apex-code 0.5.2 → 0.6.1

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 (99) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +41 -2
  3. package/dist/core/agent-session.d.ts +37 -0
  4. package/dist/core/agent-session.d.ts.map +1 -1
  5. package/dist/core/agent-session.js +264 -60
  6. package/dist/core/agent-session.js.map +1 -1
  7. package/dist/core/default-tool-names.d.ts +7 -0
  8. package/dist/core/default-tool-names.d.ts.map +1 -0
  9. package/dist/core/default-tool-names.js +14 -0
  10. package/dist/core/default-tool-names.js.map +1 -0
  11. package/dist/core/extensions/runner.d.ts.map +1 -1
  12. package/dist/core/extensions/runner.js +2 -0
  13. package/dist/core/extensions/runner.js.map +1 -1
  14. package/dist/core/extensions/types.d.ts +3 -0
  15. package/dist/core/extensions/types.d.ts.map +1 -1
  16. package/dist/core/extensions/types.js.map +1 -1
  17. package/dist/core/keybindings.d.ts +16 -1
  18. package/dist/core/keybindings.d.ts.map +1 -1
  19. package/dist/core/keybindings.js +7 -1
  20. package/dist/core/keybindings.js.map +1 -1
  21. package/dist/core/permissions/startup.d.ts +1 -1
  22. package/dist/core/permissions/startup.d.ts.map +1 -1
  23. package/dist/core/permissions/startup.js.map +1 -1
  24. package/dist/core/sdk.d.ts.map +1 -1
  25. package/dist/core/sdk.js +13 -9
  26. package/dist/core/sdk.js.map +1 -1
  27. package/dist/core/settings-manager.d.ts +4 -0
  28. package/dist/core/settings-manager.d.ts.map +1 -1
  29. package/dist/core/settings-manager.js +13 -0
  30. package/dist/core/settings-manager.js.map +1 -1
  31. package/dist/core/slash-commands.d.ts.map +1 -1
  32. package/dist/core/slash-commands.js +1 -0
  33. package/dist/core/slash-commands.js.map +1 -1
  34. package/dist/core/tools/contract.d.ts +1 -0
  35. package/dist/core/tools/contract.d.ts.map +1 -1
  36. package/dist/core/tools/contract.js.map +1 -1
  37. package/dist/core/tools/index.d.ts +1 -1
  38. package/dist/core/tools/index.d.ts.map +1 -1
  39. package/dist/core/tools/index.js.map +1 -1
  40. package/dist/core/tools/plan-present.d.ts +13 -12
  41. package/dist/core/tools/plan-present.d.ts.map +1 -1
  42. package/dist/core/tools/plan-present.js +32 -19
  43. package/dist/core/tools/plan-present.js.map +1 -1
  44. package/dist/core/tools/renderers/index.d.ts +1 -1
  45. package/dist/core/tools/renderers/index.d.ts.map +1 -1
  46. package/dist/core/tools/renderers/index.js +2 -0
  47. package/dist/core/tools/renderers/index.js.map +1 -1
  48. package/dist/core/tools/renderers/todo-write.d.ts +7 -0
  49. package/dist/core/tools/renderers/todo-write.d.ts.map +1 -0
  50. package/dist/core/tools/renderers/todo-write.js +58 -0
  51. package/dist/core/tools/renderers/todo-write.js.map +1 -0
  52. package/dist/index.d.ts +2 -2
  53. package/dist/index.d.ts.map +1 -1
  54. package/dist/index.js +1 -1
  55. package/dist/index.js.map +1 -1
  56. package/dist/modes/interactive/components/bash-execution.d.ts +13 -2
  57. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  58. package/dist/modes/interactive/components/bash-execution.js +56 -1
  59. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  60. package/dist/modes/interactive/components/error-summary.d.ts +2 -0
  61. package/dist/modes/interactive/components/error-summary.d.ts.map +1 -1
  62. package/dist/modes/interactive/components/error-summary.js +10 -0
  63. package/dist/modes/interactive/components/error-summary.js.map +1 -1
  64. package/dist/modes/interactive/components/first-use-hints.d.ts +1 -1
  65. package/dist/modes/interactive/components/first-use-hints.d.ts.map +1 -1
  66. package/dist/modes/interactive/components/first-use-hints.js +1 -0
  67. package/dist/modes/interactive/components/first-use-hints.js.map +1 -1
  68. package/dist/modes/interactive/components/footer.d.ts +6 -1
  69. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  70. package/dist/modes/interactive/components/footer.js +38 -11
  71. package/dist/modes/interactive/components/footer.js.map +1 -1
  72. package/dist/modes/interactive/components/settings-selector.d.ts +5 -0
  73. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  74. package/dist/modes/interactive/components/settings-selector.js +20 -1
  75. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  76. package/dist/modes/interactive/components/task-panel.d.ts +27 -0
  77. package/dist/modes/interactive/components/task-panel.d.ts.map +1 -0
  78. package/dist/modes/interactive/components/task-panel.js +92 -0
  79. package/dist/modes/interactive/components/task-panel.js.map +1 -0
  80. package/dist/modes/interactive/components/tool-execution.d.ts +9 -1
  81. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  82. package/dist/modes/interactive/components/tool-execution.js +81 -8
  83. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  84. package/dist/modes/interactive/components/tool-panel.d.ts +7 -0
  85. package/dist/modes/interactive/components/tool-panel.d.ts.map +1 -1
  86. package/dist/modes/interactive/components/tool-panel.js +35 -0
  87. package/dist/modes/interactive/components/tool-panel.js.map +1 -1
  88. package/dist/modes/interactive/components/turn-summary.d.ts +6 -0
  89. package/dist/modes/interactive/components/turn-summary.d.ts.map +1 -0
  90. package/dist/modes/interactive/components/turn-summary.js +12 -0
  91. package/dist/modes/interactive/components/turn-summary.js.map +1 -0
  92. package/dist/modes/interactive/interactive-mode.d.ts +10 -0
  93. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  94. package/dist/modes/interactive/interactive-mode.js +191 -22
  95. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  96. package/docs/keybindings.md +21 -2
  97. package/docs/settings.md +8 -0
  98. package/npm-shrinkwrap.json +5 -5
  99. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"plan-present.js","sourceRoot":"","sources":["../../../src/core/tools/plan-present.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,IAAI,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAElE,MAAM,iBAAiB,GAAG,IAAI,CAAC,MAAM,CAAC;IACrC,IAAI,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C,oBAAoB,EAAE,IAAI,CAAC,CAAC;YAClE,OAAO;gBACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,oBAAoB,EAAE,CAAC;gBACrF,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;aAC3B,CAAC;QAAA,CACF;KACD,CAAC;AAAA,CACF;AAED,MAAM,UAAU,qBAAqB,GAAG;IACvC,OAAO,kBAAkB,CAAC,+BAA+B,EAAE,CAAC,CAAC;AAAA,CAC7D","sourcesContent":["import type { AgentToolResult } from \"apex-code-agent-core\";\nimport { type Static, Type } from \"typebox\";\nimport type { ApexToolDefinition, EvidenceRecord } from \"./contract.ts\";\nimport { wrapToolDefinition } from \"./tool-definition-wrapper.ts\";\n\nconst planPresentSchema = Type.Object({\n\tplan: Type.String({ description: \"The plan to present to the user, in markdown.\" }),\n});\n\nexport type PlanPresentInput = Static<typeof planPresentSchema>;\n\nexport interface PlanPresentDetails {\n\tplan: string;\n\tapproved: boolean;\n}\n\n/**\n * The tool by which an agent presents its plan for approval, closing the gap the\n * spec names: plan mode can deny mutation but had no tool to leave it through.\n * `deferSchema: false` matches the default four tools' exclusion reasoning -- this\n * is called on nearly every plan-mode turn, so deferring would trade a one-time\n * prefix saving for a recurring round trip.\n *\n * Deliberately does not itself change the permission mode: no such seam exists for\n * tools or extensions today (only the CLI/TUI can), so this tool's job ends at\n * reporting the user's approve/reject decision for the harness to act on.\n */\nexport function createPlanPresentToolDefinition(): ApexToolDefinition<typeof planPresentSchema, PlanPresentDetails> {\n\treturn {\n\t\tname: \"plan_present\",\n\t\tlabel: \"plan_present\",\n\t\tdescription: \"Present a plan to the user for approval before acting on it.\",\n\t\tparameters: planPresentSchema,\n\t\tcontract: {\n\t\t\tcapabilities: new Set([\"ui\"]),\n\t\t\tpermission: {\n\t\t\t\tdefaultBehavior: \"allow\",\n\t\t\t\tmatches: () => false,\n\t\t\t\tdescribe: () => \"Presenting a plan for approval\",\n\t\t\t\truleForCall: () => null,\n\t\t\t},\n\t\t\tcontext: { resultRecoverable: false, deferSchema: false },\n\t\t\tevidence: {\n\t\t\t\temits: new Set([\"workflow\"]),\n\t\t\t\tcapture: (params, result): EvidenceRecord[] => {\n\t\t\t\t\tconst details = result.details as PlanPresentDetails | undefined;\n\t\t\t\t\treturn [{ kind: \"workflow\", plan: params.plan, approved: details?.approved ?? false }];\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tasync execute(\n\t\t\t_toolCallId,\n\t\t\t{ plan }: PlanPresentInput,\n\t\t\t_signal,\n\t\t\t_onUpdate,\n\t\t\tctx,\n\t\t): Promise<AgentToolResult<PlanPresentDetails>> {\n\t\t\tif (!ctx?.hasUI) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"plan_present requires interactive UI, which is not available in this session (headless mode).\",\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst approved = await ctx.ui.confirm(\"Approve this plan?\", plan);\n\t\t\treturn {\n\t\t\t\tcontent: [{ type: \"text\", text: approved ? \"Plan approved.\" : \"Plan not approved.\" }],\n\t\t\t\tdetails: { plan, approved },\n\t\t\t};\n\t\t},\n\t};\n}\n\nexport function createPlanPresentTool() {\n\treturn wrapToolDefinition(createPlanPresentToolDefinition());\n}\n"]}
1
+ {"version":3,"file":"plan-present.js","sourceRoot":"","sources":["../../../src/core/tools/plan-present.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,IAAI,EAAE,MAAM,SAAS,CAAC;AAG5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAElE,MAAM,sBAAsB,GAAG,8DAA8D,CAAC;AAE9F,MAAM,iBAAiB,GAAG,IAAI,CAAC,MAAM,CAAC;IACrC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,+CAA+C,EAAE,CAAC;CACnF,CAAC,CAAC;AAUH,MAAM,CAAC,MAAM,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;AAAA,CAC7D","sourcesContent":["import type { AgentToolResult } from \"apex-code-agent-core\";\nimport { type Static, Type } from \"typebox\";\nimport type { ExtensionContext } from \"../extensions/types.ts\";\nimport type { ApexToolDefinition, EvidenceRecord } from \"./contract.ts\";\nimport { wrapToolDefinition } from \"./tool-definition-wrapper.ts\";\n\nconst planPresentDescription = \"Present a plan to the user for approval before acting on it.\";\n\nconst planPresentSchema = Type.Object({\n\tplan: Type.String({ description: \"The plan to present to the user, in markdown.\" }),\n});\n\nexport type PlanPresentInput = Static<typeof planPresentSchema>;\n\nexport type PlanDecision = { approved: true; nextMode: \"acceptEdits\" | \"default\" } | { approved: false };\n\nexport interface PlanPresenter {\n\tpresent(plan: string, ctx: ExtensionContext, signal?: AbortSignal): Promise<PlanDecision>;\n}\n\nexport const defaultPlanPresenter: PlanPresenter = {\n\tasync present(plan, ctx, signal) {\n\t\tif (!ctx.hasUI)\n\t\t\tthrow new Error(\n\t\t\t\t\"plan_present requires interactive UI, which is not available in this session (headless mode).\",\n\t\t\t);\n\t\tctx.ui.notify(plan, \"info\");\n\t\tconst choice = await ctx.ui.select(\n\t\t\t\"Approve this plan?\",\n\t\t\t[\"Yes, and accept edits\", \"Yes, and ask before each edit\", \"No, keep planning\"],\n\t\t\t{ signal },\n\t\t);\n\t\tif (choice === \"Yes, and accept edits\") return { approved: true, nextMode: \"acceptEdits\" };\n\t\tif (choice === \"Yes, and ask before each edit\") return { approved: true, nextMode: \"default\" };\n\t\treturn { approved: false };\n\t},\n};\n\nexport interface PlanPresentDetails {\n\tplan: string;\n\tapproved: boolean;\n\tnextMode?: \"acceptEdits\" | \"default\";\n}\n\nexport function createPlanPresentToolDefinition(\n\tpresenter: PlanPresenter = defaultPlanPresenter,\n): ApexToolDefinition<typeof planPresentSchema, PlanPresentDetails> {\n\treturn {\n\t\tname: \"plan_present\",\n\t\tlabel: \"plan_present\",\n\t\tdescription: planPresentDescription,\n\t\tpromptSnippet: planPresentDescription,\n\t\tparameters: planPresentSchema,\n\t\tcontract: {\n\t\t\tcapabilities: new Set([\"ui\"]),\n\t\t\tpermission: {\n\t\t\t\tdefaultBehavior: \"allow\",\n\t\t\t\tmatches: () => false,\n\t\t\t\tdescribe: () => \"Presenting a plan for approval\",\n\t\t\t\truleForCall: () => null,\n\t\t\t},\n\t\t\tcontext: { resultRecoverable: false, deferSchema: false },\n\t\t\tevidence: {\n\t\t\t\temits: new Set([\"workflow\"]),\n\t\t\t\tcapture: (params, result): EvidenceRecord[] => {\n\t\t\t\t\tconst details = result.details as PlanPresentDetails | undefined;\n\t\t\t\t\treturn [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tkind: \"workflow\",\n\t\t\t\t\t\t\tplan: params.plan,\n\t\t\t\t\t\t\tapproved: details?.approved ?? false,\n\t\t\t\t\t\t\t...(details?.nextMode ? { nextMode: details.nextMode } : {}),\n\t\t\t\t\t\t},\n\t\t\t\t\t];\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tasync execute(\n\t\t\t_toolCallId,\n\t\t\t{ plan }: PlanPresentInput,\n\t\t\tsignal,\n\t\t\t_onUpdate,\n\t\t\tctx,\n\t\t): Promise<AgentToolResult<PlanPresentDetails>> {\n\t\t\tif (!ctx)\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"plan_present requires interactive UI, which is not available in this session (headless mode).\",\n\t\t\t\t);\n\t\t\tsignal?.throwIfAborted();\n\t\t\tconst decision = await presenter.present(plan, ctx, signal);\n\t\t\tsignal?.throwIfAborted();\n\t\t\tconst { approved } = decision;\n\t\t\treturn {\n\t\t\t\tcontent: [{ type: \"text\", text: approved ? \"Plan approved.\" : \"Plan not approved.\" }],\n\t\t\t\tdetails: { plan, ...decision },\n\t\t\t};\n\t\t},\n\t};\n}\n\nexport function createPlanPresentTool() {\n\treturn wrapToolDefinition(createPlanPresentToolDefinition());\n}\n"]}
@@ -21,7 +21,7 @@ export { createShellRenderers, editRenderers, findRenderers, grepRenderers, lsRe
21
21
  * (ask_user, delegate, and others), and those render through the generic fallback, so this is a
22
22
  * subset of `ToolName` rather than all of it.
23
23
  */
24
- export type RenderedToolName = Extract<ToolName, "read" | "bash" | "powershell" | "edit" | "write" | "grep" | "find" | "ls">;
24
+ export type RenderedToolName = Extract<ToolName, "read" | "bash" | "powershell" | "edit" | "write" | "grep" | "find" | "ls" | "todo_write">;
25
25
  /** Renderers for every built-in tool that has one, keyed by tool name. */
26
26
  export declare function createAllToolRenderers(): Record<RenderedToolName, ToolRenderers>;
27
27
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/tools/renderers/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,YAAY,GAAG,cAAc,CAAC,CAAC;AAE1F,OAAO,EACN,oBAAoB,EACpB,aAAa,EACb,aAAa,EACb,aAAa,EACb,WAAW,EACX,aAAa,EACb,cAAc,GACd,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,CACrC,QAAQ,EACR,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAC1E,CAAC;AAEF,0EAA0E;AAC1E,wBAAgB,sBAAsB,IAAI,MAAM,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAWhF;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,SAAS,aAAa,EACrE,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,WAAW,GAAG,SAAS,GACjC,WAAW,GAAG,aAAa,GAAG,SAAS,CASzC","sourcesContent":["/**\n * Built-in tool renderers, without the tools themselves.\n *\n * A presentation displays tool calls and results; it does not execute them and does not need their\n * typebox parameter schemas. Importing this instead of `core/tools/index.ts` keeps ~17 MB of module\n * graph out of a process that only renders.\n */\n\nimport type { ToolDefinition } from \"../../extensions/types.ts\";\nimport type { ToolName } from \"../index.ts\";\nimport { createShellRenderers } from \"./bash.ts\";\nimport { editRenderers } from \"./edit.ts\";\nimport { findRenderers } from \"./find.ts\";\nimport { grepRenderers } from \"./grep.ts\";\nimport { lsRenderers } from \"./ls.ts\";\nimport { readRenderers } from \"./read.ts\";\nimport { writeRenderers } from \"./write.ts\";\n\nexport type ToolRenderers = Pick<ToolDefinition<any, any>, \"renderCall\" | \"renderResult\">;\n\nexport {\n\tcreateShellRenderers,\n\teditRenderers,\n\tfindRenderers,\n\tgrepRenderers,\n\tlsRenderers,\n\treadRenderers,\n\twriteRenderers,\n};\n\n/**\n * The built-in tools that ship a renderer. Apex registers more built-in tools than upstream\n * (ask_user, delegate, and others), and those render through the generic fallback, so this is a\n * subset of `ToolName` rather than all of it.\n */\nexport type RenderedToolName = Extract<\n\tToolName,\n\t\"read\" | \"bash\" | \"powershell\" | \"edit\" | \"write\" | \"grep\" | \"find\" | \"ls\"\n>;\n\n/** Renderers for every built-in tool that has one, keyed by tool name. */\nexport function createAllToolRenderers(): Record<RenderedToolName, ToolRenderers> {\n\treturn {\n\t\tread: readRenderers,\n\t\tbash: createShellRenderers(\"$\"),\n\t\tpowershell: createShellRenderers(\"PS>\"),\n\t\tedit: editRenderers,\n\t\twrite: writeRenderers,\n\t\tgrep: grepRenderers,\n\t\tfind: findRenderers,\n\t\tls: lsRenderers,\n\t};\n}\n\n/**\n * Merge built-in renderers into a tool definition that does not supply its own.\n *\n * `ToolExecutionComponent` used to do this lookup itself, which forced every presentation to import\n * the tool implementations. Callers do it now, so a process that renders can import renderers alone.\n */\nexport function withBuiltInRenderers<TDefinition extends ToolRenderers>(\n\ttoolName: string,\n\tdefinition: TDefinition | undefined,\n): TDefinition | ToolRenderers | undefined {\n\tconst builtIn: ToolRenderers | undefined = createAllToolRenderers()[toolName as RenderedToolName];\n\tif (!definition) return builtIn;\n\tif (!builtIn) return definition;\n\treturn {\n\t\t...definition,\n\t\trenderCall: definition.renderCall ?? builtIn.renderCall,\n\t\trenderResult: definition.renderResult ?? builtIn.renderResult,\n\t};\n}\n"]}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/tools/renderers/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,YAAY,GAAG,cAAc,CAAC,CAAC;AAE1F,OAAO,EACN,oBAAoB,EACpB,aAAa,EACb,aAAa,EACb,aAAa,EACb,WAAW,EACX,aAAa,EACb,cAAc,GACd,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,CACrC,QAAQ,EACR,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,YAAY,CACzF,CAAC;AAEF,0EAA0E;AAC1E,wBAAgB,sBAAsB,IAAI,MAAM,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAYhF;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,SAAS,aAAa,EACrE,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,WAAW,GAAG,SAAS,GACjC,WAAW,GAAG,aAAa,GAAG,SAAS,CASzC","sourcesContent":["/**\n * Built-in tool renderers, without the tools themselves.\n *\n * A presentation displays tool calls and results; it does not execute them and does not need their\n * typebox parameter schemas. Importing this instead of `core/tools/index.ts` keeps ~17 MB of module\n * graph out of a process that only renders.\n */\n\nimport type { ToolDefinition } from \"../../extensions/types.ts\";\nimport type { ToolName } from \"../index.ts\";\nimport { createShellRenderers } from \"./bash.ts\";\nimport { editRenderers } from \"./edit.ts\";\nimport { findRenderers } from \"./find.ts\";\nimport { grepRenderers } from \"./grep.ts\";\nimport { lsRenderers } from \"./ls.ts\";\nimport { readRenderers } from \"./read.ts\";\nimport { todoWriteRenderers } from \"./todo-write.ts\";\nimport { writeRenderers } from \"./write.ts\";\n\nexport type ToolRenderers = Pick<ToolDefinition<any, any>, \"renderCall\" | \"renderResult\">;\n\nexport {\n\tcreateShellRenderers,\n\teditRenderers,\n\tfindRenderers,\n\tgrepRenderers,\n\tlsRenderers,\n\treadRenderers,\n\twriteRenderers,\n};\n\n/**\n * The built-in tools that ship a renderer. Apex registers more built-in tools than upstream\n * (ask_user, delegate, and others), and those render through the generic fallback, so this is a\n * subset of `ToolName` rather than all of it.\n */\nexport type RenderedToolName = Extract<\n\tToolName,\n\t\"read\" | \"bash\" | \"powershell\" | \"edit\" | \"write\" | \"grep\" | \"find\" | \"ls\" | \"todo_write\"\n>;\n\n/** Renderers for every built-in tool that has one, keyed by tool name. */\nexport function createAllToolRenderers(): Record<RenderedToolName, ToolRenderers> {\n\treturn {\n\t\tread: readRenderers,\n\t\tbash: createShellRenderers(\"$\"),\n\t\tpowershell: createShellRenderers(\"PS>\"),\n\t\tedit: editRenderers,\n\t\twrite: writeRenderers,\n\t\tgrep: grepRenderers,\n\t\tfind: findRenderers,\n\t\tls: lsRenderers,\n\t\ttodo_write: todoWriteRenderers,\n\t};\n}\n\n/**\n * Merge built-in renderers into a tool definition that does not supply its own.\n *\n * `ToolExecutionComponent` used to do this lookup itself, which forced every presentation to import\n * the tool implementations. Callers do it now, so a process that renders can import renderers alone.\n */\nexport function withBuiltInRenderers<TDefinition extends ToolRenderers>(\n\ttoolName: string,\n\tdefinition: TDefinition | undefined,\n): TDefinition | ToolRenderers | undefined {\n\tconst builtIn: ToolRenderers | undefined = createAllToolRenderers()[toolName as RenderedToolName];\n\tif (!definition) return builtIn;\n\tif (!builtIn) return definition;\n\treturn {\n\t\t...definition,\n\t\trenderCall: definition.renderCall ?? builtIn.renderCall,\n\t\trenderResult: definition.renderResult ?? builtIn.renderResult,\n\t};\n}\n"]}
@@ -11,6 +11,7 @@ import { findRenderers } from "./find.js";
11
11
  import { grepRenderers } from "./grep.js";
