@timurproko/a1 0.2.7-dev.809 → 0.2.7-dev.820

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/README.md +4 -2
  2. package/dist/app/session-shell/resident-tab-coordinator.d.ts +6 -9
  3. package/dist/app/session-shell/resident-tab-coordinator.js +9 -52
  4. package/dist/app/session-shell/response-copy-transport.d.ts +13 -0
  5. package/dist/app/session-shell/response-copy-transport.js +16 -7
  6. package/dist/app/session-shell/session-shell-root.d.ts +1 -2
  7. package/dist/app/session-shell/session-shell.js +2 -2
  8. package/dist/app/session-shell/session-viewport-controller.js +6 -4
  9. package/dist/composition/owned-ui.js +1 -2
  10. package/dist/features/owned-ui/settings-app.js +1 -1
  11. package/dist/foundation/release/progress-palette.generated.d.ts +2 -2
  12. package/dist/foundation/release/progress-palette.generated.js +2 -2
  13. package/dist/foundation/resident-tabs/bridge-client.d.ts +1 -1
  14. package/dist/foundation/resident-tabs/bridge-client.js +1 -1
  15. package/dist/foundation/resident-tabs/settings.d.ts +0 -1
  16. package/dist/foundation/resident-tabs/settings.js +0 -2
  17. package/dist/foundation/startup/startup-descriptor.js +2 -2
  18. package/dist/integrations/pi/components/resources/builtin-themes.d.ts +2 -2
  19. package/dist/integrations/pi/components/resources/builtin-themes.js +2 -2
  20. package/dist/integrations/pi/components/shell-extension-ui.js +79 -60
  21. package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.d.ts +1 -1
  22. package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.js +1 -1
  23. package/dist/integrations/pi/components/upstream/assets/earendil-image.json +2 -2
  24. package/dist/integrations/pi/components/upstream/components/countdown-timer.d.ts +1 -1
  25. package/dist/integrations/pi/components/upstream/components/earendil-announcement.js +1 -1
  26. package/dist/integrations/pi/components/upstream/components/extension-editor.d.ts +1 -1
  27. package/dist/integrations/pi/components/upstream/components/extension-editor.js +1 -1
  28. package/dist/integrations/pi/components/upstream/components/extension-input.js +1 -1
  29. package/dist/integrations/pi/components/upstream/components/extension-selector.js +1 -1
  30. package/dist/integrations/pi/components/upstream/components/mermaid.js +1 -1
  31. package/dist/integrations/pi/components/upstream/components/owned-editor.d.ts +1 -1
  32. package/dist/integrations/pi/components/upstream/components/owned-editor.js +1 -1
  33. package/dist/integrations/pi/components/upstream/components/pi-logo.js +1 -1
  34. package/dist/integrations/pi/components/upstream/components/scoped-models-selector.d.ts +1 -1
  35. package/dist/integrations/pi/components/upstream/components/session-footer.js +1 -1
  36. package/dist/integrations/pi/components/upstream/components/session-selector-search.js +1 -1
  37. package/dist/integrations/pi/components/upstream/components/session-selector.js +1 -1
  38. package/dist/integrations/pi/components/upstream/components/skill-invocation-message.d.ts +1 -1
  39. package/dist/integrations/pi/components/upstream/components/skill-invocation-message.js +1 -1
  40. package/dist/integrations/pi/components/upstream/components/status-indicator.d.ts +1 -1
  41. package/dist/integrations/pi/components/upstream/components/status-indicator.js +1 -1
  42. package/dist/integrations/pi/components/upstream/components/themed-text.d.ts +1 -1
  43. package/dist/integrations/pi/components/upstream/components/themed-text.js +1 -1
  44. package/dist/integrations/pi/components/upstream/components/thinking-selector.d.ts +1 -1
  45. package/dist/integrations/pi/components/upstream/components/thinking-selector.js +1 -1
  46. package/dist/integrations/pi/components/upstream/components/tool-execution.d.ts +2 -4
  47. package/dist/integrations/pi/components/upstream/components/tool-execution.js +77 -98
  48. package/dist/integrations/pi/components/upstream/components/tree-selector.d.ts +1 -1
  49. package/dist/integrations/pi/components/upstream/components/tree-selector.js +1 -1
  50. package/dist/integrations/pi/components/upstream/components/trust-selector.js +1 -1
  51. package/dist/integrations/pi/components/upstream/external-editor.js +1 -1
  52. package/dist/integrations/pi/components/upstream/history/editor-core.d.ts +1 -1
  53. package/dist/integrations/pi/components/upstream/history/editor-core.js +1 -1
  54. package/dist/integrations/pi/components/upstream/history/kill-ring.d.ts +1 -1
  55. package/dist/integrations/pi/components/upstream/history/kill-ring.js +1 -1
  56. package/dist/integrations/pi/components/upstream/history/printable-key.js +1 -1
  57. package/dist/integrations/pi/components/upstream/history/text-helpers.js +1 -1
  58. package/dist/integrations/pi/components/upstream/history/undo-stack.d.ts +1 -1
  59. package/dist/integrations/pi/components/upstream/history/undo-stack.js +1 -1
  60. package/dist/integrations/pi/components/upstream/history/word-navigation.js +1 -1
  61. package/dist/integrations/pi/components/upstream/model-search.d.ts +1 -1
  62. package/dist/integrations/pi/components/upstream/program-status-reporter.d.ts +1 -1
  63. package/dist/integrations/pi/components/upstream/theme/theme-controller.d.ts +1 -1
  64. package/dist/integrations/pi/components/upstream/theme/theme.js +1 -1
  65. package/dist/integrations/pi/engine/resources/changelog.json +4 -4
  66. package/dist/integrations/pi/startup-public.js +164 -150
  67. package/dist/integrations/pi/startup-public.manifest.json +351 -310
  68. package/dist/integrations/pi/tui-runtime/adapter.js +4 -0
  69. package/dist/integrations/pi/tui-runtime/contracts.d.ts +5 -0
  70. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +1 -1
  71. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.js +1 -1
  72. package/dist/native/darwin-arm64/manifest.json +1 -1
  73. package/dist/native/darwin-arm64/terminal-host.manifest.json +3 -3
  74. package/dist/native/darwin-arm64/terminal-host.node +0 -0
  75. package/dist/native/darwin-x64/manifest.json +1 -1
  76. package/dist/native/darwin-x64/terminal-host.manifest.json +3 -3
  77. package/dist/native/darwin-x64/terminal-host.node +0 -0
  78. package/dist/native/linux-x64/manifest.json +1 -1
  79. package/dist/native/linux-x64/terminal-host.manifest.json +3 -3
  80. package/dist/native/linux-x64/terminal-host.node +0 -0
  81. package/dist/native/win32-x64/manifest.json +2 -2
  82. package/dist/native/win32-x64/process-guardian.node +0 -0
  83. package/dist/native/win32-x64/terminal-host.manifest.json +3 -3
  84. package/dist/native/win32-x64/terminal-host.node +0 -0
  85. package/dist/runtime-payload-inventory.json +5181 -5369
  86. package/dist/ui/components/dialog-panel.js +1 -1
  87. package/dist/ui/components/prompt-input.d.ts +2 -2
  88. package/dist/ui/components/prompt-input.js +2 -2
  89. package/dist/ui/components/submitted-prompt.d.ts +2 -2
  90. package/dist/ui/components/submitted-prompt.js +3 -3
  91. package/dist/ui/components/transcript-viewport.d.ts +1 -1
  92. package/dist/ui/components/transcript-viewport.js +151 -43
  93. package/dist/ui/settings/declarations.d.ts +13 -9
  94. package/dist/ui/settings/declarations.js +10 -7
  95. package/dist/ui/settings/migrations.js +7 -0
  96. package/docs/architecture/resident-tabs.md +6 -6
  97. package/docs/architecture/response-copy-delivery.md +1 -1
  98. package/docs/architecture/toolchain.md +2 -2
  99. package/package.json +5 -5
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/coding-agent/src/modes/interactive/components/extension-editor.ts.
4
4
  * Modifications: Mechanical port: remap pi-tui to the root public singleton, use owned
