@agimon-ai/doompi-edit 0.0.1-alpha.45 → 0.0.1-alpha.47

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 (67) hide show
  1. package/package.json +6 -6
  2. package/dist/api-contracts.cjs +0 -7
  3. package/dist/api-contracts.d.cts +0 -2
  4. package/dist/api-contracts.d.mts +0 -2
  5. package/dist/api-contracts.mjs +0 -2
  6. package/dist/extensions/pi.cjs +0 -19
  7. package/dist/extensions/pi.cjs.map +0 -1
  8. package/dist/extensions/pi.d.cts +0 -5
  9. package/dist/extensions/pi.d.cts.map +0 -1
  10. package/dist/extensions/pi.d.mts +0 -5
  11. package/dist/extensions/pi.d.mts.map +0 -1
  12. package/dist/extensions/pi.mjs +0 -14
  13. package/dist/extensions/pi.mjs.map +0 -1
  14. package/dist/extensions/server.cjs +0 -23
  15. package/dist/extensions/server.cjs.map +0 -1
  16. package/dist/extensions/server.d.cts +0 -5
  17. package/dist/extensions/server.d.cts.map +0 -1
  18. package/dist/extensions/server.d.mts +0 -5
  19. package/dist/extensions/server.d.mts.map +0 -1
  20. package/dist/extensions/server.mjs +0 -18
  21. package/dist/extensions/server.mjs.map +0 -1
  22. package/dist/extensions/web.mjs +0 -179
  23. package/dist/extensions/web.mjs.map +0 -1
  24. package/dist/index.cjs +0 -8
  25. package/dist/index.d.cts +0 -3
  26. package/dist/index.d.mts +0 -3
  27. package/dist/index.mjs +0 -3
  28. package/dist/src/extensions/workspaces/sessions/(backend)/tool/edit.cli.cjs +0 -7
  29. package/dist/src/extensions/workspaces/sessions/(backend)/tool/edit.cli.cjs.map +0 -1
  30. package/dist/src/extensions/workspaces/sessions/(backend)/tool/edit.cli.mjs +0 -8
  31. package/dist/src/extensions/workspaces/sessions/(backend)/tool/edit.cli.mjs.map +0 -1
  32. package/dist/src/extensions/workspaces/sessions/(backend)/tool/edit.server.cjs +0 -7
  33. package/dist/src/extensions/workspaces/sessions/(backend)/tool/edit.server.cjs.map +0 -1
  34. package/dist/src/extensions/workspaces/sessions/(backend)/tool/edit.server.mjs +0 -8
  35. package/dist/src/extensions/workspaces/sessions/(backend)/tool/edit.server.mjs.map +0 -1
  36. package/dist/src/extensions/workspaces/sessions/(frontend)/tool/_lib/editRenderer.cli.cjs +0 -18
  37. package/dist/src/extensions/workspaces/sessions/(frontend)/tool/_lib/editRenderer.cli.cjs.map +0 -1
  38. package/dist/src/extensions/workspaces/sessions/(frontend)/tool/_lib/editRenderer.cli.mjs +0 -18
  39. package/dist/src/extensions/workspaces/sessions/(frontend)/tool/_lib/editRenderer.cli.mjs.map +0 -1
  40. package/dist/src/extensions/workspaces/sessions/(frontend)/tool/edit.cli.cjs +0 -7
  41. package/dist/src/extensions/workspaces/sessions/(frontend)/tool/edit.cli.cjs.map +0 -1
  42. package/dist/src/extensions/workspaces/sessions/(frontend)/tool/edit.cli.mjs +0 -8
  43. package/dist/src/extensions/workspaces/sessions/(frontend)/tool/edit.cli.mjs.map +0 -1
  44. package/dist/src/schemas/apiContracts.cjs +0 -13
  45. package/dist/src/schemas/apiContracts.cjs.map +0 -1
  46. package/dist/src/schemas/apiContracts.d.cts +0 -53
  47. package/dist/src/schemas/apiContracts.d.cts.map +0 -1
  48. package/dist/src/schemas/apiContracts.d.mts +0 -53
  49. package/dist/src/schemas/apiContracts.d.mts.map +0 -1
  50. package/dist/src/schemas/apiContracts.mjs +0 -13
  51. package/dist/src/schemas/apiContracts.mjs.map +0 -1
  52. package/dist/src/schemas/editTool.cjs +0 -20
  53. package/dist/src/schemas/editTool.cjs.map +0 -1
  54. package/dist/src/schemas/editTool.d.cts +0 -20
  55. package/dist/src/schemas/editTool.d.cts.map +0 -1
  56. package/dist/src/schemas/editTool.d.mts +0 -20
  57. package/dist/src/schemas/editTool.d.mts.map +0 -1
  58. package/dist/src/schemas/editTool.mjs +0 -19
  59. package/dist/src/schemas/editTool.mjs.map +0 -1
  60. package/dist/src/services/editTool/index.cjs +0 -145
  61. package/dist/src/services/editTool/index.cjs.map +0 -1
  62. package/dist/src/services/editTool/index.d.cts +0 -15
  63. package/dist/src/services/editTool/index.d.cts.map +0 -1
  64. package/dist/src/services/editTool/index.d.mts +0 -15
  65. package/dist/src/services/editTool/index.d.mts.map +0 -1
  66. package/dist/src/services/editTool/index.mjs +0 -142
  67. package/dist/src/services/editTool/index.mjs.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agimon-ai/doompi-edit",
3
- "version": "0.0.1-alpha.45",
3
+ "version": "0.0.1-alpha.47",
4
4
  "description": "Snapshot-bound hashline edit tool for Pi and DoomPi.",
5
5
  "keywords": [
6
6
  "ai",
@@ -61,15 +61,15 @@
61
61
  "access": "public"
62
62
  },
63
63
  "dependencies": {
64
- "@agimon-ai/doompi-core": "0.0.1-alpha.73",
65
- "@agimon-ai/doompi-hashline": "0.0.1-alpha.42",
66
- "@agimon-ai/doompi-ui": "0.0.1-alpha.73",
67
- "@agimon-ai/doompi-web-components": "0.0.1-alpha.31",
64
+ "@agimon-ai/doompi-core": "0.0.1-alpha.75",
65
+ "@agimon-ai/doompi-hashline": "0.0.1-alpha.44",
66
+ "@agimon-ai/doompi-ui": "0.0.1-alpha.75",
67
+ "@agimon-ai/doompi-web-components": "0.0.1-alpha.33",
68
68
  "@deepseek-ai/cordis": "4.0.2",
69
69
  "typebox": "1.3.30"
70
70
  },
