@agimon-ai/po-plan 0.0.0-alpha.13 → 0.0.0-alpha.14

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.
@@ -3,13 +3,13 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  let _agimon_ai_po_core_mcpFacet = require("@agimon-ai/po-core/mcpFacet");
6
- let _agimon_ai_po_core_serverFacet = require("@agimon-ai/po-core/serverFacet");
6
+ let _agimon_ai_po_core_serverPlugin = require("@agimon-ai/po-core/serverPlugin");
7
7
  let typebox = require("typebox");
8
8
  //#region src/extensions/workspaces/sessions/(backend)/skill/po-use-plan.mcp.ts
9
9
  var po_use_plan_mcp_default = (0, _agimon_ai_po_core_mcpFacet.defineMcpSkill)({
10
10
  name: "po-use-plan",
11
11
  description: "Use Po Pi Plan to draft reviewable normal, debug, or code review plans, persist them, and exit safely.",
12
- read: () => (0, _agimon_ai_po_core_serverFacet.readPackageResource)(require("url").pathToFileURL(__filename).href, "src/prompts/po-use-plan/SKILL.md")
12
+ read: () => (0, _agimon_ai_po_core_serverPlugin.readPackageResource)(require("url").pathToFileURL(__filename).href, "src/prompts/po-use-plan/SKILL.md")
13
13
  });
14
14
  //#endregion
15
15
  //#region src/schemas/mcpTools.ts
