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

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 (213) hide show
  1. package/bin/cli.js +13 -2
  2. package/bin/ui.js +13 -0
  3. package/dist/app/session-shell/clipboard-services.d.ts +19 -0
  4. package/dist/app/session-shell/clipboard-services.js +7 -0
  5. package/dist/app/session-shell/exit-notice.d.ts +9 -5
  6. package/dist/app/session-shell/exit-notice.js +5 -5
  7. package/dist/app/session-shell/index.d.ts +3 -1
  8. package/dist/app/session-shell/index.js +1 -0
  9. package/dist/app/session-shell/paste-preparation-client.d.ts +3 -0
  10. package/dist/app/session-shell/paste-preparation-client.js +5 -2
  11. package/dist/app/session-shell/path-chip-presentation.d.ts +10 -3
  12. package/dist/app/session-shell/path-chip-presentation.js +48 -6
  13. package/dist/app/session-shell/prompt-chips.js +30 -4
  14. package/dist/app/session-shell/prompt-suggestion-controller.d.ts +5 -4
  15. package/dist/app/session-shell/prompt-suggestion-controller.js +148 -58
  16. package/dist/app/session-shell/quit-outro.d.ts +3 -1
  17. package/dist/app/session-shell/quit-outro.js +23 -8
  18. package/dist/app/session-shell/response-copy-transport.d.ts +6 -1
  19. package/dist/app/session-shell/response-copy-transport.js +8 -2
  20. package/dist/app/session-shell/session-shell-root.d.ts +22 -11
  21. package/dist/app/session-shell/session-shell-root.js +19 -12
  22. package/dist/app/session-shell/session-shell.d.ts +19 -21
  23. package/dist/app/session-shell/session-shell.js +678 -840
  24. package/dist/app/session-shell/session-viewport-controller.js +33 -21
  25. package/dist/cli/dispatch.js +5 -3
  26. package/dist/cli/session-context.d.ts +5 -1
  27. package/dist/cli/session-context.js +25 -8
  28. package/dist/composition/owned-ui.d.ts +23 -2
  29. package/dist/composition/owned-ui.js +124 -33
  30. package/dist/composition/session-info-reference.d.ts +2 -2
  31. package/dist/composition/session-info-reference.js +2 -2
  32. package/dist/composition/settings-route-host.js +2 -1
  33. package/dist/contracts/agent-engine/capability-ports.d.ts +1 -85
  34. package/dist/contracts/agent-engine/capability-ports.js +1 -35
  35. package/dist/contracts/agent-engine/index.d.ts +1 -7
  36. package/dist/contracts/agent-engine/index.js +0 -4
  37. package/dist/contracts/owned-ui/index.d.ts +9 -3
  38. package/dist/contracts/owned-ui/index.js +2 -1
  39. package/dist/contracts/owned-ui/model.d.ts +10 -0
  40. package/dist/contracts/owned-ui/session-backend.d.ts +119 -0
  41. package/dist/contracts/owned-ui/session-presenters.d.ts +55 -0
  42. package/dist/contracts/owned-ui/session-presenters.js +1 -0
  43. package/dist/contracts/owned-ui/session-workflows.d.ts +342 -0
  44. package/dist/contracts/owned-ui/session-workflows.js +30 -0
  45. package/dist/contracts/owned-ui/suggestion-diagnostics.d.ts +5 -1
  46. package/dist/contracts/owned-ui/suggestion-diagnostics.js +3 -1
  47. package/dist/contracts/owned-ui/validation.js +7 -0
  48. package/dist/features/launch/index.d.ts +1 -1
  49. package/dist/features/launch/session-context.d.ts +17 -2
  50. package/dist/features/launch/session-context.js +9 -5
  51. package/dist/features/owned-ui/settings-app.js +56 -54
  52. package/dist/features/prompt-suggestions/diagnostics.js +4 -1
  53. package/dist/foundation/lifecycle/index.d.ts +2 -2
  54. package/dist/foundation/lifecycle/index.js +1 -1
  55. package/dist/foundation/lifecycle/session-repository-context.d.ts +19 -2
  56. package/dist/foundation/lifecycle/session-repository-context.js +434 -66
  57. package/dist/foundation/process-containment/index.d.ts +1 -0
  58. package/dist/foundation/process-containment/index.js +1 -0
  59. package/dist/foundation/process-containment/native-process-inspector.d.ts +3 -0
  60. package/dist/foundation/process-containment/native-process-inspector.js +21 -0
  61. package/dist/foundation/release/bootstrap.js +1 -2
  62. package/dist/foundation/release/progress-palette.generated.d.ts +2 -2
  63. package/dist/foundation/release/progress-palette.generated.js +2 -2
  64. package/dist/foundation/release/release-gc.js +1 -1
  65. package/dist/foundation/release/update.js +0 -4
  66. package/dist/foundation/startup/startup-descriptor.js +2 -2
  67. package/dist/foundation/storage/control-store.js +0 -12
  68. package/dist/integrations/pi/components/components.js +2 -18
  69. package/dist/integrations/pi/components/index.d.ts +4 -4
  70. package/dist/integrations/pi/components/index.js +2 -2
  71. package/dist/integrations/pi/components/modal-frame.js +3 -4
  72. package/dist/integrations/pi/components/models-dialog.js +6 -35
  73. package/dist/integrations/pi/components/prompt-input-port.d.ts +1 -0
  74. package/dist/integrations/pi/components/resources/builtin-themes.d.ts +2 -2
  75. package/dist/integrations/pi/components/resources/builtin-themes.js +2 -2
  76. package/dist/integrations/pi/components/share-operation-dialog.js +3 -3
  77. package/dist/integrations/pi/components/shell-editor-autocomplete.js +19 -16
  78. package/dist/integrations/pi/components/shell-extension-ui.d.ts +5 -3
  79. package/dist/integrations/pi/components/shell-extension-ui.js +26 -12
  80. package/dist/integrations/pi/components/shell-hotkey-sections.js +2 -2
  81. package/dist/integrations/pi/components/shell-presenters-info.js +10 -10
  82. package/dist/integrations/pi/components/shell-presenters-transcript.js +13 -13
  83. package/dist/integrations/pi/components/shell-selectors-dialogs.js +5 -6
  84. package/dist/integrations/pi/components/shell-shared-facade.d.ts +21 -1
  85. package/dist/integrations/pi/components/shell-shared-facade.js +19 -3
  86. package/dist/integrations/pi/components/skills-dialog.js +3 -3
  87. package/dist/integrations/pi/components/submitted-prompt-adapter.js +2 -3
  88. package/dist/integrations/pi/components/theme.d.ts +9 -0
  89. package/dist/integrations/pi/components/theme.js +30 -0
  90. package/dist/integrations/pi/components/tool-result-adapter.js +6 -1
  91. package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.d.ts +1 -1
  92. package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.js +1 -1
  93. package/dist/integrations/pi/components/upstream/assets/earendil-image.json +2 -2
  94. package/dist/integrations/pi/components/upstream/components/countdown-timer.d.ts +1 -1
  95. package/dist/integrations/pi/components/upstream/components/earendil-announcement.js +1 -1
  96. package/dist/integrations/pi/components/upstream/components/extension-editor.d.ts +1 -1
  97. package/dist/integrations/pi/components/upstream/components/extension-editor.js +6 -6
  98. package/dist/integrations/pi/components/upstream/components/extension-input.js +4 -4
  99. package/dist/integrations/pi/components/upstream/components/extension-selector.js +4 -4
  100. package/dist/integrations/pi/components/upstream/components/mermaid.js +1 -1
  101. package/dist/integrations/pi/components/upstream/components/owned-editor.d.ts +5 -5
  102. package/dist/integrations/pi/components/upstream/components/owned-editor.js +8 -5
  103. package/dist/integrations/pi/components/upstream/components/pi-logo.js +1 -1
  104. package/dist/integrations/pi/components/upstream/components/scoped-models-selector.d.ts +1 -1
  105. package/dist/integrations/pi/components/upstream/components/scoped-models-selector.js +3 -3
  106. package/dist/integrations/pi/components/upstream/components/session-footer.js +1 -1
  107. package/dist/integrations/pi/components/upstream/components/session-selector-search.js +1 -1
  108. package/dist/integrations/pi/components/upstream/components/session-selector.js +9 -9
  109. package/dist/integrations/pi/components/upstream/components/skill-invocation-message.d.ts +3 -2
  110. package/dist/integrations/pi/components/upstream/components/skill-invocation-message.js +6 -3
  111. package/dist/integrations/pi/components/upstream/components/status-indicator.d.ts +1 -1
  112. package/dist/integrations/pi/components/upstream/components/status-indicator.js +1 -1
  113. package/dist/integrations/pi/components/upstream/components/themed-text.d.ts +1 -1
  114. package/dist/integrations/pi/components/upstream/components/themed-text.js +1 -1
  115. package/dist/integrations/pi/components/upstream/components/thinking-selector.d.ts +1 -1
  116. package/dist/integrations/pi/components/upstream/components/thinking-selector.js +2 -2
  117. package/dist/integrations/pi/components/upstream/components/tool-execution.d.ts +4 -0
  118. package/dist/integrations/pi/components/upstream/components/tool-execution.js +11 -1
  119. package/dist/integrations/pi/components/upstream/components/tree-selector.d.ts +2 -2
  120. package/dist/integrations/pi/components/upstream/components/tree-selector.js +27 -18
  121. package/dist/integrations/pi/components/upstream/components/trust-selector.js +1 -1
  122. package/dist/integrations/pi/components/upstream/external-editor.js +1 -1
  123. package/dist/integrations/pi/components/upstream/history/editor-core.d.ts +4 -4
  124. package/dist/integrations/pi/components/upstream/history/editor-core.js +11 -7
  125. package/dist/integrations/pi/components/upstream/history/kill-ring.d.ts +1 -1
  126. package/dist/integrations/pi/components/upstream/history/kill-ring.js +1 -1
  127. package/dist/integrations/pi/components/upstream/history/printable-key.js +1 -1
  128. package/dist/integrations/pi/components/upstream/history/text-helpers.js +1 -1
  129. package/dist/integrations/pi/components/upstream/history/undo-stack.d.ts +1 -1
  130. package/dist/integrations/pi/components/upstream/history/undo-stack.js +1 -1
  131. package/dist/integrations/pi/components/upstream/history/word-navigation.js +1 -1
  132. package/dist/integrations/pi/components/upstream/model-search.d.ts +1 -1
  133. package/dist/integrations/pi/components/upstream/program-status-reporter.d.ts +31 -0
  134. package/dist/integrations/pi/components/upstream/program-status-reporter.js +89 -0
  135. package/dist/integrations/pi/components/upstream/theme/theme-controller.d.ts +1 -1
  136. package/dist/integrations/pi/components/upstream/theme/theme.d.ts +22 -1
  137. package/dist/integrations/pi/components/upstream/theme/theme.js +225 -10
  138. package/dist/integrations/pi/engine/adapter.d.ts +44 -24
  139. package/dist/integrations/pi/engine/adapter.js +130 -22
  140. package/dist/integrations/pi/engine/command-dispatch.d.ts +2 -5
  141. package/dist/integrations/pi/engine/extension-ui-binding.d.ts +2 -11
  142. package/dist/integrations/pi/engine/host-ports.d.ts +20 -0
  143. package/dist/integrations/pi/engine/host-ports.js +13 -0
  144. package/dist/integrations/pi/engine/host.d.ts +70 -0
  145. package/dist/integrations/pi/engine/host.js +147 -0
  146. package/dist/integrations/pi/engine/index.d.ts +8 -4
  147. package/dist/integrations/pi/engine/index.js +3 -1
  148. package/dist/integrations/pi/engine/pi-settings-metadata.json +1 -1
  149. package/dist/integrations/pi/engine/resource-catalog.d.ts +4 -23
  150. package/dist/integrations/pi/engine/resources/changelog.json +4 -4
  151. package/dist/integrations/pi/engine/runtime-integration.d.ts +8 -2
  152. package/dist/integrations/pi/engine/runtime-integration.js +12 -7
  153. package/dist/integrations/pi/engine/session-events.js +10 -2
  154. package/dist/integrations/pi/engine/session-integration.d.ts +3 -8
  155. package/dist/integrations/pi/engine/session-integration.js +0 -49
  156. package/dist/integrations/pi/engine/session-runtime.d.ts +18 -3
  157. package/dist/integrations/pi/engine/session-runtime.js +18 -7
  158. package/dist/integrations/pi/engine/settings-bridge.d.ts +2 -2
  159. package/dist/integrations/pi/engine/settings-bridge.js +0 -2
  160. package/dist/integrations/pi/engine/settings-port.d.ts +2 -0
  161. package/dist/integrations/pi/engine/settings-port.js +3 -5
  162. package/dist/integrations/pi/engine/transcript-projection.js +2 -1
  163. package/dist/integrations/pi/engine/workflows.d.ts +33 -260
  164. package/dist/integrations/pi/engine/workflows.js +6 -28
  165. package/dist/integrations/pi/session-presenters/index.d.ts +2 -0
  166. package/dist/integrations/pi/session-presenters/index.js +1 -0
  167. package/dist/integrations/pi/session-presenters/presenters.d.ts +16 -0
  168. package/dist/integrations/pi/session-presenters/presenters.js +341 -0
  169. package/dist/integrations/pi/startup-public.js +306 -290
  170. package/dist/integrations/pi/startup-public.manifest.json +289 -265
  171. package/dist/integrations/pi/tui-runtime/adapter.d.ts +2 -1
  172. package/dist/integrations/pi/tui-runtime/adapter.js +7 -2
  173. package/dist/integrations/pi/tui-runtime/contracts.d.ts +3 -1
  174. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +8 -1
  175. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.js +67 -2
  176. package/dist/integrations/pi/tui-runtime/index.d.ts +1 -1
  177. package/dist/integrations/pi/tui-runtime/index.js +1 -1
  178. package/dist/native/darwin-arm64/manifest.json +1 -1
  179. package/dist/native/linux-x64/manifest.json +1 -1
  180. package/dist/native/win32-x64/manifest.json +2 -2
  181. package/dist/native/win32-x64/process-guardian.exe +0 -0
  182. package/dist/product-identity.d.ts +2 -2
  183. package/dist/product-identity.js +2 -2
  184. package/dist/product-identity.json +3 -1
  185. package/dist/runtime-payload-inventory.json +3092 -2878
  186. package/dist/ui/components/prompt-input.d.ts +2 -0
  187. package/dist/ui/components/prompt-input.js +5 -1
  188. package/dist/ui/components/text-selection.d.ts +1 -1
  189. package/dist/ui/components/text-selection.js +3 -1
  190. package/dist/ui/components/theme.d.ts +2 -0
  191. package/dist/ui/components/transcript-viewport.d.ts +6 -4
  192. package/dist/ui/components/transcript-viewport.js +94 -16
  193. package/dist/ui/components/value-menu.d.ts +2 -0
  194. package/dist/ui/components/value-menu.js +13 -8
  195. package/dist/ui/settings/declarations.d.ts +38 -14
  196. package/dist/ui/settings/declarations.js +35 -11
  197. package/dist/ui/settings/migrations.js +23 -0
  198. package/docs/architecture/boundaries.md +9 -1
  199. package/docs/architecture/project-structure.md +7 -5
  200. package/docs/architecture/prompt-suggestions.md +14 -10
  201. package/docs/local-worktree-cleanup.md +11 -5
  202. package/docs/openspec-archive-automation.md +6 -5
  203. package/package.json +3 -3
  204. package/dist/contracts/agent-engine/model.d.ts +0 -78
  205. package/dist/contracts/agent-engine/model.js +0 -1
  206. package/dist/contracts/agent-engine/ports.d.ts +0 -18
  207. package/dist/contracts/agent-engine/serialization.d.ts +0 -7
  208. package/dist/contracts/agent-engine/serialization.js +0 -58
  209. package/dist/contracts/agent-engine/validation.d.ts +0 -5
  210. package/dist/contracts/agent-engine/validation.js +0 -128
  211. package/dist/integrations/pi/components/upstream/theme/system-theme.d.ts +0 -61
  212. package/dist/integrations/pi/components/upstream/theme/system-theme.js +0 -709
  213. /package/dist/contracts/{agent-engine/ports.js → owned-ui/session-backend.js} +0 -0
