@totalreclaw/mcp-server 3.6.0 → 3.6.2-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +1 -1
  2. package/SKILL.md +1 -1
  3. package/dist/credential-activation.d.ts +80 -0
  4. package/dist/credential-activation.d.ts.map +1 -0
  5. package/dist/credential-activation.js +254 -0
  6. package/dist/credential-activation.js.map +1 -0
  7. package/dist/dispatch.d.ts +10 -2
  8. package/dist/dispatch.d.ts.map +1 -1
  9. package/dist/dispatch.js +17 -4
  10. package/dist/dispatch.js.map +1 -1
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +105 -52
  13. package/dist/index.js.map +1 -1
  14. package/dist/prompts.d.ts +4 -4
  15. package/dist/prompts.d.ts.map +1 -1
  16. package/dist/prompts.js +3 -3
  17. package/dist/quota-copy.d.ts +25 -0
  18. package/dist/quota-copy.d.ts.map +1 -0
  19. package/dist/quota-copy.js +37 -0
  20. package/dist/quota-copy.js.map +1 -0
  21. package/dist/recall-top-k.d.ts +6 -1
  22. package/dist/recall-top-k.d.ts.map +1 -1
  23. package/dist/recall-top-k.js +10 -2
  24. package/dist/recall-top-k.js.map +1 -1
  25. package/dist/setup-note.d.ts +29 -0
  26. package/dist/setup-note.d.ts.map +1 -0
  27. package/dist/setup-note.js +68 -0
  28. package/dist/setup-note.js.map +1 -0
  29. package/dist/tools/account.d.ts.map +1 -1
  30. package/dist/tools/account.js +10 -1
  31. package/dist/tools/account.js.map +1 -1
  32. package/dist/tools/import-from.d.ts.map +1 -1
  33. package/dist/tools/import-from.js +11 -14
  34. package/dist/tools/import-from.js.map +1 -1
  35. package/dist/tools/pair.d.ts +22 -12
  36. package/dist/tools/pair.d.ts.map +1 -1
  37. package/dist/tools/pair.js +42 -12
  38. package/dist/tools/pair.js.map +1 -1
  39. package/dist/tools/status.d.ts +12 -0
  40. package/dist/tools/status.d.ts.map +1 -1
  41. package/dist/tools/status.js +24 -2
  42. package/dist/tools/status.js.map +1 -1
  43. package/package.json +2 -2
package/dist/prompts.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export declare const SERVER_INSTRUCTIONS = "TotalReclaw is the user's encrypted long-term memory. Use it unprompted:\n- Recall: ALWAYS call totalreclaw_recall at the start of EVERY conversation (query: the user's first message) and whenever past context could help. Use quietly.\n- Remember: call totalreclaw_remember WITHOUT being asked, same turn, whenever the user shares a durable fact. They never need to say \"remember this\".\n- Safety: the recovery phrase must never enter this chat. Never ask for it, echo it or run a CLI that prints it.\n\n## Recovery phrase (hard rules)\n- NEVER ask the user to paste their recovery phrase into chat. NEVER echo, print or summarize a phrase.\n- NEVER run a phrase-touching CLI through a shell tool (e.g. \"npx @totalreclaw/mcp-server setup\" or \"show-phrase\"): its output enters your context.\n- If the user pastes a phrase anyway, tell them it is compromised and they need a fresh one from the browser pair flow (totalreclaw_pair).\n\n## Remembering\nStore without being asked whenever the user shares: preferences, personal info, decisions or goals, corrections, important dates or events, tech preferences, project context, opinions or values. If it could help later, store it automatically. Store atomic facts (\"User is vegan\"). Skip small talk, one-off tasks, generic knowledge and secrets (passwords, API keys, tokens). Correction: store the new fact.\n\n## Setup\n\"not_configured\" means no account yet. Call totalreclaw_pair and give the user the link + PIN. The phrase is created or entered in a browser only, never in config, env vars or chat. After Pairing, on \"You're all set\", ask them to fully quit and reopen this app (or start a new session).\n\n## Everything else\n\"quota_exceeded\" -> tell the user, offer totalreclaw_status / totalreclaw_upgrade, stop storing. \"pin that\" -> totalreclaw_pin. Migrating -> totalreclaw_import_from (dry_run first). \"file that under X\" / \"that's a work thing\" -> totalreclaw_set_scope. End of a substantive conversation -> totalreclaw_debrief. Guide: totalreclaw://guide.";
2
- export declare const SYSTEM_PROMPT_FRAGMENT = "TotalReclaw is the user's encrypted long-term memory. Use it unprompted:\n- Recall: ALWAYS call totalreclaw_recall at the start of EVERY conversation (query: the user's first message) and whenever past context could help. Use quietly.\n- Remember: call totalreclaw_remember WITHOUT being asked, same turn, whenever the user shares a durable fact. They never need to say \"remember this\".\n- Safety: the recovery phrase must never enter this chat. Never ask for it, echo it or run a CLI that prints it.\n\n## Recovery phrase (hard rules)\n- NEVER ask the user to paste their recovery phrase into chat. NEVER echo, print or summarize a phrase.\n- NEVER run a phrase-touching CLI through a shell tool (e.g. \"npx @totalreclaw/mcp-server setup\" or \"show-phrase\"): its output enters your context.\n- If the user pastes a phrase anyway, tell them it is compromised and they need a fresh one from the browser pair flow (totalreclaw_pair).\n\n## Remembering\nStore without being asked whenever the user shares: preferences, personal info, decisions or goals, corrections, important dates or events, tech preferences, project context, opinions or values. If it could help later, store it automatically. Store atomic facts (\"User is vegan\"). Skip small talk, one-off tasks, generic knowledge and secrets (passwords, API keys, tokens). Correction: store the new fact.\n\n## Setup\n\"not_configured\" means no account yet. Call totalreclaw_pair and give the user the link + PIN. The phrase is created or entered in a browser only, never in config, env vars or chat. After Pairing, on \"You're all set\", ask them to fully quit and reopen this app (or start a new session).\n\n## Everything else\n\"quota_exceeded\" -> tell the user, offer totalreclaw_status / totalreclaw_upgrade, stop storing. \"pin that\" -> totalreclaw_pin. Migrating -> totalreclaw_import_from (dry_run first). \"file that under X\" / \"that's a work thing\" -> totalreclaw_set_scope. End of a substantive conversation -> totalreclaw_debrief. Guide: totalreclaw://guide.";
1
+ export declare const SERVER_INSTRUCTIONS = "TotalReclaw is the user's encrypted long-term memory. Use it unprompted:\n- Recall: ALWAYS call totalreclaw_recall at the start of EVERY conversation (query: the user's first message) and whenever past context could help. Use quietly.\n- Remember: call totalreclaw_remember WITHOUT being asked, same turn, whenever the user shares a durable fact. They never need to say \"remember this\".\n- Safety: the recovery phrase must never enter this chat. Never ask for it, echo it or run a CLI that prints it.\n\n## Recovery phrase (hard rules)\n- NEVER ask the user to paste their recovery phrase into chat. NEVER echo, print or summarize a phrase.\n- NEVER run a phrase-touching CLI through a shell tool (e.g. \"npx @totalreclaw/mcp-server setup\" or \"show-phrase\"): its output enters your context.\n- If the user pastes a phrase anyway, tell them it is compromised and they need a fresh one from the browser pair flow (totalreclaw_pair).\n\n## Remembering\nStore without being asked whenever the user shares: preferences, personal info, decisions or goals, corrections, important dates or events, tech preferences, project context, opinions or values. If it could help later, store it automatically. Store atomic facts (\"User is vegan\"). Skip small talk, one-off tasks, generic knowledge and secrets (passwords, API keys, tokens). Correction: store the new fact.\n\n## Setup\n\"not_configured\" means no account yet. Call totalreclaw_pair and give the user the link + PIN. The phrase is created or entered in a browser only, never in config, env vars or chat. On \"You're all set\" the tools work at once, no restart (if not_configured persists, reopen the app).\n\n## Everything else\n\"quota_exceeded\" -> tell the user, offer totalreclaw_status / totalreclaw_upgrade, stop storing. \"pin that\" -> totalreclaw_pin. Migrating -> totalreclaw_import_from (dry_run first). \"file that under X\" / \"that's a work thing\" -> totalreclaw_set_scope. End of a substantive conversation -> totalreclaw_debrief. Guide: totalreclaw://guide.";
2
+ export declare const SYSTEM_PROMPT_FRAGMENT = "TotalReclaw is the user's encrypted long-term memory. Use it unprompted:\n- Recall: ALWAYS call totalreclaw_recall at the start of EVERY conversation (query: the user's first message) and whenever past context could help. Use quietly.\n- Remember: call totalreclaw_remember WITHOUT being asked, same turn, whenever the user shares a durable fact. They never need to say \"remember this\".\n- Safety: the recovery phrase must never enter this chat. Never ask for it, echo it or run a CLI that prints it.\n\n## Recovery phrase (hard rules)\n- NEVER ask the user to paste their recovery phrase into chat. NEVER echo, print or summarize a phrase.\n- NEVER run a phrase-touching CLI through a shell tool (e.g. \"npx @totalreclaw/mcp-server setup\" or \"show-phrase\"): its output enters your context.\n- If the user pastes a phrase anyway, tell them it is compromised and they need a fresh one from the browser pair flow (totalreclaw_pair).\n\n## Remembering\nStore without being asked whenever the user shares: preferences, personal info, decisions or goals, corrections, important dates or events, tech preferences, project context, opinions or values. If it could help later, store it automatically. Store atomic facts (\"User is vegan\"). Skip small talk, one-off tasks, generic knowledge and secrets (passwords, API keys, tokens). Correction: store the new fact.\n\n## Setup\n\"not_configured\" means no account yet. Call totalreclaw_pair and give the user the link + PIN. The phrase is created or entered in a browser only, never in config, env vars or chat. On \"You're all set\" the tools work at once, no restart (if not_configured persists, reopen the app).\n\n## Everything else\n\"quota_exceeded\" -> tell the user, offer totalreclaw_status / totalreclaw_upgrade, stop storing. \"pin that\" -> totalreclaw_pin. Migrating -> totalreclaw_import_from (dry_run first). \"file that under X\" / \"that's a work thing\" -> totalreclaw_set_scope. End of a substantive conversation -> totalreclaw_debrief. Guide: totalreclaw://guide.";
3
3
  /** URI of the static usage-guide resource (all modes, including unconfigured). */
