pantheon-cli 0.2.128 → 0.2.130

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 +423 -6
  2. package/package.json +1 -1
package/dist/pantheon.mjs CHANGED
@@ -39832,6 +39832,401 @@ var MAX_TIMER_DELAY_MS = 2 ** 31 - 1;
39832
39832
  import { resolve as resolve6 } from "node:path";
39833
39833
  import { fileURLToPath } from "node:url";
39834
39834
 
39835
+ // ../mcp/src/handoff-receipt-ui.ts
39836
+ var MCP_APP_MIME = "text/html;profile=mcp-app";
39837
+ var HANDOFF_RECEIPT_UI_URI = "ui://pantheon/handoff-receipt";
39838
+ function handoffReceiptHtml() {
39839
+ return `<!DOCTYPE html>
39840
+ <html lang="en">
39841
+ <head>
39842
+ <meta charset="utf-8" />
39843
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
39844
+ <title>Handoff results</title>
39845
+ <style>
39846
+ :root {
39847
+ color-scheme: light dark;
39848
+ --bg: #f7f5f1;
39849
+ --fg: #1c1917;
39850
+ --muted: #78716c;
39851
+ --line: #e7e5e4;
39852
+ --ok: #15803d;
39853
+ --warn: #b45309;
39854
+ --chip: #efeae3;
39855
+ --accent: #0f766e;
39856
+ --on-accent: #f8faf9;
39857
+ font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
39858
+ }
39859
+ @media (prefers-color-scheme: dark) {
39860
+ :root {
39861
+ --bg: #1c1917;
39862
+ --fg: #f5f5f4;
39863
+ --muted: #a8a29e;
39864
+ --line: #44403c;
39865
+ --ok: #4ade80;
39866
+ --warn: #fbbf24;
39867
+ --chip: #292524;
39868
+ --accent: #2dd4bf;
39869
+ --on-accent: #042f2e;
39870
+ }
39871
+ }
39872
+ * { box-sizing: border-box; }
39873
+ body {
39874
+ margin: 0;
39875
+ background: var(--bg);
39876
+ color: var(--fg);
39877
+ font-size: 14px;
39878
+ line-height: 1.45;
39879
+ }
39880
+ main { padding: 14px 16px 16px; }
39881
+ .row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
39882
+ .status {
39883
+ display: inline-flex;
39884
+ align-items: center;
39885
+ gap: 6px;
39886
+ border-radius: 999px;
39887
+ padding: 4px 10px;
39888
+ font-size: 12px;
39889
+ font-weight: 600;
39890
+ letter-spacing: 0.02em;
39891
+ text-transform: uppercase;
39892
+ }
39893
+ .status.complete { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
39894
+ .status.incomplete { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
39895
+ h1 { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
39896
+ .meta { margin-top: 6px; color: var(--muted); font-size: 12.5px; }
39897
+ .grid {
39898
+ margin-top: 14px;
39899
+ display: grid;
39900
+ grid-template-columns: repeat(3, minmax(0, 1fr));
39901
+ gap: 8px;
39902
+ }
39903
+ @media (max-width: 420px) {
39904
+ .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
39905
+ }
39906
+ button.stat {
39907
+ appearance: none;
39908
+ border: 1px solid var(--line);
39909
+ background: var(--chip);
39910
+ color: var(--fg);
39911
+ border-radius: 10px;
39912
+ padding: 10px 10px 9px;
39913
+ text-align: left;
39914
+ cursor: pointer;
39915
+ min-height: 64px;
39916
+ }
39917
+ button.stat:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
39918
+ button.stat .label { display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
39919
+ button.stat .value { display: block; font-size: 18px; font-weight: 650; letter-spacing: -0.02em; }
39920
+ .panel {
39921
+ margin-top: 10px;
39922
+ border: 1px solid var(--line);
39923
+ border-radius: 10px;
39924
+ background: color-mix(in srgb, var(--chip) 55%, transparent);
39925
+ padding: 10px 12px;
39926
+ color: var(--muted);
39927
+ font-size: 12.5px;
39928
+ display: none;
39929
+ }
39930
+ .panel.open { display: block; }
39931
+ .issues { margin-top: 14px; display: grid; gap: 8px; }
39932
+ .issue {
39933
+ border: 1px solid var(--line);
39934
+ border-radius: 10px;
39935
+ overflow: hidden;
39936
+ background: var(--chip);
39937
+ }
39938
+ .issue > button {
39939
+ width: 100%;
39940
+ appearance: none;
39941
+ border: 0;
39942
+ background: transparent;
39943
+ color: var(--fg);
39944
+ text-align: left;
39945
+ padding: 10px 12px;
39946
+ cursor: pointer;
39947
+ display: flex;
39948
+ justify-content: space-between;
39949
+ gap: 8px;
39950
+ font: inherit;
39951
+ }
39952
+ .issue .detail {
39953
+ display: none;
39954
+ padding: 0 12px 10px;
39955
+ color: var(--muted);
39956
+ font-size: 12.5px;
39957
+ }
39958
+ .issue.open .detail { display: block; }
39959
+ .actions { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
39960
+ .actions button {
39961
+ appearance: none;
39962
+ border: 1px solid var(--line);
39963
+ background: var(--fg);
39964
+ color: var(--bg);
39965
+ border-radius: 999px;
39966
+ padding: 7px 12px;
39967
+ font: inherit;
39968
+ font-size: 12.5px;
39969
+ font-weight: 600;
39970
+ cursor: pointer;
39971
+ }
39972
+ .actions button.secondary {
39973
+ background: transparent;
39974
+ color: var(--fg);
39975
+ }
39976
+ .actions button:disabled { opacity: 0.55; cursor: default; }
39977
+ .wait { color: var(--muted); font-size: 13px; padding: 8px 0; }
39978
+ .flags { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
39979
+ .flag {
39980
+ border-radius: 999px;
39981
+ border: 1px solid var(--line);
39982
+ padding: 3px 9px;
39983
+ font-size: 11.5px;
39984
+ color: var(--muted);
39985
+ }
39986
+ .flag.yes { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
39987
+ .flag.no { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); }
39988
+ .examples { margin: 8px 0 0; white-space: pre-wrap; font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; }
39989
+ </style>
39990
+ </head>
39991
+ <body>
39992
+ <main>
39993
+ <div id="wait" class="wait">Waiting for handoff\u2026</div>
39994
+ <div id="app" hidden></div>
39995
+ </main>
39996
+ <script>
39997
+ (function () {
39998
+ var nextId = 1;
39999
+ var pending = Object.create(null);
40000
+ var hostOrigin = "*";
40001
+ var receipt = null;
40002
+ var openPanel = null;
40003
+
40004
+ function post(message) {
40005
+ parent.postMessage(message, hostOrigin);
40006
+ }
40007
+
40008
+ function request(method, params) {
40009
+ var id = nextId++;
40010
+ return new Promise(function (resolve, reject) {
40011
+ pending[id] = { resolve: resolve, reject: reject };
40012
+ post({ jsonrpc: "2.0", id: id, method: method, params: params || {} });
40013
+ });
40014
+ }
40015
+
40016
+ function reportSize() {
40017
+ post({
40018
+ jsonrpc: "2.0",
40019
+ method: "ui/notifications/size-changed",
40020
+ params: {
40021
+ width: Math.ceil(document.documentElement.scrollWidth),
40022
+ height: Math.ceil(document.documentElement.scrollHeight)
40023
+ }
40024
+ });
40025
+ }
40026
+
40027
+ function extractReceipt(result) {
40028
+ if (!result) return null;
40029
+ if (result.structuredContent && result.structuredContent.handoffQuality) {
40030
+ return result.structuredContent.handoffQuality;
40031
+ }
40032
+ var blocks = result.content || [];
40033
+ for (var i = 0; i < blocks.length; i++) {
40034
+ var block = blocks[i];
40035
+ if (block && block.type === "text" && typeof block.text === "string") {
40036
+ try {
40037
+ var parsed = JSON.parse(block.text);
40038
+ if (parsed && parsed.handoffQuality) return parsed.handoffQuality;
40039
+ } catch (e) {}
40040
+ }
40041
+ }
40042
+ return null;
40043
+ }
40044
+
40045
+ function esc(value) {
40046
+ return String(value == null ? "" : value)
40047
+ .replace(/&/g, "&amp;")
40048
+ .replace(/</g, "&lt;")
40049
+ .replace(/>/g, "&gt;")
40050
+ .replace(/"/g, "&quot;");
40051
+ }
40052
+
40053
+ function n(value) {
40054
+ return typeof value === "number" ? String(value) : "\u2014";
40055
+ }
40056
+
40057
+ function render() {
40058
+ var root = document.getElementById("app");
40059
+ var wait = document.getElementById("wait");
40060
+ if (!receipt) return;
40061
+ wait.hidden = true;
40062
+ root.hidden = false;
40063
+
40064
+ var incomplete = receipt.status === "incomplete";
40065
+ var captured = receipt.captured || {};
40066
+ var integrity = receipt.captureIntegrity || {};
40067
+ var issues = receipt.issues || [];
40068
+ var stats = [
40069
+ { key: "turns", label: "Turns", value: captured.conversationTurns, tip: "Conversation turns archived in this handoff." },
40070
+ { key: "tools", label: "Tool calls", value: captured.toolCallsCaptured, tip: "Invocations recorded with the transcript." },
40071
+ { key: "files", label: "Artifacts", value: captured.artifacts, tip: "Files stored with the space." },
40072
+ { key: "decisions", label: "Decisions", value: captured.potentialDecisionsIdentified, tip: "Potential decisions identified for review." },
40073
+ { key: "open", label: "Open issues", value: captured.potentialUnresolvedIssuesIdentified, tip: "Potential unresolved issues identified." },
40074
+ {
40075
+ key: "integrity",
40076
+ label: "Integrity",
40077
+ value: integrity.percent == null ? integrity.status || "\u2014" : integrity.percent + "%",
40078
+ tip: integrity.explanation || "Capture integrity for this handoff."
40079
+ }
40080
+ ];
40081
+
40082
+ var html = "";
40083
+ html += '<div class="row">';
40084
+ html += '<span class="status ' + (incomplete ? "incomplete" : "complete") + '">' + esc(receipt.status || "unknown") + "</span>";
40085
+ html += "<h1>" + esc(receipt.heading || "HANDOFF RESULTS") + "</h1>";
40086
+ html += "</div>";
40087
+ html += '<p class="meta">' + esc(receipt.destination || "Pantheon Vault");
40088
+ if (receipt.capturedFrom) html += " \xB7 from " + esc(receipt.capturedFrom);
40089
+ html += "</p>";
40090
+
40091
+ html += '<div class="flags">';
40092
+ html += '<span class="flag ' + (receipt.conversationSafe ? "yes" : "no") + '">Conversation ' + (receipt.conversationSafe ? "safe" : "at risk") + "</span>";
40093
+ html += '<span class="flag ' + (receipt.readyForResume ? "yes" : "no") + '">' + (receipt.readyForResume ? "Ready for resume" : "Not ready for resume") + "</span>";
40094
+ html += "</div>";
40095
+
40096
+ html += '<div class="grid">';
40097
+ for (var s = 0; s < stats.length; s++) {
40098
+ var stat = stats[s];
40099
+ html += '<button type="button" class="stat" data-panel="' + esc(stat.key) + '">';
40100
+ html += '<span class="label">' + esc(stat.label) + "</span>";
40101
+ html += '<span class="value">' + esc(n(stat.value)) + "</span>";
40102
+ html += "</button>";
40103
+ }
40104
+ html += "</div>";
40105
+ html += '<div id="panel" class="panel"></div>';
40106
+
40107
+ if (issues.length) {
40108
+ html += '<div class="issues">';
40109
+ for (var i = 0; i < issues.length; i++) {
40110
+ var issue = issues[i];
40111
+ html += '<div class="issue" data-issue="' + i + '">';
40112
+ html += '<button type="button"><span>' + esc(issue.kind || "issue");
40113
+ if (issue.count) html += " \xB7 " + esc(issue.count);
40114
+ html += '</span><span aria-hidden="true">\u25BE</span></button>';
40115
+ html += '<div class="detail">' + esc(issue.reason || "");
40116
+ if (issue.examples) {
40117
+ try {
40118
+ html += '<pre class="examples">' + esc(JSON.stringify(issue.examples, null, 2)) + "</pre>";
40119
+ } catch (e) {}
40120
+ }
40121
+ html += "</div></div>";
40122
+ }
40123
+ html += "</div>";
40124
+ }
40125
+
40126
+ html += '<div class="actions">';
40127
+ html += '<button type="button" id="copy">Copy summary</button>';
40128
+ if (incomplete) {
40129
+ html += '<button type="button" class="secondary" id="retry">Ask agent to retry</button>';
40130
+ }
40131
+ html += "</div>";
40132
+
40133
+ root.innerHTML = html;
40134
+
40135
+ var tips = Object.create(null);
40136
+ for (var t = 0; t < stats.length; t++) tips[stats[t].key] = stats[t].tip;
40137
+ var panel = document.getElementById("panel");
40138
+ root.querySelectorAll("button.stat").forEach(function (btn) {
40139
+ btn.addEventListener("click", function () {
40140
+ var key = btn.getAttribute("data-panel");
40141
+ if (openPanel === key) {
40142
+ openPanel = null;
40143
+ panel.classList.remove("open");
40144
+ panel.textContent = "";
40145
+ } else {
40146
+ openPanel = key;
40147
+ panel.classList.add("open");
40148
+ panel.textContent = tips[key] || "";
40149
+ }
40150
+ reportSize();
40151
+ });
40152
+ });
40153
+ root.querySelectorAll(".issue").forEach(function (el) {
40154
+ el.querySelector("button").addEventListener("click", function () {
40155
+ el.classList.toggle("open");
40156
+ reportSize();
40157
+ });
40158
+ });
40159
+ document.getElementById("copy").addEventListener("click", function () {
40160
+ var lines = [
40161
+ (receipt.heading || "HANDOFF RESULTS") + " \u2014 " + (receipt.status || ""),
40162
+ "Destination: " + (receipt.destination || ""),
40163
+ "Turns: " + n(captured.conversationTurns),
40164
+ "Tool calls: " + n(captured.toolCallsCaptured),
40165
+ "Artifacts: " + n(captured.artifacts),
40166
+ "Ready for resume: " + (receipt.readyForResume ? "yes" : "no")
40167
+ ];
40168
+ if (issues.length) {
40169
+ lines.push("Issues:");
40170
+ for (var j = 0; j < issues.length; j++) {
40171
+ lines.push("- " + (issues[j].kind || "issue") + ": " + (issues[j].reason || ""));
40172
+ }
40173
+ }
40174
+ var text = lines.join("\\n");
40175
+ if (navigator.clipboard && navigator.clipboard.writeText) {
40176
+ navigator.clipboard.writeText(text).catch(function () {});
40177
+ }
40178
+ });
40179
+ var retry = document.getElementById("retry");
40180
+ if (retry) {
40181
+ retry.addEventListener("click", function () {
40182
+ request("ui/message", {
40183
+ role: "user",
40184
+ content: {
40185
+ type: "text",
40186
+ text: "Retry the Pantheon handoff and report the final handoffQuality receipt."
40187
+ }
40188
+ }).catch(function () {});
40189
+ });
40190
+ }
40191
+ reportSize();
40192
+ }
40193
+
40194
+ window.addEventListener("message", function (event) {
40195
+ var data = event.data;
40196
+ if (!data || data.jsonrpc !== "2.0") return;
40197
+ if (typeof data.id !== "undefined" && pending[data.id]) {
40198
+ var entry = pending[data.id];
40199
+ delete pending[data.id];
40200
+ if (data.error) entry.reject(data.error);
40201
+ else entry.resolve(data.result);
40202
+ return;
40203
+ }
40204
+ if (data.method === "ui/notifications/tool-result") {
40205
+ receipt = extractReceipt(data.params);
40206
+ render();
40207
+ return;
40208
+ }
40209
+ if (data.method === "ui/notifications/tool-cancelled") {
40210
+ document.getElementById("wait").textContent = "Handoff cancelled" + (data.params && data.params.reason ? ": " + data.params.reason : ".");
40211
+ reportSize();
40212
+ }
40213
+ });
40214
+
40215
+ request("ui/initialize", {
40216
+ appInfo: { name: "pantheon-handoff-receipt", version: "0.1.0" },
40217
+ appCapabilities: { availableDisplayModes: ["inline"] }
40218
+ }).then(function () {
40219
+ post({ jsonrpc: "2.0", method: "ui/notifications/initialized" });
40220
+ reportSize();
40221
+ }).catch(function () {
40222
+ document.getElementById("wait").textContent = "Could not connect to the host UI bridge.";
40223
+ });
40224
+ })();
40225
+ </script>
40226
+ </body>
40227
+ </html>`;
40228
+ }
40229
+
39835
40230
  // ../core/src/spaces.ts
