@otto-code/client 0.8.18 → 0.9.0
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 +365 -68
- package/dist/daemon-client.js +581 -107
- package/dist/index.d.ts +7 -1
- package/dist/index.js +10 -4
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -92,6 +92,9 @@ export interface OttoWorkspaceHandle {
|
|
|
92
92
|
refresh(options?: {
|
|
93
93
|
requestId?: string;
|
|
94
94
|
}): Promise<OttoWorkspace | null>;
|
|
95
|
+
setTitle(title: string | null, requestId?: string): Promise<{
|
|
96
|
+
title: string | null;
|
|
97
|
+
}>;
|
|
95
98
|
archive(requestId?: string): Promise<OttoWorkspaceArchiveResult>;
|
|
96
99
|
/**
|
|
97
100
|
* Subscribes to already-emitted daemon workspace_update events for this id.
|
|
@@ -285,15 +288,18 @@ export interface OttoConfigActions {
|
|
|
285
288
|
config: MutableDaemonConfig;
|
|
286
289
|
}>;
|
|
287
290
|
}
|
|
288
|
-
export interface
|
|
291
|
+
export interface OttoApi {
|
|
289
292
|
readonly workspaces: OttoWorkspaceActions;
|
|
290
293
|
readonly agents: OttoAgentActions;
|
|
291
294
|
readonly providers: OttoProviderActions;
|
|
292
295
|
readonly config: OttoConfigActions;
|
|
296
|
+
}
|
|
297
|
+
export interface OttoClient extends OttoApi {
|
|
293
298
|
connect(): Promise<void>;
|
|
294
299
|
close(): Promise<void>;
|
|
295
300
|
ensureConnected(): void;
|
|
296
301
|
getConnectionState(): ConnectionState;
|
|
297
302
|
}
|
|
298
303
|
export declare function createOttoClient(config: OttoClientConfig): OttoClient;
|
|
304
|
+
export declare function createOttoApi(daemonClient: DaemonClient): OttoApi;
|
|
299
305
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -11,6 +11,15 @@ export function createOttoClient(config) {
|
|
|
11
11
|
clientId: config.clientId ?? createGeneratedClientId(),
|
|
12
12
|
clientType: "cli",
|
|
13
13
|
});
|
|
14
|
+
return {
|
|
15
|
+
...createOttoApi(daemonClient),
|
|
16
|
+
connect: () => daemonClient.connect(),
|
|
17
|
+
close: () => daemonClient.close(),
|
|
18
|
+
ensureConnected: () => daemonClient.ensureConnected(),
|
|
19
|
+
getConnectionState: () => daemonClient.getConnectionState(),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export function createOttoApi(daemonClient) {
|
|
14
23
|
const createAgentHandle = createAgentHandleFactory(daemonClient);
|
|
15
24
|
const createAgent = async (options, placement) => {
|
|
16
25
|
const { config: agentConfig, cwd, parent, title, prompt, ...requestOptions } = options;
|
|
@@ -79,10 +88,6 @@ export function createOttoClient(config) {
|
|
|
79
88
|
get: (requestId) => daemonClient.getDaemonConfig(requestId),
|
|
80
89
|
patch: (patch, requestId) => daemonClient.patchDaemonConfig(patch, requestId),
|
|
81
90
|
},
|
|
82
|
-
connect: () => daemonClient.connect(),
|
|
83
|
-
close: () => daemonClient.close(),
|
|
84
|
-
ensureConnected: () => daemonClient.ensureConnected(),
|
|
85
|
-
getConnectionState: () => daemonClient.getConnectionState(),
|
|
86
91
|
};
|
|
87
92
|
}
|
|
88
93
|
function createWorkspaceHandleFactory(daemonClient, createAgent) {
|
|
@@ -133,6 +138,7 @@ function createWorkspaceHandleFactory(daemonClient, createAgent) {
|
|
|
133
138
|
},
|
|
134
139
|
current: () => current,
|
|
135
140
|
refresh,
|
|
141
|
+
setTitle: (title, requestId) => daemonClient.setWorkspaceTitle(id, title, requestId),
|
|
136
142
|
archive: async (requestId) => {
|
|
137
143
|
const result = await daemonClient.archiveWorkspace(id, { requestId });
|
|
138
144
|
if (current) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@otto-code/client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Otto client SDK package",
|
|
5
5
|
"license": "AGPL-3.0-or-later",
|
|
6
6
|
"files": [
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"test": "vitest run"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@otto-code/protocol": "0.
|
|
44
|
-
"@otto-code/relay": "0.
|
|
43
|
+
"@otto-code/protocol": "0.9.0",
|
|
44
|
+
"@otto-code/relay": "0.9.0",
|
|
45
45
|
"zod": "^4.4.3"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|