4
4
  export declare const SERVER_GUIDE_URI = "totalreclaw://guide";
5
5
  /**
@@ -8,7 +8,7 @@ export declare const SERVER_GUIDE_URI = "totalreclaw://guide";
8
8
  * Served as the `totalreclaw://guide` resource and appended to the
9
9
  * `totalreclaw_instructions` prompt.
10
10
  */
11
- export declare const SERVER_GUIDE = "# TotalReclaw usage guide\n\n## Recovery phrase\nTotalReclaw uses a 12-word BIP-39 recovery phrase as the user's identity. The phrase MUST NEVER cross your context window.\n- NEVER ask the user to paste their phrase into chat. NEVER echo, print or summarize a phrase.\n- NEVER invoke a phrase-touching CLI (e.g. \"npx @totalreclaw/mcp-server setup\", \"npx @totalreclaw/mcp-server show-phrase\") via a shell tool: its stdout enters your context.\n- If the user pastes a phrase in chat anyway, tell them it is compromised and they need a fresh one from the browser pair flow (totalreclaw_pair).\n- Setup is totalreclaw_pair (link + PIN). The phrase is created or entered in the browser during totalreclaw_pair, never in chat, in a config file, in an env var or in a secret store, and never through you.\n\n## Setup\nIf a tool returns \"not_configured\", offer totalreclaw_pair. It returns a URL and a PIN. The user opens the URL in a browser, the browser creates or imports the phrase, and only ciphertext reaches this server. When the page says \"You're all set\", ask the user to fully quit and reopen this app (or start a new session); credentials load at startup, so until then every tool still returns not_configured. The link lasts about 10 minutes. If the install is already set up, totalreclaw_pair refuses with already_configured and opens nothing: tell the user they are set up. Only if the user explicitly asks to switch to a different account, call it again with replace=true; that opens a replace session, and the user confirms the replacement on the pairing page (you cannot confirm it for them).\nThe totalreclaw_setup tool was removed in 3.2.1 because it returned the phrase through tool output.\n\n## Recall\nCall totalreclaw_recall:\n- at the start of every new conversation, with a brief summary of the user's first message as the query;\n- when the user asks about something that might relate to past conversations;\n- when you need context about the user's background, projects or preferences;\n- when the user says \"remember when...\", \"what did I say about...\", \"do you know my...\".\nPresent recalled memories naturally as context. Do not announce \"I found these memories\" or list them unless the user asks.\n\n## Remember\nCall totalreclaw_remember without being asked whenever the user shares:\n- personal preferences (\"I prefer...\", \"I like...\", \"I hate...\");\n- personal information (name, location, occupation, family);\n- decisions or goals (\"I decided to...\", \"I chose X because Y\");\n- corrections (\"Actually, I'm vegan now\", \"We moved to Berlin\");\n- important events or dates;\n- technical preferences (languages, tools, frameworks, workflows);\n- project context (what they're working on, deadlines, team);\n- opinions and values that shape future interactions.\nDo NOT store temporary context (today's weather, a one-time task), generic knowledge, or credentials (passwords, API keys, tokens).\n\nHygiene:\n- Check recalled memories before storing to avoid duplicates; store-time dedup also runs.\n- For a correction, store the new fact. The system handles supersession.\n- Importance: 7-9 for core identity and preferences, 4-6 for moderate facts, 1-3 for minor details.\n- Atomic facts: \"User prefers dark mode\", not \"User said they prefer dark mode and also use VS Code\".\n\n## Billing and quota\nMemories are stored permanently on Gnosis mainnet, end-to-end encrypted. Free and Pro tiers have monthly write caps; reads are unlimited. Do not guess or hardcode pricing or caps: use totalreclaw_status for exact usage, cap and pricing, and refer users to https://totalreclaw.xyz/pricing.\nWhen totalreclaw_remember fails with \"quota_exceeded\":\n1. Tell the user they have hit a usage limit.\n2. Offer to check usage with totalreclaw_status.\n3. If they want to upgrade, totalreclaw_upgrade returns a checkout link.\nDo not keep retrying stores after a quota error.\nBilling status is cached for up to 2 hours. If Pro features are not active after upgrading, suggest restarting the agent to refresh the cache.\n\n## Imports\nIf the user mentions migrating from Mem0, MCP Memory Server or another AI memory tool, offer totalreclaw_import_from. Run with dry_run=true first, show the preview, then confirm before importing. API keys the user provides are used only for the import and are never stored.\n\n## Editing memories\nBesides remember and forget, three tools correct stored memories without wiping the vault:\n- \"pin that\" / \"never forget this\" -> totalreclaw_pin (keeps a fact through auto-resolution);\n- \"that was actually a directive, not a preference\" -> totalreclaw_retype;\n- \"that was work context\" / \"file that under personal\" / \"put that in my work memories\" / \"categorize as X\" / \"that's a work thing\" -> totalreclaw_set_scope (scopes: work, personal, health, family, creative, finance, misc, unspecified).\nAll three work by supersession: they write a new claim with the override and link the original via superseded_by. The original stays as a tombstone, so history is inspectable. All three are idempotent.\n\n## End of conversation\nWhen a substantive conversation ends (goodbye, topic resolved, natural close), call totalreclaw_debrief with the key takeaways: what it was about, what was decided, what was tried and how it went, what is unfinished. Skip casual conversations. At most 5 items, each 1-3 sentences, type \"summary\" or \"context\", importance 7-8.\n\n## Other tips\n- If your agent supports background routines, a routine that calls totalreclaw_remember after conversations helps make sure nothing is missed.\n- Memories are portable: they work across OpenClaw, Hermes, Claude Desktop, Cursor, NanoClaw and any MCP-compatible agent.\n";
11
+ export declare const SERVER_GUIDE = "# TotalReclaw usage guide\n\n## Recovery phrase\nTotalReclaw uses a 12-word BIP-39 recovery phrase as the user's identity. The phrase MUST NEVER cross your context window.\n- NEVER ask the user to paste their phrase into chat. NEVER echo, print or summarize a phrase.\n- NEVER invoke a phrase-touching CLI (e.g. \"npx @totalreclaw/mcp-server setup\", \"npx @totalreclaw/mcp-server show-phrase\") via a shell tool: its stdout enters your context.\n- If the user pastes a phrase in chat anyway, tell them it is compromised and they need a fresh one from the browser pair flow (totalreclaw_pair).\n- Setup is totalreclaw_pair (link + PIN). The phrase is created or entered in the browser during totalreclaw_pair, never in chat, in a config file, in an env var or in a secret store, and never through you.\n\n## Setup\nIf a tool returns \"not_configured\", offer totalreclaw_pair. It returns a URL and a PIN. The user opens the URL in a browser, the browser creates or imports the phrase, and only ciphertext reaches this server. When the page says \"You're all set\", the memory tools work in this chat right away; no restart is needed. If a tool still returns not_configured, ask the user to fully quit and reopen this app. The link lasts about 10 minutes. If the install is already set up, totalreclaw_pair refuses with already_configured and opens nothing: tell the user they are set up. Only if the user explicitly asks to switch to a different account, call it again with replace=true; that opens a replace session, and the user confirms the replacement on the pairing page (you cannot confirm it for them).\nThe totalreclaw_setup tool was removed in 3.2.1 because it returned the phrase through tool output.\n\n## Recall\nCall totalreclaw_recall:\n- at the start of every new conversation, with a brief summary of the user's first message as the query;\n- when the user asks about something that might relate to past conversations;\n- when you need context about the user's background, projects or preferences;\n- when the user says \"remember when...\", \"what did I say about...\", \"do you know my...\".\nPresent recalled memories naturally as context. Do not announce \"I found these memories\" or list them unless the user asks.\n\n## Remember\nCall totalreclaw_remember without being asked whenever the user shares:\n- personal preferences (\"I prefer...\", \"I like...\", \"I hate...\");\n- personal information (name, location, occupation, family);\n- decisions or goals (\"I decided to...\", \"I chose X because Y\");\n- corrections (\"Actually, I'm vegan now\", \"We moved to Berlin\");\n- important events or dates;\n- technical preferences (languages, tools, frameworks, workflows);\n- project context (what they're working on, deadlines, team);\n- opinions and values that shape future interactions.\nDo NOT store temporary context (today's weather, a one-time task), generic knowledge, or credentials (passwords, API keys, tokens).\n\nHygiene:\n- Check recalled memories before storing to avoid duplicates; store-time dedup also runs.\n- For a correction, store the new fact. The system handles supersession.\n- Importance: 7-9 for core identity and preferences, 4-6 for moderate facts, 1-3 for minor details.\n- Atomic facts: \"User prefers dark mode\", not \"User said they prefer dark mode and also use VS Code\".\n\n## Billing and quota\nMemories are stored permanently on Gnosis mainnet, end-to-end encrypted. Free and Pro tiers have monthly write caps; reads are unlimited. Do not guess or hardcode pricing or caps: use totalreclaw_status for exact usage, cap and pricing, and refer users to https://totalreclaw.xyz/pricing.\nWhen totalreclaw_remember fails with \"quota_exceeded\":\n1. Tell the user they have hit a usage limit.\n2. Offer to check usage with totalreclaw_status.\n3. If they want to upgrade, totalreclaw_upgrade returns a checkout link.\nDo not keep retrying stores after a quota error.\nBilling status is cached for up to 2 hours. If Pro features are not active after upgrading, suggest restarting the agent to refresh the cache.\n\n## Imports\nIf the user mentions migrating from Mem0, MCP Memory Server or another AI memory tool, offer totalreclaw_import_from. Run with dry_run=true first, show the preview, then confirm before importing. API keys the user provides are used only for the import and are never stored.\n\n## Editing memories\nBesides remember and forget, three tools correct stored memories without wiping the vault:\n- \"pin that\" / \"never forget this\" -> totalreclaw_pin (keeps a fact through auto-resolution);\n- \"that was actually a directive, not a preference\" -> totalreclaw_retype;\n- \"that was work context\" / \"file that under personal\" / \"put that in my work memories\" / \"categorize as X\" / \"that's a work thing\" -> totalreclaw_set_scope (scopes: work, personal, health, family, creative, finance, misc, unspecified).\nAll three work by supersession: they write a new claim with the override and link the original via superseded_by. The original stays as a tombstone, so history is inspectable. All three are idempotent.\n\n## End of conversation\nWhen a substantive conversation ends (goodbye, topic resolved, natural close), call totalreclaw_debrief with the key takeaways: what it was about, what was decided, what was tried and how it went, what is unfinished. Skip casual conversations. At most 5 items, each 1-3 sentences, type \"summary\" or \"context\", importance 7-8.\n\n## Other tips\n- If your agent supports background routines, a routine that calls totalreclaw_remember after conversations helps make sure nothing is missed.\n- Memories are portable: they work across OpenClaw, Hermes, Claude Desktop, Cursor, NanoClaw and any MCP-compatible agent.\n";
12
12
  export declare const REMEMBER_TOOL_DESCRIPTION = "Store user info PROACTIVELY \u2014 don't wait for \"remember this\".\nINVOKE WHEN USER SAYS \"I prefer X\", \"I'm X\", \"I chose X because Y\"; reveals identity/location/job/family.\nNOT FOR: chitchat, passwords, generic knowledge.\nExtract ATOMIC. Good: \"User is vegan\". Bad: \"User said they became vegan, prefer organic\".\nPARAMS facts[]: text; importance 1-10 def 5; type claim|preference|directive|commitment|episode|summary; scope work|personal|health|family|creative|finance|misc|unspecified. Dedup auto.";