39836
40231
  import {
39837
40232
  closeSync as closeSync2,
@@ -45303,7 +45698,7 @@ import { join as join5 } from "node:path";
45303
45698
  var LEGACY_API_URLS = /* @__PURE__ */ new Set(["https://pantheon-ui-web.vercel.app"]);
45304
45699
  function migrateApiUrl(config2, configPath) {
45305
45700
  const current = config2.apiUrl.replace(/\/$/, "");
45306
- const target = "https://pantheonvault.space"?.replace(/\/$/, "");
45701
+ const target = "https://www.pantheonvault.space"?.replace(/\/$/, "");
45307
45702
  if (!target || !LEGACY_API_URLS.has(current) || target === current) return config2;
45308
45703
  const migrated = { ...config2, apiUrl: target };
45309
45704
  writeFileSync4(configPath, `${JSON.stringify(migrated, null, 2)}
@@ -47387,14 +47782,15 @@ function structuredToolResult(result) {
47387
47782
  };
47388
47783
  }
47389
47784
  }
47390
- function registerTool(server, name, description, schema, handler) {
47785
+ function registerTool(server, name, description, schema, handler, meta) {
47391
47786
  const register = server.registerTool.bind(server);
47392
47787
  const run = (registeredName) => register(
47393
47788
  registeredName,
47394
47789
  {
47395
47790
  description,
47396
47791
  inputSchema: schema,
47397
- outputSchema: toolOutputSchema
47792
+ outputSchema: toolOutputSchema,
47793
+ ...meta ? { _meta: meta } : {}
47398
47794
  },
47399
47795
  async (...args) => structuredToolResult(await handler(...args))
47400
47796
  );
@@ -47437,7 +47833,7 @@ function createPantheonServer(home = defaultHome(), hooks, options = {}) {
47437
47833
  const vault = vaultHooks(hooks);
47438
47834
  const refreshForRead = readFreshness(vault);
47439
47835
  const allowCapture = options.allowCapture !== false;
47440
- const configuredSite = (process.env.NEXT_PUBLIC_APP_URL || "https://pantheonvault.space").replace(/\/$/, "");
47836
+ const configuredSite = (process.env.NEXT_PUBLIC_APP_URL || "https://www.pantheonvault.space").replace(/\/$/, "");
47441
47837
  const site = configuredSite === "https://pantheon-ui-web.vercel.app" ? "https://www.pantheonvault.space" : configuredSite;
47442
47838
  const server = new McpServer(
47443
47839
  {
@@ -47462,6 +47858,24 @@ function createPantheonServer(home = defaultHome(), hooks, options = {}) {
47462
47858
  },
47463
47859
  { instructions: MCP_INSTRUCTIONS }
47464
47860
  );
47861
+ server.registerResource(
47862
+ "handoff-receipt",
47863
+ HANDOFF_RECEIPT_UI_URI,
47864
+ {
47865
+ title: "Handoff results",
47866
+ description: "Minimal interactive receipt for pantheon_handoff \u2014 status, capture stats, and issues.",
47867
+ mimeType: MCP_APP_MIME
47868
+ },
47869
+ async (uri) => ({
47870
+ contents: [
47871
+ {
47872
+ uri: uri.href,
47873
+ mimeType: MCP_APP_MIME,
47874
+ text: handoffReceiptHtml()
47875
+ }
47876
+ ]
47877
+ })
47878
+ );
47465
47879
  async function clientFileRoots() {
47466
47880
  if (!allowCapture || !server.server.getClientCapabilities()?.roots) return [];
47467
47881
  const listed = await server.server.listRoots().catch(() => ({ roots: [] }));
@@ -47714,7 +48128,10 @@ ${GUIDE}` }]
47714
48128
  shouldReview ? review ? AUTO_SKILL_REVIEW : `The post-handoff skill review could not run. Call pantheon_skill_review for "${written.slug}" and continue without asking permission.` : null
47715
48129
  ].filter(Boolean).join(" ")
47716
48130
  };
47717
- })
48131
+ }),
48132
+ {
48133
+ ui: { resourceUri: HANDOFF_RECEIPT_UI_URI }
48134
+ }
47718
48135
  );
47719
48136
  if (allowCapture) {
47720
48137
  registerTool(
@@ -49029,7 +49446,7 @@ ${sections.filter(Boolean).join("\n\n")}
49029
49446
  }
49030
49447
 
49031
49448
  // src/connect.ts
49032
- var PRODUCTION_API_URL = "https://pantheonvault.space";
49449
+ var PRODUCTION_API_URL = "https://www.pantheonvault.space";
49033
49450
  function candidateHosts(explicit) {
49034
49451
  if (explicit) return [explicit.replace(/\/$/, "")];
49035
49452
  if (process.env.PANTHEON_HOST) return [process.env.PANTHEON_HOST.replace(/\/$/, "")];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pantheon-cli",
3
- "version": "0.2.128",
3
+ "version": "0.2.130",
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",