12
12
  import { lsRenderers } from "./ls.js";
13
13
  import { readRenderers } from "./read.js";
14
+ import { todoWriteRenderers } from "./todo-write.js";
14
15
  import { writeRenderers } from "./write.js";
15
16
  export { createShellRenderers, editRenderers, findRenderers, grepRenderers, lsRenderers, readRenderers, writeRenderers, };
16
17
  /** Renderers for every built-in tool that has one, keyed by tool name. */
@@ -24,6 +25,7 @@ export function createAllToolRenderers() {
24
25
  grep: grepRenderers,
25
26
  find: findRenderers,
26
27
  ls: lsRenderers,
28
+ todo_write: todoWriteRenderers,
27
29
  };
28
30
  }
29
31
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/tools/renderers/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAI5C,OAAO,EACN,oBAAoB,EACpB,aAAa,EACb,aAAa,EACb,aAAa,EACb,WAAW,EACX,aAAa,EACb,cAAc,GACd,CAAC;AAYF,0EAA0E;AAC1E,MAAM,UAAU,sBAAsB,GAA4C;IACjF,OAAO;QACN,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,oBAAoB,CAAC,GAAG,CAAC;QAC/B,UAAU,EAAE,oBAAoB,CAAC,KAAK,CAAC;QACvC,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,cAAc;QACrB,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,aAAa;QACnB,EAAE,EAAE,WAAW;KACf,CAAC;AAAA,CACF;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CACnC,QAAgB,EAChB,UAAmC,EACO;IAC1C,MAAM,OAAO,GAA8B,sBAAsB,EAAE,CAAC,QAA4B,CAAC,CAAC;IAClG,IAAI,CAAC,UAAU;QAAE,OAAO,OAAO,CAAC;IAChC,IAAI,CAAC,OAAO;QAAE,OAAO,UAAU,CAAC;IAChC,OAAO;QACN,GAAG,UAAU;QACb,UAAU,EAAE,UAAU,CAAC,UAAU,IAAI,OAAO,CAAC,UAAU;QACvD,YAAY,EAAE,UAAU,CAAC,YAAY,IAAI,OAAO,CAAC,YAAY;KAC7D,CAAC;AAAA,CACF","sourcesContent":["/**\n * Built-in tool renderers, without the tools themselves.\n *\n * A presentation displays tool calls and results; it does not execute them and does not need their\n * typebox parameter schemas. Importing this instead of `core/tools/index.ts` keeps ~17 MB of module\n * graph out of a process that only renders.\n */\n\nimport type { ToolDefinition } from \"../../extensions/types.ts\";\nimport type { ToolName } from \"../index.ts\";\nimport { createShellRenderers } from \"./bash.ts\";\nimport { editRenderers } from \"./edit.ts\";\nimport { findRenderers } from \"./find.ts\";\nimport { grepRenderers } from \"./grep.ts\";\nimport { lsRenderers } from \"./ls.ts\";\nimport { readRenderers } from \"./read.ts\";\nimport { writeRenderers } from \"./write.ts\";\n\nexport type ToolRenderers = Pick<ToolDefinition<any, any>, \"renderCall\" | \"renderResult\">;\n\nexport {\n\tcreateShellRenderers,\n\teditRenderers,\n\tfindRenderers,\n\tgrepRenderers,\n\tlsRenderers,\n\treadRenderers,\n\twriteRenderers,\n};\n\n/**\n * The built-in tools that ship a renderer. Apex registers more built-in tools than upstream\n * (ask_user, delegate, and others), and those render through the generic fallback, so this is a\n * subset of `ToolName` rather than all of it.\n */\nexport type RenderedToolName = Extract<\n\tToolName,\n\t\"read\" | \"bash\" | \"powershell\" | \"edit\" | \"write\" | \"grep\" | \"find\" | \"ls\"\n>;\n\n/** Renderers for every built-in tool that has one, keyed by tool name. */\nexport function createAllToolRenderers(): Record<RenderedToolName, ToolRenderers> {\n\treturn {\n\t\tread: readRenderers,\n\t\tbash: createShellRenderers(\"$\"),\n\t\tpowershell: createShellRenderers(\"PS>\"),\n\t\tedit: editRenderers,\n\t\twrite: writeRenderers,\n\t\tgrep: grepRenderers,\n\t\tfind: findRenderers,\n\t\tls: lsRenderers,\n\t};\n}\n\n/**\n * Merge built-in renderers into a tool definition that does not supply its own.\n *\n * `ToolExecutionComponent` used to do this lookup itself, which forced every presentation to import\n * the tool implementations. Callers do it now, so a process that renders can import renderers alone.\n */\nexport function withBuiltInRenderers<TDefinition extends ToolRenderers>(\n\ttoolName: string,\n\tdefinition: TDefinition | undefined,\n): TDefinition | ToolRenderers | undefined {\n\tconst builtIn: ToolRenderers | undefined = createAllToolRenderers()[toolName as RenderedToolName];\n\tif (!definition) return builtIn;\n\tif (!builtIn) return definition;\n\treturn {\n\t\t...definition,\n\t\trenderCall: definition.renderCall ?? builtIn.renderCall,\n\t\trenderResult: definition.renderResult ?? builtIn.renderResult,\n\t};\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/tools/renderers/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAI5C,OAAO,EACN,oBAAoB,EACpB,aAAa,EACb,aAAa,EACb,aAAa,EACb,WAAW,EACX,aAAa,EACb,cAAc,GACd,CAAC;AAYF,0EAA0E;AAC1E,MAAM,UAAU,sBAAsB,GAA4C;IACjF,OAAO;QACN,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,oBAAoB,CAAC,GAAG,CAAC;QAC/B,UAAU,EAAE,oBAAoB,CAAC,KAAK,CAAC;QACvC,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,cAAc;QACrB,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,aAAa;QACnB,EAAE,EAAE,WAAW;QACf,UAAU,EAAE,kBAAkB;KAC9B,CAAC;AAAA,CACF;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CACnC,QAAgB,EAChB,UAAmC,EACO;IAC1C,MAAM,OAAO,GAA8B,sBAAsB,EAAE,CAAC,QAA4B,CAAC,CAAC;IAClG,IAAI,CAAC,UAAU;QAAE,OAAO,OAAO,CAAC;IAChC,IAAI,CAAC,OAAO;QAAE,OAAO,UAAU,CAAC;IAChC,OAAO;QACN,GAAG,UAAU;QACb,UAAU,EAAE,UAAU,CAAC,UAAU,IAAI,OAAO,CAAC,UAAU;QACvD,YAAY,EAAE,UAAU,CAAC,YAAY,IAAI,OAAO,CAAC,YAAY;KAC7D,CAAC;AAAA,CACF","sourcesContent":["/**\n * Built-in tool renderers, without the tools themselves.\n *\n * A presentation displays tool calls and results; it does not execute them and does not need their\n * typebox parameter schemas. Importing this instead of `core/tools/index.ts` keeps ~17 MB of module\n * graph out of a process that only renders.\n */\n\nimport type { ToolDefinition } from \"../../extensions/types.ts\";\nimport type { ToolName } from \"../index.ts\";\nimport { createShellRenderers } from \"./bash.ts\";\nimport { editRenderers } from \"./edit.ts\";\nimport { findRenderers } from \"./find.ts\";\nimport { grepRenderers } from \"./grep.ts\";\nimport { lsRenderers } from \"./ls.ts\";\nimport { readRenderers } from \"./read.ts\";\nimport { todoWriteRenderers } from \"./todo-write.ts\";\nimport { writeRenderers } from \"./write.ts\";\n\nexport type ToolRenderers = Pick<ToolDefinition<any, any>, \"renderCall\" | \"renderResult\">;\n\nexport {\n\tcreateShellRenderers,\n\teditRenderers,\n\tfindRenderers,\n\tgrepRenderers,\n\tlsRenderers,\n\treadRenderers,\n\twriteRenderers,\n};\n\n/**\n * The built-in tools that ship a renderer. Apex registers more built-in tools than upstream\n * (ask_user, delegate, and others), and those render through the generic fallback, so this is a\n * subset of `ToolName` rather than all of it.\n */\nexport type RenderedToolName = Extract<\n\tToolName,\n\t\"read\" | \"bash\" | \"powershell\" | \"edit\" | \"write\" | \"grep\" | \"find\" | \"ls\" | \"todo_write\"\n>;\n\n/** Renderers for every built-in tool that has one, keyed by tool name. */\nexport function createAllToolRenderers(): Record<RenderedToolName, ToolRenderers> {\n\treturn {\n\t\tread: readRenderers,\n\t\tbash: createShellRenderers(\"$\"),\n\t\tpowershell: createShellRenderers(\"PS>\"),\n\t\tedit: editRenderers,\n\t\twrite: writeRenderers,\n\t\tgrep: grepRenderers,\n\t\tfind: findRenderers,\n\t\tls: lsRenderers,\n\t\ttodo_write: todoWriteRenderers,\n\t};\n}\n\n/**\n * Merge built-in renderers into a tool definition that does not supply its own.\n *\n * `ToolExecutionComponent` used to do this lookup itself, which forced every presentation to import\n * the tool implementations. Callers do it now, so a process that renders can import renderers alone.\n */\nexport function withBuiltInRenderers<TDefinition extends ToolRenderers>(\n\ttoolName: string,\n\tdefinition: TDefinition | undefined,\n): TDefinition | ToolRenderers | undefined {\n\tconst builtIn: ToolRenderers | undefined = createAllToolRenderers()[toolName as RenderedToolName];\n\tif (!definition) return builtIn;\n\tif (!builtIn) return definition;\n\treturn {\n\t\t...definition,\n\t\trenderCall: definition.renderCall ?? builtIn.renderCall,\n\t\trenderResult: definition.renderResult ?? builtIn.renderResult,\n\t};\n}\n"]}
@@ -0,0 +1,7 @@
1
+ import type { TodoItem } from "../todo-write.ts";
2
+ import type { ToolRenderers } from "./index.ts";
3
+ export declare function normalizeTasks(value: unknown): TodoItem[];
4
+ export declare function truncateTaskText(text: string, width: number): string;
5
+ export declare function taskRows(tasks: TodoItem[], width: number, limit?: number): string[];
6
+ export declare const todoWriteRenderers: ToolRenderers;
7
+ //# sourceMappingURL=todo-write.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"todo-write.d.ts","sourceRoot":"","sources":["../../../../src/core/tools/renderers/todo-write.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,EAAE,CAiBzD;AACD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAEpE;AACD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,SAAe,GAAG,MAAM,EAAE,CAUzF;AACD,eAAO,MAAM,kBAAkB,EAAE,aA8BhC,CAAC","sourcesContent":["import { type Component, Text, truncateToWidth } from \"@earendil-works/pi-tui\";\nimport { stripAnsi } from \"../../../utils/ansi.ts\";\nimport type { TodoItem } from \"../todo-write.ts\";\nimport type { ToolRenderers } from \"./index.ts\";\n\nexport function normalizeTasks(value: unknown): TodoItem[] {\n\tif (!Array.isArray(value)) return [];\n\tconst items: unknown[] = value;\n\tconst tasks: TodoItem[] = [];\n\tfor (const item of items) {\n\t\tif (typeof item !== \"object\" || item === null || !(\"content\" in item) || !(\"status\" in item)) continue;\n\t\tif (typeof item.content !== \"string\") continue;\n\t\tconst status = item.status;\n\t\tif (status !== \"pending\" && status !== \"in_progress\" && status !== \"completed\") continue;\n\t\tconst content = stripAnsi(item.content)\n\t\t\t.replace(/\\u001b(?:_|P|\\^|X)[\\s\\S]*?(?:\\u001b\\\\|\\u009c)/g, \"\")\n\t\t\t.replace(/[\\x00-\\x1f\\x7f-\\x9f]/g, \" \")\n\t\t\t.replace(/\\s+/g, \" \")\n\t\t\t.trim();\n\t\ttasks.push({ content, status });\n\t}\n\treturn tasks;\n}\nexport function truncateTaskText(text: string, width: number): string {\n\treturn stripAnsi(truncateToWidth(text, width, \"\"));\n}\nexport function taskRows(tasks: TodoItem[], width: number, limit = tasks.length): string[] {\n\tif (width <= 0) return [];\n\treturn tasks\n\t\t.slice(0, limit)\n\t\t.map((item) =>\n\t\t\ttruncateTaskText(\n\t\t\t\t`${item.status === \"completed\" ? \"✓\" : item.status === \"in_progress\" ? \"›\" : \"○\"} ${item.content}`,\n\t\t\t\twidth,\n\t\t\t),\n\t\t);\n}\nexport const todoWriteRenderers: ToolRenderers = {\n\trenderCall(_args, theme, context) {\n\t\tconst pending = new Text(theme.fg(\"toolTitle\", \"Updating task list…\"), 0, 0);\n\t\treturn {\n\t\t\trender: (width) => (context.state.taskResult ? [] : pending.render(width)),\n\t\t\tinvalidate: () => pending.invalidate(),\n\t\t} satisfies Component;\n\t},\n\trenderResult(result, options, theme, context) {\n\t\tcontext.state.taskResult = true;\n\t\tif (context.isError)\n\t\t\treturn new Text(\n\t\t\t\ttheme.fg(\n\t\t\t\t\t\"error\",\n\t\t\t\t\tresult.content\n\t\t\t\t\t\t.filter((item) => item.type === \"text\")\n\t\t\t\t\t\t.map((item) => item.text)\n\t\t\t\t\t\t.join(\"\\n\"),\n\t\t\t\t),\n\t\t\t\t0,\n\t\t\t\t0,\n\t\t\t);\n\t\tconst tasks = normalizeTasks(result.details?.todos);\n\t\tconst summary = `Task list updated · ${tasks.filter((item) => item.status === \"completed\").length}/${tasks.length} complete`;\n\t\treturn {\n\t\t\trender: (width) =>\n\t\t\t\twidth <= 0 ? [] : [truncateTaskText(summary, width), ...(options.expanded ? taskRows(tasks, width) : [])],\n\t\t\tinvalidate() {},\n\t\t};\n\t},\n};\n"]}
@@ -0,0 +1,58 @@
1
+ import { Text, truncateToWidth } from "@earendil-works/pi-tui";
2
+ import { stripAnsi } from "../../../utils/ansi.js";
3
+ export function normalizeTasks(value) {
4
+ if (!Array.isArray(value))
5
+ return [];
6
+ const items = value;
7
+ const tasks = [];
8
+ for (const item of items) {
9
+ if (typeof item !== "object" || item === null || !("content" in item) || !("status" in item))
10
+ continue;
11
+ if (typeof item.content !== "string")
12
+ continue;
13
+ const status = item.status;
14
+ if (status !== "pending" && status !== "in_progress" && status !== "completed")
15
+ continue;
16
+ const content = stripAnsi(item.content)
17
+ .replace(/\u001b(?:_|P|\^|X)[\s\S]*?(?:\u001b\\|\u009c)/g, "")
18
+ .replace(/[\x00-\x1f\x7f-\x9f]/g, " ")
19
+ .replace(/\s+/g, " ")
20
+ .trim();
21
+ tasks.push({ content, status });
22
+ }
23
+ return tasks;
24
+ }
25
+ export function truncateTaskText(text, width) {
26
+ return stripAnsi(truncateToWidth(text, width, ""));
27
+ }
28
+ export function taskRows(tasks, width, limit = tasks.length) {
29
+ if (width <= 0)
30
+ return [];
31
+ return tasks
32
+ .slice(0, limit)
33
+ .map((item) => truncateTaskText(`${item.status === "completed" ? "✓" : item.status === "in_progress" ? "›" : "○"} ${item.content}`, width));
34
+ }
35
+ export const todoWriteRenderers = {
36
+ renderCall(_args, theme, context) {
37
+ const pending = new Text(theme.fg("toolTitle", "Updating task list…"), 0, 0);
38
+ return {
39
+ render: (width) => (context.state.taskResult ? [] : pending.render(width)),
40
+ invalidate: () => pending.invalidate(),
41
+ };
42
+ },
43
+ renderResult(result, options, theme, context) {
44
+ context.state.taskResult = true;
45
+ if (context.isError)
46
+ return new Text(theme.fg("error", result.content
47
+ .filter((item) => item.type === "text")
48
+ .map((item) => item.text)
49
+ .join("\n")), 0, 0);
50
+ const tasks = normalizeTasks(result.details?.todos);
51
+ const summary = `Task list updated · ${tasks.filter((item) => item.status === "completed").length}/${tasks.length} complete`;
52
+ return {
53
+ render: (width) => width <= 0 ? [] : [truncateTaskText(summary, width), ...(options.expanded ? taskRows(tasks, width) : [])],
54
+ invalidate() { },
55
+ };
56
+ },
57
+ };
58
+ //# sourceMappingURL=todo-write.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"todo-write.js","sourceRoot":"","sources":["../../../../src/core/tools/renderers/todo-write.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,IAAI,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAInD,MAAM,UAAU,cAAc,CAAC,KAAc,EAAc;IAC1D,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,EAA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AAO,EAAE,KAAK,CAAC,CAAC;QACpD,MAAM,OAAO,GAAG,wBAAuB,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,WAAW,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,WAAW,CAAC;QAC7H,OAAO;YACN,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CACjB,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YAC1G,UAAU,GAAG,EAAC,CAAC;SACf,CAAC;IAAA,CACF;CACD,CAAC","sourcesContent":["import { type Component, Text, truncateToWidth } from \"@earendil-works/pi-tui\";\nimport { stripAnsi } from \"../../../utils/ansi.ts\";\nimport type { TodoItem } from \"../todo-write.ts\";\nimport type { ToolRenderers } from \"./index.ts\";\n\nexport function normalizeTasks(value: unknown): TodoItem[] {\n\tif (!Array.isArray(value)) return [];\n\tconst items: unknown[] = value;\n\tconst tasks: TodoItem[] = [];\n\tfor (const item of items) {\n\t\tif (typeof item !== \"object\" || item === null || !(\"content\" in item) || !(\"status\" in item)) continue;\n\t\tif (typeof item.content !== \"string\") continue;\n\t\tconst status = item.status;\n\t\tif (status !== \"pending\" && status !== \"in_progress\" && status !== \"completed\") continue;\n\t\tconst content = stripAnsi(item.content)\n\t\t\t.replace(/\\u001b(?:_|P|\\^|X)[\\s\\S]*?(?:\\u001b\\\\|\\u009c)/g, \"\")\n\t\t\t.replace(/[\\x00-\\x1f\\x7f-\\x9f]/g, \" \")\n\t\t\t.replace(/\\s+/g, \" \")\n\t\t\t.trim();\n\t\ttasks.push({ content, status });\n\t}\n\treturn tasks;\n}\nexport function truncateTaskText(text: string, width: number): string {\n\treturn stripAnsi(truncateToWidth(text, width, \"\"));\n}\nexport function taskRows(tasks: TodoItem[], width: number, limit = tasks.length): string[] {\n\tif (width <= 0) return [];\n\treturn tasks\n\t\t.slice(0, limit)\n\t\t.map((item) =>\n\t\t\ttruncateTaskText(\n\t\t\t\t`${item.status === \"completed\" ? \"✓\" : item.status === \"in_progress\" ? \"›\" : \"○\"} ${item.content}`,\n\t\t\t\twidth,\n\t\t\t),\n\t\t);\n}\nexport const todoWriteRenderers: ToolRenderers = {\n\trenderCall(_args, theme, context) {\n\t\tconst pending = new Text(theme.fg(\"toolTitle\", \"Updating task list…\"), 0, 0);\n\t\treturn {\n\t\t\trender: (width) => (context.state.taskResult ? [] : pending.render(width)),\n\t\t\tinvalidate: () => pending.invalidate(),\n\t\t} satisfies Component;\n\t},\n\trenderResult(result, options, theme, context) {\n\t\tcontext.state.taskResult = true;\n\t\tif (context.isError)\n\t\t\treturn new Text(\n\t\t\t\ttheme.fg(\n\t\t\t\t\t\"error\",\n\t\t\t\t\tresult.content\n\t\t\t\t\t\t.filter((item) => item.type === \"text\")\n\t\t\t\t\t\t.map((item) => item.text)\n\t\t\t\t\t\t.join(\"\\n\"),\n\t\t\t\t),\n\t\t\t\t0,\n\t\t\t\t0,\n\t\t\t);\n\t\tconst tasks = normalizeTasks(result.details?.todos);\n\t\tconst summary = `Task list updated · ${tasks.filter((item) => item.status === \"completed\").length}/${tasks.length} complete`;\n\t\treturn {\n\t\t\trender: (width) =>\n\t\t\t\twidth <= 0 ? [] : [truncateTaskText(summary, width), ...(options.expanded ? taskRows(tasks, width) : [])],\n\t\t\tinvalidate() {},\n\t\t};\n\t},\n};\n"]}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { type Args, parseArgs } from "./cli/args.ts";
2
2
  export { CONFIG_DIR_NAME, getAgentDir, getDocsPath, getExamplesPath, getPackageDir, getReadmePath, VERSION, } from "./config.ts";