13
13
  export declare const RECALL_TOOL_DESCRIPTION = "Search encrypted vault. Top 16 reranked by provenance+semantic+recency.\nINVOKE WHEN USER SAYS:\n- \"what's my [phone/address/doctor]\"\n- \"remember when I...\" / \"what did I say about...\"\n- \"do you know my...\" / \"my preferences for...\"\n- opens convo on a topic (auto-recall first msg)\nWHEN NOT TO USE: world knowledge, small talk.\nDOES: trapdoor search, decrypt, rerank BM25+cosine+source-provenance.\nPARAMS: query (5-15 words), k (def 16, max 50).\nDon't announce \"I found these memories\" \u2014 just use them.";
14
14
  export declare const FORGET_TOOL_DESCRIPTION = "Permanently remove memory.\nINVOKE WHEN USER SAYS:\n- \"forget what I said about X\" / \"delete that fact\"\n- \"that's wrong/outdated \u2014 remove it\"\n- \"I don't want you remembering X\"\nWHEN NOT TO USE:\n- CORRECTING \u2192 totalreclaw_remember (dedup auto)\n- never forget proactively\nDOES: memory_id \u2192 tombstone. query \u2192 recall \u226450, tombstone all (self-hosted only; managed service needs an id).\nPARAMS: memory_id = the fact_id from a recall result (fact_id also accepted), query, scope.";