71
71
  "devDependencies": {
72
- "@agimon-ai/doompi-build": "0.0.1-alpha.2",
72
+ "@agimon-ai/doompi-build": "0.0.1-alpha.4",
73
73
  "@earendil-works/pi-coding-agent": "0.85.1",
74
74
  "@earendil-works/pi-tui": "0.85.1",
75
75
  "@tanstack/react-store": "0.11.1",
@@ -1,7 +0,0 @@
1
- Object.defineProperties(exports, {
2
- __esModule: { value: true },
3
- [Symbol.toStringTag]: { value: "Module" }
4
- });
5
- const require_apiContracts = require("./src/schemas/apiContracts.cjs");
6
- exports.apiContracts = require_apiContracts.apiContracts;
7
- exports.default = require_apiContracts.apiContracts;
@@ -1,2 +0,0 @@
1
- import { apiContracts } from "./src/schemas/apiContracts.cjs";
2
- export { apiContracts, apiContracts as default };
@@ -1,2 +0,0 @@
1
- import { apiContracts } from "./src/schemas/apiContracts.mjs";
2
- export { apiContracts, apiContracts as default };
@@ -1,2 +0,0 @@
1
- import { apiContracts } from "./src/schemas/apiContracts.mjs";
2
- export { apiContracts, apiContracts as default };
@@ -1,19 +0,0 @@
1
- Object.defineProperties(exports, {
2
- __esModule: { value: true },
3
- [Symbol.toStringTag]: { value: "Module" }
4
- });
5
- const require_edit_cli = require("../src/extensions/workspaces/sessions/(backend)/tool/edit.cli.cjs");
6
- const require_edit_cli$1 = require("../src/extensions/workspaces/sessions/(frontend)/tool/edit.cli.cjs");
7
- let _agimon_ai_doompi_core_pi_extension = require("@agimon-ai/doompi-core/pi-extension");
8
- //#region generated/pi.ts
9
- const at = (value, context) => typeof value === "function" ? value(context) : value;
10
- const via = (identity, value) => ({
11
- ...identity,
12
- ...value
13
- });
14
- const extension = (0, _agimon_ai_doompi_core_pi_extension.definePiExtension)("@agimon-ai/doompi-edit", (context) => ({ ...(0, _agimon_ai_doompi_core_pi_extension.piToolContributions)("@agimon-ai/doompi-edit", [via({ name: "edit" }, (0, _agimon_ai_doompi_core_pi_extension.withPiRenderers)(at(require_edit_cli.default, context), at(require_edit_cli$1.default, context)))]) }));
15
- //#endregion
16
- exports.default = extension;
17
- exports.extension = extension;
18
-
19
- //# sourceMappingURL=pi.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pi.cjs","names":["definePiExtension","piToolContributions","withPiRenderers","toolEdit","renderEdit"],"sources":["../../generated/pi.ts"],"sourcesContent":["// Generated by @agimon-ai/doompi-build. Do not edit by hand.\nimport { definePiExtension, piToolContributions, withPiRenderers, type PiPluginContext } from '@agimon-ai/doompi-core/pi-extension';\n\nimport toolEdit from '../src/extensions/workspaces/sessions/(backend)/tool/edit.cli';\nimport renderEdit from '../src/extensions/workspaces/sessions/(frontend)/tool/edit.cli';\n\ntype OptionsOf<T> = T extends (context: PiPluginContext<infer Options>) => unknown ? Options : never;\ntype InferredOptions = Exclude<OptionsOf<typeof toolEdit>, undefined>;\ntype Intersect<Union> =\n (Union extends unknown ? (value: Union) => void : never) extends (value: infer Value) => void ? Value : never;\ntype ExtensionOptions = [InferredOptions] extends [never] ? undefined : Intersect<InferredOptions>;\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 => ({ ...identity, ...(value as object) }) as T;\n\nexport const extension = definePiExtension<ExtensionOptions>('@agimon-ai/doompi-edit', (context) => ({\n ...piToolContributions('@agimon-ai/doompi-edit', [via({ name: 'edit' }, withPiRenderers(at(toolEdit, context), at(renderEdit, context)))]),\n}));\n\nexport default extension;\n"],"mappings":";;;;;;;;AAaA,MAAM,MAAY,OAA0B,YAC1C,OAAO,UAAU,aAAc,MAAwB,OAAO,IAAI;AACpE,MAAM,OAAU,UAAmC,WAAuB;CAAE,GAAG;CAAU,GAAI;AAAiB;AAE9G,MAAa,aAAA,GAAYA,oCAAAA,kBAAAA,CAAoC,2BAA2B,aAAa,EACnG,IAAA,GAAGC,oCAAAA,oBAAAA,CAAoB,0BAA0B,CAAC,IAAI,EAAE,MAAM,OAAO,IAAA,GAAGC,oCAAAA,gBAAAA,CAAgB,GAAGC,iBAAAA,SAAU,OAAO,GAAG,GAAGC,mBAAAA,SAAY,OAAO,CAAC,CAAC,CAAC,CAAC,EAC3I,EAAE"}
@@ -1,5 +0,0 @@
1
- //#region generated/pi.d.ts
2
- export declare const extension: import("@agimon-ai/doompi-core/runtime-pi-extension").DefinedPiExtension<undefined>;
3
- //#endregion
4
- export { extension as default };
5
- //# sourceMappingURL=pi.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pi.d.cts","names":[],"sources":["../../generated/pi.ts"],"mappings":";qBAiBa,iEAAS"}
@@ -1,5 +0,0 @@
1
- //#region generated/pi.d.ts
2
- export declare const extension: import("@agimon-ai/doompi-core/runtime-pi-extension").DefinedPiExtension<undefined>;
3
- //#endregion
4
- export { extension as default };
5
- //# sourceMappingURL=pi.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pi.d.mts","names":[],"sources":["../../generated/pi.ts"],"mappings":";qBAiBa,iEAAS"}
@@ -1,14 +0,0 @@
1
- import edit_cli_default from "../src/extensions/workspaces/sessions/(backend)/tool/edit.cli.mjs";
2
- import edit_cli_default$1 from "../src/extensions/workspaces/sessions/(frontend)/tool/edit.cli.mjs";
3
- import { definePiExtension, piToolContributions, withPiRenderers } from "@agimon-ai/doompi-core/pi-extension";
4
- //#region generated/pi.ts
5
- const at = (value, context) => typeof value === "function" ? value(context) : value;
6
- const via = (identity, value) => ({
7
- ...identity,
8
- ...value
9
- });
10
- const extension = definePiExtension("@agimon-ai/doompi-edit", (context) => ({ ...piToolContributions("@agimon-ai/doompi-edit", [via({ name: "edit" }, withPiRenderers(at(edit_cli_default, context), at(edit_cli_default$1, context)))]) }));
11
- //#endregion
12
- export { extension as default, extension };
13
-
14
- //# sourceMappingURL=pi.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pi.mjs","names":["toolEdit","renderEdit"],"sources":["../../generated/pi.ts"],"sourcesContent":["// Generated by @agimon-ai/doompi-build. Do not edit by hand.\nimport { definePiExtension, piToolContributions, withPiRenderers, type PiPluginContext } from '@agimon-ai/doompi-core/pi-extension';\n\nimport toolEdit from '../src/extensions/workspaces/sessions/(backend)/tool/edit.cli';\nimport renderEdit from '../src/extensions/workspaces/sessions/(frontend)/tool/edit.cli';\n\ntype OptionsOf<T> = T extends (context: PiPluginContext<infer Options>) => unknown ? Options : never;\ntype InferredOptions = Exclude<OptionsOf<typeof toolEdit>, undefined>;\ntype Intersect<Union> =\n (Union extends unknown ? (value: Union) => void : never) extends (value: infer Value) => void ? Value : never;\ntype ExtensionOptions = [InferredOptions] extends [never] ? undefined : Intersect<InferredOptions>;\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 => ({ ...identity, ...(value as object) }) as T;\n\nexport const extension = definePiExtension<ExtensionOptions>('@agimon-ai/doompi-edit', (context) => ({\n ...piToolContributions('@agimon-ai/doompi-edit', [via({ name: 'edit' }, withPiRenderers(at(toolEdit, context), at(renderEdit, context)))]),\n}));\n\nexport default extension;\n"],"mappings":";;;;AAaA,MAAM,MAAY,OAA0B,YAC1C,OAAO,UAAU,aAAc,MAAwB,OAAO,IAAI;AACpE,MAAM,OAAU,UAAmC,WAAuB;CAAE,GAAG;CAAU,GAAI;AAAiB;AAE9G,MAAa,YAAY,kBAAoC,2BAA2B,aAAa,EACnG,GAAG,oBAAoB,0BAA0B,CAAC,IAAI,EAAE,MAAM,OAAO,GAAG,gBAAgB,GAAGA,kBAAU,OAAO,GAAG,GAAGC,oBAAY,OAAO,CAAC,CAAC,CAAC,CAAC,EAC3I,EAAE"}
@@ -1,23 +0,0 @@
1
- Object.defineProperties(exports, {
2
- __esModule: { value: true },
3
- [Symbol.toStringTag]: { value: "Module" }
4
- });
5
- const require_edit_server = require("../src/extensions/workspaces/sessions/(backend)/tool/edit.server.cjs");
6
- let _agimon_ai_doompi_core_server_facet = require("@agimon-ai/doompi-core/server-facet");
7
- //#region generated/server.ts
8
- const at = (value, context) => typeof value === "function" ? value(context) : value;
9
- const via = (identity, value) => ({
10
- ...identity,
11
- ...value
12
- });
13
- const facet = (0, _agimon_ai_doompi_core_server_facet.defineServerPlugin)({
14
- name: "@agimon-ai/doompi-edit",
15
- session: (context) => ({ get tools() {
16
- return [via({ name: "edit" }, at(require_edit_server.default, context))];
17
- } })
18
- });
19
- //#endregion
20
- exports.default = facet;
21
- exports.facet = facet;
22
-
23
- //# sourceMappingURL=server.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.cjs","names":["defineServerPlugin","toolEdit"],"sources":["../../generated/server.ts"],"sourcesContent":["// Generated by @agimon-ai/doompi-build. Do not edit by hand.\nimport { defineServerPlugin, type DoomServerSessionPlugin } from '@agimon-ai/doompi-core/server-facet';\n\nimport toolEdit from '../src/extensions/workspaces/sessions/(backend)/tool/edit.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 => ({ ...identity, ...(value as object) }) as T;\n\nexport const facet = defineServerPlugin({\n name: '@agimon-ai/doompi-edit',\n session: (context) => ({\n get tools(): DoomServerSessionPlugin['tools'] { return [via({ name: 'edit' }, at(toolEdit, context))]; },\n }),\n});\n\nexport default facet;\n"],"mappings":";;;;;;;AAMA,MAAM,MAAY,OAA0B,YAC1C,OAAO,UAAU,aAAc,MAAwB,OAAO,IAAI;AACpE,MAAM,OAAU,UAAmC,WAAuB;CAAE,GAAG;CAAU,GAAI;AAAiB;AAE9G,MAAa,SAAA,GAAQA,oCAAAA,mBAAAA,CAAmB;CACtC,MAAM;CACN,UAAU,aAAa,EACrB,IAAI,QAA0C;EAAE,OAAO,CAAC,IAAI,EAAE,MAAM,OAAO,GAAG,GAAGC,oBAAAA,SAAU,OAAO,CAAC,CAAC;CAAG,EACzG;AACF,CAAC"}
@@ -1,5 +0,0 @@
1
- //#region generated/server.d.ts
2
- export declare const facet: import("@agimon-ai/doompi-core/server-facet").DoomServerFacet;
3
- //#endregion
4
- export { facet as default };
5
- //# sourceMappingURL=server.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.d.cts","names":[],"sources":["../../generated/server.ts"],"mappings":";qBAUa,qDAAK"}
@@ -1,5 +0,0 @@
1
- //#region generated/server.d.ts
2
- export declare const facet: import("@agimon-ai/doompi-core/server-facet").DoomServerFacet;
3
- //#endregion
4
- export { facet as default };
5
- //# sourceMappingURL=server.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.d.mts","names":[],"sources":["../../generated/server.ts"],"mappings":";qBAUa,qDAAK"}
@@ -1,18 +0,0 @@
1
- import edit_server_default from "../src/extensions/workspaces/sessions/(backend)/tool/edit.server.mjs";
2
- import { defineServerPlugin } from "@agimon-ai/doompi-core/server-facet";
3
- //#region generated/server.ts
4
- const at = (value, context) => typeof value === "function" ? value(context) : value;
5
- const via = (identity, value) => ({
6
- ...identity,
7
- ...value
8
- });
9
- const facet = defineServerPlugin({
10
- name: "@agimon-ai/doompi-edit",
11
- session: (context) => ({ get tools() {
12
- return [via({ name: "edit" }, at(edit_server_default, context))];
13
- } })
14
- });
15
- //#endregion
16
- export { facet as default, facet };
17
-
18
- //# sourceMappingURL=server.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.mjs","names":["toolEdit"],"sources":["../../generated/server.ts"],"sourcesContent":["// Generated by @agimon-ai/doompi-build. Do not edit by hand.\nimport { defineServerPlugin, type DoomServerSessionPlugin } from '@agimon-ai/doompi-core/server-facet';\n\nimport toolEdit from '../src/extensions/workspaces/sessions/(backend)/tool/edit.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 => ({ ...identity, ...(value as object) }) as T;\n\nexport const facet = defineServerPlugin({\n name: '@agimon-ai/doompi-edit',\n session: (context) => ({\n get tools(): DoomServerSessionPlugin['tools'] { return [via({ name: 'edit' }, at(toolEdit, context))]; },\n }),\n});\n\nexport default facet;\n"],"mappings":";;;AAMA,MAAM,MAAY,OAA0B,YAC1C,OAAO,UAAU,aAAc,MAAwB,OAAO,IAAI;AACpE,MAAM,OAAU,UAAmC,WAAuB;CAAE,GAAG;CAAU,GAAI;AAAiB;AAE9G,MAAa,QAAQ,mBAAmB;CACtC,MAAM;CACN,UAAU,aAAa,EACrB,IAAI,QAA0C;EAAE,OAAO,CAAC,IAAI,EAAE,MAAM,OAAO,GAAG,GAAGA,qBAAU,OAAO,CAAC,CAAC;CAAG,EACzG;AACF,CAAC"}
@@ -1,179 +0,0 @@
1
- import { defineToolRenderer, defineWebPlugin } from "@agimon-ai/doompi-core/web";
2
- import { MessageItem, MessageItemBody, MessageItemHeader, MessageItemStatus, SyntaxLine, ToolPathLink, collapseLines, toolTone, useSyntaxLines } from "@agimon-ai/doompi-web-components";
3
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
- //#region src/extensions/workspaces/sessions/(frontend)/tool/_lib/editToolView.ts
5
- /** Pi emits `+12 text`, `-12 text`, ` 12 text`, and a blank-numbered ` ... ` elision between hunks. */
6
- const DIFF_ROW_PATTERN = /^([+\- ])( *\d*) (.*)$/u;
7
- const CONTEXT_MARKER = " ";
8
- /** What the edit call heading shows: the path and how many ranges the call touches. */
9
- function editCallView(args) {
10
- const count = Array.isArray(args.edits) ? args.edits.length : 0;
11
- return {
12
- path: typeof args.path === "string" ? args.path : "",
13
- ranges: `${count} ${count === 1 ? "range" : "ranges"}`
14
- };
15
- }
16
- function toDiffMarker(value) {
17
- return value === "+" || value === "-" ? value : CONTEXT_MARKER;
18
- }
19
- /** Pi's display diff as rows; a line that is not a diff row reads as unnumbered context. */
20
- function parseDiffRows(diff) {
21
- return diff.split("\n").map((line) => {
22
- const expanded = line.replaceAll(" ", " ");
23
- const match = DIFF_ROW_PATTERN.exec(expanded);
24
- if (!match) return {
25
- marker: CONTEXT_MARKER,
26
- lineNumber: "",
27
- content: expanded
28
- };
29
- return {
30
- marker: toDiffMarker(match[1]),
31
- lineNumber: (match[2] ?? "").trim(),
32
- content: match[3] ?? ""
33
- };
34
- });
35
- }
36
- /** The diff a successful edit carries in its details; undefined when the details never arrived. */
37
- function editResultView(result) {
38
- const details = result?.details;
39
- if (typeof details !== "object" || details === null) return void 0;
40
- const diff = details.diff;
41
- if (typeof diff !== "string" || diff.length === 0) return void 0;
42
- const rows = parseDiffRows(diff);
43
- return {
44
- rows,
45
- gutter: rows.reduce((widest, row) => Math.max(widest, row.lineNumber.length), 1)
46
- };
47
- }
48
- /** The result's text lines, for the error case where the diff never happened. */
49
- function resultTextLines(result, output) {
50
- const lines = (result === null ? output : result.content.flatMap((block) => {
51
- const record = typeof block === "object" && block !== null ? block : {};
52
- return record.type === "text" && typeof record.text === "string" ? [record.text] : [];
53
- }).join("\n")).replaceAll(" ", " ").replaceAll("\r\n", "\n").split("\n");
54
- while (lines.at(-1) === "") lines.pop();
55
- return lines;
56
- }
57
- //#endregion
58
- //#region src/extensions/workspaces/sessions/(frontend)/tool/_components/EditToolMessage.tsx
59
- /** Diff rows shown until the item expands; about what the old scroll box held. */
60
- const COLLAPSED_ROWS = 24;
61
- const ROW_TONE = {
62
- "+": "bg-doom-tint-green text-doom-green",
63
- "-": "bg-doom-tint-red text-doom-red",
64
- " ": "text-doom-dim"
65
- };
66
- /**
67
- * The banded rows, and the grammar over them.
68
- *
69
- * Its own component because the colours come from a hook, and the body that
70
- * renders these rows is chosen inside a render prop. The rows are parsed as
71
- * one document: a diff is not a file, so a replaced line is seen twice and a
72
- * split string can colour oddly, which costs a token here and there and never
73
- * costs the reader the text. The `+` and `-` wash stays underneath, so what
74
- * changed is still legible when the grammar has coloured the foreground.
75
- */
76
- function DiffRows({ rows, gutter, path }) {
77
- const spans = useSyntaxLines(rows.map((row) => row.content).join("\n"), { path });
78
- return /* @__PURE__ */ jsx(Fragment, { children: rows.map((row, index) => /* @__PURE__ */ jsxs("span", {
79
- className: `flex gap-2 ${ROW_TONE[row.marker]}`,
80
- children: [
81
- /* @__PURE__ */ jsx("span", {
82
- className: "shrink-0 text-right text-doom-faint",
83
- style: { width: `${String(gutter)}ch` },
84
- children: row.lineNumber
85
- }),
86
- /* @__PURE__ */ jsx("span", {
87
- className: "w-2 shrink-0",
88
- children: row.marker === " " ? "" : row.marker
89
- }),
90
- /* @__PURE__ */ jsx(SyntaxLine, {
91
- spans: spans?.[index],
92
- text: row.content,
93
- className: "min-w-0 whitespace-pre-wrap break-words"
94
- })
95
- ]
96
- }, `${String(index)}-${row.lineNumber}`)) });
97
- }
98
- /**
99
- * The edit tool's timeline item: `path · N ranges` in the header; the display
100
- * diff from the result's details, banded by row, in the body. A successful
101
- * edit whose details never arrived shows nothing, and a failed one shows the
102
- * tool's message in red.
103
- */
104
- function EditToolMessage({ args, result, output, running, isError, fileTabFor, openTransientTab }) {
105
- const call = editCallView(args);
106
- const view = result === null || isError ? void 0 : editResultView(result);
107
- const tab = fileTabFor(call.path);
108
- return /* @__PURE__ */ jsx(MessageItem, {
109
- tone: toolTone({
110
- running,
111
- isError
112
- }),
113
- expandable: view !== void 0 && view.rows.length > COLLAPSED_ROWS,
114
- children: ({ expanded }) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MessageItemHeader, {
115
- title: "edit",
116
- children: /* @__PURE__ */ jsxs("span", {
117
- "data-testid": "tool-call-edit",
118
- className: "flex min-w-0 flex-1 items-center gap-2",
119
- children: [/* @__PURE__ */ jsx(ToolPathLink, {
120
- path: call.path,
121
- ...tab === void 0 ? {} : { onOpen: () => openTransientTab(tab) }
122
- }), /* @__PURE__ */ jsxs("span", {
123
- className: "shrink-0 text-doom-faint",
124
- children: ["· ", call.ranges]
125
- })]
126
- })
127
- }), isError ? /* @__PURE__ */ jsxs(MessageItemBody, {
128
- "data-testid": "tool-result-edit",
129
- className: "flex flex-col",
130
- children: [/* @__PURE__ */ jsx(MessageItemStatus, {
131
- tone: "error",
132
- children: "failed"
133
- }), resultTextLines(result, output).map((line, index) => /* @__PURE__ */ jsx("span", {
134
- className: "whitespace-pre-wrap break-words text-doom-red",
135
- children: line
136
- }, `${String(index)}-${line}`))]
137
- }) : view === void 0 ? running ? /* @__PURE__ */ jsx(MessageItemBody, {
138
- "data-testid": "tool-result-edit",
139
- children: /* @__PURE__ */ jsx(MessageItemStatus, {
140
- tone: "running",
141
- children: "running"
142
- })
143
- }) : null : (() => {
144
- const { shown, hidden } = collapseLines(view.rows, COLLAPSED_ROWS, expanded);
145
- return /* @__PURE__ */ jsxs(MessageItemBody, {
146
- "data-testid": "tool-result-edit",
147
- className: "flex flex-col font-mono",
148
- children: [/* @__PURE__ */ jsx(DiffRows, {
149
- rows: shown,
150
- gutter: view.gutter,
151
- path: call.path
152
- }), hidden > 0 ? /* @__PURE__ */ jsxs(MessageItemStatus, {
153
- expands: true,
154
- className: "pt-1",
155
- children: [hidden, " more rows"]
156
- }) : null]
157
- });
158
- })()] })
159
- });
160
- }
161
- //#endregion
162
- //#region src/extensions/workspaces/sessions/(frontend)/tool/edit.web.tsx
163
- var edit_web_default = defineToolRenderer({ message: EditToolMessage });
164
- //#endregion
165
- //#region generated/web.ts
166
- const via = (identity, value) => ({
167
- ...identity,
168
- ...value
169
- });
170
- const webPlugin = defineWebPlugin({
171
- id: "edit",
172
- session: { get toolRenderers() {
173
- return [via({ tools: ["edit"] }, edit_web_default)];
174
- } }
175
- });
176
- //#endregion
177
- export { webPlugin };
178
-
179
- //# sourceMappingURL=web.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"web.mjs","names":["toolEdit"],"sources":["../../src/extensions/workspaces/sessions/(frontend)/tool/_lib/editToolView.ts","../../src/extensions/workspaces/sessions/(frontend)/tool/_components/EditToolMessage.tsx","../../src/extensions/workspaces/sessions/(frontend)/tool/edit.web.tsx","../../generated/web.ts"],"sourcesContent":["import type { ToolResultView } from '@agimon-ai/doompi-core/web';\n\n/** Pi emits `+12 text`, `-12 text`, ` 12 text`, and a blank-numbered ` ... ` elision between hunks. */\nconst DIFF_ROW_PATTERN = /^([+\\- ])( *\\d*) (.*)$/u;\nconst CONTEXT_MARKER = ' ';\n\nexport type DiffMarker = '+' | '-' | typeof CONTEXT_MARKER;\n\nexport interface DiffRow {\n readonly marker: DiffMarker;\n readonly lineNumber: string;\n readonly content: string;\n}\n\nexport interface EditCallView {\n readonly path: string;\n /** `N range` or `N ranges`, the count the TUI's call heading shows. */\n readonly ranges: string;\n}\n\nexport interface EditResultView {\n readonly rows: readonly DiffRow[];\n /** Widest line number among the rows, in characters, sizing the gutter. */\n readonly gutter: number;\n}\n\n/** What the edit call heading shows: the path and how many ranges the call touches. */\nexport function editCallView(args: Readonly<Record<string, unknown>>): EditCallView {\n const count = Array.isArray(args.edits) ? args.edits.length : 0;\n return {\n path: typeof args.path === 'string' ? args.path : '',\n ranges: `${count} ${count === 1 ? 'range' : 'ranges'}`,\n };\n}\n\nfunction toDiffMarker(value: string | undefined): DiffMarker {\n return value === '+' || value === '-' ? value : CONTEXT_MARKER;\n}\n\n/** Pi's display diff as rows; a line that is not a diff row reads as unnumbered context. */\nexport function parseDiffRows(diff: string): DiffRow[] {\n return diff.split('\\n').map((line) => {\n const expanded = line.replaceAll('\\t', ' ');\n const match = DIFF_ROW_PATTERN.exec(expanded);\n if (!match) return { marker: CONTEXT_MARKER, lineNumber: '', content: expanded };\n return { marker: toDiffMarker(match[1]), lineNumber: (match[2] ?? '').trim(), content: match[3] ?? '' };\n });\n}\n\n/** The diff a successful edit carries in its details; undefined when the details never arrived. */\nexport function editResultView(result: ToolResultView | null): EditResultView | undefined {\n const details = result?.details;\n if (typeof details !== 'object' || details === null) return undefined;\n const diff = (details as { diff?: unknown }).diff;\n if (typeof diff !== 'string' || diff.length === 0) return undefined;\n const rows = parseDiffRows(diff);\n return { rows, gutter: rows.reduce((widest, row) => Math.max(widest, row.lineNumber.length), 1) };\n}\n\n/** The result's text lines, for the error case where the diff never happened. */\nexport function resultTextLines(result: ToolResultView | null, output: string): string[] {\n const text =\n result === null\n ? output\n : result.content\n .flatMap((block) => {\n const record =\n typeof block === 'object' && block !== null ? (block as { type?: unknown; text?: unknown }) : {};\n return record.type === 'text' && typeof record.text === 'string' ? [record.text] : [];\n })\n .join('\\n');\n const lines = text.replaceAll('\\t', ' ').replaceAll('\\r\\n', '\\n').split('\\n');\n while (lines.at(-1) === '') lines.pop();\n return lines;\n}\n","import type { ToolMessageRenderProps } from '@agimon-ai/doompi-core/web';\nimport {\n collapseLines,\n MessageItem,\n MessageItemBody,\n MessageItemHeader,\n MessageItemStatus,\n SyntaxLine,\n ToolPathLink,\n toolTone,\n useSyntaxLines,\n} from '@agimon-ai/doompi-web-components';\n\nimport { type DiffRow, editCallView, editResultView, resultTextLines } from '../_lib/editToolView';\n\n/** Diff rows shown until the item expands; about what the old scroll box held. */\nconst COLLAPSED_ROWS = 24;\n\n// Doom carries a diff on the background the way Magit does: a green wash on\n// added rows, a red wash on removed ones, and the foreground left to the text.\nconst ROW_TONE: Readonly<Record<DiffRow['marker'], string>> = {\n '+': 'bg-doom-tint-green text-doom-green',\n '-': 'bg-doom-tint-red text-doom-red',\n ' ': 'text-doom-dim',\n};\n\n/**\n * The banded rows, and the grammar over them.\n *\n * Its own component because the colours come from a hook, and the body that\n * renders these rows is chosen inside a render prop. The rows are parsed as\n * one document: a diff is not a file, so a replaced line is seen twice and a\n * split string can colour oddly, which costs a token here and there and never\n * costs the reader the text. The `+` and `-` wash stays underneath, so what\n * changed is still legible when the grammar has coloured the foreground.\n */\nfunction DiffRows({ rows, gutter, path }: { rows: readonly DiffRow[]; gutter: number; path: string }) {\n const spans = useSyntaxLines(rows.map((row) => row.content).join('\\n'), { path });\n return (\n <>\n {rows.map((row, index) => (\n <span key={`${String(index)}-${row.lineNumber}`} className={`flex gap-2 ${ROW_TONE[row.marker]}`}>\n <span className=\"shrink-0 text-right text-doom-faint\" style={{ width: `${String(gutter)}ch` }}>\n {row.lineNumber}\n </span>\n <span className=\"w-2 shrink-0\">{row.marker === ' ' ? '' : row.marker}</span>\n <SyntaxLine spans={spans?.[index]} text={row.content} className=\"min-w-0 whitespace-pre-wrap break-words\" />\n </span>\n ))}\n </>\n );\n}\n\n/**\n * The edit tool's timeline item: `path · N ranges` in the header; the display\n * diff from the result's details, banded by row, in the body. A successful\n * edit whose details never arrived shows nothing, and a failed one shows the\n * tool's message in red.\n */\nexport function EditToolMessage({\n args,\n result,\n output,\n running,\n isError,\n fileTabFor,\n openTransientTab,\n}: ToolMessageRenderProps) {\n const call = editCallView(args);\n const view = result === null || isError ? undefined : editResultView(result);\n // The file this edit lands in, opened from the header rather than found\n // again in a file list; plain text when nothing installed can show it.\n const tab = fileTabFor(call.path);\n return (\n <MessageItem\n tone={toolTone({ running, isError })}\n expandable={view !== undefined && view.rows.length > COLLAPSED_ROWS}\n >\n {({ expanded }) => (\n <>\n <MessageItemHeader title=\"edit\">\n <span data-testid=\"tool-call-edit\" className=\"flex min-w-0 flex-1 items-center gap-2\">\n <ToolPathLink path={call.path} {...(tab === undefined ? {} : { onOpen: () => openTransientTab(tab) })} />\n <span className=\"shrink-0 text-doom-faint\">· {call.ranges}</span>\n </span>\n </MessageItemHeader>\n {isError ? (\n <MessageItemBody data-testid=\"tool-result-edit\" className=\"flex flex-col\">\n <MessageItemStatus tone=\"error\">failed</MessageItemStatus>\n {resultTextLines(result, output).map((line, index) => (\n <span key={`${String(index)}-${line}`} className=\"whitespace-pre-wrap break-words text-doom-red\">\n {line}\n </span>\n ))}\n </MessageItemBody>\n ) : view === undefined ? (\n running ? (\n <MessageItemBody data-testid=\"tool-result-edit\">\n <MessageItemStatus tone=\"running\">running</MessageItemStatus>\n </MessageItemBody>\n ) : null\n ) : (\n (() => {\n const { shown, hidden } = collapseLines(view.rows, COLLAPSED_ROWS, expanded);\n return (\n <MessageItemBody data-testid=\"tool-result-edit\" className=\"flex flex-col font-mono\">\n <DiffRows rows={shown} gutter={view.gutter} path={call.path} />\n {hidden > 0 ? (\n <MessageItemStatus expands className=\"pt-1\">\n {hidden} more rows\n </MessageItemStatus>\n ) : null}\n </MessageItemBody>\n );\n })()\n )}\n </>\n )}\n </MessageItem>\n );\n}\n","import { defineToolRenderer } from '@agimon-ai/doompi-core/web';\n\nimport { EditToolMessage } from './_components/EditToolMessage';\n\nexport default defineToolRenderer({ message: EditToolMessage });\n","// Generated by @agimon-ai/doompi-build. Do not edit by hand.\nimport { defineWebPlugin, type WebPluginContributions } from '@agimon-ai/doompi-core/web';\n\nimport toolEdit from '../src/extensions/workspaces/sessions/(frontend)/tool/edit.web';\n\nconst via = <T>(identity: Record<string, unknown>, value: unknown): T => ({ ...identity, ...(value as object) }) as T;\n\nexport const webPlugin = defineWebPlugin({\n id: 'edit',\n session: {\n get toolRenderers(): WebPluginContributions['toolRenderers'] { return [via({ tools: ['edit'] }, toolEdit)]; },\n },\n});\n"],"mappings":"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"}
package/dist/index.cjs DELETED
@@ -1,8 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_editTool = require("./src/schemas/editTool.cjs");
3
- const require_index = require("./src/services/editTool/index.cjs");
4
- exports.EditParamsSchema = require_editTool.EditParamsSchema;
5
- exports.HashlineRangeSchema = require_editTool.HashlineRangeSchema;
6
- exports.createHashlineEditTool = require_index.createHashlineEditTool;
7
- exports.createHeadlessEditTool = require_index.createHeadlessEditTool;
8
- exports.executeHashlineEdit = require_index.executeHashlineEdit;
package/dist/index.d.cts DELETED
@@ -1,3 +0,0 @@
1
- import { EditParams, EditParamsSchema, HashlineRange, HashlineRangeSchema } from "./src/schemas/editTool.cjs";
2
- import { createHashlineEditTool, createHeadlessEditTool, executeHashlineEdit } from "./src/services/editTool/index.cjs";
3
- export { type EditParams, EditParamsSchema, type HashlineRange, HashlineRangeSchema, createHashlineEditTool, createHeadlessEditTool, executeHashlineEdit };
package/dist/index.d.mts DELETED
@@ -1,3 +0,0 @@
1
- import { EditParams, EditParamsSchema, HashlineRange, HashlineRangeSchema } from "./src/schemas/editTool.mjs";
2
- import { createHashlineEditTool, createHeadlessEditTool, executeHashlineEdit } from "./src/services/editTool/index.mjs";
3
- export { type EditParams, EditParamsSchema, type HashlineRange, HashlineRangeSchema, createHashlineEditTool, createHeadlessEditTool, executeHashlineEdit };
package/dist/index.mjs DELETED
@@ -1,3 +0,0 @@
1
- import { EditParamsSchema, HashlineRangeSchema } from "./src/schemas/editTool.mjs";
2
- import { createHashlineEditTool, createHeadlessEditTool, executeHashlineEdit } from "./src/services/editTool/index.mjs";
3
- export { EditParamsSchema, HashlineRangeSchema, createHashlineEditTool, createHeadlessEditTool, executeHashlineEdit };
@@ -1,7 +0,0 @@
1
- const require_index = require("../../../../../services/editTool/index.cjs");
2
- //#region src/extensions/workspaces/sessions/(backend)/tool/edit.cli.ts
3
- var edit_cli_default = (0, require("@agimon-ai/doompi-core/pi-extension").definePiTool)(require_index.createHashlineEditTool(), { overrides: true });
4
- //#endregion
5
- exports.default = edit_cli_default;
6
-
7
- //# sourceMappingURL=edit.cli.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"edit.cli.cjs","names":["definePiTool","createHashlineEditTool"],"sources":["../../../../../../../src/extensions/workspaces/sessions/(backend)/tool/edit.cli.ts"],"sourcesContent":["import { definePiTool } from '@agimon-ai/doompi-core/pi-extension';\n\nimport { createHashlineEditTool } from '../../../../../services/editTool';\n\nexport default definePiTool(createHashlineEditTool(), { overrides: true });\n"],"mappings":";;AAIA,IAAA,oBAAA,gDAAeA,CAAAA,CAAAA,aAAAA,CAAaC,cAAAA,uBAAuB,GAAG,EAAE,WAAW,KAAK,CAAC"}
@@ -1,8 +0,0 @@
1
- import { createHashlineEditTool } from "../../../../../services/editTool/index.mjs";
2
- import { definePiTool } from "@agimon-ai/doompi-core/pi-extension";
3
- //#region src/extensions/workspaces/sessions/(backend)/tool/edit.cli.ts
4
- var edit_cli_default = definePiTool(createHashlineEditTool(), { overrides: true });
5
- //#endregion
6
- export { edit_cli_default as default };
7
-
8
- //# sourceMappingURL=edit.cli.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"edit.cli.mjs","names":[],"sources":["../../../../../../../src/extensions/workspaces/sessions/(backend)/tool/edit.cli.ts"],"sourcesContent":["import { definePiTool } from '@agimon-ai/doompi-core/pi-extension';\n\nimport { createHashlineEditTool } from '../../../../../services/editTool';\n\nexport default definePiTool(createHashlineEditTool(), { overrides: true });\n"],"mappings":";;;AAIA,IAAA,mBAAe,aAAa,uBAAuB,GAAG,EAAE,WAAW,KAAK,CAAC"}
@@ -1,7 +0,0 @@
1
- const require_index = require("../../../../../services/editTool/index.cjs");
2
- //#region src/extensions/workspaces/sessions/(backend)/tool/edit.server.ts
3
- var edit_server_default = (0, require("@agimon-ai/doompi-core/extension-file").defineServerTool)(require_index.createHeadlessEditTool);
4
- //#endregion
5
- exports.default = edit_server_default;
6
-
7
- //# sourceMappingURL=edit.server.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"edit.server.cjs","names":["defineServerTool","createHeadlessEditTool"],"sources":["../../../../../../../src/extensions/workspaces/sessions/(backend)/tool/edit.server.ts"],"sourcesContent":["import { defineServerTool } from '@agimon-ai/doompi-core/extension-file';\n\nimport { createHeadlessEditTool } from '../../../../../services/editTool';\n\nexport default defineServerTool(createHeadlessEditTool);\n"],"mappings":";;AAIA,IAAA,uBAAA,kDAAeA,CAAAA,CAAAA,iBAAAA,CAAiBC,cAAAA,sBAAsB"}
@@ -1,8 +0,0 @@
1
- import { createHeadlessEditTool } from "../../../../../services/editTool/index.mjs";
2
- import { defineServerTool } from "@agimon-ai/doompi-core/extension-file";
3
- //#region src/extensions/workspaces/sessions/(backend)/tool/edit.server.ts
4
- var edit_server_default = defineServerTool(createHeadlessEditTool);
5
- //#endregion
6
- export { edit_server_default as default };
7
-
8
- //# sourceMappingURL=edit.server.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"edit.server.mjs","names":[],"sources":["../../../../../../../src/extensions/workspaces/sessions/(backend)/tool/edit.server.ts"],"sourcesContent":["import { defineServerTool } from '@agimon-ai/doompi-core/extension-file';\n\nimport { createHeadlessEditTool } from '../../../../../services/editTool';\n\nexport default defineServerTool(createHeadlessEditTool);\n"],"mappings":";;;AAIA,IAAA,sBAAe,iBAAiB,sBAAsB"}
@@ -1,18 +0,0 @@
1
- let _agimon_ai_doompi_ui_hashlineRendering = require("@agimon-ai/doompi-ui/hashlineRendering");
2
- //#region src/extensions/workspaces/sessions/(frontend)/tool/_lib/editRenderer.cli.ts
3
- const editRenderer = {
4
- renderShell: "self",
5
- renderCall(args, theme) {
6
- const input = args;
7
- const count = input.edits.length;
8
- return (0, _agimon_ai_doompi_ui_hashlineRendering.renderHashlineCall)("edit", input.path, [`${count} ${count === 1 ? "range" : "ranges"}`], theme);
9
- },
10
- renderResult(result, options, theme, context) {
11
- const input = context.args;
12
- return (0, _agimon_ai_doompi_ui_hashlineRendering.renderHashlineEditResult)(input.path, result, options, theme, context);
13
- }
14
- };
15
- //#endregion
16
- exports.editRenderer = editRenderer;
17
-
18
- //# sourceMappingURL=editRenderer.cli.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"editRenderer.cli.cjs","names":["renderHashlineCall","renderHashlineEditResult"],"sources":["../../../../../../../../src/extensions/workspaces/sessions/(frontend)/tool/_lib/editRenderer.cli.ts"],"sourcesContent":["import type { PiToolRenderers } from '@agimon-ai/doompi-core/pi-extension';\nimport { renderHashlineCall, renderHashlineEditResult } from '@agimon-ai/doompi-ui/hashlineRendering';\n\nimport { EditParamsSchema, type EditParams } from '../../../../../../schemas/editTool';\n\nexport const editRenderer: PiToolRenderers<typeof EditParamsSchema> = {\n renderShell: 'self',\n renderCall(args, theme) {\n const input = args as EditParams;\n const count = input.edits.length;\n return renderHashlineCall('edit', input.path, [`${count} ${count === 1 ? 'range' : 'ranges'}`], theme);\n },\n renderResult(result, options, theme, context) {\n const input = context.args as EditParams;\n return renderHashlineEditResult(input.path, result, options, theme, context);\n },\n};\n"],"mappings":";;AAKA,MAAa,eAAyD;CACpE,aAAa;CACb,WAAW,MAAM,OAAO;EACtB,MAAM,QAAQ;EACd,MAAM,QAAQ,MAAM,MAAM;EAC1B,QAAA,GAAOA,uCAAAA,mBAAAA,CAAmB,QAAQ,MAAM,MAAM,CAAC,GAAG,MAAM,GAAG,UAAU,IAAI,UAAU,UAAU,GAAG,KAAK;CACvG;CACA,aAAa,QAAQ,SAAS,OAAO,SAAS;EAC5C,MAAM,QAAQ,QAAQ;EACtB,QAAA,GAAOC,uCAAAA,yBAAAA,CAAyB,MAAM,MAAM,QAAQ,SAAS,OAAO,OAAO;CAC7E;AACF"}
@@ -1,18 +0,0 @@
1
- import { renderHashlineCall, renderHashlineEditResult } from "@agimon-ai/doompi-ui/hashlineRendering";
2
- //#region src/extensions/workspaces/sessions/(frontend)/tool/_lib/editRenderer.cli.ts
3
- const editRenderer = {
4
- renderShell: "self",
5
- renderCall(args, theme) {
6
- const input = args;
7
- const count = input.edits.length;
8
- return renderHashlineCall("edit", input.path, [`${count} ${count === 1 ? "range" : "ranges"}`], theme);
9
- },
10
- renderResult(result, options, theme, context) {
11
- const input = context.args;
12
- return renderHashlineEditResult(input.path, result, options, theme, context);
13
- }
14
- };
15
- //#endregion
16
- export { editRenderer };
17
-
18
- //# sourceMappingURL=editRenderer.cli.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"editRenderer.cli.mjs","names":[],"sources":["../../../../../../../../src/extensions/workspaces/sessions/(frontend)/tool/_lib/editRenderer.cli.ts"],"sourcesContent":["import type { PiToolRenderers } from '@agimon-ai/doompi-core/pi-extension';\nimport { renderHashlineCall, renderHashlineEditResult } from '@agimon-ai/doompi-ui/hashlineRendering';\n\nimport { EditParamsSchema, type EditParams } from '../../../../../../schemas/editTool';\n\nexport const editRenderer: PiToolRenderers<typeof EditParamsSchema> = {\n renderShell: 'self',\n renderCall(args, theme) {\n const input = args as EditParams;\n const count = input.edits.length;\n return renderHashlineCall('edit', input.path, [`${count} ${count === 1 ? 'range' : 'ranges'}`], theme);\n },\n renderResult(result, options, theme, context) {\n const input = context.args as EditParams;\n return renderHashlineEditResult(input.path, result, options, theme, context);\n },\n};\n"],"mappings":";;AAKA,MAAa,eAAyD;CACpE,aAAa;CACb,WAAW,MAAM,OAAO;EACtB,MAAM,QAAQ;EACd,MAAM,QAAQ,MAAM,MAAM;EAC1B,OAAO,mBAAmB,QAAQ,MAAM,MAAM,CAAC,GAAG,MAAM,GAAG,UAAU,IAAI,UAAU,UAAU,GAAG,KAAK;CACvG;CACA,aAAa,QAAQ,SAAS,OAAO,SAAS;EAC5C,MAAM,QAAQ,QAAQ;EACtB,OAAO,yBAAyB,MAAM,MAAM,QAAQ,SAAS,OAAO,OAAO;CAC7E;AACF"}
@@ -1,7 +0,0 @@
1
- const require_editRenderer_cli = require("./_lib/editRenderer.cli.cjs");
2
- //#region src/extensions/workspaces/sessions/(frontend)/tool/edit.cli.ts
3
- var edit_cli_default = (0, require("@agimon-ai/doompi-core/pi-extension").definePiToolRenderer)(require_editRenderer_cli.editRenderer);
4
- //#endregion
5
- exports.default = edit_cli_default;
6
-
7
- //# sourceMappingURL=edit.cli.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"edit.cli.cjs","names":["definePiToolRenderer","editRenderer"],"sources":["../../../../../../../src/extensions/workspaces/sessions/(frontend)/tool/edit.cli.ts"],"sourcesContent":["import { definePiToolRenderer } from '@agimon-ai/doompi-core/pi-extension';\n\nimport { editRenderer } from './_lib/editRenderer.cli';\n\nexport default definePiToolRenderer(editRenderer);\n"],"mappings":";;AAIA,IAAA,oBAAA,gDAAeA,CAAAA,CAAAA,qBAAAA,CAAqBC,yBAAAA,YAAY"}
@@ -1,8 +0,0 @@
1
- import { editRenderer } from "./_lib/editRenderer.cli.mjs";
2
- import { definePiToolRenderer } from "@agimon-ai/doompi-core/pi-extension";
3
- //#region src/extensions/workspaces/sessions/(frontend)/tool/edit.cli.ts
4
- var edit_cli_default = definePiToolRenderer(editRenderer);
5
- //#endregion
6
- export { edit_cli_default as default };
7
-
8
- //# sourceMappingURL=edit.cli.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"edit.cli.mjs","names":[],"sources":["../../../../../../../src/extensions/workspaces/sessions/(frontend)/tool/edit.cli.ts"],"sourcesContent":["import { definePiToolRenderer } from '@agimon-ai/doompi-core/pi-extension';\n\nimport { editRenderer } from './_lib/editRenderer.cli';\n\nexport default definePiToolRenderer(editRenderer);\n"],"mappings":";;;AAIA,IAAA,mBAAe,qBAAqB,YAAY"}
@@ -1,13 +0,0 @@
1
- //#region src/schemas/apiContracts.ts
2
- /** This facet contributes agent tools, commands or lifecycle only, with no separate HTTP or socket surface. */
3
- const apiContracts = (0, require("@agimon-ai/doompi-core/api-contracts").defineApiContract)({
4
- version: 1,
5
- http: [],
6
- sockets: [],
7
- dynamic: []
8
- });
9
- //#endregion
10
- exports.apiContracts = apiContracts;
11
- exports.default = apiContracts;
12
-
13
- //# sourceMappingURL=apiContracts.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"apiContracts.cjs","names":["defineApiContract"],"sources":["../../../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract } from '@agimon-ai/doompi-core/api-contracts';\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,iDAAeA,CAAAA,CAAAA,kBAAAA,CAAkB;CAAE,SAAS;CAAG,MAAM,CAAC;CAAG,SAAS,CAAC;CAAG,SAAS,CAAC;AAAE,CAAC"}