pantheon-cli 0.2.115 → 0.2.117

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 +41 -3
  2. package/package.json +3 -3
package/dist/pantheon.mjs CHANGED
@@ -46406,12 +46406,50 @@ function promptText(body) {
46406
46406
  ]
46407
46407
  };
46408
46408
  }
46409
+ var toolOutputSchema = external_exports.object({}).catchall(external_exports.unknown()).describe(
46410
+ "Structured Pantheon result. Fields match the JSON object rendered in the text content for backward compatibility."
46411
+ );
46412
+ function structuredToolResult(result) {
46413
+ if (!result || typeof result !== "object") return result;
46414
+ const response = result;
46415
+ if (response.isError || response.structuredContent) return result;
46416
+ const textBlock = response.content?.find(
46417
+ (item) => item.type === "text" && typeof item.text === "string"
46418
+ );
46419
+ if (!textBlock?.text) {
46420
+ return {
46421
+ ...response,
46422
+ structuredContent: { content: response.content ?? [] }
46423
+ };
46424
+ }
46425
+ try {
46426
+ const parsed = JSON.parse(textBlock.text);
46427
+ return {
46428
+ ...response,
46429
+ structuredContent: parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : { value: parsed }
46430
+ };
46431
+ } catch {
46432
+ return {
46433
+ ...response,
46434
+ structuredContent: { text: textBlock.text }
46435
+ };
46436
+ }
46437
+ }
46409
46438
  function registerTool(server, name, description, schema, handler) {
46410
- const run = server.tool.bind(server);
46411
- run(name, description, schema, handler);
46439
+ const register = server.registerTool.bind(server);
46440
+ const run = (registeredName) => register(
46441
+ registeredName,
46442
+ {
46443
+ description,
46444
+ inputSchema: schema,
46445
+ outputSchema: toolOutputSchema
46446
+ },
46447
+ async (...args) => structuredToolResult(await handler(...args))
46448
+ );
46449
+ run(name);
46412
46450
  const alias = name === "pantheon_search" ? "search_space" : name.startsWith("pantheon_") ? name.slice("pantheon_".length) : "";
46413
46451
  if (alias && alias !== name) {
46414
- run(alias, description, schema, handler);
46452
+ run(alias);
46415
46453
  }
46416
46454
  }
46417
46455
  function inferResumeSpace(spaces) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pantheon-cli",
3
- "version": "0.2.115",
3
+ "version": "0.2.117",
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",