5
5
  * keybindings/theme and external-editor seams, preserve editor layout, hints, focus, submission,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/coding-agent/src/modes/interactive/components/extension-input.ts.
4
4
  * Modifications: Mechanical port: remap public imports, use ECMAScript private fields, and route the
5
5
  * bare-A1 instruction row and chrome through the shared semantic shortcut and compact padded
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/coding-agent/src/modes/interactive/components/extension-selector.ts.
4
4
  * Modifications: Mechanical port: remap public imports, use ECMAScript private fields, and route the
5
5
  * bare-A1 instruction row and chrome through the shared semantic shortcut and compact padded
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/coding-agent/src/modes/interactive/components/mermaid.ts.
4
4
  * Modifications: Mechanical pinned source port with private imports remapped to public package-root
5
5
  * types/APIs and A1-owned theme boundaries; behavior remains acceptance-tested.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/coding-agent/src/modes/interactive/components/custom-editor.ts.
4
4
  * Modifications: A1-owned class name and synchronized A1 keybinding contract replace the nominal
5
5
  * private upstream keybinding constructor dependency; bare A1 injects the shared Settings/agent input
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/coding-agent/src/modes/interactive/components/custom-editor.ts.
4
4
  * Modifications: A1-owned class name and synchronized A1 keybinding contract replace the nominal
