@timurproko/a1 0.2.3-dev.651 → 0.2.3-dev.656

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 (83) hide show
  1. package/dist/app/session-shell/session-shell.js +9 -2
  2. package/dist/contracts/owned-ui/model.d.ts +5 -0
  3. package/dist/foundation/startup/startup-descriptor.js +2 -2
  4. package/dist/integrations/pi/components/resources/builtin-themes.d.ts +114 -126
  5. package/dist/integrations/pi/components/resources/builtin-themes.js +145 -157
  6. package/dist/integrations/pi/components/shell-footer-status.js +12 -8
  7. package/dist/integrations/pi/components/shell-presenters-info.js +1 -1
  8. package/dist/integrations/pi/components/shell-selectors-dialogs.js +1 -0
  9. package/dist/integrations/pi/components/shell-shared-facade.js +1 -2
  10. package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.d.ts +2 -2
  11. package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.js +2 -2
  12. package/dist/integrations/pi/components/upstream/assets/earendil-image.json +2 -2
  13. package/dist/integrations/pi/components/upstream/components/countdown-timer.d.ts +1 -1
  14. package/dist/integrations/pi/components/upstream/components/daxnuts.d.ts +1 -1
  15. package/dist/integrations/pi/components/upstream/components/daxnuts.js +1 -1
  16. package/dist/integrations/pi/components/upstream/components/earendil-announcement.js +1 -1
  17. package/dist/integrations/pi/components/upstream/components/extension-editor.d.ts +1 -1
  18. package/dist/integrations/pi/components/upstream/components/extension-editor.js +1 -1
  19. package/dist/integrations/pi/components/upstream/components/extension-input.js +1 -1
  20. package/dist/integrations/pi/components/upstream/components/extension-selector.js +1 -1
  21. package/dist/integrations/pi/components/upstream/components/mermaid.js +1 -1
  22. package/dist/integrations/pi/components/upstream/components/owned-editor.d.ts +1 -1
  23. package/dist/integrations/pi/components/upstream/components/owned-editor.js +1 -1
  24. package/dist/integrations/pi/components/upstream/components/pi-logo.d.ts +2 -0
  25. package/dist/integrations/pi/components/upstream/components/pi-logo.js +21 -0
  26. package/dist/integrations/pi/components/upstream/components/scoped-models-selector.d.ts +1 -1
  27. package/dist/integrations/pi/components/upstream/components/session-footer.js +13 -6
  28. package/dist/integrations/pi/components/upstream/components/session-selector-search.js +1 -1
  29. package/dist/integrations/pi/components/upstream/components/session-selector.js +1 -1
  30. package/dist/integrations/pi/components/upstream/components/skill-invocation-message.d.ts +1 -1
  31. package/dist/integrations/pi/components/upstream/components/skill-invocation-message.js +1 -1
  32. package/dist/integrations/pi/components/upstream/components/status-indicator.d.ts +1 -1
  33. package/dist/integrations/pi/components/upstream/components/status-indicator.js +1 -1
  34. package/dist/integrations/pi/components/upstream/components/themed-text.d.ts +16 -0
  35. package/dist/integrations/pi/components/upstream/components/themed-text.js +28 -0
  36. package/dist/integrations/pi/components/upstream/components/thinking-selector.d.ts +1 -1
  37. package/dist/integrations/pi/components/upstream/components/thinking-selector.js +1 -1
  38. package/dist/integrations/pi/components/upstream/components/tool-execution.js +25 -3
  39. package/dist/integrations/pi/components/upstream/components/tree-selector.d.ts +1 -1
  40. package/dist/integrations/pi/components/upstream/components/tree-selector.js +1 -1
  41. package/dist/integrations/pi/components/upstream/components/trust-selector.js +1 -1
  42. package/dist/integrations/pi/components/upstream/external-editor.js +1 -1
  43. package/dist/integrations/pi/components/upstream/history/editor-core.d.ts +1 -1
  44. package/dist/integrations/pi/components/upstream/history/editor-core.js +5 -3
  45. package/dist/integrations/pi/components/upstream/history/kill-ring.d.ts +1 -1
  46. package/dist/integrations/pi/components/upstream/history/kill-ring.js +1 -1
  47. package/dist/integrations/pi/components/upstream/history/printable-key.js +1 -1
  48. package/dist/integrations/pi/components/upstream/history/text-helpers.js +1 -1
  49. package/dist/integrations/pi/components/upstream/history/undo-stack.d.ts +1 -1
  50. package/dist/integrations/pi/components/upstream/history/undo-stack.js +1 -1
  51. package/dist/integrations/pi/components/upstream/history/word-navigation.js +1 -1
  52. package/dist/integrations/pi/components/upstream/model-search.d.ts +1 -1
  53. package/dist/integrations/pi/components/upstream/theme/system-theme.d.ts +60 -0
  54. package/dist/integrations/pi/components/upstream/theme/system-theme.js +695 -0
  55. package/dist/integrations/pi/components/upstream/theme/theme-controller.d.ts +1 -1
  56. package/dist/integrations/pi/components/upstream/theme/theme.d.ts +6 -2
  57. package/dist/integrations/pi/components/upstream/theme/theme.js +22 -7
  58. package/dist/integrations/pi/engine/adapter.js +6 -0
  59. package/dist/integrations/pi/engine/pi-settings-metadata.json +10 -0
  60. package/dist/integrations/pi/engine/resources/changelog.json +4 -4
  61. package/dist/integrations/pi/engine/session-integration.d.ts +2 -2
  62. package/dist/integrations/pi/engine/session-integration.js +1 -1
  63. package/dist/integrations/pi/engine/settings-bridge.d.ts +1 -1
  64. package/dist/integrations/pi/engine/settings-bridge.js +9 -0
  65. package/dist/integrations/pi/engine/settings-port.js +4 -1
  66. package/dist/integrations/pi/engine/workflows.d.ts +2 -1
  67. package/dist/integrations/pi/engine/workflows.js +1 -0
  68. package/dist/integrations/pi/startup-public.js +1925 -1309
  69. package/dist/integrations/pi/startup-public.manifest.json +1611 -929
  70. package/dist/integrations/pi/tui-runtime/adapter.d.ts +2 -0
  71. package/dist/integrations/pi/tui-runtime/adapter.js +5 -0
  72. package/dist/integrations/pi/tui-runtime/contracts.d.ts +2 -1
  73. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +1 -1
  74. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.js +1 -1
  75. package/dist/native/darwin-arm64/manifest.json +3 -3
  76. package/dist/native/darwin-arm64/process-guardian +0 -0
  77. package/dist/native/linux-x64/manifest.json +3 -3
  78. package/dist/native/linux-x64/process-guardian +0 -0
  79. package/dist/native/win32-x64/manifest.json +3 -3
  80. package/dist/native/win32-x64/process-guardian.exe +0 -0
  81. package/dist/runtime-payload-inventory.json +40622 -27400
  82. package/docs/ci-release-runbook.md +10 -7
  83. package/package.json +3 -3
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 0.87.1 (MIT), commit f07218c4d4bbc12bef056a7058c3dd49dfe41abe,
2
+ * Provenance: @earendil-works/pi-coding-agent 0.99.2 (MIT), commit 005af57d88ee23b33778f343a9595b32e67ff788,
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 0.87.1 (MIT), commit f07218c4d4bbc12bef056a7058c3dd49dfe41abe,
2
+ * Provenance: @earendil-works/pi-coding-agent 0.99.2 (MIT), commit 005af57d88ee23b33778f343a9595b32e67ff788,
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, loading
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 0.87.1 (MIT), commit f07218c4d4bbc12bef056a7058c3dd49dfe41abe,
2
+ * Provenance: @earendil-works/pi-coding-agent 0.99.2 (MIT), commit 005af57d88ee23b33778f343a9595b32e67ff788,
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 0.87.1 (MIT), commit f07218c4d4bbc12bef056a7058c3dd49dfe41abe,
2
+ * Provenance: @earendil-works/pi-coding-agent 0.99.2 (MIT), commit 005af57d88ee23b33778f343a9595b32e67ff788,
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 0.87.1 (MIT), commit f07218c4d4bbc12bef056a7058c3dd49dfe41abe,
2
+ * Provenance: @earendil-works/pi-coding-agent 0.99.2 (MIT), commit 005af57d88ee23b33778f343a9595b32e67ff788,
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 0.87.1 (MIT), commit f07218c4d4bbc12bef056a7058c3dd49dfe41abe,
2
+ * Provenance: @earendil-works/pi-coding-agent 0.99.2 (MIT), commit 005af57d88ee23b33778f343a9595b32e67ff788,
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.
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Provenance: @earendil-works/pi-coding-agent 0.99.2 (MIT), commit 005af57d88ee23b33778f343a9595b32e67ff788,
3
+ * packages/coding-agent/src/modes/interactive/components/themed-text.ts.
4
+ * Modifications: Integrated invalidation-aware text into A1's owned startup header and notices;
5
+ * repository formatting only.
6
+ * Deviations: none.
7
+ */
8
+ import { Text } from "@earendil-works/pi-tui";
9
+ /** Rebuilds theme-colored text after invalidation rather than retaining stale ANSI colors. */
10
+ export declare class ThemedText extends Text {
11
+ private readonly build;
12
+ private stale;
13
+ constructor(build: () => string, paddingX?: number, paddingY?: number);
14
+ invalidate(): void;
15
+ render(width: number): string[];
16
+ }
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Provenance: @earendil-works/pi-coding-agent 0.99.2 (MIT), commit 005af57d88ee23b33778f343a9595b32e67ff788,
3
+ * packages/coding-agent/src/modes/interactive/components/themed-text.ts.
4
+ * Modifications: Integrated invalidation-aware text into A1's owned startup header and notices;
5
+ * repository formatting only.
6
+ * Deviations: none.
7
+ */
8
+ import { Text } from "@earendil-works/pi-tui";
9
+ /** Rebuilds theme-colored text after invalidation rather than retaining stale ANSI colors. */
10
+ export class ThemedText extends Text {
11
+ build;
12
+ stale = true;
13
+ constructor(build, paddingX = 1, paddingY = 1) {
14
+ super("", paddingX, paddingY);
15
+ this.build = build;
16
+ }
17
+ invalidate() {
18
+ super.invalidate();
19
+ this.stale = true;
20
+ }
21
+ render(width) {
22
+ if (this.stale) {
23
+ this.stale = false;
24
+ this.setText(this.build());
25
+ }
26
+ return super.render(width);
27
+ }
28
+ }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 0.87.1 (MIT), commit f07218c4d4bbc12bef056a7058c3dd49dfe41abe,
2
+ * Provenance: @earendil-works/pi-coding-agent 0.99.2 (MIT), commit 005af57d88ee23b33778f343a9595b32e67ff788,
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 0.87.1 (MIT), commit f07218c4d4bbc12bef056a7058c3dd49dfe41abe,
2
+ * Provenance: @earendil-works/pi-coding-agent 0.99.2 (MIT), commit 005af57d88ee23b33778f343a9595b32e67ff788,
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 0.87.1 (MIT), commit f07218c4d4bbc12bef056a7058c3dd49dfe41abe,
2
+ * Provenance: @earendil-works/pi-coding-agent 0.99.2 (MIT), commit 005af57d88ee23b33778f343a9595b32e67ff788,
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
@@ -29,6 +29,29 @@ export function mergeBuiltInRenderers(definition, builtIn) {
29
29
  const definitions = { read: createReadToolDefinition, bash: createBashToolDefinition, edit: createEditToolDefinition,
30
30
  write: createWriteToolDefinition, grep: createGrepToolDefinition, find: createFindToolDefinition, ls: createLsToolDefinition };
31
31
  const FALLBACK_PREVIEW_LINES = 10;
32
+ const COLLAPSED_ARGS_CHARS = 100;
33
+ /** Locally attributed equivalent of pinned Pi's private generic tool-call formatter. */
34
+ function formatToolCallWithArgs(title, args, expanded) {
35
+ const theme = piTheme();
36
+ const header = theme.fg("toolTitle", theme.bold(title));
37
+ if (args === null || args === undefined)
38
+ return header;
39
+ const entries = typeof args === "object" && !Array.isArray(args)
40
+ ? Object.entries(args)
41
+ : [["args", args]];
42
+ if (entries.length === 0)
43
+ return header;
44
+ if (expanded) {
45
+ const lines = entries.map(([key, value]) => {
46
+ const text = typeof value === "string" ? value : JSON.stringify(value, null, 2) ?? String(value);
47
+ return ` ${key}: ${text.replace(/\t/g, " ").replace(/\r/g, "").split("\n").join("\n ")}`;
48
+ });
49
+ return `${header}\n${theme.fg("muted", lines.join("\n"))}`;
50
+ }
51
+ const pairs = entries.map(([key, value]) => `${key}=${JSON.stringify(value) ?? String(value)}`).join(" ");
52
+ const preview = pairs.length > COLLAPSED_ARGS_CHARS ? `${pairs.slice(0, COLLAPSED_ARGS_CHARS - 3)}...` : pairs;
53
+ return `${header} ${theme.fg("muted", preview)}`;
54
+ }
32
55
  export class ToolExecutionComponent extends Container {
33
56
  contentBox;
34
57
  contentText;
@@ -128,8 +151,7 @@ export class ToolExecutionComponent extends Container {
128
151
  };
129
152
  }
130
153
  createCallFallback() {
131
- const theme = piTheme();
132
- return new Text(theme.fg("toolTitle", theme.bold(this.toolName)), 0, 0);
154
+ return new Text(formatToolCallWithArgs(this.toolName, this.args, this.expanded), 0, 0);
133
155
  }
134
156
  createResultFallback() {
135
157
  const theme = piTheme();
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 0.87.1 (MIT), commit f07218c4d4bbc12bef056a7058c3dd49dfe41abe,
2
+ * Provenance: @earendil-works/pi-coding-agent 0.99.2 (MIT), commit 005af57d88ee23b33778f343a9595b32e67ff788,
3
3
  * packages/coding-agent/src/modes/interactive/components/tree-selector.ts.
4
4
  * Modifications: Source-synchronized tree selector port: preserve filtering, folding, labels, copying,
5
5
  * tree navigation, key hints, focus, and viewport behavior while remapping public types/components
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 0.87.1 (MIT), commit f07218c4d4bbc12bef056a7058c3dd49dfe41abe,
2
+ * Provenance: @earendil-works/pi-coding-agent 0.99.2 (MIT), commit 005af57d88ee23b33778f343a9595b32e67ff788,
3
3
  * packages/coding-agent/src/modes/interactive/components/tree-selector.ts.
4
4
  * Modifications: Source-synchronized tree selector port: preserve filtering, folding, labels, copying,
5
5
  * tree navigation, key hints, focus, and viewport behavior while remapping public types/components
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 0.87.1 (MIT), commit f07218c4d4bbc12bef056a7058c3dd49dfe41abe,
2
+ * Provenance: @earendil-works/pi-coding-agent 0.99.2 (MIT), commit 005af57d88ee23b33778f343a9595b32e67ff788,
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, and the shared bare-A1 modal
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-coding-agent 0.87.1 (MIT), commit f07218c4d4bbc12bef056a7058c3dd49dfe41abe,
2
+ * Provenance: @earendil-works/pi-coding-agent 0.99.2 (MIT), commit 005af57d88ee23b33778f343a9595b32e67ff788,
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 0.87.1 (MIT), commit f07218c4d4bbc12bef056a7058c3dd49dfe41abe,
2
+ * Provenance: @earendil-works/pi-tui 0.99.2 (MIT), commit 005af57d88ee23b33778f343a9595b32e67ff788,
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 0.87.1 (MIT), commit f07218c4d4bbc12bef056a7058c3dd49dfe41abe,
2
+ * Provenance: @earendil-works/pi-tui 0.99.2 (MIT), commit 005af57d88ee23b33778f343a9595b32e67ff788,
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
@@ -179,15 +179,17 @@ const ATTACHMENT_AUTOCOMPLETE_DEBOUNCE_MS = 20;
179
179
  const DEFAULT_AUTOCOMPLETE_TRIGGER_CHARACTERS = ["@", "#"];
180
180
  // Unquoted completions end at whitespace or CJK punctuation; quoted paths may contain either.
181
181
  const unquotedAutocompleteSuffixRegex = new RegExp(`(?:(?!${autocompleteSeparatorRegex.source}).)*`, "u");
182
+ // Trigger tokens may be wrapped in prose, e.g. "(@src/foo" or "`@src/foo".
183
+ const autocompleteTokenStartSource = `${autocompleteBoundaryRegex.source}[([{<\`]*`;
182
184
  function escapeCharacterClass(value) {
183
185
  return value.replace(/[\\^$.*+?()[\]{}|-]/g, "\\$&");
184
186
  }
185
187
  function buildTriggerPattern(triggerCharacters) {
186
- return new RegExp(`${autocompleteBoundaryRegex.source}(?:@"[^"]*|[${triggerCharacters.map(escapeCharacterClass).join("")}]${unquotedAutocompleteSuffixRegex.source})$`, "u");
188
+ return new RegExp(`${autocompleteTokenStartSource}(?:@"[^"]*|[${triggerCharacters.map(escapeCharacterClass).join("")}]${unquotedAutocompleteSuffixRegex.source})$`, "u");
187
189
  }
188
190
  function buildDebouncePattern(triggerCharacters) {
189
191
  const escapedWithoutAt = triggerCharacters.filter((character) => character !== "@").map(escapeCharacterClass);
190
- return new RegExp(`${autocompleteBoundaryRegex.source}(?:@(?:"[^"]*|${unquotedAutocompleteSuffixRegex.source})|[${escapedWithoutAt.join("")}]${unquotedAutocompleteSuffixRegex.source})$`, "u");
192
+ return new RegExp(`${autocompleteTokenStartSource}(?:@(?:"[^"]*|${unquotedAutocompleteSuffixRegex.source})|[${escapedWithoutAt.join("")}]${unquotedAutocompleteSuffixRegex.source})$`, "u");
191
193
  }
192
194
  function createScrollBorder(direction, hiddenLineCount, width, minimumCueStart = 0) {
193
195
  const availableWidth = Math.max(0, width);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Provenance: @earendil-works/pi-tui 0.87.1 (MIT), commit f07218c4d4bbc12bef056a7058c3dd49dfe41abe,
2
+ * Provenance: @earendil-works/pi-tui 0.99.2 (MIT), commit 005af57d88ee23b33778f343a9595b32e67ff788,
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 0.87.1 (MIT), commit f07218c4d4bbc12bef056a7058c3dd49dfe41abe,
2
+ * Provenance: @earendil-works/pi-tui 0.99.2 (MIT), commit 005af57d88ee23b33778f343a9595b32e67ff788,
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 0.87.1 (MIT), commit f07218c4d4bbc12bef056a7058c3dd49dfe41abe,
2
+ * Provenance: @earendil-works/pi-tui 0.99.2 (MIT), commit 005af57d88ee23b33778f343a9595b32e67ff788,
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 0.87.1 (MIT), commit f07218c4d4bbc12bef056a7058c3dd49dfe41abe,
2
+ * Provenance: @earendil-works/pi-tui 0.99.2 (MIT), commit 005af57d88ee23b33778f343a9595b32e67ff788,
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 0.87.1 (MIT), commit f07218c4d4bbc12bef056a7058c3dd49dfe41abe,
2
+ * Provenance: @earendil-works/pi-tui 0.99.2 (MIT), commit 005af57d88ee23b33778f343a9595b32e67ff788,
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 0.87.1 (MIT), commit f07218c4d4bbc12bef056a7058c3dd49dfe41abe,
2
+ * Provenance: @earendil-works/pi-tui 0.99.2 (MIT), commit 005af57d88ee23b33778f343a9595b32e67ff788,
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 0.87.1 (MIT), commit f07218c4d4bbc12bef056a7058c3dd49dfe41abe,
2
+ * Provenance: @earendil-works/pi-tui 0.99.2 (MIT), commit 005af57d88ee23b33778f343a9595b32e67ff788,
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 0.87.1 (MIT), commit f07218c4d4bbc12bef056a7058c3dd49dfe41abe,
2
+ * Provenance: @earendil-works/pi-coding-agent 0.99.2 (MIT), commit 005af57d88ee23b33778f343a9595b32e67ff788,
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,60 @@
1
+ /**
2
+ * Provenance: @earendil-works/pi-coding-agent 0.99.2 (MIT), commit 005af57d88ee23b33778f343a9595b32e67ff788,
3
+ * packages/coding-agent/src/modes/interactive/theme/system-theme.ts.
4
+ * Modifications: Copied the system palette generator with ESM import remapping and strict
5
+ * indexed-access assertions; A1 retains explicit owned theme selection.
6
+ * Deviations: none.
7
+ */
8
+ /**
9
+ * The `system` theme: pi's colors derived from the terminal's own theme.
10
+ *
11
+ * Every token belongs to a color family (its hue) and has contrast rules: it must reach a contrast level
12
+ * on the background and on the panels it is drawn on. Hue and saturation come from the terminal's palette
13
+ * color for the family's ANSI slot, or from the family's own hue when the terminal reports no palette.
14
+ * Lightness comes from the rules alone. Colors are built in OKHSL, whose saturation is relative to the
15
+ * sRGB gamut, and fade toward gray near black and white.
16
+ *
17
+ * A contrast level is a target-lightness curve: the OKLab lightness a token needs, given the lightness of
18
+ * the surface below it. The curves were fitted to the reference theme design from the "Pi themes: system
19
+ * and light/dark" review. On dark backgrounds they aim for nearly fixed lightness; on light backgrounds the
20
+ * required difference grows as the background darkens.
21
+ *
22
+ * Depending on what the terminal reports, the theme is generated in one of three tiers:
23
+ * - background and palette: hues from the palette, lightness from the background;
24
+ * - background only: the families' own hues, lightness from the background;
25
+ * - nothing: ANSI palette indices and the default colors, which the terminal renders itself.
26
+ */
27
+ import { type RgbColor } from "@earendil-works/pi-tui";
28
+ import type { ThemeAppearance, ThemeColor, ThemeToken } from "./theme.js";
29
+ export declare const SYSTEM_THEME_NAME = "system";
30
+ export interface SystemThemeInput {
31
+ foreground?: RgbColor;
32
+ background?: RgbColor;
33
+ /** ANSI colors 0-15. */
34
+ palette?: RgbColor[];
35
+ /** Saturation multiplier from 0 (grayscale) to 1. The first frame renders in grayscale until colors arrive. */
36
+ saturation?: number;
37
+ /** Appearance when the terminal did not report its background, e.g. from its light/dark report or COLORFGBG. */
38
+ appearanceHint?: ThemeAppearance;
39
+ }
40
+ export interface SystemThemeColors {
41
+ /** Hex colors, ANSI palette indices, or "" for the terminal default. */
42
+ colors: Record<ThemeToken, string | number>;
43
+ /** Foreground tokens rendered faint (SGR 2), for terminals that did not report colors. */
44
+ dim: ThemeColor[];
45
+ appearance: ThemeAppearance | undefined;
46
+ }
47
+ /** WCAG 2 relative luminance. */
48
+ export declare function relativeLuminance({ r, g, b }: RgbColor): number;
49
+ /** WCAG 2 contrast ratio, 1-21. */
50
+ export declare function wcagContrast(first: RgbColor, second: RgbColor): number;
51
+ /**
52
+ * Whether a terminal is dark or light, from its reported colors: the direction of its own foreground
53
+ * when text can be readable that way, otherwise dark when white text has more contrast on the
54
+ * background than black text.
55
+ */
56
+ export declare function terminalAppearance(background: RgbColor, foreground?: RgbColor): ThemeAppearance;
57
+ /**
58
+ * Generate the system theme's colors from the terminal's reported colors.
59
+ */
60
+ export declare function generateSystemThemeColors(input: SystemThemeInput): SystemThemeColors;