@timurproko/a1 0.2.6-dev.717 → 0.2.6-dev.727

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 (143) hide show
  1. package/bin/cli.js +13 -2
  2. package/bin/ui.js +13 -0
  3. package/dist/app/session-shell/prompt-suggestion-controller.d.ts +5 -4
  4. package/dist/app/session-shell/prompt-suggestion-controller.js +148 -58
  5. package/dist/app/session-shell/session-shell-root.d.ts +2 -1
  6. package/dist/app/session-shell/session-shell-root.js +13 -6
  7. package/dist/app/session-shell/session-shell.js +45 -3
  8. package/dist/app/session-shell/session-viewport-controller.js +33 -21
  9. package/dist/cli/dispatch.js +5 -3
  10. package/dist/cli/session-context.d.ts +5 -1
  11. package/dist/cli/session-context.js +25 -8
  12. package/dist/composition/owned-ui.d.ts +3 -0
  13. package/dist/composition/owned-ui.js +66 -6
  14. package/dist/composition/settings-route-host.js +2 -1
  15. package/dist/contracts/owned-ui/index.d.ts +4 -2
  16. package/dist/contracts/owned-ui/index.js +1 -1
  17. package/dist/contracts/owned-ui/model.d.ts +4 -0
  18. package/dist/contracts/owned-ui/suggestion-diagnostics.d.ts +5 -1
  19. package/dist/contracts/owned-ui/suggestion-diagnostics.js +3 -1
  20. package/dist/contracts/owned-ui/validation.js +7 -0
  21. package/dist/features/launch/index.d.ts +1 -1
  22. package/dist/features/launch/session-context.d.ts +17 -2
  23. package/dist/features/launch/session-context.js +9 -5
  24. package/dist/features/owned-ui/settings-app.js +21 -39
  25. package/dist/features/prompt-suggestions/diagnostics.js +4 -1
  26. package/dist/foundation/lifecycle/index.d.ts +2 -2
  27. package/dist/foundation/lifecycle/index.js +1 -1
  28. package/dist/foundation/lifecycle/session-repository-context.d.ts +19 -2
  29. package/dist/foundation/lifecycle/session-repository-context.js +434 -66
  30. package/dist/foundation/process-containment/index.d.ts +1 -0
  31. package/dist/foundation/process-containment/index.js +1 -0
  32. package/dist/foundation/process-containment/native-process-inspector.d.ts +3 -0
  33. package/dist/foundation/process-containment/native-process-inspector.js +21 -0
  34. package/dist/foundation/release/progress-palette.generated.d.ts +2 -2
  35. package/dist/foundation/release/progress-palette.generated.js +2 -2
  36. package/dist/foundation/startup/startup-descriptor.js +2 -2
  37. package/dist/integrations/pi/components/components.js +2 -2
  38. package/dist/integrations/pi/components/index.d.ts +2 -2
  39. package/dist/integrations/pi/components/index.js +1 -1
  40. package/dist/integrations/pi/components/modal-frame.js +3 -4
  41. package/dist/integrations/pi/components/models-dialog.js +5 -5
  42. package/dist/integrations/pi/components/prompt-input-port.d.ts +1 -0
  43. package/dist/integrations/pi/components/resources/builtin-themes.d.ts +2 -2
  44. package/dist/integrations/pi/components/resources/builtin-themes.js +2 -2
  45. package/dist/integrations/pi/components/share-operation-dialog.js +3 -3
  46. package/dist/integrations/pi/components/shell-editor-autocomplete.js +8 -7
  47. package/dist/integrations/pi/components/shell-extension-ui.d.ts +2 -0
  48. package/dist/integrations/pi/components/shell-extension-ui.js +20 -10
  49. package/dist/integrations/pi/components/shell-hotkey-sections.js +2 -2
  50. package/dist/integrations/pi/components/shell-presenters-info.js +10 -10
  51. package/dist/integrations/pi/components/shell-presenters-transcript.js +10 -10
  52. package/dist/integrations/pi/components/shell-selectors-dialogs.js +5 -6
  53. package/dist/integrations/pi/components/shell-shared-facade.js +1 -1
  54. package/dist/integrations/pi/components/skills-dialog.js +3 -3
  55. package/dist/integrations/pi/components/submitted-prompt-adapter.js +2 -3
  56. package/dist/integrations/pi/components/theme.d.ts +9 -0
  57. package/dist/integrations/pi/components/theme.js +30 -0
  58. package/dist/integrations/pi/components/tool-result-adapter.js +6 -1
  59. package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.d.ts +1 -1
  60. package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.js +1 -1
  61. package/dist/integrations/pi/components/upstream/assets/earendil-image.json +2 -2
  62. package/dist/integrations/pi/components/upstream/components/countdown-timer.d.ts +1 -1
  63. package/dist/integrations/pi/components/upstream/components/earendil-announcement.js +1 -1
  64. package/dist/integrations/pi/components/upstream/components/extension-editor.d.ts +1 -1
  65. package/dist/integrations/pi/components/upstream/components/extension-editor.js +6 -6
  66. package/dist/integrations/pi/components/upstream/components/extension-input.js +4 -4
  67. package/dist/integrations/pi/components/upstream/components/extension-selector.js +4 -4
  68. package/dist/integrations/pi/components/upstream/components/mermaid.js +1 -1
  69. package/dist/integrations/pi/components/upstream/components/owned-editor.d.ts +5 -5
  70. package/dist/integrations/pi/components/upstream/components/owned-editor.js +8 -5
  71. package/dist/integrations/pi/components/upstream/components/pi-logo.js +1 -1
  72. package/dist/integrations/pi/components/upstream/components/scoped-models-selector.d.ts +1 -1
  73. package/dist/integrations/pi/components/upstream/components/scoped-models-selector.js +3 -3
  74. package/dist/integrations/pi/components/upstream/components/session-footer.js +1 -1
  75. package/dist/integrations/pi/components/upstream/components/session-selector-search.js +1 -1
  76. package/dist/integrations/pi/components/upstream/components/session-selector.js +9 -9
  77. package/dist/integrations/pi/components/upstream/components/skill-invocation-message.d.ts +3 -2
  78. package/dist/integrations/pi/components/upstream/components/skill-invocation-message.js +6 -3
  79. package/dist/integrations/pi/components/upstream/components/status-indicator.d.ts +1 -1
  80. package/dist/integrations/pi/components/upstream/components/status-indicator.js +1 -1
  81. package/dist/integrations/pi/components/upstream/components/themed-text.d.ts +1 -1
  82. package/dist/integrations/pi/components/upstream/components/themed-text.js +1 -1
  83. package/dist/integrations/pi/components/upstream/components/thinking-selector.d.ts +1 -1
  84. package/dist/integrations/pi/components/upstream/components/thinking-selector.js +2 -2
  85. package/dist/integrations/pi/components/upstream/components/tool-execution.d.ts +4 -0
  86. package/dist/integrations/pi/components/upstream/components/tool-execution.js +11 -1
  87. package/dist/integrations/pi/components/upstream/components/tree-selector.d.ts +2 -2
  88. package/dist/integrations/pi/components/upstream/components/tree-selector.js +27 -18
  89. package/dist/integrations/pi/components/upstream/components/trust-selector.js +1 -1
  90. package/dist/integrations/pi/components/upstream/external-editor.js +1 -1
  91. package/dist/integrations/pi/components/upstream/history/editor-core.d.ts +4 -4
  92. package/dist/integrations/pi/components/upstream/history/editor-core.js +11 -7
  93. package/dist/integrations/pi/components/upstream/history/kill-ring.d.ts +1 -1
  94. package/dist/integrations/pi/components/upstream/history/kill-ring.js +1 -1
  95. package/dist/integrations/pi/components/upstream/history/printable-key.js +1 -1
  96. package/dist/integrations/pi/components/upstream/history/text-helpers.js +1 -1
  97. package/dist/integrations/pi/components/upstream/history/undo-stack.d.ts +1 -1
  98. package/dist/integrations/pi/components/upstream/history/undo-stack.js +1 -1
  99. package/dist/integrations/pi/components/upstream/history/word-navigation.js +1 -1
  100. package/dist/integrations/pi/components/upstream/model-search.d.ts +1 -1
  101. package/dist/integrations/pi/components/upstream/program-status-reporter.d.ts +31 -0
  102. package/dist/integrations/pi/components/upstream/program-status-reporter.js +89 -0
  103. package/dist/integrations/pi/components/upstream/theme/system-theme.d.ts +1 -1
  104. package/dist/integrations/pi/components/upstream/theme/system-theme.js +1 -1
  105. package/dist/integrations/pi/components/upstream/theme/theme-controller.d.ts +1 -1
  106. package/dist/integrations/pi/components/upstream/theme/theme.d.ts +18 -1
  107. package/dist/integrations/pi/components/upstream/theme/theme.js +207 -10
  108. package/dist/integrations/pi/engine/pi-settings-metadata.json +1 -1
  109. package/dist/integrations/pi/engine/resources/changelog.json +4 -4
  110. package/dist/integrations/pi/engine/session-events.js +10 -2
  111. package/dist/integrations/pi/engine/transcript-projection.js +2 -1
  112. package/dist/integrations/pi/startup-public.js +306 -290
  113. package/dist/integrations/pi/startup-public.manifest.json +289 -265
  114. package/dist/integrations/pi/tui-runtime/adapter.d.ts +2 -1
  115. package/dist/integrations/pi/tui-runtime/adapter.js +7 -0
  116. package/dist/integrations/pi/tui-runtime/contracts.d.ts +3 -1
  117. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +1 -1
  118. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.js +1 -1
  119. package/dist/native/darwin-arm64/manifest.json +1 -1
  120. package/dist/native/linux-x64/manifest.json +1 -1
  121. package/dist/native/win32-x64/manifest.json +2 -2
  122. package/dist/native/win32-x64/process-guardian.exe +0 -0
  123. package/dist/product-identity.d.ts +2 -2
  124. package/dist/product-identity.js +2 -2
  125. package/dist/product-identity.json +3 -1
  126. package/dist/runtime-payload-inventory.json +3092 -2878
  127. package/dist/ui/components/prompt-input.d.ts +2 -0
  128. package/dist/ui/components/prompt-input.js +5 -1
  129. package/dist/ui/components/text-selection.d.ts +1 -1
  130. package/dist/ui/components/text-selection.js +3 -1
  131. package/dist/ui/components/theme.d.ts +2 -0
  132. package/dist/ui/components/transcript-viewport.d.ts +6 -4
  133. package/dist/ui/components/transcript-viewport.js +94 -16
  134. package/dist/ui/components/value-menu.d.ts +2 -0
  135. package/dist/ui/components/value-menu.js +13 -8
  136. package/dist/ui/settings/declarations.d.ts +26 -14
  137. package/dist/ui/settings/declarations.js +24 -11
  138. package/dist/ui/settings/migrations.js +16 -0
  139. package/docs/architecture/project-structure.md +4 -3
  140. package/docs/architecture/prompt-suggestions.md +14 -10
  141. package/docs/local-worktree-cleanup.md +11 -5
  142. package/docs/openspec-archive-automation.md +6 -5
  143. package/package.json +3 -3
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
3
3
  * packages/coding-agent/src/modes/interactive/components/tool-execution.ts.
