@timurproko/a1 0.2.7-dev.754 → 0.2.7-dev.772

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 (217) hide show
  1. package/README.md +30 -0
  2. package/bin/cli.js +4 -0
  3. package/bin/guardian.js +5 -0
  4. package/bin/tab-launch-context.d.ts +26 -0
  5. package/bin/tab-launch-context.js +94 -0
  6. package/bin/ui.js +24 -6
  7. package/dist/app/session-shell/helper-pool.d.ts +3 -5
  8. package/dist/app/session-shell/helper-pool.js +3 -5
  9. package/dist/app/session-shell/session-shell-root.d.ts +28 -1
  10. package/dist/app/session-shell/session-shell-root.js +4 -3
  11. package/dist/app/session-shell/session-shell.js +149 -31
  12. package/dist/app/session-shell/session-viewport-controller.d.ts +1 -1
  13. package/dist/app/session-shell/session-viewport-controller.js +3 -3
  14. package/dist/app/session-shell/shell-host.d.ts +2 -0
  15. package/dist/app/session-shell/shell-host.js +20 -1
  16. package/dist/cli/dispatch.d.ts +11 -1
  17. package/dist/cli/dispatch.js +79 -5
  18. package/dist/cli/tabs-request.d.ts +7 -0
  19. package/dist/cli/tabs-request.js +1 -0
  20. package/dist/cli/tabs.d.ts +14 -0
  21. package/dist/cli/tabs.js +140 -0
  22. package/dist/composition/owned-ui.d.ts +26 -0
  23. package/dist/composition/owned-ui.js +176 -6
  24. package/dist/contracts/owned-ui/session-backend.d.ts +1 -0
  25. package/dist/features/launch/index.d.ts +1 -1
  26. package/dist/features/launch/intent.d.ts +3 -1
  27. package/dist/features/launch/intent.js +7 -4
  28. package/dist/features/owned-ui/settings-app.js +8 -35
  29. package/dist/features/resident-tab/auto-name.d.ts +11 -0
  30. package/dist/features/resident-tab/auto-name.js +42 -0
  31. package/dist/features/resident-tab/index.d.ts +3 -0
  32. package/dist/features/resident-tab/index.js +3 -0
  33. package/dist/features/resident-tab/shortcuts.d.ts +10 -0
  34. package/dist/features/resident-tab/shortcuts.js +35 -0
  35. package/dist/features/resident-tab/status-deriver.d.ts +9 -0
  36. package/dist/features/resident-tab/status-deriver.js +15 -0
  37. package/dist/foundation/launch-context/index.d.ts +10 -0
  38. package/dist/foundation/launch-context/index.js +25 -0
  39. package/dist/foundation/launch-guardian/main.d.ts +5 -0
  40. package/dist/foundation/launch-guardian/main.js +2 -1
  41. package/dist/foundation/release/bootstrap.d.ts +6 -0
  42. package/dist/foundation/release/bootstrap.js +51 -10
  43. package/dist/foundation/release/cohort-state.d.ts +1 -1
  44. package/dist/foundation/release/cohort-state.js +1 -1
  45. package/dist/foundation/release/dependency-certification.js +54 -19
  46. package/dist/foundation/release/progress-palette.generated.d.ts +2 -2
  47. package/dist/foundation/release/progress-palette.generated.js +2 -2
  48. package/dist/foundation/release/release-gc.d.ts +3 -0
  49. package/dist/foundation/release/release-gc.js +44 -8
  50. package/dist/foundation/resident-tabs/bounded-host-command.d.ts +16 -0
  51. package/dist/foundation/resident-tabs/bounded-host-command.js +35 -0
  52. package/dist/foundation/resident-tabs/bridge-client.d.ts +56 -0
  53. package/dist/foundation/resident-tabs/bridge-client.js +279 -0
  54. package/dist/foundation/resident-tabs/doctor.d.ts +29 -0
  55. package/dist/foundation/resident-tabs/doctor.js +166 -0
  56. package/dist/foundation/resident-tabs/draft-checkpoint.d.ts +27 -0
  57. package/dist/foundation/resident-tabs/draft-checkpoint.js +145 -0
  58. package/dist/foundation/resident-tabs/ensure-terminal-host.d.ts +31 -0
  59. package/dist/foundation/resident-tabs/ensure-terminal-host.js +147 -0
  60. package/dist/foundation/resident-tabs/fault-injection.d.ts +8 -0
  61. package/dist/foundation/resident-tabs/fault-injection.js +26 -0
  62. package/dist/foundation/resident-tabs/index.d.ts +12 -0
  63. package/dist/foundation/resident-tabs/index.js +6 -0
  64. package/dist/foundation/resident-tabs/maintenance.d.ts +42 -0
  65. package/dist/foundation/resident-tabs/maintenance.js +78 -0
  66. package/dist/foundation/resident-tabs/prompt-journal.d.ts +65 -0
  67. package/dist/foundation/resident-tabs/prompt-journal.js +214 -0
  68. package/dist/foundation/resident-tabs/protocol.d.ts +12 -0
  69. package/dist/foundation/resident-tabs/protocol.js +195 -0
  70. package/dist/foundation/resident-tabs/recovery.d.ts +26 -0
  71. package/dist/foundation/resident-tabs/recovery.js +205 -0
  72. package/dist/foundation/resident-tabs/release-holds.d.ts +27 -0
  73. package/dist/foundation/resident-tabs/release-holds.js +77 -0
  74. package/dist/foundation/resident-tabs/routing.d.ts +11 -0
  75. package/dist/foundation/resident-tabs/routing.js +10 -0
  76. package/dist/foundation/resident-tabs/session-sync.d.ts +14 -0
  77. package/dist/foundation/resident-tabs/session-sync.js +37 -0
  78. package/dist/foundation/resident-tabs/settings.d.ts +14 -0
  79. package/dist/foundation/resident-tabs/settings.js +66 -0
  80. package/dist/foundation/resident-tabs/terminal-host-artifact.d.ts +18 -0
  81. package/dist/foundation/resident-tabs/terminal-host-artifact.js +53 -0
  82. package/dist/foundation/resident-tabs/zip-archive.d.ts +9 -0
  83. package/dist/foundation/resident-tabs/zip-archive.js +56 -0
  84. package/dist/foundation/session-writer-lock/index.d.ts +32 -0
  85. package/dist/foundation/session-writer-lock/index.js +201 -0
  86. package/dist/foundation/startup/startup-descriptor.js +2 -2
  87. package/dist/foundation/terminal-cleanup/index.d.ts +1 -1
  88. package/dist/foundation/terminal-cleanup/index.js +1 -1
  89. package/dist/foundation/terminal-cleanup/terminal-reset.d.ts +1 -0
  90. package/dist/foundation/terminal-cleanup/terminal-reset.js +1 -0
  91. package/dist/integrations/pi/components/owned-editor-ux.d.ts +1 -1
  92. package/dist/integrations/pi/components/owned-editor-ux.js +2 -2
  93. package/dist/integrations/pi/components/resources/builtin-themes.d.ts +4 -4
  94. package/dist/integrations/pi/components/resources/builtin-themes.js +4 -4
  95. package/dist/integrations/pi/components/shell-hotkey-sections.js +1 -1
  96. package/dist/integrations/pi/components/shell-presenters-info.d.ts +4 -2
  97. package/dist/integrations/pi/components/shell-presenters-info.js +38 -4
  98. package/dist/integrations/pi/components/shell-shared-facade.d.ts +1 -1
  99. package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.d.ts +1 -1
  100. package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.js +17 -4
  101. package/dist/integrations/pi/components/upstream/assets/earendil-image.json +2 -2
  102. package/dist/integrations/pi/components/upstream/components/countdown-timer.d.ts +1 -1
  103. package/dist/integrations/pi/components/upstream/components/earendil-announcement.js +1 -1
  104. package/dist/integrations/pi/components/upstream/components/extension-editor.d.ts +1 -1
  105. package/dist/integrations/pi/components/upstream/components/extension-editor.js +1 -1
  106. package/dist/integrations/pi/components/upstream/components/extension-input.js +1 -1
  107. package/dist/integrations/pi/components/upstream/components/extension-selector.js +1 -1
  108. package/dist/integrations/pi/components/upstream/components/mermaid.js +1 -1
  109. package/dist/integrations/pi/components/upstream/components/owned-editor.d.ts +1 -1
  110. package/dist/integrations/pi/components/upstream/components/owned-editor.js +1 -1
  111. package/dist/integrations/pi/components/upstream/components/pi-logo.js +1 -1
  112. package/dist/integrations/pi/components/upstream/components/scoped-models-selector.d.ts +1 -1
  113. package/dist/integrations/pi/components/upstream/components/session-footer.js +1 -1
  114. package/dist/integrations/pi/components/upstream/components/session-selector-search.js +1 -1
  115. package/dist/integrations/pi/components/upstream/components/session-selector.js +1 -1
  116. package/dist/integrations/pi/components/upstream/components/skill-invocation-message.d.ts +1 -1
  117. package/dist/integrations/pi/components/upstream/components/skill-invocation-message.js +1 -1
  118. package/dist/integrations/pi/components/upstream/components/status-indicator.d.ts +2 -2
  119. package/dist/integrations/pi/components/upstream/components/status-indicator.js +3 -3
  120. package/dist/integrations/pi/components/upstream/components/themed-text.d.ts +1 -1
  121. package/dist/integrations/pi/components/upstream/components/themed-text.js +1 -1
  122. package/dist/integrations/pi/components/upstream/components/thinking-selector.d.ts +1 -1
  123. package/dist/integrations/pi/components/upstream/components/thinking-selector.js +1 -1
  124. package/dist/integrations/pi/components/upstream/components/tool-execution.d.ts +0 -2
  125. package/dist/integrations/pi/components/upstream/components/tool-execution.js +41 -20
  126. package/dist/integrations/pi/components/upstream/components/tree-selector.d.ts +1 -1
  127. package/dist/integrations/pi/components/upstream/components/tree-selector.js +1 -1
  128. package/dist/integrations/pi/components/upstream/components/trust-selector.js +1 -1
  129. package/dist/integrations/pi/components/upstream/external-editor.js +1 -1
  130. package/dist/integrations/pi/components/upstream/history/editor-core.d.ts +2 -2
  131. package/dist/integrations/pi/components/upstream/history/editor-core.js +5 -5
  132. package/dist/integrations/pi/components/upstream/history/kill-ring.d.ts +1 -1
  133. package/dist/integrations/pi/components/upstream/history/kill-ring.js +1 -1
  134. package/dist/integrations/pi/components/upstream/history/printable-key.js +1 -1
  135. package/dist/integrations/pi/components/upstream/history/text-helpers.js +1 -1
  136. package/dist/integrations/pi/components/upstream/history/undo-stack.d.ts +1 -1
  137. package/dist/integrations/pi/components/upstream/history/undo-stack.js +1 -1
  138. package/dist/integrations/pi/components/upstream/history/word-navigation.js +1 -1
  139. package/dist/integrations/pi/components/upstream/model-search.d.ts +1 -1
  140. package/dist/integrations/pi/components/upstream/program-status-reporter.d.ts +1 -1
  141. package/dist/integrations/pi/components/upstream/theme/theme-controller.d.ts +1 -1
  142. package/dist/integrations/pi/components/upstream/theme/theme.d.ts +3 -0
  143. package/dist/integrations/pi/components/upstream/theme/theme.js +24 -1
  144. package/dist/integrations/pi/engine/adapter.d.ts +1 -0
  145. package/dist/integrations/pi/engine/adapter.js +4 -0
  146. package/dist/integrations/pi/engine/pi-settings-metadata.json +2 -2
  147. package/dist/integrations/pi/engine/prompt-suggestions.d.ts +1 -0
  148. package/dist/integrations/pi/engine/prompt-suggestions.js +40 -0
  149. package/dist/integrations/pi/engine/resources/changelog.json +4 -4
  150. package/dist/integrations/pi/engine/runtime-integration.js +102 -29
  151. package/dist/integrations/pi/engine/session-runtime.d.ts +0 -6
  152. package/dist/integrations/pi/engine/session-runtime.js +8 -3
  153. package/dist/integrations/pi/engine/session-selection.d.ts +3 -0
  154. package/dist/integrations/pi/engine/session-selection.js +45 -9
  155. package/dist/integrations/pi/engine/workflow-contexts.js +10 -1
  156. package/dist/integrations/pi/startup-public.js +152 -222
  157. package/dist/integrations/pi/startup-public.manifest.json +266 -177
  158. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +1 -1
  159. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.js +1 -1
  160. package/dist/native/darwin-arm64/a1_session_lock.node +0 -0
  161. package/dist/native/darwin-arm64/manifest.json +1 -1
  162. package/dist/native/darwin-arm64/terminal-host +0 -0
  163. package/dist/native/darwin-arm64/terminal-host-THIRD-PARTY-NOTICES.txt +10500 -0
  164. package/dist/native/darwin-arm64/terminal-host.manifest.json +44 -0
  165. package/dist/native/darwin-x64/a1_session_lock.node +0 -0
  166. package/dist/native/darwin-x64/manifest.json +20 -0
  167. package/dist/native/darwin-x64/process-guardian +0 -0
  168. package/dist/native/darwin-x64/terminal-host +0 -0
  169. package/dist/native/darwin-x64/terminal-host-THIRD-PARTY-NOTICES.txt +10737 -0
  170. package/dist/native/darwin-x64/terminal-host.manifest.json +44 -0
  171. package/dist/native/linux-x64/a1_session_lock.node +0 -0
  172. package/dist/native/linux-x64/manifest.json +1 -1
  173. package/dist/native/linux-x64/terminal-host +0 -0
  174. package/dist/native/linux-x64/terminal-host-THIRD-PARTY-NOTICES.txt +11226 -0
  175. package/dist/native/linux-x64/terminal-host.manifest.json +44 -0
  176. package/dist/native/win32-x64/a1_session_lock.node +0 -0
  177. package/dist/native/win32-x64/manifest.json +2 -2
  178. package/dist/native/win32-x64/process-guardian.exe +0 -0
  179. package/dist/native/win32-x64/terminal-host-THIRD-PARTY-NOTICES.txt +10757 -0
  180. package/dist/native/win32-x64/terminal-host.exe +0 -0
  181. package/dist/native/win32-x64/terminal-host.manifest.json +44 -0
  182. package/dist/product-identity.d.ts +1 -1
  183. package/dist/product-identity.js +1 -1
  184. package/dist/product-identity.json +5 -0
  185. package/dist/runtime-payload-inventory.json +5349 -6035
  186. package/dist/ui/components/line-input.d.ts +1 -1
  187. package/dist/ui/components/prompt-input.d.ts +7 -5
  188. package/dist/ui/components/prompt-input.js +7 -7
  189. package/dist/ui/components/transcript-viewport.d.ts +6 -3
  190. package/dist/ui/components/transcript-viewport.js +13 -15
  191. package/dist/ui/settings/declarations.d.ts +25 -1
  192. package/dist/ui/settings/declarations.js +21 -1
  193. package/dist/ui/settings/index.d.ts +4 -2
  194. package/dist/ui/settings/index.js +2 -1
  195. package/dist/ui/settings/manager.d.ts +10 -3
  196. package/dist/ui/settings/manager.js +90 -30
  197. package/dist/ui/settings/migrations.d.ts +6 -0
  198. package/dist/ui/settings/migrations.js +44 -0
  199. package/dist/ui/settings/profile-document.d.ts +26 -0
  200. package/dist/ui/settings/profile-document.js +164 -0
  201. package/docs/architecture/evidence/resident-tabs/linux-x64.md +37 -0
  202. package/docs/architecture/evidence/resident-tabs/macos-arm64.md +36 -0
  203. package/docs/architecture/evidence/resident-tabs/macos-x64.md +35 -0
  204. package/docs/architecture/evidence/resident-tabs/windows-x64.md +36 -0
  205. package/docs/architecture/internal-naming.md +3 -1
  206. package/docs/architecture/process-guardian-provenance.md +2 -0
  207. package/docs/architecture/resident-tabs-requirements.md +18 -0
  208. package/docs/architecture/resident-tabs.md +594 -0
  209. package/docs/architecture/terminal-host-proof-gate.md +2 -0
  210. package/docs/architecture/terminal-host-provenance.md +13 -3
  211. package/docs/architecture/toolchain.md +1 -1
  212. package/docs/ci-release-runbook.md +2 -2
  213. package/docs/features/launch-profiles.md +11 -8
  214. package/docs/manual-resident-tabs-acceptance.md +51 -0
  215. package/docs/openspec-archive-automation.md +17 -16
  216. package/docs/validation.md +9 -1
  217. package/package.json +10 -4
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
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.
@@ -24,7 +24,7 @@ export declare class RetryStatusIndicator extends StatusIndicator {
24
24
  }
