@hippodid/openclaw-plugin 1.0.7 → 1.0.8
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/hooks/auto-capture.d.ts.map +1 -1
- package/dist/hooks/auto-capture.js +17 -24
- package/dist/hooks/auto-capture.js.map +1 -1
- package/dist/hooks/auto-recall.d.ts.map +1 -1
- package/dist/hooks/auto-recall.js +18 -24
- package/dist/hooks/auto-recall.js.map +1 -1
- package/openclaw.plugin.json +1 -0
- package/package.json +2 -1
- package/skills/hippodid/SKILL.md +31 -0
- package/src/hooks/auto-capture.ts +21 -23
- package/src/hooks/auto-recall.ts +21 -23
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-capture.d.ts","sourceRoot":"","sources":["../../src/hooks/auto-capture.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE;IAAE,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAC3D,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,
|
|
1
|
+
{"version":3,"file":"auto-capture.d.ts","sourceRoot":"","sources":["../../src/hooks/auto-capture.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE;IAAE,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAC3D,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CA2BpB"}
|
|
@@ -1,32 +1,25 @@
|
|
|
1
1
|
export function createAutoCaptureHook(client, config, logger) {
|
|
2
2
|
return (api) => {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
],
|
|
14
|
-
handler: async (args) => {
|
|
15
|
-
const content = args['content'] ?? '';
|
|
16
|
-
if (!content)
|
|
17
|
-
return 'Nothing to remember.';
|
|
3
|
+
api.registerHook('agent_end', async (ctx) => {
|
|
4
|
+
try {
|
|
5
|
+
const user = ctx?.userMessage ?? ctx?.prompt ?? ctx?.input ?? '';
|
|
6
|
+
const assistant = ctx?.assistantMessage ?? ctx?.response ?? ctx?.output ?? '';
|
|
7
|
+
if (!user && !assistant)
|
|
8
|
+
return;
|
|
9
|
+
const content = [
|
|
10
|
+
user ? `User: ${user}` : '',
|
|
11
|
+
assistant ? `Assistant: ${assistant}` : '',
|
|
12
|
+
].filter(Boolean).join('\n');
|
|
18
13
|
const result = await client.addMemory(config.characterId, content);
|
|
19
14
|
if (result.ok) {
|
|
20
|
-
logger.info(
|
|
21
|
-
return 'Remembered.';
|
|
15
|
+
logger.info('hippodid: captured conversation turn');
|
|
22
16
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
logger.info('hippodid: auto-capture tool registered as hippodid:remember');
|
|
17
|
+
}
|
|
18
|
+
catch (e) {
|
|
19
|
+
logger.warn(`hippodid: capture error: ${e instanceof Error ? e.message : String(e)}`);
|
|
20
|
+
}
|
|
21
|
+
}, { name: 'hippodid.agent-end', description: 'Capture conversation to HippoDid after agent responds' });
|
|
22
|
+
logger.info('hippodid: auto-capture hook registered (agent_end)');
|
|
30
23
|
};
|
|
31
24
|
}
|
|
32
25
|
//# sourceMappingURL=auto-capture.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-capture.js","sourceRoot":"","sources":["../../src/hooks/auto-capture.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,qBAAqB,CACnC,MAAsB,EACtB,MAAoB,EACpB,MAA4D;IAE5D,OAAO,CAAC,GAAQ,EAAE,EAAE;QAClB,
|
|
1
|
+
{"version":3,"file":"auto-capture.js","sourceRoot":"","sources":["../../src/hooks/auto-capture.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,qBAAqB,CACnC,MAAsB,EACtB,MAAoB,EACpB,MAA4D;IAE5D,OAAO,CAAC,GAAQ,EAAE,EAAE;QAClB,GAAG,CAAC,YAAY,CACd,WAAW,EACX,KAAK,EAAE,GAAQ,EAAE,EAAE;YACjB,IAAI,CAAC;gBACH,MAAM,IAAI,GAAG,GAAG,EAAE,WAAW,IAAI,GAAG,EAAE,MAAM,IAAI,GAAG,EAAE,KAAK,IAAI,EAAE,CAAC;gBACjE,MAAM,SAAS,GAAG,GAAG,EAAE,gBAAgB,IAAI,GAAG,EAAE,QAAQ,IAAI,GAAG,EAAE,MAAM,IAAI,EAAE,CAAC;gBAC9E,IAAI,CAAC,IAAI,IAAI,CAAC,SAAS;oBAAE,OAAO;gBAEhC,MAAM,OAAO,GAAG;oBACd,IAAI,CAAC,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE;oBAC3B,SAAS,CAAC,CAAC,CAAC,cAAc,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE;iBAC3C,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAE7B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;gBACnE,IAAI,MAAM,CAAC,EAAE,EAAE,CAAC;oBACd,MAAM,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;gBACtD,CAAC;YACH,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,MAAM,CAAC,IAAI,CAAC,4BAA4B,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YACxF,CAAC;QACH,CAAC,EACD,EAAE,IAAI,EAAE,oBAAoB,EAAE,WAAW,EAAE,uDAAuD,EAAE,CACrG,CAAC;QACF,MAAM,CAAC,IAAI,CAAC,oDAAoD,CAAC,CAAC;IACpE,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-recall.d.ts","sourceRoot":"","sources":["../../src/hooks/auto-recall.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE;IAAE,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAC3D,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,
|
|
1
|
+
{"version":3,"file":"auto-recall.d.ts","sourceRoot":"","sources":["../../src/hooks/auto-recall.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE;IAAE,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAC3D,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CA0BpB"}
|
|
@@ -1,31 +1,25 @@
|
|
|
1
1
|
export function createAutoRecallHook(client, config, logger) {
|
|
2
2
|
return (api) => {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
{
|
|
9
|
-
name: 'query',
|
|
10
|
-
description: 'What to search for in memory',
|
|
11
|
-
required: true,
|
|
12
|
-
},
|
|
13
|
-
],
|
|
14
|
-
handler: async (args) => {
|
|
15
|
-
const query = args['query'] ?? '';
|
|
3
|
+
api.registerHook('before_agent_start', async (ctx) => {
|
|
4
|
+
try {
|
|
5
|
+
const query = ctx?.prompt ?? ctx?.message ?? ctx?.input ?? '';
|
|
6
|
+
if (!query)
|
|
7
|
+
return;
|
|
16
8
|
const result = await client.searchMemories(config.characterId, query);
|
|
17
|
-
if (result.ok) {
|
|
18
|
-
const memories = result.value
|
|
19
|
-
|
|
20
|
-
|
|
9
|
+
if (result.ok && result.value?.length > 0) {
|
|
10
|
+
const memories = result.value
|
|
11
|
+
.map((m) => m.content ?? m.text ?? m.body ?? '')
|
|
12
|
+
.filter(Boolean)
|
|
13
|
+
.join('\n---\n');
|
|
14
|
+
ctx.prependContext?.(`## HippoDid Memories\n${memories}\n`);
|
|
15
|
+
logger.info(`hippodid: recalled ${result.value.length} memories`);
|
|
21
16
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
logger.info('hippodid: auto-recall tool registered as hippodid:recall');
|
|
17
|
+
}
|
|
18
|
+
catch (e) {
|
|
19
|
+
logger.warn(`hippodid: recall error: ${e instanceof Error ? e.message : String(e)}`);
|
|
20
|
+
}
|
|
21
|
+
}, { name: 'hippodid.before-agent-start', description: 'Inject HippoDid memories before agent responds' });
|
|
22
|
+
logger.info('hippodid: auto-recall hook registered (before_agent_start)');
|
|
29
23
|
};
|
|
30
24
|
}
|
|
31
25
|
//# sourceMappingURL=auto-recall.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-recall.js","sourceRoot":"","sources":["../../src/hooks/auto-recall.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,oBAAoB,CAClC,MAAsB,EACtB,MAAoB,EACpB,MAA4D;IAE5D,OAAO,CAAC,GAAQ,EAAE,EAAE;QAClB,
|
|
1
|
+
{"version":3,"file":"auto-recall.js","sourceRoot":"","sources":["../../src/hooks/auto-recall.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,oBAAoB,CAClC,MAAsB,EACtB,MAAoB,EACpB,MAA4D;IAE5D,OAAO,CAAC,GAAQ,EAAE,EAAE;QAClB,GAAG,CAAC,YAAY,CACd,oBAAoB,EACpB,KAAK,EAAE,GAAQ,EAAE,EAAE;YACjB,IAAI,CAAC;gBACH,MAAM,KAAK,GAAG,GAAG,EAAE,MAAM,IAAI,GAAG,EAAE,OAAO,IAAI,GAAG,EAAE,KAAK,IAAI,EAAE,CAAC;gBAC9D,IAAI,CAAC,KAAK;oBAAE,OAAO;gBAEnB,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;gBACtE,IAAI,MAAM,CAAC,EAAE,IAAI,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,EAAE,CAAC;oBAC1C,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK;yBAC1B,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC;yBACpD,MAAM,CAAC,OAAO,CAAC;yBACf,IAAI,CAAC,SAAS,CAAC,CAAC;oBACnB,GAAG,CAAC,cAAc,EAAE,CAAC,yBAAyB,QAAQ,IAAI,CAAC,CAAC;oBAC5D,MAAM,CAAC,IAAI,CAAC,sBAAsB,MAAM,CAAC,KAAK,CAAC,MAAM,WAAW,CAAC,CAAC;gBACpE,CAAC;YACH,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YACvF,CAAC;QACH,CAAC,EACD,EAAE,IAAI,EAAE,6BAA6B,EAAE,WAAW,EAAE,gDAAgD,EAAE,CACvG,CAAC;QACF,MAAM,CAAC,IAAI,CAAC,4DAA4D,CAAC,CAAC;IAC5E,CAAC,CAAC;AACJ,CAAC"}
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"id": "hippodid",
|
|
3
3
|
"name": "HippoDid — Cloud Character Memory",
|
|
4
4
|
"description": "Cloud sync for MEMORY.md with structured character memory. Survives context compaction.",
|
|
5
|
+
"skills": ["./skills"],
|
|
5
6
|
"configSchema": {
|
|
6
7
|
"type": "object",
|
|
7
8
|
"additionalProperties": false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hippodid/openclaw-plugin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "Cloud sync for MEMORY.md with structured character memory. Survives context compaction.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"files": [
|
|
21
21
|
"dist",
|
|
22
22
|
"src",
|
|
23
|
+
"skills",
|
|
23
24
|
"openclaw.plugin.json",
|
|
24
25
|
"LICENSE",
|
|
25
26
|
"README.md"
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: hippodid
|
|
3
|
+
description: Use HippoDid to save memories that persist across sessions and survive context compaction. Use this when the user wants to remember something, recall past context, or sync memory files.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# HippoDid — Persistent Cloud Memory
|
|
7
|
+
|
|
8
|
+
HippoDid stores memories in the cloud so they survive context compaction and persist across sessions and devices.
|
|
9
|
+
|
|
10
|
+
## When to use this skill
|
|
11
|
+
|
|
12
|
+
- User says "remember", "save this", "don't forget", "note that" → call hippodid:remember
|
|
13
|
+
- User asks "what do you know about me", "do you remember", "recall" → call hippodid:recall
|
|
14
|
+
- You need context from previous sessions at the start of a task → call hippodid:recall
|
|
15
|
+
- User wants to sync their memory files → call hippodid:sync
|
|
16
|
+
|
|
17
|
+
## Tools
|
|
18
|
+
|
|
19
|
+
### hippodid:remember
|
|
20
|
+
Saves information to persistent HippoDid cloud memory. Always use this instead of writing to local memory files.
|
|
21
|
+
- content: the information to save (string, required)
|
|
22
|
+
|
|
23
|
+
### hippodid:recall
|
|
24
|
+
Searches HippoDid cloud memory for relevant context.
|
|
25
|
+
- query: what to search for (string, required)
|
|
26
|
+
|
|
27
|
+
### hippodid:sync
|
|
28
|
+
Force-syncs all watched files to HippoDid cloud immediately.
|
|
29
|
+
|
|
30
|
+
### hippodid:status
|
|
31
|
+
Shows HippoDid connection status, tier, and watched paths.
|
|
@@ -7,31 +7,29 @@ export function createAutoCaptureHook(
|
|
|
7
7
|
logger: { info(msg: string): void; warn(msg: string): void },
|
|
8
8
|
): (api: any) => void {
|
|
9
9
|
return (api: any) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
description: 'The information to remember',
|
|
18
|
-
required: true,
|
|
19
|
-
},
|
|
20
|
-
],
|
|
21
|
-
handler: async (args: Record<string, string>) => {
|
|
22
|
-
const content = args['content'] ?? '';
|
|
23
|
-
if (!content) return 'Nothing to remember.';
|
|
10
|
+
api.registerHook(
|
|
11
|
+
'agent_end',
|
|
12
|
+
async (ctx: any) => {
|
|
13
|
+
try {
|
|
14
|
+
const user = ctx?.userMessage ?? ctx?.prompt ?? ctx?.input ?? '';
|
|
15
|
+
const assistant = ctx?.assistantMessage ?? ctx?.response ?? ctx?.output ?? '';
|
|
16
|
+
if (!user && !assistant) return;
|
|
24
17
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
18
|
+
const content = [
|
|
19
|
+
user ? `User: ${user}` : '',
|
|
20
|
+
assistant ? `Assistant: ${assistant}` : '',
|
|
21
|
+
].filter(Boolean).join('\n');
|
|
22
|
+
|
|
23
|
+
const result = await client.addMemory(config.characterId, content);
|
|
24
|
+
if (result.ok) {
|
|
25
|
+
logger.info('hippodid: captured conversation turn');
|
|
26
|
+
}
|
|
27
|
+
} catch (e) {
|
|
28
|
+
logger.warn(`hippodid: capture error: ${e instanceof Error ? e.message : String(e)}`);
|
|
32
29
|
}
|
|
33
30
|
},
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
{ name: 'hippodid.agent-end', description: 'Capture conversation to HippoDid after agent responds' },
|
|
32
|
+
);
|
|
33
|
+
logger.info('hippodid: auto-capture hook registered (agent_end)');
|
|
36
34
|
};
|
|
37
35
|
}
|
package/src/hooks/auto-recall.ts
CHANGED
|
@@ -7,30 +7,28 @@ export function createAutoRecallHook(
|
|
|
7
7
|
logger: { info(msg: string): void; warn(msg: string): void },
|
|
8
8
|
): (api: any) => void {
|
|
9
9
|
return (api: any) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
} else {
|
|
29
|
-
logger.warn(`hippodid: recall failed: ${result.error.message}`);
|
|
30
|
-
return 'No memories found.';
|
|
10
|
+
api.registerHook(
|
|
11
|
+
'before_agent_start',
|
|
12
|
+
async (ctx: any) => {
|
|
13
|
+
try {
|
|
14
|
+
const query = ctx?.prompt ?? ctx?.message ?? ctx?.input ?? '';
|
|
15
|
+
if (!query) return;
|
|
16
|
+
|
|
17
|
+
const result = await client.searchMemories(config.characterId, query);
|
|
18
|
+
if (result.ok && result.value?.length > 0) {
|
|
19
|
+
const memories = result.value
|
|
20
|
+
.map((m: any) => m.content ?? m.text ?? m.body ?? '')
|
|
21
|
+
.filter(Boolean)
|
|
22
|
+
.join('\n---\n');
|
|
23
|
+
ctx.prependContext?.(`## HippoDid Memories\n${memories}\n`);
|
|
24
|
+
logger.info(`hippodid: recalled ${result.value.length} memories`);
|
|
25
|
+
}
|
|
26
|
+
} catch (e) {
|
|
27
|
+
logger.warn(`hippodid: recall error: ${e instanceof Error ? e.message : String(e)}`);
|
|
31
28
|
}
|
|
32
29
|
},
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
{ name: 'hippodid.before-agent-start', description: 'Inject HippoDid memories before agent responds' },
|
|
31
|
+
);
|
|
32
|
+
logger.info('hippodid: auto-recall hook registered (before_agent_start)');
|
|
35
33
|
};
|
|
36
34
|
}
|