@camerontaylor/paseo-client 0.8.0-fork.1 → 0.8.0-fork.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/connection/index.d.ts +27 -21
- package/dist/connection/index.js +89 -85
- package/dist/connection/legacy-workspaces.d.ts +19 -0
- package/dist/connection/legacy-workspaces.js +160 -0
- package/dist/connection/legacy.d.ts +31 -0
- package/dist/connection/legacy.js +245 -0
- package/dist/connection/owned.d.ts +36 -0
- package/dist/connection/owned.js +210 -0
- package/dist/daemon-client.d.ts +88 -57
- package/dist/daemon-client.js +259 -392
- package/dist/index.d.ts +39 -10
- package/dist/index.js +254 -125
- package/dist/provider-snapshots/index.d.ts +1 -3
- package/dist/provider-snapshots/index.js +23 -27
- package/dist/terminal-stream-router.d.ts +7 -10
- package/dist/terminal-stream-router.js +41 -88
- package/dist/timeline-subscription/index.d.ts +25 -0
- package/dist/timeline-subscription/index.js +56 -0
- package/package.json +7 -3
- package/dist/creation/index.d.ts +0 -47
- package/dist/creation/index.js +0 -216
package/dist/daemon-client.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import type
|
|
1
|
+
import { type TimelineMessage } from "./timeline-subscription/index.js";
|
|
2
|
+
import { type OwnedSubscription, type TimelineSubscription } from "./connection/index.js";
|
|
3
3
|
import type { z } from "zod";
|
|
4
|
-
import {
|
|
4
|
+
import type { SessionEventSubscription } from "@camerontaylor/paseo-protocol/messages";
|
|
5
|
+
import type { ClientCapability } from "@camerontaylor/paseo-protocol/client-capabilities";
|
|
5
6
|
import type { AgentAttentionNotificationPayload } from "@camerontaylor/paseo-protocol/agent-attention-notification";
|
|
6
7
|
import { AgentRefreshedStatusPayloadSchema, CheckoutRenameBranchResponseSchema, RenameTerminalResponseSchema, RestartRequestedStatusPayloadSchema, ShutdownRequestedStatusPayloadSchema, DaemonUpdateResponseSchema, type ActiveTurnBehavior, type ServerInfoStatusPayload } from "@camerontaylor/paseo-protocol/messages";
|
|
7
8
|
import type { AgentStreamEventPayload, AgentSnapshotPayload, ProjectPlacementPayload, AgentPermissionResolvedMessage, CreateAgentRequestMessage, CreatePaseoWorktreeRequest, FileDownloadTokenResponse, FileUploadResponse, FileExplorerResponse, FileVersion, FileWriteResult, FetchAgentTimelineResponseMessage, AgentForkContextResponseMessage, GitSetupOptions, CheckoutStatusResponse, CheckoutCommit, ParsedDiffFile, CheckoutCommitResponse, CheckoutMergeResponse, CheckoutMergeFromBaseResponse, CheckoutPullResponse, CheckoutPushResponse, CheckoutRefreshResponse, CheckoutPrCreateResponse, CheckoutPrMergeResponse, CheckoutPrMergeMethod, CheckoutForgeSetAutoMergeResponse, CheckoutGithubSetAutoMergeResponse, CheckoutForgeGetCheckDetailsResponse, CheckoutGithubGetCheckDetailsResponse, CheckoutPrStatusResponse, PullRequestTimelineResponse, CheckoutSwitchBranchResponse, StashSaveResponse, StashPopResponse, StashListResponse, ValidateBranchResponse, BranchSuggestionsResponse, ForgeSearchResponse, ForgeSearchRequest, GitHubSearchResponse, GitHubSearchRequest, DirectorySuggestionsResponse, PaseoWorktreeListResponse, PaseoWorktreeArchiveResponse, ProjectIconSource, ProjectIconResponse, ProjectIconGetResponse, ProjectAddResponse, ProjectCreateDirectoryResponse, OpenProjectResponseMessage, WorkspaceGithubSearchRepositoriesResponse, ProjectGithubCloneProtocol, ProjectGithubCloneResponse, ArchiveWorkspaceResponseMessage, WorkspaceSetupStatusResponseMessage, ListCommandsResponse, ListProviderFeaturesResponseMessage, ListProviderModelsResponseMessage, ListProviderModesResponseMessage, ListAvailableProvidersResponse, GetProvidersSnapshotResponseMessage, RefreshProvidersSnapshotResponseMessage, ProviderDiagnosticResponseMessage, ProviderUsageListResponseMessage, DaemonGetStatusResponse, DaemonGetPairingOfferResponse, DaemonConfigReloadResponse, DiagnosticsResponse, AgentRewindResponseMessage, ListTerminalsResponse, CreateTerminalResponse, SubscribeTerminalResponse, SubscribeTerminalRequest, CloseItemsResponse, KillTerminalResponse, CaptureTerminalResponse, TerminalInput, SessionInboundMessage, SessionOutboundMessage, SendAgentMessageRequest, PaseoConfigRaw, PaseoConfigRevision, WorkspaceCreateRequest, WorkspaceRecoveryState, PluginListItem, PluginLogEntry, PluginSourceStatusItem, PluginSourceUpdateItem, AgentSkillSelection, AgentSkillsStatus, AgentSkillsSaveResult } from "@camerontaylor/paseo-protocol/messages";
|
|
@@ -155,8 +156,6 @@ export interface AgentAttentionRequiredNotification {
|
|
|
155
156
|
}
|
|
156
157
|
type AgentConfigOverrides = Partial<Omit<AgentSessionConfig, "provider" | "cwd">>;
|
|
157
158
|
export interface CreateAgentRequestOptions extends AgentConfigOverrides {
|
|
158
|
-
agentId?: string;
|
|
159
|
-
onEvent?: (snapshot: CreationSnapshot) => void;
|
|
160
159
|
config?: AgentSessionConfig;
|
|
161
160
|
provider?: AgentProvider;
|
|
162
161
|
cwd?: string;
|
|
@@ -176,16 +175,6 @@ export interface CreateAgentRequestOptions extends AgentConfigOverrides {
|
|
|
176
175
|
requestId?: string;
|
|
177
176
|
labels?: Record<string, string>;
|
|
178
177
|
}
|
|
179
|
-
export interface CreateWorkspaceRequestOptions {
|
|
180
|
-
source: WorkspaceCreateRequest["source"];
|
|
181
|
-
title?: string;
|
|
182
|
-
idempotencyKey?: string;
|
|
183
|
-
workspaceId?: string;
|
|
184
|
-
agent?: Omit<CreateAgentRequestOptions, "workspaceId" | "onEvent" | "worktree" | "git" | "worktreeName" | "idempotencyKey" | "requestId">;
|
|
185
|
-
onEvent?: (snapshot: CreationSnapshot) => void;
|
|
186
|
-
firstAgentContext?: WorkspaceCreateRequest["firstAgentContext"];
|
|
187
|
-
requestId?: string;
|
|
188
|
-
}
|
|
189
178
|
export interface CreatePaseoWorktreeInput extends Pick<CreatePaseoWorktreeRequest, "cwd" | "projectId" | "worktreeSlug" | "firstAgentContext" | "refName" | "action" | "checkoutSource" | "githubPrNumber"> {
|
|
190
179
|
}
|
|
191
180
|
type CheckoutStatusPayload = CheckoutStatusResponse["payload"];
|
|
@@ -389,6 +378,7 @@ type FetchAgentsRequest = Extract<SessionInboundMessage, {
|
|
|
389
378
|
type: "fetch_agents_request";
|
|
390
379
|
}>;
|
|
391
380
|
export type FetchAgentsOptions = Omit<FetchAgentsRequest, "type" | "requestId"> & {
|
|
381
|
+
signal?: AbortSignal;
|
|
392
382
|
requestId?: string;
|
|
393
383
|
timeout?: number;
|
|
394
384
|
};
|
|
@@ -422,6 +412,7 @@ type FetchWorkspacesRequest = Extract<SessionInboundMessage, {
|
|
|
422
412
|
type: "fetch_workspaces_request";
|
|
423
413
|
}>;
|
|
424
414
|
export type FetchWorkspacesOptions = Omit<FetchWorkspacesRequest, "type" | "requestId"> & {
|
|
415
|
+
signal?: AbortSignal;
|
|
425
416
|
requestId?: string;
|
|
426
417
|
};
|
|
427
418
|
export type FetchWorkspacesEntry = FetchWorkspacesPayload["entries"][number];
|
|
@@ -549,15 +540,22 @@ type CorrelatedResponseMessage = Extract<SessionOutboundMessage, {
|
|
|
549
540
|
payload: {
|
|
550
541
|
requestId: string;
|
|
551
542
|
};
|
|
543
|
+
}> | Extract<SessionOutboundMessage, {
|
|
544
|
+
type: "terminals_changed";
|
|
552
545
|
}> | GetDaemonConfigResponse | SetDaemonConfigResponse;
|
|
553
546
|
type CorrelatedResponseType = CorrelatedResponseMessage["type"];
|
|
554
|
-
type
|
|
555
|
-
type:
|
|
556
|
-
}
|
|
547
|
+
type CorrelatedResponsePayloads = {
|
|
548
|
+
[Message in CorrelatedResponseMessage as Message["type"]]: Message["payload"];
|
|
549
|
+
};
|
|
550
|
+
type CorrelatedResponsePayload<TType extends CorrelatedResponseType> = CorrelatedResponsePayloads[TType];
|
|
551
|
+
export declare class DaemonConnectionError extends Error {
|
|
552
|
+
readonly code: "DAEMON_CONNECTION_LOST" | "DAEMON_REQUEST_TIMEOUT";
|
|
553
|
+
constructor(message: string, code?: "DAEMON_CONNECTION_LOST" | "DAEMON_REQUEST_TIMEOUT");
|
|
554
|
+
}
|
|
557
555
|
export declare class DaemonClient {
|
|
558
556
|
private config;
|
|
559
557
|
private readonly providerSnapshotUpdates;
|
|
560
|
-
private readonly
|
|
558
|
+
private readonly owned;
|
|
561
559
|
private transport;
|
|
562
560
|
private transportCleanup;
|
|
563
561
|
private rawMessageListeners;
|
|
@@ -576,9 +574,6 @@ export declare class DaemonClient {
|
|
|
576
574
|
private connectReject;
|
|
577
575
|
private lastErrorValue;
|
|
578
576
|
private connectionState;
|
|
579
|
-
private checkoutDiffSubscriptions;
|
|
580
|
-
private terminalDirectorySubscriptions;
|
|
581
|
-
private fileSubscriptions;
|
|
582
577
|
private readonly terminalStreams;
|
|
583
578
|
private pendingBinaryFileReads;
|
|
584
579
|
private activeBinaryFileTransfers;
|
|
@@ -679,18 +674,42 @@ export declare class DaemonClient {
|
|
|
679
674
|
private startLivenessHeartbeat;
|
|
680
675
|
private stopLivenessHeartbeat;
|
|
681
676
|
private scheduleNextLivenessHeartbeat;
|
|
677
|
+
private observe;
|
|
678
|
+
registerBrowserHost(registration: Omit<Extract<SessionInboundMessage, {
|
|
679
|
+
type: "browser.host.register.request";
|
|
680
|
+
}>, "type" | "requestId">, options?: {
|
|
681
|
+
signal?: AbortSignal;
|
|
682
|
+
}): OwnedSubscription<CorrelatedResponsePayload<"browser.host.register.response">>;
|
|
683
|
+
observeEvents(events: SessionEventSubscription[], options?: {
|
|
684
|
+
signal?: AbortSignal;
|
|
685
|
+
notifications?: boolean;
|
|
686
|
+
}): OwnedSubscription<CorrelatedResponsePayload<"session.events.set_subscription.response">>;
|
|
687
|
+
observeAgents(options?: Omit<FetchAgentsOptions, "subscribe">): OwnedSubscription<FetchAgentsPayload>;
|
|
688
|
+
observeWorkspaces(options?: Omit<FetchWorkspacesOptions, "subscribe">): OwnedSubscription<FetchWorkspacesPayload>;
|
|
689
|
+
fetchAgents(options: FetchAgentsOptions & {
|
|
690
|
+
subscribe: {};
|
|
691
|
+
}): Promise<FetchAgentsPayload & {
|
|
692
|
+
subscription: OwnedSubscription<FetchAgentsPayload>;
|
|
693
|
+
}>;
|
|
682
694
|
fetchAgents(options?: FetchAgentsOptions): Promise<FetchAgentsPayload>;
|
|
683
695
|
fetchAgentHistory(options?: FetchAgentHistoryOptions): Promise<FetchAgentHistoryPayload>;
|
|
684
696
|
fetchRecentProviderSessions(options?: FetchRecentProviderSessionsOptions): Promise<FetchRecentProviderSessionsPayload>;
|
|
697
|
+
fetchWorkspaces(options: FetchWorkspacesOptions & {
|
|
698
|
+
subscribe: {};
|
|
699
|
+
}): Promise<FetchWorkspacesPayload & {
|
|
700
|
+
subscription: OwnedSubscription<FetchWorkspacesPayload>;
|
|
701
|
+
}>;
|
|
685
702
|
fetchWorkspaces(options?: FetchWorkspacesOptions): Promise<FetchWorkspacesPayload>;
|
|
686
|
-
listWorkspaceLabels(options
|
|
687
|
-
subscriptionId: string;
|
|
703
|
+
listWorkspaceLabels(options?: {
|
|
688
704
|
sync?: {
|
|
689
705
|
generation: string;
|
|
690
706
|
afterSeq: number;
|
|
691
707
|
};
|
|
692
708
|
requestId?: string;
|
|
693
709
|
}): Promise<WorkspaceLabelListPayload>;
|
|
710
|
+
observeWorkspaceLabels(options?: {
|
|
711
|
+
signal?: AbortSignal;
|
|
712
|
+
}): OwnedSubscription<WorkspaceLabelListPayload>;
|
|
694
713
|
setWorkspaceLabel(options: {
|
|
695
714
|
workspaceId: string;
|
|
696
715
|
label: Extract<SessionInboundMessage, {
|
|
@@ -751,12 +770,7 @@ export declare class DaemonClient {
|
|
|
751
770
|
fetchAgent(options: FetchAgentOptions): Promise<FetchAgentResult | null>;
|
|
752
771
|
fetchAgent(agentId: string, requestId?: string): Promise<FetchAgentResult | null>;
|
|
753
772
|
fetchAgent(agentId: string, options?: LegacyFetchAgentOptions): Promise<FetchAgentResult | null>;
|
|
754
|
-
private resubscribeCheckoutDiffSubscriptions;
|
|
755
|
-
private resubscribeTerminalDirectorySubscriptions;
|
|
756
|
-
private resubscribeFileSubscriptions;
|
|
757
|
-
private readonly creations;
|
|
758
773
|
createAgent(options: CreateAgentRequestOptions): Promise<AgentSnapshotPayload>;
|
|
759
|
-
private createLegacyAgent;
|
|
760
774
|
private requireAgentRequestReceipts;
|
|
761
775
|
deleteAgent(agentId: string): Promise<void>;
|
|
762
776
|
archiveAgent(agentId: string): Promise<{
|
|
@@ -799,6 +813,9 @@ export declare class DaemonClient {
|
|
|
799
813
|
timeout?: number;
|
|
800
814
|
}): Promise<ProviderSubagentListPayload>;
|
|
801
815
|
fetchProviderSubagentTimeline(parentAgentId: string, subagentId: string, options?: FetchProviderSubagentTimelineOptions): Promise<ProviderSubagentTimelinePayload>;
|
|
816
|
+
observeTimeline(agentIds: string[], options?: {
|
|
817
|
+
signal?: AbortSignal;
|
|
818
|
+
}): OwnedSubscription<CorrelatedResponsePayload<"agent.timeline.set_subscription.response">>;
|
|
802
819
|
askSideConversation(parentAgentId: string, threadId: string, question: string, options?: {
|
|
803
820
|
requestId?: string;
|
|
804
821
|
timeout?: number;
|
|
@@ -811,13 +828,7 @@ export declare class DaemonClient {
|
|
|
811
828
|
requestId?: string;
|
|
812
829
|
timeout?: number;
|
|
813
830
|
}): Promise<SideConversationListPayload>;
|
|
814
|
-
|
|
815
|
-
subscribeAgentTimeline(agentId: string, handler: (message: Extract<SessionOutboundMessage, {
|
|
816
|
-
type: "agent_stream" | "agent.timeline.replacement";
|
|
817
|
-
}>) => void): TimelineSubscription;
|
|
818
|
-
private updateEventSubscriptions;
|
|
819
|
-
private sendEventSubscription;
|
|
820
|
-
private sendTimelineSubscription;
|
|
831
|
+
subscribeAgentTimeline(agentId: string, handler: (message: TimelineMessage) => void): TimelineSubscription;
|
|
821
832
|
buildAgentForkContext(agentId: string, options?: AgentForkContextOptions): Promise<AgentForkContextPayload>;
|
|
822
833
|
sendAgentMessage(agentId: string, text: string, options?: SendMessageOptions): Promise<void>;
|
|
823
834
|
sendMessage(agentId: string, text: string, options?: SendMessageOptions): Promise<void>;
|
|
@@ -835,7 +846,9 @@ export declare class DaemonClient {
|
|
|
835
846
|
* Gated on `server_info.features.agentConfigApply`.
|
|
836
847
|
*/
|
|
837
848
|
applyAgentConfig(agentId: string, config: AgentConfigApply): Promise<AgentProviderNotice | null>;
|
|
838
|
-
restartServer(reason?: string, requestId?: string
|
|
849
|
+
restartServer(reason?: string, requestId?: string, options?: {
|
|
850
|
+
timeout?: number;
|
|
851
|
+
}): Promise<RestartRequestedStatusPayload>;
|
|
839
852
|
shutdownServer(options?: ShutdownServerOptions): Promise<ShutdownRequestedStatusPayload>;
|
|
840
853
|
updateDaemon(requestId?: string): Promise<DaemonUpdateResponse["payload"]>;
|
|
841
854
|
setVoiceMode(enabled: boolean, agentId?: string): Promise<SetVoiceModePayload>;
|
|
@@ -858,15 +871,14 @@ export declare class DaemonClient {
|
|
|
858
871
|
baseRef?: string;
|
|
859
872
|
ignoreWhitespace?: boolean;
|
|
860
873
|
}, requestId?: string): Promise<CheckoutDiffPayload>;
|
|
861
|
-
|
|
874
|
+
observeCheckoutDiff(cwd: string, compare: {
|
|
862
875
|
mode: "uncommitted" | "base";
|
|
863
876
|
baseRef?: string;
|
|
864
877
|
ignoreWhitespace?: boolean;
|
|
865
878
|
}, options?: {
|
|
866
|
-
subscriptionId?: string;
|
|
867
879
|
requestId?: string;
|
|
868
|
-
|
|
869
|
-
|
|
880
|
+
signal?: AbortSignal;
|
|
881
|
+
}): OwnedSubscription<SubscribeCheckoutDiffPayload>;
|
|
870
882
|
checkoutCommit(cwd: string, input: {
|
|
871
883
|
message?: string;
|
|
872
884
|
addAll?: boolean;
|
|
@@ -953,8 +965,11 @@ export declare class DaemonClient {
|
|
|
953
965
|
scope?: "workspace" | "worktree";
|
|
954
966
|
}, requestId?: string): Promise<PaseoWorktreeArchivePayload>;
|
|
955
967
|
createPaseoWorktree(input: CreatePaseoWorktreeInput, requestId?: string): Promise<CreatePaseoWorktreePayload>;
|
|
956
|
-
createWorkspace(input:
|
|
957
|
-
|
|
968
|
+
createWorkspace(input: {
|
|
969
|
+
source: WorkspaceCreateRequest["source"];
|
|
970
|
+
title?: string;
|
|
971
|
+
firstAgentContext?: WorkspaceCreateRequest["firstAgentContext"];
|
|
972
|
+
}, requestId?: string): Promise<WorkspaceCreatePayload>;
|
|
958
973
|
validateBranch(options: {
|
|
959
974
|
cwd: string;
|
|
960
975
|
branchName: string;
|
|
@@ -987,12 +1002,19 @@ export declare class DaemonClient {
|
|
|
987
1002
|
private requestFileExplorer;
|
|
988
1003
|
listDirectory(cwd: string, path: string, requestId?: string): Promise<FileExplorerDirectoryPayload>;
|
|
989
1004
|
readFile(cwd: string, path: string, requestId?: string, maxBytes?: number): Promise<FileReadResult>;
|
|
1005
|
+
observeFile(input: {
|
|
1006
|
+
cwd: string;
|
|
1007
|
+
path: string;
|
|
1008
|
+
signal?: AbortSignal;
|
|
1009
|
+
}): OwnedSubscription<CorrelatedResponsePayload<"fs.file.subscribe.response">>;
|
|
990
1010
|
subscribeFile(input: {
|
|
991
1011
|
cwd: string;
|
|
992
1012
|
path: string;
|
|
1013
|
+
signal?: AbortSignal;
|
|
993
1014
|
}, onUpdate: (version: FileVersion) => void): Promise<{
|
|
994
1015
|
initial: FileVersion;
|
|
995
|
-
|
|
1016
|
+
subscription: OwnedSubscription<CorrelatedResponsePayload<"fs.file.subscribe.response">>;
|
|
1017
|
+
unsubscribe: () => Promise<void>;
|
|
996
1018
|
}>;
|
|
997
1019
|
writeFile(input: {
|
|
998
1020
|
cwd: string;
|
|
@@ -1056,7 +1078,7 @@ export declare class DaemonClient {
|
|
|
1056
1078
|
connectHub(hubUrl: string, token: string, permissions?: readonly string[], requestId?: string): Promise<{
|
|
1057
1079
|
requestId: string;
|
|
1058
1080
|
status: {
|
|
1059
|
-
state: "
|
|
1081
|
+
state: "not_connected" | "connecting" | "connected" | "reconnecting" | "disconnecting" | "revoked";
|
|
1060
1082
|
daemonId: string | null;
|
|
1061
1083
|
hubOrigin: string | null;
|
|
1062
1084
|
permissions: ("daemon.read" | "daemon.manage" | "tunnel.manage" | "access.manage" | "workspace.read" | "workspace.write" | "workspace.manage" | "automation.manage" | "hub.execute")[];
|
|
@@ -1070,7 +1092,7 @@ export declare class DaemonClient {
|
|
|
1070
1092
|
}, requestId?: string): Promise<{
|
|
1071
1093
|
requestId: string;
|
|
1072
1094
|
status: {
|
|
1073
|
-
state: "
|
|
1095
|
+
state: "not_connected" | "connecting" | "connected" | "reconnecting" | "disconnecting" | "revoked";
|
|
1074
1096
|
daemonId: string | null;
|
|
1075
1097
|
hubOrigin: string | null;
|
|
1076
1098
|
permissions: ("daemon.read" | "daemon.manage" | "tunnel.manage" | "access.manage" | "workspace.read" | "workspace.write" | "workspace.manage" | "automation.manage" | "hub.execute")[];
|
|
@@ -1081,7 +1103,7 @@ export declare class DaemonClient {
|
|
|
1081
1103
|
getHubStatus(requestId?: string): Promise<{
|
|
1082
1104
|
requestId: string;
|
|
1083
1105
|
status: {
|
|
1084
|
-
state: "
|
|
1106
|
+
state: "not_connected" | "connecting" | "connected" | "reconnecting" | "disconnecting" | "revoked";
|
|
1085
1107
|
daemonId: string | null;
|
|
1086
1108
|
hubOrigin: string | null;
|
|
1087
1109
|
permissions: ("daemon.read" | "daemon.manage" | "tunnel.manage" | "access.manage" | "workspace.read" | "workspace.write" | "workspace.manage" | "automation.manage" | "hub.execute")[];
|
|
@@ -1092,7 +1114,7 @@ export declare class DaemonClient {
|
|
|
1092
1114
|
disconnectHub(force?: boolean, requestId?: string): Promise<{
|
|
1093
1115
|
requestId: string;
|
|
1094
1116
|
status: {
|
|
1095
|
-
state: "
|
|
1117
|
+
state: "not_connected" | "connecting" | "connected" | "reconnecting" | "disconnecting" | "revoked";
|
|
1096
1118
|
daemonId: string | null;
|
|
1097
1119
|
hubOrigin: string | null;
|
|
1098
1120
|
permissions: ("daemon.read" | "daemon.manage" | "tunnel.manage" | "access.manage" | "workspace.read" | "workspace.write" | "workspace.manage" | "automation.manage" | "hub.execute")[];
|
|
@@ -1162,14 +1184,11 @@ export declare class DaemonClient {
|
|
|
1162
1184
|
respondToPermissionAndWait(agentId: string, requestId: string, response: AgentPermissionResponse, timeout?: number): Promise<AgentPermissionResolvedPayload>;
|
|
1163
1185
|
waitForAgentUpsert(agentId: string, predicate: (snapshot: AgentSnapshotPayload) => boolean, timeout?: number): Promise<AgentSnapshotPayload>;
|
|
1164
1186
|
waitForFinish(agentId: string, timeout?: number): Promise<WaitForFinishResult>;
|
|
1165
|
-
|
|
1166
|
-
cwd: string;
|
|
1167
|
-
workspaceId?: string;
|
|
1168
|
-
}): void;
|
|
1169
|
-
unsubscribeTerminals(input: {
|
|
1187
|
+
observeTerminals(input: {
|
|
1170
1188
|
cwd: string;
|
|
1171
1189
|
workspaceId?: string;
|
|
1172
|
-
|
|
1190
|
+
signal?: AbortSignal;
|
|
1191
|
+
}): OwnedSubscription<CorrelatedResponsePayload<"terminals_changed">>;
|
|
1173
1192
|
listTerminals(cwd?: string, requestId?: string, options?: {
|
|
1174
1193
|
workspaceId?: string;
|
|
1175
1194
|
}): Promise<ListTerminalsPayload>;
|
|
@@ -1184,11 +1203,23 @@ export declare class DaemonClient {
|
|
|
1184
1203
|
};
|
|
1185
1204
|
}): Promise<CreateTerminalPayload>;
|
|
1186
1205
|
renameTerminal(input: RenameTerminalInput): Promise<RenameTerminalResult>;
|
|
1187
|
-
|
|
1206
|
+
/**
|
|
1207
|
+
* Snapshot/restore and output arrive in receive. Subscribe to the returned handle
|
|
1208
|
+
* for terminal_stream_exit: payload.error means observation failure, not PTY exit.
|
|
1209
|
+
* Either outcome detaches this slot and releases the handle automatically.
|
|
1210
|
+
*/
|
|
1211
|
+
observeTerminal(terminalId: string, receive: (event: TerminalStreamEvent) => void, options?: {
|
|
1188
1212
|
restore?: SubscribeTerminalRequest["restore"];
|
|
1213
|
+
signal?: AbortSignal;
|
|
1189
1214
|
requestId?: string;
|
|
1190
|
-
}
|
|
1191
|
-
|
|
1215
|
+
}): OwnedSubscription<SubscribeTerminalPayload>;
|
|
1216
|
+
subscribeTerminal(terminalId: string, options?: {
|
|
1217
|
+
restore?: SubscribeTerminalRequest["restore"];
|
|
1218
|
+
signal?: AbortSignal;
|
|
1219
|
+
requestId?: string;
|
|
1220
|
+
}): Promise<SubscribeTerminalPayload & {
|
|
1221
|
+
subscription: OwnedSubscription<SubscribeTerminalPayload>;
|
|
1222
|
+
}>;
|
|
1192
1223
|
sendTerminalInput(terminalId: string, message: TerminalInput["message"]): void;
|
|
1193
1224
|
killTerminal(terminalId: string, requestId?: string): Promise<KillTerminalPayload>;
|
|
1194
1225
|
closeItems(input: {
|