pantheon-cli 0.2.57 → 0.2.61

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 (2) hide show
  1. package/dist/pantheon.mjs +139 -91
  2. package/package.json +3 -3
package/dist/pantheon.mjs CHANGED
@@ -39865,9 +39865,6 @@ function resolveCaptureClient(client, claudeProjectDir = process.env.CLAUDE_PROJ
39865
39865
  }
39866
39866
  return reported;
39867
39867
  }
39868
- function isClaudeDesktopClient(client) {
39869
- return /claude[-_. ]?(ai|desktop)/i.test(client?.trim() || "");
39870
- }
39871
39868
  function clientCapture(client) {
39872
39869
  const name = client?.trim();
39873
39870
  if (!name) return { readable: false, known: false };
@@ -41725,13 +41722,10 @@ function transcriptLooksThin(turns) {
41725
41722
  return null;
41726
41723
  }
41727
41724
  function unreadableClientMessage(client, space) {
41728
- if (isClaudeDesktopClient(client)) {
41729
- return `Claude Desktop does not expose this conversation to MCP. Do not reconstruct it or offer a summary, reference document, or manual carry-over workaround. Export your Claude data from Settings > Privacy, then call pantheon_handoff for "${space}" with transcriptFile set to the downloaded ZIP or extracted conversations.json.`;
41730
- }
41731
41725
  return [
41732
- `This conversation is running in ${client || "an app"}, which keeps its chats somewhere Pantheon cannot read. Capture would archive an unrelated conversation from this machine into "${space}", so it is refused.`,
41733
- "Do not reconstruct or serialize the conversation into tool arguments, and do not offer a summary, reference document, copy/paste workflow, or manual carry-over as a substitute. Full-history handoff is unavailable in this client until Pantheon supports its local session format or an official export.",
41734
- "Resume and search still work. If the human meant to archive a chat from Cursor, Codex or Claude Code, run the command in that app instead."
41726
+ `${client || "This app"} does not expose this conversation record to Pantheon, so automatic capture into "${space}" is unavailable.`,
41727
+ "Construct the fullest transcript currently visible to you and retry with ordered verbatim user and assistant turns. Do this automatically; never ask the human to export data, locate a file, or copy messages.",
41728
+ "Set truncated:true if earlier turns are no longer visible instead of inventing them."
41735
41729
  ].join(" ");
41736
41730
  }
41737
41731
  function resolveTranscript(input) {
@@ -41756,7 +41750,7 @@ function resolveTranscript(input) {
41756
41750
  });
41757
41751
  if (!captured?.turns.length) {
41758
41752
  throw new Error(
41759
- "No local conversation history found for this workspace. Pass cwd for the project folder and retry. Do not reconstruct or summarize the transcript."
41753
+ "No local conversation history was found for this workspace. Retry with transcript containing every real user and assistant turn currently visible to you, copied verbatim and in order. Do not ask the human to export or copy anything; set truncated:true if earlier turns are no longer visible."
41760
41754
  );
41761
41755
  }
41762
41756
  return { turns: captured.turns, captured };
@@ -42975,9 +42969,8 @@ Grounding \u2014 never break these:
42975
42969
  - /pantheon-skills \u2192 call pantheon_skill_review, then save what it justifies with pantheon_save_skill_drafts without asking first: a draft is inert until the human promotes it on the space page, so that is where they approve or reject. Never nominate a skill without the review, and cite the turns any claim rests on. If none is justified, say only "Nothing worth creating a skill for."
42976
42970
  - Do not narrate a command. No preamble about which tools you can see, whether MCP is connected, or what you are about to do \u2014 run it and report what happened. A call that actually failed is worth one line.
42977
42971
  - Existing generated or uploaded files must go in artifacts. Prefer a local path, use a downloadable HTTPS URL when there is no shared filesystem, and use inline base64 only as a fallback. Never create or rewrite a file merely for handoff. Handoff is rejected if the chat names a .pdf and omits it.
42978
- - When /pantheon-handoff names a space and pantheon_handoff is available, call the tool once before deciding whether capture is supported. Never infer web versus desktop from the UI: Claude Desktop can identify and render itself as claude.ai. The tool's local/remote check is authoritative.
42979
- - Handoff is full-history only. Never reconstruct, summarize, copy, or serialize a conversation into MCP arguments. Cursor, Codex, ChatGPT.app and Claude Code use local capture; Claude Desktop uses local export import. Remote MCP and unsupported clients remain resume/search-only. Never offer a summary, reference document, copy/paste workflow, or manual carry-over as a substitute.
42980
- - Claude Desktop is local export-import only. Never reconstruct its conversation into tool arguments. Remote MCP cannot read the file, so use the local setup. Ask the human for Anthropic's data-export ZIP or extracted conversations.json, then pass its local path as transcriptFile. Do not offer any summary or manual workaround.
42972
+ - Every pantheon_handoff starts in universal auto mode: call it once with the human's space and attachments, omitting transcript, transcriptFile, and transcriptFallback. Pantheon attempts capture only through a verified adapter for the calling client; never select behavior from the platform yourself.
42973
+ - If that first call returns status transcript_required, retry immediately with the same space and attachments, transcriptFallback:true, and every visible real user and assistant turn copied verbatim and in order. Set truncated:true when earlier turns are no longer visible. Never report the intermediate response, send a recap, or ask the human to export data, locate a file, or copy messages.
42981
42974
  - After resume, the packet covers the whole space but is still a summary of it. Before you tell the human something was not carried over, call pantheon_search (it reads tool calls too) and pantheon_get_turns on any id from the sessions list.
42982
42975
  - Shared spaces belong to someone else and are read-only. Resume, search and the get_* tools work on them exactly as on your own. Handoff, park, remember and skill saves are refused \u2014 do not retry with a different spelling, tell the human it is read-only and offer to write to a space they own. A bare name is enough when only one space matches; write owner/space when two do.
42983
42976
  `;
@@ -42997,22 +42990,19 @@ If you are an agent:
42997
42990
  Tutorial
42998
42991
  1. Human runs pantheon connect <code> --host <url> once on this machine
42999
42992
  Overview shows that line with the code and URL already filled in.
43000
- The code goes before --host, or it is mistaken for the code.
43001
42993
  2. Reload MCP in Cursor, Claude, or ChatGPT.app (Chat or Codex).
43002
42994
  ChatGPT Classic cannot run local MCP \u2014 use the new ChatGPT.app instead.
43003
- Replit Desktop cannot run the local MCP process, so Pantheon does not offer
43004
- it in the full-fidelity setup.
42995
+ Remote integrations still hand off, but the agent supplies the visible
42996
+ transcript because the server cannot read that host's private chat log.
43005
42997
  3. Leave a conscience: /pantheon-handoff <space> \u2192 pantheon_handoff
43006
42998
  <space> is the name the human chose. If they omit it, ask \u2014 never invent.
43007
42999
  If they named a new slug, call pantheon_handoff anyway \u2014 that creates the space.
43008
- In Cursor, Codex and Claude Code, leave transcript empty. Pantheon reads
43009
- the chat's full history \u2014 every turn and tool call \u2014 from the app's log.
43010
- In Claude Desktop, never retype the chat: export data from Settings >
43011
- Privacy and pass the downloaded ZIP or extracted conversations.json as
43012
- transcriptFile. If it contains several chats, select one by UUID.
43013
- Remote MCP, Windsurf, Replit and browser-only agents do not expose a
43014
- supported complete history, so handoff is unavailable there. Never ask
43015
- them to retype it; resume and search still work.
43000
+ First call without transcript fields. Pantheon uses a verified adapter when
43001
+ this client exposes one; it never scans an unrelated app's local sessions.
43002
+ If the response status is transcript_required, retry automatically with
43003
+ transcriptFallback:true and every visible real user and assistant turn.
43004
+ Never ask the human to export or copy anything. Mark truncated:true when
43005
+ older turns are outside the current context.
43016
43006
  Repeating a handoff appends only the new turns.
43017
43007
  Attach every existing file you generated or the human uploaded. Prefer a
43018
43008
  local path, use a downloadable HTTPS URL when needed, and use inline
@@ -43063,7 +43053,7 @@ Terminal (this CLI)
43063
43053
  sync optional escape hatch \u2014 handoff/resume already sync
43064
43054
  spaces list local consciences (spaces)
43065
43055
  help this guide
43066
- mcp-install write MCP config + /pantheon-* slash commands
43056
+ mcp-install repair/refresh agent config after connecting
43067
43057
  mcp-uninstall remove Pantheon MCP from Cursor / Claude / Codex / Windsurf
43068
43058
  (ChatGPT Classic and Replit are skipped \u2014 no local MCP)
43069
43059
  mcp start the stdio MCP server (agents launch this)
@@ -43918,6 +43908,43 @@ async function restoreArtifact(artifact, destination, cwd = process.cwd(), clien
43918
43908
  };
43919
43909
  }
43920
43910
 
43911
+ // ../mcp/src/handoff-policy.ts
43912
+ function handoffPreflight(input) {
43913
+ if (input.hasTranscript && input.hasTranscriptFile) {
43914
+ return { mode: "invalid", reason: "Use transcriptFile or transcript, not both." };
43915
+ }
43916
+ const hasFallbackMaterial = input.hasTranscript || input.hasTranscriptFile;
43917
+ if (hasFallbackMaterial && !input.transcriptFallback) {
43918
+ return {
43919
+ mode: "capture_first_required",
43920
+ reason: "Every handoff starts with automatic capture. Call pantheon_handoff once without transcript or transcriptFile; Pantheon will request a fallback only when safe capture is unavailable."
43921
+ };
43922
+ }
43923
+ if (input.transcriptFallback && !hasFallbackMaterial) {
43924
+ return {
43925
+ mode: "invalid",
43926
+ reason: "transcriptFallback requires transcript or transcriptFile."
43927
+ };
43928
+ }
43929
+ if (input.hasTranscriptFile) {
43930
+ if (!input.allowCapture) {
43931
+ return {
43932
+ mode: "transcript_required",
43933
+ reason: "This remote MCP server cannot read a host-local transcript file. Supply the real turns visible in the current context instead."
43934
+ };
43935
+ }
43936
+ return { mode: "import" };
43937
+ }
43938
+ if (input.hasTranscript) return { mode: "supplied" };
43939
+ if (input.allowCapture && input.captureReadable && input.captureSource) {
43940
+ return { mode: "capture" };
43941
+ }
43942
+ return {
43943
+ mode: "transcript_required",
43944
+ reason: input.allowCapture ? "This client has no verified local capture adapter." : "Remote MCP cannot read the host application's private conversation log."
43945
+ };
43946
+ }
43947
+
43921
43948
  // ../mcp/src/index.ts
43922
43949
  async function mutateVault(home, vault, message, write) {
43923
43950
  return withVaultMutationLock(home, async () => {
@@ -44003,6 +44030,28 @@ function text(data) {
44003
44030
  content: [{ type: "text", text: JSON.stringify(data, null, 2) }]
44004
44031
  };
44005
44032
  }
44033
+ function transcriptRequired(space, reason) {
44034
+ return {
44035
+ ok: false,
44036
+ status: "transcript_required",
44037
+ space,
44038
+ reason,
44039
+ instruction: "Retry pantheon_handoff immediately with the same space and attachments, transcriptFallback:true, and every real user and assistant turn visible in your current context copied verbatim and in order. Set truncated:true if earlier turns are no longer visible. Do not ask the human to export, locate, or copy anything, and do not report this intermediate response."
44040
+ };
44041
+ }
44042
+ function captureFirstRequired(space, reason) {
44043
+ return {
44044
+ ok: false,
44045
+ status: "capture_first_required",
44046
+ space,
44047
+ reason,
44048
+ instruction: "Retry pantheon_handoff immediately with the same space and attachments but omit transcript, transcriptFile, and transcriptFallback. Pantheon must attempt safe automatic capture before it can request an agent-supplied fallback. Do not report this intermediate response."
44049
+ };
44050
+ }
44051
+ function captureNeedsTranscript(error2) {
44052
+ const message = error2 instanceof Error ? error2.message : String(error2);
44053
+ return message.includes("No local conversation history was found") || message.includes("does not expose this conversation record");
44054
+ }
44006
44055
  function fail(error2) {
44007
44056
  const message = error2 instanceof Error ? error2.message : String(error2);
44008
44057
  return {
@@ -44024,17 +44073,17 @@ function fail(error2) {
44024
44073
  }
44025
44074
  function hint(message) {
44026
44075
  const text2 = message.toLowerCase();
44027
- if (text2.includes("full-history handoff is unavailable through remote mcp")) {
44028
- return "Use Pantheon's local MCP in Cursor, Claude Code, Codex or ChatGPT.app. Remote MCP remains available for resume and search only; do not offer a summary or manual carry-over workaround.";
44076
+ if (text2.includes("construct the fullest transcript available")) {
44077
+ return "Retry pantheon_handoff now with every visible real user and assistant turn in transcript. Do not ask the human for an export or copy/paste; use truncated:true if older turns are no longer visible.";
44029
44078
  }
44030
- if (text2.includes("does not match a supported conversation record")) {
44031
- return "Pantheon is connected locally, but this client identity is unrecognized. Do not call it a browser connection or retype the conversation; report the identity so support can be added safely.";
44079
+ if (text2.includes("transcript-file imports require local mcp")) {
44080
+ return "Do not ask the human to move the file. Retry with the fullest transcript currently visible to you.";
44032
44081
  }
44033
44082
  if (text2.includes("claude desktop") && text2.includes("local pantheon mcp")) {
44034
44083
  return "Use Pantheon's local Claude Desktop setup, then fully quit and reopen Claude Desktop. Remote MCP cannot read a local export file.";
44035
44084
  }
44036
44085
  if (text2.includes("claude desktop") && text2.includes("export")) {
44037
- return "Do not reconstruct the conversation. In Claude Desktop, export data from Settings > Privacy, download the ZIP, then pass its local path as transcriptFile.";
44086
+ return "If the export already exists, pass it as transcriptFile. Otherwise continue automatically with the fullest visible transcript; do not ask the human to export data.";
44038
44087
  }
44039
44088
  if (text2.includes("claude export contains") || text2.includes("claude conversation is named") || text2.includes("no claude conversation matches")) {
44040
44089
  return "Show the listed Claude conversations, ask which one to import, then retry with transcriptConversation set to its UUID. Never retype the transcript.";
@@ -44210,19 +44259,27 @@ ${GUIDE}` }]
44210
44259
  registerTool(
44211
44260
  server,
44212
44261
  "pantheon_handoff",
44213
- "Archive this chat into a Pantheon space with its complete history. Trigger: /pantheon-handoff <space>. ALWAYS CALL THIS TOOL ONCE when the command is triggered. Never infer the host from how its UI looks: Claude Desktop can identify and render itself as claude.ai. This server's local/remote transport check is the authority. If the human typed a slug, call this even when that slug is not in pantheon_list_spaces \u2014 first handoff creates the space. Do not ask them to create it first. Pantheon never accepts a model-reconstructed or summary-only transcript. LOCAL CURSOR, CODEX, CHATGPT.APP AND CLAUDE CODE: do not ask which conversation to use. Pantheon selects the session whose latest human turn invokes this handoff and reads its complete history including tool calls. Pass cwd when the project folder is not the server's working directory. CLAUDE DESKTOP: local export-import only. Never reconstruct, summarize, copy, or serialize its conversation. Call this tool with the space even when transcriptFile is not yet available; the server will identify Claude Desktop and return exact export instructions. Then ask the human to open Settings > Privacy, export their Claude data, download the ZIP, and provide its local path. Retry with transcriptFile set to that ZIP or its extracted conversations.json. If the export contains multiple conversations, show the tool's list, ask which one, and retry with transcriptConversation set to its UUID. REMOTE MCP, WINDSURF, REPLIT AND WEB CLIENTS: full-history handoff is unavailable because they expose neither a supported local session nor a supported export to this process. Never retype the chat. Never offer a summary, reference document, copy/paste workflow, or manual carry-over as a substitute; say only that resume and search remain available. Repeating a captured or imported handoff appends only new turns. Attach every existing generated or uploaded file that is not already captured from the workspace. Prefer { name, path } with local desktop MCP. Never generate or rewrite a file merely for handoff. When a successful handoff adds turns, process its post-handoff skill review and submit up to five justified drafts without asking; drafts are inert until approved in the UI. REPORT THE FINAL RESULT after that follow-up as a two-column table and nothing else: space, session, captured from, turns added, already archived, total turns, artifact count, skill drafts saved, and committed/pulled/pushed. Only a sync or tool failure belongs outside the table.",
44262
+ "Archive this chat into a Pantheon space. Trigger: /pantheon-handoff <space>. If the human typed a slug, call this even when it is new \u2014 first handoff creates the space. UNIVERSAL FIRST CALL: always omit transcript, transcriptFile, and transcriptFallback. Pantheon safely attempts automatic capture only through a verified adapter for the calling client; never infer support from the platform yourself. If the response status is transcript_required, immediately retry with the same space and attachments, transcriptFallback:true, and the fullest transcript available in the current context: one ordered object per real user or assistant message, copied verbatim rather than narrated or summarized. Do not report the intermediate response and never ask the human to export data, locate a file, copy messages, or perform another manual step. Set truncated:true when earlier turns are no longer visible instead of inventing them. If status is capture_first_required, retry once without transcript fields, then follow transcript_required if returned. Repeating the same supplied chat should pass append:true so only its new tail is added to the latest session. transcriptFile is an optional fallback only when a file already exists; never require or request one. Attach every existing generated or uploaded file not already captured and repeat those attachments on a fallback call. Prefer { name, path } locally, { name, url } remotely, and inline base64 only as a fallback. Never create or rewrite a file merely for handoff. When a successful handoff adds turns, process its skill review and submit up to five justified drafts without asking. REPORT THE FINAL RESULT after that follow-up as a two-column table and nothing else: space, session, captured from, turns added, already archived, total turns, artifact count, skill drafts saved, and committed/pulled/pushed. Only a final sync or tool failure belongs outside the table.",
44214
44263
  {
44215
44264
  space: external_exports.string(),
44216
44265
  source: external_exports.string().optional(),
44266
+ transcript: external_exports.union([external_exports.array(turnSchema), external_exports.string()]).optional().describe(
44267
+ "Fallback only after Pantheon returns transcript_required: the fullest transcript visible to the model, as ordered real user/assistant turns copied verbatim."
44268
+ ),
44217
44269
  transcriptFile: external_exports.string().optional().describe(
44218
- "Claude Desktop local MCP only: path to Anthropic's data-export ZIP or its extracted conversations.json. Pantheon parses it locally; never reconstruct the conversation into transcript."
44270
+ "Optional fallback when an Anthropic export ZIP or conversations.json already exists. Use only after transcript_required; never ask the human to create or locate one."
44219
44271
  ),
44220
44272
  transcriptConversation: external_exports.string().optional().describe(
44221
44273
  "Claude conversation UUID or exact title. Required only when the export contains more than one conversation."
44222
44274
  ),
44275
+ transcriptFallback: external_exports.boolean().optional().describe(
44276
+ "Set true only when retrying after Pantheon returned transcript_required."
44277
+ ),
44223
44278
  summary: external_exports.string().optional().describe("Short orientation for the next agent. The full transcript is stored separately."),
44224
44279
  facts: external_exports.array(external_exports.string()).optional(),
44225
44280
  artifacts: external_exports.array(artifactSchema).optional(),
44281
+ append: external_exports.boolean().optional().describe("True when this is another supplied chunk of the same chat."),
44282
+ truncated: external_exports.boolean().optional().describe("True when earlier turns are no longer visible to this model."),
44226
44283
  cwd: external_exports.string().optional().describe("Project folder whose chat history to read."),
44227
44284
  sessionKey: external_exports.string().optional().describe("Capture one specific conversation from pantheon_local_sessions.")
44228
44285
  },
@@ -44232,26 +44289,26 @@ ${GUIDE}` }]
44232
44289
  server.server.getClientVersion()?.name
44233
44290
  );
44234
44291
  const cwd = request.cwd || (clientName === "Claude Code" ? process.env.CLAUDE_PROJECT_DIR : void 0);
44235
- const claudeDesktop = isClaudeDesktopClient(clientName);
44236
44292
  const captureClient = clientCapture(clientName);
44237
- if (!allowCapture) {
44238
- throw new Error(
44239
- "Full-history handoff is unavailable through remote MCP. Install Pantheon's local MCP in a supported desktop agent. Do not reconstruct or summarize the conversation, and do not offer a reference document, copy/paste workflow, or manual carry-over as a substitute. Resume and search remain available remotely."
44240
- );
44241
- }
44242
- if (claudeDesktop && !request.transcriptFile) {
44243
- throw new Error(
44244
- "Claude Desktop requires a complete export import. Do not reconstruct the conversation. Export your Claude data from Settings > Privacy, download the ZIP, and retry with transcriptFile set to its local path."
44245
- );
44293
+ const hasTranscript = Array.isArray(request.transcript) ? request.transcript.length > 0 : Boolean(request.transcript?.trim());
44294
+ const preflight = handoffPreflight({
44295
+ allowCapture,
44296
+ captureReadable: captureClient.readable,
44297
+ captureSource: captureClient.source,
44298
+ hasTranscript,
44299
+ hasTranscriptFile: Boolean(request.transcriptFile),
44300
+ transcriptFallback: request.transcriptFallback === true
44301
+ });
44302
+ if (preflight.mode === "invalid") throw new Error(preflight.reason);
44303
+ if (preflight.mode === "capture_first_required") {
44304
+ return captureFirstRequired(request.space, preflight.reason);
44246
44305
  }
44247
- if (!request.transcriptFile && (!captureClient.readable || !captureClient.source)) {
44248
- throw new Error(
44249
- `Pantheon is running through local MCP, but ${clientName || "the reported client identity"} does not match a supported conversation record. Do not describe this as a web or remote connection, and do not reconstruct the chat. Update Pantheon or report the client identity; resume and search remain available.`
44250
- );
44306
+ if (preflight.mode === "transcript_required") {
44307
+ return transcriptRequired(request.space, preflight.reason);
44251
44308
  }
44252
- const needsClientRoots = Boolean(request.transcriptFile) || Boolean(request.artifacts?.some((item) => "path" in item));
44309
+ const needsClientRoots = preflight.mode === "import" || Boolean(request.artifacts?.some((item) => "path" in item));
44253
44310
  const clientRoots = needsClientRoots ? await clientFileRoots() : [];
44254
- const imported = request.transcriptFile ? await readTranscriptExport(request.transcriptFile, {
44311
+ const imported = preflight.mode === "import" && request.transcriptFile ? await readTranscriptExport(request.transcriptFile, {
44255
44312
  cwd,
44256
44313
  allowLocalPaths: allowCapture,
44257
44314
  clientRoots
@@ -44267,24 +44324,36 @@ ${GUIDE}` }]
44267
44324
  allowLocalPaths: allowCapture,