@@ -1 +1 @@
1
- {"version":3,"file":"mcp.cjs","names":["defineMcpSkill","readPackageResource","Type","defineMcpTool","defineMcpTool","defineMcpTool","defineMcpPlugin","skillPoUsePlan","toolCompletePlan","toolRecordDebugEvidence","toolWritePlan"],"sources":["../../src/extensions/workspaces/sessions/(backend)/skill/po-use-plan.mcp.ts","../../src/schemas/mcpTools.ts","../../src/services/mcpTools/index.ts","../../src/extensions/workspaces/sessions/(backend)/tool/complete_plan.mcp.ts","../../src/extensions/workspaces/sessions/(backend)/tool/record_debug_evidence.mcp.ts","../../src/extensions/workspaces/sessions/(backend)/tool/write_plan.mcp.ts","../../generated/mcp.ts"],"sourcesContent":["import { defineMcpSkill } from '@agimon-ai/po-core/mcpFacet';\nimport { readPackageResource } from '@agimon-ai/po-core/serverFacet';\n\nexport default defineMcpSkill({\n name: 'po-use-plan',\n description: 'Use Po Pi Plan to draft reviewable normal, debug, or code review plans, persist them, and exit safely.',\n read: () => readPackageResource(import.meta.url, 'src/prompts/po-use-plan/SKILL.md'),\n});\n","import { Type } from 'typebox';\n\nconst markdown = Type.String({ minLength: 1 });\n\nexport const remoteWritePlanParameters = Type.Object({ markdown }, { additionalProperties: false });\nexport const writePlanParameters = Type.Object({ markdown: Type.Optional(markdown) }, { additionalProperties: false });\n","import type { PoHeadlessTool } from '@agimon-ai/po-core/headless';\nimport type { PoMcpPluginContext } from '@agimon-ai/po-core/mcpFacet';\nimport type { Context } from '@deepseek-ai/cordis';\n\nimport { remoteWritePlanParameters } from '../../schemas/mcpTools';\n\nexport const PLAN_MCP_TOOLS_SERVICE = 'po/plan-mcp-tools';\n\nconst MODE_ID = 'plan';\nconst MODE_LABEL = 'Plan';\n\nexport interface McpToolCatalog {\n get(name: string): PoHeadlessTool | undefined;\n names(): readonly string[];\n}\n\nexport function mountMcpTools(tools: readonly PoHeadlessTool[]) {\n return (context: Context): void => {\n context.plugin((providerContext) => {\n providerContext.provide(PLAN_MCP_TOOLS_SERVICE, {\n get: (name) => tools.find((tool) => tool.name === name),\n names: () => tools.map((tool) => tool.name),\n } satisfies McpToolCatalog);\n });\n };\n}\n\nexport function bindMcpTool(context: PoMcpPluginContext, name: string): PoHeadlessTool {\n const catalog = context.services.get<McpToolCatalog>(PLAN_MCP_TOOLS_SERVICE);\n const tool = catalog?.get(name);\n if (!tool || !catalog) throw new Error(`Plan tool is unavailable: ${name}`);\n const writesPlan = name === 'write_plan';\n return {\n ...tool,\n ...(writesPlan\n ? {\n description:\n 'Save the supplied Markdown plan in the bound session. Requires active Plan mode. Saving does not approve implementation.',\n parameters: remoteWritePlanParameters,\n annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: false },\n }\n : {}),\n execute(toolCallId, parameters, signal, onUpdate) {\n const activeModes = context.selection.read().state?.['minor-mode'] ?? [];\n if (!activeModes.includes(MODE_ID)) {\n const inactiveTools = [...catalog.names()].sort().join(', ');\n throw new Error(`${MODE_LABEL} minor mode is inactive. Inactive ${MODE_LABEL} tools: ${inactiveTools}.`);\n }\n if (\n writesPlan &&\n (typeof parameters !== 'object' ||\n parameters === null ||\n !('markdown' in parameters) ||\n typeof parameters.markdown !== 'string' ||\n !parameters.markdown.trim())\n ) {\n throw new Error(\n 'Supply the complete visible plan in the markdown argument. Remote calls cannot read the ChatGPT transcript.',\n );\n }\n const executionSignal = AbortSignal.any([context.signal, signal ?? context.signal]);\n return tool.execute(toolCallId, parameters, executionSignal, onUpdate, context.execution);\n },\n };\n}\n","import { defineMcpTool, type PoMcpPluginContext } from '@agimon-ai/po-core/mcpFacet';\n\nimport { bindMcpTool } from '../../../../../services/mcpTools';\n\nexport default defineMcpTool((context: PoMcpPluginContext) => bindMcpTool(context, 'complete_plan'));\n","import { defineMcpTool, type PoMcpPluginContext } from '@agimon-ai/po-core/mcpFacet';\n\nimport { bindMcpTool } from '../../../../../services/mcpTools';\n\nexport default defineMcpTool((context: PoMcpPluginContext) => bindMcpTool(context, 'record_debug_evidence'));\n","import { defineMcpTool, type PoMcpPluginContext } from '@agimon-ai/po-core/mcpFacet';\n\nimport { bindMcpTool } from '../../../../../services/mcpTools';\n\nexport default defineMcpTool((context: PoMcpPluginContext) => bindMcpTool(context, 'write_plan'));\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineMcpPlugin, type PoMcpSessionPlugin } from '@agimon-ai/po-core/mcpFacet';\n\nimport skillPoUsePlan from '../src/extensions/workspaces/sessions/(backend)/skill/po-use-plan.mcp';\nimport toolCompletePlan from '../src/extensions/workspaces/sessions/(backend)/tool/complete_plan.mcp';\nimport toolRecordDebugEvidence from '../src/extensions/workspaces/sessions/(backend)/tool/record_debug_evidence.mcp';\nimport toolWritePlan from '../src/extensions/workspaces/sessions/(backend)/tool/write_plan.mcp';\n\ntype Factory<T, C> = (context: C) => T;\nconst at = <T, C>(value: T | Factory<T, C>, context: C): T =>\n typeof value === 'function' ? (value as Factory<T, C>)(context) : value;\nconst via = <T>(identity: Record<string, unknown>, value: unknown): T =>\n (value === undefined ? undefined : { ...identity, ...(value as object) }) as T;\n\nconst withWidget = <T>(key: string, value: T): T => value === undefined ? value : ({\n ...value, _meta: { ...(value as { _meta?: object })._meta, [\"po/widget\"]: key },\n});\n\nexport const mcp = defineMcpPlugin({\n name: '@agimon-ai/po-plan',\n session: (context) => ({\n get skills(): PoMcpSessionPlugin['skills'] { return [at(skillPoUsePlan, context)]; },\n get tools(): PoMcpSessionPlugin['tools'] { return [withWidget(\"@agimon-ai/po-plan/complete_plan\", via({ name: 'complete_plan' }, at(toolCompletePlan, context))), withWidget(\"@agimon-ai/po-plan/record_debug_evidence\", via({ name: 'record_debug_evidence' }, at(toolRecordDebugEvidence, context))), withWidget(\"@agimon-ai/po-plan/write_plan\", via({ name: 'write_plan' }, at(toolWritePlan, context)))]; },\n }) satisfies PoMcpSessionPlugin,\n});\n\nexport default mcp;\n"],"mappings":";;;;;;;;AAGA,IAAA,2BAAA,GAAeA,4BAAAA,eAAAA,CAAe;CAC5B,MAAM;CACN,aAAa;CACb,aAAA,GAAYC,+BAAAA,oBAAAA,CAAAA,QAAAA,KAAAA,CAAAA,CAAAA,cAAAA,UAAAA,CAAAA,CAAAA,MAAqC,kCAAkC;AACrF,CAAC;;;ACLD,MAAM,WAAWC,QAAAA,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;AAE7C,MAAa,4BAA4BA,QAAAA,KAAK,OAAO,EAAE,SAAS,GAAG,EAAE,sBAAsB,MAAM,CAAC;AAC/DA,QAAAA,KAAK,OAAO,EAAE,UAAUA,QAAAA,KAAK,SAAS,QAAQ,EAAE,GAAG,EAAE,sBAAsB,MAAM,CAAC;;;ACCrH,MAAa,yBAAyB;AAEtC,MAAM,UA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;;;ACKhG,MAAM,MAAY,OAA0B,YAC1C,OAAO,UAAU,aAAc,MAAwB,OAAO,IAAI;AACpE,MAAM,OAAU,UAAmC,UAChD,UAAU,KAAA,IAAY,KAAA,IAAY;CAAE,GAAG;CAAU,GAAI;AAAiB;AAEzE,MAAM,cAAiB,KAAa,UAAgB,UAAU,KAAA,IAAY,QAAS;CACjF,GAAG;CAAO,OAAO;EAAE,GAAI,MAA6B;GAAQ,cAAc;CAAI;AAChF;AAEA,MAAa,OAAA,GAAMC,4BAAAA,gBAAAA,CAAgB;CACjC,MAAM;CACN,UAAU,aAAa;EACrB,IAAI,SAAuC;GAAE,OAAO,CAAC,GAAGC,yBAAgB,OAAO,CAAC;EAAG;EACnF,IAAI,QAAqC;GAAE,OAAO;IAAC,WAAW,oCAAoC,IAAI,EAAE,MAAM,gBAAgB,GAAG,GAAGC,2BAAkB,OAAO,CAAC,CAAC;IAAG,WAAW,4CAA4C,IAAI,EAAE,MAAM,wBAAwB,GAAG,GAAGC,mCAAyB,OAAO,CAAC,CAAC;IAAG,WAAW,iCAAiC,IAAI,EAAE,MAAM,aAAa,GAAG,GAAGC,wBAAe,OAAO,CAAC,CAAC;GAAC;EAAG;CACjZ;AACF,CAAC"}
1
+ {"version":3,"file":"mcp.cjs","names":["defineMcpSkill","readPackageResource","Type","defineMcpTool","defineMcpTool","defineMcpTool","defineMcpPlugin","skillPoUsePlan","toolCompletePlan","toolRecordDebugEvidence","toolWritePlan"],"sources":["../../src/extensions/workspaces/sessions/(backend)/skill/po-use-plan.mcp.ts","../../src/schemas/mcpTools.ts","../../src/services/mcpTools/index.ts","../../src/extensions/workspaces/sessions/(backend)/tool/complete_plan.mcp.ts","../../src/extensions/workspaces/sessions/(backend)/tool/record_debug_evidence.mcp.ts","../../src/extensions/workspaces/sessions/(backend)/tool/write_plan.mcp.ts","../../generated/mcp.ts"],"sourcesContent":["import { defineMcpSkill } from '@agimon-ai/po-core/mcpFacet';\nimport { readPackageResource } from '@agimon-ai/po-core/serverPlugin';\n\nexport default defineMcpSkill({\n name: 'po-use-plan',\n description: 'Use Po Pi Plan to draft reviewable normal, debug, or code review plans, persist them, and exit safely.',\n read: () => readPackageResource(import.meta.url, 'src/prompts/po-use-plan/SKILL.md'),\n});\n","import { Type } from 'typebox';\n\nconst markdown = Type.String({ minLength: 1 });\n\nexport const remoteWritePlanParameters = Type.Object({ markdown }, { additionalProperties: false });\nexport const writePlanParameters = Type.Object({ markdown: Type.Optional(markdown) }, { additionalProperties: false });\n","import type { PoHeadlessTool } from '@agimon-ai/po-core/headless';\nimport type { PoMcpPluginContext } from '@agimon-ai/po-core/mcpFacet';\nimport type { Context } from '@deepseek-ai/cordis';\n\nimport { remoteWritePlanParameters } from '../../schemas/mcpTools';\n\nexport const PLAN_MCP_TOOLS_SERVICE = 'po/plan-mcp-tools';\n\nconst MODE_ID = 'plan';\nconst MODE_LABEL = 'Plan';\n\nexport interface McpToolCatalog {\n get(name: string): PoHeadlessTool | undefined;\n names(): readonly string[];\n}\n\nexport function mountMcpTools(tools: readonly PoHeadlessTool[]) {\n return (context: Context): void => {\n context.plugin((providerContext) => {\n providerContext.provide(PLAN_MCP_TOOLS_SERVICE, {\n get: (name) => tools.find((tool) => tool.name === name),\n names: () => tools.map((tool) => tool.name),\n } satisfies McpToolCatalog);\n });\n };\n}\n\nexport function bindMcpTool(context: PoMcpPluginContext, name: string): PoHeadlessTool {\n const catalog = context.services.get<McpToolCatalog>(PLAN_MCP_TOOLS_SERVICE);\n const tool = catalog?.get(name);\n if (!tool || !catalog) throw new Error(`Plan tool is unavailable: ${name}`);\n const writesPlan = name === 'write_plan';\n return {\n ...tool,\n ...(writesPlan\n ? {\n description:\n 'Save the supplied Markdown plan in the bound session. Requires active Plan mode. Saving does not approve implementation.',\n parameters: remoteWritePlanParameters,\n annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: false },\n }\n : {}),\n execute(toolCallId, parameters, signal, onUpdate) {\n const activeModes = context.selection.read().state?.['minor-mode'] ?? [];\n if (!activeModes.includes(MODE_ID)) {\n const inactiveTools = [...catalog.names()].sort().join(', ');\n throw new Error(`${MODE_LABEL} minor mode is inactive. Inactive ${MODE_LABEL} tools: ${inactiveTools}.`);\n }\n if (\n writesPlan &&\n (typeof parameters !== 'object' ||\n parameters === null ||\n !('markdown' in parameters) ||\n typeof parameters.markdown !== 'string' ||\n !parameters.markdown.trim())\n ) {\n throw new Error(\n 'Supply the complete visible plan in the markdown argument. Remote calls cannot read the ChatGPT transcript.',\n );\n }\n const executionSignal = AbortSignal.any([context.signal, signal ?? context.signal]);\n return tool.execute(toolCallId, parameters, executionSignal, onUpdate, context.execution);\n },\n };\n}\n","import { defineMcpTool, type PoMcpPluginContext } from '@agimon-ai/po-core/mcpFacet';\n\nimport { bindMcpTool } from '../../../../../services/mcpTools';\n\nexport default defineMcpTool((context: PoMcpPluginContext) => bindMcpTool(context, 'complete_plan'));\n","import { defineMcpTool, type PoMcpPluginContext } from '@agimon-ai/po-core/mcpFacet';\n\nimport { bindMcpTool } from '../../../../../services/mcpTools';\n\nexport default defineMcpTool((context: PoMcpPluginContext) => bindMcpTool(context, 'record_debug_evidence'));\n","import { defineMcpTool, type PoMcpPluginContext } from '@agimon-ai/po-core/mcpFacet';\n\nimport { bindMcpTool } from '../../../../../services/mcpTools';\n\nexport default defineMcpTool((context: PoMcpPluginContext) => bindMcpTool(context, 'write_plan'));\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineMcpPlugin, type PoMcpSessionPlugin } from '@agimon-ai/po-core/mcpFacet';\n\nimport skillPoUsePlan from '../src/extensions/workspaces/sessions/(backend)/skill/po-use-plan.mcp';\nimport toolCompletePlan from '../src/extensions/workspaces/sessions/(backend)/tool/complete_plan.mcp';\nimport toolRecordDebugEvidence from '../src/extensions/workspaces/sessions/(backend)/tool/record_debug_evidence.mcp';\nimport toolWritePlan from '../src/extensions/workspaces/sessions/(backend)/tool/write_plan.mcp';\n\ntype Factory<T, C> = (context: C) => T;\nconst at = <T, C>(value: T | Factory<T, C>, context: C): T =>\n typeof value === 'function' ? (value as Factory<T, C>)(context) : value;\nconst via = <T>(identity: Record<string, unknown>, value: unknown): T =>\n (value === undefined ? undefined : { ...identity, ...(value as object) }) as T;\n\nconst withWidget = <T>(key: string, value: T): T => value === undefined ? value : ({\n ...value, _meta: { ...(value as { _meta?: object })._meta, [\"po/widget\"]: key },\n});\n\nexport const mcp = defineMcpPlugin({\n name: '@agimon-ai/po-plan',\n session: (context) => ({\n get skills(): PoMcpSessionPlugin['skills'] { return [at(skillPoUsePlan, context)]; },\n get tools(): PoMcpSessionPlugin['tools'] { return [withWidget(\"@agimon-ai/po-plan/complete_plan\", via({ name: 'complete_plan' }, at(toolCompletePlan, context))), withWidget(\"@agimon-ai/po-plan/record_debug_evidence\", via({ name: 'record_debug_evidence' }, at(toolRecordDebugEvidence, context))), withWidget(\"@agimon-ai/po-plan/write_plan\", via({ name: 'write_plan' }, at(toolWritePlan, context)))]; },\n }) satisfies PoMcpSessionPlugin,\n});\n\nexport default mcp;\n"],"mappings":";;;;;;;;AAGA,IAAA,2BAAA,GAAeA,4BAAAA,eAAAA,CAAe;CAC5B,MAAM;CACN,aAAa;CACb,aAAA,GAAYC,gCAAAA,oBAAAA,CAAAA,QAAAA,KAAAA,CAAAA,CAAAA,cAAAA,UAAAA,CAAAA,CAAAA,MAAqC,kCAAkC;AACrF,CAAC;;;ACLD,MAAM,WAAWC,QAAAA,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;AAE7C,MAAa,4BAA4BA,QAAAA,KAAK,OAAO,EAAE,SAAS,GAAG,EAAE,sBAAsB,MAAM,CAAC;AAC/DA,QAAAA,KAAK,OAAO,EAAE,UAAUA,QAAAA,KAAK,SAAS,QAAQ,EAAE,GAAG,EAAE,sBAAsB,MAAM,CAAC;;;ACCrH,MAAa,yBAAyB;AAEtC,MAAM,UAAU;AAChB,MAAM,aAAa;AAkBnB,SAAgB,YAAY,SAA6B,MAA8B;CACrF,MAAM,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AAI;AACpE,MAAM,OAAU,UAAmC,UAChD,UAAU,KAAA,IAAY,KAAA,IAAY;CAAE,GAAG;CAAU,GAAI;AAAiB;AAEzE,MAAM,cAAiB,KAAa,UAAgB,UAAU,KAAA,IAAY,QAAS;CACjF,GAAG;CAAO,OAAO;EAAE,GAAI,MAA6B;GAAQ,cAAc;CAAI;AAChF;AAEA,MAAa,OAAA,GAAMC,4BAAAA,gBAAAA,CAAgB;CACjC,MAAM;CACN,UAAU,aAAa;EACrB,IAAI,SAAuC;GAAE,OAAO,CAAC,GAAGC,yBAAgB,OAAO,CAAC;EAAG;EACnF,IAAI,QAAqC;GAAE,OAAO;IAAC,WAAW,oCAAoC,IAAI,EAAE,MAAM,gBAAgB,GAAG,GAAGC,2BAAkB,OAAO,CAAC,CAAC;IAAG,WAAW,4CAA4C,IAAI,EAAE,MAAM,wBAAwB,GAAG,GAAGC,mCAAyB,OAAO,CAAC,CAAC;IAAG,WAAW,iCAAiC,IAAI,EAAE,MAAM,aAAa,GAAG,GAAGC,wBAAe,OAAO,CAAC,CAAC;GAAC;EAAG;CACjZ;AACF,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { defineMcpPlugin, defineMcpSkill, defineMcpTool } from "@agimon-ai/po-core/mcpFacet";
2
- import { readPackageResource } from "@agimon-ai/po-core/serverFacet";
2
+ import { readPackageResource } from "@agimon-ai/po-core/serverPlugin";
3
3
  import { Type } from "typebox";
4
4
  //#region src/extensions/workspaces/sessions/(backend)/skill/po-use-plan.mcp.ts
5
5
  var po_use_plan_mcp_default = defineMcpSkill({
@@ -1 +1 @@
1
- {"version":3,"file":"mcp.mjs","names":["skillPoUsePlan","toolCompletePlan","toolRecordDebugEvidence","toolWritePlan"],"sources":["../../src/extensions/workspaces/sessions/(backend)/skill/po-use-plan.mcp.ts","../../src/schemas/mcpTools.ts","../../src/services/mcpTools/index.ts","../../src/extensions/workspaces/sessions/(backend)/tool/complete_plan.mcp.ts","../../src/extensions/workspaces/sessions/(backend)/tool/record_debug_evidence.mcp.ts","../../src/extensions/workspaces/sessions/(backend)/tool/write_plan.mcp.ts","../../generated/mcp.ts"],"sourcesContent":["import { defineMcpSkill } from '@agimon-ai/po-core/mcpFacet';\nimport { readPackageResource } from '@agimon-ai/po-core/serverFacet';\n\nexport default defineMcpSkill({\n name: 'po-use-plan',\n description: 'Use Po Pi Plan to draft reviewable normal, debug, or code review plans, persist them, and exit safely.',\n read: () => readPackageResource(import.meta.url, 'src/prompts/po-use-plan/SKILL.md'),\n});\n","import { Type } from 'typebox';\n\nconst markdown = Type.String({ minLength: 1 });\n\nexport const remoteWritePlanParameters = Type.Object({ markdown }, { additionalProperties: false });\nexport const writePlanParameters = Type.Object({ markdown: Type.Optional(markdown) }, { additionalProperties: false });\n","import type { PoHeadlessTool } from '@agimon-ai/po-core/headless';\nimport type { PoMcpPluginContext } from '@agimon-ai/po-core/mcpFacet';\nimport type { Context } from '@deepseek-ai/cordis';\n\nimport { remoteWritePlanParameters } from '../../schemas/mcpTools';\n\nexport const PLAN_MCP_TOOLS_SERVICE = 'po/plan-mcp-tools';\n\nconst MODE_ID = 'plan';\nconst MODE_LABEL = 'Plan';\n\nexport interface McpToolCatalog {\n get(name: string): PoHeadlessTool | undefined;\n names(): readonly string[];\n}\n\nexport function mountMcpTools(tools: readonly PoHeadlessTool[]) {\n return (context: Context): void => {\n context.plugin((providerContext) => {\n providerContext.provide(PLAN_MCP_TOOLS_SERVICE, {\n get: (name) => tools.find((tool) => tool.name === name),\n names: () => tools.map((tool) => tool.name),\n } satisfies McpToolCatalog);\n });\n };\n}\n\nexport function bindMcpTool(context: PoMcpPluginContext, name: string): PoHeadlessTool {\n const catalog = context.services.get<McpToolCatalog>(PLAN_MCP_TOOLS_SERVICE);\n const tool = catalog?.get(name);\n if (!tool || !catalog) throw new Error(`Plan tool is unavailable: ${name}`);\n const writesPlan = name === 'write_plan';\n return {\n ...tool,\n ...(writesPlan\n ? {\n description:\n 'Save the supplied Markdown plan in the bound session. Requires active Plan mode. Saving does not approve implementation.',\n parameters: remoteWritePlanParameters,\n annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: false },\n }\n : {}),\n execute(toolCallId, parameters, signal, onUpdate) {\n const activeModes = context.selection.read().state?.['minor-mode'] ?? [];\n if (!activeModes.includes(MODE_ID)) {\n const inactiveTools = [...catalog.names()].sort().join(', ');\n throw new Error(`${MODE_LABEL} minor mode is inactive. Inactive ${MODE_LABEL} tools: ${inactiveTools}.`);\n }\n if (\n writesPlan &&\n (typeof parameters !== 'object' ||\n parameters === null ||\n !('markdown' in parameters) ||\n typeof parameters.markdown !== 'string' ||\n !parameters.markdown.trim())\n ) {\n throw new Error(\n 'Supply the complete visible plan in the markdown argument. Remote calls cannot read the ChatGPT transcript.',\n );\n }\n const executionSignal = AbortSignal.any([context.signal, signal ?? context.signal]);\n return tool.execute(toolCallId, parameters, executionSignal, onUpdate, context.execution);\n },\n };\n}\n","import { defineMcpTool, type PoMcpPluginContext } from '@agimon-ai/po-core/mcpFacet';\n\nimport { bindMcpTool } from '../../../../../services/mcpTools';\n\nexport default defineMcpTool((context: PoMcpPluginContext) => bindMcpTool(context, 'complete_plan'));\n","import { defineMcpTool, type PoMcpPluginContext } from '@agimon-ai/po-core/mcpFacet';\n\nimport { bindMcpTool } from '../../../../../services/mcpTools';\n\nexport default defineMcpTool((context: PoMcpPluginContext) => bindMcpTool(context, 'record_debug_evidence'));\n","import { defineMcpTool, type PoMcpPluginContext } from '@agimon-ai/po-core/mcpFacet';\n\nimport { bindMcpTool } from '../../../../../services/mcpTools';\n\nexport default defineMcpTool((context: PoMcpPluginContext) => bindMcpTool(context, 'write_plan'));\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineMcpPlugin, type PoMcpSessionPlugin } from '@agimon-ai/po-core/mcpFacet';\n\nimport skillPoUsePlan from '../src/extensions/workspaces/sessions/(backend)/skill/po-use-plan.mcp';\nimport toolCompletePlan from '../src/extensions/workspaces/sessions/(backend)/tool/complete_plan.mcp';\nimport toolRecordDebugEvidence from '../src/extensions/workspaces/sessions/(backend)/tool/record_debug_evidence.mcp';\nimport toolWritePlan from '../src/extensions/workspaces/sessions/(backend)/tool/write_plan.mcp';\n\ntype Factory<T, C> = (context: C) => T;\nconst at = <T, C>(value: T | Factory<T, C>, context: C): T =>\n typeof value === 'function' ? (value as Factory<T, C>)(context) : value;\nconst via = <T>(identity: Record<string, unknown>, value: unknown): T =>\n (value === undefined ? undefined : { ...identity, ...(value as object) }) as T;\n\nconst withWidget = <T>(key: string, value: T): T => value === undefined ? value : ({\n ...value, _meta: { ...(value as { _meta?: object })._meta, [\"po/widget\"]: key },\n});\n\nexport const mcp = defineMcpPlugin({\n name: '@agimon-ai/po-plan',\n session: (context) => ({\n get skills(): PoMcpSessionPlugin['skills'] { return [at(skillPoUsePlan, context)]; },\n get tools(): PoMcpSessionPlugin['tools'] { return [withWidget(\"@agimon-ai/po-plan/complete_plan\", via({ name: 'complete_plan' }, at(toolCompletePlan, context))), withWidget(\"@agimon-ai/po-plan/record_debug_evidence\", via({ name: 'record_debug_evidence' }, at(toolRecordDebugEvidence, context))), withWidget(\"@agimon-ai/po-plan/write_plan\", via({ name: 'write_plan' }, at(toolWritePlan, context)))]; },\n }) satisfies PoMcpSessionPlugin,\n});\n\nexport default mcp;\n"],"mappings":";;;;AAGA,IAAA,0BAAe,eAAe;CAC5B,MAAM;CACN,aAAa;CACb,YAAY,oBAAoB,YAAY,KAAK,kCAAkC;AACrF,CAAC;;;ACLD,MAAM,WAAW,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;AAE7C,MAAa,4BAA4B,KAAK,OAAO,EAAE,SAAS,GAAG,EAAE,sBAAsB,MAAM,CAAC;AAC/D,KAAK,OAAO,EAAE,UAAU,KAAK,SAAS,QAAQ,EAAE,GAAG,EAAE,sBAAsB,MAAM,CAAC;;;ACCrH,MAAa,yBAAyB;AAEtC,MAAM,UAAU;AAChB,MAAM,aAAa;AAkBnB,SAAgB,YAAY,SAA6B,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AAY,KAAA,IAAY;CAAE,GAAG;CAAU,GAAI;AAAiB;AAEzE,MAAM,cAAiB,KAAa,UAAgB,UAAU,KAAA,IAAY,QAAS;CACjF,GAAG;CAAO,OAAO;EAAE,GAAI,MAA6B;GAAQ,cAAc;CAAI;AAChF;AAEA,MAAa,MAAM,gBAAgB;CACjC,MAAM;CACN,UAAU,aAAa;EACrB,IAAI,SAAuC;GAAE,OAAO,CAAC,GAAGA,yBAAgB,OAAO,CAAC;EAAG;EACnF,IAAI,QAAqC;GAAE,OAAO;IAAC,WAAW,oCAAoC,IAAI,EAAE,MAAM,gBAAgB,GAAG,GAAGC,2BAAkB,OAAO,CAAC,CAAC;IAAG,WAAW,4CAA4C,IAAI,EAAE,MAAM,wBAAwB,GAAG,GAAGC,mCAAyB,OAAO,CAAC,CAAC;IAAG,WAAW,iCAAiC,IAAI,EAAE,MAAM,aAAa,GAAG,GAAGC,wBAAe,OAAO,CAAC,CAAC;GAAC;EAAG;CACjZ;AACF,CAAC"}
1
+ {"version":3,"file":"mcp.mjs","names":["skillPoUsePlan","toolCompletePlan","toolRecordDebugEvidence","toolWritePlan"],"sources":["../../src/extensions/workspaces/sessions/(backend)/skill/po-use-plan.mcp.ts","../../src/schemas/mcpTools.ts","../../src/services/mcpTools/index.ts","../../src/extensions/workspaces/sessions/(backend)/tool/complete_plan.mcp.ts","../../src/extensions/workspaces/sessions/(backend)/tool/record_debug_evidence.mcp.ts","../../src/extensions/workspaces/sessions/(backend)/tool/write_plan.mcp.ts","../../generated/mcp.ts"],"sourcesContent":["import { defineMcpSkill } from '@agimon-ai/po-core/mcpFacet';\nimport { readPackageResource } from '@agimon-ai/po-core/serverPlugin';\n\nexport default defineMcpSkill({\n name: 'po-use-plan',\n description: 'Use Po Pi Plan to draft reviewable normal, debug, or code review plans, persist them, and exit safely.',\n read: () => readPackageResource(import.meta.url, 'src/prompts/po-use-plan/SKILL.md'),\n});\n","import { Type } from 'typebox';\n\nconst markdown = Type.String({ minLength: 1 });\n\nexport const remoteWritePlanParameters = Type.Object({ markdown }, { additionalProperties: false });\nexport const writePlanParameters = Type.Object({ markdown: Type.Optional(markdown) }, { additionalProperties: false });\n","import type { PoHeadlessTool } from '@agimon-ai/po-core/headless';\nimport type { PoMcpPluginContext } from '@agimon-ai/po-core/mcpFacet';\nimport type { Context } from '@deepseek-ai/cordis';\n\nimport { remoteWritePlanParameters } from '../../schemas/mcpTools';\n\nexport const PLAN_MCP_TOOLS_SERVICE = 'po/plan-mcp-tools';\n\nconst MODE_ID = 'plan';\nconst MODE_LABEL = 'Plan';\n\nexport interface McpToolCatalog {\n get(name: string): PoHeadlessTool | undefined;\n names(): readonly string[];\n}\n\nexport function mountMcpTools(tools: readonly PoHeadlessTool[]) {\n return (context: Context): void => {\n context.plugin((providerContext) => {\n providerContext.provide(PLAN_MCP_TOOLS_SERVICE, {\n get: (name) => tools.find((tool) => tool.name === name),\n names: () => tools.map((tool) => tool.name),\n } satisfies McpToolCatalog);\n });\n };\n}\n\nexport function bindMcpTool(context: PoMcpPluginContext, name: string): PoHeadlessTool {\n const catalog = context.services.get<McpToolCatalog>(PLAN_MCP_TOOLS_SERVICE);\n const tool = catalog?.get(name);\n if (!tool || !catalog) throw new Error(`Plan tool is unavailable: ${name}`);\n const writesPlan = name === 'write_plan';\n return {\n ...tool,\n ...(writesPlan\n ? {\n description:\n 'Save the supplied Markdown plan in the bound session. Requires active Plan mode. Saving does not approve implementation.',\n parameters: remoteWritePlanParameters,\n annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: false },\n }\n : {}),\n execute(toolCallId, parameters, signal, onUpdate) {\n const activeModes = context.selection.read().state?.['minor-mode'] ?? [];\n if (!activeModes.includes(MODE_ID)) {\n const inactiveTools = [...catalog.names()].sort().join(', ');\n throw new Error(`${MODE_LABEL} minor mode is inactive. Inactive ${MODE_LABEL} tools: ${inactiveTools}.`);\n }\n if (\n writesPlan &&\n (typeof parameters !== 'object' ||\n parameters === null ||\n !('markdown' in parameters) ||\n typeof parameters.markdown !== 'string' ||\n !parameters.markdown.trim())\n ) {\n throw new Error(\n 'Supply the complete visible plan in the markdown argument. Remote calls cannot read the ChatGPT transcript.',\n );\n }\n const executionSignal = AbortSignal.any([context.signal, signal ?? context.signal]);\n return tool.execute(toolCallId, parameters, executionSignal, onUpdate, context.execution);\n },\n };\n}\n","import { defineMcpTool, type PoMcpPluginContext } from '@agimon-ai/po-core/mcpFacet';\n\nimport { bindMcpTool } from '../../../../../services/mcpTools';\n\nexport default defineMcpTool((context: PoMcpPluginContext) => bindMcpTool(context, 'complete_plan'));\n","import { defineMcpTool, type PoMcpPluginContext } from '@agimon-ai/po-core/mcpFacet';\n\nimport { bindMcpTool } from '../../../../../services/mcpTools';\n\nexport default defineMcpTool((context: PoMcpPluginContext) => bindMcpTool(context, 'record_debug_evidence'));\n","import { defineMcpTool, type PoMcpPluginContext } from '@agimon-ai/po-core/mcpFacet';\n\nimport { bindMcpTool } from '../../../../../services/mcpTools';\n\nexport default defineMcpTool((context: PoMcpPluginContext) => bindMcpTool(context, 'write_plan'));\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineMcpPlugin, type PoMcpSessionPlugin } from '@agimon-ai/po-core/mcpFacet';\n\nimport skillPoUsePlan from '../src/extensions/workspaces/sessions/(backend)/skill/po-use-plan.mcp';\nimport toolCompletePlan from '../src/extensions/workspaces/sessions/(backend)/tool/complete_plan.mcp';\nimport toolRecordDebugEvidence from '../src/extensions/workspaces/sessions/(backend)/tool/record_debug_evidence.mcp';\nimport toolWritePlan from '../src/extensions/workspaces/sessions/(backend)/tool/write_plan.mcp';\n\ntype Factory<T, C> = (context: C) => T;\nconst at = <T, C>(value: T | Factory<T, C>, context: C): T =>\n typeof value === 'function' ? (value as Factory<T, C>)(context) : value;\nconst via = <T>(identity: Record<string, unknown>, value: unknown): T =>\n (value === undefined ? undefined : { ...identity, ...(value as object) }) as T;\n\nconst withWidget = <T>(key: string, value: T): T => value === undefined ? value : ({\n ...value, _meta: { ...(value as { _meta?: object })._meta, [\"po/widget\"]: key },\n});\n\nexport const mcp = defineMcpPlugin({\n name: '@agimon-ai/po-plan',\n session: (context) => ({\n get skills(): PoMcpSessionPlugin['skills'] { return [at(skillPoUsePlan, context)]; },\n get tools(): PoMcpSessionPlugin['tools'] { return [withWidget(\"@agimon-ai/po-plan/complete_plan\", via({ name: 'complete_plan' }, at(toolCompletePlan, context))), withWidget(\"@agimon-ai/po-plan/record_debug_evidence\", via({ name: 'record_debug_evidence' }, at(toolRecordDebugEvidence, context))), withWidget(\"@agimon-ai/po-plan/write_plan\", via({ name: 'write_plan' }, at(toolWritePlan, context)))]; },\n }) satisfies PoMcpSessionPlugin,\n});\n\nexport default mcp;\n"],"mappings":";;;;AAGA,IAAA,0BAAe,eAAe;CAC5B,MAAM;CACN,aAAa;CACb,YAAY,oBAAoB,YAAY,KAAK,kCAAkC;AACrF,CAAC;;;ACLD,MAAM,WAAW,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;AAE7C,MAAa,4BAA4B,KAAK,OAAO,EAAE,SAAS,GAAG,EAAE,sBAAsB,MAAM,CAAC;AAC/D,KAAK,OAAO,EAAE,UAAU,KAAK,SAAS,QAAQ,EAAE,GAAG,EAAE,sBAAsB,MAAM,CAAC;;;ACCrH,MAAa,yBAAyB;AAEtC,MAAM,UAAU;AAChB,MAAM,aAAa;AAkBnB,SAAgB,YAAY,SAA6B,MAA8B;CACrF,MAAM,UAAU,QAAQ,SAAS,IAAoB,sBAAsB;CAC3E,MAAM,OAAO,SAAS,IAAI,IAAI;CAC9B,IAAI,CAAC,QAAQ,CAAC,SAAS,MAAM,IAAI,MAAM,6BAA6B,MAAM;CAC1E,MAAM,aAAa,SAAS;CAC5B,OAAO;EACL,GAAG;EACH,GAAI,aACA;GACE,aACE;GACF,YAAY;GACZ,aAAa;IAAE,cAAc;IAAO,iBAAiB;IAAO,eAAe;GAAM;EACnF,IACA,CAAC;EACL,QAAQ,YAAY,YAAY,QAAQ,UAAU;GAE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E,MAAM,gBAAgB,GAAG,GAAGC,2BAAkB,OAAO,CAAC,CAAC;IAAG,WAAW,4CAA4C,IAAI,EAAE,MAAM,wBAAwB,GAAG,GAAGC,mCAAyB,OAAO,CAAC,CAAC;IAAG,WAAW,iCAAiC,IAAI,EAAE,MAAM,aAAa,GAAG,GAAGC,wBAAe,OAAO,CAAC,CAAC;GAAC;EAAG;CACjZ;AACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"native.mjs","names":["WebPluginSlotProps","Button","Markdown","SegmentedControl","Textarea","fontOf","PoNativeTheme","useEffect","useState","StyleSheet","PLAN_STATUS_KEY","PlanDetailView","fetchPlan","savePlan","PLAN_TAB_ID","PlanPanel","sessionId","statuses","closeTransientTab","fileTabFor","openTransientTab","detail","setDetail","error","setError","loading","setLoading","view","setView","draft","setDraft","saving","setSaving","note","setNote","revision","cancelled","then","result","ok","undefined","catch","failure","Error","message","String","save","unavailable","hash","refreshed","styles","panel","title","value","label","meta","reason","content","path","tab","actions","success","planTab","Parameters","id","create","theme","padding","spacing","gap","uni__dependencies","fontFamily","sans","fontSize","lg","lineHeight","fontWeight","color","colors","hi","sm","dim","mono","red","green","flexDirection","flexWrap","styles","WebPluginSlotProps","ListRow","fontOf","PoNativeTheme","StyleSheet","parsePlanStatus","PLAN_STATUS_KEY","planTab","PlanActivitySection","sessionId","statuses","openTransientTab","view","styles","meta","title","stamp","undefined","create","theme","fontFamily","sans","fontSize","sm","lineHeight","color","colors","dim","uni__dependencies","activityGroupPlan","fillPlan"],"sources":["../../src/types/planApi.ts","../../src/extensions/workspaces/sessions/(frontend)/activity-group/plan.native.ts","../../src/types/apiRoutes.ts","../../generated/client.native.ts","../../src/extensions/workspaces/sessions/(frontend)/fill/_lib/planApi.native.ts","../../src/extensions/workspaces/sessions/(frontend)/fill/_components/PlanPanel.native.tsx","../../src/extensions/workspaces/sessions/(frontend)/fill/_components/PlanActivitySection.native.tsx","../../src/extensions/workspaces/sessions/(frontend)/fill/Plan.activity.plan.native.tsx","../../generated/native.ts"],"sourcesContent":["/**\n * The wire vocabulary this package's API shares with whatever calls it.\n *\n * It lives under src/types because that is the one server root a browser\n * bundle may read: the routes answer with these shapes and the cockpit plugin\n * reads them, so neither half can drift from the other. The paths themselves\n * are not here; they are declared once in `./apiRoutes`, which the Hono app\n * and the generated client both read.\n *\n * Two routes, and neither takes a path. A session has one current plan, so\n * `current` answers it and `content` takes the manual save back; the file they\n * act on is the one write_plan recorded, never one the page named. That is\n * also why there is nothing to escape here: a reader cannot address a second\n * file through these URLs.\n */\n\n/** Where a host mounts this package's API; the segment after /api/plugins/. */\nexport const API_BASE_PATH = 'plans';\n\n/**\n * Footer status key the session publishes once a plan exists, which is what\n * makes the cockpit's activity group appear at all. It outlives plan mode: the\n * plan is most worth reading while the agent implements it.\n */\nexport const PLAN_STATUS_KEY = 'po-plan-document';\n\n/** The selector contract shared by complete_plan and its cockpit composer prompt. */\nexport const PLAN_REVIEW_TITLE = 'Plan complete. What would you like to do?';\nexport const EXIT_PLAN_MODE_CHOICE = 'Exit plan mode and start implementation';\nexport const CONTINUE_PLANNING_CHOICE = 'Continue planning';\nexport const EXIT_PLAN_DECISION = 'exit';\nexport const CONTINUE_PLAN_DECISION = 'continue';\n\n/**\n * The label the reader sees paired with the decision the tool acts on. A headless\n * client answers with `value`, so a facet never has to recognise the wording; Pi's\n * own `ui.select` carries labels only, so its half maps the label back itself.\n */\nexport const PLAN_REVIEW_CHOICES = [\n { label: EXIT_PLAN_MODE_CHOICE, value: EXIT_PLAN_DECISION },\n { label: CONTINUE_PLANNING_CHOICE, value: CONTINUE_PLAN_DECISION },\n] as const;\n\n/** The same options as bare labels, which is all Pi's select and the composer prompt need. */\nexport const PLAN_REVIEW_OPTIONS = PLAN_REVIEW_CHOICES.map((choice) => choice.label);\n\n/** Between the plan's title and the stamp that marks a rewrite. */\nconst STATUS_SEPARATOR = ' · ';\n\n/** Strips the colour a session may have themed a status with. */\nconst ANSI = /\u001b\\[[0-9;]*m/gu;\n\n/** The status line the session publishes; the stamp changes on every write. */\nexport function formatPlanStatus(title: string, stamp: string): string {\n return `${title}${STATUS_SEPARATOR}${stamp}`;\n}\n\n/** What a reader gets out of the status line. */\nexport interface PlanStatusView {\n title: string;\n /** When the plan was last written, as the session worded it; empty when it said nothing. */\n stamp: string;\n}\n\n/**\n * Reading the status line back. Statuses reach a plugin raw, so the colour a\n * session may have added comes off here. A title can itself contain the\n * separator, so the stamp is taken from the last one rather than the first.\n */\nexport function parsePlanStatus(raw: string | undefined): PlanStatusView | undefined {\n if (raw === undefined) return undefined;\n const text = raw.replace(ANSI, '').trim();\n if (text === '') return undefined;\n const cut = text.lastIndexOf(STATUS_SEPARATOR);\n if (cut === -1) return { title: text, stamp: '' };\n return { title: text.slice(0, cut).trim(), stamp: text.slice(cut + STATUS_SEPARATOR.length).trim() };\n}\n\n/**\n * What write_plan recorded about this session's plan.\n *\n * The absolute path is the point of it: the extension resolves the plans\n * directory against the harness root, which no other process knows, so it\n * writes down where the plan landed rather than leaving the API to derive a\n * location it would sometimes get wrong.\n */\nexport interface PlanPointerRecord {\n path: string;\n title: string;\n writtenAt: string;\n planId?: string;\n}\n\n/** The plan as it stands on disk right now, which is what the source view edits. */\nexport interface PlanDetailView {\n path: string;\n title: string;\n writtenAt: string;\n planId?: string;\n content: string;\n /** sha256 of the content; the token a save hands back to prove it is not stale. */\n hash: string;\n /** True when the plan is missing or past the size cap, so `content` is empty. */\n unavailable: boolean;\n reason?: string;\n}\n\n/** What the save route takes. */\nexport interface PlanSaveRequest {\n /** The hash the reader loaded; a mismatch means the plan moved underneath them. */\n expectedHash: string;\n content: string;\n}\n\n/** What the save route answers with. */\nexport interface PlanSaveView {\n hash: string;\n}\n\n/** What a route reports when it refuses; the page shows `error` verbatim. */\nexport interface PlanErrorView {\n error: string;\n /** On a stale save, the hash the plan actually has now. */\n hash?: string;\n}\n","import { defineActivityGroup } from '@agimon-ai/po-core/native';\n\nimport { PLAN_STATUS_KEY } from '../../../../../types/planApi';\n\n// Keyed off the saved plan rather than the mode because the plan remains useful\n// while it is being implemented after the read-only mode exits.\nexport default defineActivityGroup({\n name: 'plan',\n keys: 'p e',\n statusKey: PLAN_STATUS_KEY,\n marksBackgroundWork: false,\n order: 25,\n});\n","import type { ApiResponseOf, ApiRoutes } from '@agimon-ai/po-core/web';\n\nimport type { PlanDetailView, PlanSaveView } from './planApi';\n\n/**\n * This package's routes, as data.\n *\n * No scope and no base path. The build reads both off\n * `src/extensions/workspaces/sessions/(backend)/api/plans/`, so the mount is\n * stated once, by the folder that creates it. The paths used to be written\n * here as helpers, again in the contract, and again inside every URL the page\n * built, and the copies were free to disagree.\n *\n * This is the one file the routes, the Hono app and the browser all read, so a\n * path cannot move on one side alone.\n *\n * Neither route takes a query or a path parameter: a session has one current\n * plan, so `current` answers it and `save` takes the manual write back.\n */\nconst routes = {\n current: {\n method: 'GET',\n path: '/current',\n response: undefined as unknown as ApiResponseOf<PlanDetailView>,\n },\n save: {\n method: 'PUT',\n path: '/content',\n response: undefined as unknown as ApiResponseOf<PlanSaveView>,\n },\n} as const satisfies ApiRoutes;\n\nexport default routes;\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { createApiClient, nativeApiTransport, sessionApiAddress } from '@agimon-ai/po-core/native';\n\nimport routes from '../src/types/apiRoutes';\n\n/** Scopes the tree mounts 'plans' at. */\nexport const apiScopes = ['session'] as const;\n\nexport const api = createApiClient(routes, {\n scopes: apiScopes,\n basePath: 'plans',\n transport: nativeApiTransport,\n sessionAddress: sessionApiAddress,\n});\n","import { api } from '../../../../../../../generated/client.native';\nimport type { PlanDetailView } from '../../../../../../types/planApi';\n\n/**\n * The page's half of this package's session API: the current plan, and the\n * manual save.\n *\n * These are adapters now, not a transport. The generated client owns the URL\n * and the sealed transport with it, so nothing here spells a route or reaches\n * for `fetch`. What stays is this package's own vocabulary: which refusals the\n * reader is shown, and the stale-save contract the editor depends on.\n */\n\nconst UNREACHABLE = 'The session is unreachable.';\nconst NO_PLAN = 'This session has not written a plan yet.';\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/** The message a reader is shown: the route's own words, or why there were none. */\nfunction messageOf(result: { status: number; error: string }): string {\n if (result.status === 0) return UNREACHABLE;\n return result.error === '' ? `The session answered ${String(result.status)}.` : result.error;\n}\n\nexport type FetchPlanResult = { ok: true; detail: PlanDetailView } | { ok: false; error: string };\n\nexport async function fetchPlan(sessionId: string): Promise<FetchPlanResult> {\n const result = await api.session(sessionId).current();\n // A session that has written nothing answers 404, which is not a failure the\n // reader should be shown as one.\n if (result.status === 404) return { ok: false, error: result.ok || result.error === '' ? NO_PLAN : result.error };\n if (!result.ok) return { ok: false, error: messageOf(result) };\n if (!isRecord(result.data)) return { ok: false, error: 'The session answered with no plan.' };\n return { ok: true, detail: result.data };\n}\n\nexport type SavePlanResult =\n | { ok: true; hash: string }\n /** The plan moved under the editor; `hash` is what it holds now. */\n | { ok: false; stale: true; error: string; hash?: string }\n | { ok: false; stale: false; error: string };\n\nexport async function savePlan(sessionId: string, expectedHash: string, content: string): Promise<SavePlanResult> {\n const result = await api.session(sessionId).save({ body: { expectedHash, content } });\n // The agent can rewrite the plan while a reader is still editing it. A moved\n // hash is the one refusal the editor recovers from, so it is read before the\n // generic failure.\n if (result.status === 409) {\n const data = result.ok ? undefined : result.data;\n const hash = isRecord(data) && typeof data.hash === 'string' ? data.hash : undefined;\n return {\n ok: false,\n stale: true,\n error: result.ok ? 'The plan changed since it was opened.' : messageOf(result),\n ...(hash === undefined ? {} : { hash }),\n };\n }\n if (!result.ok) return { ok: false, stale: false, error: messageOf(result) };\n return { ok: true, hash: isRecord(result.data) && typeof result.data.hash === 'string' ? result.data.hash : '' };\n}\n","import type { WebPluginSlotProps } from '@agimon-ai/po-core/native';\nimport { Button, Markdown, SegmentedControl, Textarea, fontOf } from '@agimon-ai/po-native-components';\nimport type { PoNativeTheme } from '@agimon-ai/po-web-components/nativeTheme';\nimport { useEffect, useState } from 'react';\nimport { ScrollView, Text, View } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { PLAN_STATUS_KEY, type PlanDetailView } from '../../../../../../types/planApi';\nimport { fetchPlan, savePlan } from '../_lib/planApi.native';\n\nexport const PLAN_TAB_ID = 'plan-document';\n\n/** The saved plan, with edits guarded by its on-disk hash, never a caller-supplied path. */\nexport function PlanPanel({\n sessionId,\n statuses,\n closeTransientTab,\n fileTabFor,\n openTransientTab,\n}: WebPluginSlotProps) {\n const [detail, setDetail] = useState<PlanDetailView>();\n const [error, setError] = useState<string>();\n const [loading, setLoading] = useState(true);\n const [view, setView] = useState('preview');\n const [draft, setDraft] = useState<string>();\n const [saving, setSaving] = useState(false);\n const [note, setNote] = useState<string>();\n const revision = statuses[PLAN_STATUS_KEY];\n useEffect(() => {\n if (sessionId === null) return;\n let cancelled = false;\n void fetchPlan(sessionId)\n .then((result) => {\n if (cancelled) return;\n setLoading(false);\n if (result.ok) {\n setDetail(result.detail);\n setError(undefined);\n setDraft(undefined);\n setNote(undefined);\n } else {\n setDetail(undefined);\n setError(result.error);\n }\n })\n .catch((failure: unknown) => {\n if (!cancelled) {\n setLoading(false);\n setError(failure instanceof Error ? failure.message : String(failure));\n }\n });\n return () => {\n cancelled = true;\n };\n }, [sessionId, revision]);\n\n const save = async () => {\n if (sessionId === null || !detail || draft === undefined || detail.unavailable || saving) return;\n setSaving(true);\n try {\n const result = await savePlan(sessionId, detail.hash, draft);\n if (!result.ok) {\n setNote(result.error);\n return;\n }\n setNote('saved');\n const refreshed = await fetchPlan(sessionId);\n if (refreshed.ok) {\n setDetail(refreshed.detail);\n setDraft(undefined);\n } else setError(refreshed.error);\n } catch (failure) {\n setNote(failure instanceof Error ? failure.message : String(failure));\n } finally {\n setSaving(false);\n }\n };\n\n return (\n <ScrollView contentContainerStyle={styles.panel} testID=\"plan-panel\">\n <Text style={styles.title}>{detail?.title ?? 'plan'}</Text>\n <SegmentedControl\n accessibilityLabel=\"plan view\"\n options={[\n { value: 'preview', label: 'preview' },\n { value: 'source', label: 'source' },\n ]}\n value={view}\n onValueChange={setView}\n />\n {sessionId === null ? (\n <Text style={styles.meta}>Select a session.</Text>\n ) : loading && !detail ? (\n <Text style={styles.meta}>reading this session's plan…</Text>\n ) : null}\n {error ? (\n <Text accessibilityRole=\"alert\" style={styles.error}>\n {error}\n </Text>\n ) : null}\n {detail ? (\n detail.unavailable ? (\n <Text style={styles.meta}>{detail.reason ?? 'this plan cannot be shown'}</Text>\n ) : view === 'preview' ? (\n <Markdown\n text={draft ?? detail.content}\n onFileLink={(path) => {\n const tab = fileTabFor(path);\n return tab ? () => openTransientTab(tab) : undefined;\n }}\n />\n ) : (\n <>\n <Textarea\n accessibilityLabel=\"plan source\"\n value={draft ?? detail.content}\n onChangeText={setDraft}\n numberOfLines={12}\n />\n <View style={styles.actions}>\n <Button variant=\"primary\" disabled={draft === undefined || saving} onPress={() => void save()}>\n save to disk\n </Button>\n {draft !== undefined ? (\n <Button variant=\"ghost\" onPress={() => setDraft(undefined)}>\n discard edits\n </Button>\n ) : null}\n </View>\n {note ? <Text style={note === 'saved' ? styles.success : styles.error}>{note}</Text> : null}\n </>\n )\n ) : null}\n {detail ? (\n <Text selectable style={styles.path}>\n {detail.path}\n </Text>\n ) : null}\n <Button variant=\"ghost\" onPress={() => closeTransientTab(PLAN_TAB_ID)}>\n close\n </Button>\n </ScrollView>\n );\n}\n\nexport function planTab(): Parameters<WebPluginSlotProps['openTransientTab']>[0] {\n return { id: PLAN_TAB_ID, label: 'plan', panel: PlanPanel };\n}\n\nconst styles = StyleSheet.create((theme: PoNativeTheme) => ({\n panel: { padding: theme.spacing(4), gap: theme.spacing(3) },\n title: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.lg,\n lineHeight: theme.lineHeight.lg,\n fontWeight: '600',\n color: theme.colors.hi,\n },\n meta: { fontSize: theme.fontSize.sm, lineHeight: theme.lineHeight.sm, color: theme.colors.dim },\n path: { fontFamily: fontOf(theme.fontFamily.mono), fontSize: theme.fontSize.sm, color: theme.colors.dim },\n error: { fontSize: theme.fontSize.sm, color: theme.colors.red },\n success: { fontSize: theme.fontSize.sm, color: theme.colors.green },\n actions: { flexDirection: 'row', flexWrap: 'wrap', gap: theme.spacing(2) },\n}));\n","import type { WebPluginSlotProps } from '@agimon-ai/po-core/native';\nimport { ListRow, fontOf } from '@agimon-ai/po-native-components';\nimport type { PoNativeTheme } from '@agimon-ai/po-web-components/nativeTheme';\nimport { Text, View } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { parsePlanStatus, PLAN_STATUS_KEY } from '../../../../../../types/planApi';\nimport { planTab } from './PlanPanel.native';\n\n/** The document row, not its group header, is the way into a saved plan. */\nexport function PlanActivitySection({ sessionId, statuses, openTransientTab }: WebPluginSlotProps) {\n const view = parsePlanStatus(statuses[PLAN_STATUS_KEY]);\n if (!view) return <Text style={styles.meta}>no plan written yet</Text>;\n return (\n <View testID=\"activity-plan\">\n <ListRow\n title={view.title}\n description={view.stamp || undefined}\n disabled={sessionId === null}\n onPress={() => {\n if (sessionId !== null) openTransientTab(planTab());\n }}\n />\n <Text style={styles.meta}>open to read or edit; the agent reads what you save.</Text>\n </View>\n );\n}\n\nconst styles = StyleSheet.create((theme: PoNativeTheme) => ({\n meta: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n color: theme.colors.dim,\n },\n}));\n","import { defineFill } from '@agimon-ai/po-core/native';\n\nimport { PlanActivitySection } from './_components/PlanActivitySection.native';\n\nexport default defineFill({ slot: 'activity.plan', id: 'plan', component: PlanActivitySection });\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineNativePlugin, type WebPluginContributions } from '@agimon-ai/po-core/native';\n\nimport activityGroupPlan from '../src/extensions/workspaces/sessions/(frontend)/activity-group/plan.native';\nimport fillPlan from '../src/extensions/workspaces/sessions/(frontend)/fill/Plan.activity.plan.native';\n\nconst via = <T>(identity: Record<string, unknown>, value: unknown): T =>\n (value === undefined ? undefined : { ...identity, ...(value as object) }) as T;\n\nexport const nativePlugin = defineNativePlugin({\n id: 'plan',\n session: {\n get activityGroups(): WebPluginContributions['activityGroups'] { return [via({ name: 'plan' }, activityGroupPlan)]; },\n get fills(): WebPluginContributions['fills'] { return [via({ slot: 'activity.plan', id: 'plan' }, fillPlan)]; },\n },\n});\n"],"mappings":";;;;;;;;;;;;;;AAwBA,MAAa,kBAAkB;AAoBI,CALjC;CAAE,OAAO;CAAuB,OAAO;AAAmB,GAC1D;CAAE,OAAO;CAA0B,OAAO;AAAuB,CAIhC,CAAA,CAAoB,KAAK,WAAW,OAAO,KAAK;;AAGnF,MAAM,mBAAmB;;AAGzB,MAAM,OAAO;;;;;;AAmBb,SAAgB,gBAAgB,KAAqD;CACnF,IAAI,QAAQ,KAAA,GAAW,OAAO,KAAA;CAC9B,MAAM,OAAO,IAAI,QAAQ,MAAM,EAAE,CAAC,CAAC,KAAK;CACxC,IAAI,SAAS,IAAI,OAAO,KAAA;CACxB,MAAM,MAAM,KAAK,YAAY,gBAAgB;CAC7C,IAAI,QAAQ,IAAI,OAAO;EAAE,OAAO;EAAM,OAAO;CAAG;CAChD,OAAO;EAAE,OAAO,KAAK,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK;EAAG,OAAO,KAAK,MAAM,MAAM,CAAuB,CAAC,CAAC,KAAK;CAAE;AACrG;;;ACtEA,IAAA,sBAAe,oBAAoB;CACjC,MAAM;CACN,MAAM;CACN,WAAW;CACX,qBAAqB;CACrB,OAAO;AACT,CAAC;AEJD,MAAa,MAAM,gBAAgB;CDYjC,SAAS;EACP,QAAQ;EACR,MAAM;EACN,UAAU,KAAA;CACZ;CACA,MAAM;EACJ,QAAQ;EACR,MAAM;EACN,UAAU,KAAA;CACZ;ACrBiC,GAAQ;CACzC,QAAQ,CAHgB,SAGhB;CACR,UAAU;CACV,WAAW;C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0D,CAAA,CAChF;;AAEV;AAEA,MAAMD,SAAST,WAAWc,QAAQC,WAA0B,EAC1DL,MAAM;CACJM,YAAYlB,OAAOiB,MAAMC,WAAWC,IAAI;CACxCC,UAAUH,MAAMG,SAASC;CACzBC,YAAYL,MAAMK,WAAWD;CAC7BE,OAAON,MAAMO,OAAOC;CAAGC,mBAAA,CAAA,CAAA;AACzB,EACF,EAAE;;;AC/BF,IAAA,oCAAe,WAAW;CAAE,MAAM;CAAiB,IAAI;CAAQ,WAAW;AAAoB,CAAC;;;ACE/F,MAAM,OAAU,UAAmC,UAChD,UAAU,KAAA,IAAY,KAAA,IAAY;CAAE,GAAG;CAAU,GAAI;AAAiB;AAEzE,MAAa,eAAe,mBAAmB;CAC7C,IAAI;CACJ,SAAS;EACP,IAAI,iBAA2D;GAAE,OAAO,CAAC,IAAI,EAAE,MAAM,OAAO,GAAGC,mBAAiB,CAAC;EAAG;EACpH,IAAI,QAAyC;GAAE,OAAO,CAAC,IAAI;IAAE,MAAM;IAAiB,IAAI;GAAO,GAAGC,iCAAQ,CAAC;EAAG;CAChH;AACF,CAAC"}
1
+ {"version":3,"file":"native.mjs","names":["WebPluginSlotProps","Button","Markdown","SegmentedControl","Textarea","fontOf","PoNativeTheme","useEffect","useState","StyleSheet","PLAN_STATUS_KEY","PlanDetailView","fetchPlan","savePlan","PLAN_TAB_ID","PlanPanel","sessionId","statuses","closeTransientTab","fileTabFor","openTransientTab","detail","setDetail","error","setError","loading","setLoading","view","setView","draft","setDraft","saving","setSaving","note","setNote","revision","cancelled","then","result","ok","undefined","catch","failure","Error","message","String","save","unavailable","hash","refreshed","styles","panel","title","value","label","meta","reason","content","path","tab","actions","success","planTab","Parameters","id","create","theme","padding","spacing","gap","uni__dependencies","fontFamily","sans","fontSize","lg","lineHeight","fontWeight","color","colors","hi","sm","dim","mono","red","green","flexDirection","flexWrap","styles","WebPluginSlotProps","ListRow","fontOf","PoNativeTheme","StyleSheet","parsePlanStatus","PLAN_STATUS_KEY","planTab","PlanActivitySection","sessionId","statuses","openTransientTab","view","styles","meta","title","stamp","undefined","create","theme","fontFamily","sans","fontSize","sm","lineHeight","color","colors","dim","uni__dependencies","activityGroupPlan","fillPlan"],"sources":["../../src/types/planApi.ts","../../src/extensions/workspaces/sessions/(frontend)/activity-group/plan.native.ts","../../src/types/apiRoutes.ts","../../generated/client.native.ts","../../src/extensions/workspaces/sessions/(frontend)/fill/_lib/planApi.native.ts","../../src/extensions/workspaces/sessions/(frontend)/fill/_components/PlanPanel.native.tsx","../../src/extensions/workspaces/sessions/(frontend)/fill/_components/PlanActivitySection.native.tsx","../../src/extensions/workspaces/sessions/(frontend)/fill/Plan.activity.plan.native.tsx","../../generated/native.ts"],"sourcesContent":["/**\n * The wire vocabulary this package's API shares with whatever calls it.\n *\n * It lives under src/types because that is the one server root a browser\n * bundle may read: the routes answer with these shapes and the cockpit plugin\n * reads them, so neither half can drift from the other. The paths themselves\n * are not here; they are declared once in `./apiRoutes`, which the Hono app\n * and the generated client both read.\n *\n * Two routes, and neither takes a path. A session has one current plan, so\n * `current` answers it and `content` takes the manual save back; the file they\n * act on is the one write_plan recorded, never one the page named. That is\n * also why there is nothing to escape here: a reader cannot address a second\n * file through these URLs.\n */\n\n/** Where a host mounts this package's API; the segment after /api/plugins/. */\nexport const API_BASE_PATH = 'plans';\n\n/**\n * Footer status key the session publishes once a plan exists, which is what\n * makes the cockpit's activity group appear at all. It outlives plan mode: the\n * plan is most worth reading while the agent implements it.\n */\nexport const PLAN_STATUS_KEY = 'po-plan-document';\n\n/** The selector contract shared by complete_plan and its cockpit composer prompt. */\nexport const PLAN_REVIEW_TITLE = 'Plan complete. What would you like to do?';\nexport const EXIT_PLAN_MODE_CHOICE = 'Exit plan mode and start implementation';\nexport const CONTINUE_PLANNING_CHOICE = 'Continue planning';\nexport const EXIT_PLAN_DECISION = 'exit';\nexport const CONTINUE_PLAN_DECISION = 'continue';\n\n/**\n * The label the reader sees paired with the decision the tool acts on. A headless\n * client answers with `value`, so a server plugin never has to recognise the wording; Pi's\n * own `ui.select` carries labels only, so its half maps the label back itself.\n */\nexport const PLAN_REVIEW_CHOICES = [\n { label: EXIT_PLAN_MODE_CHOICE, value: EXIT_PLAN_DECISION },\n { label: CONTINUE_PLANNING_CHOICE, value: CONTINUE_PLAN_DECISION },\n] as const;\n\n/** The same options as bare labels, which is all Pi's select and the composer prompt need. */\nexport const PLAN_REVIEW_OPTIONS = PLAN_REVIEW_CHOICES.map((choice) => choice.label);\n\n/** Between the plan's title and the stamp that marks a rewrite. */\nconst STATUS_SEPARATOR = ' · ';\n\n/** Strips the colour a session may have themed a status with. */\nconst ANSI = /\u001b\\[[0-9;]*m/gu;\n\n/** The status line the session publishes; the stamp changes on every write. */\nexport function formatPlanStatus(title: string, stamp: string): string {\n return `${title}${STATUS_SEPARATOR}${stamp}`;\n}\n\n/** What a reader gets out of the status line. */\nexport interface PlanStatusView {\n title: string;\n /** When the plan was last written, as the session worded it; empty when it said nothing. */\n stamp: string;\n}\n\n/**\n * Reading the status line back. Statuses reach a plugin raw, so the colour a\n * session may have added comes off here. A title can itself contain the\n * separator, so the stamp is taken from the last one rather than the first.\n */\nexport function parsePlanStatus(raw: string | undefined): PlanStatusView | undefined {\n if (raw === undefined) return undefined;\n const text = raw.replace(ANSI, '').trim();\n if (text === '') return undefined;\n const cut = text.lastIndexOf(STATUS_SEPARATOR);\n if (cut === -1) return { title: text, stamp: '' };\n return { title: text.slice(0, cut).trim(), stamp: text.slice(cut + STATUS_SEPARATOR.length).trim() };\n}\n\n/**\n * What write_plan recorded about this session's plan.\n *\n * The absolute path is the point of it: the extension resolves the plans\n * directory against the harness root, which no other process knows, so it\n * writes down where the plan landed rather than leaving the API to derive a\n * location it would sometimes get wrong.\n */\nexport interface PlanPointerRecord {\n path: string;\n title: string;\n writtenAt: string;\n planId?: string;\n}\n\n/** The plan as it stands on disk right now, which is what the source view edits. */\nexport interface PlanDetailView {\n path: string;\n title: string;\n writtenAt: string;\n planId?: string;\n content: string;\n /** sha256 of the content; the token a save hands back to prove it is not stale. */\n hash: string;\n /** True when the plan is missing or past the size cap, so `content` is empty. */\n unavailable: boolean;\n reason?: string;\n}\n\n/** What the save route takes. */\nexport interface PlanSaveRequest {\n /** The hash the reader loaded; a mismatch means the plan moved underneath them. */\n expectedHash: string;\n content: string;\n}\n\n/** What the save route answers with. */\nexport interface PlanSaveView {\n hash: string;\n}\n\n/** What a route reports when it refuses; the page shows `error` verbatim. */\nexport interface PlanErrorView {\n error: string;\n /** On a stale save, the hash the plan actually has now. */\n hash?: string;\n}\n","import { defineActivityGroup } from '@agimon-ai/po-core/native';\n\nimport { PLAN_STATUS_KEY } from '../../../../../types/planApi';\n\n// Keyed off the saved plan rather than the mode because the plan remains useful\n// while it is being implemented after the read-only mode exits.\nexport default defineActivityGroup({\n name: 'plan',\n keys: 'p e',\n statusKey: PLAN_STATUS_KEY,\n marksBackgroundWork: false,\n order: 25,\n});\n","import type { ApiResponseOf, ApiRoutes } from '@agimon-ai/po-core/web';\n\nimport type { PlanDetailView, PlanSaveView } from './planApi';\n\n/**\n * This package's routes, as data.\n *\n * No scope and no base path. The build reads both off\n * `src/extensions/workspaces/sessions/(backend)/api/plans/`, so the mount is\n * stated once, by the folder that creates it. The paths used to be written\n * here as helpers, again in the contract, and again inside every URL the page\n * built, and the copies were free to disagree.\n *\n * This is the one file the routes, the Hono app and the browser all read, so a\n * path cannot move on one side alone.\n *\n * Neither route takes a query or a path parameter: a session has one current\n * plan, so `current` answers it and `save` takes the manual write back.\n */\nconst routes = {\n current: {\n method: 'GET',\n path: '/current',\n response: undefined as unknown as ApiResponseOf<PlanDetailView>,\n },\n save: {\n method: 'PUT',\n path: '/content',\n response: undefined as unknown as ApiResponseOf<PlanSaveView>,\n },\n} as const satisfies ApiRoutes;\n\nexport default routes;\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { createApiClient, nativeApiTransport, sessionApiAddress } from '@agimon-ai/po-core/native';\n\nimport routes from '../src/types/apiRoutes';\n\n/** Scopes the tree mounts 'plans' at. */\nexport const apiScopes = ['session'] as const;\n\nexport const api = createApiClient(routes, {\n scopes: apiScopes,\n basePath: 'plans',\n transport: nativeApiTransport,\n sessionAddress: sessionApiAddress,\n});\n","import { api } from '../../../../../../../generated/client.native';\nimport type { PlanDetailView } from '../../../../../../types/planApi';\n\n/**\n * The page's half of this package's session API: the current plan, and the\n * manual save.\n *\n * These are adapters now, not a transport. The generated client owns the URL\n * and the sealed transport with it, so nothing here spells a route or reaches\n * for `fetch`. What stays is this package's own vocabulary: which refusals the\n * reader is shown, and the stale-save contract the editor depends on.\n */\n\nconst UNREACHABLE = 'The session is unreachable.';\nconst NO_PLAN = 'This session has not written a plan yet.';\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/** The message a reader is shown: the route's own words, or why there were none. */\nfunction messageOf(result: { status: number; error: string }): string {\n if (result.status === 0) return UNREACHABLE;\n return result.error === '' ? `The session answered ${String(result.status)}.` : result.error;\n}\n\nexport type FetchPlanResult = { ok: true; detail: PlanDetailView } | { ok: false; error: string };\n\nexport async function fetchPlan(sessionId: string): Promise<FetchPlanResult> {\n const result = await api.session(sessionId).current();\n // A session that has written nothing answers 404, which is not a failure the\n // reader should be shown as one.\n if (result.status === 404) return { ok: false, error: result.ok || result.error === '' ? NO_PLAN : result.error };\n if (!result.ok) return { ok: false, error: messageOf(result) };\n if (!isRecord(result.data)) return { ok: false, error: 'The session answered with no plan.' };\n return { ok: true, detail: result.data };\n}\n\nexport type SavePlanResult =\n | { ok: true; hash: string }\n /** The plan moved under the editor; `hash` is what it holds now. */\n | { ok: false; stale: true; error: string; hash?: string }\n | { ok: false; stale: false; error: string };\n\nexport async function savePlan(sessionId: string, expectedHash: string, content: string): Promise<SavePlanResult> {\n const result = await api.session(sessionId).save({ body: { expectedHash, content } });\n // The agent can rewrite the plan while a reader is still editing it. A moved\n // hash is the one refusal the editor recovers from, so it is read before the\n // generic failure.\n if (result.status === 409) {\n const data = result.ok ? undefined : result.data;\n const hash = isRecord(data) && typeof data.hash === 'string' ? data.hash : undefined;\n return {\n ok: false,\n stale: true,\n error: result.ok ? 'The plan changed since it was opened.' : messageOf(result),\n ...(hash === undefined ? {} : { hash }),\n };\n }\n if (!result.ok) return { ok: false, stale: false, error: messageOf(result) };\n return { ok: true, hash: isRecord(result.data) && typeof result.data.hash === 'string' ? result.data.hash : '' };\n}\n","import type { WebPluginSlotProps } from '@agimon-ai/po-core/native';\nimport { Button, Markdown, SegmentedControl, Textarea, fontOf } from '@agimon-ai/po-native-components';\nimport type { PoNativeTheme } from '@agimon-ai/po-web-components/nativeTheme';\nimport { useEffect, useState } from 'react';\nimport { ScrollView, Text, View } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { PLAN_STATUS_KEY, type PlanDetailView } from '../../../../../../types/planApi';\nimport { fetchPlan, savePlan } from '../_lib/planApi.native';\n\nexport const PLAN_TAB_ID = 'plan-document';\n\n/** The saved plan, with edits guarded by its on-disk hash, never a caller-supplied path. */\nexport function PlanPanel({\n sessionId,\n statuses,\n closeTransientTab,\n fileTabFor,\n openTransientTab,\n}: WebPluginSlotProps) {\n const [detail, setDetail] = useState<PlanDetailView>();\n const [error, setError] = useState<string>();\n const [loading, setLoading] = useState(true);\n const [view, setView] = useState('preview');\n const [draft, setDraft] = useState<string>();\n const [saving, setSaving] = useState(false);\n const [note, setNote] = useState<string>();\n const revision = statuses[PLAN_STATUS_KEY];\n useEffect(() => {\n if (sessionId === null) return;\n let cancelled = false;\n void fetchPlan(sessionId)\n .then((result) => {\n if (cancelled) return;\n setLoading(false);\n if (result.ok) {\n setDetail(result.detail);\n setError(undefined);\n setDraft(undefined);\n setNote(undefined);\n } else {\n setDetail(undefined);\n setError(result.error);\n }\n })\n .catch((failure: unknown) => {\n if (!cancelled) {\n setLoading(false);\n setError(failure instanceof Error ? failure.message : String(failure));\n }\n });\n return () => {\n cancelled = true;\n };\n }, [sessionId, revision]);\n\n const save = async () => {\n if (sessionId === null || !detail || draft === undefined || detail.unavailable || saving) return;\n setSaving(true);\n try {\n const result = await savePlan(sessionId, detail.hash, draft);\n if (!result.ok) {\n setNote(result.error);\n return;\n }\n setNote('saved');\n const refreshed = await fetchPlan(sessionId);\n if (refreshed.ok) {\n setDetail(refreshed.detail);\n setDraft(undefined);\n } else setError(refreshed.error);\n } catch (failure) {\n setNote(failure instanceof Error ? failure.message : String(failure));\n } finally {\n setSaving(false);\n }\n };\n\n return (\n <ScrollView contentContainerStyle={styles.panel} testID=\"plan-panel\">\n <Text style={styles.title}>{detail?.title ?? 'plan'}</Text>\n <SegmentedControl\n accessibilityLabel=\"plan view\"\n options={[\n { value: 'preview', label: 'preview' },\n { value: 'source', label: 'source' },\n ]}\n value={view}\n onValueChange={setView}\n />\n {sessionId === null ? (\n <Text style={styles.meta}>Select a session.</Text>\n ) : loading && !detail ? (\n <Text style={styles.meta}>reading this session's plan…</Text>\n ) : null}\n {error ? (\n <Text accessibilityRole=\"alert\" style={styles.error}>\n {error}\n </Text>\n ) : null}\n {detail ? (\n detail.unavailable ? (\n <Text style={styles.meta}>{detail.reason ?? 'this plan cannot be shown'}</Text>\n ) : view === 'preview' ? (\n <Markdown\n text={draft ?? detail.content}\n onFileLink={(path) => {\n const tab = fileTabFor(path);\n return tab ? () => openTransientTab(tab) : undefined;\n }}\n />\n ) : (\n <>\n <Textarea\n accessibilityLabel=\"plan source\"\n value={draft ?? detail.content}\n onChangeText={setDraft}\n numberOfLines={12}\n />\n <View style={styles.actions}>\n <Button variant=\"primary\" disabled={draft === undefined || saving} onPress={() => void save()}>\n save to disk\n </Button>\n {draft !== undefined ? (\n <Button variant=\"ghost\" onPress={() => setDraft(undefined)}>\n discard edits\n </Button>\n ) : null}\n </View>\n {note ? <Text style={note === 'saved' ? styles.success : styles.error}>{note}</Text> : null}\n </>\n )\n ) : null}\n {detail ? (\n <Text selectable style={styles.path}>\n {detail.path}\n </Text>\n ) : null}\n <Button variant=\"ghost\" onPress={() => closeTransientTab(PLAN_TAB_ID)}>\n close\n </Button>\n </ScrollView>\n );\n}\n\nexport function planTab(): Parameters<WebPluginSlotProps['openTransientTab']>[0] {\n return { id: PLAN_TAB_ID, label: 'plan', panel: PlanPanel };\n}\n\nconst styles = StyleSheet.create((theme: PoNativeTheme) => ({\n panel: { padding: theme.spacing(4), gap: theme.spacing(3) },\n title: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.lg,\n lineHeight: theme.lineHeight.lg,\n fontWeight: '600',\n color: theme.colors.hi,\n },\n meta: { fontSize: theme.fontSize.sm, lineHeight: theme.lineHeight.sm, color: theme.colors.dim },\n path: { fontFamily: fontOf(theme.fontFamily.mono), fontSize: theme.fontSize.sm, color: theme.colors.dim },\n error: { fontSize: theme.fontSize.sm, color: theme.colors.red },\n success: { fontSize: theme.fontSize.sm, color: theme.colors.green },\n actions: { flexDirection: 'row', flexWrap: 'wrap', gap: theme.spacing(2) },\n}));\n","import type { WebPluginSlotProps } from '@agimon-ai/po-core/native';\nimport { ListRow, fontOf } from '@agimon-ai/po-native-components';\nimport type { PoNativeTheme } from '@agimon-ai/po-web-components/nativeTheme';\nimport { Text, View } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { parsePlanStatus, PLAN_STATUS_KEY } from '../../../../../../types/planApi';\nimport { planTab } from './PlanPanel.native';\n\n/** The document row, not its group header, is the way into a saved plan. */\nexport function PlanActivitySection({ sessionId, statuses, openTransientTab }: WebPluginSlotProps) {\n const view = parsePlanStatus(statuses[PLAN_STATUS_KEY]);\n if (!view) return <Text style={styles.meta}>no plan written yet</Text>;\n return (\n <View testID=\"activity-plan\">\n <ListRow\n title={view.title}\n description={view.stamp || undefined}\n disabled={sessionId === null}\n onPress={() => {\n if (sessionId !== null) openTransientTab(planTab());\n }}\n />\n <Text style={styles.meta}>open to read or edit; the agent reads what you save.</Text>\n </View>\n );\n}\n\nconst styles = StyleSheet.create((theme: PoNativeTheme) => ({\n meta: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n color: theme.colors.dim,\n },\n}));\n","import { defineFill } from '@agimon-ai/po-core/native';\n\nimport { PlanActivitySection } from './_components/PlanActivitySection.native';\n\nexport default defineFill({ slot: 'activity.plan', id: 'plan', component: PlanActivitySection });\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineNativePlugin, type WebPluginContributions } from '@agimon-ai/po-core/native';\n\nimport activityGroupPlan from '../src/extensions/workspaces/sessions/(frontend)/activity-group/plan.native';\nimport fillPlan from '../src/extensions/workspaces/sessions/(frontend)/fill/Plan.activity.plan.native';\n\nconst via = <T>(identity: Record<string, unknown>, value: unknown): T =>\n (value === undefined ? undefined : { ...identity, ...(value as object) }) as T;\n\nexport const nativePlugin = defineNativePlugin({\n id: 'plan',\n session: {\n get activityGroups(): WebPluginContributions['activityGroups'] { return [via({ name: 'plan' }, activityGroupPlan)]; },\n get fills(): WebPluginContributions['fills'] { return [via({ slot: 'activity.plan', id: 'plan' }, fillPlan)]; },\n },\n});\n"],"mappings":";;;;;;;;;;;;;;AAwBA,MAAa,kBAAkB;AAoBI,CALjC;CAAE,OAAO;CAAuB,OAAO;AAAmB,GAC1D;CAAE,OAAO;CAA0B,OAAO;AAAuB,CAIhC,CAAA,CAAoB,KAAK,WAAW,OAAO,KAAK;;AAGnF,MAAM,mBAAmB;;AAGzB,MAAM,OAAO;;;;;;AAmBb,SAAgB,gBAAgB,KAAqD;CACnF,IAAI,QAAQ,KAAA,GAAW,OAAO,KAAA;CAC9B,MAAM,OAAO,IAAI,QAAQ,MAAM,EAAE,CAAC,CAAC,KAAK;CACxC,IAAI,SAAS,IAAI,OAAO,KAAA;CACxB,MAAM,MAAM,KAAK,YAAY,gBAAgB;CAC7C,IAAI,QAAQ,IAAI,OAAO;EAAE,OAAO;EAAM,OAAO;CAAG;CAChD,OAAO;EAAE,OAAO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UC,oBAAwC;CACjG,MAAMC,OAAOP,gBAAgBK,SAASJ,gBAAgB;CACtD,IAAI,CAACM,MAAM,OAAO,oBAAC,MAAD;EAAM,OAAOC,OAAOC;EAAM,UAAA;CAAyB,CAAA;CACrE,OACE,qBAAC,MAAD;EAAM,QAAO;EAAb,UAAA,CACE,oBAAC,SAAD;GACE,OAAOF,KAAKG;GACZ,aAAaH,KAAKI,SAASC,KAAAA;GAC3B,UAAUR,cAAc;GACxB,eAAe;IACb,IAAIA,cAAc,MAAME,iBAAiBJ,QAAQ,CAAC;GACpD;EAAE,CAAA,GAEJ,oBAAC,MAAD;GAAM,OAAOM,OAAOC;GAAM,UAAA;EAA0D,CAAA,CAChF;;AAEV;AAEA,MAAMD,SAAST,WAAWc,QAAQC,WAA0B,EAC1DL,MAAM;CACJM,YAAYlB,OAAOiB,MAAMC,WAAWC,IAAI;CACxCC,UAAUH,MAAMG,SAASC;CACzBC,YAAYL,MAAMK,WAAWD;CAC7BE,OAAON,MAAMO,OAAOC;CAAGC,mBAAA,CAAA,CAAA;AACzB,EACF,EAAE;;;AC/BF,IAAA,oCAAe,WAAW;CAAE,MAAM;CAAiB,IAAI;CAAQ,WAAW;AAAoB,CAAC;;;ACE/F,MAAM,OAAU,UAAmC,UAChD,UAAU,KAAA,IAAY,KAAA,IAAY;CAAE,GAAG;CAAU,GAAI;AAAiB;AAEzE,MAAa,eAAe,mBAAmB;CAC7C,IAAI;CACJ,SAAS;EACP,IAAI,iBAA2D;GAAE,OAAO,CAAC,IAAI,EAAE,MAAM,OAAO,GAAGC,mBAAiB,CAAC;EAAG;EACpH,IAAI,QAAyC;GAAE,OAAO,CAAC,IAAI;IAAE,MAAM;IAAiB,IAAI;GAAO,GAAGC,iCAAQ,CAAC;EAAG;CAChH;AACF,CAAC"}
@@ -25,9 +25,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
25
25
  }) : target, mod));
26
26
  //#endregion
27
27
  const require_config = require("../config-BjNpZeNO.cjs");
28
- const require_prompts = require("../prompts-BegMUqz9.cjs");
28
+ const require_prompts = require("../prompts-xBLz0h6f.cjs");
29
29
  let node_buffer = require("node:buffer");
30
- let _agimon_ai_po_core_serverFacet = require("@agimon-ai/po-core/serverFacet");
30
+ let _agimon_ai_po_core_serverPlugin = require("@agimon-ai/po-core/serverPlugin");
31
31
  let _agimon_ai_po_core_extensionFile = require("@agimon-ai/po-core/extensionFile");
32
32
  let typebox = require("typebox");
33
33
  let node_crypto = require("node:crypto");
@@ -197,7 +197,7 @@ const EXIT_PLAN_DECISION = "exit";
197
197
  const CONTINUE_PLAN_DECISION = "continue";
198
198
  /**
199
199
  * The label the reader sees paired with the decision the tool acts on. A headless
200
- * client answers with `value`, so a facet never has to recognise the wording; Pi's
200
+ * client answers with `value`, so a server plugin never has to recognise the wording; Pi's
201
201
  * own `ui.select` carries labels only, so its half maps the label back itself.
202
202
  */
203
203
  const PLAN_REVIEW_CHOICES = [{
@@ -403,7 +403,7 @@ function createPlanServerSession(host) {
403
403
  /**
404
404
  * The activity group's line, and the pointer its panel reads.
405
405
  *
406
- * A cockpit drives this facet and never the Pi runtime, so both were written
406
+ * A cockpit drives this server plugin and never the Pi runtime, so both were written
407
407
  * only on the Pi side: the group never appeared, and when it did its panel
408
408
  * had no pointer to answer from.
409
409
  */
@@ -588,7 +588,7 @@ function createPlanServerSession(host) {
588
588
  },
589
589
  name: "po-use-plan",
590
590
  kind: "skill",
591
- read: () => (0, _agimon_ai_po_core_serverFacet.readPackageResource)(require("url").pathToFileURL(__filename).href, "src/prompts/po-use-plan/SKILL.md")
591
+ read: () => (0, _agimon_ai_po_core_serverPlugin.readPackageResource)(require("url").pathToFileURL(__filename).href, "src/prompts/po-use-plan/SKILL.md")
592
592
  }],
593
593
  tools: [
594
594
  {
@@ -976,11 +976,12 @@ const via = (identity, value) => value === void 0 ? void 0 : {
976
976
  ...identity,
977
977
  ...value
978
978
  };
979
- const facet = (0, _agimon_ai_po_core_serverFacet.defineServerPlugin)({
979
+ const serverPlugin = (0, _agimon_ai_po_core_serverPlugin.defineServerPlugin)({
980
980
  name: "@agimon-ai/po-plan",
981
- providerOverrides: (0, _agimon_ai_po_core_serverFacet.composeServerProviderOverrides)(root_server_default),
981
+ providerOverrides: (0, _agimon_ai_po_core_serverPlugin.composeServerProviderOverrides)(root_server_default),
982
+ injects: (0, _agimon_ai_po_core_extensionFile.composeRootInjects)({ session: [root_server_default] }),
982
983
  session: async (context) => {
983
- const scopeSession = await root_server_default(context);
984
+ const scopeSession = await context.scopeRoot("session", root_server_default, context);
984
985
  const contextSession = {
985
986
  ...context,
986
987
  root: scopeSession.value
@@ -1018,7 +1019,7 @@ const facet = (0, _agimon_ai_po_core_serverFacet.defineServerPlugin)({
1018
1019
  }
1019
1020
  });
1020
1021
  //#endregion
1021
- exports.default = facet;
1022
- exports.facet = facet;
1022
+ exports.default = serverPlugin;
1023
+ exports.serverPlugin = serverPlugin;
1023
1024
 
1024
1025
  //# sourceMappingURL=server.cjs.map