@otto-code/client 0.6.5 → 0.6.7
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.d.ts +81 -5
- package/dist/daemon-client.js +183 -2
- package/dist/index.js +2 -2
- package/package.json +3 -3
package/dist/daemon-client.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { z } from "zod";
|
|
2
2
|
import { type ClientCapability } from "@otto-code/protocol/client-capabilities";
|
|
3
3
|
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, FileDownloadTokenResponse, FileEol, FileReplaceFileResult, FileReplaceRequest, FileReplaceResponse, FileSearchResultPayload, FileSearchSummary, FileUploadResponse, FileExplorerResponse, FileWatchEventPayload, FileWriteResult, FetchAgentTimelineResponseMessage, AgentForkContextResponseMessage, GitSetupOptions, CheckoutStatusResponse, CheckoutCommitResponse, CheckoutGitCommitResponse, CheckoutGitCommitAgentResponse, CheckoutGitRollbackResponse, 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, ContextReportGetResponseMessage, ContextEdgeConvertResponseMessage, ProjectAddResponse, OpenProjectResponseMessage, ArchiveWorkspaceResponseMessage, WorkspaceSetupStatusResponseMessage, ListCommandsResponse, ListProviderFeaturesResponseMessage, ListProviderModelsResponseMessage, ListProviderModesResponseMessage, ListAvailableProvidersResponse, GetProvidersSnapshotResponseMessage, RefreshProvidersSnapshotResponseMessage, ProviderDiagnosticResponseMessage, ProviderUsageListResponseMessage, StatsActivityGetResponseMessage, StatsActivityResetResponseMessage, UsageLogGetResponseMessage, AgentContextGetUsageResponseMessage, DaemonGetStatusResponse, DaemonGetPairingOfferResponse, DiagnosticsResponse, AgentRewindResponseMessage, ListTerminalsResponse, CreateTerminalResponse, SubscribeTerminalResponse, SubscribeTerminalRequest, CloseItemsResponse, KillTerminalResponse, CaptureTerminalResponse, TerminalInput, SessionInboundMessage, SessionOutboundMessage, SendAgentMessageRequest, TasksSuggestedStartMode, OttoConfigRaw, OttoConfigRevision, WorkspaceCreateRequest } from "@otto-code/protocol/messages";
|
|
4
|
+
import type { AgentStreamEventPayload, AgentSnapshotPayload, ProjectPlacementPayload, AgentPermissionResolvedMessage, CreateAgentRequestMessage, CreateOttoWorktreeRequest, CodeListFilesResponse, CodeSymbolLocation, FileDownloadTokenResponse, FileEol, FileReplaceFileResult, FileReplaceRequest, FileReplaceResponse, FileSearchResultPayload, FileSearchSummary, FileUploadResponse, FileExplorerResponse, FileWatchEventPayload, FileWriteResult, 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, ContextReportGetResponseMessage, ContextEdgeConvertResponseMessage, ProjectAddResponse, OpenProjectResponseMessage, ArchiveWorkspaceResponseMessage, WorkspaceArchivePreflightResponse, 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, KillTerminalResponse, CaptureTerminalResponse, TerminalInput, SessionInboundMessage, SessionOutboundMessage, SendAgentMessageRequest, TasksSuggestedStartMode, OttoConfigRaw, OttoConfigRevision, WorkspaceCreateRequest } from "@otto-code/protocol/messages";
|
|
5
5
|
import type { AgentPermissionRequest, AgentPermissionResponse, AgentPersistenceHandle, AgentProviderNotice, AgentProvider, AgentSessionConfig } from "@otto-code/protocol/agent-types";
|
|
6
|
-
import type { Run } from "@otto-code/protocol/orchestration";
|
|
7
|
-
import type { MutableDaemonConfig, MutableDaemonConfigPatch, ProjectLink, SpeechSettingsOptions, SpeechTtsPreviewResult, VisualizerVoiceCuesResult } from "@otto-code/protocol/messages";
|
|
6
|
+
import type { OrchestrationGraph, Run } from "@otto-code/protocol/orchestration";
|
|
7
|
+
import type { CueMoment, MutableDaemonConfig, MutableDaemonConfigPatch, ProjectLink, SpeechSettingsOptions, SpeechTtsPreviewResult, SpeechTtsSpeakResult, SpeechTtsSpeakCancelResult, VisualizerVoiceCuesResult } from "@otto-code/protocol/messages";
|
|
8
8
|
import { type DaemonTransportFactory, type WebSocketFactory } from "./daemon-client-transport.js";
|
|
9
9
|
import { type TerminalStreamEvent } from "./terminal-stream-router.js";
|
|
10
10
|
import type { BrowserAutomationExecuteRequest, BrowserAutomationExecuteResponse } from "@otto-code/protocol/browser-automation/rpc-schemas";
|
|
@@ -161,6 +161,10 @@ export type CheckoutGitCommitPayload = CheckoutGitCommitResponse["payload"];
|
|
|
161
161
|
export type CheckoutGitCommitAgentPayload = CheckoutGitCommitAgentResponse["payload"];
|
|
162
162
|
export type CheckoutGitRollbackPayload = CheckoutGitRollbackResponse["payload"];
|
|
163
163
|
export type CheckoutGitGetOperationLogPayload = CheckoutGitGetOperationLogResponse["payload"];
|
|
164
|
+
export type CheckoutGitFileHistoryPayload = CheckoutGitFileHistoryResponse["payload"];
|
|
165
|
+
export type CheckoutGitFileCommitDiffPayload = CheckoutGitFileCommitDiffResponse["payload"];
|
|
166
|
+
export type CheckoutGitFileBlamePayload = CheckoutGitFileBlameResponse["payload"];
|
|
167
|
+
export type CheckoutGitFileOriginPayload = CheckoutGitFileOriginResponse["payload"];
|
|
164
168
|
type CheckoutMergePayload = CheckoutMergeResponse["payload"];
|
|
165
169
|
type CheckoutMergeFromBasePayload = CheckoutMergeFromBaseResponse["payload"];
|
|
166
170
|
type CheckoutPullPayload = CheckoutPullResponse["payload"];
|
|
@@ -627,6 +631,9 @@ export interface RenameTerminalInput {
|
|
|
627
631
|
type OpenProjectPayload = OpenProjectResponseMessage["payload"];
|
|
628
632
|
type ProjectAddPayload = ProjectAddResponse["payload"];
|
|
629
633
|
type ArchiveWorkspacePayload = ArchiveWorkspaceResponseMessage["payload"];
|
|
634
|
+
type WorkspaceArchivePreflightPayload = WorkspaceArchivePreflightResponse["payload"];
|
|
635
|
+
type WorktreeReattachListPayload = WorktreeReattachListResponse["payload"];
|
|
636
|
+
type WorktreeReattachPayload = WorktreeReattachResponse["payload"];
|
|
630
637
|
type WorkspaceSetupStatusPayload = WorkspaceSetupStatusResponseMessage["payload"];
|
|
631
638
|
export interface FetchAgentResult {
|
|
632
639
|
agent: AgentSnapshotPayload;
|
|
@@ -762,7 +769,16 @@ export declare class DaemonClient {
|
|
|
762
769
|
startWorkspaceScript(workspaceId: string, scriptName: string, requestId?: string): Promise<Extract<SessionOutboundMessage, {
|
|
763
770
|
type: "start_workspace_script_response";
|
|
764
771
|
}>["payload"]>;
|
|
765
|
-
archiveWorkspace(workspaceId: string,
|
|
772
|
+
archiveWorkspace(workspaceId: string, options?: {
|
|
773
|
+
branchDisposition?: "keep" | "delete";
|
|
774
|
+
requestId?: string;
|
|
775
|
+
}): Promise<ArchiveWorkspacePayload>;
|
|
776
|
+
workspaceArchivePreflight(workspaceId: string, requestId?: string): Promise<WorkspaceArchivePreflightPayload>;
|
|
777
|
+
listReattachableWorktrees(scope: {
|
|
778
|
+
projectId?: string;
|
|
779
|
+
cwd?: string;
|
|
780
|
+
}, requestId?: string): Promise<WorktreeReattachListPayload>;
|
|
781
|
+
reattachWorktree(target: WorktreeReattachTarget, requestId?: string): Promise<WorktreeReattachPayload>;
|
|
766
782
|
fetchWorkspaceSetupStatus(workspaceId: string, requestId?: string): Promise<WorkspaceSetupStatusPayload>;
|
|
767
783
|
fetchAgent(options: FetchAgentOptions): Promise<FetchAgentResult | null>;
|
|
768
784
|
fetchAgent(agentId: string, requestId?: string): Promise<FetchAgentResult | null>;
|
|
@@ -819,6 +835,36 @@ export declare class DaemonClient {
|
|
|
819
835
|
cancelRun(runId: string): Promise<boolean>;
|
|
820
836
|
/** Orchestration: delete every finished (done/failed/canceled) run. */
|
|
821
837
|
clearFinishedRuns(): Promise<string[]>;
|
|
838
|
+
/** Orchestration: list the host's reusable graph templates. */
|
|
839
|
+
listOrchestrationGraphs(): Promise<OrchestrationGraph[]>;
|
|
840
|
+
/** Orchestration: upsert a graph template. Returns the persisted graph. */
|
|
841
|
+
saveOrchestrationGraph(graph: OrchestrationGraph): Promise<OrchestrationGraph>;
|
|
842
|
+
/** Orchestration: delete a graph template (built-in starters refuse). */
|
|
843
|
+
deleteOrchestrationGraph(graphId: string): Promise<boolean>;
|
|
844
|
+
/**
|
|
845
|
+
* Orchestration: start (or draft) a user-initiated orchestration. Returns the
|
|
846
|
+
* run id (graph flavor) and the orchestrator chat's agent id to navigate to.
|
|
847
|
+
*/
|
|
848
|
+
startOrchestration(input: {
|
|
849
|
+
flavor: "ai" | "graph";
|
|
850
|
+
cwd: string;
|
|
851
|
+
workspaceId?: string;
|
|
852
|
+
title?: string;
|
|
853
|
+
description?: string;
|
|
854
|
+
orchestratorPersonalityId?: string;
|
|
855
|
+
orchestratorProvider?: string;
|
|
856
|
+
orchestratorModel?: string;
|
|
857
|
+
orchestratorThinkingOptionId?: string;
|
|
858
|
+
prompt?: string;
|
|
859
|
+
graphId?: string;
|
|
860
|
+
graphInputs?: Record<string, string>;
|
|
861
|
+
draft?: boolean;
|
|
862
|
+
runId?: string;
|
|
863
|
+
}): Promise<{
|
|
864
|
+
runId?: string;
|
|
865
|
+
agentId?: string;
|
|
866
|
+
workspaceId?: string;
|
|
867
|
+
}>;
|
|
822
868
|
updateAgent(agentId: string, updates: {
|
|
823
869
|
name?: string;
|
|
824
870
|
labels?: Record<string, string>;
|
|
@@ -905,6 +951,27 @@ export declare class DaemonClient {
|
|
|
905
951
|
allowWithRunningAgents?: boolean;
|
|
906
952
|
}, requestId?: string): Promise<CheckoutGitRollbackPayload>;
|
|
907
953
|
checkoutGitGetOperationLog(cwd: string, operation: string, requestId?: string): Promise<CheckoutGitGetOperationLogPayload>;
|
|
954
|
+
checkoutGitFileHistory(cwd: string, input: {
|
|
955
|
+
path: string;
|
|
956
|
+
limit?: number;
|
|
957
|
+
offset?: number;
|
|
958
|
+
startLine?: number;
|
|
959
|
+
endLine?: number;
|
|
960
|
+
}, requestId?: string): Promise<CheckoutGitFileHistoryPayload>;
|
|
961
|
+
checkoutGitFileCommitDiff(cwd: string, input: {
|
|
962
|
+
path: string;
|
|
963
|
+
sha: string;
|
|
964
|
+
ignoreWhitespace?: boolean;
|
|
965
|
+
}, requestId?: string): Promise<CheckoutGitFileCommitDiffPayload>;
|
|
966
|
+
checkoutGitFileBlame(cwd: string, input: {
|
|
967
|
+
path: string;
|
|
968
|
+
startLine?: number;
|
|
969
|
+
lineCount?: number;
|
|
970
|
+
sha?: string;
|
|
971
|
+
}, requestId?: string): Promise<CheckoutGitFileBlamePayload>;
|
|
972
|
+
checkoutGitFileOrigin(cwd: string, input: {
|
|
973
|
+
path: string;
|
|
974
|
+
}, requestId?: string): Promise<CheckoutGitFileOriginPayload>;
|
|
908
975
|
checkoutMerge(cwd: string, input: {
|
|
909
976
|
baseRef?: string;
|
|
910
977
|
strategy?: "merge" | "squash";
|
|
@@ -1107,12 +1174,21 @@ export declare class DaemonClient {
|
|
|
1107
1174
|
name: string;
|
|
1108
1175
|
};
|
|
1109
1176
|
}, requestId?: string): Promise<SpeechTtsPreviewResult>;
|
|
1177
|
+
speakMessage(params: {
|
|
1178
|
+
text: string;
|
|
1179
|
+
voice?: {
|
|
1180
|
+
provider?: string;
|
|
1181
|
+
model?: string;
|
|
1182
|
+
name: string;
|
|
1183
|
+
};
|
|
1184
|
+
}, requestId?: string): Promise<SpeechTtsSpeakResult>;
|
|
1185
|
+
cancelSpeakMessage(requestId?: string): Promise<SpeechTtsSpeakCancelResult>;
|
|
1110
1186
|
generateVisualizerVoiceCues(params: {
|
|
1111
1187
|
name: string;
|
|
1112
1188
|
prompt?: string;
|
|
1113
1189
|
cwd?: string;
|
|
1114
1190
|
roles?: string[];
|
|
1115
|
-
moment?:
|
|
1191
|
+
moment?: CueMoment;
|
|
1116
1192
|
}, requestId?: string): Promise<VisualizerVoiceCuesResult>;
|
|
1117
1193
|
getPersonalityStats(requestId?: string): Promise<{
|
|
1118
1194
|
requestId: string;
|
package/dist/daemon-client.js
CHANGED
|
@@ -1033,16 +1033,55 @@ export class DaemonClient {
|
|
|
1033
1033
|
responseType: "start_workspace_script_response",
|
|
1034
1034
|
});
|
|
1035
1035
|
}
|
|
1036
|
-
async archiveWorkspace(workspaceId,
|
|
1036
|
+
async archiveWorkspace(workspaceId, options) {
|
|
1037
1037
|
return this.sendCorrelatedSessionRequest({
|
|
1038
|
-
requestId,
|
|
1038
|
+
requestId: options?.requestId,
|
|
1039
1039
|
message: {
|
|
1040
1040
|
type: "archive_workspace_request",
|
|
1041
1041
|
workspaceId,
|
|
1042
|
+
...(options?.branchDisposition ? { branchDisposition: options.branchDisposition } : {}),
|
|
1042
1043
|
},
|
|
1043
1044
|
responseType: "archive_workspace_response",
|
|
1044
1045
|
});
|
|
1045
1046
|
}
|
|
1047
|
+
// Read-only pre-archive inspection of a worktree's leftover branch (merge
|
|
1048
|
+
// state, deletability). Gated by server_info.features.worktreeArchiveBranchCleanup.
|
|
1049
|
+
async workspaceArchivePreflight(workspaceId, requestId) {
|
|
1050
|
+
return this.sendCorrelatedSessionRequest({
|
|
1051
|
+
requestId,
|
|
1052
|
+
message: {
|
|
1053
|
+
type: "workspace.archive.preflight.request",
|
|
1054
|
+
workspaceId,
|
|
1055
|
+
},
|
|
1056
|
+
responseType: "workspace.archive.preflight.response",
|
|
1057
|
+
});
|
|
1058
|
+
}
|
|
1059
|
+
// List re-attachable Otto worktrees for a project (or the repo containing cwd):
|
|
1060
|
+
// archived worktree workspaces with a kept branch, plus orphaned on-disk
|
|
1061
|
+
// worktrees. Gated by server_info.features.worktreeReattach.
|
|
1062
|
+
async listReattachableWorktrees(scope, requestId) {
|
|
1063
|
+
return this.sendCorrelatedSessionRequest({
|
|
1064
|
+
requestId,
|
|
1065
|
+
message: {
|
|
1066
|
+
type: "worktree.reattach.list.request",
|
|
1067
|
+
...(scope.projectId ? { projectId: scope.projectId } : {}),
|
|
1068
|
+
...(scope.cwd ? { cwd: scope.cwd } : {}),
|
|
1069
|
+
},
|
|
1070
|
+
responseType: "worktree.reattach.list.response",
|
|
1071
|
+
});
|
|
1072
|
+
}
|
|
1073
|
+
// Re-attach a "left" worktree as a live workspace: revive an archived workspace
|
|
1074
|
+
// record in place, or bind a fresh workspace to an orphaned on-disk worktree.
|
|
1075
|
+
async reattachWorktree(target, requestId) {
|
|
1076
|
+
return this.sendCorrelatedSessionRequest({
|
|
1077
|
+
requestId,
|
|
1078
|
+
message: {
|
|
1079
|
+
type: "worktree.reattach.request",
|
|
1080
|
+
target,
|
|
1081
|
+
},
|
|
1082
|
+
responseType: "worktree.reattach.response",
|
|
1083
|
+
});
|
|
1084
|
+
}
|
|
1046
1085
|
async fetchWorkspaceSetupStatus(workspaceId, requestId) {
|
|
1047
1086
|
return this.sendCorrelatedSessionRequest({
|
|
1048
1087
|
requestId,
|
|
@@ -1358,6 +1397,74 @@ export class DaemonClient {
|
|
|
1358
1397
|
});
|
|
1359
1398
|
return payload.runIds;
|
|
1360
1399
|
}
|
|
1400
|
+
/** Orchestration: list the host's reusable graph templates. */
|
|
1401
|
+
async listOrchestrationGraphs() {
|
|
1402
|
+
const payload = await this.sendNamespacedCorrelatedSessionRequest({
|
|
1403
|
+
message: { type: "runs.graphs.list.request" },
|
|
1404
|
+
});
|
|
1405
|
+
return payload.graphs;
|
|
1406
|
+
}
|
|
1407
|
+
/** Orchestration: upsert a graph template. Returns the persisted graph. */
|
|
1408
|
+
async saveOrchestrationGraph(graph) {
|
|
1409
|
+
const payload = await this.sendNamespacedCorrelatedSessionRequest({
|
|
1410
|
+
message: { type: "runs.graphs.save.request", graph },
|
|
1411
|
+
});
|
|
1412
|
+
if (payload.error !== undefined || payload.graph === undefined) {
|
|
1413
|
+
throw new Error(payload.error ?? "saveOrchestrationGraph rejected");
|
|
1414
|
+
}
|
|
1415
|
+
return payload.graph;
|
|
1416
|
+
}
|
|
1417
|
+
/** Orchestration: delete a graph template (built-in starters refuse). */
|
|
1418
|
+
async deleteOrchestrationGraph(graphId) {
|
|
1419
|
+
const payload = await this.sendNamespacedCorrelatedSessionRequest({
|
|
1420
|
+
message: { type: "runs.graphs.delete.request", graphId },
|
|
1421
|
+
});
|
|
1422
|
+
if (payload.error !== undefined) {
|
|
1423
|
+
throw new Error(payload.error);
|
|
1424
|
+
}
|
|
1425
|
+
return payload.deleted;
|
|
1426
|
+
}
|
|
1427
|
+
/**
|
|
1428
|
+
* Orchestration: start (or draft) a user-initiated orchestration. Returns the
|
|
1429
|
+
* run id (graph flavor) and the orchestrator chat's agent id to navigate to.
|
|
1430
|
+
*/
|
|
1431
|
+
async startOrchestration(input) {
|
|
1432
|
+
const payload = await this.sendNamespacedCorrelatedSessionRequest({
|
|
1433
|
+
message: {
|
|
1434
|
+
type: "runs.start.request",
|
|
1435
|
+
flavor: input.flavor,
|
|
1436
|
+
cwd: input.cwd,
|
|
1437
|
+
...(input.workspaceId !== undefined ? { workspaceId: input.workspaceId } : {}),
|
|
1438
|
+
...(input.title !== undefined ? { title: input.title } : {}),
|
|
1439
|
+
...(input.description !== undefined ? { description: input.description } : {}),
|
|
1440
|
+
...(input.orchestratorPersonalityId !== undefined
|
|
1441
|
+
? { orchestratorPersonalityId: input.orchestratorPersonalityId }
|
|
1442
|
+
: {}),
|
|
1443
|
+
...(input.orchestratorProvider !== undefined
|
|
1444
|
+
? { orchestratorProvider: input.orchestratorProvider }
|
|
1445
|
+
: {}),
|
|
1446
|
+
...(input.orchestratorModel !== undefined
|
|
1447
|
+
? { orchestratorModel: input.orchestratorModel }
|
|
1448
|
+
: {}),
|
|
1449
|
+
...(input.orchestratorThinkingOptionId !== undefined
|
|
1450
|
+
? { orchestratorThinkingOptionId: input.orchestratorThinkingOptionId }
|
|
1451
|
+
: {}),
|
|
1452
|
+
...(input.prompt !== undefined ? { prompt: input.prompt } : {}),
|
|
1453
|
+
...(input.graphId !== undefined ? { graphId: input.graphId } : {}),
|
|
1454
|
+
...(input.graphInputs !== undefined ? { graphInputs: input.graphInputs } : {}),
|
|
1455
|
+
...(input.draft !== undefined ? { draft: input.draft } : {}),
|
|
1456
|
+
...(input.runId !== undefined ? { runId: input.runId } : {}),
|
|
1457
|
+
},
|
|
1458
|
+
});
|
|
1459
|
+
if (payload.error !== undefined) {
|
|
1460
|
+
throw new Error(payload.error);
|
|
1461
|
+
}
|
|
1462
|
+
return {
|
|
1463
|
+
...(payload.runId !== undefined ? { runId: payload.runId } : {}),
|
|
1464
|
+
...(payload.agentId !== undefined ? { agentId: payload.agentId } : {}),
|
|
1465
|
+
...(payload.workspaceId !== undefined ? { workspaceId: payload.workspaceId } : {}),
|
|
1466
|
+
};
|
|
1467
|
+
}
|
|
1361
1468
|
async updateAgent(agentId, updates) {
|
|
1362
1469
|
const requestId = this.createRequestId();
|
|
1363
1470
|
const message = SessionInboundMessageSchema.parse({
|
|
@@ -2289,6 +2396,59 @@ export class DaemonClient {
|
|
|
2289
2396
|
},
|
|
2290
2397
|
});
|
|
2291
2398
|
}
|
|
2399
|
+
// ── Git file investigation ────────────────────────────────────────────────
|
|
2400
|
+
// Local git only: no remote, no forge, and no per-provider variant — the same
|
|
2401
|
+
// four calls answer for every agent provider. Gated by
|
|
2402
|
+
// server_info.features.checkoutGitFileHistory.
|
|
2403
|
+
async checkoutGitFileHistory(cwd, input, requestId) {
|
|
2404
|
+
return this.sendNamespacedCorrelatedSessionRequest({
|
|
2405
|
+
requestId,
|
|
2406
|
+
message: {
|
|
2407
|
+
type: "checkout.git.get_file_history.request",
|
|
2408
|
+
cwd,
|
|
2409
|
+
path: input.path,
|
|
2410
|
+
...(input.limit !== undefined ? { limit: input.limit } : {}),
|
|
2411
|
+
...(input.offset !== undefined ? { offset: input.offset } : {}),
|
|
2412
|
+
...(input.startLine !== undefined ? { startLine: input.startLine } : {}),
|
|
2413
|
+
...(input.endLine !== undefined ? { endLine: input.endLine } : {}),
|
|
2414
|
+
},
|
|
2415
|
+
});
|
|
2416
|
+
}
|
|
2417
|
+
async checkoutGitFileCommitDiff(cwd, input, requestId) {
|
|
2418
|
+
return this.sendNamespacedCorrelatedSessionRequest({
|
|
2419
|
+
requestId,
|
|
2420
|
+
message: {
|
|
2421
|
+
type: "checkout.git.get_file_commit_diff.request",
|
|
2422
|
+
cwd,
|
|
2423
|
+
path: input.path,
|
|
2424
|
+
sha: input.sha,
|
|
2425
|
+
...(input.ignoreWhitespace ? { ignoreWhitespace: true } : {}),
|
|
2426
|
+
},
|
|
2427
|
+
});
|
|
2428
|
+
}
|
|
2429
|
+
async checkoutGitFileBlame(cwd, input, requestId) {
|
|
2430
|
+
return this.sendNamespacedCorrelatedSessionRequest({
|
|
2431
|
+
requestId,
|
|
2432
|
+
message: {
|
|
2433
|
+
type: "checkout.git.get_file_blame.request",
|
|
2434
|
+
cwd,
|
|
2435
|
+
path: input.path,
|
|
2436
|
+
...(input.startLine !== undefined ? { startLine: input.startLine } : {}),
|
|
2437
|
+
...(input.lineCount !== undefined ? { lineCount: input.lineCount } : {}),
|
|
2438
|
+
...(input.sha !== undefined ? { sha: input.sha } : {}),
|
|
2439
|
+
},
|
|
2440
|
+
});
|
|
2441
|
+
}
|
|
2442
|
+
async checkoutGitFileOrigin(cwd, input, requestId) {
|
|
2443
|
+
return this.sendNamespacedCorrelatedSessionRequest({
|
|
2444
|
+
requestId,
|
|
2445
|
+
message: {
|
|
2446
|
+
type: "checkout.git.get_file_origin.request",
|
|
2447
|
+
cwd,
|
|
2448
|
+
path: input.path,
|
|
2449
|
+
},
|
|
2450
|
+
});
|
|
2451
|
+
}
|
|
2292
2452
|
async checkoutMerge(cwd, input, requestId) {
|
|
2293
2453
|
return this.sendCorrelatedSessionRequest({
|
|
2294
2454
|
requestId,
|
|
@@ -3094,6 +3254,27 @@ export class DaemonClient {
|
|
|
3094
3254
|
},
|
|
3095
3255
|
});
|
|
3096
3256
|
}
|
|
3257
|
+
// Stream a full message aloud on demand (per-message playback button). Audio
|
|
3258
|
+
// arrives as `audio_output` chunks the session already plays; this promise
|
|
3259
|
+
// resolves when playback finishes, is canceled, or errors. `voice` is the
|
|
3260
|
+
// speaking agent's personality voice (resolved on the client).
|
|
3261
|
+
async speakMessage(params, requestId) {
|
|
3262
|
+
return this.sendNamespacedCorrelatedSessionRequest({
|
|
3263
|
+
requestId,
|
|
3264
|
+
message: {
|
|
3265
|
+
type: "speech.tts.speak.request",
|
|
3266
|
+
text: params.text,
|
|
3267
|
+
...(params.voice ? { voice: params.voice } : {}),
|
|
3268
|
+
},
|
|
3269
|
+
});
|
|
3270
|
+
}
|
|
3271
|
+
// Stop the in-flight message playback started by speakMessage.
|
|
3272
|
+
async cancelSpeakMessage(requestId) {
|
|
3273
|
+
return this.sendNamespacedCorrelatedSessionRequest({
|
|
3274
|
+
requestId,
|
|
3275
|
+
message: { type: "speech.tts.speak.cancel.request" },
|
|
3276
|
+
});
|
|
3277
|
+
}
|
|
3097
3278
|
// Author short spoken cue lines (join / thinking / done) for a persona,
|
|
3098
3279
|
// described inline (name + prompt) so it works for an unsaved editor draft.
|
|
3099
3280
|
// Routed through the Writer chain; the caller stores the result on the
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ export function createOttoClient(config) {
|
|
|
14
14
|
ref: (workspace) => createWorkspaceHandle(workspace),
|
|
15
15
|
open: (input, requestId) => openWorkspace(daemonClient, createWorkspaceHandle, input, requestId),
|
|
16
16
|
create: (input, requestId) => openWorkspace(daemonClient, createWorkspaceHandle, input, requestId),
|
|
17
|
-
archive: (workspace, requestId) => daemonClient.archiveWorkspace(resolveWorkspaceId(workspace), requestId),
|
|
17
|
+
archive: (workspace, requestId) => daemonClient.archiveWorkspace(resolveWorkspaceId(workspace), { requestId }),
|
|
18
18
|
subscribe: (handler) => daemonClient.on("workspace_update", (message) => {
|
|
19
19
|
handler(message.payload);
|
|
20
20
|
}),
|
|
@@ -75,7 +75,7 @@ function createWorkspaceHandleFactory(daemonClient) {
|
|
|
75
75
|
return latest;
|
|
76
76
|
},
|
|
77
77
|
archive: async (requestId) => {
|
|
78
|
-
const result = await daemonClient.archiveWorkspace(id, requestId);
|
|
78
|
+
const result = await daemonClient.archiveWorkspace(id, { requestId });
|
|
79
79
|
if (latest) {
|
|
80
80
|
latest = { ...latest, archivingAt: result.archivedAt };
|
|
81
81
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@otto-code/client",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.7",
|
|
4
4
|
"description": "Otto client SDK package",
|
|
5
5
|
"license": "AGPL-3.0-or-later",
|
|
6
6
|
"files": [
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"test": "vitest run"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@otto-code/protocol": "0.6.
|
|
40
|
-
"@otto-code/relay": "0.6.
|
|
39
|
+
"@otto-code/protocol": "0.6.7",
|
|
40
|
+
"@otto-code/relay": "0.6.7",
|
|
41
41
|
"zod": "^4.4.3"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|