@agimon-ai/po-ui 0.0.0-alpha.3 → 0.0.0-alpha.30
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 +1 -1
- package/dist/apiContracts.cjs +1 -1
- package/dist/apiContracts.cjs.map +1 -1
- package/dist/apiContracts.d.mts +1 -1
- package/dist/apiContracts.mjs +1 -1
- package/dist/apiContracts.mjs.map +1 -1
- package/dist/config.d.mts +2 -2
- package/dist/extensions/mcp-ui.mjs.map +1 -1
- package/dist/extensions/mcp.cjs +3 -3
- package/dist/extensions/mcp.cjs.map +1 -1
- package/dist/extensions/mcp.d.mts +1 -1
- package/dist/extensions/mcp.mjs +4 -4
- package/dist/extensions/mcp.mjs.map +1 -1
- package/dist/extensions/server.cjs +7 -7
- 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 +7 -7
- package/dist/extensions/server.mjs.map +1 -1
- package/dist/extensions/web.mjs +22 -28
- package/dist/extensions/web.mjs.map +1 -1
- package/dist/footer.d.mts +2 -2
- package/dist/{harnessMetadata-Dw9Rb1nW.cjs → harnessMetadata-B3mBGrS3.cjs} +4 -4
- package/dist/harnessMetadata-B3mBGrS3.cjs.map +1 -0
- package/dist/{harnessMetadata-CzsdGAxL.d.mts → harnessMetadata-BzMgOB0W.d.mts} +4 -4
- package/dist/harnessMetadata-BzMgOB0W.d.mts.map +1 -0
- package/dist/{harnessMetadata-DkMSJutN.mjs → harnessMetadata-Ccv_j7WP.mjs} +3 -3
- package/dist/harnessMetadata-Ccv_j7WP.mjs.map +1 -0
- package/dist/harnessMetadata.cjs +2 -2
- package/dist/harnessMetadata.d.mts +2 -2
- package/dist/harnessMetadata.mjs +1 -1
- package/dist/{index-Bx49wmE7.d.mts → index-DJvl27YF.d.mts} +9 -9
- package/dist/{index-Bx49wmE7.d.mts.map → index-DJvl27YF.d.mts.map} +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.d.mts +7 -7
- package/dist/index.mjs +4 -4
- package/dist/leader.d.mts +2 -2
- package/dist/leaderRegistry.cjs +2 -2
- package/dist/leaderRegistry.cjs.map +1 -1
- package/dist/leaderRegistry.d.mts +15 -15
- package/dist/leaderRegistry.d.mts.map +1 -1
- package/dist/leaderRegistry.mjs +2 -2
- package/dist/leaderRegistry.mjs.map +1 -1
- package/dist/logSinkTelemetry.cjs +1 -1
- package/dist/logSinkTelemetry.d.mts +1 -1
- package/dist/logSinkTelemetry.mjs +1 -1
- package/dist/skills.cjs +8 -8
- package/dist/skills.d.mts +2 -2
- package/dist/skills.mjs +1 -1
- package/dist/{telemetry--EgKB9ei.mjs → telemetry-BvCR35jo.mjs} +9 -9
- package/dist/telemetry-BvCR35jo.mjs.map +1 -0
- package/dist/{telemetry-DMR6cIT1.cjs → telemetry-DZXeC4kO.cjs} +9 -9
- package/dist/telemetry-DZXeC4kO.cjs.map +1 -0
- package/dist/{uiState-G_Pso-5i.mjs → uiState-C7I5WcMl.mjs} +3 -3
- package/dist/uiState-C7I5WcMl.mjs.map +1 -0
- package/dist/{uiState-rUwgKslb.cjs → uiState-CCytmxyX.cjs} +4 -4
- package/dist/uiState-CCytmxyX.cjs.map +1 -0
- package/dist/{uiState-Binu4nUb.d.mts → uiState-DbjaVyxl.d.mts} +3 -3
- package/dist/{uiState-Binu4nUb.d.mts.map → uiState-DbjaVyxl.d.mts.map} +1 -1
- package/dist/uiState.cjs +2 -2
- package/dist/uiState.d.mts +2 -2
- package/dist/uiState.mjs +1 -1
- package/package.json +17 -18
- package/dist/harnessMetadata-CzsdGAxL.d.mts.map +0 -1
- package/dist/harnessMetadata-DkMSJutN.mjs.map +0 -1
- package/dist/harnessMetadata-Dw9Rb1nW.cjs.map +0 -1
- package/dist/telemetry--EgKB9ei.mjs.map +0 -1
- package/dist/telemetry-DMR6cIT1.cjs.map +0 -1
- package/dist/uiState-G_Pso-5i.mjs.map +0 -1
- package/dist/uiState-rUwgKslb.cjs.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
package/dist/apiContracts.cjs
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
//#region src/schemas/apiContracts.ts
|
|
6
|
-
/** This
|
|
6
|
+
/** This server plugin contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
|
|
7
7
|
const apiContracts = (0, require("@agimon-ai/po-core/apiContracts").defineApiContract)({
|
|
8
8
|
version: 1,
|
|
9
9
|
http: [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiContracts.cjs","names":["defineApiContract"],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract } from '@agimon-ai/po-core/apiContracts';\n\n/** This
|
|
1
|
+
{"version":3,"file":"apiContracts.cjs","names":["defineApiContract"],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract } from '@agimon-ai/po-core/apiContracts';\n\n/** This server plugin contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */\nexport const apiContracts = defineApiContract({ version: 1, http: [], sockets: [], dynamic: [] });\nexport default apiContracts;\n"],"mappings":";;;;;;AAGA,MAAa,gBAAA,4CAAeA,CAAAA,CAAAA,kBAAAA,CAAkB;CAAE,SAAS;CAAG,MAAM,CAAC;CAAG,SAAS,CAAC;CAAG,SAAS,CAAC;AAAE,CAAC"}
|
package/dist/apiContracts.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/schemas/apiContracts.d.ts
|
|
2
|
-
/** This
|
|
2
|
+
/** This server plugin contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
|
|
3
3
|
export declare const apiContracts: {
|
|
4
4
|
version: 1;
|
|
5
5
|
protocols?: Record<string, string> | undefined;
|
package/dist/apiContracts.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineApiContract } from "@agimon-ai/po-core/apiContracts";
|
|
2
2
|
//#region src/schemas/apiContracts.ts
|
|
3
|
-
/** This
|
|
3
|
+
/** This server plugin contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
|
|
4
4
|
const apiContracts = defineApiContract({
|
|
5
5
|
version: 1,
|
|
6
6
|
http: [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiContracts.mjs","names":[],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract } from '@agimon-ai/po-core/apiContracts';\n\n/** This
|
|
1
|
+
{"version":3,"file":"apiContracts.mjs","names":[],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract } from '@agimon-ai/po-core/apiContracts';\n\n/** This server plugin contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */\nexport const apiContracts = defineApiContract({ version: 1, http: [], sockets: [], dynamic: [] });\nexport default apiContracts;\n"],"mappings":";;;AAGA,MAAa,eAAe,kBAAkB;CAAE,SAAS;CAAG,MAAM,CAAC;CAAG,SAAS,CAAC;CAAG,SAAS,CAAC;AAAE,CAAC"}
|
package/dist/config.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CONFIG_ACTION, ConfigAction, ConfigActionSchema, ConfigChoice, ConfigChoiceSchema, ConfigField, ConfigFieldKind, ConfigFieldKindSchema, ConfigFieldSchema, ConfigProgress, ConfigProgressSchema, ConfigSection, ConfigSectionSchema, ConfigSnapshot, ConfigSourceRef, ConfigSourceSchema, ConfigStatus, ConfigStatusSchema, ConfigStep, ConfigStepSchema,
|
|
2
|
-
export { CONFIG_ACTION, type ConfigAction, ConfigActionSchema, type ConfigChoice, ConfigChoiceSchema, type ConfigField, type ConfigFieldKind, ConfigFieldKindSchema, ConfigFieldSchema, type ConfigProgress, ConfigProgressSchema, type ConfigSection, ConfigSectionSchema, type ConfigSnapshot, type ConfigSourceRef, ConfigSourceSchema, type ConfigStatus, ConfigStatusSchema, type ConfigStep, ConfigStepSchema, type
|
|
1
|
+
import { CONFIG_ACTION, ConfigAction, ConfigActionSchema, ConfigChoice, ConfigChoiceSchema, ConfigField, ConfigFieldKind, ConfigFieldKindSchema, ConfigFieldSchema, ConfigProgress, ConfigProgressSchema, ConfigSection, ConfigSectionSchema, ConfigSnapshot, ConfigSourceRef, ConfigSourceSchema, ConfigStatus, ConfigStatusSchema, ConfigStep, ConfigStepSchema, PoConfigActionInput, PoConfigContributionHandle, PoConfigContributionOptions, PoConfigInvocation, PoConfigSectionView, PoExtensionContext } from "@agimon-ai/po-core/config";
|
|
2
|
+
export { CONFIG_ACTION, type ConfigAction, ConfigActionSchema, type ConfigChoice, ConfigChoiceSchema, type ConfigField, type ConfigFieldKind, ConfigFieldKindSchema, ConfigFieldSchema, type ConfigProgress, ConfigProgressSchema, type ConfigSection, ConfigSectionSchema, type ConfigSnapshot, type ConfigSourceRef, ConfigSourceSchema, type ConfigStatus, ConfigStatusSchema, type ConfigStep, ConfigStepSchema, type PoConfigActionInput, type PoConfigContributionHandle, type PoConfigContributionOptions, type PoConfigInvocation, type PoConfigSectionView, type PoExtensionContext };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-ui.mjs","names":["Widget0","Widget1","Widget2"],"sources":["../../src/extensions/workspaces/sessions/(frontend)/tool/find.mcp.tsx","../../src/extensions/workspaces/sessions/(frontend)/tool/ls.mcp.tsx","../../src/extensions/workspaces/sessions/(frontend)/tool/write.mcp.tsx","../../generated/mcp-ui.ts"],"sourcesContent":["import { defineMcpWidget, type
|
|
1
|
+
{"version":3,"file":"mcp-ui.mjs","names":["Widget0","Widget1","Widget2"],"sources":["../../src/extensions/workspaces/sessions/(frontend)/tool/find.mcp.tsx","../../src/extensions/workspaces/sessions/(frontend)/tool/ls.mcp.tsx","../../src/extensions/workspaces/sessions/(frontend)/tool/write.mcp.tsx","../../generated/mcp-ui.ts"],"sourcesContent":["import { defineMcpWidget, type PoMcpWidgetProps } from '@agimon-ai/po-core/web';\nimport { McpToolFrame, McpToolFields, McpToolOutput } from '@agimon-ai/po-web-components';\n\nfunction FindMcpWidget(props: PoMcpWidgetProps) {\n return (\n <McpToolFrame {...props} title=\"Find files\">\n <McpToolFields\n fields={[\n ['Pattern', props.args.pattern],\n ['Path', props.args.path],\n ['Limit', props.args.limit],\n ]}\n />\n <McpToolOutput result={props.result} />\n </McpToolFrame>\n );\n}\n\nexport default defineMcpWidget(FindMcpWidget);\n","import { defineMcpWidget, type PoMcpWidgetProps } from '@agimon-ai/po-core/web';\nimport { McpToolFrame, McpToolFields, McpToolOutput } from '@agimon-ai/po-web-components';\n\nfunction LsMcpWidget(props: PoMcpWidgetProps) {\n return (\n <McpToolFrame {...props} title=\"List directory\">\n <McpToolFields\n fields={[\n ['Path', props.args.path],\n ['Limit', props.args.limit],\n ]}\n />\n <McpToolOutput result={props.result} />\n </McpToolFrame>\n );\n}\n\nexport default defineMcpWidget(LsMcpWidget);\n","import { defineMcpWidget, type PoMcpWidgetProps } from '@agimon-ai/po-core/web';\nimport { McpToolFrame, McpToolFields, McpToolOutput } from '@agimon-ai/po-web-components';\n\nfunction WriteMcpWidget(props: PoMcpWidgetProps) {\n return (\n <McpToolFrame {...props} title=\"Write file\">\n <McpToolFields\n fields={[\n ['Path', props.args.path],\n ['Characters', typeof props.args.content === 'string' ? props.args.content.length : undefined],\n ]}\n />\n <McpToolOutput result={props.result} />\n </McpToolFrame>\n );\n}\n\nexport default defineMcpWidget(WriteMcpWidget);\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport type { ComponentType } from 'react';\nimport type { PoMcpWidgetProps } from '@agimon-ai/po-core/mcpWidget';\nimport Widget0 from \"../src/extensions/workspaces/sessions/(frontend)/tool/find.mcp\";\nimport Widget1 from \"../src/extensions/workspaces/sessions/(frontend)/tool/ls.mcp\";\nimport Widget2 from \"../src/extensions/workspaces/sessions/(frontend)/tool/write.mcp\";\n\nexport const widgets: Readonly<Record<string, ComponentType<PoMcpWidgetProps>>> = {\n \"@agimon-ai/po-ui/find\": Widget0,\n \"@agimon-ai/po-ui/ls\": Widget1,\n \"@agimon-ai/po-ui/write\": Widget2,\n};\n"],"mappings":";;;;AAGA,SAAS,cAAc,OAAyB;CAC9C,OACE,qBAAC,cAAD;EAAc,GAAI;EAAO,OAAM;EAA/B,UAAA,CACE,oBAAC,eAAD,EACE,QAAQ;GACN,CAAC,WAAW,MAAM,KAAK,OAAO;GAC9B,CAAC,QAAQ,MAAM,KAAK,IAAI;GACxB,CAAC,SAAS,MAAM,KAAK,KAAK;EAC5B,EACD,CAAA,GACD,oBAAC,eAAD,EAAe,QAAQ,MAAM,OAAS,CAAA,CAC1B;;AAElB;AAEA,IAAA,mBAAe,gBAAgB,aAAa;;;ACf5C,SAAS,YAAY,OAAyB;CAC5C,OACE,qBAAC,cAAD;EAAc,GAAI;EAAO,OAAM;EAA/B,UAAA,CACE,oBAAC,eAAD,EACE,QAAQ,CACN,CAAC,QAAQ,MAAM,KAAK,IAAI,GACxB,CAAC,SAAS,MAAM,KAAK,KAAK,CAC5B,EACD,CAAA,GACD,oBAAC,eAAD,EAAe,QAAQ,MAAM,OAAS,CAAA,CAC1B;;AAElB;AAEA,IAAA,iBAAe,gBAAgB,WAAW;;;ACd1C,SAAS,eAAe,OAAyB;CAC/C,OACE,qBAAC,cAAD;EAAc,GAAI;EAAO,OAAM;EAA/B,UAAA,CACE,oBAAC,eAAD,EACE,QAAQ,CACN,CAAC,QAAQ,MAAM,KAAK,IAAI,GACxB,CAAC,cAAc,OAAO,MAAM,KAAK,YAAY,WAAW,MAAM,KAAK,QAAQ,SAAS,KAAA,CAAS,CAC/F,EACD,CAAA,GACD,oBAAC,eAAD,EAAe,QAAQ,MAAM,OAAS,CAAA,CAC1B;;AAElB;;;ACRA,MAAa,UAAqE;CAChF,yBAAyBA;CACzB,uBAAuBC;CACvB,0BDOa,gBAAgB,cCPHC;AAC5B"}
|
package/dist/extensions/mcp.cjs
CHANGED
|
@@ -13,7 +13,7 @@ function createMcpWriteTool(context) {
|
|
|
13
13
|
description: "Create or fully overwrite a file in the Po session's repository on the host machine, creating parent folders. Use this server's edit tool to change part of an existing file.",
|
|
14
14
|
executionMode: tool.executionMode === "sequential" ? "serial" : tool.executionMode,
|
|
15
15
|
async execute(toolCallId, parameters, signal, onUpdate) {
|
|
16
|
-
return (0, _agimon_ai_po_core_headless.
|
|
16
|
+
return (0, _agimon_ai_po_core_headless.toPoHeadlessToolResult)(await tool.execute(toolCallId, parameters, AbortSignal.any([context.signal, signal ?? context.signal]), onUpdate && ((partial) => onUpdate((0, _agimon_ai_po_core_headless.toPoHeadlessToolResult)(partial)))));
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
}
|
|
@@ -24,7 +24,7 @@ function createMcpFindTool(context) {
|
|
|
24
24
|
description: "Find files by name or glob pattern in the Po session's repository on the host machine (locate paths). Respects .gitignore. Up to 1000 results by default, with output capped at 50KB.",
|
|
25
25
|
executionMode: tool.executionMode === "sequential" ? "serial" : tool.executionMode,
|
|
26
26
|
async execute(toolCallId, parameters, signal, onUpdate) {
|
|
27
|
-
return (0, _agimon_ai_po_core_headless.
|
|
27
|
+
return (0, _agimon_ai_po_core_headless.toPoHeadlessToolResult)(await tool.execute(toolCallId, parameters, AbortSignal.any([context.signal, signal ?? context.signal]), onUpdate && ((partial) => onUpdate((0, _agimon_ai_po_core_headless.toPoHeadlessToolResult)(partial)))));
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
30
|
}
|
|
@@ -35,7 +35,7 @@ function createMcpLsTool(context) {
|
|
|
35
35
|
description: "List a directory in the Po session's repository on the host machine (folder contents). Sorted, directories end with '/', dotfiles included. Up to 500 entries by default, with output capped at 50KB.",
|
|
36
36
|
executionMode: tool.executionMode === "sequential" ? "serial" : tool.executionMode,
|
|
37
37
|
async execute(toolCallId, parameters, signal, onUpdate) {
|
|
38
|
-
return (0, _agimon_ai_po_core_headless.
|
|
38
|
+
return (0, _agimon_ai_po_core_headless.toPoHeadlessToolResult)(await tool.execute(toolCallId, parameters, AbortSignal.any([context.signal, signal ?? context.signal]), onUpdate && ((partial) => onUpdate((0, _agimon_ai_po_core_headless.toPoHeadlessToolResult)(partial)))));
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.cjs","names":["createWriteTool","
|
|
1
|
+
{"version":3,"file":"mcp.cjs","names":["createWriteTool","toPoHeadlessToolResult","createFindTool","createLsTool","defineMcpTool","defineMcpTool","defineMcpTool","defineMcpPlugin","toolFind","toolLs","toolWrite"],"sources":["../../src/extensions/workspaces/sessions/(backend)/_lib/mcpFileTools.ts","../../src/extensions/workspaces/sessions/(backend)/tool/find.mcp.ts","../../src/extensions/workspaces/sessions/(backend)/tool/ls.mcp.ts","../../src/extensions/workspaces/sessions/(backend)/tool/write.mcp.ts","../../generated/mcp.ts"],"sourcesContent":["import { toPoHeadlessToolResult, type PoHeadlessTool } from '@agimon-ai/po-core/headless';\nimport type { PoMcpPluginContext } from '@agimon-ai/po-core/mcpFacet';\nimport { createFindTool, createLsTool, createWriteTool } from '@earendil-works/pi-coding-agent';\n\n// Pi's `outputSchema` is a TypeBox schema, not an MCP output schema, so it stays off the MCP surface.\n\nexport function createMcpWriteTool(\n context: PoMcpPluginContext,\n): PoHeadlessTool<ReturnType<typeof createWriteTool>['parameters']> {\n const { outputSchema: _outputSchema, ...tool } = createWriteTool(context.execution.cwd);\n return {\n ...tool,\n description:\n \"Create or fully overwrite a file in the Po session's repository on the host machine, creating parent folders. Use this server's edit tool to change part of an existing file.\",\n executionMode: tool.executionMode === 'sequential' ? 'serial' : tool.executionMode,\n async execute(toolCallId, parameters, signal, onUpdate) {\n return toPoHeadlessToolResult(\n await tool.execute(\n toolCallId,\n parameters,\n AbortSignal.any([context.signal, signal ?? context.signal]),\n onUpdate && ((partial) => onUpdate(toPoHeadlessToolResult(partial))),\n ),\n );\n },\n };\n}\n\nexport function createMcpFindTool(\n context: PoMcpPluginContext,\n): PoHeadlessTool<ReturnType<typeof createFindTool>['parameters']> {\n const { outputSchema: _outputSchema, ...tool } = createFindTool(context.execution.cwd);\n return {\n ...tool,\n description:\n \"Find files by name or glob pattern in the Po session's repository on the host machine (locate paths). Respects .gitignore. Up to 1000 results by default, with output capped at 50KB.\",\n executionMode: tool.executionMode === 'sequential' ? 'serial' : tool.executionMode,\n async execute(toolCallId, parameters, signal, onUpdate) {\n return toPoHeadlessToolResult(\n await tool.execute(\n toolCallId,\n parameters,\n AbortSignal.any([context.signal, signal ?? context.signal]),\n onUpdate && ((partial) => onUpdate(toPoHeadlessToolResult(partial))),\n ),\n );\n },\n };\n}\n\nexport function createMcpLsTool(\n context: PoMcpPluginContext,\n): PoHeadlessTool<ReturnType<typeof createLsTool>['parameters']> {\n const { outputSchema: _outputSchema, ...tool } = createLsTool(context.execution.cwd);\n return {\n ...tool,\n description:\n \"List a directory in the Po session's repository on the host machine (folder contents). Sorted, directories end with '/', dotfiles included. Up to 500 entries by default, with output capped at 50KB.\",\n executionMode: tool.executionMode === 'sequential' ? 'serial' : tool.executionMode,\n async execute(toolCallId, parameters, signal, onUpdate) {\n return toPoHeadlessToolResult(\n await tool.execute(\n toolCallId,\n parameters,\n AbortSignal.any([context.signal, signal ?? context.signal]),\n onUpdate && ((partial) => onUpdate(toPoHeadlessToolResult(partial))),\n ),\n );\n },\n };\n}\n","import type { PoHeadlessTool } from '@agimon-ai/po-core/headless';\nimport { defineMcpTool, type PoMcpPluginContext } from '@agimon-ai/po-core/mcpFacet';\n\nimport { createMcpFindTool } from '../_lib/mcpFileTools';\n\nexport default defineMcpTool<PoHeadlessTool['parameters'], PoMcpPluginContext>(createMcpFindTool);\n","import type { PoHeadlessTool } from '@agimon-ai/po-core/headless';\nimport { defineMcpTool, type PoMcpPluginContext } from '@agimon-ai/po-core/mcpFacet';\n\nimport { createMcpLsTool } from '../_lib/mcpFileTools';\n\nexport default defineMcpTool<PoHeadlessTool['parameters'], PoMcpPluginContext>(createMcpLsTool);\n","import type { PoHeadlessTool } from '@agimon-ai/po-core/headless';\nimport { defineMcpTool, type PoMcpPluginContext } from '@agimon-ai/po-core/mcpFacet';\n\nimport { createMcpWriteTool } from '../_lib/mcpFileTools';\n\nexport default defineMcpTool<PoHeadlessTool['parameters'], PoMcpPluginContext>(createMcpWriteTool);\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineMcpPlugin, type PoMcpSessionPlugin } from '@agimon-ai/po-core/mcpFacet';\n\nimport toolFind from '../src/extensions/workspaces/sessions/(backend)/tool/find.mcp';\nimport toolLs from '../src/extensions/workspaces/sessions/(backend)/tool/ls.mcp';\nimport toolWrite from '../src/extensions/workspaces/sessions/(backend)/tool/write.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-ui',\n session: (context) => ({\n get tools(): PoMcpSessionPlugin['tools'] { return [withWidget(\"@agimon-ai/po-ui/find\", via({ name: 'find' }, at(toolFind, context))), withWidget(\"@agimon-ai/po-ui/ls\", via({ name: 'ls' }, at(toolLs, context))), withWidget(\"@agimon-ai/po-ui/write\", via({ name: 'write' }, at(toolWrite, context)))]; },\n }) satisfies PoMcpSessionPlugin,\n});\n\nexport default mcp;\n"],"mappings":";;;;;;;;AAMA,SAAgB,mBACd,SACkE;CAClE,MAAM,EAAE,cAAc,eAAe,GA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AAA,GAASA,4BAAAA,uBAAAA,CAAuB,OAAO,CAAC,EACpE,CACF;EACF;CACF;AACF;;;ACjEA,IAAA,oBAAA,GAAeG,4BAAAA,cAAAA,CAAgE,iBAAiB;;;ACAhG,IAAA,kBAAA,GAAeC,4BAAAA,cAAAA,CAAgE,eAAe;;;ACA9F,IAAA,qBAAA,GAAeC,4BAAAA,cAAAA,CAAgE,kBAAkB;;;ACGjG,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,QAAqC;EAAE,OAAO;GAAC,WAAW,yBAAyB,IAAI,EAAE,MAAM,OAAO,GAAG,GAAGC,kBAAU,OAAO,CAAC,CAAC;GAAG,WAAW,uBAAuB,IAAI,EAAE,MAAM,KAAK,GAAG,GAAGC,gBAAQ,OAAO,CAAC,CAAC;GAAG,WAAW,0BAA0B,IAAI,EAAE,MAAM,QAAQ,GAAG,GAAGC,mBAAW,OAAO,CAAC,CAAC;EAAC;CAAG,EAC5S;AACF,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region generated/mcp.d.ts
|
|
2
|
-
export declare const mcp: import("@agimon-ai/po-core/mcpFacet").
|
|
2
|
+
export declare const mcp: import("@agimon-ai/po-core/mcpFacet").PoMcpPluginDefinition;
|
|
3
3
|
//#endregion
|
|
4
4
|
export { mcp as default };
|
|
5
5
|
//# sourceMappingURL=mcp.d.mts.map
|
package/dist/extensions/mcp.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineMcpPlugin, defineMcpTool } from "@agimon-ai/po-core/mcpFacet";
|
|
2
|
-
import {
|
|
2
|
+
import { toPoHeadlessToolResult } from "@agimon-ai/po-core/headless";
|
|
3
3
|
import { createFindTool, createLsTool, createWriteTool } from "@earendil-works/pi-coding-agent";
|
|
4
4
|
//#region src/extensions/workspaces/sessions/(backend)/_lib/mcpFileTools.ts
|
|
5
5
|
function createMcpWriteTool(context) {
|
|
@@ -9,7 +9,7 @@ function createMcpWriteTool(context) {
|
|
|
9
9
|
description: "Create or fully overwrite a file in the Po session's repository on the host machine, creating parent folders. Use this server's edit tool to change part of an existing file.",
|
|
10
10
|
executionMode: tool.executionMode === "sequential" ? "serial" : tool.executionMode,
|
|
11
11
|
async execute(toolCallId, parameters, signal, onUpdate) {
|
|
12
|
-
return
|
|
12
|
+
return toPoHeadlessToolResult(await tool.execute(toolCallId, parameters, AbortSignal.any([context.signal, signal ?? context.signal]), onUpdate && ((partial) => onUpdate(toPoHeadlessToolResult(partial)))));
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
15
|
}
|
|
@@ -20,7 +20,7 @@ function createMcpFindTool(context) {
|
|
|
20
20
|
description: "Find files by name or glob pattern in the Po session's repository on the host machine (locate paths). Respects .gitignore. Up to 1000 results by default, with output capped at 50KB.",
|
|
21
21
|
executionMode: tool.executionMode === "sequential" ? "serial" : tool.executionMode,
|
|
22
22
|
async execute(toolCallId, parameters, signal, onUpdate) {
|
|
23
|
-
return
|
|
23
|
+
return toPoHeadlessToolResult(await tool.execute(toolCallId, parameters, AbortSignal.any([context.signal, signal ?? context.signal]), onUpdate && ((partial) => onUpdate(toPoHeadlessToolResult(partial)))));
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
}
|
|
@@ -31,7 +31,7 @@ function createMcpLsTool(context) {
|
|
|
31
31
|
description: "List a directory in the Po session's repository on the host machine (folder contents). Sorted, directories end with '/', dotfiles included. Up to 500 entries by default, with output capped at 50KB.",
|
|
32
32
|
executionMode: tool.executionMode === "sequential" ? "serial" : tool.executionMode,
|
|
33
33
|
async execute(toolCallId, parameters, signal, onUpdate) {
|
|
34
|
-
return
|
|
34
|
+
return toPoHeadlessToolResult(await tool.execute(toolCallId, parameters, AbortSignal.any([context.signal, signal ?? context.signal]), onUpdate && ((partial) => onUpdate(toPoHeadlessToolResult(partial)))));
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.mjs","names":["toolFind","toolLs","toolWrite"],"sources":["../../src/extensions/workspaces/sessions/(backend)/_lib/mcpFileTools.ts","../../src/extensions/workspaces/sessions/(backend)/tool/find.mcp.ts","../../src/extensions/workspaces/sessions/(backend)/tool/ls.mcp.ts","../../src/extensions/workspaces/sessions/(backend)/tool/write.mcp.ts","../../generated/mcp.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"mcp.mjs","names":["toolFind","toolLs","toolWrite"],"sources":["../../src/extensions/workspaces/sessions/(backend)/_lib/mcpFileTools.ts","../../src/extensions/workspaces/sessions/(backend)/tool/find.mcp.ts","../../src/extensions/workspaces/sessions/(backend)/tool/ls.mcp.ts","../../src/extensions/workspaces/sessions/(backend)/tool/write.mcp.ts","../../generated/mcp.ts"],"sourcesContent":["import { toPoHeadlessToolResult, type PoHeadlessTool } from '@agimon-ai/po-core/headless';\nimport type { PoMcpPluginContext } from '@agimon-ai/po-core/mcpFacet';\nimport { createFindTool, createLsTool, createWriteTool } from '@earendil-works/pi-coding-agent';\n\n// Pi's `outputSchema` is a TypeBox schema, not an MCP output schema, so it stays off the MCP surface.\n\nexport function createMcpWriteTool(\n context: PoMcpPluginContext,\n): PoHeadlessTool<ReturnType<typeof createWriteTool>['parameters']> {\n const { outputSchema: _outputSchema, ...tool } = createWriteTool(context.execution.cwd);\n return {\n ...tool,\n description:\n \"Create or fully overwrite a file in the Po session's repository on the host machine, creating parent folders. Use this server's edit tool to change part of an existing file.\",\n executionMode: tool.executionMode === 'sequential' ? 'serial' : tool.executionMode,\n async execute(toolCallId, parameters, signal, onUpdate) {\n return toPoHeadlessToolResult(\n await tool.execute(\n toolCallId,\n parameters,\n AbortSignal.any([context.signal, signal ?? context.signal]),\n onUpdate && ((partial) => onUpdate(toPoHeadlessToolResult(partial))),\n ),\n );\n },\n };\n}\n\nexport function createMcpFindTool(\n context: PoMcpPluginContext,\n): PoHeadlessTool<ReturnType<typeof createFindTool>['parameters']> {\n const { outputSchema: _outputSchema, ...tool } = createFindTool(context.execution.cwd);\n return {\n ...tool,\n description:\n \"Find files by name or glob pattern in the Po session's repository on the host machine (locate paths). Respects .gitignore. Up to 1000 results by default, with output capped at 50KB.\",\n executionMode: tool.executionMode === 'sequential' ? 'serial' : tool.executionMode,\n async execute(toolCallId, parameters, signal, onUpdate) {\n return toPoHeadlessToolResult(\n await tool.execute(\n toolCallId,\n parameters,\n AbortSignal.any([context.signal, signal ?? context.signal]),\n onUpdate && ((partial) => onUpdate(toPoHeadlessToolResult(partial))),\n ),\n );\n },\n };\n}\n\nexport function createMcpLsTool(\n context: PoMcpPluginContext,\n): PoHeadlessTool<ReturnType<typeof createLsTool>['parameters']> {\n const { outputSchema: _outputSchema, ...tool } = createLsTool(context.execution.cwd);\n return {\n ...tool,\n description:\n \"List a directory in the Po session's repository on the host machine (folder contents). Sorted, directories end with '/', dotfiles included. Up to 500 entries by default, with output capped at 50KB.\",\n executionMode: tool.executionMode === 'sequential' ? 'serial' : tool.executionMode,\n async execute(toolCallId, parameters, signal, onUpdate) {\n return toPoHeadlessToolResult(\n await tool.execute(\n toolCallId,\n parameters,\n AbortSignal.any([context.signal, signal ?? context.signal]),\n onUpdate && ((partial) => onUpdate(toPoHeadlessToolResult(partial))),\n ),\n );\n },\n };\n}\n","import type { PoHeadlessTool } from '@agimon-ai/po-core/headless';\nimport { defineMcpTool, type PoMcpPluginContext } from '@agimon-ai/po-core/mcpFacet';\n\nimport { createMcpFindTool } from '../_lib/mcpFileTools';\n\nexport default defineMcpTool<PoHeadlessTool['parameters'], PoMcpPluginContext>(createMcpFindTool);\n","import type { PoHeadlessTool } from '@agimon-ai/po-core/headless';\nimport { defineMcpTool, type PoMcpPluginContext } from '@agimon-ai/po-core/mcpFacet';\n\nimport { createMcpLsTool } from '../_lib/mcpFileTools';\n\nexport default defineMcpTool<PoHeadlessTool['parameters'], PoMcpPluginContext>(createMcpLsTool);\n","import type { PoHeadlessTool } from '@agimon-ai/po-core/headless';\nimport { defineMcpTool, type PoMcpPluginContext } from '@agimon-ai/po-core/mcpFacet';\n\nimport { createMcpWriteTool } from '../_lib/mcpFileTools';\n\nexport default defineMcpTool<PoHeadlessTool['parameters'], PoMcpPluginContext>(createMcpWriteTool);\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineMcpPlugin, type PoMcpSessionPlugin } from '@agimon-ai/po-core/mcpFacet';\n\nimport toolFind from '../src/extensions/workspaces/sessions/(backend)/tool/find.mcp';\nimport toolLs from '../src/extensions/workspaces/sessions/(backend)/tool/ls.mcp';\nimport toolWrite from '../src/extensions/workspaces/sessions/(backend)/tool/write.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-ui',\n session: (context) => ({\n get tools(): PoMcpSessionPlugin['tools'] { return [withWidget(\"@agimon-ai/po-ui/find\", via({ name: 'find' }, at(toolFind, context))), withWidget(\"@agimon-ai/po-ui/ls\", via({ name: 'ls' }, at(toolLs, context))), withWidget(\"@agimon-ai/po-ui/write\", via({ name: 'write' }, at(to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F;;;ACjEA,IAAA,mBAAe,cAAgE,iBAAiB;;;ACAhG,IAAA,iBAAe,cAAgE,eAAe;;;ACA9F,IAAA,oBAAe,cAAgE,kBAAkB;;;ACGjG,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,MAAM,gBAAgB;CACjC,MAAM;CACN,UAAU,aAAa,EACrB,IAAI,QAAqC;EAAE,OAAO;GAAC,WAAW,yBAAyB,IAAI,EAAE,MAAM,OAAO,GAAG,GAAGA,kBAAU,OAAO,CAAC,CAAC;GAAG,WAAW,uBAAuB,IAAI,EAAE,MAAM,KAAK,GAAG,GAAGC,gBAAQ,OAAO,CAAC,CAAC;GAAG,WAAW,0BAA0B,IAAI,EAAE,MAAM,QAAQ,GAAG,GAAGC,mBAAW,OAAO,CAAC,CAAC;EAAC;CAAG,EAC5S;AACF,CAAC"}
|
|
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
let
|
|
5
|
+
let _agimon_ai_po_core_serverPlugin = require("@agimon-ai/po-core/serverPlugin");
|
|
6
6
|
let _agimon_ai_po_core_extensionFile = require("@agimon-ai/po-core/extensionFile");
|
|
7
7
|
let _agimon_ai_po_core_headless = require("@agimon-ai/po-core/headless");
|
|
8
8
|
let _earendil_works_pi_coding_agent = require("@earendil-works/pi-coding-agent");
|
|
@@ -65,7 +65,7 @@ function createServerWriteTool() {
|
|
|
65
65
|
promptGuidelines,
|
|
66
66
|
async execute(toolCallId, parameters, signal, onUpdate, execution) {
|
|
67
67
|
const tool = (0, _earendil_works_pi_coding_agent.createWriteTool)(execution.cwd);
|
|
68
|
-
return (0, _agimon_ai_po_core_headless.
|
|
68
|
+
return (0, _agimon_ai_po_core_headless.toPoHeadlessToolResult)(await tool.execute(toolCallId, parameters, signal, onUpdate && ((partial) => onUpdate((0, _agimon_ai_po_core_headless.toPoHeadlessToolResult)(partial)))));
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
71
|
}
|
|
@@ -80,7 +80,7 @@ function createServerFindTool() {
|
|
|
80
80
|
promptGuidelines,
|
|
81
81
|
async execute(toolCallId, parameters, signal, onUpdate, execution) {
|
|
82
82
|
const tool = (0, _earendil_works_pi_coding_agent.createFindTool)(execution.cwd);
|
|
83
|
-
return (0, _agimon_ai_po_core_headless.
|
|
83
|
+
return (0, _agimon_ai_po_core_headless.toPoHeadlessToolResult)(await tool.execute(toolCallId, parameters, signal, onUpdate && ((partial) => onUpdate((0, _agimon_ai_po_core_headless.toPoHeadlessToolResult)(partial)))));
|
|
84
84
|
}
|
|
85
85
|
};
|
|
86
86
|
}
|
|
@@ -95,7 +95,7 @@ function createServerLsTool() {
|
|
|
95
95
|
promptGuidelines,
|
|
96
96
|
async execute(toolCallId, parameters, signal, onUpdate, execution) {
|
|
97
97
|
const tool = (0, _earendil_works_pi_coding_agent.createLsTool)(execution.cwd);
|
|
98
|
-
return (0, _agimon_ai_po_core_headless.
|
|
98
|
+
return (0, _agimon_ai_po_core_headless.toPoHeadlessToolResult)(await tool.execute(toolCallId, parameters, signal, onUpdate && ((partial) => onUpdate((0, _agimon_ai_po_core_headless.toPoHeadlessToolResult)(partial)))));
|
|
99
99
|
}
|
|
100
100
|
};
|
|
101
101
|
}
|
|
@@ -115,7 +115,7 @@ const via = (identity, value) => value === void 0 ? void 0 : {
|
|
|
115
115
|
...identity,
|
|
116
116
|
...value
|
|
117
117
|
};
|
|
118
|
-
const
|
|
118
|
+
const serverPlugin = (0, _agimon_ai_po_core_serverPlugin.defineServerPlugin)({
|
|
119
119
|
name: "@agimon-ai/po-ui",
|
|
120
120
|
session: (context) => ({
|
|
121
121
|
get commands() {
|
|
@@ -131,7 +131,7 @@ const facet = (0, _agimon_ai_po_core_serverFacet.defineServerPlugin)({
|
|
|
131
131
|
})
|
|
132
132
|
});
|
|
133
133
|
//#endregion
|
|
134
|
-
exports.default =
|
|
135
|
-
exports.
|
|
134
|
+
exports.default = serverPlugin;
|
|
135
|
+
exports.serverPlugin = serverPlugin;
|
|
136
136
|
|
|
137
137
|
//# sourceMappingURL=server.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.cjs","names":["defineServerCommand","createWriteToolDefinition","createWriteTool","toDoomHeadlessToolResult","createFindToolDefinition","createFindTool","createLsToolDefinition","createLsTool","defineServerTool","defineServerTool","defineServerTool","defineServerPlugin","commandTools","toolFind","toolLs","toolWrite"],"sources":["../../src/constants/ui.ts","../../src/services/sessionToolInventory/index.ts","../../src/extensions/workspaces/sessions/(backend)/_lib/sessionInventory.ts","../../src/extensions/workspaces/sessions/(backend)/command/tools.server.ts","../../src/extensions/workspaces/sessions/(backend)/_lib/serverFileTools.ts","../../src/extensions/workspaces/sessions/(backend)/tool/find.server.ts","../../src/extensions/workspaces/sessions/(backend)/tool/ls.server.ts","../../src/extensions/workspaces/sessions/(backend)/tool/write.server.ts","../../generated/server.ts"],"sourcesContent":["export const LEADER_WIDGET_KEY = 'po-leader';\nexport const TUI_MODE = 'tui';\nexport const WIDGET_PLACEMENT = 'belowEditor';\nexport const WARNING_STYLE = 'warning';\nexport const THEME_ENVIRONMENT_KEY = 'PO_THEME';\nexport const HOTKEYS_COMMAND = 'hotkeys';\nexport const TOOLS_COMMAND = 'tools';\nexport const CONFIG_COMMAND = 'config';\nexport const SESSION_START_EVENT = 'session_start';\nexport const SESSION_MESSAGE_ENTRY = 'message';\nexport const INPUT_EVENT = 'input';\nexport const INTERACTIVE_INPUT_SOURCE = 'interactive';\nexport const TITLE_MESSAGE_MAX_LENGTH = 64;\nexport const TITLE_PREFIX = 'po';\nexport const BUILTIN_LEADER_COMMANDS: readonly string[] = [HOTKEYS_COMMAND];\nexport const PACKAGE_SOURCE = '@agimon-ai/po-ui';\n","export function toolNames(entries: readonly Record<string, unknown>[]): string[] {\n const names = new Set<string>();\n for (const entry of entries) {\n const message = entry.message;\n if (!message || typeof message !== 'object' || Array.isArray(message)) continue;\n const content = (message as { content?: unknown }).content;\n if (!Array.isArray(content)) continue;\n for (const block of content) {\n if (!block || typeof block !== 'object' || Array.isArray(block)) continue;\n const name = (block as { name?: unknown }).name;\n if (typeof name === 'string' && name) names.add(name);\n }\n }\n return [...names].sort();\n}\n","import type { DoomHeadlessCommand } from '@agimon-ai/po-core/headless';\nimport type { DoomServerSessionPlugin } from '@agimon-ai/po-core/serverFacet';\n\nimport { TOOLS_COMMAND } from '../../../../../constants/ui';\nimport { toolNames } from '../../../../../services/sessionToolInventory';\n\n/**\n * The TUI shell itself stays Pi-only. Inventory is the shared part and is exposed\n * from session data rather than silently installing a fake editor/widget host.\n *\n * Inventory is a command, never a context resource. It reports the tools observed\n * in the transcript, which is not the tool surface the current selection exposes:\n * as a prompt section it listed tools the session had since gated out, directly\n * contradicting the `Available tools:` block, and it grew for the whole session.\n */\nexport function createUiServerContributions(): DoomServerSessionPlugin {\n return {\n commands: [\n {\n name: TOOLS_COMMAND,\n description: 'Show tools observed in this headless session. TUI rendering remains unavailable.',\n async execute(_args, execution) {\n await execution.client.notify({\n title: 'Po tools',\n body:\n toolNames(await execution.session.entries({ type: 'message' })).join('\\n') ||\n '(no tool calls recorded in this session)',\n level: 'info',\n });\n },\n } satisfies DoomHeadlessCommand,\n ],\n };\n}\n","import { defineServerCommand } from '@agimon-ai/po-core/extensionFile';\n\nimport { createUiServerContributions } from '../_lib/sessionInventory';\n\nexport default defineServerCommand(createUiServerContributions().commands![0]!);\n","import { toDoomHeadlessToolResult, type DoomHeadlessTool } from '@agimon-ai/po-core/headless';\nimport {\n createWriteToolDefinition,\n createWriteTool,\n createFindToolDefinition,\n createFindTool,\n createLsToolDefinition,\n createLsTool,\n} from '@earendil-works/pi-coding-agent';\n\n// Preserve the SDK schemas and prompt guidance, but never import terminal renderers\n// into Po's native tool declarations. Execution resolves cwd for each call, including\n// a child session or a session whose working directory differs from process.cwd().\n\nexport function createServerWriteTool(): DoomHeadlessTool<ReturnType<typeof createWriteToolDefinition>['parameters']> {\n const { label, description, parameters, promptSnippet, promptGuidelines } = createWriteToolDefinition('.');\n return {\n name: 'write',\n label,\n description,\n parameters,\n promptSnippet,\n promptGuidelines,\n async execute(toolCallId, parameters, signal, onUpdate, execution) {\n const tool = createWriteTool(execution.cwd);\n return toDoomHeadlessToolResult(\n await tool.execute(\n toolCallId,\n parameters,\n signal,\n onUpdate && ((partial) => onUpdate(toDoomHeadlessToolResult(partial))),\n ),\n );\n },\n };\n}\n\nexport function createServerFindTool(): DoomHeadlessTool<ReturnType<typeof createFindToolDefinition>['parameters']> {\n const { label, description, parameters, promptSnippet, promptGuidelines } = createFindToolDefinition('.');\n return {\n name: 'find',\n label,\n description,\n parameters,\n promptSnippet,\n promptGuidelines,\n async execute(toolCallId, parameters, signal, onUpdate, execution) {\n const tool = createFindTool(execution.cwd);\n return toDoomHeadlessToolResult(\n await tool.execute(\n toolCallId,\n parameters,\n signal,\n onUpdate && ((partial) => onUpdate(toDoomHeadlessToolResult(partial))),\n ),\n );\n },\n };\n}\n\nexport function createServerLsTool(): DoomHeadlessTool<ReturnType<typeof createLsToolDefinition>['parameters']> {\n const { label, description, parameters, promptSnippet, promptGuidelines } = createLsToolDefinition('.');\n return {\n name: 'ls',\n label,\n description,\n parameters,\n promptSnippet,\n promptGuidelines,\n async execute(toolCallId, parameters, signal, onUpdate, execution) {\n const tool = createLsTool(execution.cwd);\n return toDoomHeadlessToolResult(\n await tool.execute(\n toolCallId,\n parameters,\n signal,\n onUpdate && ((partial) => onUpdate(toDoomHeadlessToolResult(partial))),\n ),\n );\n },\n };\n}\n","import { defineServerTool } from '@agimon-ai/po-core/extensionFile';\nimport type { DoomHeadlessTool } from '@agimon-ai/po-core/headless';\n\nimport { createServerFindTool } from '../_lib/serverFileTools';\n\nexport default defineServerTool<DoomHeadlessTool['parameters']>(createServerFindTool);\n","import { defineServerTool } from '@agimon-ai/po-core/extensionFile';\nimport type { DoomHeadlessTool } from '@agimon-ai/po-core/headless';\n\nimport { createServerLsTool } from '../_lib/serverFileTools';\n\nexport default defineServerTool<DoomHeadlessTool['parameters']>(createServerLsTool);\n","import { defineServerTool } from '@agimon-ai/po-core/extensionFile';\nimport type { DoomHeadlessTool } from '@agimon-ai/po-core/headless';\n\nimport { createServerWriteTool } from '../_lib/serverFileTools';\n\nexport default defineServerTool<DoomHeadlessTool['parameters']>(createServerWriteTool);\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineServerPlugin, type DoomServerSessionPlugin } from '@agimon-ai/po-core/serverFacet';\n\nimport commandTools from '../src/extensions/workspaces/sessions/(backend)/command/tools.server';\nimport toolFind from '../src/extensions/workspaces/sessions/(backend)/tool/find.server';\nimport toolLs from '../src/extensions/workspaces/sessions/(backend)/tool/ls.server';\nimport toolWrite from '../src/extensions/workspaces/sessions/(backend)/tool/write.server';\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\nexport const facet = defineServerPlugin({\n name: '@agimon-ai/po-ui',\n session: (context) => ({\n get commands(): DoomServerSessionPlugin['commands'] { return [via({ name: 'tools' }, at(commandTools, context))]; },\n get tools(): DoomServerSessionPlugin['tools'] { return [via({ name: 'find' }, at(toolFind, context)), via({ name: 'ls' }, at(toolLs, context)), via({ name: 'write' }, at(toolWrite, context))]; },\n }),\n});\n\nexport default facet;\n"],"mappings":";;;;;;;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M,OAAU,UAAmC,UAChD,UAAU,KAAA,IAAY,KAAA,IAAY;CAAE,GAAG;CAAU,GAAI;AAAiB;AAEzE,MAAa,SAAA,GAAQC,+BAAAA,mBAAAA,CAAmB;CACtC,MAAM;CACN,UAAU,aAAa;EACrB,IAAI,WAAgD;GAAE,OAAO,CAAC,IAAI,EAAE,MAAM,QAAQ,GAAG,GAAGC,sBAAc,OAAO,CAAC,CAAC;EAAG;EAClH,IAAI,QAA0C;GAAE,OAAO;IAAC,IAAI,EAAE,MAAM,OAAO,GAAG,GAAGC,qBAAU,OAAO,CAAC;IAAG,IAAI,EAAE,MAAM,KAAK,GAAG,GAAGC,mBAAQ,OAAO,CAAC;IAAG,IAAI,EAAE,MAAM,QAAQ,GAAG,GAAGC,sBAAW,OAAO,CAAC;GAAC;EAAG;CACnM;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"server.cjs","names":["defineServerCommand","createWriteToolDefinition","createWriteTool","toPoHeadlessToolResult","createFindToolDefinition","createFindTool","createLsToolDefinition","createLsTool","defineServerTool","defineServerTool","defineServerTool","defineServerPlugin","commandTools","toolFind","toolLs","toolWrite"],"sources":["../../src/constants/ui.ts","../../src/services/sessionToolInventory/index.ts","../../src/extensions/workspaces/sessions/(backend)/_lib/sessionInventory.ts","../../src/extensions/workspaces/sessions/(backend)/command/tools.server.ts","../../src/extensions/workspaces/sessions/(backend)/_lib/serverFileTools.ts","../../src/extensions/workspaces/sessions/(backend)/tool/find.server.ts","../../src/extensions/workspaces/sessions/(backend)/tool/ls.server.ts","../../src/extensions/workspaces/sessions/(backend)/tool/write.server.ts","../../generated/server.ts"],"sourcesContent":["export const LEADER_WIDGET_KEY = 'po-leader';\nexport const TUI_MODE = 'tui';\nexport const WIDGET_PLACEMENT = 'belowEditor';\nexport const WARNING_STYLE = 'warning';\nexport const THEME_ENVIRONMENT_KEY = 'PO_THEME';\nexport const HOTKEYS_COMMAND = 'hotkeys';\nexport const TOOLS_COMMAND = 'tools';\nexport const CONFIG_COMMAND = 'config';\nexport const SESSION_START_EVENT = 'session_start';\nexport const SESSION_MESSAGE_ENTRY = 'message';\nexport const INPUT_EVENT = 'input';\nexport const INTERACTIVE_INPUT_SOURCE = 'interactive';\nexport const TITLE_MESSAGE_MAX_LENGTH = 64;\nexport const TITLE_PREFIX = 'po';\nexport const BUILTIN_LEADER_COMMANDS: readonly string[] = [HOTKEYS_COMMAND];\nexport const PACKAGE_SOURCE = '@agimon-ai/po-ui';\n","export function toolNames(entries: readonly Record<string, unknown>[]): string[] {\n const names = new Set<string>();\n for (const entry of entries) {\n const message = entry.message;\n if (!message || typeof message !== 'object' || Array.isArray(message)) continue;\n const content = (message as { content?: unknown }).content;\n if (!Array.isArray(content)) continue;\n for (const block of content) {\n if (!block || typeof block !== 'object' || Array.isArray(block)) continue;\n const name = (block as { name?: unknown }).name;\n if (typeof name === 'string' && name) names.add(name);\n }\n }\n return [...names].sort();\n}\n","import type { PoHeadlessCommand } from '@agimon-ai/po-core/headless';\nimport type { PoServerSessionPlugin } from '@agimon-ai/po-core/serverPlugin';\n\nimport { TOOLS_COMMAND } from '../../../../../constants/ui';\nimport { toolNames } from '../../../../../services/sessionToolInventory';\n\n/**\n * The TUI shell itself stays Pi-only. Inventory is the shared part and is exposed\n * from session data rather than silently installing a fake editor/widget host.\n *\n * Inventory is a command, never a context resource. It reports the tools observed\n * in the transcript, which is not the tool surface the current selection exposes:\n * as a prompt section it listed tools the session had since gated out, directly\n * contradicting the `Available tools:` block, and it grew for the whole session.\n */\nexport function createUiServerContributions(): PoServerSessionPlugin {\n return {\n commands: [\n {\n name: TOOLS_COMMAND,\n description: 'Show tools observed in this headless session. TUI rendering remains unavailable.',\n async execute(_args, execution) {\n await execution.client.notify({\n title: 'Po tools',\n body:\n toolNames(await execution.session.entries({ type: 'message' })).join('\\n') ||\n '(no tool calls recorded in this session)',\n level: 'info',\n });\n },\n } satisfies PoHeadlessCommand,\n ],\n };\n}\n","import { defineServerCommand } from '@agimon-ai/po-core/extensionFile';\n\nimport { createUiServerContributions } from '../_lib/sessionInventory';\n\nexport default defineServerCommand(createUiServerContributions().commands![0]!);\n","import { toPoHeadlessToolResult, type PoHeadlessTool } from '@agimon-ai/po-core/headless';\nimport {\n createWriteToolDefinition,\n createWriteTool,\n createFindToolDefinition,\n createFindTool,\n createLsToolDefinition,\n createLsTool,\n} from '@earendil-works/pi-coding-agent';\n\n// Preserve the SDK schemas and prompt guidance, but never import terminal renderers\n// into Po's native tool declarations. Execution resolves cwd for each call, including\n// a child session or a session whose working directory differs from process.cwd().\n\nexport function createServerWriteTool(): PoHeadlessTool<ReturnType<typeof createWriteToolDefinition>['parameters']> {\n const { label, description, parameters, promptSnippet, promptGuidelines } = createWriteToolDefinition('.');\n return {\n name: 'write',\n label,\n description,\n parameters,\n promptSnippet,\n promptGuidelines,\n async execute(toolCallId, parameters, signal, onUpdate, execution) {\n const tool = createWriteTool(execution.cwd);\n return toPoHeadlessToolResult(\n await tool.execute(\n toolCallId,\n parameters,\n signal,\n onUpdate && ((partial) => onUpdate(toPoHeadlessToolResult(partial))),\n ),\n );\n },\n };\n}\n\nexport function createServerFindTool(): PoHeadlessTool<ReturnType<typeof createFindToolDefinition>['parameters']> {\n const { label, description, parameters, promptSnippet, promptGuidelines } = createFindToolDefinition('.');\n return {\n name: 'find',\n label,\n description,\n parameters,\n promptSnippet,\n promptGuidelines,\n async execute(toolCallId, parameters, signal, onUpdate, execution) {\n const tool = createFindTool(execution.cwd);\n return toPoHeadlessToolResult(\n await tool.execute(\n toolCallId,\n parameters,\n signal,\n onUpdate && ((partial) => onUpdate(toPoHeadlessToolResult(partial))),\n ),\n );\n },\n };\n}\n\nexport function createServerLsTool(): PoHeadlessTool<ReturnType<typeof createLsToolDefinition>['parameters']> {\n const { label, description, parameters, promptSnippet, promptGuidelines } = createLsToolDefinition('.');\n return {\n name: 'ls',\n label,\n description,\n parameters,\n promptSnippet,\n promptGuidelines,\n async execute(toolCallId, parameters, signal, onUpdate, execution) {\n const tool = createLsTool(execution.cwd);\n return toPoHeadlessToolResult(\n await tool.execute(\n toolCallId,\n parameters,\n signal,\n onUpdate && ((partial) => onUpdate(toPoHeadlessToolResult(partial))),\n ),\n );\n },\n };\n}\n","import { defineServerTool } from '@agimon-ai/po-core/extensionFile';\nimport type { PoHeadlessTool } from '@agimon-ai/po-core/headless';\n\nimport { createServerFindTool } from '../_lib/serverFileTools';\n\nexport default defineServerTool<PoHeadlessTool['parameters']>(createServerFindTool);\n","import { defineServerTool } from '@agimon-ai/po-core/extensionFile';\nimport type { PoHeadlessTool } from '@agimon-ai/po-core/headless';\n\nimport { createServerLsTool } from '../_lib/serverFileTools';\n\nexport default defineServerTool<PoHeadlessTool['parameters']>(createServerLsTool);\n","import { defineServerTool } from '@agimon-ai/po-core/extensionFile';\nimport type { PoHeadlessTool } from '@agimon-ai/po-core/headless';\n\nimport { createServerWriteTool } from '../_lib/serverFileTools';\n\nexport default defineServerTool<PoHeadlessTool['parameters']>(createServerWriteTool);\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineServerPlugin, type PoServerSessionPlugin } from '@agimon-ai/po-core/serverPlugin';\n\nimport commandTools from '../src/extensions/workspaces/sessions/(backend)/command/tools.server';\nimport toolFind from '../src/extensions/workspaces/sessions/(backend)/tool/find.server';\nimport toolLs from '../src/extensions/workspaces/sessions/(backend)/tool/ls.server';\nimport toolWrite from '../src/extensions/workspaces/sessions/(backend)/tool/write.server';\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\nexport const serverPlugin = defineServerPlugin({\n name: '@agimon-ai/po-ui',\n session: (context) => ({\n get commands(): PoServerSessionPlugin['commands'] { return [via({ name: 'tools' }, at(commandTools, context))]; },\n get tools(): PoServerSessionPlugin['tools'] { return [via({ name: 'find' }, at(toolFind, context)), via({ name: 'ls' }, at(toolLs, context)), via({ name: 'write' }, at(toolWrite, context))]; },\n }),\n});\n\nexport default serverPlugin;\n"],"mappings":";;;;;;;;;AAMA,MAAa,gBAAgB;;;ACN7B,SAAgB,UAAU,SAAuD;CAC/E,MAAM,wBAAQ,IAAI,IAAY;CAC9B,KAAK,MAAM,SAAS,SAAS;EAC3B,MAAM,UAAU,MAAM;EACtB,IAAI,CAAC,WAAW,OAAO,YAAY,YAAY,MAAM,QAAQ,OAAO,GAAG;EACvE,MAAM,UAAW,QAAkC;EACnD,IAAI,CAAC,MAAM,QAAQ,OAAO,GAAG;EAC7B,KAAK,MAAM,SAAS,SAAS;GAC3B,IAAI,CAAC,SAAS,OAAO,UAAU,YAAY,MAAM,QAAQ,KAAK,GAAG;GACjE,MAAM,OAAQ,MAA6B;GAC3C,IAAI,OAAO,SAAS,YAAY,MAAM,MAAM,IAAI,IAAI;EACtD;CACF;CACA,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,KAAK;AACzB;;;;;;;;;;;;ACCA,SAAgB,8BAAqD;CACnE,OAAO,EACL,UAAU,CACR;EACE,MAAM;EACN,aAAa;EACb,MAAM,QAAQ,OAAO,WAAW;GAC9B,MAAM,UAAU,OAAO,OAAO;IAC5B,OAAO;IACP,MACE,UAAU,MAAM,UAAU,QAAQ,QAAQ,EAAE,MAAM,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,KACzE;IACF,OAAO;GACT,CAAC;EACH;CACF,CACF,EACF;AACF;;;AC7BA,IAAA,wBAAA,GAAeA,iCAAAA,oBAAAA,CAAoB,4BAA4B,CAAC,CAAC,SAAU,EAAG;;;ACU9E,SAAgB,wBAAoG;CAClH,MAAM,EAAE,OAAO,aAAa,YAAY,eAAe,sBAAA,GAAqBC,gCAAAA,0BAAAA,CAA0B,GAAG;CACzG,OAAO;EACL,MAAM;EACN;EACA;EACA;EACA;EACA;EACA,MAAM,QAAQ,YAAY,YAAY,QAAQ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AeC,iCAAAA,iBAAAA,CAA+C,qBAAqB;;;ACInF,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,MAAa,gBAAA,GAAeC,gCAAAA,mBAAAA,CAAmB;CAC7C,MAAM;CACN,UAAU,aAAa;EACrB,IAAI,WAA8C;GAAE,OAAO,CAAC,IAAI,EAAE,MAAM,QAAQ,GAAG,GAAGC,sBAAc,OAAO,CAAC,CAAC;EAAG;EAChH,IAAI,QAAwC;GAAE,OAAO;IAAC,IAAI,EAAE,MAAM,OAAO,GAAG,GAAGC,qBAAU,OAAO,CAAC;IAAG,IAAI,EAAE,MAAM,KAAK,GAAG,GAAGC,mBAAQ,OAAO,CAAC;IAAG,IAAI,EAAE,MAAM,QAAQ,GAAG,GAAGC,sBAAW,OAAO,CAAC;GAAC;EAAG;CACjM;AACF,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region generated/server.d.ts
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const serverPlugin: import("@agimon-ai/po-core/serverPlugin").PoServerPlugin;
|
|
3
3
|
//#endregion
|
|
4
|
-
export {
|
|
4
|
+
export { serverPlugin as default };
|
|
5
5
|
//# sourceMappingURL=server.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.mts","names":[],"sources":["../../generated/server.ts"],"mappings":";qBAca,
|
|
1
|
+
{"version":3,"file":"server.d.mts","names":[],"sources":["../../generated/server.ts"],"mappings":";qBAca,wDAAY"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineServerPlugin } from "@agimon-ai/po-core/
|
|
1
|
+
import { defineServerPlugin } from "@agimon-ai/po-core/serverPlugin";
|
|
2
2
|
import { defineServerCommand, defineServerTool } from "@agimon-ai/po-core/extensionFile";
|
|
3
|
-
import {
|
|
3
|
+
import { toPoHeadlessToolResult } from "@agimon-ai/po-core/headless";
|
|
4
4
|
import { createFindTool, createFindToolDefinition, createLsTool, createLsToolDefinition, createWriteTool, createWriteToolDefinition } from "@earendil-works/pi-coding-agent";
|
|
5
5
|
//#region src/constants/ui.ts
|
|
6
6
|
const TOOLS_COMMAND = "tools";
|
|
@@ -61,7 +61,7 @@ function createServerWriteTool() {
|
|
|
61
61
|
promptGuidelines,
|
|
62
62
|
async execute(toolCallId, parameters, signal, onUpdate, execution) {
|
|
63
63
|
const tool = createWriteTool(execution.cwd);
|
|
64
|
-
return
|
|
64
|
+
return toPoHeadlessToolResult(await tool.execute(toolCallId, parameters, signal, onUpdate && ((partial) => onUpdate(toPoHeadlessToolResult(partial)))));
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
67
|
}
|
|
@@ -76,7 +76,7 @@ function createServerFindTool() {
|
|
|
76
76
|
promptGuidelines,
|
|
77
77
|
async execute(toolCallId, parameters, signal, onUpdate, execution) {
|
|
78
78
|
const tool = createFindTool(execution.cwd);
|
|
79
|
-
return
|
|
79
|
+
return toPoHeadlessToolResult(await tool.execute(toolCallId, parameters, signal, onUpdate && ((partial) => onUpdate(toPoHeadlessToolResult(partial)))));
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
82
|
}
|
|
@@ -91,7 +91,7 @@ function createServerLsTool() {
|
|
|
91
91
|
promptGuidelines,
|
|
92
92
|
async execute(toolCallId, parameters, signal, onUpdate, execution) {
|
|
93
93
|
const tool = createLsTool(execution.cwd);
|
|
94
|
-
return
|
|
94
|
+
return toPoHeadlessToolResult(await tool.execute(toolCallId, parameters, signal, onUpdate && ((partial) => onUpdate(toPoHeadlessToolResult(partial)))));
|
|
95
95
|
}
|
|
96
96
|
};
|
|
97
97
|
}
|
|
@@ -111,7 +111,7 @@ const via = (identity, value) => value === void 0 ? void 0 : {
|
|
|
111
111
|
...identity,
|
|
112
112
|
...value
|
|
113
113
|
};
|
|
114
|
-
const
|
|
114
|
+
const serverPlugin = defineServerPlugin({
|
|
115
115
|
name: "@agimon-ai/po-ui",
|
|
116
116
|
session: (context) => ({
|
|
117
117
|
get commands() {
|
|
@@ -127,6 +127,6 @@ const facet = defineServerPlugin({
|
|
|
127
127
|
})
|
|
128
128
|
});
|
|
129
129
|
//#endregion
|
|
130
|
-
export {
|
|
130
|
+
export { serverPlugin as default, serverPlugin };
|
|
131
131
|
|
|
132
132
|
//# sourceMappingURL=server.mjs.map
|