@keyoku/openclaw 1.4.3 → 1.4.5
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 +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +50 -29
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -14,11 +14,14 @@ import { type KeyokuConfig } from './config.js';
|
|
|
14
14
|
import type { PluginApi } from './types.js';
|
|
15
15
|
export type { KeyokuConfig } from './config.js';
|
|
16
16
|
export { KeyokuClient } from '@keyoku/memory';
|
|
17
|
-
|
|
17
|
+
type KeyokuMemoryPlugin = ReturnType<typeof createKeyokuMemoryPlugin>;
|
|
18
|
+
declare function createKeyokuMemoryPlugin(config?: KeyokuConfig): {
|
|
18
19
|
id: string;
|
|
19
20
|
name: string;
|
|
20
21
|
description: string;
|
|
21
22
|
kind: "memory";
|
|
22
23
|
register(api: PluginApi): void;
|
|
23
24
|
};
|
|
25
|
+
export { createKeyokuMemoryPlugin };
|
|
26
|
+
export default function keyokuMemory(configOrApi?: KeyokuConfig | PluginApi): KeyokuMemoryPlugin | void;
|
|
24
27
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,KAAK,YAAY,EAAiB,MAAM,aAAa,CAAC;AAO/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,KAAK,YAAY,EAAiB,MAAM,aAAa,CAAC;AAO/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC;AA6CtE,iBAAS,wBAAwB,CAAC,MAAM,CAAC,EAAE,YAAY;;;;;kBAOrC,SAAS;EAI1B;AAcD,OAAO,EAAE,wBAAwB,EAAE,CAAC;AAEpC,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,WAAW,CAAC,EAAE,YAAY,GAAG,SAAS,GAAG,kBAAkB,GAAG,IAAI,CAMtG"}
|
package/dist/index.js
CHANGED
|
@@ -19,42 +19,63 @@ import { registerCli } from './cli.js';
|
|
|
19
19
|
import { registerIncrementalCapture } from './incremental-capture.js';
|
|
20
20
|
import { createEntityResolver } from './entity-resolver.js';
|
|
21
21
|
export { KeyokuClient } from '@keyoku/memory';
|
|
22
|
-
|
|
22
|
+
function registerKeyokuMemory(api, config) {
|
|
23
|
+
const cfg = resolveConfig(config ?? api.pluginConfig);
|
|
24
|
+
// Resolve entity/agent IDs
|
|
25
|
+
// entityId = base memory namespace; resolver can derive dynamic child scopes per event
|
|
26
|
+
// agentId = attribution marker for writes
|
|
27
|
+
const entityId = cfg.entityId || 'default';
|
|
28
|
+
const agentId = cfg.agentId || 'default';
|
|
29
|
+
const resolver = createEntityResolver(entityId, cfg, api.logger);
|
|
30
|
+
// Token resolved lazily — the service generates it at startup, after register()
|
|
31
|
+
// 60s timeout: remember calls LLM extraction, heartbeatContext does analysis
|
|
32
|
+
const client = new KeyokuClient({
|
|
33
|
+
baseUrl: cfg.keyokuUrl,
|
|
34
|
+
token: () => process.env.KEYOKU_SESSION_TOKEN,
|
|
35
|
+
timeout: 60000,
|
|
36
|
+
});
|
|
37
|
+
api.logger.debug?.(`keyoku: plugin registered (url: ${cfg.keyokuUrl}, entityBase: ${entityId}, strategy: ${cfg.entityStrategy})`);
|
|
38
|
+
api.logger.info(`keyoku: TEMP capture diagnostics enabled (plugin=keyoku-memory incrementalCapture=${cfg.incrementalCapture} url=${cfg.keyokuUrl} entityBase=${entityId} strategy=${cfg.entityStrategy})`);
|
|
39
|
+
// Register 6 memory/schedule tools
|
|
40
|
+
registerTools(api, client, resolver, agentId);
|
|
41
|
+
// Register lifecycle hooks (auto-recall, heartbeat, auto-capture)
|
|
42
|
+
registerHooks(api, client, resolver, agentId, cfg);
|
|
43
|
+
// Register Keyoku binary lifecycle service
|
|
44
|
+
registerService(api, cfg.keyokuUrl);
|
|
45
|
+
// Register CLI subcommands
|
|
46
|
+
registerCli(api, client, entityId);
|
|
47
|
+
// Register incremental per-message capture
|
|
48
|
+
if (cfg.incrementalCapture) {
|
|
49
|
+
registerIncrementalCapture(api, client, resolver, agentId, cfg);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function createKeyokuMemoryPlugin(config) {
|
|
23
53
|
return {
|
|
24
54
|
id: 'keyoku-memory',
|
|
25
55
|
name: 'Keyoku Memory',
|
|
26
56
|
description: 'Persistent memory, heartbeat enhancement, and scheduling powered by Keyoku',
|
|
27
57
|
kind: 'memory',
|
|
28
58
|
register(api) {
|
|
29
|
-
|
|
30
|
-
// Resolve entity/agent IDs
|
|
31
|
-
// entityId = base memory namespace; resolver can derive dynamic child scopes per event
|
|
32
|
-
// agentId = attribution marker for writes
|
|
33
|
-
const entityId = cfg.entityId || 'default';
|
|
34
|
-
const agentId = cfg.agentId || 'default';
|
|
35
|
-
const resolver = createEntityResolver(entityId, cfg, api.logger);
|
|
36
|
-
// Token resolved lazily — the service generates it at startup, after register()
|
|
37
|
-
// 60s timeout: remember calls LLM extraction, heartbeatContext does analysis
|
|
38
|
-
const client = new KeyokuClient({
|
|
39
|
-
baseUrl: cfg.keyokuUrl,
|
|
40
|
-
token: () => process.env.KEYOKU_SESSION_TOKEN,
|
|
41
|
-
timeout: 60000,
|
|
42
|
-
});
|
|
43
|
-
api.logger.debug?.(`keyoku: plugin registered (url: ${cfg.keyokuUrl}, entityBase: ${entityId}, strategy: ${cfg.entityStrategy})`);
|
|
44
|
-
api.logger.info(`keyoku: TEMP capture diagnostics enabled (plugin=keyoku-memory incrementalCapture=${cfg.incrementalCapture} url=${cfg.keyokuUrl} entityBase=${entityId} strategy=${cfg.entityStrategy})`);
|
|
45
|
-
// Register 6 memory/schedule tools
|
|
46
|
-
registerTools(api, client, resolver, agentId);
|
|
47
|
-
// Register lifecycle hooks (auto-recall, heartbeat, auto-capture)
|
|
48
|
-
registerHooks(api, client, resolver, agentId, cfg);
|
|
49
|
-
// Register Keyoku binary lifecycle service
|
|
50
|
-
registerService(api, cfg.keyokuUrl);
|
|
51
|
-
// Register CLI subcommands
|
|
52
|
-
registerCli(api, client, entityId);
|
|
53
|
-
// Register incremental per-message capture
|
|
54
|
-
if (cfg.incrementalCapture) {
|
|
55
|
-
registerIncrementalCapture(api, client, resolver, agentId, cfg);
|
|
56
|
-
}
|
|
59
|
+
registerKeyokuMemory(api, config);
|
|
57
60
|
},
|
|
58
61
|
};
|
|
59
62
|
}
|
|
63
|
+
function isPluginApi(value) {
|
|
64
|
+
if (!value || typeof value !== 'object')
|
|
65
|
+
return false;
|
|
66
|
+
const candidate = value;
|
|
67
|
+
return (typeof candidate.registerTool === 'function' &&
|
|
68
|
+
typeof candidate.registerCli === 'function' &&
|
|
69
|
+
typeof candidate.registerService === 'function' &&
|
|
70
|
+
typeof candidate.resolvePath === 'function' &&
|
|
71
|
+
typeof candidate.on === 'function');
|
|
72
|
+
}
|
|
73
|
+
export { createKeyokuMemoryPlugin };
|
|
74
|
+
export default function keyokuMemory(configOrApi) {
|
|
75
|
+
if (isPluginApi(configOrApi)) {
|
|
76
|
+
registerKeyokuMemory(configOrApi);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
return createKeyokuMemoryPlugin(configOrApi);
|
|
80
|
+
}
|
|
60
81
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAqB,aAAa,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAI5D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAqB,aAAa,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAI5D,OAAO,EAAE,YAAY,EAAE,M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
+
"version": "1.4.5",
|
|
4
4
|
"description": "Keyoku memory plugin for OpenClaw — persistent memory, heartbeat enhancement, and scheduling",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"build": "tsc"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@keyoku/memory": "1.4.
|
|
17
|
-
"@keyoku/types": "1.4.
|
|
16
|
+
"@keyoku/memory": "1.4.5",
|
|
17
|
+
"@keyoku/types": "1.4.5",
|
|
18
18
|
"@sinclair/typebox": "^0.34.0"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|