@@ -19,7 +19,7 @@ export declare const IMPORT_FROM_TOOL_DESCRIPTION = "Import from Mem0, MCP Memor
19
19
  export declare const IMPORT_TOOL_DESCRIPTION = "Restore from totalreclaw_export backup (JSON/Markdown). Self-hosted only (managed service refuses it).\nINVOKE WHEN USER SAYS:\n- \"restore memories from this backup\" / \"import this JSON\"\n- \"I exported from another TotalReclaw account\"\n- \"put the export back\"\nWHEN NOT TO USE:\n- Mem0/ChatGPT/Claude \u2192 totalreclaw_import_from\n- single fact \u2192 totalreclaw_remember\nDOES: parse JSON/Markdown (auto), store + fingerprint dedup.\nPARAMS: content (req), format, merge_strategy, validate_only.";
20
20
  export declare const SUPPORT_TOOL_DESCRIPTION = "Support contact, docs, troubleshooting.\nINVOKE WHEN USER SAYS:\n- \"how do I get help?\" / \"who do I contact?\"\n- \"memories aren't loading\" / \"getting errors\"\n- \"lost my recovery phrase\" / \"where's the docs?\"\n- \"how do I report a bug?\"\n- asks: slow recall, quota errors, failed imports, missing post-upgrade memories\nDOES: static bundle (pre-filled email, docs URL, issues URL, troubleshooting table). Works unconfigured.\nWHEN NOT TO USE: billing info \u2192 totalreclaw_status. Skip unrelated questions.";
21
21
  export declare const ACCOUNT_TOOL_DESCRIPTION = "Account overview: wallet, tier, usage, memories, features, credential kind.\nINVOKE WHEN USER SAYS:\n- \"show my account\" / \"what's my profile?\"\n- \"how many memories?\" / \"my wallet?\"\n- \"summary of my setup\"\nDOES: billing+fact count parallel. Returns wallet, tier, writes_used/limit, total_facts, features, credential kind. Never any part of the recovery phrase.\nWHEN NOT TO USE:\n- only billing \u2192 totalreclaw_status (lighter)\n- recovery phrase (any word) \u2192 NEVER available; user checks own backup.";
