cordis-plugin-sofagent-fde
FDE 进场与能力流通——把企业业务梳理成 AI 能力,并让这些能力在企业内被发布、发现、调用、评价、退役(seam: non-seam:tool-set)——桥接 @sofagent/orchestrator publishCapability / @sofagent/ontology generateOntologyView / @sofagent/core restoreSnapshot——DSH(DeepSeek Harness)cordis plugin。sofagent 约束层在 DeepSeek Harness 生态的插件形态。
Install
npx skills add https://github.com/KongFangXun/sofagent/tree/main/engine/dsh-plugins/cordis-plugin-sofagent-fde
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install kongfangxun-sofagent@llmmart
git clone https://github.com/KongFangXun/sofagent.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole kongfangxun/sofagent collection as a plugin from our marketplace. Git is the plain clone.
Skill manifest
cordis-plugin-sofagent-fde
FDE 进场与能力流通——把企业业务梳理成 AI 能力,并让这些能力在企业内被发布、发现、调用、评价、退役(seam: non-seam:tool-set)
用途
装上之后:本体 / FDE / 公地三域工具面可用——查业务实体与知识条目(ontology 档 12 工具)、跑「该不该上 AI、上在哪、值多少」的方法论流程(fde 档 fde_* 七引擎)、能力的发布/发现/调用/评价/退役五环(commons 档 6 工具)。三档在 settings 各自可关(默认全开)。什么时候用:企业 AI 落地从进场梳理到能力流通的完整链路。
接入点(seam: non-seam:tool-set):多包桥接 @sofagent/orchestrator(能力公地)/ @sofagent/ontology(本体视图)/ @sofagent/core(能力回溯),缺任一依赖时其余照常(部分可用即部分成功);接入形态(声明 / 实现)见 SEAMS.md。v1.4.9 P2 合并批:本插件并入原 cordis-plugin-sofagent-ontology 与 cordis-plugin-sofagent-commons 两款薄插件的面。
本插件随 sofagent 主线版本发布(SkillHub 通道:skillhub install cordis-plugin-sofagent-fde 安装与检索;npm 通道未开通)。版本号与 sofagent 主线对齐。
相关链接
- sofagent 主仓:https://github.com/KongFangXun/sofagent
- 开发日志:docs/changelog/v1.4/v1.4.0.md(DSH 插件家族)
Files (sofagent)
-
src
-
index.test.ts 9.5 KB
// ============================================================ // cordis-plugin-sofagent-fde · 插件单测(v1.4.9 P2 合并批 · F2 厚插件验收面) // ============================================================ // 断言面 = F2 的四条硬要求: // ① 厚插件身份——seam 仍为 non-seam:tool-set,描述为合并后新文案(含三域能力流通语义) // ② 多包桥接——bridges 三包(orchestrator 真公地 API / ontology / core), // resolveBridges 可见(F1② 部分可用即部分成功) // ③ features 分档(🔴 验收硬线)——关档后该域工具**确实不注册**: // ontology/fde/commons 三档默认全开;settings 关 'false' 一档 → 该域 0 注册 // ④ 工具注册面——toolsRoles=['fde','commons'] 并集(真实 TOOLS 单一源对账) // ============================================================ import { describe, it, expect, vi, afterEach } from 'vitest'; import fs from 'node:fs'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; import pluginDefault, { pluginMeta, capability, invoke, resolveBridges } from './index'; const HERE = path.dirname(fileURLToPath(import.meta.url)); /** F2 featureGates 三档清单(与 src/index.ts、plugins.json 三处同源——测试侧独立抄写以对账) */ const GATES: Record<string, string[]> = { ontology: [ 'read_entity', 'read_concept', 'list_entities', 'list_concepts', 'create_entity', 'create_concept', 'update_entity', 'delete_entity', 'delete_concept', 'validate_ontology', 'ontology_import', 'search_knowledge', ], fde: [ 'fde_compose', 'fde_interview', 'fde_classify', 'fde_quantify', 'fde_derive', 'fde_distill', 'fde_deploy', ], commons: [ 'commons_publish', 'commons_search', 'commons_invoke', 'commons_rate', 'commons_retire', 'commons_harvest_rule', ], }; /** 造鸭子 ctx:settings 服务返回 SettingsScope 形态(get 返回当前档位表) */ function makeCtx(opts: { flags?: Record<string, string>; register: (def: { name: string }) => unknown } extends never ? never : { flags?: Record<string, string>; register: (def: { name: string }) => unknown }) { const flags = opts.flags ?? {}; return { provide: vi.fn(() => () => undefined), get: vi.fn((name: string) => { if (name === 'tools') return { register: opts.register }; return undefined; }), settings: { register: vi.fn(() => ({ get: () => ({ enabled: true, ...flags }), watch: () => () => undefined, })), }, }; } /** 造 settings 缺席的 ctx(headless 形态——档位退默认全开) */ function makeBareCtx(register: (def: { name: string }) => unknown) { return { provide: vi.fn(() => () => undefined), get: vi.fn((name: string) => { if (name === 'tools') return { register }; return undefined; }), }; } /** 必要的 schemastery 替身:settings.register 分支的 require 会拿它构造 shape——缺席走 catch 降级 */ vi.mock('@deepseek-ai/schemastery', () => ({ boolean: () => ({ __type: 'boolean' }), string: () => ({ __type: 'string' }), object: (shape: unknown) => ({ __type: 'object', shape }), })); describe('cordis-plugin-sofagent-fde(F2 厚插件)', () => { afterEach(() => { vi.restoreAllMocks(); }); it('插件元数据完整(id/version/seam/description 与 package.json SSOT 对齐)', () => { const pkg = require('../package.json') as { version: string }; expect(pluginMeta.id).toBe('cordis-plugin-sofagent-fde'); expect(pluginMeta.version).toBe(pkg.version); expect(pluginMeta.seam).toBe('non-seam:tool-set'); expect(pluginMeta.description).toContain('seam: non-seam:tool-set'); expect(pluginMeta.description).toContain('FDE 进场与能力流通'); // P2 新描述 }); it('能力说明与清单声明一致(三域能力流通语义)', () => { const manifest = require('../../plugins.json') as { plugins: Array<{ id: string; capability: string; bridges?: Array<{ pkg: string; api: string }>; toolsRoles?: string[]; featureGates?: Record<string, string[]> }>; }; const entry = manifest.plugins.find((p) => p.id === 'cordis-plugin-sofagent-fde'); expect(entry).toBeDefined(); expect(capability).toBe(entry!.capability); expect(entry!.bridges).toHaveLength(3); expect(entry!.bridges!.map((b) => `${b.pkg} ${b.api}`)).toContain('@sofagent/orchestrator publishCapability'); // 🔴 真公地 API(P2 修复点) expect(entry!.toolsRoles).toEqual(['fde', 'commons']); expect(entry!.featureGates).toBeDefined(); }); it('多包桥接:resolveBridges 三包逐个报告(部分可用即部分成功,不整挂)', async () => { const errSpy = vi.spyOn(console, 'error').mockImplementation(() => {}); const report = await resolveBridges(); // 测试环境:orchestrator/ontology/core 均可解析(workspace 直连)→ resolved ≥ 1 expect(report.resolved.length + report.failed.length).toBe(3); expect(report.resolved.map((r) => r.pkg)).toContain('@sofagent/orchestrator'); expect(report.resolved.find((r) => r.api === 'publishCapability')).toBeDefined(); errSpy.mockRestore(); }); it('invoke 可调用(成功或降级,不挂死)', async () => { const errSpy = vi.spyOn(console, 'error').mockImplementation(() => {}); const r = await invoke().catch((e) => e); expect(r).toBeDefined(); errSpy.mockRestore(); }); it('🔴 分档验收:三档默认全开——并集注册且各域工具在场(真实 TOOLS 单一源对账)', async () => { const errSpy = vi.spyOn(console, 'error').mockImplementation(() => {}); const registered: string[] = []; const ctx = makeCtx({ register: (def) => { registered.push(def.name); return () => undefined; } }); (pluginDefault.apply as (c: unknown) => unknown)(ctx); await new Promise((r) => setTimeout(r, 200)); const mcp = await import('@sofagent/mcp/tool-registry'); const union = mcp.TOOLS.filter( (t) => Array.isArray(t.roles) && (t.roles.includes('fde') || t.roles.includes('commons')) && typeof t.handler === 'function', ).map((t) => t.name); expect([...registered].sort()).toEqual([...union].sort()); // 与单一源并集逐名对齐 for (const gate of ['ontology', 'fde', 'commons'] as const) { const present = GATES[gate].filter((n) => registered.includes(n)); expect(present.length, `${gate} 档应基本在场(未带 handler 的少数除外)`).toBeGreaterThan(0); } errSpy.mockRestore(); }); it('🔴 分档验收硬线:settings 关 ontology 档 → 该域 12 工具确实不注册,其余两域照常', async () => { const errSpy = vi.spyOn(console, 'error').mockImplementation(() => {}); const registered: string[] = []; const ctx = makeCtx({ flags: { ontology: 'false' }, // 关档 register: (def) => { registered.push(def.name); return () => undefined; }, }); (pluginDefault.apply as (c: unknown) => unknown)(ctx); await new Promise((r) => setTimeout(r, 200)); for (const n of GATES.ontology) { expect(registered, `关档后 ${n} 不得注册`).not.toContain(n); } const fdePresent = GATES.fde.filter((n) => registered.includes(n)); const commonsPresent = GATES.commons.filter((n) => registered.includes(n)); expect(fdePresent.length).toBeGreaterThan(0); // 其余两域不受关档影响 expect(commonsPresent.length).toBeGreaterThan(0); errSpy.mockRestore(); }); it('🔴 分档验收:三档全关 → 并集内可注册工具为 0(显式 WARN,非静默)', async () => { const errSpy = vi.spyOn(console, 'error').mockImplementation(() => {}); const registered: string[] = []; const ctx = makeCtx({ flags: { ontology: 'false', fde: 'false', commons: 'false' }, register: (def) => { registered.push(def.name); return () => undefined; }, }); (pluginDefault.apply as (c: unknown) => unknown)(ctx); await new Promise((r) => setTimeout(r, 200)); const allGated = [...GATES.ontology, ...GATES.fde, ...GATES.commons]; expect(registered.filter((n) => allGated.includes(n))).toHaveLength(0); // 未设档的方法论支撑工具(think/compose/workflow/agent 族)不受三档影响——仍注册 expect(registered.some((n) => !allGated.includes(n))).toBe(true); errSpy.mockRestore(); }); it('分档边界:settings 服务缺席(headless)→ 档位退默认全开,注册面与全开态一致', async () => { const errSpy = vi.spyOn(console, 'error').mockImplementation(() => {}); const registered: string[] = []; const ctx = makeBareCtx((def) => { registered.push(def.name); return () => undefined; }); (pluginDefault.apply as (c: unknown) => unknown)(ctx); await new Promise((r) => setTimeout(r, 200)); const mcp = await import('@sofagent/mcp/tool-registry'); const union = mcp.TOOLS.filter( (t) => Array.isArray(t.roles) && (t.roles.includes('fde') || t.roles.includes('commons')) && typeof t.handler === 'function', ).map((t) => t.name); expect([...registered].sort()).toEqual([...union].sort()); errSpy.mockRestore(); }); it('原 -ontology / -commons / -gate 三目录已删(合并完成的落位断言)', () => { const siblings = path.resolve(HERE, '..'); expect(fs.existsSync(path.join(siblings, 'cordis-plugin-sofagent-ontology'))).toBe(false); expect(fs.existsSync(path.join(siblings, 'cordis-plugin-sofagent-commons'))).toBe(false); expect(fs.existsSync(path.join(siblings, 'cordis-plugin-sofagent-gate'))).toBe(false); }); }); -
index.ts 3.9 KB
// cordis-plugin-sofagent-fde · DSH 反向插件(v1.5.2 P2 合并批:并入 -ontology 与 -commons 面) // seam 挂载:non-seam:tool-set # 语义:非宿主事件接入(tool 集)——本体 / FDE / 公地三域工具按需调用 // 清单生成源 = engine/dsh-plugins/plugins.json(生成 package.json 的 description/sofagent/dsh 段与 cordis.patch.yml);本文件的 seam 字面量由生成器 --check 与之对账。 // // v1.5.2 P2 合并说明(F2): // 原三薄插件 -ontology(本体查询)/ -commons(能力公地)/ -fde(方法论六 tool)同为 // non-seam:tool-set 形态、桥接同一 @sofagent 能力族,拆三包徒增清单与挂载成本。 // 本插件为合并后的**厚插件**: // · 桥接面(bridges 三包,F1② 多包形态——部分可用即部分成功): // @sofagent/orchestrator publishCapability(能力公地五环——🔴 P2 修复:原 -commons // 错桥 @sofagent/audit::loadConfig,公地真 API 在 orchestrator 公共导出面) // @sofagent/ontology generateOntologyView(本体数据视图——原 -ontology 桥接原样保留) // @sofagent/core restoreSnapshot(core 兜底——原 -rollback 同族桥,作厚插件的能力回溯面) // · 工具面(toolsRoles = ['fde','commons'] 并集 + featureGates 三档分域): // ontology 档 = entity/concept/知识检索 12 工具;fde 档 = fde_* 七引擎; // commons 档 = commons_* 公地五环。三档默认全开,settings 关档即不注册该域工具。 // · 未设档的 fde 角色工具(think/compose/workflow/agent 族——方法论支撑面)常开: // 它们不属于「本体/FDE/公地」任一业务域,是三域共用的执行底座。 import { createSofagentPlugin } from '@sofagent/dsh-plugin-kit'; /** 插件声明(本文件唯一手写处;适配层红线由 kit 承担:ctx 鸭子类型 + 宿主 API 缺席降级不抛) */ const kit = createSofagentPlugin( { id: 'cordis-plugin-sofagent-fde', seam: 'non-seam:tool-set', seamSemantics: '非宿主事件接入(tool 集)——本体 / FDE / 公地三域工具按需调用(v1.4.9 P2 合并原 -ontology 与 -commons 面)', capability: 'FDE 进场与能力流通(本体底座 + 方法论引擎 + 能力公地五环)', bridgePkg: '@sofagent/orchestrator', bridgeApi: 'publishCapability', bridges: [ { pkg: '@sofagent/orchestrator', api: 'publishCapability' }, { pkg: '@sofagent/ontology', api: 'generateOntologyView' }, { pkg: '@sofagent/core', api: 'restoreSnapshot' }, ], toolsRoles: ['fde', 'commons'], featureGates: { ontology: [ 'read_entity', 'read_concept', 'list_entities', 'list_concepts', 'create_entity', 'create_concept', 'update_entity', 'delete_entity', 'delete_concept', 'validate_ontology', 'ontology_import', 'search_knowledge', ], fde: [ 'fde_compose', 'fde_interview', 'fde_classify', 'fde_quantify', 'fde_derive', 'fde_distill', 'fde_deploy', ], commons: [ 'commons_publish', 'commons_search', 'commons_invoke', 'commons_rate', 'commons_retire', 'commons_harvest_rule', ], }, description: 'FDE 进场与能力流通——把企业业务梳理成 AI 能力,并让这些能力在企业内被发布、发现、调用、评价、退役', }, require('../package.json') as { version?: string }, ); export const pluginMeta = kit.pluginMeta; // 插件元数据(DSH profile/注册表消费) export const capability = kit.capability; // 依赖的 sofagent 能力说明(DSH skill 引导链展示) export const invoke = kit.invoke; // 桥接 @sofagent/* 公共 API(懒加载 + 多包部分可用 + 降级不抛) export const resolveBridges = kit.resolveBridges; // 桥接解析报告(resolved/failed 双清单——降级可见的自省面) export default kit.plugin; // DSH Cordis 插件契约(apply 三段式由 kit 提供)
-
-
cordis.patch.yml 707 B
# sofagent cordis-plugin-sofagent-fde bundle patch v1.5.2——注册为 DSH profile layer - insert: - id: sofagent-fde name: 'cordis-plugin-sofagent-fde' inject: [settings, dynamicCordisRunner] config: seam: "non-seam:tool-set" # 语义:非宿主事件接入(tool 集)——本体 / FDE / 公地三域工具按需调用(v1.4.9 P2 合并原 -ontology 与 -commons 面) description: "FDE 进场与能力流通——把企业业务梳理成 AI 能力,并让这些能力在企业内被发布、发现、调用、评价、退役——桥接 @sofagent/orchestrator publishCapability / @sofagent/ontology generateOntologyView / @sofagent/core restoreSnapshot" -
package.json 3.3 KB
{ "name": "cordis-plugin-sofagent-fde", "version": "1.5.2", "engines": { "node": ">=18" }, "description": "FDE 进场与能力流通——把企业业务梳理成 AI 能力,并让这些能力在企业内被发布、发现、调用、评价、退役(seam: non-seam:tool-set)——桥接 @sofagent/orchestrator publishCapability / @sofagent/ontology generateOntologyView / @sofagent/core restoreSnapshot", "license": "MIT", "author": "KongFangXun", "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { "build": "tsc", "test": "vitest run src/index.test.ts" }, "keywords": [ "sofagent", "dsh", "cordis-plugin" ], "sofagent": { "type": "dsh-plugin", "family": "cordis", "seam": "non-seam:tool-set", "seamSemantics": "非宿主事件接入(tool 集)——本体 / FDE / 公地三域工具按需调用(v1.4.9 P2 合并原 -ontology 与 -commons 面)", "featureGates": { "ontology": [ "read_entity", "read_concept", "list_entities", "list_concepts", "create_entity", "create_concept", "update_entity", "delete_entity", "delete_concept", "validate_ontology", "ontology_import", "search_knowledge" ], "fde": [ "fde_compose", "fde_interview", "fde_classify", "fde_quantify", "fde_derive", "fde_distill", "fde_deploy" ], "commons": [ "commons_publish", "commons_search", "commons_invoke", "commons_rate", "commons_retire", "commons_harvest_rule" ] }, "tools": [ "get_think", "write_think", "compose", "search_knowledge", "read_entity", "read_concept", "list_entities", "read_lessons", "read_think_md", "create_entity", "create_concept", "update_entity", "delete_entity", "delete_concept", "validate_ontology", "activate_workflow", "list_agents", "list_concepts", "agent_identity", "create_agent", "fde_compose", "commons_publish", "commons_search", "commons_invoke", "commons_rate", "commons_retire", "commons_harvest_rule", "ontology_import", "fde_interview", "fde_classify", "fde_quantify", "fde_derive", "fde_distill", "fde_deploy", "trace_reconcile" ], "toolsRoles": [ "fde", "commons" ] }, "//optionalDependencies": "v1.4.5 T6 (R4):src/index.ts 惰性 await import(懒加载 + 缺依赖降级不抛;v1.4.8 起该样板由 @sofagent/dsh-plugin-kit 统一封装;v1.4.9 P2 起厚插件多包 bridges 按序解析、部分可用即部分成功),此前未声明任何依赖——对齐 root package.json F-18 optionalDependencies 先例。", "optionalDependencies": { "@sofagent/orchestrator": "1.5.2", "@sofagent/ontology": "1.5.2", "@sofagent/core": "1.5.2" }, "devDependencies": { "typescript": "^7.0.2", "vitest": "^5.0.0" }, "dsh": { "bundle": { "patch": "./cordis.patch.yml" } }, "files": [ "dist/", "cordis.patch.yml", "SKILL.md", "!dist/**/*.js.map", "!dist/**/*.d.ts.map", "!dist/**/*.test.*" ], "dependencies": { "@sofagent/dsh-plugin-kit": "1.5.2" } } -
SKILL.md 1.9 KB
--- name: cordis-plugin-sofagent-fde slug: cordis-plugin-sofagent-fde version: 1.5.2 displayName: cordis-plugin-sofagent-fde description: > FDE 进场与能力流通——把企业业务梳理成 AI 能力,并让这些能力在企业内被发布、发现、调用、评价、退役(seam: non-seam:tool-set)——桥接 @sofagent/orchestrator publishCapability / @sofagent/ontology generateOntologyView / @sofagent/core restoreSnapshot——DSH(DeepSeek Harness)cordis plugin。sofagent 约束层在 DeepSeek Harness 生态的插件形态。 --- # cordis-plugin-sofagent-fde FDE 进场与能力流通——把企业业务梳理成 AI 能力,并让这些能力在企业内被发布、发现、调用、评价、退役(seam: non-seam:tool-set) ## 用途 **装上之后**:本体 / FDE / 公地三域工具面可用——查业务实体与知识条目(ontology 档 12 工具)、跑「该不该上 AI、上在哪、值多少」的方法论流程(fde 档 fde_* 七引擎)、能力的发布/发现/调用/评价/退役五环(commons 档 6 工具)。三档在 settings 各自可关(默认全开)。**什么时候用**:企业 AI 落地从进场梳理到能力流通的完整链路。 **接入点**(seam: non-seam:tool-set):多包桥接 `@sofagent/orchestrator`(能力公地)/ `@sofagent/ontology`(本体视图)/ `@sofagent/core`(能力回溯),缺任一依赖时其余照常(部分可用即部分成功);接入形态(声明 / 实现)见 [SEAMS.md](../SEAMS.md)。v1.4.9 P2 合并批:本插件并入原 cordis-plugin-sofagent-ontology 与 cordis-plugin-sofagent-commons 两款薄插件的面。 本插件随 sofagent 主线版本发布(SkillHub 通道:`skillhub install cordis-plugin-sofagent-fde` 安装与检索;npm 通道未开通)。版本号与 sofagent 主线对齐。 ## 相关链接 - sofagent 主仓:https://github.com/KongFangXun/sofagent - 开发日志:docs/changelog/v1.4/v1.4.0.md(DSH 插件家族) -
tsconfig.json 185 B
{ "extends": "../tsconfig.base.json", "compilerOptions": { "rootDir": "src", "outDir": "dist" }, "include": [ "src" ], "exclude": [ "src/**/*.test.ts" ] }
Comments (0)
Sign in to join the conversation.
Reviews (0)
No reviews yet.
No comments yet.