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

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 (296) 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 +13 -14
  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/resource-labels.d.ts +2 -0
  39. package/dist/app/session-shell/resource-labels.js +158 -0
  40. package/dist/app/session-shell/response-copy-protocol.d.ts +3 -2
  41. package/dist/app/session-shell/response-copy-transport.d.ts +2 -14
  42. package/dist/app/session-shell/response-copy-transport.js +1 -1
  43. package/dist/app/session-shell/session-lifecycle.d.ts +2 -1
  44. package/dist/app/session-shell/session-prompt-history.d.ts +29 -0
  45. package/dist/app/session-shell/session-prompt-history.js +80 -0
  46. package/dist/app/session-shell/session-selectors.d.ts +46 -0
  47. package/dist/app/session-shell/session-selectors.js +269 -0
  48. package/dist/app/session-shell/session-shell-root.d.ts +76 -113
  49. package/dist/app/session-shell/session-shell-root.js +103 -329
  50. package/dist/app/session-shell/session-shell.d.ts +14 -37
  51. package/dist/app/session-shell/session-shell.js +177 -612
  52. package/dist/app/session-shell/session-viewport-controller.d.ts +9 -16
  53. package/dist/app/session-shell/session-viewport-controller.js +42 -320
  54. package/dist/app/session-shell/settings-bindings.d.ts +25 -3
  55. package/dist/app/session-shell/settings-bindings.js +26 -2
  56. package/dist/app/session-shell/share-operation.d.ts +3 -3
  57. package/dist/app/session-shell/share-operation.js +4 -6
  58. package/dist/app/session-shell/shell-clipboard.d.ts +59 -0
  59. package/dist/app/session-shell/shell-clipboard.js +119 -0
  60. package/dist/app/session-shell/shell-editor-factory.d.ts +8 -4
  61. package/dist/app/session-shell/shell-editor-factory.js +13 -15
  62. package/dist/app/session-shell/shell-host.d.ts +16 -17
  63. package/dist/app/session-shell/shell-host.js +18 -19
  64. package/dist/app/session-shell/shell-layout.d.ts +2 -2
  65. package/dist/app/session-shell/shell-prompt-suggestions.d.ts +26 -0
  66. package/dist/app/session-shell/shell-prompt-suggestions.js +48 -0
  67. package/dist/app/session-shell/suggestion-surface.d.ts +1 -6
  68. package/dist/app/session-shell/suggestion-surface.js +1 -1
  69. package/dist/app/session-shell/system-clipboard.d.ts +2 -14
  70. package/dist/app/session-shell/system-clipboard.js +2 -7
  71. package/dist/app/session-shell/transcript-document.d.ts +11 -8
  72. package/dist/app/session-shell/transcript-document.js +13 -14
  73. package/dist/app/session-shell/viewport-layout.d.ts +2 -2
  74. package/dist/app/session-shell/viewport-pointer.d.ts +83 -0
  75. package/dist/app/session-shell/viewport-pointer.js +361 -0
  76. package/dist/app/session-shell/workflow-output.d.ts +5 -3
  77. package/dist/app/session-shell/workflow-output.js +13 -15
  78. package/dist/cli/package-messages.d.ts +0 -1
  79. package/dist/cli/package-messages.js +1 -1
  80. package/dist/cli/session-context.d.ts +1 -1
  81. package/dist/cli/uninstall.d.ts +3 -2
  82. package/dist/composition/owned-settings.d.ts +2 -1
  83. package/dist/composition/owned-settings.js +0 -3
  84. package/dist/composition/owned-ui.d.ts +1 -1
  85. package/dist/composition/owned-ui.js +77 -73
  86. package/dist/composition/reference-selection-options.d.ts +1 -1
  87. package/dist/composition/reference-selection-options.js +1 -1
  88. package/dist/composition/session-runtime-registry.d.ts +2 -1
  89. package/dist/composition/settings-route-host.js +3 -10
  90. package/dist/composition/settings-search-input.d.ts +2 -1
  91. package/dist/composition/startup-route.d.ts +2 -2
  92. package/dist/composition/startup-route.js +2 -2
  93. package/dist/contracts/owned-ui/extension-ui.d.ts +2 -1
  94. package/dist/contracts/owned-ui/index.d.ts +2 -1
  95. package/dist/contracts/owned-ui/index.js +1 -1
  96. package/dist/contracts/owned-ui/session-presenters.d.ts +3 -0
  97. package/dist/contracts/owned-ui/shell-components.d.ts +543 -0
  98. package/dist/contracts/owned-ui/validation.d.ts +1 -11
  99. package/dist/contracts/owned-ui/validation.js +8 -104
  100. package/dist/contracts/presentation/component.d.ts +17 -0
  101. package/dist/contracts/presentation/component.js +8 -0
  102. package/dist/contracts/presentation/index.d.ts +6 -15
  103. package/dist/contracts/presentation/index.js +2 -0
  104. package/dist/contracts/presentation/terminal.d.ts +284 -0
  105. package/dist/contracts/presentation/terminal.js +1 -0
  106. package/dist/contracts/presentation/theme.d.ts +46 -0
  107. package/dist/contracts/presentation/theme.js +1 -0
  108. package/dist/features/launch/development-launch.js +1 -1
  109. package/dist/features/launch/runtime-selection.d.ts +2 -2
  110. package/dist/features/launch/runtime-selection.js +2 -2
  111. package/dist/features/owned-ui/project-trust-prompt.d.ts +2 -2
  112. package/dist/features/owned-ui/project-trust-prompt.js +1 -1
  113. package/dist/features/owned-ui/release-note-state.d.ts +2 -1
  114. package/dist/features/owned-ui/settings-app.js +49 -425
  115. package/dist/features/owned-ui/settings-edits.d.ts +31 -0
  116. package/dist/features/owned-ui/settings-edits.js +139 -0
  117. package/dist/features/owned-ui/settings-model-dialog.d.ts +41 -0
  118. package/dist/features/owned-ui/settings-model-dialog.js +194 -0
  119. package/dist/features/owned-ui/settings-scroll-rail.d.ts +29 -0
  120. package/dist/features/owned-ui/settings-scroll-rail.js +79 -0
  121. package/dist/features/owned-ui/settings-search-input.d.ts +2 -1
  122. package/dist/features/prompt-history/service.d.ts +3 -2
  123. package/dist/foundation/lifecycle/claim-gate.d.ts +2 -1
  124. package/dist/foundation/release/automatic-update.d.ts +5 -14
  125. package/dist/foundation/release/automatic-update.js +15 -22
  126. package/dist/foundation/release/bootstrap.js +4 -4
  127. package/dist/foundation/release/dependency-certification.d.ts +0 -1
  128. package/dist/foundation/release/dependency-certification.js +1 -1
  129. package/dist/foundation/release/dependency-layer.js +3 -3
  130. package/dist/foundation/release/early-accent.d.ts +2 -2
  131. package/dist/foundation/release/early-accent.js +1 -1
  132. package/dist/foundation/release/index.d.ts +2 -2
  133. package/dist/foundation/release/index.js +1 -1
  134. package/dist/foundation/release/latest-release.d.ts +3 -18
  135. package/dist/foundation/release/latest-release.js +11 -11
  136. package/dist/foundation/release/managed-path.d.ts +10 -0
  137. package/dist/foundation/release/managed-path.js +26 -0
  138. package/dist/foundation/release/ordinary-launch-selection.d.ts +1 -1
  139. package/dist/foundation/release/ordinary-launch-selection.js +1 -1
  140. package/dist/foundation/release/release-gc.d.ts +3 -3
  141. package/dist/foundation/release/release-gc.js +10 -12
  142. package/dist/foundation/release/{cohort-state.d.ts → release-state.d.ts} +23 -23
  143. package/dist/foundation/release/{cohort-state.js → release-state.js} +8 -8
  144. package/dist/foundation/release/restart-certification.js +3 -4
  145. package/dist/foundation/release/update-activation.js +3 -3
  146. package/dist/foundation/release/update-execution-lease.d.ts +2 -3
  147. package/dist/foundation/release/update-execution-lease.js +2 -8
  148. package/dist/foundation/release/update-installer.d.ts +45 -0
  149. package/dist/foundation/release/update-installer.js +57 -0
  150. package/dist/foundation/release/update-launch.d.ts +2 -2
  151. package/dist/foundation/release/update-recovery.js +2 -9
  152. package/dist/foundation/release/update.d.ts +4 -25
  153. package/dist/foundation/release/update.js +164 -183
  154. package/dist/foundation/startup/startup-budget.d.ts +5 -5
  155. package/dist/foundation/startup/startup-budget.js +2 -2
  156. package/dist/integrations/pi/components/bracketed-paste.d.ts +33 -0
  157. package/dist/integrations/pi/components/bracketed-paste.js +123 -0
  158. package/dist/integrations/pi/components/editor-interaction.d.ts +4 -12
  159. package/dist/integrations/pi/components/index.d.ts +15 -9
  160. package/dist/integrations/pi/components/index.js +9 -5
  161. package/dist/integrations/pi/components/lazy-selectors.d.ts +2 -10
  162. package/dist/integrations/pi/components/lazy-selectors.js +1 -1
  163. package/dist/integrations/pi/components/modal-frame.d.ts +5 -22
  164. package/dist/integrations/pi/components/modal-frame.js +3 -23
  165. package/dist/integrations/pi/components/owned-editor-ux.d.ts +4 -3
  166. package/dist/integrations/pi/components/owned-editor-ux.js +46 -140
  167. package/dist/integrations/pi/components/prompt-input-port.d.ts +2 -19
  168. package/dist/integrations/pi/components/resources/builtin-themes.d.ts +2 -1
  169. package/dist/integrations/pi/components/shell-editor-autocomplete.d.ts +3 -2
  170. package/dist/integrations/pi/components/shell-footer-status.d.ts +2 -2
  171. package/dist/integrations/pi/components/shell-footer-status.js +3 -2
  172. package/dist/integrations/pi/components/shell-presenters-info.d.ts +6 -5
  173. package/dist/integrations/pi/components/shell-presenters-info.js +2 -1
  174. package/dist/integrations/pi/components/shell-session-info-reference.d.ts +2 -1
  175. package/dist/integrations/pi/components/shell-shared-facade.d.ts +33 -227
  176. package/dist/integrations/pi/components/shell-shared-facade.js +8 -1
  177. package/dist/integrations/pi/components/skills-command.d.ts +1 -9
  178. package/dist/integrations/pi/components/skills-command.js +5 -5
  179. package/dist/integrations/pi/components/theme.d.ts +9 -2
  180. package/dist/integrations/pi/components/theme.js +17 -2
  181. package/dist/integrations/pi/components/thinking-selector-dialog.d.ts +2 -1
  182. package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.d.ts +2 -2
  183. package/dist/integrations/pi/engine/adapter.d.ts +4 -13
  184. package/dist/integrations/pi/engine/adapter.js +9 -61
  185. package/dist/integrations/pi/engine/changelog.d.ts +2 -2
  186. package/dist/integrations/pi/engine/changelog.js +3 -3
  187. package/dist/integrations/pi/engine/compaction-progress.d.ts +2 -3
  188. package/dist/integrations/pi/engine/compaction-progress.js +1 -1
  189. package/dist/integrations/pi/engine/conformance.d.ts +2 -1
  190. package/dist/integrations/pi/engine/default-model-setting.d.ts +0 -2
  191. package/dist/integrations/pi/engine/default-model-setting.js +1 -2
  192. package/dist/integrations/pi/engine/event-delivery.d.ts +2 -1
  193. package/dist/integrations/pi/engine/extension-ui-binding.d.ts +2 -1
  194. package/dist/integrations/pi/engine/host.js +3 -3
  195. package/dist/integrations/pi/engine/message-values.d.ts +0 -1
  196. package/dist/integrations/pi/engine/message-values.js +1 -1
  197. package/dist/integrations/pi/engine/pending-delivery.d.ts +0 -4
  198. package/dist/integrations/pi/engine/pending-delivery.js +3 -3
  199. package/dist/integrations/pi/engine/ports.d.ts +7 -1
  200. package/dist/integrations/pi/engine/ports.js +4 -0
  201. package/dist/integrations/pi/engine/project-trust-preflight.d.ts +2 -1
  202. package/dist/integrations/pi/engine/prompt-suggestions.d.ts +3 -2
  203. package/dist/integrations/pi/engine/provider-authentication.d.ts +1 -1
  204. package/dist/integrations/pi/engine/public-main-entry.d.ts +1 -5
  205. package/dist/integrations/pi/engine/public-main-entry.js +1 -1
  206. package/dist/integrations/pi/engine/repository-metadata.d.ts +49 -0
  207. package/dist/integrations/pi/engine/repository-metadata.js +189 -0
  208. package/dist/integrations/pi/engine/repository-pr-rest.d.ts +1 -9
  209. package/dist/integrations/pi/engine/repository-pr-rest.js +2 -2
  210. package/dist/integrations/pi/engine/repository-pr.d.ts +1 -3
  211. package/dist/integrations/pi/engine/repository-pr.js +1 -1
  212. package/dist/integrations/pi/engine/resource-catalog.d.ts +2 -1
  213. package/dist/integrations/pi/engine/session-integration.d.ts +1 -1
  214. package/dist/integrations/pi/engine/session-runtime.d.ts +7 -12
  215. package/dist/integrations/pi/engine/session-runtime.js +21 -178
  216. package/dist/integrations/pi/engine/settings-bridge.d.ts +0 -2
  217. package/dist/integrations/pi/engine/settings-bridge.js +1 -1
  218. package/dist/integrations/pi/engine/settings-port.d.ts +3 -2
  219. package/dist/integrations/pi/engine/transcript-projection.d.ts +2 -1
  220. package/dist/integrations/pi/engine/view-state.d.ts +21 -2
  221. package/dist/integrations/pi/engine/view-state.js +129 -1
  222. package/dist/integrations/pi/engine/workflow-contexts.d.ts +1 -1
  223. package/dist/integrations/pi/engine/workflow-runner.d.ts +1 -2
  224. package/dist/integrations/pi/engine/workflow-runner.js +254 -365
  225. package/dist/integrations/pi/engine/workflow-share.d.ts +9 -0
  226. package/dist/integrations/pi/engine/workflow-share.js +168 -0
  227. package/dist/integrations/pi/engine/workflow-support.d.ts +0 -20
  228. package/dist/integrations/pi/engine/workflow-support.js +4 -65
  229. package/dist/integrations/pi/engine/workflows.d.ts +5 -5
  230. package/dist/integrations/pi/session-presenters/components.d.ts +3 -0
  231. package/dist/integrations/pi/session-presenters/components.js +75 -0
  232. package/dist/integrations/pi/session-presenters/index.d.ts +1 -0
  233. package/dist/integrations/pi/session-presenters/index.js +1 -0
  234. package/dist/integrations/pi/session-presenters/presentation.d.ts +3 -0
  235. package/dist/integrations/pi/session-presenters/presentation.js +10 -0
  236. package/dist/integrations/pi/session-presenters/presenters.d.ts +2 -1
  237. package/dist/integrations/pi/session-presenters/presenters.js +3 -1
  238. package/dist/integrations/pi/tui-runtime/adapter.d.ts +9 -19
  239. package/dist/integrations/pi/tui-runtime/adapter.js +56 -174
  240. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +9 -44
  241. package/dist/integrations/pi/tui-runtime/index.d.ts +1 -1
  242. package/dist/integrations/pi/tui-runtime/index.js +1 -0
  243. package/dist/integrations/pi/tui-runtime/input-presentation-coordinator.d.ts +4 -6
  244. package/dist/integrations/pi/tui-runtime/overlay-geometry.d.ts +4 -10
  245. package/dist/integrations/pi/tui-runtime/overlay-geometry.js +3 -9
  246. package/dist/integrations/pi/tui-runtime/presentation-adapter.d.ts +2 -2
  247. package/dist/integrations/pi/tui-runtime/runtime-factory.d.ts +3 -0
  248. package/dist/integrations/pi/tui-runtime/runtime-factory.js +11 -0
  249. package/dist/ui/components/index.d.ts +2 -2
  250. package/dist/ui/components/index.js +1 -1
  251. package/dist/ui/components/selection-copy.d.ts +0 -1
  252. package/dist/ui/components/selection-copy.js +0 -12
  253. package/dist/ui/components/theme.d.ts +4 -19
  254. package/dist/ui/components/theme.js +6 -0
  255. package/dist/ui/components/transcript-viewport-frame.d.ts +120 -0
  256. package/dist/ui/components/transcript-viewport-frame.js +314 -0
  257. package/dist/ui/components/transcript-viewport-types.d.ts +147 -0
  258. package/dist/ui/components/transcript-viewport-types.js +1 -0
  259. package/dist/ui/components/transcript-viewport.d.ts +2 -147
  260. package/dist/ui/components/transcript-viewport.js +87 -315
  261. package/dist/ui/settings/declarations.d.ts +2 -3
  262. package/dist/ui/settings/declarations.js +2 -3
  263. package/dist/ui/settings/early-accent.js +1 -1
  264. package/dist/ui/settings/index.d.ts +3 -5
  265. package/dist/ui/settings/index.js +2 -3
  266. package/dist/ui/settings/manager.d.ts +0 -4
  267. package/dist/ui/settings/manager.js +6 -62
  268. package/dist/ui/settings/resolution.d.ts +6 -18
  269. package/dist/ui/settings/resolution.js +4 -103
  270. package/dist/ui/settings/sections.d.ts +0 -4
  271. package/dist/ui/settings/sections.js +1 -1
  272. package/docs/architecture/boundaries.md +2 -2
  273. package/docs/architecture/internal-naming.md +2 -0
  274. package/docs/architecture/project-structure.md +4 -2
  275. package/docs/validation.md +1 -1
  276. package/package.json +3 -4
  277. package/dist/integrations/pi/components/components.d.ts +0 -4
  278. package/dist/integrations/pi/components/components.js +0 -48
  279. package/dist/integrations/pi/components/conformance.d.ts +0 -18
  280. package/dist/integrations/pi/components/conformance.js +0 -70
  281. package/dist/integrations/pi/components/shell-components.d.ts +0 -7
  282. package/dist/integrations/pi/components/shell-components.js +0 -7
  283. package/dist/integrations/pi/components/upstream/theme/theme-controller.d.ts +0 -33
  284. package/dist/integrations/pi/components/upstream/theme/theme-controller.js +0 -114
  285. package/dist/integrations/pi/engine/diagnostics-state.d.ts +0 -9
  286. package/dist/integrations/pi/engine/diagnostics-state.js +0 -34
  287. package/dist/integrations/pi/engine/usage-view.d.ts +0 -4
  288. package/dist/integrations/pi/engine/usage-view.js +0 -56
  289. package/dist/integrations/pi/tui-runtime/contracts.d.ts +0 -166
  290. package/dist/ui/settings/migrations.d.ts +0 -19
  291. package/dist/ui/settings/migrations.js +0 -225
  292. package/dist/ui/settings/progress-palette.generated.d.ts +0 -139
  293. package/dist/ui/settings/progress-palette.generated.js +0 -139
  294. /package/dist/{integrations/pi/tui-runtime/contracts.js → contracts/owned-ui/shell-components.js} +0 -0
  295. /package/dist/{foundation/release → contracts/presentation}/progress-palette.generated.d.ts +0 -0
  296. /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,9 +0,0 @@
