@otto-code/client 0.7.4 → 0.7.6
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/daemon-client-relay-e2ee-transport.js +4 -4
- package/dist/daemon-client-transport-types.d.ts +1 -1
- package/dist/daemon-client-transport-utils.d.ts +5 -1
- package/dist/daemon-client-transport-utils.js +8 -6
- package/dist/daemon-client-transport.d.ts +1 -1
- package/dist/daemon-client-transport.js +1 -1
- package/dist/daemon-client-websocket-transport.js +9 -1
- package/dist/daemon-client.d.ts +238 -4
- package/dist/daemon-client.js +792 -26
- package/dist/index.d.ts +1 -1
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createClientChannel, } from "@otto-code/relay/e2ee";
|
|
2
|
-
import {
|
|
2
|
+
import { extractRelayMessage, normalizeTransportPayload } from "./daemon-client-transport-utils.js";
|
|
3
3
|
export function createRelayE2eeTransportFactory(args) {
|
|
4
4
|
return ({ url, headers }) => {
|
|
5
5
|
const base = args.baseFactory({ url, headers });
|
|
@@ -38,7 +38,7 @@ export function createEncryptedTransport(base, daemonPublicKeyB64, logger) {
|
|
|
38
38
|
if (closed) {
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
41
|
-
emitHandlers(messageHandlers, data);
|
|
41
|
+
emitHandlers(messageHandlers, data, data instanceof ArrayBuffer);
|
|
42
42
|
};
|
|
43
43
|
const relayTransport = {
|
|
44
44
|
send: (data) => {
|
|
@@ -81,8 +81,8 @@ export function createEncryptedTransport(base, daemonPublicKeyB64, logger) {
|
|
|
81
81
|
base.onOpen(() => {
|
|
82
82
|
void startHandshake();
|
|
83
83
|
});
|
|
84
|
-
base.onMessage((
|
|
85
|
-
relayTransport.onmessage?.(
|
|
84
|
+
base.onMessage((data, isBinary) => {
|
|
85
|
+
relayTransport.onmessage?.(extractRelayMessage(data, isBinary));
|
|
86
86
|
});
|
|
87
87
|
base.onClose((event) => {
|
|
88
88
|
const record = event;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export interface DaemonTransport {
|
|
2
2
|
send: (data: string | Uint8Array | ArrayBuffer) => void;
|
|
3
3
|
close: (code?: number, reason?: string) => void;
|
|
4
|
-
onMessage: (handler: (data: unknown) => void) => () => void;
|
|
4
|
+
onMessage: (handler: (data: unknown, isBinary: boolean) => void) => () => void;
|
|
5
5
|
onOpen: (handler: () => void) => () => void;
|
|
6
6
|
onClose: (handler: (event?: unknown) => void) => () => void;
|
|
7
7
|
onError: (handler: (event?: unknown) => void) => () => void;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export declare function copyArrayBufferViewToBuffer(data: ArrayBufferView): ArrayBuffer;
|
|
2
2
|
export declare function normalizeTransportPayload(data: string | Uint8Array | ArrayBuffer): string | ArrayBuffer;
|
|
3
|
-
export
|
|
3
|
+
export interface RelayTransportMessage {
|
|
4
|
+
data: string | ArrayBuffer;
|
|
5
|
+
isBinary: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function extractRelayMessage(event: unknown, nodeIsBinary?: boolean): RelayTransportMessage;
|
|
4
8
|
export declare function describeTransportClose(event?: unknown): string;
|
|
5
9
|
export declare function describeTransportError(event?: unknown): string;
|
|
6
10
|
export declare function safeRandomId(): string;
|
|
@@ -10,18 +10,20 @@ export function normalizeTransportPayload(data) {
|
|
|
10
10
|
}
|
|
11
11
|
return copyArrayBufferViewToBuffer(data);
|
|
12
12
|
}
|
|
13
|
-
export function
|
|
13
|
+
export function extractRelayMessage(event, nodeIsBinary) {
|
|
14
14
|
const raw = event && typeof event === "object" && "data" in event
|
|
15
15
|
? event.data
|
|
16
16
|
: event;
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
const isBinary = nodeIsBinary ?? typeof raw !== "string";
|
|
18
|
+
if (!isBinary) {
|
|
19
|
+
return { data: decodeMessageData(raw) ?? String(raw ?? ""), isBinary: false };
|
|
20
|
+
}
|
|
19
21
|
if (raw instanceof ArrayBuffer)
|
|
20
|
-
return raw;
|
|
22
|
+
return { data: raw, isBinary: true };
|
|
21
23
|
if (ArrayBuffer.isView(raw)) {
|
|
22
|
-
return copyArrayBufferViewToBuffer(raw);
|
|
24
|
+
return { data: copyArrayBufferViewToBuffer(raw), isBinary: true };
|
|
23
25
|
}
|
|
24
|
-
return String(raw ?? "");
|
|
26
|
+
return { data: String(raw ?? ""), isBinary: true };
|
|
25
27
|
}
|
|
26
28
|
export function describeTransportClose(event) {
|
|
27
29
|
if (!event) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { DaemonTransport, DaemonTransportFactory, TransportLogger, WebSocketFactory, WebSocketLike, } from "./daemon-client-transport-types.js";
|
|
2
|
-
export { decodeMessageData, describeTransportClose, describeTransportError, encodeUtf8String,
|
|
2
|
+
export { decodeMessageData, describeTransportClose, describeTransportError, encodeUtf8String, extractRelayMessage, normalizeTransportPayload, safeRandomId, } from "./daemon-client-transport-utils.js";
|
|
3
3
|
export { createEncryptedTransport, createRelayE2eeTransportFactory, } from "./daemon-client-relay-e2ee-transport.js";
|
|
4
4
|
export { bindWsHandler, createWebSocketTransportFactory, defaultWebSocketFactory, } from "./daemon-client-websocket-transport.js";
|
|
5
5
|
//# sourceMappingURL=daemon-client-transport.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { decodeMessageData, describeTransportClose, describeTransportError, encodeUtf8String,
|
|
1
|
+
export { decodeMessageData, describeTransportClose, describeTransportError, encodeUtf8String, extractRelayMessage, normalizeTransportPayload, safeRandomId, } from "./daemon-client-transport-utils.js";
|
|
2
2
|
export { createEncryptedTransport, createRelayE2eeTransportFactory, } from "./daemon-client-relay-e2ee-transport.js";
|
|
3
3
|
export { bindWsHandler, createWebSocketTransportFactory, defaultWebSocketFactory, } from "./daemon-client-websocket-transport.js";
|
|
4
4
|
//# sourceMappingURL=daemon-client-transport.js.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { extractRelayMessage } from "./daemon-client-transport-utils.js";
|
|
1
2
|
export function defaultWebSocketFactory(url, options) {
|
|
2
3
|
const globalWs = globalThis.WebSocket;
|
|
3
4
|
if (!globalWs) {
|
|
@@ -40,10 +41,17 @@ export function createWebSocketTransportFactory(factory) {
|
|
|
40
41
|
onOpen: (handler) => bindWsHandler(ws, "open", handler),
|
|
41
42
|
onClose: (handler) => bindWsHandler(ws, "close", handler),
|
|
42
43
|
onError: (handler) => bindWsHandler(ws, "error", handler),
|
|
43
|
-
onMessage: (handler) =>
|
|
44
|
+
onMessage: (handler) => bindWsMessageHandler(ws, handler),
|
|
44
45
|
};
|
|
45
46
|
};
|
|
46
47
|
}
|
|
48
|
+
function bindWsMessageHandler(ws, handler) {
|
|
49
|
+
const listener = (...args) => {
|
|
50
|
+
const message = extractRelayMessage(args[0], typeof args[1] === "boolean" ? args[1] : undefined);
|
|
51
|
+
handler(message.data, message.isBinary);
|
|
52
|
+
};
|
|
53
|
+
return bindWsHandler(ws, "message", listener);
|
|
54
|
+
}
|
|
47
55
|
function bindTemporaryEarlyCloseErrorHandler(ws) {
|
|
48
56
|
const noop = () => { };
|
|
49
57
|
if (typeof ws.addEventListener === "function") {
|
package/dist/daemon-client.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import type { AgentAttentionNotificationPayload } from "@otto-code/protocol/agent-attention-notification";
|
|
1
2
|
import type { z } from "zod";
|
|
3
|
+
import type { ProjectGithubCloneProtocol } from "@otto-code/protocol/messages";
|
|
2
4
|
import { type ClientCapability } from "@otto-code/protocol/client-capabilities";
|
|
3
5
|
import { AgentRefreshedStatusPayloadSchema, CheckoutRenameBranchResponseSchema, RenameTerminalResponseSchema, RestartRequestedStatusPayloadSchema, ShutdownRequestedStatusPayloadSchema, DaemonUpdateResponseSchema, type ServerInfoStatusPayload } from "@otto-code/protocol/messages";
|
|
4
|
-
import type { AgentStreamEventPayload, AgentSnapshotPayload, ProjectPlacementPayload, AgentPermissionResolvedMessage, CreateAgentRequestMessage, CreateOttoWorktreeRequest, CodeListFilesResponse, CodeSymbolLocation, CodeDefinitionLocation, CodeDefinitionStatus, CodeRenameApplyStatus, CodeRenameFileOutcome, CodeRenameUndoFile, CodeRenameUndoStatus, CodeHoverRange, CodeRenameEdit, CodeRenameFilePlan, LspLanguageState, LspRunningServer, CodeSolutionGetTreeResponse, CodeSolutionLoadProjectResponse, SolutionFormat, SolutionRef, SolutionTreeFolder, SolutionTreeProject, SolutionProjectNode, SolutionProjectStatus, SolutionPackageReference, FileCreateResult, FileDeleteResult, FileDownloadTokenResponse, FileEntryKind, FileEol, FileRenameResult, FileReplaceFileResult, FileReplaceRequest, FileReplaceResponse, FileSearchResultPayload, FileSearchSummary, FileUploadResponse, FileExplorerResponse, FileWatchEventPayload, FileWriteResult, FileRefineResult, FileRefineDocument, FileRefineReference, FetchAgentTimelineResponseMessage, AgentForkContextResponseMessage, GitSetupOptions, CheckoutStatusResponse, CheckoutCommitResponse, CheckoutGitCommitResponse, CheckoutGitCommitAgentResponse, CheckoutGitRollbackResponse, CheckoutGitFileHistoryResponse, CheckoutGitFileCommitDiffResponse, CheckoutGitFileBlameResponse, CheckoutGitFileOriginResponse, CheckoutGitGetOperationLogResponse, CheckoutMergeResponse, CheckoutMergeFromBaseResponse, CheckoutPullResponse, CheckoutPushResponse, CheckoutRefreshResponse, CheckoutPrCreateResponse, CheckoutPrMergeResponse, CheckoutPrMergeMethod, CheckoutGithubSetAutoMergeResponse, CheckoutGithubGetCheckDetailsResponse, PreviewListConfigResponse, PreviewStartResponse, PreviewBindTabResponse, PreviewStopResponse, CheckoutPrStatusResponse, PullRequestTimelineResponse, CheckoutSwitchBranchResponse, StashSaveResponse, StashPopResponse, StashListResponse, ValidateBranchResponse, BranchSuggestionsResponse, GitHubSearchResponse, GitHubSearchRequest, GitHostingProviderId, HostingSearchRequest, HostingSearchResponse, HostingAuthStatusResponse, DirectorySuggestionsResponse, OttoWorktreeListResponse, OttoWorktreeArchiveResponse, ProjectIconResponse, ContextCategory, ContextPromptPreviewGetResponseMessage, ContextReportGetResponseMessage, ContextEdgeConvertResponseMessage, ContextFindingsFixResponseMessage, PersonalityMemoryListResponseMessage, PersonalityMemoryUpdateResponseMessage, PersonalityMemoryTransferResponseMessage, PersonalityMemoryStatsResponseMessage, ProjectAddResponse, ProjectScaffoldGit, ProjectScaffoldProgress, ProjectScaffoldResponse, HostingListRepositoriesResponse, HostingListOwnersResponse, OpenProjectResponseMessage, ArchiveWorkspaceResponseMessage, WorkspaceArchivePreflightResponse, WorktreeBaseRefSetResponse, WorktreeReattachListResponse, WorktreeReattachResponse, WorktreeReattachTarget, WorkspaceSetupStatusResponseMessage, ListCommandsResponse, ListProviderFeaturesResponseMessage, ListProviderModelsResponseMessage, ListProviderModesResponseMessage, ListAvailableProvidersResponse, GetProvidersSnapshotResponseMessage, RefreshProvidersSnapshotResponseMessage, ProviderDiagnosticResponseMessage, ProviderUsageListResponseMessage, StatsActivityGetResponseMessage, StatsActivityResetResponseMessage, UsageLogGetResponseMessage, AgentContextGetUsageResponseMessage, DaemonGetStatusResponse, DaemonGetPairingOfferResponse, DiagnosticsResponse, AgentRewindResponseMessage, ListTerminalsResponse, CreateTerminalResponse, SubscribeTerminalResponse, SubscribeTerminalRequest, CloseItemsResponse, AttachmentsImagesClearResponse, AttachmentsImagesStatsResponse, HistoryAgentsClearArchivedResponse, KillTerminalResponse, CaptureTerminalResponse, TerminalInput, SessionInboundMessage, SessionOutboundMessage, SendAgentMessageRequest, AgentPromptDelivery, TasksSuggestedStartMode, OttoConfigRaw, OttoConfigRevision, WorkspaceCreateRequest } from "@otto-code/protocol/messages";
|
|
6
|
+
import type { AgentStreamEventPayload, AgentSnapshotPayload, ProjectPlacementPayload, AgentPermissionResolvedMessage, CreateAgentRequestMessage, CreateOttoWorktreeRequest, CodeListFilesResponse, CodeSymbolLocation, CodeDefinitionLocation, CodeDefinitionStatus, CodeRenameApplyStatus, CodeRenameFileOutcome, CodeRenameUndoFile, CodeRenameUndoStatus, CodeHoverRange, CodeRenameEdit, CodeRenameFilePlan, LspLanguageState, LspRunningServer, CodeSolutionGetTreeResponse, CodeSolutionLoadProjectResponse, SolutionFormat, SolutionRef, SolutionTreeFolder, SolutionTreeProject, SolutionProjectNode, SolutionProjectStatus, SolutionPackageReference, FileCreateResult, FileDeleteResult, FileDownloadTokenResponse, FileEntryKind, FileEol, FileRenameResult, FileReplaceFileResult, FileReplaceRequest, FileReplaceResponse, FileSearchResultPayload, FileSearchSummary, FileUploadResponse, FileExplorerResponse, FileWatchEventPayload, FileWriteResult, FileRefineResult, FileRefineDocument, FileRefineReference, FetchAgentTimelineResponseMessage, AgentForkContextResponseMessage, GitSetupOptions, CheckoutStatusResponse, CheckoutCommitResponse, CheckoutGitCommitResponse, CheckoutGitCommitAgentResponse, CheckoutGitRollbackResponse, CheckoutGitFileHistoryResponse, CheckoutGitFileCommitDiffResponse, CheckoutGitFileBlameResponse, CheckoutGitFileOriginResponse, CheckoutGitGetOperationLogResponse, CheckoutMergeResponse, CheckoutMergeFromBaseResponse, CheckoutPullResponse, CheckoutPushResponse, CheckoutRefreshResponse, CheckoutPrCreateResponse, CheckoutPrMergeResponse, CheckoutPrMergeMethod, CheckoutGithubSetAutoMergeResponse, CheckoutGithubGetCheckDetailsResponse, PreviewListConfigResponse, PreviewStartResponse, PreviewBindTabResponse, PreviewStopResponse, CheckoutPrStatusResponse, PullRequestTimelineResponse, CheckoutSwitchBranchResponse, StashSaveResponse, StashPopResponse, StashListResponse, ValidateBranchResponse, BranchSuggestionsResponse, FileVersion, CheckoutCommit, ParsedDiffFile, WorkspaceRecoveryState, CheckoutForgeGetCheckDetailsResponse, CheckoutForgeSetAutoMergeResponse, ProjectCreateDirectoryResponse, FsFileWriteResult, FsFileWriteBinaryResult, GitHubSearchResponse, GitHubSearchRequest, ForgeSearchResponse, ForgeSearchRequest, GitHostingProviderId, HostingSearchRequest, HostingSearchResponse, HostingAuthStatusResponse, DirectorySuggestionsResponse, OttoWorktreeListResponse, OttoWorktreeArchiveResponse, ProjectIconResponse, ContextCategory, ContextPromptPreviewGetResponseMessage, ContextReportGetResponseMessage, ContextEdgeConvertResponseMessage, ContextFindingsFixResponseMessage, PersonalityMemoryListResponseMessage, PersonalityMemoryUpdateResponseMessage, PersonalityMemoryTransferResponseMessage, PersonalityMemoryStatsResponseMessage, ProjectAddResponse, ProjectScaffoldGit, ProjectScaffoldProgress, ProjectScaffoldResponse, HostingListRepositoriesResponse, HostingListOwnersResponse, OpenProjectResponseMessage, ArchiveWorkspaceResponseMessage, WorkspaceArchivePreflightResponse, WorktreeBaseRefSetResponse, WorktreeReattachListResponse, WorktreeReattachResponse, WorktreeReattachTarget, WorkspaceSetupStatusResponseMessage, ListCommandsResponse, ListProviderFeaturesResponseMessage, ListProviderModelsResponseMessage, ListProviderModesResponseMessage, ListAvailableProvidersResponse, GetProvidersSnapshotResponseMessage, RefreshProvidersSnapshotResponseMessage, ProviderDiagnosticResponseMessage, ProviderUsageListResponseMessage, StatsActivityGetResponseMessage, StatsActivityResetResponseMessage, UsageLogGetResponseMessage, AgentContextGetUsageResponseMessage, DaemonGetStatusResponse, DaemonGetPairingOfferResponse, DiagnosticsResponse, AgentRewindResponseMessage, ListTerminalsResponse, CreateTerminalResponse, SubscribeTerminalResponse, SubscribeTerminalRequest, CloseItemsResponse, AttachmentsImagesClearResponse, AttachmentsImagesStatsResponse, HistoryAgentsClearArchivedResponse, KillTerminalResponse, CaptureTerminalResponse, TerminalInput, SessionInboundMessage, SessionOutboundMessage, SendAgentMessageRequest, AgentPromptDelivery, TasksSuggestedStartMode, OttoConfigRaw, OttoConfigRevision, WorkspaceCreateRequest } from "@otto-code/protocol/messages";
|
|
5
7
|
import type { AgentPermissionRequest, AgentPermissionResponse, AgentPersistenceHandle, AgentProviderNotice, AgentProvider, AgentSessionConfig } from "@otto-code/protocol/agent-types";
|
|
6
8
|
import type { OrchestrationGraph, PromptTemplate, Run } from "@otto-code/protocol/orchestration";
|
|
7
|
-
import type { CueMoment, MutableDaemonConfig, MutableDaemonConfigPatch, ProjectLink, SpeechSettingsOptions, SpeechTtsPreviewResult, SpeechTtsSpeakResult, SpeechTtsSpeakCancelResult, VisualizerVoiceCuesResult } from "@otto-code/protocol/messages";
|
|
9
|
+
import type { BrainCatalogModel, BrainEvals, BrainHfSearchResult, BrainHostStatus, BrainInstalledModel, BrainJob, BrainNetworkInfo, BrainRemoteConfig, BrainRepoQuant, BrainRuntime, ConnectorsListToolsResponse, CueMoment, MutableDaemonConfig, MutableDaemonConfigPatch, ProjectLink, SpeechSettingsOptions, SpeechTtsPreviewResult, SpeechTtsSpeakResult, SpeechTtsSpeakCancelResult, VisualizerVoiceCuesResult, AgentPersonalitiesGenerateProfileResult } from "@otto-code/protocol/messages";
|
|
8
10
|
import { type DaemonTransportFactory, type WebSocketFactory } from "./daemon-client-transport.js";
|
|
9
11
|
import { type DaemonClientTrafficHotspot, type DaemonClientTrafficTotals } from "./daemon-client-runtime-metrics.js";
|
|
10
12
|
import { type TerminalStreamEvent } from "./terminal-stream-router.js";
|
|
@@ -156,6 +158,12 @@ export interface CreateAgentRequestOptions extends AgentConfigOverrides {
|
|
|
156
158
|
personality?: CreateAgentRequestMessage["personality"];
|
|
157
159
|
env?: CreateAgentRequestMessage["env"];
|
|
158
160
|
workspaceId?: string;
|
|
161
|
+
/**
|
|
162
|
+
* Caller agent making this request. The daemon resolves the caller's own
|
|
163
|
+
* workspace and parentage from it, so a managed CLI run nests under its
|
|
164
|
+
* parent exactly as agent-scoped MCP creation does.
|
|
165
|
+
*/
|
|
166
|
+
callerAgentId?: string;
|
|
159
167
|
initialPrompt?: string;
|
|
160
168
|
clientMessageId?: string;
|
|
161
169
|
outputSchema?: Record<string, unknown>;
|
|
@@ -168,7 +176,7 @@ export interface CreateAgentRequestOptions extends AgentConfigOverrides {
|
|
|
168
176
|
requestId?: string;
|
|
169
177
|
labels?: Record<string, string>;
|
|
170
178
|
}
|
|
171
|
-
export interface CreateOttoWorktreeInput extends Pick<CreateOttoWorktreeRequest, "cwd" | "projectId" | "worktreeSlug" | "firstAgentContext" | "refName" | "action" | "githubPrNumber"> {
|
|
179
|
+
export interface CreateOttoWorktreeInput extends Pick<CreateOttoWorktreeRequest, "cwd" | "projectId" | "worktreeSlug" | "firstAgentContext" | "refName" | "action" | "githubPrNumber" | "checkoutSource"> {
|
|
172
180
|
}
|
|
173
181
|
type CheckoutStatusPayload = CheckoutStatusResponse["payload"];
|
|
174
182
|
type SubscribeCheckoutDiffPayload = Extract<SessionOutboundMessage, {
|
|
@@ -207,6 +215,23 @@ type StashListPayload = StashListResponse["payload"];
|
|
|
207
215
|
type ValidateBranchPayload = ValidateBranchResponse["payload"];
|
|
208
216
|
type BranchSuggestionsPayload = BranchSuggestionsResponse["payload"];
|
|
209
217
|
type GitHubSearchPayload = GitHubSearchResponse["payload"];
|
|
218
|
+
type CheckoutForgeGetCheckDetailsPayload = CheckoutForgeGetCheckDetailsResponse["payload"];
|
|
219
|
+
type CheckoutForgeSetAutoMergePayload = CheckoutForgeSetAutoMergeResponse["payload"];
|
|
220
|
+
export type ProjectCreateDirectoryPayload = ProjectCreateDirectoryResponse["payload"];
|
|
221
|
+
export type ProjectListPayload = Extract<SessionOutboundMessage, {
|
|
222
|
+
type: "project.list.response";
|
|
223
|
+
}>["payload"];
|
|
224
|
+
export type WorkspaceGithubSearchRepositoriesPayload = Extract<SessionOutboundMessage, {
|
|
225
|
+
type: "workspace.github.search_repositories.response";
|
|
226
|
+
}>["payload"];
|
|
227
|
+
export interface AgentAttentionRequiredNotification {
|
|
228
|
+
agentId: string;
|
|
229
|
+
reason: "finished" | "error" | "permission";
|
|
230
|
+
timestamp: string;
|
|
231
|
+
shouldNotify: boolean;
|
|
232
|
+
notification?: AgentAttentionNotificationPayload;
|
|
233
|
+
}
|
|
234
|
+
type ForgeSearchPayload = ForgeSearchResponse["payload"];
|
|
210
235
|
export type HostingSearchPayload = HostingSearchResponse["payload"];
|
|
211
236
|
export type HostingAuthStatusPayload = HostingAuthStatusResponse["payload"];
|
|
212
237
|
type DirectorySuggestionsPayload = DirectorySuggestionsResponse["payload"];
|
|
@@ -234,6 +259,8 @@ export interface FileReadResult {
|
|
|
234
259
|
* daemons older than v0.4.4. Absent means "not reported", not "LF".
|
|
235
260
|
*/
|
|
236
261
|
eol?: FileEol;
|
|
262
|
+
/** Opaque version tag for optimistic-concurrency writes; same caveat as eol. */
|
|
263
|
+
revision?: string;
|
|
237
264
|
}
|
|
238
265
|
export interface TextFileReadResult {
|
|
239
266
|
path: string;
|
|
@@ -254,6 +281,23 @@ export interface FileWriteOptions {
|
|
|
254
281
|
eol?: FileEol;
|
|
255
282
|
requestId?: string;
|
|
256
283
|
}
|
|
284
|
+
/**
|
|
285
|
+
* Bytes to a workspace path. Gated on `features.binaryFileWrite`. Unlike
|
|
286
|
+
* {@link FileWriteOptions} this carries no precondition: `overwrite` is the
|
|
287
|
+
* whole policy — see `FsFileWriteBinaryRequestSchema` for why a generated
|
|
288
|
+
* artifact has nothing to reconcile against.
|
|
289
|
+
*/
|
|
290
|
+
export interface FileWriteBinaryOptions {
|
|
291
|
+
cwd: string;
|
|
292
|
+
/** Workspace-relative, like every other file RPC. */
|
|
293
|
+
path: string;
|
|
294
|
+
/** Sent as file-transfer frames, not inside the request. */
|
|
295
|
+
bytes: Uint8Array | ArrayBuffer;
|
|
296
|
+
overwrite?: boolean;
|
|
297
|
+
requestId?: string;
|
|
298
|
+
/** Frame size, for tests that want to observe chunking. Defaults to 1 MB. */
|
|
299
|
+
chunkSize?: number;
|
|
300
|
+
}
|
|
257
301
|
/**
|
|
258
302
|
* The general file-mutation surface — what exists in a directory, rather than
|
|
259
303
|
* what is inside a file. Gated on `features.fileMutations`; there is no
|
|
@@ -541,7 +585,21 @@ export interface FetchAgentTimelineOptions {
|
|
|
541
585
|
requestId?: string;
|
|
542
586
|
timeout?: number;
|
|
543
587
|
}
|
|
588
|
+
export type ProviderSubagentListPayload = Extract<SessionOutboundMessage, {
|
|
589
|
+
type: "agent.provider_subagents.list.response";
|
|
590
|
+
}>["payload"];
|
|
591
|
+
export type ProviderSubagentTimelinePayload = Extract<SessionOutboundMessage, {
|
|
592
|
+
type: "agent.provider_subagents.timeline.get.response";
|
|
593
|
+
}>["payload"];
|
|
594
|
+
export interface FetchProviderSubagentTimelineOptions {
|
|
595
|
+
direction?: ProviderSubagentTimelinePayload["direction"];
|
|
596
|
+
cursor?: FetchAgentTimelineCursor;
|
|
597
|
+
limit?: number;
|
|
598
|
+
requestId?: string;
|
|
599
|
+
timeout?: number;
|
|
600
|
+
}
|
|
544
601
|
export interface AgentForkContextOptions {
|
|
602
|
+
boundaryCursor?: FetchAgentTimelineCursor;
|
|
545
603
|
boundaryMessageId?: string;
|
|
546
604
|
requestId?: string;
|
|
547
605
|
}
|
|
@@ -779,6 +837,9 @@ export interface WaitForFinishResult {
|
|
|
779
837
|
error: string | null;
|
|
780
838
|
lastMessage: string | null;
|
|
781
839
|
}
|
|
840
|
+
type ProjectGithubClonePayload = Extract<SessionOutboundMessage, {
|
|
841
|
+
type: "project.github.clone.response";
|
|
842
|
+
}>["payload"];
|
|
782
843
|
export declare class DaemonClient {
|
|
783
844
|
private config;
|
|
784
845
|
private transport;
|
|
@@ -801,6 +862,7 @@ export declare class DaemonClient {
|
|
|
801
862
|
private connectionState;
|
|
802
863
|
private checkoutDiffSubscriptions;
|
|
803
864
|
private terminalDirectorySubscriptions;
|
|
865
|
+
private fileSubscriptions;
|
|
804
866
|
private readonly terminalStreams;
|
|
805
867
|
private readonly scaffoldProgressListeners;
|
|
806
868
|
private pendingBinaryFileReads;
|
|
@@ -1091,6 +1153,55 @@ export declare class DaemonClient {
|
|
|
1091
1153
|
resumeAgent(handle: AgentPersistenceHandle, overrides?: Partial<AgentSessionConfig>): Promise<AgentSnapshotPayload>;
|
|
1092
1154
|
importAgent(input: ImportAgentInput): Promise<AgentSnapshotPayload>;
|
|
1093
1155
|
refreshAgent(agentId: string, requestId?: string): Promise<AgentRefreshedStatusPayload>;
|
|
1156
|
+
listProviderSubagents(parentAgentId: string, options?: {
|
|
1157
|
+
requestId?: string;
|
|
1158
|
+
timeout?: number;
|
|
1159
|
+
}): Promise<ProviderSubagentListPayload>;
|
|
1160
|
+
fetchProviderSubagentTimeline(parentAgentId: string, subagentId: string, options?: FetchProviderSubagentTimelineOptions): Promise<ProviderSubagentTimelinePayload>;
|
|
1161
|
+
checkoutForgeGetCheckDetails(input: {
|
|
1162
|
+
cwd: string;
|
|
1163
|
+
repoOwner?: string;
|
|
1164
|
+
repoName?: string;
|
|
1165
|
+
checkRunId?: number;
|
|
1166
|
+
workflowRunId?: number;
|
|
1167
|
+
changeRequestNumber?: number;
|
|
1168
|
+
}, requestId?: string): Promise<CheckoutForgeGetCheckDetailsPayload>;
|
|
1169
|
+
checkoutForgeSetAutoMerge(cwd: string, input: {
|
|
1170
|
+
enabled: true;
|
|
1171
|
+
method: CheckoutPrMergeMethod;
|
|
1172
|
+
} | {
|
|
1173
|
+
enabled: false;
|
|
1174
|
+
}, requestId?: string): Promise<CheckoutForgeSetAutoMergePayload>;
|
|
1175
|
+
createProjectDirectory(input: {
|
|
1176
|
+
parentPath: string;
|
|
1177
|
+
name: string;
|
|
1178
|
+
}, requestId?: string): Promise<ProjectCreateDirectoryPayload>;
|
|
1179
|
+
getCommitFileDiff(cwd: string, sha: string, path: string, requestId?: string): Promise<{
|
|
1180
|
+
file: ParsedDiffFile | null;
|
|
1181
|
+
}>;
|
|
1182
|
+
inspectWorkspaceRecovery(workspaceId: string, requestId?: string): Promise<WorkspaceRecoveryState>;
|
|
1183
|
+
listCheckoutCommits(cwd: string, requestId?: string): Promise<{
|
|
1184
|
+
baseRef: string | null;
|
|
1185
|
+
commits: CheckoutCommit[];
|
|
1186
|
+
}>;
|
|
1187
|
+
listProjects(requestId?: string): Promise<ProjectListPayload>;
|
|
1188
|
+
onAgentAttentionRequired(handler: (notification: AgentAttentionRequiredNotification) => void): () => void;
|
|
1189
|
+
restoreWorkspace(workspaceId: string, requestId?: string): Promise<void>;
|
|
1190
|
+
searchGithubRepositories(input: {
|
|
1191
|
+
query: string;
|
|
1192
|
+
limit?: number;
|
|
1193
|
+
}, requestId?: string): Promise<WorkspaceGithubSearchRepositoriesPayload>;
|
|
1194
|
+
setAgentTimelineSubscription(agentIds: string[]): Promise<void>;
|
|
1195
|
+
setWorkspacePinned(workspaceId: string, pinned: boolean, requestId?: string): Promise<{
|
|
1196
|
+
pinnedAt: string | null;
|
|
1197
|
+
}>;
|
|
1198
|
+
subscribeFile(input: {
|
|
1199
|
+
cwd: string;
|
|
1200
|
+
path: string;
|
|
1201
|
+
}, onUpdate: (version: FileVersion) => void): Promise<{
|
|
1202
|
+
initial: FileVersion;
|
|
1203
|
+
unsubscribe: () => void;
|
|
1204
|
+
}>;
|
|
1094
1205
|
fetchAgentTimeline(agentId: string, options?: FetchAgentTimelineOptions): Promise<FetchAgentTimelinePayload>;
|
|
1095
1206
|
buildAgentForkContext(agentId: string, options?: AgentForkContextOptions): Promise<AgentForkContextPayload>;
|
|
1096
1207
|
sendAgentMessage(agentId: string, text: string, options?: SendMessageOptions): Promise<SendAgentMessageResult>;
|
|
@@ -1118,7 +1229,7 @@ export declare class DaemonClient {
|
|
|
1118
1229
|
cancelled?: boolean;
|
|
1119
1230
|
}>;
|
|
1120
1231
|
setAgentMode(agentId: string, modeId: string): Promise<AgentProviderNotice | null>;
|
|
1121
|
-
setAgentModel(agentId: string, modelId: string | null): Promise<
|
|
1232
|
+
setAgentModel(agentId: string, modelId: string | null): Promise<AgentProviderNotice | null>;
|
|
1122
1233
|
setAgentFeature(agentId: string, featureId: string, value: unknown): Promise<void>;
|
|
1123
1234
|
setAgentThinkingOption(agentId: string, thinkingOptionId: string | null): Promise<AgentProviderNotice | null>;
|
|
1124
1235
|
/**
|
|
@@ -1276,6 +1387,12 @@ export declare class DaemonClient {
|
|
|
1276
1387
|
query?: string;
|
|
1277
1388
|
limit?: number;
|
|
1278
1389
|
}, requestId?: string): Promise<BranchSuggestionsPayload>;
|
|
1390
|
+
searchForge(options: {
|
|
1391
|
+
cwd: string;
|
|
1392
|
+
query: string;
|
|
1393
|
+
limit?: number;
|
|
1394
|
+
kinds?: ForgeSearchRequest["kinds"];
|
|
1395
|
+
}, requestId?: string): Promise<ForgeSearchPayload>;
|
|
1279
1396
|
searchGitHub(options: {
|
|
1280
1397
|
cwd: string;
|
|
1281
1398
|
query: string;
|
|
@@ -1307,8 +1424,36 @@ export declare class DaemonClient {
|
|
|
1307
1424
|
* save-precondition baseline (modifiedAt, eol, hash) alongside the content.
|
|
1308
1425
|
*/
|
|
1309
1426
|
readTextFile(cwd: string, path: string, requestId?: string): Promise<TextFileReadResult>;
|
|
1427
|
+
/**
|
|
1428
|
+
* The fs.file.write RPC: optimistic-concurrency writes keyed by an opaque
|
|
1429
|
+
* revision. The hash-keyed `writeFile` below is kept for callers
|
|
1430
|
+
* that have not moved over.
|
|
1431
|
+
*/
|
|
1432
|
+
writeFsFile(input: {
|
|
1433
|
+
cwd: string;
|
|
1434
|
+
path: string;
|
|
1435
|
+
content: string;
|
|
1436
|
+
expectedModifiedAt: string;
|
|
1437
|
+
expectedRevision?: string;
|
|
1438
|
+
}): Promise<FsFileWriteResult>;
|
|
1310
1439
|
/** Conditional save — see FileWriteRequestSchema for the no-clobber contract. */
|
|
1311
1440
|
writeFile(options: FileWriteOptions): Promise<FileWriteResult>;
|
|
1441
|
+
/**
|
|
1442
|
+
* Write bytes to a workspace file — the path for generated artifacts the
|
|
1443
|
+
* text write cannot carry (it refuses binary targets outright). Gated on
|
|
1444
|
+
* `features.binaryFileWrite`; there is no client-side substitute, because
|
|
1445
|
+
* the client never touches a workspace file on any platform.
|
|
1446
|
+
*
|
|
1447
|
+
* Shaped like {@link uploadFile}: the JSON request says where the bytes go
|
|
1448
|
+
* and how many to expect, then the bytes follow as file-transfer frames
|
|
1449
|
+
* correlated on the same `requestId`. The daemon answers at FileEnd.
|
|
1450
|
+
*/
|
|
1451
|
+
writeBinaryFile(options: FileWriteBinaryOptions): Promise<FsFileWriteBinaryResult>;
|
|
1452
|
+
/**
|
|
1453
|
+
* FileBegin, chunks, FileEnd. Synchronous through `sendBinaryFrame`, so the
|
|
1454
|
+
* frames leave in order and behind the JSON request that announced them.
|
|
1455
|
+
*/
|
|
1456
|
+
private sendFileTransfer;
|
|
1312
1457
|
/** Create an empty file or a directory. Never overwrites — see FileCreateResultSchema. */
|
|
1313
1458
|
createFileEntry(options: FileCreateOptions): Promise<FileCreateResult>;
|
|
1314
1459
|
/** Permanent delete — an unlink, not a move to any trash. */
|
|
@@ -1537,6 +1682,29 @@ export declare class DaemonClient {
|
|
|
1537
1682
|
requestId: string;
|
|
1538
1683
|
config: MutableDaemonConfig;
|
|
1539
1684
|
}>;
|
|
1685
|
+
connectorsListTools(connectorId: string, requestId?: string): Promise<ConnectorsListToolsResponse["payload"]>;
|
|
1686
|
+
brainHostStatus(requestId?: string): Promise<BrainHostStatus>;
|
|
1687
|
+
brainHostStart(model?: string | null, requestId?: string): Promise<BrainHostStatus>;
|
|
1688
|
+
brainHostStop(requestId?: string): Promise<BrainHostStatus>;
|
|
1689
|
+
brainHostRestart(model?: string | null, requestId?: string): Promise<BrainHostStatus>;
|
|
1690
|
+
brainEvalsGet(requestId?: string): Promise<BrainEvals | null>;
|
|
1691
|
+
brainRemoteConfigGet(requestId?: string): Promise<BrainRemoteConfig | null>;
|
|
1692
|
+
brainRemoteConfigPatch(patch: BrainRemoteConfig, requestId?: string): Promise<BrainRemoteConfig | null>;
|
|
1693
|
+
brainModelsList(requestId?: string): Promise<string[]>;
|
|
1694
|
+
brainNetworkDiscover(requestId?: string): Promise<BrainNetworkInfo | null>;
|
|
1695
|
+
brainModelsScan(requestId?: string): Promise<BrainInstalledModel[]>;
|
|
1696
|
+
brainCatalogList(requestId?: string): Promise<BrainCatalogModel[]>;
|
|
1697
|
+
brainRuntimeList(requestId?: string): Promise<BrainRuntime[]>;
|
|
1698
|
+
brainModelsPull(model: string, requestId?: string): Promise<BrainJob>;
|
|
1699
|
+
brainHfSearch(query: string, limit?: number | null, requestId?: string): Promise<BrainHfSearchResult[]>;
|
|
1700
|
+
brainHfQuants(repo: string, requestId?: string): Promise<BrainRepoQuant[]>;
|
|
1701
|
+
brainModelsAdd(repo: string, quant: string, requestId?: string): Promise<BrainJob>;
|
|
1702
|
+
brainRuntimeInstall(build?: string | null, requestId?: string): Promise<BrainJob>;
|
|
1703
|
+
brainCalibrate(model: string, requestId?: string): Promise<BrainJob>;
|
|
1704
|
+
brainSweep(model: string, requestId?: string): Promise<BrainJob>;
|
|
1705
|
+
brainBench(model?: string | null, requestId?: string): Promise<BrainJob>;
|
|
1706
|
+
brainJobsList(requestId?: string): Promise<BrainJob[]>;
|
|
1707
|
+
brainJobsCancel(jobId: string, requestId?: string): Promise<BrainJob[]>;
|
|
1540
1708
|
getSpeechSettingsOptions(requestId?: string): Promise<{
|
|
1541
1709
|
requestId: string;
|
|
1542
1710
|
options: SpeechSettingsOptions;
|
|
@@ -1569,6 +1737,13 @@ export declare class DaemonClient {
|
|
|
1569
1737
|
requestId: string;
|
|
1570
1738
|
stats: Record<string, number>;
|
|
1571
1739
|
}>;
|
|
1740
|
+
generatePersonalityProfile(params: {
|
|
1741
|
+
name: string;
|
|
1742
|
+
roles?: string[];
|
|
1743
|
+
glowA?: string;
|
|
1744
|
+
glowB?: string;
|
|
1745
|
+
cwd?: string;
|
|
1746
|
+
}, requestId?: string): Promise<AgentPersonalitiesGenerateProfileResult>;
|
|
1572
1747
|
sendBrowserAutomationExecuteResponse(response: BrowserAutomationExecuteResponse): void;
|
|
1573
1748
|
readProjectConfig(repoRoot: string, requestId?: string): Promise<ReadProjectConfigPayload>;
|
|
1574
1749
|
writeProjectConfig(input: WriteProjectConfigInput): Promise<WriteProjectConfigPayload>;
|
|
@@ -1745,8 +1920,67 @@ export declare class DaemonClient {
|
|
|
1745
1920
|
private recordLivenessFailure;
|
|
1746
1921
|
private handleSessionMessage;
|
|
1747
1922
|
private resolveWaiters;
|
|
1923
|
+
private rejectWaitersForRequestId;
|
|
1748
1924
|
private clearWaiters;
|
|
1749
1925
|
private toEvent;
|
|
1750
1926
|
private waitForWithCancel;
|
|
1927
|
+
cloneGithubProject(input: {
|
|
1928
|
+
repo: string;
|
|
1929
|
+
targetDirectory: string;
|
|
1930
|
+
cloneProtocol?: ProjectGithubCloneProtocol;
|
|
1931
|
+
}, requestId?: string): Promise<ProjectGithubClonePayload>;
|
|
1932
|
+
/**
|
|
1933
|
+
* `includeDiscovered` also returns the Scripts the workspace's own project
|
|
1934
|
+
* files declare (package.json scripts today), each tagged with its `source`.
|
|
1935
|
+
* Gate it on `server_info.features.workspaceScriptDiscovery` — an older
|
|
1936
|
+
* daemon ignores the flag and answers with the otto.json list only.
|
|
1937
|
+
*/
|
|
1938
|
+
listWorkspaceScripts(workspaceId: string, options?: {
|
|
1939
|
+
includeDiscovered?: boolean;
|
|
1940
|
+
requestId?: string;
|
|
1941
|
+
}): Promise<Extract<SessionOutboundMessage, {
|
|
1942
|
+
type: "workspace.script.list.response";
|
|
1943
|
+
}>["payload"]>;
|
|
1944
|
+
startWorkspaceScriptWithStatus(workspaceId: string, scriptName: string, requestId?: string): Promise<Extract<SessionOutboundMessage, {
|
|
1945
|
+
type: "workspace.script.start.response";
|
|
1946
|
+
}>["payload"]>;
|
|
1947
|
+
stopWorkspaceScript(workspaceId: string, scriptName: string, requestId?: string): Promise<Extract<SessionOutboundMessage, {
|
|
1948
|
+
type: "workspace.script.stop.response";
|
|
1949
|
+
}>["payload"]>;
|
|
1950
|
+
connectHub(hubUrl: string, token: string, requestId?: string): Promise<{
|
|
1951
|
+
requestId: string;
|
|
1952
|
+
status: {
|
|
1953
|
+
state: "connecting" | "connected" | "not_connected" | "reconnecting" | "disconnecting" | "revoked";
|
|
1954
|
+
daemonId: string | null;
|
|
1955
|
+
hubOrigin: string | null;
|
|
1956
|
+
scopes: string[];
|
|
1957
|
+
connectedAt: string | null;
|
|
1958
|
+
lastError: string | null;
|
|
1959
|
+
};
|
|
1960
|
+
}>;
|
|
1961
|
+
getHubStatus(requestId?: string): Promise<{
|
|
1962
|
+
requestId: string;
|
|
1963
|
+
status: {
|
|
1964
|
+
state: "connecting" | "connected" | "not_connected" | "reconnecting" | "disconnecting" | "revoked";
|
|
1965
|
+
daemonId: string | null;
|
|
1966
|
+
hubOrigin: string | null;
|
|
1967
|
+
scopes: string[];
|
|
1968
|
+
connectedAt: string | null;
|
|
1969
|
+
lastError: string | null;
|
|
1970
|
+
};
|
|
1971
|
+
}>;
|
|
1972
|
+
disconnectHub(force?: boolean, requestId?: string): Promise<{
|
|
1973
|
+
requestId: string;
|
|
1974
|
+
status: {
|
|
1975
|
+
state: "connecting" | "connected" | "not_connected" | "reconnecting" | "disconnecting" | "revoked";
|
|
1976
|
+
daemonId: string | null;
|
|
1977
|
+
hubOrigin: string | null;
|
|
1978
|
+
scopes: string[];
|
|
1979
|
+
connectedAt: string | null;
|
|
1980
|
+
lastError: string | null;
|
|
1981
|
+
};
|
|
1982
|
+
warning?: string | undefined;
|
|
1983
|
+
}>;
|
|
1984
|
+
private requireHubRelationshipSupport;
|
|
1751
1985
|
}
|
|
1752
1986
|
//# sourceMappingURL=daemon-client.d.ts.map
|