@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.
@@ -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,CA6BpB"}
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
- // OpenClaw 2026 does not support api.on() for post-response hooks.
4
- // Register a capture tool that agents invoke to store important information.
5
- api.registerTool('hippodid:remember', {
6
- description: 'Save important information to HippoDid character memory. Call this to store facts, decisions, preferences, or context that should persist across sessions.',
7
- args: [
8
- {
9
- name: 'content',
10
- description: 'The information to remember',
11
- required: true,
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(`hippodid: captured memory: ${content.slice(0, 80)}...`);
21
- return 'Remembered.';
15
+ logger.info('hippodid: captured conversation turn');
22
16
  }
23
- else {
24
- logger.warn(`hippodid: capture failed: ${result.error.message}`);
25
- return `Failed to remember: ${result.error.message}`;
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,mEAAmE;QACnE,6EAA6E;QAC7E,GAAG,CAAC,YAAY,CAAC,mBAAmB,EAAE;YACpC,WAAW,EAAE,4JAA4J;YACzK,IAAI,EAAE;gBACJ;oBACE,IAAI,EAA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,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,CA4BpB"}
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
- // OpenClaw 2026 does not support api.on() for pre-response hooks.
4
- // Register a recall tool that agents invoke when they need memory context.
5
- api.registerTool('hippodid:recall', {
6
- description: 'Search HippoDid character memory and return relevant context. Call this at the start of a task to recall relevant memories.',
7
- args: [
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
- logger.info(`hippodid: recalled ${memories.length} memories for query: ${query}`);
20
- return memories.map((m) => m.content).join('\n\n');
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
- else {
23
- logger.warn(`hippodid: recall failed: ${result.error.message}`);
24
- return 'No memories found.';
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,kEAAkE;QAClE,2EAA2E;QAC3E,GAAG,CAAC,YAAY,CAAC,iBAAiB,EAAE;YAClC,WAAW,EAAE,6HAA6H;YAC1I,IAAI,EAAE;gBACJ;oBACE,IAAI,EAAE,OAAO;oBACb,WAAW,EAAE,8BAA8B;oBAC3C,QAAQ,EAAE,IAAI;iBACf;aACF;YACD,OAAO,EAAE,KAAK,EAAE,IAA4B,EAAE,EAAE;gBAC9C,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;gBAClC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;gBACtE,IAAI,MAAM,CAAC,EAAE,EAAE,CAAC;oBACd,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC;oBAC9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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"}
@@ -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.7",
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
- // OpenClaw 2026 does not support api.on() for post-response hooks.
11
- // Register a capture tool that agents invoke to store important information.
12
- api.registerTool('hippodid:remember', {
13
- description: 'Save important information to HippoDid character memory. Call this to store facts, decisions, preferences, or context that should persist across sessions.',
14
- args: [
15
- {
16
- name: 'content',
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
- const result = await client.addMemory(config.characterId, content);
26
- if (result.ok) {
27
- logger.info(`hippodid: captured memory: ${content.slice(0, 80)}...`);
28
- return 'Remembered.';
29
- } else {
30
- logger.warn(`hippodid: capture failed: ${result.error.message}`);
31
- return `Failed to remember: ${result.error.message}`;
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
- logger.info('hippodid: auto-capture tool registered as hippodid:remember');
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
  }
@@ -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
- // OpenClaw 2026 does not support api.on() for pre-response hooks.
11
- // Register a recall tool that agents invoke when they need memory context.
12
- api.registerTool('hippodid:recall', {
13
- description: 'Search HippoDid character memory and return relevant context. Call this at the start of a task to recall relevant memories.',
14
- args: [
15
- {
16
- name: 'query',
17
- description: 'What to search for in memory',
18
- required: true,
19
- },
20
- ],
21
- handler: async (args: Record<string, string>) => {
22
- const query = args['query'] ?? '';
23
- const result = await client.searchMemories(config.characterId, query);
24
- if (result.ok) {
25
- const memories = result.value;
26
- logger.info(`hippodid: recalled ${memories.length} memories for query: ${query}`);
27
- return memories.map((m) => m.content).join('\n\n');
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
- logger.info('hippodid: auto-recall tool registered as hippodid:recall');
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
  }