@agimon-ai/po-ui 0.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +37 -0
  3. package/dist/apiContracts.cjs +17 -0
  4. package/dist/apiContracts.cjs.map +1 -0
  5. package/dist/apiContracts.d.mts +53 -0
  6. package/dist/apiContracts.d.mts.map +1 -0
  7. package/dist/apiContracts.mjs +13 -0
  8. package/dist/apiContracts.mjs.map +1 -0
  9. package/dist/config.cjs +62 -0
  10. package/dist/config.d.mts +2 -0
  11. package/dist/config.mjs +2 -0
  12. package/dist/extensionName.cjs +59 -0
  13. package/dist/extensionName.cjs.map +1 -0
  14. package/dist/extensionName.d.mts +14 -0
  15. package/dist/extensionName.d.mts.map +1 -0
  16. package/dist/extensionName.mjs +54 -0
  17. package/dist/extensionName.mjs.map +1 -0
  18. package/dist/extensions/mcp-ui.mjs +46 -0
  19. package/dist/extensions/mcp-ui.mjs.map +1 -0
  20. package/dist/extensions/mcp.cjs +79 -0
  21. package/dist/extensions/mcp.cjs.map +1 -0
  22. package/dist/extensions/mcp.d.mts +5 -0
  23. package/dist/extensions/mcp.d.mts.map +1 -0
  24. package/dist/extensions/mcp.mjs +74 -0
  25. package/dist/extensions/mcp.mjs.map +1 -0
  26. package/dist/extensions/server.cjs +137 -0
  27. package/dist/extensions/server.cjs.map +1 -0
  28. package/dist/extensions/server.d.mts +5 -0
  29. package/dist/extensions/server.d.mts.map +1 -0
  30. package/dist/extensions/server.mjs +132 -0
  31. package/dist/extensions/server.mjs.map +1 -0
  32. package/dist/extensions/web.mjs +332 -0
  33. package/dist/extensions/web.mjs.map +1 -0
  34. package/dist/footer.cjs +26 -0
  35. package/dist/footer.d.mts +2 -0
  36. package/dist/footer.mjs +2 -0
  37. package/dist/harnessMetadata-CzsdGAxL.d.mts +21 -0
  38. package/dist/harnessMetadata-CzsdGAxL.d.mts.map +1 -0
  39. package/dist/harnessMetadata-DkMSJutN.mjs +25 -0
  40. package/dist/harnessMetadata-DkMSJutN.mjs.map +1 -0
  41. package/dist/harnessMetadata-Dw9Rb1nW.cjs +30 -0
  42. package/dist/harnessMetadata-Dw9Rb1nW.cjs.map +1 -0
  43. package/dist/harnessMetadata.cjs +3 -0
  44. package/dist/harnessMetadata.d.mts +2 -0
  45. package/dist/harnessMetadata.mjs +2 -0
  46. package/dist/index-Bx49wmE7.d.mts +30 -0
  47. package/dist/index-Bx49wmE7.d.mts.map +1 -0
  48. package/dist/index-Dpzvl-vg.d.mts +103 -0
  49. package/dist/index-Dpzvl-vg.d.mts.map +1 -0
  50. package/dist/index.cjs +12 -0
  51. package/dist/index.d.mts +8 -0
  52. package/dist/index.mjs +5 -0
  53. package/dist/leader.cjs +0 -0
  54. package/dist/leader.d.mts +2 -0
  55. package/dist/leader.mjs +1 -0
  56. package/dist/leaderRegistry.cjs +515 -0
  57. package/dist/leaderRegistry.cjs.map +1 -0
  58. package/dist/leaderRegistry.d.mts +59 -0
  59. package/dist/leaderRegistry.d.mts.map +1 -0
  60. package/dist/leaderRegistry.mjs +514 -0
  61. package/dist/leaderRegistry.mjs.map +1 -0
  62. package/dist/logSinkTelemetry.cjs +4 -0
  63. package/dist/logSinkTelemetry.d.mts +2 -0
  64. package/dist/logSinkTelemetry.mjs +2 -0
  65. package/dist/rolldown-runtime-VH7oDXx4.cjs +28 -0
  66. package/dist/skills.cjs +38 -0
  67. package/dist/skills.d.mts +2 -0
  68. package/dist/skills.mjs +2 -0
  69. package/dist/telemetry--EgKB9ei.mjs +36 -0
  70. package/dist/telemetry--EgKB9ei.mjs.map +1 -0
  71. package/dist/telemetry-DMR6cIT1.cjs +47 -0
  72. package/dist/telemetry-DMR6cIT1.cjs.map +1 -0
  73. package/dist/theme-2wveit5V.cjs +166 -0
  74. package/dist/theme-2wveit5V.cjs.map +1 -0
  75. package/dist/theme-Byj_dBlT.mjs +134 -0
  76. package/dist/theme-Byj_dBlT.mjs.map +1 -0
  77. package/dist/theme.cjs +7 -0
  78. package/dist/theme.d.mts +2 -0
  79. package/dist/theme.mjs +2 -0
  80. package/dist/toolInventory.cjs +20 -0
  81. package/dist/toolInventory.d.mts +2 -0
  82. package/dist/toolInventory.mjs +2 -0
  83. package/dist/uiState-Binu4nUb.d.mts +40 -0
  84. package/dist/uiState-Binu4nUb.d.mts.map +1 -0
  85. package/dist/uiState-G_Pso-5i.mjs +57 -0
  86. package/dist/uiState-G_Pso-5i.mjs.map +1 -0
  87. package/dist/uiState-rUwgKslb.cjs +68 -0
  88. package/dist/uiState-rUwgKslb.cjs.map +1 -0
  89. package/dist/uiState.cjs +4 -0
  90. package/dist/uiState.d.mts +2 -0
  91. package/dist/uiState.mjs +2 -0
  92. package/package.json +196 -0
  93. package/themes/po-dark.json +88 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Vuong Ngo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # @agimon-ai/po-ui
