@everme/minimaxcode
v0.7.2
Published
Native EverMe memory-capture hooks for MiniMax Code.
Readme
@everme/minimaxcode
Native EverMe memory-capture hooks for MiniMax Code.
What it does
MiniMax Code (>= 3.0.53) executes user-registered hooks from
~/.minimax/hooks/. Its daemon currently triggers only PreToolUse and
PostToolUse, so this package captures conversation memory from those two
events:
evercli plugin install minimaxcodestages this bundle at~/.minimax/everme/, writes credentials to~/.minimax/everme.env(0600), and registers two markdown hooks (~/.minimax/hooks/everme-pre-tool-use.md/everme-post-tool-use.md). MiniMax Code reloads hooks from disk on every execution — no restart or TUI step required.On each tool call the hook entrypoint (
bin/hook.js) claims a per-session debounce slot (default 60s,EVERME_MINIMAX_SYNC_INTERVAL_MSto tune) and hands off to a detached worker, keeping the host's awaited hook chain fast.The worker reads the session transcript under
~/.minimax/v2/sessions/YYYY/MM/DD/<ts>-session_<b64>/, converts it to the EverMe agent-memory shape, and uploads only the delta past the per-session high-water mark through@everme/agent-sdk.Tool text results retain their native call IDs and empty text without synthetic placeholders. Neither this adapter nor the cold-start importer adds an 8000-character tool-result cap; normal text cleanup and credential redaction still apply.
Tool calls require native non-empty string IDs and names, and object arguments; the literal name
unknownremains valid. IDs and names are preserved verbatim, and arguments are JSON-encoded. Malformed tool records are dropped with bounded reason/count diagnostics, without invented IDs, replacement arguments, or guessed result matching. A result is dropped with a rejected call only when its native ID identifies that call uniquely. The plugin writes these diagnostics to stderr; the cold-start reader records them in its conversation warnings.Native assistant
stopReason: "stop"marks its real trailing text asturnComplete: trueonly when no tool call is present. Other assistant text remains explicitly incomplete; empty or thinking-only messages do not create an ending. The shared BFF batching path uses this metadata; no source turn IDs or new host events are introduced. A single parsed message is retained without requiring a user message or a two-message minimum. Tool-only hooks still cannot capture a session with no hook event.Both transcript formats use task-aware batching in the plugin and cold import. Fitting user tasks retain original tool output; oversized tasks try 4, 3, then 2 KiB result budgets before semantic splitting. Calls, arguments, source ordering, and the non-flushing hook contract are unchanged.
The v2 runtime carries two transcript formats and which one a session has depends on when it ran, not on the frontend: July sessions have
ledger.jsonl, sessions from 2026-08-31 on havemessages.jsonland no ledger (manifest.json still declares apaths.ledgerthat does not exist).messages.jsonlis preferred when it holds bytes — the runtime creates it empty at session start — andledger.jsonlis the fallback.Legacy ledger replay keeps only effective history: append events add messages, history-replaced and turn-retracted events replace the entire history with their
messages, and state/session deletion clears it. Later appends retain their source order. This covers the native complete append-only ledger; snapshot-only recovery and damaged-ledger repair are not implemented by these readers.
Known limits (host-side)
- Capture is tool-call-boundary INCREMENTAL, not whole-session: a
conversation with zero tool calls never fires a hook, and the last turn
after the final tool call is not captured either. The MCP write tools
that once let the model compensate (
mem_save_turn/mem_save_fact) are retired, so those turns are captured only once a later tool call fires the hook — the gap is real and cannot be closed from the model side, and guidance must not claim "everything is saved automatically". - MiniMax ships its own marketplace build of EverMe (
everme@official), which saves under the user's MiniMax cloud identity. With both enabled the same conversation is stored twice under two identities, and the server cannot dedupe across them.evercli plugin install minimaxcodewarns when it finds that plugin enabled; it does not disable it (that entry lives in MiniMax's registry, not ours). - No recall injection: MiniMax Code does not trigger
SessionStart/UserPromptSubmit, andPreToolUseoutput can only mutate tool arguments. The adapter's event map is ready to extend when the host starts firing lifecycle events. Recall is instead served on-demand through MCP:evercli plugin install minimaxcodeupserts aneverme-memoryentry (@everme/memory-mcp) into~/.minimax/mcp.json, which MiniMax Code reads natively — new sessions get mem_search / mem_context tools. - The tail of the final turn is uploaded on the next tool-call tick.
Fail-open contract
Hooks always exit 0 (exit code 2 would block the host's tool call), never write to stdout (stdout JSON is merged into the hook output), and redact credentials from diagnostics.
Test
npm test --workspace @everme/minimaxcode