3
- export { AgentSession, type AgentSessionConfig, type AgentSessionEvent, type AgentSessionEventListener, type ModelCycleResult, type ParsedSkillBlock, type PromptOptions, parseSkillBlock, type SessionStats, } from "./core/agent-session.ts";
3
+ export { AgentSession, type AgentSessionConfig, type AgentSessionEvent, type AgentSessionEventListener, type ModelCycleResult, type ParsedSkillBlock, type PromptOptions, parseSkillBlock, type SessionStats, type TreeWorkspacePreview, } from "./core/agent-session.ts";
4
4
  export { readStoredCredential } from "./core/auth-storage.ts";
5
5
  export type { CacheWarmingDecision, CacheWarmingStatus } from "./core/cache-warmer.ts";
6
6
  export { type CheckpointSettings, createGitCheckpoints, type GitCheckpoint, type GitCheckpoints, } from "./core/checkpoints/git-checkpoints.ts";
@@ -25,7 +25,7 @@ export { type CacheWarmingMode, type CompactionModelOverride, type CompactionSet
25
25
  export { formatSkillsForPrompt, type LoadSkillsFromDirOptions, type LoadSkillsResult, loadSkills, loadSkillsFromDir, type Skill, type SkillFrontmatter, } from "./core/skills.ts";
26
26
  export { createSyntheticSourceInfo } from "./core/source-info.ts";
27
27
  export { type EditDiffResult, generateDiffString, generateUnifiedPatch } from "./core/tools/edit-diff.ts";
28
- export { type BashOperations, type BashSpawnContext, type BashSpawnHook, type BashToolDetails, type BashToolInput, type BashToolOptions, createBashToolDefinition, createEditToolDefinition, createFindToolDefinition, createGrepToolDefinition, createLocalBashOperations, createLocalPowerShellOperations, createLsToolDefinition, createPowerShellToolDefinition, createReadToolDefinition, createWriteToolDefinition, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, type Diagnostic, type DiagnosticEvidenceRecord, type DiagnosticPosition, type DiagnosticRange, type DiagnosticSeverityCounts, type DiagnosticsOperations, type DiagnosticsOutcome, type DiagnosticUnavailableKind, type EditOperations, type EditToolDetails, type EditToolInput, type EditToolOptions, type FindOperations, type FindToolDetails, type FindToolInput, type FindToolOptions, formatSize, type GrepOperations, type GrepToolDetails, type GrepToolInput, type GrepToolOptions, type LsOperations, type LsToolDetails, type LsToolInput, type LsToolOptions, type PowerShellOperations, type PowerShellSpawnContext, type PowerShellSpawnHook, type PowerShellToolDetails, type PowerShellToolInput, type PowerShellToolOptions, type ReadOperations, type ReadToolDetails, type ReadToolInput, type ReadToolOptions, type ToolsOptions, type TruncationOptions, type TruncationResult, truncateHead, truncateLine, truncateTail, type WriteOperations, type WriteToolDetails, type WriteToolInput, type WriteToolOptions, withFileMutationQueue, } from "./core/tools/index.ts";
28
+ export { type BashOperations, type BashSpawnContext, type BashSpawnHook, type BashToolDetails, type BashToolInput, type BashToolOptions, createBashToolDefinition, createEditToolDefinition, createFindToolDefinition, createGrepToolDefinition, createLocalBashOperations, createLocalPowerShellOperations, createLsToolDefinition, createPlanPresentTool, createPlanPresentToolDefinition, createPowerShellToolDefinition, createReadToolDefinition, createWriteToolDefinition, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, type Diagnostic, type DiagnosticEvidenceRecord, type DiagnosticPosition, type DiagnosticRange, type DiagnosticSeverityCounts, type DiagnosticsOperations, type DiagnosticsOutcome, type DiagnosticUnavailableKind, type EditOperations, type EditToolDetails, type EditToolInput, type EditToolOptions, type FindOperations, type FindToolDetails, type FindToolInput, type FindToolOptions, formatSize, type GrepOperations, type GrepToolDetails, type GrepToolInput, type GrepToolOptions, type LsOperations, type LsToolDetails, type LsToolInput, type LsToolOptions, type PlanDecision, type PlanPresentDetails, type PlanPresenter, type PlanPresentInput, type PowerShellOperations, type PowerShellSpawnContext, type PowerShellSpawnHook, type PowerShellToolDetails, type PowerShellToolInput, type PowerShellToolOptions, type ReadOperations, type ReadToolDetails, type ReadToolInput, type ReadToolOptions, type ToolsOptions, type TruncationOptions, type TruncationResult, truncateHead, truncateLine, truncateTail, type WriteOperations, type WriteToolDetails, type WriteToolInput, type WriteToolOptions, withFileMutationQueue, } from "./core/tools/index.ts";
29
29
  export { hasTrustRequiringProjectResources, type ProjectTrustDecision, ProjectTrustStore, type ProjectTrustStoreEntry, type ProjectTrustUpdate, } from "./core/trust-manager.ts";
30
30
  export { type MainOptions, main } from "./main.ts";
31
31
  export { InteractiveMode, type InteractiveModeOptions, type JsonAgentSessionEvent, type ModelInfo, type PrintModeOptions, RpcClient, type RpcClientOptions, type RpcCommand, type RpcEventListener, type RpcExtensionUIRequest, type RpcExtensionUIResponse, type RpcResponse, type RpcSessionState, runPrintMode, runRpcMode, } from "./modes/index.ts";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,IAAI,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAGrD,OAAO,EACN,eAAe,EACf,WAAW,EACX,WAAW,EACX,eAAe,EACf,aAAa,EACb,aAAa,EACb,OAAO,GACP,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,YAAY,EACZ,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,eAAe,EACf,KAAK,YAAY,GACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,YAAY,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACvF,OAAO,EACN,KAAK,kBAAkB,EACvB,oBAAoB,EACpB,KAAK,aAAa,EAClB,KAAK,cAAc,GACnB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,KAAK,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAE9G,OAAO,EACN,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,sBAAsB,EACtB,8BAA8B,EAC9B,OAAO,EACP,2BAA2B,EAC3B,cAAc,EACd,KAAK,cAAc,EACnB,YAAY,EACZ,kBAAkB,EAClB,KAAK,4BAA4B,EACjC,qBAAqB,EACrB,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port { type Args, parseArgs } from \"./cli/args.ts\";\n\n// Config paths\nexport {\n\tCONFIG_DIR_NAME,\n\tgetAgentDir,\n\tgetDocsPath,\n\tgetExamplesPath,\n\tgetPackageDir,\n\tgetReadmePath,\n\tVERSION,\n} from \"./config.ts\";\nexport {\n\tAgentSession,\n\ttype AgentSessionConfig,\n\ttype AgentSessionEvent,\n\ttype AgentSessionEventListener,\n\ttype ModelCycleResult,\n\ttype ParsedSkillBlock,\n\ttype PromptOptions,\n\tparseSkillBlock,\n\ttype SessionStats,\n} from \"./core/agent-session.ts\";\nexport { readStoredCredential } from \"./core/auth-storage.ts\";\nexport type { CacheWarmingDecision, CacheWarmingStatus } from \"./core/cache-warmer.ts\";\nexport {\n\ttype CheckpointSettings,\n\tcreateGitCheckpoints,\n\ttype GitCheckpoint,\n\ttype GitCheckpoints,\n} from \"./core/checkpoints/git-checkpoints.ts\";\nexport { createSessionCheckpoints, type SessionCheckpoints } from \"./core/checkpoints/session-checkpoints.ts\";\n// Compaction\nexport {\n\ttype BranchPreparation,\n\ttype BranchSummaryResult,\n\ttype CollectEntriesResult,\n\ttype CompactionResult,\n\ttype CutPointResult,\n\tcalculateContextTokens,\n\tcollectEntriesForBranchSummary,\n\tcompact,\n\tDEFAULT_COMPACTION_SETTINGS,\n\testimateTokens,\n\ttype FileOperations,\n\tfindCutPoint,\n\tfindTurnStartIndex,\n\ttype GenerateBranchSummaryOptions,\n\tgenerateBranchSummary,\n\tgenerateSummary,\n\tgenerateSummaryWithUsage,\n\tgetLastAssistantUsage,\n\tprepareBranchEntries,\n\tserializeConversation,\n\tshouldCompact,\n} from \"./core/compaction/index.ts\";\nexport { createEventBus, type EventBus, type EventBusController } from \"./core/event-bus.ts\";\nexport {\n\tcreateEvidencePolicyExtension,\n\ttype EvidencePolicy,\n\ttype EvidencePolicyInput,\n} from \"./core/evidence-policy.ts\";\n// Extension system\nexport type {\n\tAfterProviderResponseEvent,\n\tAgentActivityOutcome,\n\tAgentBeforeSettleEvent,\n\tAgentBeforeSettleEventResult,\n\tAgentEndEvent,\n\tAgentSettledEvent,\n\tAgentStartEvent,\n\tAgentToolResult,\n\tAgentToolUpdateCallback,\n\tAppKeybinding,\n\tAutocompleteProviderFactory,\n\tBashToolCallEvent,\n\tBeforeAgentStartEvent,\n\tBeforeAgentStartEventResult,\n\tBeforeProviderHeadersEvent,\n\tBeforeProviderRequestEvent,\n\tBeforeProviderRequestEventResult,\n\tBoundaryContextPreview,\n\tBoundaryResult,\n\tBoundaryState,\n\tBuildSystemPromptOptions,\n\tCacheWarmingDecisionEvent,\n\tCacheWarmingDecisionEventResult,\n\tCompactionEntryDraft,\n\tCompactOptions,\n\tContextEditEntryDraft,\n\tContextEvent,\n\tContextEventResult,\n\tContextUsage,\n\tContextWithSystemEvent,\n\tCustomEntryDraft,\n\tCustomMessageEntryDraft,\n\tCustomToolCallEvent,\n\tEditToolCallEvent,\n\tEntryRenderer,\n\tEntryRenderOptions,\n\tExecOptions,\n\tExecResult,\n\tExtension,\n\tExtensionActions,\n\tExtensionAPI,\n\tExtensionCommandContext,\n\tExtensionCommandContextActions,\n\tExtensionContext,\n\tExtensionContextActions,\n\tExtensionError,\n\tExtensionEvent,\n\tExtensionFactory,\n\tExtensionFlag,\n\tExtensionHandler,\n\tExtensionRuntime,\n\tExtensionShortcut,\n\tExtensionUIContext,\n\tExtensionUIDialogOptions,\n\tExtensionWidgetOptions,\n\tFindToolCallEvent,\n\tGrepToolCallEvent,\n\tInlineExtension,\n\tInputEvent,\n\tInputEventResult,\n\tInputSource,\n\tKeybindingsManager,\n\tLoadExtensionsResult,\n\tLsToolCallEvent,\n\tMarkdownTransformContext,\n\tMarkdownTransformer,\n\tMessageEndEvent,\n\tMessageEndEventResult,\n\tMessageRenderer,\n\tMessageRenderOptions,\n\tMessageStartEvent,\n\tMessageUpdateEvent,\n\tModelSelectEvent,\n\tModelSelectSource,\n\tNormalizedBuildSystemPromptOptions,\n\tPowerShellToolCallEvent,\n\tProjectTrustContext,\n\tProjectTrustEvent,\n\tProjectTrustEventDecision,\n\tProjectTrustEventResult,\n\tProjectTrustHandler,\n\tProviderConfig,\n\tProviderModelConfig,\n\tReadToolCallEvent,\n\tRegisteredCommand,\n\tRegisteredTool,\n\tResolvedCommand,\n\tResourcesDiscoverEvent,\n\tResourcesDiscoverResult,\n\tSessionBeforeCompactEvent,\n\tSessionBeforeCompactResult,\n\tSessionBeforeForkEvent,\n\tSessionBeforeForkResult,\n\tSessionBeforeSwitchEvent,\n\tSessionBeforeSwitchResult,\n\tSessionBeforeTreeEvent,\n\tSessionBeforeTreeResult,\n\tSessionBoundaryDraft,\n\tSessionCompactEvent,\n\tSessionCompactFailedEvent,\n\tSessionInfoChangedEvent,\n\tSessionShutdownEvent,\n\tSessionStartEvent,\n\tSessionTreeEvent,\n\tSlashCommandInfo,\n\tSlashCommandSource,\n\tSourceInfo,\n\tTerminalInputHandler,\n\tThinkingLevelSelectEvent,\n\tToolCallEvent,\n\tToolCallEventResult,\n\tToolDefinition,\n\tToolExecutionEndEvent,\n\tToolExecutionMode,\n\tToolExecutionStartEvent,\n\tToolExecutionUpdateEvent,\n\tToolInfo,\n\tToolRenderResultOptions,\n\tToolResultEvent,\n\tToolResultEventResult,\n\tTurnEndEvent,\n\tTurnEndEventResult,\n\tTurnStartEvent,\n\tUIPromptEndEvent,\n\tUIPromptKind,\n\tUIPromptStartEvent,\n\tUserBashEvent,\n\tUserBashEventResult,\n\tWidgetPlacement,\n\tWorkingIndicatorOptions,\n\tWriteToolCallEvent,\n} from \"./core/extensions/index.ts\";\nexport {\n\tcreateExtensionRuntime,\n\tdefineTool,\n\tdiscoverAndLoadExtensions,\n\tExtensionRunner,\n\tisBashToolResult,\n\tisEditToolResult,\n\tisFindToolResult,\n\tisGrepToolResult,\n\tisLsToolResult,\n\tisPowerShellToolResult,\n\tisReadToolResult,\n\tisToolCallEventType,\n\tisWriteToolResult,\n\twrapRegisteredTool,\n\twrapRegisteredTools,\n} from \"./core/extensions/index.ts\";\n// Footer data provider (git branch + extension statuses - data not otherwise available to extensions)\nexport type { ReadonlyFooterDataProvider } from \"./core/footer-data-provider.ts\";\nexport { convertToLlm } from \"./core/messages.ts\";\nexport { ModelRegistry } from \"./core/model-registry.ts\";\nexport {\n\ttype ModelScopeDiagnostic,\n\ttype ResolveCliModelResult,\n\ttype ResolveModelScopeResult,\n\tresolveCliModel,\n\tresolveModelScopeWithDiagnostics,\n\ttype ScopedModel,\n} from \"./core/model-resolver.ts\";\nexport {\n\ttype CreateModelRuntimeOptions,\n\tCredentialSynchronizationError,\n\ttype CredentialSynchronizationOperation,\n\tModelRuntime,\n\ttype ModelRuntimeAuthOverrides,\n} from \"./core/model-runtime.ts\";\nexport type {\n\tPackageManager,\n\tPathMetadata,\n\tProgressCallback,\n\tProgressEvent,\n\tResolvedPaths,\n\tResolvedResource,\n} from \"./core/package-manager.ts\";\nexport { DefaultPackageManager } from \"./core/package-manager.ts\";\nexport type { ResourceCollision, ResourceDiagnostic, ResourceLoader } from \"./core/resource-loader.ts\";\nexport { DefaultResourceLoader, loadProjectContextFiles } from \"./core/resource-loader.ts\";\n// SDK for programmatic usage\nexport {\n\tAgentSessionRuntime,\n\ttype AgentSessionRuntimeDiagnostic,\n\ttype AgentSessionServices,\n\ttype CreateAgentSessionFromServicesOptions,\n\ttype CreateAgentSessionOptions,\n\ttype CreateAgentSessionResult,\n\ttype CreateAgentSessionRuntimeFactory,\n\ttype CreateAgentSessionRuntimeResult,\n\ttype CreateAgentSessionServicesOptions,\n\t// Factory\n\tcreateAgentSession,\n\tcreateAgentSessionFromServices,\n\tcreateAgentSessionRuntime,\n\tcreateAgentSessionServices,\n\tcreateBashTool,\n\t// Tool factories (for custom cwd)\n\tcreateCodingTools,\n\tcreateEditTool,\n\tcreateFindTool,\n\tcreateGrepTool,\n\tcreateLsTool,\n\tcreatePowerShellTool,\n\tcreateReadOnlyTools,\n\tcreateReadTool,\n\tcreateWriteTool,\n\ttype PromptTemplate,\n} from \"./core/sdk.ts\";\nexport {\n\ttype BranchSummaryEntry,\n\tbuildContextEntries,\n\tbuildSessionContext,\n\tbuildSessionProjection,\n\ttype CompactionEntry,\n\ttype ContextEditableContent,\n\ttype ContextEditEntry,\n\tCURRENT_SESSION_VERSION,\n\ttype CustomEntry,\n\ttype CustomMessageEntry,\n\ttype FileEntry,\n\tgetLatestCompactionEntry,\n\ttype ModelChangeEntry,\n\tmigrateSessionEntries,\n\ttype NewSessionOptions,\n\ttype ProjectedSessionEntry,\n\tparseSessionEntries,\n\ttype SessionContext,\n\ttype SessionEntry,\n\ttype SessionEntryBase,\n\ttype SessionHeader,\n\ttype SessionInfo,\n\ttype SessionInfoEntry,\n\tSessionManager,\n\ttype SessionMessageEntry,\n\ttype SessionProjection,\n\ttype SessionTreeNode,\n\tsessionEntryToContextMessages,\n\ttype ThinkingLevelChangeEntry,\n} from \"./core/session-manager.ts\";\nexport {\n\ttype CacheWarmingMode,\n\ttype CompactionModelOverride,\n\ttype CompactionSettings,\n\ttype DefaultProjectTrust,\n\ttype FullscreenExitOutput,\n\ttype ImageSettings,\n\ttype PackageSource,\n\ttype RetrySettings,\n\tSettingsManager,\n\ttype SettingsManagerCreateOptions,\n\ttype TuiMode,\n} from \"./core/settings-manager.ts\";\n// Skills\nexport {\n\tformatSkillsForPrompt,\n\ttype LoadSkillsFromDirOptions,\n\ttype LoadSkillsResult,\n\tloadSkills,\n\tloadSkillsFromDir,\n\ttype Skill,\n\ttype SkillFrontmatter,\n} from \"./core/skills.ts\";\nexport { createSyntheticSourceInfo } from \"./core/source-info.ts\";\nexport { type EditDiffResult, generateDiffString, generateUnifiedPatch } from \"./core/tools/edit-diff.ts\";\n// Tools\nexport {\n\ttype BashOperations,\n\ttype BashSpawnContext,\n\ttype BashSpawnHook,\n\ttype BashToolDetails,\n\ttype BashToolInput,\n\ttype BashToolOptions,\n\tcreateBashToolDefinition,\n\tcreateEditToolDefinition,\n\tcreateFindToolDefinition,\n\tcreateGrepToolDefinition,\n\tcreateLocalBashOperations,\n\tcreateLocalPowerShellOperations,\n\tcreateLsToolDefinition,\n\tcreatePowerShellToolDefinition,\n\tcreateReadToolDefinition,\n\tcreateWriteToolDefinition,\n\tDEFAULT_MAX_BYTES,\n\tDEFAULT_MAX_LINES,\n\ttype Diagnostic,\n\ttype DiagnosticEvidenceRecord,\n\ttype DiagnosticPosition,\n\ttype DiagnosticRange,\n\ttype DiagnosticSeverityCounts,\n\ttype DiagnosticsOperations,\n\ttype DiagnosticsOutcome,\n\ttype DiagnosticUnavailableKind,\n\ttype EditOperations,\n\ttype EditToolDetails,\n\ttype EditToolInput,\n\ttype EditToolOptions,\n\ttype FindOperations,\n\ttype FindToolDetails,\n\ttype FindToolInput,\n\ttype FindToolOptions,\n\tformatSize,\n\ttype GrepOperations,\n\ttype GrepToolDetails,\n\ttype GrepToolInput,\n\ttype GrepToolOptions,\n\ttype LsOperations,\n\ttype LsToolDetails,\n\ttype LsToolInput,\n\ttype LsToolOptions,\n\ttype PowerShellOperations,\n\ttype PowerShellSpawnContext,\n\ttype PowerShellSpawnHook,\n\ttype PowerShellToolDetails,\n\ttype PowerShellToolInput,\n\ttype PowerShellToolOptions,\n\ttype ReadOperations,\n\ttype ReadToolDetails,\n\ttype ReadToolInput,\n\ttype ReadToolOptions,\n\ttype ToolsOptions,\n\ttype TruncationOptions,\n\ttype TruncationResult,\n\ttruncateHead,\n\ttruncateLine,\n\ttruncateTail,\n\ttype WriteOperations,\n\ttype WriteToolDetails,\n\ttype WriteToolInput,\n\ttype WriteToolOptions,\n\twithFileMutationQueue,\n} from \"./core/tools/index.ts\";\nexport {\n\thasTrustRequiringProjectResources,\n\ttype ProjectTrustDecision,\n\tProjectTrustStore,\n\ttype ProjectTrustStoreEntry,\n\ttype ProjectTrustUpdate,\n} from \"./core/trust-manager.ts\";\n// Main entry point\nexport { type MainOptions, main } from \"./main.ts\";\n// Run modes for programmatic SDK usage\nexport {\n\tInteractiveMode,\n\ttype InteractiveModeOptions,\n\ttype JsonAgentSessionEvent,\n\ttype ModelInfo,\n\ttype PrintModeOptions,\n\tRpcClient,\n\ttype RpcClientOptions,\n\ttype RpcCommand,\n\ttype RpcEventListener,\n\ttype RpcExtensionUIRequest,\n\ttype RpcExtensionUIResponse,\n\ttype RpcResponse,\n\ttype RpcSessionState,\n\trunPrintMode,\n\trunRpcMode,\n} from \"./modes/index.ts\";\n// UI components for extensions\nexport {\n\tArminComponent,\n\tAssistantMessageComponent,\n\tBashExecutionComponent,\n\tBorderedLoader,\n\tBranchSummaryMessageComponent,\n\tCompactionSummaryMessageComponent,\n\tCustomEditor,\n\ttype CustomEditorOptions,\n\tCustomMessageComponent,\n\tDynamicBorder,\n\tExtensionEditorComponent,\n\tExtensionInputComponent,\n\tExtensionSelectorComponent,\n\tFooterComponent,\n\tkeyHint,\n\tkeyText,\n\tLoginDialogComponent,\n\tModelSelectorComponent,\n\tOAuthSelectorComponent,\n\ttype RenderDiffOptions,\n\trawKeyHint,\n\trenderDiff,\n\tSessionSelectorComponent,\n\ttype SettingsCallbacks,\n\ttype SettingsConfig,\n\tSettingsSelectorComponent,\n\tShowImagesSelectorComponent,\n\tSkillInvocationMessageComponent,\n\tThemeSelectorComponent,\n\tThinkingSelectorComponent,\n\tToolExecutionComponent,\n\ttype ToolExecutionOptions,\n\tTreeSelectorComponent,\n\ttruncateToVisualLines,\n\tUserMessageComponent,\n\tUserMessageSelectorComponent,\n\ttype VisualTruncateResult,\n} from \"./modes/interactive/components/index.ts\";\n// Theme utilities for custom tools and extensions\nexport {\n\tgetLanguageFromPath,\n\tgetMarkdownTheme,\n\tgetSelectListTheme,\n\tgetSettingsListTheme,\n\thighlightCode,\n\tinitTheme,\n\tTheme,\n\ttype ThemeColor,\n} from \"./modes/interactive/theme/theme.ts\";\n// Clipboard utilities\nexport { copyToClipboard } from \"./utils/clipboard.ts\";\nexport { parseFrontmatter, stripFrontmatter } from \"./utils/frontmatter.ts\";\nexport { convertToPng } from \"./utils/image-convert.ts\";\nexport { formatDimensionNote, type ResizedImage, resizeImage } from \"./utils/image-resize.ts\";\nexport { detectSupportedImageMimeTypeFromFile } from \"./utils/mime.ts\";\n// Shell utilities\nexport { getPowerShellConfig, getShellConfig } from \"./utils/shell.ts\";\n"]}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,IAAI,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAGrD,OAAO,EACN,eAAe,EACf,WAAW,EACX,WAAW,EACX,eAAe,EACf,aAAa,EACb,aAAa,EACb,OAAO,GACP,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,YAAY,EACZ,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,eAAe,EACf,KAAK,YAAY,EACjB,KAAK,oBAAoB,GACzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,YAAY,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACvF,OAAO,EACN,KAAK,kBAAkB,EACvB,oBAAoB,EACpB,KAAK,aAAa,EAClB,KAAK,cAAc,GACnB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,KAAK,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAE9G,OAAO,EACN,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,sBAAsB,EACtB,8BAA8B,EAC9B,OAAO,EACP,2BAA2B,EAC3B,cAAc,EACd,KAAK,cAAc,EACnB,YAAY,EACZ,kBAAkB,EAClB,KAAK,4BAA4B,EACjC,qBAAqB,EACrB,eAAe,EACf,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,EACpB,q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Ac,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["// Core session management\n\nexport { type Args, parseArgs } from \"./cli/args.ts\";\n\n// Config paths\nexport {\n\tCONFIG_DIR_NAME,\n\tgetAgentDir,\n\tgetDocsPath,\n\tgetExamplesPath,\n\tgetPackageDir,\n\tgetReadmePath,\n\tVERSION,\n} from \"./config.ts\";\nexport {\n\tAgentSession,\n\ttype AgentSessionConfig,\n\ttype AgentSessionEvent,\n\ttype AgentSessionEventListener,\n\ttype ModelCycleResult,\n\ttype ParsedSkillBlock,\n\ttype PromptOptions,\n\tparseSkillBlock,\n\ttype SessionStats,\n\ttype TreeWorkspacePreview,\n} from \"./core/agent-session.ts\";\nexport { readStoredCredential } from \"./core/auth-storage.ts\";\nexport type { CacheWarmingDecision, CacheWarmingStatus } from \"./core/cache-warmer.ts\";\nexport {\n\ttype CheckpointSettings,\n\tcreateGitCheckpoints,\n\ttype GitCheckpoint,\n\ttype GitCheckpoints,\n} from \"./core/checkpoints/git-checkpoints.ts\";\nexport { createSessionCheckpoints, type SessionCheckpoints } from \"./core/checkpoints/session-checkpoints.ts\";\n// Compaction\nexport {\n\ttype BranchPreparation,\n\ttype BranchSummaryResult,\n\ttype CollectEntriesResult,\n\ttype CompactionResult,\n\ttype CutPointResult,\n\tcalculateContextTokens,\n\tcollectEntriesForBranchSummary,\n\tcompact,\n\tDEFAULT_COMPACTION_SETTINGS,\n\testimateTokens,\n\ttype FileOperations,\n\tfindCutPoint,\n\tfindTurnStartIndex,\n\ttype GenerateBranchSummaryOptions,\n\tgenerateBranchSummary,\n\tgenerateSummary,\n\tgenerateSummaryWithUsage,\n\tgetLastAssistantUsage,\n\tprepareBranchEntries,\n\tserializeConversation,\n\tshouldCompact,\n} from \"./core/compaction/index.ts\";\nexport { createEventBus, type EventBus, type EventBusController } from \"./core/event-bus.ts\";\nexport {\n\tcreateEvidencePolicyExtension,\n\ttype EvidencePolicy,\n\ttype EvidencePolicyInput,\n} from \"./core/evidence-policy.ts\";\n// Extension system\nexport type {\n\tAfterProviderResponseEvent,\n\tAgentActivityOutcome,\n\tAgentBeforeSettleEvent,\n\tAgentBeforeSettleEventResult,\n\tAgentEndEvent,\n\tAgentSettledEvent,\n\tAgentStartEvent,\n\tAgentToolResult,\n\tAgentToolUpdateCallback,\n\tAppKeybinding,\n\tAutocompleteProviderFactory,\n\tBashToolCallEvent,\n\tBeforeAgentStartEvent,\n\tBeforeAgentStartEventResult,\n\tBeforeProviderHeadersEvent,\n\tBeforeProviderRequestEvent,\n\tBeforeProviderRequestEventResult,\n\tBoundaryContextPreview,\n\tBoundaryResult,\n\tBoundaryState,\n\tBuildSystemPromptOptions,\n\tCacheWarmingDecisionEvent,\n\tCacheWarmingDecisionEventResult,\n\tCompactionEntryDraft,\n\tCompactOptions,\n\tContextEditEntryDraft,\n\tContextEvent,\n\tContextEventResult,\n\tContextUsage,\n\tContextWithSystemEvent,\n\tCustomEntryDraft,\n\tCustomMessageEntryDraft,\n\tCustomToolCallEvent,\n\tEditToolCallEvent,\n\tEntryRenderer,\n\tEntryRenderOptions,\n\tExecOptions,\n\tExecResult,\n\tExtension,\n\tExtensionActions,\n\tExtensionAPI,\n\tExtensionCommandContext,\n\tExtensionCommandContextActions,\n\tExtensionContext,\n\tExtensionContextActions,\n\tExtensionError,\n\tExtensionEvent,\n\tExtensionFactory,\n\tExtensionFlag,\n\tExtensionHandler,\n\tExtensionRuntime,\n\tExtensionShortcut,\n\tExtensionUIContext,\n\tExtensionUIDialogOptions,\n\tExtensionWidgetOptions,\n\tFindToolCallEvent,\n\tGrepToolCallEvent,\n\tInlineExtension,\n\tInputEvent,\n\tInputEventResult,\n\tInputSource,\n\tKeybindingsManager,\n\tLoadExtensionsResult,\n\tLsToolCallEvent,\n\tMarkdownTransformContext,\n\tMarkdownTransformer,\n\tMessageEndEvent,\n\tMessageEndEventResult,\n\tMessageRenderer,\n\tMessageRenderOptions,\n\tMessageStartEvent,\n\tMessageUpdateEvent,\n\tModelSelectEvent,\n\tModelSelectSource,\n\tNormalizedBuildSystemPromptOptions,\n\tPowerShellToolCallEvent,\n\tProjectTrustContext,\n\tProjectTrustEvent,\n\tProjectTrustEventDecision,\n\tProjectTrustEventResult,\n\tProjectTrustHandler,\n\tProviderConfig,\n\tProviderModelConfig,\n\tReadToolCallEvent,\n\tRegisteredCommand,\n\tRegisteredTool,\n\tResolvedCommand,\n\tResourcesDiscoverEvent,\n\tResourcesDiscoverResult,\n\tSessionBeforeCompactEvent,\n\tSessionBeforeCompactResult,\n\tSessionBeforeForkEvent,\n\tSessionBeforeForkResult,\n\tSessionBeforeSwitchEvent,\n\tSessionBeforeSwitchResult,\n\tSessionBeforeTreeEvent,\n\tSessionBeforeTreeResult,\n\tSessionBoundaryDraft,\n\tSessionCompactEvent,\n\tSessionCompactFailedEvent,\n\tSessionInfoChangedEvent,\n\tSessionShutdownEvent,\n\tSessionStartEvent,\n\tSessionTreeEvent,\n\tSlashCommandInfo,\n\tSlashCommandSource,\n\tSourceInfo,\n\tTerminalInputHandler,\n\tThinkingLevelSelectEvent,\n\tToolCallEvent,\n\tToolCallEventResult,\n\tToolDefinition,\n\tToolExecutionEndEvent,\n\tToolExecutionMode,\n\tToolExecutionStartEvent,\n\tToolExecutionUpdateEvent,\n\tToolInfo,\n\tToolRenderResultOptions,\n\tToolResultEvent,\n\tToolResultEventResult,\n\tTurnEndEvent,\n\tTurnEndEventResult,\n\tTurnStartEvent,\n\tUIPromptEndEvent,\n\tUIPromptKind,\n\tUIPromptStartEvent,\n\tUserBashEvent,\n\tUserBashEventResult,\n\tWidgetPlacement,\n\tWorkingIndicatorOptions,\n\tWriteToolCallEvent,\n} from \"./core/extensions/index.ts\";\nexport {\n\tcreateExtensionRuntime,\n\tdefineTool,\n\tdiscoverAndLoadExtensions,\n\tExtensionRunner,\n\tisBashToolResult,\n\tisEditToolResult,\n\tisFindToolResult,\n\tisGrepToolResult,\n\tisLsToolResult,\n\tisPowerShellToolResult,\n\tisReadToolResult,\n\tisToolCallEventType,\n\tisWriteToolResult,\n\twrapRegisteredTool,\n\twrapRegisteredTools,\n} from \"./core/extensions/index.ts\";\n// Footer data provider (git branch + extension statuses - data not otherwise available to extensions)\nexport type { ReadonlyFooterDataProvider } from \"./core/footer-data-provider.ts\";\nexport { convertToLlm } from \"./core/messages.ts\";\nexport { ModelRegistry } from \"./core/model-registry.ts\";\nexport {\n\ttype ModelScopeDiagnostic,\n\ttype ResolveCliModelResult,\n\ttype ResolveModelScopeResult,\n\tresolveCliModel,\n\tresolveModelScopeWithDiagnostics,\n\ttype ScopedModel,\n} from \"./core/model-resolver.ts\";\nexport {\n\ttype CreateModelRuntimeOptions,\n\tCredentialSynchronizationError,\n\ttype CredentialSynchronizationOperation,\n\tModelRuntime,\n\ttype ModelRuntimeAuthOverrides,\n} from \"./core/model-runtime.ts\";\nexport type {\n\tPackageManager,\n\tPathMetadata,\n\tProgressCallback,\n\tProgressEvent,\n\tResolvedPaths,\n\tResolvedResource,\n} from \"./core/package-manager.ts\";\nexport { DefaultPackageManager } from \"./core/package-manager.ts\";\nexport type { ResourceCollision, ResourceDiagnostic, ResourceLoader } from \"./core/resource-loader.ts\";\nexport { DefaultResourceLoader, loadProjectContextFiles } from \"./core/resource-loader.ts\";\n// SDK for programmatic usage\nexport {\n\tAgentSessionRuntime,\n\ttype AgentSessionRuntimeDiagnostic,\n\ttype AgentSessionServices,\n\ttype CreateAgentSessionFromServicesOptions,\n\ttype CreateAgentSessionOptions,\n\ttype CreateAgentSessionResult,\n\ttype CreateAgentSessionRuntimeFactory,\n\ttype CreateAgentSessionRuntimeResult,\n\ttype CreateAgentSessionServicesOptions,\n\t// Factory\n\tcreateAgentSession,\n\tcreateAgentSessionFromServices,\n\tcreateAgentSessionRuntime,\n\tcreateAgentSessionServices,\n\tcreateBashTool,\n\t// Tool factories (for custom cwd)\n\tcreateCodingTools,\n\tcreateEditTool,\n\tcreateFindTool,\n\tcreateGrepTool,\n\tcreateLsTool,\n\tcreatePowerShellTool,\n\tcreateReadOnlyTools,\n\tcreateReadTool,\n\tcreateWriteTool,\n\ttype PromptTemplate,\n} from \"./core/sdk.ts\";\nexport {\n\ttype BranchSummaryEntry,\n\tbuildContextEntries,\n\tbuildSessionContext,\n\tbuildSessionProjection,\n\ttype CompactionEntry,\n\ttype ContextEditableContent,\n\ttype ContextEditEntry,\n\tCURRENT_SESSION_VERSION,\n\ttype CustomEntry,\n\ttype CustomMessageEntry,\n\ttype FileEntry,\n\tgetLatestCompactionEntry,\n\ttype ModelChangeEntry,\n\tmigrateSessionEntries,\n\ttype NewSessionOptions,\n\ttype ProjectedSessionEntry,\n\tparseSessionEntries,\n\ttype SessionContext,\n\ttype SessionEntry,\n\ttype SessionEntryBase,\n\ttype SessionHeader,\n\ttype SessionInfo,\n\ttype SessionInfoEntry,\n\tSessionManager,\n\ttype SessionMessageEntry,\n\ttype SessionProjection,\n\ttype SessionTreeNode,\n\tsessionEntryToContextMessages,\n\ttype ThinkingLevelChangeEntry,\n} from \"./core/session-manager.ts\";\nexport {\n\ttype CacheWarmingMode,\n\ttype CompactionModelOverride,\n\ttype CompactionSettings,\n\ttype DefaultProjectTrust,\n\ttype FullscreenExitOutput,\n\ttype ImageSettings,\n\ttype PackageSource,\n\ttype RetrySettings,\n\tSettingsManager,\n\ttype SettingsManagerCreateOptions,\n\ttype TuiMode,\n} from \"./core/settings-manager.ts\";\n// Skills\nexport {\n\tformatSkillsForPrompt,\n\ttype LoadSkillsFromDirOptions,\n\ttype LoadSkillsResult,\n\tloadSkills,\n\tloadSkillsFromDir,\n\ttype Skill,\n\ttype SkillFrontmatter,\n} from \"./core/skills.ts\";\nexport { createSyntheticSourceInfo } from \"./core/source-info.ts\";\nexport { type EditDiffResult, generateDiffString, generateUnifiedPatch } from \"./core/tools/edit-diff.ts\";\n// Tools\nexport {\n\ttype BashOperations,\n\ttype BashSpawnContext,\n\ttype BashSpawnHook,\n\ttype BashToolDetails,\n\ttype BashToolInput,\n\ttype BashToolOptions,\n\tcreateBashToolDefinition,\n\tcreateEditToolDefinition,\n\tcreateFindToolDefinition,\n\tcreateGrepToolDefinition,\n\tcreateLocalBashOperations,\n\tcreateLocalPowerShellOperations,\n\tcreateLsToolDefinition,\n\tcreatePlanPresentTool,\n\tcreatePlanPresentToolDefinition,\n\tcreatePowerShellToolDefinition,\n\tcreateReadToolDefinition,\n\tcreateWriteToolDefinition,\n\tDEFAULT_MAX_BYTES,\n\tDEFAULT_MAX_LINES,\n\ttype Diagnostic,\n\ttype DiagnosticEvidenceRecord,\n\ttype DiagnosticPosition,\n\ttype DiagnosticRange,\n\ttype DiagnosticSeverityCounts,\n\ttype DiagnosticsOperations,\n\ttype DiagnosticsOutcome,\n\ttype DiagnosticUnavailableKind,\n\ttype EditOperations,\n\ttype EditToolDetails,\n\ttype EditToolInput,\n\ttype EditToolOptions,\n\ttype FindOperations,\n\ttype FindToolDetails,\n\ttype FindToolInput,\n\ttype FindToolOptions,\n\tformatSize,\n\ttype GrepOperations,\n\ttype GrepToolDetails,\n\ttype GrepToolInput,\n\ttype GrepToolOptions,\n\ttype LsOperations,\n\ttype LsToolDetails,\n\ttype LsToolInput,\n\ttype LsToolOptions,\n\ttype PlanDecision,\n\ttype PlanPresentDetails,\n\ttype PlanPresenter,\n\ttype PlanPresentInput,\n\ttype PowerShellOperations,\n\ttype PowerShellSpawnContext,\n\ttype PowerShellSpawnHook,\n\ttype PowerShellToolDetails,\n\ttype PowerShellToolInput,\n\ttype PowerShellToolOptions,\n\ttype ReadOperations,\n\ttype ReadToolDetails,\n\ttype ReadToolInput,\n\ttype ReadToolOptions,\n\ttype ToolsOptions,\n\ttype TruncationOptions,\n\ttype TruncationResult,\n\ttruncateHead,\n\ttruncateLine,\n\ttruncateTail,\n\ttype WriteOperations,\n\ttype WriteToolDetails,\n\ttype WriteToolInput,\n\ttype WriteToolOptions,\n\twithFileMutationQueue,\n} from \"./core/tools/index.ts\";\nexport {\n\thasTrustRequiringProjectResources,\n\ttype ProjectTrustDecision,\n\tProjectTrustStore,\n\ttype ProjectTrustStoreEntry,\n\ttype ProjectTrustUpdate,\n} from \"./core/trust-manager.ts\";\n// Main entry point\nexport { type MainOptions, main } from \"./main.ts\";\n// Run modes for programmatic SDK usage\nexport {\n\tInteractiveMode,\n\ttype InteractiveModeOptions,\n\ttype JsonAgentSessionEvent,\n\ttype ModelInfo,\n\ttype PrintModeOptions,\n\tRpcClient,\n\ttype RpcClientOptions,\n\ttype RpcCommand,\n\ttype RpcEventListener,\n\ttype RpcExtensionUIRequest,\n\ttype RpcExtensionUIResponse,\n\ttype RpcResponse,\n\ttype RpcSessionState,\n\trunPrintMode,\n\trunRpcMode,\n} from \"./modes/index.ts\";\n// UI components for extensions\nexport {\n\tArminComponent,\n\tAssistantMessageComponent,\n\tBashExecutionComponent,\n\tBorderedLoader,\n\tBranchSummaryMessageComponent,\n\tCompactionSummaryMessageComponent,\n\tCustomEditor,\n\ttype CustomEditorOptions,\n\tCustomMessageComponent,\n\tDynamicBorder,\n\tExtensionEditorComponent,\n\tExtensionInputComponent,\n\tExtensionSelectorComponent,\n\tFooterComponent,\n\tkeyHint,\n\tkeyText,\n\tLoginDialogComponent,\n\tModelSelectorComponent,\n\tOAuthSelectorComponent,\n\ttype RenderDiffOptions,\n\trawKeyHint,\n\trenderDiff,\n\tSessionSelectorComponent,\n\ttype SettingsCallbacks,\n\ttype SettingsConfig,\n\tSettingsSelectorComponent,\n\tShowImagesSelectorComponent,\n\tSkillInvocationMessageComponent,\n\tThemeSelectorComponent,\n\tThinkingSelectorComponent,\n\tToolExecutionComponent,\n\ttype ToolExecutionOptions,\n\tTreeSelectorComponent,\n\ttruncateToVisualLines,\n\tUserMessageComponent,\n\tUserMessageSelectorComponent,\n\ttype VisualTruncateResult,\n} from \"./modes/interactive/components/index.ts\";\n// Theme utilities for custom tools and extensions\nexport {\n\tgetLanguageFromPath,\n\tgetMarkdownTheme,\n\tgetSelectListTheme,\n\tgetSettingsListTheme,\n\thighlightCode,\n\tinitTheme,\n\tTheme,\n\ttype ThemeColor,\n} from \"./modes/interactive/theme/theme.ts\";\n// Clipboard utilities\nexport { copyToClipboard } from \"./utils/clipboard.ts\";\nexport { parseFrontmatter, stripFrontmatter } from \"./utils/frontmatter.ts\";\nexport { convertToPng } from \"./utils/image-convert.ts\";\nexport { formatDimensionNote, type ResizedImage, resizeImage } from \"./utils/image-resize.ts\";\nexport { detectSupportedImageMimeTypeFromFile } from \"./utils/mime.ts\";\n// Shell utilities\nexport { getPowerShellConfig, getShellConfig } from \"./utils/shell.ts\";\n"]}
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ export { formatSkillsForPrompt, loadSkills, loadSkillsFromDir, } from "./core/sk
30
30
  export { createSyntheticSourceInfo } from "./core/source-info.js";
