@timurproko/a1 0.2.7-dev.808 → 0.2.7-dev.810

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 (141) hide show
  1. package/README.md +4 -2
  2. package/dist/app/session-shell/dialog-coordinator.d.ts +42 -0
  3. package/dist/app/session-shell/dialog-coordinator.js +133 -0
  4. package/dist/app/session-shell/dock-chrome.d.ts +34 -0
  5. package/dist/app/session-shell/dock-chrome.js +109 -0
  6. package/dist/app/session-shell/exit-notice.d.ts +1 -1
  7. package/dist/app/session-shell/exit-notice.js +1 -1
  8. package/dist/app/session-shell/extension-surface.d.ts +30 -0
  9. package/dist/app/session-shell/extension-surface.js +105 -0
  10. package/dist/app/session-shell/input-surface-switch.d.ts +36 -0
  11. package/dist/app/session-shell/input-surface-switch.js +85 -0
  12. package/dist/app/session-shell/login-interaction.d.ts +27 -0
  13. package/dist/app/session-shell/login-interaction.js +91 -0
  14. package/dist/app/session-shell/prompt-submission.d.ts +48 -0
  15. package/dist/app/session-shell/prompt-submission.js +276 -0
  16. package/dist/app/session-shell/resident-tab-coordinator.d.ts +41 -0
  17. package/dist/app/session-shell/resident-tab-coordinator.js +120 -0
  18. package/dist/app/session-shell/response-copy-transport.d.ts +13 -0
  19. package/dist/app/session-shell/response-copy-transport.js +16 -7
  20. package/dist/app/session-shell/session-concern.d.ts +22 -0
  21. package/dist/app/session-shell/session-concern.js +29 -0
  22. package/dist/app/session-shell/session-lifecycle.d.ts +29 -0
  23. package/dist/app/session-shell/session-lifecycle.js +49 -0
  24. package/dist/app/session-shell/session-shell-root.d.ts +1 -1
  25. package/dist/app/session-shell/session-shell-root.js +182 -931
  26. package/dist/app/session-shell/session-shell.d.ts +2 -8
  27. package/dist/app/session-shell/session-shell.js +202 -901
  28. package/dist/app/session-shell/settings-bindings.d.ts +17 -0
  29. package/dist/app/session-shell/settings-bindings.js +91 -0
  30. package/dist/app/session-shell/shell-editor-factory.d.ts +27 -0
  31. package/dist/app/session-shell/shell-editor-factory.js +102 -0
  32. package/dist/app/session-shell/shell-host.d.ts +6 -0
  33. package/dist/app/session-shell/shell-host.js +8 -0
  34. package/dist/app/session-shell/shell-layout.d.ts +64 -0
  35. package/dist/app/session-shell/shell-layout.js +18 -0
  36. package/dist/app/session-shell/suggestion-surface.d.ts +25 -0
  37. package/dist/app/session-shell/suggestion-surface.js +63 -0
  38. package/dist/app/session-shell/transcript-document.d.ts +78 -0
  39. package/dist/app/session-shell/transcript-document.js +365 -0
  40. package/dist/app/session-shell/viewport-layout.d.ts +31 -0
  41. package/dist/app/session-shell/viewport-layout.js +160 -0
  42. package/dist/app/session-shell/workflow-output.d.ts +33 -0
  43. package/dist/app/session-shell/workflow-output.js +174 -0
  44. package/dist/app/session-shell/workflow-router.d.ts +25 -0
  45. package/dist/app/session-shell/workflow-router.js +39 -0
  46. package/dist/composition/owned-ui.d.ts +4 -25
  47. package/dist/composition/owned-ui.js +26 -270
  48. package/dist/composition/resident-tab-bridge.d.ts +16 -0
  49. package/dist/composition/resident-tab-bridge.js +159 -0
  50. package/dist/composition/session-backend.d.ts +19 -0
  51. package/dist/composition/session-backend.js +1 -0
  52. package/dist/composition/session-runtime-registry.d.ts +20 -0
  53. package/dist/composition/session-runtime-registry.js +85 -0
  54. package/dist/composition/startup-route.d.ts +32 -0
  55. package/dist/composition/startup-route.js +72 -0
  56. package/dist/foundation/release/progress-palette.generated.d.ts +2 -2
  57. package/dist/foundation/release/progress-palette.generated.js +2 -2
  58. package/dist/foundation/startup/startup-descriptor.js +2 -2
  59. package/dist/integrations/pi/components/resources/builtin-themes.d.ts +2 -2
  60. package/dist/integrations/pi/components/resources/builtin-themes.js +2 -2
  61. package/dist/integrations/pi/components/shell-extension-ui.js +79 -60
  62. package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.d.ts +1 -1
  63. package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.js +1 -1
  64. package/dist/integrations/pi/components/upstream/assets/earendil-image.json +2 -2
  65. package/dist/integrations/pi/components/upstream/components/countdown-timer.d.ts +1 -1
  66. package/dist/integrations/pi/components/upstream/components/earendil-announcement.js +1 -1
  67. package/dist/integrations/pi/components/upstream/components/extension-editor.d.ts +1 -1
  68. package/dist/integrations/pi/components/upstream/components/extension-editor.js +1 -1
  69. package/dist/integrations/pi/components/upstream/components/extension-input.js +1 -1
  70. package/dist/integrations/pi/components/upstream/components/extension-selector.js +1 -1
  71. package/dist/integrations/pi/components/upstream/components/mermaid.js +1 -1
  72. package/dist/integrations/pi/components/upstream/components/owned-editor.d.ts +1 -1
  73. package/dist/integrations/pi/components/upstream/components/owned-editor.js +1 -1
  74. package/dist/integrations/pi/components/upstream/components/pi-logo.js +1 -1
  75. package/dist/integrations/pi/components/upstream/components/scoped-models-selector.d.ts +1 -1
  76. package/dist/integrations/pi/components/upstream/components/session-footer.js +1 -1
  77. package/dist/integrations/pi/components/upstream/components/session-selector-search.js +1 -1
  78. package/dist/integrations/pi/components/upstream/components/session-selector.js +1 -1
  79. package/dist/integrations/pi/components/upstream/components/skill-invocation-message.d.ts +1 -1
  80. package/dist/integrations/pi/components/upstream/components/skill-invocation-message.js +1 -1
  81. package/dist/integrations/pi/components/upstream/components/status-indicator.d.ts +1 -1
  82. package/dist/integrations/pi/components/upstream/components/status-indicator.js +1 -1
  83. package/dist/integrations/pi/components/upstream/components/themed-text.d.ts +1 -1
  84. package/dist/integrations/pi/components/upstream/components/themed-text.js +1 -1
  85. package/dist/integrations/pi/components/upstream/components/thinking-selector.d.ts +1 -1
  86. package/dist/integrations/pi/components/upstream/components/thinking-selector.js +1 -1
  87. package/dist/integrations/pi/components/upstream/components/tool-execution.d.ts +2 -4
  88. package/dist/integrations/pi/components/upstream/components/tool-execution.js +77 -98
  89. package/dist/integrations/pi/components/upstream/components/tree-selector.d.ts +1 -1
  90. package/dist/integrations/pi/components/upstream/components/tree-selector.js +1 -1
  91. package/dist/integrations/pi/components/upstream/components/trust-selector.js +1 -1
  92. package/dist/integrations/pi/components/upstream/external-editor.js +1 -1
  93. package/dist/integrations/pi/components/upstream/history/editor-core.d.ts +1 -1
  94. package/dist/integrations/pi/components/upstream/history/editor-core.js +1 -1
  95. package/dist/integrations/pi/components/upstream/history/kill-ring.d.ts +1 -1
  96. package/dist/integrations/pi/components/upstream/history/kill-ring.js +1 -1
  97. package/dist/integrations/pi/components/upstream/history/printable-key.js +1 -1
  98. package/dist/integrations/pi/components/upstream/history/text-helpers.js +1 -1
  99. package/dist/integrations/pi/components/upstream/history/undo-stack.d.ts +1 -1
  100. package/dist/integrations/pi/components/upstream/history/undo-stack.js +1 -1
  101. package/dist/integrations/pi/components/upstream/history/word-navigation.js +1 -1
  102. package/dist/integrations/pi/components/upstream/model-search.d.ts +1 -1
  103. package/dist/integrations/pi/components/upstream/program-status-reporter.d.ts +1 -1
  104. package/dist/integrations/pi/components/upstream/theme/theme-controller.d.ts +1 -1
  105. package/dist/integrations/pi/components/upstream/theme/theme.js +1 -1
  106. package/dist/integrations/pi/engine/adapter.d.ts +4 -77
  107. package/dist/integrations/pi/engine/adapter.js +85 -393
  108. package/dist/integrations/pi/engine/command-dispatch.d.ts +13 -0
  109. package/dist/integrations/pi/engine/command-dispatch.js +57 -0
  110. package/dist/integrations/pi/engine/host.js +2 -2
  111. package/dist/integrations/pi/engine/ports.d.ts +56 -0
  112. package/dist/integrations/pi/engine/ports.js +89 -0
  113. package/dist/integrations/pi/engine/resources/changelog.json +4 -4
  114. package/dist/integrations/pi/engine/view-state.d.ts +42 -0
  115. package/dist/integrations/pi/engine/view-state.js +126 -0
  116. package/dist/integrations/pi/startup-public.js +164 -150
  117. package/dist/integrations/pi/startup-public.manifest.json +351 -310
  118. package/dist/integrations/pi/tui-runtime/adapter.js +4 -0
  119. package/dist/integrations/pi/tui-runtime/contracts.d.ts +5 -0
  120. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +1 -1
  121. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.js +1 -1
  122. package/dist/native/darwin-arm64/manifest.json +1 -1
  123. package/dist/native/darwin-arm64/terminal-host.manifest.json +3 -3
  124. package/dist/native/darwin-arm64/terminal-host.node +0 -0
  125. package/dist/native/darwin-x64/manifest.json +1 -1
  126. package/dist/native/darwin-x64/terminal-host.manifest.json +3 -3
  127. package/dist/native/darwin-x64/terminal-host.node +0 -0
  128. package/dist/native/linux-x64/manifest.json +1 -1
  129. package/dist/native/linux-x64/terminal-host.manifest.json +3 -3
  130. package/dist/native/linux-x64/terminal-host.node +0 -0
  131. package/dist/native/win32-x64/manifest.json +2 -2
  132. package/dist/native/win32-x64/process-guardian.node +0 -0
  133. package/dist/native/win32-x64/terminal-host.manifest.json +3 -3
  134. package/dist/native/win32-x64/terminal-host.node +0 -0
  135. package/dist/runtime-payload-inventory.json +5181 -5369
  136. package/dist/ui/components/transcript-viewport.js +10 -19
  137. package/docs/architecture/boundaries.md +14 -0
  138. package/docs/architecture/resident-tabs.md +8 -8
  139. package/docs/architecture/response-copy-delivery.md +1 -1
  140. package/docs/architecture/toolchain.md +2 -2
  141. package/package.json +5 -5
