@otto-code/client 0.6.4 → 0.6.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 +34 -3
- package/dist/daemon-client.js +54 -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, 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, 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
6
|
import type { Run } from "@otto-code/protocol/orchestration";
|
|
7
|
-
import type { MutableDaemonConfig, MutableDaemonConfigPatch, ProjectLink, SpeechSettingsOptions, SpeechTtsPreviewResult, VisualizerVoiceCuesResult } from "@otto-code/protocol/messages";
|
|
7
|
+
import type { CueMoment, MutableDaemonConfig, MutableDaemonConfigPatch, ProjectLink, SpeechSettingsOptions, SpeechTtsPreviewResult, 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"];
|
|
@@ -205,6 +209,12 @@ export interface FileReadResult {
|
|
|
205
209
|
path: string;
|
|
206
210
|
kind: LegacyFileExplorerFilePayload["kind"];
|
|
207
211
|
modifiedAt: string;
|
|
212
|
+
/**
|
|
213
|
+
* Detected line endings. Optional because only the inline JSON read path
|
|
214
|
+
* reports them — the chunked binary transfer never does, and neither do
|
|
215
|
+
* daemons older than v0.4.4. Absent means "not reported", not "LF".
|
|
216
|
+
*/
|
|
217
|
+
eol?: FileEol;
|
|
208
218
|
}
|
|
209
219
|
export interface TextFileReadResult {
|
|
210
220
|
path: string;
|
|
@@ -899,6 +909,27 @@ export declare class DaemonClient {
|
|
|
899
909
|
allowWithRunningAgents?: boolean;
|
|
900
910
|
}, requestId?: string): Promise<CheckoutGitRollbackPayload>;
|
|
901
911
|
checkoutGitGetOperationLog(cwd: string, operation: string, requestId?: string): Promise<CheckoutGitGetOperationLogPayload>;
|
|
912
|
+
checkoutGitFileHistory(cwd: string, input: {
|
|
913
|
+
path: string;
|
|
914
|
+
limit?: number;
|
|
915
|
+
offset?: number;
|
|
916
|
+
startLine?: number;
|
|
917
|
+
endLine?: number;
|
|
918
|
+
}, requestId?: string): Promise<CheckoutGitFileHistoryPayload>;
|
|
919
|
+
checkoutGitFileCommitDiff(cwd: string, input: {
|
|
920
|
+
path: string;
|
|
921
|
+
sha: string;
|
|
922
|
+
ignoreWhitespace?: boolean;
|
|
923
|
+
}, requestId?: string): Promise<CheckoutGitFileCommitDiffPayload>;
|
|
924
|
+
checkoutGitFileBlame(cwd: string, input: {
|
|
925
|
+
path: string;
|
|
926
|
+
startLine?: number;
|
|
927
|
+
lineCount?: number;
|
|
928
|
+
sha?: string;
|
|
929
|
+
}, requestId?: string): Promise<CheckoutGitFileBlamePayload>;
|
|
930
|
+
checkoutGitFileOrigin(cwd: string, input: {
|
|
931
|
+
path: string;
|
|
932
|
+
}, requestId?: string): Promise<CheckoutGitFileOriginPayload>;
|
|
902
933
|
checkoutMerge(cwd: string, input: {
|
|
903
934
|
baseRef?: string;
|
|
904
935
|
strategy?: "merge" | "squash";
|
|
@@ -1106,7 +1137,7 @@ export declare class DaemonClient {
|
|
|
1106
1137
|
prompt?: string;
|
|
1107
1138
|
cwd?: string;
|
|
1108
1139
|
roles?: string[];
|
|
1109
|
-
moment?:
|
|
1140
|
+
moment?: CueMoment;
|
|
1110
1141
|
}, requestId?: string): Promise<VisualizerVoiceCuesResult>;
|
|
1111
1142
|
getPersonalityStats(requestId?: string): Promise<{
|
|
1112
1143
|
requestId: string;
|
package/dist/daemon-client.js
CHANGED
|
@@ -119,6 +119,7 @@ function legacyExplorerFileToBytes(file) {
|
|
|
119
119
|
path: file.path,
|
|
120
120
|
kind: file.kind,
|
|
121
121
|
modifiedAt: file.modifiedAt,
|
|
122
|
+
eol: file.eol,
|
|
122
123
|
};
|
|
123
124
|
}
|
|
124
125
|
function binaryFileKind(mime, encoding) {
|
|
@@ -2288,6 +2289,59 @@ export class DaemonClient {
|
|
|
2288
2289
|
},
|
|
2289
2290
|
});
|
|
2290
2291
|
}
|
|
2292
|
+
// ── Git file investigation ────────────────────────────────────────────────
|
|
2293
|
+
// Local git only: no remote, no forge, and no per-provider variant — the same
|
|
2294
|
+
// four calls answer for every agent provider. Gated by
|
|
2295
|
+
// server_info.features.checkoutGitFileHistory.
|
|
2296
|
+
async checkoutGitFileHistory(cwd, input, requestId) {
|
|
2297
|
+
return this.sendNamespacedCorrelatedSessionRequest({
|
|
2298
|
+
requestId,
|
|
2299
|
+
message: {
|
|
2300
|
+
type: "checkout.git.get_file_history.request",
|
|
2301
|
+
cwd,
|
|
2302
|
+
path: input.path,
|
|
2303
|
+
...(input.limit !== undefined ? { limit: input.limit } : {}),
|
|
2304
|
+
...(input.offset !== undefined ? { offset: input.offset } : {}),
|
|
2305
|
+
...(input.startLine !== undefined ? { startLine: input.startLine } : {}),
|
|
2306
|
+
...(input.endLine !== undefined ? { endLine: input.endLine } : {}),
|
|
2307
|
+
},
|
|
2308
|
+
});
|
|
2309
|
+
}
|
|
2310
|
+
async checkoutGitFileCommitDiff(cwd, input, requestId) {
|
|
2311
|
+
return this.sendNamespacedCorrelatedSessionRequest({
|
|
2312
|
+
requestId,
|
|
2313
|
+
message: {
|
|
2314
|
+
type: "checkout.git.get_file_commit_diff.request",
|
|
2315
|
+
cwd,
|
|
2316
|
+
path: input.path,
|
|
2317
|
+
sha: input.sha,
|
|
2318
|
+
...(input.ignoreWhitespace ? { ignoreWhitespace: true } : {}),
|
|
2319
|
+
},
|
|
2320
|
+
});
|
|
2321
|
+
}
|
|
2322
|
+
async checkoutGitFileBlame(cwd, input, requestId) {
|
|
2323
|
+
return this.sendNamespacedCorrelatedSessionRequest({
|
|
2324
|
+
requestId,
|
|
2325
|
+
message: {
|
|
2326
|
+
type: "checkout.git.get_file_blame.request",
|
|
2327
|
+
cwd,
|
|
2328
|
+
path: input.path,
|
|
2329
|
+
...(input.startLine !== undefined ? { startLine: input.startLine } : {}),
|
|
2330
|
+
...(input.lineCount !== undefined ? { lineCount: input.lineCount } : {}),
|
|
2331
|
+
...(input.sha !== undefined ? { sha: input.sha } : {}),
|
|
2332
|
+
},
|
|
2333
|
+
});
|
|
2334
|
+
}
|
|
2335
|
+
async checkoutGitFileOrigin(cwd, input, requestId) {
|
|
2336
|
+
return this.sendNamespacedCorrelatedSessionRequest({
|
|
2337
|
+
requestId,
|
|
2338
|
+
message: {
|
|
2339
|
+
type: "checkout.git.get_file_origin.request",
|
|
2340
|
+
cwd,
|
|
2341
|
+
path: input.path,
|
|
2342
|
+
},
|
|
2343
|
+
});
|
|
2344
|
+
}
|
|
2291
2345
|
async checkoutMerge(cwd, input, requestId) {
|
|
2292
2346
|
return this.sendCorrelatedSessionRequest({
|
|
2293
2347
|
requestId,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@otto-code/client",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.6",
|
|
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.6",
|
|
40
|
+
"@otto-code/relay": "0.6.6",
|
|
41
41
|
"zod": "^4.4.3"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|