@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.
@@ -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
- /** How an agent explains findings and delivers results, independently of update timing. */
213
- type ReplyStyle = "collaborative" | "direct" | "explanatory";
214
-
215
- /** Application choices; none of these fields grants access to a resource. */
216
- interface SessionConfigurationInput {
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 SessionCreationReceipt {
261
- dataScopeId: string;
262
- sessionId: string;
238
+ interface ServiceWork {
263
239
  requestId: string;
264
- action: "create-session";
265
- state: "prepared" | "completed" | "unknown";
266
- revision?: number;
267
- configuration?: SessionConfigurationSnapshot;
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 ConfigurationResourceRef {
286
- kind: "model" | "role" | "tool" | "plugin" | "service" | "skill" | "mcp";
287
- id: string;
245
+ interface ServiceConnectionDescriptor {
246
+ connectionId: string;
247
+ baseUrl: string;
248
+ apiVersion: string;
288
249
  }
289
250
 
290
- /** A directory's actual filesystem identity, captured by trusted execution code. */
291
- interface SessionExecutionRoot {
292
- readonly canonicalRoot: string;
293
- readonly rootIdentity: {
294
- readonly dev: string;
295
- readonly ino: string;
296
- };
297
- }
298
- /** Execution provenance describes a business relationship; it grants no access. */
299
- type SessionExecutionSource = {
300
- readonly kind: "interactive";
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
- readonly kind: "channel";
303
- readonly conversationId: string;
273
+ type: "fetch-headers";
274
+ id: string;
275
+ status: number;
276
+ statusText: string;
277
+ headers: [string, string][];
278
+ hasBody: boolean;
304
279
  } | {
305
- readonly kind: "automation";
306
- readonly service: string;
307
- readonly sourceId: string;
280
+ type: "fetch-credit";
281
+ id: string;
282
+ direction: FetchDirection;
283
+ sequence: number;
284
+ chunks: number;
285
+ bytes: number;
308
286
  } | {
309
- readonly kind: "child";
310
- readonly sessionId: string;
311
- readonly runId: string;
312
- readonly childId: string;
313
- readonly postRunPurpose?: "review" | "maintenance";
287
+ type: "fetch-chunk";
288
+ id: string;
289
+ direction: FetchDirection;
290
+ sequence: number;
291
+ bytes: Uint8Array;
314
292
  } | {
315
- readonly kind: "fork";
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
- storage?: SessionStorage;
336
- parentId?: string;
337
- projectId?: string;
338
- cwd: string;
339
- cwdRelative?: string;
340
- title: string;
341
- model: string;
342
- agent?: string;
343
- status: SessionStatus;
344
- metadata: Record<string, unknown> & {
345
- configurationBinding?: SessionConfigurationBinding;
346
- executionBinding?: SessionExecutionBinding;
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
- createdAt: number;
349
- updatedAt: number;
350
- archivedAt?: number;
328
+ installationRevision: number;
329
+ phase: "starting" | "ready";
351
330
  }
352
-
353
- interface WorkspaceConversationCreation {
331
+ interface ServiceInvocation {
332
+ invocationId: string;
354
333
  dataScopeId: string;
355
- requestId: string;
356
334
  sessionId: string;
357
- workspaceId?: string;
358
- outsideProject?: boolean;
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
- worktree?: {
371
- id: string;
372
- path: string;
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
- interface ControlOption {
384
- id: string;
385
- name: string;
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 DraftComposerOptions {
394
- source: "instance";
395
- optionsRevision: string;
396
- skills: (ControlOption & {
397
- path: string;
398
- source?: string;
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 SessionControlAction = "readContext" | "configure" | "compact" | "edit" | "fork" | "resume" | "goalRead" | "goalWrite" | "goalStop";
405
- interface SessionControls {
406
- dataScopeId: string;
407
- sessionId: string;
408
- source: "instance" | "auxiliary" | "im";
409
- revision: number;
410
- optionsRevision: string;
411
- actions: Record<SessionControlAction, boolean>;
412
- models: ControlOption[];
413
- roles: ControlOption[];
414
- efforts: ControlOption[];
415
- workModes: ControlOption[];
416
- permissionModes?: ControlOption[];
417
- appServiceBindings?: ControlOption[];
418
- skills: (ControlOption & {
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
- source?: string;
421
- })[];
422
- commands: ControlOption[];
423
- contexts: ControlOption[];
424
- plugins?: (ControlOption & {
425
- agents: ControlOption[];
426
- })[];
427
- }
428
- type SessionControlOriginal = {
429
- action: "compact";
430
- body: {
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
- expectedRevision: number;
433
- };
434
- } | {
435
- action: "fork";
436
- body: {
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
- id: string;
439
- copyHistory?: boolean;
440
- beforeMessageId?: string;
441
- afterMessageId?: string;
442
- storage?: "sqlite";
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
- interface SessionControlReceipt {
446
- dataScopeId: string;
447
- sessionId: string;
448
- requestId: string;
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
- interface SessionControlMethodMap {
455
- "sessions.getDraftComposerOptions": {
456
- params: DraftComposerTarget;
457
- result: DraftComposerOptions;
458
- };
459
- "sessions.createConversation": {
460
- params: WorkspaceConversationCreation;
461
- result: WorkspaceConversationResult;
462
- };
463
- "sessions.bindConversationIndex": {
464
- params: {
465
- original: WorkspaceConversationCreation;
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
- "sessions.getConversationCreationResult": {
471
- params: WorkspaceConversationCreation;
472
- result: WorkspaceConversationResult | null;
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
- "sessions.getControls": {
475
- params: {
476
- connectionId: string;
477
- sessionId: string;
478
- };
479
- result: SessionControls;
511
+ pluginsEnabled?: boolean;
512
+ pluginAutoSelectionEnabled?: boolean;
513
+ activePluginId?: string | null;
514
+ pluginIds?: string[];
515
+ serviceBindings?: string[];
516
+ memory?: {
517
+ enabled: boolean;
480
518
  };
481
- "sessions.getControlResult": {
482
- params: {
483
- connectionId?: string;
484
- requestId: string;
485
- sessionId: string;
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
- interface ServiceStatus {
493
- state: "absent" | "unauthorized" | "stopped" | "starting" | "recovering" | "ready" | "failed";
494
- reason?: "dependency_missing" | "service_start_failed" | "service_unavailable" | "result_unknown" | "incompatible" | "revoked";
495
- instanceId?: string;
496
- apiVersion?: string;
526
+ interface SessionConfigurationSnapshot {
527
+ revision: number;
528
+ configuration: ResolvedSessionConfiguration;
529
+ configurationRoot: {
530
+ cwd: string;
531
+ settingsRoot: string;
532
+ };
497
533
  }
498
- interface ServiceWork {
534
+ interface SessionCreationReceipt {
535
+ dataScopeId: string;
536
+ sessionId: string;
499
537
  requestId: string;
500
- state: ServiceWorkState;
501
- updatedAt: string;
502
- result?: JsonValue;
503
- error?: JsonValue;
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
- declare const APP_HOST_FEATURES: readonly ["fetch-v2", "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", "embedded-browser-v1", "browser-binding-invalidation-v1", "browser-capture-preview-v1"];
512
- type AppHostFeature = typeof APP_HOST_FEATURES[number];
513
- declare const FETCH_CHUNK_BYTES: number;
514
- declare const FETCH_INLINE_BODY_BYTES: number;
515
- declare const FETCH_WINDOW_CHUNKS = 4;
516
- declare const FETCH_MAX_STREAMS = 16;
517
- declare const FETCH_METADATA_BYTES: number;
518
- declare const FETCH_HEADERS_TIMEOUT_MS = 30000;
519
- declare const FETCH_IDLE_TIMEOUT_MS = 120000;
520
- type FetchDirection = "upload" | "download";
521
- type PageFetchFrame = {
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
- type: "fetch-consumed";
559
- id: string;
560
- direction: "download";
561
- sequence: number;
556
+ readonly kind: "channel";
557
+ readonly conversationId: string;
562
558
  } | {
563
- type: "fetch-cancel";
564
- id: string;
559
+ readonly kind: "automation";
560
+ readonly service: string;
561
+ readonly sourceId: string;
565
562
  } | {
566
- type: "fetch-error";
567
- id: string;
568
- error: AppHostErrorInfo;
563
+ readonly kind: "child";
564
+ readonly sessionId: string;
565
+ readonly runId: string;
566
+ readonly childId: string;
567
+ readonly postRunPurpose?: "review" | "maintenance";
569
568
  } | {
570
- type: "fetch-close";
571
- connectionId: string;
572
- });
573
- /** Plain-data validation runs before reading fields; accessors and hidden properties are invalid. */
574
- declare function isPageFetchFrame(value: unknown): value is PageFetchFrame;
575
- /** This URL is only an opaque document-local descriptor; it is never fetched over a network. */
576
- declare function pageFetchPath(baseUrl: string, input: string): string;
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
- interface ServiceContext {
579
- protocolVersion: 1;
580
- registrationId: string;
581
- instanceId: string;
582
- dataScopeId: string;
583
- scope: {
584
- appId: string;
585
- installationId: string;
586
- contentDigest: string;
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
- installationRevision: number;
589
- phase: "starting" | "ready";
603
+ createdAt: number;
604
+ updatedAt: number;
605
+ archivedAt?: number;
590
606
  }
591
- interface ServiceInvocation {
592
- invocationId: string;
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
- executionRoot?: string;
599
- privateSessionId?: string;
600
- }
601
- interface CreateWorktree {
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 WorktreeReceipt {
612
- requestId: string;
613
- state: "accepted" | "completed" | "failed" | "unknown";
614
- result?: {
615
- executionRoot: string;
616
- workspaceId: string;
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
- interface RootReleaseReceipt {
622
- requestId: string;
623
- executionRoot: string;
624
- state: "released" | "retained-dirty" | "in-use" | "unknown";
637
+
638
+ interface ControlOption {
639
+ id: string;
640
+ name: string;
625
641
  }
626
- interface GitStatus {
627
- root: string;
628
- commonDir: string;
629
- head: string;
630
- branch: string;
631
- changes: string[];
642
+ interface DraftComposerTarget {
643
+ source: "instance";
644
+ workspaceId?: string;
645
+ outsideProject?: boolean;
646
+ roleId?: string | null;
632
647
  }
633
- type Entry$1<P, R> = {
634
- params: P;
635
- result: R;
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
- "sessions.getConnection": Entry$1<{
681
- dataScopeId: string;
682
- sessionId: string;
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 ServiceHostMethod = keyof ServiceHostMethodMap;
703
- declare const SERVICE_HOST_METHODS: readonly ["secrets.get", "secrets.set", "secrets.delete", "context.get", "context.resolveInvocation", "agent.listModels", "agent.listRoles", "agent.getConnection", "agent.resolveSkills", "sessions.getConnection", "sessions.getControls", "sessions.getControlResult", "workspace.gitStatus", "workspace.createTaskWorktree", "workspace.getWorktree", "workspace.releaseExecutionRoot", "work.list", "work.get"];
704
- declare const SERVICE_HOST_MAX_FRAME_BYTES: number;
705
- declare const SERVICE_HOST_MAX_PENDING = 64;
706
- declare const validServiceContext: (v: unknown) => v is ServiceContext;
707
- declare function validServiceHostInput(method: ServiceHostMethod, v: unknown): boolean;
708
- declare function validServiceHostResult(method: ServiceHostMethod, v: unknown): boolean;
709
- type ServiceHostFrame = PageFetchFrame | {
710
- protocol: 1;
711
- type: "service-host-connect";
712
- id: string;
713
- } | {
714
- protocol: 1;
715
- type: "service-host-ready";
716
- id: string;
717
- context: ServiceContext;
718
- } | {
719
- protocol: 1;
720
- type: "service-host-context";
721
- context: ServiceContext;
722
- } | {
723
- protocol: 1;
724
- type: "service-host-request";
725
- id: string;
726
- method: ServiceHostMethod;
727
- params: ServiceHostMethodMap[ServiceHostMethod]["params"];
728
- } | ({
729
- protocol: 1;
730
- type: "service-host-response";
731
- id: string;
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
- ok: false;
737
- error: AppHostErrorInfo;
738
- })) | {
739
- protocol: 1;
740
- type: "service-host-close";
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
- declare function isServiceHostFrame(v: unknown): v is ServiceHostFrame;
743
-
744
- interface AgentApiRoute {
745
- readonly id: string;
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 original extension manager's finite operations; never an IPC channel or arbitrary service method. */
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.markSessionRead", "system.navigationReady", "system.completeNavigation"];
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(method: SessionResourceMethod, v: unknown): boolean;
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.markSessionRead", "system.navigationReady", "system.completeNavigation", "window.getState", "window.minimize", "window.toggleMaximize", "window.requestClose", "window.openHost", "window.reportStartup"];
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: SessionConnectionTarget;
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, SessionTarget, 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 };
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 };