Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
782fa392a5 | ||
|
|
9d60fd9f4e | ||
|
|
c7ee362aff | ||
|
|
d873892dad |
@@ -41,7 +41,7 @@
|
||||
"tsup": "^8.0.0",
|
||||
"tsx": "^4.7.0",
|
||||
"vite": "^6.0.0",
|
||||
"vitest": "^4.1.0",
|
||||
"vitest": "^4.1.11",
|
||||
"@biomejs/biome": "^1.7.0",
|
||||
"@types/node": "^20.0.0"
|
||||
},
|
||||
|
||||
Generated
+46
-46
@@ -51,8 +51,8 @@ importers:
|
||||
specifier: ^6.0.0
|
||||
version: 6.4.3(@types/node@20.19.37)(tsx@4.21.0)
|
||||
vitest:
|
||||
specifier: ^4.1.0
|
||||
version: 4.1.8(@types/node@20.19.37)(vite@6.4.3(@types/node@20.19.37)(tsx@4.21.0))
|
||||
specifier: ^4.1.11
|
||||
version: 4.1.11(@types/node@20.19.37)(vite@6.4.3(@types/node@20.19.37)(tsx@4.21.0))
|
||||
|
||||
packages:
|
||||
|
||||
@@ -439,11 +439,11 @@ packages:
|
||||
'@types/node@20.19.37':
|
||||
resolution: {integrity: sha512-8kzdPJ3FsNsVIurqBs7oodNnCEVbni9yUEkaHbgptDACOPW04jimGagZ51E6+lXUwJjgnBw+hyko/lkFWCldqw==}
|
||||
|
||||
'@vitest/expect@4.1.8':
|
||||
resolution: {integrity: sha512-h3nDO677RDLEGlBxyQ5CW8RlMThSKSRLUePLOx09gNIWRL40edgA1GCZSZgf1W55MFAG6/Sw14KeaAnqv0NKdQ==}
|
||||
'@vitest/expect@4.1.11':
|
||||
resolution: {integrity: sha512-VX2x5vNJXET47KAFzwERI+KRMtTTCSWTfSMKsW7JsUsXV4psq++e3DvZpuTDOpHcxytiDs6p2nhVb2tVDiiUYw==}
|
||||
|
||||
'@vitest/mocker@4.1.8':
|
||||
resolution: {integrity: sha512-LEiN/xe4OSIbKe9HQIp5OC24agGD9J5CnmMgsLohVVoOPWL9a2sBoR6VBx43jQZb7Kr1l4RCuyCJzcAa0+dojw==}
|
||||
'@vitest/mocker@4.1.11':
|
||||
resolution: {integrity: sha512-2XJVD55d1o5AZous5CCGKS74g/riOj9odEt2bQpCVZeblHyHdnMeFl4jl0XjU21stf4mbjUkew2eXQZt65g5CQ==}
|
||||
peerDependencies:
|
||||
msw: ^2.4.9
|
||||
vite: ^6.0.0 || ^7.0.0 || ^8.0.0
|
||||
@@ -453,20 +453,20 @@ packages:
|
||||
vite:
|
||||
optional: true
|
||||
|
||||
'@vitest/pretty-format@4.1.8':
|
||||
resolution: {integrity: sha512-9GasEBxpZ1VYIpqHf/0+YGg121uSNwCKOJqIrTwWP/TB7DmFCiaBpNl3aPZzoLWfWkuqhbH8vJIVobZkvdo2cA==}
|
||||
'@vitest/pretty-format@4.1.11':
|
||||
resolution: {integrity: sha512-yiZzPbGTS9Sr/JpFl8zHrcIkAofNbFV6k21vIgQN/cY/oxZeXhJv5sc/MBJ5jFKWmWs+oJHw0UXLZjmf931+Vw==}
|
||||
|
||||
'@vitest/runner@4.1.8':
|
||||
resolution: {integrity: sha512-EmVxeBAfMJvycdjd6Hm+RbFBbA9fKvo0Kx37hNpBYoYeavH3RNsBXWDooR1mgD52dCrxIIuP7UotpfiwOikvcg==}
|
||||
'@vitest/runner@4.1.11':
|
||||
resolution: {integrity: sha512-LztvUgdwMNJMIkj3hQnnxiC2Xy1zNxq928W/xhjCLaNCzqTZOudjwbQf6v9IntZGPw132i2Lq2rgTRZHD3JHNw==}
|
||||
|
||||
'@vitest/snapshot@4.1.8':
|
||||
resolution: {integrity: sha512-acfZboRmAIf05DEKcBQy33VXojFJjtUdLyo7oOmV9kebb2xdU01UknNiPuPZoJZQyO7DF0gZdTGTpeAzET9QPQ==}
|
||||
'@vitest/snapshot@4.1.11':
|
||||
resolution: {integrity: sha512-pN7ikn1ON7h8ee4gIAp4AzyK+zBtJPzVbqOgu5LCEh4VaJVbPQcgYQYJIMGQPXVeJJq1fnfazis7a5pFNPahog==}
|
||||
|
||||
'@vitest/spy@4.1.8':
|
||||
resolution: {integrity: sha512-6EevtBp6OZOPF7bmz36HrGMeP3txgVSrgebWxHOafDXGkhIzfXK14f8KF6MuFfgXXUeHxmpD3BQxkV00/3s5mA==}
|
||||
'@vitest/spy@4.1.11':
|
||||
resolution: {integrity: sha512-apNa/prQy2qCeywhnixOHPRCgGNhvg7T4Dapfl1GahLp/R+uhBm5cPyFoNVyqsNd2h1nJxL6BqqdIjiABL60YA==}
|
||||
|
||||
'@vitest/utils@4.1.8':
|
||||
resolution: {integrity: sha512-uOJamYALNhfJ6iolExyQM40yIQwDqYnkKtQ5VCiSe17E33H0aQ/u+1GlRuz4LZBk6Mm3sg90G9hEbmEt37C1Zg==}
|
||||
'@vitest/utils@4.1.11':
|
||||
resolution: {integrity: sha512-zTCVGpyFsGWBhllOyKlTw/vnr6D9qxsfSDyfbyZmTyjHw5N/VuvzHpHoQjm2ZJzn4RJgx5w4r7V0er69CmLgPQ==}
|
||||
|
||||
acorn@8.16.0:
|
||||
resolution: {integrity: sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==}
|
||||
@@ -910,20 +910,20 @@ packages:
|
||||
yaml:
|
||||
optional: true
|
||||
|
||||
vitest@4.1.8:
|
||||
resolution: {integrity: sha512-flY6ScbCIt9HThs+C5HS7jvGOB560DJtk/Z15IQROTA6zEy49Nh8T/dofWTQL+n3vswqn87sbJNiuqw1SDp5Ig==}
|
||||
vitest@4.1.11:
|
||||
resolution: {integrity: sha512-fhACrNXUidIbGSBr5FlbuBkO7VWC1ZyLl0DO4CU2DrQoAPxX84Ysxs+HeGQpii5lZWV1Q4gBZTTu49mF+A6Edw==}
|
||||
engines: {node: ^20.0.0 || ^22.0.0 || >=24.0.0}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
'@edge-runtime/vm': '*'
|
||||
'@opentelemetry/api': ^1.9.0
|
||||
'@types/node': ^20.0.0 || ^22.0.0 || >=24.0.0
|
||||
'@vitest/browser-playwright': 4.1.8
|
||||
'@vitest/browser-preview': 4.1.8
|
||||
'@vitest/browser-webdriverio': 4.1.8
|
||||
'@vitest/coverage-istanbul': 4.1.8
|
||||
'@vitest/coverage-v8': 4.1.8
|
||||
'@vitest/ui': 4.1.8
|
||||
'@vitest/browser-playwright': 4.1.11
|
||||
'@vitest/browser-preview': 4.1.11
|
||||
'@vitest/browser-webdriverio': 4.1.11
|
||||
'@vitest/coverage-istanbul': 4.1.11
|
||||
'@vitest/coverage-v8': 4.1.11
|
||||
'@vitest/ui': 4.1.11
|
||||
happy-dom: '*'
|
||||
jsdom: '*'
|
||||
vite: ^6.0.0 || ^7.0.0 || ^8.0.0
|
||||
@@ -1186,44 +1186,44 @@ snapshots:
|
||||
dependencies:
|
||||
undici-types: 6.21.0
|
||||
|
||||
'@vitest/expect@4.1.8':
|
||||
'@vitest/expect@4.1.11':
|
||||
dependencies:
|
||||
'@standard-schema/spec': 1.1.0
|
||||
'@types/chai': 5.2.3
|
||||
'@vitest/spy': 4.1.8
|
||||
'@vitest/utils': 4.1.8
|
||||
'@vitest/spy': 4.1.11
|
||||
'@vitest/utils': 4.1.11
|
||||
chai: 6.2.2
|
||||
tinyrainbow: 3.1.0
|
||||
|
||||
'@vitest/mocker@4.1.8(vite@6.4.3(@types/node@20.19.37)(tsx@4.21.0))':
|
||||
'@vitest/mocker@4.1.11(vite@6.4.3(@types/node@20.19.37)(tsx@4.21.0))':
|
||||
dependencies:
|
||||
'@vitest/spy': 4.1.8
|
||||
'@vitest/spy': 4.1.11
|
||||
estree-walker: 3.0.3
|
||||
magic-string: 0.30.21
|
||||
optionalDependencies:
|
||||
vite: 6.4.3(@types/node@20.19.37)(tsx@4.21.0)
|
||||
|
||||
'@vitest/pretty-format@4.1.8':
|
||||
'@vitest/pretty-format@4.1.11':
|
||||
dependencies:
|
||||
tinyrainbow: 3.1.0
|
||||
|
||||
'@vitest/runner@4.1.8':
|
||||
'@vitest/runner@4.1.11':
|
||||
dependencies:
|
||||
'@vitest/utils': 4.1.8
|
||||
'@vitest/utils': 4.1.11
|
||||
pathe: 2.0.3
|
||||
|
||||
'@vitest/snapshot@4.1.8':
|
||||
'@vitest/snapshot@4.1.11':
|
||||
dependencies:
|
||||
'@vitest/pretty-format': 4.1.8
|
||||
'@vitest/utils': 4.1.8
|
||||
'@vitest/pretty-format': 4.1.11
|
||||
'@vitest/utils': 4.1.11
|
||||
magic-string: 0.30.21
|
||||
pathe: 2.0.3
|
||||
|
||||
'@vitest/spy@4.1.8': {}
|
||||
'@vitest/spy@4.1.11': {}
|
||||
|
||||
'@vitest/utils@4.1.8':
|
||||
'@vitest/utils@4.1.11':
|
||||
dependencies:
|
||||
'@vitest/pretty-format': 4.1.8
|
||||
'@vitest/pretty-format': 4.1.11
|
||||
convert-source-map: 2.0.0
|
||||
tinyrainbow: 3.1.0
|
||||
|
||||
@@ -1627,15 +1627,15 @@ snapshots:
|
||||
fsevents: 2.3.3
|
||||
tsx: 4.21.0
|
||||
|
||||
vitest@4.1.8(@types/node@20.19.37)(vite@6.4.3(@types/node@20.19.37)(tsx@4.21.0)):
|
||||
vitest@4.1.11(@types/node@20.19.37)(vite@6.4.3(@types/node@20.19.37)(tsx@4.21.0)):
|
||||
dependencies:
|
||||
'@vitest/expect': 4.1.8
|
||||
'@vitest/mocker': 4.1.8(vite@6.4.3(@types/node@20.19.37)(tsx@4.21.0))
|
||||
'@vitest/pretty-format': 4.1.8
|
||||
'@vitest/runner': 4.1.8
|
||||
'@vitest/snapshot': 4.1.8
|
||||
'@vitest/spy': 4.1.8
|
||||
'@vitest/utils': 4.1.8
|
||||
'@vitest/expect': 4.1.11
|
||||
'@vitest/mocker': 4.1.11(vite@6.4.3(@types/node@20.19.37)(tsx@4.21.0))
|
||||
'@vitest/pretty-format': 4.1.11
|
||||
'@vitest/runner': 4.1.11
|
||||
'@vitest/snapshot': 4.1.11
|
||||
'@vitest/spy': 4.1.11
|
||||
'@vitest/utils': 4.1.11
|
||||
es-module-lexer: 2.1.0
|
||||
expect-type: 1.3.0
|
||||
magic-string: 0.30.21
|
||||
|
||||
@@ -2371,6 +2371,12 @@ Initial release of the Mem0 plugin for Claude Code and Cursor, followed by Codex
|
||||
|
||||
<Tab title="Claude Code">
|
||||
|
||||
<Update label="Unreleased" description="Sidekick availability">
|
||||
|
||||
Sidekick is now available only in Claude Code, with Sonnet, worktree isolation, and parent memories.
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2026-09-08" description="Claude Code plugin v0.3.1">
|
||||
|
||||
**Changed:**
|
||||
@@ -2390,6 +2396,12 @@ Initial release of the Mem0 plugin for Claude Code and Cursor, followed by Codex
|
||||
|
||||
<Tab title="Cursor">
|
||||
|
||||
<Update label="Unreleased" description="Sidekick availability">
|
||||
|
||||
Removes Sidekick and its start/stop hooks. Memory capture, search, and six skills remain available.
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2026-09-08" description="Cursor plugin v0.3.1">
|
||||
|
||||
**Changed:**
|
||||
@@ -2409,6 +2421,12 @@ Initial release of the Mem0 plugin for Claude Code and Cursor, followed by Codex
|
||||
|
||||
<Tab title="Codex">
|
||||
|
||||
<Update label="Unreleased" description="Sidekick availability">
|
||||
|
||||
Renames shared tracking to use subagent terminology. Native subagent memory support remains available.
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2026-09-08" description="Codex plugin v0.3.1">
|
||||
|
||||
**Changed:**
|
||||
@@ -2427,6 +2445,12 @@ Initial release of the Mem0 plugin for Claude Code and Cursor, followed by Codex
|
||||
|
||||
<Tab title="Agent Plugins v1">
|
||||
|
||||
<Update label="Unreleased" description="Sidekick availability">
|
||||
|
||||
Sidekick is available only in Claude Code, not in the portable package.
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2026-09-08" description="Portable Mem0 plugin v0.3.1">
|
||||
|
||||
**Added:**
|
||||
@@ -2543,6 +2567,12 @@ Initial release of the Mem0 plugin for Claude Code and Cursor, followed by Codex
|
||||
|
||||
<Tab title="Antigravity">
|
||||
|
||||
<Update label="Unreleased" description="Sidekick availability">
|
||||
|
||||
Removes Sidekick. Memory capture, search, and six skills remain available.
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2026-09-08" description="Antigravity plugin v0.3.1">
|
||||
|
||||
**Changed:**
|
||||
@@ -2635,6 +2665,12 @@ Existing memories written by the previous versions are not rewritten. If your me
|
||||
|
||||
<Tab title="Kimi">
|
||||
|
||||
<Update label="Unreleased" description="Sidekick availability">
|
||||
|
||||
Removes Sidekick and its start/stop hooks. Memory capture, recall, and six skills remain available.
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2026-09-08" description="Kimi Code plugin v0.3.1">
|
||||
|
||||
**Changed:**
|
||||
@@ -3070,6 +3106,23 @@ Existing memories written by the previous versions are not rewritten. If your me
|
||||
|
||||
<Tab title="DeepSeek Harness">
|
||||
|
||||
<Update label="2026-09-11" description="deepseek-plugin v0.3.1">
|
||||
|
||||
**Fixed:**
|
||||
- Automatic recall uses the claimed human inbox message before Harness appends it to session history, so the first request in a fresh session can recall memories and later turns use the current prompt.
|
||||
- Native `dsh.bundle` activation loads Mem0 when the package is installed into a Harness profile. `pnpm pack` builds the plugin and includes its activation patch.
|
||||
- Automatic recall guidance points to the available memory search tool for deeper searches.
|
||||
|
||||
**Added:**
|
||||
- Optional `memoryScope: workspace` applies the same canonical workspace filter to automatic recall, capture, and both memory tools. Missing workspace paths skip automatic operations and reject explicit tools without falling back to shared memory.
|
||||
|
||||
**Upgrade notes:**
|
||||
- `memoryScope: user` remains the default and shares memories across workspaces. Existing memories are not migrated into workspace scopes; separate clones and worktrees have separate scopes when workspace mode is enabled.
|
||||
- Export `MEM0_USER_ID` alongside `MEM0_API_KEY`. Remove the old manual `insert: mem0` overlay; customize the bundle's existing row with an `id: mem0` override. See [DeepSeek Harness setup](/integrations/deepseek-plugin).
|
||||
- Capture extraction remains asynchronous. This patch does not change extraction policy or guarantee that every preference or numeric constraint becomes a memory.
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2026-09-08" description="deepseek-plugin v0.3.0">
|
||||
|
||||
**Added:**
|
||||
|
||||
@@ -17,6 +17,8 @@ Mem0 seamlessly integrates with popular AI frameworks and tools to enhance your
|
||||
**Universal Integration**: Use <Link href="/platform/mem0-mcp">Mem0 MCP</Link> for a standardized protocol that works with ANY AI client.
|
||||
</Callout>
|
||||
|
||||
Sidekick is available only in the [Claude Code plugin](/integrations/claude-code#sidekick-agent). Other plugins, including the portable package, provide memory without Sidekick.
|
||||
|
||||
Here are the available integrations for Mem0:
|
||||
|
||||
## Integrations
|
||||
|
||||
@@ -7,6 +7,8 @@ Add persistent memory to [**Google Antigravity**](https://antigravity.google) (`
|
||||
|
||||
<Info>Current plugin version: `0.3.1`.</Info>
|
||||
|
||||
Sidekick is available only in the [Claude Code plugin](/integrations/claude-code#sidekick-agent).
|
||||
|
||||
## Prerequisites
|
||||
|
||||
1. A Mem0 API key (starts with `m0-`):
|
||||
@@ -48,11 +50,10 @@ This installs the generated Antigravity bundle with the Mem0 server, lifecycle h
|
||||
| Local MCP Server (`search_memories`) | Yes |
|
||||
| Lifecycle Hooks | Yes |
|
||||
| 6 Memory Skills | Yes |
|
||||
| Sidekick Agent | Yes |
|
||||
|
||||
## Memory tools and skills
|
||||
|
||||
The full plugin exposes a focused `search_memories` tool and captures completed work through lifecycle hooks. Six skills provide search, status, remember, forget, pause, and resume workflows. A native sidekick can handle a bounded task in the workspace assigned by Antigravity; it does not claim Claude Code worktree isolation.
|
||||
The full plugin exposes a focused `search_memories` tool and captures completed work through lifecycle hooks. Six skills provide search, status, remember, forget, pause, and resume workflows.
|
||||
|
||||
If you need the full set of direct CRUD tools, connect the [hosted Mem0 MCP server](/platform/mem0-mcp) separately instead of installing both configurations under the same server name.
|
||||
|
||||
|
||||
@@ -64,6 +64,8 @@ After the automatic first-prompt search, Claude can also call `search_memories`
|
||||
|
||||
### Sidekick agent
|
||||
|
||||
Sidekick is available only in Claude Code.
|
||||
|
||||
`mem0:sidekick` is a Sonnet coding agent that runs in a separate Git worktree. Use it to offload investigation, implementation, testing, or review without burning main-session context.
|
||||
|
||||
```text
|
||||
|
||||
@@ -7,6 +7,8 @@ Add persistent memory to [**OpenAI Codex**](https://openai.com/index/codex/) wit
|
||||
|
||||
<Info>Current plugin version: `0.3.1`.</Info>
|
||||
|
||||
Sidekick is available only in the [Claude Code plugin](/integrations/claude-code#sidekick-agent).
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before setting up Mem0 with Codex, ensure you have:
|
||||
|
||||
@@ -7,6 +7,8 @@ Add persistent memory to [**Cursor**](https://cursor.com) with the Mem0 plugin.
|
||||
|
||||
<Info>Current plugin version: `0.3.1`.</Info>
|
||||
|
||||
Sidekick is available only in the [Claude Code plugin](/integrations/claude-code#sidekick-agent).
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before setting up Mem0 with Cursor, ensure you have:
|
||||
@@ -49,7 +51,7 @@ cursor-agent plugin marketplace add https://github.com/mem0ai/mem0
|
||||
|
||||
Open Cursor's **Customize** page or run `/plugins`, select the **Mem0 Plugins** marketplace, and install **Mem0** at user or project scope. Enter your Mem0 API key when Cursor asks for the plugin configuration, then restart Cursor.
|
||||
|
||||
The full plugin includes automatic capture, the `search_memories` recall tool, lifecycle hooks, a sidekick agent, and six memory skills.
|
||||
The full plugin includes automatic capture, the `search_memories` recall tool, lifecycle hooks, and six memory skills.
|
||||
|
||||
### Option B: One-Click Deeplink (MCP Only)
|
||||
|
||||
@@ -98,7 +100,6 @@ Add the following to your `.cursor/mcp.json`:
|
||||
| Recall | `search_memories` | MCP search tools |
|
||||
| Lifecycle hooks | Yes | No |
|
||||
| Memory skills | 6 | No |
|
||||
| Sidekick agent | Yes | No |
|
||||
|
||||
## MCP-only tools
|
||||
|
||||
@@ -125,15 +126,14 @@ The full plugin translates Cursor's native events into the shared Mem0 memory li
|
||||
| `sessionStart` | Initializes the project session and recovers pending capture |
|
||||
| `beforeSubmitPrompt` | Observes the submitted prompt; recall stays tool-driven because this event cannot inject context |
|
||||
| `postToolUse` / `postToolUseFailure` | Records useful tool results and failures |
|
||||
| `subagentStart` / `subagentStop` | Records the Mem0 Sidekick lifecycle and completed result |
|
||||
| `afterAgentResponse` / `stop` | Captures the completed exchange |
|
||||
| `preCompact` / `sessionEnd` | Flushes pending capture in the background |
|
||||
|
||||
<Note>
|
||||
Cursor's `beforeSubmitPrompt` hook can allow or block a prompt, but it cannot add context to that prompt. The plugin therefore gives the agent `search_memories` and a memory-aware sidekick for recall instead of claiming automatic per-prompt injection.
|
||||
Cursor's `beforeSubmitPrompt` hook cannot add context to a prompt. Use `search_memories` to recall memories.
|
||||
</Note>
|
||||
|
||||
Cursor's `subagentStart` hook also cannot inject parent context. The bundled Sidekick searches Mem0 itself, while the lifecycle hooks correlate its start and completion for later capture.
|
||||
The plugin does not register subagent start or stop hooks.
|
||||
|
||||
## Example Workflow
|
||||
|
||||
|
||||
@@ -5,7 +5,9 @@ description: "Add persistent memory to DeepSeek Harness with automatic recall, a
|
||||
|
||||
Add persistent memory to the [**DeepSeek Harness**](https://github.com/deepseek-ai/deepseek-harness) with `@mem0/deepseek-plugin`. The plugin recalls relevant context before a model request, captures completed turns, and provides explicit Mem0 tools when the agent needs them.
|
||||
|
||||
<Info>Current package version: `0.3.0`.</Info>
|
||||
<Info>Current package version: `0.3.1`.</Info>
|
||||
|
||||
Sidekick is available only in the [Claude Code plugin](/integrations/claude-code#sidekick-agent).
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -30,7 +32,7 @@ A Cordis plugin is a module exporting `apply(ctx, config)`. This plugin waits fo
|
||||
|
||||
Cordis removes the listeners and tools when the plugin unmounts. Memory failures are fail-open, so a Mem0 outage does not stop the agent from completing its normal work.
|
||||
|
||||
DeepSeek Harness provides subagents through separate host-composition packages. This Mem0 package does not register a named Sidekick or claim child filesystem isolation. A Harness child uses Mem0 only when its own agent preset includes the Mem0 plugin.
|
||||
DeepSeek Harness provides subagents through separate host-composition packages. This Mem0 package does not register a named Sidekick or claim child filesystem isolation. Memory availability in children depends on the Harness composition and service scope.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
@@ -38,25 +40,27 @@ DeepSeek Harness provides subagents through separate host-composition packages.
|
||||
- <a href="https://app.mem0.ai?utm_source=oss&utm_medium=integration-deepseek-plugin">Sign up at app.mem0.ai</a>
|
||||
- <a href="https://app.mem0.ai/dashboard/api-keys?utm_source=oss&utm_medium=integration-deepseek-plugin">Get your API key</a> (starts with `m0-`)
|
||||
|
||||
2. The DeepSeek Harness installed.
|
||||
2. The DeepSeek Harness installed and a funded model-provider credential (`DEEPSEEK_API_KEY` for the official DeepSeek provider). This is separate from your Mem0 key.
|
||||
|
||||
3. Your API key exported in your shell:
|
||||
3. Your Mem0 key and a stable user identity exported in the shell that launches Harness:
|
||||
|
||||
<CodeGroup>
|
||||
```bash zsh
|
||||
echo 'export MEM0_API_KEY="m0-your-api-key"' >> ~/.zshrc
|
||||
echo 'export MEM0_USER_ID="your-user-id"' >> ~/.zshrc
|
||||
source ~/.zshrc
|
||||
```
|
||||
|
||||
```bash bash
|
||||
echo 'export MEM0_API_KEY="m0-your-api-key"' >> ~/.bashrc
|
||||
echo 'export MEM0_USER_ID="your-user-id"' >> ~/.bashrc
|
||||
source ~/.bashrc
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
## Try it locally
|
||||
|
||||
1. Build and pack the plugin:
|
||||
1. Build and pack the plugin from the full repository (the source imports the sibling shared core):
|
||||
```sh
|
||||
cd integrations/deepseek-plugin
|
||||
pnpm install --frozen-lockfile
|
||||
@@ -68,33 +72,32 @@ source ~/.bashrc
|
||||
2. Install it into a disposable Harness profile so Harness supplies its peer dependencies:
|
||||
```sh
|
||||
DSH_HOME=/tmp/mem0-dsh-dev pnpm dlx @deepseek-ai/dsh@0.1.1-rc.2 \
|
||||
plugin --profile headless add /tmp/mem0-deepseek-plugin/mem0-deepseek-plugin-0.3.0.tgz
|
||||
plugin --profile web add /tmp/mem0-deepseek-plugin/mem0-deepseek-plugin-0.3.1.tgz
|
||||
```
|
||||
|
||||
3. Copy `cordis.example.yml`, set its installed package path and your `userId`, then load it with the same profile:
|
||||
3. Launch the same profile. The package's `dsh.bundle` activates Mem0 automatically:
|
||||
```sh
|
||||
DSH_HOME=/tmp/mem0-dsh-dev pnpm dlx @deepseek-ai/dsh@0.1.1-rc.2 \
|
||||
web --patch ./integrations/deepseek-plugin/cordis.example.yml
|
||||
web
|
||||
```
|
||||
|
||||
4. Open the web UI and ask the agent to remember something, then recall it in a later turn.
|
||||
4. Open the web UI, select a workspace, and state a synthetic preference without mentioning Mem0. Allow extraction to finish, start a fresh session, and ask for that preference without tools. Inspect the `mem0:recall` context to confirm automatic recall.
|
||||
|
||||
The `cordis.yml` entry looks like this:
|
||||
`pnpm pack` builds the package automatically and ships its activation patch. To customize it, copy `cordis.example.yml` and launch with `web --patch /absolute/path/to/cordis.yml`. The override updates the existing bundle row:
|
||||
|
||||
```yaml
|
||||
- name: "@deepseek-ai/dsh-system-prompt"
|
||||
- name: "@deepseek-ai/dsh-tools"
|
||||
- insert:
|
||||
- id: mem0
|
||||
name: "/tmp/mem0-dsh-dev/profiles/headless/node_modules/@mem0/deepseek-plugin/dist/index.js"
|
||||
config:
|
||||
# apiKey is read from MEM0_API_KEY when omitted here.
|
||||
userId: "your-user-id"
|
||||
autoRecall: true
|
||||
autoCapture: true
|
||||
# host: "https://your-onprem.mem0.ai" # optional: Platform on-prem / dedicated base URL
|
||||
- id: mem0
|
||||
config:
|
||||
# A config override replaces the whole config, so restate userId.
|
||||
userId: !!js process.env.MEM0_USER_ID
|
||||
memoryScope: workspace
|
||||
autoRecall: true
|
||||
autoCapture: true
|
||||
# host: "https://your-onprem.mem0.ai" # optional: Platform dedicated base URL
|
||||
```
|
||||
|
||||
When upgrading from a manual installation, remove the old patch that inserts a `mem0` row; the bundle now inserts it. Keep custom settings as an override by `id`.
|
||||
|
||||
For a Mem0 Platform on-prem or dedicated deployment, point `config.host` at that base URL (defaults to `api.mem0.ai`). `host` is a Platform base-URL override, not a switch to self-hosted Mem0 OSS.
|
||||
|
||||
## Configuration
|
||||
@@ -103,12 +106,27 @@ For a Mem0 Platform on-prem or dedicated deployment, point `config.host` at that
|
||||
|---|---|---|---|
|
||||
| `apiKey` | no | `$MEM0_API_KEY` | Mem0 platform API key |
|
||||
| `userId` | yes | | Default entity that owns the memories |
|
||||
| `memoryScope` | no | `user` | `user` shares memory across workspaces; `workspace` isolates automatic and explicit memory operations |
|
||||
| `allowUserOverride` | no | `false` | Permit model-selected access to a different user only in a trusted multi-user deployment |
|
||||
| `host` | no | `api.mem0.ai` | Platform base URL (on-prem / dedicated) |
|
||||
| `autoRecall` | no | `true` | Recall relevant memory before model requests |
|
||||
| `autoCapture` | no | `true` | Store completed human and assistant turns |
|
||||
|
||||
Both tools also accept optional per-call `userId`, `agentId`, and `runId` params so a single install can partition memory by entity, agent, or session; `userId` defaults to the configured user, while `agentId` and `runId` are omitted unless supplied. Automatic recall and capture use the configured user without an agent, repository, or session filter. Automatic capture preserves full redacted user and assistant message text without a per-message character cutoff.
|
||||
Both tools also accept optional per-call `userId`, `agentId`, and `runId` params so a single install can partition memory by entity, agent, or session; `userId` defaults to the configured user, while `agentId` and `runId` are omitted unless supplied. Automatic capture preserves full redacted user and assistant message text without a per-message character cutoff.
|
||||
|
||||
## Workspace scope
|
||||
|
||||
By default, automatic capture and recall use the configured user across all workspaces. This is intentional compatibility behavior. To isolate workspaces, set `memoryScope: workspace` as shown above. All writes then attach an `appId` derived from the canonical absolute session workspace path; all searches require its matching `app_id`. The model cannot override that workspace filter.
|
||||
|
||||
Symlink aliases share a scope. Different directories, clones, or worktrees have different scopes; moving a directory changes its scope. Missing or invalid workspace paths skip automatic memory operations and reject explicit tools without falling back to user-wide access. Existing user-only memories are not migrated into workspace scopes.
|
||||
|
||||
User scope searches all memories belonging to the user, including workspace-tagged memories. Workspace isolation applies only when workspace scope is configured; it is application filtering, not a separate Mem0 account or credential.
|
||||
|
||||
## Extraction and recall limits
|
||||
|
||||
Capture sends the full redacted turn to Mem0 for asynchronous extraction. A queued write, or even an initially nonempty memory list, does not mean every extracted fact is ready. Allow processing to finish and inspect stored memories before diagnosing lost preferences or missing filenames and numeric constraints. Exact extraction remains model-dependent; a one-off request should not automatically become a standing preference.
|
||||
|
||||
Automatic recall is a shallow first pass: up to five results, 4,000 context characters, and a two-second wait. The explicit `search_memory` tool can use a more focused query and returns up to ten results by default.
|
||||
|
||||
## Telemetry
|
||||
|
||||
@@ -122,6 +140,6 @@ Writes are tagged `source="DEEPSEEK_HARNESS"` so Mem0 can attribute usage to thi
|
||||
|
||||
- **`MISSING_CREDENTIAL` for `deepseek-official`**: Configure `DEEPSEEK_API_KEY` through Harness's Models page or export it in the shell that launches Harness.
|
||||
- **`EMFILE: too many open files, watch` on macOS**: Launch Harness with `CHOKIDAR_USEPOLLING=1`.
|
||||
- **Mem0 tools do not appear**: Run Harness with `--dump-config` and confirm the final composition contains the `mem0` row and the installed `dist/index.js` path.
|
||||
- **Mem0 tools do not appear**: Run Harness with `--dump-config` for the same profile used at installation and confirm it contains a `mem0` row naming `@mem0/deepseek-plugin`. Export `MEM0_USER_ID` and `MEM0_API_KEY` before launching.
|
||||
|
||||
Per-call `userId` overrides are rejected unless the operator enables `allowUserOverride: true`. Automatic recall and capture always use the configured user.
|
||||
|
||||
@@ -7,6 +7,8 @@ Kimi Code forgets project decisions between sessions. The Mem0 plugin captures c
|
||||
|
||||
<Info>Current plugin version: `0.3.1`.</Info>
|
||||
|
||||
Sidekick is available only in the [Claude Code plugin](/integrations/claude-code#sidekick-agent).
|
||||
|
||||
## Prerequisites
|
||||
|
||||
1. A Mem0 Platform account and API key:
|
||||
@@ -33,7 +35,7 @@ Inside Kimi Code, install the native plugin bundle and reload the session:
|
||||
/reload
|
||||
```
|
||||
|
||||
Run `/plugins info mem0` to confirm that the plugin, MCP server, skills, hooks, and sidekick agent loaded.
|
||||
Run `/plugins info mem0` to confirm that the plugin, MCP server, skills, and hooks loaded.
|
||||
|
||||
## What you get
|
||||
|
||||
@@ -42,7 +44,6 @@ Run `/plugins info mem0` to confirm that the plugin, MCP server, skills, hooks,
|
||||
- **Explicit search:** Kimi can call `search_memories` when it needs a more specific answer.
|
||||
- **Six memory skills:** Search, status, remember, forget, pause, and resume use the same memory behavior as the other Mem0 coding-agent plugins.
|
||||
- **Project scoping:** Memories stay attached to the repository, with separate personal and shared project lanes.
|
||||
- **Kimi sidekick:** A focused subagent can investigate or implement a bounded task in a separate context. Filesystem isolation depends on the environment Kimi provides.
|
||||
|
||||
Credentials are redacted before memory capture. If Mem0 is unavailable, hooks fail open so Kimi can continue its normal work.
|
||||
|
||||
@@ -57,7 +58,8 @@ Kimi's native lifecycle events are translated into the shared Mem0 memory lifecy
|
||||
| `PostToolUse` / `PostToolUseFailure` | Records useful tool results and failures |
|
||||
| `Stop` | Captures the completed exchange |
|
||||
| `PreCompact` / `SessionEnd` | Flushes pending capture in the background |
|
||||
| `SubagentStart` / `SubagentStop` | Passes parent context to the Mem0 sidekick and records its lifecycle |
|
||||
|
||||
The plugin does not register subagent start or stop hooks or supply parent memories to child agents.
|
||||
|
||||
## Verify the plugin
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@ Add long-term memory to [OpenClaw](https://github.com/openclaw/openclaw) agents
|
||||
|
||||
<Info>Current package version: `1.1.0`.</Info>
|
||||
|
||||
Sidekick is available only in the [Claude Code plugin](/integrations/claude-code#sidekick-agent). OpenClaw subagents can recall parent memories. Mem0 does not capture their sessions.
|
||||
|
||||
## Overview
|
||||
|
||||
<Frame>
|
||||
|
||||
@@ -7,6 +7,8 @@ Add persistent memory to [**OpenCode**](https://opencode.ai) with the Mem0 plugi
|
||||
|
||||
<Info>Current package version: `0.3.0`.</Info>
|
||||
|
||||
Sidekick is available only in the [Claude Code plugin](/integrations/claude-code#sidekick-agent).
|
||||
|
||||
## Prerequisites
|
||||
|
||||
1. A Mem0 API key (starts with `m0-`):
|
||||
|
||||
@@ -7,6 +7,8 @@ Add persistent memory to [**Pi Agent**](https://pi.dev) with `@mem0/pi-agent-plu
|
||||
|
||||
<Info>Current package version: `0.3.0`.</Info>
|
||||
|
||||
Sidekick is available only in the [Claude Code plugin](/integrations/claude-code#sidekick-agent).
|
||||
|
||||
## Overview
|
||||
|
||||
The plugin provides:
|
||||
|
||||
+4
-4
@@ -269,11 +269,11 @@ If the user is on a pre-current major (Python < 2, TS < 3, or a Platform call st
|
||||
### AI Coding Tools
|
||||
- [Claude Code](https://docs.mem0.ai/integrations/claude-code) [Platform]: Use when wiring memory into Claude Code.
|
||||
- [Claude.ai](https://docs.mem0.ai/integrations/claude-ai) [Platform]: Use when connecting Mem0 to Claude.ai (the hosted web app) via a custom remote MCP connector, or when Claude's native memory seems to be crowding out mem0 tool calls.
|
||||
- [Cursor](https://docs.mem0.ai/integrations/cursor) [Platform]: Use when adding lifecycle capture, explicit memory recall, six skills, and a sidekick to Cursor.
|
||||
- [Cursor](https://docs.mem0.ai/integrations/cursor) [Platform]: Use when adding lifecycle capture, explicit memory recall, and six memory skills to Cursor.
|
||||
- [Codex](https://docs.mem0.ai/integrations/codex) [Platform]: Use when adding automatic capture and recall, six memory skills, and a search tool to OpenAI Codex.
|
||||
- [Kimi Code](https://docs.mem0.ai/integrations/kimi) [Platform]: Use when adding persistent project memory to Kimi Code through its native plugin lifecycle.
|
||||
- [OpenCode](https://docs.mem0.ai/integrations/opencode) [Platform]: Use when adding ten native SDK memory tools, automatic context, seven skills, and project scoping to OpenCode.
|
||||
- [Antigravity](https://docs.mem0.ai/integrations/antigravity) [Platform]: Use when adding lifecycle capture, explicit recall, six memory skills, and a native sidekick to Google Antigravity.
|
||||
- [Antigravity](https://docs.mem0.ai/integrations/antigravity) [Platform]: Use when adding lifecycle capture, explicit recall, and six memory skills to Google Antigravity.
|
||||
|
||||
### Voice & Real-time
|
||||
- [LiveKit](https://docs.mem0.ai/integrations/livekit) [Platform]: Use when building real-time voice/video with memory.
|
||||
@@ -418,13 +418,13 @@ Each subdirectory is a Claude Code Skill (`SKILL.md` + supporting assets). Load
|
||||
|
||||
Source: https://github.com/mem0ai/mem0/tree/main/integrations/claude-code-plugin
|
||||
|
||||
The self-contained Claude Code plugin lives in `integrations/claude-code-plugin/` (v0.3.1, installs as `mem0@mem0-plugins`). It captures evidence locally through lifecycle hooks, extracts memories in a detached background worker, and exposes a single local MCP tool, `search_memories`, plus six `/mem0:*` skills and the unchanged `mem0:sidekick` agent. Pure-stdlib Python, nothing to install.
|
||||
The self-contained Claude Code plugin lives in `integrations/claude-code-plugin/` (v0.3.1, installs as `mem0@mem0-plugins`). It captures evidence locally through lifecycle hooks, extracts memories in a detached background worker, and exposes a single local MCP tool, `search_memories`, plus six `/mem0:*` skills and `mem0:sidekick`, available only in Claude Code. Pure-stdlib Python, nothing to install.
|
||||
|
||||
### Coding-Agent Plugin Sources
|
||||
|
||||
Source: https://github.com/mem0ai/mem0/tree/main/integrations/agent-plugin-core
|
||||
|
||||
The `integrations/agent-plugin-core/` directory is the single source for shared Python and TypeScript memory behavior. Native plugins live in their own sibling directories, while `integrations/mem0-agent-plugin/` is the single portable Agent Plugins v1 package. The portable package provides search and skills but no automatic capture; its remember skill cannot save a new memory on its own. Shared Python search accepts optional `run_id` for session-specific recall in every scope. TypeScript integrations reuse the core's lifecycle, formatting, identity, scoping, and telemetry utilities while keeping their public packages and native host APIs unchanged.
|
||||
The `integrations/agent-plugin-core/` directory is the single source for shared Python and TypeScript memory behavior. Native plugins live in their own sibling directories, while `integrations/mem0-agent-plugin/` is the single portable Agent Plugins v1 package. Sidekick is available only in Claude Code. The portable package provides search and skills but no automatic capture; its remember skill cannot save a new memory on its own. Shared Python search accepts optional `run_id` for session-specific recall in every scope. TypeScript integrations reuse the core's lifecycle, formatting, identity, scoping, and telemetry utilities while keeping their public packages and native host APIs unchanged.
|
||||
|
||||
Editor-specific setup docs (already listed above under `## Integrations > AI Coding Tools`):
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ integrations/
|
||||
|
||||
Each native directory owns only its manifest, native hooks or adapter, tests, and `plugin-build.json`. Its `core/` and `skills/` directories are generated from this module. They are committed because clients install a self-contained plugin directory and the Agent Plugins specification forbids package files from resolving outside the plugin root.
|
||||
|
||||
Claude Code remains the behavioral source of truth. Its sidekick stays at `claude-code-plugin/agents/sidekick.md` and is not generated or copied to hosts without a compatible native subagent interface.
|
||||
Sidekick belongs only to Claude Code. Its agent definition is in `claude-code-plugin/agents/sidekick.md`; its hooks are in `claude-code-plugin/adapters/claude/hook.py`. Other plugins must not register Sidekick. The shared core handles memory and native subagent tracking for Claude Code and Codex.
|
||||
|
||||
TypeScript integrations (`openclaw`, `opencode-plugin`, `pi-agent-plugin`, and `deepseek-plugin`) import `typescript/src/` at build time. Their package builders include the shared implementation in their normal output; they do not carry checked-in copies.
|
||||
|
||||
@@ -106,19 +106,21 @@ For another native Python host:
|
||||
|
||||
Keep capture, recall, memory scoping, redaction, skill text, and telemetry in this shared module. Host directories should contain only behavior required by their native SDK.
|
||||
|
||||
For a TypeScript host, import the shared lifecycle modules directly and keep only native SDK registration in the integration. Do not advertise capture, compaction, or sidekick behavior unless the host exposes the necessary lifecycle seam.
|
||||
For a TypeScript host, import the shared lifecycle modules directly and keep only native SDK registration in the integration. Do not advertise capture or compaction behavior unless the host exposes the necessary lifecycle seam. Sidekick is limited to Claude Code.
|
||||
|
||||
## Host capture capabilities
|
||||
|
||||
| Host | Conversation capture | Tool outcomes | Subagent context and correlation |
|
||||
| --- | --- | --- | --- |
|
||||
| Claude Code | Incremental active transcript branch | Native success/failure hooks | Parent context; native agent ID |
|
||||
| Cursor | Prompt and response hooks; duplicate responses suppressed | Native success/failure hooks | Sidekick searches itself; no parent-injection claim |
|
||||
| Cursor | Prompt and response hooks; duplicate responses suppressed | Native success/failure hooks | No plugin subagent hooks or agent declaration |
|
||||
| Codex | Native prompt and final-response fields | Structured failure indicators when present; otherwise unknown | Parent context; native agent ID |
|
||||
| Kimi | Prompt hooks and completed v2 wire output | Native success/failure hooks | Parent context; without an ID, a stop matches only one unambiguous active run |
|
||||
| Antigravity | Incremental completed transcript messages, including later prompts | Native tool errors | Sidekick searches itself; no worktree-isolation claim |
|
||||
| Kimi | Prompt hooks and completed v2 wire output | Native success/failure hooks | No plugin subagent hooks or agent declaration |
|
||||
| Antigravity | Incremental completed transcript messages, including later prompts | Native tool errors | No plugin subagent hooks or agent declaration |
|
||||
| Portable v1 | Explicit memory skills | No native lifecycle hooks | No native subagent declaration |
|
||||
|
||||
Python status uses `subagent_runs` and `last_subagent`. Legacy SQLite names and event handling keep existing records and running workers compatible.
|
||||
|
||||
An uncorrelated subagent completion is kept as its own record; the plugin never guesses which overlapping run completed. Codex's documented hook fields already match the shared input contract, so no speculative field aliases or unsupported failure event are registered.
|
||||
|
||||
Offline conformance exercises the adapters and MCP servers with native-shaped payloads and builds each distributable package. It does not establish that every installed editor or Harness version loads the plugin correctly; those checks require smoke tests in the actual hosts.
|
||||
|
||||
@@ -11,10 +11,10 @@ import telemetry
|
||||
from memory_core import (
|
||||
EvidenceStore,
|
||||
api_key,
|
||||
configure_harness,
|
||||
data_dir,
|
||||
doctor,
|
||||
forget_remote_repo,
|
||||
configure_harness,
|
||||
resolve_repo,
|
||||
user_id,
|
||||
)
|
||||
@@ -32,7 +32,7 @@ def _print_status(value: dict) -> None:
|
||||
)
|
||||
print(
|
||||
f"Used in this repository: {value['retrievals']} memories returned, "
|
||||
f"{value['sidekick_runs']} sidekick runs"
|
||||
f"{value['subagent_runs']} subagent runs"
|
||||
)
|
||||
if last:
|
||||
item_label = ""
|
||||
@@ -48,13 +48,13 @@ def _print_status(value: dict) -> None:
|
||||
f"{'succeeded' if last['success'] else 'failed'} "
|
||||
f"({last['duration_ms']:.1f} ms{item_label})"
|
||||
)
|
||||
sidekick = value.get("last_sidekick") or {}
|
||||
if sidekick:
|
||||
state = "finished" if sidekick.get("stopped_at") else "started"
|
||||
subagent = value.get("last_subagent") or {}
|
||||
if subagent:
|
||||
state = "finished" if subagent.get("stopped_at") else "started"
|
||||
print(
|
||||
"Last sidekick: "
|
||||
f"{state}, received {sidekick['context_chars']} characters of memory, "
|
||||
f"agent {sidekick['agent_id']}"
|
||||
"Last subagent: "
|
||||
f"{state}, received {subagent['context_chars']} characters of memory, "
|
||||
f"agent {subagent['agent_id']}"
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -524,7 +524,7 @@ def _checkpoint_message(event: dict[str, Any]) -> str:
|
||||
if text:
|
||||
return text
|
||||
return redact(payload.get("text", "")).strip()
|
||||
if kind == "sidekick_stop":
|
||||
if kind in {"subagent_stop", "sidekick_stop"}:
|
||||
return redact(payload.get("final_message", "")).strip()
|
||||
return ""
|
||||
|
||||
@@ -596,6 +596,7 @@ class EvidenceStore:
|
||||
self.conn.close()
|
||||
|
||||
def _migrate(self) -> None:
|
||||
# Keep the legacy table name so existing databases and in-flight workers remain compatible.
|
||||
self.conn.executescript(
|
||||
"""
|
||||
CREATE TABLE IF NOT EXISTS events (
|
||||
@@ -688,8 +689,7 @@ class EvidenceStore:
|
||||
|
||||
"""
|
||||
)
|
||||
# Remove the pre-0.1.1 no-tools snapshot implementation. The real coding
|
||||
# sidekick is a native Claude Code agent and stores no state in this DB.
|
||||
# Remove the pre-0.1.1 snapshot implementation.
|
||||
self.conn.executescript(
|
||||
"""
|
||||
DROP TABLE IF EXISTS sidekick_calls;
|
||||
@@ -1041,7 +1041,7 @@ class EvidenceStore:
|
||||
if row["memory_text"]
|
||||
]
|
||||
|
||||
def start_sidekick(
|
||||
def start_subagent(
|
||||
self,
|
||||
repo: RepoContext,
|
||||
session_id: str,
|
||||
@@ -1049,7 +1049,7 @@ class EvidenceStore:
|
||||
agent_type: str,
|
||||
context_chars: int,
|
||||
) -> bool:
|
||||
"""Record one native sidekick instance and whether context was first sent."""
|
||||
"""Record one native subagent instance and whether context was first sent."""
|
||||
with self.conn:
|
||||
cursor = self.conn.execute(
|
||||
"""INSERT OR IGNORE INTO sidekick_runs
|
||||
@@ -1067,7 +1067,7 @@ class EvidenceStore:
|
||||
)
|
||||
return int(cursor.rowcount) > 0
|
||||
|
||||
def stop_sidekick(
|
||||
def stop_subagent(
|
||||
self,
|
||||
repo: RepoContext,
|
||||
session_id: str,
|
||||
@@ -1222,7 +1222,7 @@ class EvidenceStore:
|
||||
cursor = self.conn.execute(
|
||||
f"DELETE FROM {table} WHERE {column} = ?", (repo_id,)
|
||||
)
|
||||
removed[table] = max(int(cursor.rowcount), 0)
|
||||
removed["subagent_runs" if table == "sidekick_runs" else table] = max(int(cursor.rowcount), 0)
|
||||
return removed
|
||||
|
||||
def status(self, repo_id: str) -> dict[str, Any]:
|
||||
@@ -1238,7 +1238,7 @@ class EvidenceStore:
|
||||
FROM operations WHERE repo_id = ? ORDER BY id DESC LIMIT 1""",
|
||||
(repo_id,),
|
||||
).fetchone()
|
||||
last_sidekick = self.conn.execute(
|
||||
last_subagent = self.conn.execute(
|
||||
"""SELECT session_id, agent_id, agent_type, started_at, stopped_at,
|
||||
context_chars
|
||||
FROM sidekick_runs WHERE repo_id = ?
|
||||
@@ -1250,9 +1250,9 @@ class EvidenceStore:
|
||||
"events": count("events"),
|
||||
"flushes": count("flushes"),
|
||||
"retrievals": count("retrievals"),
|
||||
"sidekick_runs": count("sidekick_runs"),
|
||||
"subagent_runs": count("sidekick_runs"),
|
||||
"last_operation": dict(last_operation) if last_operation else None,
|
||||
"last_sidekick": dict(last_sidekick) if last_sidekick else None,
|
||||
"last_subagent": dict(last_subagent) if last_subagent else None,
|
||||
}
|
||||
|
||||
|
||||
@@ -1324,7 +1324,7 @@ def tool_payload(hook_input: dict[str, Any], *, failed: bool | None = False) ->
|
||||
"tool": name,
|
||||
"failed": failed,
|
||||
"duration_ms": hook_input.get("duration_ms"),
|
||||
"agent_role": "sidekick" if hook_input.get("agent_id") else "main",
|
||||
"agent_role": "subagent" if hook_input.get("agent_id") else "main",
|
||||
}
|
||||
if hook_input.get("agent_id"):
|
||||
payload["agent_id"] = bounded(hook_input["agent_id"], 200)
|
||||
@@ -1384,35 +1384,33 @@ def record_tool(
|
||||
)
|
||||
|
||||
|
||||
def record_sidekick_start(
|
||||
store: EvidenceStore, hook_input: dict[str, Any], *, inject_context: bool = True
|
||||
def record_subagent_start(
|
||||
store: EvidenceStore, hook_input: dict[str, Any]
|
||||
) -> str:
|
||||
"""Record a native sidekick and reuse the main turn's retrieved memories."""
|
||||
"""Record a native subagent and reuse the main turn's retrieved memories."""
|
||||
session_id = _session_id(hook_input)
|
||||
repo = store.repo_for_session(session_id, hook_input.get("cwd"))
|
||||
agent_id = bounded(hook_input.get("agent_id", "unknown-agent"), 200)
|
||||
agent_type = bounded(hook_input.get("agent_type", "mem0:sidekick"), 200)
|
||||
agent_type = bounded(hook_input.get("agent_type", "unknown-agent"), 200)
|
||||
context = combine_context(
|
||||
format_context(store.injected_memories(session_id, repo.identity))
|
||||
)
|
||||
if not inject_context:
|
||||
context = ""
|
||||
first_start = store.start_sidekick(
|
||||
first_start = store.start_subagent(
|
||||
repo, session_id, agent_id, agent_type, len(context)
|
||||
)
|
||||
store.record_event(
|
||||
repo,
|
||||
session_id,
|
||||
"sidekick_start",
|
||||
"subagent_start",
|
||||
{
|
||||
"agent_id": agent_id,
|
||||
"agent_type": agent_type,
|
||||
"context_chars": len(context) if first_start else 0,
|
||||
"worktree_root": bounded(repo.root, 2000),
|
||||
"repo_root": bounded(repo.root, 2000),
|
||||
},
|
||||
)
|
||||
telemetry.record(
|
||||
"sidekick",
|
||||
"subagent",
|
||||
repo=repo,
|
||||
session_id=session_id,
|
||||
phase="start",
|
||||
@@ -1422,14 +1420,14 @@ def record_sidekick_start(
|
||||
return context if first_start else ""
|
||||
|
||||
|
||||
def record_sidekick_stop(store: EvidenceStore, hook_input: dict[str, Any]) -> None:
|
||||
def record_subagent_stop(store: EvidenceStore, hook_input: dict[str, Any]) -> None:
|
||||
session_id = _session_id(hook_input)
|
||||
repo = store.repo_for_session(session_id, hook_input.get("cwd"))
|
||||
agent_type = bounded(hook_input.get("agent_type", "mem0:sidekick"), 200)
|
||||
agent_type = bounded(hook_input.get("agent_type", "unknown-agent"), 200)
|
||||
agent_id = bounded(hook_input.get("agent_id", ""), 200)
|
||||
final_message = redact(hook_input.get("last_assistant_message", "")).strip()
|
||||
transcript_path = bounded(hook_input.get("agent_transcript_path", ""), 2000)
|
||||
agent_id = store.stop_sidekick(
|
||||
agent_id = store.stop_subagent(
|
||||
repo,
|
||||
session_id,
|
||||
agent_id,
|
||||
@@ -1440,7 +1438,7 @@ def record_sidekick_stop(store: EvidenceStore, hook_input: dict[str, Any]) -> No
|
||||
store.record_event(
|
||||
repo,
|
||||
session_id,
|
||||
"sidekick_stop",
|
||||
"subagent_stop",
|
||||
{
|
||||
"agent_id": agent_id,
|
||||
"agent_type": agent_type,
|
||||
@@ -1449,7 +1447,7 @@ def record_sidekick_stop(store: EvidenceStore, hook_input: dict[str, Any]) -> No
|
||||
},
|
||||
)
|
||||
telemetry.record(
|
||||
"sidekick",
|
||||
"subagent",
|
||||
repo=repo,
|
||||
session_id=session_id,
|
||||
phase="stop",
|
||||
@@ -1513,10 +1511,10 @@ def build_episode(
|
||||
for e in events
|
||||
if e["kind"] == "assistant_stop" and e["payload"].get("text")
|
||||
]
|
||||
sidekick_outcomes = [
|
||||
subagent_outcomes = [
|
||||
redact(e["payload"].get("final_message", "")).strip()
|
||||
for e in events
|
||||
if e["kind"] == "sidekick_stop" and e["payload"].get("final_message")
|
||||
if e["kind"] in {"subagent_stop", "sidekick_stop"} and e["payload"].get("final_message")
|
||||
]
|
||||
tools = [
|
||||
e["payload"] for e in events if e["kind"] in {"tool_result", "tool_failure"}
|
||||
@@ -1597,7 +1595,7 @@ def build_episode(
|
||||
}
|
||||
)
|
||||
pending_user_messages = []
|
||||
elif event["kind"] == "sidekick_stop":
|
||||
elif event["kind"] in {"subagent_stop", "sidekick_stop"}:
|
||||
pass
|
||||
extraction_messages.extend(pending_user_messages)
|
||||
|
||||
@@ -1613,7 +1611,7 @@ def build_episode(
|
||||
"assistant_conclusion": conclusion,
|
||||
"user_messages": prompts,
|
||||
"assistant_outcomes": assistant_conclusions,
|
||||
"sidekick_outcomes": sidekick_outcomes,
|
||||
"subagent_outcomes": subagent_outcomes,
|
||||
"extraction_messages": extraction_messages,
|
||||
"files_read": read_paths[:50],
|
||||
"files_modified": modified_paths[:50],
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
import json
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
@@ -10,7 +10,12 @@ ROOT = Path(__file__).resolve().parents[1]
|
||||
REPOSITORY_ROOT = ROOT.parents[1]
|
||||
sys.path.insert(0, str(ROOT))
|
||||
|
||||
from build.build import build, bundle_drift, render_template, replace_output # noqa: E402
|
||||
from build.build import ( # noqa: E402
|
||||
build,
|
||||
bundle_drift,
|
||||
render_template,
|
||||
replace_output,
|
||||
)
|
||||
from build.validate import validate_bundle # noqa: E402
|
||||
|
||||
|
||||
@@ -57,6 +62,7 @@ def test_portable_bundle_is_conformant_and_self_contained(tmp_path: Path) -> Non
|
||||
assert "env" not in server
|
||||
assert not (root / "core" / "hook_runner.py").exists()
|
||||
assert not (root / "core" / "flush_worker.py").exists()
|
||||
assert not (root / "agents").exists()
|
||||
for skill in (root / "skills").glob("*/SKILL.md"):
|
||||
frontmatter = skill.read_text(encoding="utf-8").split("---", 2)[1]
|
||||
keys = {line.split(":", 1)[0] for line in frontmatter.splitlines() if ":" in line}
|
||||
@@ -73,6 +79,19 @@ def test_native_bundle_is_self_contained(host: str, tmp_path: Path) -> None:
|
||||
assert not any(path.is_symlink() for path in root.rglob("*"))
|
||||
|
||||
|
||||
@pytest.mark.parametrize("host", ["claude-code", "cursor", "codex", "kimi", "antigravity"])
|
||||
def test_only_claude_bundles_sidekick(host: str, tmp_path: Path) -> None:
|
||||
root = build(host, "native", tmp_path / host)
|
||||
if host == "claude-code":
|
||||
agent = (root / "agents" / "sidekick.md").read_text()
|
||||
assert "model: sonnet" in agent
|
||||
assert "isolation: worktree" in agent
|
||||
else:
|
||||
assert not (root / "agents").exists()
|
||||
for path in root.rglob("*.json"):
|
||||
assert "sidekick" not in path.read_text().lower()
|
||||
|
||||
|
||||
@pytest.mark.parametrize("host", ["claude-code", "cursor", "codex", "kimi", "antigravity"])
|
||||
def test_native_control_skills_select_the_host_store(host: str, tmp_path: Path) -> None:
|
||||
root = build(host, "native", tmp_path / host)
|
||||
|
||||
+42
-23
@@ -2,6 +2,7 @@
|
||||
|
||||
import json
|
||||
import os
|
||||
import sqlite3
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
@@ -11,11 +12,43 @@ import pytest
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
sys.path.insert(0, str(ROOT / "python"))
|
||||
|
||||
from memory_core import EvidenceStore # noqa: E402
|
||||
from memory_core import EvidenceStore, RepoContext, checkpoint_stats # noqa: E402
|
||||
|
||||
|
||||
@pytest.mark.parametrize("host", ["claude-code", "codex", "kimi", "cursor"])
|
||||
def test_sidekick_hooks_preserve_parent_scope_and_correlate_completion(tmp_path, host):
|
||||
def test_generic_tracking_preserves_legacy_runs_and_can_finish_them(tmp_path):
|
||||
database = tmp_path / "evidence.sqlite3"
|
||||
with sqlite3.connect(database) as connection:
|
||||
connection.executescript("""
|
||||
CREATE TABLE sidekick_runs (
|
||||
repo_id TEXT NOT NULL, session_id TEXT NOT NULL,
|
||||
agent_id TEXT NOT NULL, agent_type TEXT NOT NULL,
|
||||
started_at TEXT NOT NULL, stopped_at TEXT, transcript_path TEXT,
|
||||
context_chars INTEGER NOT NULL DEFAULT 0, final_message TEXT,
|
||||
PRIMARY KEY(repo_id, session_id, agent_id)
|
||||
);
|
||||
INSERT INTO sidekick_runs VALUES
|
||||
('repo', 'session', 'worker', 'default', '2026-09-10', NULL, NULL, 123, NULL);
|
||||
""")
|
||||
for _ in range(2):
|
||||
store = EvidenceStore(database)
|
||||
try:
|
||||
assert store.status("repo")["subagent_runs"] == 1
|
||||
row = store.conn.execute("SELECT * FROM sidekick_runs").fetchone()
|
||||
assert row["agent_id"] == "worker"
|
||||
assert row["context_chars"] == 123
|
||||
repo = RepoContext(str(tmp_path), str(tmp_path), "repo", "app", "main", "")
|
||||
store.stop_subagent(repo, "session", "worker", "default", "", "Completed after upgrade.")
|
||||
assert store.status("repo")["last_subagent"]["stopped_at"]
|
||||
assert store.conn.execute("SELECT final_message FROM sidekick_runs").fetchone()[0] == (
|
||||
"Completed after upgrade."
|
||||
)
|
||||
finally:
|
||||
store.close()
|
||||
assert checkpoint_stats([{"kind": "sidekick_stop", "payload": {"final_message": "Legacy result."}}]) == (0, 1, 14)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("host", ["claude-code", "codex"])
|
||||
def test_subagent_hooks_preserve_parent_scope_and_correlate_completion(tmp_path, host):
|
||||
parent = tmp_path / "parent"
|
||||
child = tmp_path / "child-worktree"
|
||||
parent.mkdir()
|
||||
@@ -30,21 +63,10 @@ def test_sidekick_hooks_preserve_parent_scope_and_correlate_completion(tmp_path,
|
||||
plugin = ROOT.parent / f"{host}-plugin"
|
||||
adapter = plugin / ("adapters/claude/hook.py" if host == "claude-code" else "hooks/adapter.py")
|
||||
start, stop = "sidekick-start", "sidekick-stop"
|
||||
payload = {"session_id": "parent-session", "cwd": str(child), "agent_id": "worker", "agent_type": "sidekick"}
|
||||
payload = {"session_id": "parent-session", "cwd": str(child), "agent_id": "worker", "agent_type": "default"}
|
||||
response_key = "last_assistant_message"
|
||||
if host == "kimi":
|
||||
start, stop = "SubagentStart", "SubagentStop"
|
||||
payload["agent_name"] = payload.pop("agent_type")
|
||||
response_key = "response"
|
||||
elif host == "cursor":
|
||||
start, stop = "subagentStart", "subagentStop"
|
||||
payload = {
|
||||
"conversation_id": "parent-session",
|
||||
"workspace_roots": [str(child)],
|
||||
"subagent_id": "worker",
|
||||
"subagent_type": "sidekick",
|
||||
}
|
||||
response_key = "summary"
|
||||
if host == "codex":
|
||||
start, stop = "subagent-start", "subagent-stop"
|
||||
|
||||
env = {key: value for key, value in os.environ.items() if not key.startswith(("MEM0_", "CLAUDE_PLUGIN_"))}
|
||||
env.update(MEM0_CODE_DATA_DIR=str(database.parent), MEM0_TELEMETRY="false", MEM0_API_URL="http://127.0.0.1:1")
|
||||
@@ -62,11 +84,8 @@ def test_sidekick_hooks_preserve_parent_scope_and_correlate_completion(tmp_path,
|
||||
return result.stdout
|
||||
|
||||
output = invoke(start, payload)
|
||||
if host == "cursor":
|
||||
assert json.loads(output) == {"permission": "allow"}
|
||||
else:
|
||||
context = output if host == "kimi" else json.loads(output)["hookSpecificOutput"]["additionalContext"]
|
||||
assert "Parent memory marker." in context
|
||||
context = json.loads(output)["hookSpecificOutput"]["additionalContext"]
|
||||
assert "Parent memory marker." in context
|
||||
assert "Foreign memory marker." not in output
|
||||
assert "Parent memory marker." not in invoke(start, payload)
|
||||
invoke(stop, {**payload, response_key: "Finished the delegated task."})
|
||||
@@ -80,4 +99,4 @@ def test_sidekick_hooks_preserve_parent_scope_and_correlate_completion(tmp_path,
|
||||
)
|
||||
assert runs[0]["stopped_at"]
|
||||
assert runs[0]["final_message"] == "Finished the delegated task."
|
||||
assert (runs[0]["context_chars"] > 0) == (host != "cursor")
|
||||
assert runs[0]["context_chars"] > 0
|
||||
@@ -149,7 +149,7 @@ export async function buildRecallContext(
|
||||
if (!unseen.length) return "";
|
||||
|
||||
const prefix =
|
||||
"<mem0-relevant-memories>\nRetrieved automatically for the current request. This is a shallow first pass — search mem0_memory for more if you need it.\n";
|
||||
"<mem0-relevant-memories>\nRetrieved automatically for the current request. This is a shallow first pass — use the available memory search tool for more if you need it.\n";
|
||||
const suffix = "\n</mem0-relevant-memories>";
|
||||
const maxChars = options.maxChars ?? DEFAULT_MAX_CONTEXT_CHARS;
|
||||
const lines: string[] = [];
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
---
|
||||
name: sidekick
|
||||
description: Coding subagent for focused implementation, investigation, testing, debugging, or review work.
|
||||
subagent: true
|
||||
---
|
||||
|
||||
You are Mem0's coding sidekick. Complete only the bounded task the main agent
|
||||
delegates to you and return a concise, self-contained result.
|
||||
|
||||
Search Mem0 before work that may depend on prior repository decisions or user
|
||||
preferences. Inspect the relevant repository rules and code, make changes when
|
||||
asked, and run the smallest decisive validation. Use only the workspace the
|
||||
caller assigned; do not assume a separate Git worktree.
|
||||
|
||||
Your final response must state the outcome, changed files, validation, and any
|
||||
remaining risk. Do not commit, push, or open a pull request unless the caller
|
||||
explicitly asks.
|
||||
@@ -11,10 +11,10 @@ import telemetry
|
||||
from memory_core import (
|
||||
EvidenceStore,
|
||||
api_key,
|
||||
configure_harness,
|
||||
data_dir,
|
||||
doctor,
|
||||
forget_remote_repo,
|
||||
configure_harness,
|
||||
resolve_repo,
|
||||
user_id,
|
||||
)
|
||||
@@ -32,7 +32,7 @@ def _print_status(value: dict) -> None:
|
||||
)
|
||||
print(
|
||||
f"Used in this repository: {value['retrievals']} memories returned, "
|
||||
f"{value['sidekick_runs']} sidekick runs"
|
||||
f"{value['subagent_runs']} subagent runs"
|
||||
)
|
||||
if last:
|
||||
item_label = ""
|
||||
@@ -48,13 +48,13 @@ def _print_status(value: dict) -> None:
|
||||
f"{'succeeded' if last['success'] else 'failed'} "
|
||||
f"({last['duration_ms']:.1f} ms{item_label})"
|
||||
)
|
||||
sidekick = value.get("last_sidekick") or {}
|
||||
if sidekick:
|
||||
state = "finished" if sidekick.get("stopped_at") else "started"
|
||||
subagent = value.get("last_subagent") or {}
|
||||
if subagent:
|
||||
state = "finished" if subagent.get("stopped_at") else "started"
|
||||
print(
|
||||
"Last sidekick: "
|
||||
f"{state}, received {sidekick['context_chars']} characters of memory, "
|
||||
f"agent {sidekick['agent_id']}"
|
||||
"Last subagent: "
|
||||
f"{state}, received {subagent['context_chars']} characters of memory, "
|
||||
f"agent {subagent['agent_id']}"
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -524,7 +524,7 @@ def _checkpoint_message(event: dict[str, Any]) -> str:
|
||||
if text:
|
||||
return text
|
||||
return redact(payload.get("text", "")).strip()
|
||||
if kind == "sidekick_stop":
|
||||
if kind in {"subagent_stop", "sidekick_stop"}:
|
||||
return redact(payload.get("final_message", "")).strip()
|
||||
return ""
|
||||
|
||||
@@ -596,6 +596,7 @@ class EvidenceStore:
|
||||
self.conn.close()
|
||||
|
||||
def _migrate(self) -> None:
|
||||
# Keep the legacy table name so existing databases and in-flight workers remain compatible.
|
||||
self.conn.executescript(
|
||||
"""
|
||||
CREATE TABLE IF NOT EXISTS events (
|
||||
@@ -688,8 +689,7 @@ class EvidenceStore:
|
||||
|
||||
"""
|
||||
)
|
||||
# Remove the pre-0.1.1 no-tools snapshot implementation. The real coding
|
||||
# sidekick is a native Claude Code agent and stores no state in this DB.
|
||||
# Remove the pre-0.1.1 snapshot implementation.
|
||||
self.conn.executescript(
|
||||
"""
|
||||
DROP TABLE IF EXISTS sidekick_calls;
|
||||
@@ -1041,7 +1041,7 @@ class EvidenceStore:
|
||||
if row["memory_text"]
|
||||
]
|
||||
|
||||
def start_sidekick(
|
||||
def start_subagent(
|
||||
self,
|
||||
repo: RepoContext,
|
||||
session_id: str,
|
||||
@@ -1049,7 +1049,7 @@ class EvidenceStore:
|
||||
agent_type: str,
|
||||
context_chars: int,
|
||||
) -> bool:
|
||||
"""Record one native sidekick instance and whether context was first sent."""
|
||||
"""Record one native subagent instance and whether context was first sent."""
|
||||
with self.conn:
|
||||
cursor = self.conn.execute(
|
||||
"""INSERT OR IGNORE INTO sidekick_runs
|
||||
@@ -1067,7 +1067,7 @@ class EvidenceStore:
|
||||
)
|
||||
return int(cursor.rowcount) > 0
|
||||
|
||||
def stop_sidekick(
|
||||
def stop_subagent(
|
||||
self,
|
||||
repo: RepoContext,
|
||||
session_id: str,
|
||||
@@ -1222,7 +1222,7 @@ class EvidenceStore:
|
||||
cursor = self.conn.execute(
|
||||
f"DELETE FROM {table} WHERE {column} = ?", (repo_id,)
|
||||
)
|
||||
removed[table] = max(int(cursor.rowcount), 0)
|
||||
removed["subagent_runs" if table == "sidekick_runs" else table] = max(int(cursor.rowcount), 0)
|
||||
return removed
|
||||
|
||||
def status(self, repo_id: str) -> dict[str, Any]:
|
||||
@@ -1238,7 +1238,7 @@ class EvidenceStore:
|
||||
FROM operations WHERE repo_id = ? ORDER BY id DESC LIMIT 1""",
|
||||
(repo_id,),
|
||||
).fetchone()
|
||||
last_sidekick = self.conn.execute(
|
||||
last_subagent = self.conn.execute(
|
||||
"""SELECT session_id, agent_id, agent_type, started_at, stopped_at,
|
||||
context_chars
|
||||
FROM sidekick_runs WHERE repo_id = ?
|
||||
@@ -1250,9 +1250,9 @@ class EvidenceStore:
|
||||
"events": count("events"),
|
||||
"flushes": count("flushes"),
|
||||
"retrievals": count("retrievals"),
|
||||
"sidekick_runs": count("sidekick_runs"),
|
||||
"subagent_runs": count("sidekick_runs"),
|
||||
"last_operation": dict(last_operation) if last_operation else None,
|
||||
"last_sidekick": dict(last_sidekick) if last_sidekick else None,
|
||||
"last_subagent": dict(last_subagent) if last_subagent else None,
|
||||
}
|
||||
|
||||
|
||||
@@ -1324,7 +1324,7 @@ def tool_payload(hook_input: dict[str, Any], *, failed: bool | None = False) ->
|
||||
"tool": name,
|
||||
"failed": failed,
|
||||
"duration_ms": hook_input.get("duration_ms"),
|
||||
"agent_role": "sidekick" if hook_input.get("agent_id") else "main",
|
||||
"agent_role": "subagent" if hook_input.get("agent_id") else "main",
|
||||
}
|
||||
if hook_input.get("agent_id"):
|
||||
payload["agent_id"] = bounded(hook_input["agent_id"], 200)
|
||||
@@ -1384,35 +1384,33 @@ def record_tool(
|
||||
)
|
||||
|
||||
|
||||
def record_sidekick_start(
|
||||
store: EvidenceStore, hook_input: dict[str, Any], *, inject_context: bool = True
|
||||
def record_subagent_start(
|
||||
store: EvidenceStore, hook_input: dict[str, Any]
|
||||
) -> str:
|
||||
"""Record a native sidekick and reuse the main turn's retrieved memories."""
|
||||
"""Record a native subagent and reuse the main turn's retrieved memories."""
|
||||
session_id = _session_id(hook_input)
|
||||
repo = store.repo_for_session(session_id, hook_input.get("cwd"))
|
||||
agent_id = bounded(hook_input.get("agent_id", "unknown-agent"), 200)
|
||||
agent_type = bounded(hook_input.get("agent_type", "mem0:sidekick"), 200)
|
||||
agent_type = bounded(hook_input.get("agent_type", "unknown-agent"), 200)
|
||||
context = combine_context(
|
||||
format_context(store.injected_memories(session_id, repo.identity))
|
||||
)
|
||||
if not inject_context:
|
||||
context = ""
|
||||
first_start = store.start_sidekick(
|
||||
first_start = store.start_subagent(
|
||||
repo, session_id, agent_id, agent_type, len(context)
|
||||
)
|
||||
store.record_event(
|
||||
repo,
|
||||
session_id,
|
||||
"sidekick_start",
|
||||
"subagent_start",
|
||||
{
|
||||
"agent_id": agent_id,
|
||||
"agent_type": agent_type,
|
||||
"context_chars": len(context) if first_start else 0,
|
||||
"worktree_root": bounded(repo.root, 2000),
|
||||
"repo_root": bounded(repo.root, 2000),
|
||||
},
|
||||
)
|
||||
telemetry.record(
|
||||
"sidekick",
|
||||
"subagent",
|
||||
repo=repo,
|
||||
session_id=session_id,
|
||||
phase="start",
|
||||
@@ -1422,14 +1420,14 @@ def record_sidekick_start(
|
||||
return context if first_start else ""
|
||||
|
||||
|
||||
def record_sidekick_stop(store: EvidenceStore, hook_input: dict[str, Any]) -> None:
|
||||
def record_subagent_stop(store: EvidenceStore, hook_input: dict[str, Any]) -> None:
|
||||
session_id = _session_id(hook_input)
|
||||
repo = store.repo_for_session(session_id, hook_input.get("cwd"))
|
||||
agent_type = bounded(hook_input.get("agent_type", "mem0:sidekick"), 200)
|
||||
agent_type = bounded(hook_input.get("agent_type", "unknown-agent"), 200)
|
||||
agent_id = bounded(hook_input.get("agent_id", ""), 200)
|
||||
final_message = redact(hook_input.get("last_assistant_message", "")).strip()
|
||||
transcript_path = bounded(hook_input.get("agent_transcript_path", ""), 2000)
|
||||
agent_id = store.stop_sidekick(
|
||||
agent_id = store.stop_subagent(
|
||||
repo,
|
||||
session_id,
|
||||
agent_id,
|
||||
@@ -1440,7 +1438,7 @@ def record_sidekick_stop(store: EvidenceStore, hook_input: dict[str, Any]) -> No
|
||||
store.record_event(
|
||||
repo,
|
||||
session_id,
|
||||
"sidekick_stop",
|
||||
"subagent_stop",
|
||||
{
|
||||
"agent_id": agent_id,
|
||||
"agent_type": agent_type,
|
||||
@@ -1449,7 +1447,7 @@ def record_sidekick_stop(store: EvidenceStore, hook_input: dict[str, Any]) -> No
|
||||
},
|
||||
)
|
||||
telemetry.record(
|
||||
"sidekick",
|
||||
"subagent",
|
||||
repo=repo,
|
||||
session_id=session_id,
|
||||
phase="stop",
|
||||
@@ -1513,10 +1511,10 @@ def build_episode(
|
||||
for e in events
|
||||
if e["kind"] == "assistant_stop" and e["payload"].get("text")
|
||||
]
|
||||
sidekick_outcomes = [
|
||||
subagent_outcomes = [
|
||||
redact(e["payload"].get("final_message", "")).strip()
|
||||
for e in events
|
||||
if e["kind"] == "sidekick_stop" and e["payload"].get("final_message")
|
||||
if e["kind"] in {"subagent_stop", "sidekick_stop"} and e["payload"].get("final_message")
|
||||
]
|
||||
tools = [
|
||||
e["payload"] for e in events if e["kind"] in {"tool_result", "tool_failure"}
|
||||
@@ -1597,7 +1595,7 @@ def build_episode(
|
||||
}
|
||||
)
|
||||
pending_user_messages = []
|
||||
elif event["kind"] == "sidekick_stop":
|
||||
elif event["kind"] in {"subagent_stop", "sidekick_stop"}:
|
||||
pass
|
||||
extraction_messages.extend(pending_user_messages)
|
||||
|
||||
@@ -1613,7 +1611,7 @@ def build_episode(
|
||||
"assistant_conclusion": conclusion,
|
||||
"user_messages": prompts,
|
||||
"assistant_outcomes": assistant_conclusions,
|
||||
"sidekick_outcomes": sidekick_outcomes,
|
||||
"subagent_outcomes": subagent_outcomes,
|
||||
"extraction_messages": extraction_messages,
|
||||
"files_read": read_paths[:50],
|
||||
"files_modified": modified_paths[:50],
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
"plugin.json": "plugin.json",
|
||||
"hooks.json": "hooks.json",
|
||||
"mcp_config.json": "mcp_config.json",
|
||||
"hooks/adapter.py": "hooks/adapter.py",
|
||||
"agents/sidekick/agent.md": "agents/sidekick/agent.md"
|
||||
"hooks/adapter.py": "hooks/adapter.py"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ def test_native_antigravity_bundle_uses_supported_events(tmp_path: Path) -> None
|
||||
assert manifest["$schema"] == "https://antigravity.google/schemas/v1/plugin.json"
|
||||
assert set(hooks) == {"PreInvocation", "PostToolUse", "Stop"}
|
||||
assert (root / "mcp_config.json").is_file()
|
||||
assert (root / "agents" / "sidekick" / "agent.md").is_file()
|
||||
assert not (root / "agents").exists()
|
||||
assert not any(path.is_symlink() for path in root.rglob("*"))
|
||||
|
||||
|
||||
|
||||
@@ -63,6 +63,8 @@ After that first search, Claude can call `search_memories` with a specific quest
|
||||
|
||||
### Sonnet sidekick agent
|
||||
|
||||
Sidekick is available only in this plugin. The shared core handles memory and subagent tracking.
|
||||
|
||||
`mem0:sidekick` is a Sonnet coding agent that runs in a separate Git worktree. It can investigate, implement, test, debug, or review something instead of the main (Opus/Fable) session doing the same work, reducing cost when the main agent doesn't need to repeat it.
|
||||
|
||||
The main agent reviews the result. Corrections go back to the same sidekick so it keeps what it learned. Changes stay in the sidekick's worktree until the main agent reviews and copies them over.
|
||||
|
||||
@@ -12,22 +12,22 @@ _core_dir = _bundled_core if (_bundled_core / "memory_core.py").is_file() else _
|
||||
sys.path.insert(0, str(_core_dir))
|
||||
sys.path.insert(0, str(_here.parent))
|
||||
|
||||
import hook_runner # noqa: E402
|
||||
import telemetry # noqa: E402
|
||||
from memory_core import ( # noqa: E402
|
||||
configure_harness,
|
||||
record_sidekick_start,
|
||||
record_sidekick_stop,
|
||||
record_subagent_start,
|
||||
record_subagent_stop,
|
||||
record_tool,
|
||||
)
|
||||
from transcript import record_stop # noqa: E402
|
||||
import hook_runner # noqa: E402
|
||||
|
||||
configure_harness("claude-code", data_dir_name="claude-code-plugin", source_tag="claude_code_plugin")
|
||||
telemetry.init(harness="claude-code", source_tag="CLAUDE_CODE_PLUGIN")
|
||||
|
||||
|
||||
def _sidekick_start(store, hook_input):
|
||||
context = record_sidekick_start(store, hook_input)
|
||||
context = record_subagent_start(store, {"agent_type": "mem0:sidekick", **hook_input})
|
||||
if context:
|
||||
return {
|
||||
"hookSpecificOutput": {
|
||||
@@ -38,7 +38,7 @@ def _sidekick_start(store, hook_input):
|
||||
|
||||
|
||||
def _sidekick_stop(store, hook_input):
|
||||
record_sidekick_stop(store, hook_input)
|
||||
record_subagent_stop(store, {"agent_type": "mem0:sidekick", **hook_input})
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -11,10 +11,10 @@ import telemetry
|
||||
from memory_core import (
|
||||
EvidenceStore,
|
||||
api_key,
|
||||
configure_harness,
|
||||
data_dir,
|
||||
doctor,
|
||||
forget_remote_repo,
|
||||
configure_harness,
|
||||
resolve_repo,
|
||||
user_id,
|
||||
)
|
||||
@@ -32,7 +32,7 @@ def _print_status(value: dict) -> None:
|
||||
)
|
||||
print(
|
||||
f"Used in this repository: {value['retrievals']} memories returned, "
|
||||
f"{value['sidekick_runs']} sidekick runs"
|
||||
f"{value['subagent_runs']} subagent runs"
|
||||
)
|
||||
if last:
|
||||
item_label = ""
|
||||
@@ -48,13 +48,13 @@ def _print_status(value: dict) -> None:
|
||||
f"{'succeeded' if last['success'] else 'failed'} "
|
||||
f"({last['duration_ms']:.1f} ms{item_label})"
|
||||
)
|
||||
sidekick = value.get("last_sidekick") or {}
|
||||
if sidekick:
|
||||
state = "finished" if sidekick.get("stopped_at") else "started"
|
||||
subagent = value.get("last_subagent") or {}
|
||||
if subagent:
|
||||
state = "finished" if subagent.get("stopped_at") else "started"
|
||||
print(
|
||||
"Last sidekick: "
|
||||
f"{state}, received {sidekick['context_chars']} characters of memory, "
|
||||
f"agent {sidekick['agent_id']}"
|
||||
"Last subagent: "
|
||||
f"{state}, received {subagent['context_chars']} characters of memory, "
|
||||
f"agent {subagent['agent_id']}"
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -524,7 +524,7 @@ def _checkpoint_message(event: dict[str, Any]) -> str:
|
||||
if text:
|
||||
return text
|
||||
return redact(payload.get("text", "")).strip()
|
||||
if kind == "sidekick_stop":
|
||||
if kind in {"subagent_stop", "sidekick_stop"}:
|
||||
return redact(payload.get("final_message", "")).strip()
|
||||
return ""
|
||||
|
||||
@@ -596,6 +596,7 @@ class EvidenceStore:
|
||||
self.conn.close()
|
||||
|
||||
def _migrate(self) -> None:
|
||||
# Keep the legacy table name so existing databases and in-flight workers remain compatible.
|
||||
self.conn.executescript(
|
||||
"""
|
||||
CREATE TABLE IF NOT EXISTS events (
|
||||
@@ -688,8 +689,7 @@ class EvidenceStore:
|
||||
|
||||
"""
|
||||
)
|
||||
# Remove the pre-0.1.1 no-tools snapshot implementation. The real coding
|
||||
# sidekick is a native Claude Code agent and stores no state in this DB.
|
||||
# Remove the pre-0.1.1 snapshot implementation.
|
||||
self.conn.executescript(
|
||||
"""
|
||||
DROP TABLE IF EXISTS sidekick_calls;
|
||||
@@ -1041,7 +1041,7 @@ class EvidenceStore:
|
||||
if row["memory_text"]
|
||||
]
|
||||
|
||||
def start_sidekick(
|
||||
def start_subagent(
|
||||
self,
|
||||
repo: RepoContext,
|
||||
session_id: str,
|
||||
@@ -1049,7 +1049,7 @@ class EvidenceStore:
|
||||
agent_type: str,
|
||||
context_chars: int,
|
||||
) -> bool:
|
||||
"""Record one native sidekick instance and whether context was first sent."""
|
||||
"""Record one native subagent instance and whether context was first sent."""
|
||||
with self.conn:
|
||||
cursor = self.conn.execute(
|
||||
"""INSERT OR IGNORE INTO sidekick_runs
|
||||
@@ -1067,7 +1067,7 @@ class EvidenceStore:
|
||||
)
|
||||
return int(cursor.rowcount) > 0
|
||||
|
||||
def stop_sidekick(
|
||||
def stop_subagent(
|
||||
self,
|
||||
repo: RepoContext,
|
||||
session_id: str,
|
||||
@@ -1222,7 +1222,7 @@ class EvidenceStore:
|
||||
cursor = self.conn.execute(
|
||||
f"DELETE FROM {table} WHERE {column} = ?", (repo_id,)
|
||||
)
|
||||
removed[table] = max(int(cursor.rowcount), 0)
|
||||
removed["subagent_runs" if table == "sidekick_runs" else table] = max(int(cursor.rowcount), 0)
|
||||
return removed
|
||||
|
||||
def status(self, repo_id: str) -> dict[str, Any]:
|
||||
@@ -1238,7 +1238,7 @@ class EvidenceStore:
|
||||
FROM operations WHERE repo_id = ? ORDER BY id DESC LIMIT 1""",
|
||||
(repo_id,),
|
||||
).fetchone()
|
||||
last_sidekick = self.conn.execute(
|
||||
last_subagent = self.conn.execute(
|
||||
"""SELECT session_id, agent_id, agent_type, started_at, stopped_at,
|
||||
context_chars
|
||||
FROM sidekick_runs WHERE repo_id = ?
|
||||
@@ -1250,9 +1250,9 @@ class EvidenceStore:
|
||||
"events": count("events"),
|
||||
"flushes": count("flushes"),
|
||||
"retrievals": count("retrievals"),
|
||||
"sidekick_runs": count("sidekick_runs"),
|
||||
"subagent_runs": count("sidekick_runs"),
|
||||
"last_operation": dict(last_operation) if last_operation else None,
|
||||
"last_sidekick": dict(last_sidekick) if last_sidekick else None,
|
||||
"last_subagent": dict(last_subagent) if last_subagent else None,
|
||||
}
|
||||
|
||||
|
||||
@@ -1324,7 +1324,7 @@ def tool_payload(hook_input: dict[str, Any], *, failed: bool | None = False) ->
|
||||
"tool": name,
|
||||
"failed": failed,
|
||||
"duration_ms": hook_input.get("duration_ms"),
|
||||
"agent_role": "sidekick" if hook_input.get("agent_id") else "main",
|
||||
"agent_role": "subagent" if hook_input.get("agent_id") else "main",
|
||||
}
|
||||
if hook_input.get("agent_id"):
|
||||
payload["agent_id"] = bounded(hook_input["agent_id"], 200)
|
||||
@@ -1384,35 +1384,33 @@ def record_tool(
|
||||
)
|
||||
|
||||
|
||||
def record_sidekick_start(
|
||||
store: EvidenceStore, hook_input: dict[str, Any], *, inject_context: bool = True
|
||||
def record_subagent_start(
|
||||
store: EvidenceStore, hook_input: dict[str, Any]
|
||||
) -> str:
|
||||
"""Record a native sidekick and reuse the main turn's retrieved memories."""
|
||||
"""Record a native subagent and reuse the main turn's retrieved memories."""
|
||||
session_id = _session_id(hook_input)
|
||||
repo = store.repo_for_session(session_id, hook_input.get("cwd"))
|
||||
agent_id = bounded(hook_input.get("agent_id", "unknown-agent"), 200)
|
||||
agent_type = bounded(hook_input.get("agent_type", "mem0:sidekick"), 200)
|
||||
agent_type = bounded(hook_input.get("agent_type", "unknown-agent"), 200)
|
||||
context = combine_context(
|
||||
format_context(store.injected_memories(session_id, repo.identity))
|
||||
)
|
||||
if not inject_context:
|
||||
context = ""
|
||||
first_start = store.start_sidekick(
|
||||
first_start = store.start_subagent(
|
||||
repo, session_id, agent_id, agent_type, len(context)
|
||||
)
|
||||
store.record_event(
|
||||
repo,
|
||||
session_id,
|
||||
"sidekick_start",
|
||||
"subagent_start",
|
||||
{
|
||||
"agent_id": agent_id,
|
||||
"agent_type": agent_type,
|
||||
"context_chars": len(context) if first_start else 0,
|
||||
"worktree_root": bounded(repo.root, 2000),
|
||||
"repo_root": bounded(repo.root, 2000),
|
||||
},
|
||||
)
|
||||
telemetry.record(
|
||||
"sidekick",
|
||||
"subagent",
|
||||
repo=repo,
|
||||
session_id=session_id,
|
||||
phase="start",
|
||||
@@ -1422,14 +1420,14 @@ def record_sidekick_start(
|
||||
return context if first_start else ""
|
||||
|
||||
|
||||
def record_sidekick_stop(store: EvidenceStore, hook_input: dict[str, Any]) -> None:
|
||||
def record_subagent_stop(store: EvidenceStore, hook_input: dict[str, Any]) -> None:
|
||||
session_id = _session_id(hook_input)
|
||||
repo = store.repo_for_session(session_id, hook_input.get("cwd"))
|
||||
agent_type = bounded(hook_input.get("agent_type", "mem0:sidekick"), 200)
|
||||
agent_type = bounded(hook_input.get("agent_type", "unknown-agent"), 200)
|
||||
agent_id = bounded(hook_input.get("agent_id", ""), 200)
|
||||
final_message = redact(hook_input.get("last_assistant_message", "")).strip()
|
||||
transcript_path = bounded(hook_input.get("agent_transcript_path", ""), 2000)
|
||||
agent_id = store.stop_sidekick(
|
||||
agent_id = store.stop_subagent(
|
||||
repo,
|
||||
session_id,
|
||||
agent_id,
|
||||
@@ -1440,7 +1438,7 @@ def record_sidekick_stop(store: EvidenceStore, hook_input: dict[str, Any]) -> No
|
||||
store.record_event(
|
||||
repo,
|
||||
session_id,
|
||||
"sidekick_stop",
|
||||
"subagent_stop",
|
||||
{
|
||||
"agent_id": agent_id,
|
||||
"agent_type": agent_type,
|
||||
@@ -1449,7 +1447,7 @@ def record_sidekick_stop(store: EvidenceStore, hook_input: dict[str, Any]) -> No
|
||||
},
|
||||
)
|
||||
telemetry.record(
|
||||
"sidekick",
|
||||
"subagent",
|
||||
repo=repo,
|
||||
session_id=session_id,
|
||||
phase="stop",
|
||||
@@ -1513,10 +1511,10 @@ def build_episode(
|
||||
for e in events
|
||||
if e["kind"] == "assistant_stop" and e["payload"].get("text")
|
||||
]
|
||||
sidekick_outcomes = [
|
||||
subagent_outcomes = [
|
||||
redact(e["payload"].get("final_message", "")).strip()
|
||||
for e in events
|
||||
if e["kind"] == "sidekick_stop" and e["payload"].get("final_message")
|
||||
if e["kind"] in {"subagent_stop", "sidekick_stop"} and e["payload"].get("final_message")
|
||||
]
|
||||
tools = [
|
||||
e["payload"] for e in events if e["kind"] in {"tool_result", "tool_failure"}
|
||||
@@ -1597,7 +1595,7 @@ def build_episode(
|
||||
}
|
||||
)
|
||||
pending_user_messages = []
|
||||
elif event["kind"] == "sidekick_stop":
|
||||
elif event["kind"] in {"subagent_stop", "sidekick_stop"}:
|
||||
pass
|
||||
extraction_messages.extend(pending_user_messages)
|
||||
|
||||
@@ -1613,7 +1611,7 @@ def build_episode(
|
||||
"assistant_conclusion": conclusion,
|
||||
"user_messages": prompts,
|
||||
"assistant_outcomes": assistant_conclusions,
|
||||
"sidekick_outcomes": sidekick_outcomes,
|
||||
"subagent_outcomes": subagent_outcomes,
|
||||
"extraction_messages": extraction_messages,
|
||||
"files_read": read_paths[:50],
|
||||
"files_modified": modified_paths[:50],
|
||||
|
||||
@@ -803,7 +803,7 @@ def test_tool_capture_identifies_main_and_sidekick_roles():
|
||||
)
|
||||
|
||||
assert main["agent_role"] == "main"
|
||||
assert sidekick["agent_role"] == "sidekick"
|
||||
assert sidekick["agent_role"] == "subagent"
|
||||
assert sidekick["agent_id"] == "agent-123"
|
||||
assert sidekick["agent_type"] == "mem0:sidekick"
|
||||
|
||||
@@ -1665,7 +1665,7 @@ def test_checkpoint_queues_only_prod_extraction_with_canonical_evidence(
|
||||
store.record_event(
|
||||
repo(),
|
||||
"s1",
|
||||
"sidekick_stop",
|
||||
"subagent_stop",
|
||||
{
|
||||
"agent_id": "agent-1",
|
||||
"agent_type": "mem0:sidekick",
|
||||
@@ -2337,9 +2337,9 @@ def test_sidekick_reuses_parent_memory_once_and_records_lifecycle(
|
||||
}
|
||||
|
||||
with patch.object(memory_core, "resolve_repo", return_value=repo()):
|
||||
first = memory_core.record_sidekick_start(store, start_input)
|
||||
repeated = memory_core.record_sidekick_start(store, start_input)
|
||||
memory_core.record_sidekick_stop(
|
||||
first = memory_core.record_subagent_start(store, start_input)
|
||||
repeated = memory_core.record_subagent_start(store, start_input)
|
||||
memory_core.record_subagent_stop(
|
||||
store,
|
||||
{
|
||||
**start_input,
|
||||
@@ -2359,11 +2359,11 @@ def test_sidekick_reuses_parent_memory_once_and_records_lifecycle(
|
||||
row[0]
|
||||
for row in store.conn.execute("SELECT kind FROM events ORDER BY id").fetchall()
|
||||
]
|
||||
assert events == ["sidekick_start", "sidekick_start", "sidekick_stop"]
|
||||
assert events == ["subagent_start", "subagent_start", "subagent_stop"]
|
||||
store.close()
|
||||
|
||||
|
||||
def test_sidekick_stop_without_agent_id_closes_latest_matching_run(isolated_env):
|
||||
def test_subagent_stop_without_agent_id_closes_latest_matching_run(isolated_env):
|
||||
store = memory_core.EvidenceStore()
|
||||
start_input = {
|
||||
"session_id": "s1",
|
||||
@@ -2373,8 +2373,8 @@ def test_sidekick_stop_without_agent_id_closes_latest_matching_run(isolated_env)
|
||||
}
|
||||
|
||||
with patch.object(memory_core, "resolve_repo", return_value=repo()):
|
||||
memory_core.record_sidekick_start(store, start_input)
|
||||
memory_core.record_sidekick_stop(
|
||||
memory_core.record_subagent_start(store, start_input)
|
||||
memory_core.record_subagent_stop(
|
||||
store,
|
||||
{
|
||||
"session_id": "s1",
|
||||
@@ -2836,14 +2836,14 @@ def test_status_output_explains_memory_activity_in_plain_language(capsys):
|
||||
"events": 8,
|
||||
"flushes": 2,
|
||||
"retrievals": 3,
|
||||
"sidekick_runs": 1,
|
||||
"subagent_runs": 1,
|
||||
"last_operation": {
|
||||
"operation": "flush",
|
||||
"success": 1,
|
||||
"duration_ms": 123.4,
|
||||
"item_count": 2,
|
||||
},
|
||||
"last_sidekick": {
|
||||
"last_subagent": {
|
||||
"stopped_at": "now",
|
||||
"context_chars": 240,
|
||||
"agent_id": "agent-1",
|
||||
@@ -2853,9 +2853,9 @@ def test_status_output_explains_memory_activity_in_plain_language(capsys):
|
||||
|
||||
output = capsys.readouterr().out
|
||||
assert "Saved on this computer: 8 session details, 2 memory updates" in output
|
||||
assert "3 memories returned, 1 sidekick runs" in output
|
||||
assert "3 memories returned, 1 subagent runs" in output
|
||||
assert "Last memory update: succeeded" in output
|
||||
assert "Last sidekick: finished, received 240 characters of memory" in output
|
||||
assert "Last subagent: finished, received 240 characters of memory" in output
|
||||
assert "checkpoint" not in output.lower()
|
||||
assert "injected" not in output.lower()
|
||||
|
||||
@@ -3391,7 +3391,7 @@ def test_plugin_entrypoints_share_explicit_claude_data_dir(tmp_path, monkeypatch
|
||||
status_payload = json.loads(status.stdout)
|
||||
assert status_payload["data_dir"] == str(canonical_data)
|
||||
assert status_payload["retrievals"] == 1
|
||||
assert status_payload["sidekick_runs"] == 1
|
||||
assert status_payload["subagent_runs"] == 1
|
||||
assert not (conflicting_data / "evidence.sqlite3").exists()
|
||||
|
||||
|
||||
@@ -4593,9 +4593,9 @@ def test_extraction_batches_bound_individual_messages_without_losing_text():
|
||||
|
||||
def test_overlapping_subagent_stop_without_id_does_not_guess(isolated_env):
|
||||
store = memory_core.EvidenceStore()
|
||||
store.start_sidekick(repo(), "s1", "first", "sidekick", 0)
|
||||
store.start_sidekick(repo(), "s1", "second", "sidekick", 0)
|
||||
stopped = store.stop_sidekick(repo(), "s1", "", "sidekick", "", "Uncorrelated response")
|
||||
store.start_subagent(repo(), "s1", "first", "sidekick", 0)
|
||||
store.start_subagent(repo(), "s1", "second", "sidekick", 0)
|
||||
stopped = store.stop_subagent(repo(), "s1", "", "sidekick", "", "Uncorrelated response")
|
||||
assert stopped not in {"first", "second"}
|
||||
rows = store.conn.execute("SELECT agent_id, stopped_at, final_message FROM sidekick_runs").fetchall()
|
||||
assert all(row["stopped_at"] is None for row in rows if row["agent_id"] in {"first", "second"})
|
||||
|
||||
@@ -11,10 +11,10 @@ import telemetry
|
||||
from memory_core import (
|
||||
EvidenceStore,
|
||||
api_key,
|
||||
configure_harness,
|
||||
data_dir,
|
||||
doctor,
|
||||
forget_remote_repo,
|
||||
configure_harness,
|
||||
resolve_repo,
|
||||
user_id,
|
||||
)
|
||||
@@ -32,7 +32,7 @@ def _print_status(value: dict) -> None:
|
||||
)
|
||||
print(
|
||||
f"Used in this repository: {value['retrievals']} memories returned, "
|
||||
f"{value['sidekick_runs']} sidekick runs"
|
||||
f"{value['subagent_runs']} subagent runs"
|
||||
)
|
||||
if last:
|
||||
item_label = ""
|
||||
@@ -48,13 +48,13 @@ def _print_status(value: dict) -> None:
|
||||
f"{'succeeded' if last['success'] else 'failed'} "
|
||||
f"({last['duration_ms']:.1f} ms{item_label})"
|
||||
)
|
||||
sidekick = value.get("last_sidekick") or {}
|
||||
if sidekick:
|
||||
state = "finished" if sidekick.get("stopped_at") else "started"
|
||||
subagent = value.get("last_subagent") or {}
|
||||
if subagent:
|
||||
state = "finished" if subagent.get("stopped_at") else "started"
|
||||
print(
|
||||
"Last sidekick: "
|
||||
f"{state}, received {sidekick['context_chars']} characters of memory, "
|
||||
f"agent {sidekick['agent_id']}"
|
||||
"Last subagent: "
|
||||
f"{state}, received {subagent['context_chars']} characters of memory, "
|
||||
f"agent {subagent['agent_id']}"
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -524,7 +524,7 @@ def _checkpoint_message(event: dict[str, Any]) -> str:
|
||||
if text:
|
||||
return text
|
||||
return redact(payload.get("text", "")).strip()
|
||||
if kind == "sidekick_stop":
|
||||
if kind in {"subagent_stop", "sidekick_stop"}:
|
||||
return redact(payload.get("final_message", "")).strip()
|
||||
return ""
|
||||
|
||||
@@ -596,6 +596,7 @@ class EvidenceStore:
|
||||
self.conn.close()
|
||||
|
||||
def _migrate(self) -> None:
|
||||
# Keep the legacy table name so existing databases and in-flight workers remain compatible.
|
||||
self.conn.executescript(
|
||||
"""
|
||||
CREATE TABLE IF NOT EXISTS events (
|
||||
@@ -688,8 +689,7 @@ class EvidenceStore:
|
||||
|
||||
"""
|
||||
)
|
||||
# Remove the pre-0.1.1 no-tools snapshot implementation. The real coding
|
||||
# sidekick is a native Claude Code agent and stores no state in this DB.
|
||||
# Remove the pre-0.1.1 snapshot implementation.
|
||||
self.conn.executescript(
|
||||
"""
|
||||
DROP TABLE IF EXISTS sidekick_calls;
|
||||
@@ -1041,7 +1041,7 @@ class EvidenceStore:
|
||||
if row["memory_text"]
|
||||
]
|
||||
|
||||
def start_sidekick(
|
||||
def start_subagent(
|
||||
self,
|
||||
repo: RepoContext,
|
||||
session_id: str,
|
||||
@@ -1049,7 +1049,7 @@ class EvidenceStore:
|
||||
agent_type: str,
|
||||
context_chars: int,
|
||||
) -> bool:
|
||||
"""Record one native sidekick instance and whether context was first sent."""
|
||||
"""Record one native subagent instance and whether context was first sent."""
|
||||
with self.conn:
|
||||
cursor = self.conn.execute(
|
||||
"""INSERT OR IGNORE INTO sidekick_runs
|
||||
@@ -1067,7 +1067,7 @@ class EvidenceStore:
|
||||
)
|
||||
return int(cursor.rowcount) > 0
|
||||
|
||||
def stop_sidekick(
|
||||
def stop_subagent(
|
||||
self,
|
||||
repo: RepoContext,
|
||||
session_id: str,
|
||||
@@ -1222,7 +1222,7 @@ class EvidenceStore:
|
||||
cursor = self.conn.execute(
|
||||
f"DELETE FROM {table} WHERE {column} = ?", (repo_id,)
|
||||
)
|
||||
removed[table] = max(int(cursor.rowcount), 0)
|
||||
removed["subagent_runs" if table == "sidekick_runs" else table] = max(int(cursor.rowcount), 0)
|
||||
return removed
|
||||
|
||||
def status(self, repo_id: str) -> dict[str, Any]:
|
||||
@@ -1238,7 +1238,7 @@ class EvidenceStore:
|
||||
FROM operations WHERE repo_id = ? ORDER BY id DESC LIMIT 1""",
|
||||
(repo_id,),
|
||||
).fetchone()
|
||||
last_sidekick = self.conn.execute(
|
||||
last_subagent = self.conn.execute(
|
||||
"""SELECT session_id, agent_id, agent_type, started_at, stopped_at,
|
||||
context_chars
|
||||
FROM sidekick_runs WHERE repo_id = ?
|
||||
@@ -1250,9 +1250,9 @@ class EvidenceStore:
|
||||
"events": count("events"),
|
||||
"flushes": count("flushes"),
|
||||
"retrievals": count("retrievals"),
|
||||
"sidekick_runs": count("sidekick_runs"),
|
||||
"subagent_runs": count("sidekick_runs"),
|
||||
"last_operation": dict(last_operation) if last_operation else None,
|
||||
"last_sidekick": dict(last_sidekick) if last_sidekick else None,
|
||||
"last_subagent": dict(last_subagent) if last_subagent else None,
|
||||
}
|
||||
|
||||
|
||||
@@ -1324,7 +1324,7 @@ def tool_payload(hook_input: dict[str, Any], *, failed: bool | None = False) ->
|
||||
"tool": name,
|
||||
"failed": failed,
|
||||
"duration_ms": hook_input.get("duration_ms"),
|
||||
"agent_role": "sidekick" if hook_input.get("agent_id") else "main",
|
||||
"agent_role": "subagent" if hook_input.get("agent_id") else "main",
|
||||
}
|
||||
if hook_input.get("agent_id"):
|
||||
payload["agent_id"] = bounded(hook_input["agent_id"], 200)
|
||||
@@ -1384,35 +1384,33 @@ def record_tool(
|
||||
)
|
||||
|
||||
|
||||
def record_sidekick_start(
|
||||
store: EvidenceStore, hook_input: dict[str, Any], *, inject_context: bool = True
|
||||
def record_subagent_start(
|
||||
store: EvidenceStore, hook_input: dict[str, Any]
|
||||
) -> str:
|
||||
"""Record a native sidekick and reuse the main turn's retrieved memories."""
|
||||
"""Record a native subagent and reuse the main turn's retrieved memories."""
|
||||
session_id = _session_id(hook_input)
|
||||
repo = store.repo_for_session(session_id, hook_input.get("cwd"))
|
||||
agent_id = bounded(hook_input.get("agent_id", "unknown-agent"), 200)
|
||||
agent_type = bounded(hook_input.get("agent_type", "mem0:sidekick"), 200)
|
||||
agent_type = bounded(hook_input.get("agent_type", "unknown-agent"), 200)
|
||||
context = combine_context(
|
||||
format_context(store.injected_memories(session_id, repo.identity))
|
||||
)
|
||||
if not inject_context:
|
||||
context = ""
|
||||
first_start = store.start_sidekick(
|
||||
first_start = store.start_subagent(
|
||||
repo, session_id, agent_id, agent_type, len(context)
|
||||
)
|
||||
store.record_event(
|
||||
repo,
|
||||
session_id,
|
||||
"sidekick_start",
|
||||
"subagent_start",
|
||||
{
|
||||
"agent_id": agent_id,
|
||||
"agent_type": agent_type,
|
||||
"context_chars": len(context) if first_start else 0,
|
||||
"worktree_root": bounded(repo.root, 2000),
|
||||
"repo_root": bounded(repo.root, 2000),
|
||||
},
|
||||
)
|
||||
telemetry.record(
|
||||
"sidekick",
|
||||
"subagent",
|
||||
repo=repo,
|
||||
session_id=session_id,
|
||||
phase="start",
|
||||
@@ -1422,14 +1420,14 @@ def record_sidekick_start(
|
||||
return context if first_start else ""
|
||||
|
||||
|
||||
def record_sidekick_stop(store: EvidenceStore, hook_input: dict[str, Any]) -> None:
|
||||
def record_subagent_stop(store: EvidenceStore, hook_input: dict[str, Any]) -> None:
|
||||
session_id = _session_id(hook_input)
|
||||
repo = store.repo_for_session(session_id, hook_input.get("cwd"))
|
||||
agent_type = bounded(hook_input.get("agent_type", "mem0:sidekick"), 200)
|
||||
agent_type = bounded(hook_input.get("agent_type", "unknown-agent"), 200)
|
||||
agent_id = bounded(hook_input.get("agent_id", ""), 200)
|
||||
final_message = redact(hook_input.get("last_assistant_message", "")).strip()
|
||||
transcript_path = bounded(hook_input.get("agent_transcript_path", ""), 2000)
|
||||
agent_id = store.stop_sidekick(
|
||||
agent_id = store.stop_subagent(
|
||||
repo,
|
||||
session_id,
|
||||
agent_id,
|
||||
@@ -1440,7 +1438,7 @@ def record_sidekick_stop(store: EvidenceStore, hook_input: dict[str, Any]) -> No
|
||||
store.record_event(
|
||||
repo,
|
||||
session_id,
|
||||
"sidekick_stop",
|
||||
"subagent_stop",
|
||||
{
|
||||
"agent_id": agent_id,
|
||||
"agent_type": agent_type,
|
||||
@@ -1449,7 +1447,7 @@ def record_sidekick_stop(store: EvidenceStore, hook_input: dict[str, Any]) -> No
|
||||
},
|
||||
)
|
||||
telemetry.record(
|
||||
"sidekick",
|
||||
"subagent",
|
||||
repo=repo,
|
||||
session_id=session_id,
|
||||
phase="stop",
|
||||
@@ -1513,10 +1511,10 @@ def build_episode(
|
||||
for e in events
|
||||
if e["kind"] == "assistant_stop" and e["payload"].get("text")
|
||||
]
|
||||
sidekick_outcomes = [
|
||||
subagent_outcomes = [
|
||||
redact(e["payload"].get("final_message", "")).strip()
|
||||
for e in events
|
||||
if e["kind"] == "sidekick_stop" and e["payload"].get("final_message")
|
||||
if e["kind"] in {"subagent_stop", "sidekick_stop"} and e["payload"].get("final_message")
|
||||
]
|
||||
tools = [
|
||||
e["payload"] for e in events if e["kind"] in {"tool_result", "tool_failure"}
|
||||
@@ -1597,7 +1595,7 @@ def build_episode(
|
||||
}
|
||||
)
|
||||
pending_user_messages = []
|
||||
elif event["kind"] == "sidekick_stop":
|
||||
elif event["kind"] in {"subagent_stop", "sidekick_stop"}:
|
||||
pass
|
||||
extraction_messages.extend(pending_user_messages)
|
||||
|
||||
@@ -1613,7 +1611,7 @@ def build_episode(
|
||||
"assistant_conclusion": conclusion,
|
||||
"user_messages": prompts,
|
||||
"assistant_outcomes": assistant_conclusions,
|
||||
"sidekick_outcomes": sidekick_outcomes,
|
||||
"subagent_outcomes": subagent_outcomes,
|
||||
"extraction_messages": extraction_messages,
|
||||
"files_read": read_paths[:50],
|
||||
"files_modified": modified_paths[:50],
|
||||
|
||||
@@ -15,8 +15,8 @@ import hook_runner # noqa: E402
|
||||
import telemetry # noqa: E402
|
||||
from memory_core import ( # noqa: E402
|
||||
configure_harness,
|
||||
record_sidekick_start,
|
||||
record_sidekick_stop,
|
||||
record_subagent_start,
|
||||
record_subagent_stop,
|
||||
record_tool,
|
||||
)
|
||||
|
||||
@@ -24,8 +24,8 @@ configure_harness("codex", data_dir_name="codex-plugin", source_tag="codex_plugi
|
||||
telemetry.init(harness="codex", source_tag="CODEX_PLUGIN")
|
||||
|
||||
|
||||
def _sidekick_start(store, hook_input):
|
||||
context = record_sidekick_start(store, hook_input)
|
||||
def _subagent_start(store, hook_input):
|
||||
context = record_subagent_start(store, hook_input)
|
||||
if context:
|
||||
return {
|
||||
"hookSpecificOutput": {
|
||||
@@ -35,8 +35,8 @@ def _sidekick_start(store, hook_input):
|
||||
}
|
||||
|
||||
|
||||
def _sidekick_stop(store, hook_input):
|
||||
record_sidekick_stop(store, hook_input)
|
||||
def _subagent_stop(store, hook_input):
|
||||
record_subagent_stop(store, hook_input)
|
||||
|
||||
|
||||
def _post_tool(store, payload):
|
||||
@@ -59,6 +59,6 @@ if __name__ == "__main__":
|
||||
if len(sys.argv) > 1 and sys.argv[1] == "post-tool":
|
||||
sys.argv[1] = "codex-post-tool"
|
||||
hook_runner.entry_point(
|
||||
extra_actions={"sidekick-start": _sidekick_start, "sidekick-stop": _sidekick_stop, "codex-post-tool": _post_tool},
|
||||
extra_actions={"subagent-start": _subagent_start, "subagent-stop": _subagent_stop, "codex-post-tool": _post_tool},
|
||||
automatic_flush_reasons={"session-end", "pre-compact"},
|
||||
)
|
||||
|
||||
@@ -27,14 +27,14 @@
|
||||
"SubagentStart": [
|
||||
{
|
||||
"hooks": [
|
||||
{ "type": "command", "command": "python3 \"${PLUGIN_ROOT}/hooks/adapter.py\" sidekick-start --plugin-data-dir \"${PLUGIN_DATA}\"", "timeout": 3 }
|
||||
{ "type": "command", "command": "python3 \"${PLUGIN_ROOT}/hooks/adapter.py\" subagent-start --plugin-data-dir \"${PLUGIN_DATA}\"", "timeout": 3 }
|
||||
]
|
||||
}
|
||||
],
|
||||
"SubagentStop": [
|
||||
{
|
||||
"hooks": [
|
||||
{ "type": "command", "command": "python3 \"${PLUGIN_ROOT}/hooks/adapter.py\" sidekick-stop --plugin-data-dir \"${PLUGIN_DATA}\"", "timeout": 3 }
|
||||
{ "type": "command", "command": "python3 \"${PLUGIN_ROOT}/hooks/adapter.py\" subagent-stop --plugin-data-dir \"${PLUGIN_DATA}\"", "timeout": 3 }
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
@@ -35,7 +35,7 @@ def test_codex_hooks_use_native_events_and_plugin_paths() -> None:
|
||||
assert all(hook.get("timeout", 0) <= 3 for groups in hooks.values() for group in groups for hook in group["hooks"])
|
||||
|
||||
|
||||
def test_codex_sidekick_records_lifecycle(tmp_path: Path) -> None:
|
||||
def test_codex_subagent_records_lifecycle(tmp_path: Path) -> None:
|
||||
adapter = HOST / "hooks" / "adapter.py"
|
||||
payload = {
|
||||
"session_id": "session-1",
|
||||
@@ -45,8 +45,8 @@ def test_codex_sidekick_records_lifecycle(tmp_path: Path) -> None:
|
||||
}
|
||||
|
||||
for action, extra in (
|
||||
("sidekick-start", {}),
|
||||
("sidekick-stop", {"last_assistant_message": "SIDEKICK_OK"}),
|
||||
("subagent-start", {}),
|
||||
("subagent-stop", {"last_assistant_message": "SUBAGENT_OK"}),
|
||||
):
|
||||
result = subprocess.run(
|
||||
[sys.executable, str(adapter), action, "--plugin-data-dir", str(tmp_path / "data")],
|
||||
@@ -65,7 +65,7 @@ def test_codex_sidekick_records_lifecycle(tmp_path: Path) -> None:
|
||||
assert row is not None
|
||||
assert row[0] == "agent-1"
|
||||
assert row[1]
|
||||
assert row[2] == "SIDEKICK_OK"
|
||||
assert row[2] == "SUBAGENT_OK"
|
||||
|
||||
|
||||
def test_codex_mcp_uses_host_relative_paths() -> None:
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
"license": "Apache-2.0",
|
||||
"keywords": ["memory", "coding-agents", "continual-learning", "token-efficiency"],
|
||||
"skills": "./skills/",
|
||||
"agents": "./agents/",
|
||||
"hooks": "./hooks/hooks.json",
|
||||
"mcpServers": "./mcp.json",
|
||||
"variables": {
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
---
|
||||
name: sidekick
|
||||
description: Coding agent with an isolated context. Delegate focused investigation, implementation, testing, debugging, or review work to it, then review its result.
|
||||
model: inherit
|
||||
---
|
||||
|
||||
You are Mem0's Cursor sidekick. Complete only the work the parent agent assigns.
|
||||
Return a tested result the parent can review without repeating your investigation.
|
||||
|
||||
Always call `search_memories` before work that can depend on earlier decisions,
|
||||
repository history, or user preferences. Inspect the relevant code and repository
|
||||
rules, make requested edits, and run the smallest decisive checks.
|
||||
|
||||
Do not make adjacent improvements. Ask the parent one concise question only when
|
||||
a material decision or unsafe ambiguity blocks progress. Otherwise proceed and
|
||||
report the outcome, changed files, validation, and remaining risk.
|
||||
@@ -11,10 +11,10 @@ import telemetry
|
||||
from memory_core import (
|
||||
EvidenceStore,
|
||||
api_key,
|
||||
configure_harness,
|
||||
data_dir,
|
||||
doctor,
|
||||
forget_remote_repo,
|
||||
configure_harness,
|
||||
resolve_repo,
|
||||
user_id,
|
||||
)
|
||||
@@ -32,7 +32,7 @@ def _print_status(value: dict) -> None:
|
||||
)
|
||||
print(
|
||||
f"Used in this repository: {value['retrievals']} memories returned, "
|
||||
f"{value['sidekick_runs']} sidekick runs"
|
||||
f"{value['subagent_runs']} subagent runs"
|
||||
)
|
||||
if last:
|
||||
item_label = ""
|
||||
@@ -48,13 +48,13 @@ def _print_status(value: dict) -> None:
|
||||
f"{'succeeded' if last['success'] else 'failed'} "
|
||||
f"({last['duration_ms']:.1f} ms{item_label})"
|
||||
)
|
||||
sidekick = value.get("last_sidekick") or {}
|
||||
if sidekick:
|
||||
state = "finished" if sidekick.get("stopped_at") else "started"
|
||||
subagent = value.get("last_subagent") or {}
|
||||
if subagent:
|
||||
state = "finished" if subagent.get("stopped_at") else "started"
|
||||
print(
|
||||
"Last sidekick: "
|
||||
f"{state}, received {sidekick['context_chars']} characters of memory, "
|
||||
f"agent {sidekick['agent_id']}"
|
||||
"Last subagent: "
|
||||
f"{state}, received {subagent['context_chars']} characters of memory, "
|
||||
f"agent {subagent['agent_id']}"
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -524,7 +524,7 @@ def _checkpoint_message(event: dict[str, Any]) -> str:
|
||||
if text:
|
||||
return text
|
||||
return redact(payload.get("text", "")).strip()
|
||||
if kind == "sidekick_stop":
|
||||
if kind in {"subagent_stop", "sidekick_stop"}:
|
||||
return redact(payload.get("final_message", "")).strip()
|
||||
return ""
|
||||
|
||||
@@ -596,6 +596,7 @@ class EvidenceStore:
|
||||
self.conn.close()
|
||||
|
||||
def _migrate(self) -> None:
|
||||
# Keep the legacy table name so existing databases and in-flight workers remain compatible.
|
||||
self.conn.executescript(
|
||||
"""
|
||||
CREATE TABLE IF NOT EXISTS events (
|
||||
@@ -688,8 +689,7 @@ class EvidenceStore:
|
||||
|
||||
"""
|
||||
)
|
||||
# Remove the pre-0.1.1 no-tools snapshot implementation. The real coding
|
||||
# sidekick is a native Claude Code agent and stores no state in this DB.
|
||||
# Remove the pre-0.1.1 snapshot implementation.
|
||||
self.conn.executescript(
|
||||
"""
|
||||
DROP TABLE IF EXISTS sidekick_calls;
|
||||
@@ -1041,7 +1041,7 @@ class EvidenceStore:
|
||||
if row["memory_text"]
|
||||
]
|
||||
|
||||
def start_sidekick(
|
||||
def start_subagent(
|
||||
self,
|
||||
repo: RepoContext,
|
||||
session_id: str,
|
||||
@@ -1049,7 +1049,7 @@ class EvidenceStore:
|
||||
agent_type: str,
|
||||
context_chars: int,
|
||||
) -> bool:
|
||||
"""Record one native sidekick instance and whether context was first sent."""
|
||||
"""Record one native subagent instance and whether context was first sent."""
|
||||
with self.conn:
|
||||
cursor = self.conn.execute(
|
||||
"""INSERT OR IGNORE INTO sidekick_runs
|
||||
@@ -1067,7 +1067,7 @@ class EvidenceStore:
|
||||
)
|
||||
return int(cursor.rowcount) > 0
|
||||
|
||||
def stop_sidekick(
|
||||
def stop_subagent(
|
||||
self,
|
||||
repo: RepoContext,
|
||||
session_id: str,
|
||||
@@ -1222,7 +1222,7 @@ class EvidenceStore:
|
||||
cursor = self.conn.execute(
|
||||
f"DELETE FROM {table} WHERE {column} = ?", (repo_id,)
|
||||
)
|
||||
removed[table] = max(int(cursor.rowcount), 0)
|
||||
removed["subagent_runs" if table == "sidekick_runs" else table] = max(int(cursor.rowcount), 0)
|
||||
return removed
|
||||
|
||||
def status(self, repo_id: str) -> dict[str, Any]:
|
||||
@@ -1238,7 +1238,7 @@ class EvidenceStore:
|
||||
FROM operations WHERE repo_id = ? ORDER BY id DESC LIMIT 1""",
|
||||
(repo_id,),
|
||||
).fetchone()
|
||||
last_sidekick = self.conn.execute(
|
||||
last_subagent = self.conn.execute(
|
||||
"""SELECT session_id, agent_id, agent_type, started_at, stopped_at,
|
||||
context_chars
|
||||
FROM sidekick_runs WHERE repo_id = ?
|
||||
@@ -1250,9 +1250,9 @@ class EvidenceStore:
|
||||
"events": count("events"),
|
||||
"flushes": count("flushes"),
|
||||
"retrievals": count("retrievals"),
|
||||
"sidekick_runs": count("sidekick_runs"),
|
||||
"subagent_runs": count("sidekick_runs"),
|
||||
"last_operation": dict(last_operation) if last_operation else None,
|
||||
"last_sidekick": dict(last_sidekick) if last_sidekick else None,
|
||||
"last_subagent": dict(last_subagent) if last_subagent else None,
|
||||
}
|
||||
|
||||
|
||||
@@ -1324,7 +1324,7 @@ def tool_payload(hook_input: dict[str, Any], *, failed: bool | None = False) ->
|
||||
"tool": name,
|
||||
"failed": failed,
|
||||
"duration_ms": hook_input.get("duration_ms"),
|
||||
"agent_role": "sidekick" if hook_input.get("agent_id") else "main",
|
||||
"agent_role": "subagent" if hook_input.get("agent_id") else "main",
|
||||
}
|
||||
if hook_input.get("agent_id"):
|
||||
payload["agent_id"] = bounded(hook_input["agent_id"], 200)
|
||||
@@ -1384,35 +1384,33 @@ def record_tool(
|
||||
)
|
||||
|
||||
|
||||
def record_sidekick_start(
|
||||
store: EvidenceStore, hook_input: dict[str, Any], *, inject_context: bool = True
|
||||
def record_subagent_start(
|
||||
store: EvidenceStore, hook_input: dict[str, Any]
|
||||
) -> str:
|
||||
"""Record a native sidekick and reuse the main turn's retrieved memories."""
|
||||
"""Record a native subagent and reuse the main turn's retrieved memories."""
|
||||
session_id = _session_id(hook_input)
|
||||
repo = store.repo_for_session(session_id, hook_input.get("cwd"))
|
||||
agent_id = bounded(hook_input.get("agent_id", "unknown-agent"), 200)
|
||||
agent_type = bounded(hook_input.get("agent_type", "mem0:sidekick"), 200)
|
||||
agent_type = bounded(hook_input.get("agent_type", "unknown-agent"), 200)
|
||||
context = combine_context(
|
||||
format_context(store.injected_memories(session_id, repo.identity))
|
||||
)
|
||||
if not inject_context:
|
||||
context = ""
|
||||
first_start = store.start_sidekick(
|
||||
first_start = store.start_subagent(
|
||||
repo, session_id, agent_id, agent_type, len(context)
|
||||
)
|
||||
store.record_event(
|
||||
repo,
|
||||
session_id,
|
||||
"sidekick_start",
|
||||
"subagent_start",
|
||||
{
|
||||
"agent_id": agent_id,
|
||||
"agent_type": agent_type,
|
||||
"context_chars": len(context) if first_start else 0,
|
||||
"worktree_root": bounded(repo.root, 2000),
|
||||
"repo_root": bounded(repo.root, 2000),
|
||||
},
|
||||
)
|
||||
telemetry.record(
|
||||
"sidekick",
|
||||
"subagent",
|
||||
repo=repo,
|
||||
session_id=session_id,
|
||||
phase="start",
|
||||
@@ -1422,14 +1420,14 @@ def record_sidekick_start(
|
||||
return context if first_start else ""
|
||||
|
||||
|
||||
def record_sidekick_stop(store: EvidenceStore, hook_input: dict[str, Any]) -> None:
|
||||
def record_subagent_stop(store: EvidenceStore, hook_input: dict[str, Any]) -> None:
|
||||
session_id = _session_id(hook_input)
|
||||
repo = store.repo_for_session(session_id, hook_input.get("cwd"))
|
||||
agent_type = bounded(hook_input.get("agent_type", "mem0:sidekick"), 200)
|
||||
agent_type = bounded(hook_input.get("agent_type", "unknown-agent"), 200)
|
||||
agent_id = bounded(hook_input.get("agent_id", ""), 200)
|
||||
final_message = redact(hook_input.get("last_assistant_message", "")).strip()
|
||||
transcript_path = bounded(hook_input.get("agent_transcript_path", ""), 2000)
|
||||
agent_id = store.stop_sidekick(
|
||||
agent_id = store.stop_subagent(
|
||||
repo,
|
||||
session_id,
|
||||
agent_id,
|
||||
@@ -1440,7 +1438,7 @@ def record_sidekick_stop(store: EvidenceStore, hook_input: dict[str, Any]) -> No
|
||||
store.record_event(
|
||||
repo,
|
||||
session_id,
|
||||
"sidekick_stop",
|
||||
"subagent_stop",
|
||||
{
|
||||
"agent_id": agent_id,
|
||||
"agent_type": agent_type,
|
||||
@@ -1449,7 +1447,7 @@ def record_sidekick_stop(store: EvidenceStore, hook_input: dict[str, Any]) -> No
|
||||
},
|
||||
)
|
||||
telemetry.record(
|
||||
"sidekick",
|
||||
"subagent",
|
||||
repo=repo,
|
||||
session_id=session_id,
|
||||
phase="stop",
|
||||
@@ -1513,10 +1511,10 @@ def build_episode(
|
||||
for e in events
|
||||
if e["kind"] == "assistant_stop" and e["payload"].get("text")
|
||||
]
|
||||
sidekick_outcomes = [
|
||||
subagent_outcomes = [
|
||||
redact(e["payload"].get("final_message", "")).strip()
|
||||
for e in events
|
||||
if e["kind"] == "sidekick_stop" and e["payload"].get("final_message")
|
||||
if e["kind"] in {"subagent_stop", "sidekick_stop"} and e["payload"].get("final_message")
|
||||
]
|
||||
tools = [
|
||||
e["payload"] for e in events if e["kind"] in {"tool_result", "tool_failure"}
|
||||
@@ -1597,7 +1595,7 @@ def build_episode(
|
||||
}
|
||||
)
|
||||
pending_user_messages = []
|
||||
elif event["kind"] == "sidekick_stop":
|
||||
elif event["kind"] in {"subagent_stop", "sidekick_stop"}:
|
||||
pass
|
||||
extraction_messages.extend(pending_user_messages)
|
||||
|
||||
@@ -1613,7 +1611,7 @@ def build_episode(
|
||||
"assistant_conclusion": conclusion,
|
||||
"user_messages": prompts,
|
||||
"assistant_outcomes": assistant_conclusions,
|
||||
"sidekick_outcomes": sidekick_outcomes,
|
||||
"subagent_outcomes": subagent_outcomes,
|
||||
"extraction_messages": extraction_messages,
|
||||
"files_read": read_paths[:50],
|
||||
"files_modified": modified_paths[:50],
|
||||
|
||||
@@ -19,8 +19,6 @@ import hook_runner # noqa: E402
|
||||
import telemetry # noqa: E402
|
||||
from memory_core import ( # noqa: E402
|
||||
configure_harness,
|
||||
record_sidekick_start,
|
||||
record_sidekick_stop,
|
||||
record_tool,
|
||||
)
|
||||
|
||||
@@ -30,8 +28,6 @@ EVENTS = {
|
||||
"postToolUse": "post-tool",
|
||||
"postToolUseFailure": "post-tool-failure",
|
||||
"afterAgentResponse": "assistant-stop",
|
||||
"subagentStart": "sidekick-start",
|
||||
"subagentStop": "sidekick-stop",
|
||||
"stop": "stop",
|
||||
"sessionEnd": "session-end",
|
||||
"preCompact": "pre-compact",
|
||||
@@ -52,10 +48,6 @@ def normalize(payload: dict, event: str) -> dict:
|
||||
value.setdefault("last_assistant_message", value["text"])
|
||||
if "summary" in value:
|
||||
value.setdefault("last_assistant_message", value["summary"])
|
||||
if "subagent_id" in value:
|
||||
value.setdefault("agent_id", value["subagent_id"])
|
||||
if "subagent_type" in value:
|
||||
value.setdefault("agent_type", value["subagent_type"])
|
||||
return {"action": EVENTS[event], "payload": value}
|
||||
|
||||
|
||||
@@ -67,15 +59,6 @@ def _record_response(store, payload):
|
||||
hook_runner.default_record_stop(store, payload)
|
||||
|
||||
|
||||
def _record_sidekick_start(store, payload):
|
||||
record_sidekick_start(store, payload, inject_context=False)
|
||||
return {"permission": "allow"}
|
||||
|
||||
|
||||
def _record_sidekick_stop(store, payload):
|
||||
record_sidekick_stop(store, payload)
|
||||
|
||||
|
||||
def main() -> int:
|
||||
if len(sys.argv) != 2 or sys.argv[1] not in EVENTS:
|
||||
return 2
|
||||
@@ -100,8 +83,6 @@ def main() -> int:
|
||||
extra_actions={
|
||||
"post-tool-failure": _record_failure,
|
||||
"assistant-stop": _record_response,
|
||||
"sidekick-start": _record_sidekick_start,
|
||||
"sidekick-stop": _record_sidekick_stop,
|
||||
},
|
||||
automatic_flush_reasons={"session-end", "pre-compact"},
|
||||
)
|
||||
@@ -119,8 +100,6 @@ def main() -> int:
|
||||
}
|
||||
if environment:
|
||||
print(json.dumps({"env": environment}))
|
||||
elif event == "subagentStart":
|
||||
print(json.dumps({"permission": "allow"}))
|
||||
return result
|
||||
|
||||
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
"postToolUse": [{ "command": "python3 \"${CURSOR_PLUGIN_ROOT}/hooks/adapter.py\" postToolUse", "timeout": 3 }],
|
||||
"postToolUseFailure": [{ "command": "python3 \"${CURSOR_PLUGIN_ROOT}/hooks/adapter.py\" postToolUseFailure", "timeout": 3 }],
|
||||
"afterAgentResponse": [{ "command": "python3 \"${CURSOR_PLUGIN_ROOT}/hooks/adapter.py\" afterAgentResponse", "timeout": 3 }],
|
||||
"subagentStart": [{ "command": "python3 \"${CURSOR_PLUGIN_ROOT}/hooks/adapter.py\" subagentStart", "matcher": "^sidekick$", "timeout": 5 }],
|
||||
"subagentStop": [{ "command": "python3 \"${CURSOR_PLUGIN_ROOT}/hooks/adapter.py\" subagentStop", "matcher": "^sidekick$", "timeout": 5 }],
|
||||
"stop": [{ "command": "python3 \"${CURSOR_PLUGIN_ROOT}/hooks/adapter.py\" stop", "timeout": 3 }],
|
||||
"preCompact": [{ "command": "python3 \"${CURSOR_PLUGIN_ROOT}/hooks/adapter.py\" preCompact", "timeout": 5 }],
|
||||
"sessionEnd": [{ "command": "python3 \"${CURSOR_PLUGIN_ROOT}/hooks/adapter.py\" sessionEnd", "timeout": 5 }]
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
".cursor-plugin/plugin.json": ".cursor-plugin/plugin.json",
|
||||
"hooks/hooks.json": "hooks/hooks.json",
|
||||
"hooks/adapter.py": "hooks/adapter.py",
|
||||
"agents/sidekick.md": "agents/sidekick.md",
|
||||
"mcp.json": "mcp.json"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,8 +26,6 @@ SPEC.loader.exec_module(adapter)
|
||||
("postToolUse", "post-tool"),
|
||||
("postToolUseFailure", "post-tool-failure"),
|
||||
("afterAgentResponse", "assistant-stop"),
|
||||
("subagentStart", "sidekick-start"),
|
||||
("subagentStop", "sidekick-stop"),
|
||||
("stop", "stop"),
|
||||
("sessionEnd", "session-end"),
|
||||
("preCompact", "pre-compact"),
|
||||
@@ -57,48 +55,18 @@ def test_after_agent_response_does_not_return_internal_context(monkeypatch: pyte
|
||||
assert adapter._record_response(object(), {}) is None
|
||||
|
||||
|
||||
def test_normalizes_cursor_sidekick_fields() -> None:
|
||||
started = adapter.normalize(
|
||||
{
|
||||
"subagent_id": "agent-1",
|
||||
"subagent_type": "sidekick",
|
||||
"parent_conversation_id": "parent-1",
|
||||
},
|
||||
"subagentStart",
|
||||
)["payload"]
|
||||
stopped = adapter.normalize({"summary": "done"}, "subagentStop")["payload"]
|
||||
|
||||
assert started["agent_id"] == "agent-1"
|
||||
assert started["agent_type"] == "sidekick"
|
||||
assert started["session_id"] == "parent-1"
|
||||
assert stopped["last_assistant_message"] == "done"
|
||||
|
||||
|
||||
def test_cursor_sidekick_records_lifecycle_without_blocking(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
monkeypatch.setattr(adapter, "record_sidekick_start", lambda store, payload, *, inject_context: "" if not inject_context else pytest.fail("cannot inject context"))
|
||||
stopped = []
|
||||
monkeypatch.setattr(adapter, "record_sidekick_stop", lambda store, payload: stopped.append(payload))
|
||||
|
||||
assert adapter._record_sidekick_start(object(), {}) == {"permission": "allow"}
|
||||
assert adapter._record_sidekick_stop(object(), {"summary": "done"}) is None
|
||||
assert stopped == [{"summary": "done"}]
|
||||
|
||||
|
||||
def test_cursor_hooks_use_native_flat_entries() -> None:
|
||||
hooks = json.loads((HOST / "hooks" / "hooks.json").read_text(encoding="utf-8"))
|
||||
|
||||
assert hooks["version"] == 1
|
||||
assert not {"subagentStart", "subagentStop"} & hooks["hooks"].keys()
|
||||
assert set(hooks["hooks"]) >= {
|
||||
"sessionStart",
|
||||
"beforeSubmitPrompt",
|
||||
"postToolUse",
|
||||
"subagentStart",
|
||||
"subagentStop",
|
||||
"stop",
|
||||
"sessionEnd",
|
||||
}
|
||||
assert hooks["hooks"]["subagentStart"][0]["matcher"] == "^sidekick$"
|
||||
assert hooks["hooks"]["subagentStop"][0]["matcher"] == "^sidekick$"
|
||||
assert all("hooks" not in entry for entries in hooks["hooks"].values() for entry in entries)
|
||||
|
||||
|
||||
@@ -107,6 +75,7 @@ def test_native_cursor_bundle_is_self_contained(tmp_path: Path) -> None:
|
||||
|
||||
manifest = json.loads((root / ".cursor-plugin" / "plugin.json").read_text(encoding="utf-8"))
|
||||
assert manifest["hooks"] == "./hooks/hooks.json"
|
||||
assert "agents" not in manifest
|
||||
assert (root / "hooks" / "adapter.py").is_file()
|
||||
assert (root / "agents" / "sidekick.md").is_file()
|
||||
assert not (root / "agents").exists()
|
||||
assert not any(path.is_symlink() for path in root.rglob("*"))
|
||||
|
||||
@@ -13,7 +13,9 @@ It gives a Harness agent automatic long-term memory plus two explicit memory too
|
||||
|
||||
Unlike the local/file-based memory plugins in the ecosystem, Mem0 is a managed backend: server-side extraction, semantic dedup and conflict resolution, and memories that other agents can retrieve when their user and entity filters match.
|
||||
|
||||
Current package version: `0.3.0`.
|
||||
Current package version: `0.3.1`.
|
||||
|
||||
Sidekick is available only in the [Claude Code plugin](../claude-code-plugin/README.md#sonnet-sidekick-agent).
|
||||
|
||||
## How it works
|
||||
|
||||
@@ -45,23 +47,29 @@ Cordis owns listener and tool cleanup when the plugin unmounts. Every automatic
|
||||
mkdir -p /tmp/mem0-deepseek-plugin
|
||||
pnpm pack --pack-destination /tmp/mem0-deepseek-plugin
|
||||
```
|
||||
2. Set your Mem0 key:
|
||||
2. Set your Mem0 key, a stable user identity, and a funded model API key:
|
||||
```sh
|
||||
export MEM0_API_KEY=...
|
||||
export MEM0_USER_ID=your-user-id
|
||||
export DEEPSEEK_API_KEY=...
|
||||
```
|
||||
3. Install it into a disposable Harness profile:
|
||||
```sh
|
||||
DSH_HOME=/tmp/mem0-dsh-dev pnpm dlx @deepseek-ai/dsh@0.1.1-rc.2 \
|
||||
plugin --profile headless add /tmp/mem0-deepseek-plugin/mem0-deepseek-plugin-0.3.0.tgz
|
||||
plugin --profile web add /tmp/mem0-deepseek-plugin/mem0-deepseek-plugin-0.3.1.tgz
|
||||
```
|
||||
4. Copy `cordis.example.yml`, set its installed package path and your `userId`, then run Harness with the same profile:
|
||||
4. Run Harness with the same profile. The installed bundle activates Mem0 automatically:
|
||||
```sh
|
||||
DSH_HOME=/tmp/mem0-dsh-dev pnpm dlx @deepseek-ai/dsh@0.1.1-rc.2 \
|
||||
web --patch ./integrations/deepseek-plugin/cordis.example.yml
|
||||
web
|
||||
```
|
||||
5. Open http://127.0.0.1:3080 and ask the agent to remember something, then recall it in a later turn.
|
||||
5. Open http://127.0.0.1:3080, select a workspace, and state a synthetic preference without mentioning Mem0. Wait for asynchronous extraction to finish, then start a fresh session and ask for that preference without tools. Inspect the `mem0:recall` context to verify automatic recall.
|
||||
|
||||
For a Mem0 Platform on-prem or dedicated deployment, point `config.host` at that base URL (defaults to `api.mem0.ai`). `host` is a Platform base-URL override — it is not a switch to self-hosted Mem0 OSS, whose server exposes a different API surface.
|
||||
Build from the full repository: the source imports the sibling shared core. `pnpm pack` runs the build and includes the activation patch. An installed tarball is self-contained. For custom settings, copy `cordis.example.yml` and pass its absolute path with `--patch`. When upgrading from the old manual setup, remove the old patch that **inserts** a `mem0` row; the bundle now inserts it.
|
||||
|
||||
On macOS, set `CHOKIDAR_USEPOLLING=1` if Harness reports `EMFILE`. The Mem0 key and model-provider key are separate credentials.
|
||||
|
||||
For a Mem0 Platform on-prem or dedicated deployment, point `config.host` at that base URL (defaults to `api.mem0.ai`). `host` overrides the Platform base URL. It does not support the self-hosted Mem0 OSS API.
|
||||
|
||||
## Configuration
|
||||
|
||||
@@ -69,6 +77,7 @@ For a Mem0 Platform on-prem or dedicated deployment, point `config.host` at that
|
||||
|---|---|---|---|
|
||||
| `apiKey` | no | `$MEM0_API_KEY` | Mem0 platform API key |
|
||||
| `userId` | yes | | Entity that owns the memories |
|
||||
| `memoryScope` | no | `user` | `user` shares memory across workspaces; `workspace` isolates all automatic and explicit operations by the session workspace |
|
||||
| `allowUserOverride` | no | `false` | Permit model-selected access to a different user only in a trusted multi-user deployment |
|
||||
| `host` | no | `api.mem0.ai` | Platform base URL (on-prem / dedicated) |
|
||||
| `autoRecall` | no | `true` | Recall relevant memory before model requests |
|
||||
@@ -78,10 +87,20 @@ For a Mem0 Platform on-prem or dedicated deployment, point `config.host` at that
|
||||
|
||||
Automatic capture and recall use the configured `userId` across sessions. Automatic writes do not attach a repository ID or `runId`.
|
||||
|
||||
This cross-workspace sharing is intentional compatibility behavior. Set `memoryScope: workspace` in the profile patch to isolate memory. The plugin then adds an `appId` derived from the canonical absolute session workspace path to every write and the matching `app_id` to every search. Symlink aliases share a scope; different directories (including separate clones or worktrees) do not. Moving a workspace changes its scope. Tools cannot override it. Missing or invalid workspace paths skip automatic memory operations and reject explicit tools, without falling back to user-wide access.
|
||||
|
||||
Workspace scope does not migrate existing user-only memories. User scope still searches all memories for that user, including workspace-tagged memories; isolation applies when the plugin is configured with workspace scope. These filters are application-level separation, not separate Mem0 credentials.
|
||||
|
||||
Both `search_memory` and `add_memory` accept optional `agentId` and `runId`. On search, these narrow the returned memories; on add, they attach those identities to the stored memory. Pass a known `runId` to search memories explicitly saved with that session ID. This does not include automatically captured user-only memories or identify the session making the request.
|
||||
|
||||
Per-call `userId` overrides are rejected unless the operator enables `allowUserOverride: true`. Automatic recall and capture always use the configured user.
|
||||
|
||||
## Extraction and recall limits
|
||||
|
||||
The plugin sends full redacted completed turns to Mem0; Mem0 extracts the memories asynchronously. A queued write is not proof that every extracted fact is already searchable. Even an initial nonempty memory list can be incomplete. Check the stored memories after processing before diagnosing extraction loss.
|
||||
|
||||
Automatic recall is a bounded first pass (up to five results, 4,000 context characters, and a two-second wait). `search_memory` uses a focused query and returns up to ten results by default. Exact preference extraction remains model-dependent; include filenames and numeric constraints in release tests, and distinguish standing preferences from one-off requests.
|
||||
|
||||
## Telemetry
|
||||
|
||||
Writes are tagged `source="DEEPSEEK_HARNESS"` so Mem0's backend can attribute usage to this integration. For it to surface by name (rather than bucketing into `OTHERS`), `DEEPSEEK_HARNESS` must be present in the backend's `KNOWN_EVENT_SOURCES` allowlist, a one-line platform change matching the existing `ZAPIER` / `STRANDS` sources.
|
||||
|
||||
@@ -1,17 +1,11 @@
|
||||
# Example DeepSeek Harness config that loads deepseek-plugin alongside the built-in
|
||||
# tools plugin. Load with:
|
||||
#
|
||||
# DSH_HOME=/tmp/mem0-dsh-dev pnpm dlx @deepseek-ai/dsh@0.1.1-rc.2 \
|
||||
# web --patch ./integrations/deepseek-plugin/cordis.example.yml
|
||||
#
|
||||
- insert:
|
||||
- id: mem0
|
||||
# Install the packed plugin into this disposable profile first; loading
|
||||
# raw dist bypasses Harness's peer dependency installation.
|
||||
name: "/tmp/mem0-dsh-dev/profiles/headless/node_modules/@mem0/deepseek-plugin/dist/index.js"
|
||||
config:
|
||||
# apiKey is read from the MEM0_API_KEY env var when omitted here.
|
||||
userId: "your-user-id"
|
||||
# autoRecall: true # optional; enabled by default
|
||||
# autoCapture: true # optional; enabled by default
|
||||
# host: "https://your-onprem.mem0.ai" # optional: Platform on-prem / dedicated base URL
|
||||
# Optional override for the mem0 row installed by dsh.bundle.
|
||||
# Copy this file, then use: dsh web --patch /absolute/path/to/cordis.yml
|
||||
- id: mem0
|
||||
config:
|
||||
# Replacing a row's config requires restating its userId.
|
||||
# apiKey is read from MEM0_API_KEY when omitted here.
|
||||
userId: !!js process.env.MEM0_USER_ID
|
||||
memoryScope: workspace # optional; default is user (shared across workspaces)
|
||||
# autoRecall: true
|
||||
# autoCapture: true
|
||||
# host: "https://your-onprem.mem0.ai" # Mem0 Platform dedicated deployment
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
- insert:
|
||||
- id: mem0
|
||||
name: "@mem0/deepseek-plugin"
|
||||
config:
|
||||
# Credentials stay in the process environment, not the bundle.
|
||||
userId: !!js process.env.MEM0_USER_ID
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@mem0/deepseek-plugin",
|
||||
"version": "0.3.0",
|
||||
"version": "0.3.1",
|
||||
"description": "Mem0 long-term memory as a native DeepSeek Harness (Cordis) plugin.",
|
||||
"type": "module",
|
||||
"license": "Apache-2.0",
|
||||
@@ -29,13 +29,21 @@
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"dsh": {
|
||||
"bundle": {
|
||||
"patch": "./cordis.patch.yml"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"cordis.patch.yml",
|
||||
"cordis.example.yml",
|
||||
"README.md",
|
||||
"LICENSE"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "tsup",
|
||||
"prepack": "pnpm build",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest",
|
||||
"typecheck": "tsc --noEmit"
|
||||
|
||||
@@ -18,7 +18,7 @@ import { defineTool } from "@deepseek-ai/dsh-tools";
|
||||
import { MemoryClient } from "mem0ai";
|
||||
import { formatMemoryList, formatAddResult } from "./formatting.ts";
|
||||
import { truncateOutput } from "./output.ts";
|
||||
import { resolveSearchFilters, resolveAddParams } from "./scoping.ts";
|
||||
import { resolveSearchFilters, resolveAddParams, resolveWorkspaceId } from "./scoping.ts";
|
||||
import { captureEvent, errorKind } from "./telemetry.ts";
|
||||
import { createMemoryLifecycle } from "../../agent-plugin-core/typescript/src/lifecycle.ts";
|
||||
|
||||
@@ -44,6 +44,7 @@ interface HarnessMessage {
|
||||
interface SessionState {
|
||||
lifecycle: ReturnType<typeof createMemoryLifecycle>;
|
||||
messages: HarnessMessage[];
|
||||
currentPrompt?: string;
|
||||
}
|
||||
|
||||
export interface Config {
|
||||
@@ -51,6 +52,8 @@ export interface Config {
|
||||
apiKey?: string;
|
||||
/** Default entity that owns the memories (Mem0 user scope). */
|
||||
userId: string;
|
||||
/** Share user memory across workspaces (default), or isolate by session workspace. */
|
||||
memoryScope?: "user" | "workspace";
|
||||
/** Explicitly allow model-selected cross-user access. Defaults to false. */
|
||||
allowUserOverride?: boolean;
|
||||
/** Optional Mem0 Platform base-URL override (on-prem / dedicated); defaults to api.mem0.ai. Not a switch to self-hosted OSS. */
|
||||
@@ -98,6 +101,19 @@ export function apply(ctx: Context, config: Config): void {
|
||||
if (!userId || /^\*+$/.test(userId)) {
|
||||
throw new Error("deepseek-plugin: config.userId is required");
|
||||
}
|
||||
if (config.memoryScope !== undefined && !["user", "workspace"].includes(config.memoryScope)) {
|
||||
throw new Error("deepseek-plugin: config.memoryScope must be user or workspace");
|
||||
}
|
||||
const workspaceId = (session?: { header: { cwd?: string } }) =>
|
||||
config.memoryScope === "workspace" ? resolveWorkspaceId(session?.header.cwd) : undefined;
|
||||
const searchFilters = (params: Parameters<typeof resolveSearchFilters>[0], session?: { header: { cwd?: string } }) => {
|
||||
const appId = workspaceId(session);
|
||||
return { ...resolveSearchFilters(params, userId), ...(appId ? { app_id: appId } : {}) };
|
||||
};
|
||||
const addParams = (params: Parameters<typeof resolveAddParams>[0], session?: { header: { cwd?: string } }) => {
|
||||
const appId = workspaceId(session);
|
||||
return { ...resolveAddParams(params, userId), ...(appId ? { appId } : {}) };
|
||||
};
|
||||
|
||||
const client = new MemoryClient({
|
||||
apiKey,
|
||||
@@ -123,13 +139,20 @@ export function apply(ctx: Context, config: Config): void {
|
||||
}, client);
|
||||
|
||||
if (config.autoRecall !== false) {
|
||||
// Harness assembles the prompt before appending claimed messages to history.
|
||||
ctx.on("agent/inbox/claimed", ({ agent, message }) => {
|
||||
if (message.source.kind !== "user") return;
|
||||
const state = stateFor(agent.session);
|
||||
state.currentPrompt = state.lifecycle.prepareConversation([message]).at(-1)?.content;
|
||||
});
|
||||
|
||||
ctx.on("system-prompt/assemble", async (_input, context, next): Promise<PromptAssembly> => {
|
||||
const assembly = await next();
|
||||
const { agent, signal } = context;
|
||||
if (!agent || signal?.aborted) return assembly;
|
||||
|
||||
const state = stateFor(agent.session);
|
||||
const prompt = state.lifecycle.prepareConversation(
|
||||
const prompt = state.currentPrompt ?? state.lifecycle.prepareConversation(
|
||||
agent.session
|
||||
.deriveMessages()
|
||||
.filter((message) => message.role === "user" && message.source?.kind === "user"),
|
||||
@@ -140,7 +163,7 @@ export function apply(ctx: Context, config: Config): void {
|
||||
const started = Date.now();
|
||||
try {
|
||||
const result = await client.search(query, {
|
||||
filters: resolveSearchFilters({}, userId),
|
||||
filters: searchFilters({}, agent.session),
|
||||
topK: AUTO_RECALL_LIMIT,
|
||||
});
|
||||
captureEvent("deepseek.recall.auto", {
|
||||
@@ -179,8 +202,8 @@ export function apply(ctx: Context, config: Config): void {
|
||||
const conversation = state.lifecycle.prepareConversation(state.messages);
|
||||
state.messages = [];
|
||||
if (event.data.reason.kind !== "completed" || conversation.length === 0) return;
|
||||
void client
|
||||
.add(conversation, { userId, source: SOURCE })
|
||||
void Promise.resolve()
|
||||
.then(() => client.add(conversation, { ...addParams({}, session), source: SOURCE }))
|
||||
.then(() => captureEvent("deepseek.capture.auto", {
|
||||
success: true,
|
||||
message_count: conversation.length,
|
||||
@@ -209,12 +232,12 @@ export function apply(ctx: Context, config: Config): void {
|
||||
...scopeParams,
|
||||
},
|
||||
output: textOutput,
|
||||
async execute({ query, limit, userId: u, agentId, runId }) {
|
||||
async execute({ query, limit, userId: u, agentId, runId }, exec) {
|
||||
if (u?.trim() && u.trim() !== userId && config.allowUserOverride !== true) {
|
||||
throw new Error("Cross-user access requires allowUserOverride in plugin configuration.");
|
||||
}
|
||||
const safeQuery = toolLifecycle.prepareUserText(query);
|
||||
const filters = resolveSearchFilters({ userId: u, agentId, runId }, userId);
|
||||
const filters = searchFilters({ userId: u, agentId, runId }, exec.agent?.session);
|
||||
const topK = limit && limit > 0 ? limit : DEFAULT_SEARCH_LIMIT;
|
||||
const started = Date.now();
|
||||
try {
|
||||
@@ -262,17 +285,17 @@ export function apply(ctx: Context, config: Config): void {
|
||||
...scopeParams,
|
||||
},
|
||||
output: textOutput,
|
||||
async execute({ text, userId: u, agentId, runId }) {
|
||||
async execute({ text, userId: u, agentId, runId }, exec) {
|
||||
if (u?.trim() && u.trim() !== userId && config.allowUserOverride !== true) {
|
||||
throw new Error("Cross-user access requires allowUserOverride in plugin configuration.");
|
||||
}
|
||||
const addParams = resolveAddParams({ userId: u, agentId, runId }, userId);
|
||||
const params = addParams({ userId: u, agentId, runId }, exec.agent?.session);
|
||||
const started = Date.now();
|
||||
try {
|
||||
const result = await client.add(
|
||||
[{ role: "user", content: toolLifecycle.prepareUserText(text) }],
|
||||
{
|
||||
...addParams,
|
||||
...params,
|
||||
source: SOURCE,
|
||||
},
|
||||
);
|
||||
|
||||
@@ -1,5 +1,16 @@
|
||||
import { createHash } from "node:crypto";
|
||||
import { realpathSync } from "node:fs";
|
||||
import { isAbsolute } from "node:path";
|
||||
|
||||
export {
|
||||
entityAddParams as resolveAddParams,
|
||||
entitySearchFilters as resolveSearchFilters,
|
||||
} from "../../agent-plugin-core/typescript/src/identity.ts";
|
||||
export type { EntityParams } from "../../agent-plugin-core/typescript/src/identity.ts";
|
||||
|
||||
export function resolveWorkspaceId(cwd: string | undefined): string {
|
||||
if (!cwd || !isAbsolute(cwd)) {
|
||||
throw new Error("Workspace memory scope requires an absolute session workspace path.");
|
||||
}
|
||||
return `deepseek-workspace-${createHash("sha256").update(realpathSync(cwd)).digest("hex")}`;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
|
||||
import { mkdtempSync, mkdirSync, rmSync, symlinkSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
|
||||
// Offline mock of the Mem0 SDK so these tests never touch the network.
|
||||
const mockSearch = vi.fn();
|
||||
@@ -75,6 +78,11 @@ describe("apply() config validation", () => {
|
||||
expect(() => applyAndCollect({ apiKey: "k", userId: "" } as Config)).toThrow(/userId/);
|
||||
});
|
||||
|
||||
it("rejects unknown memory scope instead of silently using user-wide access", () => {
|
||||
expect(() => applyAndCollect({ apiKey: "k", userId: "u", memoryScope: "typo" } as unknown as Config))
|
||||
.toThrow(/memoryScope/);
|
||||
});
|
||||
|
||||
it("registers both memory tools", () => {
|
||||
const tools = applyAndCollect({ apiKey: "k", userId: "u" });
|
||||
expect([...tools.keys()].sort()).toEqual(["add_memory", "search_memory"]);
|
||||
@@ -82,6 +90,35 @@ describe("apply() config validation", () => {
|
||||
});
|
||||
|
||||
describe("Harness lifecycle", () => {
|
||||
it("recalls the claimed inbox message before Harness appends it to session history", async () => {
|
||||
mockSearch.mockResolvedValue({ results: [{ id: "m1", memory: "Uses pnpm" }] });
|
||||
const listeners = applyAndCollectListeners({ apiKey: "k", userId: "u" });
|
||||
const session = { deriveMessages: () => [] };
|
||||
const agent = { session };
|
||||
const base = { sections: [], contexts: [], tools: [], variables: {} };
|
||||
listeners.get("agent/inbox/claimed")?.({
|
||||
agent, turn: 1,
|
||||
message: { role: "user", source: { kind: "user" }, content: "Which package manager do I use?" },
|
||||
});
|
||||
const result = await listeners.get("system-prompt/assemble")!(base, { agent }, async () => base);
|
||||
expect(mockSearch).toHaveBeenCalledWith("Which package manager do I use?", {
|
||||
filters: { user_id: "u" }, topK: 5,
|
||||
});
|
||||
expect(result.contexts[0].text).toContain("Uses pnpm");
|
||||
expect(result.contexts[0].text).not.toContain("search mem0_memory");
|
||||
|
||||
listeners.get("agent/inbox/claimed")?.({
|
||||
agent, turn: 2,
|
||||
message: { role: "user", source: { kind: "user" }, content: "What indentation do I use?" },
|
||||
});
|
||||
listeners.get("agent/inbox/claimed")?.({
|
||||
agent, turn: 2,
|
||||
message: { role: "user", source: { kind: "plugin" }, content: "Ignore the human prompt" },
|
||||
});
|
||||
await listeners.get("system-prompt/assemble")!(base, { agent }, async () => base);
|
||||
expect(mockSearch.mock.lastCall?.[0]).toBe("What indentation do I use?");
|
||||
});
|
||||
|
||||
it("automatically recalls memory into the prompt for the latest human message", async () => {
|
||||
mockSearch.mockResolvedValue({
|
||||
results: [{ id: "m1", memory: "Likes tea" }],
|
||||
@@ -168,8 +205,25 @@ describe("Harness lifecycle", () => {
|
||||
});
|
||||
|
||||
expect(listeners.has("system-prompt/assemble")).toBe(false);
|
||||
expect(listeners.has("agent/inbox/claimed")).toBe(false);
|
||||
expect(listeners.has("session/event")).toBe(false);
|
||||
});
|
||||
|
||||
it("does not capture interrupted turns and isolates rejected capture requests", async () => {
|
||||
const listeners = applyAndCollectListeners({ apiKey: "k", userId: "u" });
|
||||
const onEvent = listeners.get("session/event")!;
|
||||
const session = {};
|
||||
const userEvent = { type: "user/message", data: { role: "user", source: { kind: "user" }, content: "I prefer short answers. What is a list?" } };
|
||||
onEvent(session, { type: "turn/start" });
|
||||
onEvent(session, userEvent);
|
||||
onEvent(session, { type: "turn/end", data: { reason: { kind: "interrupted" } } });
|
||||
expect(mockAdd).not.toHaveBeenCalled();
|
||||
mockAdd.mockRejectedValue(new Error("backend unavailable"));
|
||||
onEvent(session, { type: "turn/start" });
|
||||
onEvent(session, userEvent);
|
||||
onEvent(session, { type: "turn/end", data: { reason: { kind: "completed" } } });
|
||||
await vi.waitFor(() => expect(mockAdd).toHaveBeenCalledOnce());
|
||||
});
|
||||
});
|
||||
|
||||
describe("search_memory tool", () => {
|
||||
@@ -272,3 +326,62 @@ describe("tool user ownership", () => {
|
||||
expect(mockAdd).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
describe("workspace scope", () => {
|
||||
it("isolates both tools and automatic paths by canonical session workspace", async () => {
|
||||
const root = mkdtempSync(join(tmpdir(), "mem0-dsh-scope-"));
|
||||
try {
|
||||
mkdirSync(join(root, "a"));
|
||||
mkdirSync(join(root, "b"));
|
||||
symlinkSync(join(root, "a"), join(root, "alias"));
|
||||
const config: Config = { apiKey: "k", userId: "u", memoryScope: "workspace" };
|
||||
const tools = applyAndCollect(config);
|
||||
mockAdd.mockResolvedValue([]);
|
||||
mockSearch.mockResolvedValue({ results: [] });
|
||||
const session = (name: string) => ({
|
||||
header: { cwd: join(root, name) },
|
||||
deriveMessages: () => [{ role: "user", source: { kind: "user" }, content: "preferences" }],
|
||||
});
|
||||
const a = session("a");
|
||||
await tools.get("add_memory")!.execute({ text: "Uses pnpm" }, { agent: { session: a } });
|
||||
const appId = mockAdd.mock.lastCall?.[1].appId;
|
||||
expect(appId).toMatch(/^deepseek-workspace-[a-f0-9]{64}$/);
|
||||
await tools.get("search_memory")!.execute({ query: "preferences" }, { agent: { session: session("alias") } });
|
||||
expect(mockSearch.mock.lastCall?.[1].filters).toEqual({ user_id: "u", app_id: appId });
|
||||
await tools.get("search_memory")!.execute({ query: "preferences" }, { agent: { session: session("b") } });
|
||||
expect(mockSearch.mock.lastCall?.[1].filters.app_id).not.toBe(appId);
|
||||
|
||||
const listeners = applyAndCollectListeners(config);
|
||||
const base = { sections: [], contexts: [], tools: [], variables: {} };
|
||||
await listeners.get("system-prompt/assemble")!(base, { agent: { session: a } }, async () => base);
|
||||
expect(mockSearch.mock.lastCall?.[1].filters).toEqual({ user_id: "u", app_id: appId });
|
||||
const onEvent = listeners.get("session/event")!;
|
||||
mockAdd.mockClear();
|
||||
onEvent(a, { type: "turn/start" });
|
||||
onEvent(a, { type: "user/message", data: { role: "user", source: { kind: "user" }, content: "I prefer short answers. What is a list?" } });
|
||||
onEvent(a, { type: "turn/end", data: { reason: { kind: "completed" } } });
|
||||
await vi.waitFor(() => expect(mockAdd.mock.lastCall?.[1]).toMatchObject({ userId: "u", appId }));
|
||||
expect(mockAdd).toHaveBeenCalledOnce();
|
||||
expect(mockAdd.mock.lastCall?.[0]).toEqual([
|
||||
{ role: "user", content: "I prefer short answers. What is a list?" },
|
||||
]);
|
||||
} finally { rmSync(root, { recursive: true, force: true }); }
|
||||
});
|
||||
|
||||
it("fails closed without a workspace while automatic paths leave the agent running", async () => {
|
||||
const config: Config = { apiKey: "k", userId: "u", memoryScope: "workspace" };
|
||||
const tools = applyAndCollect(config);
|
||||
await expect(tools.get("add_memory")!.execute({ text: "x" }, {})).rejects.toThrow(/workspace/);
|
||||
await expect(tools.get("search_memory")!.execute({ query: "x" }, {})).rejects.toThrow(/workspace/);
|
||||
const listeners = applyAndCollectListeners(config);
|
||||
const session = { header: {}, deriveMessages: () => [{ role: "user", source: { kind: "user" }, content: "hello" }] };
|
||||
const base = { sections: [], contexts: [], tools: [], variables: {} };
|
||||
expect(await listeners.get("system-prompt/assemble")!(base, { agent: { session } }, async () => base)).toBe(base);
|
||||
const onEvent = listeners.get("session/event")!;
|
||||
onEvent(session, { type: "user/message", data: { role: "user", source: { kind: "user" }, content: "hello" } });
|
||||
expect(() => onEvent(session, { type: "turn/end", data: { reason: { kind: "completed" } } })).not.toThrow();
|
||||
await new Promise((resolve) => setImmediate(resolve));
|
||||
expect(mockAdd).not.toHaveBeenCalled();
|
||||
expect(mockSearch).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import { readFileSync, existsSync } from "node:fs";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
describe("installable Harness bundle", () => {
|
||||
it("ships a native activation patch and builds before packing", () => {
|
||||
const root = new URL("../", import.meta.url);
|
||||
const manifest = JSON.parse(readFileSync(new URL("package.json", root), "utf8"));
|
||||
expect(manifest.scripts.prepack).toBe("pnpm build");
|
||||
expect(manifest.dsh.bundle.patch).toBe("./cordis.patch.yml");
|
||||
expect(manifest.files).toContain("cordis.patch.yml");
|
||||
expect(existsSync(new URL(manifest.dsh.bundle.patch, root))).toBe(true);
|
||||
expect(readFileSync(new URL(manifest.dsh.bundle.patch, root), "utf8")).toContain("@mem0/deepseek-plugin");
|
||||
});
|
||||
});
|
||||
@@ -1,18 +0,0 @@
|
||||
---
|
||||
name: sidekick
|
||||
description: Coding subagent for focused implementation, investigation, testing, debugging, or review work.
|
||||
whenToUse: Delegate a bounded engineering task that benefits from its own isolated context.
|
||||
---
|
||||
|
||||
You are Mem0's coding sidekick. Complete only the bounded task the main agent
|
||||
delegates to you and return a concise, self-contained result.
|
||||
|
||||
Search Mem0 before work that may depend on prior repository decisions or user
|
||||
preferences. Inspect the relevant repository rules and code, make changes when
|
||||
asked, and run the smallest decisive validation. Do not claim Git worktree
|
||||
isolation: Kimi provides a separate context, while filesystem isolation depends
|
||||
on the caller's environment.
|
||||
|
||||
Your final response must state the outcome, changed files, validation, and any
|
||||
remaining risk. Do not commit, push, or open a pull request unless the caller
|
||||
explicitly asks.
|
||||
@@ -11,10 +11,10 @@ import telemetry
|
||||
from memory_core import (
|
||||
EvidenceStore,
|
||||
api_key,
|
||||
configure_harness,
|
||||
data_dir,
|
||||
doctor,
|
||||
forget_remote_repo,
|
||||
configure_harness,
|
||||
resolve_repo,
|
||||
user_id,
|
||||
)
|
||||
@@ -32,7 +32,7 @@ def _print_status(value: dict) -> None:
|
||||
)
|
||||
print(
|
||||
f"Used in this repository: {value['retrievals']} memories returned, "
|
||||
f"{value['sidekick_runs']} sidekick runs"
|
||||
f"{value['subagent_runs']} subagent runs"
|
||||
)
|
||||
if last:
|
||||
item_label = ""
|
||||
@@ -48,13 +48,13 @@ def _print_status(value: dict) -> None:
|
||||
f"{'succeeded' if last['success'] else 'failed'} "
|
||||
f"({last['duration_ms']:.1f} ms{item_label})"
|
||||
)
|
||||
sidekick = value.get("last_sidekick") or {}
|
||||
if sidekick:
|
||||
state = "finished" if sidekick.get("stopped_at") else "started"
|
||||
subagent = value.get("last_subagent") or {}
|
||||
if subagent:
|
||||
state = "finished" if subagent.get("stopped_at") else "started"
|
||||
print(
|
||||
"Last sidekick: "
|
||||
f"{state}, received {sidekick['context_chars']} characters of memory, "
|
||||
f"agent {sidekick['agent_id']}"
|
||||
"Last subagent: "
|
||||
f"{state}, received {subagent['context_chars']} characters of memory, "
|
||||
f"agent {subagent['agent_id']}"
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -524,7 +524,7 @@ def _checkpoint_message(event: dict[str, Any]) -> str:
|
||||
if text:
|
||||
return text
|
||||
return redact(payload.get("text", "")).strip()
|
||||
if kind == "sidekick_stop":
|
||||
if kind in {"subagent_stop", "sidekick_stop"}:
|
||||
return redact(payload.get("final_message", "")).strip()
|
||||
return ""
|
||||
|
||||
@@ -596,6 +596,7 @@ class EvidenceStore:
|
||||
self.conn.close()
|
||||
|
||||
def _migrate(self) -> None:
|
||||
# Keep the legacy table name so existing databases and in-flight workers remain compatible.
|
||||
self.conn.executescript(
|
||||
"""
|
||||
CREATE TABLE IF NOT EXISTS events (
|
||||
@@ -688,8 +689,7 @@ class EvidenceStore:
|
||||
|
||||
"""
|
||||
)
|
||||
# Remove the pre-0.1.1 no-tools snapshot implementation. The real coding
|
||||
# sidekick is a native Claude Code agent and stores no state in this DB.
|
||||
# Remove the pre-0.1.1 snapshot implementation.
|
||||
self.conn.executescript(
|
||||
"""
|
||||
DROP TABLE IF EXISTS sidekick_calls;
|
||||
@@ -1041,7 +1041,7 @@ class EvidenceStore:
|
||||
if row["memory_text"]
|
||||
]
|
||||
|
||||
def start_sidekick(
|
||||
def start_subagent(
|
||||
self,
|
||||
repo: RepoContext,
|
||||
session_id: str,
|
||||
@@ -1049,7 +1049,7 @@ class EvidenceStore:
|
||||
agent_type: str,
|
||||
context_chars: int,
|
||||
) -> bool:
|
||||
"""Record one native sidekick instance and whether context was first sent."""
|
||||
"""Record one native subagent instance and whether context was first sent."""
|
||||
with self.conn:
|
||||
cursor = self.conn.execute(
|
||||
"""INSERT OR IGNORE INTO sidekick_runs
|
||||
@@ -1067,7 +1067,7 @@ class EvidenceStore:
|
||||
)
|
||||
return int(cursor.rowcount) > 0
|
||||
|
||||
def stop_sidekick(
|
||||
def stop_subagent(
|
||||
self,
|
||||
repo: RepoContext,
|
||||
session_id: str,
|
||||
@@ -1222,7 +1222,7 @@ class EvidenceStore:
|
||||
cursor = self.conn.execute(
|
||||
f"DELETE FROM {table} WHERE {column} = ?", (repo_id,)
|
||||
)
|
||||
removed[table] = max(int(cursor.rowcount), 0)
|
||||
removed["subagent_runs" if table == "sidekick_runs" else table] = max(int(cursor.rowcount), 0)
|
||||
return removed
|
||||
|
||||
def status(self, repo_id: str) -> dict[str, Any]:
|
||||
@@ -1238,7 +1238,7 @@ class EvidenceStore:
|
||||
FROM operations WHERE repo_id = ? ORDER BY id DESC LIMIT 1""",
|
||||
(repo_id,),
|
||||
).fetchone()
|
||||
last_sidekick = self.conn.execute(
|
||||
last_subagent = self.conn.execute(
|
||||
"""SELECT session_id, agent_id, agent_type, started_at, stopped_at,
|
||||
context_chars
|
||||
FROM sidekick_runs WHERE repo_id = ?
|
||||
@@ -1250,9 +1250,9 @@ class EvidenceStore:
|
||||
"events": count("events"),
|
||||
"flushes": count("flushes"),
|
||||
"retrievals": count("retrievals"),
|
||||
"sidekick_runs": count("sidekick_runs"),
|
||||
"subagent_runs": count("sidekick_runs"),
|
||||
"last_operation": dict(last_operation) if last_operation else None,
|
||||
"last_sidekick": dict(last_sidekick) if last_sidekick else None,
|
||||
"last_subagent": dict(last_subagent) if last_subagent else None,
|
||||
}
|
||||
|
||||
|
||||
@@ -1324,7 +1324,7 @@ def tool_payload(hook_input: dict[str, Any], *, failed: bool | None = False) ->
|
||||
"tool": name,
|
||||
"failed": failed,
|
||||
"duration_ms": hook_input.get("duration_ms"),
|
||||
"agent_role": "sidekick" if hook_input.get("agent_id") else "main",
|
||||
"agent_role": "subagent" if hook_input.get("agent_id") else "main",
|
||||
}
|
||||
if hook_input.get("agent_id"):
|
||||
payload["agent_id"] = bounded(hook_input["agent_id"], 200)
|
||||
@@ -1384,35 +1384,33 @@ def record_tool(
|
||||
)
|
||||
|
||||
|
||||
def record_sidekick_start(
|
||||
store: EvidenceStore, hook_input: dict[str, Any], *, inject_context: bool = True
|
||||
def record_subagent_start(
|
||||
store: EvidenceStore, hook_input: dict[str, Any]
|
||||
) -> str:
|
||||
"""Record a native sidekick and reuse the main turn's retrieved memories."""
|
||||
"""Record a native subagent and reuse the main turn's retrieved memories."""
|
||||
session_id = _session_id(hook_input)
|
||||
repo = store.repo_for_session(session_id, hook_input.get("cwd"))
|
||||
agent_id = bounded(hook_input.get("agent_id", "unknown-agent"), 200)
|
||||
agent_type = bounded(hook_input.get("agent_type", "mem0:sidekick"), 200)
|
||||
agent_type = bounded(hook_input.get("agent_type", "unknown-agent"), 200)
|
||||
context = combine_context(
|
||||
format_context(store.injected_memories(session_id, repo.identity))
|
||||
)
|
||||
if not inject_context:
|
||||
context = ""
|
||||
first_start = store.start_sidekick(
|
||||
first_start = store.start_subagent(
|
||||
repo, session_id, agent_id, agent_type, len(context)
|
||||
)
|
||||
store.record_event(
|
||||
repo,
|
||||
session_id,
|
||||
"sidekick_start",
|
||||
"subagent_start",
|
||||
{
|
||||
"agent_id": agent_id,
|
||||
"agent_type": agent_type,
|
||||
"context_chars": len(context) if first_start else 0,
|
||||
"worktree_root": bounded(repo.root, 2000),
|
||||
"repo_root": bounded(repo.root, 2000),
|
||||
},
|
||||
)
|
||||
telemetry.record(
|
||||
"sidekick",
|
||||
"subagent",
|
||||
repo=repo,
|
||||
session_id=session_id,
|
||||
phase="start",
|
||||
@@ -1422,14 +1420,14 @@ def record_sidekick_start(
|
||||
return context if first_start else ""
|
||||
|
||||
|
||||
def record_sidekick_stop(store: EvidenceStore, hook_input: dict[str, Any]) -> None:
|
||||
def record_subagent_stop(store: EvidenceStore, hook_input: dict[str, Any]) -> None:
|
||||
session_id = _session_id(hook_input)
|
||||
repo = store.repo_for_session(session_id, hook_input.get("cwd"))
|
||||
agent_type = bounded(hook_input.get("agent_type", "mem0:sidekick"), 200)
|
||||
agent_type = bounded(hook_input.get("agent_type", "unknown-agent"), 200)
|
||||
agent_id = bounded(hook_input.get("agent_id", ""), 200)
|
||||
final_message = redact(hook_input.get("last_assistant_message", "")).strip()
|
||||
transcript_path = bounded(hook_input.get("agent_transcript_path", ""), 2000)
|
||||
agent_id = store.stop_sidekick(
|
||||
agent_id = store.stop_subagent(
|
||||
repo,
|
||||
session_id,
|
||||
agent_id,
|
||||
@@ -1440,7 +1438,7 @@ def record_sidekick_stop(store: EvidenceStore, hook_input: dict[str, Any]) -> No
|
||||
store.record_event(
|
||||
repo,
|
||||
session_id,
|
||||
"sidekick_stop",
|
||||
"subagent_stop",
|
||||
{
|
||||
"agent_id": agent_id,
|
||||
"agent_type": agent_type,
|
||||
@@ -1449,7 +1447,7 @@ def record_sidekick_stop(store: EvidenceStore, hook_input: dict[str, Any]) -> No
|
||||
},
|
||||
)
|
||||
telemetry.record(
|
||||
"sidekick",
|
||||
"subagent",
|
||||
repo=repo,
|
||||
session_id=session_id,
|
||||
phase="stop",
|
||||
@@ -1513,10 +1511,10 @@ def build_episode(
|
||||
for e in events
|
||||
if e["kind"] == "assistant_stop" and e["payload"].get("text")
|
||||
]
|
||||
sidekick_outcomes = [
|
||||
subagent_outcomes = [
|
||||
redact(e["payload"].get("final_message", "")).strip()
|
||||
for e in events
|
||||
if e["kind"] == "sidekick_stop" and e["payload"].get("final_message")
|
||||
if e["kind"] in {"subagent_stop", "sidekick_stop"} and e["payload"].get("final_message")
|
||||
]
|
||||
tools = [
|
||||
e["payload"] for e in events if e["kind"] in {"tool_result", "tool_failure"}
|
||||
@@ -1597,7 +1595,7 @@ def build_episode(
|
||||
}
|
||||
)
|
||||
pending_user_messages = []
|
||||
elif event["kind"] == "sidekick_stop":
|
||||
elif event["kind"] in {"subagent_stop", "sidekick_stop"}:
|
||||
pass
|
||||
extraction_messages.extend(pending_user_messages)
|
||||
|
||||
@@ -1613,7 +1611,7 @@ def build_episode(
|
||||
"assistant_conclusion": conclusion,
|
||||
"user_messages": prompts,
|
||||
"assistant_outcomes": assistant_conclusions,
|
||||
"sidekick_outcomes": sidekick_outcomes,
|
||||
"subagent_outcomes": subagent_outcomes,
|
||||
"extraction_messages": extraction_messages,
|
||||
"files_read": read_paths[:50],
|
||||
"files_modified": modified_paths[:50],
|
||||
|
||||
@@ -8,7 +8,6 @@ import io
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
import uuid
|
||||
from pathlib import Path
|
||||
|
||||
HERE = Path(__file__).resolve()
|
||||
@@ -18,7 +17,7 @@ sys.path.insert(0, str(CORE))
|
||||
|
||||
import hook_runner # noqa: E402
|
||||
import telemetry # noqa: E402
|
||||
from memory_core import configure_harness, record_sidekick_start, record_sidekick_stop, record_tool # noqa: E402
|
||||
from memory_core import configure_harness, record_tool # noqa: E402
|
||||
|
||||
EVENTS = {
|
||||
"SessionStart": ["session-start"],
|
||||
@@ -28,8 +27,6 @@ EVENTS = {
|
||||
"Stop": ["stop"],
|
||||
"PreCompact": ["flush", "--reason", "pre-compact"],
|
||||
"SessionEnd": ["flush", "--reason", "session-end"],
|
||||
"SubagentStart": ["sidekick-start"],
|
||||
"SubagentStop": ["sidekick-stop"],
|
||||
}
|
||||
|
||||
|
||||
@@ -93,8 +90,6 @@ def normalize(payload: dict) -> dict:
|
||||
value.setdefault("tool_response", value["error"])
|
||||
if "response" in value:
|
||||
value.setdefault("last_assistant_message", value["response"])
|
||||
if "agent_name" in value:
|
||||
value.setdefault("agent_type", value["agent_name"])
|
||||
if value.get("hook_event_name") == "Stop":
|
||||
session = _session_dir(str(value.get("session_id") or ""))
|
||||
transcript = session / "agents" / "main" / "wire.jsonl" if session else None
|
||||
@@ -105,17 +100,6 @@ def normalize(payload: dict) -> dict:
|
||||
return value
|
||||
|
||||
|
||||
def _sidekick_start(store, payload):
|
||||
payload = dict(payload)
|
||||
payload.setdefault("agent_id", f"kimi-{uuid.uuid4().hex}")
|
||||
context = record_sidekick_start(store, payload)
|
||||
return {"hookSpecificOutput": {"additionalContext": context}} if context else None
|
||||
|
||||
|
||||
def _sidekick_stop(store, payload):
|
||||
record_sidekick_stop(store, payload)
|
||||
|
||||
|
||||
def main() -> int:
|
||||
if len(sys.argv) != 2 or sys.argv[1] not in EVENTS:
|
||||
return 2
|
||||
@@ -133,12 +117,10 @@ def main() -> int:
|
||||
result = hook_runner.run(
|
||||
extra_actions={
|
||||
"post-tool-failure": lambda store, payload: record_tool(store, payload, failed=True),
|
||||
"sidekick-start": _sidekick_start,
|
||||
"sidekick-stop": _sidekick_stop,
|
||||
},
|
||||
automatic_flush_reasons={"session-end", "pre-compact"},
|
||||
)
|
||||
if event in {"UserPromptSubmit", "SubagentStart"} and (raw_output := output.getvalue().strip()):
|
||||
if event == "UserPromptSubmit" and (raw_output := output.getvalue().strip()):
|
||||
parsed = json.loads(raw_output)
|
||||
context = parsed.get("hookSpecificOutput", {}).get("additionalContext", "")
|
||||
if context:
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
"shortDescription": "Cross-session memory for Kimi Code"
|
||||
},
|
||||
"skills": "./skills/",
|
||||
"agents": "./agents/",
|
||||
"mcpServers": {
|
||||
"mem0": {
|
||||
"command": "python3",
|
||||
@@ -25,8 +24,6 @@
|
||||
{ "event": "PostToolUseFailure", "matcher": ".*", "command": "python3 ./hooks/adapter.py PostToolUseFailure", "timeout": 3 },
|
||||
{ "event": "Stop", "command": "python3 ./hooks/adapter.py Stop", "timeout": 3 },
|
||||
{ "event": "PreCompact", "command": "python3 ./hooks/adapter.py PreCompact", "timeout": 5 },
|
||||
{ "event": "SessionEnd", "command": "python3 ./hooks/adapter.py SessionEnd", "timeout": 5 },
|
||||
{ "event": "SubagentStart", "matcher": "^sidekick$", "command": "python3 ./hooks/adapter.py SubagentStart", "timeout": 5 },
|
||||
{ "event": "SubagentStop", "matcher": "^sidekick$", "command": "python3 ./hooks/adapter.py SubagentStop", "timeout": 5 }
|
||||
{ "event": "SessionEnd", "command": "python3 ./hooks/adapter.py SessionEnd", "timeout": 5 }
|
||||
]
|
||||
}
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
"pluginRoot": "${KIMI_PLUGIN_ROOT}",
|
||||
"files": {
|
||||
"kimi.plugin.json": "kimi.plugin.json",
|
||||
"hooks/adapter.py": "hooks/adapter.py",
|
||||
"agents/sidekick.md": "agents/sidekick.md"
|
||||
"hooks/adapter.py": "hooks/adapter.py"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,73 +118,20 @@ def test_stop_reads_main_response_from_kimi_session_transcript(tmp_path: Path, m
|
||||
assert value["transcript_path"] == str(transcript)
|
||||
|
||||
|
||||
def test_repeated_sidekick_invocations_get_distinct_run_ids(tmp_path: Path) -> None:
|
||||
store = adapter.hook_runner.EvidenceStore(tmp_path / "evidence.sqlite3")
|
||||
payload = {
|
||||
"hook_event_name": "SubagentStart",
|
||||
"session_id": "session_abc",
|
||||
"session_title": "Fix Kimi capture",
|
||||
"client_type": "kimi_code_cli",
|
||||
"cwd": str(tmp_path),
|
||||
"agent_name": "sidekick",
|
||||
"prompt": "Fix the adapter",
|
||||
}
|
||||
|
||||
try:
|
||||
adapter._sidekick_start(store, adapter.normalize({**payload, "agent_id": "first"}))
|
||||
adapter._sidekick_start(store, adapter.normalize({**payload, "agent_id": "second"}))
|
||||
adapter._sidekick_stop(
|
||||
store,
|
||||
adapter.normalize(
|
||||
{
|
||||
**payload,
|
||||
"hook_event_name": "SubagentStop",
|
||||
"response": "First run complete.",
|
||||
"agent_id": "first",
|
||||
}
|
||||
),
|
||||
)
|
||||
adapter._sidekick_stop(
|
||||
store,
|
||||
adapter.normalize(
|
||||
{
|
||||
**payload,
|
||||
"hook_event_name": "SubagentStop",
|
||||
"response": "Second run complete.",
|
||||
"agent_id": "second",
|
||||
}
|
||||
),
|
||||
)
|
||||
|
||||
rows = store.conn.execute(
|
||||
"SELECT agent_id, stopped_at, final_message FROM sidekick_runs ORDER BY started_at, agent_id"
|
||||
).fetchall()
|
||||
finally:
|
||||
store.close()
|
||||
|
||||
assert len(rows) == 2
|
||||
assert rows[0]["agent_id"] != rows[1]["agent_id"]
|
||||
assert all(row["stopped_at"] for row in rows)
|
||||
assert {row["agent_id"]: row["final_message"] for row in rows} == {
|
||||
"first": "First run complete.", "second": "Second run complete."
|
||||
}
|
||||
|
||||
|
||||
def test_native_kimi_bundle_uses_inline_native_contract(tmp_path: Path) -> None:
|
||||
root = build("kimi", "native", tmp_path / "kimi")
|
||||
|
||||
manifest = json.loads((root / "kimi.plugin.json").read_text(encoding="utf-8"))
|
||||
assert manifest["skills"] == "./skills/"
|
||||
assert manifest["agents"] == "./agents/"
|
||||
assert "agents" not in manifest
|
||||
assert manifest["mcpServers"]["mem0"]["args"] == ["./core/mcp_server.py"]
|
||||
assert not {"SubagentStart", "SubagentStop"} & {hook["event"] for hook in manifest["hooks"]}
|
||||
assert {hook["event"] for hook in manifest["hooks"]} >= {
|
||||
"SessionStart",
|
||||
"UserPromptSubmit",
|
||||
"PostToolUse",
|
||||
"SubagentStart",
|
||||
"SubagentStop",
|
||||
"PreCompact",
|
||||
"SessionEnd",
|
||||
}
|
||||
assert (root / "agents" / "sidekick.md").is_file()
|
||||
assert not (root / "agents").exists()
|
||||
assert not any(path.is_symlink() for path in root.rglob("*"))
|
||||
|
||||
@@ -11,10 +11,10 @@ import telemetry
|
||||
from memory_core import (
|
||||
EvidenceStore,
|
||||
api_key,
|
||||
configure_harness,
|
||||
data_dir,
|
||||
doctor,
|
||||
forget_remote_repo,
|
||||
configure_harness,
|
||||
resolve_repo,
|
||||
user_id,
|
||||
)
|
||||
@@ -32,7 +32,7 @@ def _print_status(value: dict) -> None:
|
||||
)
|
||||
print(
|
||||
f"Used in this repository: {value['retrievals']} memories returned, "
|
||||
f"{value['sidekick_runs']} sidekick runs"
|
||||
f"{value['subagent_runs']} subagent runs"
|
||||
)
|
||||
if last:
|
||||
item_label = ""
|
||||
@@ -48,13 +48,13 @@ def _print_status(value: dict) -> None:
|
||||
f"{'succeeded' if last['success'] else 'failed'} "
|
||||
f"({last['duration_ms']:.1f} ms{item_label})"
|
||||
)
|
||||
sidekick = value.get("last_sidekick") or {}
|
||||
if sidekick:
|
||||
state = "finished" if sidekick.get("stopped_at") else "started"
|
||||
subagent = value.get("last_subagent") or {}
|
||||
if subagent:
|
||||
state = "finished" if subagent.get("stopped_at") else "started"
|
||||
print(
|
||||
"Last sidekick: "
|
||||
f"{state}, received {sidekick['context_chars']} characters of memory, "
|
||||
f"agent {sidekick['agent_id']}"
|
||||
"Last subagent: "
|
||||
f"{state}, received {subagent['context_chars']} characters of memory, "
|
||||
f"agent {subagent['agent_id']}"
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -524,7 +524,7 @@ def _checkpoint_message(event: dict[str, Any]) -> str:
|
||||
if text:
|
||||
return text
|
||||
return redact(payload.get("text", "")).strip()
|
||||
if kind == "sidekick_stop":
|
||||
if kind in {"subagent_stop", "sidekick_stop"}:
|
||||
return redact(payload.get("final_message", "")).strip()
|
||||
return ""
|
||||
|
||||
@@ -596,6 +596,7 @@ class EvidenceStore:
|
||||
self.conn.close()
|
||||
|
||||
def _migrate(self) -> None:
|
||||
# Keep the legacy table name so existing databases and in-flight workers remain compatible.
|
||||
self.conn.executescript(
|
||||
"""
|
||||
CREATE TABLE IF NOT EXISTS events (
|
||||
@@ -688,8 +689,7 @@ class EvidenceStore:
|
||||
|
||||
"""
|
||||
)
|
||||
# Remove the pre-0.1.1 no-tools snapshot implementation. The real coding
|
||||
# sidekick is a native Claude Code agent and stores no state in this DB.
|
||||
# Remove the pre-0.1.1 snapshot implementation.
|
||||
self.conn.executescript(
|
||||
"""
|
||||
DROP TABLE IF EXISTS sidekick_calls;
|
||||
@@ -1041,7 +1041,7 @@ class EvidenceStore:
|
||||
if row["memory_text"]
|
||||
]
|
||||
|
||||
def start_sidekick(
|
||||
def start_subagent(
|
||||
self,
|
||||
repo: RepoContext,
|
||||
session_id: str,
|
||||
@@ -1049,7 +1049,7 @@ class EvidenceStore:
|
||||
agent_type: str,
|
||||
context_chars: int,
|
||||
) -> bool:
|
||||
"""Record one native sidekick instance and whether context was first sent."""
|
||||
"""Record one native subagent instance and whether context was first sent."""
|
||||
with self.conn:
|
||||
cursor = self.conn.execute(
|
||||
"""INSERT OR IGNORE INTO sidekick_runs
|
||||
@@ -1067,7 +1067,7 @@ class EvidenceStore:
|
||||
)
|
||||
return int(cursor.rowcount) > 0
|
||||
|
||||
def stop_sidekick(
|
||||
def stop_subagent(
|
||||
self,
|
||||
repo: RepoContext,
|
||||
session_id: str,
|
||||
@@ -1222,7 +1222,7 @@ class EvidenceStore:
|
||||
cursor = self.conn.execute(
|
||||
f"DELETE FROM {table} WHERE {column} = ?", (repo_id,)
|
||||
)
|
||||
removed[table] = max(int(cursor.rowcount), 0)
|
||||
removed["subagent_runs" if table == "sidekick_runs" else table] = max(int(cursor.rowcount), 0)
|
||||
return removed
|
||||
|
||||
def status(self, repo_id: str) -> dict[str, Any]:
|
||||
@@ -1238,7 +1238,7 @@ class EvidenceStore:
|
||||
FROM operations WHERE repo_id = ? ORDER BY id DESC LIMIT 1""",
|
||||
(repo_id,),
|
||||
).fetchone()
|
||||
last_sidekick = self.conn.execute(
|
||||
last_subagent = self.conn.execute(
|
||||
"""SELECT session_id, agent_id, agent_type, started_at, stopped_at,
|
||||
context_chars
|
||||
FROM sidekick_runs WHERE repo_id = ?
|
||||
@@ -1250,9 +1250,9 @@ class EvidenceStore:
|
||||
"events": count("events"),
|
||||
"flushes": count("flushes"),
|
||||
"retrievals": count("retrievals"),
|
||||
"sidekick_runs": count("sidekick_runs"),
|
||||
"subagent_runs": count("sidekick_runs"),
|
||||
"last_operation": dict(last_operation) if last_operation else None,
|
||||
"last_sidekick": dict(last_sidekick) if last_sidekick else None,
|
||||
"last_subagent": dict(last_subagent) if last_subagent else None,
|
||||
}
|
||||
|
||||
|
||||
@@ -1324,7 +1324,7 @@ def tool_payload(hook_input: dict[str, Any], *, failed: bool | None = False) ->
|
||||
"tool": name,
|
||||
"failed": failed,
|
||||
"duration_ms": hook_input.get("duration_ms"),
|
||||
"agent_role": "sidekick" if hook_input.get("agent_id") else "main",
|
||||
"agent_role": "subagent" if hook_input.get("agent_id") else "main",
|
||||
}
|
||||
if hook_input.get("agent_id"):
|
||||
payload["agent_id"] = bounded(hook_input["agent_id"], 200)
|
||||
@@ -1384,35 +1384,33 @@ def record_tool(
|
||||
)
|
||||
|
||||
|
||||
def record_sidekick_start(
|
||||
store: EvidenceStore, hook_input: dict[str, Any], *, inject_context: bool = True
|
||||
def record_subagent_start(
|
||||
store: EvidenceStore, hook_input: dict[str, Any]
|
||||
) -> str:
|
||||
"""Record a native sidekick and reuse the main turn's retrieved memories."""
|
||||
"""Record a native subagent and reuse the main turn's retrieved memories."""
|
||||
session_id = _session_id(hook_input)
|
||||
repo = store.repo_for_session(session_id, hook_input.get("cwd"))
|
||||
agent_id = bounded(hook_input.get("agent_id", "unknown-agent"), 200)
|
||||
agent_type = bounded(hook_input.get("agent_type", "mem0:sidekick"), 200)
|
||||
agent_type = bounded(hook_input.get("agent_type", "unknown-agent"), 200)
|
||||
context = combine_context(
|
||||
format_context(store.injected_memories(session_id, repo.identity))
|
||||
)
|
||||
if not inject_context:
|
||||
context = ""
|
||||
first_start = store.start_sidekick(
|
||||
first_start = store.start_subagent(
|
||||
repo, session_id, agent_id, agent_type, len(context)
|
||||
)
|
||||
store.record_event(
|
||||
repo,
|
||||
session_id,
|
||||
"sidekick_start",
|
||||
"subagent_start",
|
||||
{
|
||||
"agent_id": agent_id,
|
||||
"agent_type": agent_type,
|
||||
"context_chars": len(context) if first_start else 0,
|
||||
"worktree_root": bounded(repo.root, 2000),
|
||||
"repo_root": bounded(repo.root, 2000),
|
||||
},
|
||||
)
|
||||
telemetry.record(
|
||||
"sidekick",
|
||||
"subagent",
|
||||
repo=repo,
|
||||
session_id=session_id,
|
||||
phase="start",
|
||||
@@ -1422,14 +1420,14 @@ def record_sidekick_start(
|
||||
return context if first_start else ""
|
||||
|
||||
|
||||
def record_sidekick_stop(store: EvidenceStore, hook_input: dict[str, Any]) -> None:
|
||||
def record_subagent_stop(store: EvidenceStore, hook_input: dict[str, Any]) -> None:
|
||||
session_id = _session_id(hook_input)
|
||||
repo = store.repo_for_session(session_id, hook_input.get("cwd"))
|
||||
agent_type = bounded(hook_input.get("agent_type", "mem0:sidekick"), 200)
|
||||
agent_type = bounded(hook_input.get("agent_type", "unknown-agent"), 200)
|
||||
agent_id = bounded(hook_input.get("agent_id", ""), 200)
|
||||
final_message = redact(hook_input.get("last_assistant_message", "")).strip()
|
||||
transcript_path = bounded(hook_input.get("agent_transcript_path", ""), 2000)
|
||||
agent_id = store.stop_sidekick(
|
||||
agent_id = store.stop_subagent(
|
||||
repo,
|
||||
session_id,
|
||||
agent_id,
|
||||
@@ -1440,7 +1438,7 @@ def record_sidekick_stop(store: EvidenceStore, hook_input: dict[str, Any]) -> No
|
||||
store.record_event(
|
||||
repo,
|
||||
session_id,
|
||||
"sidekick_stop",
|
||||
"subagent_stop",
|
||||
{
|
||||
"agent_id": agent_id,
|
||||
"agent_type": agent_type,
|
||||
@@ -1449,7 +1447,7 @@ def record_sidekick_stop(store: EvidenceStore, hook_input: dict[str, Any]) -> No
|
||||
},
|
||||
)
|
||||
telemetry.record(
|
||||
"sidekick",
|
||||
"subagent",
|
||||
repo=repo,
|
||||
session_id=session_id,
|
||||
phase="stop",
|
||||
@@ -1513,10 +1511,10 @@ def build_episode(
|
||||
for e in events
|
||||
if e["kind"] == "assistant_stop" and e["payload"].get("text")
|
||||
]
|
||||
sidekick_outcomes = [
|
||||
subagent_outcomes = [
|
||||
redact(e["payload"].get("final_message", "")).strip()
|
||||
for e in events
|
||||
if e["kind"] == "sidekick_stop" and e["payload"].get("final_message")
|
||||
if e["kind"] in {"subagent_stop", "sidekick_stop"} and e["payload"].get("final_message")
|
||||
]
|
||||
tools = [
|
||||
e["payload"] for e in events if e["kind"] in {"tool_result", "tool_failure"}
|
||||
@@ -1597,7 +1595,7 @@ def build_episode(
|
||||
}
|
||||
)
|
||||
pending_user_messages = []
|
||||
elif event["kind"] == "sidekick_stop":
|
||||
elif event["kind"] in {"subagent_stop", "sidekick_stop"}:
|
||||
pass
|
||||
extraction_messages.extend(pending_user_messages)
|
||||
|
||||
@@ -1613,7 +1611,7 @@ def build_episode(
|
||||
"assistant_conclusion": conclusion,
|
||||
"user_messages": prompts,
|
||||
"assistant_outcomes": assistant_conclusions,
|
||||
"sidekick_outcomes": sidekick_outcomes,
|
||||
"subagent_outcomes": subagent_outcomes,
|
||||
"extraction_messages": extraction_messages,
|
||||
"files_read": read_paths[:50],
|
||||
"files_modified": modified_paths[:50],
|
||||
|
||||
@@ -2,12 +2,14 @@
|
||||
|
||||
Long-term memory for [OpenClaw](https://github.com/openclaw/openclaw) agents, powered by [Mem0](https://mem0.ai).
|
||||
|
||||
Your agent forgets everything between sessions. This plugin fixes that — it stores conversations, extracts what matters, and brings it back when relevant.
|
||||
Your agent forgets everything between sessions. This plugin stores conversations and recalls relevant memories.
|
||||
|
||||
By default, the plugin runs in **skills mode**: the agent controls what to remember (triage) and how to recall (recall). Skills mode, `autoRecall`, and `autoCapture` are all enabled by default during `openclaw mem0 init`.
|
||||
|
||||
Current package version: `1.1.0`. Shared redaction and lifecycle utilities come from [agent-plugin-core](../agent-plugin-core/README.md); OpenClaw keeps its own tools, skills, and memory scopes.
|
||||
|
||||
Sidekick is available only in the [Claude Code plugin](../claude-code-plugin/README.md#sonnet-sidekick-agent).
|
||||
|
||||
## Requirements
|
||||
|
||||
Check your OpenClaw version:
|
||||
@@ -29,7 +31,7 @@ If you're an AI agent setting up Mem0 autonomously (no human dashboard signup),
|
||||
mem0 init --agent --json
|
||||
```
|
||||
|
||||
No email, no OTP, no browser. The key is written to your Mem0 CLI config and exported as `MEM0_API_KEY` — pass it to `openclaw mem0 init --api-key $MEM0_API_KEY --user-id <id>` to wire OpenClaw up immediately. The human owner can later run `mem0 init --email <their-email>` to claim ownership: memories transfer, same API key keeps working, no agent disruption.
|
||||
No email, no OTP, no browser. The key is written to your Mem0 CLI config and exported as `MEM0_API_KEY`. Pass it to `openclaw mem0 init --api-key $MEM0_API_KEY --user-id <id>` to wire OpenClaw up immediately. The human owner can later run `mem0 init --email <their-email>` to claim ownership: memories transfer, same API key keeps working, no agent disruption.
|
||||
|
||||
Humans should follow the Quick Start below.
|
||||
|
||||
@@ -95,9 +97,9 @@ openclaw plugins update openclaw-mem0
|
||||
|
||||
### Open-Source (Self-hosted)
|
||||
|
||||
No Mem0 key needed. Vectors are stored locally in SQLite at `~/.mem0/vector_store.db` — no external database required.
|
||||
No Mem0 key needed. Vectors are stored locally in SQLite at `~/.mem0/vector_store.db`. No external database is required.
|
||||
|
||||
Defaults: `text-embedding-3-small` (OpenAI) for embeddings, `gpt-5-mini` (OpenAI) for fact extraction — requires `OPENAI_API_KEY`. For a fully local setup, use Ollama for both LLM and embeddings.
|
||||
Defaults: `text-embedding-3-small` (OpenAI) for embeddings, `gpt-5-mini` (OpenAI) for fact extraction. Both require `OPENAI_API_KEY`. For a fully local setup, use Ollama for both LLM and embeddings.
|
||||
|
||||
#### Interactive Setup (Recommended)
|
||||
|
||||
@@ -108,16 +110,16 @@ openclaw mem0 init --mode open-source
|
||||
```
|
||||
|
||||
The wizard walks you through:
|
||||
1. **LLM provider** — OpenAI (`gpt-5-mini`), Ollama (`llama3.1:8b`, local), or Anthropic (`claude-sonnet-4-5-20250514`)
|
||||
2. **Embedding provider** — OpenAI (`text-embedding-3-small`) or Ollama (`nomic-embed-text`, local)
|
||||
3. **Vector store** — Qdrant (`http://localhost:6333`) or PGVector (PostgreSQL)
|
||||
4. **User ID** — your memory namespace identifier
|
||||
1. **LLM provider**: OpenAI (`gpt-5-mini`), Ollama (`llama3.1:8b`, local), or Anthropic (`claude-sonnet-4-5-20250514`)
|
||||
2. **Embedding provider**: OpenAI (`text-embedding-3-small`) or Ollama (`nomic-embed-text`, local)
|
||||
3. **Vector store**: Qdrant (`http://localhost:6333`) or PGVector (PostgreSQL)
|
||||
4. **User ID**: your memory namespace identifier
|
||||
|
||||
Each step tests connectivity (Ollama, Qdrant, PGVector) before proceeding.
|
||||
|
||||
#### Non-Interactive Setup
|
||||
|
||||
For CI/CD, scripts, or agent-driven setup — pass all options as flags:
|
||||
For automated setup, pass all options as flags:
|
||||
|
||||
```bash
|
||||
# Fully local with Ollama + Qdrant
|
||||
@@ -166,7 +168,7 @@ openclaw mem0 init --mode open-source --oss-llm ollama --oss-embedder ollama --o
|
||||
|
||||
#### Manual Config
|
||||
|
||||
Minimal config — uses OpenAI defaults:
|
||||
Minimal config using OpenAI defaults:
|
||||
|
||||
```json5
|
||||
{
|
||||
@@ -213,8 +215,8 @@ All `oss` fields are optional. See the [Mem0 OSS docs](https://docs.mem0.ai/open
|
||||
|
||||
Enabled automatically during `openclaw mem0 init`. The agent controls memory through two skills:
|
||||
|
||||
- **Triage** — Extracts durable facts from conversations using a structured protocol. Categories, importance gates, and domain overlays control what gets stored.
|
||||
- **Recall** — Before each turn, rewrites the user message into search queries, retrieves relevant memories with reranking, and injects them into context.
|
||||
- **Triage**: Extracts durable facts from conversations using a structured protocol. Categories, importance gates, and domain overlays control what gets stored.
|
||||
- **Recall**: Before each turn, rewrites the user message into search queries, retrieves relevant memories with reranking, and injects them into context.
|
||||
|
||||
When skills mode is active, the skills handle memory operations. `autoRecall` and `autoCapture` remain `true` by default alongside skills mode. The built-in `session-memory` hook is disabled to avoid conflicts.
|
||||
|
||||
@@ -222,8 +224,8 @@ When skills mode is active, the skills handle memory operations. `autoRecall` an
|
||||
|
||||
The plugin also registers `autoRecall` and `autoCapture` when their flags are enabled (both default to `true`), including alongside skills mode:
|
||||
|
||||
- **Auto-Recall** — Before the agent responds, the plugin searches Mem0 for relevant memories and injects them into context.
|
||||
- **Auto-Capture** — After the agent responds, the conversation is filtered through a noise-removal pipeline and sent to Mem0. New facts get stored, stale ones updated, duplicates merged.
|
||||
- **Auto-Recall**: Before the agent responds, the plugin searches Mem0 for relevant memories and injects them into context.
|
||||
- **Auto-Capture**: After the agent responds, the conversation is filtered through a noise-removal pipeline and sent to Mem0. New facts get stored, stale ones updated, duplicates merged.
|
||||
|
||||
Automatic capture selects a recent-message window and earlier assistant summaries, removes injected context and noise, and redacts secrets. Selected message text is no longer cut off at 2,000 characters. This preserves full redacted text for selected messages, not every message in the session. Capture skips non-interactive triggers, subagent sessions, and turns that already used memory mutation tools.
|
||||
|
||||
@@ -231,8 +233,8 @@ Set `autoRecall: false` or `autoCapture: false` to disable these automatic hooks
|
||||
|
||||
### Memory Scopes
|
||||
|
||||
- **Session (short-term)** — Scoped to the current conversation via `run_id`. Recalled alongside long-term memories.
|
||||
- **User (long-term)** — Persistent across all sessions. Default for `memory_add`.
|
||||
- **Session (short-term)**: Scoped to the current conversation via `run_id`. Recalled alongside long-term memories.
|
||||
- **User (long-term)**: Persistent across all sessions. Default for `memory_add`.
|
||||
|
||||
### Multi-Agent Isolation
|
||||
|
||||
@@ -320,7 +322,7 @@ Enabled by default during `openclaw mem0 init`. `autoRecall` and `autoCapture` a
|
||||
|
||||
| Key | Type | Default | Description |
|
||||
| --- | ---- | ------- | ----------- |
|
||||
| `apiKey` | `string` | — | **Required.** Mem0 API key (supports `${MEM0_API_KEY}`) |
|
||||
| `apiKey` | `string` | Not set | **Required.** Mem0 API key (supports `${MEM0_API_KEY}`) |
|
||||
| `customInstructions` | `string` | *(built-in)* | Custom extraction rules |
|
||||
| `customCategories` | `object` | *(12 defaults)* | Category name to description map |
|
||||
|
||||
@@ -332,12 +334,12 @@ All fields optional. Defaults: `text-embedding-3-small` embeddings, local SQLite
|
||||
| --- | ---- | ------- | ----------- |
|
||||
| `customPrompt` | `string` | *(built-in)* | Extraction prompt |
|
||||
| `oss.embedder.provider` | `string` | `"openai"` | Embedding provider |
|
||||
| `oss.embedder.config` | `object` | — | Provider config (`apiKey`, `model`, `baseURL`) |
|
||||
| `oss.embedder.config` | `object` | Not set | Provider config (`apiKey`, `model`, `baseURL`) |
|
||||
| `oss.vectorStore.provider` | `string` | `"memory"` | Vector store provider (see list above) |
|
||||
| `oss.vectorStore.config` | `object` | — | Provider config (`host`, `port`, `collectionName`, `dbPath`) |
|
||||
| `oss.vectorStore.config` | `object` | Not set | Provider config (`host`, `port`, `collectionName`, `dbPath`) |
|
||||
| `oss.llm.provider` | `string` | `"openai"` | LLM provider |
|
||||
| `oss.llm.config` | `object` | — | Provider config (`apiKey`, `model`, `baseURL`) |
|
||||
| `oss.historyDbPath` | `string` | — | SQLite path for edit history |
|
||||
| `oss.llm.config` | `object` | Not set | Provider config (`apiKey`, `model`, `baseURL`) |
|
||||
| `oss.historyDbPath` | `string` | Not set | SQLite path for edit history |
|
||||
|
||||
## Privacy & Security
|
||||
|
||||
@@ -347,7 +349,7 @@ All fields optional. Defaults: `text-embedding-3-small` embeddings, local SQLite
|
||||
|------|----------------|-------------------|
|
||||
| **Platform** | Conversations sent to `api.mem0.ai` for memory extraction and retrieval | `MEM0_API_KEY` |
|
||||
| **Open-Source (OpenAI)** | LLM/embedding calls to OpenAI API; vectors stored locally at `~/.mem0/vector_store.db` | `OPENAI_API_KEY` |
|
||||
| **Open-Source (Ollama)** | Fully local — LLM, embeddings, and vectors all on your machine | None |
|
||||
| **Open-Source (Ollama)** | LLM, embeddings, and vectors run locally | None |
|
||||
|
||||
### Credential Storage
|
||||
|
||||
|
||||
@@ -56,11 +56,11 @@
|
||||
"devDependencies": {
|
||||
"@qdrant/js-client-rest": "^1.18.0",
|
||||
"@types/node": "^22.15.0",
|
||||
"@vitest/coverage-v8": "^4.1.7",
|
||||
"@vitest/coverage-v8": "^4.1.11",
|
||||
"tsup": "^8.5.0",
|
||||
"typescript": "^5.8.3",
|
||||
"vite": "^8.0.5",
|
||||
"vitest": "^4.1.7"
|
||||
"vitest": "^4.1.11"
|
||||
},
|
||||
"pnpm": {
|
||||
"overrides": {
|
||||
|
||||
Generated
+56
-56
@@ -36,8 +36,8 @@ importers:
|
||||
specifier: ^22.15.0
|
||||
version: 22.19.20
|
||||
'@vitest/coverage-v8':
|
||||
specifier: ^4.1.7
|
||||
version: 4.1.8(vitest@4.1.8)
|
||||
specifier: ^4.1.11
|
||||
version: 4.1.11(vitest@4.1.11)
|
||||
tsup:
|
||||
specifier: ^8.5.0
|
||||
version: 8.5.1(postcss@8.5.23)(typescript@5.9.3)
|
||||
@@ -48,8 +48,8 @@ importers:
|
||||
specifier: ^8.0.5
|
||||
version: 8.0.16(@types/node@22.19.20)(esbuild@0.28.1)
|
||||
vitest:
|
||||
specifier: ^4.1.7
|
||||
version: 4.1.8(@types/node@22.19.20)(@vitest/coverage-v8@4.1.8)(vite@8.0.16(@types/node@22.19.20)(esbuild@0.28.1))
|
||||
specifier: ^4.1.11
|
||||
version: 4.1.11(@types/node@22.19.20)(@vitest/coverage-v8@4.1.11)(vite@8.0.16(@types/node@22.19.20)(esbuild@0.28.1))
|
||||
|
||||
packages:
|
||||
|
||||
@@ -767,20 +767,20 @@ packages:
|
||||
resolution: {integrity: sha512-jIXhD0eWQ1JA6ln/5Dltyx22UxWNrw0hZmhy2rlv6m6KgF7kplHx3g0fzi09lNmTJQRR91OlemYp3xFnvDK9og==}
|
||||
engines: {node: '>=20.0.0'}
|
||||
|
||||
'@vitest/coverage-v8@4.1.8':
|
||||
resolution: {integrity: sha512-lt3kovsyHwYe00wq4D1ti0Z974fWj4NLp6siqiyEufUpyFwK9Yhi7rBhac9JL5aA0zoMrJqc4vYPZRUnI7l7nw==}
|
||||
'@vitest/coverage-v8@4.1.11':
|
||||
resolution: {integrity: sha512-8MVGEFnJIcdGjcbfKmeq8z0pZHH0JlVtoVZH9Q/qwUp6wyFnEJUBMrw9DCaj+ra3vShGmhavjalMIhPNxZAUcw==}
|
||||
peerDependencies:
|
||||
'@vitest/browser': 4.1.8
|
||||
vitest: 4.1.8
|
||||
'@vitest/browser': 4.1.11
|
||||
vitest: 4.1.11
|
||||
peerDependenciesMeta:
|
||||
'@vitest/browser':
|
||||
optional: true
|
||||
|
||||
'@vitest/expect@4.1.8':
|
||||
resolution: {integrity: sha512-h3nDO677RDLEGlBxyQ5CW8RlMThSKSRLUePLOx09gNIWRL40edgA1GCZSZgf1W55MFAG6/Sw14KeaAnqv0NKdQ==}
|
||||
'@vitest/expect@4.1.11':
|
||||
resolution: {integrity: sha512-VX2x5vNJXET47KAFzwERI+KRMtTTCSWTfSMKsW7JsUsXV4psq++e3DvZpuTDOpHcxytiDs6p2nhVb2tVDiiUYw==}
|
||||
|
||||
'@vitest/mocker@4.1.8':
|
||||
resolution: {integrity: sha512-LEiN/xe4OSIbKe9HQIp5OC24agGD9J5CnmMgsLohVVoOPWL9a2sBoR6VBx43jQZb7Kr1l4RCuyCJzcAa0+dojw==}
|
||||
'@vitest/mocker@4.1.11':
|
||||
resolution: {integrity: sha512-2XJVD55d1o5AZous5CCGKS74g/riOj9odEt2bQpCVZeblHyHdnMeFl4jl0XjU21stf4mbjUkew2eXQZt65g5CQ==}
|
||||
peerDependencies:
|
||||
msw: ^2.4.9
|
||||
vite: ^8.0.5
|
||||
@@ -790,20 +790,20 @@ packages:
|
||||
vite:
|
||||
optional: true
|
||||
|
||||
'@vitest/pretty-format@4.1.8':
|
||||
resolution: {integrity: sha512-9GasEBxpZ1VYIpqHf/0+YGg121uSNwCKOJqIrTwWP/TB7DmFCiaBpNl3aPZzoLWfWkuqhbH8vJIVobZkvdo2cA==}
|
||||
'@vitest/pretty-format@4.1.11':
|
||||
resolution: {integrity: sha512-yiZzPbGTS9Sr/JpFl8zHrcIkAofNbFV6k21vIgQN/cY/oxZeXhJv5sc/MBJ5jFKWmWs+oJHw0UXLZjmf931+Vw==}
|
||||
|
||||
'@vitest/runner@4.1.8':
|
||||
resolution: {integrity: sha512-EmVxeBAfMJvycdjd6Hm+RbFBbA9fKvo0Kx37hNpBYoYeavH3RNsBXWDooR1mgD52dCrxIIuP7UotpfiwOikvcg==}
|
||||
'@vitest/runner@4.1.11':
|
||||
resolution: {integrity: sha512-LztvUgdwMNJMIkj3hQnnxiC2Xy1zNxq928W/xhjCLaNCzqTZOudjwbQf6v9IntZGPw132i2Lq2rgTRZHD3JHNw==}
|
||||
|
||||
'@vitest/snapshot@4.1.8':
|
||||
resolution: {integrity: sha512-acfZboRmAIf05DEKcBQy33VXojFJjtUdLyo7oOmV9kebb2xdU01UknNiPuPZoJZQyO7DF0gZdTGTpeAzET9QPQ==}
|
||||
'@vitest/snapshot@4.1.11':
|
||||
resolution: {integrity: sha512-pN7ikn1ON7h8ee4gIAp4AzyK+zBtJPzVbqOgu5LCEh4VaJVbPQcgYQYJIMGQPXVeJJq1fnfazis7a5pFNPahog==}
|
||||
|
||||
'@vitest/spy@4.1.8':
|
||||
resolution: {integrity: sha512-6EevtBp6OZOPF7bmz36HrGMeP3txgVSrgebWxHOafDXGkhIzfXK14f8KF6MuFfgXXUeHxmpD3BQxkV00/3s5mA==}
|
||||
'@vitest/spy@4.1.11':
|
||||
resolution: {integrity: sha512-apNa/prQy2qCeywhnixOHPRCgGNhvg7T4Dapfl1GahLp/R+uhBm5cPyFoNVyqsNd2h1nJxL6BqqdIjiABL60YA==}
|
||||
|
||||
'@vitest/utils@4.1.8':
|
||||
resolution: {integrity: sha512-uOJamYALNhfJ6iolExyQM40yIQwDqYnkKtQ5VCiSe17E33H0aQ/u+1GlRuz4LZBk6Mm3sg90G9hEbmEt37C1Zg==}
|
||||
'@vitest/utils@4.1.11':
|
||||
resolution: {integrity: sha512-zTCVGpyFsGWBhllOyKlTw/vnr6D9qxsfSDyfbyZmTyjHw5N/VuvzHpHoQjm2ZJzn4RJgx5w4r7V0er69CmLgPQ==}
|
||||
|
||||
abort-controller@3.0.0:
|
||||
resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==}
|
||||
@@ -2094,20 +2094,20 @@ packages:
|
||||
yaml:
|
||||
optional: true
|
||||
|
||||
vitest@4.1.8:
|
||||
resolution: {integrity: sha512-flY6ScbCIt9HThs+C5HS7jvGOB560DJtk/Z15IQROTA6zEy49Nh8T/dofWTQL+n3vswqn87sbJNiuqw1SDp5Ig==}
|
||||
vitest@4.1.11:
|
||||
resolution: {integrity: sha512-fhACrNXUidIbGSBr5FlbuBkO7VWC1ZyLl0DO4CU2DrQoAPxX84Ysxs+HeGQpii5lZWV1Q4gBZTTu49mF+A6Edw==}
|
||||
engines: {node: ^20.0.0 || ^22.0.0 || >=24.0.0}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
'@edge-runtime/vm': '*'
|
||||
'@opentelemetry/api': ^1.9.0
|
||||
'@types/node': ^20.0.0 || ^22.0.0 || >=24.0.0
|
||||
'@vitest/browser-playwright': 4.1.8
|
||||
'@vitest/browser-preview': 4.1.8
|
||||
'@vitest/browser-webdriverio': 4.1.8
|
||||
'@vitest/coverage-istanbul': 4.1.8
|
||||
'@vitest/coverage-v8': 4.1.8
|
||||
'@vitest/ui': 4.1.8
|
||||
'@vitest/browser-playwright': 4.1.11
|
||||
'@vitest/browser-preview': 4.1.11
|
||||
'@vitest/browser-webdriverio': 4.1.11
|
||||
'@vitest/coverage-istanbul': 4.1.11
|
||||
'@vitest/coverage-v8': 4.1.11
|
||||
'@vitest/ui': 4.1.11
|
||||
happy-dom: '*'
|
||||
jsdom: '*'
|
||||
vite: ^8.0.5
|
||||
@@ -2807,10 +2807,10 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@vitest/coverage-v8@4.1.8(vitest@4.1.8)':
|
||||
'@vitest/coverage-v8@4.1.11(vitest@4.1.11)':
|
||||
dependencies:
|
||||
'@bcoe/v8-coverage': 1.0.2
|
||||
'@vitest/utils': 4.1.8
|
||||
'@vitest/utils': 4.1.11
|
||||
ast-v8-to-istanbul: 1.0.3
|
||||
istanbul-lib-coverage: 3.2.2
|
||||
istanbul-lib-report: 3.0.1
|
||||
@@ -2819,46 +2819,46 @@ snapshots:
|
||||
obug: 2.1.2
|
||||
std-env: 4.1.0
|
||||
tinyrainbow: 3.1.0
|
||||
vitest: 4.1.8(@types/node@22.19.20)(@vitest/coverage-v8@4.1.8)(vite@8.0.16(@types/node@22.19.20)(esbuild@0.28.1))
|
||||
vitest: 4.1.11(@types/node@22.19.20)(@vitest/coverage-v8@4.1.11)(vite@8.0.16(@types/node@22.19.20)(esbuild@0.28.1))
|
||||
|
||||
'@vitest/expect@4.1.8':
|
||||
'@vitest/expect@4.1.11':
|
||||
dependencies:
|
||||
'@standard-schema/spec': 1.1.0
|
||||
'@types/chai': 5.2.3
|
||||
'@vitest/spy': 4.1.8
|
||||
'@vitest/utils': 4.1.8
|
||||
'@vitest/spy': 4.1.11
|
||||
'@vitest/utils': 4.1.11
|
||||
chai: 6.2.2
|
||||
tinyrainbow: 3.1.0
|
||||
|
||||
'@vitest/mocker@4.1.8(vite@8.0.16(@types/node@22.19.20)(esbuild@0.28.1))':
|
||||
'@vitest/mocker@4.1.11(vite@8.0.16(@types/node@22.19.20)(esbuild@0.28.1))':
|
||||
dependencies:
|
||||
'@vitest/spy': 4.1.8
|
||||
'@vitest/spy': 4.1.11
|
||||
estree-walker: 3.0.3
|
||||
magic-string: 0.30.21
|
||||
optionalDependencies:
|
||||
vite: 8.0.16(@types/node@22.19.20)(esbuild@0.28.1)
|
||||
|
||||
'@vitest/pretty-format@4.1.8':
|
||||
'@vitest/pretty-format@4.1.11':
|
||||
dependencies:
|
||||
tinyrainbow: 3.1.0
|
||||
|
||||
'@vitest/runner@4.1.8':
|
||||
'@vitest/runner@4.1.11':
|
||||
dependencies:
|
||||
'@vitest/utils': 4.1.8
|
||||
'@vitest/utils': 4.1.11
|
||||
pathe: 2.0.3
|
||||
|
||||
'@vitest/snapshot@4.1.8':
|
||||
'@vitest/snapshot@4.1.11':
|
||||
dependencies:
|
||||
'@vitest/pretty-format': 4.1.8
|
||||
'@vitest/utils': 4.1.8
|
||||
'@vitest/pretty-format': 4.1.11
|
||||
'@vitest/utils': 4.1.11
|
||||
magic-string: 0.30.21
|
||||
pathe: 2.0.3
|
||||
|
||||
'@vitest/spy@4.1.8': {}
|
||||
'@vitest/spy@4.1.11': {}
|
||||
|
||||
'@vitest/utils@4.1.8':
|
||||
'@vitest/utils@4.1.11':
|
||||
dependencies:
|
||||
'@vitest/pretty-format': 4.1.8
|
||||
'@vitest/pretty-format': 4.1.11
|
||||
convert-source-map: 2.0.0
|
||||
tinyrainbow: 3.1.0
|
||||
|
||||
@@ -4141,15 +4141,15 @@ snapshots:
|
||||
esbuild: 0.28.1
|
||||
fsevents: 2.3.3
|
||||
|
||||
vitest@4.1.8(@types/node@22.19.20)(@vitest/coverage-v8@4.1.8)(vite@8.0.16(@types/node@22.19.20)(esbuild@0.28.1)):
|
||||
vitest@4.1.11(@types/node@22.19.20)(@vitest/coverage-v8@4.1.11)(vite@8.0.16(@types/node@22.19.20)(esbuild@0.28.1)):
|
||||
dependencies:
|
||||
'@vitest/expect': 4.1.8
|
||||
'@vitest/mocker': 4.1.8(vite@8.0.16(@types/node@22.19.20)(esbuild@0.28.1))
|
||||
'@vitest/pretty-format': 4.1.8
|
||||
'@vitest/runner': 4.1.8
|
||||
'@vitest/snapshot': 4.1.8
|
||||
'@vitest/spy': 4.1.8
|
||||
'@vitest/utils': 4.1.8
|
||||
'@vitest/expect': 4.1.11
|
||||
'@vitest/mocker': 4.1.11(vite@8.0.16(@types/node@22.19.20)(esbuild@0.28.1))
|
||||
'@vitest/pretty-format': 4.1.11
|
||||
'@vitest/runner': 4.1.11
|
||||
'@vitest/snapshot': 4.1.11
|
||||
'@vitest/spy': 4.1.11
|
||||
'@vitest/utils': 4.1.11
|
||||
es-module-lexer: 2.1.0
|
||||
expect-type: 1.3.0
|
||||
magic-string: 0.30.21
|
||||
@@ -4165,7 +4165,7 @@ snapshots:
|
||||
why-is-node-running: 2.3.0
|
||||
optionalDependencies:
|
||||
'@types/node': 22.19.20
|
||||
'@vitest/coverage-v8': 4.1.8(vitest@4.1.8)
|
||||
'@vitest/coverage-v8': 4.1.11(vitest@4.1.11)
|
||||
transitivePeerDependencies:
|
||||
- msw
|
||||
|
||||
|
||||
@@ -4,15 +4,17 @@ Persistent memory for [OpenCode](https://opencode.ai). Your agent remembers deci
|
||||
|
||||
Current package version: `0.3.0`. This native TypeScript integration keeps its own tools and scopes while sharing redaction and lifecycle utilities with [agent-plugin-core](../agent-plugin-core/README.md).
|
||||
|
||||
Sidekick is available only in the [Claude Code plugin](../claude-code-plugin/README.md#sonnet-sidekick-agent).
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
opencode plugin @mem0/opencode-plugin
|
||||
```
|
||||
|
||||
This adds the plugin to your `~/.config/opencode/opencode.json`. The plugin registers its memory tools and skills itself — there is no MCP server to configure.
|
||||
This adds the plugin to your `~/.config/opencode/opencode.json`. The plugin registers its memory tools and skills. No MCP server configuration is needed.
|
||||
|
||||
**Or let your agent do it** — paste this into OpenCode:
|
||||
**Or let your agent do it**: paste this into OpenCode:
|
||||
|
||||
```
|
||||
Install @mem0/opencode-plugin by following https://raw.githubusercontent.com/mem0ai/mem0/main/integrations/opencode-plugin/README.md
|
||||
@@ -30,17 +32,17 @@ Restart OpenCode.
|
||||
|
||||
| Component | Description |
|
||||
|-----------|-------------|
|
||||
| **10 Native Memory Tools** | `add_memory`, `search_memories`, `get_memories`, `update_memory`, `delete_memory`, and more — registered as OpenCode tools, backed by the `mem0ai` SDK (no MCP server required) |
|
||||
| **10 Native Memory Tools** | `add_memory`, `search_memories`, `get_memories`, `update_memory`, `delete_memory`, and more, backed by the `mem0ai` SDK |
|
||||
| **Lifecycle Hooks** | Auto-search on session start and every prompt, error memory lookup, compaction context, secret redaction |
|
||||
| **7 Skills** | `/mem0-remember`, `/mem0-tour`, `/mem0-search`, `/mem0-status`, `/mem0-scope`, `/mem0-forget`, `/mem0-context-loader` — discovered in place from the plugin via OpenCode's `skills.paths` |
|
||||
| **7 Skills** | `/mem0-remember`, `/mem0-tour`, `/mem0-search`, `/mem0-status`, `/mem0-scope`, `/mem0-forget`, `/mem0-context-loader`. Discovered through OpenCode's `skills.paths` |
|
||||
|
||||
## Hooks
|
||||
|
||||
Pure TypeScript — no Python, no shell scripts. Memory operations are native OpenCode tools backed by the [mem0ai](https://www.npmjs.com/package/mem0ai) SDK directly.
|
||||
Written in TypeScript. Memory operations are native OpenCode tools backed by the [mem0ai](https://www.npmjs.com/package/mem0ai) SDK directly.
|
||||
|
||||
| Hook | Event | What it does |
|
||||
|------|-------|-------------|
|
||||
| **Config** | `config` | Registers the `/mem0-*` slash commands (via `config.command`) and adds the plugin's own `opencode-skills/` dir to OpenCode's `skills.paths` for in-place skill discovery — no copying into `~/.config/opencode/skills` |
|
||||
| **Config** | `config` | Registers the `/mem0-*` slash commands (via `config.command`) and adds the plugin's own `opencode-skills/` dir to OpenCode's `skills.paths` for skill discovery without copying files |
|
||||
| **Chat message** | `chat.message` | Loads prior memories on session start, searches relevant memories before each prompt, auto-captures learnings periodically |
|
||||
| **Pre-tool** | `tool.execute.before` | Blocks MEMORY.md writes, steering them to the `add_memory` tool |
|
||||
| **Post-tool** | `tool.execute.after` | Scans bash errors and pre-fetches related memories |
|
||||
@@ -81,7 +83,7 @@ scope (used when none is passed) with the `/mem0-scope` skill:
|
||||
```
|
||||
|
||||
The default persists in `~/.mem0/settings.json` (`default_scope`) and is read
|
||||
fresh on each memory operation, so a change applies immediately — no restart.
|
||||
fresh on each memory operation, so changes apply without a restart.
|
||||
`delete_all_memories` always requires an explicit `scope="global"` to delete
|
||||
user-wide, so changing the default can't trigger a cross-project wipe.
|
||||
|
||||
|
||||
@@ -6,15 +6,17 @@ This extension gives Pi Agent long-term memory that persists across sessions, pr
|
||||
|
||||
Current package version: `0.3.0`. Shared redaction and lifecycle utilities come from [agent-plugin-core](../agent-plugin-core/README.md); Pi keeps its own tools and scopes.
|
||||
|
||||
Sidekick is available only in the [Claude Code plugin](../claude-code-plugin/README.md#sonnet-sidekick-agent).
|
||||
|
||||
## Features
|
||||
|
||||
- **Automatic memory capture** — learns from every conversation (both user and assistant messages)
|
||||
- **Semantic search** — find memories by meaning, not just keywords
|
||||
- **Scoped memory** — project, session, or global scope
|
||||
- **Monorepo-aware** — uses git root for project detection, consistent app_id across subdirectories
|
||||
- **Confirmation dialogs** — destructive commands ask before acting
|
||||
- **6 slash commands** — essential memory management from the command line
|
||||
- **Agent tool** — `mem0_memory` tool lets the agent search and store memories autonomously
|
||||
- **Automatic memory capture**: learns from every conversation (both user and assistant messages)
|
||||
- **Semantic search**: find memories by meaning, not just keywords
|
||||
- **Scoped memory**: project, session, or global scope
|
||||
- **Monorepo-aware**: uses git root for project detection, consistent app_id across subdirectories
|
||||
- **Confirmation dialogs**: destructive commands ask before acting
|
||||
- **6 slash commands**: essential memory management from the command line
|
||||
- **Agent tool**: `mem0_memory` tool lets the agent search and store memories autonomously
|
||||
|
||||
## Setup
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
"tsup": "^8.5.0",
|
||||
"typebox": "^1.2.3",
|
||||
"typescript": "^6.0.3",
|
||||
"vitest": "^4.1.7"
|
||||
"vitest": "^4.1.11"
|
||||
},
|
||||
"dependencies": {
|
||||
"mem0ai": "^3.0.7"
|
||||
|
||||
+46
-46
@@ -43,8 +43,8 @@ importers:
|
||||
specifier: ^6.0.3
|
||||
version: 6.0.3
|
||||
vitest:
|
||||
specifier: ^4.1.7
|
||||
version: 4.1.8(@types/node@25.9.2)(vite@8.0.16(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(yaml@2.9.0))
|
||||
specifier: ^4.1.11
|
||||
version: 4.1.11(@types/node@25.9.2)(vite@8.0.16(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(yaml@2.9.0))
|
||||
|
||||
packages:
|
||||
|
||||
@@ -985,11 +985,11 @@ packages:
|
||||
resolution: {integrity: sha512-jIXhD0eWQ1JA6ln/5Dltyx22UxWNrw0hZmhy2rlv6m6KgF7kplHx3g0fzi09lNmTJQRR91OlemYp3xFnvDK9og==}
|
||||
engines: {node: '>=20.0.0'}
|
||||
|
||||
'@vitest/expect@4.1.8':
|
||||
resolution: {integrity: sha512-h3nDO677RDLEGlBxyQ5CW8RlMThSKSRLUePLOx09gNIWRL40edgA1GCZSZgf1W55MFAG6/Sw14KeaAnqv0NKdQ==}
|
||||
'@vitest/expect@4.1.11':
|
||||
resolution: {integrity: sha512-VX2x5vNJXET47KAFzwERI+KRMtTTCSWTfSMKsW7JsUsXV4psq++e3DvZpuTDOpHcxytiDs6p2nhVb2tVDiiUYw==}
|
||||
|
||||
'@vitest/mocker@4.1.8':
|
||||
resolution: {integrity: sha512-LEiN/xe4OSIbKe9HQIp5OC24agGD9J5CnmMgsLohVVoOPWL9a2sBoR6VBx43jQZb7Kr1l4RCuyCJzcAa0+dojw==}
|
||||
'@vitest/mocker@4.1.11':
|
||||
resolution: {integrity: sha512-2XJVD55d1o5AZous5CCGKS74g/riOj9odEt2bQpCVZeblHyHdnMeFl4jl0XjU21stf4mbjUkew2eXQZt65g5CQ==}
|
||||
peerDependencies:
|
||||
msw: ^2.4.9
|
||||
vite: ^6.0.0 || ^7.0.0 || ^8.0.0
|
||||
@@ -999,20 +999,20 @@ packages:
|
||||
vite:
|
||||
optional: true
|
||||
|
||||
'@vitest/pretty-format@4.1.8':
|
||||
resolution: {integrity: sha512-9GasEBxpZ1VYIpqHf/0+YGg121uSNwCKOJqIrTwWP/TB7DmFCiaBpNl3aPZzoLWfWkuqhbH8vJIVobZkvdo2cA==}
|
||||
'@vitest/pretty-format@4.1.11':
|
||||
resolution: {integrity: sha512-yiZzPbGTS9Sr/JpFl8zHrcIkAofNbFV6k21vIgQN/cY/oxZeXhJv5sc/MBJ5jFKWmWs+oJHw0UXLZjmf931+Vw==}
|
||||
|
||||
'@vitest/runner@4.1.8':
|
||||
resolution: {integrity: sha512-EmVxeBAfMJvycdjd6Hm+RbFBbA9fKvo0Kx37hNpBYoYeavH3RNsBXWDooR1mgD52dCrxIIuP7UotpfiwOikvcg==}
|
||||
'@vitest/runner@4.1.11':
|
||||
resolution: {integrity: sha512-LztvUgdwMNJMIkj3hQnnxiC2Xy1zNxq928W/xhjCLaNCzqTZOudjwbQf6v9IntZGPw132i2Lq2rgTRZHD3JHNw==}
|
||||
|
||||
'@vitest/snapshot@4.1.8':
|
||||
resolution: {integrity: sha512-acfZboRmAIf05DEKcBQy33VXojFJjtUdLyo7oOmV9kebb2xdU01UknNiPuPZoJZQyO7DF0gZdTGTpeAzET9QPQ==}
|
||||
'@vitest/snapshot@4.1.11':
|
||||
resolution: {integrity: sha512-pN7ikn1ON7h8ee4gIAp4AzyK+zBtJPzVbqOgu5LCEh4VaJVbPQcgYQYJIMGQPXVeJJq1fnfazis7a5pFNPahog==}
|
||||
|
||||
'@vitest/spy@4.1.8':
|
||||
resolution: {integrity: sha512-6EevtBp6OZOPF7bmz36HrGMeP3txgVSrgebWxHOafDXGkhIzfXK14f8KF6MuFfgXXUeHxmpD3BQxkV00/3s5mA==}
|
||||
'@vitest/spy@4.1.11':
|
||||
resolution: {integrity: sha512-apNa/prQy2qCeywhnixOHPRCgGNhvg7T4Dapfl1GahLp/R+uhBm5cPyFoNVyqsNd2h1nJxL6BqqdIjiABL60YA==}
|
||||
|
||||
'@vitest/utils@4.1.8':
|
||||
resolution: {integrity: sha512-uOJamYALNhfJ6iolExyQM40yIQwDqYnkKtQ5VCiSe17E33H0aQ/u+1GlRuz4LZBk6Mm3sg90G9hEbmEt37C1Zg==}
|
||||
'@vitest/utils@4.1.11':
|
||||
resolution: {integrity: sha512-zTCVGpyFsGWBhllOyKlTw/vnr6D9qxsfSDyfbyZmTyjHw5N/VuvzHpHoQjm2ZJzn4RJgx5w4r7V0er69CmLgPQ==}
|
||||
|
||||
abort-controller@3.0.0:
|
||||
resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==}
|
||||
@@ -2416,20 +2416,20 @@ packages:
|
||||
yaml:
|
||||
optional: true
|
||||
|
||||
vitest@4.1.8:
|
||||
resolution: {integrity: sha512-flY6ScbCIt9HThs+C5HS7jvGOB560DJtk/Z15IQROTA6zEy49Nh8T/dofWTQL+n3vswqn87sbJNiuqw1SDp5Ig==}
|
||||
vitest@4.1.11:
|
||||
resolution: {integrity: sha512-fhACrNXUidIbGSBr5FlbuBkO7VWC1ZyLl0DO4CU2DrQoAPxX84Ysxs+HeGQpii5lZWV1Q4gBZTTu49mF+A6Edw==}
|
||||
engines: {node: ^20.0.0 || ^22.0.0 || >=24.0.0}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
'@edge-runtime/vm': '*'
|
||||
'@opentelemetry/api': ^1.9.0
|
||||
'@types/node': ^20.0.0 || ^22.0.0 || >=24.0.0
|
||||
'@vitest/browser-playwright': 4.1.8
|
||||
'@vitest/browser-preview': 4.1.8
|
||||
'@vitest/browser-webdriverio': 4.1.8
|
||||
'@vitest/coverage-istanbul': 4.1.8
|
||||
'@vitest/coverage-v8': 4.1.8
|
||||
'@vitest/ui': 4.1.8
|
||||
'@vitest/browser-playwright': 4.1.11
|
||||
'@vitest/browser-preview': 4.1.11
|
||||
'@vitest/browser-webdriverio': 4.1.11
|
||||
'@vitest/coverage-istanbul': 4.1.11
|
||||
'@vitest/coverage-v8': 4.1.11
|
||||
'@vitest/ui': 4.1.11
|
||||
happy-dom: '*'
|
||||
jsdom: '*'
|
||||
vite: ^6.0.0 || ^7.0.0 || ^8.0.0
|
||||
@@ -3517,44 +3517,44 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@vitest/expect@4.1.8':
|
||||
'@vitest/expect@4.1.11':
|
||||
dependencies:
|
||||
'@standard-schema/spec': 1.1.0
|
||||
'@types/chai': 5.2.3
|
||||
'@vitest/spy': 4.1.8
|
||||
'@vitest/utils': 4.1.8
|
||||
'@vitest/spy': 4.1.11
|
||||
'@vitest/utils': 4.1.11
|
||||
chai: 6.2.2
|
||||
tinyrainbow: 3.1.0
|
||||
|
||||
'@vitest/mocker@4.1.8(vite@8.0.16(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(yaml@2.9.0))':
|
||||
'@vitest/mocker@4.1.11(vite@8.0.16(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(yaml@2.9.0))':
|
||||
dependencies:
|
||||
'@vitest/spy': 4.1.8
|
||||
'@vitest/spy': 4.1.11
|
||||
estree-walker: 3.0.3
|
||||
magic-string: 0.30.21
|
||||
optionalDependencies:
|
||||
vite: 8.0.16(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(yaml@2.9.0)
|
||||
|
||||
'@vitest/pretty-format@4.1.8':
|
||||
'@vitest/pretty-format@4.1.11':
|
||||
dependencies:
|
||||
tinyrainbow: 3.1.0
|
||||
|
||||
'@vitest/runner@4.1.8':
|
||||
'@vitest/runner@4.1.11':
|
||||
dependencies:
|
||||
'@vitest/utils': 4.1.8
|
||||
'@vitest/utils': 4.1.11
|
||||
pathe: 2.0.3
|
||||
|
||||
'@vitest/snapshot@4.1.8':
|
||||
'@vitest/snapshot@4.1.11':
|
||||
dependencies:
|
||||
'@vitest/pretty-format': 4.1.8
|
||||
'@vitest/utils': 4.1.8
|
||||
'@vitest/pretty-format': 4.1.11
|
||||
'@vitest/utils': 4.1.11
|
||||
magic-string: 0.30.21
|
||||
pathe: 2.0.3
|
||||
|
||||
'@vitest/spy@4.1.8': {}
|
||||
'@vitest/spy@4.1.11': {}
|
||||
|
||||
'@vitest/utils@4.1.8':
|
||||
'@vitest/utils@4.1.11':
|
||||
dependencies:
|
||||
'@vitest/pretty-format': 4.1.8
|
||||
'@vitest/pretty-format': 4.1.11
|
||||
convert-source-map: 2.0.0
|
||||
tinyrainbow: 3.1.0
|
||||
|
||||
@@ -4919,15 +4919,15 @@ snapshots:
|
||||
jiti: 2.7.0
|
||||
yaml: 2.9.0
|
||||
|
||||
vitest@4.1.8(@types/node@25.9.2)(vite@8.0.16(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(yaml@2.9.0)):
|
||||
vitest@4.1.11(@types/node@25.9.2)(vite@8.0.16(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(yaml@2.9.0)):
|
||||
dependencies:
|
||||
'@vitest/expect': 4.1.8
|
||||
'@vitest/mocker': 4.1.8(vite@8.0.16(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(yaml@2.9.0))
|
||||
'@vitest/pretty-format': 4.1.8
|
||||
'@vitest/runner': 4.1.8
|
||||
'@vitest/snapshot': 4.1.8
|
||||
'@vitest/spy': 4.1.8
|
||||
'@vitest/utils': 4.1.8
|
||||
'@vitest/expect': 4.1.11
|
||||
'@vitest/mocker': 4.1.11(vite@8.0.16(@types/node@25.9.2)(esbuild@0.28.1)(jiti@2.7.0)(yaml@2.9.0))
|
||||
'@vitest/pretty-format': 4.1.11
|
||||
'@vitest/runner': 4.1.11
|
||||
'@vitest/snapshot': 4.1.11
|
||||
'@vitest/spy': 4.1.11
|
||||
'@vitest/utils': 4.1.11
|
||||
es-module-lexer: 2.1.0
|
||||
expect-type: 1.3.0
|
||||
magic-string: 0.30.21
|
||||
|
||||
@@ -89,7 +89,8 @@
|
||||
"brace-expansion@<1.1.16": ">=1.1.16 <2.0.0",
|
||||
"brace-expansion@>=3.0.0 <5.0.8": ">=5.0.8 <6.0.0",
|
||||
"js-yaml@<3.15.1": ">=3.15.1 <4.0.0",
|
||||
"js-yaml@>=4.0.0 <4.3.1": ">=4.3.1 <5.0.0"
|
||||
"js-yaml@>=4.0.0 <4.3.1": ">=4.3.1 <5.0.0",
|
||||
"browserslist@<4.28.7": ">=4.28.7 <5.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+27
-26
@@ -16,6 +16,7 @@ overrides:
|
||||
brace-expansion@>=3.0.0 <5.0.8: '>=5.0.8 <6.0.0'
|
||||
js-yaml@<3.15.1: '>=3.15.1 <4.0.0'
|
||||
js-yaml@>=4.0.0 <4.3.1: '>=4.3.1 <5.0.0'
|
||||
browserslist@<4.28.7: '>=4.28.7 <5.0.0'
|
||||
|
||||
importers:
|
||||
|
||||
@@ -832,8 +833,8 @@ packages:
|
||||
resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==}
|
||||
engines: {node: 18 || 20 || >=22}
|
||||
|
||||
baseline-browser-mapping@2.10.35:
|
||||
resolution: {integrity: sha512-honAfLBde0HAFLdNyBEfuuENkF6zR+ozxqxa/2zJKHBe1qzLqyTSeRKpdPEHAP03rlDGyQOPnCSxnVpVqQo9Mg==}
|
||||
baseline-browser-mapping@2.11.21:
|
||||
resolution: {integrity: sha512-uh8vpY/1/YyFkunIDFH/12p7/7VdPKA1hejMVEbdkEaWnUz0Hesvx5EbiU6XxjyHZIOju+ZMbQJkRh+es3/spQ==}
|
||||
engines: {node: '>=6.0.0'}
|
||||
hasBin: true
|
||||
|
||||
@@ -852,8 +853,8 @@ packages:
|
||||
resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
browserslist@4.28.2:
|
||||
resolution: {integrity: sha512-48xSriZYYg+8qXna9kwqjIVzuQxi+KYWp2+5nCYnYKPTr0LvD89Jqk2Or5ogxz0NUMfIjhh2lIUX/LyX9B4oIg==}
|
||||
browserslist@4.28.9:
|
||||
resolution: {integrity: sha512-EWazOblFYUvlGZcfGhPUPmYh3nikUxBVb+y9MJun5f3hBi812X+8MSQTujLBtgK3cf51fJWbWfOjyeO954d+Eg==}
|
||||
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
|
||||
hasBin: true
|
||||
|
||||
@@ -889,8 +890,8 @@ packages:
|
||||
resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==}
|
||||
engines: {node: '>=10'}
|
||||
|
||||
caniuse-lite@1.0.30001797:
|
||||
resolution: {integrity: sha512-l8xKG+gwAIExZGl9FrF7KUwuOmk6wbEPC9Xoy/RtnWv1XG0Q4LFlagaLpUv3Kiza3W/wm27zy0yWJEieYKAP6w==}
|
||||
caniuse-lite@1.0.30001810:
|
||||
resolution: {integrity: sha512-TITQPUkaz+aVk5GL6NhOdwk1aEaNTSDPsGFWrTuhKGtjTF70jL/Oht2W4c6rXUe5fu7Ie19VIahAXHIIiWWNeg==}
|
||||
|
||||
chalk@4.1.2:
|
||||
resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==}
|
||||
@@ -999,8 +1000,8 @@ packages:
|
||||
resolution: {integrity: sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
electron-to-chromium@1.5.371:
|
||||
resolution: {integrity: sha512-e9htk9mAYL6AzmkEhSvVVw7IWGSBJ/Bqdn2eRyRLrj1g6sncN4WbFt5qnILYoCktktr45pyjIrOiRvBThQ808w==}
|
||||
electron-to-chromium@1.5.426:
|
||||
resolution: {integrity: sha512-2Gcq6inCQs/AqfHP3f5ftCzk+pqeW2VlA1LgmPqEj2hfBO8HiZRspNYkD4HzFBe4u6lGqca4BspFr6Ix4Q400g==}
|
||||
|
||||
emittery@0.13.1:
|
||||
resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==}
|
||||
@@ -1456,8 +1457,8 @@ packages:
|
||||
node-int64@0.4.0:
|
||||
resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==}
|
||||
|
||||
node-releases@2.0.47:
|
||||
resolution: {integrity: sha512-Uzmd6LXpouKo8EUK68IjH4+E01w/hXyV3R3g/geCJo+rXLNfh1xucB+LOzYEOQPSiUK3h/xZf0cQGcSsmyL2Og==}
|
||||
node-releases@2.0.55:
|
||||
resolution: {integrity: sha512-mIrE/Cw9y+9Au6dS5vDKDhQza9YvG6w+ZrS6X+ZzA7yFW/soAeaups4Qzn1bL6g5FVy8WtP79+0j82oPIbqRjQ==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
nodemon@3.1.14:
|
||||
@@ -1837,11 +1838,11 @@ packages:
|
||||
undici-types@5.26.5:
|
||||
resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==}
|
||||
|
||||
update-browserslist-db@1.2.3:
|
||||
resolution: {integrity: sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==}
|
||||
update-browserslist-db@1.3.2:
|
||||
resolution: {integrity: sha512-UQ+MSxlhRm1bzjhU+DcuXfjFO1FzNtqhK5+9Yvlp90ItDLk5vT932A0rFu619nf7RVS+Y/VeaUW1jaRDqZ8VJw==}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
browserslist: '>= 4.21.0'
|
||||
browserslist: '>=4.28.7 <5.0.0'
|
||||
|
||||
v8-compile-cache-lib@3.0.1:
|
||||
resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==}
|
||||
@@ -1988,7 +1989,7 @@ snapshots:
|
||||
dependencies:
|
||||
'@babel/compat-data': 7.29.7
|
||||
'@babel/helper-validator-option': 7.29.7
|
||||
browserslist: 4.28.2
|
||||
browserslist: 4.28.9
|
||||
lru-cache: 5.1.1
|
||||
semver: 6.3.1
|
||||
|
||||
@@ -2672,7 +2673,7 @@ snapshots:
|
||||
|
||||
balanced-match@4.0.4: {}
|
||||
|
||||
baseline-browser-mapping@2.10.35: {}
|
||||
baseline-browser-mapping@2.11.21: {}
|
||||
|
||||
binary-extensions@2.3.0: {}
|
||||
|
||||
@@ -2689,13 +2690,13 @@ snapshots:
|
||||
dependencies:
|
||||
fill-range: 7.1.1
|
||||
|
||||
browserslist@4.28.2:
|
||||
browserslist@4.28.9:
|
||||
dependencies:
|
||||
baseline-browser-mapping: 2.10.35
|
||||
caniuse-lite: 1.0.30001797
|
||||
electron-to-chromium: 1.5.371
|
||||
node-releases: 2.0.47
|
||||
update-browserslist-db: 1.2.3(browserslist@4.28.2)
|
||||
baseline-browser-mapping: 2.11.21
|
||||
caniuse-lite: 1.0.30001810
|
||||
electron-to-chromium: 1.5.426
|
||||
node-releases: 2.0.55
|
||||
update-browserslist-db: 1.3.2(browserslist@4.28.9)
|
||||
|
||||
bs-logger@0.2.6:
|
||||
dependencies:
|
||||
@@ -2720,7 +2721,7 @@ snapshots:
|
||||
|
||||
camelcase@6.3.0: {}
|
||||
|
||||
caniuse-lite@1.0.30001797: {}
|
||||
caniuse-lite@1.0.30001810: {}
|
||||
|
||||
chalk@4.1.2:
|
||||
dependencies:
|
||||
@@ -2816,7 +2817,7 @@ snapshots:
|
||||
|
||||
dotenv@16.6.1: {}
|
||||
|
||||
electron-to-chromium@1.5.371: {}
|
||||
electron-to-chromium@1.5.426: {}
|
||||
|
||||
emittery@0.13.1: {}
|
||||
|
||||
@@ -3446,7 +3447,7 @@ snapshots:
|
||||
|
||||
node-int64@0.4.0: {}
|
||||
|
||||
node-releases@2.0.47: {}
|
||||
node-releases@2.0.55: {}
|
||||
|
||||
nodemon@3.1.14:
|
||||
dependencies:
|
||||
@@ -3799,9 +3800,9 @@ snapshots:
|
||||
|
||||
undici-types@5.26.5: {}
|
||||
|
||||
update-browserslist-db@1.2.3(browserslist@4.28.2):
|
||||
update-browserslist-db@1.3.2(browserslist@4.28.9):
|
||||
dependencies:
|
||||
browserslist: 4.28.2
|
||||
browserslist: 4.28.9
|
||||
escalade: 3.2.0
|
||||
picocolors: 1.1.1
|
||||
|
||||
|
||||
@@ -17,3 +17,4 @@ overrides:
|
||||
"brace-expansion@>=3.0.0 <5.0.8": ">=5.0.8 <6.0.0"
|
||||
"js-yaml@<3.15.1": ">=3.15.1 <4.0.0"
|
||||
"js-yaml@>=4.0.0 <4.3.1": ">=4.3.1 <5.0.0"
|
||||
"browserslist@<4.28.7": ">=4.28.7 <5.0.0"
|
||||
|
||||
@@ -306,7 +306,9 @@
|
||||
"thrift@<0.23.0": "^0.23.0",
|
||||
"mongoose@>=9.0.0 <9.7.2": ">=9.7.2 <10.0.0",
|
||||
"protobufjs@<7.6.5": ">=7.6.5 <8.0.0",
|
||||
"ip-address@<10.3.1": ">=10.3.1 <11.0.0"
|
||||
"ip-address@<10.3.1": ">=10.3.1 <11.0.0",
|
||||
"browserslist@<4.28.7": ">=4.28.7 <5.0.0",
|
||||
"mysql2@<3.23.1": ">=3.23.1 <4.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+37
-36
@@ -40,6 +40,8 @@ overrides:
|
||||
mongoose@>=9.0.0 <9.7.2: '>=9.7.2 <10.0.0'
|
||||
protobufjs@<7.6.5: '>=7.6.5 <8.0.0'
|
||||
ip-address@<10.3.1: '>=10.3.1 <11.0.0'
|
||||
browserslist@<4.28.7: '>=4.28.7 <5.0.0'
|
||||
mysql2@<3.23.1: '>=3.23.1 <4.0.0'
|
||||
|
||||
patchedDependencies:
|
||||
tar@7.5.22:
|
||||
@@ -150,8 +152,8 @@ importers:
|
||||
specifier: ^7.0.0
|
||||
version: 7.2.0(socks@2.8.9)
|
||||
mysql2:
|
||||
specifier: ^3.0.0
|
||||
version: 3.22.5(@types/node@22.19.21)
|
||||
specifier: '>=3.23.1 <4.0.0'
|
||||
version: 3.24.4(@types/node@22.19.21)
|
||||
natural:
|
||||
specifier: ^8.0.1
|
||||
version: 8.1.1(@opentelemetry/api@1.9.1)(socks@2.8.9)
|
||||
@@ -2146,8 +2148,8 @@ packages:
|
||||
base64-js@1.5.1:
|
||||
resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==}
|
||||
|
||||
baseline-browser-mapping@2.10.35:
|
||||
resolution: {integrity: sha512-honAfLBde0HAFLdNyBEfuuENkF6zR+ozxqxa/2zJKHBe1qzLqyTSeRKpdPEHAP03rlDGyQOPnCSxnVpVqQo9Mg==}
|
||||
baseline-browser-mapping@2.11.21:
|
||||
resolution: {integrity: sha512-uh8vpY/1/YyFkunIDFH/12p7/7VdPKA1hejMVEbdkEaWnUz0Hesvx5EbiU6XxjyHZIOju+ZMbQJkRh+es3/spQ==}
|
||||
engines: {node: '>=6.0.0'}
|
||||
hasBin: true
|
||||
|
||||
@@ -2200,8 +2202,8 @@ packages:
|
||||
browser-or-node@1.3.0:
|
||||
resolution: {integrity: sha512-0F2z/VSnLbmEeBcUrSuDH5l0HxTXdQQzLjkmBR4cYfvg1zJrKSlmIZFqyFR8oX0NrwPhy3c3HQ6i3OxMbew4Tg==}
|
||||
|
||||
browserslist@4.28.2:
|
||||
resolution: {integrity: sha512-48xSriZYYg+8qXna9kwqjIVzuQxi+KYWp2+5nCYnYKPTr0LvD89Jqk2Or5ogxz0NUMfIjhh2lIUX/LyX9B4oIg==}
|
||||
browserslist@4.28.9:
|
||||
resolution: {integrity: sha512-EWazOblFYUvlGZcfGhPUPmYh3nikUxBVb+y9MJun5f3hBi812X+8MSQTujLBtgK3cf51fJWbWfOjyeO954d+Eg==}
|
||||
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
|
||||
hasBin: true
|
||||
|
||||
@@ -2266,8 +2268,8 @@ packages:
|
||||
resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==}
|
||||
engines: {node: '>=10'}
|
||||
|
||||
caniuse-lite@1.0.30001799:
|
||||
resolution: {integrity: sha512-hG1bReV+OUU+MOqK4t/ZWI0tZOyz3rqS9XuhOUz1cIcbwBKjOyJEJuw9ER5JuNyqxNk8u/JUVbGibBOL1yrjFw==}
|
||||
caniuse-lite@1.0.30001810:
|
||||
resolution: {integrity: sha512-TITQPUkaz+aVk5GL6NhOdwk1aEaNTSDPsGFWrTuhKGtjTF70jL/Oht2W4c6rXUe5fu7Ie19VIahAXHIIiWWNeg==}
|
||||
|
||||
cassandra-driver@4.8.0:
|
||||
resolution: {integrity: sha512-HritfMGq9V7SuESeSodHvArs0mLuMk7uh+7hQK2lqdvXrvm50aWxb4RPxkK3mPDdsgHjJ427xNRFITMH2ei+Sw==}
|
||||
@@ -2593,8 +2595,8 @@ packages:
|
||||
resolution: {integrity: sha512-/RInbCy1d4P6Zdfa+TMVsf/ufZVotat5hCw3QXmWtjU+3pFEOvOQ7ibo3aIxyCJw2leIeAMjmPj+1SLJiCpdrQ==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
|
||||
electron-to-chromium@1.5.371:
|
||||
resolution: {integrity: sha512-e9htk9mAYL6AzmkEhSvVVw7IWGSBJ/Bqdn2eRyRLrj1g6sncN4WbFt5qnILYoCktktr45pyjIrOiRvBThQ808w==}
|
||||
electron-to-chromium@1.5.426:
|
||||
resolution: {integrity: sha512-2Gcq6inCQs/AqfHP3f5ftCzk+pqeW2VlA1LgmPqEj2hfBO8HiZRspNYkD4HzFBe4u6lGqca4BspFr6Ix4Q400g==}
|
||||
|
||||
emittery@0.13.1:
|
||||
resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==}
|
||||
@@ -3630,8 +3632,8 @@ packages:
|
||||
resolution: {integrity: sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==}
|
||||
hasBin: true
|
||||
|
||||
mysql2@3.22.5:
|
||||
resolution: {integrity: sha512-95uZ2TrPWAZdwpB3vvvDbmEMcNG8yIeNCyu6GUcr/QnWEE/wXm7+mhOCsdQfWQDTV7qYT/PDUZ4U4UPP4AsXqQ==}
|
||||
mysql2@3.24.4:
|
||||
resolution: {integrity: sha512-A2olluVlj0mvgyIRRISMEzXc51m+21mRtcMVjJyIpt2GG98+XrC9m9HzsqcMsX2LcnfccJvY5NB22g8fENBnOA==}
|
||||
engines: {node: '>= 8.0'}
|
||||
peerDependencies:
|
||||
'@types/node': '>= 8'
|
||||
@@ -3697,8 +3699,8 @@ packages:
|
||||
node-int64@0.4.0:
|
||||
resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==}
|
||||
|
||||
node-releases@2.0.47:
|
||||
resolution: {integrity: sha512-Uzmd6LXpouKo8EUK68IjH4+E01w/hXyV3R3g/geCJo+rXLNfh1xucB+LOzYEOQPSiUK3h/xZf0cQGcSsmyL2Og==}
|
||||
node-releases@2.0.55:
|
||||
resolution: {integrity: sha512-mIrE/Cw9y+9Au6dS5vDKDhQza9YvG6w+ZrS6X+ZzA7yFW/soAeaups4Qzn1bL6g5FVy8WtP79+0j82oPIbqRjQ==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
nodemon@3.1.14:
|
||||
@@ -4318,8 +4320,8 @@ packages:
|
||||
sprintf-js@1.1.3:
|
||||
resolution: {integrity: sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==}
|
||||
|
||||
sql-escaper@1.3.3:
|
||||
resolution: {integrity: sha512-BsTCV265VpTp8tm1wyIm1xqQCS+Q9NHx2Sr+WcnUrgLrQ6yiDIvHYJV5gHxsj1lMBy2zm5twLaZao8Jd+S8JJw==}
|
||||
sql-escaper@1.5.1:
|
||||
resolution: {integrity: sha512-4toX5E1fQbBrpfXidaHnF0669nkAdETeIPTs2SUjxxD7RRIs9ICG4gtpmfc68JCEKehsdwLFqBu9VlQqZ1P1gg==}
|
||||
engines: {bun: '>=1.0.0', deno: '>=2.0.0', node: '>=12.0.0'}
|
||||
|
||||
stack-trace@0.0.10:
|
||||
@@ -4627,11 +4629,11 @@ packages:
|
||||
resolution: {integrity: sha512-IDxfleLmmbSskfWSUATiN1nfn2rDuvnMOqb5CWR92iIfojA0Ud+ulOAAEQ57LPr9rWmsreUyf5lwyao+7GNNVw==}
|
||||
engines: {node: '>=20.18.1'}
|
||||
|
||||
update-browserslist-db@1.2.3:
|
||||
resolution: {integrity: sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==}
|
||||
update-browserslist-db@1.3.2:
|
||||
resolution: {integrity: sha512-UQ+MSxlhRm1bzjhU+DcuXfjFO1FzNtqhK5+9Yvlp90ItDLk5vT932A0rFu619nf7RVS+Y/VeaUW1jaRDqZ8VJw==}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
browserslist: '>= 4.21.0'
|
||||
browserslist: '>=4.28.7 <5.0.0'
|
||||
|
||||
util-deprecate@1.0.2:
|
||||
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
|
||||
@@ -5915,7 +5917,7 @@ snapshots:
|
||||
dependencies:
|
||||
'@babel/compat-data': 7.29.7
|
||||
'@babel/helper-validator-option': 7.29.7
|
||||
browserslist: 4.28.2
|
||||
browserslist: 4.28.9
|
||||
lru-cache: 5.1.1
|
||||
semver: 6.3.1
|
||||
|
||||
@@ -7519,7 +7521,7 @@ snapshots:
|
||||
|
||||
base64-js@1.5.1: {}
|
||||
|
||||
baseline-browser-mapping@2.10.35: {}
|
||||
baseline-browser-mapping@2.11.21: {}
|
||||
|
||||
basic-ftp@5.3.1: {}
|
||||
|
||||
@@ -7567,13 +7569,13 @@ snapshots:
|
||||
|
||||
browser-or-node@1.3.0: {}
|
||||
|
||||
browserslist@4.28.2:
|
||||
browserslist@4.28.9:
|
||||
dependencies:
|
||||
baseline-browser-mapping: 2.10.35
|
||||
caniuse-lite: 1.0.30001799
|
||||
electron-to-chromium: 1.5.371
|
||||
node-releases: 2.0.47
|
||||
update-browserslist-db: 1.2.3(browserslist@4.28.2)
|
||||
baseline-browser-mapping: 2.11.21
|
||||
caniuse-lite: 1.0.30001810
|
||||
electron-to-chromium: 1.5.426
|
||||
node-releases: 2.0.55
|
||||
update-browserslist-db: 1.3.2(browserslist@4.28.9)
|
||||
|
||||
bs-logger@0.2.6:
|
||||
dependencies:
|
||||
@@ -7625,7 +7627,7 @@ snapshots:
|
||||
|
||||
camelcase@6.3.0: {}
|
||||
|
||||
caniuse-lite@1.0.30001799: {}
|
||||
caniuse-lite@1.0.30001810: {}
|
||||
|
||||
cassandra-driver@4.8.0:
|
||||
dependencies:
|
||||
@@ -7929,7 +7931,7 @@ snapshots:
|
||||
|
||||
efrt@2.7.0: {}
|
||||
|
||||
electron-to-chromium@1.5.371: {}
|
||||
electron-to-chromium@1.5.426: {}
|
||||
|
||||
emittery@0.13.1: {}
|
||||
|
||||
@@ -9145,17 +9147,16 @@ snapshots:
|
||||
|
||||
mustache@4.2.0: {}
|
||||
|
||||
mysql2@3.22.5(@types/node@22.19.21):
|
||||
mysql2@3.24.4(@types/node@22.19.21):
|
||||
dependencies:
|
||||
'@types/node': 22.19.21
|
||||
aws-ssl-profiles: 1.1.2
|
||||
denque: 2.1.0
|
||||
generate-function: 2.3.1
|
||||
iconv-lite: 0.7.3
|
||||
long: 5.3.2
|
||||
lru.min: 1.1.4
|
||||
named-placeholders: 1.1.6
|
||||
sql-escaper: 1.3.3
|
||||
sql-escaper: 1.5.1
|
||||
|
||||
mz@2.7.0:
|
||||
dependencies:
|
||||
@@ -9239,7 +9240,7 @@ snapshots:
|
||||
|
||||
node-int64@0.4.0: {}
|
||||
|
||||
node-releases@2.0.47: {}
|
||||
node-releases@2.0.55: {}
|
||||
|
||||
nodemon@3.1.14:
|
||||
dependencies:
|
||||
@@ -9916,7 +9917,7 @@ snapshots:
|
||||
|
||||
sprintf-js@1.1.3: {}
|
||||
|
||||
sql-escaper@1.3.3: {}
|
||||
sql-escaper@1.5.1: {}
|
||||
|
||||
stack-trace@0.0.10: {}
|
||||
|
||||
@@ -10219,9 +10220,9 @@ snapshots:
|
||||
|
||||
undici@7.29.0: {}
|
||||
|
||||
update-browserslist-db@1.2.3(browserslist@4.28.2):
|
||||
update-browserslist-db@1.3.2(browserslist@4.28.9):
|
||||
dependencies:
|
||||
browserslist: 4.28.2
|
||||
browserslist: 4.28.9
|
||||
escalade: 3.2.0
|
||||
picocolors: 1.1.1
|
||||
|
||||
|
||||
@@ -38,6 +38,8 @@ overrides:
|
||||
"mongoose@>=9.0.0 <9.7.2": ">=9.7.2 <10.0.0"
|
||||
"protobufjs@<7.6.5": ">=7.6.5 <8.0.0"
|
||||
"ip-address@<10.3.1": ">=10.3.1 <11.0.0"
|
||||
"browserslist@<4.28.7": ">=4.28.7 <5.0.0"
|
||||
"mysql2@<3.23.1": ">=3.23.1 <4.0.0"
|
||||
|
||||
patchedDependencies:
|
||||
"tar@7.5.22": "patches/tar@7.5.22.patch"
|
||||
|
||||
Generated
+17
-3
@@ -1355,6 +1355,19 @@ docs = ["docutils"]
|
||||
pg = ["PyGreSQL (>=5)"]
|
||||
tests = ["pytest (>=7)", "ruff"]
|
||||
|
||||
[[package]]
|
||||
name = "defusedxml"
|
||||
version = "0.7.1"
|
||||
description = "XML bomb protection for Python stdlib modules"
|
||||
optional = true
|
||||
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
|
||||
groups = ["main"]
|
||||
markers = "extra == \"vector-stores\""
|
||||
files = [
|
||||
{file = "defusedxml-0.7.1-py2.py3-none-any.whl", hash = "sha256:a352e7e428770286cc899e2542b6cdaedb2b4953ff269a210103ec58f6198a61"},
|
||||
{file = "defusedxml-0.7.1.tar.gz", hash = "sha256:1bb3032db185915b62d7c6209c5a8792be6a32ab2fedacc84e01b52c51aa3e69"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "deprecated"
|
||||
version = "1.2.18"
|
||||
@@ -4296,19 +4309,20 @@ test-extras = ["pytest-mpl", "pytest-randomly"]
|
||||
|
||||
[[package]]
|
||||
name = "nltk"
|
||||
version = "3.9.4"
|
||||
version = "3.10.3"
|
||||
description = "Natural Language Toolkit"
|
||||
optional = true
|
||||
python-versions = ">=3.10"
|
||||
groups = ["main"]
|
||||
markers = "extra == \"vector-stores\""
|
||||
files = [
|
||||
{file = "nltk-3.9.4-py3-none-any.whl", hash = "sha256:f2fa301c3a12718ce4a0e9305c5675299da5ad9e26068218b69d692fda84828f"},
|
||||
{file = "nltk-3.9.4.tar.gz", hash = "sha256:ed03bc098a40481310320808b2db712d95d13ca65b27372f8a403949c8b523d0"},
|
||||
{file = "nltk-3.10.3-py3-none-any.whl", hash = "sha256:ff9598a8e20518ee0d557745890cc4435b9578489e2dcbc69c4f81fa060caf7c"},
|
||||
{file = "nltk-3.10.3.tar.gz", hash = "sha256:bb9327a461c3811c2fa4900e03840401f2126adfb30c0072827c433bd2444ea4"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
click = "*"
|
||||
defusedxml = "*"
|
||||
joblib = "*"
|
||||
regex = ">=2021.8.3"
|
||||
tqdm = "*"
|
||||
|
||||
Generated
+29
-23
@@ -16,6 +16,7 @@ overrides:
|
||||
postcss@<8.5.18: '>=8.5.18 <9.0.0'
|
||||
nanoid@<3.3.18: '>=3.3.18 <4.0.0'
|
||||
sharp@<0.35.0: '>=0.35.0 <0.36.0'
|
||||
browserslist@<4.28.7: '>=4.28.7 <5.0.0'
|
||||
|
||||
importers:
|
||||
|
||||
@@ -1507,8 +1508,8 @@ packages:
|
||||
resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==}
|
||||
engines: {node: 18 || 20 || >=22}
|
||||
|
||||
baseline-browser-mapping@2.10.35:
|
||||
resolution: {integrity: sha512-honAfLBde0HAFLdNyBEfuuENkF6zR+ozxqxa/2zJKHBe1qzLqyTSeRKpdPEHAP03rlDGyQOPnCSxnVpVqQo9Mg==}
|
||||
baseline-browser-mapping@2.11.21:
|
||||
resolution: {integrity: sha512-uh8vpY/1/YyFkunIDFH/12p7/7VdPKA1hejMVEbdkEaWnUz0Hesvx5EbiU6XxjyHZIOju+ZMbQJkRh+es3/spQ==}
|
||||
engines: {node: '>=6.0.0'}
|
||||
hasBin: true
|
||||
|
||||
@@ -1527,8 +1528,8 @@ packages:
|
||||
resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
browserslist@4.28.2:
|
||||
resolution: {integrity: sha512-48xSriZYYg+8qXna9kwqjIVzuQxi+KYWp2+5nCYnYKPTr0LvD89Jqk2Or5ogxz0NUMfIjhh2lIUX/LyX9B4oIg==}
|
||||
browserslist@4.28.9:
|
||||
resolution: {integrity: sha512-EWazOblFYUvlGZcfGhPUPmYh3nikUxBVb+y9MJun5f3hBi812X+8MSQTujLBtgK3cf51fJWbWfOjyeO954d+Eg==}
|
||||
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
|
||||
hasBin: true
|
||||
|
||||
@@ -1555,6 +1556,9 @@ packages:
|
||||
caniuse-lite@1.0.30001797:
|
||||
resolution: {integrity: sha512-l8xKG+gwAIExZGl9FrF7KUwuOmk6wbEPC9Xoy/RtnWv1XG0Q4LFlagaLpUv3Kiza3W/wm27zy0yWJEieYKAP6w==}
|
||||
|
||||
caniuse-lite@1.0.30001810:
|
||||
resolution: {integrity: sha512-TITQPUkaz+aVk5GL6NhOdwk1aEaNTSDPsGFWrTuhKGtjTF70jL/Oht2W4c6rXUe5fu7Ie19VIahAXHIIiWWNeg==}
|
||||
|
||||
chalk@4.1.2:
|
||||
resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==}
|
||||
engines: {node: '>=10'}
|
||||
@@ -1749,8 +1753,8 @@ packages:
|
||||
resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
electron-to-chromium@1.5.371:
|
||||
resolution: {integrity: sha512-e9htk9mAYL6AzmkEhSvVVw7IWGSBJ/Bqdn2eRyRLrj1g6sncN4WbFt5qnILYoCktktr45pyjIrOiRvBThQ808w==}
|
||||
electron-to-chromium@1.5.426:
|
||||
resolution: {integrity: sha512-2Gcq6inCQs/AqfHP3f5ftCzk+pqeW2VlA1LgmPqEj2hfBO8HiZRspNYkD4HzFBe4u6lGqca4BspFr6Ix4Q400g==}
|
||||
|
||||
emoji-regex@9.2.2:
|
||||
resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==}
|
||||
@@ -2438,8 +2442,8 @@ packages:
|
||||
resolution: {integrity: sha512-pyFS63ptit/P5WqUkt+UUfe+4oevH+bFeIiPPdfb0pFeYEu/1ELnJu5l+5EcTKYL5M7zaAa7S8ddywgXypqKCw==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
node-releases@2.0.47:
|
||||
resolution: {integrity: sha512-Uzmd6LXpouKo8EUK68IjH4+E01w/hXyV3R3g/geCJo+rXLNfh1xucB+LOzYEOQPSiUK3h/xZf0cQGcSsmyL2Og==}
|
||||
node-releases@2.0.55:
|
||||
resolution: {integrity: sha512-mIrE/Cw9y+9Au6dS5vDKDhQza9YvG6w+ZrS6X+ZzA7yFW/soAeaups4Qzn1bL6g5FVy8WtP79+0j82oPIbqRjQ==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
normalize-path@3.0.0:
|
||||
@@ -3033,11 +3037,11 @@ packages:
|
||||
unrs-resolver@1.12.2:
|
||||
resolution: {integrity: sha512-dmlRxBJJayXjqTwC+JtF1HhJmgf3ftQ3YejFcZrf4+KKtJv0qDsK1pjqaaVjG7wJ5NJ6UVP1OqRMQ71Z4C3rxQ==}
|
||||
|
||||
update-browserslist-db@1.2.3:
|
||||
resolution: {integrity: sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==}
|
||||
update-browserslist-db@1.3.2:
|
||||
resolution: {integrity: sha512-UQ+MSxlhRm1bzjhU+DcuXfjFO1FzNtqhK5+9Yvlp90ItDLk5vT932A0rFu619nf7RVS+Y/VeaUW1jaRDqZ8VJw==}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
browserslist: '>= 4.21.0'
|
||||
browserslist: '>=4.28.7 <5.0.0'
|
||||
|
||||
uri-js@4.4.1:
|
||||
resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
|
||||
@@ -4350,7 +4354,7 @@ snapshots:
|
||||
|
||||
autoprefixer@10.5.0(postcss@8.5.23):
|
||||
dependencies:
|
||||
browserslist: 4.28.2
|
||||
browserslist: 4.28.9
|
||||
caniuse-lite: 1.0.30001797
|
||||
fraction.js: 5.3.4
|
||||
picocolors: 1.1.1
|
||||
@@ -4379,7 +4383,7 @@ snapshots:
|
||||
|
||||
balanced-match@4.0.4: {}
|
||||
|
||||
baseline-browser-mapping@2.10.35: {}
|
||||
baseline-browser-mapping@2.11.21: {}
|
||||
|
||||
binary-extensions@2.3.0: {}
|
||||
|
||||
@@ -4396,13 +4400,13 @@ snapshots:
|
||||
dependencies:
|
||||
fill-range: 7.1.1
|
||||
|
||||
browserslist@4.28.2:
|
||||
browserslist@4.28.9:
|
||||
dependencies:
|
||||
baseline-browser-mapping: 2.10.35
|
||||
caniuse-lite: 1.0.30001797
|
||||
electron-to-chromium: 1.5.371
|
||||
node-releases: 2.0.47
|
||||
update-browserslist-db: 1.2.3(browserslist@4.28.2)
|
||||
baseline-browser-mapping: 2.11.21
|
||||
caniuse-lite: 1.0.30001810
|
||||
electron-to-chromium: 1.5.426
|
||||
node-releases: 2.0.55
|
||||
update-browserslist-db: 1.3.2(browserslist@4.28.9)
|
||||
|
||||
call-bind-apply-helpers@1.0.2:
|
||||
dependencies:
|
||||
@@ -4427,6 +4431,8 @@ snapshots:
|
||||
|
||||
caniuse-lite@1.0.30001797: {}
|
||||
|
||||
caniuse-lite@1.0.30001810: {}
|
||||
|
||||
chalk@4.1.2:
|
||||
dependencies:
|
||||
ansi-styles: 4.3.0
|
||||
@@ -4614,7 +4620,7 @@ snapshots:
|
||||
es-errors: 1.3.0
|
||||
gopd: 1.2.0
|
||||
|
||||
electron-to-chromium@1.5.371: {}
|
||||
electron-to-chromium@1.5.426: {}
|
||||
|
||||
emoji-regex@9.2.2: {}
|
||||
|
||||
@@ -5446,7 +5452,7 @@ snapshots:
|
||||
object.entries: 1.1.9
|
||||
semver: 6.3.1
|
||||
|
||||
node-releases@2.0.47: {}
|
||||
node-releases@2.0.55: {}
|
||||
|
||||
normalize-path@3.0.0: {}
|
||||
|
||||
@@ -6159,9 +6165,9 @@ snapshots:
|
||||
'@unrs/resolver-binding-win32-ia32-msvc': 1.12.2
|
||||
'@unrs/resolver-binding-win32-x64-msvc': 1.12.2
|
||||
|
||||
update-browserslist-db@1.2.3(browserslist@4.28.2):
|
||||
update-browserslist-db@1.3.2(browserslist@4.28.9):
|
||||
dependencies:
|
||||
browserslist: 4.28.2
|
||||
browserslist: 4.28.9
|
||||
escalade: 3.2.0
|
||||
picocolors: 1.1.1
|
||||
|
||||
|
||||
@@ -13,3 +13,4 @@ overrides:
|
||||
"postcss@<8.5.18": ">=8.5.18 <9.0.0"
|
||||
"nanoid@<3.3.18": ">=3.3.18 <4.0.0"
|
||||
"sharp@<0.35.0": ">=0.35.0 <0.36.0"
|
||||
"browserslist@<4.28.7": ">=4.28.7 <5.0.0"
|
||||
|
||||
Reference in New Issue
Block a user