@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.
- package/bin/cli.js +13 -2
- package/bin/ui.js +13 -0
- package/dist/app/session-shell/clipboard-services.d.ts +19 -0
- package/dist/app/session-shell/clipboard-services.js +7 -0
- package/dist/app/session-shell/exit-notice.d.ts +9 -5
- package/dist/app/session-shell/exit-notice.js +5 -5
- package/dist/app/session-shell/index.d.ts +3 -1
- package/dist/app/session-shell/index.js +1 -0
- package/dist/app/session-shell/paste-preparation-client.d.ts +3 -0
- package/dist/app/session-shell/paste-preparation-client.js +5 -2
- package/dist/app/session-shell/path-chip-presentation.d.ts +10 -3
- package/dist/app/session-shell/path-chip-presentation.js +48 -6
- package/dist/app/session-shell/prompt-chips.js +30 -4
- package/dist/app/session-shell/prompt-suggestion-controller.d.ts +5 -4
- package/dist/app/session-shell/prompt-suggestion-controller.js +148 -58
- package/dist/app/session-shell/quit-outro.d.ts +3 -1
- package/dist/app/session-shell/quit-outro.js +23 -8
- package/dist/app/session-shell/response-copy-transport.d.ts +6 -1
- package/dist/app/session-shell/response-copy-transport.js +8 -2
- package/dist/app/session-shell/session-shell-root.d.ts +22 -11
- package/dist/app/session-shell/session-shell-root.js +19 -12
- package/dist/app/session-shell/session-shell.d.ts +19 -21
- package/dist/app/session-shell/session-shell.js +678 -840
- package/dist/app/session-shell/session-viewport-controller.js +33 -21
- package/dist/cli/dispatch.js +5 -3
- package/dist/cli/session-context.d.ts +5 -1
- package/dist/cli/session-context.js +25 -8
- package/dist/composition/owned-ui.d.ts +23 -2
- package/dist/composition/owned-ui.js +124 -33
- package/dist/composition/session-info-reference.d.ts +2 -2
- package/dist/composition/session-info-reference.js +2 -2
- package/dist/composition/settings-route-host.js +2 -1
- package/dist/contracts/agent-engine/capability-ports.d.ts +1 -85
- package/dist/contracts/agent-engine/capability-ports.js +1 -35
- package/dist/contracts/agent-engine/index.d.ts +1 -7
- package/dist/contracts/agent-engine/index.js +0 -4
- package/dist/contracts/owned-ui/index.d.ts +9 -3
- package/dist/contracts/owned-ui/index.js +2 -1
- package/dist/contracts/owned-ui/model.d.ts +10 -0
- package/dist/contracts/owned-ui/session-backend.d.ts +119 -0
- package/dist/contracts/owned-ui/session-presenters.d.ts +55 -0
- package/dist/contracts/owned-ui/session-presenters.js +1 -0
- package/dist/contracts/owned-ui/session-workflows.d.ts +342 -0
- package/dist/contracts/owned-ui/session-workflows.js +30 -0
- package/dist/contracts/owned-ui/suggestion-diagnostics.d.ts +5 -1
- package/dist/contracts/owned-ui/suggestion-diagnostics.js +3 -1
- package/dist/contracts/owned-ui/validation.js +7 -0
- package/dist/features/launch/index.d.ts +1 -1
- package/dist/features/launch/session-context.d.ts +17 -2
- package/dist/features/launch/session-context.js +9 -5
- package/dist/features/owned-ui/settings-app.js +56 -54
- package/dist/features/prompt-suggestions/diagnostics.js +4 -1
- package/dist/foundation/lifecycle/index.d.ts +2 -2
- package/dist/foundation/lifecycle/index.js +1 -1
- package/dist/foundation/lifecycle/session-repository-context.d.ts +19 -2
- package/dist/foundation/lifecycle/session-repository-context.js +434 -66
- package/dist/foundation/process-containment/index.d.ts +1 -0
- package/dist/foundation/process-containment/index.js +1 -0
- package/dist/foundation/process-containment/native-process-inspector.d.ts +3 -0
- package/dist/foundation/process-containment/native-process-inspector.js +21 -0
- package/dist/foundation/release/bootstrap.js +1 -2
- package/dist/foundation/release/progress-palette.generated.d.ts +2 -2
- package/dist/foundation/release/progress-palette.generated.js +2 -2
- package/dist/foundation/release/release-gc.js +1 -1
- package/dist/foundation/release/update.js +0 -4
- package/dist/foundation/startup/startup-descriptor.js +2 -2
- package/dist/foundation/storage/control-store.js +0 -12
- package/dist/integrations/pi/components/components.js +2 -18
- package/dist/integrations/pi/components/index.d.ts +4 -4
- package/dist/integrations/pi/components/index.js +2 -2
- package/dist/integrations/pi/components/modal-frame.js +3 -4
- package/dist/integrations/pi/components/models-dialog.js +6 -35
- package/dist/integrations/pi/components/prompt-input-port.d.ts +1 -0
- package/dist/integrations/pi/components/resources/builtin-themes.d.ts +2 -2
- package/dist/integrations/pi/components/resources/builtin-themes.js +2 -2
- package/dist/integrations/pi/components/share-operation-dialog.js +3 -3
- package/dist/integrations/pi/components/shell-editor-autocomplete.js +19 -16
- package/dist/integrations/pi/components/shell-extension-ui.d.ts +5 -3
- package/dist/integrations/pi/components/shell-extension-ui.js +26 -12
- package/dist/integrations/pi/components/shell-hotkey-sections.js +2 -2
- package/dist/integrations/pi/components/shell-presenters-info.js +10 -10
- package/dist/integrations/pi/components/shell-presenters-transcript.js +13 -13
- package/dist/integrations/pi/components/shell-selectors-dialogs.js +5 -6
- package/dist/integrations/pi/components/shell-shared-facade.d.ts +21 -1
- package/dist/integrations/pi/components/shell-shared-facade.js +19 -3
- package/dist/integrations/pi/components/skills-dialog.js +3 -3
- package/dist/integrations/pi/components/submitted-prompt-adapter.js +2 -3
- package/dist/integrations/pi/components/theme.d.ts +9 -0
- package/dist/integrations/pi/components/theme.js +30 -0
- package/dist/integrations/pi/components/tool-result-adapter.js +6 -1
- package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.js +1 -1
- package/dist/integrations/pi/components/upstream/assets/earendil-image.json +2 -2
- package/dist/integrations/pi/components/upstream/components/countdown-timer.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/earendil-announcement.js +1 -1
- package/dist/integrations/pi/components/upstream/components/extension-editor.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/extension-editor.js +6 -6
- package/dist/integrations/pi/components/upstream/components/extension-input.js +4 -4
- package/dist/integrations/pi/components/upstream/components/extension-selector.js +4 -4
- package/dist/integrations/pi/components/upstream/components/mermaid.js +1 -1
- package/dist/integrations/pi/components/upstream/components/owned-editor.d.ts +5 -5
- package/dist/integrations/pi/components/upstream/components/owned-editor.js +8 -5
- package/dist/integrations/pi/components/upstream/components/pi-logo.js +1 -1
- package/dist/integrations/pi/components/upstream/components/scoped-models-selector.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/scoped-models-selector.js +3 -3
- package/dist/integrations/pi/components/upstream/components/session-footer.js +1 -1
- package/dist/integrations/pi/components/upstream/components/session-selector-search.js +1 -1
- package/dist/integrations/pi/components/upstream/components/session-selector.js +9 -9
- package/dist/integrations/pi/components/upstream/components/skill-invocation-message.d.ts +3 -2
- package/dist/integrations/pi/components/upstream/components/skill-invocation-message.js +6 -3
- package/dist/integrations/pi/components/upstream/components/status-indicator.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/status-indicator.js +1 -1
- package/dist/integrations/pi/components/upstream/components/themed-text.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/themed-text.js +1 -1
- package/dist/integrations/pi/components/upstream/components/thinking-selector.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/thinking-selector.js +2 -2
- package/dist/integrations/pi/components/upstream/components/tool-execution.d.ts +4 -0
- package/dist/integrations/pi/components/upstream/components/tool-execution.js +11 -1
- package/dist/integrations/pi/components/upstream/components/tree-selector.d.ts +2 -2
- package/dist/integrations/pi/components/upstream/components/tree-selector.js +27 -18
- package/dist/integrations/pi/components/upstream/components/trust-selector.js +1 -1
- package/dist/integrations/pi/components/upstream/external-editor.js +1 -1
- package/dist/integrations/pi/components/upstream/history/editor-core.d.ts +4 -4
- package/dist/integrations/pi/components/upstream/history/editor-core.js +11 -7
- package/dist/integrations/pi/components/upstream/history/kill-ring.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/history/kill-ring.js +1 -1
- package/dist/integrations/pi/components/upstream/history/printable-key.js +1 -1
- package/dist/integrations/pi/components/upstream/history/text-helpers.js +1 -1
- package/dist/integrations/pi/components/upstream/history/undo-stack.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/history/undo-stack.js +1 -1
- package/dist/integrations/pi/components/upstream/history/word-navigation.js +1 -1
- package/dist/integrations/pi/components/upstream/model-search.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/program-status-reporter.d.ts +31 -0
- package/dist/integrations/pi/components/upstream/program-status-reporter.js +89 -0
- package/dist/integrations/pi/components/upstream/theme/theme-controller.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/theme/theme.d.ts +22 -1
- package/dist/integrations/pi/components/upstream/theme/theme.js +225 -10
- package/dist/integrations/pi/engine/adapter.d.ts +44 -24
- package/dist/integrations/pi/engine/adapter.js +130 -22
- package/dist/integrations/pi/engine/command-dispatch.d.ts +2 -5
- package/dist/integrations/pi/engine/extension-ui-binding.d.ts +2 -11
- package/dist/integrations/pi/engine/host-ports.d.ts +20 -0
- package/dist/integrations/pi/engine/host-ports.js +13 -0
- package/dist/integrations/pi/engine/host.d.ts +70 -0
- package/dist/integrations/pi/engine/host.js +147 -0
- package/dist/integrations/pi/engine/index.d.ts +8 -4
- package/dist/integrations/pi/engine/index.js +3 -1
- package/dist/integrations/pi/engine/pi-settings-metadata.json +1 -1
- package/dist/integrations/pi/engine/resource-catalog.d.ts +4 -23
- package/dist/integrations/pi/engine/resources/changelog.json +4 -4
- package/dist/integrations/pi/engine/runtime-integration.d.ts +8 -2
- package/dist/integrations/pi/engine/runtime-integration.js +12 -7
- package/dist/integrations/pi/engine/session-events.js +10 -2
- package/dist/integrations/pi/engine/session-integration.d.ts +3 -8
- package/dist/integrations/pi/engine/session-integration.js +0 -49
- package/dist/integrations/pi/engine/session-runtime.d.ts +18 -3
- package/dist/integrations/pi/engine/session-runtime.js +18 -7
- package/dist/integrations/pi/engine/settings-bridge.d.ts +2 -2
- package/dist/integrations/pi/engine/settings-bridge.js +0 -2
- package/dist/integrations/pi/engine/settings-port.d.ts +2 -0
- package/dist/integrations/pi/engine/settings-port.js +3 -5
- package/dist/integrations/pi/engine/transcript-projection.js +2 -1
- package/dist/integrations/pi/engine/workflows.d.ts +33 -260
- package/dist/integrations/pi/engine/workflows.js +6 -28
- package/dist/integrations/pi/session-presenters/index.d.ts +2 -0
- package/dist/integrations/pi/session-presenters/index.js +1 -0
- package/dist/integrations/pi/session-presenters/presenters.d.ts +16 -0
- package/dist/integrations/pi/session-presenters/presenters.js +341 -0
- package/dist/integrations/pi/startup-public.js +306 -290
- package/dist/integrations/pi/startup-public.manifest.json +289 -265
- package/dist/integrations/pi/tui-runtime/adapter.d.ts +2 -1
- package/dist/integrations/pi/tui-runtime/adapter.js +7 -2
- package/dist/integrations/pi/tui-runtime/contracts.d.ts +3 -1
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +8 -1
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.js +67 -2
- package/dist/integrations/pi/tui-runtime/index.d.ts +1 -1
- package/dist/integrations/pi/tui-runtime/index.js +1 -1
- package/dist/native/darwin-arm64/manifest.json +1 -1
- package/dist/native/linux-x64/manifest.json +1 -1
- package/dist/native/win32-x64/manifest.json +2 -2
- package/dist/native/win32-x64/process-guardian.exe +0 -0
- package/dist/product-identity.d.ts +2 -2
- package/dist/product-identity.js +2 -2
- package/dist/product-identity.json +3 -1
- package/dist/runtime-payload-inventory.json +3092 -2878
- package/dist/ui/components/prompt-input.d.ts +2 -0
- package/dist/ui/components/prompt-input.js +5 -1
- package/dist/ui/components/text-selection.d.ts +1 -1
- package/dist/ui/components/text-selection.js +3 -1
- package/dist/ui/components/theme.d.ts +2 -0
- package/dist/ui/components/transcript-viewport.d.ts +6 -4
- package/dist/ui/components/transcript-viewport.js +94 -16
- package/dist/ui/components/value-menu.d.ts +2 -0
- package/dist/ui/components/value-menu.js +13 -8
- package/dist/ui/settings/declarations.d.ts +38 -14
- package/dist/ui/settings/declarations.js +35 -11
- package/dist/ui/settings/migrations.js +23 -0
- package/docs/architecture/boundaries.md +9 -1
- package/docs/architecture/project-structure.md +7 -5
- package/docs/architecture/prompt-suggestions.md +14 -10
- package/docs/local-worktree-cleanup.md +11 -5
- package/docs/openspec-archive-automation.md +6 -5
- package/package.json +3 -3
- package/dist/contracts/agent-engine/model.d.ts +0 -78
- package/dist/contracts/agent-engine/model.js +0 -1
- package/dist/contracts/agent-engine/ports.d.ts +0 -18
- package/dist/contracts/agent-engine/serialization.d.ts +0 -7
- package/dist/contracts/agent-engine/serialization.js +0 -58
- package/dist/contracts/agent-engine/validation.d.ts +0 -5
- package/dist/contracts/agent-engine/validation.js +0 -128
- package/dist/integrations/pi/components/upstream/theme/system-theme.d.ts +0 -61
- package/dist/integrations/pi/components/upstream/theme/system-theme.js +0 -709
- /package/dist/contracts/{agent-engine/ports.js → owned-ui/session-backend.js} +0 -0
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Payloads that cross the session backend port: workflow requests and results, catalog and
|
|
3
|
+
* settings snapshots, resource summaries, and the slash-command names the shell routes. Every
|
|
4
|
+
* declaration is plain data, so a backend other than pinned Pi can produce it.
|
|
5
|
+
*/
|
|
6
|
+
import type { OWNED_UI_EXTENSION_CONTRACT_VERSION, OWNED_UI_EXTENSION_RENDER_CALLBACKS, OWNED_UI_EXTENSION_UI_CALLBACKS, OWNED_UI_EXTENSION_UI_PROPERTIES } from "./extension-ui.js";
|
|
7
|
+
import type { OwnedUiCommandOutcome, OwnedUiThinkingLevel } from "./model.js";
|
|
8
|
+
/** Every workflow command the session engine advertises, in its own catalog order. */
|
|
9
|
+
export declare const OWNED_UI_WORKFLOW_COMMAND_NAMES: readonly ["settings", "model", "tree", "thinking", "scoped-models", "export", "import", "share", "copy", "name", "session", "changelog", "hotkeys", "fork", "clone", "trust", "login", "logout", "new", "compact", "resume", "reload", "quit"];
|
|
10
|
+
/** Routes the engine answers but never advertises. */
|
|
11
|
+
export declare const OWNED_UI_HIDDEN_COMMAND_NAMES: readonly ["debug", "arminsayshi", "dementedelves"];
|
|
12
|
+
/** The one bare-A1 model command; it replaces the `model` and `scoped-models` routes there. */
|
|
13
|
+
export declare const OWNED_UI_MODELS_COMMAND_NAME: "models";
|
|
14
|
+
export type OwnedUiWorkflowCommandName = typeof OWNED_UI_WORKFLOW_COMMAND_NAMES[number];
|
|
15
|
+
export type OwnedUiHiddenWorkflowCommandName = typeof OWNED_UI_HIDDEN_COMMAND_NAMES[number];
|
|
16
|
+
export type OwnedUiModelsCommandName = typeof OWNED_UI_MODELS_COMMAND_NAME;
|
|
17
|
+
export type OwnedUiWorkflowRoute = OwnedUiWorkflowCommandName | OwnedUiHiddenWorkflowCommandName | OwnedUiModelsCommandName;
|
|
18
|
+
/** Which settings surface a backend serves; hidden-in-bare effects are unbindable in bare mode. */
|
|
19
|
+
export type OwnedUiSessionProductMode = "bare" | "comparison";
|
|
20
|
+
export interface OwnedUiWorkflowOption {
|
|
21
|
+
readonly id: string;
|
|
22
|
+
readonly label: string;
|
|
23
|
+
readonly description?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface OwnedUiAuthenticationProviderStatus {
|
|
26
|
+
readonly type: "oauth" | "api_key";
|
|
27
|
+
readonly source?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface OwnedUiAuthenticationProviderOption extends OwnedUiWorkflowOption {
|
|
30
|
+
readonly providerId: string;
|
|
31
|
+
readonly authType: "oauth" | "api_key";
|
|
32
|
+
readonly status?: OwnedUiAuthenticationProviderStatus;
|
|
33
|
+
}
|
|
34
|
+
/** A provider configured outside the engine, which the login route explains instead of running. */
|
|
35
|
+
export interface OwnedUiAmbientAuthentication {
|
|
36
|
+
readonly providerId: string;
|
|
37
|
+
readonly providerName: string;
|
|
38
|
+
readonly title: string;
|
|
39
|
+
readonly message: string;
|
|
40
|
+
}
|
|
41
|
+
export interface OwnedUiWorkflowRequest {
|
|
42
|
+
readonly command: OwnedUiWorkflowRoute;
|
|
43
|
+
readonly argument: string;
|
|
44
|
+
readonly selection?: string;
|
|
45
|
+
/** For the model route: also persist the selection as the default model. The bare `models` route always persists. */
|
|
46
|
+
readonly persist?: boolean;
|
|
47
|
+
readonly confirmed?: boolean;
|
|
48
|
+
/** Recovery cwd selected after an import/resume source cwd is unavailable. */
|
|
49
|
+
readonly cwdOverride?: string;
|
|
50
|
+
/** Cancellation for an owned operation surface such as `/share`. */
|
|
51
|
+
readonly signal?: AbortSignal;
|
|
52
|
+
readonly treeSummary?: {
|
|
53
|
+
readonly summarize: boolean;
|
|
54
|
+
readonly customInstructions?: string;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
export type OwnedUiWorkflowOutcome = "completed" | "cancelled" | "failed" | "requires-selection" | "requires-confirmation";
|
|
58
|
+
export interface OwnedUiSessionInfoPresentation {
|
|
59
|
+
readonly kind: "session-info";
|
|
60
|
+
readonly sessionName?: string;
|
|
61
|
+
readonly stats: {
|
|
62
|
+
readonly sessionFile?: string;
|
|
63
|
+
readonly sessionId: string;
|
|
64
|
+
readonly userMessages: number;
|
|
65
|
+
readonly assistantMessages: number;
|
|
66
|
+
readonly toolCalls: number;
|
|
67
|
+
readonly toolResults: number;
|
|
68
|
+
readonly totalMessages: number;
|
|
69
|
+
readonly tokens: {
|
|
70
|
+
readonly input: number;
|
|
71
|
+
readonly output: number;
|
|
72
|
+
readonly cacheRead: number;
|
|
73
|
+
readonly cacheWrite: number;
|
|
74
|
+
readonly total: number;
|
|
75
|
+
};
|
|
76
|
+
readonly cost: number;
|
|
77
|
+
};
|
|
78
|
+
readonly cacheWaste: {
|
|
79
|
+
readonly missedTokens: number;
|
|
80
|
+
readonly missedCost: number;
|
|
81
|
+
readonly missCount: number;
|
|
82
|
+
};
|
|
83
|
+
readonly usageBreakdown: readonly {
|
|
84
|
+
readonly key: string;
|
|
85
|
+
readonly cost: number;
|
|
86
|
+
readonly tokens: number;
|
|
87
|
+
}[];
|
|
88
|
+
readonly cacheWarming: OwnedUiCacheWarmingPresentation;
|
|
89
|
+
}
|
|
90
|
+
/** The engine's prompt-cache warming mode and, once warming has acted, the decision behind it. */
|
|
91
|
+
export interface OwnedUiCacheWarmingPresentation {
|
|
92
|
+
readonly mode: string;
|
|
93
|
+
readonly status?: {
|
|
94
|
+
readonly state: "inactive" | "scheduled" | "refreshing";
|
|
95
|
+
readonly reason?: string;
|
|
96
|
+
readonly nextWarmAt?: number;
|
|
97
|
+
readonly extensionOverride?: boolean;
|
|
98
|
+
readonly decision?: {
|
|
99
|
+
readonly phase: "streaming" | "idle";
|
|
100
|
+
readonly action: string;
|
|
101
|
+
readonly warmCost: number;
|
|
102
|
+
readonly missCost: number;
|
|
103
|
+
readonly continuationProbability: number;
|
|
104
|
+
readonly expectedSavings: number;
|
|
105
|
+
readonly economicsAvailable: boolean;
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
export type OwnedUiWorkflowPresentation = OwnedUiSessionInfoPresentation;
|
|
110
|
+
export type OwnedUiWorkflowMessageKind = "status" | "warning" | "error" | "accent" | "silent";
|
|
111
|
+
export interface OwnedUiWorkflowMessage {
|
|
112
|
+
readonly kind: Exclude<OwnedUiWorkflowMessageKind, "silent">;
|
|
113
|
+
readonly message: string;
|
|
114
|
+
}
|
|
115
|
+
export interface OwnedUiWorkflowResult {
|
|
116
|
+
readonly command: OwnedUiWorkflowRoute;
|
|
117
|
+
readonly outcome: OwnedUiWorkflowOutcome;
|
|
118
|
+
readonly message: string;
|
|
119
|
+
/** Explicit presentation semantics; never inferred from message prefixes. */
|
|
120
|
+
readonly messageKind?: OwnedUiWorkflowMessageKind;
|
|
121
|
+
/** Ordered messages for truthful partial-success outcomes. */
|
|
122
|
+
readonly messages?: readonly OwnedUiWorkflowMessage[];
|
|
123
|
+
readonly detail?: string;
|
|
124
|
+
readonly selectorTitle?: string;
|
|
125
|
+
readonly options?: readonly OwnedUiWorkflowOption[];
|
|
126
|
+
readonly presentation?: OwnedUiWorkflowPresentation;
|
|
127
|
+
}
|
|
128
|
+
export interface OwnedUiWorkflowAutocompleteCommand {
|
|
129
|
+
readonly name: string;
|
|
130
|
+
readonly description?: string;
|
|
131
|
+
readonly argumentHint?: string;
|
|
132
|
+
readonly argumentOptions?: readonly OwnedUiWorkflowOption[];
|
|
133
|
+
readonly source: "builtin" | "prompt" | "skill" | "extension";
|
|
134
|
+
}
|
|
135
|
+
export interface OwnedUiWorkflowInteractionRequest {
|
|
136
|
+
readonly type: "text" | "secret" | "manual-code" | "select";
|
|
137
|
+
readonly message: string;
|
|
138
|
+
readonly placeholder?: string;
|
|
139
|
+
readonly options?: readonly {
|
|
140
|
+
readonly id: string;
|
|
141
|
+
readonly label: string;
|
|
142
|
+
}[];
|
|
143
|
+
}
|
|
144
|
+
export interface OwnedUiWorkflowLoginStart {
|
|
145
|
+
readonly providerId: string;
|
|
146
|
+
readonly providerName: string;
|
|
147
|
+
readonly authType: "oauth" | "api_key";
|
|
148
|
+
}
|
|
149
|
+
export type OwnedUiWorkflowLoginNotification = {
|
|
150
|
+
readonly type: "auth_url";
|
|
151
|
+
readonly url: string;
|
|
152
|
+
readonly instructions?: string;
|
|
153
|
+
} | {
|
|
154
|
+
readonly type: "device_code";
|
|
155
|
+
readonly verificationUri: string;
|
|
156
|
+
readonly userCode: string;
|
|
157
|
+
} | {
|
|
158
|
+
readonly type: "info";
|
|
159
|
+
readonly message: string;
|
|
160
|
+
readonly links?: readonly {
|
|
161
|
+
readonly label?: string;
|
|
162
|
+
readonly url: string;
|
|
163
|
+
}[];
|
|
164
|
+
} | {
|
|
165
|
+
readonly type: "waiting" | "progress";
|
|
166
|
+
readonly message: string;
|
|
167
|
+
};
|
|
168
|
+
/** The shell's side of an interactive workflow such as `/login`. */
|
|
169
|
+
export interface OwnedUiWorkflowInteractionHost {
|
|
170
|
+
startLogin?(request: OwnedUiWorkflowLoginStart): void;
|
|
171
|
+
prompt(request: OwnedUiWorkflowInteractionRequest): Promise<string | null>;
|
|
172
|
+
notify(event: OwnedUiWorkflowLoginNotification): void;
|
|
173
|
+
/** Deliver a post-login status or warning after the authentication dialog closes. */
|
|
174
|
+
publish?(message: OwnedUiWorkflowMessage): void;
|
|
175
|
+
finishLogin?(): void;
|
|
176
|
+
}
|
|
177
|
+
export interface OwnedUiBashWorkflowResult {
|
|
178
|
+
readonly command: string;
|
|
179
|
+
readonly output: string;
|
|
180
|
+
readonly exitCode: number | undefined;
|
|
181
|
+
readonly cancelled: boolean;
|
|
182
|
+
readonly truncated: boolean;
|
|
183
|
+
readonly excludeFromContext: boolean;
|
|
184
|
+
}
|
|
185
|
+
export interface OwnedUiScopedModelDescriptor {
|
|
186
|
+
readonly provider: string;
|
|
187
|
+
readonly id: string;
|
|
188
|
+
readonly name: string;
|
|
189
|
+
}
|
|
190
|
+
export interface OwnedUiScopedModelsContext {
|
|
191
|
+
readonly models: readonly OwnedUiScopedModelDescriptor[];
|
|
192
|
+
readonly enabledModelIds: readonly string[] | null;
|
|
193
|
+
}
|
|
194
|
+
export interface OwnedUiScopedModelsRefreshResult extends OwnedUiScopedModelsContext {
|
|
195
|
+
readonly status: string;
|
|
196
|
+
readonly statusKind: "success" | "warning";
|
|
197
|
+
}
|
|
198
|
+
/** What the bare-A1 Models dialog reads: the authenticated catalog and the explicit session and persisted scopes, kept apart. */
|
|
199
|
+
export interface OwnedUiModelsContext {
|
|
200
|
+
readonly models: readonly OwnedUiScopedModelDescriptor[];
|
|
201
|
+
/** `provider/id` of the active model, or null before one is set. */
|
|
202
|
+
readonly activeModelId: string | null;
|
|
203
|
+
/** Ordered `provider/id` references the session cycles; empty is the all-model fallback, not an explicit full scope. */
|
|
204
|
+
readonly sessionScopeIds: readonly string[];
|
|
205
|
+
/** The persisted `enabledModels` patterns resolved against the catalog, in order; unmatched patterns stay verbatim. */
|
|
206
|
+
readonly persistedScopeIds: readonly string[];
|
|
207
|
+
}
|
|
208
|
+
export interface OwnedUiModelsRefreshResult {
|
|
209
|
+
readonly models: readonly OwnedUiScopedModelDescriptor[];
|
|
210
|
+
readonly status: string;
|
|
211
|
+
readonly statusKind: "success" | "warning";
|
|
212
|
+
}
|
|
213
|
+
export interface OwnedUiProjectTrustUpdate {
|
|
214
|
+
readonly path: string;
|
|
215
|
+
readonly decision: boolean | null;
|
|
216
|
+
}
|
|
217
|
+
export interface OwnedUiProjectTrustContext {
|
|
218
|
+
readonly cwd: string;
|
|
219
|
+
readonly savedDecision: {
|
|
220
|
+
readonly path: string;
|
|
221
|
+
readonly decision: boolean;
|
|
222
|
+
} | null;
|
|
223
|
+
readonly projectTrusted: boolean;
|
|
224
|
+
readonly trustOptions: readonly {
|
|
225
|
+
readonly label: string;
|
|
226
|
+
readonly trusted: boolean;
|
|
227
|
+
readonly updates: readonly OwnedUiProjectTrustUpdate[];
|
|
228
|
+
readonly savedPath?: string;
|
|
229
|
+
}[];
|
|
230
|
+
}
|
|
231
|
+
export interface OwnedUiSessionResumeMetadata {
|
|
232
|
+
readonly sessionId: string;
|
|
233
|
+
readonly sessionDir: string;
|
|
234
|
+
readonly usesDefaultSessionDir: boolean;
|
|
235
|
+
}
|
|
236
|
+
/** Settings-level thinking: the session's levels plus `max`, which only models that map it offer. */
|
|
237
|
+
export type OwnedUiSettingsThinkingLevel = OwnedUiThinkingLevel | "max";
|
|
238
|
+
/** The engine settings the shell reads to configure itself and to seed its settings surfaces. */
|
|
239
|
+
export interface OwnedUiSessionSettingsSnapshot {
|
|
240
|
+
readonly autoCompact: boolean;
|
|
241
|
+
readonly showImages: boolean;
|
|
242
|
+
readonly imageWidthCells: number;
|
|
243
|
+
readonly autoResizeImages: boolean;
|
|
244
|
+
readonly blockImages: boolean;
|
|
245
|
+
readonly enableSkillCommands: boolean;
|
|
246
|
+
readonly steeringMode: "all" | "one-at-a-time";
|
|
247
|
+
readonly followUpMode: "all" | "one-at-a-time";
|
|
248
|
+
readonly transport: "sse" | "websocket" | "websocket-cached" | "auto";
|
|
249
|
+
readonly httpIdleTimeoutMs: number;
|
|
250
|
+
readonly cacheWarmingMode: "off" | "streaming" | "idle";
|
|
251
|
+
readonly thinkingLevel: OwnedUiSettingsThinkingLevel;
|
|
252
|
+
readonly availableThinkingLevels: readonly OwnedUiSettingsThinkingLevel[];
|
|
253
|
+
/** The stored global default the selector offers to restore; the session's level may differ. */
|
|
254
|
+
readonly defaultThinkingLevel: OwnedUiSettingsThinkingLevel;
|
|
255
|
+
/** Per-model thinking overrides keyed `provider/modelId`. */
|
|
256
|
+
readonly modelThinkingLevels: Readonly<Record<string, string>>;
|
|
257
|
+
/** `provider/modelId` of the persisted default model, or the engine's "not set" wording. */
|
|
258
|
+
readonly defaultModel: string;
|
|
259
|
+
readonly currentTheme: string;
|
|
260
|
+
readonly terminalTheme: "dark" | "light";
|
|
261
|
+
readonly availableThemes: readonly string[];
|
|
262
|
+
readonly hideThinkingBlock: boolean;
|
|
263
|
+
readonly mermaidRenderingMode: "off" | "final" | "streaming";
|
|
264
|
+
readonly showCacheMissNotices: boolean;
|
|
265
|
+
readonly collapseChangelog: boolean;
|
|
266
|
+
readonly enableInstallTelemetry: boolean;
|
|
267
|
+
readonly doubleEscapeAction: "fork" | "tree" | "none";
|
|
268
|
+
readonly treeFilterMode: "default" | "no-tools" | "user-only" | "labeled-only" | "all";
|
|
269
|
+
readonly showHardwareCursor: boolean;
|
|
270
|
+
readonly editorPaddingX: number;
|
|
271
|
+
readonly outputPad: 0 | 1;
|
|
272
|
+
readonly autocompleteMaxVisible: number;
|
|
273
|
+
readonly quietStartup: boolean | "header";
|
|
274
|
+
readonly defaultProjectTrust: "ask" | "always" | "never";
|
|
275
|
+
readonly clearOnShrink: boolean;
|
|
276
|
+
readonly showTerminalProgress: boolean;
|
|
277
|
+
readonly tuiMode: "regular" | "fullscreen";
|
|
278
|
+
readonly fullscreenExitOutput: "transcript" | "resume-hint";
|
|
279
|
+
readonly fullscreenScrollbar: "hidden" | "auto" | "always";
|
|
280
|
+
readonly fullscreenCopyOnSelect: boolean;
|
|
281
|
+
readonly fullscreenWheelScrollLines: number | "auto";
|
|
282
|
+
readonly warnings: {
|
|
283
|
+
readonly anthropicExtraUsage?: boolean;
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
export type OwnedUiJsonValue = null | boolean | number | string | readonly OwnedUiJsonValue[] | {
|
|
287
|
+
readonly [key: string]: OwnedUiJsonValue;
|
|
288
|
+
};
|
|
289
|
+
/** The layer that installs a setting's live effect. */
|
|
290
|
+
export type OwnedUiSettingOwner = "agent" | "shell" | "terminal" | "startup" | "shutdown" | "installation";
|
|
291
|
+
/** Engine settings whose live effect an owner may bind. */
|
|
292
|
+
export type OwnedUiSessionSettingKey = "autoCompact" | "showImages" | "imageWidthCells" | "autoResizeImages" | "blockImages" | "enableSkillCommands" | "steeringMode" | "followUpMode" | "transport" | "httpIdleTimeoutMs" | "cacheWarmingMode" | "modelThinkingLevels" | "theme" | "hideThinkingBlock" | "mermaidRenderingMode" | "showCacheMissNotices" | "collapseChangelog" | "enableInstallTelemetry" | "quietStartup" | "defaultProjectTrust" | "doubleEscapeAction" | "treeFilterMode" | "showHardwareCursor" | "editorPaddingX" | "outputPad" | "autocompleteMaxVisible" | "clearOnShrink" | "showTerminalProgress" | "tuiMode" | "fullscreenExitOutput" | "fullscreenScrollbar" | "fullscreenCopyOnSelect" | "fullscreenWheelScrollLines" | "warnings";
|
|
293
|
+
export interface OwnedUiSettingEffectHandler {
|
|
294
|
+
/** Install one value in the active owner. Handlers must be idempotent and reversible. */
|
|
295
|
+
apply(value: OwnedUiJsonValue): void | Promise<void>;
|
|
296
|
+
}
|
|
297
|
+
export type OwnedUiSettingOwnerHandlers = Partial<Record<OwnedUiSessionSettingKey, OwnedUiSettingEffectHandler>>;
|
|
298
|
+
/** How the backend settled one owned UI command. */
|
|
299
|
+
export interface OwnedUiCommandResult {
|
|
300
|
+
readonly outcome: OwnedUiCommandOutcome;
|
|
301
|
+
readonly diagnostic: string | null;
|
|
302
|
+
}
|
|
303
|
+
export interface OwnedUiResourceSummary {
|
|
304
|
+
readonly kind: "skill" | "prompt-template" | "agent-context" | "system-prompt" | "theme";
|
|
305
|
+
readonly id: string;
|
|
306
|
+
readonly label: string;
|
|
307
|
+
readonly sourcePath: string | null;
|
|
308
|
+
readonly diagnostic: string | null;
|
|
309
|
+
}
|
|
310
|
+
export interface OwnedUiExtensionSourceSummary {
|
|
311
|
+
readonly source: string;
|
|
312
|
+
readonly scope: "user" | "project" | "temporary";
|
|
313
|
+
readonly origin: "package" | "top-level";
|
|
314
|
+
readonly baseDir: string | null;
|
|
315
|
+
}
|
|
316
|
+
export interface OwnedUiExtensionResourceSummary {
|
|
317
|
+
readonly kind: "extension";
|
|
318
|
+
readonly id: string;
|
|
319
|
+
readonly sourcePath: string | null;
|
|
320
|
+
readonly resolvedPath: string | null;
|
|
321
|
+
readonly sourceInfo: OwnedUiExtensionSourceSummary | null;
|
|
322
|
+
readonly loaded: boolean;
|
|
323
|
+
readonly hidden: boolean;
|
|
324
|
+
readonly diagnostic: string | null;
|
|
325
|
+
}
|
|
326
|
+
/** Whether the owned extension UI bridge is bound to the current session, and the contract it offers. */
|
|
327
|
+
export interface OwnedUiVisualExtensionSupport {
|
|
328
|
+
readonly available: boolean;
|
|
329
|
+
readonly contractComplete: true;
|
|
330
|
+
readonly contractVersion: typeof OWNED_UI_EXTENSION_CONTRACT_VERSION;
|
|
331
|
+
readonly binding: "bound" | "unbound";
|
|
332
|
+
readonly uiCallbacks: typeof OWNED_UI_EXTENSION_UI_CALLBACKS;
|
|
333
|
+
readonly uiProperties: typeof OWNED_UI_EXTENSION_UI_PROPERTIES;
|
|
334
|
+
readonly renderCallbacks: typeof OWNED_UI_EXTENSION_RENDER_CALLBACKS;
|
|
335
|
+
readonly diagnostic: string;
|
|
336
|
+
}
|
|
337
|
+
/** A newer release found by the startup check. */
|
|
338
|
+
export interface OwnedUiReleaseUpdate {
|
|
339
|
+
readonly version: string;
|
|
340
|
+
readonly command: string;
|
|
341
|
+
readonly changelogUrl: string | null;
|
|
342
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** Every workflow command the session engine advertises, in its own catalog order. */
|
|
2
|
+
export const OWNED_UI_WORKFLOW_COMMAND_NAMES = [
|
|
3
|
+
"settings",
|
|
4
|
+
"model",
|
|
5
|
+
"tree",
|
|
6
|
+
"thinking",
|
|
7
|
+
"scoped-models",
|
|
8
|
+
"export",
|
|
9
|
+
"import",
|
|
10
|
+
"share",
|
|
11
|
+
"copy",
|
|
12
|
+
"name",
|
|
13
|
+
"session",
|
|
14
|
+
"changelog",
|
|
15
|
+
"hotkeys",
|
|
16
|
+
"fork",
|
|
17
|
+
"clone",
|
|
18
|
+
"trust",
|
|
19
|
+
"login",
|
|
20
|
+
"logout",
|
|
21
|
+
"new",
|
|
22
|
+
"compact",
|
|
23
|
+
"resume",
|
|
24
|
+
"reload",
|
|
25
|
+
"quit",
|
|
26
|
+
];
|
|
27
|
+
/** Routes the engine answers but never advertises. */
|
|
28
|
+
export const OWNED_UI_HIDDEN_COMMAND_NAMES = ["debug", "arminsayshi", "dementedelves"];
|
|
29
|
+
/** The one bare-A1 model command; it replaces the `model` and `scoped-models` routes there. */
|
|
30
|
+
export const OWNED_UI_MODELS_COMMAND_NAME = "models";
|
|
@@ -2,12 +2,16 @@ import type { OwnedUiPromptSuggestionReasoning } from "./model.js";
|
|
|
2
2
|
export declare const SUGGESTION_DECISION_REASONS: readonly ["disabled", "disposed", "early-conversation", "no-model", "failed-response", "incomplete-response", "tool-continuation", "replacement-input", "modal", "draft", "not-ready", "not-focused", "autocomplete", "prompt-mode", "presentation-unavailable", "ineligible", "stale-identity"];
|
|
3
3
|
export type SuggestionDecisionReason = typeof SUGGESTION_DECISION_REASONS[number];
|
|
4
4
|
export type SuggestionDecision = SuggestionDecisionReason | null;
|
|
5
|
-
export declare const SUGGESTION_DIAGNOSTIC_EVENTS: readonly ["skipped", "started", "displayed", "empty", "rejected", "provider-failure", "unavailable", "timeout", "cancelled", "stale-result", "presentation-blocked", "late-result-discarded"];
|
|
5
|
+
export declare const SUGGESTION_DIAGNOSTIC_EVENTS: readonly ["skipped", "started", "displayed", "empty", "rejected", "provider-failure", "unavailable", "timeout", "cancelled", "stale-result", "presentation-blocked", "presentation-deferred", "retry-exhausted", "late-result-discarded"];
|
|
6
6
|
export type SuggestionDiagnosticEvent = typeof SUGGESTION_DIAGNOSTIC_EVENTS[number];
|
|
7
|
+
export declare const SUGGESTION_ATTEMPT_TRIGGERS: readonly ["prefetch", "settlement", "retry"];
|
|
8
|
+
export type SuggestionAttemptTrigger = typeof SUGGESTION_ATTEMPT_TRIGGERS[number];
|
|
7
9
|
/** Metadata only: never carry a session path, prompt, candidate, or raw error. */
|
|
8
10
|
export interface SuggestionDiagnosticRecord {
|
|
9
11
|
readonly event: SuggestionDiagnosticEvent;
|
|
10
12
|
readonly reason?: SuggestionDecisionReason;
|
|
13
|
+
readonly attempt?: number;
|
|
14
|
+
readonly trigger?: SuggestionAttemptTrigger;
|
|
11
15
|
readonly session: number;
|
|
12
16
|
readonly run: number;
|
|
13
17
|
readonly response: number;
|
|
@@ -5,5 +5,7 @@ export const SUGGESTION_DECISION_REASONS = [
|
|
|
5
5
|
];
|
|
6
6
|
export const SUGGESTION_DIAGNOSTIC_EVENTS = [
|
|
7
7
|
"skipped", "started", "displayed", "empty", "rejected", "provider-failure", "unavailable",
|
|
8
|
-
"timeout", "cancelled", "stale-result", "presentation-blocked", "
|
|
8
|
+
"timeout", "cancelled", "stale-result", "presentation-blocked", "presentation-deferred",
|
|
9
|
+
"retry-exhausted", "late-result-discarded",
|
|
9
10
|
];
|
|
11
|
+
export const SUGGESTION_ATTEMPT_TRIGGERS = ["prefetch", "settlement", "retry"];
|
|
@@ -133,6 +133,13 @@ export function assertOwnedUiEvent(event) {
|
|
|
133
133
|
assertOwnedUiModelInfo(event.model);
|
|
134
134
|
if (typeof event.successful !== "boolean")
|
|
135
135
|
throw new TypeError("owned-UI settlement success state is invalid");
|
|
136
|
+
if (event.stopReason === undefined)
|
|
137
|
+
throw new TypeError("owned-UI settlement stop reason is missing");
|
|
138
|
+
assertOptionalText(event.stopReason, "owned-UI settlement stop reason", MAX_LABEL_LENGTH);
|
|
139
|
+
if (typeof event.toolContinuation !== "boolean")
|
|
140
|
+
throw new TypeError("owned-UI settlement tool-continuation state is invalid");
|
|
141
|
+
if (typeof event.aborted !== "boolean")
|
|
142
|
+
throw new TypeError("owned-UI settlement aborted state is invalid");
|
|
136
143
|
return;
|
|
137
144
|
case "editor-state":
|
|
138
145
|
assertOwnedUiEditorState(event.editor);
|
|
@@ -9,6 +9,6 @@ export type { LaunchProfilePathOptions, LaunchProfilePaths } from "./profile-pat
|
|
|
9
9
|
export { prepareInteractiveLaunch } from "./prepare-launch.js";
|
|
10
10
|
export type { PrepareInteractiveLaunchOptions, PreparedInteractiveLaunch } from "./prepare-launch.js";
|
|
11
11
|
export { updateSessionRepositoryContext } from "./session-context.js";
|
|
12
|
-
export type { SessionContextRequest } from "./session-context.js";
|
|
12
|
+
export type { SessionContextOutcome, SessionContextRequest, SessionContextRuntime } from "./session-context.js";
|
|
13
13
|
export { runSelectedInteractiveRuntime, selectInteractiveRuntime } from "./runtime-selection.js";
|
|
14
14
|
export type { InteractiveRuntimeRunners, InteractiveRuntimeSelection, OwnedUiProfileId } from "./runtime-selection.js";
|
|
@@ -1,8 +1,23 @@
|
|
|
1
|
-
import { type SessionRepositoryIdentity } from "../../foundation/lifecycle/index.js";
|
|
1
|
+
import { type NativeProcessIdentity, type SessionRepositoryIdentity, type SessionWorktreeInventoryEntry } from "../../foundation/lifecycle/index.js";
|
|
2
2
|
export type SessionContextRequest = {
|
|
3
3
|
readonly action: "link-worktree";
|
|
4
4
|
readonly path: string;
|
|
5
5
|
} | {
|
|
6
6
|
readonly action: "unlink-worktree";
|
|
7
|
+
} | {
|
|
8
|
+
readonly action: "worktrees";
|
|
9
|
+
};
|
|
10
|
+
export type SessionContextOutcome = {
|
|
11
|
+
readonly kind: "linked";
|
|
12
|
+
readonly cwd: string;
|
|
13
|
+
} | {
|
|
14
|
+
readonly kind: "unlinked";
|
|
15
|
+
} | {
|
|
16
|
+
readonly kind: "worktrees";
|
|
17
|
+
readonly entries: readonly SessionWorktreeInventoryEntry[];
|
|
7
18
|
};
|
|
8
|
-
export
|
|
19
|
+
export interface SessionContextRuntime {
|
|
20
|
+
readonly runtimeId: string;
|
|
21
|
+
readonly inspectProcess: (pid: number) => Promise<NativeProcessIdentity | null>;
|
|
22
|
+
}
|
|
23
|
+
export declare function updateSessionRepositoryContext(identity: SessionRepositoryIdentity, request: SessionContextRequest, runtime: SessionContextRuntime): Promise<SessionContextOutcome>;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import { clearSessionRepositoryContext, setSessionRepositoryContext, } from "../../foundation/lifecycle/index.js";
|
|
2
|
-
export async function updateSessionRepositoryContext(identity, request) {
|
|
1
|
+
import { clearSessionRepositoryContext, listSessionRepositoryWorktrees, setSessionRepositoryContext, } from "../../foundation/lifecycle/index.js";
|
|
2
|
+
export async function updateSessionRepositoryContext(identity, request, runtime) {
|
|
3
|
+
const options = { runtimeId: runtime.runtimeId, inspectProcess: runtime.inspectProcess };
|
|
3
4
|
if (request.action === "unlink-worktree") {
|
|
4
|
-
await clearSessionRepositoryContext(identity);
|
|
5
|
-
return
|
|
5
|
+
await clearSessionRepositoryContext(identity, options);
|
|
6
|
+
return { kind: "unlinked" };
|
|
6
7
|
}
|
|
7
|
-
|
|
8
|
+
if (request.action === "worktrees") {
|
|
9
|
+
return { kind: "worktrees", entries: await listSessionRepositoryWorktrees(identity, options) };
|
|
10
|
+
}
|
|
11
|
+
return { kind: "linked", cwd: (await setSessionRepositoryContext(identity, request.path, options)).cwd };
|
|
8
12
|
}
|