4
4
  * Modifications: Retain pinned shell and actual public tool-definition renderers. Replace private
5
5
  * index-keyed image conversion with current-source ownership, serial conversion, visible fallback, and
@@ -73,6 +73,7 @@ export class ToolExecutionComponent extends Container {
73
73
  expanded = false;
74
74
  showImages;
75
75
  imageWidthCells;
76
+ outputPad;
76
77
  isPartial = true;
77
78
  toolDefinition;
78
79
  builtInToolDefinition;
@@ -94,6 +95,7 @@ export class ToolExecutionComponent extends Container {
94
95
  this.toolDefinition = mergeBuiltInRenderers(toolDefinition, this.builtInToolDefinition);
95
96
  this.showImages = options.showImages ?? true;
96
97
  this.imageWidthCells = options.imageWidthCells ?? 60;
98
+ this.outputPad = options.outputPad ?? 1;
97
99
  this.ui = ui;
98
100
  this.cwd = cwd;
99
101
  this.images = new ToolImagePresentation(() => {
@@ -149,6 +151,8 @@ export class ToolExecutionComponent extends Container {
149
151
  expanded: this.expanded,
150
152
  showImages: this.showImages,
151
153
  isError: this.result?.isError ?? false,
154
+ durationMs: this.isPartial ? undefined : this.result?.durationMs,
155
+ outputPad: this.outputPad,
152
156
  };
153
157
  }
154
158
  createCallFallback() {
@@ -212,6 +216,10 @@ export class ToolExecutionComponent extends Container {
212
216
  this.expanded = expanded;
213
217
  this.updateDisplay();
214
218
  }
219
+ setOutputPad(outputPad) {
220
+ this.outputPad = outputPad;
221
+ this.updateDisplay();
222
+ }
215
223
  setShowImages(show) {
216
224
  this.showImages = show;
217
225
  this.updateDisplay();
@@ -288,6 +296,7 @@ export class ToolExecutionComponent extends Container {
288
296
  const renderContainer = this.getRenderShell() === "self" ? this.selfRenderContainer : this.contentBox;
289
297
  if (renderContainer instanceof Box) {
290
298
  renderContainer.setBgFn(bgFn);
299
+ renderContainer.setPaddingX(this.outputPad);
291
300
  }
292
301
  renderContainer.clear();
293
302
  const callRenderer = this.getCallRenderer();
@@ -337,6 +346,7 @@ export class ToolExecutionComponent extends Container {
337
346
  }
338
347
  else {
339
348
  this.contentText.setCustomBgFn(bgFn);
349
+ this.contentText.setPaddingX(this.outputPad);
340
350
  this.contentText.setText(this.formatToolExecution());
341
351
  hasContent = true;
342
352
  }
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
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
6
6
  * Models-style filter status with Tab/Shift+Tab directional cycling and concise all-first presentation
7
- * excluding internal bookkeeping, standard search input, blue item-bounded menu-arrow selection that
7
+ * excluding internal bookkeeping, standard search input, blue full-row menu-arrow selection that
8
8
  * preserves per-entry semantic foregrounds and has no path bullets, accent entry labels, bracketed
9
9
  * timestamps, numeric result counters without duplicate label-time status, and a stateful time on/off
10
10
  * shortcut, semantic role colors with session naming for the system root, standard
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
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
6
6
  * Models-style filter status with Tab/Shift+Tab directional cycling and concise all-first presentation
7
- * excluding internal bookkeeping, standard search input, blue item-bounded menu-arrow selection that
7
+ * excluding internal bookkeeping, standard search input, blue full-row menu-arrow selection that
8
8
  * preserves per-entry semantic foregrounds and has no path bullets, accent entry labels, bracketed
9
9
  * timestamps, numeric result counters without duplicate label-time status, and a stateful time on/off
10
10
  * shortcut, semantic role colors with session naming for the system root, standard
@@ -18,7 +18,7 @@ import { Container, Input, matchesKey, Spacer, sliceByColumn, Text, truncateToWi
18
18
  import { DynamicBorder } from "../../../startup-public.js";
19
19
  import { KeybindingsManager } from "../adjacent/core/keybindings.js";
20
20
  import { addPiModalHeader, adoptPiModalFrame } from "../../modal-frame.js";
21
- import { DIALOG_CLOSE_SHORTCUT_HINT, piTheme, renderPiModalShortcutHints } from "../../theme.js";
21
+ import { DIALOG_CLOSE_SHORTCUT_HINT, paintPiBorder, piTheme, renderPiModalShortcutHints } from "../../theme.js";
22
22
  const theme = new Proxy({}, {
23
23
  get(_target, property) {
24
24
  const active = piTheme();
@@ -41,6 +41,19 @@ const MIN_VISIBLE_ANCHOR_CONTENT_WIDTH = 4;
41
41
  const MAX_VISIBLE_ANCHOR_CONTENT_WIDTH = 20;
42
42
  const MIN_ANCHOR_CONTEXT_WIDTH = 2;
43
43
  const MAX_ANCHOR_CONTEXT_WIDTH = 12;
44
+ /** Fit and paint a selected viewport row without letting nested SGR changes clear its background. */
45
+ function renderSelectedViewportRow(value, width) {
46
+ const availableWidth = Math.max(0, width);
47
+ const clipped = truncateToWidth(value, availableWidth, "");
48
+ const fitted = `${clipped}${" ".repeat(Math.max(0, availableWidth - visibleWidth(clipped)))}`;
49
+ const marker = "\u0000";
50
+ const wrapper = theme.bg("selectedBg", marker);
51
+ const markerIndex = wrapper.indexOf(marker);
52
+ const on = wrapper.slice(0, markerIndex);
53
+ const off = wrapper.slice(markerIndex + marker.length);
54
+ const reasserted = fitted.replace(/\u001b\[[0-?]*[ -/]*m/gu, sequence => `${sequence}${on}`);
55
+ return `${on}${reasserted}${off}`;
56
+ }
44
57
  /**
45
58
  * Render tree rows into a horizontally clipped viewport.
46
59
  *
@@ -64,20 +77,20 @@ function renderHorizontalViewport(rows, width) {
64
77
  }
65
78
  // Clip only the body; the fixed-width gutter remains visible as navigation context.
66
79
  return rows.map((row) => {
67
- if (viewportWidth === 0)
68
- return truncateToWidth(row.gutter, width, "");
80
+ if (viewportWidth === 0) {
81
+ const gutter = truncateToWidth(row.gutter, width, "");
82
+ return row.isSelected ? renderSelectedViewportRow(gutter, width) : gutter;
83
+ }
69
84
  const leftClipped = horizontalScroll > 0;
70
85
  const widthAfterLeftMarker = Math.max(0, viewportWidth - (leftClipped ? 1 : 0));
71
86
  const rightClipped = row.bodyWidth - horizontalScroll > widthAfterLeftMarker;
72
87
  const rightMarkerText = `…${row.rightClipSuffix}`;
73
88
  const rightMarkerWidth = rightClipped ? visibleWidth(rightMarkerText) : 0;
74
89
  const bodyWidth = Math.max(0, widthAfterLeftMarker - rightMarkerWidth);
75
- const marker = (text) => row.isSelected
76
- ? theme.bg("selectedBg", theme.fg("muted", text))
77
- : theme.fg("muted", text);
90
+ const marker = (text) => theme.fg("muted", text);
78
91
  const body = sliceByColumn(row.body, horizontalScroll, bodyWidth, true);
79
92
  const line = `${row.gutter}${leftClipped ? marker("…") : ""}${body}${rightClipped ? marker(rightMarkerText) : ""}\x1b[0m`;
80
- return truncateToWidth(line, width, "");
93
+ return row.isSelected ? renderSelectedViewportRow(line, width) : truncateToWidth(line, width, "");
81
94
  });
82
95
  }
83
96
  const FILTER_MODES = ["all", "no-tools", "user-only", "labeled-only"];
@@ -620,12 +633,8 @@ class TreeList {
620
633
  const content = this.getEntryDisplayText(flatNode.node);
621
634
  const prefixPart = theme.fg("dim", prefix) + foldMarker;
622
635
  const anchorCol = visibleWidth(prefixPart);
623
- let gutter = cursor;
624
- let body = prefixPart + label + labelTimestamp + content;
625
- if (isSelected) {
626
- gutter = theme.bg("selectedBg", gutter);
627
- body = theme.bg("selectedBg", body);
628
- }
636
+ const gutter = cursor;
637
+ const body = prefixPart + label + labelTimestamp + content;
629
638
  const rightClipSuffix = entry.type === "message" && entry.message.role === "toolResult" ? "]" : "";
630
639
  renderedRows.push({ gutter, body, anchorCol, bodyWidth: visibleWidth(body), rightClipSuffix, isSelected });
631
640
  }
@@ -1088,7 +1097,7 @@ class TreeFilter {
1088
1097
  invalidate() { }
1089
1098
  render(width) {
1090
1099
  const active = this.treeList.getFilterMode();
1091
- const choices = FILTER_MODES.map((mode) => theme.fg(mode === active ? "accent" : "muted", FILTER_LABELS[mode]));
1100
+ const choices = FILTER_MODES.map((mode) => theme.fg(mode === active ? "mdHeading" : "muted", FILTER_LABELS[mode]));
1092
1101
  return [truncateToWidth(theme.fg("muted", "Filter: ") + choices.join(theme.fg("muted", " | ")), width)];
1093
1102
  }
1094
1103
  }
@@ -1269,12 +1278,12 @@ export class TreeSelectorComponent extends Container {
1269
1278
  this.treeHelp = new TreeHelp(this.treeList);
1270
1279
  this.titleText = new Text(theme.fg("accent", theme.bold("Session Tree")), 0, 0);
1271
1280
  this.restoreTreeContent();
1272
- const header = addPiModalHeader(this, new DynamicBorder(), this.titleText);
1281
+ const header = addPiModalHeader(this, new DynamicBorder(paintPiBorder), this.titleText);
1273
1282
  this.addChild(this.searchInputContainer);
1274
1283
  this.addChild(this.treeContainer);
1275
1284
  this.addChild(this.labelInputContainer);
1276
1285
  this.addChild(this.footerContainer);
1277
- this.addChild(new DynamicBorder());
1286
+ this.addChild(new DynamicBorder(paintPiBorder));
1278
1287
  adoptPiModalFrame(this, {
1279
1288
  topIndex: 0,
1280
1289
  bottomIndex: this.children.length - 1,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
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.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
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,11 +1,11 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-tui 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
2
+ * Provenance: @earendil-works/pi-tui 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
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
6
- * history label and separate centered history-overflow cue, and history-count retention during cursor
7
- * placement within recalled multiline text. Public terminal runtime/exports remain shared and
8
- * unchanged. See docs/architecture/history-editor-provenance.md.
6
+ * history label with a three-cell inset and separate centered history-overflow cue, and history-count
7
+ * retention during cursor placement within recalled multiline text. Public terminal runtime/exports
8
+ * remain shared and unchanged. See docs/architecture/history-editor-provenance.md.
9
9
  * Deviations: compact-history-counter-label, history-overflow-cue-separation,
10
10
  * history-recall-cursor-retention, persistent-history-owned-editor-boundary.
11
11
  */
@@ -1,11 +1,11 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-tui 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
2
+ * Provenance: @earendil-works/pi-tui 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
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
6
- * history label and separate centered history-overflow cue, and history-count retention during cursor
7
- * placement within recalled multiline text. Public terminal runtime/exports remain shared and
8
- * unchanged. See docs/architecture/history-editor-provenance.md.
6
+ * history label with a three-cell inset and separate centered history-overflow cue, and history-count
7
+ * retention during cursor placement within recalled multiline text. Public terminal runtime/exports
8
+ * remain shared and unchanged. See docs/architecture/history-editor-provenance.md.
9
9
  * Deviations: compact-history-counter-label, history-overflow-cue-separation,
10
10
  * history-recall-cursor-retention, persistent-history-owned-editor-boundary.
11
11
  */
@@ -191,6 +191,8 @@ function buildDebouncePattern(triggerCharacters) {
191
191
  const escapedWithoutAt = triggerCharacters.filter((character) => character !== "@").map(escapeCharacterClass);
192
192
  return new RegExp(`${autocompleteTokenStartSource}(?:@(?:"[^"]*|${unquotedAutocompleteSuffixRegex.source})|[${escapedWithoutAt.join("")}]${unquotedAutocompleteSuffixRegex.source})$`, "u");
193
193
  }
194
+ const HISTORY_COUNTER_INSET = 3;
195
+ const HISTORY_COUNTER_PREFIX = "── ";
194
196
  function createScrollBorder(direction, hiddenLineCount, width, minimumCueStart = 0) {
195
197
  const availableWidth = Math.max(0, width);
196
198
  const label = ` ${direction} ${hiddenLineCount} more `;
@@ -491,7 +493,7 @@ export class HistoryEditorCore {
491
493
  if (this.persistentHistory && this.historyIndex >= 0) {
492
494
  const history = `${this.history.length - this.historyIndex}/${this.history.length} `;
493
495
  if (hiddenLineCount > 0) {
494
- const historyStart = 4;
496
+ const historyStart = HISTORY_COUNTER_INSET;
495
497
  const historyEnd = historyStart + visibleWidth(history);
496
498
  const historyAnchorStart = historyStart - 1;
497
499
  if (historyEnd <= width) {
@@ -501,10 +503,12 @@ export class HistoryEditorCore {
501
503
  + this.borderColor(border.slice(historyEnd));
502
504
  }
503
505
  }
504
- const label = `─── ${history}`;
506
+ const label = `${HISTORY_COUNTER_PREFIX}${history}`;
505
507
  const shown = truncateToWidth(label, width);
506
508
  const remaining = Math.max(0, width - visibleWidth(shown));
507
- return this.borderColor(shown.slice(0, 4)) + this.styleHistoryLabel(shown.slice(4)) + this.borderColor("─".repeat(remaining));
509
+ return this.borderColor(shown.slice(0, HISTORY_COUNTER_INSET))
510
+ + this.styleHistoryLabel(shown.slice(HISTORY_COUNTER_INSET))
511
+ + this.borderColor("─".repeat(remaining));
508
512
  }
509
513
  const border = hiddenLineCount > 0 ? createScrollBorder("↑", hiddenLineCount, width) : "─".repeat(width);
510
514
  return this.borderColor(border);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-tui 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
2
+ * Provenance: @earendil-works/pi-tui 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
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.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
2
+ * Provenance: @earendil-works/pi-tui 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
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.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
2
+ * Provenance: @earendil-works/pi-tui 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
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.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
2
+ * Provenance: @earendil-works/pi-tui 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
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.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
2
+ * Provenance: @earendil-works/pi-tui 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
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.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
2
+ * Provenance: @earendil-works/pi-tui 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
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.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
2
+ * Provenance: @earendil-works/pi-tui 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
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.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
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.
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Provenance: @earendil-works/pi-coding-agent 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
3
+ * packages/coding-agent/src/modes/interactive/program-status-reporter.ts.
4
+ * Modifications: Remap Pi session events to A1's neutral run events, inject the terminal reporter, use
5
+ * A1's application identity, and clear dialog state when the owned session changes.
6
+ * Deviations: none.
7
+ */
8
+ import type { ProgramStatus } from "@earendil-works/pi-tui";
9
+ import type { OwnedUiEvent } from "../../../../contracts/owned-ui/index.js";
10
+ export type ProgramStatusBlocked = {
11
+ readonly kind: NonNullable<ProgramStatus["kind"]>;
12
+ readonly message: string;
13
+ };
14
+ type ProgramStatusRunEvent = Extract<OwnedUiEvent, {
15
+ type: "agent-run-started" | "assistant-message-completed" | "agent-run-settled";
16
+ }>;
17
+ /** Reports A1's owned session lifecycle through Pi TUI's OSC 7501 terminal contract. */
18
+ export declare class ProgramStatusReporter {
19
+ #private;
20
+ constructor(reportStatus: (status: ProgramStatus) => void, getSessionName: () => string | undefined, app?: string);
21
+ handleEvent(event: ProgramStatusRunEvent): void;
22
+ /** Report `blocked` for a dialog until it is cleared with `undefined`. Reopening a source replaces it. */
23
+ setBlocked(source: string, status: ProgramStatusBlocked | undefined): void;
24
+ /** Preserve the first visible error line without exposing transcript or prompt content. */
25
+ setErrorMessage(message: string | undefined): void;
26
+ /** Forget the previous session's run and transient dialogs. */
27
+ reset(): void;
28
+ clear(): void;
29
+ report(): void;
30
+ }
31
+ export {};
@@ -0,0 +1,89 @@
1
+ function firstLine(text) {
2
+ return text?.split(/\r?\n/, 1)[0]?.trim() || "Error";
3
+ }
4
+ /** Reports A1's owned session lifecycle through Pi TUI's OSC 7501 terminal contract. */
5
+ export class ProgramStatusReporter {
6
+ #reportStatus;
7
+ #getSessionName;
8
+ #app;
9
+ #runActive = false;
10
+ #runResult = { state: "done" };
11
+ #restingStatus = { state: "idle" };
12
+ #blocked = new Map();
13
+ #lastReport;
14
+ constructor(reportStatus, getSessionName, app = "a1") {
15
+ this.#reportStatus = reportStatus;
16
+ this.#getSessionName = getSessionName;
17
+ this.#app = app;
18
+ }
19
+ handleEvent(event) {
20
+ switch (event.type) {
21
+ case "agent-run-started":
22
+ this.#runActive = true;
23
+ this.#runResult = { state: "done" };
24
+ break;
25
+ case "assistant-message-completed":
26
+ this.#runResult = event.successful
27
+ ? { state: "done" }
28
+ : this.#runResult.state === "error" ? this.#runResult : { state: "error" };
29
+ break;
30
+ case "agent-run-settled":
31
+ this.#runActive = false;
32
+ this.#restingStatus = event.aborted
33
+ ? { state: "idle" }
34
+ : event.successful
35
+ ? this.#runResult
36
+ : this.#runResult.state === "error" ? this.#runResult : { state: "error" };
37
+ break;
38
+ }
39
+ this.report();
40
+ }
41
+ /** Report `blocked` for a dialog until it is cleared with `undefined`. Reopening a source replaces it. */
42
+ setBlocked(source, status) {
43
+ this.#blocked.delete(source);
44
+ if (status !== undefined)
45
+ this.#blocked.set(source, status);
46
+ this.report();
47
+ }
48
+ /** Preserve the first visible error line without exposing transcript or prompt content. */
49
+ setErrorMessage(message) {
50
+ const status = { state: "error", message: firstLine(message) };
51
+ if (this.#runActive)
52
+ this.#runResult = status;
53
+ else
54
+ this.#restingStatus = status;
55
+ this.report();
56
+ }
57
+ /** Forget the previous session's run and transient dialogs. */
58
+ reset() {
59
+ this.#runActive = false;
60
+ this.#runResult = { state: "done" };
61
+ this.#restingStatus = { state: "idle" };
62
+ this.#blocked.clear();
63
+ this.report();
64
+ }
65
+ clear() {
66
+ this.#emit({ state: "clear", app: this.#app });
67
+ }
68
+ report() {
69
+ this.#emit({ ...this.#currentStatus(), app: this.#app });
70
+ }
71
+ #emit(status) {
72
+ const key = JSON.stringify(status);
73
+ if (key === this.#lastReport)
74
+ return;
75
+ this.#lastReport = key;
76
+ this.#reportStatus(status);
77
+ }
78
+ #currentStatus() {
79
+ const blocked = [...this.#blocked.values()].at(-1);
80
+ if (blocked !== undefined)
81
+ return { state: "blocked", ...blocked };
82
+ const status = this.#runActive ? { state: "working" } : this.#restingStatus;
83
+ if (status.state === "working" || status.state === "done") {
84
+ const message = this.#getSessionName();
85
+ return { ...status, ...(message === undefined ? {} : { message }) };
86
+ }
87
+ return status;
88
+ }
89
+ }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
3
3
  * packages/coding-agent/src/modes/interactive/theme/system-theme.ts.
4
4
  * Modifications: Copied the system palette generator with ESM import remapping and strict
5
5
  * indexed-access assertions; A1 retains explicit owned theme selection.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
3
3
  * packages/coding-agent/src/modes/interactive/theme/system-theme.ts.
4
4
  * Modifications: Copied the system palette generator with ESM import remapping and strict
5
5
  * indexed-access assertions; A1 retains explicit owned theme selection.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.0.4 (MIT), commit 7c10bd4337495ee613f2224843ecdf349b80d1df,
2
+ * Provenance: @earendil-works/pi-coding-agent 1.1.0 (MIT), commit abe508e1b89912adde45528136c3221eb69acdd7,
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,6 +1,7 @@
1
1
  import { Theme, type ThemeColor } from "@earendil-works/pi-coding-agent";
2
2
  export type { ThemeColor } from "@earendil-works/pi-coding-agent";
3
- import { type RgbColor } from "@earendil-works/pi-tui";
3
+ import { type Color, type RgbColor } from "@earendil-works/pi-tui";
4
+ import type { UiAccentColor } from "../../../../../contracts/owned-ui/index.js";
4
5
  export declare const PINNED_PI_LAYOUT: Readonly<{
5
6
  readonly editorPaddingX: 0;
6
7
  readonly outputPad: 1;
@@ -35,9 +36,25 @@ export interface PiTerminalThemeDetector {
35
36
  readonly timeoutMs: number;
36
37
  }): Promise<PiTerminalTheme | undefined>;
37
38
  }
39
+ export interface PiAccentProjection {
40
+ readonly accent: Color;
41
+ readonly border: Color;
42
+ readonly secondaryHeading: Color;
43
+ readonly selectedBg: Color;
44
+ readonly userMessageBg: Color;
45
+ }
46
+ /** Derive the complete semantic family from any primary accent, including future custom colors. */
47
+ export declare function derivePiAccentProjection(accent: Color, appearance: PiTerminalTheme): PiAccentProjection;
38
48
  export declare function ensurePiTheme(): Theme;
39
49
  export declare function piTheme(): Theme;
40
50
  export declare function currentPiThemeName(): string;
51
+ export declare function currentPiAccentColor(): UiAccentColor;
52
+ /** Paints one menu swatch from a named A1 palette entry. */
53
+ export declare function renderPiAccentPreview(color: string, text: string): string | null;
54
+ /** Keeps the complete comparison theme unmodified while bare A1 projects its semantic accent family. */
55
+ export declare function setPiPackageBorderProjectionEnabled(enabled: boolean): void;
56
+ /** Reprojects the active base theme; repeated changes never derive from an earlier projection. */
57
+ export declare function setPiAccentColor(color: UiAccentColor): void;
41
58
  export declare function applyPiTheme(name: string, enableWatcher?: boolean, mode?: PiColorMode): PiThemeResult;
42
59
  export declare function applyPiThemeInstance(theme: Theme): PiThemeResult;
43
60
  export declare function onPiThemeChange(listener: () => void): () => void;