@kedge-agentic/ontology-nest
v0.1.0
Published
NestJS bindings for @kedge-agentic/ontology. OntologyModule + ManifestAccessorService + ontology REST controller + actionDef→toolDefinition bridge. Consumes platform services (SessionMetadata, ToolCallerProxy) via DI port tokens so the package has zero de
Readme
@kedge-agentic/ontology-nest
@kedge-agentic/ontology 的 NestJS 适配。
类型: NestJS 绑定 · 状态: public · v0.1.0
用途
把框架无关的 @kedge-agentic/ontology 接入 NestJS:
OntologyModule— DI 接线 (controller + providers + seal hook)OntologyController—GET /api/v1/ontology/schema(ETag/304)ManifestAccessorService— per-requestManifestAccessor工厂OntologyRegistryProvider+ONTOLOGY_REGISTRYDI tokenOntologySealService— 在所有 solution-sideOnModuleInitregistrar 跑完之后,一次性OntologyRegistry.seal()compileActionToToolDefinition—ActionDef到 tool-caller proxy 可消费的ToolDefinition的桥接
Port token + 契约类型在 ./ports:
SESSION_METADATA_PORT,SessionMetadataPortTOOL_CALLER_PROXY_PORT,ToolCallerProxyPortToolDefinition,ToolInvocation,ToolResult,ToolResultContent
通过 DI port token 消费平台服务 (SessionMetadata, ToolCallerProxy),所以包在 typecheck 时对 @kedge-agentic/platform 是零依赖。 Phase 7 (2026-05-31) 从 packages/platform/src/ontology/ 抽出。
用法
@Module({
imports: [OntologyModule],
providers: [
{ provide: SESSION_METADATA_PORT, useExisting: SessionMetadataService },
{ provide: TOOL_CALLER_PROXY_PORT, useExisting: ToolCallerProxyService },
],
})
export class AppModule {}依赖
- 运行时:
@kedge-agentic/ontology - Peer:
@nestjs/common,@nestjs/core,@nestjs/swagger,reflect-metadata,zod
关联包
- @kedge-agentic/ontology — 框架无关的规格
- @kedge-agentic/workflow-nest — workflow 引擎的 NestJS 适配,姐妹包
构建 / 测试
npm run build:ontology-nest
npm test -w @kedge-agentic/ontology-nest