@@ -0,0 +1,42 @@
1
+ import type { OwnedUiDiagnostics, OwnedUiEditorState, OwnedUiModelInfo, OwnedUiSessionViewModel, OwnedUiStatusView, OwnedUiTerminalSurface, OwnedUiThinkingLevel, OwnedUiUsageView } from "../../../contracts/owned-ui/index.js";
2
+ /**
3
+ * The engine adapter's own view-model state: lifecycle, editor, status, terminal surface, active
4
+ * model, thinking level, the usage cache, diagnostics, and the view revision. Every change that
5
+ * touches more than one field is one named mutator, so the adapter and its collaborators never
6
+ * rebuild these objects inline.
7
+ */
8
+ export declare class EngineViewState {
9
+ #private;
10
+ lifecycle: OwnedUiSessionViewModel["lifecycle"];
11
+ activeModel: OwnedUiModelInfo | null;
12
+ thinkingLevel: OwnedUiThinkingLevel;
13
+ get revision(): number;
14
+ get editor(): OwnedUiEditorState;
15
+ get status(): OwnedUiStatusView;
16
+ get terminal(): OwnedUiTerminalSurface;
17
+ get diagnostics(): readonly OwnedUiDiagnostics[];
18
+ /** Any emitted event advances the revision. */
19
+ advance(): void;
20
+ /** A full view is about to be published: usage is recomputed and the revision advances. */
21
+ invalidate(): void;
22
+ invalidateUsage(): void;
23
+ /** The cached usage view, computed once per published view. */
24
+ usage(read: () => OwnedUiUsageView): OwnedUiUsageView;
25
+ /** The engine started: the session is ready and accepts submissions. */
26
+ markReady(): void;
27
+ /** A run started with `message` as its working status; true when the session was already busy. */
28
+ enterWork(message: string): boolean;
29
+ leaveWork(): void;
30
+ /** Records compaction or retry progress; false when it did not change. */
31
+ setWorkProgress(percent: Exclude<OwnedUiStatusView["workingProgress"], undefined>): boolean;
32
+ setQueuedSubmissions(queuedSubmissions: readonly string[]): void;
33
+ /** Fills an empty editor with `text`, as tree navigation does for the selected branch's prompt. */
34
+ offerEditorText(text: string): void;
35
+ setHardwareCursor(hardwareCursor: boolean): void;
36
+ setTerminal(surface: OwnedUiTerminalSurface): void;
37
+ /** A replaced session starts with an empty editor that accepts submissions and no working status. */
38
+ replaceSession(): void;
39
+ /** Delivery overload ended the run: ready when it can resume, stopped once disposed, otherwise failed. */
40
+ settleOverload(canResume: boolean, disposed: boolean): void;
41
+ recordDiagnostic(severity: OwnedUiDiagnostics["severity"], code: string, message: string, recoverable: boolean): OwnedUiDiagnostics;
42
+ }
@@ -0,0 +1,126 @@
1
+ const DEFAULT_SURFACE = {
2
+ columns: 100,
3
+ rows: 32,
4
+ focusedRegion: "editor",
5
+ hardwareCursor: false,
6
+ };
7
+ const MAX_DIAGNOSTICS = 100;
8
+ const MAX_STATUS_DIAGNOSTICS = 8;
9
+ /**
10
+ * The engine adapter's own view-model state: lifecycle, editor, status, terminal surface, active
11
+ * model, thinking level, the usage cache, diagnostics, and the view revision. Every change that
12
+ * touches more than one field is one named mutator, so the adapter and its collaborators never
13
+ * rebuild these objects inline.
14
+ */
15
+ export class EngineViewState {
16
+ #revision = 0;
17
+ #editor = {
18
+ text: "",
19
+ queuedSubmissions: [],
20
+ selection: null,
21
+ cursorOffset: 0,
22
+ historyRevision: 0,
23
+ submitEnabled: false,
24
+ };
25
+ #status = {
26
+ title: "Pi",
27
+ workingMessage: null,
28
+ diagnostics: [],
29
+ badges: [],
30
+ };
31
+ #terminal = DEFAULT_SURFACE;
32
+ lifecycle = "starting";
33
+ activeModel = null;
34
+ thinkingLevel = "medium";
35
+ #usage;
36
+ #diagnostics = [];
37
+ get revision() { return this.#revision; }
38
+ get editor() { return this.#editor; }
39
+ get status() { return this.#status; }
40
+ get terminal() { return this.#terminal; }
41
+ get diagnostics() { return this.#diagnostics; }
42
+ /** Any emitted event advances the revision. */
43
+ advance() {
44
+ this.#revision += 1;
45
+ }
46
+ /** A full view is about to be published: usage is recomputed and the revision advances. */
47
+ invalidate() {
48
+ this.#usage = undefined;
49
+ this.#revision += 1;
50
+ }
51
+ invalidateUsage() {
52
+ this.#usage = undefined;
53
+ }
54
+ /** The cached usage view, computed once per published view. */
55
+ usage(read) {
56
+ return this.#usage ??= read();
57
+ }
58
+ /** The engine started: the session is ready and accepts submissions. */
59
+ markReady() {
60
+ this.lifecycle = "ready";
61
+ this.#editor = { ...this.#editor, submitEnabled: true };
62
+ }
63
+ /** A run started with `message` as its working status; true when the session was already busy. */
64
+ enterWork(message) {
65
+ const wasBusy = this.lifecycle === "busy";
66
+ this.lifecycle = "busy";
67
+ this.#status = { ...this.#status, workingMessage: message, workingProgress: null };
68
+ return wasBusy;
69
+ }
70
+ leaveWork() {
71
+ this.lifecycle = "ready";
72
+ this.#status = { ...this.#status, workingMessage: null, workingProgress: null };
73
+ }
74
+ /** Records compaction or retry progress; false when it did not change. */
75
+ setWorkProgress(percent) {
76
+ if (this.#status.workingProgress === percent)
77
+ return false;
78
+ this.#status = { ...this.#status, workingProgress: percent };
79
+ return true;
80
+ }
81
+ setQueuedSubmissions(queuedSubmissions) {
82
+ this.#editor = { ...this.#editor, queuedSubmissions: [...queuedSubmissions], historyRevision: this.#editor.historyRevision + 1 };
83
+ }
84
+ /** Fills an empty editor with `text`, as tree navigation does for the selected branch's prompt. */
85
+ offerEditorText(text) {
86
+ if (!this.#editor.text.trim()) {
87
+ this.#editor = { ...this.#editor, text, selection: null, cursorOffset: text.length };
88
+ }
89
+ }
90
+ setHardwareCursor(hardwareCursor) {
91
+ this.#terminal = { ...this.#terminal, hardwareCursor };
92
+ }
93
+ setTerminal(surface) {
94
+ this.#terminal = { ...surface };
95
+ }
96
+ /** A replaced session starts with an empty editor that accepts submissions and no working status. */
97
+ replaceSession() {
98
+ this.#editor = {
99
+ text: "",
100
+ queuedSubmissions: [],
101
+ selection: null,
102
+ cursorOffset: 0,
103
+ historyRevision: this.#editor.historyRevision + 1,
104
+ submitEnabled: true,
105
+ };
106
+ this.#status = { ...this.#status, workingMessage: null, workingProgress: null, badges: [] };
107
+ }
108
+ /** Delivery overload ended the run: ready when it can resume, stopped once disposed, otherwise failed. */
109
+ settleOverload(canResume, disposed) {
110
+ this.#status = { ...this.#status, workingMessage: null, workingProgress: null };
111
+ this.lifecycle = disposed ? "stopped" : canResume ? "ready" : "failed";
112
+ this.#editor = { ...this.#editor, submitEnabled: canResume && !disposed };
113
+ this.#revision += 1;
114
+ }
115
+ recordDiagnostic(severity, code, message, recoverable) {
116
+ const diagnostic = { sequence: this.#diagnostics.length, code, severity, message, recoverable };
117
+ this.#diagnostics.push(diagnostic);
118
+ if (this.#diagnostics.length > MAX_DIAGNOSTICS)
119
+ this.#diagnostics.shift();
120
+ this.#status = {
121
+ ...this.#status,
122
+ diagnostics: [...this.#status.diagnostics, message].slice(-MAX_STATUS_DIAGNOSTICS),
123
+ };
124
+ return diagnostic;
125
+ }
126
+ }