@bobannomi/app-host 0.1.0-next.1 → 0.1.1
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/README.md +3 -3
- package/dist/index.d.ts +111 -131
- package/dist/index.js +477 -242
- package/dist/index.js.map +3 -3
- package/dist/node/service-host.d.ts +114 -336
- package/dist/node/service-host.js +88 -153
- package/dist/node/service-host.js.map +3 -3
- package/dist/protocol.d.ts +492 -513
- package/dist/protocol.js +220 -140
- package/dist/protocol.js.map +3 -3
- package/package.json +3 -3
package/dist/protocol.d.ts
CHANGED
|
@@ -85,6 +85,20 @@ interface AppWindowMaterialState {
|
|
|
85
85
|
shell: "solid" | "translucent" | "transparent";
|
|
86
86
|
unavailableReason: "unsupported-platform" | "unsupported-system" | "reduced-transparency" | "material-error" | null;
|
|
87
87
|
}
|
|
88
|
+
/** Host update facts for a custom title bar. Actions stay in the host's About window. */
|
|
89
|
+
type AppWindowUpdateState = {
|
|
90
|
+
status: "idle" | "checking" | "error";
|
|
91
|
+
} | {
|
|
92
|
+
status: "available" | "downloaded";
|
|
93
|
+
version: string;
|
|
94
|
+
} | {
|
|
95
|
+
status: "downloading";
|
|
96
|
+
version: string;
|
|
97
|
+
percent: number;
|
|
98
|
+
};
|
|
99
|
+
type AppWindowUpdateCheckResult = AppWindowUpdateState | {
|
|
100
|
+
status: "unsupported";
|
|
101
|
+
};
|
|
88
102
|
interface AppWindowState {
|
|
89
103
|
platform: "win32" | "darwin" | "linux";
|
|
90
104
|
maximized: boolean;
|
|
@@ -92,6 +106,7 @@ interface AppWindowState {
|
|
|
92
106
|
/** Horizontal space to reserve inside the application's title bar, in page coordinates. */
|
|
93
107
|
trafficLightInset: number;
|
|
94
108
|
material: AppWindowMaterialState;
|
|
109
|
+
update?: AppWindowUpdateState;
|
|
95
110
|
}
|
|
96
111
|
interface AppWindowOpenHostInput {
|
|
97
112
|
page: "manage" | "settings" | "about" | "recovery";
|
|
@@ -106,12 +121,16 @@ interface WindowStateChanged {
|
|
|
106
121
|
type: "window-state-changed";
|
|
107
122
|
state: AppWindowState;
|
|
108
123
|
}
|
|
109
|
-
declare const WINDOW_METHODS: readonly ["window.getState", "window.minimize", "window.toggleMaximize", "window.requestClose", "window.openHost", "window.reportStartup"];
|
|
124
|
+
declare const WINDOW_METHODS: readonly ["window.getState", "window.checkForUpdates", "window.minimize", "window.toggleMaximize", "window.requestClose", "window.openHost", "window.reportStartup"];
|
|
110
125
|
interface WindowMethodMap {
|
|
111
126
|
"window.getState": {
|
|
112
127
|
params: Record<string, never>;
|
|
113
128
|
result: AppWindowState;
|
|
114
129
|
};
|
|
130
|
+
"window.checkForUpdates": {
|
|
131
|
+
params: Record<string, never>;
|
|
132
|
+
result: AppWindowUpdateCheckResult;
|
|
133
|
+
};
|
|
115
134
|
"window.minimize": {
|
|
116
135
|
params: Record<string, never>;
|
|
117
136
|
result: void;
|
|
@@ -141,6 +160,7 @@ declare function validWindowResult(method: WindowMethod, value: unknown): boolea
|
|
|
141
160
|
declare function validWindowEvent(value: unknown): value is WindowStateChanged;
|
|
142
161
|
interface AppHostWindow {
|
|
143
162
|
getState(): Promise<AppWindowState>;
|
|
163
|
+
checkForUpdates(): Promise<AppWindowUpdateCheckResult>;
|
|
144
164
|
onStateChanged(listener: (state: AppWindowState) => void): () => void;
|
|
145
165
|
minimize(): Promise<void>;
|
|
146
166
|
toggleMaximize(): Promise<void>;
|
|
@@ -150,7 +170,7 @@ interface AppHostWindow {
|
|
|
150
170
|
reportStartup(input: AppWindowStartupResult): Promise<void>;
|
|
151
171
|
}
|
|
152
172
|
interface WindowRequester {
|
|
153
|
-
requireFeature(): void;
|
|
173
|
+
requireFeature(feature?: "window-update-check-v1"): void;
|
|
154
174
|
request<M extends WindowMethod>(method: M, params: WindowMethodMap[M]["params"]): Promise<WindowMethodMap[M]["result"]>;
|
|
155
175
|
onEvent(listener: (event: AppHostEvent) => void): () => void;
|
|
156
176
|
}
|
|
@@ -209,544 +229,520 @@ declare class AppHostError extends Error {
|
|
|
209
229
|
});
|
|
210
230
|
}
|
|
211
231
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
model?: {
|
|
218
|
-
provider: string;
|
|
219
|
-
model: string;
|
|
220
|
-
};
|
|
221
|
-
roleId?: string | null;
|
|
222
|
-
systemPrompt?: string | null;
|
|
223
|
-
executionInstructions?: {
|
|
224
|
-
revision: number;
|
|
225
|
-
content: string;
|
|
226
|
-
} | null;
|
|
227
|
-
effort?: string | null;
|
|
228
|
-
workMode?: "execute" | "plan";
|
|
229
|
-
maxTurns?: number;
|
|
230
|
-
sessionMode?: "direct" | "coordinator";
|
|
231
|
-
replyStyle?: ReplyStyle;
|
|
232
|
-
approvalMode?: "ask" | "auto_review" | "full_access";
|
|
233
|
-
tools?: {
|
|
234
|
-
allowed?: string[];
|
|
235
|
-
denied?: string[];
|
|
236
|
-
};
|
|
237
|
-
pluginsEnabled?: boolean;
|
|
238
|
-
pluginAutoSelectionEnabled?: boolean;
|
|
239
|
-
activePluginId?: string | null;
|
|
240
|
-
pluginIds?: string[];
|
|
241
|
-
serviceBindings?: string[];
|
|
242
|
-
memory?: {
|
|
243
|
-
enabled: boolean;
|
|
244
|
-
};
|
|
245
|
-
}
|
|
246
|
-
interface ResolvedSessionConfiguration extends Required<Omit<SessionConfigurationInput, "tools">> {
|
|
247
|
-
tools: {
|
|
248
|
-
allowed: string[];
|
|
249
|
-
denied: string[];
|
|
250
|
-
};
|
|
251
|
-
}
|
|
252
|
-
interface SessionConfigurationSnapshot {
|
|
253
|
-
revision: number;
|
|
254
|
-
configuration: ResolvedSessionConfiguration;
|
|
255
|
-
configurationRoot: {
|
|
256
|
-
cwd: string;
|
|
257
|
-
settingsRoot: string;
|
|
258
|
-
};
|
|
232
|
+
interface ServiceStatus {
|
|
233
|
+
state: "absent" | "unauthorized" | "stopped" | "starting" | "recovering" | "ready" | "failed";
|
|
234
|
+
reason?: "dependency_missing" | "service_start_failed" | "service_unavailable" | "result_unknown" | "incompatible" | "revoked";
|
|
235
|
+
instanceId?: string;
|
|
236
|
+
apiVersion?: string;
|
|
259
237
|
}
|
|
260
|
-
interface
|
|
261
|
-
dataScopeId: string;
|
|
262
|
-
sessionId: string;
|
|
238
|
+
interface ServiceWork {
|
|
263
239
|
requestId: string;
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
}
|
|
269
|
-
interface SessionConfigurationBinding {
|
|
270
|
-
revision: number;
|
|
271
|
-
/** Explicit creation choices plus subsequent editor deltas; never accepted as public metadata. */
|
|
272
|
-
configurationInput?: SessionConfigurationInput;
|
|
273
|
-
/** Original non-role defaults for fields that role selection can replace. */
|
|
274
|
-
roleBaseConfiguration?: SessionConfigurationInput;
|
|
275
|
-
effectiveConfiguration: ResolvedSessionConfiguration;
|
|
276
|
-
resolvedResources: (ConfigurationResourceRef & {
|
|
277
|
-
revision: string;
|
|
278
|
-
})[];
|
|
279
|
-
defaultsRevision: string;
|
|
280
|
-
configurationRoot: {
|
|
281
|
-
cwd: string;
|
|
282
|
-
settingsRoot: string;
|
|
283
|
-
};
|
|
240
|
+
state: ServiceWorkState;
|
|
241
|
+
updatedAt: string;
|
|
242
|
+
result?: JsonValue;
|
|
243
|
+
error?: JsonValue;
|
|
284
244
|
}
|
|
285
|
-
interface
|
|
286
|
-
|
|
287
|
-
|
|
245
|
+
interface ServiceConnectionDescriptor {
|
|
246
|
+
connectionId: string;
|
|
247
|
+
baseUrl: string;
|
|
248
|
+
apiVersion: string;
|
|
288
249
|
}
|
|
289
250
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
type
|
|
300
|
-
|
|
251
|
+
declare const APP_HOST_FEATURES: readonly ["fetch-v1", "fetch-inline-body-v1", "fetch-target-close-v1", "service-v1", "extended-errors-v1", "workspace-v1", "session-resources-v1", "session-controls-v1", "conversation-creation-session-v1", "trusted-desktop-v1", "attachments-v1", "auxiliary-sessions-v1", "system-ui-v1", "lifecycle-v1", "commands-v1", "resource-catalog-v1", "file-content-v1", "window-chrome-v1", "window-updates-v1", "window-update-check-v1", "embedded-browser-v1", "browser-binding-invalidation-v1", "browser-capture-preview-v1"];
|
|
252
|
+
type AppHostFeature = (typeof APP_HOST_FEATURES)[number];
|
|
253
|
+
declare const FETCH_CHUNK_BYTES: number;
|
|
254
|
+
declare const FETCH_INLINE_BODY_BYTES: number;
|
|
255
|
+
declare const FETCH_WINDOW_CHUNKS = 4;
|
|
256
|
+
declare const FETCH_MAX_STREAMS = 16;
|
|
257
|
+
declare const FETCH_METADATA_BYTES: number;
|
|
258
|
+
declare const FETCH_HEADERS_TIMEOUT_MS = 30000;
|
|
259
|
+
declare const FETCH_IDLE_TIMEOUT_MS = 120000;
|
|
260
|
+
type FetchDirection = "upload" | "download";
|
|
261
|
+
type PageFetchFrame = {
|
|
262
|
+
protocol: 2;
|
|
263
|
+
} & ({
|
|
264
|
+
type: "fetch-open";
|
|
265
|
+
id: string;
|
|
266
|
+
connectionId: string;
|
|
267
|
+
url: string;
|
|
268
|
+
method: string;
|
|
269
|
+
headers: [string, string][];
|
|
270
|
+
hasBody: boolean;
|
|
271
|
+
inlineBody?: string;
|
|
301
272
|
} | {
|
|
302
|
-
|
|
303
|
-
|
|
273
|
+
type: "fetch-headers";
|
|
274
|
+
id: string;
|
|
275
|
+
status: number;
|
|
276
|
+
statusText: string;
|
|
277
|
+
headers: [string, string][];
|
|
278
|
+
hasBody: boolean;
|
|
304
279
|
} | {
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
280
|
+
type: "fetch-credit";
|
|
281
|
+
id: string;
|
|
282
|
+
direction: FetchDirection;
|
|
283
|
+
sequence: number;
|
|
284
|
+
chunks: number;
|
|
285
|
+
bytes: number;
|
|
308
286
|
} | {
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
287
|
+
type: "fetch-chunk";
|
|
288
|
+
id: string;
|
|
289
|
+
direction: FetchDirection;
|
|
290
|
+
sequence: number;
|
|
291
|
+
bytes: Uint8Array;
|
|
314
292
|
} | {
|
|
315
|
-
|
|
316
|
-
readonly sessionId: string;
|
|
317
|
-
readonly requestId: string;
|
|
318
|
-
};
|
|
319
|
-
/** Frozen alongside configuration when work is accepted, then copied to Input/Run. */
|
|
320
|
-
interface SessionExecutionBinding {
|
|
321
|
-
readonly version: 1;
|
|
322
|
-
readonly cwd: SessionExecutionRoot;
|
|
323
|
-
readonly settingsRoot: SessionExecutionRoot;
|
|
324
|
-
readonly source: SessionExecutionSource;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
/**
|
|
328
|
-
* `closing` 表示 Session 正在停止当前工作并等待资源释放,此时不再接收新工作。
|
|
329
|
-
* 等待结束后,Session 会进入不可逆的 archived 状态。
|
|
330
|
-
*/
|
|
331
|
-
type SessionStatus = "idle" | "running" | "closing" | "archived" | "error";
|
|
332
|
-
type SessionStorage = "sqlite" | "memory";
|
|
333
|
-
interface SessionRecord {
|
|
293
|
+
type: "fetch-end";
|
|
334
294
|
id: string;
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
295
|
+
direction: FetchDirection;
|
|
296
|
+
sequence: number;
|
|
297
|
+
} | {
|
|
298
|
+
type: "fetch-consumed";
|
|
299
|
+
id: string;
|
|
300
|
+
direction: "download";
|
|
301
|
+
sequence: number;
|
|
302
|
+
} | {
|
|
303
|
+
type: "fetch-cancel";
|
|
304
|
+
id: string;
|
|
305
|
+
} | {
|
|
306
|
+
type: "fetch-error";
|
|
307
|
+
id: string;
|
|
308
|
+
error: AppHostErrorInfo;
|
|
309
|
+
} | {
|
|
310
|
+
type: "fetch-close";
|
|
311
|
+
connectionId: string;
|
|
312
|
+
});
|
|
313
|
+
/** Plain-data validation runs before reading fields; accessors and hidden properties are invalid. */
|
|
314
|
+
declare function isPageFetchFrame(value: unknown): value is PageFetchFrame;
|
|
315
|
+
/** This URL is only an opaque document-local descriptor; it is never fetched over a network. */
|
|
316
|
+
declare function pageFetchPath(baseUrl: string, input: string): string;
|
|
317
|
+
|
|
318
|
+
interface ServiceContext {
|
|
319
|
+
protocolVersion: 1;
|
|
320
|
+
registrationId: string;
|
|
321
|
+
instanceId: string;
|
|
322
|
+
dataScopeId: string;
|
|
323
|
+
scope: {
|
|
324
|
+
appId: string;
|
|
325
|
+
installationId: string;
|
|
326
|
+
contentDigest: string;
|
|
347
327
|
};
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
archivedAt?: number;
|
|
328
|
+
installationRevision: number;
|
|
329
|
+
phase: "starting" | "ready";
|
|
351
330
|
}
|
|
352
|
-
|
|
353
|
-
|
|
331
|
+
interface ServiceInvocation {
|
|
332
|
+
invocationId: string;
|
|
354
333
|
dataScopeId: string;
|
|
355
|
-
requestId: string;
|
|
356
334
|
sessionId: string;
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
taskLocation: "current" | "worktree";
|
|
360
|
-
configuration: SessionConfigurationInput;
|
|
361
|
-
preparationRevision?: string;
|
|
362
|
-
}
|
|
363
|
-
interface WorkspaceConversationResult extends SessionCreationReceipt {
|
|
364
|
-
session?: SessionRecord;
|
|
365
|
-
operationState?: "prepared" | "running" | "completed" | "failed" | "unknown";
|
|
366
|
-
indexBindingPending?: true;
|
|
335
|
+
runId: string;
|
|
336
|
+
inputId?: string;
|
|
367
337
|
workspaceId?: string;
|
|
368
338
|
executionRoot?: string;
|
|
369
339
|
privateSessionId?: string;
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
340
|
+
}
|
|
341
|
+
interface CreateWorktree {
|
|
342
|
+
requestId: string;
|
|
343
|
+
workspaceId: string;
|
|
344
|
+
expectedHead: string;
|
|
345
|
+
branch: string;
|
|
346
|
+
}
|
|
347
|
+
interface WorktreeQuery {
|
|
348
|
+
requestId: string;
|
|
349
|
+
original: Omit<CreateWorktree, "requestId">;
|
|
350
|
+
}
|
|
351
|
+
interface WorktreeReceipt {
|
|
352
|
+
requestId: string;
|
|
353
|
+
state: "accepted" | "completed" | "failed" | "unknown";
|
|
354
|
+
result?: {
|
|
355
|
+
executionRoot: string;
|
|
356
|
+
workspaceId: string;
|
|
373
357
|
branch: string;
|
|
374
358
|
sourceHead: string;
|
|
375
|
-
projectId: string;
|
|
376
|
-
projectPath: string;
|
|
377
|
-
configDir: string;
|
|
378
|
-
environment: "native" | "wsl";
|
|
379
|
-
distribution?: string;
|
|
380
359
|
};
|
|
381
360
|
}
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
}
|
|
387
|
-
interface DraftComposerTarget {
|
|
388
|
-
source: "instance";
|
|
389
|
-
workspaceId?: string;
|
|
390
|
-
outsideProject?: boolean;
|
|
391
|
-
roleId?: string | null;
|
|
361
|
+
interface RootReleaseReceipt {
|
|
362
|
+
requestId: string;
|
|
363
|
+
executionRoot: string;
|
|
364
|
+
state: "released" | "retained-dirty" | "in-use" | "unknown";
|
|
392
365
|
}
|
|
393
|
-
interface
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
})[];
|
|
400
|
-
plugins: (ControlOption & {
|
|
401
|
-
agents: ControlOption[];
|
|
402
|
-
})[];
|
|
366
|
+
interface GitStatus {
|
|
367
|
+
root: string;
|
|
368
|
+
commonDir: string;
|
|
369
|
+
head: string;
|
|
370
|
+
branch: string;
|
|
371
|
+
changes: string[];
|
|
403
372
|
}
|
|
404
|
-
type
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
373
|
+
type Entry$1<P, R> = {
|
|
374
|
+
params: P;
|
|
375
|
+
result: R;
|
|
376
|
+
};
|
|
377
|
+
interface ServiceHostMethodMap {
|
|
378
|
+
"secrets.get": Entry$1<{
|
|
379
|
+
key: string;
|
|
380
|
+
}, string | null>;
|
|
381
|
+
"secrets.set": Entry$1<{
|
|
382
|
+
key: string;
|
|
383
|
+
value: string;
|
|
384
|
+
}, {
|
|
385
|
+
stored: true;
|
|
386
|
+
}>;
|
|
387
|
+
"secrets.delete": Entry$1<{
|
|
388
|
+
key: string;
|
|
389
|
+
}, {
|
|
390
|
+
deleted: true;
|
|
391
|
+
}>;
|
|
392
|
+
"context.get": Entry$1<Record<string, never>, ServiceContext>;
|
|
393
|
+
"context.resolveInvocation": Entry$1<{
|
|
394
|
+
ticket: string;
|
|
395
|
+
}, ServiceInvocation>;
|
|
396
|
+
"agent.listModels": Entry$1<Record<string, never>, {
|
|
397
|
+
id: string;
|
|
398
|
+
name: string;
|
|
399
|
+
}[]>;
|
|
400
|
+
"agent.getConnection": Entry$1<{
|
|
401
|
+
workspaceId?: string;
|
|
402
|
+
executionRoot?: string;
|
|
403
|
+
privateSessionId?: string;
|
|
404
|
+
}, {
|
|
405
|
+
connectionId: string;
|
|
406
|
+
baseUrl: string;
|
|
407
|
+
}>;
|
|
408
|
+
"agent.resolveSkills": Entry$1<{
|
|
409
|
+
skillIds: string[];
|
|
410
|
+
}, {
|
|
411
|
+
type: "skill";
|
|
412
|
+
name: string;
|
|
419
413
|
path: string;
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
414
|
+
}[]>;
|
|
415
|
+
"sessions.getConnection": Entry$1<{
|
|
416
|
+
dataScopeId: string;
|
|
417
|
+
sessionId: string;
|
|
418
|
+
}, {
|
|
419
|
+
connectionId: string;
|
|
420
|
+
baseUrl: string;
|
|
421
|
+
}>;
|
|
422
|
+
"workspace.gitStatus": Entry$1<{
|
|
423
|
+
workspaceId: string;
|
|
424
|
+
}, GitStatus>;
|
|
425
|
+
"workspace.createTaskWorktree": Entry$1<CreateWorktree, WorktreeReceipt>;
|
|
426
|
+
"workspace.getWorktree": Entry$1<WorktreeQuery, WorktreeReceipt | null>;
|
|
427
|
+
"workspace.releaseExecutionRoot": Entry$1<{
|
|
431
428
|
requestId: string;
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
|
|
429
|
+
workspaceId: string;
|
|
430
|
+
executionRoot: string;
|
|
431
|
+
}, RootReleaseReceipt>;
|
|
432
|
+
"work.list": Entry$1<Record<string, never>, ServiceWork[]>;
|
|
433
|
+
"work.get": Entry$1<{
|
|
437
434
|
requestId: string;
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
435
|
+
}, ServiceWork | null>;
|
|
436
|
+
}
|
|
437
|
+
type ServiceHostMethod = keyof ServiceHostMethodMap;
|
|
438
|
+
declare const SERVICE_HOST_METHODS: readonly ["secrets.get", "secrets.set", "secrets.delete", "context.get", "context.resolveInvocation", "agent.listModels", "agent.getConnection", "agent.resolveSkills", "sessions.getConnection", "workspace.gitStatus", "workspace.createTaskWorktree", "workspace.getWorktree", "workspace.releaseExecutionRoot", "work.list", "work.get"];
|
|
439
|
+
declare const SERVICE_HOST_MAX_FRAME_BYTES: number;
|
|
440
|
+
declare const SERVICE_HOST_MAX_PENDING = 64;
|
|
441
|
+
declare const validServiceContext: (v: unknown) => v is ServiceContext;
|
|
442
|
+
declare function validServiceHostInput(method: ServiceHostMethod, v: unknown): boolean;
|
|
443
|
+
declare function validServiceHostResult(method: ServiceHostMethod, v: unknown): boolean;
|
|
444
|
+
type ServiceHostFrame = PageFetchFrame | {
|
|
445
|
+
protocol: 1;
|
|
446
|
+
type: "service-host-connect";
|
|
447
|
+
id: string;
|
|
448
|
+
} | {
|
|
449
|
+
protocol: 1;
|
|
450
|
+
type: "service-host-ready";
|
|
451
|
+
id: string;
|
|
452
|
+
context: ServiceContext;
|
|
453
|
+
} | {
|
|
454
|
+
protocol: 1;
|
|
455
|
+
type: "service-host-context";
|
|
456
|
+
context: ServiceContext;
|
|
457
|
+
} | {
|
|
458
|
+
protocol: 1;
|
|
459
|
+
type: "service-host-request";
|
|
460
|
+
id: string;
|
|
461
|
+
method: ServiceHostMethod;
|
|
462
|
+
params: ServiceHostMethodMap[ServiceHostMethod]["params"];
|
|
463
|
+
} | ({
|
|
464
|
+
protocol: 1;
|
|
465
|
+
type: "service-host-response";
|
|
466
|
+
id: string;
|
|
467
|
+
} & ({
|
|
468
|
+
ok: true;
|
|
469
|
+
value: unknown;
|
|
470
|
+
} | {
|
|
471
|
+
ok: false;
|
|
472
|
+
error: AppHostErrorInfo;
|
|
473
|
+
})) | {
|
|
474
|
+
protocol: 1;
|
|
475
|
+
type: "service-host-close";
|
|
444
476
|
};
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
action: SessionControlOriginal["action"] | "configure";
|
|
450
|
-
state: "prepared" | "created" | "completed" | "unknown";
|
|
451
|
-
revision?: number;
|
|
452
|
-
targetSessionId?: string;
|
|
477
|
+
declare function isServiceHostFrame(v: unknown): v is ServiceHostFrame;
|
|
478
|
+
|
|
479
|
+
interface AgentApiRoute {
|
|
480
|
+
readonly id: string;
|
|
453
481
|
}
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
dataScopeId: string;
|
|
467
|
-
};
|
|
468
|
-
result: WorkspaceConversationResult;
|
|
482
|
+
declare function matchAgentApiRoute(method: string, path: string): AgentApiRoute | undefined;
|
|
483
|
+
/** Read the original Node request target, before WHATWG URL removes dot segments. */
|
|
484
|
+
declare function normalizeAgentApiPath(raw: string): string;
|
|
485
|
+
|
|
486
|
+
/** How an agent explains findings and delivers results, independently of update timing. */
|
|
487
|
+
type ReplyStyle = "collaborative" | "direct" | "explanatory";
|
|
488
|
+
|
|
489
|
+
/** Application choices; none of these fields grants access to a resource. */
|
|
490
|
+
interface SessionConfigurationInput {
|
|
491
|
+
model?: {
|
|
492
|
+
provider: string;
|
|
493
|
+
model: string;
|
|
469
494
|
};
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
495
|
+
roleId?: string | null;
|
|
496
|
+
systemPrompt?: string | null;
|
|
497
|
+
executionInstructions?: {
|
|
498
|
+
revision: number;
|
|
499
|
+
content: string;
|
|
500
|
+
} | null;
|
|
501
|
+
effort?: string | null;
|
|
502
|
+
workMode?: "execute" | "plan";
|
|
503
|
+
maxTurns?: number;
|
|
504
|
+
sessionMode?: "direct" | "coordinator";
|
|
505
|
+
replyStyle?: ReplyStyle;
|
|
506
|
+
approvalMode?: "ask" | "auto_review" | "full_access";
|
|
507
|
+
tools?: {
|
|
508
|
+
allowed?: string[];
|
|
509
|
+
denied?: string[];
|
|
473
510
|
};
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
511
|
+
pluginsEnabled?: boolean;
|
|
512
|
+
pluginAutoSelectionEnabled?: boolean;
|
|
513
|
+
activePluginId?: string | null;
|
|
514
|
+
pluginIds?: string[];
|
|
515
|
+
serviceBindings?: string[];
|
|
516
|
+
memory?: {
|
|
517
|
+
enabled: boolean;
|
|
480
518
|
};
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
original: SessionControlOriginal;
|
|
487
|
-
};
|
|
488
|
-
result: SessionControlReceipt | null;
|
|
519
|
+
}
|
|
520
|
+
interface ResolvedSessionConfiguration extends Required<Omit<SessionConfigurationInput, "tools">> {
|
|
521
|
+
tools: {
|
|
522
|
+
allowed: string[];
|
|
523
|
+
denied: string[];
|
|
489
524
|
};
|
|
490
525
|
}
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
526
|
+
interface SessionConfigurationSnapshot {
|
|
527
|
+
revision: number;
|
|
528
|
+
configuration: ResolvedSessionConfiguration;
|
|
529
|
+
configurationRoot: {
|
|
530
|
+
cwd: string;
|
|
531
|
+
settingsRoot: string;
|
|
532
|
+
};
|
|
497
533
|
}
|
|
498
|
-
interface
|
|
534
|
+
interface SessionCreationReceipt {
|
|
535
|
+
dataScopeId: string;
|
|
536
|
+
sessionId: string;
|
|
499
537
|
requestId: string;
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
}
|
|
505
|
-
interface ServiceConnectionDescriptor {
|
|
506
|
-
connectionId: string;
|
|
507
|
-
baseUrl: string;
|
|
508
|
-
apiVersion: string;
|
|
538
|
+
action: "create-session";
|
|
539
|
+
state: "prepared" | "completed" | "unknown";
|
|
540
|
+
revision?: number;
|
|
541
|
+
configuration?: SessionConfigurationSnapshot;
|
|
509
542
|
}
|
|
510
543
|
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
type
|
|
521
|
-
|
|
522
|
-
protocol: 2;
|
|
523
|
-
} & ({
|
|
524
|
-
type: "fetch-open";
|
|
525
|
-
id: string;
|
|
526
|
-
connectionId: string;
|
|
527
|
-
url: string;
|
|
528
|
-
method: string;
|
|
529
|
-
headers: [string, string][];
|
|
530
|
-
hasBody: boolean;
|
|
531
|
-
inlineBody?: string;
|
|
532
|
-
} | {
|
|
533
|
-
type: "fetch-headers";
|
|
534
|
-
id: string;
|
|
535
|
-
status: number;
|
|
536
|
-
statusText: string;
|
|
537
|
-
headers: [string, string][];
|
|
538
|
-
hasBody: boolean;
|
|
539
|
-
} | {
|
|
540
|
-
type: "fetch-credit";
|
|
541
|
-
id: string;
|
|
542
|
-
direction: FetchDirection;
|
|
543
|
-
sequence: number;
|
|
544
|
-
chunks: number;
|
|
545
|
-
bytes: number;
|
|
546
|
-
} | {
|
|
547
|
-
type: "fetch-chunk";
|
|
548
|
-
id: string;
|
|
549
|
-
direction: FetchDirection;
|
|
550
|
-
sequence: number;
|
|
551
|
-
bytes: Uint8Array;
|
|
552
|
-
} | {
|
|
553
|
-
type: "fetch-end";
|
|
554
|
-
id: string;
|
|
555
|
-
direction: FetchDirection;
|
|
556
|
-
sequence: number;
|
|
544
|
+
/** A directory's actual filesystem identity, captured by trusted execution code. */
|
|
545
|
+
interface SessionExecutionRoot {
|
|
546
|
+
readonly canonicalRoot: string;
|
|
547
|
+
readonly rootIdentity: {
|
|
548
|
+
readonly dev: string;
|
|
549
|
+
readonly ino: string;
|
|
550
|
+
};
|
|
551
|
+
}
|
|
552
|
+
/** Execution provenance describes a business relationship; it grants no access. */
|
|
553
|
+
type SessionExecutionSource = {
|
|
554
|
+
readonly kind: "interactive";
|
|
557
555
|
} | {
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
direction: "download";
|
|
561
|
-
sequence: number;
|
|
556
|
+
readonly kind: "channel";
|
|
557
|
+
readonly conversationId: string;
|
|
562
558
|
} | {
|
|
563
|
-
|
|
564
|
-
|
|
559
|
+
readonly kind: "automation";
|
|
560
|
+
readonly service: string;
|
|
561
|
+
readonly sourceId: string;
|
|
565
562
|
} | {
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
563
|
+
readonly kind: "child";
|
|
564
|
+
readonly sessionId: string;
|
|
565
|
+
readonly runId: string;
|
|
566
|
+
readonly childId: string;
|
|
567
|
+
readonly postRunPurpose?: "review" | "maintenance";
|
|
569
568
|
} | {
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
569
|
+
readonly kind: "fork";
|
|
570
|
+
readonly sessionId: string;
|
|
571
|
+
readonly requestId: string;
|
|
572
|
+
};
|
|
573
|
+
/** Actual roots and business source captured when work is accepted, then copied to Input/Run. */
|
|
574
|
+
interface SessionExecutionBinding {
|
|
575
|
+
readonly version: 1;
|
|
576
|
+
readonly cwd: SessionExecutionRoot;
|
|
577
|
+
readonly settingsRoot: SessionExecutionRoot;
|
|
578
|
+
readonly source: SessionExecutionSource;
|
|
579
|
+
}
|
|
577
580
|
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
581
|
+
/**
|
|
582
|
+
* `closing` 表示 Session 正在停止当前工作并等待资源释放,此时不再接收新工作。
|
|
583
|
+
* 等待结束后,Session 会进入不可逆的 archived 状态。
|
|
584
|
+
*/
|
|
585
|
+
type SessionStatus = "idle" | "running" | "closing" | "archived" | "error";
|
|
586
|
+
type SessionStorage = "sqlite" | "memory";
|
|
587
|
+
interface SessionRecord {
|
|
588
|
+
id: string;
|
|
589
|
+
storage?: SessionStorage;
|
|
590
|
+
parentId?: string;
|
|
591
|
+
projectId?: string;
|
|
592
|
+
cwd: string;
|
|
593
|
+
cwdRelative?: string;
|
|
594
|
+
title: string;
|
|
595
|
+
model: string;
|
|
596
|
+
agent?: string;
|
|
597
|
+
status: SessionStatus;
|
|
598
|
+
metadata: Record<string, unknown> & {
|
|
599
|
+
configurationInput?: SessionConfigurationInput;
|
|
600
|
+
pluginIds?: string[];
|
|
601
|
+
executionBinding?: SessionExecutionBinding;
|
|
587
602
|
};
|
|
588
|
-
|
|
589
|
-
|
|
603
|
+
createdAt: number;
|
|
604
|
+
updatedAt: number;
|
|
605
|
+
archivedAt?: number;
|
|
590
606
|
}
|
|
591
|
-
|
|
592
|
-
|
|
607
|
+
|
|
608
|
+
interface WorkspaceConversationCreation {
|
|
593
609
|
dataScopeId: string;
|
|
610
|
+
requestId: string;
|
|
594
611
|
sessionId: string;
|
|
595
|
-
runId: string;
|
|
596
|
-
inputId?: string;
|
|
597
612
|
workspaceId?: string;
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
requestId: string;
|
|
603
|
-
workspaceId: string;
|
|
604
|
-
expectedHead: string;
|
|
605
|
-
branch: string;
|
|
606
|
-
}
|
|
607
|
-
interface WorktreeQuery {
|
|
608
|
-
requestId: string;
|
|
609
|
-
original: Omit<CreateWorktree, "requestId">;
|
|
613
|
+
outsideProject?: boolean;
|
|
614
|
+
taskLocation: "current" | "worktree";
|
|
615
|
+
configuration: SessionConfigurationInput;
|
|
616
|
+
preparationRevision?: string;
|
|
610
617
|
}
|
|
611
|
-
interface
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
618
|
+
interface WorkspaceConversationResult extends SessionCreationReceipt {
|
|
619
|
+
session?: SessionRecord;
|
|
620
|
+
operationState?: "prepared" | "running" | "completed" | "failed" | "unknown";
|
|
621
|
+
indexBindingPending?: true;
|
|
622
|
+
workspaceId?: string;
|
|
623
|
+
executionRoot?: string;
|
|
624
|
+
privateSessionId?: string;
|
|
625
|
+
worktree?: {
|
|
626
|
+
id: string;
|
|
627
|
+
path: string;
|
|
617
628
|
branch: string;
|
|
618
629
|
sourceHead: string;
|
|
630
|
+
projectId: string;
|
|
631
|
+
projectPath: string;
|
|
632
|
+
configDir: string;
|
|
633
|
+
environment: "native" | "wsl";
|
|
634
|
+
distribution?: string;
|
|
619
635
|
};
|
|
620
636
|
}
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
637
|
+
|
|
638
|
+
interface ControlOption {
|
|
639
|
+
id: string;
|
|
640
|
+
name: string;
|
|
625
641
|
}
|
|
626
|
-
interface
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
changes: string[];
|
|
642
|
+
interface DraftComposerTarget {
|
|
643
|
+
source: "instance";
|
|
644
|
+
workspaceId?: string;
|
|
645
|
+
outsideProject?: boolean;
|
|
646
|
+
roleId?: string | null;
|
|
632
647
|
}
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
interface ServiceHostMethodMap extends Pick<SessionControlMethodMap, "sessions.getControls" | "sessions.getControlResult"> {
|
|
638
|
-
"secrets.get": Entry$1<{
|
|
639
|
-
key: string;
|
|
640
|
-
}, string | null>;
|
|
641
|
-
"secrets.set": Entry$1<{
|
|
642
|
-
key: string;
|
|
643
|
-
value: string;
|
|
644
|
-
}, {
|
|
645
|
-
stored: true;
|
|
646
|
-
}>;
|
|
647
|
-
"secrets.delete": Entry$1<{
|
|
648
|
-
key: string;
|
|
649
|
-
}, {
|
|
650
|
-
deleted: true;
|
|
651
|
-
}>;
|
|
652
|
-
"context.get": Entry$1<Record<string, never>, ServiceContext>;
|
|
653
|
-
"context.resolveInvocation": Entry$1<{
|
|
654
|
-
ticket: string;
|
|
655
|
-
}, ServiceInvocation>;
|
|
656
|
-
"agent.listModels": Entry$1<Record<string, never>, {
|
|
657
|
-
id: string;
|
|
658
|
-
name: string;
|
|
659
|
-
}[]>;
|
|
660
|
-
"agent.listRoles": Entry$1<Record<string, never>, {
|
|
661
|
-
id: string;
|
|
662
|
-
name: string;
|
|
663
|
-
description: string;
|
|
664
|
-
}[]>;
|
|
665
|
-
"agent.getConnection": Entry$1<{
|
|
666
|
-
workspaceId?: string;
|
|
667
|
-
executionRoot?: string;
|
|
668
|
-
privateSessionId?: string;
|
|
669
|
-
}, {
|
|
670
|
-
connectionId: string;
|
|
671
|
-
baseUrl: string;
|
|
672
|
-
}>;
|
|
673
|
-
"agent.resolveSkills": Entry$1<{
|
|
674
|
-
skillIds: string[];
|
|
675
|
-
}, {
|
|
676
|
-
type: "skill";
|
|
677
|
-
name: string;
|
|
648
|
+
interface DraftComposerOptions {
|
|
649
|
+
source: "instance";
|
|
650
|
+
optionsRevision: string;
|
|
651
|
+
skills: (ControlOption & {
|
|
678
652
|
path: string;
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
}
|
|
684
|
-
connectionId: string;
|
|
685
|
-
baseUrl: string;
|
|
686
|
-
}>;
|
|
687
|
-
"workspace.gitStatus": Entry$1<{
|
|
688
|
-
workspaceId: string;
|
|
689
|
-
}, GitStatus>;
|
|
690
|
-
"workspace.createTaskWorktree": Entry$1<CreateWorktree, WorktreeReceipt>;
|
|
691
|
-
"workspace.getWorktree": Entry$1<WorktreeQuery, WorktreeReceipt | null>;
|
|
692
|
-
"workspace.releaseExecutionRoot": Entry$1<{
|
|
693
|
-
requestId: string;
|
|
694
|
-
workspaceId: string;
|
|
695
|
-
executionRoot: string;
|
|
696
|
-
}, RootReleaseReceipt>;
|
|
697
|
-
"work.list": Entry$1<Record<string, never>, ServiceWork[]>;
|
|
698
|
-
"work.get": Entry$1<{
|
|
699
|
-
requestId: string;
|
|
700
|
-
}, ServiceWork | null>;
|
|
653
|
+
source?: string;
|
|
654
|
+
})[];
|
|
655
|
+
plugins: (ControlOption & {
|
|
656
|
+
agents: ControlOption[];
|
|
657
|
+
})[];
|
|
701
658
|
}
|
|
702
|
-
type
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
} & ({
|
|
733
|
-
ok: true;
|
|
734
|
-
value: unknown;
|
|
659
|
+
type SessionControlAction = "readContext" | "configure" | "compact" | "edit" | "fork" | "resume" | "goalRead" | "goalWrite" | "goalStop";
|
|
660
|
+
interface SessionControls {
|
|
661
|
+
dataScopeId: string;
|
|
662
|
+
sessionId: string;
|
|
663
|
+
source: "instance" | "auxiliary" | "im";
|
|
664
|
+
revision: number;
|
|
665
|
+
optionsRevision: string;
|
|
666
|
+
actions: Record<SessionControlAction, boolean>;
|
|
667
|
+
models: ControlOption[];
|
|
668
|
+
roles: ControlOption[];
|
|
669
|
+
efforts: ControlOption[];
|
|
670
|
+
workModes: ControlOption[];
|
|
671
|
+
permissionModes?: ControlOption[];
|
|
672
|
+
appServiceBindings?: ControlOption[];
|
|
673
|
+
skills: (ControlOption & {
|
|
674
|
+
path: string;
|
|
675
|
+
source?: string;
|
|
676
|
+
})[];
|
|
677
|
+
commands: ControlOption[];
|
|
678
|
+
contexts: ControlOption[];
|
|
679
|
+
plugins?: (ControlOption & {
|
|
680
|
+
agents: ControlOption[];
|
|
681
|
+
})[];
|
|
682
|
+
}
|
|
683
|
+
type SessionControlOriginal = {
|
|
684
|
+
action: "compact";
|
|
685
|
+
body: {
|
|
686
|
+
requestId: string;
|
|
687
|
+
expectedRevision: number;
|
|
688
|
+
};
|
|
735
689
|
} | {
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
690
|
+
action: "fork";
|
|
691
|
+
body: {
|
|
692
|
+
requestId: string;
|
|
693
|
+
id: string;
|
|
694
|
+
copyHistory?: boolean;
|
|
695
|
+
beforeMessageId?: string;
|
|
696
|
+
afterMessageId?: string;
|
|
697
|
+
storage?: "sqlite";
|
|
698
|
+
};
|
|
741
699
|
};
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
700
|
+
interface SessionControlReceipt {
|
|
701
|
+
dataScopeId: string;
|
|
702
|
+
sessionId: string;
|
|
703
|
+
requestId: string;
|
|
704
|
+
action: SessionControlOriginal["action"] | "configure";
|
|
705
|
+
state: "prepared" | "created" | "completed" | "unknown";
|
|
706
|
+
revision?: number;
|
|
707
|
+
targetSessionId?: string;
|
|
708
|
+
}
|
|
709
|
+
interface SessionControlMethodMap {
|
|
710
|
+
"sessions.getDraftComposerOptions": {
|
|
711
|
+
params: DraftComposerTarget;
|
|
712
|
+
result: DraftComposerOptions;
|
|
713
|
+
};
|
|
714
|
+
"sessions.createConversation": {
|
|
715
|
+
params: WorkspaceConversationCreation;
|
|
716
|
+
result: WorkspaceConversationResult;
|
|
717
|
+
};
|
|
718
|
+
"sessions.bindConversationIndex": {
|
|
719
|
+
params: {
|
|
720
|
+
original: WorkspaceConversationCreation;
|
|
721
|
+
dataScopeId: string;
|
|
722
|
+
};
|
|
723
|
+
result: WorkspaceConversationResult;
|
|
724
|
+
};
|
|
725
|
+
"sessions.getConversationCreationResult": {
|
|
726
|
+
params: WorkspaceConversationCreation;
|
|
727
|
+
result: WorkspaceConversationResult | null;
|
|
728
|
+
};
|
|
729
|
+
"sessions.getControls": {
|
|
730
|
+
params: {
|
|
731
|
+
connectionId: string;
|
|
732
|
+
sessionId: string;
|
|
733
|
+
};
|
|
734
|
+
result: SessionControls;
|
|
735
|
+
};
|
|
736
|
+
"sessions.getControlResult": {
|
|
737
|
+
params: {
|
|
738
|
+
connectionId?: string;
|
|
739
|
+
requestId: string;
|
|
740
|
+
sessionId: string;
|
|
741
|
+
original: SessionControlOriginal;
|
|
742
|
+
};
|
|
743
|
+
result: SessionControlReceipt | null;
|
|
744
|
+
};
|
|
746
745
|
}
|
|
747
|
-
declare function matchAgentApiRoute(method: string, path: string): AgentApiRoute | undefined;
|
|
748
|
-
/** Read the original Node request target, before WHATWG URL removes dot segments. */
|
|
749
|
-
declare function normalizeAgentApiPath(raw: string): string;
|
|
750
746
|
|
|
751
747
|
interface WorkspaceRef {
|
|
752
748
|
id: string;
|
|
@@ -1373,14 +1369,6 @@ interface DesktopMethodMap {
|
|
|
1373
1369
|
"desktop.browser.removeAnnotation": Entry<BrowserPage & {
|
|
1374
1370
|
annotationId: string;
|
|
1375
1371
|
}, BrowserAnnotationSnapshot>;
|
|
1376
|
-
"desktop.browser.capture": Entry<BrowserPage, {
|
|
1377
|
-
assetId: string;
|
|
1378
|
-
sha256: string;
|
|
1379
|
-
mediaType: string;
|
|
1380
|
-
byteLength: number;
|
|
1381
|
-
width: number;
|
|
1382
|
-
height: number;
|
|
1383
|
-
}>;
|
|
1384
1372
|
"desktop.browser.capturePreview": Entry<BrowserPage, {
|
|
1385
1373
|
bytes: Uint8Array<ArrayBuffer>;
|
|
1386
1374
|
width: number;
|
|
@@ -1675,7 +1663,7 @@ declare function createAppAuxiliarySessionsApi(rpc: {
|
|
|
1675
1663
|
request<M extends AuxiliaryMethod>(method: M, params: AuxiliaryMethodMap[M]["params"]): Promise<AuxiliaryMethodMap[M]["result"]>;
|
|
1676
1664
|
}, streams: ConnectionStreams): AppHostAuxiliarySessions;
|
|
1677
1665
|
|
|
1678
|
-
/** The
|
|
1666
|
+
/** The extension manager's finite operations. */
|
|
1679
1667
|
declare const EXTENSION_INPUTS: {
|
|
1680
1668
|
context: Check;
|
|
1681
1669
|
"plugins.loadIcon": Check;
|
|
@@ -1700,6 +1688,8 @@ declare const EXTENSION_INPUTS: {
|
|
|
1700
1688
|
"plugins.marketplaceOperation": Check;
|
|
1701
1689
|
"skills.snapshot": Check;
|
|
1702
1690
|
"skills.remove": Check;
|
|
1691
|
+
"skills.marketplaceCatalog": Check;
|
|
1692
|
+
"skills.marketplaceInstall": (value: unknown) => boolean;
|
|
1703
1693
|
"mcp.snapshot": Check;
|
|
1704
1694
|
"mcp.exportConfig": Check;
|
|
1705
1695
|
"mcp.getConfig": Check;
|
|
@@ -1803,6 +1793,9 @@ type ModelProviderRequest = {
|
|
|
1803
1793
|
} | {
|
|
1804
1794
|
action: "createCustom";
|
|
1805
1795
|
value: CustomModelProviderInput;
|
|
1796
|
+
} | {
|
|
1797
|
+
action: "syncAccount";
|
|
1798
|
+
value: CustomModelProviderInput;
|
|
1806
1799
|
} | {
|
|
1807
1800
|
action: "updateCustom";
|
|
1808
1801
|
provider: string;
|
|
@@ -2004,7 +1997,7 @@ type SystemEvent = {
|
|
|
2004
1997
|
type: "git-preferences-changed";
|
|
2005
1998
|
defaultTaskLocation: "current" | "worktree";
|
|
2006
1999
|
};
|
|
2007
|
-
declare const SYSTEM_METHODS: readonly ["system.projects", "system.extensions", "system.modelProviders", "system.providerDefaults", "system.open", "system.getPresentationPreferences", "system.setTheme", "system.setWindowMaterial", "system.copyText", "system.openExternal", "system.
|
|
2000
|
+
declare const SYSTEM_METHODS: readonly ["system.projects", "system.extensions", "system.modelProviders", "system.providerDefaults", "system.open", "system.getPresentationPreferences", "system.setTheme", "system.setWindowMaterial", "system.copyText", "system.openExternal", "system.navigationReady", "system.completeNavigation"];
|
|
2008
2001
|
interface SystemMethodMap {
|
|
2009
2002
|
"system.projects": {
|
|
2010
2003
|
params: ProjectRequest;
|
|
@@ -2056,14 +2049,6 @@ interface SystemMethodMap {
|
|
|
2056
2049
|
};
|
|
2057
2050
|
result: void;
|
|
2058
2051
|
};
|
|
2059
|
-
"system.markSessionRead": {
|
|
2060
|
-
params: {
|
|
2061
|
-
connectionId: string;
|
|
2062
|
-
sessionId: string;
|
|
2063
|
-
throughSeq: number;
|
|
2064
|
-
};
|
|
2065
|
-
result: void;
|
|
2066
|
-
};
|
|
2067
2052
|
"system.navigationReady": {
|
|
2068
2053
|
params: Record<string, never>;
|
|
2069
2054
|
result: {
|
|
@@ -2110,11 +2095,6 @@ interface AppHostSystem {
|
|
|
2110
2095
|
copyText(text: string): Promise<void>;
|
|
2111
2096
|
/** Opens an HTTP(S) URL without credentials in the default browser. */
|
|
2112
2097
|
openExternal(url: string): Promise<void>;
|
|
2113
|
-
markSessionRead(input: {
|
|
2114
|
-
connection: AgentConnection;
|
|
2115
|
-
sessionId: string;
|
|
2116
|
-
throughSeq: number;
|
|
2117
|
-
}): Promise<void>;
|
|
2118
2098
|
navigationReady(): Promise<{
|
|
2119
2099
|
pending: DesktopNavigationTarget | null;
|
|
2120
2100
|
}>;
|
|
@@ -2129,14 +2109,13 @@ interface SystemRequester {
|
|
|
2129
2109
|
}
|
|
2130
2110
|
declare function createAppSystemApi(requester: SystemRequester, connectionOwner: object): AppHostSystem;
|
|
2131
2111
|
|
|
2132
|
-
interface SessionTarget {
|
|
2133
|
-
dataScopeId: string;
|
|
2134
|
-
sessionId: string;
|
|
2135
|
-
}
|
|
2136
|
-
type SessionConnectionTarget = SessionTarget | Record<string, never>;
|
|
2137
2112
|
type SessionResourceMethod = "sessions.getConnection";
|
|
2138
2113
|
declare function validSessionResourceInput(method: SessionResourceMethod, v: unknown): boolean;
|
|
2139
|
-
declare function validSessionResourceResult(
|
|
2114
|
+
declare function validSessionResourceResult(_method: SessionResourceMethod, v: unknown): v is {
|
|
2115
|
+
connectionId: string;
|
|
2116
|
+
baseUrl: string;
|
|
2117
|
+
defaultTaskLocation?: "current" | "worktree";
|
|
2118
|
+
};
|
|
2140
2119
|
|
|
2141
2120
|
type AppUnloadReason = "switch" | "reload" | "disable" | "quit";
|
|
2142
2121
|
type AppLifecycleFrame = {
|
|
@@ -2167,7 +2146,7 @@ declare const APP_HOST_REQUEST_TIMEOUT_MS = 30000;
|
|
|
2167
2146
|
declare const APP_HOST_PORT_TIMEOUT_MS = 10000;
|
|
2168
2147
|
declare const APP_HOST_LOGIN_TIMEOUT_MS = 300000;
|
|
2169
2148
|
declare const APP_HOST_LOGIN_TRANSPORT_TIMEOUT_MS: number;
|
|
2170
|
-
declare const APP_HOST_METHODS: readonly ["connect", "negotiate", "getContext", "storage.get", "storage.set", "storage.delete", "sessions.getConnection", "service.getStatus", "service.getConnection", "service.listWork", "service.getWork", "service.interruptWork", "storage.putFile", "storage.readFile", "storage.deleteFile", "auth.openLogin", "workspace.select", "workspace.getSelection", "workspace.get", "workspace.listFiles", "workspace.readText", "commands.register", "commands.update", "commands.dispose", "workspace.list", "sessions.createConversation", "sessions.getConversationCreationResult", "sessions.bindConversationIndex", ...(keyof DesktopMethodMap)[], "attachments.getConnection", "sessions.getAuxiliaryOptions", "sessions.openAuxiliary", "sessions.getAuxiliary", "sessions.closeAuxiliary", "system.projects", "system.extensions", "system.modelProviders", "system.providerDefaults", "system.open", "system.getPresentationPreferences", "system.setTheme", "system.setWindowMaterial", "system.copyText", "system.openExternal", "system.
|
|
2149
|
+
declare const APP_HOST_METHODS: readonly ["connect", "negotiate", "getContext", "storage.get", "storage.set", "storage.delete", "sessions.getConnection", "service.getStatus", "service.getConnection", "service.listWork", "service.getWork", "service.interruptWork", "storage.putFile", "storage.readFile", "storage.deleteFile", "auth.openLogin", "workspace.select", "workspace.getSelection", "workspace.get", "workspace.listFiles", "workspace.readText", "commands.register", "commands.update", "commands.dispose", "workspace.list", "sessions.createConversation", "sessions.getConversationCreationResult", "sessions.bindConversationIndex", ...(keyof DesktopMethodMap)[], "attachments.getConnection", "sessions.getAuxiliaryOptions", "sessions.openAuxiliary", "sessions.getAuxiliary", "sessions.closeAuxiliary", "system.projects", "system.extensions", "system.modelProviders", "system.providerDefaults", "system.open", "system.getPresentationPreferences", "system.setTheme", "system.setWindowMaterial", "system.copyText", "system.openExternal", "system.navigationReady", "system.completeNavigation", "window.getState", "window.checkForUpdates", "window.minimize", "window.toggleMaximize", "window.requestClose", "window.openHost", "window.reportStartup"];
|
|
2171
2150
|
|
|
2172
2151
|
interface AppContext {
|
|
2173
2152
|
readonly appId: string;
|
|
@@ -2222,7 +2201,7 @@ interface ConnectParams {
|
|
|
2222
2201
|
}
|
|
2223
2202
|
interface AppHostMethodMap extends CommandsMethodMap, ResourceCatalogMethodMap, ConversationPreparationMethodMap, DesktopMethodMap, AttachmentsMethodMap, AuxiliaryMethodMap, SystemMethodMap, WindowMethodMap {
|
|
2224
2203
|
"sessions.getConnection": {
|
|
2225
|
-
params:
|
|
2204
|
+
params: Record<string, never>;
|
|
2226
2205
|
result: {
|
|
2227
2206
|
connectionId: string;
|
|
2228
2207
|
baseUrl: string;
|
|
@@ -2389,4 +2368,4 @@ interface AppHostPortMessage {
|
|
|
2389
2368
|
}
|
|
2390
2369
|
|
|
2391
2370
|
export { APP_HOST_ERROR_RETRY, APP_HOST_FEATURES, APP_HOST_LOGIN_TIMEOUT_MS, APP_HOST_LOGIN_TRANSPORT_TIMEOUT_MS, APP_HOST_MAX_PAYLOAD_BYTES, APP_HOST_MAX_PENDING, APP_HOST_METHODS, APP_HOST_PORT, APP_HOST_PORT_TIMEOUT_MS, APP_HOST_PROTOCOL, APP_HOST_READY, APP_HOST_REQUEST_TIMEOUT_MS, ATTACHMENTS_METHODS, AUXILIARY_METHODS, AppHostError, BROWSER_CAPTURE_PREVIEW_MAX_BYTES, COMMANDS_METHODS, DESKTOP_METHODS, EXTENSION_INPUTS, FETCH_CHUNK_BYTES, FETCH_HEADERS_TIMEOUT_MS, FETCH_IDLE_TIMEOUT_MS, FETCH_INLINE_BODY_BYTES, FETCH_MAX_STREAMS, FETCH_METADATA_BYTES, FETCH_WINDOW_CHUNKS, HOST_REQUEST_ID, RESOURCE_CATALOG_METHODS, SERVICE_HOST_MAX_FRAME_BYTES, SERVICE_HOST_MAX_PENDING, SERVICE_HOST_METHODS, SYSTEM_METHODS, SYSTEM_SETTINGS_SECTIONS, SYSTEM_SHORTCUT_IDS, WINDOW_METHODS, appHostErrorMessage, canonicalDesktopRequest, createAppAttachmentsApi, createAppAuxiliarySessionsApi, createAppCommandsApi, createAppDesktopApi, createAppSystemApi, createAppWindowApi, createResourceCatalogApi, isAppHostErrorInfo, isAppLifecycleFrame, isAuxiliaryMethod, isCommandsMethod, isConversationPreparationMethod, isDesktopMethod, isPageFetchFrame, isResourceCatalogMethod, isSafeErrorDetails, isServiceHostFrame, isSystemMethod, isWindowMethod, matchAgentApiRoute, normalizeAgentApiPath, pageFetchPath, validAppCommandSnapshot, validAppWindowState, validAttachmentsInput, validAttachmentsResult, validAuxiliaryInput, validAuxiliaryResult, validBrowserSnapshot, validCommandInvocation, validCommandReceipt, validCommandsInput, validConversationPreparationInput, validConversationPreparationResult, validDesktopEvent, validDesktopInput, validDesktopNavigationTarget, validDesktopResult, validDesktopResultForInput, validDesktopTarget, validExtensionRequest, validExtensionResult, validPresentationSnapshot, validProjectRequest, validProjectSnapshot, validResourceCatalogInput, validResourceCatalogResult, validResourceChanged, validServiceContext, validServiceHostInput, validServiceHostResult, validSessionResourceInput, validSessionResourceResult, validSessionSettingsTarget, validSystemEvent, validSystemInput, validSystemResult, validWindowEvent, validWindowInput, validWindowResult, validWorkspaceInput, validWorkspaceOperation, validWorkspaceResult };
|
|
2392
|
-
export type { AgentApiRoute, AnnotationMode, AnnotationRect, AnnotationTarget, AppCommandRegistration, AppCommandSnapshot, AppContext, AppHostAttachments, AppHostAuxiliarySessions, AppHostCommands, AppHostDesktop, AppHostErrorCode, AppHostErrorInfo, AppHostEvent, AppHostEventMessage, AppHostFeature, AppHostMethod, AppHostMethodMap, AppHostPortMessage, AppHostReadyMessage, AppHostRequest, AppHostResponse, AppHostRetry, AppHostSystem, AppHostWindow, AppLifecycleFrame, AppUnloadReason, AppWindowMaterialState, AppWindowOpenHostInput, AppWindowStartupResult, AppWindowState, AppearancePreferences, AttachmentsMethod, AttachmentsMethodMap, AuxiliaryMethod, AuxiliaryMethodMap, AuxiliaryOptions, AuxiliaryReceipt, AuxiliaryRequest, AuxiliarySelection, AuxiliaryWireRequest, BindDesktopTarget, BrowserAnnotationRecord, BrowserAnnotationSnapshot, BrowserPage, CommandInvocation, CommandReceipt, CommandsMethod, CommandsMethodMap, ConnectParams, ConversationPreparationMethod, ConversationPreparationMethodMap, CreateWorktree, DesktopGitChange, DesktopMethod, DesktopMethodMap, DesktopNavigationTarget, DesktopOpener, DesktopRoot, DesktopSearch, DesktopTarget, DesktopTerminal, DesktopTerminalInfo, DesktopTerminalRequestOriginal, DesktopTerminalRequestReceipt, DesktopTerminalSnapshot, DesktopText, DesktopToolEvent, DesktopWindow, ExtensionOperation, ExtensionRequest, FetchDirection, GitStatus, JsonValue, LoginResult, ModelProviderConnection, ModelProviderRequest, NavigationCompletionStatus, PageFetchFrame, PluginAppActionReceipt, PluginAppActionResponse, PluginAppCatalog, PluginAppComposerContext, PluginAppHostState, PluginAppModelContext, PluginAppMount, PluginAppPreparedMessage, PluginAppPreparedTool, PluginAppRecord, PluginAppSource, PluginAppSubmissionReceipt, PluginAppToolPolicy, PresentationSnapshot, ProjectRequest, ProjectSnapshot, ProviderConnectionTestResult, ProviderDefaultsRequest, ProviderDefaultsSnapshot, ResourceCatalogMethod, ResourceCatalogMethodMap, ResourceChanged, RootReleaseReceipt, ServiceConnectionDescriptor, ServiceContext, ServiceHostFrame, ServiceHostMethod, ServiceHostMethodMap, ServiceInvocation, ServiceStatus, ServiceWork, ServiceWorkState, SessionResourceMethod, SessionSettingsTarget, SessionSettingsWireTarget,
|
|
2371
|
+
export type { AgentApiRoute, AnnotationMode, AnnotationRect, AnnotationTarget, AppCommandRegistration, AppCommandSnapshot, AppContext, AppHostAttachments, AppHostAuxiliarySessions, AppHostCommands, AppHostDesktop, AppHostErrorCode, AppHostErrorInfo, AppHostEvent, AppHostEventMessage, AppHostFeature, AppHostMethod, AppHostMethodMap, AppHostPortMessage, AppHostReadyMessage, AppHostRequest, AppHostResponse, AppHostRetry, AppHostSystem, AppHostWindow, AppLifecycleFrame, AppUnloadReason, AppWindowMaterialState, AppWindowOpenHostInput, AppWindowStartupResult, AppWindowState, AppWindowUpdateCheckResult, AppWindowUpdateState, AppearancePreferences, AttachmentsMethod, AttachmentsMethodMap, AuxiliaryMethod, AuxiliaryMethodMap, AuxiliaryOptions, AuxiliaryReceipt, AuxiliaryRequest, AuxiliarySelection, AuxiliaryWireRequest, BindDesktopTarget, BrowserAnnotationRecord, BrowserAnnotationSnapshot, BrowserPage, CommandInvocation, CommandReceipt, CommandsMethod, CommandsMethodMap, ConnectParams, ConversationPreparationMethod, ConversationPreparationMethodMap, CreateWorktree, DesktopGitChange, DesktopMethod, DesktopMethodMap, DesktopNavigationTarget, DesktopOpener, DesktopRoot, DesktopSearch, DesktopTarget, DesktopTerminal, DesktopTerminalInfo, DesktopTerminalRequestOriginal, DesktopTerminalRequestReceipt, DesktopTerminalSnapshot, DesktopText, DesktopToolEvent, DesktopWindow, ExtensionOperation, ExtensionRequest, FetchDirection, GitStatus, JsonValue, LoginResult, ModelProviderConnection, ModelProviderRequest, NavigationCompletionStatus, PageFetchFrame, PluginAppActionReceipt, PluginAppActionResponse, PluginAppCatalog, PluginAppComposerContext, PluginAppHostState, PluginAppModelContext, PluginAppMount, PluginAppPreparedMessage, PluginAppPreparedTool, PluginAppRecord, PluginAppSource, PluginAppSubmissionReceipt, PluginAppToolPolicy, PresentationSnapshot, ProjectRequest, ProjectSnapshot, ProviderConnectionTestResult, ProviderDefaultsRequest, ProviderDefaultsSnapshot, ResourceCatalogMethod, ResourceCatalogMethodMap, ResourceChanged, RootReleaseReceipt, ServiceConnectionDescriptor, ServiceContext, ServiceHostFrame, ServiceHostMethod, ServiceHostMethodMap, ServiceInvocation, ServiceStatus, ServiceWork, ServiceWorkState, SessionResourceMethod, SessionSettingsTarget, SessionSettingsWireTarget, StorageGetResult, StoredFile, SystemEvent, SystemMethod, SystemMethodMap, SystemOpenInput, SystemOpenWireInput, SystemProject, SystemRequester, SystemShortcutId, WindowMethod, WindowMethodMap, WindowRequester, WindowStateChanged, WorkspaceDirectoryPage, WorkspaceFilePage, WorkspaceMethod, WorkspaceOperation, WorkspaceOperationKind, WorkspaceOperationOriginal, WorkspaceRef, WorkspaceSelection, WorkspaceText, WorktreeQuery, WorktreeReceipt };
|