@coralai/sps-plugin-api 0.11.0 → 0.12.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/dist/index.d.ts +10 -0
- package/dist/index.js +11 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -343,6 +343,16 @@ export interface SpsMemory {
|
|
|
343
343
|
project?: string;
|
|
344
344
|
all?: boolean;
|
|
345
345
|
}): MemoryMigrateStats;
|
|
346
|
+
/**
|
|
347
|
+
* 要注入 worker 的 Claude Code 插件目录(**绝对路径**)。没有就返回 `[]`。
|
|
348
|
+
*
|
|
349
|
+
* 用于把"自动召回"做进会话:hooks 在 worker 的 claude 进程里跑,
|
|
350
|
+
* 不依赖 agent 主动调工具。
|
|
351
|
+
*
|
|
352
|
+
* ⚠️ 只有 claude 后端会用到 —— 别的 agent(openai/codex)没有对应概念,
|
|
353
|
+
* 它们要等价能力时各自在自己的适配器里解决。
|
|
354
|
+
*/
|
|
355
|
+
workerPlugins(): string[];
|
|
346
356
|
}
|
|
347
357
|
export interface MemoryGcStats {
|
|
348
358
|
/** 硬删的 tombstone 数。 */
|
package/dist/index.js
CHANGED
|
@@ -11,6 +11,17 @@
|
|
|
11
11
|
* ⚠️ 这里只声明**插件会调的那一面**。服务内部还有别的方法(比如注册表的
|
|
12
12
|
* `list()`),不写进来 —— 写进来就等于承诺它们不变,而那不是我们打算承诺的。
|
|
13
13
|
*/
|
|
14
|
+
// ── 后端可以往 worker 注入一个 Claude Code 插件 ─────────────────────────────
|
|
15
|
+
//
|
|
16
|
+
// 记忆的读路有两半:**pull**(agent 自己调 `memory_recall`)与 **push**(会话自动召回)。
|
|
17
|
+
// 只有 pull 时,工具挂着而 agent 不调 = 等于没记忆 —— 这是实测过的失效模式。
|
|
18
|
+
// push 那一半靠 Claude Code 的 hooks,而 hooks 装在一个 claude 插件目录里。
|
|
19
|
+
//
|
|
20
|
+
// 🔴 宿主**只要一个目录路径**,不解析里面的 hooks.json / .mcp.json ——
|
|
21
|
+
// 那是运行时 substrate 的格式,和"sps 不解析 claude 的 transcript"同源。
|
|
22
|
+
// ⚠️ 目录由 SDK 的 `plugins: [{type:'local', path}]` 加载,**不需要装进
|
|
23
|
+
// `~/.claude/plugins`**(2026-08-27 实测:任意路径可加载,MCP server 正常注册)。
|
|
24
|
+
// 这也意味着关掉 = 不传参数,零残留。
|
|
14
25
|
// ── 跨后端必须一致的算法 ──────────────────────────────────────────────────
|
|
15
26
|
//
|
|
16
27
|
// 🔴 放这里的判据只有一条:**两个后端对它给出不同答案会出错**。
|