@coralai/sps-cli 0.66.8 → 0.67.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/assembly/art.yml +6 -0
- package/assembly/base.yml +72 -0
- package/assembly/cli.yml +4 -0
- package/assembly/console.yml +4 -0
- package/assembly/daemon.yml +4 -0
- package/dist/commands/agentCommand.d.ts +22 -1
- package/dist/commands/agentCommand.d.ts.map +1 -1
- package/dist/commands/agentCommand.js +14 -15
- package/dist/commands/agentCommand.js.map +1 -1
- package/dist/commands/cardAdd.d.ts +14 -1
- package/dist/commands/cardAdd.d.ts.map +1 -1
- package/dist/commands/cardAdd.js +5 -13
- package/dist/commands/cardAdd.js.map +1 -1
- package/dist/commands/cardInsert.d.ts +19 -1
- package/dist/commands/cardInsert.d.ts.map +1 -1
- package/dist/commands/cardInsert.js +5 -18
- package/dist/commands/cardInsert.js.map +1 -1
- package/dist/commands/consoleCommand.d.ts +20 -1
- package/dist/commands/consoleCommand.d.ts.map +1 -1
- package/dist/commands/consoleCommand.js +5 -2
- package/dist/commands/consoleCommand.js.map +1 -1
- package/dist/commands/imCommand.d.ts +9 -1
- package/dist/commands/imCommand.d.ts.map +1 -1
- package/dist/commands/imCommand.js +2 -9
- package/dist/commands/imCommand.js.map +1 -1
- package/dist/commands/memoryCommand.d.ts +11 -1
- package/dist/commands/memoryCommand.d.ts.map +1 -1
- package/dist/commands/memoryCommand.js +12 -18
- package/dist/commands/memoryCommand.js.map +1 -1
- package/dist/commands/monitorTick.d.ts +24 -1
- package/dist/commands/monitorTick.d.ts.map +1 -1
- package/dist/commands/monitorTick.js +8 -4
- package/dist/commands/monitorTick.js.map +1 -1
- package/dist/commands/openaiAgent.d.ts +2 -1
- package/dist/commands/openaiAgent.d.ts.map +1 -1
- package/dist/commands/openaiAgent.js +7 -3
- package/dist/commands/openaiAgent.js.map +1 -1
- package/dist/commands/pipelineTick.d.ts +4 -1
- package/dist/commands/pipelineTick.d.ts.map +1 -1
- package/dist/commands/pipelineTick.js +11 -7
- package/dist/commands/pipelineTick.js.map +1 -1
- package/dist/commands/pluginCommand.d.ts +2 -0
- package/dist/commands/pluginCommand.d.ts.map +1 -0
- package/dist/commands/pluginCommand.js +160 -0
- package/dist/commands/pluginCommand.js.map +1 -0
- package/dist/commands/qaTick.d.ts +4 -1
- package/dist/commands/qaTick.d.ts.map +1 -1
- package/dist/commands/qaTick.js +11 -7
- package/dist/commands/qaTick.js.map +1 -1
- package/dist/commands/schedulerTick.d.ts +24 -1
- package/dist/commands/schedulerTick.d.ts.map +1 -1
- package/dist/commands/schedulerTick.js +5 -23
- package/dist/commands/schedulerTick.js.map +1 -1
- package/dist/commands/tick.d.ts +25 -2
- package/dist/commands/tick.d.ts.map +1 -1
- package/dist/commands/tick.js +39 -16
- package/dist/commands/tick.js.map +1 -1
- package/dist/commands/workerLaunch.d.ts +4 -1
- package/dist/commands/workerLaunch.d.ts.map +1 -1
- package/dist/commands/workerLaunch.js +11 -7
- package/dist/commands/workerLaunch.js.map +1 -1
- package/dist/console/index.d.ts +21 -0
- package/dist/console/index.d.ts.map +1 -1
- package/dist/console/index.js +8 -4
- package/dist/console/index.js.map +1 -1
- package/dist/console/routes/capabilities.d.ts +3 -0
- package/dist/console/routes/capabilities.d.ts.map +1 -1
- package/dist/console/routes/capabilities.js +2 -21
- package/dist/console/routes/capabilities.js.map +1 -1
- package/dist/console/routes/cards.d.ts +19 -0
- package/dist/console/routes/cards.d.ts.map +1 -1
- package/dist/console/routes/cards.js +1 -1
- package/dist/console/routes/cards.js.map +1 -1
- package/dist/console/routes/mcpTools.d.ts +2 -1
- package/dist/console/routes/mcpTools.d.ts.map +1 -1
- package/dist/console/routes/mcpTools.js +3 -8
- package/dist/console/routes/mcpTools.js.map +1 -1
- package/dist/console/routes/plugins.d.ts +20 -0
- package/dist/console/routes/plugins.d.ts.map +1 -0
- package/dist/console/routes/plugins.js +185 -0
- package/dist/console/routes/plugins.js.map +1 -0
- package/dist/console/routes/tts.d.ts +2 -1
- package/dist/console/routes/tts.d.ts.map +1 -1
- package/dist/console/routes/tts.js +2 -3
- package/dist/console/routes/tts.js.map +1 -1
- package/dist/console-assets/assets/{ShowcasePage-C8tqVK7m.js → ShowcasePage-3ekOTV_g.js} +1 -1
- package/dist/console-assets/assets/{index-DCKXZKta.css → index-Dd7MTFgX.css} +1 -1
- package/dist/console-assets/assets/{index-DAvJ1-Qg.js → index-o3svZ9mC.js} +223 -213
- package/dist/console-assets/index.html +2 -2
- package/dist/core/agents/resolveBackend.d.ts +0 -5
- package/dist/core/agents/resolveBackend.d.ts.map +1 -1
- package/dist/core/agents/resolveBackend.js +6 -52
- package/dist/core/agents/resolveBackend.js.map +1 -1
- package/dist/core/art/artRunService.d.ts +13 -1
- package/dist/core/art/artRunService.d.ts.map +1 -1
- package/dist/core/art/artRunService.js +1 -0
- package/dist/core/art/artRunService.js.map +1 -1
- package/dist/core/mcpToolCatalog.d.ts +14 -1
- package/dist/core/mcpToolCatalog.d.ts.map +1 -1
- package/dist/core/mcpToolCatalog.js +7 -11
- package/dist/core/mcpToolCatalog.js.map +1 -1
- package/dist/core/tools/ToolCardExecutor.d.ts +12 -2
- package/dist/core/tools/ToolCardExecutor.d.ts.map +1 -1
- package/dist/core/tools/ToolCardExecutor.js.map +1 -1
- package/dist/daemon/daemonClient.d.ts +8 -2
- package/dist/daemon/daemonClient.d.ts.map +1 -1
- package/dist/daemon/daemonClient.js +9 -0
- package/dist/daemon/daemonClient.js.map +1 -1
- package/dist/daemon/sessionDaemon.d.ts +7 -2
- package/dist/daemon/sessionDaemon.d.ts.map +1 -1
- package/dist/daemon/sessionDaemon.js +49 -10
- package/dist/daemon/sessionDaemon.js.map +1 -1
- package/dist/engines/StageEngine.d.ts +6 -1
- package/dist/engines/StageEngine.d.ts.map +1 -1
- package/dist/engines/StageEngine.js +10 -7
- package/dist/engines/StageEngine.js.map +1 -1
- package/dist/im/IMGatewayManager.d.ts +12 -0
- package/dist/im/IMGatewayManager.d.ts.map +1 -1
- package/dist/im/IMGatewayManager.js +10 -18
- package/dist/im/IMGatewayManager.js.map +1 -1
- package/dist/main.js +67 -21
- package/dist/main.js.map +1 -1
- package/dist/manager/makeBackendFactory.d.ts +12 -0
- package/dist/manager/makeBackendFactory.d.ts.map +1 -1
- package/dist/manager/makeBackendFactory.js +3 -2
- package/dist/manager/makeBackendFactory.js.map +1 -1
- package/dist/manager/worker-manager-impl.d.ts +19 -0
- package/dist/manager/worker-manager-impl.d.ts.map +1 -1
- package/dist/manager/worker-manager-impl.js +15 -15
- package/dist/manager/worker-manager-impl.js.map +1 -1
- package/dist/openai-agent/memory/v2Bridge.d.ts +28 -2
- package/dist/openai-agent/memory/v2Bridge.d.ts.map +1 -1
- package/dist/openai-agent/memory/v2Bridge.js +4 -20
- package/dist/openai-agent/memory/v2Bridge.js.map +1 -1
- package/dist/openai-agent/runWorker.d.ts +8 -6
- package/dist/openai-agent/runWorker.d.ts.map +1 -1
- package/dist/openai-agent/runWorker.js +5 -4
- package/dist/openai-agent/runWorker.js.map +1 -1
- package/dist/openai-agent/sandbox/execution.d.ts +10 -2
- package/dist/openai-agent/sandbox/execution.d.ts.map +1 -1
- package/dist/openai-agent/sandbox/execution.js +9 -6
- package/dist/openai-agent/sandbox/execution.js.map +1 -1
- package/dist/plugin/assembly.d.ts +37 -0
- package/dist/plugin/assembly.d.ts.map +1 -0
- package/dist/plugin/assembly.js +95 -0
- package/dist/plugin/assembly.js.map +1 -0
- package/dist/plugin/context.d.ts +101 -0
- package/dist/plugin/context.d.ts.map +1 -0
- package/dist/plugin/context.js +187 -0
- package/dist/plugin/context.js.map +1 -0
- package/dist/plugin/hot.d.ts +34 -0
- package/dist/plugin/hot.d.ts.map +1 -0
- package/dist/plugin/hot.js +62 -0
- package/dist/plugin/hot.js.map +1 -0
- package/dist/plugin/layers.d.ts +40 -0
- package/dist/plugin/layers.d.ts.map +1 -0
- package/dist/plugin/layers.js +101 -0
- package/dist/plugin/layers.js.map +1 -0
- package/dist/plugin/manager.d.ts +80 -0
- package/dist/plugin/manager.d.ts.map +1 -0
- package/dist/plugin/manager.js +202 -0
- package/dist/plugin/manager.js.map +1 -0
- package/dist/plugin/run.d.ts +53 -0
- package/dist/plugin/run.d.ts.map +1 -0
- package/dist/plugin/run.js +72 -0
- package/dist/plugin/run.js.map +1 -0
- package/dist/providers/art/artGen.d.ts +18 -3
- package/dist/providers/art/artGen.d.ts.map +1 -1
- package/dist/providers/art/artGen.js +15 -15
- package/dist/providers/art/artGen.js.map +1 -1
- package/dist/providers/art/artRunChild.d.ts +2 -1
- package/dist/providers/art/artRunChild.d.ts.map +1 -1
- package/dist/providers/art/artRunChild.js +15 -8
- package/dist/providers/art/artRunChild.js.map +1 -1
- package/dist/providers/llm/chatTools.d.ts +10 -1
- package/dist/providers/llm/chatTools.d.ts.map +1 -1
- package/dist/providers/llm/chatTools.js +4 -4
- package/dist/providers/llm/chatTools.js.map +1 -1
- package/dist/providers/mcp/spsMcpServer.d.ts +3 -0
- package/dist/providers/mcp/spsMcpServer.d.ts.map +1 -1
- package/dist/providers/mcp/spsMcpServer.js +25 -31
- package/dist/providers/mcp/spsMcpServer.js.map +1 -1
- package/dist/providers/mcp/spsMcpStdio.js +12 -1
- package/dist/providers/mcp/spsMcpStdio.js.map +1 -1
- package/dist/providers/media/generateAsset.d.ts +11 -0
- package/dist/providers/media/generateAsset.d.ts.map +1 -1
- package/dist/providers/media/generateAsset.js +2 -3
- package/dist/providers/media/generateAsset.js.map +1 -1
- package/dist/providers/registry.d.ts +0 -4
- package/dist/providers/registry.d.ts.map +1 -1
- package/dist/providers/registry.js +1 -14
- package/dist/providers/registry.js.map +1 -1
- package/dist/seams/agents/index.d.ts +49 -0
- package/dist/seams/agents/index.d.ts.map +1 -0
- package/dist/seams/agents/index.js +54 -0
- package/dist/seams/agents/index.js.map +1 -0
- package/dist/seams/agents-builtin/index.d.ts +19 -0
- package/dist/seams/agents-builtin/index.d.ts.map +1 -0
- package/dist/seams/agents-builtin/index.js +69 -0
- package/dist/seams/agents-builtin/index.js.map +1 -0
- package/dist/seams/capabilities/index.d.ts +39 -0
- package/dist/seams/capabilities/index.d.ts.map +1 -0
- package/dist/seams/capabilities/index.js +47 -0
- package/dist/seams/capabilities/index.js.map +1 -0
- package/dist/seams/capabilities-art/index.d.ts +14 -0
- package/dist/seams/capabilities-art/index.d.ts.map +1 -0
- package/dist/seams/capabilities-art/index.js +9 -0
- package/dist/seams/capabilities-art/index.js.map +1 -0
- package/dist/seams/im/index.d.ts +28 -0
- package/dist/seams/im/index.d.ts.map +1 -0
- package/dist/seams/im/index.js +36 -0
- package/dist/seams/im/index.js.map +1 -0
- package/dist/seams/im-builtin/index.d.ts +13 -0
- package/dist/seams/im-builtin/index.d.ts.map +1 -0
- package/dist/seams/im-builtin/index.js +25 -0
- package/dist/seams/im-builtin/index.js.map +1 -0
- package/dist/seams/media/index.d.ts +30 -0
- package/dist/seams/media/index.d.ts.map +1 -0
- package/dist/seams/media/index.js +38 -0
- package/dist/seams/media/index.js.map +1 -0
- package/dist/seams/media-builtin/index.d.ts +13 -0
- package/dist/seams/media-builtin/index.d.ts.map +1 -0
- package/dist/seams/media-builtin/index.js +10 -0
- package/dist/seams/media-builtin/index.js.map +1 -0
- package/dist/seams/memory/index.d.ts +58 -0
- package/dist/seams/memory/index.d.ts.map +1 -0
- package/dist/seams/memory/index.js +28 -0
- package/dist/seams/memory/index.js.map +1 -0
- package/dist/seams/memory-local/index.d.ts +31 -0
- package/dist/seams/memory-local/index.d.ts.map +1 -0
- package/dist/seams/memory-local/index.js +55 -0
- package/dist/seams/memory-local/index.js.map +1 -0
- package/dist/seams/notifier/index.d.ts +37 -0
- package/dist/seams/notifier/index.d.ts.map +1 -0
- package/dist/seams/notifier/index.js +30 -0
- package/dist/seams/notifier/index.js.map +1 -0
- package/dist/seams/notifier-matrix/index.d.ts +17 -0
- package/dist/seams/notifier-matrix/index.d.ts.map +1 -0
- package/dist/seams/notifier-matrix/index.js +8 -0
- package/dist/seams/notifier-matrix/index.js.map +1 -0
- package/dist/seams/notifier-none/index.d.ts +18 -0
- package/dist/seams/notifier-none/index.d.ts.map +1 -0
- package/dist/seams/notifier-none/index.js +14 -0
- package/dist/seams/notifier-none/index.js.map +1 -0
- package/dist/seams/repo/index.d.ts +38 -0
- package/dist/seams/repo/index.d.ts.map +1 -0
- package/dist/seams/repo/index.js +43 -0
- package/dist/seams/repo/index.js.map +1 -0
- package/dist/seams/repo-builtin/index.d.ts +14 -0
- package/dist/seams/repo-builtin/index.d.ts.map +1 -0
- package/dist/seams/repo-builtin/index.js +14 -0
- package/dist/seams/repo-builtin/index.js.map +1 -0
- package/dist/seams/tools/index.d.ts +83 -0
- package/dist/seams/tools/index.d.ts.map +1 -0
- package/dist/seams/tools/index.js +67 -0
- package/dist/seams/tools/index.js.map +1 -0
- package/dist/services/MemoryService.d.ts +12 -0
- package/dist/services/MemoryService.d.ts.map +1 -1
- package/dist/services/MemoryService.js +14 -18
- package/dist/services/MemoryService.js.map +1 -1
- package/dist/services/container.d.ts +20 -1
- package/dist/services/container.d.ts.map +1 -1
- package/dist/services/container.js +10 -3
- package/dist/services/container.js.map +1 -1
- package/dist/services/executors.d.ts +4 -0
- package/dist/services/executors.d.ts.map +1 -1
- package/dist/services/executors.js +27 -5
- package/dist/services/executors.js.map +1 -1
- package/dist/services/promptPreview.d.ts +14 -1
- package/dist/services/promptPreview.d.ts.map +1 -1
- package/dist/services/promptPreview.js +4 -3
- package/dist/services/promptPreview.js.map +1 -1
- package/package.json +16 -3
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module seams/capabilities
|
|
3
|
+
* @description **工具卡能力注册表 seam** —— 插件把能力注册进来,工具卡按 id 调。
|
|
4
|
+
*
|
|
5
|
+
* @layer seam
|
|
6
|
+
*
|
|
7
|
+
* 类型:**乙 · 注册表型**。它本来就是注册表(`core/tools/registry`),
|
|
8
|
+
* 这一层只是把它**变成一个可被插件写入的服务**。
|
|
9
|
+
*
|
|
10
|
+
* 🔴 **改的是"谁能往里加",不是注册表本身。**
|
|
11
|
+
* 之前每跑一张工具卡就 `new CapabilityRegistry(artCapabilities())` —— 一个**每次重建、
|
|
12
|
+
* 只装内建**的注册表,插件根本插不进去。现在它是进程级服务,装配档决定谁往里注册。
|
|
13
|
+
*
|
|
14
|
+
* ⚠️ **script 层能力从这里进**:`Capability.source` 已经预留了
|
|
15
|
+
* `{ kind: 'script', template, script }`。那条路一直被 template.json 未落地挡着;
|
|
16
|
+
* 插件化之后它的载体就是这个注册表 —— 一个模板包插件把自己的脚本能力注册进来。
|
|
17
|
+
*/
|
|
18
|
+
import { type Context, Service } from '@deepseek-ai/cordis';
|
|
19
|
+
import type { Capability } from '../../core/tools/registry.js';
|
|
20
|
+
export declare const CAPABILITIES = "sps.capabilities";
|
|
21
|
+
export default class CapabilitySeam extends Service {
|
|
22
|
+
private readonly byId;
|
|
23
|
+
constructor(ctx: Context);
|
|
24
|
+
/**
|
|
25
|
+
* 注册一个能力。**返回注销函数**,调用方包进 `ctx.effect`。
|
|
26
|
+
*
|
|
27
|
+
* 🔴 重名**抛错**不是覆盖 —— 静默覆盖会让"我调的是哪一个 art.resize"无从判断
|
|
28
|
+
* (与 `core/tools/registry` 原本的判据一致)。
|
|
29
|
+
*/
|
|
30
|
+
register(cap: Capability): () => void;
|
|
31
|
+
get(id: string): Capability | undefined;
|
|
32
|
+
list(): Capability[];
|
|
33
|
+
}
|
|
34
|
+
declare module '@deepseek-ai/cordis' {
|
|
35
|
+
interface Context {
|
|
36
|
+
'sps.capabilities': CapabilitySeam;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/seams/capabilities/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,KAAK,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE/D,eAAO,MAAM,YAAY,qBAAqB,CAAC;AAE/C,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,OAAO;IACjD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAiC;gBAE1C,GAAG,EAAE,OAAO;IAIxB;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE,UAAU,GAAG,MAAM,IAAI;IAQrC,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAIvC,IAAI,IAAI,UAAU,EAAE;CAGrB;AAED,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,OAAO;QACf,kBAAkB,EAAE,cAAc,CAAC;KACpC;CACF"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module seams/capabilities
|
|
3
|
+
* @description **工具卡能力注册表 seam** —— 插件把能力注册进来,工具卡按 id 调。
|
|
4
|
+
*
|
|
5
|
+
* @layer seam
|
|
6
|
+
*
|
|
7
|
+
* 类型:**乙 · 注册表型**。它本来就是注册表(`core/tools/registry`),
|
|
8
|
+
* 这一层只是把它**变成一个可被插件写入的服务**。
|
|
9
|
+
*
|
|
10
|
+
* 🔴 **改的是"谁能往里加",不是注册表本身。**
|
|
11
|
+
* 之前每跑一张工具卡就 `new CapabilityRegistry(artCapabilities())` —— 一个**每次重建、
|
|
12
|
+
* 只装内建**的注册表,插件根本插不进去。现在它是进程级服务,装配档决定谁往里注册。
|
|
13
|
+
*
|
|
14
|
+
* ⚠️ **script 层能力从这里进**:`Capability.source` 已经预留了
|
|
15
|
+
* `{ kind: 'script', template, script }`。那条路一直被 template.json 未落地挡着;
|
|
16
|
+
* 插件化之后它的载体就是这个注册表 —— 一个模板包插件把自己的脚本能力注册进来。
|
|
17
|
+
*/
|
|
18
|
+
import { Service } from '@deepseek-ai/cordis';
|
|
19
|
+
export const CAPABILITIES = 'sps.capabilities';
|
|
20
|
+
export default class CapabilitySeam extends Service {
|
|
21
|
+
byId = new Map();
|
|
22
|
+
constructor(ctx) {
|
|
23
|
+
super(ctx, CAPABILITIES);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 注册一个能力。**返回注销函数**,调用方包进 `ctx.effect`。
|
|
27
|
+
*
|
|
28
|
+
* 🔴 重名**抛错**不是覆盖 —— 静默覆盖会让"我调的是哪一个 art.resize"无从判断
|
|
29
|
+
* (与 `core/tools/registry` 原本的判据一致)。
|
|
30
|
+
*/
|
|
31
|
+
register(cap) {
|
|
32
|
+
if (this.byId.has(cap.id))
|
|
33
|
+
throw new Error(`能力 id 重复:${cap.id}`);
|
|
34
|
+
this.byId.set(cap.id, cap);
|
|
35
|
+
return () => {
|
|
36
|
+
if (this.byId.get(cap.id) === cap)
|
|
37
|
+
this.byId.delete(cap.id);
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
get(id) {
|
|
41
|
+
return this.byId.get(id);
|
|
42
|
+
}
|
|
43
|
+
list() {
|
|
44
|
+
return [...this.byId.values()].sort((a, b) => a.id.localeCompare(b.id));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/seams/capabilities/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAgB,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAG5D,MAAM,CAAC,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAE/C,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,OAAO;IAChC,IAAI,GAAG,IAAI,GAAG,EAAsB,CAAC;IAEtD,YAAY,GAAY;QACtB,KAAK,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;IAC3B,CAAC;IAED;;;;;OAKG;IACH,QAAQ,CAAC,GAAe;QACtB,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,YAAY,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;QACjE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;QAC3B,OAAO,GAAG,EAAE;YACV,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,GAAG;gBAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC9D,CAAC,CAAC;IACJ,CAAC;IAED,GAAG,CAAC,EAAU;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC;IAED,IAAI;QACF,OAAO,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1E,CAAC;CACF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module seams/capabilities-art
|
|
3
|
+
* @description 把十个内建 art 能力注册进 `sps.capabilities`。
|
|
4
|
+
*
|
|
5
|
+
* @layer seam
|
|
6
|
+
*
|
|
7
|
+
* ⚠️ 能力本身(取参/围栏/落盘)不动,仍在 `core/tools/artCapabilities` ——
|
|
8
|
+
* 这一步只搬**注册方式**。
|
|
9
|
+
*/
|
|
10
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
11
|
+
export declare const name = "sps-capabilities-art";
|
|
12
|
+
export declare const inject: string[];
|
|
13
|
+
export declare function apply(ctx: Context): void;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/seams/capabilities-art/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAInD,eAAO,MAAM,IAAI,yBAAyB,CAAC;AAC3C,eAAO,MAAM,MAAM,UAAiB,CAAC;AAErC,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAExC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { artCapabilities } from '../../core/tools/artCapabilities.js';
|
|
2
|
+
import { CAPABILITIES } from '../capabilities/index.js';
|
|
3
|
+
export const name = 'sps-capabilities-art';
|
|
4
|
+
export const inject = [CAPABILITIES];
|
|
5
|
+
export function apply(ctx) {
|
|
6
|
+
for (const cap of artCapabilities())
|
|
7
|
+
ctx.effect(() => ctx[CAPABILITIES].register(cap));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/seams/capabilities-art/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,MAAM,CAAC,MAAM,IAAI,GAAG,sBAAsB,CAAC;AAC3C,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,YAAY,CAAC,CAAC;AAErC,MAAM,UAAU,KAAK,CAAC,GAAY;IAChC,KAAK,MAAM,GAAG,IAAI,eAAe,EAAE;QAAE,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;AACzF,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module seams/im
|
|
3
|
+
* @description **IM 平台适配器注册表 seam** —— telegram / 钉钉 / matrix / slack …
|
|
4
|
+
*
|
|
5
|
+
* @layer seam
|
|
6
|
+
*
|
|
7
|
+
* 类型:**乙 · 注册表型**。与 `sps.media` 同一条判据:
|
|
8
|
+
* 🔴 **seam 在 adapter,不在实例。**
|
|
9
|
+
* "配了哪几个机器人、各自什么 token"是**数据**,落 `~/.coral/im/config.json`
|
|
10
|
+
* (含密,0600,已有测试锁着);而"支持哪些平台"是一张写死在
|
|
11
|
+
* `IMGatewayManager.REGISTRY` 里的表 —— 加一个平台必须改内核。痛在这儿。
|
|
12
|
+
*/
|
|
13
|
+
import { type Context, Service } from '@deepseek-ai/cordis';
|
|
14
|
+
import type { IMAdapterFactory } from '../../im/IMAdapter.js';
|
|
15
|
+
export declare const IM = "sps.im";
|
|
16
|
+
export default class IMAdapterRegistry extends Service {
|
|
17
|
+
private readonly byKind;
|
|
18
|
+
constructor(ctx: Context);
|
|
19
|
+
register(kind: string, factory: IMAdapterFactory): () => void;
|
|
20
|
+
get(kind: string): IMAdapterFactory | undefined;
|
|
21
|
+
list(): string[];
|
|
22
|
+
}
|
|
23
|
+
declare module '@deepseek-ai/cordis' {
|
|
24
|
+
interface Context {
|
|
25
|
+
'sps.im': IMAdapterRegistry;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/seams/im/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,KAAK,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,eAAO,MAAM,EAAE,WAAW,CAAC;AAE3B,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,OAAO;IACpD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuC;gBAElD,GAAG,EAAE,OAAO;IAIxB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,GAAG,MAAM,IAAI;IAQ7D,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS;IAI/C,IAAI,IAAI,MAAM,EAAE;CAGjB;AAED,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,OAAO;QACf,QAAQ,EAAE,iBAAiB,CAAC;KAC7B;CACF"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module seams/im
|
|
3
|
+
* @description **IM 平台适配器注册表 seam** —— telegram / 钉钉 / matrix / slack …
|
|
4
|
+
*
|
|
5
|
+
* @layer seam
|
|
6
|
+
*
|
|
7
|
+
* 类型:**乙 · 注册表型**。与 `sps.media` 同一条判据:
|
|
8
|
+
* 🔴 **seam 在 adapter,不在实例。**
|
|
9
|
+
* "配了哪几个机器人、各自什么 token"是**数据**,落 `~/.coral/im/config.json`
|
|
10
|
+
* (含密,0600,已有测试锁着);而"支持哪些平台"是一张写死在
|
|
11
|
+
* `IMGatewayManager.REGISTRY` 里的表 —— 加一个平台必须改内核。痛在这儿。
|
|
12
|
+
*/
|
|
13
|
+
import { Service } from '@deepseek-ai/cordis';
|
|
14
|
+
export const IM = 'sps.im';
|
|
15
|
+
export default class IMAdapterRegistry extends Service {
|
|
16
|
+
byKind = new Map();
|
|
17
|
+
constructor(ctx) {
|
|
18
|
+
super(ctx, IM);
|
|
19
|
+
}
|
|
20
|
+
register(kind, factory) {
|
|
21
|
+
if (this.byKind.has(kind))
|
|
22
|
+
throw new Error(`IM 平台 kind 重复:${kind}`);
|
|
23
|
+
this.byKind.set(kind, factory);
|
|
24
|
+
return () => {
|
|
25
|
+
if (this.byKind.get(kind) === factory)
|
|
26
|
+
this.byKind.delete(kind);
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
get(kind) {
|
|
30
|
+
return this.byKind.get(kind);
|
|
31
|
+
}
|
|
32
|
+
list() {
|
|
33
|
+
return [...this.byKind.keys()].sort();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/seams/im/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAgB,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAG5D,MAAM,CAAC,MAAM,EAAE,GAAG,QAAQ,CAAC;AAE3B,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,OAAO;IACnC,MAAM,GAAG,IAAI,GAAG,EAA4B,CAAC;IAE9D,YAAY,GAAY;QACtB,KAAK,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACjB,CAAC;IAED,QAAQ,CAAC,IAAY,EAAE,OAAyB;QAC9C,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;QACpE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC/B,OAAO,GAAG,EAAE;YACV,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,OAAO;gBAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAClE,CAAC,CAAC;IACJ,CAAC;IAED,GAAG,CAAC,IAAY;QACd,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED,IAAI;QACF,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACxC,CAAC;CACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module seams/im-builtin
|
|
3
|
+
* @description 内建的六个 IM 平台注册进 `sps.im`。
|
|
4
|
+
*
|
|
5
|
+
* @layer seam
|
|
6
|
+
*
|
|
7
|
+
* ⚠️ 适配器实现不动,仍在 `im/adapters/` —— 这一步只搬**注册方式**。
|
|
8
|
+
*/
|
|
9
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
10
|
+
export declare const name = "sps-im-builtin";
|
|
11
|
+
export declare const inject: string[];
|
|
12
|
+
export declare function apply(ctx: Context): void;
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/seams/im-builtin/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAUnD,eAAO,MAAM,IAAI,mBAAmB,CAAC;AACrC,eAAO,MAAM,MAAM,UAAO,CAAC;AAa3B,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAIxC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { DingTalkAdapter } from '../../im/adapters/dingtalkAdapter.js';
|
|
2
|
+
import { DiscordAdapter } from '../../im/adapters/discordAdapter.js';
|
|
3
|
+
import { FeishuAdapter } from '../../im/adapters/feishuAdapter.js';
|
|
4
|
+
import { MatrixAdapter } from '../../im/adapters/matrixAdapter.js';
|
|
5
|
+
import { SlackAdapter } from '../../im/adapters/slackAdapter.js';
|
|
6
|
+
import { TelegramAdapter } from '../../im/adapters/telegramAdapter.js';
|
|
7
|
+
import { IM } from '../im/index.js';
|
|
8
|
+
export const name = 'sps-im-builtin';
|
|
9
|
+
export const inject = [IM];
|
|
10
|
+
// biome-ignore-start lint/suspicious/noExplicitAny: 各适配器的 cfg 形状不同,原样沿用既有写法
|
|
11
|
+
const BUILT_IN = {
|
|
12
|
+
telegram: (cfg) => new TelegramAdapter(cfg),
|
|
13
|
+
dingtalk: (cfg) => new DingTalkAdapter(cfg),
|
|
14
|
+
matrix: (cfg) => new MatrixAdapter(cfg),
|
|
15
|
+
slack: (cfg) => new SlackAdapter(cfg),
|
|
16
|
+
discord: (cfg) => new DiscordAdapter(cfg),
|
|
17
|
+
feishu: (cfg) => new FeishuAdapter(cfg),
|
|
18
|
+
};
|
|
19
|
+
// biome-ignore-end lint/suspicious/noExplicitAny: 见上
|
|
20
|
+
export function apply(ctx) {
|
|
21
|
+
for (const [kind, factory] of Object.entries(BUILT_IN)) {
|
|
22
|
+
ctx.effect(() => ctx[IM].register(kind, factory));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/seams/im-builtin/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAEvE,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAEpC,MAAM,CAAC,MAAM,IAAI,GAAG,gBAAgB,CAAC;AACrC,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC;AAE3B,4EAA4E;AAC5E,MAAM,QAAQ,GAAqC;IACjD,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,eAAe,CAAC,GAAU,CAAC;IAClD,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,eAAe,CAAC,GAAU,CAAC;IAClD,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,aAAa,CAAC,GAAU,CAAC;IAC9C,KAAK,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,YAAY,CAAC,GAAU,CAAC;IAC5C,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,cAAc,CAAC,GAAU,CAAC;IAChD,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,aAAa,CAAC,GAAU,CAAC;CAC/C,CAAC;AACF,qDAAqD;AAErD,MAAM,UAAU,KAAK,CAAC,GAAY;IAChC,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QACvD,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IACpD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module seams/media
|
|
3
|
+
* @description **媒体适配器注册表 seam** —— 生图/生视频/TTS 各家厂商的调用适配。
|
|
4
|
+
*
|
|
5
|
+
* @layer seam
|
|
6
|
+
*
|
|
7
|
+
* 类型:**乙 · 注册表型**。
|
|
8
|
+
*
|
|
9
|
+
* 🔴 **seam 的位置在 adapter,不在 provider。**
|
|
10
|
+
* provider(端点 + 密钥 + 能力)本来就是**数据**,存在 `~/.coral/media-providers.json`,
|
|
11
|
+
* 加一个 = 改配置。而 `ADAPTERS` 是一张**写死的表** ——
|
|
12
|
+
* 加一个新厂商(Replicate / Luma…)必须改内核代码。**痛在这儿,seam 就该在这儿。**
|
|
13
|
+
* 看错位置的话,会把一个已经可配置的东西再包一层,却没解决真正卡人的那一格。
|
|
14
|
+
*/
|
|
15
|
+
import { type Context, Service } from '@deepseek-ai/cordis';
|
|
16
|
+
import type { MediaAdapter } from '../../providers/media/adapters.js';
|
|
17
|
+
export declare const MEDIA = "sps.media";
|
|
18
|
+
export default class MediaAdapterRegistry extends Service {
|
|
19
|
+
private readonly byId;
|
|
20
|
+
constructor(ctx: Context);
|
|
21
|
+
register(id: string, adapter: MediaAdapter): () => void;
|
|
22
|
+
get(id: string): MediaAdapter | undefined;
|
|
23
|
+
list(): string[];
|
|
24
|
+
}
|
|
25
|
+
declare module '@deepseek-ai/cordis' {
|
|
26
|
+
interface Context {
|
|
27
|
+
'sps.media': MediaAdapterRegistry;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/seams/media/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,KAAK,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEtE,eAAO,MAAM,KAAK,cAAc,CAAC;AAEjC,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,OAAO;IACvD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAmC;gBAE5C,GAAG,EAAE,OAAO;IAIxB,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG,MAAM,IAAI;IAQvD,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS;IAIzC,IAAI,IAAI,MAAM,EAAE;CAGjB;AAED,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,OAAO;QACf,WAAW,EAAE,oBAAoB,CAAC;KACnC;CACF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module seams/media
|
|
3
|
+
* @description **媒体适配器注册表 seam** —— 生图/生视频/TTS 各家厂商的调用适配。
|
|
4
|
+
*
|
|
5
|
+
* @layer seam
|
|
6
|
+
*
|
|
7
|
+
* 类型:**乙 · 注册表型**。
|
|
8
|
+
*
|
|
9
|
+
* 🔴 **seam 的位置在 adapter,不在 provider。**
|
|
10
|
+
* provider(端点 + 密钥 + 能力)本来就是**数据**,存在 `~/.coral/media-providers.json`,
|
|
11
|
+
* 加一个 = 改配置。而 `ADAPTERS` 是一张**写死的表** ——
|
|
12
|
+
* 加一个新厂商(Replicate / Luma…)必须改内核代码。**痛在这儿,seam 就该在这儿。**
|
|
13
|
+
* 看错位置的话,会把一个已经可配置的东西再包一层,却没解决真正卡人的那一格。
|
|
14
|
+
*/
|
|
15
|
+
import { Service } from '@deepseek-ai/cordis';
|
|
16
|
+
export const MEDIA = 'sps.media';
|
|
17
|
+
export default class MediaAdapterRegistry extends Service {
|
|
18
|
+
byId = new Map();
|
|
19
|
+
constructor(ctx) {
|
|
20
|
+
super(ctx, MEDIA);
|
|
21
|
+
}
|
|
22
|
+
register(id, adapter) {
|
|
23
|
+
if (this.byId.has(id))
|
|
24
|
+
throw new Error(`媒体适配器 id 重复:${id}`);
|
|
25
|
+
this.byId.set(id, adapter);
|
|
26
|
+
return () => {
|
|
27
|
+
if (this.byId.get(id) === adapter)
|
|
28
|
+
this.byId.delete(id);
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
get(id) {
|
|
32
|
+
return this.byId.get(id);
|
|
33
|
+
}
|
|
34
|
+
list() {
|
|
35
|
+
return [...this.byId.keys()].sort();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/seams/media/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAgB,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAG5D,MAAM,CAAC,MAAM,KAAK,GAAG,WAAW,CAAC;AAEjC,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,OAAO;IACtC,IAAI,GAAG,IAAI,GAAG,EAAwB,CAAC;IAExD,YAAY,GAAY;QACtB,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACpB,CAAC;IAED,QAAQ,CAAC,EAAU,EAAE,OAAqB;QACxC,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;QAC5D,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QAC3B,OAAO,GAAG,EAAE;YACV,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,OAAO;gBAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC1D,CAAC,CAAC;IACJ,CAAC;IAED,GAAG,CAAC,EAAU;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC;IAED,IAAI;QACF,OAAO,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACtC,CAAC;CACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module seams/media-builtin
|
|
3
|
+
* @description 把内建的十个媒体适配器注册进 `sps.media`。
|
|
4
|
+
*
|
|
5
|
+
* @layer seam
|
|
6
|
+
*
|
|
7
|
+
* ⚠️ 适配器实现不动,仍在 `providers/media/adapters` —— 这一步只搬**注册方式**。
|
|
8
|
+
*/
|
|
9
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
10
|
+
export declare const name = "sps-media-builtin";
|
|
11
|
+
export declare const inject: string[];
|
|
12
|
+
export declare function apply(ctx: Context): void;
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/seams/media-builtin/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAInD,eAAO,MAAM,IAAI,sBAAsB,CAAC;AACxC,eAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAIxC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ADAPTERS } from '../../providers/media/adapters.js';
|
|
2
|
+
import { MEDIA } from '../media/index.js';
|
|
3
|
+
export const name = 'sps-media-builtin';
|
|
4
|
+
export const inject = [MEDIA];
|
|
5
|
+
export function apply(ctx) {
|
|
6
|
+
for (const [id, adapter] of Object.entries(ADAPTERS)) {
|
|
7
|
+
ctx.effect(() => ctx[MEDIA].register(id, adapter));
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/seams/media-builtin/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C,MAAM,CAAC,MAAM,IAAI,GAAG,mBAAmB,CAAC;AACxC,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,KAAK,CAAC,CAAC;AAE9B,MAAM,UAAU,KAAK,CAAC,GAAY;IAChC,KAAK,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QACrD,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;IACrD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module seams/memory
|
|
3
|
+
* @description **记忆 seam 的服务定义** —— 读路契约在这里,实现在 `memory-*`。
|
|
4
|
+
*
|
|
5
|
+
* @layer seam
|
|
6
|
+
*
|
|
7
|
+
* 类型:**甲 · 工厂型**(见 docs/design/plugin-architecture.md §3c)。
|
|
8
|
+
* 判据是「换实现是**部署决定**」——"这台节点的记忆走本地 markdown 还是别的后端"。
|
|
9
|
+
*
|
|
10
|
+
* 🔴 **seam 只管"哪个后端",不管"这个后端开不开"。**
|
|
11
|
+
* memory2 自己有 `SPS_MEMORY_MODE=none` 这个开关,那是**后端的配置**。
|
|
12
|
+
* 在 seam 上再造一个 `memory-none`,就有了两处能关掉记忆的地方 —— 两处判据必漂,
|
|
13
|
+
* 而且排错时"到底是谁关的"要翻两个地方。
|
|
14
|
+
* (与 notifier 一致:seam 选 Matrix,MatrixNotifier 自己读 MATRIX_* 并自我降级。)
|
|
15
|
+
*
|
|
16
|
+
* ⚠️ **今天只有一个实现**,而且是有意的:`external` / `local+external` 的适配器
|
|
17
|
+
* memory2 里明确标了 YAGNI(无已接外部后端)。造第二个实现只为"证明能换",
|
|
18
|
+
* 等于造一条没有东西会跑的路径。可换性由用例上的替身证明,不由多发一个包证明。
|
|
19
|
+
*/
|
|
20
|
+
import { type Context, Service } from '@deepseek-ai/cordis';
|
|
21
|
+
import type { WorkerOutputEvent } from '../../core/agents/AgentBackend.js';
|
|
22
|
+
import type { CaptureOutcome } from '../../core/memory2/capture.js';
|
|
23
|
+
import type { MemoryEntry, SaveInput, ScopeRef } from '../../core/memory2/types.js';
|
|
24
|
+
/** 服务名。加 `sps.` 前缀 —— Cordis 是扁平命名空间。 */
|
|
25
|
+
export declare const MEMORY = "sps.memory";
|
|
26
|
+
export declare abstract class MemorySeam extends Service {
|
|
27
|
+
constructor(ctx: Context);
|
|
28
|
+
/**
|
|
29
|
+
* 拼 `<memory>` 注入块;**没有记忆时返回空串**(派活方据此决定要不要 prepend)。
|
|
30
|
+
*
|
|
31
|
+
* 🔴 返回空串是契约的一部分,不是"失败" —— 实现不要用抛错表达"没有记忆"。
|
|
32
|
+
*/
|
|
33
|
+
abstract buildInjection(refs: ScopeRef[]): string;
|
|
34
|
+
abstract captureStart(project: string, cardId: string): void;
|
|
35
|
+
/** 绑一个取消订阅函数;flush/discard 时由实现负责调用。 */
|
|
36
|
+
abstract captureBindUnsub(project: string, cardId: string, unsub: () => void): void;
|
|
37
|
+
abstract captureNote(project: string, cardId: string, ev: WorkerOutputEvent): void;
|
|
38
|
+
/** 落盘并结束这次捕获。 */
|
|
39
|
+
abstract captureFlush(project: string, cardId: string): CaptureOutcome;
|
|
40
|
+
/** 丢弃这次捕获(卡失败/取消时用),**不落盘**。 */
|
|
41
|
+
abstract captureDiscard(project: string, cardId: string): void;
|
|
42
|
+
abstract listEntries(ref: ScopeRef): MemoryEntry[];
|
|
43
|
+
abstract readEntry(ref: ScopeRef, id: string): MemoryEntry | null;
|
|
44
|
+
abstract listAllScopes(): ScopeRef[];
|
|
45
|
+
abstract saveEntry(ref: ScopeRef, input: SaveInput): MemoryEntry;
|
|
46
|
+
abstract deleteEntry(ref: ScopeRef, id: string): boolean;
|
|
47
|
+
/** 记一次"被用到" —— 检索排序要用。 */
|
|
48
|
+
abstract bumpUses(ref: ScopeRef, id: string): void;
|
|
49
|
+
abstract promoteEntry(from: ScopeRef, id: string, to: ScopeRef, opts: {
|
|
50
|
+
move?: boolean;
|
|
51
|
+
}): MemoryEntry | null;
|
|
52
|
+
}
|
|
53
|
+
declare module '@deepseek-ai/cordis' {
|
|
54
|
+
interface Context {
|
|
55
|
+
'sps.memory': MemorySeam;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/seams/memory/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,KAAK,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEpF,yCAAyC;AACzC,eAAO,MAAM,MAAM,eAAe,CAAC;AAEnC,8BAAsB,UAAW,SAAQ,OAAO;gBAClC,GAAG,EAAE,OAAO;IAMxB;;;;OAIG;IACH,QAAQ,CAAC,cAAc,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,MAAM;IAWjD,QAAQ,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAC5D,wCAAwC;IACxC,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,IAAI,GAAG,IAAI;IACnF,QAAQ,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,iBAAiB,GAAG,IAAI;IAClF,iBAAiB;IACjB,QAAQ,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,cAAc;IACtE,gCAAgC;IAChC,QAAQ,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAI9D,QAAQ,CAAC,WAAW,CAAC,GAAG,EAAE,QAAQ,GAAG,WAAW,EAAE;IAClD,QAAQ,CAAC,SAAS,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI;IACjE,QAAQ,CAAC,aAAa,IAAI,QAAQ,EAAE;IAQpC,QAAQ,CAAC,SAAS,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,GAAG,WAAW;IAChE,QAAQ,CAAC,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO;IACxD,0BAA0B;IAC1B,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI;IAClD,QAAQ,CAAC,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;QAAE,IAAI,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,WAAW,GAAG,IAAI;CAC9G;AAED,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,OAAO;QACf,YAAY,EAAE,UAAU,CAAC;KAC1B;CACF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module seams/memory
|
|
3
|
+
* @description **记忆 seam 的服务定义** —— 读路契约在这里,实现在 `memory-*`。
|
|
4
|
+
*
|
|
5
|
+
* @layer seam
|
|
6
|
+
*
|
|
7
|
+
* 类型:**甲 · 工厂型**(见 docs/design/plugin-architecture.md §3c)。
|
|
8
|
+
* 判据是「换实现是**部署决定**」——"这台节点的记忆走本地 markdown 还是别的后端"。
|
|
9
|
+
*
|
|
10
|
+
* 🔴 **seam 只管"哪个后端",不管"这个后端开不开"。**
|
|
11
|
+
* memory2 自己有 `SPS_MEMORY_MODE=none` 这个开关,那是**后端的配置**。
|
|
12
|
+
* 在 seam 上再造一个 `memory-none`,就有了两处能关掉记忆的地方 —— 两处判据必漂,
|
|
13
|
+
* 而且排错时"到底是谁关的"要翻两个地方。
|
|
14
|
+
* (与 notifier 一致:seam 选 Matrix,MatrixNotifier 自己读 MATRIX_* 并自我降级。)
|
|
15
|
+
*
|
|
16
|
+
* ⚠️ **今天只有一个实现**,而且是有意的:`external` / `local+external` 的适配器
|
|
17
|
+
* memory2 里明确标了 YAGNI(无已接外部后端)。造第二个实现只为"证明能换",
|
|
18
|
+
* 等于造一条没有东西会跑的路径。可换性由用例上的替身证明,不由多发一个包证明。
|
|
19
|
+
*/
|
|
20
|
+
import { Service } from '@deepseek-ai/cordis';
|
|
21
|
+
/** 服务名。加 `sps.` 前缀 —— Cordis 是扁平命名空间。 */
|
|
22
|
+
export const MEMORY = 'sps.memory';
|
|
23
|
+
export class MemorySeam extends Service {
|
|
24
|
+
constructor(ctx) {
|
|
25
|
+
super(ctx, MEMORY);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/seams/memory/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAgB,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAK5D,yCAAyC;AACzC,MAAM,CAAC,MAAM,MAAM,GAAG,YAAY,CAAC;AAEnC,MAAM,OAAgB,UAAW,SAAQ,OAAO;IAC9C,YAAY,GAAY;QACtB,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACrB,CAAC;CA8CF"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module seams/memory-local
|
|
3
|
+
* @description 记忆 seam 的**本地实现** —— 接现有的 memory2(markdown 真源 + 内存 BM25)。
|
|
4
|
+
*
|
|
5
|
+
* @layer seam
|
|
6
|
+
*
|
|
7
|
+
* 它只做一件事:把 `buildMemoryInjection` 接到 `sps.memory` 这道缝上。
|
|
8
|
+
* `SPS_MEMORY_MODE=none` 由 memory2 内部处理 —— 那是**这个后端的配置**,不是 seam 的职责。
|
|
9
|
+
*/
|
|
10
|
+
import type { WorkerOutputEvent } from '../../core/agents/AgentBackend.js';
|
|
11
|
+
import { type CaptureOutcome } from '../../core/memory2/capture.js';
|
|
12
|
+
import type { MemoryEntry, SaveInput, ScopeRef } from '../../core/memory2/types.js';
|
|
13
|
+
import { MemorySeam } from '../memory/index.js';
|
|
14
|
+
export default class LocalMemorySeam extends MemorySeam {
|
|
15
|
+
buildInjection(refs: ScopeRef[]): string;
|
|
16
|
+
captureStart(project: string, cardId: string): void;
|
|
17
|
+
captureBindUnsub(project: string, cardId: string, unsub: () => void): void;
|
|
18
|
+
captureNote(project: string, cardId: string, ev: WorkerOutputEvent): void;
|
|
19
|
+
captureFlush(project: string, cardId: string): CaptureOutcome;
|
|
20
|
+
captureDiscard(project: string, cardId: string): void;
|
|
21
|
+
listEntries(ref: ScopeRef): MemoryEntry[];
|
|
22
|
+
readEntry(ref: ScopeRef, id: string): MemoryEntry | null;
|
|
23
|
+
listAllScopes(): ScopeRef[];
|
|
24
|
+
saveEntry(ref: ScopeRef, input: SaveInput): MemoryEntry;
|
|
25
|
+
deleteEntry(ref: ScopeRef, id: string): boolean;
|
|
26
|
+
bumpUses(ref: ScopeRef, id: string): void;
|
|
27
|
+
promoteEntry(from: ScopeRef, id: string, to: ScopeRef, opts: {
|
|
28
|
+
move?: boolean;
|
|
29
|
+
}): MemoryEntry | null;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/seams/memory-local/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EACL,KAAK,cAAc,EAMpB,MAAM,+BAA+B,CAAC;AAWvC,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,UAAU;IACrD,cAAc,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,MAAM;IAIxC,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAGnD,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,IAAI,GAAG,IAAI;IAG1E,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,iBAAiB,GAAG,IAAI;IAGzE,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,cAAc;IAG7D,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAIrD,WAAW,CAAC,GAAG,EAAE,QAAQ,GAAG,WAAW,EAAE;IAGzC,SAAS,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI;IAGxD,aAAa,IAAI,QAAQ,EAAE;IAI3B,SAAS,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,GAAG,WAAW;IAGvD,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO;IAG/C,QAAQ,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI;IAGzC,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;QAAE,IAAI,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,WAAW,GAAG,IAAI;CAGrG"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module seams/memory-local
|
|
3
|
+
* @description 记忆 seam 的**本地实现** —— 接现有的 memory2(markdown 真源 + 内存 BM25)。
|
|
4
|
+
*
|
|
5
|
+
* @layer seam
|
|
6
|
+
*
|
|
7
|
+
* 它只做一件事:把 `buildMemoryInjection` 接到 `sps.memory` 这道缝上。
|
|
8
|
+
* `SPS_MEMORY_MODE=none` 由 memory2 内部处理 —— 那是**这个后端的配置**,不是 seam 的职责。
|
|
9
|
+
*/
|
|
10
|
+
import { captureBindUnsub, captureDiscard, captureFlush, captureNote, captureStart, } from '../../core/memory2/capture.js';
|
|
11
|
+
import { buildMemoryInjection } from '../../core/memory2/inject.js';
|
|
12
|
+
import { bumpUses, deleteEntry, listAllScopes, listEntries, promoteEntry, readEntry, saveEntry, } from '../../core/memory2/store.js';
|
|
13
|
+
import { MemorySeam } from '../memory/index.js';
|
|
14
|
+
export default class LocalMemorySeam extends MemorySeam {
|
|
15
|
+
buildInjection(refs) {
|
|
16
|
+
return buildMemoryInjection(refs);
|
|
17
|
+
}
|
|
18
|
+
captureStart(project, cardId) {
|
|
19
|
+
captureStart(project, cardId);
|
|
20
|
+
}
|
|
21
|
+
captureBindUnsub(project, cardId, unsub) {
|
|
22
|
+
captureBindUnsub(project, cardId, unsub);
|
|
23
|
+
}
|
|
24
|
+
captureNote(project, cardId, ev) {
|
|
25
|
+
captureNote(project, cardId, ev);
|
|
26
|
+
}
|
|
27
|
+
captureFlush(project, cardId) {
|
|
28
|
+
return captureFlush(project, cardId);
|
|
29
|
+
}
|
|
30
|
+
captureDiscard(project, cardId) {
|
|
31
|
+
captureDiscard(project, cardId);
|
|
32
|
+
}
|
|
33
|
+
listEntries(ref) {
|
|
34
|
+
return listEntries(ref);
|
|
35
|
+
}
|
|
36
|
+
readEntry(ref, id) {
|
|
37
|
+
return readEntry(ref, id);
|
|
38
|
+
}
|
|
39
|
+
listAllScopes() {
|
|
40
|
+
return listAllScopes();
|
|
41
|
+
}
|
|
42
|
+
saveEntry(ref, input) {
|
|
43
|
+
return saveEntry(ref, input);
|
|
44
|
+
}
|
|
45
|
+
deleteEntry(ref, id) {
|
|
46
|
+
return deleteEntry(ref, id);
|
|
47
|
+
}
|
|
48
|
+
bumpUses(ref, id) {
|
|
49
|
+
bumpUses(ref, id);
|
|
50
|
+
}
|
|
51
|
+
promoteEntry(from, id, to, opts) {
|
|
52
|
+
return promoteEntry(from, id, to, opts);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/seams/memory-local/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAEL,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,WAAW,EACX,YAAY,GACb,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EACL,QAAQ,EACR,WAAW,EACX,aAAa,EACb,WAAW,EACX,YAAY,EACZ,SAAS,EACT,SAAS,GACV,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,UAAU;IACrD,cAAc,CAAC,IAAgB;QAC7B,OAAO,oBAAoB,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IAED,YAAY,CAAC,OAAe,EAAE,MAAc;QAC1C,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAChC,CAAC;IACD,gBAAgB,CAAC,OAAe,EAAE,MAAc,EAAE,KAAiB;QACjE,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAC3C,CAAC;IACD,WAAW,CAAC,OAAe,EAAE,MAAc,EAAE,EAAqB;QAChE,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;IACnC,CAAC;IACD,YAAY,CAAC,OAAe,EAAE,MAAc;QAC1C,OAAO,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACvC,CAAC;IACD,cAAc,CAAC,OAAe,EAAE,MAAc;QAC5C,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAClC,CAAC;IAED,WAAW,CAAC,GAAa;QACvB,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;IACD,SAAS,CAAC,GAAa,EAAE,EAAU;QACjC,OAAO,SAAS,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAC5B,CAAC;IACD,aAAa;QACX,OAAO,aAAa,EAAE,CAAC;IACzB,CAAC;IAED,SAAS,CAAC,GAAa,EAAE,KAAgB;QACvC,OAAO,SAAS,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC/B,CAAC;IACD,WAAW,CAAC,GAAa,EAAE,EAAU;QACnC,OAAO,WAAW,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAC9B,CAAC;IACD,QAAQ,CAAC,GAAa,EAAE,EAAU;QAChC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACpB,CAAC;IACD,YAAY,CAAC,IAAc,EAAE,EAAU,EAAE,EAAY,EAAE,IAAwB;QAC7E,OAAO,YAAY,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;IAC1C,CAAC;CACF"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module seams/notifier
|
|
3
|
+
* @description **通知 seam 的服务定义** —— 契约在这里,实现在别的包(`notifier-*`)。
|
|
4
|
+
*
|
|
5
|
+
* @layer seam
|
|
6
|
+
*
|
|
7
|
+
* 类型:**甲 · 工厂型**(见 docs/design/plugin-architecture.md §3c)。
|
|
8
|
+
* 判据是「换实现是**部署决定**」——"这台节点的通知走 Matrix 还是不发",
|
|
9
|
+
* 不是"这个项目走什么"。所以进程级只装一个实现,按项目 `open()` 出句柄。
|
|
10
|
+
*
|
|
11
|
+
* 🔴 **服务是工厂,不是实例**:`Notifier` 是项目绑定的(房间 id、token 都在 ProjectConfig 里),
|
|
12
|
+
* 而一个进程同时服务很多项目。这与 sps 现有的 `createNotifier(config)` 形态一致 ——
|
|
13
|
+
* 插件化改的是「工厂里造什么」,不是「工厂的形态」。
|
|
14
|
+
*
|
|
15
|
+
* 消费方永远只写:
|
|
16
|
+
* ```ts
|
|
17
|
+
* export const inject = ['sps.notifier'];
|
|
18
|
+
* const notifier = ctx['sps.notifier'].open(projectConfig);
|
|
19
|
+
* ```
|
|
20
|
+
* **不 import 任何一种实现。**
|
|
21
|
+
*/
|
|
22
|
+
import { type Context, Service } from '@deepseek-ai/cordis';
|
|
23
|
+
import type { ProjectConfig } from '../../core/config.js';
|
|
24
|
+
import type { Notifier } from '../../interfaces/Notifier.js';
|
|
25
|
+
/** 服务名。加 `sps.` 前缀:Cordis 是扁平命名空间,不加前缀迟早撞名。 */
|
|
26
|
+
export declare const NOTIFIER = "sps.notifier";
|
|
27
|
+
export declare abstract class NotifierSeam extends Service {
|
|
28
|
+
constructor(ctx: Context);
|
|
29
|
+
/** 按项目开一个通知句柄。**每次调用返回一个新句柄**,与现有 `createNotifier` 同语义。 */
|
|
30
|
+
abstract open(config: ProjectConfig): Notifier;
|
|
31
|
+
}
|
|
32
|
+
declare module '@deepseek-ai/cordis' {
|
|
33
|
+
interface Context {
|
|
34
|
+
'sps.notifier': NotifierSeam;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/seams/notifier/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,KAAK,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAE7D,+CAA+C;AAC/C,eAAO,MAAM,QAAQ,iBAAiB,CAAC;AAEvC,8BAAsB,YAAa,SAAQ,OAAO;gBACpC,GAAG,EAAE,OAAO;IAIxB,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,aAAa,GAAG,QAAQ;CAC/C;AAED,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,OAAO;QACf,cAAc,EAAE,YAAY,CAAC;KAC9B;CACF"}
|