@deksden-com/dd-flow-cli 0.9.0-beta.134 → 0.9.0-beta.136

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.
Files changed (161) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +33 -0
  3. package/dist/build-info.json +7 -7
  4. package/dist/cli/command-inputs.js +1 -0
  5. package/dist/cli/command-metadata.js +144 -0
  6. package/dist/cli/command-option-descriptions.js +186 -0
  7. package/dist/cli/completion-cli.js +70 -0
  8. package/dist/cli/completion.js +57 -0
  9. package/dist/cli/error-output.js +52 -0
  10. package/dist/cli/executor-onboarding.js +71 -0
  11. package/dist/cli/harnesses.js +84 -0
  12. package/dist/cli/models.js +39 -0
  13. package/dist/cli/operator-profiles.js +61 -0
  14. package/dist/cli/output-options.js +35 -0
  15. package/dist/cli/response-file.js +69 -0
  16. package/dist/cli/run-cli.js +5 -0
  17. package/dist/cli/setup.js +147 -0
  18. package/dist/harness-runtime/OPENCODE-LICENSE.txt +24 -0
  19. package/dist/harness-runtime/bin/dd-opencode.mjs +1 -1
  20. package/dist/harness-runtime/lib/codex-capacity-policy.mjs +13 -0
  21. package/dist/harness-runtime/lib/dd-opencode-daemon.mjs +193 -39
  22. package/dist/harness-runtime/lib/dd-opencode.mjs +295 -100
  23. package/dist/harness-runtime/lib/delegation-instructions.mjs +3 -3
  24. package/dist/harness-runtime/lib/managed-daemon.mjs +1 -1
  25. package/dist/harness-runtime/lib/native-hook-command.d.mts +2 -2
  26. package/dist/harness-runtime/lib/native-hook-command.mjs +4 -4
  27. package/dist/harness-runtime/lib/opencode-plugin.mjs +60 -0
  28. package/dist/harness-runtime/vendor/opencode-client/chunks/service-probe-1y4a697q.js +81 -0
  29. package/dist/harness-runtime/vendor/opencode-client/chunks/service-probe-2ny4vxct.js +92 -0
  30. package/dist/harness-runtime/vendor/opencode-client/chunks/service-probe-6mptkzbc.js +0 -0
  31. package/dist/harness-runtime/vendor/opencode-client/chunks/service-probe-7x67cf1q.js +52 -0
  32. package/dist/harness-runtime/vendor/opencode-client/chunks/service-probe-9rqn6x4v.js +16 -0
  33. package/dist/harness-runtime/vendor/opencode-client/chunks/service-probe-9vdz0zwn.js +1661 -0
  34. package/dist/harness-runtime/vendor/opencode-client/chunks/service-probe-ecs5ftka.js +1466 -0
  35. package/dist/harness-runtime/vendor/opencode-client/chunks/service-probe-frbwqjmf.js +145 -0
  36. package/dist/harness-runtime/vendor/opencode-client/chunks/service-probe-gne7h7mq.js +50 -0
  37. package/dist/harness-runtime/vendor/opencode-client/chunks/service-probe-gx9wnkzr.js +105 -0
  38. package/dist/harness-runtime/vendor/opencode-client/chunks/service-probe-m2eywc8w.js +0 -0
  39. package/dist/harness-runtime/vendor/opencode-client/chunks/service-probe-nwcpakzx.js +12 -0
  40. package/dist/harness-runtime/vendor/opencode-client/chunks/service-probe-q4g3afnw.js +623 -0
  41. package/dist/harness-runtime/vendor/opencode-client/chunks/service-probe-qav6mfdz.js +0 -0
  42. package/dist/harness-runtime/vendor/opencode-client/chunks/service-probe-sxt88q69.js +12 -0
  43. package/dist/harness-runtime/vendor/opencode-client/chunks/service-probe-t1xa31vm.js +39 -0
  44. package/dist/harness-runtime/vendor/opencode-client/chunks/service-probe-ve4aws36.js +103 -0
  45. package/dist/harness-runtime/vendor/opencode-client/chunks/service-probe-vmytr4q8.js +4 -0
  46. package/dist/harness-runtime/vendor/opencode-client/chunks/service-probe-vt9jbch8.js +36 -0
  47. package/dist/harness-runtime/vendor/opencode-client/chunks/service-probe-vyas3vgt.js +0 -0
  48. package/dist/harness-runtime/vendor/opencode-client/chunks/service-probe-wjyeq25y.js +30 -0
  49. package/dist/harness-runtime/vendor/opencode-client/chunks/service-probe-xgnj2w4v.js +20 -0
  50. package/dist/harness-runtime/vendor/opencode-client/chunks/service-probe-y2etg5bs.js +9 -0
  51. package/dist/harness-runtime/vendor/opencode-client/chunks/service-probe-ydhz1zrh.js +238 -0
  52. package/dist/harness-runtime/vendor/opencode-client/chunks/service-probe-z6qdwcsf.js +62 -0
  53. package/dist/harness-runtime/vendor/opencode-client/contract.d.ts +1 -0
  54. package/dist/harness-runtime/vendor/opencode-client/contract.js +12 -0
  55. package/dist/harness-runtime/vendor/opencode-client/effect/api/api.d.ts +2806 -0
  56. package/dist/harness-runtime/vendor/opencode-client/effect/api/api.js +0 -0
  57. package/dist/harness-runtime/vendor/opencode-client/effect/api.d.ts +4 -0
  58. package/dist/harness-runtime/vendor/opencode-client/effect/api.js +0 -0
  59. package/dist/harness-runtime/vendor/opencode-client/effect/client.d.ts +2530 -0
  60. package/dist/harness-runtime/vendor/opencode-client/effect/client.js +15 -0
  61. package/dist/harness-runtime/vendor/opencode-client/effect/generated/client-error.d.ts +7 -0
  62. package/dist/harness-runtime/vendor/opencode-client/effect/generated/client-error.js +6 -0
  63. package/dist/harness-runtime/vendor/opencode-client/effect/generated/client.d.ts +2529 -0
  64. package/dist/harness-runtime/vendor/opencode-client/effect/generated/client.js +8 -0
  65. package/dist/harness-runtime/vendor/opencode-client/effect/generated/index.d.ts +2 -0
  66. package/dist/harness-runtime/vendor/opencode-client/effect/generated/index.js +12 -0
  67. package/dist/harness-runtime/vendor/opencode-client/effect/index.d.ts +35 -0
  68. package/dist/harness-runtime/vendor/opencode-client/effect/index.js +75 -0
  69. package/dist/harness-runtime/vendor/opencode-client/effect/rpc.d.ts +20 -0
  70. package/dist/harness-runtime/vendor/opencode-client/effect/rpc.js +11 -0
  71. package/dist/harness-runtime/vendor/opencode-client/effect/service.d.ts +90 -0
  72. package/dist/harness-runtime/vendor/opencode-client/effect/service.js +187 -0
  73. package/dist/harness-runtime/vendor/opencode-client/package.json +84 -0
  74. package/dist/harness-runtime/vendor/opencode-client/promise/api.d.ts +21 -0
  75. package/dist/harness-runtime/vendor/opencode-client/promise/api.js +0 -0
  76. package/dist/harness-runtime/vendor/opencode-client/promise/client.d.ts +252 -0
  77. package/dist/harness-runtime/vendor/opencode-client/promise/client.js +14 -0
  78. package/dist/harness-runtime/vendor/opencode-client/promise/generated/client-error.d.ts +8 -0
  79. package/dist/harness-runtime/vendor/opencode-client/promise/generated/client-error.js +6 -0
  80. package/dist/harness-runtime/vendor/opencode-client/promise/generated/client.d.ts +259 -0
  81. package/dist/harness-runtime/vendor/opencode-client/promise/generated/client.js +7 -0
  82. package/dist/harness-runtime/vendor/opencode-client/promise/generated/index.d.ts +3 -0
  83. package/dist/harness-runtime/vendor/opencode-client/promise/generated/index.js +79 -0
  84. package/dist/harness-runtime/vendor/opencode-client/promise/generated/types.d.ts +8932 -0
  85. package/dist/harness-runtime/vendor/opencode-client/promise/generated/types.js +70 -0
  86. package/dist/harness-runtime/vendor/opencode-client/promise/index.d.ts +6 -0
  87. package/dist/harness-runtime/vendor/opencode-client/promise/index.js +83 -0
  88. package/dist/harness-runtime/vendor/opencode-client/promise/rpc.d.ts +32 -0
  89. package/dist/harness-runtime/vendor/opencode-client/promise/rpc.js +7 -0
  90. package/dist/harness-runtime/vendor/opencode-client/promise/service.d.ts +24 -0
  91. package/dist/harness-runtime/vendor/opencode-client/promise/service.js +187 -0
  92. package/dist/harness-runtime/vendor/opencode-client/pty-handoff.d.ts +12 -0
  93. package/dist/harness-runtime/vendor/opencode-client/pty-handoff.js +14 -0
  94. package/dist/harness-runtime/vendor/opencode-client/rpc-runtime.d.ts +20 -0
  95. package/dist/harness-runtime/vendor/opencode-client/rpc-runtime.js +14 -0
  96. package/dist/harness-runtime/vendor/opencode-client/service-contender.d.ts +37 -0
  97. package/dist/harness-runtime/vendor/opencode-client/service-contender.js +10 -0
  98. package/dist/harness-runtime/vendor/opencode-client/service-probe.d.ts +70 -0
  99. package/dist/harness-runtime/vendor/opencode-client/service-probe.js +16 -0
  100. package/dist/harness-runtime/vendor/opencode-client/service-timing.d.ts +12 -0
  101. package/dist/harness-runtime/vendor/opencode-client/service-timing.js +10 -0
  102. package/dist/harness-runtime/vendor/opencode-client/service-version.d.ts +2 -0
  103. package/dist/harness-runtime/vendor/opencode-client/service-version.js +6 -0
  104. package/dist/harness-runtime/vendor/opencode-client/service.d.ts +52 -0
  105. package/dist/harness-runtime/vendor/opencode-client/service.js +1 -0
  106. package/dist/harness-runtime/vendor/opencode-client/shared-events.d.ts +11 -0
  107. package/dist/harness-runtime/vendor/opencode-client/shared-events.js +8 -0
  108. package/dist/harness-runtime/vendor/opencode-client/solid/connection.d.ts +37 -0
  109. package/dist/harness-runtime/vendor/opencode-client/solid/connection.js +10 -0
  110. package/dist/harness-runtime/vendor/opencode-client/solid/data.d.ts +211 -0
  111. package/dist/harness-runtime/vendor/opencode-client/solid/data.js +18 -0
  112. package/dist/harness-runtime/vendor/opencode-client/solid/index.d.ts +3 -0
  113. package/dist/harness-runtime/vendor/opencode-client/solid/index.js +32 -0
  114. package/dist/harness-runtime/vendor/opencode-client/solid/pty.d.ts +22 -0
  115. package/dist/harness-runtime/vendor/opencode-client/solid/pty.js +8 -0
  116. package/dist/harness-runtime/vendor/opencode-plugin.mjs +3 -0
  117. package/dist/services/cli-operation-classifier.js +4 -0
  118. package/dist/services/cli-upgrade-allowlist.js +27 -0
  119. package/dist/services/discovery/agy-discovery.js +2 -0
  120. package/dist/services/discovery/codex-discovery.js +2 -0
  121. package/dist/services/discovery/droid-discovery.js +2 -0
  122. package/dist/services/discovery/grok-discovery.js +2 -0
  123. package/dist/services/discovery/opencode-discovery.js +2 -0
  124. package/dist/services/discovery/static.js +31 -0
  125. package/dist/services/discovery/zcode-discovery.js +2 -0
  126. package/dist/services/engines.js +23 -25
  127. package/dist/services/eval-snapshots.js +1 -1
  128. package/dist/services/executor-onboarding.js +56 -0
  129. package/dist/services/external-work-launch.js +1 -1
  130. package/dist/services/harness-discovery.js +29 -0
  131. package/dist/services/harness-doctor.js +75 -0
  132. package/dist/services/harness-probe-effects.js +51 -0
  133. package/dist/services/harness-version-probe.js +100 -0
  134. package/dist/services/hooks.js +1 -1
  135. package/dist/services/hybrid-contracts.js +455 -0
  136. package/dist/services/installation-lock.js +92 -0
  137. package/dist/services/managed-processes.js +30 -0
  138. package/dist/services/merge-server.js +1 -1
  139. package/dist/services/model-catalog.js +109 -0
  140. package/dist/services/model-discovery.js +46 -0
  141. package/dist/services/operator-profiles.js +236 -0
  142. package/dist/services/release-archive-producer.js +52 -0
  143. package/dist/services/release-archive.js +143 -0
  144. package/dist/services/release-cache.js +142 -0
  145. package/dist/services/release-compatibility.js +18 -0
  146. package/dist/services/release-download.js +67 -0
  147. package/dist/services/release-envelope.js +104 -0
  148. package/dist/services/release-manifest.js +45 -0
  149. package/dist/services/release-payload.js +114 -0
  150. package/dist/services/release-producer.js +63 -0
  151. package/dist/services/release-provenance.js +160 -0
  152. package/dist/services/release-registry.js +66 -0
  153. package/dist/services/release-source.js +194 -0
  154. package/dist/services/run-controller-recovery.js +2 -2
  155. package/dist/services/run-controller.js +3 -2
  156. package/dist/services/run-health.js +149 -0
  157. package/dist/services/runs.js +61 -13
  158. package/dist/services/setup.js +377 -0
  159. package/dist/storage/database.js +18 -3
  160. package/dist/storage/writer-contract.js +8 -0
  161. package/package.json +4 -1