5
5
  * private upstream keybinding constructor dependency; bare A1 injects the shared Settings/agent input
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/coding-agent/src/modes/interactive/components/pi-logo.ts.
4
4
  * Modifications: Remapped the private theme import to A1's public-backed adapter and composed the
5
5
  * fixed-color logo into the owned startup header.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/coding-agent/src/modes/interactive/components/scoped-models-selector.ts.
4
4
  * Modifications: Source-synchronized scoped-model selector port: preserve session-only toggles,
5
5
  * search, bulk/provider/reorder actions, dirty state, Ctrl+S persistence, refresh status,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/coding-agent/src/modes/interactive/components/footer.ts.
4
4
  * Modifications: Consumes neutral owned-UI view data instead of a fabricated concrete AgentSession;
5
5
  * preserves the latest physical route for virtual models; an explicit bare-A1 profile colors the
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/coding-agent/src/modes/interactive/components/session-selector-search.ts.
4
4
  * Modifications: Source-synchronized session search port with only the public SessionInfo type import
5
5
  * remapped.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/coding-agent/src/modes/interactive/components/session-selector.ts.
4
4
  * Modifications: Source-synchronized session selector port: preserve threaded/current/all scope,
5
5
  * search, sort, named/path filters, rename, delete confirmation, active-session protection,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/coding-agent/src/modes/interactive/components/skill-invocation-message.ts.
4
4
  * Modifications: Mechanical port uses A1's public pi-tui instance, owned theme boundary, and
5
5
  * root-instance keybinding registry because the public coding-agent component closes over a second
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/coding-agent/src/modes/interactive/components/skill-invocation-message.ts.
4
4
  * Modifications: Mechanical port uses A1's public pi-tui instance, owned theme boundary, and
5
5
  * root-instance keybinding registry because the public coding-agent component closes over a second
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/coding-agent/src/modes/interactive/components/status-indicator.ts.
4
4
  * Modifications: Mechanical source port with public package-root keybinding, Loader, and owned
5
5
  * theme/countdown imports plus ECMAScript private fields.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/coding-agent/src/modes/interactive/components/status-indicator.ts.
4
4
  * Modifications: Mechanical source port with public package-root keybinding, Loader, and owned
5
5
  * theme/countdown imports plus ECMAScript private fields.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/coding-agent/src/modes/interactive/components/themed-text.ts.
4
4
  * Modifications: Integrated invalidation-aware text into A1's owned startup header and notices;
5
5
  * repository formatting only.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/coding-agent/src/modes/interactive/components/themed-text.ts.
4
4
  * Modifications: Integrated invalidation-aware text into A1's owned startup header and notices;
5
5
  * repository formatting only.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/coding-agent/src/modes/interactive/components/thinking-selector.ts.
4
4
  * Modifications: Preserve the searchable thinking-level selector, current/default semantics,