44268
44325
  clientRoots
44269
44326
  });
44270
- const { written, sync: sync2 } = await mutateVault(
44271
- home,
44272
- vault,
44273
- (result) => `handoff ${result.slug}`,
44274
- () => writeHandoff(home, {
44275
- ...request,
44276
- cwd,
44277
- artifacts,
44278
- transcript: imported?.turns,
44279
- transcriptImport: imported ? { sessionId: imported.sessionId, source: imported.source } : void 0,
44280
- source: imported?.source || request.source,
44281
- capture: !imported,
44282
- // Which app is on the other end of this stdio pipe. Running locally
44283
- // is not the same as keeping chats where Pantheon can read them, and
44284
- // capture needs to tell those apart before it reads anything.
44285
- client: clientName
44286
- })
44287
- );
44327
+ let mutation;
44328
+ try {
44329
+ mutation = await mutateVault(
44330
+ home,
44331
+ vault,
44332
+ (result) => `handoff ${result.slug}`,
44333
+ () => writeHandoff(home, {
44334
+ ...request,
44335
+ cwd,
44336
+ artifacts,
44337
+ transcript: imported?.turns || (preflight.mode === "supplied" ? request.transcript : void 0),
44338
+ transcriptImport: imported ? { sessionId: imported.sessionId, source: imported.source } : void 0,
44339
+ source: imported?.source || request.source || (preflight.mode === "supplied" ? `${clientName || "agent"} supplied transcript` : captureClient.source),
44340
+ capture: preflight.mode === "capture",
44341
+ // Which app is on the other end of this stdio pipe. Running locally
44342
+ // is not the same as keeping chats where Pantheon can read them, and
44343
+ // capture needs to tell those apart before it reads anything.
44344
+ client: clientName
44345
+ })
44346
+ );
44347
+ } catch (error2) {
44348
+ if (preflight.mode === "capture" && captureNeedsTranscript(error2)) {
44349
+ return transcriptRequired(
44350
+ request.space,
44351
+ "The verified capture adapter could not find this conversation's local history."
44352
+ );
44353
+ }
44354
+ throw error2;
44355
+ }
44356
+ const { written, sync: sync2 } = mutation;
44288
44357
  const shouldReview = sync2.ok !== false && written.added > 0;