@@ -0,0 +1,1466 @@
1
+ import {
2
+ ClientError3
3
+ } from "./service-probe-nwcpakzx.js";
4
+ import {
5
+ __export
6
+ } from "./service-probe-9rqn6x4v.js";
7
+
8
+ // src/promise/generated/client.ts
9
+ var exports_client4 = {};
10
+ __export(exports_client4, {
11
+ make: () => make6
12
+ });
13
+ var maxSseEventBytes = 16 * 1024 * 1024;
14
+ function make6(options) {
15
+ const fetch = options.fetch ?? globalThis.fetch;
16
+ const prepare = (descriptor, requestOptions) => {
17
+ const baseUrl = new URL(options.baseUrl);
18
+ if (!baseUrl.pathname.endsWith("/"))
19
+ baseUrl.pathname += "/";
20
+ const url = new URL(descriptor.path.slice(1), baseUrl);
21
+ for (const [key, value] of Object.entries(descriptor.query ?? {}))
22
+ appendQuery(url.searchParams, key, value);
23
+ const headers = new Headers(options.headers);
24
+ for (const [key, value] of Object.entries(descriptor.headers ?? {})) {
25
+ if (value !== undefined && value !== null)
26
+ headers.set(key, String(value));
27
+ }
28
+ for (const [key, value] of new Headers(requestOptions?.headers))
29
+ headers.set(key, value);
30
+ if (descriptor.body !== undefined && !headers.has("content-type"))
31
+ headers.set("content-type", descriptor.binaryBody ? "application/octet-stream" : "application/json");
32
+ return {
33
+ url,
34
+ init: {
35
+ method: descriptor.method,
36
+ signal: requestOptions?.signal,
37
+ headers,
38
+ body: descriptor.body === undefined ? undefined : descriptor.binaryBody ? descriptor.body : JSON.stringify(descriptor.body)
39
+ }
40
+ };
41
+ };
42
+ const execute = async (descriptor, requestOptions) => {
43
+ try {
44
+ const prepared = prepare(descriptor, requestOptions);
45
+ return await fetch(prepared.url, prepared.init);
46
+ } catch (cause) {
47
+ throw new ClientError3("Transport", { cause });
48
+ }
49
+ };
50
+ const responseError = async (response, descriptor) => {
51
+ if (descriptor.declaredStatuses.includes(response.status))
52
+ throw declared(await json(response));
53
+ try {
54
+ await response.body?.cancel();
55
+ } catch {}
56
+ throw new ClientError3("UnexpectedStatus", { cause: { status: response.status }, detail: String(response.status) });
57
+ };
58
+ const request = async (descriptor, requestOptions) => {
59
+ const response = await execute(descriptor, requestOptions);
60
+ if (response.status !== descriptor.successStatus)
61
+ return responseError(response, descriptor);
62
+ if (descriptor.binary)
63
+ return new Uint8Array(await response.arrayBuffer());
64
+ if (descriptor.empty) {
65
+ try {
66
+ await response.body?.cancel();
67
+ } catch {}
68
+ return;
69
+ }
70
+ return await json(response);
71
+ };
72
+ const sse = (descriptor, requestOptions) => ({
73
+ async* [Symbol.asyncIterator]() {
74
+ const response = await execute(descriptor, requestOptions);
75
+ if (response.status !== descriptor.successStatus)
76
+ await responseError(response, descriptor);
77
+ if (!isContentType(response, "text/event-stream")) {
78
+ try {
79
+ await response.body?.cancel();
80
+ } catch {}
81
+ throw new ClientError3("UnsupportedContentType", { detail: response.headers.get("content-type") });
82
+ }
83
+ if (response.body === null)
84
+ throw new ClientError3("MalformedResponse");
85
+ const reader = response.body.getReader();
86
+ const decoder = new TextDecoder;
87
+ let buffer = "";
88
+ try {
89
+ while (true) {
90
+ let next;
91
+ try {
92
+ next = await reader.read();
93
+ } catch (cause) {
94
+ throw new ClientError3("Transport", { cause });
95
+ }
96
+ if (!next.done)
97
+ requestOptions?.onActivity?.();
98
+ buffer += decoder.decode(next.value, { stream: !next.done });
99
+ if (buffer.length > maxSseEventBytes)
100
+ throw new ClientError3("SseEventTooLarge");
101
+ const trailingCarriageReturn = !next.done && buffer.endsWith("\r");
102
+ if (trailingCarriageReturn)
103
+ buffer = buffer.slice(0, -1);
104
+ buffer = buffer.replaceAll(`\r
105
+ `, `
106
+ `).replaceAll("\r", `
107
+ `);
108
+ if (trailingCarriageReturn)
109
+ buffer += "\r";
110
+ if (next.done && buffer !== "")
111
+ buffer += `
112
+
113
+ `;
114
+ let boundary = buffer.indexOf(`
115
+
116
+ `);
117
+ while (boundary >= 0) {
118
+ const block = buffer.slice(0, boundary);
119
+ buffer = buffer.slice(boundary + 2);
120
+ const data = block.split(`
121
+ `).flatMap((line) => line.startsWith("data:") ? [line.slice(5).trimStart()] : []).join(`
122
+ `);
123
+ if (data !== "") {
124
+ try {
125
+ yield JSON.parse(data);
126
+ } catch (cause) {
127
+ throw new ClientError3("MalformedResponse", { cause });
128
+ }
129
+ }
130
+ boundary = buffer.indexOf(`
131
+
132
+ `);
133
+ }
134
+ if (next.done)
135
+ return;
136
+ }
137
+ } finally {
138
+ try {
139
+ await reader.cancel();
140
+ } catch {}
141
+ reader.releaseLock();
142
+ }
143
+ }
144
+ });
145
+ return {
146
+ server: {
147
+ info: (requestOptions) => request({ method: "GET", path: `/api/info`, successStatus: 200, declaredStatuses: [400, 401], empty: false }, requestOptions),
148
+ pair: (requestOptions) => request({ method: "POST", path: `/api/pair`, successStatus: 200, declaredStatuses: [400, 401], empty: false }, requestOptions),
149
+ connect: (input, requestOptions) => request({
150
+ method: "GET",
151
+ path: `/auth/connect/${encodeURIComponent(input.code)}`,
152
+ successStatus: 200,
153
+ declaredStatuses: [400, 401],
154
+ empty: false
155
+ }, requestOptions)
156
+ },
157
+ location: {
158
+ get: (input, requestOptions) => request({
159
+ method: "GET",
160
+ path: `/api/location`,
161
+ query: { location: input?.["location"] },
162
+ successStatus: 200,
163
+ declaredStatuses: [400, 401, 404],
164
+ empty: false
165
+ }, requestOptions),
166
+ reload: (requestOptions) => request({
167
+ method: "POST",
168
+ path: `/api/location/reload`,
169
+ successStatus: 204,
170
+ declaredStatuses: [400, 401, 503],
171
+ empty: true
172
+ }, requestOptions)
173
+ },
174
+ agent: {
175
+ list: (input, requestOptions) => request({
176
+ method: "GET",
177
+ path: `/api/agent`,
178
+ query: { location: input?.["location"] },
179
+ successStatus: 200,
180
+ declaredStatuses: [400, 401, 404],
181
+ empty: false
182
+ }, requestOptions),
183
+ get: (input, requestOptions) => request({
184
+ method: "GET",
185
+ path: `/api/agent/${encodeURIComponent(input.agentID)}`,
186
+ query: { location: input["location"] },
187
+ successStatus: 200,
188
+ declaredStatuses: [400, 401, 404],
189
+ empty: false
190
+ }, requestOptions)
191
+ },
192
+ plugin: {
193
+ list: (input, requestOptions) => request({
194
+ method: "GET",
195
+ path: `/api/plugin`,
196
+ query: { location: input?.["location"] },
197
+ successStatus: 200,
198
+ declaredStatuses: [400, 401, 404],
199
+ empty: false
200
+ }, requestOptions),
201
+ check: (input, requestOptions) => request({
202
+ method: "POST",
203
+ path: `/api/plugin/check`,
204
+ query: { location: input?.["location"] },
205
+ body: { target: input?.["target"] },
206
+ successStatus: 200,
207
+ declaredStatuses: [400, 401, 404],
208
+ empty: false
209
+ }, requestOptions),
210
+ update: (input, requestOptions) => request({
211
+ method: "POST",
212
+ path: `/api/plugin/update`,
213
+ query: { location: input["location"] },
214
+ body: { targets: input["targets"] },
215
+ successStatus: 204,
216
+ declaredStatuses: [400, 401, 404, 503],
217
+ empty: true
218
+ }, requestOptions)
219
+ },
220
+ session: {
221
+ list: (input, requestOptions) => request({
222
+ method: "GET",
223
+ path: `/api/session`,
224
+ query: {
225
+ limit: input?.["limit"],
226
+ order: input?.["order"],
227
+ search: input?.["search"],
228
+ parentID: input?.["parentID"],
229
+ directory: input?.["directory"],
230
+ project: input?.["project"],
231
+ subpath: input?.["subpath"],
232
+ cursor: input?.["cursor"]
233
+ },
234
+ successStatus: 200,
235
+ declaredStatuses: [400, 401],
236
+ empty: false
237
+ }, requestOptions),
238
+ stats: (input, requestOptions) => request({
239
+ method: "GET",
240
+ path: `/api/experimental/session/stats`,
241
+ query: {
242
+ from: input?.["from"],
243
+ to: input?.["to"],
244
+ project: input?.["project"],
245
+ timezone: input?.["timezone"],
246
+ tools: input?.["tools"]
247
+ },
248
+ successStatus: 200,
249
+ declaredStatuses: [400, 401],
250
+ empty: false
251
+ }, requestOptions).then((value) => value.data),
252
+ create: (input, requestOptions) => request({
253
+ method: "POST",
254
+ path: `/api/session`,
255
+ body: {
256
+ id: input?.["id"],
257
+ parentID: input?.["parentID"],
258
+ title: input?.["title"],
259
+ agent: input?.["agent"],
260
+ model: input?.["model"],
261
+ location: input?.["location"],
262
+ metadata: input?.["metadata"],
263
+ permissions: input?.["permissions"]
264
+ },
265
+ successStatus: 200,
266
+ declaredStatuses: [400, 401, 404],
267
+ empty: false
268
+ }, requestOptions).then((value) => value.data),
269
+ import: (input, requestOptions) => request({
270
+ method: "POST",
271
+ path: `/api/experimental/session/import`,
272
+ body: { info: input["info"], messages: input["messages"], location: input["location"] },
273
+ successStatus: 200,
274
+ declaredStatuses: [400, 401, 404, 409],
275
+ empty: false
276
+ }, requestOptions).then((value) => value.data),
277
+ export: (input, requestOptions) => request({
278
+ method: "GET",
279
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/export`,
280
+ query: { sanitize: input["sanitize"] },
281
+ successStatus: 200,
282
+ declaredStatuses: [400, 401, 404, 500],
283
+ empty: false
284
+ }, requestOptions).then((value) => value.data),
285
+ active: (requestOptions) => request({
286
+ method: "GET",
287
+ path: `/api/session/active`,
288
+ successStatus: 200,
289
+ declaredStatuses: [400, 401],
290
+ empty: false
291
+ }, requestOptions).then((value) => value.data),
292
+ get: (input, requestOptions) => request({
293
+ method: "GET",
294
+ path: `/api/session/${encodeURIComponent(input.sessionID)}`,
295
+ successStatus: 200,
296
+ declaredStatuses: [400, 401, 404],
297
+ empty: false
298
+ }, requestOptions).then((value) => value.data),
299
+ remove: (input, requestOptions) => request({
300
+ method: "DELETE",
301
+ path: `/api/session/${encodeURIComponent(input.sessionID)}`,
302
+ successStatus: 204,
303
+ declaredStatuses: [400, 401, 404],
304
+ empty: true
305
+ }, requestOptions),
306
+ fork: (input, requestOptions) => request({
307
+ method: "POST",
308
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/fork`,
309
+ body: { before: input["before"] },
310
+ successStatus: 200,
311
+ declaredStatuses: [400, 401, 404],
312
+ empty: false
313
+ }, requestOptions).then((value) => value.data),
314
+ switchAgent: (input, requestOptions) => request({
315
+ method: "POST",
316
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/agent`,
317
+ body: { agent: input["agent"] },
318
+ successStatus: 204,
319
+ declaredStatuses: [400, 401, 404],
320
+ empty: true
321
+ }, requestOptions),
322
+ switchModel: (input, requestOptions) => request({
323
+ method: "POST",
324
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/model`,
325
+ body: { model: input["model"] },
326
+ successStatus: 204,
327
+ declaredStatuses: [400, 401, 404],
328
+ empty: true
329
+ }, requestOptions),
330
+ update: (input, requestOptions) => request({
331
+ method: "PATCH",
332
+ path: `/api/session/${encodeURIComponent(input.sessionID)}`,
333
+ body: { title: input["title"], metadata: input["metadata"], permissions: input["permissions"] },
334
+ successStatus: 204,
335
+ declaredStatuses: [400, 401, 404],
336
+ empty: true
337
+ }, requestOptions),
338
+ move: (input, requestOptions) => request({
339
+ method: "POST",
340
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/move`,
341
+ body: { directory: input["directory"], delivery: input["delivery"] },
342
+ successStatus: 204,
343
+ declaredStatuses: [400, 401, 404],
344
+ empty: true
345
+ }, requestOptions),
346
+ prompt: (input, requestOptions) => request({
347
+ method: "POST",
348
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/prompt`,
349
+ body: {
350
+ id: input["id"],
351
+ text: input["text"],
352
+ files: input["files"],
353
+ agents: input["agents"],
354
+ skills: input["skills"],
355
+ metadata: input["metadata"],
356
+ delivery: input["delivery"],
357
+ resume: input["resume"]
358
+ },
359
+ successStatus: 200,
360
+ declaredStatuses: [400, 401, 404, 409],
361
+ empty: false
362
+ }, requestOptions).then((value) => value.data),
363
+ command: (input, requestOptions) => request({
364
+ method: "POST",
365
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/command`,
366
+ body: {
367
+ name: input["name"],
368
+ text: input["text"],
369
+ files: input["files"],
370
+ agents: input["agents"],
371
+ skills: input["skills"],
372
+ delivery: input["delivery"]
373
+ },
374
+ successStatus: 204,
375
+ declaredStatuses: [400, 401, 404, 500],
376
+ empty: true
377
+ }, requestOptions),
378
+ skill: (input, requestOptions) => request({
379
+ method: "POST",
380
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/skill`,
381
+ body: { id: input["id"], resume: input["resume"] },
382
+ successStatus: 204,
383
+ declaredStatuses: [400, 401, 404],
384
+ empty: true
385
+ }, requestOptions),
386
+ synthetic: (input, requestOptions) => request({
387
+ method: "POST",
388
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/synthetic`,
389
+ body: {
390
+ id: input["id"],
391
+ text: input["text"],
392
+ description: input["description"],
393
+ metadata: input["metadata"],
394
+ delivery: input["delivery"],
395
+ resume: input["resume"]
396
+ },
397
+ successStatus: 200,
398
+ declaredStatuses: [400, 401, 404, 409],
399
+ empty: false
400
+ }, requestOptions).then((value) => value.data),
401
+ shell: (input, requestOptions) => request({
402
+ method: "POST",
403
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/shell`,
404
+ body: { id: input["id"], command: input["command"] },
405
+ successStatus: 204,
406
+ declaredStatuses: [400, 401, 404],
407
+ empty: true
408
+ }, requestOptions),
409
+ compact: (input, requestOptions) => request({
410
+ method: "POST",
411
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/compact`,
412
+ body: { id: input["id"], delivery: input["delivery"] },
413
+ successStatus: 200,
414
+ declaredStatuses: [400, 401, 404, 409],
415
+ empty: false
416
+ }, requestOptions).then((value) => value.data),
417
+ wait: (input, requestOptions) => request({
418
+ method: "POST",
419
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/wait`,
420
+ successStatus: 204,
421
+ declaredStatuses: [400, 401, 404, 503],
422
+ empty: true
423
+ }, requestOptions),
424
+ revert: {
425
+ stage: (input, requestOptions) => request({
426
+ method: "POST",
427
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/revert/stage`,
428
+ body: { messageID: input["messageID"], files: input["files"] },
429
+ successStatus: 200,
430
+ declaredStatuses: [400, 401, 404, 409, 500],
431
+ empty: false
432
+ }, requestOptions).then((value) => value.data),
433
+ clear: (input, requestOptions) => request({
434
+ method: "DELETE",
435
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/revert`,
436
+ successStatus: 204,
437
+ declaredStatuses: [400, 401, 404, 409, 500],
438
+ empty: true
439
+ }, requestOptions),
440
+ commit: (input, requestOptions) => request({
441
+ method: "POST",
442
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/revert/commit`,
443
+ successStatus: 204,
444
+ declaredStatuses: [400, 401, 404, 409],
445
+ empty: true
446
+ }, requestOptions)
447
+ },
448
+ context: (input, requestOptions) => request({
449
+ method: "GET",
450
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/context`,
451
+ successStatus: 200,
452
+ declaredStatuses: [400, 401, 404, 500],
453
+ empty: false
454
+ }, requestOptions).then((value) => value.data),
455
+ diff: (input, requestOptions) => request({
456
+ method: "GET",
457
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/diff`,
458
+ query: { from: input["from"], to: input["to"], context: input["context"] },
459
+ successStatus: 200,
460
+ declaredStatuses: [400, 401, 404, 500],
461
+ empty: false
462
+ }, requestOptions).then((value) => value.data),
463
+ inbox: {
464
+ list: (input, requestOptions) => request({
465
+ method: "GET",
466
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/inbox`,
467
+ successStatus: 200,
468
+ declaredStatuses: [400, 401, 404],
469
+ empty: false
470
+ }, requestOptions).then((value) => value.data),
471
+ cancel: (input, requestOptions) => request({
472
+ method: "DELETE",
473
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/inbox/${encodeURIComponent(input.inboxID)}`,
474
+ successStatus: 204,
475
+ declaredStatuses: [400, 401, 404],
476
+ empty: true
477
+ }, requestOptions),
478
+ update: (input, requestOptions) => request({
479
+ method: "PATCH",
480
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/inbox/${encodeURIComponent(input.inboxID)}`,
481
+ body: { delivery: input["delivery"] },
482
+ successStatus: 204,
483
+ declaredStatuses: [400, 401, 404, 409],
484
+ empty: true
485
+ }, requestOptions)
486
+ },
487
+ instructions: {
488
+ entry: {
489
+ list: (input, requestOptions) => request({
490
+ method: "GET",
491
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/instructions/entries`,
492
+ successStatus: 200,
493
+ declaredStatuses: [400, 401, 404],
494
+ empty: false
495
+ }, requestOptions).then((value) => value.data),
496
+ put: (input, requestOptions) => request({
497
+ method: "PUT",
498
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/instructions/entries/${encodeURIComponent(input.key)}`,
499
+ body: { value: input["value"] },
500
+ successStatus: 204,
501
+ declaredStatuses: [400, 401, 404, 413],
502
+ empty: true
503
+ }, requestOptions),
504
+ remove: (input, requestOptions) => request({
505
+ method: "DELETE",
506
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/instructions/entries/${encodeURIComponent(input.key)}`,
507
+ successStatus: 204,
508
+ declaredStatuses: [400, 401, 404],
509
+ empty: true
510
+ }, requestOptions)
511
+ }
512
+ },
513
+ generate: (input, requestOptions) => request({
514
+ method: "POST",
515
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/generate`,
516
+ body: { prompt: input["prompt"] },
517
+ successStatus: 200,
518
+ declaredStatuses: [400, 401, 404, 503],
519
+ empty: false
520
+ }, requestOptions).then((value) => value.data),
521
+ log: (input, requestOptions) => sse({
522
+ method: "GET",
523
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/log`,
524
+ query: { after: input["after"], follow: input["follow"] },
525
+ successStatus: 200,
526
+ declaredStatuses: [400, 401, 404],
527
+ empty: false
528
+ }, requestOptions),
529
+ interrupt: (input, requestOptions) => request({
530
+ method: "POST",
531
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/interrupt`,
532
+ query: { resume: input["resume"] },
533
+ successStatus: 200,
534
+ declaredStatuses: [400, 401, 404],
535
+ empty: false
536
+ }, requestOptions),
537
+ background: (input, requestOptions) => request({
538
+ method: "POST",
539
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/background`,
540
+ successStatus: 204,
541
+ declaredStatuses: [400, 401, 404],
542
+ empty: true
543
+ }, requestOptions),
544
+ message: {
545
+ get: (input, requestOptions) => request({
546
+ method: "GET",
547
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/message/${encodeURIComponent(input.messageID)}`,
548
+ successStatus: 200,
549
+ declaredStatuses: [400, 401, 404],
550
+ empty: false
551
+ }, requestOptions).then((value) => value.data)
552
+ },
553
+ form: {
554
+ list: (input, requestOptions) => request({
555
+ method: "GET",
556
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/form`,
557
+ successStatus: 200,
558
+ declaredStatuses: [400, 401, 404],
559
+ empty: false
560
+ }, requestOptions).then((value) => value.data),
561
+ create: (input, requestOptions) => request({
562
+ method: "POST",
563
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/form`,
564
+ body: { id: input["id"], title: input["title"], metadata: input["metadata"], fields: input["fields"] },
565
+ successStatus: 200,
566
+ declaredStatuses: [400, 401, 404, 409],
567
+ empty: false
568
+ }, requestOptions).then((value) => value.data),
569
+ get: (input, requestOptions) => request({
570
+ method: "GET",
571
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/form/${encodeURIComponent(input.formID)}`,
572
+ successStatus: 200,
573
+ declaredStatuses: [400, 401, 404],
574
+ empty: false
575
+ }, requestOptions).then((value) => value.data),
576
+ reply: (input, requestOptions) => request({
577
+ method: "POST",
578
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/form/${encodeURIComponent(input.formID)}/reply`,
579
+ body: { answer: input["answer"] },
580
+ successStatus: 204,
581
+ declaredStatuses: [400, 401, 404, 409],
582
+ empty: true
583
+ }, requestOptions),
584
+ cancel: (input, requestOptions) => request({
585
+ method: "DELETE",
586
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/form/${encodeURIComponent(input.formID)}`,
587
+ query: { message: input["message"] },
588
+ successStatus: 204,
589
+ declaredStatuses: [400, 401, 404, 409],
590
+ empty: true
591
+ }, requestOptions)
592
+ },
593
+ environment: (input, requestOptions) => request({
594
+ method: "PUT",
595
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/environment`,
596
+ body: { variables: input["variables"] },
597
+ successStatus: 204,
598
+ declaredStatuses: [400, 401, 404],
599
+ empty: true
600
+ }, requestOptions),
601
+ view: (input, requestOptions) => request({
602
+ method: "POST",
603
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/view`,
604
+ body: { idle: input["idle"] },
605
+ successStatus: 204,
606
+ declaredStatuses: [400, 401, 404],
607
+ empty: true
608
+ }, requestOptions)
609
+ },
610
+ message: {
611
+ list: (input, requestOptions) => request({
612
+ method: "GET",
613
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/message`,
614
+ query: { limit: input["limit"], order: input["order"], cursor: input["cursor"], type: input["type"] },
615
+ successStatus: 200,
616
+ declaredStatuses: [400, 401, 404, 500],
617
+ empty: false
618
+ }, requestOptions)
619
+ },
620
+ model: {
621
+ list: (input, requestOptions) => request({
622
+ method: "GET",
623
+ path: `/api/model`,
624
+ query: { location: input?.["location"] },
625
+ successStatus: 200,
626
+ declaredStatuses: [400, 401, 404, 503],
627
+ empty: false
628
+ }, requestOptions),
629
+ default: (input, requestOptions) => request({
630
+ method: "GET",
631
+ path: `/api/model/default`,
632
+ query: { location: input?.["location"] },
633
+ successStatus: 200,
634
+ declaredStatuses: [400, 401, 404, 503],
635
+ empty: false
636
+ }, requestOptions)
637
+ },
638
+ generate: {
639
+ text: (input, requestOptions) => request({
640
+ method: "POST",
641
+ path: `/api/experimental/generate`,
642
+ body: { prompt: input["prompt"], model: input["model"] },
643
+ successStatus: 200,
644
+ declaredStatuses: [400, 401, 404, 503],
645
+ empty: false
646
+ }, requestOptions).then((value) => value.data)
647
+ },
648
+ provider: {
649
+ list: (input, requestOptions) => request({
650
+ method: "GET",
651
+ path: `/api/provider`,
652
+ query: { location: input?.["location"] },
653
+ successStatus: 200,
654
+ declaredStatuses: [400, 401, 404, 503],
655
+ empty: false
656
+ }, requestOptions),
657
+ get: (input, requestOptions) => request({
658
+ method: "GET",
659
+ path: `/api/provider/${encodeURIComponent(input.providerID)}`,
660
+ query: { location: input["location"] },
661
+ successStatus: 200,
662
+ declaredStatuses: [400, 401, 404, 503],
663
+ empty: false
664
+ }, requestOptions)
665
+ },
666
+ integration: {
667
+ list: (input, requestOptions) => request({
668
+ method: "GET",
669
+ path: `/api/integration`,
670
+ query: { location: input?.["location"] },
671
+ successStatus: 200,
672
+ declaredStatuses: [400, 401, 404],
673
+ empty: false
674
+ }, requestOptions),
675
+ get: (input, requestOptions) => request({
676
+ method: "GET",
677
+ path: `/api/integration/${encodeURIComponent(input.integrationID)}`,
678
+ query: { location: input["location"] },
679
+ successStatus: 200,
680
+ declaredStatuses: [400, 401, 404],
681
+ empty: false
682
+ }, requestOptions),
683
+ wellknown: {
684
+ add: (input, requestOptions) => request({
685
+ method: "POST",
686
+ path: `/api/experimental/integration/wellknown`,
687
+ query: { location: input["location"] },
688
+ body: { url: input["url"] },
689
+ successStatus: 204,
690
+ declaredStatuses: [400, 401, 404],
691
+ empty: true
692
+ }, requestOptions)
693
+ },
694
+ connect: {
695
+ key: (input, requestOptions) => request({
696
+ method: "POST",
697
+ path: `/api/integration/${encodeURIComponent(input.integrationID)}/connect/key`,
698
+ query: { location: input["location"] },
699
+ body: { key: input["key"], answer: input["answer"], label: input["label"] },
700
+ successStatus: 204,
701
+ declaredStatuses: [400, 401, 404],
702
+ empty: true
703
+ }, requestOptions),
704
+ external: (input, requestOptions) => request({
705
+ method: "POST",
706
+ path: `/api/integration/${encodeURIComponent(input.integrationID)}/connect/external`,
707
+ query: { location: input["location"] },
708
+ body: { methodID: input["methodID"], answer: input["answer"], label: input["label"] },
709
+ successStatus: 204,
710
+ declaredStatuses: [400, 401, 404],
711
+ empty: true
712
+ }, requestOptions)
713
+ },
714
+ oauth: {
715
+ connect: (input, requestOptions) => request({
716
+ method: "POST",
717
+ path: `/api/integration/${encodeURIComponent(input.integrationID)}/connect/oauth`,
718
+ query: { location: input["location"] },
719
+ body: { methodID: input["methodID"], answer: input["answer"], label: input["label"] },
720
+ successStatus: 200,
721
+ declaredStatuses: [400, 401, 404],
722
+ empty: false
723
+ }, requestOptions),
724
+ status: (input, requestOptions) => request({
725
+ method: "GET",
726
+ path: `/api/integration/${encodeURIComponent(input.integrationID)}/connect/oauth/${encodeURIComponent(input.attemptID)}`,
727
+ query: { location: input["location"] },
728
+ successStatus: 200,
729
+ declaredStatuses: [400, 401, 404],
730
+ empty: false
731
+ }, requestOptions),
732
+ complete: (input, requestOptions) => request({
733
+ method: "POST",
734
+ path: `/api/integration/${encodeURIComponent(input.integrationID)}/connect/oauth/${encodeURIComponent(input.attemptID)}/complete`,
735
+ query: { location: input["location"] },
736
+ body: { code: input["code"] },
737
+ successStatus: 204,
738
+ declaredStatuses: [400, 401, 404],
739
+ empty: true
740
+ }, requestOptions),
741
+ cancel: (input, requestOptions) => request({
742
+ method: "DELETE",
743
+ path: `/api/integration/${encodeURIComponent(input.integrationID)}/connect/oauth/${encodeURIComponent(input.attemptID)}`,
744
+ query: { location: input["location"] },
745
+ successStatus: 204,
746
+ declaredStatuses: [400, 401, 404],
747
+ empty: true
748
+ }, requestOptions)
749
+ },
750
+ command: {
751
+ connect: (input, requestOptions) => request({
752
+ method: "POST",
753
+ path: `/api/integration/${encodeURIComponent(input.integrationID)}/connect/command`,
754
+ query: { location: input["location"] },
755
+ body: { methodID: input["methodID"], label: input["label"] },
756
+ successStatus: 200,
757
+ declaredStatuses: [400, 401, 404],
758
+ empty: false
759
+ }, requestOptions),
760
+ status: (input, requestOptions) => request({
761
+ method: "GET",
762
+ path: `/api/integration/${encodeURIComponent(input.integrationID)}/connect/command/${encodeURIComponent(input.attemptID)}`,
763
+ query: { location: input["location"] },
764
+ successStatus: 200,
765
+ declaredStatuses: [400, 401, 404],
766
+ empty: false
767
+ }, requestOptions),
768
+ cancel: (input, requestOptions) => request({
769
+ method: "DELETE",
770
+ path: `/api/integration/${encodeURIComponent(input.integrationID)}/connect/command/${encodeURIComponent(input.attemptID)}`,
771
+ query: { location: input["location"] },
772
+ successStatus: 204,
773
+ declaredStatuses: [400, 401, 404],
774
+ empty: true
775
+ }, requestOptions)
776
+ }
777
+ },
778
+ mcp: {
779
+ list: (input, requestOptions) => request({
780
+ method: "GET",
781
+ path: `/api/mcp`,
782
+ query: { location: input?.["location"] },
783
+ successStatus: 200,
784
+ declaredStatuses: [400, 401, 404],
785
+ empty: false
786
+ }, requestOptions),
787
+ add: (input, requestOptions) => request({
788
+ method: "PUT",
789
+ path: `/api/experimental/mcp/${encodeURIComponent(input.server)}`,
790
+ query: { location: input["location"] },
791
+ body: { config: input["config"] },
792
+ successStatus: 204,
793
+ declaredStatuses: [400, 401, 404],
794
+ empty: true
795
+ }, requestOptions),
796
+ remove: (input, requestOptions) => request({
797
+ method: "DELETE",
798
+ path: `/api/experimental/mcp/${encodeURIComponent(input.server)}`,
799
+ query: { location: input["location"] },
800
+ successStatus: 204,
801
+ declaredStatuses: [400, 401, 404],
802
+ empty: true
803
+ }, requestOptions),
804
+ connect: (input, requestOptions) => request({
805
+ method: "POST",
806
+ path: `/api/experimental/mcp/${encodeURIComponent(input.server)}/connect`,
807
+ query: { location: input["location"] },
808
+ successStatus: 204,
809
+ declaredStatuses: [400, 401, 404],
810
+ empty: true
811
+ }, requestOptions),
812
+ disconnect: (input, requestOptions) => request({
813
+ method: "POST",
814
+ path: `/api/experimental/mcp/${encodeURIComponent(input.server)}/disconnect`,
815
+ query: { location: input["location"] },
816
+ successStatus: 204,
817
+ declaredStatuses: [400, 401, 404],
818
+ empty: true
819
+ }, requestOptions),
820
+ resource: {
821
+ catalog: (input, requestOptions) => request({
822
+ method: "GET",
823
+ path: `/api/mcp/resource`,
824
+ query: { location: input?.["location"] },
825
+ successStatus: 200,
826
+ declaredStatuses: [400, 401, 404],
827
+ empty: false
828
+ }, requestOptions)
829
+ }
830
+ },
831
+ credential: {
832
+ list: (requestOptions) => request({ method: "GET", path: `/api/credential`, successStatus: 200, declaredStatuses: [400, 401], empty: false }, requestOptions).then((value) => value.data),
833
+ create: (input, requestOptions) => request({
834
+ method: "POST",
835
+ path: `/api/credential`,
836
+ body: {
837
+ id: input["id"],
838
+ integrationID: input["integrationID"],
839
+ label: input["label"],
840
+ value: input["value"],
841
+ activate: input["activate"]
842
+ },
843
+ successStatus: 200,
844
+ declaredStatuses: [400, 401, 409],
845
+ empty: false
846
+ }, requestOptions).then((value) => value.data),
847
+ update: (input, requestOptions) => request({
848
+ method: "PATCH",
849
+ path: `/api/credential/${encodeURIComponent(input.credentialID)}`,
850
+ body: { label: input["label"] },
851
+ successStatus: 204,
852
+ declaredStatuses: [400, 401],
853
+ empty: true
854
+ }, requestOptions),
855
+ activate: (input, requestOptions) => request({
856
+ method: "POST",
857
+ path: `/api/credential/${encodeURIComponent(input.credentialID)}/activate`,
858
+ successStatus: 204,
859
+ declaredStatuses: [400, 401],
860
+ empty: true
861
+ }, requestOptions),
862
+ remove: (input, requestOptions) => request({
863
+ method: "DELETE",
864
+ path: `/api/credential/${encodeURIComponent(input.credentialID)}`,
865
+ successStatus: 204,
866
+ declaredStatuses: [400, 401],
867
+ empty: true
868
+ }, requestOptions)
869
+ },
870
+ project: {
871
+ list: (input, requestOptions) => request({
872
+ method: "GET",
873
+ path: `/api/project`,
874
+ query: { archived: input?.["archived"] },
875
+ successStatus: 200,
876
+ declaredStatuses: [400, 401, 404],
877
+ empty: false
878
+ }, requestOptions),
879
+ update: (input, requestOptions) => request({
880
+ method: "PATCH",
881
+ path: `/api/project/${encodeURIComponent(input.projectID)}`,
882
+ body: {
883
+ canonical: input["canonical"],
884
+ name: input["name"],
885
+ icon: input["icon"],
886
+ commands: input["commands"]
887
+ },
888
+ successStatus: 200,
889
+ declaredStatuses: [400, 401, 404],
890
+ empty: false
891
+ }, requestOptions)
892
+ },
893
+ form: {
894
+ list: (input, requestOptions) => request({
895
+ method: "GET",
896
+ path: `/api/form`,
897
+ query: { location: input?.["location"] },
898
+ successStatus: 200,
899
+ declaredStatuses: [400, 401, 404],
900
+ empty: false
901
+ }, requestOptions)
902
+ },
903
+ permission: {
904
+ request: {
905
+ list: (input, requestOptions) => request({
906
+ method: "GET",
907
+ path: `/api/permission/request`,
908
+ query: { location: input?.["location"] },
909
+ successStatus: 200,
910
+ declaredStatuses: [400, 401, 404],
911
+ empty: false
912
+ }, requestOptions)
913
+ },
914
+ saved: {
915
+ list: (input, requestOptions) => request({
916
+ method: "GET",
917
+ path: `/api/permission/saved`,
918
+ query: { projectID: input?.["projectID"] },
919
+ successStatus: 200,
920
+ declaredStatuses: [400, 401, 404],
921
+ empty: false
922
+ }, requestOptions).then((value) => value.data),
923
+ remove: (input, requestOptions) => request({
924
+ method: "DELETE",
925
+ path: `/api/permission/saved/${encodeURIComponent(input.id)}`,
926
+ successStatus: 204,
927
+ declaredStatuses: [400, 401, 404],
928
+ empty: true
929
+ }, requestOptions)
930
+ },
931
+ create: (input, requestOptions) => request({
932
+ method: "POST",
933
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/permission`,
934
+ body: {
935
+ id: input["id"],
936
+ action: input["action"],
937
+ resources: input["resources"],
938
+ save: input["save"],
939
+ metadata: input["metadata"],
940
+ source: input["source"],
941
+ agent: input["agent"]
942
+ },
943
+ successStatus: 200,
944
+ declaredStatuses: [400, 401, 404],
945
+ empty: false
946
+ }, requestOptions).then((value) => value.data),
947
+ list: (input, requestOptions) => request({
948
+ method: "GET",
949
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/permission`,
950
+ successStatus: 200,
951
+ declaredStatuses: [400, 401, 404],
952
+ empty: false
953
+ }, requestOptions).then((value) => value.data),
954
+ get: (input, requestOptions) => request({
955
+ method: "GET",
956
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/permission/${encodeURIComponent(input.requestID)}`,
957
+ successStatus: 200,
958
+ declaredStatuses: [400, 401, 404],
959
+ empty: false
960
+ }, requestOptions).then((value) => value.data),
961
+ reply: (input, requestOptions) => request({
962
+ method: "POST",
963
+ path: `/api/session/${encodeURIComponent(input.sessionID)}/permission/${encodeURIComponent(input.requestID)}/reply`,
964
+ body: { decision: input["decision"], message: input["message"] },
965
+ successStatus: 204,
966
+ declaredStatuses: [400, 401, 404],
967
+ empty: true
968
+ }, requestOptions)
969
+ },
970
+ file: {
971
+ read: (input, requestOptions) => request({
972
+ method: "GET",
973
+ path: `/api/fs/read/${encodePath(input.path)}`,
974
+ query: { location: input["location"] },
975
+ successStatus: 200,
976
+ declaredStatuses: [400, 401, 404],
977
+ empty: false,
978
+ binary: true
979
+ }, requestOptions),
980
+ list: (input, requestOptions) => request({
981
+ method: "GET",
982
+ path: `/api/fs/list`,
983
+ query: { location: input?.["location"], path: input?.["path"] },
984
+ successStatus: 200,
985
+ declaredStatuses: [400, 401, 404],
986
+ empty: false
987
+ }, requestOptions),
988
+ find: (input, requestOptions) => request({
989
+ method: "GET",
990
+ path: `/api/fs/find`,
991
+ query: { location: input["location"], query: input["query"], type: input["type"], limit: input["limit"] },
992
+ successStatus: 200,
993
+ declaredStatuses: [400, 401, 404],
994
+ empty: false
995
+ }, requestOptions),
996
+ write: (input, requestOptions) => request({
997
+ method: "POST",
998
+ path: `/api/experimental/fs/write`,
999
+ query: { location: input["location"], path: input["path"] },
1000
+ body: input["payload"],
1001
+ successStatus: 200,
1002
+ declaredStatuses: [400, 401, 404],
1003
+ empty: false,
1004
+ binaryBody: true
1005
+ }, requestOptions)
1006
+ },
1007
+ command: {
1008
+ list: (input, requestOptions) => request({
1009
+ method: "GET",
1010
+ path: `/api/command`,
1011
+ query: { location: input?.["location"] },
1012
+ successStatus: 200,
1013
+ declaredStatuses: [400, 401, 404],
1014
+ empty: false
1015
+ }, requestOptions)
1016
+ },
1017
+ skill: {
1018
+ list: (input, requestOptions) => request({
1019
+ method: "GET",
1020
+ path: `/api/skill`,
1021
+ query: { location: input?.["location"] },
1022
+ successStatus: 200,
1023
+ declaredStatuses: [400, 401, 404],
1024
+ empty: false
1025
+ }, requestOptions)
1026
+ },
1027
+ rpc: {
1028
+ call: (input, requestOptions) => request({
1029
+ method: "POST",
1030
+ path: `/api/rpc/${encodeURIComponent(input.rpcID)}/${encodeURIComponent(input.method)}`,
1031
+ query: { location: input["location"] },
1032
+ body: { input: input["input"] },
1033
+ successStatus: 200,
1034
+ declaredStatuses: [400, 401, 404, 500],
1035
+ empty: false
1036
+ }, requestOptions)
1037
+ },
1038
+ event: {
1039
+ subscribe: (requestOptions) => sse({ method: "GET", path: `/api/event`, successStatus: 200, declaredStatuses: [400, 401], empty: false }, requestOptions)
1040
+ },
1041
+ pty: {
1042
+ list: (input, requestOptions) => request({
1043
+ method: "GET",
1044
+ path: `/api/pty`,
1045
+ query: { location: input?.["location"] },
1046
+ successStatus: 200,
1047
+ declaredStatuses: [400, 401, 404],
1048
+ empty: false
1049
+ }, requestOptions),
1050
+ create: (input, requestOptions) => request({
1051
+ method: "POST",
1052
+ path: `/api/pty`,
1053
+ query: { location: input?.["location"] },
1054
+ body: {
1055
+ command: input?.["command"],
1056
+ args: input?.["args"],
1057
+ cwd: input?.["cwd"],
1058
+ title: input?.["title"],
1059
+ env: input?.["env"]
1060
+ },
1061
+ successStatus: 200,
1062
+ declaredStatuses: [400, 401, 404],
1063
+ empty: false
1064
+ }, requestOptions),
1065
+ get: (input, requestOptions) => request({
1066
+ method: "GET",
1067
+ path: `/api/pty/${encodeURIComponent(input.ptyID)}`,
1068
+ query: { location: input["location"] },
1069
+ successStatus: 200,
1070
+ declaredStatuses: [400, 401, 404],
1071
+ empty: false
1072
+ }, requestOptions),
1073
+ update: (input, requestOptions) => request({
1074
+ method: "PUT",
1075
+ path: `/api/pty/${encodeURIComponent(input.ptyID)}`,
1076
+ query: { location: input["location"] },
1077
+ body: { title: input["title"], size: input["size"] },
1078
+ successStatus: 200,
1079
+ declaredStatuses: [400, 401, 404],
1080
+ empty: false
1081
+ }, requestOptions),
1082
+ remove: (input, requestOptions) => request({
1083
+ method: "DELETE",
1084
+ path: `/api/pty/${encodeURIComponent(input.ptyID)}`,
1085
+ query: { location: input["location"] },
1086
+ successStatus: 204,
1087
+ declaredStatuses: [400, 401, 404],
1088
+ empty: true
1089
+ }, requestOptions),
1090
+ connect: {
1091
+ token: (input, requestOptions) => request({
1092
+ method: "POST",
1093
+ path: `/api/pty/${encodeURIComponent(input.ptyID)}/connect-token`,
1094
+ query: { location: input["location"] },
1095
+ headers: { "x-opencode-ticket": input["x-opencode-ticket"] },
1096
+ successStatus: 200,
1097
+ declaredStatuses: [400, 401, 403, 404],
1098
+ empty: false
1099
+ }, requestOptions)
1100
+ }
1101
+ },
1102
+ experimental: {
1103
+ persistentPty: {
1104
+ read: (input, requestOptions) => request({
1105
+ method: "GET",
1106
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/terminal/read`,
1107
+ query: { lines: input["lines"] },
1108
+ successStatus: 200,
1109
+ declaredStatuses: [400, 401, 503],
1110
+ empty: false
1111
+ }, requestOptions).then((value) => value.data),
1112
+ list: (input, requestOptions) => request({
1113
+ method: "GET",
1114
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/terminal`,
1115
+ successStatus: 200,
1116
+ declaredStatuses: [400, 401, 503],
1117
+ empty: false
1118
+ }, requestOptions).then((value) => value.data),
1119
+ create: (input, requestOptions) => request({
1120
+ method: "POST",
1121
+ path: `/api/experimental/session/${encodeURIComponent(input.sessionID)}/terminal`,
1122
+ body: {
1123
+ command: input["command"],
1124
+ args: input["args"],
1125
+ cwd: input["cwd"],
1126
+ title: input["title"],
1127
+ env: input["env"],
1128
+ size: input["size"]
1129
+ },
1130
+ successStatus: 200,
1131
+ declaredStatuses: [400, 401, 503],
1132
+ empty: false
1133
+ }, requestOptions).then((value) => value.data),
1134
+ shutdown: (requestOptions) => request({
1135
+ method: "POST",
1136
+ path: `/api/experimental/persistent-pty/shutdown`,
1137
+ successStatus: 204,
1138
+ declaredStatuses: [400, 401, 503],
1139
+ empty: true
1140
+ }, requestOptions),
1141
+ handoff: (requestOptions) => request({
1142
+ method: "POST",
1143
+ path: `/api/experimental/persistent-pty/handoff`,
1144
+ successStatus: 200,
1145
+ declaredStatuses: [400, 401, 503],
1146
+ empty: false
1147
+ }, requestOptions),
1148
+ get: (input, requestOptions) => request({
1149
+ method: "GET",
1150
+ path: `/api/experimental/persistent-pty/${encodeURIComponent(input.ptyID)}`,
1151
+ successStatus: 200,
1152
+ declaredStatuses: [400, 401, 404, 503],
1153
+ empty: false
1154
+ }, requestOptions).then((value) => value.data),
1155
+ update: (input, requestOptions) => request({
1156
+ method: "PUT",
1157
+ path: `/api/experimental/persistent-pty/${encodeURIComponent(input.ptyID)}`,
1158
+ body: { attachmentID: input["attachmentID"], size: input["size"] },
1159
+ successStatus: 200,
1160
+ declaredStatuses: [400, 401, 404, 503],
1161
+ empty: false
1162
+ }, requestOptions).then((value) => value.data),
1163
+ snapshot: (input, requestOptions) => request({
1164
+ method: "GET",
1165
+ path: `/api/experimental/persistent-pty/${encodeURIComponent(input.ptyID)}/snapshot`,
1166
+ successStatus: 200,
1167
+ declaredStatuses: [400, 401, 404, 503],
1168
+ empty: false
1169
+ }, requestOptions).then((value) => value.data),
1170
+ remove: (input, requestOptions) => request({
1171
+ method: "DELETE",
1172
+ path: `/api/experimental/persistent-pty/${encodeURIComponent(input.ptyID)}`,
1173
+ successStatus: 204,
1174
+ declaredStatuses: [400, 401, 404, 503],
1175
+ empty: true
1176
+ }, requestOptions),
1177
+ connectToken: (input, requestOptions) => request({
1178
+ method: "POST",
1179
+ path: `/api/experimental/persistent-pty/${encodeURIComponent(input.ptyID)}/connect-token`,
1180
+ headers: { "x-opencode-ticket": input["x-opencode-ticket"] },
1181
+ successStatus: 200,
1182
+ declaredStatuses: [400, 401, 403, 404, 503],
1183
+ empty: false
1184
+ }, requestOptions).then((value) => value.data)
1185
+ }
1186
+ },
1187
+ shell: {
1188
+ list: (input, requestOptions) => request({
1189
+ method: "GET",
1190
+ path: `/api/shell`,
1191
+ query: { location: input?.["location"] },
1192
+ successStatus: 200,
1193
+ declaredStatuses: [400, 401, 404],
1194
+ empty: false
1195
+ }, requestOptions),
1196
+ create: (input, requestOptions) => request({
1197
+ method: "POST",
1198
+ path: `/api/shell`,
1199
+ query: { location: input["location"] },
1200
+ body: {
1201
+ command: input["command"],
1202
+ cwd: input["cwd"],
1203
+ timeout: input["timeout"],
1204
+ metadata: input["metadata"]
1205
+ },
1206
+ successStatus: 200,
1207
+ declaredStatuses: [400, 401, 404],
1208
+ empty: false
1209
+ }, requestOptions),
1210
+ get: (input, requestOptions) => request({
1211
+ method: "GET",
1212
+ path: `/api/shell/${encodeURIComponent(input.id)}`,
1213
+ query: { location: input["location"] },
1214
+ successStatus: 200,
1215
+ declaredStatuses: [400, 401, 404],
1216
+ empty: false
1217
+ }, requestOptions),
1218
+ output: (input, requestOptions) => request({
1219
+ method: "GET",
1220
+ path: `/api/shell/${encodeURIComponent(input.id)}/output`,
1221
+ query: { location: input["location"], cursor: input["cursor"], limit: input["limit"] },
1222
+ successStatus: 200,
1223
+ declaredStatuses: [400, 401, 404],
1224
+ empty: false
1225
+ }, requestOptions),
1226
+ remove: (input, requestOptions) => request({
1227
+ method: "DELETE",
1228
+ path: `/api/shell/${encodeURIComponent(input.id)}`,
1229
+ query: { location: input["location"] },
1230
+ successStatus: 204,
1231
+ declaredStatuses: [400, 401, 404],
1232
+ empty: true
1233
+ }, requestOptions)
1234
+ },
1235
+ reference: {
1236
+ list: (input, requestOptions) => request({
1237
+ method: "GET",
1238
+ path: `/api/reference`,
1239
+ query: { location: input?.["location"] },
1240
+ successStatus: 200,
1241
+ declaredStatuses: [400, 401, 404],
1242
+ empty: false
1243
+ }, requestOptions)
1244
+ },
1245
+ worktree: {
1246
+ list: (input, requestOptions) => request({
1247
+ method: "GET",
1248
+ path: `/api/worktree`,
1249
+ query: { projectID: input["projectID"] },
1250
+ successStatus: 200,
1251
+ declaredStatuses: [400, 401, 404],
1252
+ empty: false
1253
+ }, requestOptions),
1254
+ create: (input, requestOptions) => request({
1255
+ method: "POST",
1256
+ path: `/api/worktree`,
1257
+ body: {
1258
+ projectID: input["projectID"],
1259
+ from: input["from"],
1260
+ branch: input["branch"],
1261
+ directory: input["directory"],
1262
+ name: input["name"]
1263
+ },
1264
+ successStatus: 200,
1265
+ declaredStatuses: [400, 401, 404],
1266
+ empty: false
1267
+ }, requestOptions),
1268
+ remove: (input, requestOptions) => request({
1269
+ method: "DELETE",
1270
+ path: `/api/worktree`,
1271
+ body: { projectID: input["projectID"], directory: input["directory"], force: input["force"] },
1272
+ successStatus: 204,
1273
+ declaredStatuses: [400, 401, 404],
1274
+ empty: true
1275
+ }, requestOptions),
1276
+ refresh: (input, requestOptions) => request({
1277
+ method: "POST",
1278
+ path: `/api/worktree/refresh`,
1279
+ body: { projectID: input["projectID"] },
1280
+ successStatus: 204,
1281
+ declaredStatuses: [400, 401, 404],
1282
+ empty: true
1283
+ }, requestOptions)
1284
+ },
1285
+ vcs: {
1286
+ init: (input, requestOptions) => request({
1287
+ method: "POST",
1288
+ path: `/api/vcs/init`,
1289
+ query: { location: input?.["location"], provider: input?.["provider"] },
1290
+ successStatus: 204,
1291
+ declaredStatuses: [400, 401, 404, 409, 501, 503],
1292
+ empty: true
1293
+ }, requestOptions),
1294
+ get: (input, requestOptions) => request({
1295
+ method: "GET",
1296
+ path: `/api/vcs`,
1297
+ query: { location: input?.["location"] },
1298
+ successStatus: 200,
1299
+ declaredStatuses: [400, 401, 404],
1300
+ empty: false
1301
+ }, requestOptions),
1302
+ base: (input, requestOptions) => request({
1303
+ method: "GET",
1304
+ path: `/api/vcs/base`,
1305
+ query: { location: input?.["location"] },
1306
+ successStatus: 200,
1307
+ declaredStatuses: [400, 401, 404, 503],
1308
+ empty: false
1309
+ }, requestOptions),
1310
+ status: (input, requestOptions) => request({
1311
+ method: "GET",
1312
+ path: `/api/vcs/status`,
1313
+ query: { location: input?.["location"] },
1314
+ successStatus: 200,
1315
+ declaredStatuses: [400, 401, 404],
1316
+ empty: false
1317
+ }, requestOptions),
1318
+ branch: {
1319
+ list: (input, requestOptions) => request({
1320
+ method: "GET",
1321
+ path: `/api/vcs/branch`,
1322
+ query: { location: input?.["location"], search: input?.["search"], limit: input?.["limit"] },
1323
+ successStatus: 200,
1324
+ declaredStatuses: [400, 401, 404],
1325
+ empty: false
1326
+ }, requestOptions)
1327
+ },
1328
+ diff: (input, requestOptions) => request({
1329
+ method: "GET",
1330
+ path: `/api/vcs/diff`,
1331
+ query: { location: input["location"], mode: input["mode"], base: input["base"], context: input["context"] },
1332
+ successStatus: 200,
1333
+ declaredStatuses: [400, 401, 404, 503],
1334
+ empty: false
1335
+ }, requestOptions)
1336
+ },
1337
+ debug: {
1338
+ location: {
1339
+ list: (requestOptions) => request({
1340
+ method: "GET",
1341
+ path: `/api/debug/location`,
1342
+ successStatus: 200,
1343
+ declaredStatuses: [400, 401],
1344
+ empty: false
1345
+ }, requestOptions),
1346
+ evict: (input, requestOptions) => request({
1347
+ method: "DELETE",
1348
+ path: `/api/debug/location`,
1349
+ query: { location: input?.["location"] },
1350
+ successStatus: 204,
1351
+ declaredStatuses: [400, 401],
1352
+ empty: true
1353
+ }, requestOptions)
1354
+ }
1355
+ },
1356
+ migration: {
1357
+ v1: {
1358
+ status: (requestOptions) => request({
1359
+ method: "GET",
1360
+ path: `/api/experimental/migration/v1`,
1361
+ successStatus: 200,
1362
+ declaredStatuses: [400, 401],
1363
+ empty: false
1364
+ }, requestOptions)
1365
+ }
1366
+ },
1367
+ websearch: {
1368
+ providers: (input, requestOptions) => request({
1369
+ method: "GET",
1370
+ path: `/api/websearch/provider`,
1371
+ query: { location: input?.["location"] },
1372
+ successStatus: 200,
1373
+ declaredStatuses: [400, 401, 404, 503],
1374
+ empty: false
1375
+ }, requestOptions),
1376
+ query: (input, requestOptions) => request({
1377
+ method: "POST",
1378
+ path: `/api/websearch`,
1379
+ query: { location: input["location"] },
1380
+ body: { query: input["query"], providerID: input["providerID"] },
1381
+ successStatus: 200,
1382
+ declaredStatuses: [400, 401, 404, 503],
1383
+ empty: false
1384
+ }, requestOptions)
1385
+ },
1386
+ config: {
1387
+ get: (input, requestOptions) => request({
1388
+ method: "GET",
1389
+ path: `/api/config`,
1390
+ query: { location: input?.["location"] },
1391
+ successStatus: 200,
1392
+ declaredStatuses: [400, 401, 404],
1393
+ empty: false
1394
+ }, requestOptions),
1395
+ shells: (requestOptions) => request({
1396
+ method: "GET",
1397
+ path: `/api/config/shell`,
1398
+ successStatus: 200,
1399
+ declaredStatuses: [400, 401, 404],
1400
+ empty: false
1401
+ }, requestOptions),
1402
+ update: (input, requestOptions) => request({
1403
+ method: "PATCH",
1404
+ path: `/api/experimental/config`,
1405
+ body: { shell: input["shell"] },
1406
+ successStatus: 204,
1407
+ declaredStatuses: [400, 401, 404],
1408
+ empty: true
1409
+ }, requestOptions)
1410
+ }
1411
+ };
1412
+ }
1413
+ function encodePath(value) {
1414
+ return value.split("/").map(encodeURIComponent).join("/");
1415
+ }
1416
+ function appendQuery(params, key, value) {
1417
+ if (value === undefined)
1418
+ return;
1419
+ if (value === null) {
1420
+ params.append(key, "null");
1421
+ return;
1422
+ }
1423
+ if (Array.isArray(value)) {
1424
+ for (const item of value)
1425
+ appendQuery(params, key, item);
1426
+ return;
1427
+ }
1428
+ if (typeof value === "object") {
1429
+ for (const [child, item] of Object.entries(value))
1430
+ appendQuery(params, `${key}[${child}]`, item);
1431
+ return;
1432
+ }
1433
+ params.append(key, String(value));
1434
+ }
1435
+ async function json(response) {
1436
+ if (!isContentType(response, "application/json") && !response.headers.get("content-type")?.includes("+json")) {
1437
+ try {
1438
+ await response.body?.cancel();
1439
+ } catch {}
1440
+ throw new ClientError3("UnsupportedContentType", { detail: response.headers.get("content-type") });
1441
+ }
1442
+ let text;
1443
+ try {
1444
+ text = await response.text();
1445
+ } catch (cause) {
1446
+ throw new ClientError3("Transport", { cause });
1447
+ }
1448
+ if (text === "")
1449
+ throw new ClientError3("MalformedResponse");
1450
+ try {
1451
+ return JSON.parse(text);
1452
+ } catch (cause) {
1453
+ throw new ClientError3("MalformedResponse", { cause });
1454
+ }
1455
+ }
1456
+ function declared(body) {
1457
+ const error = Object.assign(new Error(body.message ?? body.data?.message), body);
1458
+ if (body._tag)
1459
+ error.name = body._tag;
1460
+ return error;
1461
+ }
1462
+ function isContentType(response, expected) {
1463
+ return response.headers.get("content-type")?.split(";", 1)[0]?.trim().toLowerCase() === expected;
1464
+ }
1465
+
1466
+ export { make6, exports_client4 };