1
- import type { OwnedUiDiagnostics } from "../../../contracts/owned-ui/index.js";
2
- /** Bounded structured notices; acknowledgements never inspect terminal cells or touch Agent work. */
3
- export declare class EngineDiagnostics {
4
- #private;
5
- get values(): readonly OwnedUiDiagnostics[];
6
- get messages(): readonly string[];
7
- record(severity: OwnedUiDiagnostics["severity"], code: string, message: string, recoverable: boolean): OwnedUiDiagnostics;
8
- clearCodes(codes: readonly string[]): boolean;
9
- }
@@ -1,34 +0,0 @@
1
- /** Bounded structured notices; acknowledgements never inspect terminal cells or touch Agent work. */
2
- export class EngineDiagnostics {
3
- #values = [];
4
- #messages = [];
5
- #sequence = 0;
6
- get values() { return this.#values; }
7
- get messages() { return this.#messages; }
8
- record(severity, code, message, recoverable) {
9
- const diagnostic = { sequence: this.#sequence++, code, severity, message, recoverable };
10
- this.#values.push(diagnostic);
11
- if (this.#values.length > 100)
12
- this.#values.shift();
13
- this.#messages = [...this.#messages, message].slice(-8);
14
- return diagnostic;
15
- }
16
- clearCodes(codes) {
17
- const selected = new Set(codes);
18
- return this.#remove(diagnostic => selected.has(diagnostic.code));
19
- }
20
- #remove(predicate) {
21
- const removed = new Set();
22
- for (let index = this.#values.length - 1; index >= 0; index--) {
23
- const diagnostic = this.#values[index];
24
- if (predicate(diagnostic)) {
25
- removed.add(diagnostic.message);
26
- this.#values.splice(index, 1);
27
- }
28
- }
29
- if (removed.size === 0)
30
- return false;
31
- this.#messages = this.#messages.filter(message => !removed.has(message) || this.#values.some(diagnostic => diagnostic.message === message));
32
- return true;
33
- }
34
- }
@@ -1,4 +0,0 @@
1
- import type { AgentSession, AgentSessionRuntime } from "../startup-public.js";
2
- import type { OwnedUiModelInfo, OwnedUiUsageView } from "../../../contracts/owned-ui/index.js";
3
- /** Token, cost, cache, and context usage summed from the session's entries for the status footer. */
4
- export declare function readUsageView(session: AgentSession | undefined, runtime: AgentSessionRuntime | undefined, activeModel: OwnedUiModelInfo | null): OwnedUiUsageView;
@@ -1,56 +0,0 @@
1
- import { finiteNumber, isRecord } from "./message-values.js";
2
- /** Token, cost, cache, and context usage summed from the session's entries for the status footer. */
3
- export function readUsageView(session, runtime, activeModel) {
4
- let input = 0;
5
- let output = 0;
6
- let cacheRead = 0;
7
- let cacheWrite = 0;
8
- let cost = 0;
9
- let latestCacheHitRate = null;
10
- let latestPrompt = null;
11
- const entries = session?.sessionManager?.getEntries?.()
12
- ?? (session?.messages ?? []).map(message => ({ type: "message", message }));
13
- for (const entry of entries) {
14
- if (!isRecord(entry))
15
- continue;
16
- const message = entry.type === "message" && isRecord(entry.message) ? entry.message : undefined;
17
- const usage = message !== undefined && isRecord(message.usage)
18
- ? message.usage
19
- : (entry.type === "usage" || entry.type === "branch_summary" || entry.type === "compaction") && isRecord(entry.usage) ? entry.usage : undefined;
20
- if (usage === undefined)
21
- continue;
22
- input += finiteNumber(usage.input);
23
- output += finiteNumber(usage.output);
24
- cacheRead += finiteNumber(usage.cacheRead);
25
- cacheWrite += finiteNumber(usage.cacheWrite);
26
- cost += isRecord(usage.cost) ? finiteNumber(usage.cost.total) : 0;
27
- if (message?.role === "assistant") {
28
- latestPrompt = {
29
- input: finiteNumber(usage.input),
30
- cacheRead: finiteNumber(usage.cacheRead),
31
- cacheWrite: finiteNumber(usage.cacheWrite),
32
- };
33
- const promptTokens = latestPrompt.input + latestPrompt.cacheRead + latestPrompt.cacheWrite;
34
- latestCacheHitRate = promptTokens > 0 ? (latestPrompt.cacheRead / promptTokens) * 100 : null;
35
- }
36
- }
37
- const context = session?.getContextUsage?.();
38
- const providerId = activeModel?.providerId;
39
- const usingSubscription = providerId === "kimi-coding"
40
- || (providerId !== undefined && runtime?.services.modelRuntime.isUsingSubscription?.(providerId) === true);
41
- return {
42
- input,
43
- output,
44
- cacheRead,
45
- cacheWrite,
46
- cost,
47
- latestCacheHitRate,
48
- latestPrompt,
49
- contextAvailable: context !== undefined,
50
- contextTokens: context?.tokens ?? null,
51
- contextWindow: context?.contextWindow ?? 0,
52
- contextPercent: context?.percent ?? null,
53
- usingSubscription,
54
- autoCompactEnabled: runtime?.services.settingsManager?.getCompactionEnabled?.() ?? true,
55
- };
56
- }
@@ -1,166 +0,0 @@
1
- import type { PresentationComponentPort, PresentationPointerSurface } from "../../../contracts/presentation/index.js";
2
- import type { ProgramStatus, WheelScrollLines } from "@earendil-works/pi-tui";
3
- import type { PiTuiInputCoordinationDecision, PiTuiInputCoordinationScheduler, PiTuiInputSurfaceKind } from "./input-presentation-coordinator.js";
4
- export type PiTuiRuntimeState = "idle" | "running" | "stopping" | "stopped" | "failed";
5
- export interface PiTuiViewport {
6
- readonly columns: number;
7
- readonly rows: number;
8
- }
9
- export interface PiTuiScrollState {
10
- readonly scrollTop: number;
11
- readonly viewportHeight: number;
12
- readonly followingEnd: boolean;
13
- readonly scrollbarVisible: boolean;
14
- }
15
- export type PiTuiPointerSurface = PresentationPointerSurface;
16
- export interface PiTuiComponentPort extends PresentationComponentPort {
17
- readonly wantsKeyRelease?: boolean;
18
- }
19
- export interface PiTuiTerminalPort {
20
- start(onInput: (data: string) => void, onResize: () => void): void;
21
- stop(): void;
22
- drainInput(maxMs?: number, idleMs?: number): Promise<void>;
23
- write(data: string): void;
24
- readonly columns: number;
25
- readonly rows: number;
26
- readonly kittyProtocolActive: boolean;
27
- moveBy(lines: number): void;
28
- hideCursor(): void;
29
- showCursor(): void;
30
- clearLine(): void;
31
- clearFromCursor(): void;
32
- clearScreen(): void;
33
- setTitle(title: string): void;
34
- setProgress(active: boolean): void;
35
- /** Optional for neutral test/decorator ports; the Pi-facing adapter always supplies it. */
36
- setProgramStatus?(status: ProgramStatus): void;
37
- /**
38
- * Optional synchronous last-resort mode restore that Pi TUI invokes from a process `exit` handler when
39
- * `stop()` did not run; the runtime adapter binds it to the undecorated terminal, so decorators need not forward it.
40
- */
41
- restoreOnExit?(before: string, after: string): void;
42
- }
43
- export type PiTuiSizeValue = number | `${number}%`;
44
- export type PiTuiOverlayAnchor = "center" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | "top-center" | "bottom-center" | "left-center" | "right-center";
45
- export interface PiTuiOverlayMargin {
46
- readonly top?: number;
47
- readonly right?: number;
48
- readonly bottom?: number;
49
- readonly left?: number;
50
- }
51
- export interface PiTuiOverlayOptions {
52
- readonly width?: PiTuiSizeValue;
53
- readonly minWidth?: number;
54
- readonly maxHeight?: PiTuiSizeValue;
55
- readonly anchor?: PiTuiOverlayAnchor;
56
- readonly offsetX?: number;
57
- readonly offsetY?: number;
58
- readonly row?: PiTuiSizeValue;
59
- readonly col?: PiTuiSizeValue;
60
- readonly margin?: PiTuiOverlayMargin | number;
61
- readonly visible?: (columns: number, rows: number) => boolean;
62
- readonly nonCapturing?: boolean;
63
- /** A1-owned input scheduling declaration; omitted extension overlays fail closed. */
64
- readonly inputCoordination?: Exclude<PiTuiInputSurfaceKind, "editor">;
65
- }
66
- export interface PiTuiOverlayUnfocusOptions {
67
- readonly target: PiTuiComponentPort | null;
68
- }
69
- export interface PiTuiOverlayHandle {
70
- hide(): void;
71
- setHidden(hidden: boolean): void;
72
- isHidden(): boolean;
73
- focus(): void;
74
- unfocus(options?: PiTuiOverlayUnfocusOptions): void;
75
- isFocused(): boolean;
76
- /** The most recently rendered terminal-relative rectangle of a visible overlay. */
77
- getBounds(): {
78
- readonly row: number;
79
- readonly col: number;
80
- readonly width: number;
81
- readonly height: number;
82
- } | undefined;
83
- }
84
- export interface PiTuiInputListenerResult {
85
- readonly consume?: boolean;
86
- readonly data?: string;
87
- }
88
- export type PiTuiInputListener = (data: string) => PiTuiInputListenerResult | undefined;
89
- /** Runs at the terminal bridge before Pi TUI receives physical input. */
90
- export type PiTuiPreInputListener = PiTuiInputListener;
91
- export interface PiTuiLayoutEntry {
92
- readonly node: PiTuiLayoutNode;
93
- readonly basis?: number | "auto";
94
- readonly grow?: number;
95
- readonly shrink?: number;
96
- readonly minSize?: number;
97
- readonly maxSize?: number;
98
- readonly visible?: (viewport: PiTuiViewport) => boolean;
99
- }
100
- export type PiTuiLayoutNode = {
101
- readonly type: "component";
102
- readonly component: PiTuiComponentPort;
103
- } | {
104
- readonly type: "stack";
105
- readonly direction: "vertical" | "horizontal";
106
- readonly children: readonly PiTuiLayoutEntry[];
107
- readonly gap?: number;
108
- readonly align?: "stretch" | "start" | "center" | "end";
109
- } | {
110
- readonly type: "scroll";
111
- readonly id: string;
112
- readonly child: PiTuiLayoutNode;
113
- readonly follow?: "none" | "end";
114
- readonly primary?: boolean;
115
- readonly overscroll?: "chain" | "contain";
116
- readonly scrollbar?: "hidden" | "auto" | "always";
117
- /** Styles the scrollbar track; the pinned runtime draws it as foreground text. */
118
- readonly scrollbarTrackStyle?: (text: string) => string;
119
- /** Styles the scrollbar thumb; the pinned runtime draws it as foreground text. */
120
- readonly scrollbarThumbStyle?: (text: string) => string;
121
- readonly scrollbarHideDelayMs?: number;
122
- };
123
- export type PiTuiInputDiagnosticsPhase = "receipt" | "semantic-start" | "semantic-end" | "composition-start" | "composition-end" | "write-start" | "write-end";
124
- export interface PiTuiInputDiagnosticsEvent {
125
- readonly phase: PiTuiInputDiagnosticsPhase;
126
- readonly revision: number;
127
- readonly atMs: number;
128
- readonly pendingDepth: number;
129
- readonly pendingPresentationDepth: 0 | 1;
130
- readonly appliedRevision: number;
131
- }
132
- export interface PiTuiRuntimeAdapterOptions {
133
- readonly root: PiTuiComponentPort;
134
- /** Bare viewport only: painted overlays in back-to-front order; null while geometry is stale. */
135
- readonly onOverlayGeometry?: (surfaces: readonly PiTuiPointerSurface[] | null) => void;
136
- readonly mode?: "regular" | "fullscreen";
137
- readonly layoutRoot?: PiTuiLayoutNode;
138
- readonly terminal?: PiTuiTerminalPort;
139
- /** A1-owned public-boundary decorator; comparison paths omit it. */
140
- readonly decorateTerminal?: (terminal: PiTuiTerminalPort) => PiTuiTerminalPort;
141
- /** Bare-custom-viewport scheduling policy; comparison paths omit it. */
142
- readonly inputCoordination?: {
143
- readonly classify: (data: string, focusedOverlay?: Exclude<PiTuiInputSurfaceKind, "editor">) => PiTuiInputCoordinationDecision;
144
- readonly onReceipt?: () => void;
145
- readonly scheduler?: PiTuiInputCoordinationScheduler;
146
- };
147
- /** Optional bounded evidence hook. Production composition omits it. */
148
- readonly inputDiagnostics?: {
149
- readonly onEvent: (event: PiTuiInputDiagnosticsEvent) => void;
150
- readonly now?: () => number;
151
- };
152
- readonly hardwareCursor?: boolean;
153
- readonly mouse?: boolean;
154
- /** Consume residual SGR mouse reports after every pre-input listener has run. */
155
- readonly consumeUnhandledMouse?: boolean;
156
- readonly wheelScrollLines?: WheelScrollLines;
157
- readonly openUrl?: (url: string) => void;
158
- readonly onRightClickPaste?: () => void;
159
- readonly logDirectory?: string;
160
- }
161
- export interface PiTuiStopOptions {
162
- readonly preserveScreen?: boolean;
163
- readonly drainInput?: boolean;
164
- readonly drainMaxMs?: number;
165
- readonly drainIdleMs?: number;
166
- }
@@ -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[];