@timurproko/a1 0.2.6-dev.727 → 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/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/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 +20 -10
- package/dist/app/session-shell/session-shell-root.js +6 -6
- package/dist/app/session-shell/session-shell.d.ts +19 -21
- package/dist/app/session-shell/session-shell.js +656 -860
- package/dist/composition/owned-ui.d.ts +20 -2
- package/dist/composition/owned-ui.js +66 -35
- package/dist/composition/session-info-reference.d.ts +2 -2
- package/dist/composition/session-info-reference.js +2 -2
- 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 +5 -1
- package/dist/contracts/owned-ui/index.js +1 -0
- package/dist/contracts/owned-ui/model.d.ts +6 -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/features/owned-ui/settings-app.js +35 -15
- package/dist/foundation/release/bootstrap.js +1 -2
- package/dist/foundation/release/release-gc.js +1 -1
- package/dist/foundation/release/update.js +0 -4
- package/dist/foundation/storage/control-store.js +0 -12
- package/dist/integrations/pi/components/components.js +0 -16
- package/dist/integrations/pi/components/index.d.ts +3 -3
- package/dist/integrations/pi/components/index.js +2 -2
- package/dist/integrations/pi/components/models-dialog.js +1 -30
- package/dist/integrations/pi/components/shell-editor-autocomplete.js +11 -9
- package/dist/integrations/pi/components/shell-extension-ui.d.ts +3 -3
- package/dist/integrations/pi/components/shell-extension-ui.js +6 -2
- package/dist/integrations/pi/components/shell-presenters-transcript.js +4 -4
- package/dist/integrations/pi/components/shell-shared-facade.d.ts +21 -1
- package/dist/integrations/pi/components/shell-shared-facade.js +18 -2
- package/dist/integrations/pi/components/upstream/theme/theme.d.ts +5 -1
- package/dist/integrations/pi/components/upstream/theme/theme.js +20 -2
- 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/resource-catalog.d.ts +4 -23
- 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-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/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/tui-runtime/adapter.js +0 -2
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +7 -0
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.js +66 -1
- 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/ui/settings/declarations.d.ts +13 -1
- package/dist/ui/settings/declarations.js +12 -1
- package/dist/ui/settings/migrations.js +7 -0
- package/docs/architecture/boundaries.md +9 -1
- package/docs/architecture/project-structure.md +3 -2
- package/package.json +1 -1
- 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,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 {};
|
|
@@ -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";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DIALOG_BACK_SHORTCUT_HINT, DIALOG_CLOSE_SHORTCUT_HINT } from "../../contracts/presentation/index.js";
|
|
2
|
-
import { GLOBAL_SCOPE, LineInput, PLAIN_THEME, ShortcutRegistry, assertNoShortcutConflicts, blockJumpTarget, numericValues, RAIL_COLUMNS, renderDialogPanel, renderSteppedDialogPanel, renderEmptyState, renderGroupHeader, renderInputRow, renderListRow, renderNote, renderShortcutHintsWithClose, menuRowAt, regionAt, renderValueMenu, withScrollbarRail, stepperEnds, steppedValue, truncateToWidth, valueColumnFor, valueMenuFrame, blockRowSpan, displayWidth, handleLineInputKey, humanizeLabel, humanizeTitle, indexOfKey,
|
|
3
|
-
import { SETTINGS_APP_ID
|
|
2
|
+
import { GLOBAL_SCOPE, LineInput, PLAIN_THEME, ShortcutRegistry, assertNoShortcutConflicts, blockJumpTarget, numericValues, RAIL_COLUMNS, renderDialogPanel, renderSteppedDialogPanel, renderEmptyState, renderGroupHeader, renderInputRow, renderListRow, renderNote, renderShortcutHintsWithClose, menuRowAt, regionAt, renderValueMenu, withScrollbarRail, stepperEnds, steppedValue, truncateToWidth, valueColumnFor, valueMenuFrame, blockRowSpan, displayWidth, handleLineInputKey, humanizeLabel, humanizeTitle, indexOfKey, layoutList, moveSelection, rowKey, scrollForSelection, scrollForTrackPage, scrollbarGeometry, scrollbarPresentation, ScrollbarRails, scrollbarWheelRows, selectableIndexes, } from "../../ui/components/index.js";
|
|
3
|
+
import { SETTINGS_APP_ID } from "./settings-route.js";
|
|
4
4
|
export { SETTINGS_APP_ID, SETTINGS_ROUTE } from "./settings-route.js";
|
|
5
5
|
const SCOPE = SETTINGS_APP_ID;
|
|
6
6
|
const SETTINGS_TOP_RULE_ROWS = 1;
|
|
@@ -265,8 +265,10 @@ export class SettingsApp {
|
|
|
265
265
|
const row = rows[selected];
|
|
266
266
|
if (row?.kind === "element" && row.value.structured)
|
|
267
267
|
this.#openStructured(row.value);
|
|
268
|
-
else
|
|
268
|
+
else if (row?.kind === "element" && typeof this.#shownValue(row.value) === "number")
|
|
269
269
|
this.#cycle(rows, selected, 1);
|
|
270
|
+
else
|
|
271
|
+
this.#openMenu(rows, selected, true);
|
|
270
272
|
return { consumed: true };
|
|
271
273
|
}
|
|
272
274
|
case "move-up":
|
|
@@ -334,11 +336,11 @@ export class SettingsApp {
|
|
|
334
336
|
return { consumed: true, render: false };
|
|
335
337
|
if (overRow === null) {
|
|
336
338
|
// Invariant: a press anywhere else dismisses the menu rather than acting through it.
|
|
337
|
-
this.#menu
|
|
339
|
+
this.#closeMenu(menu);
|
|
338
340
|
return { consumed: true };
|
|
339
341
|
}
|
|
340
342
|
const value = menu.choices[overRow];
|
|
341
|
-
this.#menu
|
|
343
|
+
this.#closeMenu(menu);
|
|
342
344
|
if (value !== undefined)
|
|
343
345
|
this.#apply(menu.entry, value);
|
|
344
346
|
return { consumed: true };
|
|
@@ -442,7 +444,7 @@ export class SettingsApp {
|
|
|
442
444
|
clearTimeout(this.#activityTimer);
|
|
443
445
|
this.#activityTimer = undefined;
|
|
444
446
|
}
|
|
445
|
-
#openMenu(rows, selected) {
|
|
447
|
+
#openMenu(rows, selected, selectCurrent = false) {
|
|
446
448
|
const row = rows[selected];
|
|
447
449
|
if (row === undefined || row.kind !== "element")
|
|
448
450
|
return;
|
|
@@ -461,9 +463,30 @@ export class SettingsApp {
|
|
|
461
463
|
return;
|
|
462
464
|
}
|
|
463
465
|
const current = shown === null ? 0 : Math.max(0, entry.choices.indexOf(shown));
|
|
464
|
-
|
|
465
|
-
//
|
|
466
|
-
|
|
466
|
+
const anchorKey = `${entry.backend}:${entry.id}`;
|
|
467
|
+
// Compatibility: pointer opening already brightens the source value. Enter borrows that
|
|
468
|
+
// same value-region state for the life of its menu rather than inventing a keyboard color.
|
|
469
|
+
if (selectCurrent) {
|
|
470
|
+
this.#hoverKey = anchorKey;
|
|
471
|
+
this.#hoverRegion = "value";
|
|
472
|
+
}
|
|
473
|
+
// Invariant: pointer opening stays inactive because it targeted the setting value, while
|
|
474
|
+
// Enter explicitly starts keyboard choice navigation at the value already in effect.
|
|
475
|
+
this.#menu = {
|
|
476
|
+
entry,
|
|
477
|
+
current,
|
|
478
|
+
anchorKey,
|
|
479
|
+
choices: entry.choices,
|
|
480
|
+
keyboardOpened: selectCurrent,
|
|
481
|
+
index: selectCurrent ? current : -1,
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
#closeMenu(menu) {
|
|
485
|
+
this.#menu = null;
|
|
486
|
+
if (!menu.keyboardOpened || this.#hoverKey !== menu.anchorKey)
|
|
487
|
+
return;
|
|
488
|
+
this.#hoverKey = null;
|
|
489
|
+
this.#hoverRegion = "label";
|
|
467
490
|
}
|
|
468
491
|
// Rationale: a structured setting opens as its own flag list rather than a value menu.
|
|
469
492
|
#openStructured(entry) {
|
|
@@ -640,12 +663,12 @@ export class SettingsApp {
|
|
|
640
663
|
return { consumed: false };
|
|
641
664
|
const key = KEYS[data] ?? data;
|
|
642
665
|
if (SETTINGS_SHORTCUTS.resolve(key, SCOPE) === "undo") {
|
|
643
|
-
this.#menu
|
|
666
|
+
this.#closeMenu(menu);
|
|
644
667
|
this.#undo();
|
|
645
668
|
return { consumed: true };
|
|
646
669
|
}
|
|
647
670
|
if (key === "escape") {
|
|
648
|
-
this.#menu
|
|
671
|
+
this.#closeMenu(menu);
|
|
649
672
|
return { consumed: true };
|
|
650
673
|
}
|
|
651
674
|
if (key === "up" || key === "down") {
|
|
@@ -656,7 +679,7 @@ export class SettingsApp {
|
|
|
656
679
|
}
|
|
657
680
|
else if (key === "enter") {
|
|
658
681
|
const value = menu.choices[menu.index];
|
|
659
|
-
this.#menu
|
|
682
|
+
this.#closeMenu(menu);
|
|
660
683
|
if (value !== undefined)
|
|
661
684
|
this.#apply(menu.entry, value);
|
|
662
685
|
}
|
|
@@ -1084,9 +1107,6 @@ function changeFailure(outcome) {
|
|
|
1084
1107
|
function labelOf(entry) {
|
|
1085
1108
|
return entry.label ?? humanizeLabel(entry.id);
|
|
1086
1109
|
}
|
|
1087
|
-
function isStepper(entry, shown = entry.value) {
|
|
1088
|
-
return typeof shown === "number" && entry.editable;
|
|
1089
|
-
}
|
|
1090
1110
|
/** Where a setting's number may go: what the engine states, or what it offers. */
|
|
1091
1111
|
function rangeOf(entry) {
|
|
1092
1112
|
return { minimum: entry.minimum, maximum: entry.maximum, values: numericValues(entry.choices) };
|
|
@@ -2,7 +2,6 @@ import { spawn } from "node:child_process";
|
|
|
2
2
|
import { restoreAfterOwnedExit } from "../terminal-cleanup/index.js";
|
|
3
3
|
import { chmod, mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
4
4
|
import { connect } from "node:net";
|
|
5
|
-
import { platform } from "node:os";
|
|
6
5
|
import { resolve } from "node:path";
|
|
7
6
|
import { selectCohortLaunch } from "./cohort-selection.js";
|
|
8
7
|
import { selectOrdinaryLaunchReleaseId } from "./ordinary-launch-selection.js";
|
|
@@ -16,7 +15,7 @@ import { selectUpdateLaunchRelease } from "./update-launch.js";
|
|
|
16
15
|
import { consumeMaterializationProof, materializeRelease, readCertifiedReleaseManifest, readMaterializedRelease, resolveReleaseEntryPoint, verifyMaterializedRelease } from "./release-store.js";
|
|
17
16
|
import { scheduleReleaseCleanup } from "./release-gc.js";
|
|
18
17
|
import { createRestartSeal, readRestartCertifiedRelease, releaseCertificationDocument } from "./restart-certification.js";
|
|
19
|
-
import {
|
|
18
|
+
import { PRODUCT_TEXT } from "../../product-identity.js";
|
|
20
19
|
import { markStartupPhase } from "../startup/index.js";
|
|
21
20
|
import { launchContractTarget, readLaunchContext, withLaunchContext } from "../launch-context/index.js";
|
|
22
21
|
const RELEASE_RESELECTION_MESSAGE = "a1-release-reselection";
|
|
@@ -3,7 +3,7 @@ import { spawn } from "node:child_process";
|
|
|
3
3
|
import { lstat, mkdir, open, readFile, readdir, realpath, rename, rm, stat } from "node:fs/promises";
|
|
4
4
|
import { dirname, isAbsolute, relative, resolve, sep } from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
|
-
import { CohortStateStore,
|
|
6
|
+
import { CohortStateStore, } from "./cohort-state.js";
|
|
7
7
|
import { liveReleaseIds } from "./endpoints.js";
|
|
8
8
|
import { resolveProductPaths } from "../lifecycle/index.js";
|
|
9
9
|
import { RELEASE_MANIFEST_FILENAME } from "./release-store.js";
|
|
@@ -790,10 +790,6 @@ async function canonicalImmutableRoot(dataDir, releaseRoot) {
|
|
|
790
790
|
function samePath(left, right) {
|
|
791
791
|
return process.platform === "win32" ? resolve(left).toLowerCase() === resolve(right).toLowerCase() : resolve(left) === resolve(right);
|
|
792
792
|
}
|
|
793
|
-
function isContainedBy(parent, child) {
|
|
794
|
-
const pathFromParent = relative(parent, child);
|
|
795
|
-
return pathFromParent.length > 0 && pathFromParent !== ".." && !pathFromParent.startsWith(`..${sep}`) && !isAbsolute(pathFromParent);
|
|
796
|
-
}
|
|
797
793
|
function unsuccessfulCode(code) { return code === null || code === 0 ? 1 : code; }
|
|
798
794
|
function formatExitCode(code) { return code === null ? "unknown" : String(code); }
|
|
799
795
|
function errorMessage(error) { return error instanceof Error ? error.message : String(error); }
|
|
@@ -308,18 +308,6 @@ export class ControlStore {
|
|
|
308
308
|
close() {
|
|
309
309
|
this.database.close();
|
|
310
310
|
}
|
|
311
|
-
#transaction(operation) {
|
|
312
|
-
this.database.exec("BEGIN IMMEDIATE");
|
|
313
|
-
try {
|
|
314
|
-
const result = operation();
|
|
315
|
-
this.database.exec("COMMIT");
|
|
316
|
-
return result;
|
|
317
|
-
}
|
|
318
|
-
catch (error) {
|
|
319
|
-
this.database.exec("ROLLBACK");
|
|
320
|
-
throw error;
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
311
|
}
|
|
324
312
|
function launchInstanceFromRow(row) {
|
|
325
313
|
const instance = {
|
|
@@ -39,26 +39,10 @@ function requireBlock(block, kind) {
|
|
|
39
39
|
function blockPayload(block) {
|
|
40
40
|
return isRecord(block.payload) ? block.payload : {};
|
|
41
41
|
}
|
|
42
|
-
function blockProvider(block) {
|
|
43
|
-
return stringPayload(blockPayload(block), "provider") ?? "openai";
|
|
44
|
-
}
|
|
45
|
-
function blockModel(block) {
|
|
46
|
-
return stringPayload(blockPayload(block), "model") ?? "gpt-5";
|
|
47
|
-
}
|
|
48
42
|
function stringPayload(payload, key) {
|
|
49
43
|
const value = payload[key];
|
|
50
44
|
return typeof value === "string" && value.length > 0 ? value : undefined;
|
|
51
45
|
}
|
|
52
|
-
function emptyUsage() {
|
|
53
|
-
return {
|
|
54
|
-
input: 0,
|
|
55
|
-
output: 0,
|
|
56
|
-
cacheRead: 0,
|
|
57
|
-
cacheWrite: 0,
|
|
58
|
-
totalTokens: 0,
|
|
59
|
-
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
46
|
function isRecord(value) {
|
|
63
47
|
return typeof value === "object" && value !== null;
|
|
64
48
|
}
|
|
@@ -3,11 +3,11 @@ export { loadHistoryEditor, type HistoryEditorConstructor } from "./history-edit
|
|
|
3
3
|
export { PiComponentConformanceError, runPiComponentConformance } from "./conformance.js";
|
|
4
4
|
export type { PiComponentConformanceReport, PiComponentConformanceResult } from "./conformance.js";
|
|
5
5
|
export { createPiShellOperationLoader, createPiShellShareOperationDialog, type PiShellOperationLoaderPort, } from "./share-operation-dialog.js";
|
|
6
|
-
export { OWNED_BUILTIN_SLASH_COMMANDS, PINNED_PI_BUILTIN_SLASH_COMMANDS, componentFromPort, componentPort, createPiExtensionUiBridge, createPiQueuedInputStatus, createPiShellArmin, createPiShellAuthProviderSelector, createPiShellChangelog, createPiShellCollapsedChangelog, createPiShellDialog, createPiShellEarendilAnnouncement, createPiShellEditor, createPiShellExtensionSelector, createPiShellFooter, createPiShellHeader, createPiShellHotkeys, createPiShellLoadedResources, createPiShellLoginDialog, createPiShellModelSelector, createPiShellModelsDialog, createPiShellReloadBox, createPiShellScopedModelsSelector, createPiShellSelector, createPiShellSessionInfo, createPiShellSessionSelector, createPiShellSettingsSelector, createPiShellShowImagesSelector, createPiShellSkillsSelector, createPiShellStatus, createPiShellThemeSelector, createPiShellTranscriptComponent, createPiShellTreeSelector, createPiShellTrustSelector, createPiShellUserMessageSelector, createTuiFacade, ensureTheme, formatSessionTokens, isAutocompleteProvider, isPiPromptStyleCompaction, isRecord, paintPiSubmittedPromptTimestamp, piShellHyperlink, piShellTruncateToWidth, piShellVisibleWidth, renderPiShellChangelogLines, renderPiShellCommandMessage, renderPiShellHotkeysLines, renderPiShellPackageUpdateNotice, renderPiShellReleaseUpdateBanner, renderPiShellReleaseUpdateNotice, renderPiShellStartupDiagnostic, renderPiShellStatusText, renderPiShellTranscriptBlock, validatedAssistantMessage, } from "./shell-components.js";
|
|
6
|
+
export { OWNED_BUILTIN_SLASH_COMMANDS, PINNED_PI_BUILTIN_SLASH_COMMANDS, componentFromPort, componentPort, createPiExtensionUiBridge, createPiQueuedInputStatus, createPiShellArmin, createPiShellAuthProviderSelector, createPiShellChangelog, createPiShellCollapsedChangelog, createPiShellDialog, createPiShellEarendilAnnouncement, createPiShellEditor, createPiShellExtensionSelector, createPiShellFooter, createPiShellHeader, createPiShellHotkeys, createPiShellLoadedResources, createPiShellLoginDialog, createPiShellModelSelector, createPiShellModelsDialog, createPiShellReloadBox, createPiShellScopedModelsSelector, createPiShellSelector, createPiShellSessionInfo, createPiShellSessionSelector, createPiShellSettingsSelector, createPiShellShowImagesSelector, createPiShellSkillsSelector, createPiShellStatus, createPiShellThemeSelector, createPiShellTranscriptComponent, createPiShellTreeSelector, createPiShellTrustSelector, createPiShellUserMessageSelector, createTuiFacade, createPiKeybindingsHost, ensureTheme, formatSessionTokens, isAutocompleteProvider, isPiPromptStyleCompaction, isRecord, paintPiSubmittedPromptTimestamp, piShellHyperlink, piShellTruncateToWidth, piShellVisibleWidth, renderPiShellChangelogLines, renderPiShellCommandMessage, renderPiShellHotkeysLines, renderPiShellPackageUpdateNotice, renderPiShellReleaseUpdateBanner, renderPiShellReleaseUpdateNotice, renderPiShellStartupDiagnostic, renderPiShellStatusText, renderPiShellTranscriptBlock, validatedAssistantMessage, } from "./shell-components.js";
|
|
7
7
|
export { renderPiShellHotkeySections } from "./shell-hotkey-sections.js";
|
|
8
8
|
export type { PiShellHotkeySection } from "./shell-hotkey-sections.js";
|
|
9
|
-
export type { PiExtensionUiBridge, PiExtensionUiBridgeHost, PiShellAuthProviderOption, PiShellAutocompleteCommand, PiShellClipboardContent, PiShellCommandMessagePresentation, PiShellComponentPort, PiShellEditorBodyGeometry, PiShellEditorOptions, PiShellEditorPointerEvent, PiShellEditorPort, PiShellEditorTextRange, PiShellExtensionRendererResolver, PiShellHeaderOptions, PiShellHeaderPort, PiShellHotkeysPresentation, PiShellImageAssetResolver, PiShellLoadedResourcesPort, PiShellLoginDialogPort, PiShellModelSelectorOptions, PiShellModelsDialogOptions, PiShellModelsDialogPort, PiShellPasteReservation, PiShellQueuedInputPort, PiShellResourceEntry, PiShellResourceSection, PiShellScopedModelDescriptor, PiShellScopedModelsSelectorOptions, PiShellScopedModelsSelectorPort, PiShellSelectorOption, PiShellSelectorOptions, PiShellSessionInfoPresentation, PiShellSettingsSelectorOptions, PiShellStartupNotice, PiShellStatusPlacement, PiShellStatusPort, PiShellSubmittedPromptComposer, PiShellTranscriptComponentPort, PiShellViewComponentPort, } from "./shell-components.js";
|
|
10
|
-
export { PINNED_PI_LAYOUT, applyConfiguredPiTheme, applyPiTheme, applyPiThemeInstance, currentPiAccentColor, currentPiThemeName, derivePiAccentProjection, detectPiTerminalBackgroundFromEnv, detectPiTerminalBackgroundTheme, detectPiTerminalThemeForAuto, ensurePiTheme, getAvailablePiThemes, getPiSelectListTheme, loadPiTheme, onPiThemeChange, parsePiAutoThemeSetting, piTheme, resolvePiThemeSetting, setPiAccentColor, setPiPackageBorderProjectionEnabled, stopPiThemeWatcher, } from "./theme.js";
|
|
9
|
+
export type { PiExtensionUiBridge, PiExtensionUiBridgeHost, PiShellAuthProviderOption, PiShellAutocompleteCommand, PiShellClipboardContent, PiShellCommandMessagePresentation, PiShellComponentPort, PiShellEditorBodyGeometry, PiShellEditorOptions, PiShellEditorPointerEvent, PiKeybindingsHost, PiShellEditorPort, PiShellEditorTextRange, PiShellExtensionRendererResolver, PiShellHeaderOptions, PiShellHeaderPort, PiShellHotkeysPresentation, PiShellImageAssetResolver, PiShellLoadedResourcesPort, PiShellLoginDialogPort, PiShellModelSelectorOptions, PiShellModelsDialogOptions, PiShellModelsDialogPort, PiShellPasteReservation, PiShellQueuedInputPort, PiShellResourceEntry, PiShellResourceSection, PiShellScopedModelDescriptor, PiShellScopedModelsSelectorOptions, PiShellScopedModelsSelectorPort, PiShellSelectorOption, PiShellSelectorOptions, PiShellSessionInfoPresentation, PiShellSettingsSelectorOptions, PiShellStartupNotice, PiShellStatusPlacement, PiShellStatusPort, PiShellSubmittedPromptComposer, PiShellTranscriptComponentPort, PiShellViewComponentPort, } from "./shell-components.js";
|
|
10
|
+
export { PINNED_PI_LAYOUT, applyConfiguredPiTheme, applyPiTheme, applyPiThemeInstance, currentPiAccentColor, currentPiThemeName, derivePiAccentProjection, derivePiCanvasBackground, detectPiTerminalBackgroundFromEnv, detectPiTerminalBackgroundTheme, detectPiTerminalThemeForAuto, ensurePiTheme, getAvailablePiThemes, getPiSelectListTheme, loadPiTheme, onPiThemeChange, parsePiAutoThemeSetting, piCanvasBackgroundAnsi, piTheme, resolvePiThemeSetting, setPiAccentColor, setPiPackageBorderProjectionEnabled, stopPiThemeWatcher, } from "./theme.js";
|
|
11
11
|
export type { PiAccentProjection, PiColorMode, PiTerminalTheme, PiTerminalThemeDetection, PiTerminalThemeDetector, PiThemeBackground, PiThemeResult } from "./theme.js";
|
|
12
12
|
export { OwnedPiThemeController } from "./upstream/theme/theme-controller.js";
|
|
13
13
|
export type { PiThemeRuntimePort, PiThemeSettingsPort } from "./upstream/theme/theme-controller.js";
|