22
- export declare const PAIR_TOOL_DESCRIPTION = "Set up the user's TotalReclaw account (browser-side recovery-phrase generation or import).\nINVOKE WHEN USER SAYS:\n- \"set up totalreclaw\" / \"set up my account\"\n- \"I don't have a totalreclaw recovery phrase yet\" / \"create a totalreclaw account\"\n- ANY tool returns \"not_configured\" \u2014 propose this tool BEFORE asking the user to edit MCP config.\nDOES: opens a relay pairing session, returns {url, pin, expires_at_ms}. Hand the URL + PIN to the user \u2014 they open the URL in any browser, the BROWSER generates (or imports) a 12-word phrase, encrypts it, uploads ciphertext to this MCP server. Server decrypts in-memory, writes ~/.totalreclaw/credentials.json (mode 0600). Phrase NEVER touches LLM context, chat transcript, stdout, or logs.\nAFTER PAIRING: when the page says \"You're all set\", tell the user to fully quit and reopen their MCP host (Claude Desktop / Cursor / Claude Code); the server reads credentials.json only at startup. The link lasts about 10 minutes.\nWHEN NOT TO USE:\n- already set up (credentials.json exists or the server is configured) \u2192 the tool refuses with already_configured. Tell the user they are set up. Only if THEY ask to replace their account, call with replace=true; the pairing page asks the user to confirm. You cannot confirm it for them.\n- user explicitly wants terminal-only setup \u2192 point them at `npx @totalreclaw/mcp-server setup` (CLI wizard, runs OUTSIDE your shell tool)\n- NEVER ask the user to paste their phrase in chat. NEVER echo or print a phrase from any source.";
22
+ export declare const PAIR_TOOL_DESCRIPTION = "Set up the user's TotalReclaw account (browser-side recovery-phrase generation or import).\nINVOKE WHEN USER SAYS:\n- \"set up totalreclaw\" / \"set up my account\"\n- \"I don't have a totalreclaw recovery phrase yet\" / \"create a totalreclaw account\"\n- ANY tool returns \"not_configured\" \u2014 propose this tool BEFORE asking the user to edit MCP config.\nDOES: opens a relay pairing session, returns {url, pin, expires_at_ms}. Hand the URL + PIN to the user \u2014 they open the URL in any browser, the BROWSER generates (or imports) a 12-word phrase, encrypts it, uploads ciphertext to this MCP server. Server decrypts in-memory, writes ~/.totalreclaw/credentials.json (mode 0600). Phrase NEVER touches LLM context, chat transcript, stdout, or logs.\nAFTER PAIRING: when the page says \"You're all set\", the server loads the new credentials by itself, so the memory tools work in this chat right away with no restart. If one still returns not_configured, ask the user to fully quit and reopen their MCP host (Claude Desktop / Cursor / Claude Code). The link lasts about 10 minutes.\nWHEN NOT TO USE:\n- already set up (credentials.json exists or the server is configured) \u2192 the tool refuses with already_configured. Tell the user they are set up. Only if THEY ask to replace their account, call with replace=true; the pairing page asks the user to confirm. You cannot confirm it for them.\n- user explicitly wants terminal-only setup \u2192 point them at `npx @totalreclaw/mcp-server setup` (CLI wizard, runs OUTSIDE your shell tool)\n- NEVER ask the user to paste their phrase in chat. NEVER echo or print a phrase from any source.";
23
23
  export declare const PROMPT_DEFINITIONS: {
24
24
  name: string;
25
25
  title: string;
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,mBAAmB,w/DAiBkT,CAAC;AAGnV,eAAO,MAAM,sBAAsB,w/DAAsB,CAAC;AAE1D,kFAAkF;AAClF,eAAO,MAAM,gBAAgB,wBAAwB,CAAC;AAEtD;;;;;GAKG;AACH,eAAO,MAAM,YAAY,unLAgExB,CAAC;AAIF,eAAO,MAAM,yBAAyB,ugBAIoJ,CAAC;AAE3L,eAAO,MAAM,uBAAuB,mhBASqB,CAAC;AAE1D,eAAO,MAAM,uBAAuB,sgBASwD,CAAC;AAE7F,eAAO,MAAM,uBAAuB,2gBASF,CAAC;AAEnC,eAAO,MAAM,uBAAuB,kgBASK,CAAC;AAE1C,eAAO,MAAM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mC,CAAC;AAEzE,eAAO,MAAM,qBAAqB,mnDAUgE,CAAC;AAInG,eAAO,MAAM,kBAAkB;;;;;;;;;GAqB9B,CAAC;AAEF,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,MAAM,EAClB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC5B,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAAC,CAqClE"}
package/dist/prompts.js CHANGED
@@ -28,7 +28,7 @@ exports.SERVER_INSTRUCTIONS = `TotalReclaw is the user's encrypted long-term mem
28
28
  Store without being asked whenever the user shares: preferences, personal info, decisions or goals, corrections, important dates or events, tech preferences, project context, opinions or values. If it could help later, store it automatically. Store atomic facts ("User is vegan"). Skip small talk, one-off tasks, generic knowledge and secrets (passwords, API keys, tokens). Correction: store the new fact.
29
29
 
30
30
  ## Setup
31
- "not_configured" means no account yet. Call totalreclaw_pair and give the user the link + PIN. The phrase is created or entered in a browser only, never in config, env vars or chat. After Pairing, on "You're all set", ask them to fully quit and reopen this app (or start a new session).
31
+ "not_configured" means no account yet. Call totalreclaw_pair and give the user the link + PIN. The phrase is created or entered in a browser only, never in config, env vars or chat. On "You're all set" the tools work at once, no restart (if not_configured persists, reopen the app).
32
32
 
33
33
  ## Everything else
34
34
  "quota_exceeded" -> tell the user, offer totalreclaw_status / totalreclaw_upgrade, stop storing. "pin that" -> totalreclaw_pin. Migrating -> totalreclaw_import_from (dry_run first). "file that under X" / "that's a work thing" -> totalreclaw_set_scope. End of a substantive conversation -> totalreclaw_debrief. Guide: totalreclaw://guide.`;
@@ -52,7 +52,7 @@ TotalReclaw uses a 12-word BIP-39 recovery phrase as the user's identity. The ph
52
52
  - Setup is totalreclaw_pair (link + PIN). The phrase is created or entered in the browser during totalreclaw_pair, never in chat, in a config file, in an env var or in a secret store, and never through you.
53
53
 
54
54
  ## Setup
55
- If a tool returns "not_configured", offer totalreclaw_pair. It returns a URL and a PIN. The user opens the URL in a browser, the browser creates or imports the phrase, and only ciphertext reaches this server. When the page says "You're all set", ask the user to fully quit and reopen this app (or start a new session); credentials load at startup, so until then every tool still returns not_configured. The link lasts about 10 minutes. If the install is already set up, totalreclaw_pair refuses with already_configured and opens nothing: tell the user they are set up. Only if the user explicitly asks to switch to a different account, call it again with replace=true; that opens a replace session, and the user confirms the replacement on the pairing page (you cannot confirm it for them).
55
+ If a tool returns "not_configured", offer totalreclaw_pair. It returns a URL and a PIN. The user opens the URL in a browser, the browser creates or imports the phrase, and only ciphertext reaches this server. When the page says "You're all set", the memory tools work in this chat right away; no restart is needed. If a tool still returns not_configured, ask the user to fully quit and reopen this app. The link lasts about 10 minutes. If the install is already set up, totalreclaw_pair refuses with already_configured and opens nothing: tell the user they are set up. Only if the user explicitly asks to switch to a different account, call it again with replace=true; that opens a replace session, and the user confirms the replacement on the pairing page (you cannot confirm it for them).
56
56
  The totalreclaw_setup tool was removed in 3.2.1 because it returned the phrase through tool output.
57
57
 
58
58
  ## Recall
@@ -205,7 +205,7 @@ INVOKE WHEN USER SAYS:
205
205
  - "I don't have a totalreclaw recovery phrase yet" / "create a totalreclaw account"
206
206
  - ANY tool returns "not_configured" — propose this tool BEFORE asking the user to edit MCP config.
207
207
  DOES: opens a relay pairing session, returns {url, pin, expires_at_ms}. Hand the URL + PIN to the user — they open the URL in any browser, the BROWSER generates (or imports) a 12-word phrase, encrypts it, uploads ciphertext to this MCP server. Server decrypts in-memory, writes ~/.totalreclaw/credentials.json (mode 0600). Phrase NEVER touches LLM context, chat transcript, stdout, or logs.
208
- AFTER PAIRING: when the page says "You're all set", tell the user to fully quit and reopen their MCP host (Claude Desktop / Cursor / Claude Code); the server reads credentials.json only at startup. The link lasts about 10 minutes.
208
+ AFTER PAIRING: when the page says "You're all set", the server loads the new credentials by itself, so the memory tools work in this chat right away with no restart. If one still returns not_configured, ask the user to fully quit and reopen their MCP host (Claude Desktop / Cursor / Claude Code). The link lasts about 10 minutes.
209
209
  WHEN NOT TO USE:
210
210
  - already set up (credentials.json exists or the server is configured) → the tool refuses with already_configured. Tell the user they are set up. Only if THEY ask to replace their account, call with replace=true; the pairing page asks the user to confirm. You cannot confirm it for them.
211
211
  - user explicitly wants terminal-only setup → point them at \`npx @totalreclaw/mcp-server setup\` (CLI wizard, runs OUTSIDE your shell tool)
@@ -0,0 +1,25 @@
1
+ /**
2
+ * TotalReclaw MCP - quota-exceeded copy from the billing snapshot
3
+ *
4
+ * Spec: docs/specs/ops/write-quota-source-of-truth.md §4.1 (R-C). The
5
+ * 403 quota_exceeded message must never hardcode a tier cap: Free 250 and
6
+ * the Pro figure both come from /v1/billing/status via the cached snapshot
7
+ * (the relay sources them from Stripe). When the snapshot (or a field) is
8
+ * absent — an older relay, or a quota error right after an account swap —
9
+ * the copy degrades to wording with no number.
10
+ *
11
+ * Pure module: no imports, no I/O. Exact strings are spec-pinned.
12
+ */
13
+ /** Subset of the billing snapshot the quota copy reads. */
14
+ export interface QuotaSnapshot {
15
+ tier?: string;
16
+ free_writes_limit?: number;
17
+ upgrade_writes_limit?: number;
18
+ }
19
+ /**
20
+ * Build the quota-exceeded message from a (possibly stale or absent)
21
+ * billing snapshot. Any snapshot beats none — callers should not apply a
22
+ * TTL before deciding what to say.
23
+ */
24
+ export declare function quotaExceededMessage(s: QuotaSnapshot | null | undefined): string;
25
+ //# sourceMappingURL=quota-copy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quota-copy.d.ts","sourceRoot":"","sources":["../src/quota-copy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,2DAA2D;AAC3D,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAMD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,aAAa,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAchF"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ /**
3
+ * TotalReclaw MCP - quota-exceeded copy from the billing snapshot
4
+ *
5
+ * Spec: docs/specs/ops/write-quota-source-of-truth.md §4.1 (R-C). The
6
+ * 403 quota_exceeded message must never hardcode a tier cap: Free 250 and
7
+ * the Pro figure both come from /v1/billing/status via the cached snapshot
8
+ * (the relay sources them from Stripe). When the snapshot (or a field) is
9
+ * absent — an older relay, or a quota error right after an account swap —
10
+ * the copy degrades to wording with no number.
11
+ *
12
+ * Pure module: no imports, no I/O. Exact strings are spec-pinned.
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.quotaExceededMessage = quotaExceededMessage;
16
+ const NO_SNAPSHOT = 'You have reached your monthly memory limit. The counter resets on the 1st of the month. '
17
+ + 'Call totalreclaw_status for your current cap; on Free, totalreclaw_upgrade raises it.';
18
+ /**
19
+ * Build the quota-exceeded message from a (possibly stale or absent)
20
+ * billing snapshot. Any snapshot beats none — callers should not apply a
21
+ * TTL before deciding what to say.
22
+ */
23
+ function quotaExceededMessage(s) {
24
+ const limit = s?.free_writes_limit;
25
+ if (typeof limit !== 'number')
26
+ return NO_SNAPSHOT;
27
+ const lim = limit.toLocaleString('en-US');
28
+ if (s?.tier === 'pro') {
29
+ return `Monthly Pro limit reached (${lim} memories plus grace). The counter resets on the 1st of the month.`;
30
+ }
31
+ const up = s?.upgrade_writes_limit;
32
+ const upgradeTarget = typeof up === 'number'
33
+ ? `for ${up.toLocaleString('en-US')} memories a month with the totalreclaw_upgrade tool.`
34
+ : `for a higher monthly limit with the totalreclaw_upgrade tool.`;
35
+ return `Monthly Free limit reached (${lim} memories). The counter resets on the 1st of the month. Upgrade to Pro ${upgradeTarget}`;
36
+ }
37
+ //# sourceMappingURL=quota-copy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quota-copy.js","sourceRoot":"","sources":["../src/quota-copy.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;AAkBH,oDAcC;AAvBD,MAAM,WAAW,GACf,0FAA0F;MACxF,uFAAuF,CAAC;AAE5F;;;;GAIG;AACH,SAAgB,oBAAoB,CAAC,CAAmC;IACtE,MAAM,KAAK,GAAG,CAAC,EAAE,iBAAiB,CAAC;IACnC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,WAAW,CAAC;IAClD,MAAM,GAAG,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IAE1C,IAAI,CAAC,EAAE,IAAI,KAAK,KAAK,EAAE,CAAC;QACtB,OAAO,8BAA8B,GAAG,oEAAoE,CAAC;IAC/G,CAAC;IAED,MAAM,EAAE,GAAG,CAAC,EAAE,oBAAoB,CAAC;IACnC,MAAM,aAAa,GAAG,OAAO,EAAE,KAAK,QAAQ;QAC1C,CAAC,CAAC,OAAO,EAAE,CAAC,cAAc,CAAC,OAAO,CAAC,sDAAsD;QACzF,CAAC,CAAC,+DAA+D,CAAC;IACpE,OAAO,+BAA+B,GAAG,0EAA0E,aAAa,EAAE,CAAC;AACrI,CAAC"}
@@ -23,6 +23,11 @@ export declare const DEFAULT_RECALL_TOP_K = 16;
23
23
  export declare function setServerRecallTopK(value: unknown): void;
24
24
  /** Resolve the default recall top-k (env > relay > 16). */
25
25
  export declare function getRecallTopK(env?: NodeJS.ProcessEnv): number;
26
- /** Test-only: forget any relay value seen so far. */
26
+ /**
27
+ * Forget the relay value seen so far. Used when the running server swaps to a
28
+ * different account (3.6.1); the value came from the old account's billing.
29
+ */
30
+ export declare function resetServerRecallTopK(): void;
31
+ /** Test-only alias of {@link resetServerRecallTopK}. */
27
32
  export declare function _resetServerRecallTopKForTests(): void;
28
33
  //# sourceMappingURL=recall-top-k.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"recall-top-k.d.ts","sourceRoot":"","sources":["../src/recall-top-k.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAUvC;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAGxD;AAED,2DAA2D;AAC3D,wBAAgB,aAAa,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAK1E;AAED,qDAAqD;AACrD,wBAAgB,8BAA8B,IAAI,IAAI,CAErD"}
1
+ {"version":3,"file":"recall-top-k.d.ts","sourceRoot":"","sources":["../src/recall-top-k.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAUvC;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAGxD;AAED,2DAA2D;AAC3D,wBAAgB,aAAa,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAK1E;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C;AAED,wDAAwD;AACxD,wBAAgB,8BAA8B,IAAI,IAAI,CAErD"}
@@ -20,6 +20,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
20
20
  exports.DEFAULT_RECALL_TOP_K = void 0;
21
21
  exports.setServerRecallTopK = setServerRecallTopK;
22
22
  exports.getRecallTopK = getRecallTopK;
23
+ exports.resetServerRecallTopK = resetServerRecallTopK;
23
24
  exports._resetServerRecallTopKForTests = _resetServerRecallTopKForTests;
24
25
  exports.DEFAULT_RECALL_TOP_K = 16;
25
26
  let serverRecallTopK;
@@ -47,8 +48,15 @@ function getRecallTopK(env = process.env) {
47
48
  return serverRecallTopK;
48
49
  return exports.DEFAULT_RECALL_TOP_K;
49
50
  }
50
- /** Test-only: forget any relay value seen so far. */
51
- function _resetServerRecallTopKForTests() {
51
+ /**
52
+ * Forget the relay value seen so far. Used when the running server swaps to a
53
+ * different account (3.6.1); the value came from the old account's billing.
54
+ */
55
+ function resetServerRecallTopK() {
52
56
  serverRecallTopK = undefined;
53
57
  }
58
+ /** Test-only alias of {@link resetServerRecallTopK}. */
59
+ function _resetServerRecallTopKForTests() {
60
+ resetServerRecallTopK();
61
+ }
54
62
  //# sourceMappingURL=recall-top-k.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"recall-top-k.js","sourceRoot":"","sources":["../src/recall-top-k.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAgBH,kDAGC;AAGD,sCAKC;AAGD,wEAEC;AA9BY,QAAA,oBAAoB,GAAG,EAAE,CAAC;AAEvC,IAAI,gBAAoC,CAAC;AAEzC,SAAS,aAAa,CAAC,KAAc;IACnC,MAAM,CAAC,GAAG,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACnF,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,SAAS,CAAC;IAC9E,OAAO,CAAC,CAAC;AACX,CAAC;AAED;;;GAGG;AACH,SAAgB,mBAAmB,CAAC,KAAc;IAChD,MAAM,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IAC/B,IAAI,CAAC,KAAK,SAAS;QAAE,gBAAgB,GAAG,CAAC,CAAC;AAC5C,CAAC;AAED,2DAA2D;AAC3D,SAAgB,aAAa,CAAC,MAAyB,OAAO,CAAC,GAAG;IAChE,MAAM,OAAO,GAAG,aAAa,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IAC5D,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,OAAO,CAAC;IAC1C,IAAI,gBAAgB,KAAK,SAAS;QAAE,OAAO,gBAA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C,gBAAgB,GAAG,SAAS,CAAC;AAC/B,CAAC;AAED,wDAAwD;AACxD,SAAgB,8BAA8B;IAC5C,qBAAqB,EAAE,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * One-time tip for Claude Desktop: how to make TotalReclaw Claude's main memory.
3
+ *
4
+ * Claude's own memory is on by default and is used before TotalReclaw. After
5
+ * credentials were activated by a pairing in THIS process (not at startup),
6
+ * the first successful `totalreclaw_account` / `totalreclaw_status` result gets
7
+ * one extra final paragraph: a tip for the user (not an instruction to the
8
+ * host). Once per pairing (a new pairing in the same process arms it again). No other tool is touched.
9
+ *
10
+ * Only Claude Desktop sees it (MCP `clientInfo.name` is exactly `claude-ai`).
11
+ * For any other client, or when clientInfo is missing, the tip is dropped
12
+ * silently and never shown.
13
+ */
14
+ import type { ToolResponse } from './tools/types.js';
15
+ /** Approved user-facing copy. Do not edit without the owner's approval. */
16
+ export declare const SETUP_NOTE_TEXT: string;
17
+ /** MCP `clientInfo.name` that Claude Desktop sends. */
18
+ export declare const CLAUDE_DESKTOP_CLIENT_NAME = "claude-ai";
19
+ /** Arm the tip (called when a reload activated credentials after pairing). */
20
+ export declare function armSetupNote(): void;
21
+ /** Test helper. */
22
+ export declare function resetSetupNote(): void;
23
+ /**
24
+ * Append the tip to a successful result, once, for Claude Desktop only.
25
+ * Errors (isError, or a JSON `{"error": ...}` text) pass through and keep it armed. For any other client the tip is
26
+ * disarmed without a trace.
27
+ */
28
+ export declare function withSetupNote(res: ToolResponse, clientName: string | undefined): ToolResponse;
29
+ //# sourceMappingURL=setup-note.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup-note.d.ts","sourceRoot":"","sources":["../src/setup-note.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,2EAA2E;AAC3E,eAAO,MAAM,eAAe,QAEkF,CAAC;AAE/G,uDAAuD;AACvD,eAAO,MAAM,0BAA0B,cAAc,CAAC;AAItD,8EAA8E;AAC9E,wBAAgB,YAAY,IAAI,IAAI,CAEnC;AAED,mBAAmB;AACnB,wBAAgB,cAAc,IAAI,IAAI,CAErC;AAYD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,YAAY,CAe7F"}
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ /**
3
+ * One-time tip for Claude Desktop: how to make TotalReclaw Claude's main memory.
4
+ *
5
+ * Claude's own memory is on by default and is used before TotalReclaw. After
6
+ * credentials were activated by a pairing in THIS process (not at startup),
7
+ * the first successful `totalreclaw_account` / `totalreclaw_status` result gets
8
+ * one extra final paragraph: a tip for the user (not an instruction to the
9
+ * host). Once per pairing (a new pairing in the same process arms it again). No other tool is touched.
10
+ *
11
+ * Only Claude Desktop sees it (MCP `clientInfo.name` is exactly `claude-ai`).
12
+ * For any other client, or when clientInfo is missing, the tip is dropped
13
+ * silently and never shown.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.CLAUDE_DESKTOP_CLIENT_NAME = exports.SETUP_NOTE_TEXT = void 0;
17
+ exports.armSetupNote = armSetupNote;
18
+ exports.resetSetupNote = resetSetupNote;
19
+ exports.withSetupNote = withSetupNote;
20
+ /** Approved user-facing copy. Do not edit without the owner's approval. */
21
+ exports.SETUP_NOTE_TEXT = 'Tip for the user: in Claude apps, Claude\'s own memory is usually on and is used before TotalReclaw. ' +
22
+ 'To have Claude use TotalReclaw automatically in future chats, just say: "Make TotalReclaw my main memory."';
23
+ /** MCP `clientInfo.name` that Claude Desktop sends. */
24
+ exports.CLAUDE_DESKTOP_CLIENT_NAME = 'claude-ai';
25
+ let pending = false;
26
+ /** Arm the tip (called when a reload activated credentials after pairing). */
27
+ function armSetupNote() {
28
+ pending = true;
29
+ }
30
+ /** Test helper. */
31
+ function resetSetupNote() {
32
+ pending = false;
33
+ }
34
+ /** True when the result is a soft error: a text block holding a JSON object with an `error` key. */
35
+ function isSoftError(text) {
36
+ try {
37
+ const v = JSON.parse(text);
38
+ return typeof v === 'object' && v !== null && !Array.isArray(v) && 'error' in v;
39
+ }
40
+ catch {
41
+ return false;
42
+ }
43
+ }
44
+ /**
45
+ * Append the tip to a successful result, once, for Claude Desktop only.
46
+ * Errors (isError, or a JSON `{"error": ...}` text) pass through and keep it armed. For any other client the tip is
47
+ * disarmed without a trace.
48
+ */
49
+ function withSetupNote(res, clientName) {
50
+ if (!pending || res.isError)
51
+ return res;
52
+ if (clientName !== exports.CLAUDE_DESKTOP_CLIENT_NAME) {
53
+ pending = false;
54
+ return res;
55
+ }
56
+ const content = res.content ?? [];
57
+ const idx = content.map((c) => c.type).lastIndexOf('text');
58
+ if (idx < 0)
59
+ return res;
60
+ if (isSoftError(content[idx].text))
61
+ return res;
62
+ pending = false;
63
+ const next = content.slice();
64
+ const last = next[idx];
65
+ next[idx] = { ...last, text: `${last.text}\n\n${exports.SETUP_NOTE_TEXT}` };
66
+ return { ...res, content: next };
67
+ }
68
+ //# sourceMappingURL=setup-note.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup-note.js","sourceRoot":"","sources":["../src/setup-note.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAeH,oCAEC;AAGD,wCAEC;AAiBD,sCAeC;AAlDD,2EAA2E;AAC9D,QAAA,eAAe,GAC1B,uGAAuG;IACvG,4GAA4G,CAAC;AAE/G,uDAAuD;AAC1C,QAAA,0BAA0B,GAAG,WAAW,CAAC;AAEtD,IAAI,OAAO,GAAG,KAAK,CAAC;AAEpB,8EAA8E;AAC9E,SAAgB,YAAY;IAC1B,OAAO,GAAG,IAAI,CAAC;AACjB,CAAC;AAED,mBAAmB;AACnB,SAAgB,cAAc;IAC5B,OAAO,GAAG,KAAK,CAAC;AAClB,CAAC;AAED,oGAAoG;AACpG,SAAS,WAAW,CAAC,IAAY;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}
@@ -1 +1 @@
1
- {"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/tools/account.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAI9C,eAAO,MAAM,qBAAqB;;;;;;;;;;;;CAYjC,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,cAAc,EAAE,UAAU,GAAG,QAAQ,CAAC;IACtC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,OAAO,EAAE,UAAU,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,GAAG,MAAM,CAIjF;AAED,kFAAkF;AAClF,wBAAgB,0BAA0B,IAAI;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,EAAE,IAAI,CAAA;CAAE,CAU9G;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,gBAAgB,EACvB,IAAI,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;CAAE,GAC/D,WAAW,CAQb;AAUD;;;;;;;GAOG;AACH,wBAAsB,aAAa,CACjC,GAAG,EAAE,WAAW,EAChB,KAAK,CAAC,EAAE,OAAO,GACd,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAgD7D"}
1
+ {"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/tools/account.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAI9C,eAAO,MAAM,qBAAqB;;;;;;;;;;;;CAYjC,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,cAAc,EAAE,UAAU,GAAG,QAAQ,CAAC;IACtC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,OAAO,EAAE,UAAU,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,GAAG,MAAM,CAIjF;AAED,kFAAkF;AAClF,wBAAgB,0BAA0B,IAAI;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,EAAE,IAAI,CAAA;CAAE,CAU9G;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,gBAAgB,EACvB,IAAI,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;CAAE,GAC/D,WAAW,CAQb;AAgBD;;;;;;;GAOG;AACH,wBAAsB,aAAa,CACjC,GAAG,EAAE,WAAW,EAChB,KAAK,CAAC,EAAE,OAAO,GACd,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAyD7D"}
@@ -101,7 +101,7 @@ async function handleAccount(ctx, _args) {
101
101
  }
102
102
  const billing = billingResult.data;
103
103
  const tierLabel = billing.tier === 'pro' ? 'Pro' : 'Free';
104
- const remaining = billing.free_writes_limit - billing.free_writes_used;
104
+ const remaining = Math.max(0, billing.free_writes_limit - billing.free_writes_used);
105
105
  return {
106
106
  content: [{
107
107
  type: 'text',
@@ -113,6 +113,15 @@ async function handleAccount(ctx, _args) {
113
113
  writes_used: billing.free_writes_used,
114
114
  writes_limit: billing.free_writes_limit,
115
115
  remaining_writes: remaining,
116
+ ...(typeof billing.upgrade_writes_limit === 'number'
117
+ ? { upgrade_writes_limit: billing.upgrade_writes_limit }
118
+ : {}),
119
+ ...(typeof billing.write_grace === 'number'
120
+ ? { write_grace: billing.write_grace }
121
+ : {}),
122
+ ...(typeof billing.topup_writes_remaining === 'number'
123
+ ? { topup_writes_remaining: billing.topup_writes_remaining }
124
+ : {}),
116
125
  total_facts_stored: factCount,
117
126
  features: billing.features ?? {},
118
127
  credential: credentialStatus,
@@ -1 +1 @@
1
- {"version":3,"file":"account.js","sourceRoot":"","sources":["../../src/tools/account.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAkCH,4CAIC;AAGD,gEAUC;AAMD,0DAWC;AAkBD,sCAmDC;AAtID,8CAAyD;AACzD,kDAA8C;AAEjC,QAAA,qBAAqB,GAAG;IACnC,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,qCAAwB;IACrC,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,EAAE;KACf;IACD,WAAW,EAAE;QACX,YAAY,EAAE,IAAI;QAClB,eAAe,EAAE,KAAK;QACtB,cAAc,EAAE,IAAI;KACrB;CACF,CAAC;AAYF;;;GAGG;AACH,SAAgB,gBAAgB,CAAC,IAAwC;IACvE,OAAO,IAAI,KAAK,QAAQ;QACtB,CAAC,CAAC,gEAAgE;QAClE,CAAC,CAAC,+CAA+C,CAAC;AACtD,CAAC;AAED,kFAAkF;AAClF,SAAgB,0BAA0B;IACxC,OAAO;QACL,OAAO,EAAE,CAAC;gBACR,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;oBACnB,KAAK,EAAE,mGAAmG;iBAC3G,CAAC;aACH,CAAC;QACF,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAgB,uBAAuB,CACrC,KAA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,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtE,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB;AAYD,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4CpC,CAAC;AA2CF;;;;;;;;;;GAUG;AACH,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,WAAW,EAChB,IAAI,EAAE,OAAO,GACZ,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CA0L7D"}
@@ -192,7 +192,10 @@ async function handleImportFrom(ctx, args) {
192
192
  }
193
193
  // Store facts via client.remember()
194
194
  let imported = 0;
195
- let skippedDuplicate = 0;
195
+ // The self-hosted server reports a content-fingerprint duplicate inside a
196
+ // successful response, never as an error, and the client sends no
197
+ // fingerprint, so nothing here is counted as a duplicate (#778).
198
+ const skippedDuplicate = 0;
196
199
  const skippedInvalid = 0;
197
200
  const storeErrors = [];
198
201
  for (let i = 0; i < parseResult.facts.length; i++) {
@@ -213,18 +216,12 @@ async function handleImportFrom(ctx, args) {
213
216
  imported++;
214
217
  }
215
218
  catch (e) {
216
- const msg = e instanceof Error ? e.message : 'Unknown error';
217
- // Content fingerprint dedup returns 409
218
- if (msg.includes('409') || msg.includes('duplicate') || msg.includes('fingerprint')) {
219
- skippedDuplicate++;
220
- }
221
- else {
222
- storeErrors.push({
223
- index: i,
224
- text_preview: fact.text.slice(0, 60),
225
- error: msg,
226
- });
227
- }
219
+ // Every error is a real failure: the fact was not stored (#778).
220
+ storeErrors.push({
221
+ index: i,
222
+ text_preview: fact.text.slice(0, 60),
223
+ error: e instanceof Error ? e.message : 'Unknown error',
224
+ });
228
225
  }
229
226
  // Limit individual errors reported
230
227
  if (storeErrors.length >= 20) {
@@ -237,7 +234,7 @@ async function handleImportFrom(ctx, args) {
237
234
  }
238
235
  }
239
236
  const result = {
240
- success: imported > 0 || skippedDuplicate > 0,
237
+ success: imported > 0,
241
238
  source: input.source,
242
239
  total_found: parseResult.facts.length,
243
240
  imported,
@@ -1 +1 @@
1
- {"version":3,"file":"import-from.js","sourceRoot":"","sources":["../../src/tools/import-from.ts"],"names":[],"mappings":";;;AAwKA,4CAgMC;AAtWD,yCAAoC;AACpC,8CAA6D;AAiE7D,+EAA+E;AAElE,QAAA,wBAAwB,GAAG;IACtC,IAAI,EAAE,yBAAyB;IAC/B,WAAW,EAAE,yCAA4B;IACzC,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC;gBAC3D,WAAW,EAAE,iIAAiI;aAC/I;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,+EAA+E;aAC7F;YACD,cAAc,EAAE;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,uCAAuC;aACrD;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,uEAAuE;aACrF;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,kDAAkD;aAChE;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,KAAK;gBACd,WAAW,EAAE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IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;aACzD,CAAC;KACH,CAAC;AACJ,CAAC"}
@@ -6,8 +6,8 @@
6
6
  * a 12-word BIP-39 recovery phrase, encrypts it via x25519 ECDH + AES-256-GCM,
7
7
  * and uploads the ciphertext to the same relay this MCP server already talks
8
8
  * to. The MCP server decrypts the phrase locally and writes
9
- * `~/.totalreclaw/credentials.json` so a host restart picks the user up in
10
- * configured mode.
9
+ * `~/.totalreclaw/credentials.json`; the server then loads it (3.6.1) so the
10
+ * memory tools work in the same chat.
11
11
  *
12
12
  * Phrase-safety invariants (see project_phrase_safety_rule):
13
13
  * - The phrase NEVER appears in the tool's return payload.
@@ -32,11 +32,12 @@
32
32
  * the relay's pairing session expires (the `expires_at` the relay returns,
33
33
  * 10 minutes on the current relay, plus a short grace). It used to stop
34
34
  * after 60 seconds, which closed the session before a user in generate mode
35
- * could write down 12 words and retype 3 of them. Credentials are read once,
36
- * at startup (`index.ts` `main()`), so after completion the user must fully
37
- * quit and reopen their MCP host (Claude Desktop / Cursor / Claude Code) for
38
- * the server to re-read credentials.json and switch out of `unconfigured`
39
- * mode.
35
+ * could write down 12 words and retype 3 of them. Credentials are read at
36
+ * startup (`index.ts` `main()`) and, since 3.6.1, again once this task has
37
+ * written credentials.json (`onCredentialsWritten`, no arguments: the server
38
+ * re-reads the file from disk through the same validated path as startup), so
39
+ * no host restart is needed. A file written by another process while this one
40
+ * is unconfigured is picked up on the next tool call (`dispatch.ts`).
40
41
  *
41
42
  * Existing-credentials guard (mirrors Hermes, `python/src/totalreclaw/hermes/pair_tool.py`):
42
43
  * `~/.totalreclaw/credentials.json` is shared with every TotalReclaw client
@@ -162,6 +163,8 @@ export declare function runPairBackgroundTask(opts: {
162
163
  log?: (level: 'info' | 'warn' | 'error', msg: string) => void;
163
164
  /** Override the credentials.json path — for tests. */
164
165
  credentialsPath?: string;
166
+ /** See `HandlePairOptions.onCredentialsWritten`. */
167
+ onCredentialsWritten?: () => void | Promise<void>;
165
168
  }): Promise<void>;
166
169
  export interface HandlePairOptions {
167
170
  /** Override relay URL — for tests. */
@@ -180,15 +183,22 @@ export interface HandlePairOptions {
180
183
  /**
181
184
  * True when the running server already has a credential (managed or
182
185
  * self-hosted mode). Wired by `index.ts`. The guard also checks
183
- * credentials.json on disk, which covers a pairing completed earlier in
184
- * this process (the server stays unconfigured until restart) and a file
185
- * this server can't read.
186
+ * credentials.json on disk, which covers a pairing whose reload has not
187
+ * finished yet and a file this server can't read.
186
188
  */
187
189
  isConfigured?: () => boolean;
188
190
  /** Set when startup found a credentials file it can't use. Wired by `index.ts`. */
189
191
  getUnusableCredentials?: () => UnusableCredentials | undefined;
190
192
  /** Override the credentials.json path — for tests. */
191
193
  credentialsPath?: string;
194
+ /**
195
+ * Called (no arguments) after credentials.json was written, any replace
196
+ * bookkeeping finished, and the relay ack/nack was decided. `index.ts` wires
197
+ * it to the credential reload, which re-reads the file from disk; nothing
198
+ * secret is passed. A throw or rejection is logged and never changes the
199
+ * ack the relay got.
200
+ */
201
+ onCredentialsWritten?: () => void | Promise<void>;
192
202
  /** Override the session opener — for tests. */
193
203
  openSession?: typeof openRemotePairSession;
194
204
  }
@@ -216,8 +226,8 @@ export declare function handlePair(_ctx: ToolContext, args: Record<string, unkno
216
226
  /**
217
227
  * The steps the agent relays to the user. Kept in step with what actually
218
228
  * happens: the relay page ends on "You're all set", the link lives as long as
219
- * the relay session, and the memory tools only work after the host restarts
220
- * (credentials are read once, at startup). Exported for tests.
229
+ * the relay session, and the server loads the new credentials by itself, so
230
+ * the memory tools work right away (3.6.1). Exported for tests.
221
231
  */
222
232
  export declare function pairInstructions(mode: 'generate' | 'import', minutesLeft: number): string[];
223
233
  //# sourceMappingURL=pair.d.ts.map