@timurproko/a1 0.2.7-dev.1252 → 0.2.7-dev.1255

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 (253) hide show
  1. package/bin/ui.js +3 -3
  2. package/dist/app/session-shell/clipboard-diagnostics.d.ts +2 -2
  3. package/dist/app/session-shell/clipboard-image.d.ts +0 -1
  4. package/dist/app/session-shell/clipboard-image.js +1 -1
  5. package/dist/app/session-shell/dialog-coordinator.d.ts +6 -5
  6. package/dist/app/session-shell/dialog-coordinator.js +3 -4
  7. package/dist/app/session-shell/dock-chrome.d.ts +11 -6
  8. package/dist/app/session-shell/dock-chrome.js +5 -8
  9. package/dist/app/session-shell/editor-hyperlink-budget.d.ts +0 -2
  10. package/dist/app/session-shell/editor-hyperlink-budget.js +1 -1
  11. package/dist/app/session-shell/exit-notice.d.ts +2 -2
  12. package/dist/app/session-shell/exit-notice.js +1 -1
  13. package/dist/app/session-shell/extension-surface.d.ts +8 -7
  14. package/dist/app/session-shell/helper-pool.d.ts +3 -4
  15. package/dist/app/session-shell/helper-pool.js +1 -1
  16. package/dist/app/session-shell/image-preparation-client.d.ts +4 -3
  17. package/dist/app/session-shell/image-preparation.d.ts +0 -2
  18. package/dist/app/session-shell/image-preparation.js +2 -2
  19. package/dist/app/session-shell/image-source.d.ts +2 -3
  20. package/dist/app/session-shell/image-source.js +2 -2
  21. package/dist/app/session-shell/input-surface-switch.d.ts +9 -7
  22. package/dist/app/session-shell/input-surface-switch.js +1 -2
  23. package/dist/app/session-shell/login-interaction.d.ts +5 -4
  24. package/dist/app/session-shell/login-interaction.js +2 -3
  25. package/dist/app/session-shell/paste-executor.d.ts +4 -8
  26. package/dist/app/session-shell/paste-executor.js +2 -2
  27. package/dist/app/session-shell/paste-protocol.d.ts +2 -2
  28. package/dist/app/session-shell/path-chip-presentation.d.ts +0 -5
  29. package/dist/app/session-shell/path-chip-presentation.js +3 -3
  30. package/dist/app/session-shell/prompt-chips.d.ts +8 -7
  31. package/dist/app/session-shell/prompt-history-controller.d.ts +3 -3
  32. package/dist/app/session-shell/prompt-submission.d.ts +5 -2
  33. package/dist/app/session-shell/prompt-submission.js +4 -5
  34. package/dist/app/session-shell/quit-outro-effects.d.ts +3 -3
  35. package/dist/app/session-shell/quit-outro-effects.js +1 -4
  36. package/dist/app/session-shell/quit-outro.d.ts +9 -12
  37. package/dist/app/session-shell/quit-outro.js +11 -11
  38. package/dist/app/session-shell/response-copy-protocol.d.ts +3 -2
  39. package/dist/app/session-shell/response-copy-transport.d.ts +2 -14
  40. package/dist/app/session-shell/response-copy-transport.js +1 -1
  41. package/dist/app/session-shell/session-lifecycle.d.ts +2 -1
  42. package/dist/app/session-shell/session-shell-root.d.ts +74 -89
  43. package/dist/app/session-shell/session-shell-root.js +81 -113
  44. package/dist/app/session-shell/session-shell.d.ts +13 -16
  45. package/dist/app/session-shell/session-shell.js +144 -268
  46. package/dist/app/session-shell/session-viewport-controller.d.ts +7 -6
  47. package/dist/app/session-shell/session-viewport-controller.js +2 -2
  48. package/dist/app/session-shell/settings-bindings.d.ts +24 -2
  49. package/dist/app/session-shell/settings-bindings.js +24 -0
  50. package/dist/app/session-shell/share-operation.d.ts +3 -3
  51. package/dist/app/session-shell/share-operation.js +4 -6
  52. package/dist/app/session-shell/shell-clipboard.d.ts +59 -0
  53. package/dist/app/session-shell/shell-clipboard.js +119 -0
  54. package/dist/app/session-shell/shell-editor-factory.d.ts +8 -4
  55. package/dist/app/session-shell/shell-editor-factory.js +13 -15
  56. package/dist/app/session-shell/shell-host.d.ts +16 -17
  57. package/dist/app/session-shell/shell-host.js +18 -19
  58. package/dist/app/session-shell/shell-layout.d.ts +2 -2
  59. package/dist/app/session-shell/shell-prompt-suggestions.d.ts +26 -0
  60. package/dist/app/session-shell/shell-prompt-suggestions.js +48 -0
  61. package/dist/app/session-shell/suggestion-surface.d.ts +1 -6
  62. package/dist/app/session-shell/suggestion-surface.js +1 -1
  63. package/dist/app/session-shell/system-clipboard.d.ts +2 -14
  64. package/dist/app/session-shell/system-clipboard.js +2 -7
  65. package/dist/app/session-shell/transcript-document.d.ts +11 -8
  66. package/dist/app/session-shell/transcript-document.js +13 -14
  67. package/dist/app/session-shell/viewport-layout.d.ts +2 -2
  68. package/dist/app/session-shell/workflow-output.d.ts +5 -3
  69. package/dist/app/session-shell/workflow-output.js +13 -15
  70. package/dist/cli/package-messages.d.ts +0 -1
  71. package/dist/cli/package-messages.js +1 -1
  72. package/dist/cli/session-context.d.ts +1 -1
  73. package/dist/cli/uninstall.d.ts +3 -2
  74. package/dist/composition/owned-settings.d.ts +2 -1
  75. package/dist/composition/owned-settings.js +0 -3
  76. package/dist/composition/owned-ui.d.ts +1 -1
  77. package/dist/composition/owned-ui.js +27 -27
  78. package/dist/composition/reference-selection-options.d.ts +1 -1
  79. package/dist/composition/reference-selection-options.js +1 -1
  80. package/dist/composition/session-runtime-registry.d.ts +2 -1
  81. package/dist/composition/settings-route-host.js +3 -10
  82. package/dist/composition/settings-search-input.d.ts +2 -1
  83. package/dist/composition/startup-route.d.ts +2 -2
  84. package/dist/composition/startup-route.js +2 -2
  85. package/dist/contracts/owned-ui/extension-ui.d.ts +2 -1
  86. package/dist/contracts/owned-ui/index.d.ts +1 -0
  87. package/dist/contracts/owned-ui/session-presenters.d.ts +3 -0
  88. package/dist/contracts/owned-ui/shell-components.d.ts +543 -0
  89. package/dist/contracts/owned-ui/shell-components.js +1 -0
  90. package/dist/contracts/presentation/component.d.ts +17 -0
  91. package/dist/contracts/presentation/component.js +8 -0
  92. package/dist/contracts/presentation/index.d.ts +6 -15
  93. package/dist/contracts/presentation/index.js +2 -0
  94. package/dist/contracts/presentation/terminal.d.ts +290 -0
  95. package/dist/contracts/presentation/terminal.js +1 -0
  96. package/dist/contracts/presentation/theme.d.ts +46 -0
  97. package/dist/contracts/presentation/theme.js +1 -0
  98. package/dist/features/launch/development-launch.js +1 -1
  99. package/dist/features/launch/runtime-selection.d.ts +2 -2
  100. package/dist/features/launch/runtime-selection.js +2 -2
  101. package/dist/features/owned-ui/project-trust-prompt.d.ts +2 -2
  102. package/dist/features/owned-ui/project-trust-prompt.js +1 -1
  103. package/dist/features/owned-ui/release-note-state.d.ts +2 -1
  104. package/dist/features/owned-ui/settings-app.js +38 -219
  105. package/dist/features/owned-ui/settings-edits.d.ts +31 -0
  106. package/dist/features/owned-ui/settings-edits.js +139 -0
  107. package/dist/features/owned-ui/settings-scroll-rail.d.ts +29 -0
  108. package/dist/features/owned-ui/settings-scroll-rail.js +79 -0
  109. package/dist/features/owned-ui/settings-search-input.d.ts +2 -1
  110. package/dist/features/prompt-history/service.d.ts +3 -2
  111. package/dist/foundation/lifecycle/claim-gate.d.ts +2 -1
  112. package/dist/foundation/release/automatic-update.d.ts +5 -14
  113. package/dist/foundation/release/automatic-update.js +14 -14
  114. package/dist/foundation/release/bootstrap.js +4 -4
  115. package/dist/foundation/release/dependency-certification.d.ts +0 -1
  116. package/dist/foundation/release/dependency-certification.js +1 -1
  117. package/dist/foundation/release/early-accent.d.ts +2 -2
  118. package/dist/foundation/release/early-accent.js +1 -1
  119. package/dist/foundation/release/index.d.ts +2 -2
  120. package/dist/foundation/release/index.js +1 -1
  121. package/dist/foundation/release/latest-release.d.ts +3 -18
  122. package/dist/foundation/release/latest-release.js +10 -10
  123. package/dist/foundation/release/ordinary-launch-selection.d.ts +1 -1
  124. package/dist/foundation/release/ordinary-launch-selection.js +1 -1
  125. package/dist/foundation/release/release-gc.d.ts +3 -3
  126. package/dist/foundation/release/release-gc.js +4 -4
  127. package/dist/foundation/release/{cohort-state.d.ts → release-state.d.ts} +23 -23
  128. package/dist/foundation/release/{cohort-state.js → release-state.js} +8 -8
  129. package/dist/foundation/release/update-activation.js +2 -2
  130. package/dist/foundation/release/update-execution-lease.d.ts +2 -3
  131. package/dist/foundation/release/update-execution-lease.js +1 -1
  132. package/dist/foundation/release/update-launch.d.ts +2 -2
  133. package/dist/foundation/release/update.d.ts +0 -2
  134. package/dist/foundation/release/update.js +14 -14
  135. package/dist/foundation/startup/startup-budget.d.ts +5 -5
  136. package/dist/foundation/startup/startup-budget.js +2 -2
  137. package/dist/integrations/pi/components/editor-interaction.d.ts +4 -12
  138. package/dist/integrations/pi/components/index.d.ts +15 -9
  139. package/dist/integrations/pi/components/index.js +9 -5
  140. package/dist/integrations/pi/components/lazy-selectors.d.ts +2 -10
  141. package/dist/integrations/pi/components/lazy-selectors.js +1 -1
  142. package/dist/integrations/pi/components/modal-frame.d.ts +5 -22
  143. package/dist/integrations/pi/components/modal-frame.js +3 -23
  144. package/dist/integrations/pi/components/owned-editor-ux.d.ts +4 -3
  145. package/dist/integrations/pi/components/prompt-input-port.d.ts +2 -19
  146. package/dist/integrations/pi/components/resources/builtin-themes.d.ts +2 -1
  147. package/dist/integrations/pi/components/shell-editor-autocomplete.d.ts +3 -2
  148. package/dist/integrations/pi/components/shell-footer-status.d.ts +2 -2
  149. package/dist/integrations/pi/components/shell-footer-status.js +3 -2
  150. package/dist/integrations/pi/components/shell-presenters-info.d.ts +6 -5
  151. package/dist/integrations/pi/components/shell-presenters-info.js +2 -1
  152. package/dist/integrations/pi/components/shell-session-info-reference.d.ts +2 -1
  153. package/dist/integrations/pi/components/shell-shared-facade.d.ts +33 -227
  154. package/dist/integrations/pi/components/shell-shared-facade.js +8 -1
  155. package/dist/integrations/pi/components/skills-command.d.ts +1 -9
  156. package/dist/integrations/pi/components/skills-command.js +5 -5
  157. package/dist/integrations/pi/components/theme.d.ts +9 -2
  158. package/dist/integrations/pi/components/theme.js +17 -2
  159. package/dist/integrations/pi/components/thinking-selector-dialog.d.ts +2 -1
  160. package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.d.ts +2 -2
  161. package/dist/integrations/pi/engine/adapter.d.ts +3 -5
  162. package/dist/integrations/pi/engine/adapter.js +3 -12
  163. package/dist/integrations/pi/engine/changelog.d.ts +2 -2
  164. package/dist/integrations/pi/engine/changelog.js +3 -3
  165. package/dist/integrations/pi/engine/compaction-progress.d.ts +2 -3
  166. package/dist/integrations/pi/engine/compaction-progress.js +1 -1
  167. package/dist/integrations/pi/engine/conformance.d.ts +2 -1
  168. package/dist/integrations/pi/engine/default-model-setting.d.ts +0 -2
  169. package/dist/integrations/pi/engine/default-model-setting.js +1 -2
  170. package/dist/integrations/pi/engine/event-delivery.d.ts +2 -1
  171. package/dist/integrations/pi/engine/extension-ui-binding.d.ts +2 -1
  172. package/dist/integrations/pi/engine/host.js +2 -2
  173. package/dist/integrations/pi/engine/message-values.d.ts +0 -1
  174. package/dist/integrations/pi/engine/message-values.js +1 -1
  175. package/dist/integrations/pi/engine/pending-delivery.d.ts +0 -4
  176. package/dist/integrations/pi/engine/pending-delivery.js +3 -3
  177. package/dist/integrations/pi/engine/ports.d.ts +7 -1
  178. package/dist/integrations/pi/engine/ports.js +4 -0
  179. package/dist/integrations/pi/engine/project-trust-preflight.d.ts +2 -1
  180. package/dist/integrations/pi/engine/prompt-suggestions.d.ts +3 -2
  181. package/dist/integrations/pi/engine/provider-authentication.d.ts +1 -1
  182. package/dist/integrations/pi/engine/public-main-entry.d.ts +1 -5
  183. package/dist/integrations/pi/engine/public-main-entry.js +1 -1
  184. package/dist/integrations/pi/engine/repository-pr-rest.d.ts +1 -9
  185. package/dist/integrations/pi/engine/repository-pr-rest.js +2 -2
  186. package/dist/integrations/pi/engine/repository-pr.d.ts +1 -3
  187. package/dist/integrations/pi/engine/repository-pr.js +1 -1
  188. package/dist/integrations/pi/engine/resource-catalog.d.ts +2 -1
  189. package/dist/integrations/pi/engine/session-integration.d.ts +1 -1
  190. package/dist/integrations/pi/engine/session-runtime.d.ts +4 -3
  191. package/dist/integrations/pi/engine/settings-bridge.d.ts +0 -2
  192. package/dist/integrations/pi/engine/settings-bridge.js +1 -1
  193. package/dist/integrations/pi/engine/settings-port.d.ts +3 -2
  194. package/dist/integrations/pi/engine/transcript-projection.d.ts +2 -1
  195. package/dist/integrations/pi/engine/workflow-contexts.d.ts +1 -1
  196. package/dist/integrations/pi/engine/workflow-runner.d.ts +1 -1
  197. package/dist/integrations/pi/engine/workflow-support.d.ts +0 -6
  198. package/dist/integrations/pi/engine/workflow-support.js +4 -18
  199. package/dist/integrations/pi/engine/workflows.d.ts +5 -5
  200. package/dist/integrations/pi/session-presenters/components.d.ts +3 -0
  201. package/dist/integrations/pi/session-presenters/components.js +75 -0
  202. package/dist/integrations/pi/session-presenters/index.d.ts +1 -0
  203. package/dist/integrations/pi/session-presenters/index.js +1 -0
  204. package/dist/integrations/pi/session-presenters/presentation.d.ts +3 -0
  205. package/dist/integrations/pi/session-presenters/presentation.js +10 -0
  206. package/dist/integrations/pi/session-presenters/presenters.d.ts +2 -1
  207. package/dist/integrations/pi/session-presenters/presenters.js +3 -1
  208. package/dist/integrations/pi/tui-runtime/adapter.js +21 -30
  209. package/dist/integrations/pi/tui-runtime/contracts.d.ts +22 -166
  210. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +5 -40
  211. package/dist/integrations/pi/tui-runtime/index.d.ts +1 -0
  212. package/dist/integrations/pi/tui-runtime/index.js +1 -0
  213. package/dist/integrations/pi/tui-runtime/input-presentation-coordinator.d.ts +4 -6
  214. package/dist/integrations/pi/tui-runtime/overlay-geometry.d.ts +2 -8
  215. package/dist/integrations/pi/tui-runtime/overlay-geometry.js +3 -9
  216. package/dist/integrations/pi/tui-runtime/runtime-factory.d.ts +3 -0
  217. package/dist/integrations/pi/tui-runtime/runtime-factory.js +11 -0
  218. package/dist/ui/components/index.d.ts +2 -2
  219. package/dist/ui/components/index.js +1 -1
  220. package/dist/ui/components/selection-copy.d.ts +0 -1
  221. package/dist/ui/components/selection-copy.js +0 -12
  222. package/dist/ui/components/theme.d.ts +4 -19
  223. package/dist/ui/components/theme.js +6 -0
  224. package/dist/ui/settings/declarations.d.ts +2 -3
  225. package/dist/ui/settings/declarations.js +2 -3
  226. package/dist/ui/settings/early-accent.js +1 -1
  227. package/dist/ui/settings/index.d.ts +3 -5
  228. package/dist/ui/settings/index.js +2 -3
  229. package/dist/ui/settings/manager.d.ts +0 -4
  230. package/dist/ui/settings/manager.js +6 -62
  231. package/dist/ui/settings/resolution.d.ts +6 -18
  232. package/dist/ui/settings/resolution.js +4 -103
  233. package/dist/ui/settings/sections.d.ts +0 -4
  234. package/dist/ui/settings/sections.js +1 -1
  235. package/docs/architecture/boundaries.md +2 -2
  236. package/docs/architecture/internal-naming.md +2 -0
  237. package/docs/architecture/project-structure.md +4 -2
  238. package/docs/validation.md +1 -1
  239. package/package.json +3 -4
  240. package/dist/integrations/pi/components/components.d.ts +0 -4
  241. package/dist/integrations/pi/components/components.js +0 -48
  242. package/dist/integrations/pi/components/conformance.d.ts +0 -18
  243. package/dist/integrations/pi/components/conformance.js +0 -70
  244. package/dist/integrations/pi/components/shell-components.d.ts +0 -7
  245. package/dist/integrations/pi/components/shell-components.js +0 -7
  246. package/dist/integrations/pi/components/upstream/theme/theme-controller.d.ts +0 -33
  247. package/dist/integrations/pi/components/upstream/theme/theme-controller.js +0 -114
  248. package/dist/ui/settings/migrations.d.ts +0 -19
  249. package/dist/ui/settings/migrations.js +0 -225
  250. package/dist/ui/settings/progress-palette.generated.d.ts +0 -139
  251. package/dist/ui/settings/progress-palette.generated.js +0 -139
  252. /package/dist/{foundation/release → contracts/presentation}/progress-palette.generated.d.ts +0 -0
  253. /package/dist/{foundation/release → contracts/presentation}/progress-palette.generated.js +0 -0
