@agimon-ai/po-plan 0.0.0-alpha.7 → 0.0.0-alpha.70
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.
- package/LICENSE +149 -21
- package/README.md +4 -3
- package/dist/extensions/mcp.cjs +2 -2
- package/dist/extensions/mcp.cjs.map +1 -1
- package/dist/extensions/mcp.mjs +1 -1
- package/dist/extensions/mcp.mjs.map +1 -1
- package/dist/extensions/native.mjs.map +1 -1
- package/dist/extensions/server.cjs +190 -83
- package/dist/extensions/server.cjs.map +1 -1
- package/dist/extensions/server.d.mts +2 -2
- package/dist/extensions/server.d.mts.map +1 -1
- package/dist/extensions/server.mjs +190 -82
- package/dist/extensions/server.mjs.map +1 -1
- package/dist/extensions/web.mjs +11 -5
- package/dist/extensions/web.mjs.map +1 -1
- package/dist/{index-C9QBG9cw.d.mts → index-z5fDlKWZ.d.mts} +5 -9
- package/dist/index-z5fDlKWZ.d.mts.map +1 -0
- package/dist/index.cjs +1 -14
- package/dist/index.d.mts +2 -3
- package/dist/index.mjs +2 -3
- package/dist/logSinkTelemetry.cjs +2 -2
- package/dist/logSinkTelemetry.cjs.map +1 -1
- package/dist/logSinkTelemetry.d.mts +1 -1
- package/dist/logSinkTelemetry.mjs +1 -1
- package/dist/logSinkTelemetry.mjs.map +1 -1
- package/dist/{prompts-mKH52qIX.mjs → prompts-CQteex7L.mjs} +5 -10
- package/dist/prompts-CQteex7L.mjs.map +1 -0
- package/dist/{prompts-BegMUqz9.cjs → prompts-CTao3VmZ.cjs} +4 -15
- package/dist/prompts-CTao3VmZ.cjs.map +1 -0
- package/dist/prompts.cjs +1 -2
- package/dist/prompts.d.mts +2 -2
- package/dist/prompts.mjs +1 -1
- package/package.json +19 -25
- package/src/types/planApi.ts +1 -1
- package/dist/fableFlow-BDc8a__Y.mjs +0 -214
- package/dist/fableFlow-BDc8a__Y.mjs.map +0 -1
- package/dist/fableFlow-CzfrLPzJ.cjs +0 -279
- package/dist/fableFlow-CzfrLPzJ.cjs.map +0 -1
- package/dist/fableFlow.cjs +0 -13
- package/dist/fableFlow.d.mts +0 -2
- package/dist/fableFlow.mjs +0 -1
- package/dist/index-C8e7IK60.d.mts +0 -68
- package/dist/index-C8e7IK60.d.mts.map +0 -1
- package/dist/index-C9QBG9cw.d.mts.map +0 -1
- package/dist/prompts-BegMUqz9.cjs.map +0 -1
- package/dist/prompts-mKH52qIX.mjs.map +0 -1
package/LICENSE
CHANGED
|
@@ -1,21 +1,149 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
License text copyright © 2017 MariaDB Corporation Ab, All Rights Reserved.
|
|
2
|
+
"Business Source License" is a trademark of MariaDB Corporation Ab.
|
|
3
|
+
|
|
4
|
+
Parameters
|
|
5
|
+
|
|
6
|
+
Licensor: Agimon Pty Ltd
|
|
7
|
+
Licensed Work: Po, the software in the Po source repository and the
|
|
8
|
+
packages released from it, in each version released by
|
|
9
|
+
the Licensor.
|
|
10
|
+
The Licensed Work is (c) 2026 Agimon Pty Ltd.
|
|
11
|
+
Material identified as third-party in the "Third-party
|
|
12
|
+
components" section at the end of this file or in a
|
|
13
|
+
NOTICE file, and any package or directory whose own
|
|
14
|
+
license file grants a different license, is not part of
|
|
15
|
+
the Licensed Work and remains under its own license.
|
|
16
|
+
Additional Use Grant: You may make production use of the Licensed Work if
|
|
17
|
+
your use is Eligible Use. "Eligible Use" is production use that falls
|
|
18
|
+
within at least one of the following:
|
|
19
|
+
|
|
20
|
+
(a) Personal Use. Use by an individual for their own personal purposes,
|
|
21
|
+
and not on behalf of, or for the benefit of, an employer, client, or
|
|
22
|
+
other Organization. Use by an individual in the course of employment
|
|
23
|
+
or engagement by an Organization is use by that Organization.
|
|
24
|
+
|
|
25
|
+
(b) Small Organization Use. Use by or on behalf of an Organization whose
|
|
26
|
+
Annual Revenue is less than USD 1,000,000.
|
|
27
|
+
|
|
28
|
+
(c) Non-profit, Education and Research Use. Use, regardless of Annual
|
|
29
|
+
Revenue, by (i) an Organization registered or recognized as a
|
|
30
|
+
non-profit or charitable organization under the laws of its
|
|
31
|
+
jurisdiction, for its non-profit purposes; (ii) an accredited school,
|
|
32
|
+
college, or university, for teaching, learning, or academic research;
|
|
33
|
+
or (iii) a publicly funded research institution, for its research.
|
|
34
|
+
|
|
35
|
+
(d) Service Provider Use. Use by a consultant, contractor, agency, or other
|
|
36
|
+
service provider, regardless of its own Annual Revenue, solely to
|
|
37
|
+
build, deploy, host, operate, or support the Licensed Work for a client
|
|
38
|
+
whose own use would be Eligible Use under (a), (b), or (c). A service
|
|
39
|
+
provider's use for its own purposes is Eligible Use only if the service
|
|
40
|
+
provider itself qualifies under (b) or (c).
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
Hosted services. Offering the Licensed Work to third parties as a hosted
|
|
44
|
+
or managed service whose primary value is the Licensed Work is Eligible
|
|
45
|
+
Use only if each such third party's own use would be Eligible Use.
|
|
46
|
+
|
|
47
|
+
Definitions. "Organization" means any company, partnership, sole
|
|
48
|
+
proprietorship, trust, association, government body, or other entity, and
|
|
49
|
+
includes an individual acting in a business or professional capacity.
|
|
50
|
+
"Affiliate" means any entity that directly or indirectly controls, is
|
|
51
|
+
controlled by, or is under common control with an Organization, where
|
|
52
|
+
"control" means ownership of more than 50% of the voting interests of an
|
|
53
|
+
entity or the power to direct its management and policies by contract or
|
|
54
|
+
otherwise. "Annual Revenue" means the total gross revenue of an
|
|
55
|
+
Organization and all of its Affiliates combined, from all sources and
|
|
56
|
+
whether or not related to the Licensed Work, for its most recently
|
|
57
|
+
completed fiscal year, or, if it has not completed a fiscal year, for the
|
|
58
|
+
twelve months before the use (or since its formation, if shorter),
|
|
59
|
+
converted into US dollars at the average exchange rate for that period.
|
|
60
|
+
Proceeds of equity or debt financing are not revenue.
|
|
61
|
+
|
|
62
|
+
Threshold. If an Organization stops qualifying under (b), its existing
|
|
63
|
+
production use remains Eligible Use for 90 days after it stops
|
|
64
|
+
qualifying, after which it must obtain a commercial license or stop
|
|
65
|
+
production use. Use that was Eligible Use when it occurred never requires
|
|
66
|
+
a commercial license after the fact.
|
|
67
|
+
Change Date: Four years from the date a version of the Licensed Work
|
|
68
|
+
is first publicly released by the Licensor.
|
|
69
|
+
Change License: Apache License, Version 2.0
|
|
70
|
+
|
|
71
|
+
For information about alternative licensing arrangements for the Licensed
|
|
72
|
+
Work, please visit: https://agimon.ai/licensing
|
|
73
|
+
|
|
74
|
+
Notice
|
|
75
|
+
|
|
76
|
+
The Business Source License (this document, or the "License") is not an Open
|
|
77
|
+
Source license. However, the Licensed Work will eventually be made available
|
|
78
|
+
under an Open Source License, as stated in this License.
|
|
79
|
+
|
|
80
|
+
-----------------------------------------------------------------------------
|
|
81
|
+
|
|
82
|
+
Business Source License 1.1
|
|
83
|
+
|
|
84
|
+
Terms
|
|
85
|
+
|
|
86
|
+
The Licensor hereby grants you the right to copy, modify, create derivative
|
|
87
|
+
works, redistribute, and make non-production use of the Licensed Work. The
|
|
88
|
+
Licensor may make an Additional Use Grant, above, permitting limited
|
|
89
|
+
production use.
|
|
90
|
+
|
|
91
|
+
Effective on the Change Date, or the fourth anniversary of the first publicly
|
|
92
|
+
available distribution of a specific version of the Licensed Work under this
|
|
93
|
+
License, whichever comes first, the Licensor hereby grants you rights under
|
|
94
|
+
the terms of the Change License, and the rights granted in the paragraph
|
|
95
|
+
above terminate.
|
|
96
|
+
|
|
97
|
+
If your use of the Licensed Work does not comply with the requirements
|
|
98
|
+
currently in effect as described in this License, you must purchase a
|
|
99
|
+
commercial license from the Licensor, its affiliated entities, or authorized
|
|
100
|
+
resellers, or you must refrain from using the Licensed Work.
|
|
101
|
+
|
|
102
|
+
All copies of the original and modified Licensed Work, and derivative works
|
|
103
|
+
of the Licensed Work, are subject to this License. This License applies
|
|
104
|
+
separately for each version of the Licensed Work and the Change Date may vary
|
|
105
|
+
for each version of the Licensed Work released by Licensor.
|
|
106
|
+
|
|
107
|
+
You must conspicuously display this License on each original or modified copy
|
|
108
|
+
of the Licensed Work. If you receive the Licensed Work in original or
|
|
109
|
+
modified form from a third party, the terms and conditions set forth in this
|
|
110
|
+
License apply to your use of that work.
|
|
111
|
+
|
|
112
|
+
Any use of the Licensed Work in violation of this License will automatically
|
|
113
|
+
terminate your rights under this License for the current and all other
|
|
114
|
+
versions of the Licensed Work.
|
|
115
|
+
|
|
116
|
+
This License does not grant you any right in any trademark or logo of
|
|
117
|
+
Licensor or its affiliates (provided that you may use a trademark or logo of
|
|
118
|
+
Licensor as expressly required by this License).
|
|
119
|
+
|
|
120
|
+
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
|
|
121
|
+
AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
|
|
122
|
+
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
|
|
123
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
|
|
124
|
+
TITLE.
|
|
125
|
+
|
|
126
|
+
MariaDB hereby grants you permission to use this License’s text to license
|
|
127
|
+
your works, and to refer to it using the trademark “Business Source License”,
|
|
128
|
+
as long as you comply with the Covenants of Licensor below.
|
|
129
|
+
|
|
130
|
+
Covenants of Licensor
|
|
131
|
+
|
|
132
|
+
In consideration of the right to use this License’s text and the “Business
|
|
133
|
+
Source License” name and trademark, Licensor covenants to MariaDB, and to all
|
|
134
|
+
other recipients of the licensed work to be provided by Licensor:
|
|
135
|
+
|
|
136
|
+
1. To specify as the Change License the GPL Version 2.0 or any later version,
|
|
137
|
+
or a license that is compatible with GPL Version 2.0 or a later version,
|
|
138
|
+
where “compatible” means that software provided under the Change License can
|
|
139
|
+
be included in a program with software provided under GPL Version 2.0 or a
|
|
140
|
+
later version. Licensor may specify additional Change Licenses without
|
|
141
|
+
limitation.
|
|
142
|
+
|
|
143
|
+
2. To either: (a) specify an additional grant of rights to use that does not
|
|
144
|
+
impose any additional restriction on the right granted in this License, as
|
|
145
|
+
the Additional Use Grant; or (b) insert the text “None”.
|
|
146
|
+
|
|
147
|
+
3. To specify a Change Date.
|
|
148
|
+
|
|
149
|
+
4. Not to modify this License in any other way.
|
package/README.md
CHANGED
|
@@ -77,8 +77,9 @@ modes:
|
|
|
77
77
|
```
|
|
78
78
|
|
|
79
79
|
`main` controls the planning model, `subagents` controls delegated research defaults, and
|
|
80
|
-
`plansDirectory` can be absolute, repository-relative, or under `~`.
|
|
81
|
-
|
|
80
|
+
`plansDirectory` can be absolute, repository-relative, or under `~`. When session artifacts are
|
|
81
|
+
available, plans are stored under `<artifactRoot>/plans/` instead; `plansDirectory` is the fallback.
|
|
82
|
+
Planning and delegated model calls consume provider quota.
|
|
82
83
|
|
|
83
84
|
## Public API
|
|
84
85
|
|
|
@@ -95,4 +96,4 @@ Maintained by [Agimon](https://agimon.ai/about).
|
|
|
95
96
|
|
|
96
97
|
## License
|
|
97
98
|
|
|
98
|
-
|
|
99
|
+
Business Source License 1.1: free for personal use, organisations under USD 1M revenue, non-profits and education. See [LICENSE](LICENSE) and https://agimon.ai/licensing.
|
package/dist/extensions/mcp.cjs
CHANGED
|
@@ -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
|
|
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,
|
|
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/
|
|
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,sBAA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eC,4BAAAA,cAAAA,EAAe,YAAgC,YAAY,SAAS,YAAY,CAAC;;;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"}
|
package/dist/extensions/mcp.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineMcpPlugin, defineMcpSkill, defineMcpTool } from "@agimon-ai/po-core/mcpFacet";
|
|
2
|
-
import { readPackageResource } from "@agimon-ai/po-core/
|
|
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/
|
|
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;GAEhD,IAAI,EADgB,QAAQ,UAAU,KAAK,CAAC,CAAC,QAAQ,iBAAiB,CAAC,EAAA,CACtD,SAAS,OAAO,GAAG;IAClC,MAAM,gBAAgB,CAAC,GAAG,QAAQ,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI;IAC3D,MAAM,IAAI,MAAM,GAAG,WAAW,oCAAoC,WAAW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;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(): WebPlugin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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,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,MA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