@@ -1,24 +1,4 @@
1
- import type { AgentJsonValue, AgentModelDescriptor, AgentSettingChangeOutcome, AgentResourceDescriptor, AgentSettingDescriptor } from "./domain.js";
2
- export interface AgentModelPort {
3
- readonly capabilities: {
4
- readonly selection: boolean;
5
- readonly refresh: boolean;
6
- readonly scopedCatalog: boolean;
7
- };
8
- listModels(scope?: string): Promise<readonly AgentModelDescriptor[]>;
9
- currentModel(): Promise<AgentModelDescriptor | null>;
10
- selectModel?(providerId: string, modelId: string): Promise<void>;
11
- refreshModels?(): Promise<void>;
12
- }
13
- export interface AgentAuthenticationPort {
14
- readonly capabilities: {
15
- readonly login: boolean;
16
- readonly logout: boolean;
17
- };
18
- status(providerId: string): Promise<"authenticated" | "unauthenticated" | "unavailable">;
19
- login?(providerId: string, signal?: AbortSignal): Promise<void>;
20
- logout?(providerId: string): Promise<void>;
21
- }
1
+ import type { AgentJsonValue, AgentSettingChangeOutcome, AgentSettingDescriptor } from "./domain.js";
22
2
  export interface AgentSettingsPort {
23
3
  readonly capabilities: {
24
4
  readonly write: boolean;
@@ -29,67 +9,3 @@ export interface AgentSettingsPort {
29
9
  writeSetting?(key: string, value: AgentJsonValue): Promise<AgentSettingChangeOutcome>;
30
10
  flush?(): Promise<void>;
31
11
  }
32
- export interface AgentResourcesPort {
33
- readonly capabilities: {
34
- readonly reload: boolean;
35
- readonly extensionBinding: boolean;
36
- };
37
- discoverResources(): Promise<readonly AgentResourceDescriptor[]>;
38
- reload?(): Promise<void>;
39
- bindExtensions?(sessionId: string): Promise<AgentExtensionBinding>;
40
- }
41
- export interface AgentExtensionBinding {
42
- readonly sessionId: string;
43
- dispose(): Promise<void>;
44
- }
45
- export interface AgentExtensionCommand {
46
- readonly name: string;
47
- readonly description: string;
48
- }
49
- export interface AgentSessionMetadata {
50
- readonly sessionId: string;
51
- readonly sessionName: string | null;
52
- readonly sessionPath: string | null;
53
- readonly cwd: string;
54
- }
55
- export interface AgentExtensionFailure {
56
- readonly extensionPath: string | null;
57
- readonly operation: string;
58
- readonly message: string;
59
- readonly recoverable: boolean;
60
- }
61
- export interface AgentExtensionPort {
62
- readonly capabilities: {
63
- readonly reload: boolean;
64
- readonly binding: boolean;
65
- readonly renderers: boolean;
66
- };
67
- discoverCommands(): Promise<readonly AgentExtensionCommand[]>;
68
- sessionMetadata(): Promise<AgentSessionMetadata>;
69
- bind?(sessionId: string): Promise<AgentExtensionBinding>;
70
- reload?(): Promise<void>;
71
- resolveMessageRenderer?(customType: string): unknown;
72
- resolveToolRenderer?(toolName: string): unknown;
73
- subscribeFailures(listener: (failure: AgentExtensionFailure) => void): () => void;
74
- }
75
- export interface AgentWorkflowDescriptor {
76
- readonly id: string;
77
- readonly label: string;
78
- readonly requiredCommands: readonly string[];
79
- }
80
- export interface AgentWorkflowPort {
81
- readonly capabilities: {
82
- readonly execute: boolean;
83
- };
84
- listWorkflows(): Promise<readonly AgentWorkflowDescriptor[]>;
85
- executeWorkflow?(workflowId: string, input: AgentJsonValue, signal?: AbortSignal): Promise<AgentJsonValue>;
86
- }
87
- export interface AgentServicePorts {
88
- readonly models: AgentModelPort;
89
- readonly authentication: AgentAuthenticationPort;
90
- readonly settings: AgentSettingsPort;
91
- readonly resources: AgentResourcesPort;
92
- readonly extensions: AgentExtensionPort;
93
- readonly workflows: AgentWorkflowPort;
94
- }
95
- export declare function assertAgentServicePorts(ports: AgentServicePorts): void;
@@ -1,35 +1 @@
1
- export function assertAgentServicePorts(ports) {
2
- required(ports.models, ["listModels", "currentModel"], "model");
3
- advertised(ports.models, "selection", "selectModel", "model");
4
- advertised(ports.models, "refresh", "refreshModels", "model");
5
- required(ports.authentication, ["status"], "authentication");
6
- advertised(ports.authentication, "login", "login", "authentication");
7
- advertised(ports.authentication, "logout", "logout", "authentication");
8
- required(ports.settings, ["listSettings", "readSetting"], "settings");
9
- advertised(ports.settings, "write", "writeSetting", "settings");
10
- advertised(ports.settings, "flush", "flush", "settings");
11
- required(ports.resources, ["discoverResources"], "resources");
12
- advertised(ports.resources, "reload", "reload", "resources");
13
- advertised(ports.resources, "extensionBinding", "bindExtensions", "resources");
14
- required(ports.extensions, ["discoverCommands", "sessionMetadata", "subscribeFailures"], "extensions");
15
- advertised(ports.extensions, "reload", "reload", "extensions");
16
- advertised(ports.extensions, "binding", "bind", "extensions");
17
- advertised(ports.extensions, "renderers", "resolveMessageRenderer", "extensions");
18
- advertised(ports.extensions, "renderers", "resolveToolRenderer", "extensions");
19
- required(ports.workflows, ["listWorkflows"], "workflow");
20
- advertised(ports.workflows, "execute", "executeWorkflow", "workflow");
21
- }
22
- function required(port, operations, label) {
23
- if (!port || typeof port.capabilities !== "object")
24
- throw new TypeError(`${label} port and capabilities are required`);
25
- for (const operation of operations)
26
- if (typeof port[operation] !== "function")
27
- throw new TypeError(`${label} port requires ${operation}`);
28
- }
29
- function advertised(port, capability, operation, label) {
30
- const enabled = port.capabilities[capability];
31
- if (typeof enabled !== "boolean")
32
- throw new TypeError(`${label} capability ${capability} must be explicit`);
33
- if (enabled && typeof port[operation] !== "function")
34
- throw new TypeError(`${label} capability ${capability} requires ${operation}`);
35
- }
1
+ export {};
@@ -1,11 +1,5 @@
1
- export { assertAgentServicePorts } from "./capability-ports.js";
2
- export type { AgentAuthenticationPort, AgentExtensionBinding, AgentExtensionCommand, AgentExtensionFailure, AgentExtensionPort, AgentModelPort, AgentResourcesPort, AgentServicePorts, AgentSessionMetadata, AgentSettingsPort, AgentWorkflowDescriptor, AgentWorkflowPort, } from "./capability-ports.js";
1
+ export type { AgentSettingsPort } from "./capability-ports.js";
3
2
  export type { AgentDomainCapabilities, AgentFailure, AgentFailureCategory, AgentJsonValue, AgentMessage, AgentMessageContent, AgentModelDescriptor, AgentResourceDescriptor, AgentSettingApplicationBoundary, AgentSettingChangeOutcome, AgentSettingDescriptor, AgentSettingFlag, AgentSettingOwner, AgentThemeDescriptor, AgentToolDescriptor, AgentUiContribution, AgentUsage, } from "./domain.js";
4
3
  export { assertAgentDomainCapabilities, assertAgentFailure, assertAgentMessage, assertAgentMessageContent, assertAgentModelDescriptor, assertAgentResourceDescriptor, assertAgentSettingDescriptor, assertAgentThemeDescriptor, assertAgentToolDescriptor, assertAgentUiContribution, assertAgentUsage, } from "./domain-validation.js";
5
- export { AGENT_ENGINE_CONTRACT_VERSION } from "./model.js";
6
- export type { AgentCapabilityContract, AgentCommand, AgentCommandCapability, AgentCommandId, AgentCommandOutcome, AgentEvent, AgentEventCapability, AgentEventSequence, AgentSessionId, AgentSessionLifecycle, AgentSnapshot, } from "./model.js";
7
4
  export { agentPackageOutcome, assertAgentPackagesPort } from "./package-ports.js";
8
5
  export type { AgentPackageDescriptor, AgentPackageDiagnostic, AgentPackageOperation, AgentPackageOutcome, AgentPackageProgress, AgentPackageStatus, AgentPackagesPort, AgentPackagesPortInput, } from "./package-ports.js";
9
- export type { AgentEnginePort, AgentSessionPort } from "./ports.js";
10
- export { assertAgentCapabilityContract, assertAgentCommand, assertAgentEvent, assertAgentSnapshot } from "./validation.js";
11
- export { decodeAgentCommand, decodeAgentEvent, decodeAgentSnapshot, encodeAgentCommand, encodeAgentEvent, encodeAgentSnapshot } from "./serialization.js";
@@ -1,6 +1,2 @@
1
- export { assertAgentServicePorts } from "./capability-ports.js";
2
1
  export { assertAgentDomainCapabilities, assertAgentFailure, assertAgentMessage, assertAgentMessageContent, assertAgentModelDescriptor, assertAgentResourceDescriptor, assertAgentSettingDescriptor, assertAgentThemeDescriptor, assertAgentToolDescriptor, assertAgentUiContribution, assertAgentUsage, } from "./domain-validation.js";
3
- export { AGENT_ENGINE_CONTRACT_VERSION } from "./model.js";
4
2
  export { agentPackageOutcome, assertAgentPackagesPort } from "./package-ports.js";
5
- export { assertAgentCapabilityContract, assertAgentCommand, assertAgentEvent, assertAgentSnapshot } from "./validation.js";
6
- export { decodeAgentCommand, decodeAgentEvent, decodeAgentSnapshot, encodeAgentCommand, encodeAgentEvent, encodeAgentSnapshot } from "./serialization.js";
@@ -1,14 +1,20 @@
1
+ /** Stable stored choices for bare A1's semantic UI accent. */
2
+ export type UiAccentColor = "purple" | "blue" | "cyan" | "green" | "orange" | "pink";
1
3
  export { OWNED_UI_EXTENSION_CONTRACT_VERSION, OWNED_UI_EXTENSION_RENDER_CALLBACKS, OWNED_UI_EXTENSION_UI_CALLBACKS, OWNED_UI_EXTENSION_UI_PROPERTIES, assertOwnedUiExtensionUiPort, } from "./extension-ui.js";
2
4
  export type { OwnedUiExtensionAutocompleteItem, OwnedUiExtensionAutocompleteProvider, OwnedUiExtensionAutocompleteProviderFactory, OwnedUiExtensionAutocompleteSuggestions, OwnedUiExtensionComponent, OwnedUiExtensionComponentFactory, OwnedUiExtensionComponentFactoryContext, OwnedUiExtensionCustomFactory, OwnedUiExtensionCustomOptions, OwnedUiExtensionDialogOptions, OwnedUiExtensionEditorComponent, OwnedUiExtensionEditorFactory, OwnedUiExtensionEditorThemePort, OwnedUiExtensionEntryRenderInput, OwnedUiExtensionFooterDataPort, OwnedUiExtensionFooterFactory, OwnedUiExtensionInputListener, OwnedUiExtensionKeybindingsPort, OwnedUiExtensionMessageRenderInput, OwnedUiExtensionNotificationSeverity, OwnedUiExtensionOverlayAnchor, OwnedUiExtensionOverlayHandle, OwnedUiExtensionOverlayMargin, OwnedUiExtensionOverlayOptions, OwnedUiExtensionRenderCallback, OwnedUiExtensionRendererPort, OwnedUiExtensionRuntimePort, OwnedUiExtensionSelectListThemePort, OwnedUiExtensionSizeValue, OwnedUiExtensionTerminalPort, OwnedUiExtensionThemeBackground, OwnedUiExtensionThemeColor, OwnedUiExtensionThemeInfo, OwnedUiExtensionThemePort, OwnedUiExtensionToolRenderContext, OwnedUiExtensionUiCallback, OwnedUiExtensionUiPort, OwnedUiExtensionUiProperty, OwnedUiExtensionWidgetOptions, OwnedUiExtensionWidgetPlacement, OwnedUiExtensionWorkingIndicatorOptions, } from "./extension-ui.js";
3
5
  export { OWNED_UI_CONTRACT_VERSION } from "./model.js";
4
- export type { OwnedUiBlockStatus, OwnedUiCommand, OwnedUiCommandOutcome, OwnedUiCorrelationId, OwnedUiCustomization, OwnedUiDiagnostics, OwnedUiDialog, OwnedUiEditorState, OwnedUiEntityId, OwnedUiEvent, OwnedUiFooterView, OwnedUiImageAttachment, OwnedUiLifecycle, OwnedUiModelInfo, OwnedUiOverlay, OwnedUiPromptSuggestionGeneratorPort, OwnedUiPromptSuggestionIdentity, OwnedUiPromptSuggestionReasoning, OwnedUiPromptSuggestionRequest, OwnedUiPromptSuggestionResult, OwnedUiPromptSuggestionState, OwnedUiQuitOutroSettings, OwnedUiQuitOutroSettingsPort, OwnedUiSessionId, OwnedUiSessionViewModel, OwnedUiSeverity, OwnedUiSlotId, OwnedUiSnapshot, OwnedUiStatusView, OwnedUiTerminalSurface, OwnedUiThinkingLevel, OwnedUiToolRendering, OwnedUiToolResultPart, OwnedUiToolState, OwnedUiTranscriptBlock, OwnedUiTranscriptBlockKind, OwnedUiTranscriptImageReference, OwnedUiUsageView, OwnedUiViewportSettings, OwnedUiViewportSettingsPort, } from "./model.js";
6
+ export type { OwnedUiBackgroundSettingsPort, OwnedUiBackgroundStyle, OwnedUiBlockStatus, OwnedUiCommand, OwnedUiCommandOutcome, OwnedUiCorrelationId, OwnedUiCustomization, OwnedUiDiagnostics, OwnedUiDialog, OwnedUiEditorState, OwnedUiEntityId, OwnedUiEvent, OwnedUiFooterView, OwnedUiImageAttachment, OwnedUiLifecycle, OwnedUiModelInfo, OwnedUiOverlay, OwnedUiPromptSuggestionGeneratorPort, OwnedUiPromptSuggestionIdentity, OwnedUiPromptSuggestionReasoning, OwnedUiPromptSuggestionRequest, OwnedUiPromptSuggestionResult, OwnedUiPromptSuggestionState, OwnedUiQuitOutroSettings, OwnedUiQuitOutroSettingsPort, OwnedUiSessionId, OwnedUiSessionViewModel, OwnedUiSeverity, OwnedUiSlotId, OwnedUiSnapshot, OwnedUiStatusView, OwnedUiTerminalSurface, OwnedUiThinkingLevel, OwnedUiToolRendering, OwnedUiToolResultPart, OwnedUiToolState, OwnedUiTranscriptBlock, OwnedUiTranscriptBlockKind, OwnedUiTranscriptImageReference, OwnedUiUsageView, OwnedUiViewportSettings, OwnedUiViewportSettingsPort, } from "./model.js";
7
+ export type { OwnedUiExtensionPort, OwnedUiSessionBackend, OwnedUiSessionCatalogPort, OwnedUiSessionFactory, OwnedUiSessionIdentityPort, OwnedUiSessionPort, OwnedUiSessionRequest, OwnedUiSessionSettingsPort, OwnedUiWorkflowPort, } from "./session-backend.js";
8
+ export type { OwnedUiDialogHost, OwnedUiInputSurface, OwnedUiSessionPresenters, OwnedUiShortcutDescription, OwnedUiTranscriptRendererPort, } from "./session-presenters.js";
9
+ export { OWNED_UI_HIDDEN_COMMAND_NAMES, OWNED_UI_MODELS_COMMAND_NAME, OWNED_UI_WORKFLOW_COMMAND_NAMES, } from "./session-workflows.js";
10
+ export type { OwnedUiAmbientAuthentication, OwnedUiAuthenticationProviderOption, OwnedUiAuthenticationProviderStatus, OwnedUiBashWorkflowResult, OwnedUiCacheWarmingPresentation, OwnedUiCommandResult, OwnedUiExtensionResourceSummary, OwnedUiExtensionSourceSummary, OwnedUiHiddenWorkflowCommandName, OwnedUiJsonValue, OwnedUiModelsCommandName, OwnedUiModelsContext, OwnedUiModelsRefreshResult, OwnedUiProjectTrustContext, OwnedUiProjectTrustUpdate, OwnedUiReleaseUpdate, OwnedUiResourceSummary, OwnedUiScopedModelDescriptor, OwnedUiScopedModelsContext, OwnedUiScopedModelsRefreshResult, OwnedUiSessionInfoPresentation, OwnedUiSessionProductMode, OwnedUiSessionResumeMetadata, OwnedUiSessionSettingKey, OwnedUiSessionSettingsSnapshot, OwnedUiSettingEffectHandler, OwnedUiSettingOwner, OwnedUiSettingOwnerHandlers, OwnedUiSettingsThinkingLevel, OwnedUiVisualExtensionSupport, OwnedUiWorkflowAutocompleteCommand, OwnedUiWorkflowCommandName, OwnedUiWorkflowInteractionHost, OwnedUiWorkflowInteractionRequest, OwnedUiWorkflowLoginNotification, OwnedUiWorkflowLoginStart, OwnedUiWorkflowMessage, OwnedUiWorkflowMessageKind, OwnedUiWorkflowOption, OwnedUiWorkflowOutcome, OwnedUiWorkflowPresentation, OwnedUiWorkflowRequest, OwnedUiWorkflowResult, OwnedUiWorkflowRoute, } from "./session-workflows.js";
5
11
  export { acceptsTranscriptUpdate, transcriptToolState } from "./transcript-lifecycle.js";
6
12
  export { DEFAULT_PROMPT_IMAGE_LIMIT, ImageAttachmentError, MAX_CLIPBOARD_TEXT_BYTES, MAX_IMAGE_DATA_BYTES, MAX_PROMPT_IMAGES, assertImageEncodedSize, assertPromptImages, } from "./image-attachments.js";
7
13
  export { CONTEXTUAL_PROMPT_SUGGESTION_INSTRUCTION, normalizePromptSuggestionCandidate } from "./prompt-suggestions.js";
8
14
  export { canonicalPromptChipMatches, protectPromptChipWrapping, replaceCanonicalPromptChips } from "./prompt-chips.js";
9
15
  export type { PromptChipTextMatch, PromptChipWrapProtection } from "./prompt-chips.js";
10
- export { SUGGESTION_DECISION_REASONS, SUGGESTION_DIAGNOSTIC_EVENTS } from "./suggestion-diagnostics.js";
11
- export type { SuggestionDecision, SuggestionDecisionReason, SuggestionDiagnosticEvent, SuggestionDiagnosticObserver, SuggestionDiagnosticRecord, } from "./suggestion-diagnostics.js";
16
+ export { SUGGESTION_ATTEMPT_TRIGGERS, SUGGESTION_DECISION_REASONS, SUGGESTION_DIAGNOSTIC_EVENTS } from "./suggestion-diagnostics.js";
17
+ export type { SuggestionAttemptTrigger, SuggestionDecision, SuggestionDecisionReason, SuggestionDiagnosticEvent, SuggestionDiagnosticObserver, SuggestionDiagnosticRecord, } from "./suggestion-diagnostics.js";
12
18
  export { PROMPT_HISTORY_EDITOR_REPLACEMENT, PROMPT_HISTORY_MAX_ENTRY_BYTES, PROMPT_HISTORY_MAX_PENDING, PROMPT_HISTORY_MAX_TEXT_BYTES, assertPromptHistorySubmission, } from "./prompt-history.js";
13
19
  export type { PromptHistoryFailure, PromptHistoryImageSidecarAttachment, PromptHistoryImageSidecarPort, PromptHistoryImageSidecarRecord, PromptHistoryKind, PromptHistoryPort, PromptHistoryResult, PromptHistorySnapshot, PromptHistorySubmission, } from "./prompt-history.js";
14
20
  export { assertOwnedUiCommand, assertOwnedUiCustomization, assertOwnedUiDiagnostics, assertOwnedUiEditorState, assertOwnedUiEvent, assertOwnedUiPromptSuggestionIdentity, assertOwnedUiPromptSuggestionRequest, assertOwnedUiPromptSuggestionResult, assertOwnedUiPromptSuggestionState, assertOwnedUiSessionViewModel, assertOwnedUiSnapshot, assertOwnedUiStatusView, assertOwnedUiTerminalSurface, assertOwnedUiTranscriptBlock, } from "./validation.js";
@@ -1,9 +1,10 @@
1
1
  export { OWNED_UI_EXTENSION_CONTRACT_VERSION, OWNED_UI_EXTENSION_RENDER_CALLBACKS, OWNED_UI_EXTENSION_UI_CALLBACKS, OWNED_UI_EXTENSION_UI_PROPERTIES, assertOwnedUiExtensionUiPort, } from "./extension-ui.js";
2
2
  export { OWNED_UI_CONTRACT_VERSION } from "./model.js";
3
+ export { OWNED_UI_HIDDEN_COMMAND_NAMES, OWNED_UI_MODELS_COMMAND_NAME, OWNED_UI_WORKFLOW_COMMAND_NAMES, } from "./session-workflows.js";
3
4
  export { acceptsTranscriptUpdate, transcriptToolState } from "./transcript-lifecycle.js";
4
5
  export { DEFAULT_PROMPT_IMAGE_LIMIT, ImageAttachmentError, MAX_CLIPBOARD_TEXT_BYTES, MAX_IMAGE_DATA_BYTES, MAX_PROMPT_IMAGES, assertImageEncodedSize, assertPromptImages, } from "./image-attachments.js";
5
6
  export { CONTEXTUAL_PROMPT_SUGGESTION_INSTRUCTION, normalizePromptSuggestionCandidate } from "./prompt-suggestions.js";
6
7
  export { canonicalPromptChipMatches, protectPromptChipWrapping, replaceCanonicalPromptChips } from "./prompt-chips.js";
7
- export { SUGGESTION_DECISION_REASONS, SUGGESTION_DIAGNOSTIC_EVENTS } from "./suggestion-diagnostics.js";
8
+ export { SUGGESTION_ATTEMPT_TRIGGERS, SUGGESTION_DECISION_REASONS, SUGGESTION_DIAGNOSTIC_EVENTS } from "./suggestion-diagnostics.js";
8
9
  export { PROMPT_HISTORY_EDITOR_REPLACEMENT, PROMPT_HISTORY_MAX_ENTRY_BYTES, PROMPT_HISTORY_MAX_PENDING, PROMPT_HISTORY_MAX_TEXT_BYTES, assertPromptHistorySubmission, } from "./prompt-history.js";
9
10
  export { assertOwnedUiCommand, assertOwnedUiCustomization, assertOwnedUiDiagnostics, assertOwnedUiEditorState, assertOwnedUiEvent, assertOwnedUiPromptSuggestionIdentity, assertOwnedUiPromptSuggestionRequest, assertOwnedUiPromptSuggestionResult, assertOwnedUiPromptSuggestionState, assertOwnedUiSessionViewModel, assertOwnedUiSnapshot, assertOwnedUiStatusView, assertOwnedUiTerminalSurface, assertOwnedUiTranscriptBlock, } from "./validation.js";
@@ -64,6 +64,12 @@ export interface OwnedUiViewportSettingsPort {
64
64
  snapshot(): OwnedUiViewportSettings;
65
65
  onChange(listener: (settings: OwnedUiViewportSettings) => void): () => void;
66
66
  }
67
+ export type OwnedUiBackgroundStyle = "transparent" | "accent" | "dark";
68
+ /** Narrow live canvas setting supplied only to the bare-A1 fullscreen presentation. */
69
+ export interface OwnedUiBackgroundSettingsPort {
70
+ snapshot(): OwnedUiBackgroundStyle;
71
+ onChange(listener: (style: OwnedUiBackgroundStyle) => void): () => void;
72
+ }
67
73
  /** Profile-local quit outro choice, read at the moment bare A1 quits. */
68
74
  export interface OwnedUiQuitOutroSettings {
69
75
  /** False leaves the terminal immediately; true plays the shell's fixed effect. */
@@ -336,6 +342,10 @@ export type OwnedUiEvent = {
336
342
  readonly model: OwnedUiModelInfo | null;
337
343
  readonly assistantMessageCount: number;
338
344
  readonly successful: boolean;
345
+ readonly stopReason: string | null;
346
+ readonly toolContinuation: boolean;
347
+ /** Pi 1.1 distinguishes user cancellation from an ordinary or failed settlement. */
348
+ readonly aborted: boolean;
339
349
  } | {
340
350
  readonly type: "editor-state";
341
351
  readonly sessionId: OwnedUiSessionId;
@@ -0,0 +1,119 @@
1
+ /**
2
+ * The session backend the owned shell presents. The shell and composition depend on this port,
3
+ * never on an engine adapter class, so a per-tab or non-Pi backend can stand behind the shell.
4
+ */
5
+ import type { OwnedUiExtensionUiPort } from "./extension-ui.js";
6
+ import type { OwnedUiCommand, OwnedUiEvent, OwnedUiImageAttachment, OwnedUiSessionViewModel, OwnedUiSnapshot } from "./model.js";
7
+ import type { OwnedUiAmbientAuthentication, OwnedUiAuthenticationProviderOption, OwnedUiBashWorkflowResult, OwnedUiCommandResult, OwnedUiExtensionResourceSummary, OwnedUiModelsContext, OwnedUiModelsRefreshResult, OwnedUiProjectTrustContext, OwnedUiProjectTrustUpdate, OwnedUiReleaseUpdate, OwnedUiResourceSummary, OwnedUiScopedModelsContext, OwnedUiScopedModelsRefreshResult, OwnedUiSessionProductMode, OwnedUiSessionResumeMetadata, OwnedUiSessionSettingsSnapshot, OwnedUiSettingOwner, OwnedUiSettingOwnerHandlers, OwnedUiSettingsThinkingLevel, OwnedUiVisualExtensionSupport, OwnedUiWorkflowAutocompleteCommand, OwnedUiWorkflowInteractionHost, OwnedUiWorkflowOption, OwnedUiWorkflowRequest, OwnedUiWorkflowResult } from "./session-workflows.js";
8
+ export interface OwnedUiSessionBackend {
9
+ readonly identity: OwnedUiSessionIdentityPort;
10
+ readonly session: OwnedUiSessionPort;
11
+ readonly workflows: OwnedUiWorkflowPort;
12
+ readonly settings: OwnedUiSessionSettingsPort;
13
+ readonly catalog: OwnedUiSessionCatalogPort;
14
+ readonly extensions: OwnedUiExtensionPort;
15
+ }
16
+ /** What a caller states about the session it wants; everything process-wide stays with the factory. */
17
+ export interface OwnedUiSessionRequest {
18
+ /** Unique within the process. Omitted means the factory assigns one that is. */
19
+ readonly sessionId?: string;
20
+ readonly cwd: string;
21
+ }
22
+ /**
23
+ * The one place sessions come from. The factory owns the state that is process-wide, so two
24
+ * sessions in one process never install, announce, or trace the same thing twice.
25
+ */
26
+ export interface OwnedUiSessionFactory {
27
+ create(request: OwnedUiSessionRequest): Promise<OwnedUiSessionBackend>;
28
+ }
29
+ /** Which session this is, where it lives, and how often it has been replaced. */
30
+ export interface OwnedUiSessionIdentityPort {
31
+ readonly sessionId: string;
32
+ readonly agentDir: string;
33
+ readonly cwd: string;
34
+ /** Advances on every session replacement and on delivery-only callback invalidation. */
35
+ readonly sessionGeneration: number;
36
+ /** Actual session replacements, excluding delivery-only invalidation of callbacks. */
37
+ readonly sessionBindingGeneration: number;
38
+ readonly disposed: boolean;
39
+ currentSessionResumeMetadata(): OwnedUiSessionResumeMetadata | null;
40
+ }
41
+ /** The session lifecycle, its view, its event stream, and command admission. */
42
+ export interface OwnedUiSessionPort {
43
+ start(): Promise<OwnedUiSessionViewModel>;
44
+ view(): OwnedUiSessionViewModel;
45
+ snapshot(): OwnedUiSnapshot;
46
+ /** Subscribe to events; the listener first receives the current view. Returns the unsubscribe. */
47
+ onEvent(listener: (event: OwnedUiEvent) => void): () => void;
48
+ execute(command: OwnedUiCommand): Promise<OwnedUiCommandResult>;
49
+ /** Settle queued delivery; rejects when required delivery was interrupted. */
50
+ flushEvents(): Promise<void>;
51
+ dispose(): Promise<void>;
52
+ }
53
+ /** Slash-command workflows and the shell-side host their interactive steps call back into. */
54
+ export interface OwnedUiWorkflowPort {
55
+ executeWorkflow(request: OwnedUiWorkflowRequest): Promise<OwnedUiWorkflowResult>;
56
+ executeBashWorkflow(command: string, excludeFromContext: boolean): Promise<OwnedUiBashWorkflowResult>;
57
+ cycleModelWorkflow(direction: "forward" | "backward"): Promise<OwnedUiWorkflowResult>;
58
+ workflowAutocompleteCommands(): readonly OwnedUiWorkflowAutocompleteCommand[];
59
+ /** Clear queued steering and follow-up submissions, returning their texts in order. */
60
+ clearQueuedWorkflows(): readonly string[];
61
+ /** The result a blocked `/reload` reported, or null when reload is available. */
62
+ reloadBlockedResult(): OwnedUiWorkflowResult | null;
63
+ /** Copy through the active clipboard owner; true means acknowledged delivery. */
64
+ copyWorkflowText(text: string): Promise<boolean>;
65
+ setWorkflowInteractionHost(interaction: OwnedUiWorkflowInteractionHost): void;
66
+ }
67
+ /**
68
+ * Engine settings the shell reads and the live effects it installs. Settings writes stay here
69
+ * rather than in `OwnedUiCommand`: commands are admitted per session, and a global default must
70
+ * not be gated by one session's admission or overload state.
71
+ */
72
+ export interface OwnedUiSessionSettingsPort {
73
+ readonly productMode: OwnedUiSessionProductMode;
74
+ snapshot(): OwnedUiSessionSettingsSnapshot;
75
+ /** Bind live effects for one owner; returns the unbind. */
76
+ bindOwner(owner: OwnedUiSettingOwner, handlers: OwnedUiSettingOwnerHandlers): () => void;
77
+ /** Persist the global thinking default without changing the live session level. */
78
+ setDefaultThinkingLevel(level: OwnedUiSettingsThinkingLevel): void;
79
+ /**
80
+ * The theme the engine is configured with, in the engine's own grammar: a theme's name, or a
81
+ * `light/dark` pair meaning "follow the terminal".
82
+ */
83
+ configuredTheme(): string | undefined;
84
+ }
85
+ /** Models, scopes, project trust, and authentication choices. */
86
+ export interface OwnedUiSessionCatalogPort {
87
+ modelsContext(): OwnedUiModelsContext;
88
+ setSessionModelScope(scopeIds: readonly string[]): void;
89
+ persistModelScope(scopeIds: readonly string[]): void;
90
+ refreshModels(signal: AbortSignal): Promise<OwnedUiModelsRefreshResult>;
91
+ pinnedScopedModelsContext(): OwnedUiScopedModelsContext;
92
+ updateScopedModels(enabledModelIds: readonly string[] | null): void;
93
+ persistScopedModels(enabledModelIds: readonly string[] | null): void;
94
+ refreshScopedModels(signal: AbortSignal): Promise<OwnedUiScopedModelsRefreshResult>;
95
+ pinnedProjectTrustContext(): OwnedUiProjectTrustContext;
96
+ persistProjectTrust(updates: readonly OwnedUiProjectTrustUpdate[]): void;
97
+ pinnedLoginOptions(authType?: "oauth" | "api_key"): readonly OwnedUiAuthenticationProviderOption[];
98
+ pinnedLoginMethodOptions(providerReference: string): {
99
+ readonly title: string;
100
+ readonly options: readonly OwnedUiWorkflowOption[];
101
+ };
102
+ pinnedAmbientAuthentication(selection: string): OwnedUiAmbientAuthentication | null;
103
+ pinnedLogoutOptions(): Promise<readonly OwnedUiAuthenticationProviderOption[]>;
104
+ pinnedForkOptions(): readonly OwnedUiWorkflowOption[];
105
+ }
106
+ /** Loaded resources, the extension UI bridge, transcript images, and clipboard binding. */
107
+ export interface OwnedUiExtensionPort {
108
+ nonVisualResources(): readonly OwnedUiResourceSummary[];
109
+ extensionResources(): readonly OwnedUiExtensionResourceSummary[];
110
+ resolveTranscriptImage(assetId: string): OwnedUiImageAttachment | null;
111
+ visualExtensionSupport(): OwnedUiVisualExtensionSupport;
112
+ /** Attach the shell's extension UI and bind it to the current session. */
113
+ bindExtensionUi(ui: OwnedUiExtensionUiPort, shutdown?: () => void | Promise<void>): Promise<void>;
114
+ unbindExtensionUi(): Promise<void>;
115
+ /** Bind the owned UI's clipboard lifecycle; true from the writer means acknowledged delivery. Returns the unbind. */
116
+ bindClipboardWriter(writer: (text: string) => Promise<boolean>): () => void;
117
+ /** Report a newer release found by the startup check. */
118
+ announceReleaseUpdate(release: OwnedUiReleaseUpdate): void;
119
+ }
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Presenters for the selectors and transcript renderers whose inputs are engine objects. The shell opens them
3
+ * through this port and never holds those objects; the Pi session presenters owner implements it.
4
+ */
5
+ import type { OwnedUiCommandResult, OwnedUiWorkflowRequest, OwnedUiWorkflowResult } from "./session-workflows.js";
6
+ /** A component that replaces the prompt editor while a selector is open. */
7
+ export interface OwnedUiInputSurface {
8
+ render(width: number): readonly string[];
9
+ invalidate(): void;
10
+ handleInput?(data: string): void;
11
+ setFocused?(focused: boolean): void;
12
+ dispose?(): void;
13
+ }
14
+ /** The shell's side of a presenter: where the selector is shown and how its choices reach the session. */
15
+ export interface OwnedUiDialogHost {
16
+ /** True once the shell is disposed; a presenter that awaited stops before showing anything. */
17
+ readonly disposed: boolean;
18
+ setInputSurface(surface: OwnedUiInputSurface | null): void;
19
+ requestRender(): void;
20
+ viewport(): {
21
+ readonly columns: number;
22
+ readonly rows: number;
23
+ };
24
+ appendWorkflowStatus(text: string): void;
25
+ appendWorkflowResult(result: OwnedUiWorkflowResult): void;
26
+ runWorkflow(request: OwnedUiWorkflowRequest): Promise<OwnedUiCommandResult>;
27
+ /** Present only where the shell holds frames while an optional selector module loads. */
28
+ beginPresentationHold?(): () => void;
29
+ /** Present only where the surface can change TUI mode; false means overlays block the switch. */
30
+ switchTuiMode?(mode: "regular" | "fullscreen"): boolean;
31
+ }
32
+ /** One extension shortcut row in the hotkeys document. */
33
+ export interface OwnedUiShortcutDescription {
34
+ readonly key: string;
35
+ readonly description: string;
36
+ }
37
+ /**
38
+ * Extension renderer lookups for transcript components. Renderers are opaque objects that only the component
39
+ * adapter inspects and validates; the shell passes this port through without reading them.
40
+ */
41
+ export interface OwnedUiTranscriptRendererPort {
42
+ getMessageRenderer(customType: string): object | undefined;
43
+ getToolRenderers(toolName: string): object | undefined;
44
+ getShortcuts(bindings: Readonly<Record<string, string | readonly string[] | undefined>>): readonly OwnedUiShortcutDescription[];
45
+ }
46
+ export interface OwnedUiSessionPresenters {
47
+ transcriptRenderers(): OwnedUiTranscriptRendererPort;
48
+ openModelSelector(host: OwnedUiDialogHost, initialSearchInput?: string): void;
49
+ openSessionSelector(host: OwnedUiDialogHost, onExit: () => void): Promise<void>;
50
+ /** `navigate` completes a selection that leaves the current leaf, including any summary prompt. */
51
+ openTreeSelector(host: OwnedUiDialogHost, navigate: (entryId: string, skipSummaryPrompt: boolean) => void, initialSelectedId?: string): Promise<void>;
52
+ openSettingsSelector(host: OwnedUiDialogHost): void;
53
+ openModelsDialog(host: OwnedUiDialogHost, initialQuery?: string): void;
54
+ openScopedModelsSelector(host: OwnedUiDialogHost): void;
55
+ }
@@ -0,0 +1 @@
1
+ export {};