31
31
  export { generateDiffString, generateUnifiedPatch } from "./core/tools/edit-diff.js";
32
32
  // Tools
33
- export { createBashToolDefinition, createEditToolDefinition, createFindToolDefinition, createGrepToolDefinition, createLocalBashOperations, createLocalPowerShellOperations, createLsToolDefinition, createPowerShellToolDefinition, createReadToolDefinition, createWriteToolDefinition, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, formatSize, truncateHead, truncateLine, truncateTail, withFileMutationQueue, } from "./core/tools/index.js";
33
+ export { createBashToolDefinition, createEditToolDefinition, createFindToolDefinition, createGrepToolDefinition, createLocalBashOperations, createLocalPowerShellOperations, createLsToolDefinition, createPlanPresentTool, createPlanPresentToolDefinition, createPowerShellToolDefinition, createReadToolDefinition, createWriteToolDefinition, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, formatSize, truncateHead, truncateLine, truncateTail, withFileMutationQueue, } from "./core/tools/index.js";
34
34
  export { hasTrustRequiringProjectResources, ProjectTrustStore, } from "./core/trust-manager.js";
35
35
  // Main entry point
36
36
  export { main } from "./main.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAE1B,OAAO,EAAa,SAAS,E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vC,OAAO,EACN,eAAe,EAKf,SAAS,EAQT,YAAY,EACZ,UAAU,GACV,MAAM,kBAAkB,CAAC;AAC1B,+BAA+B;AAC/B,OAAO,EACN,cAAc,EACd,yBAAyB,EACzB,sBAAsB,EACtB,cAAc,EACd,6BAA6B,EAC7B,iCAAiC,EACjC,YAAY,EAEZ,sBAAsB,EACtB,aAAa,EACb,wBAAwB,EACxB,uBAAuB,EACvB,0BAA0B,EAC1B,eAAe,EACf,OAAO,EACP,OAAO,EACP,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EAEtB,UAAU,EACV,UAAU,EACV,wBAAwB,EAGxB,yBAAyB,EACzB,2BAA2B,EAC3B,+BAA+B,EAC/B,sBAAsB,EACtB,yBAAyB,EACzB,sBAAsB,EAEtB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,4BAA4B,GAE5B,MAAM,yCAAyC,CAAC;AACjD,kDAAkD;AAClD,OAAO,EACN,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,SAAS,EACT,KAAK,GAEL,MAAM,oCAAoC,CAAC;AAC5C,sBAAsB;AACtB,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAqB,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC9F,OAAO,EAAE,oCAAoC,EAAE,MAAM,iBAAiB,CAAC;AACvE,kBAAkB;AAClB,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["// Core session management\n\nexport { type Args, parseArgs } from \"./cli/args.ts\";\n\n// Config paths\nexport {\n\tCONFIG_DIR_NAME,\n\tgetAgentDir,\n\tgetDocsPath,\n\tgetExamplesPath,\n\tgetPackageDir,\n\tgetReadmePath,\n\tVERSION,\n} from \"./config.ts\";\nexport {\n\tAgentSession,\n\ttype AgentSessionConfig,\n\ttype AgentSessionEvent,\n\ttype AgentSessionEventListener,\n\ttype ModelCycleResult,\n\ttype ParsedSkillBlock,\n\ttype PromptOptions,\n\tparseSkillBlock,\n\ttype SessionStats,\n} from \"./core/agent-session.ts\";\nexport { readStoredCredential } from \"./core/auth-storage.ts\";\nexport type { CacheWarmingDecision, CacheWarmingStatus } from \"./core/cache-warmer.ts\";\nexport {\n\ttype CheckpointSettings,\n\tcreateGitCheckpoints,\n\ttype GitCheckpoint,\n\ttype GitCheckpoints,\n} from \"./core/checkpoints/git-checkpoints.ts\";\nexport { createSessionCheckpoints, type SessionCheckpoints } from \"./core/checkpoints/session-checkpoints.ts\";\n// Compaction\nexport {\n\ttype BranchPreparation,\n\ttype BranchSummaryResult,\n\ttype CollectEntriesResult,\n\ttype CompactionResult,\n\ttype CutPointResult,\n\tcalculateContextTokens,\n\tcollectEntriesForBranchSummary,\n\tcompact,\n\tDEFAULT_COMPACTION_SETTINGS,\n\testimateTokens,\n\ttype FileOperations,\n\tfindCutPoint,\n\tfindTurnStartIndex,\n\ttype GenerateBranchSummaryOptions,\n\tgenerateBranchSummary,\n\tgenerateSummary,\n\tgenerateSummaryWithUsage,\n\tgetLastAssistantUsage,\n\tprepareBranchEntries,\n\tserializeConversation,\n\tshouldCompact,\n} from \"./core/compaction/index.ts\";\nexport { createEventBus, type EventBus, type EventBusController } from \"./core/event-bus.ts\";\nexport {\n\tcreateEvidencePolicyExtension,\n\ttype EvidencePolicy,\n\ttype EvidencePolicyInput,\n} from \"./core/evidence-policy.ts\";\n// Extension system\nexport type {\n\tAfterProviderResponseEvent,\n\tAgentActivityOutcome,\n\tAgentBeforeSettleEvent,\n\tAgentBeforeSettleEventResult,\n\tAgentEndEvent,\n\tAgentSettledEvent,\n\tAgentStartEvent,\n\tAgentToolResult,\n\tAgentToolUpdateCallback,\n\tAppKeybinding,\n\tAutocompleteProviderFactory,\n\tBashToolCallEvent,\n\tBeforeAgentStartEvent,\n\tBeforeAgentStartEventResult,\n\tBeforeProviderHeadersEvent,\n\tBeforeProviderRequestEvent,\n\tBeforeProviderRequestEventResult,\n\tBoundaryContextPreview,\n\tBoundaryResult,\n\tBoundaryState,\n\tBuildSystemPromptOptions,\n\tCacheWarmingDecisionEvent,\n\tCacheWarmingDecisionEventResult,\n\tCompactionEntryDraft,\n\tCompactOptions,\n\tContextEditEntryDraft,\n\tContextEvent,\n\tContextEventResult,\n\tContextUsage,\n\tContextWithSystemEvent,\n\tCustomEntryDraft,\n\tCustomMessageEntryDraft,\n\tCustomToolCallEvent,\n\tEditToolCallEvent,\n\tEntryRenderer,\n\tEntryRenderOptions,\n\tExecOptions,\n\tExecResult,\n\tExtension,\n\tExtensionActions,\n\tExtensionAPI,\n\tExtensionCommandContext,\n\tExtensionCommandContextActions,\n\tExtensionContext,\n\tExtensionContextActions,\n\tExtensionError,\n\tExtensionEvent,\n\tExtensionFactory,\n\tExtensionFlag,\n\tExtensionHandler,\n\tExtensionRuntime,\n\tExtensionShortcut,\n\tExtensionUIContext,\n\tExtensionUIDialogOptions,\n\tExtensionWidgetOptions,\n\tFindToolCallEvent,\n\tGrepToolCallEvent,\n\tInlineExtension,\n\tInputEvent,\n\tInputEventResult,\n\tInputSource,\n\tKeybindingsManager,\n\tLoadExtensionsResult,\n\tLsToolCallEvent,\n\tMarkdownTransformContext,\n\tMarkdownTransformer,\n\tMessageEndEvent,\n\tMessageEndEventResult,\n\tMessageRenderer,\n\tMessageRenderOptions,\n\tMessageStartEvent,\n\tMessageUpdateEvent,\n\tModelSelectEvent,\n\tModelSelectSource,\n\tNormalizedBuildSystemPromptOptions,\n\tPowerShellToolCallEvent,\n\tProjectTrustContext,\n\tProjectTrustEvent,\n\tProjectTrustEventDecision,\n\tProjectTrustEventResult,\n\tProjectTrustHandler,\n\tProviderConfig,\n\tProviderModelConfig,\n\tReadToolCallEvent,\n\tRegisteredCommand,\n\tRegisteredTool,\n\tResolvedCommand,\n\tResourcesDiscoverEvent,\n\tResourcesDiscoverResult,\n\tSessionBeforeCompactEvent,\n\tSessionBeforeCompactResult,\n\tSessionBeforeForkEvent,\n\tSessionBeforeForkResult,\n\tSessionBeforeSwitchEvent,\n\tSessionBeforeSwitchResult,\n\tSessionBeforeTreeEvent,\n\tSessionBeforeTreeResult,\n\tSessionBoundaryDraft,\n\tSessionCompactEvent,\n\tSessionCompactFailedEvent,\n\tSessionInfoChangedEvent,\n\tSessionShutdownEvent,\n\tSessionStartEvent,\n\tSessionTreeEvent,\n\tSlashCommandInfo,\n\tSlashCommandSource,\n\tSourceInfo,\n\tTerminalInputHandler,\n\tThinkingLevelSelectEvent,\n\tToolCallEvent,\n\tToolCallEventResult,\n\tToolDefinition,\n\tToolExecutionEndEvent,\n\tToolExecutionMode,\n\tToolExecutionStartEvent,\n\tToolExecutionUpdateEvent,\n\tToolInfo,\n\tToolRenderResultOptions,\n\tToolResultEvent,\n\tToolResultEventResult,\n\tTurnEndEvent,\n\tTurnEndEventResult,\n\tTurnStartEvent,\n\tUIPromptEndEvent,\n\tUIPromptKind,\n\tUIPromptStartEvent,\n\tUserBashEvent,\n\tUserBashEventResult,\n\tWidgetPlacement,\n\tWorkingIndicatorOptions,\n\tWriteToolCallEvent,\n} from \"./core/extensions/index.ts\";\nexport {\n\tcreateExtensionRuntime,\n\tdefineTool,\n\tdiscoverAndLoadExtensions,\n\tExtensionRunner,\n\tisBashToolResult,\n\tisEditToolResult,\n\tisFindToolResult,\n\tisGrepToolResult,\n\tisLsToolResult,\n\tisPowerShellToolResult,\n\tisReadToolResult,\n\tisToolCallEventType,\n\tisWriteToolResult,\n\twrapRegisteredTool,\n\twrapRegisteredTools,\n} from \"./core/extensions/index.ts\";\n// Footer data provider (git branch + extension statuses - data not otherwise available to extensions)\nexport type { ReadonlyFooterDataProvider } from \"./core/footer-data-provider.ts\";\nexport { convertToLlm } from \"./core/messages.ts\";\nexport { ModelRegistry } from \"./core/model-registry.ts\";\nexport {\n\ttype ModelScopeDiagnostic,\n\ttype ResolveCliModelResult,\n\ttype ResolveModelScopeResult,\n\tresolveCliModel,\n\tresolveModelScopeWithDiagnostics,\n\ttype ScopedModel,\n} from \"./core/model-resolver.ts\";\nexport {\n\ttype CreateModelRuntimeOptions,\n\tCredentialSynchronizationError,\n\ttype CredentialSynchronizationOperation,\n\tModelRuntime,\n\ttype ModelRuntimeAuthOverrides,\n} from \"./core/model-runtime.ts\";\nexport type {\n\tPackageManager,\n\tPathMetadata,\n\tProgressCallback,\n\tProgressEvent,\n\tResolvedPaths,\n\tResolvedResource,\n} from \"./core/package-manager.ts\";\nexport { DefaultPackageManager } from \"./core/package-manager.ts\";\nexport type { ResourceCollision, ResourceDiagnostic, ResourceLoader } from \"./core/resource-loader.ts\";\nexport { DefaultResourceLoader, loadProjectContextFiles } from \"./core/resource-loader.ts\";\n// SDK for programmatic usage\nexport {\n\tAgentSessionRuntime,\n\ttype AgentSessionRuntimeDiagnostic,\n\ttype AgentSessionServices,\n\ttype CreateAgentSessionFromServicesOptions,\n\ttype CreateAgentSessionOptions,\n\ttype CreateAgentSessionResult,\n\ttype CreateAgentSessionRuntimeFactory,\n\ttype CreateAgentSessionRuntimeResult,\n\ttype CreateAgentSessionServicesOptions,\n\t// Factory\n\tcreateAgentSession,\n\tcreateAgentSessionFromServices,\n\tcreateAgentSessionRuntime,\n\tcreateAgentSessionServices,\n\tcreateBashTool,\n\t// Tool factories (for custom cwd)\n\tcreateCodingTools,\n\tcreateEditTool,\n\tcreateFindTool,\n\tcreateGrepTool,\n\tcreateLsTool,\n\tcreatePowerShellTool,\n\tcreateReadOnlyTools,\n\tcreateReadTool,\n\tcreateWriteTool,\n\ttype PromptTemplate,\n} from \"./core/sdk.ts\";\nexport {\n\ttype BranchSummaryEntry,\n\tbuildContextEntries,\n\tbuildSessionContext,\n\tbuildSessionProjection,\n\ttype CompactionEntry,\n\ttype ContextEditableContent,\n\ttype ContextEditEntry,\n\tCURRENT_SESSION_VERSION,\n\ttype CustomEntry,\n\ttype CustomMessageEntry,\n\ttype FileEntry,\n\tgetLatestCompactionEntry,\n\ttype ModelChangeEntry,\n\tmigrateSessionEntries,\n\ttype NewSessionOptions,\n\ttype ProjectedSessionEntry,\n\tparseSessionEntries,\n\ttype SessionContext,\n\ttype SessionEntry,\n\ttype SessionEntryBase,\n\ttype SessionHeader,\n\ttype SessionInfo,\n\ttype SessionInfoEntry,\n\tSessionManager,\n\ttype SessionMessageEntry,\n\ttype SessionProjection,\n\ttype SessionTreeNode,\n\tsessionEntryToContextMessages,\n\ttype ThinkingLevelChangeEntry,\n} from \"./core/session-manager.ts\";\nexport {\n\ttype CacheWarmingMode,\n\ttype CompactionModelOverride,\n\ttype CompactionSettings,\n\ttype DefaultProjectTrust,\n\ttype FullscreenExitOutput,\n\ttype ImageSettings,\n\ttype PackageSource,\n\ttype RetrySettings,\n\tSettingsManager,\n\ttype SettingsManagerCreateOptions,\n\ttype TuiMode,\n} from \"./core/settings-manager.ts\";\n// Skills\nexport {\n\tformatSkillsForPrompt,\n\ttype LoadSkillsFromDirOptions,\n\ttype LoadSkillsResult,\n\tloadSkills,\n\tloadSkillsFromDir,\n\ttype Skill,\n\ttype SkillFrontmatter,\n} from \"./core/skills.ts\";\nexport { createSyntheticSourceInfo } from \"./core/source-info.ts\";\nexport { type EditDiffResult, generateDiffString, generateUnifiedPatch } from \"./core/tools/edit-diff.ts\";\n// Tools\nexport {\n\ttype BashOperations,\n\ttype BashSpawnContext,\n\ttype BashSpawnHook,\n\ttype BashToolDetails,\n\ttype BashToolInput,\n\ttype BashToolOptions,\n\tcreateBashToolDefinition,\n\tcreateEditToolDefinition,\n\tcreateFindToolDefinition,\n\tcreateGrepToolDefinition,\n\tcreateLocalBashOperations,\n\tcreateLocalPowerShellOperations,\n\tcreateLsToolDefinition,\n\tcreatePowerShellToolDefinition,\n\tcreateReadToolDefinition,\n\tcreateWriteToolDefinition,\n\tDEFAULT_MAX_BYTES,\n\tDEFAULT_MAX_LINES,\n\ttype Diagnostic,\n\ttype DiagnosticEvidenceRecord,\n\ttype DiagnosticPosition,\n\ttype DiagnosticRange,\n\ttype DiagnosticSeverityCounts,\n\ttype DiagnosticsOperations,\n\ttype DiagnosticsOutcome,\n\ttype DiagnosticUnavailableKind,\n\ttype EditOperations,\n\ttype EditToolDetails,\n\ttype EditToolInput,\n\ttype EditToolOptions,\n\ttype FindOperations,\n\ttype FindToolDetails,\n\ttype FindToolInput,\n\ttype FindToolOptions,\n\tformatSize,\n\ttype GrepOperations,\n\ttype GrepToolDetails,\n\ttype GrepToolInput,\n\ttype GrepToolOptions,\n\ttype LsOperations,\n\ttype LsToolDetails,\n\ttype LsToolInput,\n\ttype LsToolOptions,\n\ttype PowerShellOperations,\n\ttype PowerShellSpawnContext,\n\ttype PowerShellSpawnHook,\n\ttype PowerShellToolDetails,\n\ttype PowerShellToolInput,\n\ttype PowerShellToolOptions,\n\ttype ReadOperations,\n\ttype ReadToolDetails,\n\ttype ReadToolInput,\n\ttype ReadToolOptions,\n\ttype ToolsOptions,\n\ttype TruncationOptions,\n\ttype TruncationResult,\n\ttruncateHead,\n\ttruncateLine,\n\ttruncateTail,\n\ttype WriteOperations,\n\ttype WriteToolDetails,\n\ttype WriteToolInput,\n\ttype WriteToolOptions,\n\twithFileMutationQueue,\n} from \"./core/tools/index.ts\";\nexport {\n\thasTrustRequiringProjectResources,\n\ttype ProjectTrustDecision,\n\tProjectTrustStore,\n\ttype ProjectTrustStoreEntry,\n\ttype ProjectTrustUpdate,\n} from \"./core/trust-manager.ts\";\n// Main entry point\nexport { type MainOptions, main } from \"./main.ts\";\n// Run modes for programmatic SDK usage\nexport {\n\tInteractiveMode,\n\ttype InteractiveModeOptions,\n\ttype JsonAgentSessionEvent,\n\ttype ModelInfo,\n\ttype PrintModeOptions,\n\tRpcClient,\n\ttype RpcClientOptions,\n\ttype RpcCommand,\n\ttype RpcEventListener,\n\ttype RpcExtensionUIRequest,\n\ttype RpcExtensionUIResponse,\n\ttype RpcResponse,\n\ttype RpcSessionState,\n\trunPrintMode,\n\trunRpcMode,\n} from \"./modes/index.ts\";\n// UI components for extensions\nexport {\n\tArminComponent,\n\tAssistantMessageComponent,\n\tBashExecutionComponent,\n\tBorderedLoader,\n\tBranchSummaryMessageComponent,\n\tCompactionSummaryMessageComponent,\n\tCustomEditor,\n\ttype CustomEditorOptions,\n\tCustomMessageComponent,\n\tDynamicBorder,\n\tExtensionEditorComponent,\n\tExtensionInputComponent,\n\tExtensionSelectorComponent,\n\tFooterComponent,\n\tkeyHint,\n\tkeyText,\n\tLoginDialogComponent,\n\tModelSelectorComponent,\n\tOAuthSelectorComponent,\n\ttype RenderDiffOptions,\n\trawKeyHint,\n\trenderDiff,\n\tSessionSelectorComponent,\n\ttype SettingsCallbacks,\n\ttype SettingsConfig,\n\tSettingsSelectorComponent,\n\tShowImagesSelectorComponent,\n\tSkillInvocationMessageComponent,\n\tThemeSelectorComponent,\n\tThinkingSelectorComponent,\n\tToolExecutionComponent,\n\ttype ToolExecutionOptions,\n\tTreeSelectorComponent,\n\ttruncateToVisualLines,\n\tUserMessageComponent,\n\tUserMessageSelectorComponent,\n\ttype VisualTruncateResult,\n} from \"./modes/interactive/components/index.ts\";\n// Theme utilities for custom tools and extensions\nexport {\n\tgetLanguageFromPath,\n\tgetMarkdownTheme,\n\tgetSelectListTheme,\n\tgetSettingsListTheme,\n\thighlightCode,\n\tinitTheme,\n\tTheme,\n\ttype ThemeColor,\n} from \"./modes/interactive/theme/theme.ts\";\n// Clipboard utilities\nexport { copyToClipboard } from \"./utils/clipboard.ts\";\nexport { parseFrontmatter, stripFrontmatter } from \"./utils/frontmatter.ts\";\nexport { convertToPng } from \"./utils/image-convert.ts\";\nexport { formatDimensionNote, type ResizedImage, resizeImage } from \"./utils/image-resize.ts\";\nexport { detectSupportedImageMimeTypeFromFile } from \"./utils/mime.ts\";\n// Shell utilities\nexport { getPowerShellConfig, getShellConfig } from \"./utils/shell.ts\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAE1B,OAAO,EAAa,SAAS,EAAE,MAAM,eAAe,CAAC;AAErD,eAAe;AACf,OAAO,EACN,eAAe,EACf,WAAW,EACX,WAAW,EACX,eAAe,EACf,aAAa,EACb,aAAa,EACb,OAAO,GACP,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,YAAY,EAOZ,eAAe,GAGf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAEN,oBAAoB,GAGpB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAA2B,MAAM,2CAA2C,CAAC;AAC9G,aAAa;AACb,OAAO,EAMN,sBAAsB,EACtB,8BAA8B,EAC9B,OAAO,EACP,2BAA2B,EAC3B,cAAc,EAEd,YAAY,EACZ,kBAAkB,EAElB,qBAAqB,EACrB,eAAe,EACf,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,aAAa,GACb,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAA0C,MAAM,qBAAqB,CAAC;AAC7F,OAAO,EACN,6BAA6B,GAG7B,MAAM,2BAA2B,CAAC;AAuInC,OAAO,EACN,sBAAsB,EACtB,UAAU,EACV,yBAAyB,EACzB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,sBAAsB,EACtB,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,GACnB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAIN,eAAe,EACf,gCAAgC,GAEh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M,kBAAkB,CAAC","sourcesContent":["// Core session management\n\nexport { type Args, parseArgs } from \"./cli/args.ts\";\n\n// Config paths\nexport {\n\tCONFIG_DIR_NAME,\n\tgetAgentDir,\n\tgetDocsPath,\n\tgetExamplesPath,\n\tgetPackageDir,\n\tgetReadmePath,\n\tVERSION,\n} from \"./config.ts\";\nexport {\n\tAgentSession,\n\ttype AgentSessionConfig,\n\ttype AgentSessionEvent,\n\ttype AgentSessionEventListener,\n\ttype ModelCycleResult,\n\ttype ParsedSkillBlock,\n\ttype PromptOptions,\n\tparseSkillBlock,\n\ttype SessionStats,\n\ttype TreeWorkspacePreview,\n} from \"./core/agent-session.ts\";\nexport { readStoredCredential } from \"./core/auth-storage.ts\";\nexport type { CacheWarmingDecision, CacheWarmingStatus } from \"./core/cache-warmer.ts\";\nexport {\n\ttype CheckpointSettings,\n\tcreateGitCheckpoints,\n\ttype GitCheckpoint,\n\ttype GitCheckpoints,\n} from \"./core/checkpoints/git-checkpoints.ts\";\nexport { createSessionCheckpoints, type SessionCheckpoints } from \"./core/checkpoints/session-checkpoints.ts\";\n// Compaction\nexport {\n\ttype BranchPreparation,\n\ttype BranchSummaryResult,\n\ttype CollectEntriesResult,\n\ttype CompactionResult,\n\ttype CutPointResult,\n\tcalculateContextTokens,\n\tcollectEntriesForBranchSummary,\n\tcompact,\n\tDEFAULT_COMPACTION_SETTINGS,\n\testimateTokens,\n\ttype FileOperations,\n\tfindCutPoint,\n\tfindTurnStartIndex,\n\ttype GenerateBranchSummaryOptions,\n\tgenerateBranchSummary,\n\tgenerateSummary,\n\tgenerateSummaryWithUsage,\n\tgetLastAssistantUsage,\n\tprepareBranchEntries,\n\tserializeConversation,\n\tshouldCompact,\n} from \"./core/compaction/index.ts\";\nexport { createEventBus, type EventBus, type EventBusController } from \"./core/event-bus.ts\";\nexport {\n\tcreateEvidencePolicyExtension,\n\ttype EvidencePolicy,\n\ttype EvidencePolicyInput,\n} from \"./core/evidence-policy.ts\";\n// Extension system\nexport type {\n\tAfterProviderResponseEvent,\n\tAgentActivityOutcome,\n\tAgentBeforeSettleEvent,\n\tAgentBeforeSettleEventResult,\n\tAgentEndEvent,\n\tAgentSettledEvent,\n\tAgentStartEvent,\n\tAgentToolResult,\n\tAgentToolUpdateCallback,\n\tAppKeybinding,\n\tAutocompleteProviderFactory,\n\tBashToolCallEvent,\n\tBeforeAgentStartEvent,\n\tBeforeAgentStartEventResult,\n\tBeforeProviderHeadersEvent,\n\tBeforeProviderRequestEvent,\n\tBeforeProviderRequestEventResult,\n\tBoundaryContextPreview,\n\tBoundaryResult,\n\tBoundaryState,\n\tBuildSystemPromptOptions,\n\tCacheWarmingDecisionEvent,\n\tCacheWarmingDecisionEventResult,\n\tCompactionEntryDraft,\n\tCompactOptions,\n\tContextEditEntryDraft,\n\tContextEvent,\n\tContextEventResult,\n\tContextUsage,\n\tContextWithSystemEvent,\n\tCustomEntryDraft,\n\tCustomMessageEntryDraft,\n\tCustomToolCallEvent,\n\tEditToolCallEvent,\n\tEntryRenderer,\n\tEntryRenderOptions,\n\tExecOptions,\n\tExecResult,\n\tExtension,\n\tExtensionActions,\n\tExtensionAPI,\n\tExtensionCommandContext,\n\tExtensionCommandContextActions,\n\tExtensionContext,\n\tExtensionContextActions,\n\tExtensionError,\n\tExtensionEvent,\n\tExtensionFactory,\n\tExtensionFlag,\n\tExtensionHandler,\n\tExtensionRuntime,\n\tExtensionShortcut,\n\tExtensionUIContext,\n\tExtensionUIDialogOptions,\n\tExtensionWidgetOptions,\n\tFindToolCallEvent,\n\tGrepToolCallEvent,\n\tInlineExtension,\n\tInputEvent,\n\tInputEventResult,\n\tInputSource,\n\tKeybindingsManager,\n\tLoadExtensionsResult,\n\tLsToolCallEvent,\n\tMarkdownTransformContext,\n\tMarkdownTransformer,\n\tMessageEndEvent,\n\tMessageEndEventResult,\n\tMessageRenderer,\n\tMessageRenderOptions,\n\tMessageStartEvent,\n\tMessageUpdateEvent,\n\tModelSelectEvent,\n\tModelSelectSource,\n\tNormalizedBuildSystemPromptOptions,\n\tPowerShellToolCallEvent,\n\tProjectTrustContext,\n\tProjectTrustEvent,\n\tProjectTrustEventDecision,\n\tProjectTrustEventResult,\n\tProjectTrustHandler,\n\tProviderConfig,\n\tProviderModelConfig,\n\tReadToolCallEvent,\n\tRegisteredCommand,\n\tRegisteredTool,\n\tResolvedCommand,\n\tResourcesDiscoverEvent,\n\tResourcesDiscoverResult,\n\tSessionBeforeCompactEvent,\n\tSessionBeforeCompactResult,\n\tSessionBeforeForkEvent,\n\tSessionBeforeForkResult,\n\tSessionBeforeSwitchEvent,\n\tSessionBeforeSwitchResult,\n\tSessionBeforeTreeEvent,\n\tSessionBeforeTreeResult,\n\tSessionBoundaryDraft,\n\tSessionCompactEvent,\n\tSessionCompactFailedEvent,\n\tSessionInfoChangedEvent,\n\tSessionShutdownEvent,\n\tSessionStartEvent,\n\tSessionTreeEvent,\n\tSlashCommandInfo,\n\tSlashCommandSource,\n\tSourceInfo,\n\tTerminalInputHandler,\n\tThinkingLevelSelectEvent,\n\tToolCallEvent,\n\tToolCallEventResult,\n\tToolDefinition,\n\tToolExecutionEndEvent,\n\tToolExecutionMode,\n\tToolExecutionStartEvent,\n\tToolExecutionUpdateEvent,\n\tToolInfo,\n\tToolRenderResultOptions,\n\tToolResultEvent,\n\tToolResultEventResult,\n\tTurnEndEvent,\n\tTurnEndEventResult,\n\tTurnStartEvent,\n\tUIPromptEndEvent,\n\tUIPromptKind,\n\tUIPromptStartEvent,\n\tUserBashEvent,\n\tUserBashEventResult,\n\tWidgetPlacement,\n\tWorkingIndicatorOptions,\n\tWriteToolCallEvent,\n} from \"./core/extensions/index.ts\";\nexport {\n\tcreateExtensionRuntime,\n\tdefineTool,\n\tdiscoverAndLoadExtensions,\n\tExtensionRunner,\n\tisBashToolResult,\n\tisEditToolResult,\n\tisFindToolResult,\n\tisGrepToolResult,\n\tisLsToolResult,\n\tisPowerShellToolResult,\n\tisReadToolResult,\n\tisToolCallEventType,\n\tisWriteToolResult,\n\twrapRegisteredTool,\n\twrapRegisteredTools,\n} from \"./core/extensions/index.ts\";\n// Footer data provider (git branch + extension statuses - data not otherwise available to extensions)\nexport type { ReadonlyFooterDataProvider } from \"./core/footer-data-provider.ts\";\nexport { convertToLlm } from \"./core/messages.ts\";\nexport { ModelRegistry } from \"./core/model-registry.ts\";\nexport {\n\ttype ModelScopeDiagnostic,\n\ttype ResolveCliModelResult,\n\ttype ResolveModelScopeResult,\n\tresolveCliModel,\n\tresolveModelScopeWithDiagnostics,\n\ttype ScopedModel,\n} from \"./core/model-resolver.ts\";\nexport {\n\ttype CreateModelRuntimeOptions,\n\tCredentialSynchronizationError,\n\ttype CredentialSynchronizationOperation,\n\tModelRuntime,\n\ttype ModelRuntimeAuthOverrides,\n} from \"./core/model-runtime.ts\";\nexport type {\n\tPackageManager,\n\tPathMetadata,\n\tProgressCallback,\n\tProgressEvent,\n\tResolvedPaths,\n\tResolvedResource,\n} from \"./core/package-manager.ts\";\nexport { DefaultPackageManager } from \"./core/package-manager.ts\";\nexport type { ResourceCollision, ResourceDiagnostic, ResourceLoader } from \"./core/resource-loader.ts\";\nexport { DefaultResourceLoader, loadProjectContextFiles } from \"./core/resource-loader.ts\";\n// SDK for programmatic usage\nexport {\n\tAgentSessionRuntime,\n\ttype AgentSessionRuntimeDiagnostic,\n\ttype AgentSessionServices,\n\ttype CreateAgentSessionFromServicesOptions,\n\ttype CreateAgentSessionOptions,\n\ttype CreateAgentSessionResult,\n\ttype CreateAgentSessionRuntimeFactory,\n\ttype CreateAgentSessionRuntimeResult,\n\ttype CreateAgentSessionServicesOptions,\n\t// Factory\n\tcreateAgentSession,\n\tcreateAgentSessionFromServices,\n\tcreateAgentSessionRuntime,\n\tcreateAgentSessionServices,\n\tcreateBashTool,\n\t// Tool factories (for custom cwd)\n\tcreateCodingTools,\n\tcreateEditTool,\n\tcreateFindTool,\n\tcreateGrepTool,\n\tcreateLsTool,\n\tcreatePowerShellTool,\n\tcreateReadOnlyTools,\n\tcreateReadTool,\n\tcreateWriteTool,\n\ttype PromptTemplate,\n} from \"./core/sdk.ts\";\nexport {\n\ttype BranchSummaryEntry,\n\tbuildContextEntries,\n\tbuildSessionContext,\n\tbuildSessionProjection,\n\ttype CompactionEntry,\n\ttype ContextEditableContent,\n\ttype ContextEditEntry,\n\tCURRENT_SESSION_VERSION,\n\ttype CustomEntry,\n\ttype CustomMessageEntry,\n\ttype FileEntry,\n\tgetLatestCompactionEntry,\n\ttype ModelChangeEntry,\n\tmigrateSessionEntries,\n\ttype NewSessionOptions,\n\ttype ProjectedSessionEntry,\n\tparseSessionEntries,\n\ttype SessionContext,\n\ttype SessionEntry,\n\ttype SessionEntryBase,\n\ttype SessionHeader,\n\ttype SessionInfo,\n\ttype SessionInfoEntry,\n\tSessionManager,\n\ttype SessionMessageEntry,\n\ttype SessionProjection,\n\ttype SessionTreeNode,\n\tsessionEntryToContextMessages,\n\ttype ThinkingLevelChangeEntry,\n} from \"./core/session-manager.ts\";\nexport {\n\ttype CacheWarmingMode,\n\ttype CompactionModelOverride,\n\ttype CompactionSettings,\n\ttype DefaultProjectTrust,\n\ttype FullscreenExitOutput,\n\ttype ImageSettings,\n\ttype PackageSource,\n\ttype RetrySettings,\n\tSettingsManager,\n\ttype SettingsManagerCreateOptions,\n\ttype TuiMode,\n} from \"./core/settings-manager.ts\";\n// Skills\nexport {\n\tformatSkillsForPrompt,\n\ttype LoadSkillsFromDirOptions,\n\ttype LoadSkillsResult,\n\tloadSkills,\n\tloadSkillsFromDir,\n\ttype Skill,\n\ttype SkillFrontmatter,\n} from \"./core/skills.ts\";\nexport { createSyntheticSourceInfo } from \"./core/source-info.ts\";\nexport { type EditDiffResult, generateDiffString, generateUnifiedPatch } from \"./core/tools/edit-diff.ts\";\n// Tools\nexport {\n\ttype BashOperations,\n\ttype BashSpawnContext,\n\ttype BashSpawnHook,\n\ttype BashToolDetails,\n\ttype BashToolInput,\n\ttype BashToolOptions,\n\tcreateBashToolDefinition,\n\tcreateEditToolDefinition,\n\tcreateFindToolDefinition,\n\tcreateGrepToolDefinition,\n\tcreateLocalBashOperations,\n\tcreateLocalPowerShellOperations,\n\tcreateLsToolDefinition,\n\tcreatePlanPresentTool,\n\tcreatePlanPresentToolDefinition,\n\tcreatePowerShellToolDefinition,\n\tcreateReadToolDefinition,\n\tcreateWriteToolDefinition,\n\tDEFAULT_MAX_BYTES,\n\tDEFAULT_MAX_LINES,\n\ttype Diagnostic,\n\ttype DiagnosticEvidenceRecord,\n\ttype DiagnosticPosition,\n\ttype DiagnosticRange,\n\ttype DiagnosticSeverityCounts,\n\ttype DiagnosticsOperations,\n\ttype DiagnosticsOutcome,\n\ttype DiagnosticUnavailableKind,\n\ttype EditOperations,\n\ttype EditToolDetails,\n\ttype EditToolInput,\n\ttype EditToolOptions,\n\ttype FindOperations,\n\ttype FindToolDetails,\n\ttype FindToolInput,\n\ttype FindToolOptions,\n\tformatSize,\n\ttype GrepOperations,\n\ttype GrepToolDetails,\n\ttype GrepToolInput,\n\ttype GrepToolOptions,\n\ttype LsOperations,\n\ttype LsToolDetails,\n\ttype LsToolInput,\n\ttype LsToolOptions,\n\ttype PlanDecision,\n\ttype PlanPresentDetails,\n\ttype PlanPresenter,\n\ttype PlanPresentInput,\n\ttype PowerShellOperations,\n\ttype PowerShellSpawnContext,\n\ttype PowerShellSpawnHook,\n\ttype PowerShellToolDetails,\n\ttype PowerShellToolInput,\n\ttype PowerShellToolOptions,\n\ttype ReadOperations,\n\ttype ReadToolDetails,\n\ttype ReadToolInput,\n\ttype ReadToolOptions,\n\ttype ToolsOptions,\n\ttype TruncationOptions,\n\ttype TruncationResult,\n\ttruncateHead,\n\ttruncateLine,\n\ttruncateTail,\n\ttype WriteOperations,\n\ttype WriteToolDetails,\n\ttype WriteToolInput,\n\ttype WriteToolOptions,\n\twithFileMutationQueue,\n} from \"./core/tools/index.ts\";\nexport {\n\thasTrustRequiringProjectResources,\n\ttype ProjectTrustDecision,\n\tProjectTrustStore,\n\ttype ProjectTrustStoreEntry,\n\ttype ProjectTrustUpdate,\n} from \"./core/trust-manager.ts\";\n// Main entry point\nexport { type MainOptions, main } from \"./main.ts\";\n// Run modes for programmatic SDK usage\nexport {\n\tInteractiveMode,\n\ttype InteractiveModeOptions,\n\ttype JsonAgentSessionEvent,\n\ttype ModelInfo,\n\ttype PrintModeOptions,\n\tRpcClient,\n\ttype RpcClientOptions,\n\ttype RpcCommand,\n\ttype RpcEventListener,\n\ttype RpcExtensionUIRequest,\n\ttype RpcExtensionUIResponse,\n\ttype RpcResponse,\n\ttype RpcSessionState,\n\trunPrintMode,\n\trunRpcMode,\n} from \"./modes/index.ts\";\n// UI components for extensions\nexport {\n\tArminComponent,\n\tAssistantMessageComponent,\n\tBashExecutionComponent,\n\tBorderedLoader,\n\tBranchSummaryMessageComponent,\n\tCompactionSummaryMessageComponent,\n\tCustomEditor,\n\ttype CustomEditorOptions,\n\tCustomMessageComponent,\n\tDynamicBorder,\n\tExtensionEditorComponent,\n\tExtensionInputComponent,\n\tExtensionSelectorComponent,\n\tFooterComponent,\n\tkeyHint,\n\tkeyText,\n\tLoginDialogComponent,\n\tModelSelectorComponent,\n\tOAuthSelectorComponent,\n\ttype RenderDiffOptions,\n\trawKeyHint,\n\trenderDiff,\n\tSessionSelectorComponent,\n\ttype SettingsCallbacks,\n\ttype SettingsConfig,\n\tSettingsSelectorComponent,\n\tShowImagesSelectorComponent,\n\tSkillInvocationMessageComponent,\n\tThemeSelectorComponent,\n\tThinkingSelectorComponent,\n\tToolExecutionComponent,\n\ttype ToolExecutionOptions,\n\tTreeSelectorComponent,\n\ttruncateToVisualLines,\n\tUserMessageComponent,\n\tUserMessageSelectorComponent,\n\ttype VisualTruncateResult,\n} from \"./modes/interactive/components/index.ts\";\n// Theme utilities for custom tools and extensions\nexport {\n\tgetLanguageFromPath,\n\tgetMarkdownTheme,\n\tgetSelectListTheme,\n\tgetSettingsListTheme,\n\thighlightCode,\n\tinitTheme,\n\tTheme,\n\ttype ThemeColor,\n} from \"./modes/interactive/theme/theme.ts\";\n// Clipboard utilities\nexport { copyToClipboard } from \"./utils/clipboard.ts\";\nexport { parseFrontmatter, stripFrontmatter } from \"./utils/frontmatter.ts\";\nexport { convertToPng } from \"./utils/image-convert.ts\";\nexport { formatDimensionNote, type ResizedImage, resizeImage } from \"./utils/image-resize.ts\";\nexport { detectSupportedImageMimeTypeFromFile } from \"./utils/mime.ts\";\n// Shell utilities\nexport { getPowerShellConfig, getShellConfig } from \"./utils/shell.ts\";\n"]}