5
5
  * selection, and focus while accepting the active bare-A1 cycle-key label from the shell, styling the
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/coding-agent/src/modes/interactive/components/thinking-selector.ts.
4
4
  * Modifications: Preserve the searchable thinking-level selector, current/default semantics,
5
5
  * selection, and focus while accepting the active bare-A1 cycle-key label from the shell, styling the
@@ -14,7 +14,6 @@ export interface ToolExecutionOptions {
14
14
  export declare class ToolExecutionComponent extends Container {
15
15
  private contentBox;
16
16
  private contentText;
17
- private contentTextRegion;
18
17
  private selfRenderContainer;
19
18
  private selfRenderHeight;
20
19
  private callRendererComponent;
@@ -42,9 +41,6 @@ export declare class ToolExecutionComponent extends Container {
42
41
  private result;
43
42
  private hideComponent;
44
43
  constructor(toolName: string, toolCallId: string, args: any, options: ToolExecutionOptions | undefined, toolDefinition: ToolRenderers | ToolDefinition<any, any, any> | undefined, ui: TUI, cwd: string);
45
- private getCallRenderer;
46
- private getResultRenderer;
47
- private hasRendererDefinition;
48
44
  private getRenderShell;
49
45
  private getRenderContext;
50
46
  private createCallFallback;
@@ -63,6 +59,8 @@ export declare class ToolExecutionComponent extends Container {
63
59
  render(width: number): string[];
64
60
  handleMouse(event: TuiMouseEvent): ReturnType<Container["handleMouse"]>;
65
61
  private updateDisplay;
62
+ private callTheme;
63
+ private appendRenderer;
66
64
  private composeDisplay;
67
65
  private getTextOutput;
68
66
  private formatToolExecution;
@@ -1,11 +1,12 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/coding-agent/src/modes/interactive/components/tool-execution.ts.
4
4
  * Modifications: Retain pinned shell/public renderers. Own image conversion; replace private APIs with
5
5
  * public/local equivalents. Use bare-A1 secondary-accent read ranges and concise collapse shortcut
6
- * hints. See docs/architecture/tool-image-presentation.md.
6
+ * hints. Restore the enclosing default-shell background after nested renderer resets. See
7
+ * docs/architecture/tool-image-presentation.md.
7
8
  * Deviations: current-tool-image-conversion-ownership, read-range-secondary-accent,
8
- * concise-tool-expand-shortcut-hint.
9
+ * concise-tool-expand-shortcut-hint, default-shell-background-reset-scoping.
9
10
  */
10
11
  import { stripVTControlCharacters } from "node:util";
11
12
  import { Box, Container, getCapabilities, getImageDimensions, imageFallback, MouseRegion, Spacer, Text } from "@earendil-works/pi-tui";
@@ -29,6 +30,30 @@ function withConciseExpandHint(component) {
29
30
  return typeof value === "function" ? value.bind(target) : value;
30
31
  } });
31
32
  }
33
+ function enclosingToolBackground(theme, role) {
34
+ const background = theme.bg(role, "\u0000").split("\u0000")[0];
35
+ // Invariant: child defaults return to the enclosing shell, not the terminal canvas.
36
+ return text => theme.bg(role, text.replace(/\u001b\[([0-9:;]*)m/gu, (ansi, parameters) => {
37
+ const values = parameters.split(";");
38
+ let restore = false;
39
+ for (let index = 0; index < values.length; index++) {
40
+ const token = values[index], code = Number(token.split(":", 1)[0] || "0");
41
+ if (code === 0 || code === 49)
42
+ restore = true;
43
+ else if (code >= 40 && code <= 47 || code >= 100 && code <= 107)
44
+ restore = false;
45
+ else if (code === 38 || code === 48 || code === 58) {
46
+ if (code === 48)
47
+ restore = false;
48
+ if (!token.includes(":")) {
49
+ const mode = Number(values[index + 1]);
50
+ index += mode === 2 ? 4 : mode === 5 ? 2 : 1;
51
+ }
52
+ }
53
+ }
54
+ return restore ? ansi + background : ansi;
55
+ }));
56
+ }
32
57
  export function mergeBuiltInRenderers(definition, builtIn) {
33
58
  if (definition === undefined)
34
59
  return builtIn;
@@ -71,7 +96,6 @@ function formatToolCallWithArgs(title, args, expanded) {
71
96
  export class ToolExecutionComponent extends Container {
72
97
  contentBox;
73
98
  contentText;
74
- contentTextRegion;
75
99
  selfRenderContainer;
76
100
  selfRenderHeight = 0;
77
101
  callRendererComponent;
@@ -118,27 +142,17 @@ export class ToolExecutionComponent extends Container {
118
142
  this.ui.requestRender();
119
143
  });
120
144
  this.addChild(new Spacer(1));
121
- this.contentBox = new Box(1, 1, (text) => piTheme().bg("toolPendingBg", text));
122
- this.contentText = new Text("", 1, 1, (text) => piTheme().bg("toolPendingBg", text));
123
- this.contentTextRegion = this.createResultRegion(this.contentText);
145
+ this.contentBox = new Box(1, 1, enclosingToolBackground(piTheme(), "toolPendingBg"));
146
+ this.contentText = new Text("", 1, 1, enclosingToolBackground(piTheme(), "toolPendingBg"));
124
147
  this.selfRenderContainer = new Container();
125
- if (this.hasRendererDefinition()) {
148
+ if (this.toolDefinition !== undefined) {
126
149
  this.addChild(this.getRenderShell() === "self" ? this.selfRenderContainer : this.contentBox);
127
150
  }
128
151
  else {
129
- this.addChild(this.contentTextRegion);
152
+ this.addChild(this.createResultRegion(this.contentText));
130
153
  }
131
154
  this.updateDisplay();
132
155
  }
133
- getCallRenderer() {
134
- return this.toolDefinition?.renderCall;
135
- }
136
- getResultRenderer() {
137
- return this.toolDefinition?.renderResult;
138
- }
139
- hasRendererDefinition() {
140
- return this.toolDefinition !== undefined;
141
- }
142
156
  getRenderShell() {
143
157
  return this.toolDefinition?.renderShell ?? "default";
144
158
  }
@@ -171,9 +185,8 @@ export class ToolExecutionComponent extends Container {
171
185
  createResultFallback() {
172
186
  const theme = piTheme();
173
187
  const output = this.getTextOutput();
174
- if (!output) {
188
+ if (!output)
175
189
  return undefined;
176
- }
177
190
  const lines = output.split("\n");
178
191
  const displayLines = this.expanded ? lines : lines.slice(0, FALLBACK_PREVIEW_LINES);
179
192
  const remaining = lines.length - displayLines.length;
@@ -245,7 +258,7 @@ export class ToolExecutionComponent extends Container {
245
258
  if (this.hideComponent) {
246
259
  return [];
247
260
  }
248
- if (this.hasRendererDefinition() && this.getRenderShell() === "self") {
261
+ if (this.toolDefinition !== undefined && this.getRenderShell() === "self") {
249
262
  const contentLines = this.selfRenderContainer.render(width);
250
263
  this.selfRenderHeight = contentLines.length;
251
264
  if (contentLines.length === 0 && this.imageComponents.length === 0) {
@@ -271,7 +284,7 @@ export class ToolExecutionComponent extends Container {
271
284
  return super.render(width);
272
285
  }
273
286
  handleMouse(event) {
274
- if (!this.hasRendererDefinition() || this.getRenderShell() !== "self")
287
+ if (this.toolDefinition === undefined || this.getRenderShell() !== "self")
275
288
  return super.handleMouse(event);
276
289
  if (event.y <= 0 || event.y > this.selfRenderHeight)
277
290
  return undefined;
@@ -292,77 +305,52 @@ export class ToolExecutionComponent extends Container {
292
305
  this.updatingDisplay = false;
293
306
  }
294
307
  }
308
+ callTheme(theme, renderer) {
309
+ if (this.toolName !== "read" || renderer !== this.builtInToolDefinition?.renderCall || !isPiAccentProjectionEnabled)
310
+ return theme;
311
+ return new Proxy(theme, { get(target, property) {
312
+ if (property === "fg")
313
+ return (...args) => target.fg(args[0] === "warning" ? "mdHeading" : args[0], args[1]);
314
+ const value = Reflect.get(target, property, target);
315
+ return typeof value === "function" ? value.bind(target) : value;
316
+ } });
317
+ }
318
+ appendRenderer(container, field, render, fallback, builtIn) {
319
+ if (render) {
320
+ try {
321
+ const component = render(this.getRenderContext(this[field]));
322
+ this[field] = component;
323
+ container.addChild(this.createResultRegion(builtIn ? withConciseExpandHint(component) : component));
324
+ return true;
325
+ }
326
+ catch {
327
+ this[field] = undefined;
328
+ }
329
+ }
330
+ const component = fallback();
331
+ if (component)
332
+ container.addChild(this.createResultRegion(component));
333
+ return component !== undefined;
334
+ }
295
335
  composeDisplay() {
296
336
  const theme = piTheme();
297
- const bgFn = this.isPartial
298
- ? (text) => theme.bg("toolPendingBg", text)
299
- : this.result?.isError
300
- ? (text) => theme.bg("toolErrorBg", text)
301
- : (text) => theme.bg("toolSuccessBg", text);
337
+ const bgFn = enclosingToolBackground(theme, this.isPartial ? "toolPendingBg"
338
+ : this.result?.isError ? "toolErrorBg" : "toolSuccessBg");
302
339
  let hasContent = false;
303
340
  this.hideComponent = false;
304
- if (this.hasRendererDefinition()) {
341
+ if (this.toolDefinition !== undefined) {
305
342
  const renderContainer = this.getRenderShell() === "self" ? this.selfRenderContainer : this.contentBox;
306
343
  if (renderContainer instanceof Box) {
307
344
  renderContainer.setBgFn(bgFn);
308
345
  renderContainer.setPaddingX(this.outputPad);
309
346
  }
310
347
  renderContainer.clear();
311
- const callRenderer = this.getCallRenderer();
312
- if (!callRenderer) {
313
- renderContainer.addChild(this.createResultRegion(this.createCallFallback()));
314
- hasContent = true;
315
- }
316
- else {
317
- try {
318
- const component = callRenderer(this.args, this.toolName === "read" && callRenderer === this.builtInToolDefinition?.renderCall && isPiAccentProjectionEnabled
319
- ? new Proxy(theme, {
320
- get(target, property) {
321
- if (property === "fg") {
322
- return (...args) => target.fg(args[0] === "warning" ? "mdHeading" : args[0], args[1]);
323
- }
324
- const value = Reflect.get(target, property, target);
325
- return typeof value === "function" ? value.bind(target) : value;
326
- },
327
- })
328
- : theme, this.getRenderContext(this.callRendererComponent));
329
- this.callRendererComponent = component;
330
- renderContainer.addChild(this.createResultRegion(callRenderer === this.builtInToolDefinition?.renderCall
331
- ? withConciseExpandHint(component) : component));
332
- hasContent = true;
333
- }
334
- catch {
335
- this.callRendererComponent = undefined;
336
- renderContainer.addChild(this.createResultRegion(this.createCallFallback()));
337
- hasContent = true;
338
- }
339
- }
340
- if (this.result) {
341
- const resultRenderer = this.getResultRenderer();
342
- if (!resultRenderer) {
343
- const component = this.createResultFallback();
344
- if (component) {
345
- renderContainer.addChild(this.createResultRegion(component));
346
- hasContent = true;
347
- }
348
- }
349
- else {
350
- try {
351
- const component = resultRenderer({ content: this.result.content, details: this.result.details }, { expanded: this.expanded, isPartial: this.isPartial }, theme, this.getRenderContext(this.resultRendererComponent));
352
- this.resultRendererComponent = component;
353
- renderContainer.addChild(this.createResultRegion(resultRenderer === this.builtInToolDefinition?.renderResult
354
- ? withConciseExpandHint(component) : component));
355
- hasContent = true;
356
- }
357
- catch {
358
- this.resultRendererComponent = undefined;
359
- const component = this.createResultFallback();
360
- if (component) {
361
- renderContainer.addChild(this.createResultRegion(component));
362
- hasContent = true;
363
- }
364
- }
365
- }
348
+ const call = this.toolDefinition?.renderCall;
349
+ hasContent = this.appendRenderer(renderContainer, "callRendererComponent", call ? context => call(this.args, this.callTheme(theme, call), context) : undefined, () => this.createCallFallback(), call === this.builtInToolDefinition?.renderCall);
350
+ const result = this.result;
351
+ if (result) {
352
+ const render = this.toolDefinition?.renderResult;
353
+ hasContent = this.appendRenderer(renderContainer, "resultRendererComponent", render ? context => render({ content: result.content, details: result.details }, { expanded: this.expanded, isPartial: this.isPartial }, theme, context) : undefined, () => this.createResultFallback(), render === this.builtInToolDefinition?.renderResult) || hasContent;
366
354
  }
367
355
  }
368
356
  else {
@@ -371,13 +359,9 @@ export class ToolExecutionComponent extends Container {
371
359
  this.contentText.setText(this.formatToolExecution());
372
360
  hasContent = true;
373
361
  }
374
- for (const img of this.imageComponents) {
375
- this.removeChild(img);
376
- }
362
+ for (const child of [...this.imageComponents, ...this.imageSpacers])
363
+ this.removeChild(child);
377
364
  this.imageComponents = [];
378
- for (const spacer of this.imageSpacers) {
379
- this.removeChild(spacer);
380
- }
381
365
  this.imageSpacers = [];
382
366
  this.images.update(this.result?.content ?? [], this.showImages);
383
367
  for (const imageComponent of this.images.components(this.imageWidthCells)) {
@@ -387,17 +371,14 @@ export class ToolExecutionComponent extends Container {
387
371
  this.imageComponents.push(imageComponent);
388
372
  this.addChild(imageComponent);
389
373
  }
390
- if (this.hasRendererDefinition() && !hasContent && this.imageComponents.length === 0) {
374
+ if (this.toolDefinition !== undefined && !hasContent && this.imageComponents.length === 0) {
391
375
  this.hideComponent = true;
392
376
  }
393
377
  }
394
378
  getTextOutput() {
395
379
  if (!this.result)
396
380
  return "";
397
- const text = this.result.content.filter(part => part.type === "text").map(part => Array.from(stripVTControlCharacters(part.text ?? "")).filter(char => {
398
- const code = char.codePointAt(0);
399
- return code === 9 || code === 10 || code > 31 && (code < 0xfff9 || code > 0xfffb);
400
- }).join("")).join("\n");
381
+ const text = this.result.content.filter(part => part.type === "text").map(part => stripVTControlCharacters(part.text ?? "").replace(/[\u0000-\u0008\u000b-\u001f\ufff9-\ufffb]/gu, "")).join("\n");
401
382
  if (getCapabilities().images && this.showImages)
402
383
  return text;
403
384
  const indicators = this.result.content.filter(part => part.type === "image").map(part => imageFallback(part.mimeType ?? "image/unknown", part.data && part.mimeType ? getImageDimensions(part.data, part.mimeType) ?? undefined : undefined)).join("\n");
@@ -407,13 +388,11 @@ export class ToolExecutionComponent extends Container {
407
388
  const theme = piTheme();
408
389
  let text = theme.fg("toolTitle", theme.bold(this.toolName));
409
390
  const content = JSON.stringify(this.args, null, 2);
410
- if (content) {
391
+ if (content)
411
392
  text += `\n\n${content}`;
412
- }
413
393
  const output = this.getTextOutput();
414
- if (output) {
394
+ if (output)
415
395
  text += `\n${output}`;
416
- }
417
396
  return text;
418
397
  }
419
398
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/coding-agent/src/modes/interactive/components/tree-selector.ts.
4
4
  * Modifications: Port remaps public types/components plus owned keybindings/theme helpers while
5
5
  * preserving tree behavior; bare A1 uses compact modal chrome and label editing, four-mode
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/coding-agent/src/modes/interactive/components/tree-selector.ts.
4
4
  * Modifications: Port remaps public types/components plus owned keybindings/theme helpers while
5
5
  * preserving tree behavior; bare A1 uses compact modal chrome and label editing, four-mode
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/coding-agent/src/modes/interactive/components/trust-selector.ts.
4
4
  * Modifications: Mechanical source-synchronized trust selector port with injected public
5
5
  * ProjectTrustStore-derived options, remapped owned theme imports, the shared bare-A1 modal shortcut
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/coding-agent/src/modes/interactive/external-editor.ts.
4
4
  * Modifications: Mechanical port: retain temporary prompt file, asynchronous inherited-stdio editor
5
5
  * process, completion readback, and best-effort cleanup behind the owned extension-editor component.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-tui 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-tui 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/tui/src/components/editor.ts.
4
4
  * Modifications: Owned editor core or minimal editor-local helper subset; public imports, strict
5
5
  * types, typed persistent-history hooks, semantic border state with the user-approved numeric-only
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-tui 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-tui 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/tui/src/components/editor.ts.
4
4
  * Modifications: Owned editor core or minimal editor-local helper subset; public imports, strict
5
5
  * types, typed persistent-history hooks, semantic border state with the user-approved numeric-only
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-tui 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-tui 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/tui/src/kill-ring.ts.
4
4
  * Modifications: Owned editor core or minimal editor-local helper subset; public imports, strict
5
5
  * types, typed persistent-history hooks, and semantic border state. Public terminal runtime/exports
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-tui 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-tui 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/tui/src/kill-ring.ts.
4
4
  * Modifications: Owned editor core or minimal editor-local helper subset; public imports, strict
5
5
  * types, typed persistent-history hooks, and semantic border state. Public terminal runtime/exports
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-tui 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-tui 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/tui/src/keys.ts.
4
4
  * Modifications: Owned editor core or minimal editor-local helper subset; public imports, strict
5
5
  * types, typed persistent-history hooks, and semantic border state. Public terminal runtime/exports
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-tui 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-tui 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/tui/src/utils.ts.
4
4
  * Modifications: Owned editor core or minimal editor-local helper subset; public imports, strict
5
5
  * types, typed persistent-history hooks, and semantic border state. Public terminal runtime/exports
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-tui 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-tui 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/tui/src/undo-stack.ts.
4
4
  * Modifications: Owned editor core or minimal editor-local helper subset; public imports, strict
5
5
  * types, typed persistent-history hooks, and semantic border state. Public terminal runtime/exports
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-tui 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-tui 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/tui/src/undo-stack.ts.
4
4
  * Modifications: Owned editor core or minimal editor-local helper subset; public imports, strict
5
5
  * types, typed persistent-history hooks, and semantic border state. Public terminal runtime/exports
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-tui 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-tui 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/tui/src/word-navigation.ts.
4
4
  * Modifications: Owned editor core or minimal editor-local helper subset; public imports, strict
5
5
  * types, typed persistent-history hooks, and semantic border state. Public terminal runtime/exports
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/coding-agent/src/modes/interactive/model-search.ts.
4
4
  * Modifications: Mechanical source-synchronized port preserving pinned model search terms for stateful
5
5
  * scoped-model filtering.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/coding-agent/src/modes/interactive/program-status-reporter.ts.
4
4
  * Modifications: Remap Pi session events to A1's neutral run events, inject the terminal reporter, use
5
5
  * A1's application identity, and clear dialog state when the owned session changes.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/coding-agent/src/modes/interactive/theme/theme-controller.ts.
4
4
  * Modifications: Source-synchronized controller port: renamed owner class, injected dependency-free
5
5
  * settings/runtime ports, remapped private theme helpers to the public-backed A1 theme adapter, and
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.3.0 (MIT), commit 71023aec1546d6d677a65669c5665c0927ce0dd0,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.4.0 (MIT), commit 4a080252f06caf63a525d7873c5d94d3c23887e0,
3
3
  * packages/coding-agent/src/modes/interactive/theme/theme.ts.
4
4
  * Modifications: Source-synchronized theme port: retain pinned theme schema, variable/color
5
5
  * resolution, built-in and custom loading, terminal detection, and layout defaults while constructing