@@ -1,70 +0,0 @@
1
- import { mkdtemp, rm } from "node:fs/promises";
2
- import { tmpdir } from "node:os";
3
- import { join } from "node:path";
4
- import { AssistantMessageComponent, ExtensionSelectorComponent, initTheme, LoginDialogComponent, ModelSelectorComponent, SettingsSelectorComponent, ThemeSelectorComponent, ThinkingSelectorComponent, ToolExecutionComponent, UserMessageComponent, UserMessageSelectorComponent, VERSION, } from "@earendil-works/pi-coding-agent";
5
- import { OWNED_UI_CONTRACT_VERSION } from "../../../contracts/owned-ui/index.js";
6
- import { createTuiFacade, validatedAssistantMessage } from "./shell-components.js";
7
- import { PRODUCT_IDENTITY } from "../../../product-identity.js";
8
- /** Identifies the Pi presentation-conformance stage that failed against the pinned component surface. */
9
- export class PiComponentConformanceError extends Error {
10
- stage;
11
- constructor(stage, cause) {
12
- super(`Pi component conformance failed during ${stage}: ${cause instanceof Error ? cause.message : String(cause)}`, { cause });
13
- this.stage = stage;
14
- this.name = "PiComponentConformanceError";
15
- }
16
- }
17
- export async function runPiComponentConformance() {
18
- const root = await mkdtemp(join(tmpdir(), `${PRODUCT_IDENTITY.filesystem.temporaryPrefix}pi-components-`));
19
- try {
20
- try {
21
- initTheme("dark", false);
22
- }
23
- catch (error) {
24
- throw new PiComponentConformanceError("theme", error);
25
- }
26
- try {
27
- const width = 80;
28
- const publicConstructors = [UserMessageComponent, AssistantMessageComponent, ToolExecutionComponent, ExtensionSelectorComponent,
29
- LoginDialogComponent, ModelSelectorComponent, SettingsSelectorComponent, ThemeSelectorComponent, ThinkingSelectorComponent,
30
- UserMessageSelectorComponent];
31
- if (publicConstructors.some(constructor => typeof constructor !== "function"))
32
- throw new Error("a reused public component constructor is missing");
33
- const user = new UserMessageComponent(`hello from ${PRODUCT_IDENTITY.displayName}`);
34
- const assistantBlock = {
35
- id: "assistant-1",
36
- kind: "assistant",
37
- status: "finalized",
38
- text: "hello from Pi",
39
- title: null,
40
- revision: 1,
41
- payload: { provider: "openai", model: "gpt-5" },
42
- };
43
- const assistant = new AssistantMessageComponent(validatedAssistantMessage(assistantBlock), false);
44
- const tool = new ToolExecutionComponent("read", "tool-1", { path: "README.md" }, undefined, undefined, createTuiFacade({ getColumns: () => width, getRows: () => 24, requestRender() { } }), root);
45
- const componentResults = [
46
- { component: "user-message", renderRows: user.render(width).length, width },
47
- { component: "assistant-message", renderRows: assistant.render(width).length, width },
48
- { component: "tool-execution", renderRows: tool.render(width).length, width },
49
- ];
50
- if (componentResults.some(result => result.renderRows <= 0)) {
51
- throw new Error("a public component produced no render rows");
52
- }
53
- return {
54
- packageName: "@earendil-works/pi-coding-agent",
55
- packageVersion: VERSION,
56
- ownedUiContractVersion: OWNED_UI_CONTRACT_VERSION,
57
- componentResults,
58
- componentFamilies: ["messages", "tool-execution", "selectors", "dialogs", "editor-autocomplete", "footer-status", "extension-surfaces"],
59
- };
60
- }
61
- catch (error) {
62
- if (error instanceof PiComponentConformanceError)
63
- throw error;
64
- throw new PiComponentConformanceError("components", error);
65
- }
66
- }
67
- finally {
68
- await rm(root, { recursive: true, force: true });
69
- }
70
- }
@@ -1,7 +0,0 @@
1
- export * from "./shell-shared-facade.js";
2
- export * from "./shell-editor-autocomplete.js";
3
- export * from "./shell-selectors-dialogs.js";
4
- export * from "./shell-presenters-transcript.js";
5
- export * from "./shell-presenters-info.js";
6
- export * from "./shell-footer-status.js";
7
- export * from "./shell-extension-ui.js";
@@ -1,7 +0,0 @@
1
- export * from "./shell-shared-facade.js";
2
- export * from "./shell-editor-autocomplete.js";
3
- export * from "./shell-selectors-dialogs.js";
4
- export * from "./shell-presenters-transcript.js";
5
- export * from "./shell-presenters-info.js";
6
- export * from "./shell-footer-status.js";
7
- export * from "./shell-extension-ui.js";
@@ -1,33 +0,0 @@
1
- /**
2
- * Provenance: @earendil-works/pi-coding-agent 1.5.0 (MIT), commit f9a26365568127461c47a07a37dcb42c140a3ac5,
3
- * packages/coding-agent/src/modes/interactive/theme/theme-controller.ts.
4
- * Modifications: Source-synchronized controller port: renamed owner class, injected dependency-free
5
- * settings/runtime ports, remapped private theme helpers to the public-backed A1 theme adapter, and
6
- * added explicit disposal.
7
- * Deviations: theme-controller-owned-boundaries, theme-controller-explicit-disposal.
8
- */
9
- import type { Theme } from "@earendil-works/pi-coding-agent";
10
- import { type PiTerminalTheme, type PiTerminalThemeDetector, type PiThemeResult } from "./theme.js";
11
- export interface PiThemeRuntimePort extends PiTerminalThemeDetector {
12
- invalidate(): void;
13
- requestRender(force?: boolean): void;
14
- setTerminalColorSchemeNotifications(enabled: boolean): void;
15
- onTerminalColorSchemeChange(listener: (theme: PiTerminalTheme) => void): () => void;
16
- }
17
- export interface PiThemeSettingsPort {
18
- getThemeSetting(): string | undefined;
19
- setTheme(theme: string): void;
20
- flush(): Promise<void>;
21
- }
22
- export declare class OwnedPiThemeController {
23
- #private;
24
- constructor(ui: PiThemeRuntimePort, settings: PiThemeSettingsPort, showError: (message: string) => void, onChanged: () => void);
25
- rebindTui(): void;
26
- applyFromSettings(): Promise<void>;
27
- setThemeName(themeName: string, showError?: boolean): PiThemeResult;
28
- setThemeInstance(theme: Theme): PiThemeResult;
29
- preview(themeSettingOrName: string): void;
30
- disableAutoSync(): void;
31
- getTerminalTheme(): PiTerminalTheme;
32
- dispose(): void;
33
- }
@@ -1,114 +0,0 @@
1
- import { applyPiTheme, applyPiThemeInstance, detectPiTerminalBackgroundFromEnv, detectPiTerminalBackgroundTheme, detectPiTerminalThemeForAuto, parsePiAutoThemeSetting, resolvePiThemeSetting, } from "./theme.js";
2
- export class OwnedPiThemeController {
3
- #ui;
4
- #settings;
5
- #showError;
6
- #onChanged;
7
- #terminalTheme = detectPiTerminalBackgroundFromEnv().theme;
8
- #activeThemeName;
9
- #autoSyncEnabled = false;
10
- #terminalColorSchemeUnsubscribe;
11
- constructor(ui, settings, showError, onChanged) {
12
- this.#ui = ui;
13
- this.#settings = settings;
14
- this.#showError = showError;
15
- this.#onChanged = onChanged;
16
- this.#activeThemeName = resolvePiThemeSetting(this.#settings.getThemeSetting(), this.#terminalTheme);
17
- applyPiTheme(this.#activeThemeName ?? this.#terminalTheme, true);
18
- this.#bindTerminalColorSchemeListener();
19
- }
20
- rebindTui() {
21
- this.#terminalColorSchemeUnsubscribe?.();
22
- this.#bindTerminalColorSchemeListener();
23
- this.#ui.setTerminalColorSchemeNotifications(this.#autoSyncEnabled);
24
- }
25
- async applyFromSettings() {
26
- const themeSetting = this.#settings.getThemeSetting();
27
- const autoTheme = parsePiAutoThemeSetting(themeSetting);
28
- if (autoTheme) {
29
- this.#terminalTheme = await detectPiTerminalThemeForAuto(this.#ui, 100);
30
- this.#setAutoSync(true);
31
- this.#applyThemeName(this.#terminalTheme === "light" ? autoTheme.lightTheme : autoTheme.darkTheme, true);
32
- return;
33
- }
34
- this.#setAutoSync(false);
35
- if (themeSetting !== undefined) {
36
- this.#applyThemeName(themeSetting, true);
37
- return;
38
- }
39
- const detection = await detectPiTerminalBackgroundTheme(this.#ui, 100);
40
- this.#terminalTheme = detection.theme;
41
- if (!this.#applyThemeName(detection.theme).success)
42
- return;
43
- if (detection.confidence === "high") {
44
- this.#settings.setTheme(detection.theme);
45
- await this.#settings.flush();
46
- }
47
- }
48
- setThemeName(themeName, showError = false) {
49
- this.#setAutoSync(false);
50
- return this.#applyThemeName(themeName, showError);
51
- }
52
- setThemeInstance(theme) {
53
- this.#setAutoSync(false);
54
- const result = applyPiThemeInstance(theme);
55
- this.#activeThemeName = result.name;
56
- this.#notifyChanged();
57
- return result;
58
- }
59
- preview(themeSettingOrName) {
60
- const themeName = resolvePiThemeSetting(themeSettingOrName, this.#terminalTheme) ?? this.#activeThemeName;
61
- if (!themeName)
62
- return;
63
- if (applyPiTheme(themeName, true).success) {
64
- this.#ui.invalidate();
65
- this.#ui.requestRender();
66
- }
67
- }
68
- disableAutoSync() {
69
- this.#setAutoSync(false);
70
- }
71
- getTerminalTheme() {
72
- return this.#terminalTheme;
73
- }
74
- dispose() {
75
- this.#terminalColorSchemeUnsubscribe?.();
76
- this.#terminalColorSchemeUnsubscribe = undefined;
77
- this.#setAutoSync(false);
78
- }
79
- #applyThemeName(themeName, showError = false) {
80
- const result = applyPiTheme(themeName, true);
81
- this.#activeThemeName = result.name;
82
- this.#notifyChanged();
83
- if (!result.success && showError) {
84
- this.#showError(`Failed to load theme "${themeName}": ${result.error}\nFell back to dark theme.`);
85
- }
86
- return result;
87
- }
88
- #notifyChanged() {
89
- this.#ui.invalidate();
90
- this.#onChanged();
91
- }
92
- #setAutoSync(enabled) {
93
- if (this.#autoSyncEnabled === enabled)
94
- return;
95
- this.#autoSyncEnabled = enabled;
96
- this.#ui.setTerminalColorSchemeNotifications(enabled);
97
- }
98
- #bindTerminalColorSchemeListener() {
99
- this.#terminalColorSchemeUnsubscribe = this.#ui.onTerminalColorSchemeChange(theme => this.#applyTerminalTheme(theme));
100
- }
101
- #applyTerminalTheme(terminalTheme) {
102
- if (!this.#autoSyncEnabled)
103
- return;
104
- this.#terminalTheme = terminalTheme;
105
- const autoTheme = parsePiAutoThemeSetting(this.#settings.getThemeSetting());
106
- if (!autoTheme) {
107
- this.#setAutoSync(false);
108
- return;
109
- }
110
- const themeName = terminalTheme === "light" ? autoTheme.lightTheme : autoTheme.darkTheme;
111
- if (themeName !== this.#activeThemeName)
112
- this.#applyThemeName(themeName);
113
- }
114
- }
@@ -1,19 +0,0 @@
1
- export interface OwnedUiSettingsMigration {
2
- /** Version this migration produces. A migration from N-1 declares `to: N`. */
3
- readonly to: number;
4
- readonly description: string;
5
- migrate(values: Readonly<Record<string, unknown>>): Record<string, unknown>;
6
- }
7
- /**
8
- * Ordered, contiguous migrations ending at OWNED_UI_SETTINGS_VERSION. Version 1
9
- * is the first stored shape.
10
- */
11
- export declare const OWNED_UI_SETTINGS_MIGRATIONS: readonly OwnedUiSettingsMigration[];
12
- export interface OwnedUiSettingsCompatibilityResult {
13
- readonly values: Readonly<Record<string, unknown>> | null;
14
- readonly failure: string | null;
15
- }
16
- /** Shape-selected compatibility for the metadata-free product object. */
17
- export declare function normalizeOwnedUiSettingsValues(source: Readonly<Record<string, unknown>>): OwnedUiSettingsCompatibilityResult;
18
- export declare function assertOwnedUiSettingsMigrations(migrations: readonly OwnedUiSettingsMigration[], currentVersion?: number): void;
19
- export declare function migrationsFrom(migrations: readonly OwnedUiSettingsMigration[], storedVersion: number): readonly OwnedUiSettingsMigration[];
@@ -1,225 +0,0 @@
1
- import { OWNED_UI_SETTINGS_VERSION } from "./declarations.js";
2
- /**
3
- * Ordered, contiguous migrations ending at OWNED_UI_SETTINGS_VERSION. Version 1
4
- * is the first stored shape.
5
- */
6
- export const OWNED_UI_SETTINGS_MIGRATIONS = Object.freeze([
7
- Object.freeze({
8
- to: 2,
9
- description: "Rename scrollbar speed high to fast.",
10
- migrate(values) {
11
- return values.scrollbarSpeed === "high"
12
- ? { ...values, scrollbarSpeed: "fast" }
13
- : { ...values };
14
- },
15
- }),
16
- Object.freeze({
17
- to: 3,
18
- description: "Match Pi's auto scrollbar appearance name and ordering.",
19
- migrate(values) {
20
- return values.scrollbarAppearance === "hover"
21
- ? { ...values, scrollbarAppearance: "auto" }
22
- : { ...values };
23
- },
24
- }),
25
- Object.freeze({
26
- to: 4,
27
- description: "Introduce contextual prompt suggestions with an enabled default.",
28
- migrate(values) {
29
- return { ...values };
30
- },
31
- }),
32
- Object.freeze({
33
- to: 5,
34
- description: "Introduce the quit outro effect and duration with prototype defaults.",
35
- migrate(values) {
36
- return { ...values };
37
- },
38
- }),
39
- Object.freeze({
40
- to: 6,
41
- description: "Move the disabled quit effect into the exit-animation toggle.",
42
- migrate(values) {
43
- // Invariant: a profile that chose off keeps quitting without an animation; the
44
- // effect it stored is no longer a choice, so it resolves to the default.
45
- if (values.quitEffect !== "off")
46
- return { ...values };
47
- const migrated = { ...values, quitAnimation: false };
48
- delete migrated.quitEffect;
49
- return migrated;
50
- },
51
- }),
52
- Object.freeze({
53
- to: 7,
54
- description: "Drop the quit effect and duration; the outro always plays fall for 800 ms.",
55
- migrate(values) {
56
- // Invariant: the manager keeps unknown keys, so the retired ids are removed here rather than lingering.
57
- const migrated = { ...values };
58
- delete migrated.quitEffect;
59
- delete migrated.quitEffectDurationMs;
60
- return migrated;
61
- },
62
- }),
63
- Object.freeze({
64
- to: 8,
65
- description: "Introduce the collapsed skills presentation with the collapse default.",
66
- migrate(values) {
67
- return { ...values };
68
- },
69
- }),
70
- Object.freeze({
71
- to: 9,
72
- description: "Introduce the configurable prompt image limit with the eight-image default.",
73
- migrate(values) {
74
- return { ...values };
75
- },
76
- }),
77
- Object.freeze({
78
- to: 10,
79
- description: "Introduce the startup update check with the enabled default.",
80
- migrate(values) {
81
- return { ...values };
82
- },
83
- }),
84
- Object.freeze({
85
- to: 11,
86
- description: "Introduce semantic accent selection with the active-theme default.",
87
- migrate(values) {
88
- return { ...values };
89
- },
90
- }),
91
- Object.freeze({
92
- to: 12,
93
- description: "Rename the inherited default accent choice to explicit purple.",
94
- migrate(values) {
95
- return values.accentColor === "default"
96
- ? { ...values, accentColor: "purple" }
97
- : { ...values };
98
- },
99
- }),
100
- Object.freeze({
101
- to: 13,
102
- description: "Introduce the transparent fullscreen background default.",
103
- migrate(values) {
104
- return { ...values };
105
- },
106
- }),
107
- Object.freeze({
108
- to: 14,
109
- description: "Introduce the opt-in resident tabs preview with a disabled default.",
110
- migrate(values) {
111
- return { ...values };
112
- },
113
- }),
114
- Object.freeze({
115
- to: 15,
116
- description: "Introduce the bounded concurrent resident-tab start limit.",
117
- migrate(values) {
118
- return { ...values };
119
- },
120
- }),
121
- Object.freeze({
122
- to: 16,
123
- description: "Make bare A1 tabs unconditional and keep only tab UX controls.",
124
- migrate(values) {
125
- const migrated = { ...values };
126
- delete migrated.residentTabs;
127
- delete migrated.tabsMaxConcurrentStarts;
128
- delete migrated.tabsUnresponsiveRestartSeconds;
129
- delete migrated.tabsStallNoticeSeconds;
130
- return migrated;
131
- },
132
- }),
133
- Object.freeze({
134
- to: 17,
135
- description: "Introduce the shared twelve-hour time format default.",
136
- migrate(values) {
137
- return { ...values };
138
- },
139
- }),
140
- Object.freeze({
141
- to: 18,
142
- description: "Introduce the top resident tab-bar position default.",
143
- migrate(values) {
144
- return { ...values };
145
- },
146
- }),
147
- Object.freeze({
148
- to: 19,
149
- description: "Expand the update check into auto, notify, and no modes.",
150
- migrate(values) {
151
- if (values.updateCheck === true)
152
- return { ...values, updateCheck: "notify" };
153
- if (values.updateCheck === false)
154
- return { ...values, updateCheck: "no" };
155
- return { ...values };
156
- },
157
- }),
158
- Object.freeze({
159
- to: 20,
160
- description: "Introduce the resident tab-bar Version and Time defaults.",
161
- migrate(values) {
162
- return { ...values };
163
- },
164
- }),
165
- Object.freeze({
166
- to: 21,
167
- description: "Retire tab-bar and time-format settings and reduce updates to auto or no.",
168
- migrate(values) {
169
- const migrated = { ...values };
170
- // Compatibility: notify and the legacy boolean both meant "look for updates"; auto now does that.
171
- if (migrated.updateCheck === "notify" || migrated.updateCheck === true)
172
- migrated.updateCheck = "auto";
173
- if (migrated.updateCheck === false)
174
- migrated.updateCheck = "no";
175
- for (const key of ["tabsPosition", "tabBarPlusMenu", "tabBarRightItems", "tabBarBackgroundStyle", "tabsAutoName", "timeFormat"]) {
176
- delete migrated[key];
177
- }
178
- return migrated;
179
- },
180
- }),
181
- ]);
182
- /** Shape-selected compatibility for the metadata-free product object. */
183
- export function normalizeOwnedUiSettingsValues(source) {
184
- const values = { ...source };
185
- // Compatibility: "high" is valid again, so the old speed meaning is ambiguous without legacy metadata.
186
- if (values.scrollbarAppearance === "hover")
187
- values.scrollbarAppearance = "auto";
188
- if (values.accentColor === "default")
189
- values.accentColor = "purple";
190
- if (values.updateCheck === true || values.updateCheck === "notify")
191
- values.updateCheck = "auto";
192
- else if (values.updateCheck === false)
193
- values.updateCheck = "no";
194
- if (values.quitEffect === "off") {
195
- if (Object.hasOwn(values, "quitAnimation") && values.quitAnimation !== false) {
196
- return { values: null, failure: "legacy quitEffect conflicts with quitAnimation" };
197
- }
198
- values.quitAnimation = false;
199
- }
200
- delete values.quitEffect;
201
- delete values.quitEffectDurationMs;
202
- return { values, failure: null };
203
- }
204
- export function assertOwnedUiSettingsMigrations(migrations, currentVersion = OWNED_UI_SETTINGS_VERSION) {
205
- const firstProduced = currentVersion - migrations.length + 1;
206
- if (migrations.length > 0 && firstProduced < 2) {
207
- throw new Error("owned UI settings migrations cannot produce a version below 2");
208
- }
209
- migrations.forEach((migration, index) => {
210
- const expected = firstProduced + index;
211
- if (migration.to !== expected) {
212
- throw new Error(`owned UI settings migration ${index} produces version ${migration.to}, expected ${expected}`);
213
- }
214
- if (migration.description.trim().length === 0) {
215
- throw new Error(`owned UI settings migration to version ${migration.to} has no description`);
216
- }
217
- });
218
- const last = migrations.at(-1);
219
- if (last && last.to !== currentVersion) {
220
- throw new Error(`owned UI settings migrations end at version ${last.to}, expected ${currentVersion}`);
221
- }
222
- }
223
- export function migrationsFrom(migrations, storedVersion) {
224
- return migrations.filter(migration => migration.to > storedVersion);
225
- }
@@ -1,139 +0,0 @@
1
- /**
2
- * Generated by scripts/pi/sync-progress-palette.ts from A1's named accent projection
3
- * over pinned Pi 1.5.0 (MIT), commit f9a26365568127461c47a07a37dcb42c140a3ac5. Do not edit directly.
4
- */
5
- export declare const SHARED_PROGRESS_PALETTE: Readonly<{
6
- blue: {
7
- dark: {
8
- truecolor: {
9
- accent: string;
10
- border: string;
11
- };
12
- "256color": {
13
- accent: string;
14
- border: string;
15
- };
16
- };
17
- light: {
18
- truecolor: {
19
- accent: string;
20
- border: string;
21
- };
22
- "256color": {
23
- accent: string;
24
- border: string;
25
- };
26
- };
27
- };
28
- purple: {
29
- dark: {
30
- truecolor: {
31
- accent: string;
32
- border: string;
33
- };
34
- "256color": {
35
- accent: string;
36
- border: string;
37
- };
38
- };
39
- light: {
40
- truecolor: {
41
- accent: string;
42
- border: string;
43
- };
44
- "256color": {
45
- accent: string;
46
- border: string;
47
- };
48
- };
49
- };
50
- cyan: {
51
- dark: {
52
- truecolor: {
53
- accent: string;
54
- border: string;
55
- };
56
- "256color": {
57
- accent: string;
58
- border: string;
59
- };
60
- };
61
- light: {
62
- truecolor: {
63
- accent: string;
64
- border: string;
65
- };
66
- "256color": {
67
- accent: string;
68
- border: string;
69
- };
70
- };
71
- };
72
- green: {
73
- dark: {
74
- truecolor: {
75
- accent: string;
76
- border: string;
77
- };
78
- "256color": {
79
- accent: string;
80
- border: string;
81
- };
82
- };
83
- light: {
84
- truecolor: {
85
- accent: string;
86
- border: string;
87
- };
88
- "256color": {
89
- accent: string;
90
- border: string;
91
- };
92
- };
93
- };
94
- orange: {
95
- dark: {
96
- truecolor: {
97
- accent: string;
98
- border: string;
99
- };
100
- "256color": {
101
- accent: string;
102
- border: string;
103
- };
104
- };
105
- light: {
106
- truecolor: {
107
- accent: string;
108
- border: string;
109
- };
110
- "256color": {
111
- accent: string;
112
- border: string;
113
- };
114
- };
115
- };
116
- pink: {
117
- dark: {
118
- truecolor: {
119
- accent: string;
120
- border: string;
121
- };
122
- "256color": {
123
- accent: string;
124
- border: string;
125
- };
126
- };
127
- light: {
128
- truecolor: {
129
- accent: string;
130
- border: string;
131
- };
132
- "256color": {
133
- accent: string;
134
- border: string;
135
- };
136
- };
137
- };
138
- }>;
139
- export declare const SHARED_PROGRESS_ACCENT_ANSI: string;