@@ -1,8 +1,10 @@
1
+ import type { ChatDetail } from "../../../core/settings-manager.ts";
1
2
  /**
2
3
  * Component for displaying bash command execution with streaming output.
3
4
  */
4
- import { Container, type TUI } from "@earendil-works/pi-tui";
5
+ import { Container, type TUI, type TuiMouseEvent } from "@earendil-works/pi-tui";
5
6
  import { type TruncationResult } from "../../../core/tools/truncate.ts";
7
+ import { type ToolSymbolPreset } from "./tool-panel.ts";
6
8
  export declare class BashExecutionComponent extends Container {
7
9
  private command;
8
10
  private outputLines;
@@ -12,13 +14,22 @@ export declare class BashExecutionComponent extends Container {
12
14
  private truncationResult?;
13
15
  private fullOutputPath?;
14
16
  private expanded;
17
+ private collapsedOverride;
18
+ private chatDetail;
19
+ private symbolPreset;
15
20
  private contentContainer;
16
21
  private displayState?;
17
- constructor(command: string, ui: TUI, excludeFromContext?: boolean);
22
+ private compactSummary;
23
+ constructor(command: string, ui: TUI, excludeFromContext?: boolean, symbolPreset?: ToolSymbolPreset);
18
24
  /**
19
25
  * Set whether the output is expanded (shows full output) or collapsed (preview only).
20
26
  */
21
27
  setExpanded(expanded: boolean): void;
28
+ setChatDetail(detail: ChatDetail): void;
29
+ toggleExpanded(): void;
30
+ handleMouse(event: TuiMouseEvent): ReturnType<Container["handleMouse"]>;
31
+ private isCompact;
32
+ render(width: number): string[];
22
33
  invalidate(): void;
23
34
  appendOutput(chunk: string): void;
24
35
  setComplete(exitCode: number | undefined, cancelled: boolean, truncationResult?: TruncationResult, fullOutputPath?: string): void;
@@ -1 +1 @@
1
- {"version":3,"file":"bash-execution.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/bash-execution.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAwB,KAAK,GAAG,EAAE,MAAM,wBAAwB,CAAC;AACnF,OAAO,EAGN,KAAK,gBAAgB,EAErB,MAAM,iCAAiC,CAAC;AAUzC,qBAAa,sBAAuB,SAAQ,SAAS;IACpD,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,WAAW,CAAgB;IACnC,OAAO,CAAC,MAAM,CAA6D;IAC3E,OAAO,CAAC,QAAQ,CAAiC;IACjD,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,gBAAgB,CAAC,CAAmB;IAC5C,OAAO,CAAC,cAAc,CAAC,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,gBAAgB,CAAY;IAGpC,OAAO,CAAC,YAAY,CAAC,CAAkB;IAEvC,YAAY,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,kBAAkB,UAAQ,EAiC/D;IAED;;OAEG;IACH,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAGnC;IAEQ,UAAU,IAAI,IAAI,CAG1B;IAED,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAgBhC;IAED,WAAW,CACV,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,SAAS,EAAE,OAAO,EAClB,gBAAgB,CAAC,EAAE,gBAAgB,EACnC,cAAc,CAAC,EAAE,MAAM,GACrB,IAAI,CAcN;IAED,OAAO,CAAC,aAAa;IAiGrB;;OAEG;IACH,SAAS,IAAI,MAAM,CAElB;IAED;;OAEG;IACH,UAAU,IAAI,MAAM,CAEnB;IAED;;;;OAIG;IACH,OAAO,IAAI,IAAI,CAEd;CACD","sourcesContent":["/**\n * Component for displaying bash command execution with streaming output.\n */\n\nimport { Container, Loader, Spacer, Text, type TUI } from \"@earendil-works/pi-tui\";\nimport {\n\tDEFAULT_MAX_BYTES,\n\tDEFAULT_MAX_LINES,\n\ttype TruncationResult,\n\ttruncateTail,\n} from \"../../../core/tools/truncate.ts\";\nimport { stripAnsi } from \"../../../utils/ansi.ts\";\nimport { theme } from \"../theme/theme.ts\";\nimport { DynamicBorder } from \"./dynamic-border.ts\";\nimport { formatHiddenLines, keyHint, keyText, previewLineCount } from \"./keybinding-hints.ts\";\nimport { truncateToVisualLines } from \"./visual-truncate.ts\";\n\n// Preview line limit when not expanded (matches tool execution behavior)\nconst PREVIEW_LINES = 20;\n\nexport class BashExecutionComponent extends Container {\n\tprivate command: string;\n\tprivate outputLines: string[] = [];\n\tprivate status: \"running\" | \"complete\" | \"cancelled\" | \"error\" = \"running\";\n\tprivate exitCode: number | undefined = undefined;\n\tprivate loader: Loader;\n\tprivate truncationResult?: TruncationResult;\n\tprivate fullOutputPath?: string;\n\tprivate expanded = false;\n\tprivate contentContainer: Container;\n\t// Display rebuild cache: appendOutput and invalidate() fire far more often\n\t// than the displayed state changes, and the rebuild is allocation-heavy.\n\tprivate displayState?: { key: string };\n\n\tconstructor(command: string, ui: TUI, excludeFromContext = false) {\n\t\tsuper();\n\t\tthis.command = command;\n\n\t\t// Use dim border for excluded-from-context commands (!! prefix)\n\t\tconst colorKey = excludeFromContext ? \"dim\" : \"bashMode\";\n\t\tconst borderColor = (str: string) => theme.fg(colorKey, str);\n\n\t\t// Add spacer\n\t\tthis.addChild(new Spacer(1));\n\n\t\t// Top border\n\t\tthis.addChild(new DynamicBorder(borderColor));\n\n\t\t// Content container (holds dynamic content between borders)\n\t\tthis.contentContainer = new Container();\n\t\tthis.addChild(this.contentContainer);\n\n\t\t// Command header\n\t\tconst header = new Text(theme.fg(colorKey, theme.bold(`$ ${command}`)), 1, 0);\n\t\tthis.contentContainer.addChild(header);\n\n\t\t// Loader\n\t\tthis.loader = new Loader(\n\t\t\tui,\n\t\t\t(spinner) => theme.fg(colorKey, spinner),\n\t\t\t(text) => theme.fg(\"muted\", text),\n\t\t\t`Running... (${keyText(\"tui.select.cancel\")} to cancel)`, // Plain text for loader\n\t\t);\n\t\tthis.contentContainer.addChild(this.loader);\n\n\t\t// Bottom border\n\t\tthis.addChild(new DynamicBorder(borderColor));\n\t}\n\n\t/**\n\t * Set whether the output is expanded (shows full output) or collapsed (preview only).\n\t */\n\tsetExpanded(expanded: boolean): void {\n\t\tthis.expanded = expanded;\n\t\tthis.updateDisplay();\n\t}\n\n\toverride invalidate(): void {\n\t\tsuper.invalidate();\n\t\tthis.updateDisplay();\n\t}\n\n\tappendOutput(chunk: string): void {\n\t\t// Strip ANSI codes and normalize line endings\n\t\t// Note: binary data is already sanitized in tui-renderer.ts executeBashCommand\n\t\tconst clean = stripAnsi(chunk).replace(/\\r\\n/g, \"\\n\").replace(/\\r/g, \"\\n\");\n\n\t\t// Append to output lines\n\t\tconst newLines = clean.split(\"\\n\");\n\t\tif (this.outputLines.length > 0 && newLines.length > 0) {\n\t\t\t// Append first chunk to last line (incomplete line continuation)\n\t\t\tthis.outputLines[this.outputLines.length - 1] += newLines[0];\n\t\t\tthis.outputLines.push(...newLines.slice(1));\n\t\t} else {\n\t\t\tthis.outputLines.push(...newLines);\n\t\t}\n\n\t\tthis.updateDisplay();\n\t}\n\n\tsetComplete(\n\t\texitCode: number | undefined,\n\t\tcancelled: boolean,\n\t\ttruncationResult?: TruncationResult,\n\t\tfullOutputPath?: string,\n\t): void {\n\t\tthis.exitCode = exitCode;\n\t\tthis.status = cancelled\n\t\t\t? \"cancelled\"\n\t\t\t: exitCode !== 0 && exitCode !== undefined && exitCode !== null\n\t\t\t\t? \"error\"\n\t\t\t\t: \"complete\";\n\t\tthis.truncationResult = truncationResult;\n\t\tthis.fullOutputPath = fullOutputPath;\n\n\t\t// Stop loader\n\t\tthis.loader.stop();\n\n\t\tthis.updateDisplay();\n\t}\n\n\tprivate updateDisplay(): void {\n\t\t// Skip the rebuild when nothing observable changed: appendOutput runs\n\t\t// per output chunk and invalidate() runs per TUI invalidation, while\n\t\t// the display only depends on line count, expansion, and completion\n\t\t// state. The last line's length moves with intra-line appends.\n\t\tconst lastLineLength = this.outputLines[this.outputLines.length - 1]?.length ?? 0;\n\t\tconst key = `${this.outputLines.length}:${lastLineLength}:${this.expanded}:${this.status}:${this.exitCode ?? \"none\"}:${this.truncationResult !== undefined}:${this.fullOutputPath !== undefined}`;\n\t\tif (this.displayState?.key === key) return;\n\t\tthis.displayState = { key };\n\n\t\t// Apply truncation for LLM context limits (same limits as bash tool)\n\t\tconst fullOutput = this.outputLines.join(\"\\n\");\n\t\tconst contextTruncation = truncateTail(fullOutput, {\n\t\t\tmaxLines: DEFAULT_MAX_LINES,\n\t\t\tmaxBytes: DEFAULT_MAX_BYTES,\n\t\t});\n\n\t\t// Get the lines to potentially display (after context truncation)\n\t\tconst availableLines = contextTruncation.content ? contextTruncation.content.split(\"\\n\") : [];\n\n\t\t// Apply preview truncation based on expanded state\n\t\tconst previewLogicalLines = availableLines.slice(-previewLineCount(availableLines.length, PREVIEW_LINES));\n\t\tconst hiddenLineCount = availableLines.length - previewLogicalLines.length;\n\n\t\t// Rebuild content container\n\t\tthis.contentContainer.clear();\n\n\t\t// Command header\n\t\tconst header = new Text(theme.fg(\"bashMode\", theme.bold(`$ ${this.command}`)), 1, 0);\n\t\tthis.contentContainer.addChild(header);\n\n\t\t// Output\n\t\tif (availableLines.length > 0) {\n\t\t\t// A preview that hides no line shows all of it. Capping its rows as well would cut\n\t\t\t// wrapped lines with nothing to say so, since the hint counts hidden lines.\n\t\t\tif (this.expanded || hiddenLineCount === 0) {\n\t\t\t\t// Show all lines\n\t\t\t\tconst displayText = availableLines.map((line) => theme.fg(\"muted\", line)).join(\"\\n\");\n\t\t\t\tthis.contentContainer.addChild(new Text(`\\n${displayText}`, 1, 0));\n\t\t\t} else {\n\t\t\t\t// Use shared visual truncation utility with width-aware caching\n\t\t\t\tconst styledOutput = previewLogicalLines.map((line) => theme.fg(\"muted\", line)).join(\"\\n\");\n\t\t\t\tconst styledInput = `\\n${styledOutput}`;\n\t\t\t\tlet cachedWidth: number | undefined;\n\t\t\t\tlet cachedLines: string[] | undefined;\n\t\t\t\tthis.contentContainer.addChild({\n\t\t\t\t\trender: (width: number) => {\n\t\t\t\t\t\tif (cachedLines === undefined || cachedWidth !== width) {\n\t\t\t\t\t\t\tconst result = truncateToVisualLines(styledInput, PREVIEW_LINES, width, 1);\n\t\t\t\t\t\t\tcachedLines = result.visualLines;\n\t\t\t\t\t\t\tcachedWidth = width;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn cachedLines ?? [];\n\t\t\t\t\t},\n\t\t\t\t\tinvalidate: () => {\n\t\t\t\t\t\tcachedWidth = undefined;\n\t\t\t\t\t\tcachedLines = undefined;\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t// Loader or status\n\t\tif (this.status === \"running\") {\n\t\t\tthis.contentContainer.addChild(this.loader);\n\t\t} else {\n\t\t\tconst statusParts: string[] = [];\n\n\t\t\t// Show how many lines are hidden (collapsed preview)\n\t\t\tif (hiddenLineCount > 0) {\n\t\t\t\tif (this.expanded) {\n\t\t\t\t\tstatusParts.push(\n\t\t\t\t\t\t`${theme.fg(\"muted\", \"(\")}${keyHint(\"app.tools.expand\", \"to collapse\")}${theme.fg(\"muted\", \")\")}`,\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tstatusParts.push(formatHiddenLines(hiddenLineCount, \"earlier\"));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.status === \"cancelled\") {\n\t\t\t\tstatusParts.push(theme.fg(\"warning\", \"(cancelled)\"));\n\t\t\t} else if (this.status === \"error\") {\n\t\t\t\tstatusParts.push(theme.fg(\"error\", `(exit ${this.exitCode})`));\n\t\t\t}\n\n\t\t\t// Add truncation warning (context truncation, not preview truncation)\n\t\t\tconst wasTruncated = this.truncationResult?.truncated || contextTruncation.truncated;\n\t\t\tif (wasTruncated && this.fullOutputPath) {\n\t\t\t\tstatusParts.push(theme.fg(\"warning\", `Output truncated. Full output: ${this.fullOutputPath}`));\n\t\t\t}\n\n\t\t\tif (statusParts.length > 0) {\n\t\t\t\tthis.contentContainer.addChild(new Text(`\\n${statusParts.join(\"\\n\")}`, 1, 0));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Get the raw output for creating BashExecutionMessage.\n\t */\n\tgetOutput(): string {\n\t\treturn this.outputLines.join(\"\\n\");\n\t}\n\n\t/**\n\t * Get the command that was executed.\n\t */\n\tgetCommand(): string {\n\t\treturn this.command;\n\t}\n\n\t/**\n\t * Stop the animated loader. Session swaps clear containers wholesale,\n\t * which detaches children without stopping their timers; an in-flight\n\t * component left uncompleted would otherwise animate forever.\n\t */\n\tdispose(): void {\n\t\tthis.loader.stop();\n\t}\n}\n"]}
1
+ {"version":3,"file":"bash-execution.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/bash-execution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AACpE;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAwB,KAAK,GAAG,EAAE,KAAK,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvG,OAAO,EAGN,KAAK,gBAAgB,EAErB,MAAM,iCAAiC,CAAC;AAMzC,OAAO,EAA+C,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAMrG,qBAAa,sBAAuB,SAAQ,SAAS;IACpD,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,WAAW,CAAgB;IACnC,OAAO,CAAC,MAAM,CAA6D;IAC3E,OAAO,CAAC,QAAQ,CAAiC;IACjD,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,gBAAgB,CAAC,CAAmB;IAC5C,OAAO,CAAC,cAAc,CAAC,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,iBAAiB,CAAS;IAClC,OAAO,CAAC,UAAU,CAAyB;IAC3C,OAAO,CAAC,YAAY,CAAmB;IACvC,OAAO,CAAC,gBAAgB,CAAY;IAGpC,OAAO,CAAC,YAAY,CAAC,CAAkB;IACvC,OAAO,CAAC,cAAc,CAAoB;IAE1C,YAAY,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,kBAAkB,UAAQ,EAAE,YAAY,GAAE,gBAA4B,EAkC3G;IAED;;OAEG;IACH,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAInC;IAED,aAAa,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAGtC;IAED,cAAc,IAAI,IAAI,CAIrB;IAEQ,WAAW,CAAC,KAAK,EAAE,aAAa,GAAG,UAAU,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAc/E;IAED,OAAO,CAAC,SAAS;IAIR,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAWvC;IAEQ,UAAU,IAAI,IAAI,CAG1B;IAED,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAgBhC;IAED,WAAW,CACV,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,SAAS,EAAE,OAAO,EAClB,gBAAgB,CAAC,EAAE,gBAAgB,EACnC,cAAc,CAAC,EAAE,MAAM,GACrB,IAAI,CAcN;IAED,OAAO,CAAC,aAAa;IAyGrB;;OAEG;IACH,SAAS,IAAI,MAAM,CAElB;IAED;;OAEG;IACH,UAAU,IAAI,MAAM,CAEnB;IAED;;;;OAIG;IACH,OAAO,IAAI,IAAI,CAEd;CACD","sourcesContent":["import type { ChatDetail } from \"../../../core/settings-manager.ts\";\n/**\n * Component for displaying bash command execution with streaming output.\n */\n\nimport { Container, Loader, Spacer, Text, type TUI, type TuiMouseEvent } from \"@earendil-works/pi-tui\";\nimport {\n\tDEFAULT_MAX_BYTES,\n\tDEFAULT_MAX_LINES,\n\ttype TruncationResult,\n\ttruncateTail,\n} from \"../../../core/tools/truncate.ts\";\nimport { stripAnsi } from \"../../../utils/ansi.ts\";\nimport { theme } from \"../theme/theme.ts\";\nimport { DynamicBorder } from \"./dynamic-border.ts\";\nimport { summarizeOperationError } from \"./error-summary.ts\";\nimport { formatHiddenLines, keyHint, keyText, previewLineCount } from \"./keybinding-hints.ts\";\nimport { countOutputLines, renderCompactOperationRow, type ToolSymbolPreset } from \"./tool-panel.ts\";\nimport { truncateToVisualLines } from \"./visual-truncate.ts\";\n\n// Preview line limit when not expanded (matches tool execution behavior)\nconst PREVIEW_LINES = 20;\n\nexport class BashExecutionComponent extends Container {\n\tprivate command: string;\n\tprivate outputLines: string[] = [];\n\tprivate status: \"running\" | \"complete\" | \"cancelled\" | \"error\" = \"running\";\n\tprivate exitCode: number | undefined = undefined;\n\tprivate loader: Loader;\n\tprivate truncationResult?: TruncationResult;\n\tprivate fullOutputPath?: string;\n\tprivate expanded = false;\n\tprivate collapsedOverride = false;\n\tprivate chatDetail: ChatDetail = \"details\";\n\tprivate symbolPreset: ToolSymbolPreset;\n\tprivate contentContainer: Container;\n\t// Display rebuild cache: appendOutput and invalidate() fire far more often\n\t// than the displayed state changes, and the rebuild is allocation-heavy.\n\tprivate displayState?: { key: string };\n\tprivate compactSummary = \"0 output lines\";\n\n\tconstructor(command: string, ui: TUI, excludeFromContext = false, symbolPreset: ToolSymbolPreset = \"unicode\") {\n\t\tsuper();\n\t\tthis.command = command;\n\t\tthis.symbolPreset = symbolPreset;\n\n\t\t// Use dim border for excluded-from-context commands (!! prefix)\n\t\tconst colorKey = excludeFromContext ? \"dim\" : \"bashMode\";\n\t\tconst borderColor = (str: string) => theme.fg(colorKey, str);\n\n\t\t// Add spacer\n\t\tthis.addChild(new Spacer(1));\n\n\t\t// Top border\n\t\tthis.addChild(new DynamicBorder(borderColor));\n\n\t\t// Content container (holds dynamic content between borders)\n\t\tthis.contentContainer = new Container();\n\t\tthis.addChild(this.contentContainer);\n\n\t\t// Command header\n\t\tconst header = new Text(theme.fg(colorKey, theme.bold(`$ ${command}`)), 1, 0);\n\t\tthis.contentContainer.addChild(header);\n\n\t\t// Loader\n\t\tthis.loader = new Loader(\n\t\t\tui,\n\t\t\t(spinner) => theme.fg(colorKey, spinner),\n\t\t\t(text) => theme.fg(\"muted\", text),\n\t\t\t`Running... (${keyText(\"tui.select.cancel\")} to cancel)`, // Plain text for loader\n\t\t);\n\t\tthis.contentContainer.addChild(this.loader);\n\n\t\t// Bottom border\n\t\tthis.addChild(new DynamicBorder(borderColor));\n\t}\n\n\t/**\n\t * Set whether the output is expanded (shows full output) or collapsed (preview only).\n\t */\n\tsetExpanded(expanded: boolean): void {\n\t\tthis.collapsedOverride = false;\n\t\tthis.expanded = expanded;\n\t\tthis.updateDisplay();\n\t}\n\n\tsetChatDetail(detail: ChatDetail): void {\n\t\tthis.chatDetail = detail;\n\t\tthis.setExpanded(detail === \"all\");\n\t}\n\n\ttoggleExpanded(): void {\n\t\tthis.expanded = !this.expanded;\n\t\tthis.collapsedOverride = !this.expanded;\n\t\tthis.updateDisplay();\n\t}\n\n\toverride handleMouse(event: TuiMouseEvent): ReturnType<Container[\"handleMouse\"]> {\n\t\tif (event.type !== \"click\" || event.button !== \"left\" || event.y < 0 || event.y >= event.height) return undefined;\n\t\tif (event.y !== (this.isCompact() ? 0 : 2)) return undefined;\n\t\tthis.toggleExpanded();\n\t\treturn {\n\t\t\thandled: true,\n\t\t\ttarget: {\n\t\t\t\tcomponent: this,\n\t\t\t\toriginX: event.screenX - event.x,\n\t\t\t\toriginY: event.screenY - event.y,\n\t\t\t\twidth: event.width,\n\t\t\t\theight: event.height,\n\t\t\t},\n\t\t};\n\t}\n\n\tprivate isCompact(): boolean {\n\t\treturn this.collapsedOverride || (this.chatDetail === \"overview\" && !this.expanded);\n\t}\n\n\toverride render(width: number): string[] {\n\t\tif (!this.isCompact()) return super.render(width);\n\t\treturn renderCompactOperationRow(\n\t\t\t{\n\t\t\t\tlabel: `$ ${this.command}`,\n\t\t\t\tlifecycle: this.status === \"running\" ? \"running\" : this.status === \"complete\" ? \"done\" : \"error\",\n\t\t\t\tsymbolPreset: this.symbolPreset,\n\t\t\t\tsummary: this.compactSummary,\n\t\t\t},\n\t\t\twidth,\n\t\t);\n\t}\n\n\toverride invalidate(): void {\n\t\tsuper.invalidate();\n\t\tthis.updateDisplay();\n\t}\n\n\tappendOutput(chunk: string): void {\n\t\t// Strip ANSI codes and normalize line endings\n\t\t// Note: binary data is already sanitized in tui-renderer.ts executeBashCommand\n\t\tconst clean = stripAnsi(chunk).replace(/\\r\\n/g, \"\\n\").replace(/\\r/g, \"\\n\");\n\n\t\t// Append to output lines\n\t\tconst newLines = clean.split(\"\\n\");\n\t\tif (this.outputLines.length > 0 && newLines.length > 0) {\n\t\t\t// Append first chunk to last line (incomplete line continuation)\n\t\t\tthis.outputLines[this.outputLines.length - 1] += newLines[0];\n\t\t\tthis.outputLines.push(...newLines.slice(1));\n\t\t} else {\n\t\t\tthis.outputLines.push(...newLines);\n\t\t}\n\n\t\tthis.updateDisplay();\n\t}\n\n\tsetComplete(\n\t\texitCode: number | undefined,\n\t\tcancelled: boolean,\n\t\ttruncationResult?: TruncationResult,\n\t\tfullOutputPath?: string,\n\t): void {\n\t\tthis.exitCode = exitCode;\n\t\tthis.status = cancelled\n\t\t\t? \"cancelled\"\n\t\t\t: exitCode !== 0 && exitCode !== undefined && exitCode !== null\n\t\t\t\t? \"error\"\n\t\t\t\t: \"complete\";\n\t\tthis.truncationResult = truncationResult;\n\t\tthis.fullOutputPath = fullOutputPath;\n\n\t\t// Stop loader\n\t\tthis.loader.stop();\n\n\t\tthis.updateDisplay();\n\t}\n\n\tprivate updateDisplay(): void {\n\t\t// Skip the rebuild when nothing observable changed: appendOutput runs\n\t\t// per output chunk and invalidate() runs per TUI invalidation, while\n\t\t// the display only depends on line count, expansion, and completion\n\t\t// state. The last line's length moves with intra-line appends.\n\t\tconst lastLineLength = this.outputLines[this.outputLines.length - 1]?.length ?? 0;\n\t\tconst key = `${this.outputLines.length}:${lastLineLength}:${this.expanded}:${this.status}:${this.exitCode ?? \"none\"}:${this.truncationResult !== undefined}:${this.fullOutputPath !== undefined}`;\n\t\tif (this.displayState?.key === key) return;\n\t\tthis.displayState = { key };\n\n\t\t// Apply truncation for LLM context limits (same limits as bash tool)\n\t\tconst fullOutput = this.outputLines.join(\"\\n\");\n\t\tconst outputLineCount = countOutputLines(fullOutput);\n\t\tconst diagnostic = this.status === \"error\" ? summarizeOperationError(fullOutput) : undefined;\n\t\tthis.compactSummary =\n\t\t\tthis.status === \"cancelled\"\n\t\t\t\t? \"cancelled\"\n\t\t\t\t: this.status === \"error\"\n\t\t\t\t\t? `exit ${this.exitCode}${diagnostic ? `: ${diagnostic}` : \"\"}`\n\t\t\t\t\t: `${outputLineCount} output line${outputLineCount === 1 ? \"\" : \"s\"}`;\n\t\tconst contextTruncation = truncateTail(fullOutput, {\n\t\t\tmaxLines: DEFAULT_MAX_LINES,\n\t\t\tmaxBytes: DEFAULT_MAX_BYTES,\n\t\t});\n\n\t\t// Get the lines to potentially display (after context truncation)\n\t\tconst availableLines = contextTruncation.content ? contextTruncation.content.split(\"\\n\") : [];\n\n\t\t// Apply preview truncation based on expanded state\n\t\tconst previewLogicalLines = availableLines.slice(-previewLineCount(availableLines.length, PREVIEW_LINES));\n\t\tconst hiddenLineCount = availableLines.length - previewLogicalLines.length;\n\n\t\t// Rebuild content container\n\t\tthis.contentContainer.clear();\n\n\t\t// Command header\n\t\tconst header = new Text(theme.fg(\"bashMode\", theme.bold(`$ ${this.command}`)), 1, 0);\n\t\tthis.contentContainer.addChild(header);\n\n\t\t// Output\n\t\tif (availableLines.length > 0) {\n\t\t\t// A preview that hides no line shows all of it. Capping its rows as well would cut\n\t\t\t// wrapped lines with nothing to say so, since the hint counts hidden lines.\n\t\t\tif (this.expanded || hiddenLineCount === 0) {\n\t\t\t\t// Show all lines\n\t\t\t\tconst displayText = availableLines.map((line) => theme.fg(\"muted\", line)).join(\"\\n\");\n\t\t\t\tthis.contentContainer.addChild(new Text(`\\n${displayText}`, 1, 0));\n\t\t\t} else {\n\t\t\t\t// Use shared visual truncation utility with width-aware caching\n\t\t\t\tconst styledOutput = previewLogicalLines.map((line) => theme.fg(\"muted\", line)).join(\"\\n\");\n\t\t\t\tconst styledInput = `\\n${styledOutput}`;\n\t\t\t\tlet cachedWidth: number | undefined;\n\t\t\t\tlet cachedLines: string[] | undefined;\n\t\t\t\tthis.contentContainer.addChild({\n\t\t\t\t\trender: (width: number) => {\n\t\t\t\t\t\tif (cachedLines === undefined || cachedWidth !== width) {\n\t\t\t\t\t\t\tconst result = truncateToVisualLines(styledInput, PREVIEW_LINES, width, 1);\n\t\t\t\t\t\t\tcachedLines = result.visualLines;\n\t\t\t\t\t\t\tcachedWidth = width;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn cachedLines ?? [];\n\t\t\t\t\t},\n\t\t\t\t\tinvalidate: () => {\n\t\t\t\t\t\tcachedWidth = undefined;\n\t\t\t\t\t\tcachedLines = undefined;\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t// Loader or status\n\t\tif (this.status === \"running\") {\n\t\t\tthis.contentContainer.addChild(this.loader);\n\t\t} else {\n\t\t\tconst statusParts: string[] = [];\n\n\t\t\t// Show how many lines are hidden (collapsed preview)\n\t\t\tif (hiddenLineCount > 0) {\n\t\t\t\tif (this.expanded) {\n\t\t\t\t\tstatusParts.push(\n\t\t\t\t\t\t`${theme.fg(\"muted\", \"(\")}${keyHint(\"app.tools.expand\", \"to collapse\")}${theme.fg(\"muted\", \")\")}`,\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tstatusParts.push(formatHiddenLines(hiddenLineCount, \"earlier\"));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.status === \"cancelled\") {\n\t\t\t\tstatusParts.push(theme.fg(\"warning\", \"(cancelled)\"));\n\t\t\t} else if (this.status === \"error\") {\n\t\t\t\tstatusParts.push(theme.fg(\"error\", `(exit ${this.exitCode})`));\n\t\t\t}\n\n\t\t\t// Add truncation warning (context truncation, not preview truncation)\n\t\t\tconst wasTruncated = this.truncationResult?.truncated || contextTruncation.truncated;\n\t\t\tif (wasTruncated && this.fullOutputPath) {\n\t\t\t\tstatusParts.push(theme.fg(\"warning\", `Output truncated. Full output: ${this.fullOutputPath}`));\n\t\t\t}\n\n\t\t\tif (statusParts.length > 0) {\n\t\t\t\tthis.contentContainer.addChild(new Text(`\\n${statusParts.join(\"\\n\")}`, 1, 0));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Get the raw output for creating BashExecutionMessage.\n\t */\n\tgetOutput(): string {\n\t\treturn this.outputLines.join(\"\\n\");\n\t}\n\n\t/**\n\t * Get the command that was executed.\n\t */\n\tgetCommand(): string {\n\t\treturn this.command;\n\t}\n\n\t/**\n\t * Stop the animated loader. Session swaps clear containers wholesale,\n\t * which detaches children without stopping their timers; an in-flight\n\t * component left uncompleted would otherwise animate forever.\n\t */\n\tdispose(): void {\n\t\tthis.loader.stop();\n\t}\n}\n"]}