Open History to see the last commit
1import type {
2 VcsCreateRefInput,
3 VcsCreateRefResult,
4 VcsCreateWorktreeInput,
5 VcsCreateWorktreeResult,
6 VcsInitInput,
7 VcsListRefsInput,
8 VcsListRefsResult,
9 VcsPullInput,
10 VcsPullResult,
11 VcsRemoveWorktreeInput,
12 VcsSwitchRefInput,
13 VcsSwitchRefResult,
14 GitPreparePullRequestThreadInput,
15 GitPreparePullRequestThreadResult,
16 GitPullRequestRefInput,
17 GitResolvePullRequestResult,
18 VcsStatusInput,
19 VcsStatusResult,
20} from "./git.ts";
21import type { ReviewDiffPreviewInput, ReviewDiffPreviewResult } from "./review.ts";
22import type { FilesystemBrowseInput, FilesystemBrowseResult } from "./filesystem.ts";
23import type {
24 ProjectSearchEntriesInput,
25 ProjectSearchEntriesResult,
26 ProjectWriteFileInput,
27 ProjectWriteFileResult,
28} from "./project.ts";
29import type { ProviderInstanceId } from "./providerInstance.ts";
30import type {
31 ServerConfig,
32 ServerProcessDiagnosticsResult,
33 ServerProcessResourceHistoryInput,
34 ServerProcessResourceHistoryResult,
35 ServerProviderUpdateInput,
36 ServerProviderUpdatedPayload,
37 ServerRemoveKeybindingResult,
38 ServerSignalProcessInput,
39 ServerSignalProcessResult,
40 ServerTraceDiagnosticsResult,
41 ServerUpsertKeybindingResult,
42} from "./server.ts";
43import type {
44 TerminalAttachInput,
45 TerminalAttachStreamEvent,
46 TerminalClearInput,
47 TerminalCloseInput,
48 TerminalMetadataStreamEvent,
49 TerminalOpenInput,
50 TerminalResizeInput,
51 TerminalRestartInput,
52 TerminalSessionSnapshot,
53 TerminalWriteInput,
54} from "./terminal.ts";
55import type { ServerRemoveKeybindingInput, ServerUpsertKeybindingInput } from "./server.ts";
56import * as Schema from "effect/Schema";
57import type {
58 ClientOrchestrationCommand,
59 OrchestrationGetFullThreadDiffInput,
60 OrchestrationGetFullThreadDiffResult,
61 OrchestrationGetTurnDiffInput,
62 OrchestrationGetTurnDiffResult,
63 OrchestrationShellSnapshot,
64 OrchestrationShellStreamItem,
65 OrchestrationSubscribeThreadInput,
66 OrchestrationThreadStreamItem,
67} from "./orchestration.ts";
68import { EnvironmentId } from "./baseSchemas.ts";
69import { AuthAccessTokenResult, AuthSessionState, AuthWebSocketTicketResult } from "./auth.ts";
70import { AdvertisedEndpoint } from "./remoteAccess.ts";
71import { EditorId } from "./editor.ts";
72import { ExecutionEnvironmentDescriptor } from "./environment.ts";
73import type { ClientSettings, ServerSettings, ServerSettingsPatch } from "./settings.ts";
74import type {
75 SourceControlCloneRepositoryInput,
76 SourceControlCloneRepositoryResult,
77 SourceControlDiscoveryResult,
78 SourceControlPublishRepositoryInput,
79 SourceControlPublishRepositoryResult,
80 SourceControlRepositoryInfo,
81 SourceControlRepositoryLookupInput,
82} from "./sourceControl.ts";
83
84export interface ContextMenuItem<T extends string = string> {
85 id: T;
86 label: string;
87 destructive?: boolean;
88 disabled?: boolean;
89 children?: readonly ContextMenuItem<T>[];
90}
91
92export interface ContextMenuItemSchemaType {
93 readonly id: string;
94 readonly label: string;
95 readonly destructive?: boolean;
96 readonly disabled?: boolean;
97 readonly children?: readonly ContextMenuItemSchemaType[];
98}
99
100export const ContextMenuItemSchema: Schema.Codec<ContextMenuItemSchemaType> = Schema.Struct({
101 id: Schema.String,
102 label: Schema.String,
103 destructive: Schema.optionalKey(Schema.Boolean),
104 disabled: Schema.optionalKey(Schema.Boolean),
105 children: Schema.optionalKey(
106 Schema.Array(
107 Schema.suspend((): Schema.Codec<ContextMenuItemSchemaType> => ContextMenuItemSchema),
108 ),
109 ),
110});
111
112export type DesktopUpdateStatus =
113 | "disabled"
114 | "idle"
115 | "checking"
116 | "up-to-date"
117 | "available"
118 | "downloading"
119 | "downloaded"
120 | "error";
121
122export type DesktopRuntimeArch = "arm64" | "x64" | "other";
123export type DesktopTheme = "light" | "dark" | "system";
124export type DesktopUpdateChannel = "latest" | "nightly";
125export type DesktopAppStageLabel = "Alpha" | "Dev" | "Nightly";
126
127export const DesktopUpdateStatusSchema = Schema.Literals([
128 "disabled",
129 "idle",
130 "checking",
131 "up-to-date",
132 "available",
133 "downloading",
134 "downloaded",
135 "error",
136]);
137export const DesktopRuntimeArchSchema = Schema.Literals(["arm64", "x64", "other"]);
138export const DesktopThemeSchema = Schema.Literals(["light", "dark", "system"]);
139export const DesktopUpdateChannelSchema = Schema.Literals(["latest", "nightly"]);
140export const DesktopAppStageLabelSchema = Schema.Literals(["Alpha", "Dev", "Nightly"]);
141
142export interface DesktopAppBranding {
143 baseName: string;
144 stageLabel: DesktopAppStageLabel;
145 displayName: string;
146}
147
148export const DesktopAppBrandingSchema = Schema.Struct({
149 baseName: Schema.String,
150 stageLabel: DesktopAppStageLabelSchema,
151 displayName: Schema.String,
152});
153
154export interface DesktopRuntimeInfo {
155 hostArch: DesktopRuntimeArch;
156 appArch: DesktopRuntimeArch;
157 runningUnderArm64Translation: boolean;
158}
159
160export const DesktopRuntimeInfoSchema = Schema.Struct({
161 hostArch: DesktopRuntimeArchSchema,
162 appArch: DesktopRuntimeArchSchema,
163 runningUnderArm64Translation: Schema.Boolean,
164});
165
166export interface DesktopUpdateState {
167 enabled: boolean;
168 status: DesktopUpdateStatus;
169 channel: DesktopUpdateChannel;
170 currentVersion: string;
171 hostArch: DesktopRuntimeArch;
172 appArch: DesktopRuntimeArch;
173 runningUnderArm64Translation: boolean;
174 availableVersion: string | null;
175 downloadedVersion: string | null;
176 downloadPercent: number | null;
177 checkedAt: string | null;
178 message: string | null;
179 errorContext: "check" | "download" | "install" | null;
180 canRetry: boolean;
181}
182
183export const DesktopUpdateStateSchema = Schema.Struct({
184 enabled: Schema.Boolean,
185 status: DesktopUpdateStatusSchema,
186 channel: DesktopUpdateChannelSchema,
187 currentVersion: Schema.String,
188 hostArch: DesktopRuntimeArchSchema,
189 appArch: DesktopRuntimeArchSchema,
190 runningUnderArm64Translation: Schema.Boolean,
191 availableVersion: Schema.NullOr(Schema.String),
192 downloadedVersion: Schema.NullOr(Schema.String),
193 downloadPercent: Schema.NullOr(Schema.Number),
194 checkedAt: Schema.NullOr(Schema.String),
195 message: Schema.NullOr(Schema.String),
196 errorContext: Schema.NullOr(Schema.Literals(["check", "download", "install"])),
197 canRetry: Schema.Boolean,
198});
199
200export interface DesktopUpdateActionResult {
201 accepted: boolean;
202 completed: boolean;
203 state: DesktopUpdateState;
204}
205
206export const DesktopUpdateActionResultSchema = Schema.Struct({
207 accepted: Schema.Boolean,
208 completed: Schema.Boolean,
209 state: DesktopUpdateStateSchema,
210});
211
212export interface DesktopUpdateCheckResult {
213 checked: boolean;
214 state: DesktopUpdateState;
215}
216
217export const DesktopUpdateCheckResultSchema = Schema.Struct({
218 checked: Schema.Boolean,
219 state: DesktopUpdateStateSchema,
220});
221
222export interface DesktopEnvironmentBootstrap {
223 label: string;
224 httpBaseUrl: string | null;
225 wsBaseUrl: string | null;
226 bootstrapToken?: string;
227}
228
229export const DesktopEnvironmentBootstrapSchema = Schema.Struct({
230 label: Schema.String,
231 httpBaseUrl: Schema.NullOr(Schema.String),
232 wsBaseUrl: Schema.NullOr(Schema.String),
233 bootstrapToken: Schema.optionalKey(Schema.String),
234});
235
236export const DesktopSshEnvironmentTargetSchema = Schema.Struct({
237 alias: Schema.String,
238 hostname: Schema.String,
239 username: Schema.NullOr(Schema.String),
240 port: Schema.NullOr(Schema.Number),
241});
242export type DesktopSshEnvironmentTarget = typeof DesktopSshEnvironmentTargetSchema.Type;
243
244export type DesktopSshHostSource = "ssh-config" | "known-hosts";
245export const DesktopSshHostSourceSchema = Schema.Literals(["ssh-config", "known-hosts"]);
246
247export interface DesktopDiscoveredSshHost extends DesktopSshEnvironmentTarget {
248 source: DesktopSshHostSource;
249}
250
251export const DesktopDiscoveredSshHostSchema = Schema.Struct({
252 alias: Schema.String,
253 hostname: Schema.String,
254 username: Schema.NullOr(Schema.String),
255 port: Schema.NullOr(Schema.Number),
256 source: DesktopSshHostSourceSchema,
257});
258
259export interface DesktopSshEnvironmentBootstrap {
260 target: DesktopSshEnvironmentTarget;
261 httpBaseUrl: string;
262 wsBaseUrl: string;
263 pairingToken: string | null;
264 remotePort?: number;
265 remoteServerKind?: "external" | "managed";
266}
267
268export const DesktopSshEnvironmentBootstrapSchema = Schema.Struct({
269 target: DesktopSshEnvironmentTargetSchema,
270 httpBaseUrl: Schema.String,
271 wsBaseUrl: Schema.String,
272 pairingToken: Schema.NullOr(Schema.String),
273 remotePort: Schema.optionalKey(Schema.Number),
274 remoteServerKind: Schema.optionalKey(Schema.Literals(["external", "managed"])),
275});
276
277export interface DesktopSshPasswordPromptRequest {
278 requestId: string;
279 destination: string;
280 username: string | null;
281 prompt: string;
282 expiresAt: string;
283}
284
285export const DesktopSshPasswordPromptRequestSchema = Schema.Struct({
286 requestId: Schema.String,
287 destination: Schema.String,
288 username: Schema.NullOr(Schema.String),
289 prompt: Schema.String,
290 expiresAt: Schema.String,
291});
292
293export const DesktopSshPasswordPromptCancelledType = "ssh-password-prompt-cancelled" as const;
294
295export const DesktopSshPasswordPromptCancelledResultSchema = Schema.Struct({
296 type: Schema.Literal(DesktopSshPasswordPromptCancelledType),
297 message: Schema.String,
298});
299
300export const DesktopSshEnvironmentEnsureOptionsSchema = Schema.Struct({
301 issuePairingToken: Schema.optionalKey(Schema.Boolean),
302});
303
304export const DesktopSshEnvironmentEnsureInputSchema = Schema.Struct({
305 target: DesktopSshEnvironmentTargetSchema,
306 options: Schema.optionalKey(DesktopSshEnvironmentEnsureOptionsSchema),
307});
308
309export const DesktopSshEnvironmentEnsureResultSchema = Schema.Union([
310 DesktopSshEnvironmentBootstrapSchema,
311 DesktopSshPasswordPromptCancelledResultSchema,
312]);
313
314export const DesktopSshHttpBaseUrlInputSchema = Schema.Struct({
315 httpBaseUrl: Schema.String,
316});
317
318export const DesktopSshBearerRequestInputSchema = Schema.Struct({
319 httpBaseUrl: Schema.String,
320 bearerToken: Schema.String,
321});
322
323export const DesktopSshBearerBootstrapInputSchema = Schema.Struct({
324 httpBaseUrl: Schema.String,
325 credential: Schema.String,
326});
327
328export const DesktopSshPasswordPromptResolutionInputSchema = Schema.Struct({
329 requestId: Schema.String,
330 password: Schema.NullOr(Schema.String),
331});
332
333export const PersistedSavedEnvironmentRecordSchema = Schema.Struct({
334 environmentId: EnvironmentId,
335 label: Schema.String,
336 wsBaseUrl: Schema.String,
337 httpBaseUrl: Schema.String,
338 createdAt: Schema.String,
339 lastConnectedAt: Schema.NullOr(Schema.String),
340 desktopSsh: Schema.optionalKey(DesktopSshEnvironmentTargetSchema),
341 relayManaged: Schema.optionalKey(
342 Schema.Struct({
343 relayUrl: Schema.String,
344 }),
345 ),
346});
347export type PersistedSavedEnvironmentRecord = typeof PersistedSavedEnvironmentRecordSchema.Type;
348
349export type DesktopServerExposureMode = "local-only" | "network-accessible";
350
351export const DesktopServerExposureModeSchema = Schema.Literals([
352 "local-only",
353 "network-accessible",
354]);
355
356export interface DesktopServerExposureState {
357 mode: DesktopServerExposureMode;
358 endpointUrl: string | null;
359 advertisedHost: string | null;
360 tailscaleServeEnabled: boolean;
361 tailscaleServePort: number;
362}
363
364export const DesktopServerExposureStateSchema = Schema.Struct({
365 mode: DesktopServerExposureModeSchema,
366 endpointUrl: Schema.NullOr(Schema.String),
367 advertisedHost: Schema.NullOr(Schema.String),
368 tailscaleServeEnabled: Schema.Boolean,
369 tailscaleServePort: Schema.Number,
370});
371
372export interface PickFolderOptions {
373 initialPath?: string | null;
374}
375
376export const PickFolderOptionsSchema = Schema.Struct({
377 initialPath: Schema.optionalKey(Schema.NullOr(Schema.String)),
378});
379
380export const DesktopCloudAuthFetchInputSchema = Schema.Struct({
381 url: Schema.String,
382 method: Schema.optionalKey(Schema.String),
383 headers: Schema.Record(Schema.String, Schema.String),
384 body: Schema.optionalKey(Schema.String),
385});
386export type DesktopCloudAuthFetchInput = typeof DesktopCloudAuthFetchInputSchema.Type;
387
388export const DesktopCloudAuthFetchResultSchema = Schema.Struct({
389 ok: Schema.Boolean,
390 status: Schema.Number,
391 statusText: Schema.String,
392 headers: Schema.Record(Schema.String, Schema.String),
393 body: Schema.String,
394});
395export type DesktopCloudAuthFetchResult = typeof DesktopCloudAuthFetchResultSchema.Type;
396
397export interface DesktopBridge {
398 getAppBranding: () => DesktopAppBranding | null;
399 getLocalEnvironmentBootstrap: () => DesktopEnvironmentBootstrap | null;
400 getClientSettings: () => Promise<ClientSettings | null>;
401 setClientSettings: (settings: ClientSettings) => Promise<void>;
402 getSavedEnvironmentRegistry: () => Promise<readonly PersistedSavedEnvironmentRecord[]>;
403 setSavedEnvironmentRegistry: (
404 records: readonly PersistedSavedEnvironmentRecord[],
405 ) => Promise<void>;
406 getSavedEnvironmentSecret: (environmentId: EnvironmentId) => Promise<string | null>;
407 setSavedEnvironmentSecret: (environmentId: EnvironmentId, secret: string) => Promise<boolean>;
408 removeSavedEnvironmentSecret: (environmentId: EnvironmentId) => Promise<void>;
409 discoverSshHosts: () => Promise<readonly DesktopDiscoveredSshHost[]>;
410 ensureSshEnvironment: (
411 target: DesktopSshEnvironmentTarget,
412 options?: { issuePairingToken?: boolean },
413 ) => Promise<DesktopSshEnvironmentBootstrap>;
414 disconnectSshEnvironment: (target: DesktopSshEnvironmentTarget) => Promise<void>;
415 fetchSshEnvironmentDescriptor: (httpBaseUrl: string) => Promise<ExecutionEnvironmentDescriptor>;
416 bootstrapSshBearerSession: (
417 httpBaseUrl: string,
418 credential: string,
419 ) => Promise<AuthAccessTokenResult>;
420 fetchSshSessionState: (httpBaseUrl: string, bearerToken: string) => Promise<AuthSessionState>;
421 issueSshWebSocketTicket: (
422 httpBaseUrl: string,
423 bearerToken: string,
424 ) => Promise<AuthWebSocketTicketResult>;
425 onSshPasswordPrompt: (listener: (request: DesktopSshPasswordPromptRequest) => void) => () => void;
426 resolveSshPasswordPrompt: (requestId: string, password: string | null) => Promise<void>;
427 getServerExposureState: () => Promise<DesktopServerExposureState>;
428 setServerExposureMode: (mode: DesktopServerExposureMode) => Promise<DesktopServerExposureState>;
429 setTailscaleServeEnabled: (input: {
430 readonly enabled: boolean;
431 readonly port?: number;
432 }) => Promise<DesktopServerExposureState>;
433 getAdvertisedEndpoints: () => Promise<readonly AdvertisedEndpoint[]>;
434 pickFolder: (options?: PickFolderOptions) => Promise<string | null>;
435 confirm: (message: string) => Promise<boolean>;
436 setTheme: (theme: DesktopTheme) => Promise<void>;
437 showContextMenu: <T extends string>(
438 items: readonly ContextMenuItem<T>[],
439 position?: { x: number; y: number },
440 ) => Promise<T | null>;
441 openExternal: (url: string) => Promise<boolean>;
442 createCloudAuthRequest: () => Promise<string>;
443 getCloudAuthToken: () => Promise<string | null>;
444 setCloudAuthToken: (token: string) => Promise<boolean>;
445 clearCloudAuthToken: () => Promise<void>;
446 fetchCloudAuth: (input: DesktopCloudAuthFetchInput) => Promise<DesktopCloudAuthFetchResult>;
447 onCloudAuthCallback: (listener: (rawUrl: string) => void) => () => void;
448 onMenuAction: (listener: (action: string) => void) => () => void;
449 getUpdateState: () => Promise<DesktopUpdateState>;
450 setUpdateChannel: (channel: DesktopUpdateChannel) => Promise<DesktopUpdateState>;
451 checkForUpdate: () => Promise<DesktopUpdateCheckResult>;
452 downloadUpdate: () => Promise<DesktopUpdateActionResult>;
453 installUpdate: () => Promise<DesktopUpdateActionResult>;
454 onUpdateState: (listener: (state: DesktopUpdateState) => void) => () => void;
455}
456
457/**
458 * APIs bound to the local app shell, not to any particular backend environment.
459 *
460 * These capabilities describe the desktop/browser host that the user is
461 * currently running: dialogs, editor/external-link opening, context menus, and
462 * app-level settings/config access. They must not be used as a proxy for
463 * "whatever environment the user is targeting", because in a multi-environment
464 * world the local shell and a selected backend environment are distinct
465 * concepts.
466 */
467export interface LocalApi {
468 dialogs: {
469 pickFolder: (options?: PickFolderOptions) => Promise<string | null>;
470 confirm: (message: string) => Promise<boolean>;
471 };
472 shell: {
473 openInEditor: (cwd: string, editor: EditorId) => Promise<void>;
474 openExternal: (url: string) => Promise<void>;
475 };
476 contextMenu: {
477 show: <T extends string>(
478 items: readonly ContextMenuItem<T>[],
479 position?: { x: number; y: number },
480 ) => Promise<T | null>;
481 };
482 persistence: {
483 getClientSettings: () => Promise<ClientSettings | null>;
484 setClientSettings: (settings: ClientSettings) => Promise<void>;
485 getSavedEnvironmentRegistry: () => Promise<readonly PersistedSavedEnvironmentRecord[]>;
486 setSavedEnvironmentRegistry: (
487 records: readonly PersistedSavedEnvironmentRecord[],
488 ) => Promise<void>;
489 getSavedEnvironmentSecret: (environmentId: EnvironmentId) => Promise<string | null>;
490 setSavedEnvironmentSecret: (environmentId: EnvironmentId, secret: string) => Promise<boolean>;
491 removeSavedEnvironmentSecret: (environmentId: EnvironmentId) => Promise<void>;
492 };
493 server: {
494 getConfig: () => Promise<ServerConfig>;
495 /**
496 * Refresh provider snapshots. When `input.instanceId` is supplied only that
497 * configured instance is probed; otherwise every configured instance is
498 * refreshed (legacy untargeted refresh).
499 */
500 refreshProviders: (input?: {
501 readonly instanceId?: ProviderInstanceId;
502 }) => Promise<ServerProviderUpdatedPayload>;
503 updateProvider: (input: ServerProviderUpdateInput) => Promise<ServerProviderUpdatedPayload>;
504 upsertKeybinding: (input: ServerUpsertKeybindingInput) => Promise<ServerUpsertKeybindingResult>;
505 removeKeybinding: (input: ServerRemoveKeybindingInput) => Promise<ServerRemoveKeybindingResult>;
506 getSettings: () => Promise<ServerSettings>;
507 updateSettings: (patch: ServerSettingsPatch) => Promise<ServerSettings>;
508 discoverSourceControl: () => Promise<SourceControlDiscoveryResult>;
509 getTraceDiagnostics: () => Promise<ServerTraceDiagnosticsResult>;
510 getProcessDiagnostics: () => Promise<ServerProcessDiagnosticsResult>;
511 getProcessResourceHistory: (
512 input: ServerProcessResourceHistoryInput,
513 ) => Promise<ServerProcessResourceHistoryResult>;
514 signalProcess: (input: ServerSignalProcessInput) => Promise<ServerSignalProcessResult>;
515 };
516}
517
518/**
519 * APIs bound to a specific backend environment connection.
520 *
521 * These operations must always be routed with explicit environment context.
522 * They represent remote stateful capabilities such as orchestration, terminal,
523 * project, VCS, and provider operations. In multi-environment mode, each environment gets
524 * its own instance of this surface, and callers should resolve it by
525 * `environmentId` rather than reaching through the local desktop bridge.
526 */
527export interface EnvironmentApi {
528 terminal: {
529 open: (input: typeof TerminalOpenInput.Encoded) => Promise<TerminalSessionSnapshot>;
530 attach: (
531 input: typeof TerminalAttachInput.Encoded,
532 callback: (event: TerminalAttachStreamEvent) => void,
533 options?: {
534 onResubscribe?: () => void;
535 },
536 ) => () => void;
537 write: (input: typeof TerminalWriteInput.Encoded) => Promise<void>;
538 resize: (input: typeof TerminalResizeInput.Encoded) => Promise<void>;
539 clear: (input: typeof TerminalClearInput.Encoded) => Promise<void>;
540 restart: (input: typeof TerminalRestartInput.Encoded) => Promise<TerminalSessionSnapshot>;
541 close: (input: typeof TerminalCloseInput.Encoded) => Promise<void>;
542 onMetadata: (
543 callback: (event: TerminalMetadataStreamEvent) => void,
544 options?: {
545 onResubscribe?: () => void;
546 },
547 ) => () => void;
548 };
549 projects: {
550 searchEntries: (input: ProjectSearchEntriesInput) => Promise<ProjectSearchEntriesResult>;
551 writeFile: (input: ProjectWriteFileInput) => Promise<ProjectWriteFileResult>;
552 };
553 filesystem: {
554 browse: (input: FilesystemBrowseInput) => Promise<FilesystemBrowseResult>;
555 };
556 sourceControl: {
557 lookupRepository: (
558 input: SourceControlRepositoryLookupInput,
559 ) => Promise<SourceControlRepositoryInfo>;
560 cloneRepository: (
561 input: SourceControlCloneRepositoryInput,
562 ) => Promise<SourceControlCloneRepositoryResult>;
563 publishRepository: (
564 input: SourceControlPublishRepositoryInput,
565 ) => Promise<SourceControlPublishRepositoryResult>;
566 };
567 vcs: {
568 listRefs: (input: VcsListRefsInput) => Promise<VcsListRefsResult>;
569 createWorktree: (input: VcsCreateWorktreeInput) => Promise<VcsCreateWorktreeResult>;
570 removeWorktree: (input: VcsRemoveWorktreeInput) => Promise<void>;
571 createRef: (input: VcsCreateRefInput) => Promise<VcsCreateRefResult>;
572 switchRef: (input: VcsSwitchRefInput) => Promise<VcsSwitchRefResult>;
573 init: (input: VcsInitInput) => Promise<void>;
574 pull: (input: VcsPullInput) => Promise<VcsPullResult>;
575 refreshStatus: (input: VcsStatusInput) => Promise<VcsStatusResult>;
576 onStatus: (
577 input: VcsStatusInput,
578 callback: (status: VcsStatusResult) => void,
579 options?: {
580 onResubscribe?: () => void;
581 },
582 ) => () => void;
583 };
584 git: {
585 resolvePullRequest: (input: GitPullRequestRefInput) => Promise<GitResolvePullRequestResult>;
586 preparePullRequestThread: (
587 input: GitPreparePullRequestThreadInput,
588 ) => Promise<GitPreparePullRequestThreadResult>;
589 };
590 review: {
591 getDiffPreview: (input: ReviewDiffPreviewInput) => Promise<ReviewDiffPreviewResult>;
592 };
593 orchestration: {
594 dispatchCommand: (command: ClientOrchestrationCommand) => Promise<{ sequence: number }>;
595 getTurnDiff: (input: OrchestrationGetTurnDiffInput) => Promise<OrchestrationGetTurnDiffResult>;
596 getFullThreadDiff: (
597 input: OrchestrationGetFullThreadDiffInput,
598 ) => Promise<OrchestrationGetFullThreadDiffResult>;
599 getArchivedShellSnapshot: () => Promise<OrchestrationShellSnapshot>;
600 subscribeShell: (
601 callback: (event: OrchestrationShellStreamItem) => void,
602 options?: {
603 onResubscribe?: () => void;
604 },
605 ) => () => void;
606 subscribeThread: (
607 input: OrchestrationSubscribeThreadInput,
608 callback: (event: OrchestrationThreadStreamItem) => void,
609 options?: {
610 onResubscribe?: () => void;
611 },
612 ) => () => void;
613 };
614}