25
25
  export type CompactionStatusReason = "manual" | "threshold" | "overflow";
26
26
  export declare class CompactionStatusIndicator extends StatusIndicator {
27
- constructor(ui: TUI, reason: CompactionStatusReason);
27
+ constructor(ui: TUI, reason: CompactionStatusReason, colorFn?: (text: string) => string);
28
28
  }
29
29
  export declare class BranchSummaryStatusIndicator extends StatusIndicator {
30
30
  constructor(ui: TUI);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
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.
@@ -47,12 +47,12 @@ export class RetryStatusIndicator extends StatusIndicator {
47
47
  }
48
48
  }
49
49
  export class CompactionStatusIndicator extends StatusIndicator {
50
- constructor(ui, reason) {
50
+ constructor(ui, reason, colorFn) {
51
51
  const cancelHint = `(${keyText("app.interrupt")} to cancel)`;
52
52
  const label = reason === "manual"
53
53
  ? `Compacting context... ${cancelHint}`
54
54
  : `${reason === "overflow" ? "Context overflow detected, " : ""}Auto-compacting... ${cancelHint}`;
55
- super("compaction", ui, spinner => piTheme().fg("accent", spinner), text => piTheme().fg("muted", text), label);
55
+ super("compaction", ui, colorFn ?? (spinner => piTheme().fg("accent", spinner)), colorFn ?? (text => piTheme().fg("muted", text)), label);
56
56
  }
57
57
  }
58
58
  export class BranchSummaryStatusIndicator extends StatusIndicator {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
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.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
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.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
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.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
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
@@ -4,7 +4,6 @@ type ToolPresentationResult = Parameters<NonNullable<ToolDefinition["renderResul
4
4
  isError: boolean;
5
5
  durationMs?: number;
6
6
  };
7
- /** The caller-side merge 0.85.1 performs before handing a definition to the component: built-in renderers fill the gaps. */
8
7
  type ToolRendererInput = ToolRenderers | ToolDefinition<any, any, any>;
9
8
  export declare function mergeBuiltInRenderers(definition: ToolRendererInput | undefined, builtIn: ToolRendererInput | undefined): ToolRenderers | undefined;
10
9
  export interface ToolExecutionOptions {
@@ -55,7 +54,6 @@ export declare class ToolExecutionComponent extends Container {
55
54
  markExecutionStarted(): void;
56
55
  setArgsComplete(): void;
57
56
  updateResult(result: ToolPresentationResult, isPartial?: boolean): void;
58
- /** End mount ownership without letting an obsolete conversion or extension callback repaint. */
59
57
  dispose(): void;
60
58
  setExpanded(expanded: boolean): void;
61
59
  setOutputPad(outputPad: number): void;
@@ -1,18 +1,34 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
3
3
  * packages/coding-agent/src/modes/interactive/components/tool-execution.ts.
4
- * Modifications: Retain pinned shell and actual public tool-definition renderers. Replace private
5
- * index-keyed image conversion with current-source ownership, serial conversion, visible fallback, and
6
- * disposal; guard reentrant invalidation. Remap private types, definition factories, theme, and
7
- * generic text helpers to public or locally attributed equivalents. See
8
- * docs/architecture/tool-image-presentation.md.
9
- * Deviations: current-tool-image-conversion-ownership.
4
+ * Modifications: Retain pinned shell/public renderers. Own image conversion; replace private APIs with
5
+ * public/local equivalents. Use bare-A1 secondary-accent read ranges and concise collapse shortcut
6
+ * hints. See docs/architecture/tool-image-presentation.md.
7
+ * Deviations: current-tool-image-conversion-ownership, read-range-secondary-accent,
8
+ * concise-tool-expand-shortcut-hint.
10
9
  */
11
10
  import { stripVTControlCharacters } from "node:util";
12
11
  import { Box, Container, getCapabilities, getImageDimensions, imageFallback, MouseRegion, Spacer, Text } from "@earendil-works/pi-tui";
13
- import { createReadToolDefinition, createBashToolDefinition, createEditToolDefinition, createWriteToolDefinition, createGrepToolDefinition, createFindToolDefinition, createLsToolDefinition, keyHint, } from "../../../startup-public.js";
14
- import { piTheme } from "../theme/theme.js";
12
+ import { createReadToolDefinition, createBashToolDefinition, createEditToolDefinition, createWriteToolDefinition, createGrepToolDefinition, createFindToolDefinition, createLsToolDefinition, keyHint, keyText, } from "../../../startup-public.js";
13
+ import { renderPiModalShortcutHints } from "../../theme.js";
14
+ import { isPiAccentProjectionEnabled, piTheme } from "../theme/theme.js";
15
15
  import { ToolImagePresentation } from "../../tool-image-presentation.js";
16
+ function conciseExpandHint() {
17
+ return renderPiModalShortcutHints([{ key: keyText("app.tools.expand"), action: "expand" }]);
18
+ }
19
+ function withConciseExpandHint(component) {
20
+ return new Proxy(component, { get(target, property) {
21
+ if (property === "render")
22
+ return (width) => {
23
+ const theme = piTheme(), key = keyText("app.tools.expand"), concise = conciseExpandHint();
24
+ const compact = theme.fg("dim", ` (${key} to expand)`);
25
+ return target.render(width).map(row => row.replaceAll(keyHint("app.tools.expand", "to expand"), concise)
26
+ .replaceAll(compact, `${theme.fg("dim", " (")}${concise}${theme.fg("dim", ")")}`));
27
+ };
28
+ const value = Reflect.get(target, property, target);
29
+ return typeof value === "function" ? value.bind(target) : value;
30
+ } });
31
+ }
16
32
  export function mergeBuiltInRenderers(definition, builtIn) {
17
33
  if (definition === undefined)
18
34
  return builtIn;
@@ -31,7 +47,6 @@ const definitions = { read: createReadToolDefinition, bash: createBashToolDefini
31
47
  write: createWriteToolDefinition, grep: createGrepToolDefinition, find: createFindToolDefinition, ls: createLsToolDefinition };
32
48
  const FALLBACK_PREVIEW_LINES = 10;
33
49
  const COLLAPSED_ARGS_CHARS = 100;
34
- /** Locally attributed equivalent of pinned Pi's private generic tool-call formatter. */
35
50
  function formatToolCallWithArgs(title, args, expanded) {
36
51
  const theme = piTheme();
37
52
  const header = theme.fg("toolTitle", theme.bold(title));
@@ -90,8 +105,6 @@ export class ToolExecutionComponent extends Container {
90
105
  this.args = args;
91
106
  this.builtInToolDefinition = Object.hasOwn(definitions, toolName)
92
107
  ? definitions[toolName](cwd) : undefined;
93
- // Rationale: 0.85.1 moved the built-in renderer fallback to the caller; A1 keeps it here so every caller of
94
- // the owned component gets the built-in edit/read/bash renderers without reaching into the tool registry.
95
108
  this.toolDefinition = mergeBuiltInRenderers(toolDefinition, this.builtInToolDefinition);
96
109
  this.showImages = options.showImages ?? true;
97
110
  this.imageWidthCells = options.imageWidthCells ?? 60;
@@ -105,9 +118,6 @@ export class ToolExecutionComponent extends Container {
105
118
  this.ui.requestRender();
106
119
  });
107
120
  this.addChild(new Spacer(1));
108
- // Always create all shell variants. contentBox is used for default renderer-based composition.
109
- // selfRenderContainer is used when the tool renders its own framing.
110
- // contentText is reserved for generic fallback rendering when no tool definition exists.
111
121
  this.contentBox = new Box(1, 1, (text) => piTheme().bg("toolPendingBg", text));
112
122
  this.contentText = new Text("", 1, 1, (text) => piTheme().bg("toolPendingBg", text));
113
123
  this.contentTextRegion = this.createResultRegion(this.contentText);
@@ -169,7 +179,7 @@ export class ToolExecutionComponent extends Container {
169
179
  const remaining = lines.length - displayLines.length;
170
180
  let text = displayLines.map((line) => theme.fg("toolOutput", line)).join("\n");
171
181
  if (remaining > 0) {
172
- text += `${theme.fg("muted", `\n... (${remaining} more lines,`)} ${keyHint("app.tools.expand", "to expand")}${theme.fg("muted", ")")}`;
182
+ text += `${theme.fg("muted", `\n... (${remaining} more lines,`)} ${conciseExpandHint()}${theme.fg("muted", ")")}`;
173
183
  }
174
184
  return new Text(text, 0, 0);
175
185
  }
@@ -200,7 +210,6 @@ export class ToolExecutionComponent extends Container {
200
210
  this.isPartial = isPartial;
201
211
  this.updateDisplay();
202
212
  }
203
- /** End mount ownership without letting an obsolete conversion or extension callback repaint. */
204
213
  dispose() {
205
214
  this.disposed = true;
206
215
  this.images.dispose();
@@ -306,9 +315,20 @@ export class ToolExecutionComponent extends Container {
306
315
  }
307
316
  else {
308
317
  try {
309
- const component = callRenderer(this.args, theme, this.getRenderContext(this.callRendererComponent));
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));
310
329
  this.callRendererComponent = component;
311
- renderContainer.addChild(this.createResultRegion(component));
330
+ renderContainer.addChild(this.createResultRegion(callRenderer === this.builtInToolDefinition?.renderCall
331
+ ? withConciseExpandHint(component) : component));
312
332
  hasContent = true;
313
333
  }
314
334
  catch {
@@ -330,7 +350,8 @@ export class ToolExecutionComponent extends Container {
330
350
  try {
331
351
  const component = resultRenderer({ content: this.result.content, details: this.result.details }, { expanded: this.expanded, isPartial: this.isPartial }, theme, this.getRenderContext(this.resultRendererComponent));
332
352
  this.resultRendererComponent = component;
333
- renderContainer.addChild(this.createResultRegion(component));
353
+ renderContainer.addChild(this.createResultRegion(resultRenderer === this.builtInToolDefinition?.renderResult
354
+ ? withConciseExpandHint(component) : component));
334
355
  hasContent = true;
335
356
  }
336
357
  catch {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
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.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
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.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
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.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
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.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
2
+ * Provenance: @earendil-works/pi-tui 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
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
@@ -9,7 +9,7 @@
9
9
  * Deviations: compact-history-counter-label, history-overflow-cue-separation,
10
10
  * history-recall-cursor-retention, persistent-history-owned-editor-boundary.
11
11
  */
12
- import { type AutocompleteProvider, type Component, type Focusable, type TUI, type TuiMouseEvent, type TuiMouseEventResult, type SelectListTheme } from "@earendil-works/pi-tui";
12
+ import { type AutocompleteProvider, type Component, type Focusable, type SelectListTheme, type TUI, type TuiMouseEvent, type TuiMouseEventResult } from "@earendil-works/pi-tui";
13
13
  import type { EditorInteractionPort, EditorRecallPort } from "../../editor-interaction.js";
14
14
  /**
15
15
  * Represents a chunk of text for word-wrap layout.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-tui 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
2
+ * Provenance: @earendil-works/pi-tui 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
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
@@ -9,11 +9,11 @@
9
9
  * Deviations: compact-history-counter-label, history-overflow-cue-separation,
10
10
  * history-recall-cursor-retention, persistent-history-owned-editor-boundary.
11
11
  */
12
- import { getKeybindings, matchesKey, CURSOR_MARKER, sliceByColumn, truncateToWidth, visibleWidth, SelectList } from "@earendil-works/pi-tui";
12
+ import { CURSOR_MARKER, SelectList, getKeybindings, matchesKey, renderFakeCursor, sliceByColumn, truncateToWidth, visibleWidth, } from "@earendil-works/pi-tui";
13
13
  import { decodePrintableKey } from "./printable-key.js";
14
14
  import { KillRing } from "./kill-ring.js";
15
15
  import { UndoStack } from "./undo-stack.js";
16
- import { autocompleteBoundaryRegex, autocompleteSeparatorRegex, cjkBreakRegex, getGraphemeSegmenter, getWordSegmenter, isWhitespaceChar } from "./text-helpers.js";
16
+ import { autocompleteBoundaryRegex, autocompleteSeparatorRegex, cjkBreakRegex, getGraphemeSegmenter, getWordSegmenter, isWhitespaceChar, } from "./text-helpers.js";
17
17
  import { findWordBackward, findWordForward } from "./word-navigation.js";
18
18
  const graphemeSegmenter = getGraphemeSegmenter();
19
19
  const wordSegmenter = getWordSegmenter();
@@ -574,13 +574,13 @@ export class HistoryEditorCore {
574
574
  const afterGraphemes = [...this.segment(after, "grapheme")];
575
575
  const firstGrapheme = afterGraphemes[0]?.segment || "";
576
576
  const restAfter = after.slice(firstGrapheme.length);
577
- const cursor = `\x1b[7m${firstGrapheme}\x1b[0m`;
577
+ const cursor = renderFakeCursor(firstGrapheme);
578
578
  displayText = before + marker + cursor + restAfter;
579
579
  // lineVisibleWidth stays the same - we're replacing, not adding
580
580
  }
581
581
  else {
582
582
  // Cursor is at the end - add highlighted space
583
- const cursor = "\x1b[7m \x1b[0m";
583
+ const cursor = renderFakeCursor(" ");
584
584
  displayText = before + marker + cursor;
585
585
  lineVisibleWidth = lineVisibleWidth + 1;
586
586
  // If cursor overflows content width into the padding, flag it
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-tui 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
2
+ * Provenance: @earendil-works/pi-tui 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
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.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
2
+ * Provenance: @earendil-works/pi-tui 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
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.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
2
+ * Provenance: @earendil-works/pi-tui 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
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.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
2
+ * Provenance: @earendil-works/pi-tui 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
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.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
2
+ * Provenance: @earendil-works/pi-tui 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
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.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
2
+ * Provenance: @earendil-works/pi-tui 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
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.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
2
+ * Provenance: @earendil-works/pi-tui 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
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.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
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.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
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.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
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
@@ -45,6 +45,7 @@ export interface PiAccentProjection {
45
45
  }
46
46
  /** Derive the complete semantic family from any primary accent, including future custom colors. */
47
47
  export declare function derivePiAccentProjection(accent: Color, appearance: PiTerminalTheme): PiAccentProjection;
48
+ declare let packageBorderProjectionEnabled: boolean;
48
49
  export declare function ensurePiTheme(): Theme;
49
50
  export declare function piTheme(): Theme;
50
51
  export declare function currentPiThemeName(): string;
@@ -55,6 +56,8 @@ export declare function renderPiAccentPreview(color: string, text: string): stri
55
56
  export declare function derivePiCanvasBackground(style: OwnedUiBackgroundStyle, accent: Color): Color | null;
56
57
  /** Resolves the selected canvas through the active accent and terminal color mode. */
57
58
  export declare function piCanvasBackgroundAnsi(style: OwnedUiBackgroundStyle): string | null;
59
+ /** Read-only live view of whether bare A1's semantic accent family is active. */
60
+ export { packageBorderProjectionEnabled as isPiAccentProjectionEnabled };
58
61
  /** Keeps the complete comparison theme unmodified while bare A1 projects its semantic accent family. */
59
62
  export declare function setPiPackageBorderProjectionEnabled(enabled: boolean): void;
60
63
  /** Reprojects the active base theme; repeated changes never derive from an earlier projection. */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.2.0 (MIT), commit 06a466935536f8c9bcacb2d5efc0fc021be1bdff,
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
@@ -32,6 +32,9 @@ const FOREGROUND_COLORS = [
32
32
  const BACKGROUND_COLORS = [
33
33
  "selectedBg", "searchMatchBg", "userMessageBg", "customMessageBg", "toolPendingBg", "toolSuccessBg", "toolErrorBg",
34
34
  ];
35
+ const THEME_ROOT_KEYS = new Set(["$schema", "name", "appearance", "vars", "colors", "export"]);
36
+ const THEME_COLOR_KEYS = new Set([...FOREGROUND_COLORS, ...BACKGROUND_COLORS]);
37
+ const THEME_EXPORT_KEYS = new Set(["pageBg", "cardBg", "infoBg"]);
35
38
  const ACCENT_PALETTE = Object.freeze({
36
39
  purple: Object.freeze({
37
40
  dark: Object.freeze({ kind: "rgb", r: 167, g: 152, b: 215 }),
@@ -122,6 +125,8 @@ export function piCanvasBackgroundAnsi(style) {
122
125
  const background = derivePiCanvasBackground(style, accent);
123
126
  return background === null ? null : backgroundAnsi(background, base.getColorMode());
124
127
  }
128
+ /** Read-only live view of whether bare A1's semantic accent family is active. */
129
+ export { packageBorderProjectionEnabled as isPiAccentProjectionEnabled };
125
130
  /** Keeps the complete comparison theme unmodified while bare A1 projects its semantic accent family. */
126
131
  export function setPiPackageBorderProjectionEnabled(enabled) {
127
132
  if (packageBorderProjectionEnabled === enabled)
@@ -471,6 +476,22 @@ function validateThemeJson(label, value) {
471
476
  || (value.vars !== undefined && !isRecord(value.vars))) {
472
477
  throw new Error(`Invalid theme "${label}": expected name, colors, and optional vars objects`);
473
478
  }
479
+ const unsupportedRootKey = Object.keys(value).find(key => !THEME_ROOT_KEYS.has(key));
480
+ if (unsupportedRootKey !== undefined) {
481
+ throw new Error(`Invalid theme "${label}": unsupported property ${unsupportedRootKey}`);
482
+ }
483
+ if (value.$schema !== undefined && typeof value.$schema !== "string") {
484
+ throw new Error(`Invalid theme "${label}": $schema must be a string`);
485
+ }
486
+ if (value.export !== undefined) {
487
+ if (!isRecord(value.export))
488
+ throw new Error(`Invalid theme "${label}": export must be an object`);
489
+ for (const [key, color] of Object.entries(value.export)) {
490
+ if (!THEME_EXPORT_KEYS.has(key))
491
+ throw new Error(`Invalid theme "${label}": unsupported export color ${key}`);
492
+ validateColor(color, `${label}.export.${key}`);
493
+ }
494
+ }
474
495
  if (value.name.includes("/"))
475
496
  throw new Error(`Invalid theme name "${value.name}"`);
476
497
  if (value.appearance !== undefined && value.appearance !== "dark" && value.appearance !== "light") {
@@ -486,6 +507,8 @@ function validateThemeJson(label, value) {
486
507
  }
487
508
  const colors = {};
488
509
  for (const [key, color] of Object.entries(value.colors)) {
510
+ if (!THEME_COLOR_KEYS.has(key))
511
+ throw new Error(`Invalid theme "${label}": unsupported color ${key}`);
489
512
  validateColor(color, `${label}.colors.${key}`);
490
513
  colors[key] = color;
491
514
  }
@@ -98,6 +98,7 @@ export declare class PiEngineAdapter implements OwnedUiSessionBackend, OwnedUiPr
98
98
  announceReleaseUpdate(release: OwnedUiReleaseUpdate): void;
99
99
  suggestionReasoningPolicy(): OwnedUiPromptSuggestionReasoning;
100
100
  generate(request: OwnedUiPromptSuggestionRequest): Promise<OwnedUiPromptSuggestionResult>;
101
+ generateResidentTabName(instruction: string, maxTokens: number, signal: AbortSignal): Promise<string | null>;
101
102
  start(): Promise<OwnedUiSessionViewModel>;
102
103
  /** Announce pinned Pi's changelog since the profile's last seen version; the host calls this once per process. */
103
104
  announceStartupChangelog(): Promise<void>;
@@ -280,6 +280,9 @@ export class PiEngineAdapter {
280
280
  generate(request) {
281
281
  return this.#suggestions.generate(request);
282
282
  }
283
+ generateResidentTabName(instruction, maxTokens, signal) {
284
+ return this.#suggestions.completeInstruction(instruction, maxTokens, signal);
285
+ }
283
286
  async start() {
284
287
  if (this.#engine.started)
285
288
  return this.view();
@@ -551,6 +554,7 @@ export class PiEngineAdapter {
551
554
  get sessionBindingGeneration() { return engine.bindingGeneration; },
552
555
  get disposed() { return isDisposed(); },
553
556
  currentSessionResumeMetadata: () => engine.currentSessionResumeMetadata(),
557
+ currentSessionFile: () => engine.currentSessionFile(),
554
558
  },
555
559
  session: {
556
560
  start: () => this.start(),
@@ -129,7 +129,7 @@
129
129
  },
130
130
  "showHardwareCursor": {
131
131
  "label": "Show hardware cursor",
132
- "description": "Show the terminal cursor while still positioning it for IME support",
132
+ "description": "Use the terminal cursor instead of Pi's drawn cursor",
133
133
  "opensDialog": false,
134
134
  "values": [
135
135
  "true",
@@ -388,7 +388,7 @@
388
388
  "label": "Anthropic extra usage",
389
389
  "description": "Warn when Anthropic subscription auth may use paid extra usage",
390
390
  "key": "anthropicExtraUsage",
391
- "fallback": true
391
+ "fallback": false
392
392
  }
393
393
  ]
394
394
  },
@@ -26,5 +26,6 @@ export declare class PiPromptSuggestions implements OwnedUiPromptSuggestionGener
26
26
  #private;
27
27
  constructor(ports: PiPromptSuggestionPorts);
28
28
  reasoningPolicy(): OwnedUiPromptSuggestionReasoning;
29
+ completeInstruction(instruction: string, maxTokens: number, signal: AbortSignal): Promise<string | null>;
29
30
  generate(request: OwnedUiPromptSuggestionRequest): Promise<OwnedUiPromptSuggestionResult>;
30
31
  }
@@ -20,6 +20,46 @@ export class PiPromptSuggestions {
20
20
  // Performance: the run's own level keeps the provider's thinking parameters, and the cached prefix, identical.
21
21
  return readSuggestionReasoning(session.thinkingLevel);
22
22
  }
23
+ async completeInstruction(instruction, maxTokens, signal) {
24
+ const session = this.#ports.session();
25
+ const runtime = this.#ports.runtime();
26
+ if (this.#ports.unavailable() || session === undefined || runtime === undefined || signal.aborted
27
+ || session.model === undefined || typeof runtime.services.modelRuntime.completeSimple !== "function")
28
+ return null;
29
+ const agent = session.agent;
30
+ try {
31
+ const transformed = typeof agent.transformContext === "function"
32
+ ? await agent.transformContext(agent.state.messages, signal)
33
+ : agent.state.messages;
34
+ const messages = typeof agent.convertToLlm === "function"
35
+ ? await agent.convertToLlm(transformed)
36
+ : transformed.filter(message => message.role === "user" || message.role === "assistant" || message.role === "toolResult");
37
+ const response = await runtime.services.modelRuntime.completeSimple(session.model, {
38
+ systemPrompt: agent.state.systemPrompt,
39
+ messages: [...messages, { role: "user", content: instruction, timestamp: Date.now() }],
40
+ tools: [],
41
+ }, {
42
+ signal,
43
+ maxTokens,
44
+ ...(agent.sessionId === undefined ? {} : { sessionId: agent.sessionId }),
45
+ ...(agent.transport === undefined ? {} : { transport: agent.transport }),
46
+ ...(agent.onPayload === undefined ? {} : { onPayload: agent.onPayload }),
47
+ });
48
+ if (signal.aborted || !isRecord(response) || response.stopReason === "aborted"
49
+ || response.stopReason === "error" || response.stopReason === "length"
50
+ || stringValue(response.errorMessage) !== undefined)
51
+ return null;
52
+ const content = Array.isArray(response.content) ? response.content : [];
53
+ if (content.some(block => isRecord(block) && block.type === "toolCall"))
54
+ return null;
55
+ const text = content.filter(block => isRecord(block) && block.type === "text")
56
+ .map(block => stringValue(block.text) ?? "").join("\n").trim();
57
+ return text || null;
58
+ }
59
+ catch {
60
+ return null;
61
+ }
62
+ }
23
63
  async generate(request) {
24
64
  assertOwnedUiPromptSuggestionRequest(request);
25
65
  const identity = request.identity;