@co-engram/openclaw 0.1.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/LICENSE +21 -0
- package/README.md +203 -0
- package/dist/adapter.d.ts +36 -0
- package/dist/adapter.d.ts.map +1 -0
- package/dist/adapter.js +330 -0
- package/dist/adapter.js.map +1 -0
- package/dist/auto-onboard.d.ts +19 -0
- package/dist/auto-onboard.d.ts.map +1 -0
- package/dist/auto-onboard.js +35 -0
- package/dist/auto-onboard.js.map +1 -0
- package/dist/entry-example.d.ts +10 -0
- package/dist/entry-example.d.ts.map +1 -0
- package/dist/entry-example.js +10 -0
- package/dist/entry-example.js.map +1 -0
- package/dist/entry.d.ts +96 -0
- package/dist/entry.d.ts.map +1 -0
- package/dist/entry.js +228 -0
- package/dist/entry.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/json-schemas.d.ts +35 -0
- package/dist/json-schemas.d.ts.map +1 -0
- package/dist/json-schemas.js +432 -0
- package/dist/json-schemas.js.map +1 -0
- package/dist/list-intent-detector.d.ts +20 -0
- package/dist/list-intent-detector.d.ts.map +1 -0
- package/dist/list-intent-detector.js +50 -0
- package/dist/list-intent-detector.js.map +1 -0
- package/dist/llm-client.d.ts +29 -0
- package/dist/llm-client.d.ts.map +1 -0
- package/dist/llm-client.js +112 -0
- package/dist/llm-client.js.map +1 -0
- package/dist/maintenance-runtime.d.ts +31 -0
- package/dist/maintenance-runtime.d.ts.map +1 -0
- package/dist/maintenance-runtime.js +61 -0
- package/dist/maintenance-runtime.js.map +1 -0
- package/dist/memory-tools.d.ts +82 -0
- package/dist/memory-tools.d.ts.map +1 -0
- package/dist/memory-tools.js +237 -0
- package/dist/memory-tools.js.map +1 -0
- package/dist/plugin-entry.d.ts +98 -0
- package/dist/plugin-entry.d.ts.map +1 -0
- package/dist/plugin-entry.js +444 -0
- package/dist/plugin-entry.js.map +1 -0
- package/dist/prompt-builder.d.ts +48 -0
- package/dist/prompt-builder.d.ts.map +1 -0
- package/dist/prompt-builder.js +33 -0
- package/dist/prompt-builder.js.map +1 -0
- package/dist/types.d.ts +236 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +29 -0
- package/dist/types.js.map +1 -0
- package/dist/viewer-loader.d.ts +36 -0
- package/dist/viewer-loader.d.ts.map +1 -0
- package/dist/viewer-loader.js +45 -0
- package/dist/viewer-loader.js.map +1 -0
- package/openclaw.plugin.json +137 -0
- package/package.json +61 -0
- package/scripts/setup.mjs +231 -0
- package/scripts/sync-deps.mjs +247 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenClaw Plugin API 最小化类型定义
|
|
3
|
+
*
|
|
4
|
+
* 不直接 import openclaw 包(避免版本耦合),
|
|
5
|
+
* 只定义我们需要用到的子集签名。
|
|
6
|
+
*
|
|
7
|
+
* host 在自己的 openclaw 项目里通过 definePluginEntry(api => ...)
|
|
8
|
+
* 把真实的 OpenClawPluginApi 传给 registerCoEngramTools。
|
|
9
|
+
*
|
|
10
|
+
* @module @co-engram/openclaw
|
|
11
|
+
*/
|
|
12
|
+
import type { MaintenanceConfig, ProposalEngineConfig, Language, PromptSignalSnapshot, NecessityEvaluator } from "@co-engram/core";
|
|
13
|
+
/**
|
|
14
|
+
* JSON Schema 片段(OpenClaw tool parameters 接受 plain JSON Schema object)
|
|
15
|
+
*/
|
|
16
|
+
export type JsonSchemaObject = {
|
|
17
|
+
readonly type?: string;
|
|
18
|
+
readonly properties?: Record<string, unknown>;
|
|
19
|
+
readonly required?: readonly string[];
|
|
20
|
+
readonly additionalProperties?: boolean;
|
|
21
|
+
readonly [key: string]: unknown;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* AgentTool.execute 的返回结构(最小化)
|
|
25
|
+
*/
|
|
26
|
+
export interface ToolExecuteResult {
|
|
27
|
+
readonly content: ReadonlyArray<{
|
|
28
|
+
readonly type: "text" | "json";
|
|
29
|
+
readonly text?: string;
|
|
30
|
+
readonly data?: unknown;
|
|
31
|
+
}>;
|
|
32
|
+
readonly details?: Record<string, unknown>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* AnyAgentTool 最小子集(OpenClaw 期望的 tool shape)
|
|
36
|
+
*/
|
|
37
|
+
export interface OpenClawToolDescriptor {
|
|
38
|
+
readonly name: string;
|
|
39
|
+
readonly label?: string;
|
|
40
|
+
readonly description: string;
|
|
41
|
+
readonly parameters: JsonSchemaObject;
|
|
42
|
+
readonly execute: (toolCallId: string, params: unknown, signal?: AbortSignal) => Promise<ToolExecuteResult>;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* api.registerTool 的最小签名(AnyAgentTool | Factory 都支持,这里简化)
|
|
46
|
+
*/
|
|
47
|
+
export type RegisterToolFn = (tool: OpenClawToolDescriptor, opts?: {
|
|
48
|
+
readonly name?: string;
|
|
49
|
+
}) => void;
|
|
50
|
+
/**
|
|
51
|
+
* 可选的下轮注入 hook(OpenClaw 真实 API 子集)
|
|
52
|
+
*
|
|
53
|
+
* 用于 M3b:会话开始时把候选提示注入下一轮 agent context。
|
|
54
|
+
* 如果 host 不支持,省略即可——plugin 会跳过自动注入。
|
|
55
|
+
*/
|
|
56
|
+
export interface PluginNextTurnInjectionInput {
|
|
57
|
+
readonly sessionKey: string;
|
|
58
|
+
readonly text: string;
|
|
59
|
+
readonly placement?: "prepend_context" | "append_context";
|
|
60
|
+
readonly idempotencyKey?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface PluginNextTurnInjectionResult {
|
|
63
|
+
readonly enqueued: boolean;
|
|
64
|
+
readonly id?: string;
|
|
65
|
+
readonly sessionKey: string;
|
|
66
|
+
}
|
|
67
|
+
export type EnqueueNextTurnInjectionFn = (injection: PluginNextTurnInjectionInput) => Promise<PluginNextTurnInjectionResult>;
|
|
68
|
+
/**
|
|
69
|
+
* 可选的 session hook(OpenClaw registerHook 子集)
|
|
70
|
+
*
|
|
71
|
+
* 用于 M3b:监听 session 'new' 事件以触发候选提示注入。
|
|
72
|
+
*/
|
|
73
|
+
export type SessionHookHandler = (event: {
|
|
74
|
+
readonly type: "session";
|
|
75
|
+
readonly action: string;
|
|
76
|
+
readonly sessionKey: string;
|
|
77
|
+
readonly context?: Readonly<Record<string, unknown>>;
|
|
78
|
+
}) => Promise<void> | void;
|
|
79
|
+
export type RegisterHookFn = (events: "session" | readonly string[], handler: SessionHookHandler, opts?: {
|
|
80
|
+
readonly name: string;
|
|
81
|
+
readonly description?: string;
|
|
82
|
+
readonly entry?: unknown;
|
|
83
|
+
}) => void;
|
|
84
|
+
/**
|
|
85
|
+
* Memory capability 注册参数
|
|
86
|
+
*
|
|
87
|
+
* 对应 OpenClaw `api.registerMemoryCapability({...})` 的子集。
|
|
88
|
+
* co-engram 目前只用 promptBuilder 字段;flushPlanResolver/runtime 留空
|
|
89
|
+
* (维护引擎自带定时器,不依赖 OpenClaw runtime 钩子)。
|
|
90
|
+
*/
|
|
91
|
+
export interface MemoryPromptBuilderParams {
|
|
92
|
+
readonly availableTools: ReadonlySet<string>;
|
|
93
|
+
readonly citationsMode?: "off" | "compact" | "full";
|
|
94
|
+
}
|
|
95
|
+
export type MemoryPromptBuilder = (params: MemoryPromptBuilderParams) => readonly string[];
|
|
96
|
+
export interface MemoryCapabilityRegistration {
|
|
97
|
+
readonly promptBuilder?: MemoryPromptBuilder;
|
|
98
|
+
readonly flushPlanResolver?: unknown;
|
|
99
|
+
readonly runtime?: unknown;
|
|
100
|
+
readonly publicArtifacts?: unknown;
|
|
101
|
+
}
|
|
102
|
+
export type RegisterMemoryCapabilityFn = (capability: MemoryCapabilityRegistration) => void;
|
|
103
|
+
/**
|
|
104
|
+
* before_prompt_build hook 事件
|
|
105
|
+
*
|
|
106
|
+
* OpenClaw 在 prompt 组装前触发,允许插件追加 system prompt 段。
|
|
107
|
+
* 用于在 workspace MEMORY.md 之后追加 co-engram 的实际记忆内容。
|
|
108
|
+
*/
|
|
109
|
+
export interface BeforePromptBuildEvent {
|
|
110
|
+
readonly prompt: string;
|
|
111
|
+
readonly messages?: readonly unknown[];
|
|
112
|
+
}
|
|
113
|
+
export interface BeforePromptBuildResult {
|
|
114
|
+
/** 追加到 base system prompt 末尾(workspace MEMORY.md / promptBuilder 段之后) */
|
|
115
|
+
readonly appendSystemContext?: string;
|
|
116
|
+
/** 前置到 base system prompt 开头 */
|
|
117
|
+
readonly prependSystemContext?: string;
|
|
118
|
+
}
|
|
119
|
+
export type BeforePromptBuildHandler = (event: BeforePromptBuildEvent) => Promise<BeforePromptBuildResult | void> | BeforePromptBuildResult | void;
|
|
120
|
+
/**
|
|
121
|
+
* OpenClaw Plugin API 子集
|
|
122
|
+
*
|
|
123
|
+
* 实际 OpenClawPluginApi 有更多方法,但 co-engram 只需要 registerTool;
|
|
124
|
+
* enqueueNextTurnInjection / registerHook 可选(用于 M3b system prompt 注入)。
|
|
125
|
+
*/
|
|
126
|
+
export interface CoEngramPluginHostApi {
|
|
127
|
+
readonly registerTool: RegisterToolFn;
|
|
128
|
+
/** 可选:用于 M3b 候选提示注入 */
|
|
129
|
+
readonly enqueueNextTurnInjection?: EnqueueNextTurnInjectionFn;
|
|
130
|
+
/** 可选:用于监听 session 生命周期事件 */
|
|
131
|
+
readonly registerHook?: RegisterHookFn;
|
|
132
|
+
/** 可选:声明 memory capability(OpenClaw 主要记忆插件需要,触发 memory section 注入) */
|
|
133
|
+
readonly registerMemoryCapability?: RegisterMemoryCapabilityFn;
|
|
134
|
+
/** 可选:注册 plugin hook(OpenClaw api.on 子集) */
|
|
135
|
+
readonly on?: (event: "before_prompt_build", handler: BeforePromptBuildHandler) => void;
|
|
136
|
+
/** 可选:plugin config(由 OpenClaw 默认 entry 透传) */
|
|
137
|
+
readonly pluginConfig?: Record<string, unknown>;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* 插件配置(来自 openclaw.plugin.json 的 configSchema)
|
|
141
|
+
*/
|
|
142
|
+
export interface CoEngramPluginConfig {
|
|
143
|
+
/** 数据仓库根路径(默认 ~/team-memory) */
|
|
144
|
+
readonly dataRoot?: string;
|
|
145
|
+
/** 是否启用 */
|
|
146
|
+
readonly enabled?: boolean;
|
|
147
|
+
/** 默认创建者(写入操作时若未指定 createdBy,用此值) */
|
|
148
|
+
readonly defaultCreatedBy?: string;
|
|
149
|
+
/** 工具描述、查看器 UI、提示词所用语言(默认 'en') */
|
|
150
|
+
readonly language?: Language;
|
|
151
|
+
/** 是否启动自动维护服务(默认 false,需宿主显式开启) */
|
|
152
|
+
readonly startMaintenance?: boolean;
|
|
153
|
+
/** 维护服务配置(light/deep/rem 间隔、learningRate 等),透传给 MaintenanceEngine */
|
|
154
|
+
readonly maintenanceConfig?: MaintenanceConfig;
|
|
155
|
+
/** 是否启用 audit log(默认 true) */
|
|
156
|
+
readonly auditEnabled?: boolean;
|
|
157
|
+
/** 是否启用 effectiveness 追踪(默认 true) */
|
|
158
|
+
readonly effectivenessEnabled?: boolean;
|
|
159
|
+
/** 是否启用 proposal engine(默认 true) */
|
|
160
|
+
readonly proposalEnabled?: boolean;
|
|
161
|
+
/** proposal engine 配置 */
|
|
162
|
+
readonly proposalConfig?: ProposalEngineConfig;
|
|
163
|
+
/**
|
|
164
|
+
* 必要性评估 LLM 配置(可选)
|
|
165
|
+
*
|
|
166
|
+
* 配置后,proposal engine 在 cluster 晋升前会用 LLM 判断"是否值得固化为团队记忆",
|
|
167
|
+
* 失败 fallback 到规则版(RuleBasedNecessityEvaluator)。
|
|
168
|
+
* 不配置时只走规则版,零 LLM 成本。
|
|
169
|
+
*/
|
|
170
|
+
readonly necessityLlm?: NecessityLlmConfig;
|
|
171
|
+
/**
|
|
172
|
+
* 可选:宿主直接注入 NecessityEvaluator 实例(优先级高于 necessityLlm 配置)
|
|
173
|
+
*
|
|
174
|
+
* 让 OpenClaw 等高级宿主可以用自己的 LLM 调用设施构造评估器,绕过本插件
|
|
175
|
+
* 内置的 OpenAI-compatible fetch 实现。
|
|
176
|
+
*/
|
|
177
|
+
readonly necessityEvaluator?: NecessityEvaluator;
|
|
178
|
+
/** 是否启动 viewer HTTP server(默认 false,M4) */
|
|
179
|
+
readonly startViewer?: boolean;
|
|
180
|
+
/** viewer 配置(端口/token 等) */
|
|
181
|
+
readonly viewerConfig?: ViewerConfig;
|
|
182
|
+
/**
|
|
183
|
+
* 是否在 plugin 启动时自动 onboard git merge driver(默认 true)。
|
|
184
|
+
*
|
|
185
|
+
* 启用后,启动时会检测 dataRoot 所在 git repo,自动安装 merge driver
|
|
186
|
+
* bundle / .gitattributes / .git/config(全部幂等)。
|
|
187
|
+
*
|
|
188
|
+
* 关闭后,用户需手动运行 `co-engram git enable`(P2.6 CLI)。
|
|
189
|
+
* 默认开启,匹配零手动步骤的 low-friction-defaults 原则。
|
|
190
|
+
*/
|
|
191
|
+
readonly autoOnboardMergeDriver?: boolean;
|
|
192
|
+
/** 预计算的 prompt signals(由 entry.ts 从 .co-engram/prompt-signals.json 读取并注入) */
|
|
193
|
+
readonly promptSignals?: PromptSignalSnapshot;
|
|
194
|
+
}
|
|
195
|
+
/** Viewer 配置 */
|
|
196
|
+
export interface ViewerConfig {
|
|
197
|
+
/** 端口(默认 18799) */
|
|
198
|
+
readonly port?: number;
|
|
199
|
+
/** Bearer token(可选) */
|
|
200
|
+
readonly token?: string;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* 必要性评估 LLM 配置
|
|
204
|
+
*
|
|
205
|
+
* 用于 LlmNecessityEvaluator — proposal 晋升前的"必要性"判断。
|
|
206
|
+
* 失败 fallback 到规则版,所以配置不正确不会阻塞 proposal engine。
|
|
207
|
+
*/
|
|
208
|
+
export interface NecessityLlmConfig {
|
|
209
|
+
/**
|
|
210
|
+
* OpenAI-compatible chat completions endpoint
|
|
211
|
+
*
|
|
212
|
+
* 支持 OpenAI / Azure / 通义 / 智谱 / 本地 ollama 等。
|
|
213
|
+
* 自动追加 `/chat/completions` 后缀。
|
|
214
|
+
*/
|
|
215
|
+
readonly endpoint: string;
|
|
216
|
+
/** API key */
|
|
217
|
+
readonly apiKey: string;
|
|
218
|
+
/** 模型名(如 'gpt-4o-mini' / 'qwen-turbo' / 'glm-4-flash') */
|
|
219
|
+
readonly model: string;
|
|
220
|
+
/** 可选额外 headers */
|
|
221
|
+
readonly headers?: Record<string, string>;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* 默认配置
|
|
225
|
+
*
|
|
226
|
+
* - dataRoot / enabled / defaultCreatedBy 有固定默认值(必填)
|
|
227
|
+
* - startMaintenance 显式默认 false
|
|
228
|
+
* - maintenanceConfig 默认 undefined(交给 MaintenanceEngine 内置默认值)
|
|
229
|
+
* - audit/effectiveness/proposal 默认 true
|
|
230
|
+
*/
|
|
231
|
+
export declare const DEFAULT_CONFIG: Required<Pick<CoEngramPluginConfig, "dataRoot" | "enabled" | "defaultCreatedBy" | "startMaintenance">> & Pick<CoEngramPluginConfig, "maintenanceConfig"> & {
|
|
232
|
+
readonly auditEnabled: boolean;
|
|
233
|
+
readonly effectivenessEnabled: boolean;
|
|
234
|
+
readonly proposalEnabled: boolean;
|
|
235
|
+
};
|
|
236
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EACV,iBAAiB,EACjB,oBAAoB,EACpB,QAAQ,EACR,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,iBAAiB,CAAC;AAEzB;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9C,QAA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AW,YAAY;IAC3B,mBAAmB;IACnB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,uBAAuB;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,cAAc;IACd,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,0DAA0D;IAC1D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,mBAAmB;IACnB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC3C;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,EAAE,QAAQ,CACnC,IAAI,CACF,oBAAoB,EACpB,UAAU,GAAG,SAAS,GAAG,kBAAkB,GAAG,kBAAkB,CACjE,CACF,GACC,IAAI,CAAC,oBAAoB,EAAE,mBAAmB,CAAC,GAAG;IAChD,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,oBAAoB,EAAE,OAAO,CAAC;IACvC,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;CASrC,CAAC"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenClaw Plugin API 最小化类型定义
|
|
3
|
+
*
|
|
4
|
+
* 不直接 import openclaw 包(避免版本耦合),
|
|
5
|
+
* 只定义我们需要用到的子集签名。
|
|
6
|
+
*
|
|
7
|
+
* host 在自己的 openclaw 项目里通过 definePluginEntry(api => ...)
|
|
8
|
+
* 把真实的 OpenClawPluginApi 传给 registerCoEngramTools。
|
|
9
|
+
*
|
|
10
|
+
* @module @co-engram/openclaw
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* 默认配置
|
|
14
|
+
*
|
|
15
|
+
* - dataRoot / enabled / defaultCreatedBy 有固定默认值(必填)
|
|
16
|
+
* - startMaintenance 显式默认 false
|
|
17
|
+
* - maintenanceConfig 默认 undefined(交给 MaintenanceEngine 内置默认值)
|
|
18
|
+
* - audit/effectiveness/proposal 默认 true
|
|
19
|
+
*/
|
|
20
|
+
export const DEFAULT_CONFIG = {
|
|
21
|
+
dataRoot: `${process.env.HOME ?? "/tmp"}/team-memory`,
|
|
22
|
+
enabled: true,
|
|
23
|
+
defaultCreatedBy: "openclaw",
|
|
24
|
+
startMaintenance: false,
|
|
25
|
+
auditEnabled: true,
|
|
26
|
+
effectivenessEnabled: true,
|
|
27
|
+
proposalEnabled: true,
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAoQH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,cAAc,GAUrB;IACJ,QAAQ,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,MAAM,cAAc;IACrD,OAAO,EAAE,IAAI;IACb,gBAAgB,EAAE,UAAU;IAC5B,gBAAgB,EAAE,KAAK;IACvB,YAAY,EAAE,IAAI;IAClB,oBAAoB,EAAE,IAAI;IAC1B,eAAe,EAAE,IAAI;CACtB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenClaw Viewer 适配(M4)
|
|
3
|
+
*
|
|
4
|
+
* 通过 dynamic import 从 @co-engram/viewer 加载 host-agnostic viewer 实现,
|
|
5
|
+
* 与 @co-engram/claude-code 共享同一份 viewer 源码。
|
|
6
|
+
*
|
|
7
|
+
* @module @co-engram/openclaw
|
|
8
|
+
*/
|
|
9
|
+
import type { Language, ToolContext } from "@co-engram/core";
|
|
10
|
+
import type { ViewerConfig } from "./types.js";
|
|
11
|
+
/** Viewer 运行时句柄(动态加载,类型宽松) */
|
|
12
|
+
export interface ViewerRuntime {
|
|
13
|
+
readonly port: number;
|
|
14
|
+
readonly stop: () => Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 启动 viewer HTTP server
|
|
18
|
+
*
|
|
19
|
+
* 内部调用 @co-engram/viewer 的 startViewerServer。
|
|
20
|
+
*
|
|
21
|
+
* @throws 如果 @co-engram/viewer 未安装
|
|
22
|
+
*/
|
|
23
|
+
export declare function startViewerForOpenClaw(ctx: ToolContext, config?: ViewerConfig & {
|
|
24
|
+
readonly language?: Language;
|
|
25
|
+
readonly dataRoot?: string;
|
|
26
|
+
}): Promise<ViewerRuntime>;
|
|
27
|
+
/**
|
|
28
|
+
* 渲染 SPA HTML(仅用于测试 / 在 viewer 不可用时展示占位)
|
|
29
|
+
*
|
|
30
|
+
* 与 @co-engram/viewer 的 renderSpaHtml 保持同构。
|
|
31
|
+
*/
|
|
32
|
+
export declare function renderViewerHtml(options?: {
|
|
33
|
+
readonly tokenRequired?: boolean;
|
|
34
|
+
readonly language?: Language;
|
|
35
|
+
}): Promise<string>;
|
|
36
|
+
//# sourceMappingURL=viewer-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewer-loader.d.ts","sourceRoot":"","sources":["../src/viewer-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,8BAA8B;AAC9B,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACpC;AAED;;;;;;GAMG;AACH,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,WAAW,EAChB,MAAM,GAAE,YAAY,GAAG;IACrB,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACvB,GACL,OAAO,CAAC,aAAa,CAAC,CAGxB;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,GAAE;IACP,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACzB,GACL,OAAO,CAAC,MAAM,CAAC,CAGjB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenClaw Viewer 适配(M4)
|
|
3
|
+
*
|
|
4
|
+
* 通过 dynamic import 从 @co-engram/viewer 加载 host-agnostic viewer 实现,
|
|
5
|
+
* 与 @co-engram/claude-code 共享同一份 viewer 源码。
|
|
6
|
+
*
|
|
7
|
+
* @module @co-engram/openclaw
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* 启动 viewer HTTP server
|
|
11
|
+
*
|
|
12
|
+
* 内部调用 @co-engram/viewer 的 startViewerServer。
|
|
13
|
+
*
|
|
14
|
+
* @throws 如果 @co-engram/viewer 未安装
|
|
15
|
+
*/
|
|
16
|
+
export async function startViewerForOpenClaw(ctx, config = {}) {
|
|
17
|
+
const mod = await dynamicImportViewer();
|
|
18
|
+
return mod.startViewerServer(ctx, config);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 渲染 SPA HTML(仅用于测试 / 在 viewer 不可用时展示占位)
|
|
22
|
+
*
|
|
23
|
+
* 与 @co-engram/viewer 的 renderSpaHtml 保持同构。
|
|
24
|
+
*/
|
|
25
|
+
export async function renderViewerHtml(options = {}) {
|
|
26
|
+
const mod = await dynamicImportViewer();
|
|
27
|
+
return mod.renderSpaHtml(options);
|
|
28
|
+
}
|
|
29
|
+
/** 动态加载 viewer 模块(隔离类型,避免编译期依赖) */
|
|
30
|
+
async function dynamicImportViewer() {
|
|
31
|
+
try {
|
|
32
|
+
// 用字符串变量名避免 TypeScript 把它视为静态依赖
|
|
33
|
+
const specifier = "@co-engram/viewer";
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
35
|
+
const mod = await import(specifier);
|
|
36
|
+
if (typeof mod.startViewerServer !== "function") {
|
|
37
|
+
throw new Error("@co-engram/viewer missing startViewerServer export");
|
|
38
|
+
}
|
|
39
|
+
return mod;
|
|
40
|
+
}
|
|
41
|
+
catch (err) {
|
|
42
|
+
throw new Error(`Failed to load @co-engram/viewer. Install it first: pnpm add @co-engram/viewer. Cause: ${err instanceof Error ? err.message : String(err)}`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=viewer-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewer-loader.js","sourceRoot":"","sources":["../src/viewer-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAWH;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,GAAgB,EAChB,SAGI,EAAE;IAEN,MAAM,GAAG,GAAG,MAAM,mBAAmB,EAAE,CAAC;IACxC,OAAO,GAAG,CAAC,iBAAiB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;AAC5C,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,UAGI,EAAE;IAEN,MAAM,GAAG,GAAG,MAAM,mBAAmB,EAAE,CAAC;IACxC,OAAO,GAAG,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;AACpC,CAAC;AAED,mCAAmC;AACnC,KAAK,UAAU,mBAAmB;IAehC,IAAI,CAAC;QACH,gCAAgC;QAChC,MAAM,SAAS,GAAG,mBAAmB,CAAC;QACtC,8DAA8D;QAC9D,MAAM,GAAG,GAAQ,MAAM,MAAM,CAAC,SAAS,CAAC,CAAC;QACzC,IAAI,OAAO,GAAG,CAAC,iBAAiB,KAAK,UAAU,EAAE,CAAC;YAChD,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;QACxE,CAAC;QACD,OAAO,GAcN,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,0FAA0F,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAC7I,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "co-engram",
|
|
3
|
+
"kind": "memory",
|
|
4
|
+
"activation": {
|
|
5
|
+
"onStartup": true
|
|
6
|
+
},
|
|
7
|
+
"contracts": {
|
|
8
|
+
"tools": [
|
|
9
|
+
"memory_search",
|
|
10
|
+
"memory_get",
|
|
11
|
+
"engram_create",
|
|
12
|
+
"engram_get",
|
|
13
|
+
"engram_update",
|
|
14
|
+
"engram_delete",
|
|
15
|
+
"engram_search",
|
|
16
|
+
"engram_list",
|
|
17
|
+
"engram_reinforce",
|
|
18
|
+
"engram_report_failure",
|
|
19
|
+
"engram_archive",
|
|
20
|
+
"engram_restore",
|
|
21
|
+
"engram_forget",
|
|
22
|
+
"engram_recompute_importance",
|
|
23
|
+
"synapse_create",
|
|
24
|
+
"synapse_get",
|
|
25
|
+
"synapse_list",
|
|
26
|
+
"synapse_delete",
|
|
27
|
+
"skill_get",
|
|
28
|
+
"skill_invoke",
|
|
29
|
+
"close_learning_loop",
|
|
30
|
+
"contradiction_resolve",
|
|
31
|
+
"get_evolution_lineage",
|
|
32
|
+
"upgrade_verification",
|
|
33
|
+
"engram_list_proposals",
|
|
34
|
+
"engram_accept_proposal",
|
|
35
|
+
"engram_dismiss_proposal",
|
|
36
|
+
"engram_doctor",
|
|
37
|
+
"engram_list_paths"
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
"name": "Co-Engram",
|
|
41
|
+
"description": "Team memory with neuroscience-inspired plasticity. Self-editing tools for engrams / synapses / skills. Acts as the primary memory plugin (kind=memory) — mutually exclusive with memory-core.",
|
|
42
|
+
"configSchema": {
|
|
43
|
+
"type": "object",
|
|
44
|
+
"additionalProperties": false,
|
|
45
|
+
"properties": {
|
|
46
|
+
"enabled": {
|
|
47
|
+
"type": "boolean",
|
|
48
|
+
"default": true,
|
|
49
|
+
"description": "Enable or disable Co-Engram tool registration."
|
|
50
|
+
},
|
|
51
|
+
"dataRoot": {
|
|
52
|
+
"type": "string",
|
|
53
|
+
"description": "Absolute path to the team-memory repository (default: $HOME/team-memory)."
|
|
54
|
+
},
|
|
55
|
+
"defaultCreatedBy": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"description": "Default creator identifier when not specified on writes."
|
|
58
|
+
},
|
|
59
|
+
"language": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"enum": ["en", "zh"],
|
|
62
|
+
"default": "en",
|
|
63
|
+
"description": "Language for tool descriptions, viewer UI, and system prompts. Falls back to team-memory persisted config if unset."
|
|
64
|
+
},
|
|
65
|
+
"startMaintenance": {
|
|
66
|
+
"type": "boolean",
|
|
67
|
+
"default": true,
|
|
68
|
+
"description": "Start the auto-maintenance engine (light/deep/rem stages)."
|
|
69
|
+
},
|
|
70
|
+
"maintenanceConfig": {
|
|
71
|
+
"type": "object",
|
|
72
|
+
"additionalProperties": true,
|
|
73
|
+
"description": "Maintenance engine config (lightIntervalMs / deepIntervalMs / remIntervalMs / learningRate / enabledStages)."
|
|
74
|
+
},
|
|
75
|
+
"auditEnabled": {
|
|
76
|
+
"type": "boolean",
|
|
77
|
+
"default": true,
|
|
78
|
+
"description": "Enable audit log (.co-engram/audit.jsonl)."
|
|
79
|
+
},
|
|
80
|
+
"effectivenessEnabled": {
|
|
81
|
+
"type": "boolean",
|
|
82
|
+
"default": true,
|
|
83
|
+
"description": "Enable effectiveness tracking (retrieve_hit → effective/inconclusive)."
|
|
84
|
+
},
|
|
85
|
+
"proposalEnabled": {
|
|
86
|
+
"type": "boolean",
|
|
87
|
+
"default": true,
|
|
88
|
+
"description": "Enable implicit memory proposal engine (on by default for low-friction onboarding)."
|
|
89
|
+
},
|
|
90
|
+
"proposalConfig": {
|
|
91
|
+
"type": "object",
|
|
92
|
+
"additionalProperties": true,
|
|
93
|
+
"description": "Proposal engine config (threshold / similarityThreshold / maxSamples / defaultDismissDays / minMessageLength)."
|
|
94
|
+
},
|
|
95
|
+
"startViewer": {
|
|
96
|
+
"type": "boolean",
|
|
97
|
+
"default": true,
|
|
98
|
+
"description": "Start the web viewer HTTP server on 127.0.0.1:18799 (requires @co-engram/claude-code installed)."
|
|
99
|
+
},
|
|
100
|
+
"viewerConfig": {
|
|
101
|
+
"type": "object",
|
|
102
|
+
"additionalProperties": false,
|
|
103
|
+
"properties": {
|
|
104
|
+
"port": { "type": "number", "default": 18799 },
|
|
105
|
+
"token": { "type": "string" }
|
|
106
|
+
},
|
|
107
|
+
"description": "Viewer server config (port / token)."
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"uiHints": {
|
|
112
|
+
"enabled": {
|
|
113
|
+
"label": "Enable Co-Engram",
|
|
114
|
+
"help": "Globally enable or disable Co-Engram tool registration."
|
|
115
|
+
},
|
|
116
|
+
"dataRoot": {
|
|
117
|
+
"label": "Data Root",
|
|
118
|
+
"help": "Path to the team-memory Git repository where engrams are stored."
|
|
119
|
+
},
|
|
120
|
+
"startMaintenance": {
|
|
121
|
+
"label": "Start Maintenance",
|
|
122
|
+
"help": "Start P4 auto-maintenance (signal extraction + RPE + metacognition)."
|
|
123
|
+
},
|
|
124
|
+
"proposalEnabled": {
|
|
125
|
+
"label": "Implicit Memory Proposals",
|
|
126
|
+
"help": "Watch conversations and propose engrams after a topic is seen multiple times."
|
|
127
|
+
},
|
|
128
|
+
"startViewer": {
|
|
129
|
+
"label": "Start Web Viewer",
|
|
130
|
+
"help": "Launch a local-only HTTP viewer on 127.0.0.1:18799 (requires @co-engram/claude-code)."
|
|
131
|
+
},
|
|
132
|
+
"language": {
|
|
133
|
+
"label": "Language",
|
|
134
|
+
"help": "Tool description / viewer / prompt language: en (default) or zh."
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@co-engram/openclaw",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Co-Engram adapter for OpenClaw (plugin SDK).",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Yang Yang <yang.yang29@zte.com.cn>",
|
|
7
|
+
"homepage": "https://github.com/co-engram/co-engram#readme",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/co-engram/co-engram.git",
|
|
11
|
+
"directory": "packages/openclaw-plugin"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/co-engram/co-engram/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"openclaw",
|
|
18
|
+
"plugin",
|
|
19
|
+
"memory",
|
|
20
|
+
"ai-memory",
|
|
21
|
+
"agent-memory",
|
|
22
|
+
"engram",
|
|
23
|
+
"mcp"
|
|
24
|
+
],
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist",
|
|
30
|
+
"openclaw.plugin.json",
|
|
31
|
+
"scripts/setup.mjs",
|
|
32
|
+
"scripts/sync-deps.mjs",
|
|
33
|
+
"README.md",
|
|
34
|
+
"LICENSE"
|
|
35
|
+
],
|
|
36
|
+
"engines": {
|
|
37
|
+
"node": ">=22.0.0"
|
|
38
|
+
},
|
|
39
|
+
"type": "module",
|
|
40
|
+
"main": "./dist/index.js",
|
|
41
|
+
"types": "./dist/index.d.ts",
|
|
42
|
+
"bin": {
|
|
43
|
+
"co-engram-openclaw-setup": "./scripts/setup.mjs"
|
|
44
|
+
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"build": "tsc -p tsconfig.json",
|
|
47
|
+
"test": "vitest run --reporter=verbose",
|
|
48
|
+
"typecheck": "tsc --noEmit",
|
|
49
|
+
"sync-deps": "node ./scripts/sync-deps.mjs",
|
|
50
|
+
"apply:openclaw": "node ./scripts/setup.mjs"
|
|
51
|
+
},
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"@co-engram/core": "workspace:*",
|
|
54
|
+
"@co-engram/viewer": "workspace:*"
|
|
55
|
+
},
|
|
56
|
+
"openclaw": {
|
|
57
|
+
"extensions": [
|
|
58
|
+
"./src/entry.ts"
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
}
|