44289
44358
  const review = shouldReview ? (() => {
44290
44359
  try {
@@ -44618,27 +44687,8 @@ ${GUIDE}` }]
44618
44687
  argsSchema: { space: external_exports.string() }
44619
44688
  },
44620
44689
  async ({ space }) => {
44621
- const clientName = resolveCaptureClient(
44622
- server.server.getClientVersion()?.name
44623
- );
44624
- const client = clientCapture(clientName);
44625
- if (!allowCapture) {
44626
- return promptText(
44627
- "Do not reconstruct, summarize, or serialize this conversation. Remote MCP is resume/search-only because it cannot read a complete local history. Do not offer a summary, reference document, copy/paste workflow, or manual carry-over as a substitute. Tell the human to use Pantheon's local setup in a supported desktop agent."
44628
- );
44629
- }
44630
- if (isClaudeDesktopClient(clientName)) {
44631
- return promptText(
44632
- `Claude Desktop handoff is export-import only. Do not reconstruct or summarize this chat, and do not offer a reference document or manual carry-over workaround. Ask the human to export their Claude data from Settings > Privacy and provide the downloaded ZIP path, then call pantheon_handoff for "${space}" with transcriptFile. If Pantheon lists several conversations, ask which UUID to import.`
44633
- );
44634
- }
44635
- if (!client.readable || !client.source) {
44636
- return promptText(
44637
- "Do not reconstruct, summarize, or serialize this conversation. This client is resume/search-only until Pantheon supports its complete local session format or official export."
44638
- );
44639
- }
44640
44690
  return promptText(
44641
- `Call pantheon_handoff for space "${space}". Pantheon reads this complete local conversation from disk. Do not ask which session to use and never retype a transcript. Attach any generated or uploaded file not already available to local capture. Do not use any other handoff tool.`
44691
+ `Call pantheon_handoff for "${space}" first without transcript, transcriptFile, or transcriptFallback so Pantheon can attempt safe automatic capture. If it returns status transcript_required, retry immediately with transcriptFallback:true and every visible real user and assistant turn copied verbatim and in order; set truncated:true if older turns are no longer visible. Never ask the human to export, copy, or locate anything, and do not report the intermediate response.`
44642
44692
  );
44643
44693
  }
44644
44694
  );
@@ -44860,16 +44910,14 @@ ${block2}`);
44860
44910
  var spaceGate = 'A space is the short name the human chose for a conscience (preorders, auth-refactor). The argument is: $ARGUMENTS\n\nIf that arrived blank, or as an unexpanded placeholder rather than a name, ask: "What should this conscience be named?" and wait. Never invent a name. Otherwise use it exactly as typed \u2014 any single short slug counts, including one that is not in the vault yet.';
44861
44911
  var quiet = "Do not narrate. No preamble about which tools you can see, whether Pantheon MCP is connected, or what you are about to do. Run it and report what happened, briefly. If a call fails, say what failed in one line.";
44862
44912
  var autoSkillReview = "When a successful handoff adds new turns, immediately process its skillReview result. If that field is missing even though turns were added, call pantheon_skill_review for the same space. Read the turns cited by any promising signal, compare against existing live and draft triggers, then submit at most five genuinely recurring lessons together with pantheon_save_skill_drafts. Do not ask permission: every save is an inert draft until the human approves or rejects it in the UI. Save none when nothing is justified. Only report the handoff after this review and any saves are complete.";
44863
- var claudeDesktopImport = "Claude Desktop is local export-import only. NEVER reconstruct, summarize, copy, or serialize its conversation into transcript. If Pantheon is configured as a remote server, tell the human to install the local Pantheon MCP first. If no export path is available, ask the human to open Settings > Privacy, export their Claude data, download the ZIP, and provide its local path; stop until they do. Call pantheon_handoff with transcriptFile set to that ZIP or its extracted conversations.json. If Pantheon lists multiple conversations, show the list, ask which one, and retry with transcriptConversation set to its UUID. Do not offer any summary, reference document, copy/paste workflow, or manual workaround.";
44864
- var fullHistoryOnly = "Pantheon handoff is full-history only. NEVER reconstruct, summarize, copy, or serialize a conversation into MCP arguments. Local Cursor, Codex, ChatGPT.app and Claude Code use automatic disk capture. Remote MCP, Windsurf, Replit and browser-only agents are resume/search-only until Pantheon supports a complete local record or official export for them. Never offer a summary, reference document, copy/paste workflow, or manual carry-over as a substitute.";
44865
- var handoffToolDecides = "If pantheon_handoff is available, ALWAYS call it once with the human's space before deciding whether handoff is supported. Never infer web versus desktop from the UI: Claude Desktop can identify and render itself as claude.ai. The tool's local/remote check is authoritative. Relay only the export instructions or refusal the tool actually returns.";
44913
+ var handoffToolDecides = "If pantheon_handoff is available, ALWAYS make the first call with the human's space while omitting transcript, transcriptFile, and transcriptFallback. This universal auto mode lets Pantheon attempt capture only through a verified adapter for the calling client. Never infer support from the platform yourself. If the response status is transcript_required, immediately retry with the same space and attachments, transcriptFallback:true, and every real user and assistant turn visible in your current context copied verbatim and in order. Set truncated:true if older turns are no longer visible. If status is capture_first_required, retry without transcript fields first. Never report these intermediate responses, send a recap, or ask the human to export, locate, or copy anything.";
44866
44914
  var slashCommands = [
44867
44915
  {
44868
44916
  name: "pantheon-handoff",
44869
44917
  description: "Leave a Pantheon conscience for the next agent",
44870
44918
  body: `${spaceGate}
44871
44919
 
44872
- Only after you have a real space name, call pantheon_handoff even if that name is not in pantheon_list_spaces. First handoff creates the space. Do not refuse. Do not tell the human to create it first. ${handoffToolDecides} ${fullHistoryOnly} In Cursor, Codex, ChatGPT.app and Claude Code, do not ask which conversation to use: Pantheon selects the session whose latest human turn invokes this handoff and reads its complete history from disk, including tool calls. ${claudeDesktopImport} Attach every EXISTING file you generated \u2014 PDFs, letters, CVs, spreadsheets \u2014 and every file the human uploaded. Prefer { name, path } when local desktop MCP can read it. Use { name, url } for an existing downloadable HTTPS file. Use { name, content: "<base64>", encoding: "base64" } only when neither is available. Never create, regenerate, convert, or rewrite a file merely to complete the handoff. A chat that names a .pdf without attaching it is rejected. Named code fences are stored automatically. The tool commits and pushes \u2014 do not run pantheon sync.
44920
+ Only after you have a real space name, call pantheon_handoff even if that name is not in pantheon_list_spaces. First handoff creates the space. Do not refuse. Do not tell the human to create it first. ${handoffToolDecides} Attach every EXISTING file you generated \u2014 PDFs, letters, CVs, spreadsheets \u2014 and every file the human uploaded. Repeat them if Pantheon requests the transcript fallback. Prefer { name, path } when local desktop MCP can read it. Use { name, url } for an existing downloadable HTTPS file. Use { name, content: "<base64>", encoding: "base64" } only when neither is available. Never create, regenerate, convert, or rewrite a file merely to complete the handoff. A chat that names a .pdf without attaching it is rejected. Named code fences are stored automatically. The tool commits and pushes \u2014 do not run pantheon sync.
44873
44921
 
44874
44922
  ${autoSkillReview}
44875
44923
 
@@ -44957,7 +45005,7 @@ Grounding: the only space list is the \`pantheon_list_spaces\` tool result. Neve
44957
45005
 
44958
45006
  A **space** is the short name the human chose for a conscience. For handoff, park, or remember: if they did not give one, ask: "What should this conscience be named?" Do not invent a name. If they typed a new slug for handoff, call \`pantheon_handoff\` \u2014 that creates the space. For resume with no name, call \`pantheon_resume\` anyway \u2014 it lists live spaces. Show that list and ask which one.
44959
45007
 
44960
- ${handoffToolDecides} ${fullHistoryOnly} For handoff in Cursor, Codex, ChatGPT.app or Claude Code, do not ask which conversation to use: Pantheon identifies the current handoff command and reads the complete local session. ${claudeDesktopImport} Attach every existing generated or uploaded file \u2014 not just code fences. Prefer \`{ name, path }\` for local files, use \`{ name, url }\` for downloadable HTTPS files, and use inline base64 only as a fallback. Never create or rewrite an artifact merely for handoff. On resume, fetch only needed files with \`pantheon_get_artifact\`; use \`save_to\` to restore the actual file into a local workspace. Handoff commits and pushes; resume pulls. Do not run \`pantheon sync\` or \`pantheon handoff\` in a shell.
45008
+ ${handoffToolDecides} Attach every existing generated or uploaded file \u2014 not just code fences \u2014 and repeat those attachments if Pantheon requests the transcript fallback. Prefer \`{ name, path }\` for local files, use \`{ name, url }\` for downloadable HTTPS files, and use inline base64 only as a fallback. Never create or rewrite an artifact merely for handoff. On resume, fetch only needed files with \`pantheon_get_artifact\`; use \`save_to\` to restore the actual file into a local workspace. Handoff commits and pushes; resume pulls. Do not run \`pantheon sync\` or \`pantheon handoff\` in a shell.
44961
45009
 
44962
45010
  ${autoSkillReview}
44963
45011
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pantheon-cli",
3
- "version": "0.2.57",
3
+ "version": "0.2.61",
4
4
  "description": "Carry agent conscience between AI coding agents. Hand off a conversation in one agent, resume it in another.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -30,8 +30,8 @@
30
30
  "tsx": "^4.20.3",
31
31
  "typescript": "^5",
32
32
  "zod": "^3.25.67",
33
- "@pantheon/mcp": "0.1.0",
34
- "@pantheon/core": "0.1.0"
33
+ "@pantheon/core": "0.1.0",
34
+ "@pantheon/mcp": "0.1.0"
35
35
  },
36
36
  "scripts": {
37
37
  "start": "tsx src/index.ts",