2
+
3
+ Native file tools and shared browser contracts for Po.
4
+
5
+ The [Po distribution](https://www.npmjs.com/package/@agimon-ai/po) loads this package as
6
+ core. Extension authors can depend on its public contracts without adopting the full distribution.
7
+
8
+ > **Alpha:** UI and contribution contracts may change between releases.
9
+
10
+ ## Requirements
11
+
12
+ - Node.js 24 or newer
13
+
14
+ ## Install
15
+
16
+ Po users should not add it to a layer; the distribution loads it before layer contributions.
17
+
18
+ ## Public API
19
+
20
+ ```ts
21
+ import { DEFAULT_THEME_NAME } from '@agimon-ai/po-ui/theme';
22
+ ```
23
+
24
+ ## Development
25
+
26
+ ```bash
27
+ pnpm build
28
+ pnpm typecheck
29
+ pnpm test
30
+ pnpm lint
31
+ ```
32
+
33
+ Maintained by [Agimon](https://agimon.ai/about).
34
+
35
+ ## License
36
+
37
+ MIT
@@ -0,0 +1,17 @@
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
5
+ //#region src/schemas/apiContracts.ts
6
+ /** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
7
+ const apiContracts = (0, require("@agimon-ai/po-core/apiContracts").defineApiContract)({
8
+ version: 1,
9
+ http: [],
10
+ sockets: [],
11
+ dynamic: []
12
+ });
13
+ //#endregion
14
+ exports.apiContracts = apiContracts;
15
+ exports.default = apiContracts;
16
+
17
+ //# sourceMappingURL=apiContracts.cjs.map
@@ -0,0 +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 facet 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"}
@@ -0,0 +1,53 @@
1
+ //#region src/schemas/apiContracts.d.ts
2
+ /** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
3
+ export declare const apiContracts: {
4
+ version: 1;
5
+ protocols?: Record<string, string> | undefined;
6
+ schemas?: Record<string, boolean | object> | undefined;
7
+ http: {
8
+ id: string;
9
+ scope: "global" | "session" | "workspace";
10
+ basePath?: string | undefined;
11
+ path: string;
12
+ method: "DELETE" | "GET" | "HEAD" | "OPTIONS" | "PATCH" | "POST" | "PUT";
13
+ description: string;
14
+ availability?: string | undefined;
15
+ authentication: "device" | "none" | "owner";
16
+ parameters?: {
17
+ name: string;
18
+ in: "header" | "path" | "query";
19
+ required: boolean;
20
+ schema: boolean | object;
21
+ }[] | undefined;
22
+ body?: {
23
+ contentType: string;
24
+ contentTypes?: string[] | undefined;
25
+ required: boolean;
26
+ schema: boolean | object;
27
+ } | undefined;
28
+ responses: Record<string, {
29
+ description: string;
30
+ contentType?: string | undefined;
31
+ schema?: boolean | object | undefined;
32
+ events?: Record<string, boolean | object> | undefined;
33
+ }>;
34
+ }[];
35
+ sockets: {
36
+ id: string;
37
+ scope: "global" | "session" | "workspace";
38
+ description: string;
39
+ availability?: string | undefined;
40
+ service: string;
41
+ member: string;
42
+ direction: "client-to-server" | "server-to-client";
43
+ kind: "channel" | "method" | "state";
44
+ input: boolean | object;
45
+ output?: boolean | object | undefined;
46
+ errors?: boolean | object | undefined;
47
+ }[];
48
+ dynamic: string[];
49
+ gaps?: string[] | undefined;
50
+ };
51
+ //#endregion
52
+ export { apiContracts as default };
53
+ //# sourceMappingURL=apiContracts.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiContracts.d.mts","names":[],"sources":["../src/schemas/apiContracts.ts"],"mappings":";;qBAGa"}
@@ -0,0 +1,13 @@
1
+ import { defineApiContract } from "@agimon-ai/po-core/apiContracts";
2
+ //#region src/schemas/apiContracts.ts
3
+ /** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
4
+ const apiContracts = defineApiContract({
5
+ version: 1,
6
+ http: [],
7
+ sockets: [],
8
+ dynamic: []
9
+ });
10
+ //#endregion
11
+ export { apiContracts, apiContracts as default };
12
+
13
+ //# sourceMappingURL=apiContracts.mjs.map
@@ -0,0 +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 facet 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"}
@@ -0,0 +1,62 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ let _agimon_ai_po_core_config = require("@agimon-ai/po-core/config");
3
+ Object.defineProperty(exports, "CONFIG_ACTION", {
4
+ enumerable: true,
5
+ get: function() {
6
+ return _agimon_ai_po_core_config.CONFIG_ACTION;
7
+ }
8
+ });
9
+ Object.defineProperty(exports, "ConfigActionSchema", {
10
+ enumerable: true,
11
+ get: function() {
12
+ return _agimon_ai_po_core_config.ConfigActionSchema;
13
+ }
14
+ });
15
+ Object.defineProperty(exports, "ConfigChoiceSchema", {
16
+ enumerable: true,
17
+ get: function() {
18
+ return _agimon_ai_po_core_config.ConfigChoiceSchema;
19
+ }
20
+ });
21
+ Object.defineProperty(exports, "ConfigFieldKindSchema", {
22
+ enumerable: true,
23
+ get: function() {
24
+ return _agimon_ai_po_core_config.ConfigFieldKindSchema;
25
+ }
26
+ });
27
+ Object.defineProperty(exports, "ConfigFieldSchema", {
28
+ enumerable: true,
29
+ get: function() {
30
+ return _agimon_ai_po_core_config.ConfigFieldSchema;
31
+ }
32
+ });
33
+ Object.defineProperty(exports, "ConfigProgressSchema", {
34
+ enumerable: true,
35
+ get: function() {
36
+ return _agimon_ai_po_core_config.ConfigProgressSchema;
37
+ }
38
+ });
39
+ Object.defineProperty(exports, "ConfigSectionSchema", {
40
+ enumerable: true,
41
+ get: function() {
42
+ return _agimon_ai_po_core_config.ConfigSectionSchema;
43
+ }
44
+ });
45
+ Object.defineProperty(exports, "ConfigSourceSchema", {
46
+ enumerable: true,
47
+ get: function() {
48
+ return _agimon_ai_po_core_config.ConfigSourceSchema;
49
+ }
50
+ });
51
+ Object.defineProperty(exports, "ConfigStatusSchema", {
52
+ enumerable: true,
53
+ get: function() {
54
+ return _agimon_ai_po_core_config.ConfigStatusSchema;
55
+ }
56
+ });
57
+ Object.defineProperty(exports, "ConfigStepSchema", {
58
+ enumerable: true,
59
+ get: function() {
60
+ return _agimon_ai_po_core_config.ConfigStepSchema;
61
+ }
62
+ });
@@ -0,0 +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, DoomConfigActionInput, DoomConfigContributionHandle, DoomConfigContributionOptions, DoomConfigInvocation, DoomConfigSectionView, DoomExtensionContext } 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 DoomConfigActionInput, type DoomConfigContributionHandle, type DoomConfigContributionOptions, type DoomConfigInvocation, type DoomConfigSectionView, type DoomExtensionContext };
@@ -0,0 +1,2 @@
1
+ import { CONFIG_ACTION, ConfigActionSchema, ConfigChoiceSchema, ConfigFieldKindSchema, ConfigFieldSchema, ConfigProgressSchema, ConfigSectionSchema, ConfigSourceSchema, ConfigStatusSchema, ConfigStepSchema } from "@agimon-ai/po-core/config";
2
+ export { CONFIG_ACTION, ConfigActionSchema, ConfigChoiceSchema, ConfigFieldKindSchema, ConfigFieldSchema, ConfigProgressSchema, ConfigSectionSchema, ConfigSourceSchema, ConfigStatusSchema, ConfigStepSchema };
@@ -0,0 +1,59 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_rolldown_runtime = require("./rolldown-runtime-VH7oDXx4.cjs");
3
+ let node_fs = require("node:fs");
4
+ node_fs = require_rolldown_runtime.__toESM(node_fs, 1);
5
+ let node_path = require("node:path");
6
+ node_path = require_rolldown_runtime.__toESM(node_path, 1);
7
+ //#region src/services/extensionSource/index.ts
8
+ /**
9
+ * Display name for an extension that Pi could not attribute to a package.
10
+ *
11
+ * Pi stamps every `--extension <path>` argument with the literal source `cli`,
12
+ * and po launches all of its extensions that way, so the only surviving
13
+ * identity is the entry path. The nearest `package.json` above it names the
14
+ * package that registered the tools.
15
+ */
16
+ /** Results are stable for the life of a session, and every source hits the same few dirs. */
17
+ const cache = /* @__PURE__ */ new Map();
18
+ const packageCache = /* @__PURE__ */ new Map();
19
+ function packageName(directory) {
20
+ let current = directory;
21
+ for (;;) {
22
+ try {
23
+ const manifest = JSON.parse(node_fs.default.readFileSync(node_path.default.join(current, "package.json"), "utf8"));
24
+ if (typeof manifest.name === "string" && manifest.name.length > 0) return manifest.name;
25
+ } catch {}
26
+ const parent = node_path.default.dirname(current);
27
+ if (parent === current) return void 0;
28
+ current = parent;
29
+ }
30
+ }
31
+ function extensionName(entryPath) {
32
+ const cached = cache.get(entryPath);
33
+ if (cached !== void 0) return cached;
34
+ const name = packageName(node_path.default.dirname(entryPath));
35
+ const resolved = name ? name.split("/").pop() ?? name : node_path.default.basename(entryPath, node_path.default.extname(entryPath));
36
+ cache.set(entryPath, resolved);
37
+ return resolved;
38
+ }
39
+ /**
40
+ * The package name exactly as a manifest spells it, scope and all.
41
+ *
42
+ * `extensionName` drops the scope because a tree reads better without it, but
43
+ * that makes it useless as a key: `.po/modes.yaml` names packages as
44
+ * `@agimon-ai/po-team`, so joining a registered tool back to the layer that
45
+ * admitted it needs the unshortened name. Attribution and display are different
46
+ * jobs, so they get different functions rather than one lossy one.
47
+ */
48
+ function extensionPackageName(entryPath) {
49
+ const cached = packageCache.get(entryPath);
50
+ if (cached !== void 0) return cached.name;
51
+ const name = packageName(node_path.default.dirname(entryPath));
52
+ packageCache.set(entryPath, { name });
53
+ return name;
54
+ }
55
+ //#endregion
56
+ exports.extensionName = extensionName;
57
+ exports.extensionPackageName = extensionPackageName;
58
+
59
+ //# sourceMappingURL=extensionName.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensionName.cjs","names":["fs","path"],"sources":["../src/services/extensionSource/index.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\n\n/**\n * Display name for an extension that Pi could not attribute to a package.\n *\n * Pi stamps every `--extension <path>` argument with the literal source `cli`,\n * and po launches all of its extensions that way, so the only surviving\n * identity is the entry path. The nearest `package.json` above it names the\n * package that registered the tools.\n */\n\n/** Results are stable for the life of a session, and every source hits the same few dirs. */\nconst cache = new Map<string, string>();\n// Wrapped, because \"no package above this path\" is a real answer worth caching\n// and a bare undefined cannot be told apart from a miss.\nconst packageCache = new Map<string, { readonly name: string | undefined }>();\nfunction packageName(directory: string): string | undefined {\n let current = directory;\n for (;;) {\n try {\n const manifest = JSON.parse(fs.readFileSync(path.join(current, 'package.json'), 'utf8')) as { name?: unknown };\n if (typeof manifest.name === 'string' && manifest.name.length > 0) return manifest.name;\n } catch {\n // No manifest here, or an unreadable one; keep walking up.\n }\n const parent = path.dirname(current);\n if (parent === current) return undefined;\n current = parent;\n }\n}\n\nexport function extensionName(entryPath: string): string {\n const cached = cache.get(entryPath);\n if (cached !== undefined) return cached;\n const name = packageName(path.dirname(entryPath));\n // `@agimon-ai/po-task` reads as `doom-task`; the scope is noise in a tree.\n const resolved = name ? (name.split('/').pop() ?? name) : path.basename(entryPath, path.extname(entryPath));\n cache.set(entryPath, resolved);\n return resolved;\n}\n\n/**\n * The package name exactly as a manifest spells it, scope and all.\n *\n * `extensionName` drops the scope because a tree reads better without it, but\n * that makes it useless as a key: `.po/modes.yaml` names packages as\n * `@agimon-ai/po-team`, so joining a registered tool back to the layer that\n * admitted it needs the unshortened name. Attribution and display are different\n * jobs, so they get different functions rather than one lossy one.\n */\nexport function extensionPackageName(entryPath: string): string | undefined {\n const cached = packageCache.get(entryPath);\n if (cached !== undefined) return cached.name;\n const name = packageName(path.dirname(entryPath));\n packageCache.set(entryPath, { name });\n return name;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAaA,MAAM,wBAAQ,IAAI,IAAoB;AAGtC,MAAM,+BAAe,IAAI,IAAmD;AAC5E,SAAS,YAAY,WAAuC;CAC1D,IAAI,UAAU;CACd,SAAS;EACP,IAAI;GACF,MAAM,WAAW,KAAK,MAAMA,QAAAA,QAAG,aAAaC,UAAAA,QAAK,KAAK,SAAS,cAAc,GAAG,MAAM,CAAC;GACvF,IAAI,OAAO,SAAS,SAAS,YAAY,SAAS,KAAK,SAAS,GAAG,OAAO,SAAS;EACrF,QAAQ,CAER;EACA,MAAM,SAASA,UAAAA,QAAK,QAAQ,OAAO;EACnC,IAAI,WAAW,SAAS,OAAO,KAAA;EAC/B,UAAU;CACZ;AACF;AAEA,SAAgB,cAAc,WAA2B;CACvD,MAAM,SAAS,MAAM,IAAI,SAAS;CAClC,IAAI,WAAW,KAAA,GAAW,OAAO;CACjC,MAAM,OAAO,YAAYA,UAAAA,QAAK,QAAQ,SAAS,CAAC;CAEhD,MAAM,WAAW,OAAQ,KAAK,MAAM,GAAG,CAAC,CAAC,IAAI,KAAK,OAAQA,UAAAA,QAAK,SAAS,WAAWA,UAAAA,QAAK,QAAQ,SAAS,CAAC;CAC1G,MAAM,IAAI,WAAW,QAAQ;CAC7B,OAAO;AACT;;;;;;;;;;AAWA,SAAgB,qBAAqB,WAAuC;CAC1E,MAAM,SAAS,aAAa,IAAI,SAAS;CACzC,IAAI,WAAW,KAAA,GAAW,OAAO,OAAO;CACxC,MAAM,OAAO,YAAYA,UAAAA,QAAK,QAAQ,SAAS,CAAC;CAChD,aAAa,IAAI,WAAW,EAAE,KAAK,CAAC;CACpC,OAAO;AACT"}
@@ -0,0 +1,14 @@
1
+ //#region src/services/extensionSource/index.d.ts
2
+ export declare function extensionName(entryPath: string): string;
3
+ /**
4
+ * The package name exactly as a manifest spells it, scope and all.
5
+ *
6
+ * `extensionName` drops the scope because a tree reads better without it, but
7
+ * that makes it useless as a key: `.po/modes.yaml` names packages as
8
+ * `@agimon-ai/po-team`, so joining a registered tool back to the layer that
9
+ * admitted it needs the unshortened name. Attribution and display are different
10
+ * jobs, so they get different functions rather than one lossy one.
11
+ */
12
+ export declare function extensionPackageName(entryPath: string): string | undefined;
13
+ //#endregion
14
+ //# sourceMappingURL=extensionName.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensionName.d.mts","names":[],"sources":["../src/services/extensionSource/index.ts"],"mappings":";wBAgCgB,cAAc;;;;;;;;;;wBAmBd,qBAAqB"}
@@ -0,0 +1,54 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+ //#region src/services/extensionSource/index.ts
4
+ /**
5
+ * Display name for an extension that Pi could not attribute to a package.
6
+ *
7
+ * Pi stamps every `--extension <path>` argument with the literal source `cli`,
8
+ * and po launches all of its extensions that way, so the only surviving
9
+ * identity is the entry path. The nearest `package.json` above it names the
10
+ * package that registered the tools.
11
+ */
12
+ /** Results are stable for the life of a session, and every source hits the same few dirs. */
13
+ const cache = /* @__PURE__ */ new Map();
14
+ const packageCache = /* @__PURE__ */ new Map();
15
+ function packageName(directory) {
16
+ let current = directory;
17
+ for (;;) {
18
+ try {
19
+ const manifest = JSON.parse(fs.readFileSync(path.join(current, "package.json"), "utf8"));
20
+ if (typeof manifest.name === "string" && manifest.name.length > 0) return manifest.name;
21
+ } catch {}
22
+ const parent = path.dirname(current);
23
+ if (parent === current) return void 0;
24
+ current = parent;
25
+ }
26
+ }
27
+ function extensionName(entryPath) {
28
+ const cached = cache.get(entryPath);
29
+ if (cached !== void 0) return cached;
30
+ const name = packageName(path.dirname(entryPath));
31
+ const resolved = name ? name.split("/").pop() ?? name : path.basename(entryPath, path.extname(entryPath));
32
+ cache.set(entryPath, resolved);
33
+ return resolved;
34
+ }
35
+ /**
36
+ * The package name exactly as a manifest spells it, scope and all.
37
+ *
38
+ * `extensionName` drops the scope because a tree reads better without it, but
39
+ * that makes it useless as a key: `.po/modes.yaml` names packages as
40
+ * `@agimon-ai/po-team`, so joining a registered tool back to the layer that
41
+ * admitted it needs the unshortened name. Attribution and display are different
42
+ * jobs, so they get different functions rather than one lossy one.
43
+ */
44
+ function extensionPackageName(entryPath) {
45
+ const cached = packageCache.get(entryPath);
46
+ if (cached !== void 0) return cached.name;
47
+ const name = packageName(path.dirname(entryPath));
48
+ packageCache.set(entryPath, { name });
49
+ return name;
50
+ }
51
+ //#endregion
52
+ export { extensionName, extensionPackageName };
53
+
54
+ //# sourceMappingURL=extensionName.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensionName.mjs","names":[],"sources":["../src/services/extensionSource/index.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\n\n/**\n * Display name for an extension that Pi could not attribute to a package.\n *\n * Pi stamps every `--extension <path>` argument with the literal source `cli`,\n * and po launches all of its extensions that way, so the only surviving\n * identity is the entry path. The nearest `package.json` above it names the\n * package that registered the tools.\n */\n\n/** Results are stable for the life of a session, and every source hits the same few dirs. */\nconst cache = new Map<string, string>();\n// Wrapped, because \"no package above this path\" is a real answer worth caching\n// and a bare undefined cannot be told apart from a miss.\nconst packageCache = new Map<string, { readonly name: string | undefined }>();\nfunction packageName(directory: string): string | undefined {\n let current = directory;\n for (;;) {\n try {\n const manifest = JSON.parse(fs.readFileSync(path.join(current, 'package.json'), 'utf8')) as { name?: unknown };\n if (typeof manifest.name === 'string' && manifest.name.length > 0) return manifest.name;\n } catch {\n // No manifest here, or an unreadable one; keep walking up.\n }\n const parent = path.dirname(current);\n if (parent === current) return undefined;\n current = parent;\n }\n}\n\nexport function extensionName(entryPath: string): string {\n const cached = cache.get(entryPath);\n if (cached !== undefined) return cached;\n const name = packageName(path.dirname(entryPath));\n // `@agimon-ai/po-task` reads as `doom-task`; the scope is noise in a tree.\n const resolved = name ? (name.split('/').pop() ?? name) : path.basename(entryPath, path.extname(entryPath));\n cache.set(entryPath, resolved);\n return resolved;\n}\n\n/**\n * The package name exactly as a manifest spells it, scope and all.\n *\n * `extensionName` drops the scope because a tree reads better without it, but\n * that makes it useless as a key: `.po/modes.yaml` names packages as\n * `@agimon-ai/po-team`, so joining a registered tool back to the layer that\n * admitted it needs the unshortened name. Attribution and display are different\n * jobs, so they get different functions rather than one lossy one.\n */\nexport function extensionPackageName(entryPath: string): string | undefined {\n const cached = packageCache.get(entryPath);\n if (cached !== undefined) return cached.name;\n const name = packageName(path.dirname(entryPath));\n packageCache.set(entryPath, { name });\n return name;\n}\n"],"mappings":";;;;;;;;;;;;AAaA,MAAM,wBAAQ,IAAI,IAAoB;AAGtC,MAAM,+BAAe,IAAI,IAAmD;AAC5E,SAAS,YAAY,WAAuC;CAC1D,IAAI,UAAU;CACd,SAAS;EACP,IAAI;GACF,MAAM,WAAW,KAAK,MAAM,GAAG,aAAa,KAAK,KAAK,SAAS,cAAc,GAAG,MAAM,CAAC;GACvF,IAAI,OAAO,SAAS,SAAS,YAAY,SAAS,KAAK,SAAS,GAAG,OAAO,SAAS;EACrF,QAAQ,CAER;EACA,MAAM,SAAS,KAAK,QAAQ,OAAO;EACnC,IAAI,WAAW,SAAS,OAAO,KAAA;EAC/B,UAAU;CACZ;AACF;AAEA,SAAgB,cAAc,WAA2B;CACvD,MAAM,SAAS,MAAM,IAAI,SAAS;CAClC,IAAI,WAAW,KAAA,GAAW,OAAO;CACjC,MAAM,OAAO,YAAY,KAAK,QAAQ,SAAS,CAAC;CAEhD,MAAM,WAAW,OAAQ,KAAK,MAAM,GAAG,CAAC,CAAC,IAAI,KAAK,OAAQ,KAAK,SAAS,WAAW,KAAK,QAAQ,SAAS,CAAC;CAC1G,MAAM,IAAI,WAAW,QAAQ;CAC7B,OAAO;AACT;;;;;;;;;;AAWA,SAAgB,qBAAqB,WAAuC;CAC1E,MAAM,SAAS,aAAa,IAAI,SAAS;CACzC,IAAI,WAAW,KAAA,GAAW,OAAO,OAAO;CACxC,MAAM,OAAO,YAAY,KAAK,QAAQ,SAAS,CAAC;CAChD,aAAa,IAAI,WAAW,EAAE,KAAK,CAAC;CACpC,OAAO;AACT"}
@@ -0,0 +1,46 @@
1
+ import { defineMcpWidget } from "@agimon-ai/po-core/web";
2
+ import { McpToolFields, McpToolFrame, McpToolOutput } from "@agimon-ai/po-web-components";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ //#region src/extensions/workspaces/sessions/(frontend)/tool/find.mcp.tsx
5
+ function FindMcpWidget(props) {
6
+ return /* @__PURE__ */ jsxs(McpToolFrame, {
7
+ ...props,
8
+ title: "Find files",
9
+ children: [/* @__PURE__ */ jsx(McpToolFields, { fields: [
10
+ ["Pattern", props.args.pattern],
11
+ ["Path", props.args.path],
12
+ ["Limit", props.args.limit]
13
+ ] }), /* @__PURE__ */ jsx(McpToolOutput, { result: props.result })]
14
+ });
15
+ }
16
+ var find_mcp_default = defineMcpWidget(FindMcpWidget);
17
+ //#endregion
18
+ //#region src/extensions/workspaces/sessions/(frontend)/tool/ls.mcp.tsx
19
+ function LsMcpWidget(props) {
20
+ return /* @__PURE__ */ jsxs(McpToolFrame, {
21
+ ...props,
22
+ title: "List directory",
23
+ children: [/* @__PURE__ */ jsx(McpToolFields, { fields: [["Path", props.args.path], ["Limit", props.args.limit]] }), /* @__PURE__ */ jsx(McpToolOutput, { result: props.result })]
24
+ });
25
+ }
26
+ var ls_mcp_default = defineMcpWidget(LsMcpWidget);
27
+ //#endregion
28
+ //#region src/extensions/workspaces/sessions/(frontend)/tool/write.mcp.tsx
29
+ function WriteMcpWidget(props) {
30
+ return /* @__PURE__ */ jsxs(McpToolFrame, {
31
+ ...props,
32
+ title: "Write file",
33
+ children: [/* @__PURE__ */ jsx(McpToolFields, { fields: [["Path", props.args.path], ["Characters", typeof props.args.content === "string" ? props.args.content.length : void 0]] }), /* @__PURE__ */ jsx(McpToolOutput, { result: props.result })]
34
+ });
35
+ }
36
+ //#endregion
37
+ //#region generated/mcp-ui.ts
38
+ const widgets = {
39
+ "@agimon-ai/po-ui/find": find_mcp_default,
40
+ "@agimon-ai/po-ui/ls": ls_mcp_default,
41
+ "@agimon-ai/po-ui/write": defineMcpWidget(WriteMcpWidget)
42
+ };
43
+ //#endregion
44
+ export { widgets };
45
+
46
+ //# sourceMappingURL=mcp-ui.mjs.map
@@ -0,0 +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 DoomMcpWidgetProps } from '@agimon-ai/po-core/web';\nimport { McpToolFrame, McpToolFields, McpToolOutput } from '@agimon-ai/po-web-components';\n\nfunction FindMcpWidget(props: DoomMcpWidgetProps) {\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 DoomMcpWidgetProps } from '@agimon-ai/po-core/web';\nimport { McpToolFrame, McpToolFields, McpToolOutput } from '@agimon-ai/po-web-components';\n\nfunction LsMcpWidget(props: DoomMcpWidgetProps) {\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 DoomMcpWidgetProps } from '@agimon-ai/po-core/web';\nimport { McpToolFrame, McpToolFields, McpToolOutput } from '@agimon-ai/po-web-components';\n\nfunction WriteMcpWidget(props: DoomMcpWidgetProps) {\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 { DoomMcpWidgetProps } 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<DoomMcpWidgetProps>>> = {\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,OAA2B;CAChD,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,OAA2B;CAC9C,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,OAA2B;CACjD,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,UAAuE;CAClF,yBAAyBA;CACzB,uBAAuBC;CACvB,0BDOa,gBAAgB,cCPHC;AAC5B"}
@@ -0,0 +1,79 @@
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
5
+ let _agimon_ai_po_core_mcpFacet = require("@agimon-ai/po-core/mcpFacet");
6
+ let _agimon_ai_po_core_headless = require("@agimon-ai/po-core/headless");
7
+ let _earendil_works_pi_coding_agent = require("@earendil-works/pi-coding-agent");
8
+ //#region src/extensions/workspaces/sessions/(backend)/_lib/mcpFileTools.ts
9
+ function createMcpWriteTool(context) {
10
+ const { outputSchema: _outputSchema, ...tool } = (0, _earendil_works_pi_coding_agent.createWriteTool)(context.execution.cwd);
11
+ return {
12
+ ...tool,
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
+ executionMode: tool.executionMode === "sequential" ? "serial" : tool.executionMode,
15
+ async execute(toolCallId, parameters, signal, onUpdate) {
16
+ return (0, _agimon_ai_po_core_headless.toDoomHeadlessToolResult)(await tool.execute(toolCallId, parameters, AbortSignal.any([context.signal, signal ?? context.signal]), onUpdate && ((partial) => onUpdate((0, _agimon_ai_po_core_headless.toDoomHeadlessToolResult)(partial)))));
17
+ }
18
+ };
19
+ }
20
+ function createMcpFindTool(context) {
21
+ const { outputSchema: _outputSchema, ...tool } = (0, _earendil_works_pi_coding_agent.createFindTool)(context.execution.cwd);
22
+ return {
23
+ ...tool,
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
+ executionMode: tool.executionMode === "sequential" ? "serial" : tool.executionMode,
26
+ async execute(toolCallId, parameters, signal, onUpdate) {
27
+ return (0, _agimon_ai_po_core_headless.toDoomHeadlessToolResult)(await tool.execute(toolCallId, parameters, AbortSignal.any([context.signal, signal ?? context.signal]), onUpdate && ((partial) => onUpdate((0, _agimon_ai_po_core_headless.toDoomHeadlessToolResult)(partial)))));
28
+ }
29
+ };
30
+ }
31
+ function createMcpLsTool(context) {
32
+ const { outputSchema: _outputSchema, ...tool } = (0, _earendil_works_pi_coding_agent.createLsTool)(context.execution.cwd);
33
+ return {
34
+ ...tool,
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
+ executionMode: tool.executionMode === "sequential" ? "serial" : tool.executionMode,
37
+ async execute(toolCallId, parameters, signal, onUpdate) {
38
+ return (0, _agimon_ai_po_core_headless.toDoomHeadlessToolResult)(await tool.execute(toolCallId, parameters, AbortSignal.any([context.signal, signal ?? context.signal]), onUpdate && ((partial) => onUpdate((0, _agimon_ai_po_core_headless.toDoomHeadlessToolResult)(partial)))));
39
+ }
40
+ };
41
+ }
42
+ //#endregion
43
+ //#region src/extensions/workspaces/sessions/(backend)/tool/find.mcp.ts
44
+ var find_mcp_default = (0, _agimon_ai_po_core_mcpFacet.defineMcpTool)(createMcpFindTool);
45
+ //#endregion
46
+ //#region src/extensions/workspaces/sessions/(backend)/tool/ls.mcp.ts
47
+ var ls_mcp_default = (0, _agimon_ai_po_core_mcpFacet.defineMcpTool)(createMcpLsTool);
48
+ //#endregion
49
+ //#region src/extensions/workspaces/sessions/(backend)/tool/write.mcp.ts
50
+ var write_mcp_default = (0, _agimon_ai_po_core_mcpFacet.defineMcpTool)(createMcpWriteTool);
51
+ //#endregion
52
+ //#region generated/mcp.ts
53
+ const at = (value, context) => typeof value === "function" ? value(context) : value;
54
+ const via = (identity, value) => value === void 0 ? void 0 : {
55
+ ...identity,
56
+ ...value
57
+ };
58
+ const withWidget = (key, value) => value === void 0 ? value : {
59
+ ...value,
60
+ _meta: {
61
+ ...value._meta,
62
+ ["po/widget"]: key
63
+ }
64
+ };
65
+ const mcp = (0, _agimon_ai_po_core_mcpFacet.defineMcpPlugin)({
66
+ name: "@agimon-ai/po-ui",
67
+ session: (context) => ({ get tools() {
68
+ return [
69
+ withWidget("@agimon-ai/po-ui/find", via({ name: "find" }, at(find_mcp_default, context))),
70
+ withWidget("@agimon-ai/po-ui/ls", via({ name: "ls" }, at(ls_mcp_default, context))),
71
+ withWidget("@agimon-ai/po-ui/write", via({ name: "write" }, at(write_mcp_default, context)))
72
+ ];
73
+ } })
74
+ });
75
+ //#endregion
76
+ exports.default = mcp;
77
+ exports.mcp = mcp;
78
+
79
+ //# sourceMappingURL=mcp.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.cjs","names":["createWriteTool","toDoomHeadlessToolResult","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 { toDoomHeadlessToolResult, type DoomHeadlessTool } from '@agimon-ai/po-core/headless';\nimport type { DoomMcpPluginContext } 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: DoomMcpPluginContext,\n): DoomHeadlessTool<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 toDoomHeadlessToolResult(\n await tool.execute(\n toolCallId,\n parameters,\n AbortSignal.any([context.signal, signal ?? context.signal]),\n onUpdate && ((partial) => onUpdate(toDoomHeadlessToolResult(partial))),\n ),\n );\n },\n };\n}\n\nexport function createMcpFindTool(\n context: DoomMcpPluginContext,\n): DoomHeadlessTool<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 toDoomHeadlessToolResult(\n await tool.execute(\n toolCallId,\n parameters,\n AbortSignal.any([context.signal, signal ?? context.signal]),\n onUpdate && ((partial) => onUpdate(toDoomHeadlessToolResult(partial))),\n ),\n );\n },\n };\n}\n\nexport function createMcpLsTool(\n context: DoomMcpPluginContext,\n): DoomHeadlessTool<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 toDoomHeadlessToolResult(\n await tool.execute(\n toolCallId,\n parameters,\n AbortSignal.any([context.signal, signal ?? context.signal]),\n onUpdate && ((partial) => onUpdate(toDoomHeadlessToolResult(partial))),\n ),\n );\n },\n };\n}\n","import type { DoomHeadlessTool } from '@agimon-ai/po-core/headless';\nimport { defineMcpTool, type DoomMcpPluginContext } from '@agimon-ai/po-core/mcpFacet';\n\nimport { createMcpFindTool } from '../_lib/mcpFileTools';\n\nexport default defineMcpTool<DoomHeadlessTool['parameters'], DoomMcpPluginContext>(createMcpFindTool);\n","import type { DoomHeadlessTool } from '@agimon-ai/po-core/headless';\nimport { defineMcpTool, type DoomMcpPluginContext } from '@agimon-ai/po-core/mcpFacet';\n\nimport { createMcpLsTool } from '../_lib/mcpFileTools';\n\nexport default defineMcpTool<DoomHeadlessTool['parameters'], DoomMcpPluginContext>(createMcpLsTool);\n","import type { DoomHeadlessTool } from '@agimon-ai/po-core/headless';\nimport { defineMcpTool, type DoomMcpPluginContext } from '@agimon-ai/po-core/mcpFacet';\n\nimport { createMcpWriteTool } from '../_lib/mcpFileTools';\n\nexport default defineMcpTool<DoomHeadlessTool['parameters'], DoomMcpPluginContext>(createMcpWriteTool);\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineMcpPlugin, type DoomMcpSessionPlugin } 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(): DoomMcpSessionPlugin['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 DoomMcpSessionPlugin,\n});\n\nexport default mcp;\n"],"mappings":";;;;;;;;AAMA,SAAgB,mBACd,SACoE;CACpE,MAAM,EAAE,cAAc,eAAe,GAAG,UAAA,GAASA,gCAAAA,gBAAAA,CAAgB,QAAQ,UAAU,GAAG;CACtF,OAAO;EACL,GAAG;EACH,aACE;EACF,eAAe,KAAK,kBAAkB,eAAe,WAAW,KAAK;EACrE,MAAM,QAAQ,YAAY,YAAY,QAAQ,UAAU;GACtD,QAAA,GAAOC,4BAAAA,yBAAAA,CACL,MAAM,KAAK,QACT,YACA,YACA,YAAY,IAAI,CAAC,QAAQ,QAAQ,UAAU,QAAQ,MAAM,CAAC,GAC1D,cAAc,YAAY,UAAA,GAASA,4BAAAA,yBAAAA,CAAyB,OAAO,CAAC,EACtE,CACF;EACF;CACF;AACF;AAEA,SAAgB,kBACd,SACmE;CACnE,MAAM,EAAE,cAAc,eAAe,GAAG,UAAA,GAASC,gCAAAA,eAAAA,CAAe,QAAQ,UAAU,GAAG;CACrF,OAAO;EACL,GAAG;EACH,aACE;EACF,eAAe,KAAK,kBAAkB,eAAe,WAAW,KAAK;EACrE,MAAM,QAAQ,YAAY,YAAY,QAAQ,UAAU;GACtD,QAAA,GAAOD,4BAAAA,yBAAAA,CACL,MAAM,KAAK,QACT,YACA,YACA,YAAY,IAAI,CAAC,QAAQ,QAAQ,UAAU,QAAQ,MAAM,CAAC,GAC1D,cAAc,YAAY,UAAA,GAASA,4BAAAA,yBAAAA,CAAyB,OAAO,CAAC,EACtE,CACF;EACF;CACF;AACF;AAEA,SAAgB,gBACd,SACiE;CACjE,MAAM,EAAE,cAAc,eAAe,GAAG,UAAA,GAASE,gCAAAA,aAAAA,CAAa,QAAQ,UAAU,GAAG;CACnF,OAAO;EACL,GAAG;EACH,aACE;EACF,eAAe,KAAK,kBAAkB,eAAe,WAAW,KAAK;EACrE,MAAM,QAAQ,YAAY,YAAY,QAAQ,UAAU;GACtD,QAAA,GAAOF,4BAAAA,yBAAAA,CACL,MAAM,KAAK,QACT,YACA,YACA,YAAY,IAAI,CAAC,QAAQ,QAAQ,UAAU,QAAQ,MAAM,CAAC,GAC1D,cAAc,YAAY,UAAA,GAASA,4BAAAA,yBAAAA,CAAyB,OAAO,CAAC,EACtE,CACF;EACF;CACF;AACF;;;ACjEA,IAAA,oBAAA,GAAeG,4BAAAA,cAAAA,CAAoE,iBAAiB;;;ACApG,IAAA,kBAAA,GAAeC,4BAAAA,cAAAA,CAAoE,eAAe;;;ACAlG,IAAA,qBAAA,GAAeC,4BAAAA,cAAAA,CAAoE,kBAAkB;;;ACGrG,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,QAAuC;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,EAC9S;AACF,CAAC"}
@@ -0,0 +1,5 @@
1
+ //#region generated/mcp.d.ts
2
+ export declare const mcp: import("@agimon-ai/po-core/mcpFacet").DoomMcpPluginDefinition;
3
+ //#endregion
4
+ export { mcp as default };
5
+ //# sourceMappingURL=mcp.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.d.mts","names":[],"sources":["../../generated/mcp.ts"],"mappings":";qBAiBa,2CAAG"}
@@ -0,0 +1,74 @@
1
+ import { defineMcpPlugin, defineMcpTool } from "@agimon-ai/po-core/mcpFacet";
2
+ import { toDoomHeadlessToolResult } from "@agimon-ai/po-core/headless";
3
+ import { createFindTool, createLsTool, createWriteTool } from "@earendil-works/pi-coding-agent";
4
+ //#region src/extensions/workspaces/sessions/(backend)/_lib/mcpFileTools.ts
5
+ function createMcpWriteTool(context) {
6
+ const { outputSchema: _outputSchema, ...tool } = createWriteTool(context.execution.cwd);
7
+ return {
8
+ ...tool,
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
+ executionMode: tool.executionMode === "sequential" ? "serial" : tool.executionMode,
11
+ async execute(toolCallId, parameters, signal, onUpdate) {
12
+ return toDoomHeadlessToolResult(await tool.execute(toolCallId, parameters, AbortSignal.any([context.signal, signal ?? context.signal]), onUpdate && ((partial) => onUpdate(toDoomHeadlessToolResult(partial)))));
13
+ }
14
+ };
15
+ }
16
+ function createMcpFindTool(context) {
17
+ const { outputSchema: _outputSchema, ...tool } = createFindTool(context.execution.cwd);
18
+ return {
19
+ ...tool,
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
+ executionMode: tool.executionMode === "sequential" ? "serial" : tool.executionMode,
22
+ async execute(toolCallId, parameters, signal, onUpdate) {
23
+ return toDoomHeadlessToolResult(await tool.execute(toolCallId, parameters, AbortSignal.any([context.signal, signal ?? context.signal]), onUpdate && ((partial) => onUpdate(toDoomHeadlessToolResult(partial)))));
24
+ }
25
+ };
26
+ }
27
+ function createMcpLsTool(context) {
28
+ const { outputSchema: _outputSchema, ...tool } = createLsTool(context.execution.cwd);
29
+ return {
30
+ ...tool,
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
+ executionMode: tool.executionMode === "sequential" ? "serial" : tool.executionMode,
33
+ async execute(toolCallId, parameters, signal, onUpdate) {
34
+ return toDoomHeadlessToolResult(await tool.execute(toolCallId, parameters, AbortSignal.any([context.signal, signal ?? context.signal]), onUpdate && ((partial) => onUpdate(toDoomHeadlessToolResult(partial)))));
35
+ }
36
+ };
37
+ }
38
+ //#endregion
39
+ //#region src/extensions/workspaces/sessions/(backend)/tool/find.mcp.ts
40
+ var find_mcp_default = defineMcpTool(createMcpFindTool);
41
+ //#endregion
42
+ //#region src/extensions/workspaces/sessions/(backend)/tool/ls.mcp.ts
43
+ var ls_mcp_default = defineMcpTool(createMcpLsTool);
44
+ //#endregion
45
+ //#region src/extensions/workspaces/sessions/(backend)/tool/write.mcp.ts
46
+ var write_mcp_default = defineMcpTool(createMcpWriteTool);
47
+ //#endregion
48
+ //#region generated/mcp.ts
49
+ const at = (value, context) => typeof value === "function" ? value(context) : value;
50
+ const via = (identity, value) => value === void 0 ? void 0 : {
51
+ ...identity,
52
+ ...value
53
+ };
54
+ const withWidget = (key, value) => value === void 0 ? value : {
55
+ ...value,
56
+ _meta: {
57
+ ...value._meta,
58
+ ["po/widget"]: key
59
+ }
60
+ };
61
+ const mcp = defineMcpPlugin({
62
+ name: "@agimon-ai/po-ui",
63
+ session: (context) => ({ get tools() {
64
+ return [
65
+ withWidget("@agimon-ai/po-ui/find", via({ name: "find" }, at(find_mcp_default, context))),
66
+ withWidget("@agimon-ai/po-ui/ls", via({ name: "ls" }, at(ls_mcp_default, context))),
67
+ withWidget("@agimon-ai/po-ui/write", via({ name: "write" }, at(write_mcp_default, context)))
68
+ ];
69
+ } })
70
+ });
71
+ //#endregion
72
+ export { mcp as default, mcp };
73
+
74
+ //# sourceMappingURL=mcp.mjs.map