@otto-code/client 0.5.5 → 0.5.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.d.ts +19 -2
- package/dist/daemon-client.js +65 -0
- 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, ProjectAddResponse, OpenProjectResponseMessage, ArchiveWorkspaceResponseMessage, WorkspaceSetupStatusResponseMessage, ListCommandsResponse, ListProviderFeaturesResponseMessage, ListProviderModelsResponseMessage, ListProviderModesResponseMessage, ListAvailableProvidersResponse, GetProvidersSnapshotResponseMessage, RefreshProvidersSnapshotResponseMessage, ProviderDiagnosticResponseMessage, ProviderUsageListResponseMessage, StatsActivityGetResponseMessage, AgentContextGetUsageResponseMessage, DaemonGetStatusResponse, DaemonGetPairingOfferResponse, DiagnosticsResponse, AgentRewindResponseMessage, ListTerminalsResponse, CreateTerminalResponse, SubscribeTerminalResponse, SubscribeTerminalRequest, CloseItemsResponse, KillTerminalResponse, CaptureTerminalResponse, TerminalInput, SessionInboundMessage, SessionOutboundMessage, SendAgentMessageRequest, 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, 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, ProjectAddResponse, OpenProjectResponseMessage, ArchiveWorkspaceResponseMessage, WorkspaceSetupStatusResponseMessage, ListCommandsResponse, ListProviderFeaturesResponseMessage, ListProviderModelsResponseMessage, ListProviderModesResponseMessage, ListAvailableProvidersResponse, GetProvidersSnapshotResponseMessage, RefreshProvidersSnapshotResponseMessage, ProviderDiagnosticResponseMessage, ProviderUsageListResponseMessage, StatsActivityGetResponseMessage, 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
6
|
import type { Run } from "@otto-code/protocol/orchestration";
|
|
7
|
-
import type { MutableDaemonConfig, MutableDaemonConfigPatch, SpeechSettingsOptions, SpeechTtsPreviewResult } from "@otto-code/protocol/messages";
|
|
7
|
+
import type { MutableDaemonConfig, MutableDaemonConfigPatch, ProjectLink, SpeechSettingsOptions, SpeechTtsPreviewResult } 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";
|
|
@@ -787,6 +787,19 @@ export declare class DaemonClient {
|
|
|
787
787
|
* Tasks track. Still-live tasks are stopped best-effort first.
|
|
788
788
|
*/
|
|
789
789
|
clearBackgroundShellTasks(parentAgentId: string, taskIds: readonly string[]): Promise<void>;
|
|
790
|
+
/**
|
|
791
|
+
* Start one or more suggested tasks (from `spawn_task` chips), applying the
|
|
792
|
+
* same mode to each — a new worktree workspace per task, a new local session
|
|
793
|
+
* per task, or steering the parent's current session. Individual actions pass
|
|
794
|
+
* a single-element array; the "Start all" collective action passes the whole
|
|
795
|
+
* pending queue. Resolves to the count started; throws only if all failed.
|
|
796
|
+
*/
|
|
797
|
+
startSuggestedTasks(parentAgentId: string, taskIds: readonly string[], mode: TasksSuggestedStartMode): Promise<{
|
|
798
|
+
succeeded: number;
|
|
799
|
+
failed: number;
|
|
800
|
+
}>;
|
|
801
|
+
/** Dismiss one or more suggested-task chips the user has not acted on. */
|
|
802
|
+
dismissSuggestedTasks(parentAgentId: string, taskIds: readonly string[]): Promise<void>;
|
|
790
803
|
/** Orchestration: fetch the current snapshot of all runs on this host. */
|
|
791
804
|
getRunsSnapshot(): Promise<Run[]>;
|
|
792
805
|
/** Orchestration: approve or reject a run's attended gate. */
|
|
@@ -813,6 +826,9 @@ export declare class DaemonClient {
|
|
|
813
826
|
setWorkspaceTitle(workspaceId: string, title: string | null, requestId?: string): Promise<{
|
|
814
827
|
title: string | null;
|
|
815
828
|
}>;
|
|
829
|
+
listProjectLinks(requestId?: string): Promise<ProjectLink[]>;
|
|
830
|
+
linkProjects(projectId: string, otherProjectId: string, requestId?: string): Promise<ProjectLink[]>;
|
|
831
|
+
unlinkProjects(projectId: string, otherProjectId: string, requestId?: string): Promise<ProjectLink[]>;
|
|
816
832
|
resumeAgent(handle: AgentPersistenceHandle, overrides?: Partial<AgentSessionConfig>): Promise<AgentSnapshotPayload>;
|
|
817
833
|
importAgent(input: ImportAgentInput): Promise<AgentSnapshotPayload>;
|
|
818
834
|
refreshAgent(agentId: string, requestId?: string): Promise<AgentRefreshedStatusPayload>;
|
|
@@ -880,6 +896,7 @@ export declare class DaemonClient {
|
|
|
880
896
|
checkoutGitCommitAgent(cwd: string, requestId?: string): Promise<CheckoutGitCommitAgentPayload>;
|
|
881
897
|
checkoutGitRollback(cwd: string, input: {
|
|
882
898
|
paths: string[];
|
|
899
|
+
allowWithRunningAgents?: boolean;
|
|
883
900
|
}, requestId?: string): Promise<CheckoutGitRollbackPayload>;
|
|
884
901
|
checkoutGitGetOperationLog(cwd: string, operation: string, requestId?: string): Promise<CheckoutGitGetOperationLogPayload>;
|
|
885
902
|
checkoutMerge(cwd: string, input: {
|
package/dist/daemon-client.js
CHANGED
|
@@ -1289,6 +1289,40 @@ export class DaemonClient {
|
|
|
1289
1289
|
throw new Error(payload.error ?? "clearBackgroundShellTasks rejected");
|
|
1290
1290
|
}
|
|
1291
1291
|
}
|
|
1292
|
+
/**
|
|
1293
|
+
* Start one or more suggested tasks (from `spawn_task` chips), applying the
|
|
1294
|
+
* same mode to each — a new worktree workspace per task, a new local session
|
|
1295
|
+
* per task, or steering the parent's current session. Individual actions pass
|
|
1296
|
+
* a single-element array; the "Start all" collective action passes the whole
|
|
1297
|
+
* pending queue. Resolves to the count started; throws only if all failed.
|
|
1298
|
+
*/
|
|
1299
|
+
async startSuggestedTasks(parentAgentId, taskIds, mode) {
|
|
1300
|
+
const payload = await this.sendNamespacedCorrelatedSessionRequest({
|
|
1301
|
+
message: {
|
|
1302
|
+
type: "tasks.suggested.start.request",
|
|
1303
|
+
parentAgentId,
|
|
1304
|
+
taskIds: [...taskIds],
|
|
1305
|
+
mode,
|
|
1306
|
+
},
|
|
1307
|
+
});
|
|
1308
|
+
if (!payload.accepted) {
|
|
1309
|
+
throw new Error(payload.error ?? "startSuggestedTasks rejected");
|
|
1310
|
+
}
|
|
1311
|
+
return { succeeded: payload.succeeded, failed: payload.failed };
|
|
1312
|
+
}
|
|
1313
|
+
/** Dismiss one or more suggested-task chips the user has not acted on. */
|
|
1314
|
+
async dismissSuggestedTasks(parentAgentId, taskIds) {
|
|
1315
|
+
const payload = await this.sendNamespacedCorrelatedSessionRequest({
|
|
1316
|
+
message: {
|
|
1317
|
+
type: "tasks.suggested.dismiss.request",
|
|
1318
|
+
parentAgentId,
|
|
1319
|
+
taskIds: [...taskIds],
|
|
1320
|
+
},
|
|
1321
|
+
});
|
|
1322
|
+
if (!payload.accepted) {
|
|
1323
|
+
throw new Error(payload.error ?? "dismissSuggestedTasks rejected");
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1292
1326
|
/** Orchestration: fetch the current snapshot of all runs on this host. */
|
|
1293
1327
|
async getRunsSnapshot() {
|
|
1294
1328
|
const payload = await this.sendNamespacedCorrelatedSessionRequest({
|
|
@@ -1395,6 +1429,36 @@ export class DaemonClient {
|
|
|
1395
1429
|
}
|
|
1396
1430
|
return { title: payload.title };
|
|
1397
1431
|
}
|
|
1432
|
+
async listProjectLinks(requestId) {
|
|
1433
|
+
const payload = await this.sendNamespacedCorrelatedSessionRequest({
|
|
1434
|
+
requestId,
|
|
1435
|
+
message: { type: "project.links.list.request" },
|
|
1436
|
+
});
|
|
1437
|
+
if (payload.error) {
|
|
1438
|
+
throw new Error(payload.error);
|
|
1439
|
+
}
|
|
1440
|
+
return payload.links;
|
|
1441
|
+
}
|
|
1442
|
+
async linkProjects(projectId, otherProjectId, requestId) {
|
|
1443
|
+
const payload = await this.sendNamespacedCorrelatedSessionRequest({
|
|
1444
|
+
requestId,
|
|
1445
|
+
message: { type: "project.links.set.request", projectId, otherProjectId },
|
|
1446
|
+
});
|
|
1447
|
+
if (!payload.accepted) {
|
|
1448
|
+
throw new Error(payload.error ?? "linkProjects rejected");
|
|
1449
|
+
}
|
|
1450
|
+
return payload.links;
|
|
1451
|
+
}
|
|
1452
|
+
async unlinkProjects(projectId, otherProjectId, requestId) {
|
|
1453
|
+
const payload = await this.sendNamespacedCorrelatedSessionRequest({
|
|
1454
|
+
requestId,
|
|
1455
|
+
message: { type: "project.links.unset.request", projectId, otherProjectId },
|
|
1456
|
+
});
|
|
1457
|
+
if (!payload.accepted) {
|
|
1458
|
+
throw new Error(payload.error ?? "unlinkProjects rejected");
|
|
1459
|
+
}
|
|
1460
|
+
return payload.links;
|
|
1461
|
+
}
|
|
1398
1462
|
async resumeAgent(handle, overrides) {
|
|
1399
1463
|
const requestId = this.createRequestId();
|
|
1400
1464
|
const message = SessionInboundMessageSchema.parse({
|
|
@@ -2210,6 +2274,7 @@ export class DaemonClient {
|
|
|
2210
2274
|
type: "checkout.git.rollback.request",
|
|
2211
2275
|
cwd,
|
|
2212
2276
|
paths: input.paths,
|
|
2277
|
+
...(input.allowWithRunningAgents ? { allowWithRunningAgents: true } : {}),
|
|
2213
2278
|
},
|
|
2214
2279
|
});
|
|
2215
2280
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@otto-code/client",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.6",
|
|
4
4
|
"description": "Otto client SDK package",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"test": "vitest run"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@otto-code/protocol": "0.5.
|
|
39
|
-
"@otto-code/relay": "0.5.
|
|
38
|
+
"@otto-code/protocol": "0.5.6",
|
|
39
|
+
"@otto-code/relay": "0.5.6",
|
|
40
40
|
"zod": "^4.4.3"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|