npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@kedge-agentic/context-layer-core

v0.2.0

Published

Framework-free core of @kedge-agentic/context-layer. Entity registry, document edit provider, recommend/router/injector primitives, and the HTTP client SDK. Zero NestJS coupling — agent subprocesses, CLI tools, browsers, and NestJS services can all consum

Readme

@kedge-agentic/context-layer-core

Context layer 的框架无关核心: entity registry / document edit provider / recommend/router/injector 原语 / HTTP 客户端 SDK。

类型: 框架无关库 · 状态: public · v0.2.0

用途

AI chat UI 的 "@-mention" context layer — 让用户在对话中引用 entity (菜谱、教案等),并让 AI agent 把相关 entity 上下文注入到 prompt 里。 Solution backend 按 entity 类型注册 DocumentEditProvider 实现; framework 处理 browse / search / 解析 / 推荐 / 编辑应用。

零 NestJS 耦合。 Agent 子进程、CLI 工具、浏览器、NestJS 服务都能用。

主要导出

import {
  EntityRegistry,
  RelationInferrer,
  ActivityEmitter,
  RecommendEngine,
  ContextInjector,
  ContextRouter,
  ShortcutManager,
  DocumentEditProvider,
  referenceableOptionsToPicker,
  pickerToReferenceableOptions,
  createSingleSlotManifestAccessor,
  // 再导出的 interface
  OrmAdapter,
  CacheStore,
  EntityBrowseProvider,
  BrowseResponse,
  SearchResponse,
  ResolveResponse,
  EditOperation,
  EntityRef,
  AtReference,
  // 根方便再导出
  ContextLayerClient,
} from '@kedge-agentic/context-layer-core'

// 新代码推荐用 subpath
import { ContextLayerClient } from '@kedge-agentic/context-layer-core/client'

用法

// 在 solution backend 里
export class RecipeProvider implements DocumentEditProvider<Recipe> {
  async load(id: string): Promise<Recipe> { ... }
  async applyEdit(entity: Recipe, op: EditOperation): Promise<Recipe> { ... }
  async save(entity: Recipe): Promise<void> { ... }
}

const registry = new EntityRegistry()
registry.register('recipe', new RecipeProvider())

依赖

  • 运行时: @kedge-agentic/entity-document, @kedge-agentic/ontology
  • 无 peerDeps

关联包

Phase 2 (2026-05-31) 从原 @kedge-agentic/context-layer wrapper 拆出。

构建 / 测试

npm run build:context-layer-core
npm test -w @kedge-agentic/context-layer-core