@agentmemory/agentmemory 0.9.30 → 0.9.31
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/.env.example +39 -33
- package/AGENTS.md +8 -8
- package/README.md +173 -558
- package/dist/.env.example +39 -33
- package/dist/cli.d.mts.map +1 -1
- package/dist/cli.mjs +1741 -966
- package/dist/cli.mjs.map +1 -1
- package/dist/compression-recovery-CnhLQC6N.mjs +5912 -0
- package/dist/compression-recovery-CnhLQC6N.mjs.map +1 -0
- package/dist/{connect-B4_ca6BD.mjs → connect-BSLIAMpw.mjs} +874 -267
- package/dist/connect-BSLIAMpw.mjs.map +1 -0
- package/dist/hooks/_capture.d.mts +5 -2
- package/dist/hooks/_capture.d.mts.map +1 -1
- package/dist/hooks/_capture.mjs +55 -19
- package/dist/hooks/_capture.mjs.map +1 -1
- package/dist/hooks/notification.mjs +20 -6
- package/dist/hooks/notification.mjs.map +1 -1
- package/dist/hooks/post-commit.mjs +25 -5
- package/dist/hooks/post-commit.mjs.map +1 -1
- package/dist/hooks/post-tool-failure.mjs +12 -4
- package/dist/hooks/post-tool-failure.mjs.map +1 -1
- package/dist/hooks/post-tool-use.mjs +12 -4
- package/dist/hooks/post-tool-use.mjs.map +1 -1
- package/dist/hooks/pre-compact.mjs +37 -10
- package/dist/hooks/pre-compact.mjs.map +1 -1
- package/dist/hooks/pre-tool-use.mjs +25 -5
- package/dist/hooks/pre-tool-use.mjs.map +1 -1
- package/dist/hooks/prompt-submit.mjs +12 -4
- package/dist/hooks/prompt-submit.mjs.map +1 -1
- package/dist/hooks/session-end.mjs +47 -16
- package/dist/hooks/session-end.mjs.map +1 -1
- package/dist/hooks/session-start.mjs +37 -10
- package/dist/hooks/session-start.mjs.map +1 -1
- package/dist/hooks/stop.mjs +74 -72
- package/dist/hooks/stop.mjs.map +1 -1
- package/dist/hooks/subagent-start.mjs +13 -5
- package/dist/hooks/subagent-start.mjs.map +1 -1
- package/dist/hooks/subagent-stop.mjs +18 -6
- package/dist/hooks/subagent-stop.mjs.map +1 -1
- package/dist/hooks/task-completed.mjs +13 -5
- package/dist/hooks/task-completed.mjs.map +1 -1
- package/dist/{image-refs-T_urbwHM.mjs → image-refs-Cyta4Lf9.mjs} +2 -2
- package/dist/{image-refs-T_urbwHM.mjs.map → image-refs-Cyta4Lf9.mjs.map} +1 -1
- package/dist/index.mjs +8539 -4203
- package/dist/index.mjs.map +1 -1
- package/dist/integrations/dsh.d.mts +55 -0
- package/dist/integrations/dsh.d.mts.map +1 -0
- package/dist/integrations/dsh.mjs +1145 -0
- package/dist/integrations/dsh.mjs.map +1 -0
- package/dist/{keyed-mutex-DchXsyfP.mjs → keyed-mutex-DCUh7PG-.mjs} +58 -9
- package/dist/keyed-mutex-DCUh7PG-.mjs.map +1 -0
- package/dist/{secret-store-BnY3A50C.mjs → secret-store-D9GwO0xp.mjs} +535 -434
- package/dist/secret-store-D9GwO0xp.mjs.map +1 -0
- package/dist/session-arguments-zxsbbd8y.mjs +113 -0
- package/dist/session-arguments-zxsbbd8y.mjs.map +1 -0
- package/dist/{src-Jsq9LCeH.mjs → src-DaMtDzt_.mjs} +4087 -3788
- package/dist/src-DaMtDzt_.mjs.map +1 -0
- package/dist/{standalone-DKCdrf1d.mjs → standalone-BlqshyZ5.mjs} +213 -56
- package/dist/standalone-BlqshyZ5.mjs.map +1 -0
- package/dist/standalone.d.mts +1 -1
- package/dist/standalone.d.mts.map +1 -1
- package/dist/standalone.mjs +626 -73
- package/dist/standalone.mjs.map +1 -1
- package/dist/viewer/index.html +288 -140
- package/integrations/hermes/README.md +84 -0
- package/integrations/hermes/__init__.py +669 -0
- package/integrations/hermes/plugin.yaml +27 -0
- package/integrations/omp/LICENSE +190 -0
- package/integrations/omp/README.md +76 -0
- package/integrations/omp/capture.ts +1 -0
- package/integrations/omp/dist/index.mjs +1450 -0
- package/integrations/omp/index.ts +488 -0
- package/integrations/omp/package.json +13 -0
- package/integrations/omp/security.ts +67 -0
- package/integrations/omp/skills/agentmemory-agents/REFERENCE.md +32 -0
- package/integrations/omp/skills/agentmemory-agents/SKILL.md +48 -0
- package/integrations/omp/skills/agentmemory-agents/TROUBLESHOOTING.md +70 -0
- package/integrations/omp/skills/agentmemory-architecture/SKILL.md +33 -0
- package/integrations/omp/skills/agentmemory-architecture/TROUBLESHOOTING.md +70 -0
- package/integrations/omp/skills/agentmemory-config/REFERENCE.md +90 -0
- package/integrations/omp/skills/agentmemory-config/SKILL.md +78 -0
- package/integrations/omp/skills/agentmemory-config/TROUBLESHOOTING.md +70 -0
- package/integrations/omp/skills/agentmemory-hooks/REFERENCE.md +20 -0
- package/integrations/omp/skills/agentmemory-hooks/SKILL.md +49 -0
- package/integrations/omp/skills/agentmemory-hooks/TROUBLESHOOTING.md +70 -0
- package/integrations/omp/skills/agentmemory-mcp-tools/REFERENCE.md +66 -0
- package/integrations/omp/skills/agentmemory-mcp-tools/SKILL.md +42 -0
- package/integrations/omp/skills/agentmemory-mcp-tools/TROUBLESHOOTING.md +70 -0
- package/integrations/omp/skills/agentmemory-rest-api/REFERENCE.md +158 -0
- package/integrations/omp/skills/agentmemory-rest-api/SKILL.md +49 -0
- package/integrations/omp/skills/agentmemory-rest-api/TROUBLESHOOTING.md +70 -0
- package/integrations/omp/skills/commit-context/EXAMPLES.md +71 -0
- package/integrations/omp/skills/commit-context/SKILL.md +64 -0
- package/integrations/omp/skills/commit-context/TROUBLESHOOTING.md +70 -0
- package/integrations/omp/skills/commit-history/EXAMPLES.md +71 -0
- package/integrations/omp/skills/commit-history/SKILL.md +62 -0
- package/integrations/omp/skills/commit-history/TROUBLESHOOTING.md +70 -0
- package/integrations/omp/skills/forget/EXAMPLES.md +40 -0
- package/integrations/omp/skills/forget/SKILL.md +73 -0
- package/integrations/omp/skills/forget/TROUBLESHOOTING.md +70 -0
- package/integrations/omp/skills/handoff/EXAMPLES.md +57 -0
- package/integrations/omp/skills/handoff/SKILL.md +75 -0
- package/integrations/omp/skills/handoff/TROUBLESHOOTING.md +70 -0
- package/integrations/omp/skills/lesson/SKILL.md +64 -0
- package/integrations/omp/skills/lesson/TROUBLESHOOTING.md +70 -0
- package/integrations/omp/skills/memory-discipline/SKILL.md +65 -0
- package/integrations/omp/skills/memory-discipline/TROUBLESHOOTING.md +70 -0
- package/integrations/omp/skills/recall/EXAMPLES.md +74 -0
- package/integrations/omp/skills/recall/SKILL.md +74 -0
- package/integrations/omp/skills/recall/TROUBLESHOOTING.md +70 -0
- package/integrations/omp/skills/recap/EXAMPLES.md +62 -0
- package/integrations/omp/skills/recap/SKILL.md +68 -0
- package/integrations/omp/skills/recap/TROUBLESHOOTING.md +70 -0
- package/integrations/omp/skills/remember/EXAMPLES.md +67 -0
- package/integrations/omp/skills/remember/SKILL.md +66 -0
- package/integrations/omp/skills/remember/TROUBLESHOOTING.md +70 -0
- package/integrations/omp/skills/session-history/EXAMPLES.md +59 -0
- package/integrations/omp/skills/session-history/SKILL.md +67 -0
- package/integrations/omp/skills/session-history/TROUBLESHOOTING.md +70 -0
- package/integrations/omp/skills/write-agentmemory-skill/SKILL.md +41 -0
- package/integrations/omp/skills/write-agentmemory-skill/TROUBLESHOOTING.md +70 -0
- package/integrations/openclaw/LICENSE +190 -0
- package/integrations/openclaw/README.md +88 -0
- package/integrations/openclaw/openclaw.plugin.json +71 -0
- package/integrations/openclaw/package.json +38 -0
- package/integrations/openclaw/plugin.mjs +425 -0
- package/integrations/openclaw/plugin.yaml +26 -0
- package/integrations/openclaw/skills/agentmemory-agents/REFERENCE.md +32 -0
- package/integrations/openclaw/skills/agentmemory-agents/SKILL.md +48 -0
- package/integrations/openclaw/skills/agentmemory-agents/TROUBLESHOOTING.md +70 -0
- package/integrations/openclaw/skills/agentmemory-architecture/SKILL.md +33 -0
- package/integrations/openclaw/skills/agentmemory-architecture/TROUBLESHOOTING.md +70 -0
- package/integrations/openclaw/skills/agentmemory-config/REFERENCE.md +90 -0
- package/integrations/openclaw/skills/agentmemory-config/SKILL.md +78 -0
- package/integrations/openclaw/skills/agentmemory-config/TROUBLESHOOTING.md +70 -0
- package/integrations/openclaw/skills/agentmemory-hooks/REFERENCE.md +20 -0
- package/integrations/openclaw/skills/agentmemory-hooks/SKILL.md +49 -0
- package/integrations/openclaw/skills/agentmemory-hooks/TROUBLESHOOTING.md +70 -0
- package/integrations/openclaw/skills/agentmemory-mcp-tools/REFERENCE.md +66 -0
- package/integrations/openclaw/skills/agentmemory-mcp-tools/SKILL.md +42 -0
- package/integrations/openclaw/skills/agentmemory-mcp-tools/TROUBLESHOOTING.md +70 -0
- package/integrations/openclaw/skills/agentmemory-rest-api/REFERENCE.md +158 -0
- package/integrations/openclaw/skills/agentmemory-rest-api/SKILL.md +49 -0
- package/integrations/openclaw/skills/agentmemory-rest-api/TROUBLESHOOTING.md +70 -0
- package/integrations/openclaw/skills/commit-context/EXAMPLES.md +71 -0
- package/integrations/openclaw/skills/commit-context/SKILL.md +64 -0
- package/integrations/openclaw/skills/commit-context/TROUBLESHOOTING.md +70 -0
- package/integrations/openclaw/skills/commit-history/EXAMPLES.md +71 -0
- package/integrations/openclaw/skills/commit-history/SKILL.md +62 -0
- package/integrations/openclaw/skills/commit-history/TROUBLESHOOTING.md +70 -0
- package/integrations/openclaw/skills/forget/EXAMPLES.md +40 -0
- package/integrations/openclaw/skills/forget/SKILL.md +73 -0
- package/integrations/openclaw/skills/forget/TROUBLESHOOTING.md +70 -0
- package/integrations/openclaw/skills/handoff/EXAMPLES.md +57 -0
- package/integrations/openclaw/skills/handoff/SKILL.md +75 -0
- package/integrations/openclaw/skills/handoff/TROUBLESHOOTING.md +70 -0
- package/integrations/openclaw/skills/lesson/SKILL.md +64 -0
- package/integrations/openclaw/skills/lesson/TROUBLESHOOTING.md +70 -0
- package/integrations/openclaw/skills/memory-discipline/SKILL.md +65 -0
- package/integrations/openclaw/skills/memory-discipline/TROUBLESHOOTING.md +70 -0
- package/integrations/openclaw/skills/recall/EXAMPLES.md +74 -0
- package/integrations/openclaw/skills/recall/SKILL.md +74 -0
- package/integrations/openclaw/skills/recall/TROUBLESHOOTING.md +70 -0
- package/integrations/openclaw/skills/recap/EXAMPLES.md +62 -0
- package/integrations/openclaw/skills/recap/SKILL.md +68 -0
- package/integrations/openclaw/skills/recap/TROUBLESHOOTING.md +70 -0
- package/integrations/openclaw/skills/remember/EXAMPLES.md +67 -0
- package/integrations/openclaw/skills/remember/SKILL.md +66 -0
- package/integrations/openclaw/skills/remember/TROUBLESHOOTING.md +70 -0
- package/integrations/openclaw/skills/session-history/EXAMPLES.md +59 -0
- package/integrations/openclaw/skills/session-history/SKILL.md +67 -0
- package/integrations/openclaw/skills/session-history/TROUBLESHOOTING.md +70 -0
- package/integrations/openclaw/skills/write-agentmemory-skill/SKILL.md +41 -0
- package/integrations/openclaw/skills/write-agentmemory-skill/TROUBLESHOOTING.md +70 -0
- package/integrations/pi/LICENSE +190 -0
- package/integrations/pi/README.md +45 -51
- package/integrations/pi/dist/index.mjs +1379 -0
- package/integrations/pi/index.ts +138 -171
- package/integrations/pi/package.json +16 -6
- package/integrations/pi/security.ts +6 -26
- package/integrations/pi/skills/agentmemory-agents/REFERENCE.md +32 -0
- package/integrations/pi/skills/agentmemory-agents/SKILL.md +48 -0
- package/integrations/pi/skills/agentmemory-agents/TROUBLESHOOTING.md +70 -0
- package/integrations/pi/skills/agentmemory-architecture/SKILL.md +33 -0
- package/integrations/pi/skills/agentmemory-architecture/TROUBLESHOOTING.md +70 -0
- package/integrations/pi/skills/agentmemory-config/REFERENCE.md +90 -0
- package/integrations/pi/skills/agentmemory-config/SKILL.md +78 -0
- package/integrations/pi/skills/agentmemory-config/TROUBLESHOOTING.md +70 -0
- package/integrations/pi/skills/agentmemory-hooks/REFERENCE.md +20 -0
- package/integrations/pi/skills/agentmemory-hooks/SKILL.md +49 -0
- package/integrations/pi/skills/agentmemory-hooks/TROUBLESHOOTING.md +70 -0
- package/integrations/pi/skills/agentmemory-mcp-tools/REFERENCE.md +66 -0
- package/integrations/pi/skills/agentmemory-mcp-tools/SKILL.md +42 -0
- package/integrations/pi/skills/agentmemory-mcp-tools/TROUBLESHOOTING.md +70 -0
- package/integrations/pi/skills/agentmemory-rest-api/REFERENCE.md +158 -0
- package/integrations/pi/skills/agentmemory-rest-api/SKILL.md +49 -0
- package/integrations/pi/skills/agentmemory-rest-api/TROUBLESHOOTING.md +70 -0
- package/integrations/pi/skills/commit-context/EXAMPLES.md +71 -0
- package/integrations/pi/skills/commit-context/SKILL.md +64 -0
- package/integrations/pi/skills/commit-context/TROUBLESHOOTING.md +70 -0
- package/integrations/pi/skills/commit-history/EXAMPLES.md +71 -0
- package/integrations/pi/skills/commit-history/SKILL.md +62 -0
- package/integrations/pi/skills/commit-history/TROUBLESHOOTING.md +70 -0
- package/integrations/pi/skills/forget/EXAMPLES.md +40 -0
- package/integrations/pi/skills/forget/SKILL.md +73 -0
- package/integrations/pi/skills/forget/TROUBLESHOOTING.md +70 -0
- package/integrations/pi/skills/handoff/EXAMPLES.md +57 -0
- package/integrations/pi/skills/handoff/SKILL.md +75 -0
- package/integrations/pi/skills/handoff/TROUBLESHOOTING.md +70 -0
- package/integrations/pi/skills/lesson/SKILL.md +64 -0
- package/integrations/pi/skills/lesson/TROUBLESHOOTING.md +70 -0
- package/integrations/pi/skills/memory-discipline/SKILL.md +65 -0
- package/integrations/pi/skills/memory-discipline/TROUBLESHOOTING.md +70 -0
- package/integrations/pi/skills/recall/EXAMPLES.md +74 -0
- package/integrations/pi/skills/recall/SKILL.md +74 -0
- package/integrations/pi/skills/recall/TROUBLESHOOTING.md +70 -0
- package/integrations/pi/skills/recap/EXAMPLES.md +62 -0
- package/integrations/pi/skills/recap/SKILL.md +68 -0
- package/integrations/pi/skills/recap/TROUBLESHOOTING.md +70 -0
- package/integrations/pi/skills/remember/EXAMPLES.md +67 -0
- package/integrations/pi/skills/remember/SKILL.md +66 -0
- package/integrations/pi/skills/remember/TROUBLESHOOTING.md +70 -0
- package/integrations/pi/skills/session-history/EXAMPLES.md +59 -0
- package/integrations/pi/skills/session-history/SKILL.md +67 -0
- package/integrations/pi/skills/session-history/TROUBLESHOOTING.md +70 -0
- package/integrations/pi/skills/write-agentmemory-skill/SKILL.md +41 -0
- package/integrations/pi/skills/write-agentmemory-skill/TROUBLESHOOTING.md +70 -0
- package/package.json +32 -11
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/.codex-plugin/plugin.json +4 -3
- package/plugin/.devin-plugin/plugin.json +5 -3
- package/plugin/cursor/hooks.json +23 -8
- package/plugin/hooks.json +67 -0
- package/plugin/opencode/README.md +1 -1
- package/plugin/opencode/agentmemory-capture.ts +25 -11
- package/plugin/opencode/plugin.json +1 -1
- package/plugin/plugin.json +1 -1
- package/plugin/scripts/_capture.d.mts +5 -2
- package/plugin/scripts/_capture.d.mts.map +1 -1
- package/plugin/scripts/_capture.mjs +55 -19
- package/plugin/scripts/_capture.mjs.map +1 -1
- package/plugin/scripts/cursor/run-detached.d.mts +1 -0
- package/plugin/scripts/cursor/run-detached.mjs +786 -0
- package/plugin/scripts/cursor/run-detached.mjs.map +1 -0
- package/plugin/scripts/cursor/run-hook.d.mts +1 -0
- package/plugin/scripts/cursor/run-hook.mjs +704 -0
- package/plugin/scripts/cursor/run-hook.mjs.map +1 -0
- package/plugin/scripts/notification.mjs +20 -6
- package/plugin/scripts/notification.mjs.map +1 -1
- package/plugin/scripts/plugin-bridge.mjs +37 -6
- package/plugin/scripts/post-commit.mjs +25 -5
- package/plugin/scripts/post-commit.mjs.map +1 -1
- package/plugin/scripts/post-tool-failure.mjs +12 -4
- package/plugin/scripts/post-tool-failure.mjs.map +1 -1
- package/plugin/scripts/post-tool-use.mjs +12 -4
- package/plugin/scripts/post-tool-use.mjs.map +1 -1
- package/plugin/scripts/pre-compact.mjs +37 -10
- package/plugin/scripts/pre-compact.mjs.map +1 -1
- package/plugin/scripts/pre-tool-use.mjs +25 -5
- package/plugin/scripts/pre-tool-use.mjs.map +1 -1
- package/plugin/scripts/prompt-submit.mjs +12 -4
- package/plugin/scripts/prompt-submit.mjs.map +1 -1
- package/plugin/scripts/session-end.mjs +47 -16
- package/plugin/scripts/session-end.mjs.map +1 -1
- package/plugin/scripts/session-start.mjs +37 -10
- package/plugin/scripts/session-start.mjs.map +1 -1
- package/plugin/scripts/stop.mjs +74 -72
- package/plugin/scripts/stop.mjs.map +1 -1
- package/plugin/scripts/subagent-start.mjs +13 -5
- package/plugin/scripts/subagent-start.mjs.map +1 -1
- package/plugin/scripts/subagent-stop.mjs +18 -6
- package/plugin/scripts/subagent-stop.mjs.map +1 -1
- package/plugin/scripts/task-completed.mjs +13 -5
- package/plugin/scripts/task-completed.mjs.map +1 -1
- package/plugin/skills/_shared/TROUBLESHOOTING.md +21 -7
- package/plugin/skills/agentmemory-agents/REFERENCE.md +7 -6
- package/plugin/skills/agentmemory-agents/SKILL.md +19 -5
- package/plugin/skills/agentmemory-agents/TROUBLESHOOTING.md +70 -0
- package/plugin/skills/agentmemory-architecture/SKILL.md +4 -4
- package/plugin/skills/agentmemory-architecture/TROUBLESHOOTING.md +70 -0
- package/plugin/skills/agentmemory-config/REFERENCE.md +12 -15
- package/plugin/skills/agentmemory-config/SKILL.md +7 -3
- package/plugin/skills/agentmemory-config/TROUBLESHOOTING.md +70 -0
- package/plugin/skills/agentmemory-hooks/SKILL.md +15 -5
- package/plugin/skills/agentmemory-hooks/TROUBLESHOOTING.md +70 -0
- package/plugin/skills/agentmemory-mcp-tools/REFERENCE.md +4 -4
- package/plugin/skills/agentmemory-mcp-tools/SKILL.md +6 -3
- package/plugin/skills/agentmemory-mcp-tools/TROUBLESHOOTING.md +70 -0
- package/plugin/skills/agentmemory-rest-api/REFERENCE.md +9 -1
- package/plugin/skills/agentmemory-rest-api/SKILL.md +12 -6
- package/plugin/skills/agentmemory-rest-api/TROUBLESHOOTING.md +70 -0
- package/plugin/skills/commit-context/SKILL.md +1 -1
- package/plugin/skills/commit-context/TROUBLESHOOTING.md +70 -0
- package/plugin/skills/commit-history/SKILL.md +1 -1
- package/plugin/skills/commit-history/TROUBLESHOOTING.md +70 -0
- package/plugin/skills/forget/EXAMPLES.md +19 -54
- package/plugin/skills/forget/SKILL.md +16 -12
- package/plugin/skills/forget/TROUBLESHOOTING.md +70 -0
- package/plugin/skills/handoff/EXAMPLES.md +5 -4
- package/plugin/skills/handoff/SKILL.md +10 -5
- package/plugin/skills/handoff/TROUBLESHOOTING.md +70 -0
- package/plugin/skills/lesson/SKILL.md +1 -1
- package/plugin/skills/lesson/TROUBLESHOOTING.md +70 -0
- package/plugin/skills/memory-discipline/SKILL.md +1 -1
- package/plugin/skills/memory-discipline/TROUBLESHOOTING.md +70 -0
- package/plugin/skills/recall/SKILL.md +18 -7
- package/plugin/skills/recall/TROUBLESHOOTING.md +70 -0
- package/plugin/skills/recap/EXAMPLES.md +5 -3
- package/plugin/skills/recap/SKILL.md +11 -6
- package/plugin/skills/recap/TROUBLESHOOTING.md +70 -0
- package/plugin/skills/remember/EXAMPLES.md +3 -3
- package/plugin/skills/remember/SKILL.md +1 -1
- package/plugin/skills/remember/TROUBLESHOOTING.md +70 -0
- package/plugin/skills/session-history/EXAMPLES.md +2 -2
- package/plugin/skills/session-history/SKILL.md +10 -4
- package/plugin/skills/session-history/TROUBLESHOOTING.md +70 -0
- package/plugin/skills/write-agentmemory-skill/SKILL.md +2 -1
- package/plugin/skills/write-agentmemory-skill/TROUBLESHOOTING.md +70 -0
- package/dist/connect-B4_ca6BD.mjs.map +0 -1
- package/dist/docker-compose.yml +0 -73
- package/dist/iii-config.docker.yaml +0 -53
- package/dist/iii-config.yaml +0 -63
- package/dist/keyed-mutex-DchXsyfP.mjs.map +0 -1
- package/dist/secret-store-BnY3A50C.mjs.map +0 -1
- package/dist/src-Jsq9LCeH.mjs.map +0 -1
- package/dist/standalone-DKCdrf1d.mjs.map +0 -1
- package/dist/status-IRz7ta8-.mjs +0 -2344
- package/dist/status-IRz7ta8-.mjs.map +0 -1
- package/docker-compose.yml +0 -73
- package/iii-config.docker.yaml +0 -53
- package/iii-config.yaml +0 -63
package/plugin/cursor/hooks.json
CHANGED
|
@@ -3,38 +3,53 @@
|
|
|
3
3
|
"hooks": {
|
|
4
4
|
"sessionStart": [
|
|
5
5
|
{
|
|
6
|
-
"command": "node ${CURSOR_PLUGIN_ROOT}/plugin/scripts/
|
|
6
|
+
"command": "node \"${CURSOR_PLUGIN_ROOT}/plugin/scripts/cursor/run-hook.mjs\" sessionStart"
|
|
7
7
|
}
|
|
8
8
|
],
|
|
9
9
|
"beforeSubmitPrompt": [
|
|
10
10
|
{
|
|
11
|
-
"command": "node ${CURSOR_PLUGIN_ROOT}/plugin/scripts/
|
|
11
|
+
"command": "node \"${CURSOR_PLUGIN_ROOT}/plugin/scripts/cursor/run-hook.mjs\" beforeSubmitPrompt"
|
|
12
12
|
}
|
|
13
13
|
],
|
|
14
14
|
"preToolUse": [
|
|
15
15
|
{
|
|
16
|
-
"
|
|
17
|
-
"
|
|
16
|
+
"matcher": "Edit|Write|Read|Glob|Grep|Shell",
|
|
17
|
+
"command": "node \"${CURSOR_PLUGIN_ROOT}/plugin/scripts/cursor/run-hook.mjs\" preToolUse"
|
|
18
18
|
}
|
|
19
19
|
],
|
|
20
20
|
"postToolUse": [
|
|
21
21
|
{
|
|
22
|
-
"command": "node ${CURSOR_PLUGIN_ROOT}/plugin/scripts/
|
|
22
|
+
"command": "node \"${CURSOR_PLUGIN_ROOT}/plugin/scripts/cursor/run-hook.mjs\" postToolUse"
|
|
23
23
|
}
|
|
24
24
|
],
|
|
25
25
|
"postToolUseFailure": [
|
|
26
26
|
{
|
|
27
|
-
"command": "node ${CURSOR_PLUGIN_ROOT}/plugin/scripts/
|
|
27
|
+
"command": "node \"${CURSOR_PLUGIN_ROOT}/plugin/scripts/cursor/run-hook.mjs\" postToolUseFailure"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"preCompact": [
|
|
31
|
+
{
|
|
32
|
+
"command": "node \"${CURSOR_PLUGIN_ROOT}/plugin/scripts/cursor/run-hook.mjs\" preCompact"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"subagentStart": [
|
|
36
|
+
{
|
|
37
|
+
"command": "node \"${CURSOR_PLUGIN_ROOT}/plugin/scripts/cursor/run-hook.mjs\" subagentStart"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"subagentStop": [
|
|
41
|
+
{
|
|
42
|
+
"command": "node \"${CURSOR_PLUGIN_ROOT}/plugin/scripts/cursor/run-hook.mjs\" subagentStop"
|
|
28
43
|
}
|
|
29
44
|
],
|
|
30
45
|
"stop": [
|
|
31
46
|
{
|
|
32
|
-
"command": "node ${CURSOR_PLUGIN_ROOT}/plugin/scripts/
|
|
47
|
+
"command": "node \"${CURSOR_PLUGIN_ROOT}/plugin/scripts/cursor/run-detached.mjs\" stop"
|
|
33
48
|
}
|
|
34
49
|
],
|
|
35
50
|
"sessionEnd": [
|
|
36
51
|
{
|
|
37
|
-
"command": "node ${CURSOR_PLUGIN_ROOT}/plugin/scripts/
|
|
52
|
+
"command": "node \"${CURSOR_PLUGIN_ROOT}/plugin/scripts/cursor/run-detached.mjs\" sessionEnd"
|
|
38
53
|
}
|
|
39
54
|
]
|
|
40
55
|
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hooks": {
|
|
3
|
+
"SessionStart": [
|
|
4
|
+
{
|
|
5
|
+
"hooks": [
|
|
6
|
+
{
|
|
7
|
+
"type": "command",
|
|
8
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/session-start.mjs\""
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"UserPromptSubmit": [
|
|
14
|
+
{
|
|
15
|
+
"hooks": [
|
|
16
|
+
{
|
|
17
|
+
"type": "command",
|
|
18
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/prompt-submit.mjs\""
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"PreToolUse": [
|
|
24
|
+
{
|
|
25
|
+
"matcher": "^(exec|edit|write|read|apply_patch|grep|glob)$",
|
|
26
|
+
"hooks": [
|
|
27
|
+
{
|
|
28
|
+
"type": "command",
|
|
29
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/pre-tool-use.mjs\""
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"PostToolUse": [
|
|
35
|
+
{
|
|
36
|
+
"matcher": "",
|
|
37
|
+
"hooks": [
|
|
38
|
+
{
|
|
39
|
+
"type": "command",
|
|
40
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/post-tool-use.mjs\""
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"Stop": [
|
|
46
|
+
{
|
|
47
|
+
"matcher": "",
|
|
48
|
+
"hooks": [
|
|
49
|
+
{
|
|
50
|
+
"type": "command",
|
|
51
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/stop.mjs\""
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"SessionEnd": [
|
|
57
|
+
{
|
|
58
|
+
"hooks": [
|
|
59
|
+
{
|
|
60
|
+
"type": "command",
|
|
61
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/session-end.mjs\""
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -440,7 +440,7 @@ agentmemory ──push──▶ OpenCode system prompt
|
|
|
440
440
|
|
|
441
441
|
### Why OpenCode goes direct
|
|
442
442
|
|
|
443
|
-
agentmemory
|
|
443
|
+
agentmemory persists state through the iii state worker, using file-backed KV (`data/state_store.db`) by default or Redis when configured. Adding an intermediate MEMORY.md file would duplicate data, introduce sync lag, and require the model to re-parse structured context from markdown. Direct injection delivers the same data with lower latency and zero staleness — the agent always sees what agentmemory knows right now.
|
|
444
444
|
|
|
445
445
|
## Slash commands
|
|
446
446
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Plugin } from "@opencode-ai/plugin";
|
|
2
2
|
import { execFileSync } from "node:child_process";
|
|
3
|
-
import { readFileSync } from "node:fs";
|
|
3
|
+
import { readFileSync, realpathSync } from "node:fs";
|
|
4
4
|
import { homedir } from "node:os";
|
|
5
|
-
import { basename, join } from "node:path";
|
|
5
|
+
import { basename, dirname, join, resolve } from "node:path";
|
|
6
6
|
|
|
7
7
|
const API = process.env.AGENTMEMORY_URL || "http://localhost:3111";
|
|
8
8
|
// OpenCode reports tool names in lowercase ("read", "edit", ...); matching is
|
|
@@ -116,7 +116,7 @@ async function observe(
|
|
|
116
116
|
let activeSessionId: string | null = null;
|
|
117
117
|
let pendingConfig: Record<string, unknown> | null = null;
|
|
118
118
|
// Default scope resolved at plugin init (same resolution order as the hooks'
|
|
119
|
-
// resolveProject: env override, git
|
|
119
|
+
// resolveProject: env override, git repository basename, cwd basename). In a
|
|
120
120
|
// long-lived OpenCode process serving multiple directories these defaults are
|
|
121
121
|
// only a fallback — attribution is per-session via sessionProjects, resolved
|
|
122
122
|
// from each session's own directory at session.created. Module-level-only
|
|
@@ -138,13 +138,19 @@ function resolveProjectName(dir: string): string {
|
|
|
138
138
|
const cached = projectNameCache.get(dir);
|
|
139
139
|
if (cached !== undefined) return cached;
|
|
140
140
|
try {
|
|
141
|
-
const top
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
141
|
+
const [top, gitDir, commonDir] = execFileSync(
|
|
142
|
+
"git",
|
|
143
|
+
["rev-parse", "--show-toplevel", "--git-dir", "--git-common-dir"],
|
|
144
|
+
{
|
|
145
|
+
cwd: dir,
|
|
146
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
147
|
+
encoding: "utf8",
|
|
148
|
+
},
|
|
149
|
+
)
|
|
150
|
+
.trim()
|
|
151
|
+
.split(/\r?\n/);
|
|
146
152
|
if (top) {
|
|
147
|
-
const name = basename(top);
|
|
153
|
+
const name = basename(repositoryRoot(dir, top, gitDir, commonDir));
|
|
148
154
|
projectNameCache.set(dir, name);
|
|
149
155
|
return name;
|
|
150
156
|
}
|
|
@@ -155,6 +161,14 @@ function resolveProjectName(dir: string): string {
|
|
|
155
161
|
projectNameCache.set(dir, fallback);
|
|
156
162
|
return fallback;
|
|
157
163
|
}
|
|
164
|
+
|
|
165
|
+
function repositoryRoot(dir: string, top: string, gitDir?: string, commonDir?: string): string {
|
|
166
|
+
if (!gitDir || !commonDir) return top;
|
|
167
|
+
const physical = realpathSync(dir);
|
|
168
|
+
const common = resolve(physical, commonDir);
|
|
169
|
+
if (resolve(physical, gitDir) === common || basename(common) !== ".git") return top;
|
|
170
|
+
return dirname(common);
|
|
171
|
+
}
|
|
158
172
|
const stashedFiles = new Map<string, Set<string>>();
|
|
159
173
|
const seenSubtaskIds = new Map<string, Set<string>>();
|
|
160
174
|
const seenToolCallIds = new Map<string, Set<string>>();
|
|
@@ -380,7 +394,7 @@ const v1Hooks: Plugin = async (ctx) => {
|
|
|
380
394
|
if (DEBUG) console.error("[agentmemory] session.deleted with no session ID");
|
|
381
395
|
return;
|
|
382
396
|
}
|
|
383
|
-
await post("/session/end", { sessionId: sid });
|
|
397
|
+
await post("/session/end", { sessionId: sid, final: true });
|
|
384
398
|
post("/crystals/auto", { olderThanDays: 7 }, 30000);
|
|
385
399
|
post("/consolidate-pipeline", { tier: "all", force: true }, 30000);
|
|
386
400
|
if (sid === activeSessionId) activeSessionId = null;
|
|
@@ -1260,7 +1274,7 @@ async function v2Setup(ctx: any) {
|
|
|
1260
1274
|
case "session.deleted": {
|
|
1261
1275
|
const sid = (data.sessionID as string) || activeSessionId;
|
|
1262
1276
|
if (!sid) return;
|
|
1263
|
-
await post("/session/end", { sessionId: sid });
|
|
1277
|
+
await post("/session/end", { sessionId: sid, final: true });
|
|
1264
1278
|
void post("/crystals/auto", { olderThanDays: 7 }, 30000);
|
|
1265
1279
|
void post("/consolidate-pipeline", { tier: "all", force: true }, 30000);
|
|
1266
1280
|
if (sid === activeSessionId) activeSessionId = null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentmemory-capture",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.31",
|
|
4
4
|
"description": "OpenCode plugin for agentmemory — full Claude Code hook parity: session lifecycle (create/idle/status/compacted/update/diff/delete/error), messages & prompts (chat.message, message.updated user+assistant, message.removed), tool lifecycle (ToolPart states with timing), part tracking (subtask, step-finish, reasoning, file, patch, compaction, agent, retry), file enrichment pipeline, permissions, task tracking (w/ priority), commands, config & model tracking. 22 hooks, 2 slash commands.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Rohit Ghumare",
|
package/plugin/plugin.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentmemory",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.31",
|
|
4
4
|
"description": "Persistent memory for AI coding agents -- captures tool usage, compresses via LLM, injects context into future sessions. 12 hooks, 54 MCP tools, 17 skills, real-time viewer.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Rohit Ghumare",
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
//#region src/functions/privacy.d.ts
|
|
2
|
+
declare function stripPrivateData(input: string): string;
|
|
3
|
+
//#endregion
|
|
1
4
|
//#region src/hooks/_capture.d.ts
|
|
2
|
-
declare const REST_URL:
|
|
5
|
+
declare const REST_URL: any;
|
|
3
6
|
type CaptureOutcome = "delivered" | "duplicate" | "rejected" | "spooled" | "dropped";
|
|
4
7
|
interface ObserveBody {
|
|
5
8
|
hookType: string;
|
|
@@ -18,5 +21,5 @@ declare function captureObservation(body: ObserveBody, timeoutMs: number): Promi
|
|
|
18
21
|
declare function isDrainChild(): boolean;
|
|
19
22
|
declare function runDrainChild(): Promise<void>;
|
|
20
23
|
//#endregion
|
|
21
|
-
export { CaptureOutcome, ObserveBody, REST_URL, authHeaders, captureObservation, isDrainChild, runDrainChild, withEventId };
|
|
24
|
+
export { CaptureOutcome, ObserveBody, REST_URL, authHeaders, captureObservation, isDrainChild, runDrainChild, stripPrivateData, withEventId };
|
|
22
25
|
//# sourceMappingURL=_capture.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_capture.d.mts","names":[],"sources":["../../src/hooks/_capture.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"_capture.d.mts","names":[],"sources":["../../src/functions/privacy.ts","../../src/hooks/_capture.ts"],"mappings":";iBA2BgB,gBAAA,CAAiB,KAAA;;;cCTpB,QAAA;AAAA,KAOD,cAAA;AAAA,UAEK,WAAA;EACf,QAAA;EACA,SAAA;EACA,OAAA;EACA,GAAA;EACA,SAAA;EACA,IAAA;EACA,OAAA;AAAA;AAAA,iBAGc,WAAA,CAAA,GAAe,MAAA;AAAA,iBAMf,WAAA,CACd,IAAA,EAAM,WAAA,EACN,IAAA,EAAM,MAAA,mBACN,OAAA,YACA,OAAA;EAAW,MAAA;AAAA,IACV,WAAA;AAAA,iBAoDmB,kBAAA,CAAmB,IAAA,EAAM,WAAA,EAAa,SAAA,WAAoB,OAAA,CAAQ,cAAA;AAAA,iBAmBxE,YAAA,CAAA;AAAA,iBAIM,aAAA,CAAA,GAAiB,OAAA"}
|
|
@@ -6,7 +6,7 @@ import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
|
6
6
|
//#region src/secret-store.ts
|
|
7
7
|
const SECRET_KEY = "AGENTMEMORY_SECRET";
|
|
8
8
|
function agentmemoryHomeDir() {
|
|
9
|
-
return join(homedir(), ".agentmemory");
|
|
9
|
+
return process.env["AGENTMEMORY_DATA_DIR"] || join(homedir(), ".agentmemory");
|
|
10
10
|
}
|
|
11
11
|
function secretFilePath() {
|
|
12
12
|
return join(agentmemoryHomeDir(), "secret");
|
|
@@ -30,7 +30,7 @@ function unquote(value) {
|
|
|
30
30
|
function readEnvFileSecret() {
|
|
31
31
|
let content;
|
|
32
32
|
try {
|
|
33
|
-
content = readFileSync(join(
|
|
33
|
+
content = readFileSync(process.env["AGENTMEMORY_ENV_FILE"] || join(homedir(), ".agentmemory", ".env"), "utf-8");
|
|
34
34
|
} catch {
|
|
35
35
|
return "";
|
|
36
36
|
}
|
|
@@ -46,13 +46,29 @@ function readEnvFileSecret() {
|
|
|
46
46
|
}
|
|
47
47
|
return found;
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function readSecretFile(path) {
|
|
50
50
|
try {
|
|
51
|
-
return usable(readFileSync(
|
|
51
|
+
return usable(readFileSync(path, "utf-8"));
|
|
52
52
|
} catch {
|
|
53
53
|
return "";
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
+
function legacyDataDirSecretPaths(env = process.env) {
|
|
57
|
+
const dataDir = env["AGENTMEMORY_DATA_DIR"];
|
|
58
|
+
if (!dataDir) return [];
|
|
59
|
+
const paths = [
|
|
60
|
+
join(dataDir, "secret"),
|
|
61
|
+
join(dataDir, ".hmac"),
|
|
62
|
+
join(dataDir, "..", ".hmac")
|
|
63
|
+
];
|
|
64
|
+
return [...new Set(paths.filter((path) => path !== secretFilePath()))];
|
|
65
|
+
}
|
|
66
|
+
function readStoredSecret(env = process.env) {
|
|
67
|
+
const canonicalPath = canonicalSecretPath();
|
|
68
|
+
const localPath = secretFilePath();
|
|
69
|
+
const legacyPaths = legacyDataDirSecretPaths(env);
|
|
70
|
+
return readSecretFile(canonicalPath) || (localPath === canonicalPath ? "" : readSecretFile(localPath)) || legacyPaths.map(readSecretFile).find(Boolean) || "";
|
|
71
|
+
}
|
|
56
72
|
function isLoopbackUrl(url) {
|
|
57
73
|
let hostname;
|
|
58
74
|
try {
|
|
@@ -66,8 +82,12 @@ function isLoopbackUrl(url) {
|
|
|
66
82
|
function resolveClientSecret(baseUrl, env = process.env) {
|
|
67
83
|
const fromEnv = usable(env[SECRET_KEY]);
|
|
68
84
|
if (fromEnv) return fromEnv;
|
|
85
|
+
if (env.AGENTMEMORY_CREDENTIAL_MODE === "explicit") return "";
|
|
69
86
|
if (!isLoopbackUrl(baseUrl)) return "";
|
|
70
|
-
return readEnvFileSecret() || readStoredSecret();
|
|
87
|
+
return readEnvFileSecret() || readStoredSecret(env);
|
|
88
|
+
}
|
|
89
|
+
function canonicalSecretPath() {
|
|
90
|
+
return join(homedir(), ".agentmemory", "secret");
|
|
71
91
|
}
|
|
72
92
|
//#endregion
|
|
73
93
|
//#region src/capture/event-id.ts
|
|
@@ -220,9 +240,9 @@ const PRIVATE_TAG_RE = /<private>[\s\S]*?<\/private>/gi;
|
|
|
220
240
|
const SECRET_PATTERN_SOURCES = [
|
|
221
241
|
/(?:api[_-]?key|secret|token|password|credential|auth)[\s]*[=:]\s*["']?[A-Za-z0-9_\-/.+]{20,}["']?/gi,
|
|
222
242
|
/Bearer\s+[A-Za-z0-9._\-+/=]{20,}/gi,
|
|
223
|
-
/sk-proj-[A-Za-z0-9\-_]{20,}/
|
|
224
|
-
/(?:sk|pk|rk|ak)-[A-Za-z0-9][A-Za-z0-9\-_]{19,}/
|
|
225
|
-
/sk-ant-[A-Za-z0-9\-_]{20,}/
|
|
243
|
+
/(?<![\p{L}\p{N}\p{M}_])sk-proj-[A-Za-z0-9\-_]{20,}/gu,
|
|
244
|
+
/(?<![\p{L}\p{N}\p{M}_])(?:sk|pk|rk|ak)-[A-Za-z0-9][A-Za-z0-9\-_]{19,}/gu,
|
|
245
|
+
/(?<![\p{L}\p{N}\p{M}_])sk-ant-[A-Za-z0-9\-_]{20,}/gu,
|
|
226
246
|
/gh[pus]_[A-Za-z0-9]{36,}/g,
|
|
227
247
|
/github_pat_[A-Za-z0-9_]{22,}/g,
|
|
228
248
|
/xoxb-[A-Za-z0-9\-]+/g,
|
|
@@ -245,6 +265,29 @@ function stripPrivateData(input) {
|
|
|
245
265
|
}
|
|
246
266
|
return result;
|
|
247
267
|
}
|
|
268
|
+
function scrubRecord(value, options = {}) {
|
|
269
|
+
if (typeof value === "string") return stripPrivateData(value);
|
|
270
|
+
if (Array.isArray(value)) return value.map((item) => scrubRecord(item, options));
|
|
271
|
+
if (value !== null && typeof value === "object") {
|
|
272
|
+
const proto = Object.getPrototypeOf(value);
|
|
273
|
+
if (proto !== Object.prototype && proto !== null) return value;
|
|
274
|
+
const entries = Object.entries(value).map(([key, item]) => [options.scrubKeys ? stripPrivateData(key) : key, item]);
|
|
275
|
+
const reserved = new Set(entries.map(([key]) => key));
|
|
276
|
+
const used = /* @__PURE__ */ new Set();
|
|
277
|
+
return Object.fromEntries(entries.map(([key, item]) => {
|
|
278
|
+
let unique = key;
|
|
279
|
+
if (used.has(unique)) {
|
|
280
|
+
let suffix = 2;
|
|
281
|
+
do
|
|
282
|
+
unique = `${key}_${suffix++}`;
|
|
283
|
+
while (reserved.has(unique) || used.has(unique));
|
|
284
|
+
}
|
|
285
|
+
used.add(unique);
|
|
286
|
+
return [unique, scrubRecord(item, options)];
|
|
287
|
+
}));
|
|
288
|
+
}
|
|
289
|
+
return value;
|
|
290
|
+
}
|
|
248
291
|
//#endregion
|
|
249
292
|
//#region src/capture/spool.ts
|
|
250
293
|
const DEFAULT_MAX_BYTES = 5 * 1024 * 1024;
|
|
@@ -258,7 +301,7 @@ const IMAGE_PLACEHOLDER = "[image dropped from capture spool]";
|
|
|
258
301
|
const BOOT_ID_RE = /^[A-Za-z0-9]{8,64}$/;
|
|
259
302
|
const SENT_FILE_RE = /^([A-Za-z0-9]{8,64})-(\d+)\.jsonl$/;
|
|
260
303
|
const SENT_BUCKET_MS = 1e3;
|
|
261
|
-
const MAX_DURABLE_AFTER_MS =
|
|
304
|
+
const MAX_DURABLE_AFTER_MS = 61 * 6e4;
|
|
262
305
|
function emptyStats() {
|
|
263
306
|
return {
|
|
264
307
|
spooled: 0,
|
|
@@ -390,13 +433,6 @@ function fileSize(path) {
|
|
|
390
433
|
return 0;
|
|
391
434
|
}
|
|
392
435
|
}
|
|
393
|
-
function sanitizeBody(body) {
|
|
394
|
-
try {
|
|
395
|
-
return JSON.parse(stripPrivateData(JSON.stringify(body)));
|
|
396
|
-
} catch {
|
|
397
|
-
return body;
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
436
|
function withoutImage(body) {
|
|
401
437
|
const data = body["data"];
|
|
402
438
|
if (!data || typeof data !== "object" || Array.isArray(data)) return body;
|
|
@@ -482,7 +518,7 @@ function appendSpool(url, eventId, body, reason, options = {}) {
|
|
|
482
518
|
spooledAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
483
519
|
reason,
|
|
484
520
|
attempts: options.attempts ?? 0,
|
|
485
|
-
body:
|
|
521
|
+
body: scrubRecord(JSON.parse(JSON.stringify(body)), { scrubKeys: true })
|
|
486
522
|
};
|
|
487
523
|
let line = JSON.stringify(record) + "\n";
|
|
488
524
|
if (Buffer.byteLength(line) > policy.maxRecordBytes) {
|
|
@@ -582,7 +618,7 @@ function retainSent(url, eventId, body, mark, options = {}) {
|
|
|
582
618
|
spooledAt: new Date(now).toISOString(),
|
|
583
619
|
reason: "sent",
|
|
584
620
|
attempts: 0,
|
|
585
|
-
body:
|
|
621
|
+
body: scrubRecord(JSON.parse(JSON.stringify(body)), { scrubKeys: true }),
|
|
586
622
|
bootId: mark.bootId
|
|
587
623
|
};
|
|
588
624
|
let line = JSON.stringify(record) + "\n";
|
|
@@ -903,6 +939,6 @@ async function runDrainChild() {
|
|
|
903
939
|
}).catch(() => void 0);
|
|
904
940
|
}
|
|
905
941
|
//#endregion
|
|
906
|
-
export { REST_URL, authHeaders, captureObservation, isDrainChild, runDrainChild, withEventId };
|
|
942
|
+
export { REST_URL, authHeaders, captureObservation, isDrainChild, runDrainChild, stripPrivateData, withEventId };
|
|
907
943
|
|
|
908
944
|
//# sourceMappingURL=_capture.mjs.map
|