@opengeni/sdk 0.46.0 → 0.52.1
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/README.md +94 -2
- package/dist/artifact-client.d.ts +20 -2
- package/dist/artifacts.d.ts +4 -0
- package/dist/artifacts.js +11 -0
- package/dist/artifacts.js.map +1 -0
- package/dist/chunk-FHI4DFIG.js +128 -0
- package/dist/chunk-FHI4DFIG.js.map +1 -0
- package/dist/chunk-FRJFNDIR.js +218 -0
- package/dist/chunk-FRJFNDIR.js.map +1 -0
- package/dist/{chunk-QKV5OCLJ.js → chunk-ILQZR5N6.js} +1380 -595
- package/dist/chunk-ILQZR5N6.js.map +1 -0
- package/dist/chunk-MZWTWOX6.js +661 -0
- package/dist/chunk-MZWTWOX6.js.map +1 -0
- package/dist/chunk-VWE2QIVO.js +1162 -0
- package/dist/chunk-VWE2QIVO.js.map +1 -0
- package/dist/chunk-VYCTL62C.js +230 -0
- package/dist/chunk-VYCTL62C.js.map +1 -0
- package/dist/client.d.ts +176 -20
- package/dist/codex-realtime-controller.d.ts +6 -6
- package/dist/codex-realtime-lifecycle.d.ts +1 -1
- package/dist/codex-realtime-v3.d.ts +3 -3
- package/dist/codex-realtime.d.ts +1 -1
- package/dist/company-profile.d.ts +100 -0
- package/dist/core.d.ts +5 -5
- package/dist/core.js +9 -4
- package/dist/desktop.d.ts +1 -1
- package/dist/editable-artifact-resources.d.ts +96 -0
- package/dist/editable-artifacts/browser-session.d.ts +35 -0
- package/dist/editable-artifacts/controller.d.ts +60 -0
- package/dist/editable-artifacts/errors.d.ts +23 -0
- package/dist/editable-artifacts/http-live-transport.d.ts +46 -0
- package/dist/editable-artifacts/index.d.ts +19 -0
- package/dist/editable-artifacts/pool.d.ts +15 -0
- package/dist/editable-artifacts/session.d.ts +96 -0
- package/dist/editable-artifacts/storage.d.ts +72 -0
- package/dist/editable-artifacts/types.d.ts +416 -0
- package/dist/editable-artifacts/worker/browser-client.d.ts +80 -0
- package/dist/editable-artifacts/worker/browser-entry.d.ts +6 -0
- package/dist/editable-artifacts/worker/kernel-adapter.d.ts +45 -0
- package/dist/editable-artifacts/worker/rpc-protocol.d.ts +92 -0
- package/dist/editable-artifacts/worker/runtime.d.ts +66 -0
- package/dist/editable-artifacts/worker/wire-codec.d.ts +52 -0
- package/dist/editable-artifacts-worker.d.ts +8 -0
- package/dist/editable-artifacts-worker.js +1708 -0
- package/dist/editable-artifacts-worker.js.map +1 -0
- package/dist/editable-artifacts.d.ts +6 -0
- package/dist/editable-artifacts.js +5954 -0
- package/dist/editable-artifacts.js.map +1 -0
- package/dist/gateway-realtime-transport.d.ts +1 -1
- package/dist/index.d.ts +41 -35
- package/dist/index.js +104 -68
- package/dist/index.js.map +1 -1
- package/dist/interaction.d.ts +885 -0
- package/dist/interaction.js +55 -0
- package/dist/interaction.js.map +1 -0
- package/dist/memory-slack-client.d.ts +13 -0
- package/dist/memory-slack-delivery.d.ts +99 -0
- package/dist/memory-slack.d.ts +4 -0
- package/dist/memory-slack.js +44 -0
- package/dist/memory-slack.js.map +1 -0
- package/dist/proxy.d.ts +3 -3
- package/dist/realtime.d.ts +12 -12
- package/dist/retained-artifacts.d.ts +12 -0
- package/dist/stream.d.ts +16 -1
- package/dist/terminal.d.ts +1 -1
- package/dist/transcription.d.ts +2 -2
- package/dist/types.d.ts +1203 -23
- package/dist/workspace-control-stream.d.ts +2 -2
- package/dist/workspace-state.d.ts +1 -1
- package/package.json +29 -3
- package/src/artifact-client.ts +129 -0
- package/src/artifacts.ts +17 -0
- package/src/client.ts +1801 -206
- package/src/company-profile.ts +92 -0
- package/src/editable-artifact-resources.ts +119 -0
- package/src/editable-artifacts/browser-session.ts +176 -0
- package/src/editable-artifacts/controller.ts +2632 -0
- package/src/editable-artifacts/errors.ts +52 -0
- package/src/editable-artifacts/http-live-transport.ts +1449 -0
- package/src/editable-artifacts/index.ts +175 -0
- package/src/editable-artifacts/pool.ts +81 -0
- package/src/editable-artifacts/session.ts +778 -0
- package/src/editable-artifacts/storage.ts +1718 -0
- package/src/editable-artifacts/types.ts +499 -0
- package/src/editable-artifacts/worker/browser-client.ts +1167 -0
- package/src/editable-artifacts/worker/browser-entry.ts +57 -0
- package/src/editable-artifacts/worker/kernel-adapter.ts +1039 -0
- package/src/editable-artifacts/worker/rpc-protocol.ts +622 -0
- package/src/editable-artifacts/worker/runtime.ts +1204 -0
- package/src/editable-artifacts/worker/wire-codec.ts +852 -0
- package/src/editable-artifacts-worker.ts +8 -0
- package/src/editable-artifacts.ts +6 -0
- package/src/index.ts +194 -0
- package/src/interaction.ts +1830 -0
- package/src/memory-slack-client.ts +71 -0
- package/src/memory-slack-delivery.ts +128 -0
- package/src/memory-slack.ts +19 -0
- package/src/retained-artifacts.ts +326 -0
- package/src/stream.ts +102 -4
- package/src/transcription.ts +2 -2
- package/src/types.ts +1430 -33
- package/src/workspace-control-stream.ts +15 -5
- package/dist/chunk-QKV5OCLJ.js.map +0 -1
|
@@ -6,6 +6,17 @@ import {
|
|
|
6
6
|
isAbortError,
|
|
7
7
|
isRetryableStreamError
|
|
8
8
|
} from "./chunk-V5F253OG.js";
|
|
9
|
+
import {
|
|
10
|
+
OpenGeniInteractionClient
|
|
11
|
+
} from "./chunk-MZWTWOX6.js";
|
|
12
|
+
import {
|
|
13
|
+
COMPUTER_SCREENSHOT_MAX_BYTES,
|
|
14
|
+
GENERATED_VIDEO_MAX_BYTES,
|
|
15
|
+
OPENGENI_API_CONTRACT_HEADER,
|
|
16
|
+
OPENGENI_API_CONTRACT_REVISION,
|
|
17
|
+
OPENGENI_CORRELATION_HEADER,
|
|
18
|
+
RETAINED_OUTPUT_MAX_PAGE_BYTES
|
|
19
|
+
} from "./chunk-FRJFNDIR.js";
|
|
9
20
|
|
|
10
21
|
// src/sse.ts
|
|
11
22
|
async function* parseSseStream(stream) {
|
|
@@ -82,6 +93,9 @@ async function* streamSessionEvents(transport, options = {}) {
|
|
|
82
93
|
const reconnect = options.reconnect ?? true;
|
|
83
94
|
const baseDelayMs = options.reconnectDelayMs ?? 500;
|
|
84
95
|
const maxDelayMs = options.maxReconnectDelayMs ?? 1e4;
|
|
96
|
+
const jitterRatio = options.reconnectJitterRatio ?? 0.2;
|
|
97
|
+
const beforeLiveTimeoutMs = options.beforeLiveTimeoutMs ?? 15e3;
|
|
98
|
+
const heartbeatTimeoutMs = options.heartbeatTimeoutMs ?? 45e3;
|
|
85
99
|
const maxAttempts = options.maxReconnectAttempts ?? Number.POSITIVE_INFINITY;
|
|
86
100
|
let cursor = options.after ?? 0;
|
|
87
101
|
let failedAttempts = 0;
|
|
@@ -96,9 +110,15 @@ async function* streamSessionEvents(transport, options = {}) {
|
|
|
96
110
|
everConnected = true;
|
|
97
111
|
failedAttempts = 0;
|
|
98
112
|
delayMs = baseDelayMs;
|
|
99
|
-
|
|
113
|
+
try {
|
|
114
|
+
options.onOpen?.();
|
|
115
|
+
} catch {
|
|
116
|
+
}
|
|
117
|
+
await runBeforeLive(options.beforeLive, beforeLiveTimeoutMs, signal);
|
|
100
118
|
options.onStateChange?.("live");
|
|
101
|
-
for await (const message of parseSseStream(
|
|
119
|
+
for await (const message of parseSseStream(
|
|
120
|
+
withStreamInactivityTimeout(body, heartbeatTimeoutMs, signal)
|
|
121
|
+
)) {
|
|
102
122
|
if (signal?.aborted) {
|
|
103
123
|
return;
|
|
104
124
|
}
|
|
@@ -122,7 +142,7 @@ async function* streamSessionEvents(transport, options = {}) {
|
|
|
122
142
|
return;
|
|
123
143
|
}
|
|
124
144
|
if (cursor === cursorAtOpen) {
|
|
125
|
-
await sleep(baseDelayMs, signal);
|
|
145
|
+
await sleep(jitteredDelay(baseDelayMs, jitterRatio), signal);
|
|
126
146
|
}
|
|
127
147
|
continue;
|
|
128
148
|
} catch (error) {
|
|
@@ -139,10 +159,76 @@ async function* streamSessionEvents(transport, options = {}) {
|
|
|
139
159
|
);
|
|
140
160
|
}
|
|
141
161
|
}
|
|
142
|
-
await sleep(delayMs, signal);
|
|
162
|
+
await sleep(jitteredDelay(delayMs, jitterRatio), signal);
|
|
143
163
|
delayMs = Math.min(Math.max(delayMs * 2, baseDelayMs), maxDelayMs);
|
|
144
164
|
}
|
|
145
165
|
}
|
|
166
|
+
async function runBeforeLive(beforeLive, timeoutMs, signal) {
|
|
167
|
+
if (!beforeLive) return;
|
|
168
|
+
let timer;
|
|
169
|
+
let abortListener;
|
|
170
|
+
const timeout = new Promise((_resolve, reject) => {
|
|
171
|
+
timer = setTimeout(
|
|
172
|
+
() => reject(new TypeError(`stream reconciliation timed out after ${timeoutMs}ms`)),
|
|
173
|
+
timeoutMs
|
|
174
|
+
);
|
|
175
|
+
if (signal) {
|
|
176
|
+
abortListener = () => reject(new DOMException("Aborted", "AbortError"));
|
|
177
|
+
signal.addEventListener("abort", abortListener, { once: true });
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
try {
|
|
181
|
+
await Promise.race([Promise.resolve().then(beforeLive), timeout]);
|
|
182
|
+
} finally {
|
|
183
|
+
if (timer !== void 0) clearTimeout(timer);
|
|
184
|
+
if (signal && abortListener) signal.removeEventListener("abort", abortListener);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
function jitteredDelay(delayMs, ratio) {
|
|
188
|
+
if (delayMs <= 0 || ratio <= 0) return delayMs;
|
|
189
|
+
const boundedRatio = Math.min(ratio, 1);
|
|
190
|
+
const spread = delayMs * boundedRatio;
|
|
191
|
+
return Math.max(0, delayMs - spread + Math.random() * spread * 2);
|
|
192
|
+
}
|
|
193
|
+
function withStreamInactivityTimeout(stream, timeoutMs, signal) {
|
|
194
|
+
if (!Number.isSafeInteger(timeoutMs) || timeoutMs <= 0) {
|
|
195
|
+
throw new RangeError("stream heartbeat timeout must be a positive safe integer");
|
|
196
|
+
}
|
|
197
|
+
const reader = stream.getReader();
|
|
198
|
+
return new ReadableStream({
|
|
199
|
+
pull: async (controller) => {
|
|
200
|
+
let timer;
|
|
201
|
+
let abortListener;
|
|
202
|
+
try {
|
|
203
|
+
const result = await Promise.race([
|
|
204
|
+
reader.read(),
|
|
205
|
+
new Promise((_resolve, reject) => {
|
|
206
|
+
timer = setTimeout(
|
|
207
|
+
() => reject(new TypeError(`event stream heartbeat timed out after ${timeoutMs}ms`)),
|
|
208
|
+
timeoutMs
|
|
209
|
+
);
|
|
210
|
+
if (signal) {
|
|
211
|
+
abortListener = () => reject(new DOMException("Aborted", "AbortError"));
|
|
212
|
+
signal.addEventListener("abort", abortListener, { once: true });
|
|
213
|
+
}
|
|
214
|
+
})
|
|
215
|
+
]);
|
|
216
|
+
if (result.done) controller.close();
|
|
217
|
+
else controller.enqueue(result.value);
|
|
218
|
+
} catch (error) {
|
|
219
|
+
void reader.cancel(error).catch(() => {
|
|
220
|
+
});
|
|
221
|
+
controller.error(error);
|
|
222
|
+
} finally {
|
|
223
|
+
if (timer !== void 0) clearTimeout(timer);
|
|
224
|
+
if (signal && abortListener) signal.removeEventListener("abort", abortListener);
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
cancel: async (reason) => {
|
|
228
|
+
await reader.cancel(reason);
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
}
|
|
146
232
|
async function* backfillEvents(transport, fromExclusive, toInclusive) {
|
|
147
233
|
let cursor = fromExclusive;
|
|
148
234
|
while (cursor < toInclusive) {
|
|
@@ -197,6 +283,9 @@ async function* streamWorkspaceControlEvents(transport, options = {}) {
|
|
|
197
283
|
const reconnect = options.reconnect ?? true;
|
|
198
284
|
const baseDelayMs = options.reconnectDelayMs ?? 500;
|
|
199
285
|
const maxDelayMs = options.maxReconnectDelayMs ?? 1e4;
|
|
286
|
+
const jitterRatio = options.reconnectJitterRatio ?? 0.2;
|
|
287
|
+
const beforeLiveTimeoutMs = options.beforeLiveTimeoutMs ?? 15e3;
|
|
288
|
+
const heartbeatTimeoutMs = options.heartbeatTimeoutMs ?? 45e3;
|
|
200
289
|
const maxAttempts = options.maxReconnectAttempts ?? Number.POSITIVE_INFINITY;
|
|
201
290
|
let cursor = options.after ?? 0;
|
|
202
291
|
let failures = 0;
|
|
@@ -211,9 +300,11 @@ async function* streamWorkspaceControlEvents(transport, options = {}) {
|
|
|
211
300
|
everConnected = true;
|
|
212
301
|
failures = 0;
|
|
213
302
|
delayMs = baseDelayMs;
|
|
214
|
-
await options.beforeLive
|
|
303
|
+
await runBeforeLive(options.beforeLive, beforeLiveTimeoutMs, signal);
|
|
215
304
|
options.onStateChange?.("live");
|
|
216
|
-
for await (const message of parseSseStream(
|
|
305
|
+
for await (const message of parseSseStream(
|
|
306
|
+
withStreamInactivityTimeout(body, heartbeatTimeoutMs, signal)
|
|
307
|
+
)) {
|
|
217
308
|
if (signal?.aborted) return;
|
|
218
309
|
const event = parseWorkspaceControlEvent(message.data);
|
|
219
310
|
if (!event || event.sequence <= cursor) continue;
|
|
@@ -221,7 +312,7 @@ async function* streamWorkspaceControlEvents(transport, options = {}) {
|
|
|
221
312
|
yield event;
|
|
222
313
|
}
|
|
223
314
|
if (!reconnect) return;
|
|
224
|
-
if (cursor === cursorAtOpen) await sleep2(baseDelayMs, signal);
|
|
315
|
+
if (cursor === cursorAtOpen) await sleep2(jitteredDelay(baseDelayMs, jitterRatio), signal);
|
|
225
316
|
continue;
|
|
226
317
|
} catch (error) {
|
|
227
318
|
if (signal?.aborted || isAbortError(error)) return;
|
|
@@ -233,7 +324,7 @@ async function* streamWorkspaceControlEvents(transport, options = {}) {
|
|
|
233
324
|
);
|
|
234
325
|
}
|
|
235
326
|
}
|
|
236
|
-
await sleep2(delayMs, signal);
|
|
327
|
+
await sleep2(jitteredDelay(delayMs, jitterRatio), signal);
|
|
237
328
|
delayMs = Math.min(Math.max(delayMs * 2, baseDelayMs), maxDelayMs);
|
|
238
329
|
}
|
|
239
330
|
}
|
|
@@ -262,196 +353,177 @@ async function sleep2(delayMs, signal) {
|
|
|
262
353
|
});
|
|
263
354
|
}
|
|
264
355
|
|
|
265
|
-
// src/
|
|
266
|
-
var
|
|
267
|
-
var
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
"
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
"
|
|
287
|
-
|
|
288
|
-
"
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
"
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
"
|
|
299
|
-
"
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
"
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
"
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
"
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
"
|
|
328
|
-
|
|
329
|
-
"
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
"
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
"
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
"
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
"
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
"
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
"
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
"
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
"
|
|
387
|
-
"
|
|
388
|
-
"
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
"
|
|
392
|
-
"
|
|
393
|
-
"
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
"
|
|
401
|
-
"
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
"
|
|
409
|
-
"
|
|
410
|
-
"
|
|
411
|
-
"
|
|
412
|
-
"
|
|
413
|
-
"
|
|
414
|
-
"
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
"
|
|
418
|
-
"
|
|
419
|
-
"
|
|
420
|
-
"
|
|
421
|
-
"
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
"
|
|
425
|
-
"
|
|
426
|
-
"
|
|
427
|
-
"
|
|
428
|
-
"
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
"
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
var OPENGENI_API_CONTRACT_REVISION = "2026-07-workspace-artifacts-v1";
|
|
437
|
-
var OPENGENI_API_CONTRACT_HEADER = "x-opengeni-api-contract";
|
|
438
|
-
var OPENGENI_CORRELATION_HEADER = "x-opengeni-correlation-id";
|
|
439
|
-
var RETAINED_OUTPUT_DEFAULT_PAGE_BYTES = 256 * 1024;
|
|
440
|
-
var RETAINED_OUTPUT_MAX_PAGE_BYTES = 1024 * 1024;
|
|
441
|
-
var KNOWN_USAGE_EVENT_TYPES = [
|
|
442
|
-
"agent_run.created",
|
|
443
|
-
"agent_run.completed",
|
|
444
|
-
"model.tokens",
|
|
445
|
-
"model.cost",
|
|
446
|
-
"file.uploaded",
|
|
447
|
-
"file.deleted",
|
|
448
|
-
"document.indexed",
|
|
449
|
-
"scheduled_task.fired",
|
|
450
|
-
"api_key.request",
|
|
451
|
-
// sandbox warm-time metering (P2.1) — mirrors contracts UsageEventType.
|
|
452
|
-
"sandbox.warm_seconds",
|
|
453
|
-
"sandbox.warm_cost"
|
|
454
|
-
];
|
|
356
|
+
// src/retained-artifacts.ts
|
|
357
|
+
var UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
|
|
358
|
+
var SHA256 = /^[0-9a-f]{64}$/;
|
|
359
|
+
var ISO_DATETIME_WITH_OFFSET = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/;
|
|
360
|
+
var WORKSPACE_PATH = /^\/v1\/workspaces\/([0-9a-f-]+)\/artifacts\/([0-9a-f-]+)\/content$/;
|
|
361
|
+
var MAX_BYTES = 64 * 1024 * 1024;
|
|
362
|
+
var MAX_VIDEO_BYTES = 512 * 1024 * 1024;
|
|
363
|
+
var MAX_DIMENSION = 16384;
|
|
364
|
+
var MAX_PIXELS = 67108864;
|
|
365
|
+
var MAX_RANGE_BYTES = 1024 * 1024;
|
|
366
|
+
function parseRetainedGeneratedImageReference(value, expectedWorkspaceId) {
|
|
367
|
+
if (!recordWithKeys(value, GENERATED_IMAGE_REFERENCE_KEYS)) return null;
|
|
368
|
+
const artifact = value;
|
|
369
|
+
if (artifact.available !== true || artifact.kind !== "generated_image" || typeof artifact.artifactId !== "string" || !UUID.test(artifact.artifactId) || !["image/png", "image/jpeg", "image/webp"].includes(String(artifact.contentType)) || !safeIntegerBetween(artifact.originalBytes, 1, MAX_BYTES) || typeof artifact.sha256 !== "string" || !SHA256.test(artifact.sha256) || typeof artifact.retainedAt !== "string" || artifact.retainedAt.length > 64 || !ISO_DATETIME_WITH_OFFSET.test(artifact.retainedAt) || !Number.isFinite(Date.parse(artifact.retainedAt)) || !recordWithKeys(artifact.dimensions, DIMENSION_KEYS) || !recordWithKeys(artifact.retention, RETENTION_KEYS) || !recordWithKeys(artifact.retrieval, RETRIEVAL_KEYS)) {
|
|
370
|
+
return null;
|
|
371
|
+
}
|
|
372
|
+
const dimensions = artifact.dimensions;
|
|
373
|
+
if (!safeIntegerBetween(dimensions.width, 1, MAX_DIMENSION) || !safeIntegerBetween(dimensions.height, 1, MAX_DIMENSION) || Number(dimensions.width) * Number(dimensions.height) > MAX_PIXELS) {
|
|
374
|
+
return null;
|
|
375
|
+
}
|
|
376
|
+
const retention = artifact.retention;
|
|
377
|
+
if (retention.policy !== "workspace_file" || retention.expiresAt !== null) return null;
|
|
378
|
+
const retrieval = artifact.retrieval;
|
|
379
|
+
if (retrieval.method !== "GET" || retrieval.acceptRanges !== "bytes" || retrieval.maxRangeBytes !== MAX_RANGE_BYTES || typeof retrieval.path !== "string" || retrieval.path.length > 256) {
|
|
380
|
+
return null;
|
|
381
|
+
}
|
|
382
|
+
const match = WORKSPACE_PATH.exec(retrieval.path);
|
|
383
|
+
if (!match || !UUID.test(match[1] ?? "") || match[2] !== artifact.artifactId || expectedWorkspaceId !== void 0 && match[1] !== expectedWorkspaceId) {
|
|
384
|
+
return null;
|
|
385
|
+
}
|
|
386
|
+
return value;
|
|
387
|
+
}
|
|
388
|
+
function generatedImageSandboxPathMatches(artifact, sandboxPath) {
|
|
389
|
+
if (typeof sandboxPath !== "string") return false;
|
|
390
|
+
const extension = artifact.contentType === "image/png" ? "png" : artifact.contentType === "image/jpeg" ? "jpg" : artifact.contentType === "image/webp" ? "webp" : null;
|
|
391
|
+
return extension !== null && sandboxPath === `/workspace/generated-images/generated-image-${artifact.artifactId}.${extension}`;
|
|
392
|
+
}
|
|
393
|
+
function parseGeneratedImageReceipt(value, expectedWorkspaceId) {
|
|
394
|
+
if (typeof value === "string" && value.length <= 4096) {
|
|
395
|
+
try {
|
|
396
|
+
return parseGeneratedImageReceipt(JSON.parse(value), expectedWorkspaceId);
|
|
397
|
+
} catch {
|
|
398
|
+
return null;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
if (!recordWithKeys(value, GENERATED_IMAGE_RECEIPT_KEYS)) return null;
|
|
402
|
+
if (value.type !== "generated_image") return null;
|
|
403
|
+
const artifact = parseRetainedGeneratedImageReference(value.artifact, expectedWorkspaceId);
|
|
404
|
+
if (!artifact || !generatedImageSandboxPathMatches(artifact, value.sandboxPath)) return null;
|
|
405
|
+
return { type: "generated_image", artifact, sandboxPath: value.sandboxPath };
|
|
406
|
+
}
|
|
407
|
+
function parseRetainedGeneratedVideoReference(value, expectedWorkspaceId) {
|
|
408
|
+
if (!recordWithKeys(value, GENERATED_IMAGE_REFERENCE_KEYS)) return null;
|
|
409
|
+
const artifact = value;
|
|
410
|
+
if (artifact.available !== true || artifact.kind !== "generated_video" || typeof artifact.artifactId !== "string" || !UUID.test(artifact.artifactId) || artifact.contentType !== "video/mp4" || !safeIntegerBetween(artifact.originalBytes, 1, MAX_VIDEO_BYTES) || typeof artifact.sha256 !== "string" || !SHA256.test(artifact.sha256) || typeof artifact.retainedAt !== "string" || artifact.retainedAt.length > 64 || !ISO_DATETIME_WITH_OFFSET.test(artifact.retainedAt) || !Number.isFinite(Date.parse(artifact.retainedAt)) || !recordWithKeys(artifact.dimensions, DIMENSION_KEYS) || !recordWithKeys(artifact.retention, RETENTION_KEYS) || !recordWithKeys(artifact.retrieval, RETRIEVAL_KEYS)) {
|
|
411
|
+
return null;
|
|
412
|
+
}
|
|
413
|
+
const dimensions = artifact.dimensions;
|
|
414
|
+
if (!safeIntegerBetween(dimensions.width, 1, 8192) || !safeIntegerBetween(dimensions.height, 1, 8192)) {
|
|
415
|
+
return null;
|
|
416
|
+
}
|
|
417
|
+
const retention = artifact.retention;
|
|
418
|
+
if (retention.policy !== "workspace_file" || retention.expiresAt !== null) return null;
|
|
419
|
+
const retrieval = artifact.retrieval;
|
|
420
|
+
if (retrieval.method !== "GET" || retrieval.acceptRanges !== "bytes" || retrieval.maxRangeBytes !== MAX_RANGE_BYTES || typeof retrieval.path !== "string" || retrieval.path.length > 256) {
|
|
421
|
+
return null;
|
|
422
|
+
}
|
|
423
|
+
const match = WORKSPACE_PATH.exec(retrieval.path);
|
|
424
|
+
if (!match || !UUID.test(match[1] ?? "") || match[2] !== artifact.artifactId || expectedWorkspaceId !== void 0 && match[1] !== expectedWorkspaceId) {
|
|
425
|
+
return null;
|
|
426
|
+
}
|
|
427
|
+
return value;
|
|
428
|
+
}
|
|
429
|
+
function parseGeneratedVideoReceipt(value, expectedWorkspaceId) {
|
|
430
|
+
if (typeof value === "string" && value.length <= 8192) {
|
|
431
|
+
try {
|
|
432
|
+
return parseGeneratedVideoReceipt(JSON.parse(value), expectedWorkspaceId);
|
|
433
|
+
} catch {
|
|
434
|
+
return null;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
if (!recordWithKeys(value, GENERATED_VIDEO_RECEIPT_KEYS)) return null;
|
|
438
|
+
if (value.type !== "generated_video" || value.schemaVersion !== 1 || typeof value.operationId !== "string" || !UUID.test(value.operationId) || !recordWithKeys(value.video, GENERATED_VIDEO_FACT_KEYS)) {
|
|
439
|
+
return null;
|
|
440
|
+
}
|
|
441
|
+
const artifact = parseRetainedGeneratedVideoReference(value.artifact, expectedWorkspaceId);
|
|
442
|
+
const video = value.video;
|
|
443
|
+
if (!artifact || typeof value.sandboxPath !== "string" || value.sandboxPath !== `/workspace/generated-videos/generated-video-${artifact.artifactId}.mp4` || typeof video.durationSeconds !== "number" || !Number.isFinite(video.durationSeconds) || video.durationSeconds <= 0 || video.durationSeconds > 120 || video.width !== artifact.dimensions?.width || video.height !== artifact.dimensions?.height || typeof video.fps !== "number" || !Number.isFinite(video.fps) || video.fps <= 0 || video.fps > 120 || typeof video.hasAudio !== "boolean" || video.videoCodec !== "h264" || video.audioCodec !== null && video.audioCodec !== "aac") {
|
|
444
|
+
return null;
|
|
445
|
+
}
|
|
446
|
+
return value;
|
|
447
|
+
}
|
|
448
|
+
function parseMediaGenerationResult(value, expectedWorkspaceId) {
|
|
449
|
+
if (typeof value === "string" && value.length <= 12e3) {
|
|
450
|
+
try {
|
|
451
|
+
return parseMediaGenerationResult(JSON.parse(value), expectedWorkspaceId);
|
|
452
|
+
} catch {
|
|
453
|
+
return null;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
|
|
457
|
+
const result = value;
|
|
458
|
+
if (result.type !== "media_generation_result" || result.schemaVersion !== 1 || typeof result.operationId !== "string" || !UUID.test(result.operationId)) {
|
|
459
|
+
return null;
|
|
460
|
+
}
|
|
461
|
+
if (result.status === "ready") {
|
|
462
|
+
if (!recordWithKeys(result, MEDIA_RESULT_READY_KEYS)) return null;
|
|
463
|
+
const receipt = parseGeneratedVideoReceipt(result.receipt, expectedWorkspaceId);
|
|
464
|
+
if (!receipt || receipt.operationId !== result.operationId) return null;
|
|
465
|
+
return value;
|
|
466
|
+
}
|
|
467
|
+
if (!["provider_failed", "retention_failed", "cancelled_before_submit", "outcome_unknown"].includes(
|
|
468
|
+
String(result.status)
|
|
469
|
+
) || !recordWithKeys(result, MEDIA_RESULT_FAILURE_KEYS) || typeof result.boundedPublicReason !== "string" || result.boundedPublicReason.length < 1 || result.boundedPublicReason.length > 1e3) {
|
|
470
|
+
return null;
|
|
471
|
+
}
|
|
472
|
+
return value;
|
|
473
|
+
}
|
|
474
|
+
var GENERATED_IMAGE_REFERENCE_KEYS = /* @__PURE__ */ new Set([
|
|
475
|
+
"available",
|
|
476
|
+
"artifactId",
|
|
477
|
+
"kind",
|
|
478
|
+
"contentType",
|
|
479
|
+
"originalBytes",
|
|
480
|
+
"sha256",
|
|
481
|
+
"retainedAt",
|
|
482
|
+
"dimensions",
|
|
483
|
+
"retention",
|
|
484
|
+
"retrieval"
|
|
485
|
+
]);
|
|
486
|
+
var DIMENSION_KEYS = /* @__PURE__ */ new Set(["width", "height"]);
|
|
487
|
+
var RETENTION_KEYS = /* @__PURE__ */ new Set(["policy", "expiresAt"]);
|
|
488
|
+
var RETRIEVAL_KEYS = /* @__PURE__ */ new Set(["method", "path", "acceptRanges", "maxRangeBytes"]);
|
|
489
|
+
var GENERATED_IMAGE_RECEIPT_KEYS = /* @__PURE__ */ new Set(["type", "artifact", "sandboxPath"]);
|
|
490
|
+
var GENERATED_VIDEO_RECEIPT_KEYS = /* @__PURE__ */ new Set([
|
|
491
|
+
"type",
|
|
492
|
+
"schemaVersion",
|
|
493
|
+
"operationId",
|
|
494
|
+
"artifact",
|
|
495
|
+
"video",
|
|
496
|
+
"sandboxPath"
|
|
497
|
+
]);
|
|
498
|
+
var GENERATED_VIDEO_FACT_KEYS = /* @__PURE__ */ new Set([
|
|
499
|
+
"durationSeconds",
|
|
500
|
+
"width",
|
|
501
|
+
"height",
|
|
502
|
+
"fps",
|
|
503
|
+
"hasAudio",
|
|
504
|
+
"videoCodec",
|
|
505
|
+
"audioCodec"
|
|
506
|
+
]);
|
|
507
|
+
var MEDIA_RESULT_READY_KEYS = /* @__PURE__ */ new Set([
|
|
508
|
+
"type",
|
|
509
|
+
"schemaVersion",
|
|
510
|
+
"status",
|
|
511
|
+
"operationId",
|
|
512
|
+
"receipt"
|
|
513
|
+
]);
|
|
514
|
+
var MEDIA_RESULT_FAILURE_KEYS = /* @__PURE__ */ new Set([
|
|
515
|
+
"type",
|
|
516
|
+
"schemaVersion",
|
|
517
|
+
"status",
|
|
518
|
+
"operationId",
|
|
519
|
+
"boundedPublicReason"
|
|
520
|
+
]);
|
|
521
|
+
function recordWithKeys(value, allowed) {
|
|
522
|
+
return value !== null && typeof value === "object" && !Array.isArray(value) && Object.keys(value).length === allowed.size && Object.keys(value).every((key) => allowed.has(key));
|
|
523
|
+
}
|
|
524
|
+
function safeIntegerBetween(value, min, max) {
|
|
525
|
+
return Number.isSafeInteger(value) && Number(value) >= min && Number(value) <= max;
|
|
526
|
+
}
|
|
455
527
|
|
|
456
528
|
// src/client.ts
|
|
457
529
|
function sessionListQuery(options) {
|
|
@@ -465,10 +537,15 @@ var OpenGeniClient = class {
|
|
|
465
537
|
baseUrl;
|
|
466
538
|
options;
|
|
467
539
|
fetchImpl;
|
|
540
|
+
readInFlight = /* @__PURE__ */ new Map();
|
|
541
|
+
readTrailing = /* @__PURE__ */ new Map();
|
|
542
|
+
/** Resource-oriented Browser/Computer facade over this exact authenticated client. */
|
|
543
|
+
interaction;
|
|
468
544
|
constructor(options) {
|
|
469
545
|
this.baseUrl = options.baseUrl.replace(/\/+$/, "");
|
|
470
546
|
this.options = options;
|
|
471
547
|
this.fetchImpl = options.fetch ?? ((input, init) => fetch(input, init));
|
|
548
|
+
this.interaction = new OpenGeniInteractionClient(this);
|
|
472
549
|
}
|
|
473
550
|
// --- Session lifecycle ---------------------------------------------------
|
|
474
551
|
/** Make one finalization attempt for a recording; callers may retry retained audio. */
|
|
@@ -476,7 +553,11 @@ var OpenGeniClient = class {
|
|
|
476
553
|
const correlationId = crypto.randomUUID();
|
|
477
554
|
const form = new FormData();
|
|
478
555
|
const filename = filenameForAudioMimeType(input.mimeType);
|
|
479
|
-
const audio = input.audio instanceof File ? input.audio : input.audio instanceof Uint8Array ? new File([Uint8Array.from(input.audio)], filename, {
|
|
556
|
+
const audio = input.audio instanceof File ? input.audio : input.audio instanceof Uint8Array ? new File([Uint8Array.from(input.audio)], filename, {
|
|
557
|
+
type: input.mimeType
|
|
558
|
+
}) : new File([input.audio], filename, {
|
|
559
|
+
type: input.mimeType || input.audio.type
|
|
560
|
+
});
|
|
480
561
|
form.append("audio", audio, filename);
|
|
481
562
|
form.append("mimeType", input.mimeType);
|
|
482
563
|
if (input.durationSeconds !== void 0) {
|
|
@@ -486,7 +567,10 @@ var OpenGeniClient = class {
|
|
|
486
567
|
try {
|
|
487
568
|
response = await this.fetchImpl(this.url(`/v1/workspaces/${workspaceId}/transcriptions`), {
|
|
488
569
|
method: "POST",
|
|
489
|
-
headers: {
|
|
570
|
+
headers: {
|
|
571
|
+
...this.headers(correlationId),
|
|
572
|
+
Accept: "application/json"
|
|
573
|
+
},
|
|
490
574
|
body: form,
|
|
491
575
|
...input.signal ? { signal: input.signal } : {}
|
|
492
576
|
});
|
|
@@ -495,7 +579,11 @@ var OpenGeniClient = class {
|
|
|
495
579
|
throw mutationTransportError(correlationId);
|
|
496
580
|
}
|
|
497
581
|
assertApiContractResponse(response);
|
|
498
|
-
if (!response.ok)
|
|
582
|
+
if (!response.ok)
|
|
583
|
+
throw await apiErrorFromResponse(response, {
|
|
584
|
+
method: "POST",
|
|
585
|
+
correlationId
|
|
586
|
+
});
|
|
499
587
|
await assertJsonResponse(response, { method: "POST", correlationId });
|
|
500
588
|
let body;
|
|
501
589
|
try {
|
|
@@ -580,7 +668,11 @@ var OpenGeniClient = class {
|
|
|
580
668
|
throw mutationTransportError(correlationId);
|
|
581
669
|
}
|
|
582
670
|
assertApiContractResponse(response);
|
|
583
|
-
if (!response.ok)
|
|
671
|
+
if (!response.ok)
|
|
672
|
+
throw await apiErrorFromResponse(response, {
|
|
673
|
+
method: "PUT",
|
|
674
|
+
correlationId
|
|
675
|
+
});
|
|
584
676
|
await assertJsonResponse(response, { method: "PUT", correlationId });
|
|
585
677
|
const body = await response.json().catch(() => null);
|
|
586
678
|
if (!isUploadTranscriptionRecordingChunkResponse(body)) {
|
|
@@ -649,11 +741,9 @@ var OpenGeniClient = class {
|
|
|
649
741
|
request
|
|
650
742
|
);
|
|
651
743
|
}
|
|
652
|
-
async getSession(workspaceId, sessionId) {
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
`/v1/workspaces/${workspaceId}/sessions/${sessionId}`
|
|
656
|
-
);
|
|
744
|
+
async getSession(workspaceId, sessionId, options = {}) {
|
|
745
|
+
const path = `/v1/workspaces/${workspaceId}/sessions/${sessionId}`;
|
|
746
|
+
return await this.singleFlightRead(path, () => this.requestJson("GET", path), options);
|
|
657
747
|
}
|
|
658
748
|
async updateSession(workspaceId, sessionId, request) {
|
|
659
749
|
return await this.requestJson(
|
|
@@ -737,6 +827,21 @@ var OpenGeniClient = class {
|
|
|
737
827
|
}
|
|
738
828
|
return response;
|
|
739
829
|
}
|
|
830
|
+
/** Compact, bounded workspace agent hierarchy page. */
|
|
831
|
+
async listAgentTopology(workspaceId, options = {}) {
|
|
832
|
+
const search = options.search?.trim();
|
|
833
|
+
return await this.requestJson(
|
|
834
|
+
"GET",
|
|
835
|
+
`/v1/workspaces/${workspaceId}/agent-topology`,
|
|
836
|
+
void 0,
|
|
837
|
+
{
|
|
838
|
+
...options.limit !== void 0 ? { limit: String(options.limit) } : {},
|
|
839
|
+
...options.parentSessionId === void 0 ? {} : { parentSessionId: options.parentSessionId ?? "null" },
|
|
840
|
+
...options.cursor ? { cursor: options.cursor } : {},
|
|
841
|
+
...search ? { search } : {}
|
|
842
|
+
}
|
|
843
|
+
);
|
|
844
|
+
}
|
|
740
845
|
/** Set this authenticated member's personal workspace pin for a session. */
|
|
741
846
|
async updateSessionPin(workspaceId, sessionId, request) {
|
|
742
847
|
return await this.requestJson(
|
|
@@ -746,10 +851,34 @@ var OpenGeniClient = class {
|
|
|
746
851
|
);
|
|
747
852
|
}
|
|
748
853
|
async getSessionLineage(workspaceId, sessionId) {
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
854
|
+
const path = `/v1/workspaces/${workspaceId}/sessions/${sessionId}/lineage`;
|
|
855
|
+
return await this.singleFlightRead(
|
|
856
|
+
path,
|
|
857
|
+
() => this.requestJson("GET", path)
|
|
858
|
+
);
|
|
859
|
+
}
|
|
860
|
+
singleFlightRead(key, read, options = {}) {
|
|
861
|
+
const existing = this.readInFlight.get(key);
|
|
862
|
+
if (existing) {
|
|
863
|
+
if (!options.fresh) return existing;
|
|
864
|
+
const queued = this.readTrailing.get(key);
|
|
865
|
+
if (queued) return queued;
|
|
866
|
+
const trailing = existing.then(
|
|
867
|
+
() => this.singleFlightRead(key, read),
|
|
868
|
+
() => this.singleFlightRead(key, read)
|
|
869
|
+
);
|
|
870
|
+
this.readTrailing.set(key, trailing);
|
|
871
|
+
const clear = () => {
|
|
872
|
+
if (this.readTrailing.get(key) === trailing) this.readTrailing.delete(key);
|
|
873
|
+
};
|
|
874
|
+
void trailing.then(clear, clear);
|
|
875
|
+
return trailing;
|
|
876
|
+
}
|
|
877
|
+
const promise = read().finally(() => {
|
|
878
|
+
if (this.readInFlight.get(key) === promise) this.readInFlight.delete(key);
|
|
879
|
+
});
|
|
880
|
+
this.readInFlight.set(key, promise);
|
|
881
|
+
return promise;
|
|
753
882
|
}
|
|
754
883
|
/** Negotiate one server-mediated connected-Codex GPT-Live V3 WebRTC call. */
|
|
755
884
|
async negotiateCodexRealtimeWebrtc(workspaceId, sessionId, request, options = {}) {
|
|
@@ -826,7 +955,9 @@ var OpenGeniClient = class {
|
|
|
826
955
|
}
|
|
827
956
|
/** Newest turn that durably emitted `turn.started`, or null before any admission. */
|
|
828
957
|
async getLatestStartedTurn(workspaceId, sessionId) {
|
|
829
|
-
const turns = await this.listTurns(workspaceId, sessionId, {
|
|
958
|
+
const turns = await this.listTurns(workspaceId, sessionId, {
|
|
959
|
+
latestStarted: true
|
|
960
|
+
});
|
|
830
961
|
return turns[0] ?? null;
|
|
831
962
|
}
|
|
832
963
|
// --- Bring-your-own-compute: Machines dashboard + metrics (M10) ------------
|
|
@@ -860,6 +991,19 @@ var OpenGeniClient = class {
|
|
|
860
991
|
);
|
|
861
992
|
return response.samples;
|
|
862
993
|
}
|
|
994
|
+
/**
|
|
995
|
+
* Remove one connected self-hosted machine enrollment. The control-plane
|
|
996
|
+
* operation works while the agent is offline, revokes future reconnects,
|
|
997
|
+
* retains history, and returns a typed blocker when active route/lease or
|
|
998
|
+
* recovery dependencies make removal unsafe. `idempotencyKey` is replay-safe.
|
|
999
|
+
*/
|
|
1000
|
+
async removeEnrollment(workspaceId, enrollmentId, request = {}) {
|
|
1001
|
+
return await this.requestJson(
|
|
1002
|
+
"POST",
|
|
1003
|
+
`/v1/workspaces/${workspaceId}/enrollments/${enrollmentId}/revoke`,
|
|
1004
|
+
request
|
|
1005
|
+
);
|
|
1006
|
+
}
|
|
863
1007
|
// --- Self-hosted enrollment UX (design 11) --------------------------------
|
|
864
1008
|
/**
|
|
865
1009
|
* Resolve a pending device-enrollment flow by its user_code for the click-Grant
|
|
@@ -1144,9 +1288,10 @@ var OpenGeniClient = class {
|
|
|
1144
1288
|
}
|
|
1145
1289
|
// --- Turn queue ------------------------------------------------------------
|
|
1146
1290
|
async getQueue(workspaceId, sessionId) {
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1291
|
+
const path = `/v1/workspaces/${workspaceId}/sessions/${sessionId}/queue`;
|
|
1292
|
+
return await this.singleFlightRead(
|
|
1293
|
+
path,
|
|
1294
|
+
() => this.requestJson("GET", path)
|
|
1150
1295
|
);
|
|
1151
1296
|
}
|
|
1152
1297
|
async moveQueueItem(workspaceId, sessionId, turnId, request) {
|
|
@@ -1314,10 +1459,8 @@ var OpenGeniClient = class {
|
|
|
1314
1459
|
// --- Goals -------------------------------------------------------------------
|
|
1315
1460
|
/** The session's goal. 404s when the session never had one. */
|
|
1316
1461
|
async getGoal(workspaceId, sessionId) {
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
`/v1/workspaces/${workspaceId}/sessions/${sessionId}/goal`
|
|
1320
|
-
);
|
|
1462
|
+
const path = `/v1/workspaces/${workspaceId}/sessions/${sessionId}/goal`;
|
|
1463
|
+
return await this.singleFlightRead(path, () => this.requestJson("GET", path));
|
|
1321
1464
|
}
|
|
1322
1465
|
async updateGoal(workspaceId, sessionId, request) {
|
|
1323
1466
|
return await this.requestJson(
|
|
@@ -1377,6 +1520,16 @@ var OpenGeniClient = class {
|
|
|
1377
1520
|
options
|
|
1378
1521
|
);
|
|
1379
1522
|
}
|
|
1523
|
+
/** FileSystem: hydrate several independent directories behind one sandbox lease. */
|
|
1524
|
+
async fsListBatch(workspaceId, sessionId, request, options = {}) {
|
|
1525
|
+
return await this.requestJson(
|
|
1526
|
+
"POST",
|
|
1527
|
+
`/v1/workspaces/${workspaceId}/sessions/${sessionId}/fs/list-batch`,
|
|
1528
|
+
request,
|
|
1529
|
+
{},
|
|
1530
|
+
options
|
|
1531
|
+
);
|
|
1532
|
+
}
|
|
1380
1533
|
/** FileSystem: read a file (text or base64; binary-safe, size-capped). */
|
|
1381
1534
|
async fsRead(workspaceId, sessionId, request, options = {}) {
|
|
1382
1535
|
return await this.requestJson(
|
|
@@ -1439,6 +1592,16 @@ var OpenGeniClient = class {
|
|
|
1439
1592
|
options
|
|
1440
1593
|
);
|
|
1441
1594
|
}
|
|
1595
|
+
/** Git: read status and optional diffs for several repositories behind one sandbox lease. */
|
|
1596
|
+
async gitReadBatch(workspaceId, sessionId, request, options = {}) {
|
|
1597
|
+
return await this.requestJson(
|
|
1598
|
+
"POST",
|
|
1599
|
+
`/v1/workspaces/${workspaceId}/sessions/${sessionId}/git/read-batch`,
|
|
1600
|
+
request,
|
|
1601
|
+
{},
|
|
1602
|
+
options
|
|
1603
|
+
);
|
|
1604
|
+
}
|
|
1442
1605
|
/** Git: commit log. */
|
|
1443
1606
|
async gitLog(workspaceId, sessionId, request = {}) {
|
|
1444
1607
|
return await this.requestJson(
|
|
@@ -1554,13 +1717,11 @@ var OpenGeniClient = class {
|
|
|
1554
1717
|
);
|
|
1555
1718
|
}
|
|
1556
1719
|
/** Attach a viewer holder (refcounted liveness — keeps the box warm while
|
|
1557
|
-
* watched/used), spinning the box up in-process when cold
|
|
1558
|
-
*
|
|
1559
|
-
*
|
|
1560
|
-
*
|
|
1561
|
-
*
|
|
1562
|
-
* (`desktop` omitted/false) warms the box + mints the pty-ws terminal cell with
|
|
1563
|
-
* NO consent gate. An omitted `viewerId` mints a fresh one. */
|
|
1720
|
+
* watched/used), spinning the box up in-process when cold. Exact plane flags
|
|
1721
|
+
* mint only the requested short-lived credentials and enforce that plane's
|
|
1722
|
+
* permission. `desktop:true` alone carries the un-redacted/shared consent
|
|
1723
|
+
* gate. An entirely omitted plane set retains the legacy terminal-only
|
|
1724
|
+
* meaning; current clients should send all three flags. */
|
|
1564
1725
|
async attachViewer(workspaceId, sessionId, request = {}) {
|
|
1565
1726
|
return await this.requestJson(
|
|
1566
1727
|
"POST",
|
|
@@ -1585,132 +1746,438 @@ var OpenGeniClient = class {
|
|
|
1585
1746
|
`/v1/workspaces/${workspaceId}/sessions/${sessionId}/viewers/${viewerId}`
|
|
1586
1747
|
);
|
|
1587
1748
|
}
|
|
1588
|
-
// ---
|
|
1589
|
-
|
|
1590
|
-
* The deployment's public client bootstrap config: the host-exposed models
|
|
1591
|
-
* (provider-grouped in `models`, flat in `allowedModels` for back-compat),
|
|
1592
|
-
* reasoning efforts, MCP servers, file-upload limits, and how the client is
|
|
1593
|
-
* expected to authenticate. Drives a composer's model picker without prior
|
|
1594
|
-
* knowledge of the host setup; safe to call before any auth is established.
|
|
1595
|
-
*/
|
|
1596
|
-
async getClientConfig() {
|
|
1597
|
-
const config = await this.requestJson("GET", "/v1/config/client");
|
|
1598
|
-
if (config.apiContractRevision !== OPENGENI_API_CONTRACT_REVISION) {
|
|
1599
|
-
throw new OpenGeniApiContractMismatchError(
|
|
1600
|
-
OPENGENI_API_CONTRACT_REVISION,
|
|
1601
|
-
String(config.apiContractRevision || "(missing)")
|
|
1602
|
-
);
|
|
1603
|
-
}
|
|
1604
|
-
return config;
|
|
1605
|
-
}
|
|
1606
|
-
/** Authenticated model definitions plus workspace-specific selectability. */
|
|
1607
|
-
async getWorkspaceModelCatalog(workspaceId) {
|
|
1749
|
+
// --- Browser / Computer interaction resources --------------------------------
|
|
1750
|
+
async listAttachedBrowsers(workspaceId, options = {}) {
|
|
1608
1751
|
return await this.requestJson(
|
|
1609
1752
|
"GET",
|
|
1610
|
-
`/v1/workspaces/${workspaceId}/
|
|
1753
|
+
`/v1/workspaces/${workspaceId}/attached-browsers`,
|
|
1754
|
+
void 0,
|
|
1755
|
+
options.includeDisconnected ? { includeDisconnected: "true" } : {},
|
|
1756
|
+
options
|
|
1611
1757
|
);
|
|
1612
1758
|
}
|
|
1613
|
-
|
|
1614
|
-
async getWorkspaceRealtimeModelCatalog(workspaceId) {
|
|
1759
|
+
async getAttachedBrowser(workspaceId, deviceId, options = {}) {
|
|
1615
1760
|
return await this.requestJson(
|
|
1616
1761
|
"GET",
|
|
1617
|
-
`/v1/workspaces/${workspaceId}/
|
|
1762
|
+
`/v1/workspaces/${workspaceId}/attached-browsers/${encodeURIComponent(deviceId)}`,
|
|
1763
|
+
void 0,
|
|
1764
|
+
{},
|
|
1765
|
+
options
|
|
1618
1766
|
);
|
|
1619
1767
|
}
|
|
1620
|
-
|
|
1621
|
-
async getAccessContext() {
|
|
1622
|
-
return await this.requestJson("GET", "/v1/access/me");
|
|
1623
|
-
}
|
|
1624
|
-
async listWorkspaces() {
|
|
1625
|
-
return await this.requestJson("GET", "/v1/workspaces");
|
|
1626
|
-
}
|
|
1627
|
-
async createWorkspace(request) {
|
|
1628
|
-
return await this.requestJson("POST", "/v1/workspaces", request);
|
|
1629
|
-
}
|
|
1630
|
-
async getWorkspace(workspaceId) {
|
|
1631
|
-
return await this.requestJson("GET", `/v1/workspaces/${workspaceId}`);
|
|
1632
|
-
}
|
|
1633
|
-
/** Read-time, secret-safe inventory of policy heads and visible workspace knowledge. */
|
|
1634
|
-
async getWorkspaceState(workspaceId, options = {}) {
|
|
1635
|
-
const params = new URLSearchParams();
|
|
1636
|
-
if (options.attemptId) params.set("attemptId", options.attemptId);
|
|
1637
|
-
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
1768
|
+
async listBrowserIdentities(workspaceId, options = {}) {
|
|
1638
1769
|
return await this.requestJson(
|
|
1639
1770
|
"GET",
|
|
1640
|
-
`/v1/workspaces/${workspaceId}/
|
|
1771
|
+
`/v1/workspaces/${workspaceId}/browser-identities`,
|
|
1772
|
+
void 0,
|
|
1773
|
+
options.includeArchived ? { includeArchived: "true" } : {},
|
|
1774
|
+
options
|
|
1641
1775
|
);
|
|
1642
1776
|
}
|
|
1643
|
-
|
|
1644
|
-
async exportWorkspaceState(workspaceId, options = {}) {
|
|
1645
|
-
const params = new URLSearchParams();
|
|
1646
|
-
if (options.attemptId) params.set("attemptId", options.attemptId);
|
|
1647
|
-
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
1777
|
+
async getBrowserIdentity(workspaceId, identityId, options = {}) {
|
|
1648
1778
|
return await this.requestJson(
|
|
1649
1779
|
"GET",
|
|
1650
|
-
`/v1/workspaces/${workspaceId}/
|
|
1780
|
+
`/v1/workspaces/${workspaceId}/browser-identities/${encodeURIComponent(identityId)}`,
|
|
1781
|
+
void 0,
|
|
1782
|
+
{},
|
|
1783
|
+
options
|
|
1651
1784
|
);
|
|
1652
1785
|
}
|
|
1653
|
-
async
|
|
1654
|
-
return await this.requestJson(
|
|
1786
|
+
async createBrowserIdentity(workspaceId, request, options = {}) {
|
|
1787
|
+
return await this.requestJson(
|
|
1788
|
+
"POST",
|
|
1789
|
+
`/v1/workspaces/${workspaceId}/browser-identities`,
|
|
1790
|
+
request,
|
|
1791
|
+
{},
|
|
1792
|
+
options
|
|
1793
|
+
);
|
|
1655
1794
|
}
|
|
1656
|
-
|
|
1657
|
-
async listWorkspaceInstructionPolicies(workspaceId, options = {}) {
|
|
1658
|
-
const params = new URLSearchParams();
|
|
1659
|
-
if (options.kind !== void 0) params.set("kind", options.kind);
|
|
1660
|
-
if (options.scope !== void 0) params.set("scope", options.scope);
|
|
1661
|
-
if (options.roleKey !== void 0) params.set("roleKey", options.roleKey);
|
|
1662
|
-
if (options.afterRevision !== void 0) {
|
|
1663
|
-
params.set("afterRevision", String(options.afterRevision));
|
|
1664
|
-
}
|
|
1665
|
-
if (options.limit !== void 0) params.set("limit", String(options.limit));
|
|
1666
|
-
const query = params.toString();
|
|
1795
|
+
async listBrowserRevisions(workspaceId, identityId, options = {}) {
|
|
1667
1796
|
return await this.requestJson(
|
|
1668
1797
|
"GET",
|
|
1669
|
-
`/v1/workspaces/${workspaceId}/
|
|
1798
|
+
`/v1/workspaces/${workspaceId}/browser-identities/${encodeURIComponent(identityId)}/revisions`,
|
|
1799
|
+
void 0,
|
|
1800
|
+
{},
|
|
1801
|
+
options
|
|
1670
1802
|
);
|
|
1671
1803
|
}
|
|
1672
|
-
|
|
1804
|
+
/** Workspace-wide BrowserSession inventory. Associations express relevance,
|
|
1805
|
+
* not access: peers and child agents intentionally remain discoverable. */
|
|
1806
|
+
async listBrowserSessions(workspaceId, options = {}) {
|
|
1673
1807
|
return await this.requestJson(
|
|
1674
1808
|
"GET",
|
|
1675
|
-
`/v1/workspaces/${workspaceId}/
|
|
1809
|
+
`/v1/workspaces/${workspaceId}/browser-sessions`,
|
|
1810
|
+
void 0,
|
|
1811
|
+
{},
|
|
1812
|
+
options
|
|
1676
1813
|
);
|
|
1677
1814
|
}
|
|
1678
|
-
async
|
|
1815
|
+
async getBrowserSession(workspaceId, browserSessionId, options = {}) {
|
|
1816
|
+
return await this.requestJson(
|
|
1817
|
+
"GET",
|
|
1818
|
+
`/v1/workspaces/${workspaceId}/browser-sessions/${encodeURIComponent(browserSessionId)}`,
|
|
1819
|
+
void 0,
|
|
1820
|
+
{},
|
|
1821
|
+
options
|
|
1822
|
+
);
|
|
1823
|
+
}
|
|
1824
|
+
async createBrowserSession(workspaceId, request, options = {}) {
|
|
1679
1825
|
return await this.requestJson(
|
|
1680
1826
|
"POST",
|
|
1681
|
-
`/v1/workspaces/${workspaceId}/
|
|
1682
|
-
request
|
|
1827
|
+
`/v1/workspaces/${workspaceId}/browser-sessions`,
|
|
1828
|
+
request,
|
|
1829
|
+
{},
|
|
1830
|
+
options
|
|
1683
1831
|
);
|
|
1684
1832
|
}
|
|
1685
|
-
|
|
1686
|
-
async listWorkspaceInstructionPolicyOnboardingProposals(workspaceId, options = {}) {
|
|
1687
|
-
const params = new URLSearchParams();
|
|
1688
|
-
if (options.limit !== void 0) params.set("limit", String(options.limit));
|
|
1689
|
-
const query = params.toString();
|
|
1833
|
+
async listBrowserTargets(workspaceId, browserSessionId, options = {}) {
|
|
1690
1834
|
return await this.requestJson(
|
|
1691
1835
|
"GET",
|
|
1692
|
-
`/v1/workspaces/${workspaceId}/
|
|
1836
|
+
`/v1/workspaces/${workspaceId}/browser-sessions/${encodeURIComponent(browserSessionId)}/targets`,
|
|
1837
|
+
void 0,
|
|
1838
|
+
{},
|
|
1839
|
+
options
|
|
1693
1840
|
);
|
|
1694
1841
|
}
|
|
1695
|
-
|
|
1696
|
-
async createWorkspaceInstructionPolicyOnboardingProposal(workspaceId, request) {
|
|
1842
|
+
async openBrowserTarget(workspaceId, browserSessionId, request = {}, options = {}) {
|
|
1697
1843
|
return await this.requestJson(
|
|
1698
1844
|
"POST",
|
|
1699
|
-
`/v1/workspaces/${workspaceId}/
|
|
1700
|
-
request
|
|
1845
|
+
`/v1/workspaces/${workspaceId}/browser-sessions/${encodeURIComponent(browserSessionId)}/targets`,
|
|
1846
|
+
request,
|
|
1847
|
+
{},
|
|
1848
|
+
options
|
|
1701
1849
|
);
|
|
1702
1850
|
}
|
|
1703
|
-
|
|
1704
|
-
async importLegacyWorkspaceInstructionPolicyDraft(workspaceId, request = {}) {
|
|
1851
|
+
async selectBrowserTarget(workspaceId, browserSessionId, targetId, options = {}) {
|
|
1705
1852
|
return await this.requestJson(
|
|
1706
1853
|
"POST",
|
|
1707
|
-
`/v1/workspaces/${workspaceId}/
|
|
1708
|
-
|
|
1854
|
+
`/v1/workspaces/${workspaceId}/browser-sessions/${encodeURIComponent(browserSessionId)}/targets/${encodeURIComponent(targetId)}/select`,
|
|
1855
|
+
{},
|
|
1856
|
+
{},
|
|
1857
|
+
options
|
|
1709
1858
|
);
|
|
1710
1859
|
}
|
|
1711
|
-
async
|
|
1712
|
-
|
|
1713
|
-
|
|
1860
|
+
async closeBrowserTarget(workspaceId, browserSessionId, targetId, options = {}) {
|
|
1861
|
+
return await this.requestJson(
|
|
1862
|
+
"DELETE",
|
|
1863
|
+
`/v1/workspaces/${workspaceId}/browser-sessions/${encodeURIComponent(browserSessionId)}/targets/${encodeURIComponent(targetId)}`,
|
|
1864
|
+
void 0,
|
|
1865
|
+
{},
|
|
1866
|
+
options
|
|
1867
|
+
);
|
|
1868
|
+
}
|
|
1869
|
+
async observeBrowserTarget(workspaceId, browserSessionId, targetId, options = {}) {
|
|
1870
|
+
return await this.requestJson(
|
|
1871
|
+
"GET",
|
|
1872
|
+
`/v1/workspaces/${workspaceId}/browser-sessions/${encodeURIComponent(browserSessionId)}/targets/${encodeURIComponent(targetId)}/observation`,
|
|
1873
|
+
void 0,
|
|
1874
|
+
{},
|
|
1875
|
+
options
|
|
1876
|
+
);
|
|
1877
|
+
}
|
|
1878
|
+
async actInBrowser(workspaceId, browserSessionId, request, options = {}) {
|
|
1879
|
+
return await this.requestJson(
|
|
1880
|
+
"POST",
|
|
1881
|
+
`/v1/workspaces/${workspaceId}/browser-sessions/${encodeURIComponent(browserSessionId)}/actions`,
|
|
1882
|
+
request,
|
|
1883
|
+
{},
|
|
1884
|
+
options
|
|
1885
|
+
);
|
|
1886
|
+
}
|
|
1887
|
+
async getBrowserActionReceipt(workspaceId, browserSessionId, operationId, options = {}) {
|
|
1888
|
+
return await this.requestJson(
|
|
1889
|
+
"GET",
|
|
1890
|
+
`/v1/workspaces/${workspaceId}/browser-sessions/${encodeURIComponent(browserSessionId)}/operations/${encodeURIComponent(operationId)}`,
|
|
1891
|
+
void 0,
|
|
1892
|
+
{},
|
|
1893
|
+
options
|
|
1894
|
+
);
|
|
1895
|
+
}
|
|
1896
|
+
async listBrowserDiagnostics(workspaceId, browserSessionId, targetId, options = {}) {
|
|
1897
|
+
return await this.requestJson(
|
|
1898
|
+
"GET",
|
|
1899
|
+
`/v1/workspaces/${workspaceId}/browser-sessions/${encodeURIComponent(browserSessionId)}/targets/${encodeURIComponent(targetId)}/diagnostics`,
|
|
1900
|
+
void 0,
|
|
1901
|
+
{
|
|
1902
|
+
...options.kinds?.length ? { kinds: options.kinds.join(",") } : {},
|
|
1903
|
+
...options.after !== void 0 ? { after: String(options.after) } : {},
|
|
1904
|
+
...options.limit !== void 0 ? { limit: String(options.limit) } : {}
|
|
1905
|
+
},
|
|
1906
|
+
options.signal ? { signal: options.signal } : {}
|
|
1907
|
+
);
|
|
1908
|
+
}
|
|
1909
|
+
async attachBrowserSession(workspaceId, browserSessionId, request, options = {}) {
|
|
1910
|
+
return await this.requestJson(
|
|
1911
|
+
"POST",
|
|
1912
|
+
`/v1/workspaces/${workspaceId}/browser-sessions/${encodeURIComponent(browserSessionId)}/attachments`,
|
|
1913
|
+
request,
|
|
1914
|
+
{},
|
|
1915
|
+
options
|
|
1916
|
+
);
|
|
1917
|
+
}
|
|
1918
|
+
async heartbeatBrowserSession(workspaceId, browserSessionId, options = {}) {
|
|
1919
|
+
return await this.requestJson(
|
|
1920
|
+
"POST",
|
|
1921
|
+
`/v1/workspaces/${workspaceId}/browser-sessions/${encodeURIComponent(browserSessionId)}/heartbeat`,
|
|
1922
|
+
{},
|
|
1923
|
+
{},
|
|
1924
|
+
options
|
|
1925
|
+
);
|
|
1926
|
+
}
|
|
1927
|
+
async publishBrowserRevision(workspaceId, browserSessionId, request, options = {}) {
|
|
1928
|
+
return await this.requestJson(
|
|
1929
|
+
"POST",
|
|
1930
|
+
`/v1/workspaces/${workspaceId}/browser-sessions/${encodeURIComponent(browserSessionId)}/revisions`,
|
|
1931
|
+
request,
|
|
1932
|
+
{},
|
|
1933
|
+
options
|
|
1934
|
+
);
|
|
1935
|
+
}
|
|
1936
|
+
async suspendBrowserSession(workspaceId, browserSessionId, request, options = {}) {
|
|
1937
|
+
return await this.requestJson(
|
|
1938
|
+
"POST",
|
|
1939
|
+
`/v1/workspaces/${workspaceId}/browser-sessions/${encodeURIComponent(browserSessionId)}/suspend`,
|
|
1940
|
+
request,
|
|
1941
|
+
{},
|
|
1942
|
+
options
|
|
1943
|
+
);
|
|
1944
|
+
}
|
|
1945
|
+
async resumeBrowserSession(workspaceId, browserSessionId, request, options = {}) {
|
|
1946
|
+
return await this.requestJson(
|
|
1947
|
+
"POST",
|
|
1948
|
+
`/v1/workspaces/${workspaceId}/browser-sessions/${encodeURIComponent(browserSessionId)}/resume`,
|
|
1949
|
+
request,
|
|
1950
|
+
{},
|
|
1951
|
+
options
|
|
1952
|
+
);
|
|
1953
|
+
}
|
|
1954
|
+
async endBrowserSession(workspaceId, browserSessionId, request, options = {}) {
|
|
1955
|
+
return await this.requestJson(
|
|
1956
|
+
"POST",
|
|
1957
|
+
`/v1/workspaces/${workspaceId}/browser-sessions/${encodeURIComponent(browserSessionId)}/end`,
|
|
1958
|
+
request,
|
|
1959
|
+
{},
|
|
1960
|
+
options
|
|
1961
|
+
);
|
|
1962
|
+
}
|
|
1963
|
+
/** Workspace-wide ComputerSession inventory. Associations express
|
|
1964
|
+
* relevance, not access; peer sessions intentionally remain discoverable. */
|
|
1965
|
+
async listComputerSessions(workspaceId, options = {}) {
|
|
1966
|
+
return await this.requestJson(
|
|
1967
|
+
"GET",
|
|
1968
|
+
`/v1/workspaces/${workspaceId}/computer-sessions`,
|
|
1969
|
+
void 0,
|
|
1970
|
+
{},
|
|
1971
|
+
options
|
|
1972
|
+
);
|
|
1973
|
+
}
|
|
1974
|
+
async getComputerSession(workspaceId, computerSessionId, options = {}) {
|
|
1975
|
+
return await this.requestJson(
|
|
1976
|
+
"GET",
|
|
1977
|
+
`/v1/workspaces/${workspaceId}/computer-sessions/${encodeURIComponent(computerSessionId)}`,
|
|
1978
|
+
void 0,
|
|
1979
|
+
{},
|
|
1980
|
+
options
|
|
1981
|
+
);
|
|
1982
|
+
}
|
|
1983
|
+
async createComputerSession(workspaceId, request, options = {}) {
|
|
1984
|
+
return await this.requestJson(
|
|
1985
|
+
"POST",
|
|
1986
|
+
`/v1/workspaces/${workspaceId}/computer-sessions`,
|
|
1987
|
+
request,
|
|
1988
|
+
{},
|
|
1989
|
+
options
|
|
1990
|
+
);
|
|
1991
|
+
}
|
|
1992
|
+
async listComputerTargets(workspaceId, computerSessionId, options = {}) {
|
|
1993
|
+
return await this.requestJson(
|
|
1994
|
+
"GET",
|
|
1995
|
+
`/v1/workspaces/${workspaceId}/computer-sessions/${encodeURIComponent(computerSessionId)}/targets`,
|
|
1996
|
+
void 0,
|
|
1997
|
+
{},
|
|
1998
|
+
options
|
|
1999
|
+
);
|
|
2000
|
+
}
|
|
2001
|
+
async observeComputerTarget(workspaceId, computerSessionId, targetId, options = {}) {
|
|
2002
|
+
return await this.requestJson(
|
|
2003
|
+
"GET",
|
|
2004
|
+
`/v1/workspaces/${workspaceId}/computer-sessions/${encodeURIComponent(computerSessionId)}/targets/${encodeURIComponent(targetId)}/observation`,
|
|
2005
|
+
void 0,
|
|
2006
|
+
{},
|
|
2007
|
+
options
|
|
2008
|
+
);
|
|
2009
|
+
}
|
|
2010
|
+
async actInComputer(workspaceId, computerSessionId, request, options = {}) {
|
|
2011
|
+
return await this.requestJson(
|
|
2012
|
+
"POST",
|
|
2013
|
+
`/v1/workspaces/${workspaceId}/computer-sessions/${encodeURIComponent(computerSessionId)}/actions`,
|
|
2014
|
+
request,
|
|
2015
|
+
{},
|
|
2016
|
+
options
|
|
2017
|
+
);
|
|
2018
|
+
}
|
|
2019
|
+
async getComputerActionReceipt(workspaceId, computerSessionId, operationId, options = {}) {
|
|
2020
|
+
return await this.requestJson(
|
|
2021
|
+
"GET",
|
|
2022
|
+
`/v1/workspaces/${workspaceId}/computer-sessions/${encodeURIComponent(computerSessionId)}/operations/${encodeURIComponent(operationId)}`,
|
|
2023
|
+
void 0,
|
|
2024
|
+
{},
|
|
2025
|
+
options
|
|
2026
|
+
);
|
|
2027
|
+
}
|
|
2028
|
+
async attachComputerSession(workspaceId, computerSessionId, request, options = {}) {
|
|
2029
|
+
return await this.requestJson(
|
|
2030
|
+
"POST",
|
|
2031
|
+
`/v1/workspaces/${workspaceId}/computer-sessions/${encodeURIComponent(computerSessionId)}/attachments`,
|
|
2032
|
+
request,
|
|
2033
|
+
{},
|
|
2034
|
+
options
|
|
2035
|
+
);
|
|
2036
|
+
}
|
|
2037
|
+
async heartbeatComputerSession(workspaceId, computerSessionId, options = {}) {
|
|
2038
|
+
return await this.requestJson(
|
|
2039
|
+
"POST",
|
|
2040
|
+
`/v1/workspaces/${workspaceId}/computer-sessions/${encodeURIComponent(computerSessionId)}/heartbeat`,
|
|
2041
|
+
{},
|
|
2042
|
+
{},
|
|
2043
|
+
options
|
|
2044
|
+
);
|
|
2045
|
+
}
|
|
2046
|
+
async endComputerSession(workspaceId, computerSessionId, request, options = {}) {
|
|
2047
|
+
return await this.requestJson(
|
|
2048
|
+
"POST",
|
|
2049
|
+
`/v1/workspaces/${workspaceId}/computer-sessions/${encodeURIComponent(computerSessionId)}/end`,
|
|
2050
|
+
request,
|
|
2051
|
+
{},
|
|
2052
|
+
options
|
|
2053
|
+
);
|
|
2054
|
+
}
|
|
2055
|
+
// --- Access + workspaces -----------------------------------------------------
|
|
2056
|
+
/**
|
|
2057
|
+
* The deployment's public client bootstrap config: the host-exposed models
|
|
2058
|
+
* (provider-grouped in `models`, flat in `allowedModels` for back-compat),
|
|
2059
|
+
* reasoning efforts, MCP servers, file-upload limits, and how the client is
|
|
2060
|
+
* expected to authenticate. Drives a composer's model picker without prior
|
|
2061
|
+
* knowledge of the host setup; safe to call before any auth is established.
|
|
2062
|
+
*/
|
|
2063
|
+
async getClientConfig() {
|
|
2064
|
+
const config = await this.requestJson("GET", "/v1/config/client");
|
|
2065
|
+
if (config.apiContractRevision !== OPENGENI_API_CONTRACT_REVISION) {
|
|
2066
|
+
throw new OpenGeniApiContractMismatchError(
|
|
2067
|
+
OPENGENI_API_CONTRACT_REVISION,
|
|
2068
|
+
String(config.apiContractRevision || "(missing)")
|
|
2069
|
+
);
|
|
2070
|
+
}
|
|
2071
|
+
return config;
|
|
2072
|
+
}
|
|
2073
|
+
/** Authenticated model definitions plus workspace-specific selectability. */
|
|
2074
|
+
async getWorkspaceModelCatalog(workspaceId) {
|
|
2075
|
+
return await this.requestJson(
|
|
2076
|
+
"GET",
|
|
2077
|
+
`/v1/workspaces/${workspaceId}/model-catalog`
|
|
2078
|
+
);
|
|
2079
|
+
}
|
|
2080
|
+
/** Authenticated realtime voice models and credential readiness. */
|
|
2081
|
+
async getWorkspaceRealtimeModelCatalog(workspaceId) {
|
|
2082
|
+
return await this.requestJson(
|
|
2083
|
+
"GET",
|
|
2084
|
+
`/v1/workspaces/${workspaceId}/realtime-model-catalog`
|
|
2085
|
+
);
|
|
2086
|
+
}
|
|
2087
|
+
/** The caller's access context: subject, account + workspace grants, defaults. */
|
|
2088
|
+
async getAccessContext() {
|
|
2089
|
+
return await this.requestJson("GET", "/v1/access/me");
|
|
2090
|
+
}
|
|
2091
|
+
async listWorkspaces() {
|
|
2092
|
+
return await this.requestJson("GET", "/v1/workspaces");
|
|
2093
|
+
}
|
|
2094
|
+
async createWorkspace(request) {
|
|
2095
|
+
return await this.requestJson("POST", "/v1/workspaces", request);
|
|
2096
|
+
}
|
|
2097
|
+
async getWorkspace(workspaceId) {
|
|
2098
|
+
return await this.requestJson("GET", `/v1/workspaces/${workspaceId}`);
|
|
2099
|
+
}
|
|
2100
|
+
/** Read-time, secret-safe inventory of policy heads and visible workspace knowledge. */
|
|
2101
|
+
async getWorkspaceState(workspaceId, options = {}) {
|
|
2102
|
+
const params = new URLSearchParams();
|
|
2103
|
+
if (options.attemptId) params.set("attemptId", options.attemptId);
|
|
2104
|
+
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
2105
|
+
return await this.requestJson(
|
|
2106
|
+
"GET",
|
|
2107
|
+
`/v1/workspaces/${workspaceId}/workspace-state${query}`
|
|
2108
|
+
);
|
|
2109
|
+
}
|
|
2110
|
+
/** Download the canonical, explicitly sanitized Workspace State export. */
|
|
2111
|
+
async exportWorkspaceState(workspaceId, options = {}) {
|
|
2112
|
+
const params = new URLSearchParams();
|
|
2113
|
+
if (options.attemptId) params.set("attemptId", options.attemptId);
|
|
2114
|
+
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
2115
|
+
return await this.requestJson(
|
|
2116
|
+
"GET",
|
|
2117
|
+
`/v1/workspaces/${workspaceId}/workspace-state/export${query}`
|
|
2118
|
+
);
|
|
2119
|
+
}
|
|
2120
|
+
async updateWorkspace(workspaceId, request) {
|
|
2121
|
+
return await this.requestJson("PATCH", `/v1/workspaces/${workspaceId}`, request);
|
|
2122
|
+
}
|
|
2123
|
+
/** Inspect immutable instruction-policy history, active heads, and activation audit evidence. */
|
|
2124
|
+
async listWorkspaceInstructionPolicies(workspaceId, options = {}) {
|
|
2125
|
+
const params = new URLSearchParams();
|
|
2126
|
+
if (options.kind !== void 0) params.set("kind", options.kind);
|
|
2127
|
+
if (options.scope !== void 0) params.set("scope", options.scope);
|
|
2128
|
+
if (options.roleKey !== void 0) params.set("roleKey", options.roleKey);
|
|
2129
|
+
if (options.afterRevision !== void 0) {
|
|
2130
|
+
params.set("afterRevision", String(options.afterRevision));
|
|
2131
|
+
}
|
|
2132
|
+
if (options.limit !== void 0) params.set("limit", String(options.limit));
|
|
2133
|
+
const query = params.toString();
|
|
2134
|
+
return await this.requestJson(
|
|
2135
|
+
"GET",
|
|
2136
|
+
`/v1/workspaces/${workspaceId}/instruction-policies${query ? `?${query}` : ""}`
|
|
2137
|
+
);
|
|
2138
|
+
}
|
|
2139
|
+
async getWorkspaceInstructionPolicyRevision(workspaceId, revisionId) {
|
|
2140
|
+
return await this.requestJson(
|
|
2141
|
+
"GET",
|
|
2142
|
+
`/v1/workspaces/${workspaceId}/instruction-policies/${encodeURIComponent(revisionId)}`
|
|
2143
|
+
);
|
|
2144
|
+
}
|
|
2145
|
+
async createWorkspaceInstructionPolicyDraft(workspaceId, request) {
|
|
2146
|
+
return await this.requestJson(
|
|
2147
|
+
"POST",
|
|
2148
|
+
`/v1/workspaces/${workspaceId}/instruction-policies/drafts`,
|
|
2149
|
+
request
|
|
2150
|
+
);
|
|
2151
|
+
}
|
|
2152
|
+
/** List the newest immutable onboarding proposals and their inactive policy drafts. */
|
|
2153
|
+
async listWorkspaceInstructionPolicyOnboardingProposals(workspaceId, options = {}) {
|
|
2154
|
+
const params = new URLSearchParams();
|
|
2155
|
+
if (options.limit !== void 0) params.set("limit", String(options.limit));
|
|
2156
|
+
const query = params.toString();
|
|
2157
|
+
return await this.requestJson(
|
|
2158
|
+
"GET",
|
|
2159
|
+
`/v1/workspaces/${workspaceId}/instruction-policies/onboarding-proposals${query ? `?${query}` : ""}`
|
|
2160
|
+
);
|
|
2161
|
+
}
|
|
2162
|
+
/** Create one draft-only proposal against an exact active-policy baseline. */
|
|
2163
|
+
async createWorkspaceInstructionPolicyOnboardingProposal(workspaceId, request) {
|
|
2164
|
+
return await this.requestJson(
|
|
2165
|
+
"POST",
|
|
2166
|
+
`/v1/workspaces/${workspaceId}/instruction-policies/onboarding-proposals`,
|
|
2167
|
+
request
|
|
2168
|
+
);
|
|
2169
|
+
}
|
|
2170
|
+
/** Import the stored legacy workspace override as an inactive charter draft. */
|
|
2171
|
+
async importLegacyWorkspaceInstructionPolicyDraft(workspaceId, request = {}) {
|
|
2172
|
+
return await this.requestJson(
|
|
2173
|
+
"POST",
|
|
2174
|
+
`/v1/workspaces/${workspaceId}/instruction-policies/import-legacy`,
|
|
2175
|
+
request
|
|
2176
|
+
);
|
|
2177
|
+
}
|
|
2178
|
+
async diffWorkspaceInstructionPolicyRevisions(workspaceId, request) {
|
|
2179
|
+
const params = new URLSearchParams({
|
|
2180
|
+
fromRevisionId: request.fromRevisionId,
|
|
1714
2181
|
toRevisionId: request.toRevisionId
|
|
1715
2182
|
});
|
|
1716
2183
|
return await this.requestJson(
|
|
@@ -1732,6 +2199,52 @@ var OpenGeniClient = class {
|
|
|
1732
2199
|
request
|
|
1733
2200
|
);
|
|
1734
2201
|
}
|
|
2202
|
+
/** Read the current organization profile plus immutable revision and activation history. */
|
|
2203
|
+
async listCompanyProfile(workspaceId, options = {}) {
|
|
2204
|
+
const params = new URLSearchParams();
|
|
2205
|
+
if (options.afterRevision !== void 0)
|
|
2206
|
+
params.set("afterRevision", String(options.afterRevision));
|
|
2207
|
+
if (options.limit !== void 0) params.set("limit", String(options.limit));
|
|
2208
|
+
const query = params.toString();
|
|
2209
|
+
return await this.requestJson(
|
|
2210
|
+
"GET",
|
|
2211
|
+
`/v1/workspaces/${workspaceId}/company-profile${query ? `?${query}` : ""}`
|
|
2212
|
+
);
|
|
2213
|
+
}
|
|
2214
|
+
async getCompanyProfileRevision(workspaceId, revisionId) {
|
|
2215
|
+
return await this.requestJson(
|
|
2216
|
+
"GET",
|
|
2217
|
+
`/v1/workspaces/${workspaceId}/company-profile/revisions/${encodeURIComponent(revisionId)}`
|
|
2218
|
+
);
|
|
2219
|
+
}
|
|
2220
|
+
async updateCompanyProfile(workspaceId, request) {
|
|
2221
|
+
return await this.requestJson(
|
|
2222
|
+
"PUT",
|
|
2223
|
+
`/v1/workspaces/${workspaceId}/company-profile`,
|
|
2224
|
+
request
|
|
2225
|
+
);
|
|
2226
|
+
}
|
|
2227
|
+
async diffCompanyProfileRevisions(workspaceId, request) {
|
|
2228
|
+
const params = new URLSearchParams(request);
|
|
2229
|
+
return await this.requestJson(
|
|
2230
|
+
"GET",
|
|
2231
|
+
`/v1/workspaces/${workspaceId}/company-profile/diff?${params}`
|
|
2232
|
+
);
|
|
2233
|
+
}
|
|
2234
|
+
async activateCompanyProfileRevision(workspaceId, revisionId, request) {
|
|
2235
|
+
return await this.requestJson(
|
|
2236
|
+
"POST",
|
|
2237
|
+
`/v1/workspaces/${workspaceId}/company-profile/revisions/${encodeURIComponent(revisionId)}/activate`,
|
|
2238
|
+
request
|
|
2239
|
+
);
|
|
2240
|
+
}
|
|
2241
|
+
async rollbackCompanyProfile(workspaceId, request) {
|
|
2242
|
+
return await this.requestJson(
|
|
2243
|
+
"POST",
|
|
2244
|
+
`/v1/workspaces/${workspaceId}/company-profile/rollback`,
|
|
2245
|
+
request
|
|
2246
|
+
);
|
|
2247
|
+
}
|
|
1735
2248
|
async listPreferenceRegistry(workspaceId, options = {}) {
|
|
1736
2249
|
const params = new URLSearchParams();
|
|
1737
2250
|
if (options.scope) params.set("scope", options.scope);
|
|
@@ -1855,6 +2368,55 @@ var OpenGeniClient = class {
|
|
|
1855
2368
|
`/v1/workspaces/${workspaceId}/members/${encodeURIComponent(subjectId)}`
|
|
1856
2369
|
);
|
|
1857
2370
|
}
|
|
2371
|
+
/** Exchange one signed Slack bearer for durable, token-free continuation state. */
|
|
2372
|
+
async prepareSlackUserLinkAccess(workspaceId, request) {
|
|
2373
|
+
return await this.requestJson(
|
|
2374
|
+
"POST",
|
|
2375
|
+
`/v1/workspaces/${workspaceId}/integrations/slack/user-link-intents`,
|
|
2376
|
+
request
|
|
2377
|
+
);
|
|
2378
|
+
}
|
|
2379
|
+
async getSlackUserLinkAccess(workspaceId, requestId) {
|
|
2380
|
+
return await this.requestJson(
|
|
2381
|
+
"GET",
|
|
2382
|
+
`/v1/workspaces/${workspaceId}/integrations/slack/user-link-intents/${requestId}`
|
|
2383
|
+
);
|
|
2384
|
+
}
|
|
2385
|
+
async requestSlackUserLinkWorkspaceAccess(workspaceId, requestId, request) {
|
|
2386
|
+
return await this.requestJson(
|
|
2387
|
+
"POST",
|
|
2388
|
+
`/v1/workspaces/${workspaceId}/integrations/slack/user-link-intents/${requestId}/request-access`,
|
|
2389
|
+
request
|
|
2390
|
+
);
|
|
2391
|
+
}
|
|
2392
|
+
async cancelSlackUserLinkAccess(workspaceId, requestId, request) {
|
|
2393
|
+
return await this.requestJson(
|
|
2394
|
+
"POST",
|
|
2395
|
+
`/v1/workspaces/${workspaceId}/integrations/slack/user-link-intents/${requestId}/cancel`,
|
|
2396
|
+
request
|
|
2397
|
+
);
|
|
2398
|
+
}
|
|
2399
|
+
async listSlackUserLinkAccessRequests(workspaceId) {
|
|
2400
|
+
const response = await this.requestJson(
|
|
2401
|
+
"GET",
|
|
2402
|
+
`/v1/workspaces/${workspaceId}/members/access-requests/slack`
|
|
2403
|
+
);
|
|
2404
|
+
return response.requests;
|
|
2405
|
+
}
|
|
2406
|
+
async approveSlackUserLinkAccessRequest(workspaceId, requestId, request) {
|
|
2407
|
+
return await this.requestJson(
|
|
2408
|
+
"POST",
|
|
2409
|
+
`/v1/workspaces/${workspaceId}/members/access-requests/slack/${requestId}/approve`,
|
|
2410
|
+
request
|
|
2411
|
+
);
|
|
2412
|
+
}
|
|
2413
|
+
async denySlackUserLinkAccessRequest(workspaceId, requestId, request) {
|
|
2414
|
+
return await this.requestJson(
|
|
2415
|
+
"POST",
|
|
2416
|
+
`/v1/workspaces/${workspaceId}/members/access-requests/slack/${requestId}/deny`,
|
|
2417
|
+
request
|
|
2418
|
+
);
|
|
2419
|
+
}
|
|
1858
2420
|
// --- Scheduled tasks (write + runs) -------------------------------------------
|
|
1859
2421
|
async createScheduledTask(workspaceId, request) {
|
|
1860
2422
|
return await this.requestJson(
|
|
@@ -1911,7 +2473,8 @@ var OpenGeniClient = class {
|
|
|
1911
2473
|
);
|
|
1912
2474
|
}
|
|
1913
2475
|
// --- VariableSets --------------------------------------------------------------
|
|
1914
|
-
//
|
|
2476
|
+
// Generic reads return name/version metadata only. Plaintext uses one
|
|
2477
|
+
// dedicated permissioned endpoint.
|
|
1915
2478
|
async listVariableSets(workspaceId) {
|
|
1916
2479
|
return await this.requestJson(
|
|
1917
2480
|
"GET",
|
|
@@ -1931,6 +2494,12 @@ var OpenGeniClient = class {
|
|
|
1931
2494
|
`/v1/workspaces/${workspaceId}/variable-sets/${variableSetId}`
|
|
1932
2495
|
);
|
|
1933
2496
|
}
|
|
2497
|
+
async getVariableSetVariable(workspaceId, variableSetId, name) {
|
|
2498
|
+
return await this.requestJson(
|
|
2499
|
+
"GET",
|
|
2500
|
+
`/v1/workspaces/${workspaceId}/variable-sets/${variableSetId}/variables/${encodeURIComponent(name)}`
|
|
2501
|
+
);
|
|
2502
|
+
}
|
|
1934
2503
|
async updateVariableSet(workspaceId, variableSetId, request) {
|
|
1935
2504
|
return await this.requestJson(
|
|
1936
2505
|
"PATCH",
|
|
@@ -1944,7 +2513,7 @@ var OpenGeniClient = class {
|
|
|
1944
2513
|
`/v1/workspaces/${workspaceId}/variable-sets/${variableSetId}`
|
|
1945
2514
|
);
|
|
1946
2515
|
}
|
|
1947
|
-
/** Create or rotate a variable.
|
|
2516
|
+
/** Create or rotate a variable. Generic reads never return its value. */
|
|
1948
2517
|
async setVariableSetVariable(workspaceId, variableSetId, name, value) {
|
|
1949
2518
|
return await this.requestJson(
|
|
1950
2519
|
"PUT",
|
|
@@ -2076,18 +2645,23 @@ var OpenGeniClient = class {
|
|
|
2076
2645
|
}
|
|
2077
2646
|
// --- Files -----------------------------------------------------------------------
|
|
2078
2647
|
/** Step 1 of the upload flow: returns the pre-signed PUT target. */
|
|
2079
|
-
async beginFileUpload(workspaceId, request) {
|
|
2648
|
+
async beginFileUpload(workspaceId, request, options = {}) {
|
|
2080
2649
|
return await this.requestJson(
|
|
2081
2650
|
"POST",
|
|
2082
2651
|
`/v1/workspaces/${workspaceId}/files/uploads`,
|
|
2083
|
-
request
|
|
2652
|
+
request,
|
|
2653
|
+
{},
|
|
2654
|
+
options
|
|
2084
2655
|
);
|
|
2085
2656
|
}
|
|
2086
2657
|
/** Step 3 of the upload flow: server verifies the object and marks it ready. */
|
|
2087
|
-
async completeFileUpload(workspaceId, uploadId) {
|
|
2658
|
+
async completeFileUpload(workspaceId, uploadId, options = {}) {
|
|
2088
2659
|
const response = await this.requestJson(
|
|
2089
2660
|
"POST",
|
|
2090
|
-
`/v1/workspaces/${workspaceId}/files/uploads/${uploadId}/complete
|
|
2661
|
+
`/v1/workspaces/${workspaceId}/files/uploads/${uploadId}/complete`,
|
|
2662
|
+
void 0,
|
|
2663
|
+
{},
|
|
2664
|
+
options
|
|
2091
2665
|
);
|
|
2092
2666
|
return response.file;
|
|
2093
2667
|
}
|
|
@@ -2097,35 +2671,68 @@ var OpenGeniClient = class {
|
|
|
2097
2671
|
* -> complete. Returns the ready `FileAsset`.
|
|
2098
2672
|
*/
|
|
2099
2673
|
async uploadFile(workspaceId, input) {
|
|
2674
|
+
if (input.timeoutMs !== void 0 && (!Number.isFinite(input.timeoutMs) || input.timeoutMs <= 0)) {
|
|
2675
|
+
throw new Error("File upload timeout must be a positive number");
|
|
2676
|
+
}
|
|
2677
|
+
const withTimeout = async (timeoutMs, operation) => {
|
|
2678
|
+
const controller = new AbortController();
|
|
2679
|
+
let timeout;
|
|
2680
|
+
const timedOut = new Promise((_resolve, reject) => {
|
|
2681
|
+
timeout = setTimeout(() => {
|
|
2682
|
+
controller.abort();
|
|
2683
|
+
reject(new Error("File upload timed out. Retry the upload."));
|
|
2684
|
+
}, timeoutMs);
|
|
2685
|
+
});
|
|
2686
|
+
try {
|
|
2687
|
+
return await Promise.race([operation(controller.signal), timedOut]);
|
|
2688
|
+
} finally {
|
|
2689
|
+
if (timeout !== void 0) clearTimeout(timeout);
|
|
2690
|
+
}
|
|
2691
|
+
};
|
|
2100
2692
|
const body = input.data instanceof Uint8Array ? new Blob([input.data.slice()]) : input.data instanceof ArrayBuffer ? input.data.slice(0) : input.data;
|
|
2101
2693
|
const sizeBytes = typeof body === "string" ? new TextEncoder().encode(body).byteLength : body instanceof Blob ? body.size : body.byteLength;
|
|
2102
2694
|
const sha256 = input.sha256 ?? await sha256ForUpload(body);
|
|
2103
|
-
const upload = await
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2695
|
+
const upload = await withTimeout(
|
|
2696
|
+
3e4,
|
|
2697
|
+
async (signal) => await this.beginFileUpload(
|
|
2698
|
+
workspaceId,
|
|
2699
|
+
{
|
|
2700
|
+
filename: input.filename,
|
|
2701
|
+
contentType: input.contentType,
|
|
2702
|
+
sizeBytes,
|
|
2703
|
+
sha256
|
|
2704
|
+
},
|
|
2705
|
+
{ signal }
|
|
2706
|
+
)
|
|
2707
|
+
);
|
|
2708
|
+
const transferTimeoutMs = input.timeoutMs ?? Math.max(12e4, Math.ceil(sizeBytes / (256 * 1024)) * 1e3);
|
|
2709
|
+
const putResponse = await withTimeout(
|
|
2710
|
+
transferTimeoutMs,
|
|
2711
|
+
async (signal) => await this.fetchImpl(upload.putUrl, {
|
|
2712
|
+
method: "PUT",
|
|
2713
|
+
// Signed object-storage URLs carry their own short-lived authority.
|
|
2714
|
+
// Browser cookies and HTTP auth must never accompany this cross-origin
|
|
2715
|
+
// request: credentialed fetches are incompatible with wildcard CORS and
|
|
2716
|
+
// can leak ambient credentials to a caller-selected storage endpoint.
|
|
2717
|
+
credentials: "omit",
|
|
2718
|
+
// The backend's requiredHeaders already carry the canonical lowercase
|
|
2719
|
+
// `content-type` for every storage backend (Azure/S3/GCS). Do NOT also set
|
|
2720
|
+
// a `Content-Type` key here: WHATWG Headers treats the two casings as the
|
|
2721
|
+
// same header and comma-joins their values (e.g. "text/plain, text/plain"),
|
|
2722
|
+
// which the object store persists verbatim and COMPLETE then rejects (422),
|
|
2723
|
+
// and which breaks S3's presigned-URL signature.
|
|
2724
|
+
headers: { ...upload.requiredHeaders },
|
|
2725
|
+
body,
|
|
2726
|
+
signal
|
|
2727
|
+
})
|
|
2728
|
+
);
|
|
2125
2729
|
if (!putResponse.ok) {
|
|
2126
2730
|
throw await apiErrorFromResponse(putResponse, { method: "PUT" });
|
|
2127
2731
|
}
|
|
2128
|
-
return await
|
|
2732
|
+
return await withTimeout(
|
|
2733
|
+
3e4,
|
|
2734
|
+
async (signal) => await this.completeFileUpload(workspaceId, upload.uploadId, { signal })
|
|
2735
|
+
);
|
|
2129
2736
|
}
|
|
2130
2737
|
async getFile(workspaceId, fileId) {
|
|
2131
2738
|
return await this.requestJson(
|
|
@@ -2145,22 +2752,100 @@ var OpenGeniClient = class {
|
|
|
2145
2752
|
* deliberately does not use the ordinary signed file-download URL.
|
|
2146
2753
|
*/
|
|
2147
2754
|
async getRetainedArtifactContent(workspaceId, artifactId, options = {}) {
|
|
2755
|
+
return await this.getRetainedArtifactContentAtPath(
|
|
2756
|
+
`/v1/workspaces/${workspaceId}/artifacts/${artifactId}/content`,
|
|
2757
|
+
options
|
|
2758
|
+
);
|
|
2759
|
+
}
|
|
2760
|
+
async getSessionRetainedArtifact(workspaceId, sessionId, artifactId) {
|
|
2761
|
+
return await this.requestJson(
|
|
2762
|
+
"GET",
|
|
2763
|
+
`/v1/workspaces/${workspaceId}/sessions/${sessionId}/artifacts/${artifactId}`
|
|
2764
|
+
);
|
|
2765
|
+
}
|
|
2766
|
+
async getSessionRetainedArtifactContent(workspaceId, sessionId, artifactId, options = {}) {
|
|
2767
|
+
return await this.getRetainedArtifactContentAtPath(
|
|
2768
|
+
`/v1/workspaces/${workspaceId}/sessions/${sessionId}/artifacts/${artifactId}/content`,
|
|
2769
|
+
options
|
|
2770
|
+
);
|
|
2771
|
+
}
|
|
2772
|
+
/** Assemble one permanent generated-image receipt from bounded authenticated ranges. */
|
|
2773
|
+
async downloadRetainedArtifact(workspaceId, artifact, options = {}) {
|
|
2774
|
+
assertRetainedGeneratedImageReceipt(workspaceId, artifact);
|
|
2775
|
+
const bytes = await this.downloadRetainedArtifactBytes(artifact, options);
|
|
2776
|
+
return { artifact, bytes };
|
|
2777
|
+
}
|
|
2778
|
+
/** Mint a short-lived, zero-copy browser source for a validated generated image. */
|
|
2779
|
+
async createRetainedArtifactDownloadUrl(workspaceId, artifact, options = {}) {
|
|
2780
|
+
assertRetainedGeneratedImageReceipt(workspaceId, artifact);
|
|
2781
|
+
const download = await this.createFileDownloadUrl(workspaceId, artifact.artifactId, options);
|
|
2782
|
+
assertSafeArtifactDownloadUrl(download);
|
|
2783
|
+
return download;
|
|
2784
|
+
}
|
|
2785
|
+
/** Assemble one retained screenshot from bounded authenticated API ranges. */
|
|
2786
|
+
async downloadRetainedScreenshot(workspaceId, sessionId, artifactId, options = {}) {
|
|
2787
|
+
const metadata = await this.getSessionRetainedArtifact(workspaceId, sessionId, artifactId);
|
|
2788
|
+
if (!metadata.available) return { metadata, bytes: null };
|
|
2789
|
+
if (metadata.kind !== "computer_screenshot" || metadata.contentType !== "image/png" || !metadata.dimensions || metadata.originalBytes <= 0 || metadata.originalBytes > COMPUTER_SCREENSHOT_MAX_BYTES) {
|
|
2790
|
+
throw new OpenGeniApiError(502, "retained screenshot metadata is invalid");
|
|
2791
|
+
}
|
|
2792
|
+
const bytes = await this.downloadRetainedArtifactBytes(metadata, options);
|
|
2793
|
+
return { metadata, bytes };
|
|
2794
|
+
}
|
|
2795
|
+
async downloadRetainedArtifactBytes(artifact, options) {
|
|
2796
|
+
const maxRetries = options.maxRetries ?? 2;
|
|
2797
|
+
if (!Number.isInteger(maxRetries) || maxRetries < 0 || maxRetries > 3) {
|
|
2798
|
+
throw new RangeError("retained artifact maxRetries must be an integer from 0 to 3");
|
|
2799
|
+
}
|
|
2800
|
+
const bytes = new Uint8Array(artifact.originalBytes);
|
|
2801
|
+
const pageBytes = Math.min(artifact.retrieval.maxRangeBytes, RETAINED_OUTPUT_MAX_PAGE_BYTES);
|
|
2802
|
+
if (!Number.isSafeInteger(pageBytes) || pageBytes <= 0) {
|
|
2803
|
+
throw new OpenGeniApiError(502, "retained artifact range metadata is invalid");
|
|
2804
|
+
}
|
|
2805
|
+
for (let start = 0; start < bytes.byteLength; start += pageBytes) {
|
|
2806
|
+
options.signal?.throwIfAborted();
|
|
2807
|
+
const end = Math.min(start + pageBytes, bytes.byteLength) - 1;
|
|
2808
|
+
let page = null;
|
|
2809
|
+
for (let attempt = 0; attempt <= maxRetries; attempt += 1) {
|
|
2810
|
+
try {
|
|
2811
|
+
page = await this.getRetainedArtifactContentAtPath(artifact.retrieval.path, {
|
|
2812
|
+
range: `bytes=${start}-${end}`,
|
|
2813
|
+
...options.signal ? { signal: options.signal } : {}
|
|
2814
|
+
});
|
|
2815
|
+
break;
|
|
2816
|
+
} catch (error) {
|
|
2817
|
+
options.signal?.throwIfAborted();
|
|
2818
|
+
if (attempt >= maxRetries || error instanceof OpenGeniApiError && error.status >= 400 && error.status < 500) {
|
|
2819
|
+
throw error;
|
|
2820
|
+
}
|
|
2821
|
+
}
|
|
2822
|
+
}
|
|
2823
|
+
if (!page) throw new OpenGeniApiError(502, "retained artifact range retry exhausted");
|
|
2824
|
+
const expectedLength = end - start + 1;
|
|
2825
|
+
if (page.status !== 206 || page.contentType !== artifact.contentType || page.contentLength !== expectedLength || page.contentRange !== `bytes ${start}-${end}/${artifact.originalBytes}`) {
|
|
2826
|
+
throw new OpenGeniApiError(502, "retained artifact range response is invalid");
|
|
2827
|
+
}
|
|
2828
|
+
bytes.set(page.bytes, start);
|
|
2829
|
+
}
|
|
2830
|
+
if (await sha256Hex(bytes) !== artifact.sha256) {
|
|
2831
|
+
throw new OpenGeniApiError(502, "retained artifact checksum mismatch");
|
|
2832
|
+
}
|
|
2833
|
+
return bytes;
|
|
2834
|
+
}
|
|
2835
|
+
async getRetainedArtifactContentAtPath(path, options) {
|
|
2148
2836
|
if (options.range && (options.range.length > 128 || /[^\x20-\x7e]/.test(options.range))) {
|
|
2149
2837
|
throw new RangeError("retained artifact range must be at most 128 printable ASCII bytes");
|
|
2150
2838
|
}
|
|
2151
2839
|
const correlationId = crypto.randomUUID();
|
|
2152
|
-
const response = await this.fetchImpl(
|
|
2153
|
-
|
|
2154
|
-
{
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
...options.signal ? { signal: options.signal } : {}
|
|
2162
|
-
}
|
|
2163
|
-
);
|
|
2840
|
+
const response = await this.fetchImpl(this.url(path), {
|
|
2841
|
+
method: "GET",
|
|
2842
|
+
headers: {
|
|
2843
|
+
...this.headers(correlationId),
|
|
2844
|
+
Accept: "application/octet-stream",
|
|
2845
|
+
...options.range ? { Range: options.range } : {}
|
|
2846
|
+
},
|
|
2847
|
+
...options.signal ? { signal: options.signal } : {}
|
|
2848
|
+
});
|
|
2164
2849
|
try {
|
|
2165
2850
|
assertApiContractResponse(response);
|
|
2166
2851
|
} catch (error) {
|
|
@@ -2203,11 +2888,57 @@ var OpenGeniClient = class {
|
|
|
2203
2888
|
};
|
|
2204
2889
|
}
|
|
2205
2890
|
/** Mint a short-lived signed download URL for a ready file. */
|
|
2206
|
-
async createFileDownloadUrl(workspaceId, fileId) {
|
|
2891
|
+
async createFileDownloadUrl(workspaceId, fileId, options = {}) {
|
|
2892
|
+
return await this.requestJson(
|
|
2893
|
+
"POST",
|
|
2894
|
+
`/v1/workspaces/${workspaceId}/files/${fileId}/download-url`,
|
|
2895
|
+
void 0,
|
|
2896
|
+
{},
|
|
2897
|
+
options
|
|
2898
|
+
);
|
|
2899
|
+
}
|
|
2900
|
+
// --- Video generation ---------------------------------------------------------------
|
|
2901
|
+
/** Read the effective workspace policy and executable Seedance capabilities. */
|
|
2902
|
+
async getVideoGenerationSettings(workspaceId, options = {}) {
|
|
2903
|
+
return await this.requestJson(
|
|
2904
|
+
"GET",
|
|
2905
|
+
`/v1/workspaces/${workspaceId}/video-generation`,
|
|
2906
|
+
void 0,
|
|
2907
|
+
{},
|
|
2908
|
+
options
|
|
2909
|
+
);
|
|
2910
|
+
}
|
|
2911
|
+
/** Replace the enabled video models/default under optimistic policy revision control. */
|
|
2912
|
+
async updateVideoGenerationPolicy(workspaceId, request, options = {}) {
|
|
2207
2913
|
return await this.requestJson(
|
|
2914
|
+
"PUT",
|
|
2915
|
+
`/v1/workspaces/${workspaceId}/video-generation/policy`,
|
|
2916
|
+
request,
|
|
2917
|
+
{},
|
|
2918
|
+
options
|
|
2919
|
+
);
|
|
2920
|
+
}
|
|
2921
|
+
/** Read durable progress for one accepted video generation operation. */
|
|
2922
|
+
async getVideoGenerationOperation(workspaceId, operationId, options = {}) {
|
|
2923
|
+
return await this.requestJson(
|
|
2924
|
+
"GET",
|
|
2925
|
+
`/v1/workspaces/${workspaceId}/video-generation/operations/${operationId}`,
|
|
2926
|
+
void 0,
|
|
2927
|
+
{},
|
|
2928
|
+
options
|
|
2929
|
+
);
|
|
2930
|
+
}
|
|
2931
|
+
/** Mint a short-lived zero-copy URL for native Range-based video playback. */
|
|
2932
|
+
async createVideoArtifactPlaybackSource(workspaceId, artifactId, options = {}) {
|
|
2933
|
+
const source = await this.requestJson(
|
|
2208
2934
|
"POST",
|
|
2209
|
-
`/v1/workspaces/${workspaceId}/
|
|
2935
|
+
`/v1/workspaces/${workspaceId}/artifacts/${artifactId}/playback-source`,
|
|
2936
|
+
void 0,
|
|
2937
|
+
{},
|
|
2938
|
+
options
|
|
2210
2939
|
);
|
|
2940
|
+
assertSafeVideoArtifactPlaybackSource(source, artifactId);
|
|
2941
|
+
return source;
|
|
2211
2942
|
}
|
|
2212
2943
|
// --- Documents ----------------------------------------------------------------------
|
|
2213
2944
|
async createDocumentBase(workspaceId, request) {
|
|
@@ -2380,6 +3111,37 @@ var OpenGeniClient = class {
|
|
|
2380
3111
|
request
|
|
2381
3112
|
);
|
|
2382
3113
|
}
|
|
3114
|
+
/** Resolve pinned components, Variable Set, and Rig requirements before installation. */
|
|
3115
|
+
async previewPackInstallation(workspaceId, packId, request = {}) {
|
|
3116
|
+
return await this.requestJson(
|
|
3117
|
+
"POST",
|
|
3118
|
+
`/v1/workspaces/${workspaceId}/packs/${encodeURIComponent(packId)}/installation-preview`,
|
|
3119
|
+
request
|
|
3120
|
+
);
|
|
3121
|
+
}
|
|
3122
|
+
/** Install, update, or repair a Pack from an exact previewed manifest. */
|
|
3123
|
+
async installPack(workspaceId, packId, request) {
|
|
3124
|
+
return await this.requestJson(
|
|
3125
|
+
"POST",
|
|
3126
|
+
`/v1/workspaces/${workspaceId}/packs/${encodeURIComponent(packId)}/install`,
|
|
3127
|
+
request
|
|
3128
|
+
);
|
|
3129
|
+
}
|
|
3130
|
+
/** Preview which Pack-owned components will be retained by other owners. */
|
|
3131
|
+
async previewPackUninstall(workspaceId, packId) {
|
|
3132
|
+
return await this.requestJson(
|
|
3133
|
+
"GET",
|
|
3134
|
+
`/v1/workspaces/${workspaceId}/packs/${encodeURIComponent(packId)}/uninstall-preview`
|
|
3135
|
+
);
|
|
3136
|
+
}
|
|
3137
|
+
/** Safely release Pack ownership and disable only now-ownerless components. */
|
|
3138
|
+
async uninstallPack(workspaceId, packId, request) {
|
|
3139
|
+
return await this.requestJson(
|
|
3140
|
+
"DELETE",
|
|
3141
|
+
`/v1/workspaces/${workspaceId}/packs/${encodeURIComponent(packId)}/installation`,
|
|
3142
|
+
request
|
|
3143
|
+
);
|
|
3144
|
+
}
|
|
2383
3145
|
/** Unregister a workspace-scoped pack (built-in packs cannot be deleted). */
|
|
2384
3146
|
async deletePack(workspaceId, packId) {
|
|
2385
3147
|
await this.requestVoid(
|
|
@@ -2433,6 +3195,189 @@ var OpenGeniClient = class {
|
|
|
2433
3195
|
}
|
|
2434
3196
|
);
|
|
2435
3197
|
}
|
|
3198
|
+
/** List installed protocol-neutral OpenAPI and GraphQL Integrations. */
|
|
3199
|
+
async listApiIntegrations(workspaceId) {
|
|
3200
|
+
return await this.requestJson(
|
|
3201
|
+
"GET",
|
|
3202
|
+
`/v1/workspaces/${workspaceId}/integrations`
|
|
3203
|
+
);
|
|
3204
|
+
}
|
|
3205
|
+
/** List curated provider presets without exposing deployment OAuth credentials. */
|
|
3206
|
+
async listApiIntegrationPresets(workspaceId) {
|
|
3207
|
+
return await this.requestJson(
|
|
3208
|
+
"GET",
|
|
3209
|
+
`/v1/workspaces/${workspaceId}/integrations/presets`
|
|
3210
|
+
);
|
|
3211
|
+
}
|
|
3212
|
+
/** Detect and compile an Integration without mutating workspace state. */
|
|
3213
|
+
async previewApiIntegration(workspaceId, request) {
|
|
3214
|
+
return await this.requestJson(
|
|
3215
|
+
"POST",
|
|
3216
|
+
`/v1/workspaces/${workspaceId}/integrations/preview`,
|
|
3217
|
+
request
|
|
3218
|
+
);
|
|
3219
|
+
}
|
|
3220
|
+
/** Start a signed PKCE OAuth flow for a built-in Google or Microsoft preset. */
|
|
3221
|
+
async startApiIntegrationOAuth(workspaceId, request) {
|
|
3222
|
+
return await this.requestJson(
|
|
3223
|
+
"POST",
|
|
3224
|
+
`/v1/workspaces/${workspaceId}/integrations/oauth/start`,
|
|
3225
|
+
request
|
|
3226
|
+
);
|
|
3227
|
+
}
|
|
3228
|
+
/** Install only the exact immutable revision and digest accepted in preview. */
|
|
3229
|
+
async installApiIntegration(workspaceId, request) {
|
|
3230
|
+
return await this.requestJson(
|
|
3231
|
+
"POST",
|
|
3232
|
+
`/v1/workspaces/${workspaceId}/integrations/install`,
|
|
3233
|
+
request
|
|
3234
|
+
);
|
|
3235
|
+
}
|
|
3236
|
+
async previewApiIntegrationUninstall(workspaceId, capabilityId, instanceKey) {
|
|
3237
|
+
return await this.requestJson(
|
|
3238
|
+
"GET",
|
|
3239
|
+
`/v1/workspaces/${workspaceId}/integrations/${encodeURIComponent(capabilityId)}/instances/${encodeURIComponent(instanceKey)}/uninstall-preview`
|
|
3240
|
+
);
|
|
3241
|
+
}
|
|
3242
|
+
/** Remove one Integration instance without deleting its Connection or sibling instances. */
|
|
3243
|
+
async uninstallApiIntegration(workspaceId, capabilityId, instanceKey, request) {
|
|
3244
|
+
return await this.requestJson(
|
|
3245
|
+
"DELETE",
|
|
3246
|
+
`/v1/workspaces/${workspaceId}/integrations/${encodeURIComponent(capabilityId)}/instances/${encodeURIComponent(instanceKey)}`,
|
|
3247
|
+
request
|
|
3248
|
+
);
|
|
3249
|
+
}
|
|
3250
|
+
/** List immutable provider facets and their exact per-account bindings. */
|
|
3251
|
+
async listIntegrationFeatures(workspaceId, capabilityId, instanceKey) {
|
|
3252
|
+
return await this.requestJson(
|
|
3253
|
+
"GET",
|
|
3254
|
+
`/v1/workspaces/${workspaceId}/integrations/${encodeURIComponent(capabilityId)}/instances/${encodeURIComponent(instanceKey)}/features`
|
|
3255
|
+
);
|
|
3256
|
+
}
|
|
3257
|
+
/** Configure or OCC-update one adapter-owned feature on an Integration instance. */
|
|
3258
|
+
async configureIntegrationFeature(workspaceId, capabilityId, instanceKey, featureKey, request) {
|
|
3259
|
+
return await this.requestJson(
|
|
3260
|
+
"PUT",
|
|
3261
|
+
`/v1/workspaces/${workspaceId}/integrations/${encodeURIComponent(capabilityId)}/instances/${encodeURIComponent(instanceKey)}/features/${encodeURIComponent(featureKey)}`,
|
|
3262
|
+
request
|
|
3263
|
+
);
|
|
3264
|
+
}
|
|
3265
|
+
/** Browse source metadata through one exact Google Drive Integration instance. */
|
|
3266
|
+
async browseGoogleDriveIntegrationSource(workspaceId, capabilityId, instanceKey, featureKey, options = {}) {
|
|
3267
|
+
const query = new URLSearchParams();
|
|
3268
|
+
if (options.parentId) query.set("parentId", options.parentId);
|
|
3269
|
+
if (options.pageToken) query.set("pageToken", options.pageToken);
|
|
3270
|
+
const suffix = query.size > 0 ? `?${query}` : "";
|
|
3271
|
+
return await this.requestJson(
|
|
3272
|
+
"GET",
|
|
3273
|
+
`/v1/workspaces/${workspaceId}/integrations/${encodeURIComponent(capabilityId)}/instances/${encodeURIComponent(instanceKey)}/features/${encodeURIComponent(featureKey)}/browse${suffix}`
|
|
3274
|
+
);
|
|
3275
|
+
}
|
|
3276
|
+
/** Verify and bind document sources to one exact Google Drive Integration instance. */
|
|
3277
|
+
async saveGoogleDriveIntegrationSource(workspaceId, capabilityId, instanceKey, featureKey, request) {
|
|
3278
|
+
return await this.requestJson(
|
|
3279
|
+
"PUT",
|
|
3280
|
+
`/v1/workspaces/${workspaceId}/integrations/${encodeURIComponent(capabilityId)}/instances/${encodeURIComponent(instanceKey)}/features/${encodeURIComponent(featureKey)}/source`,
|
|
3281
|
+
request
|
|
3282
|
+
);
|
|
3283
|
+
}
|
|
3284
|
+
async pauseIntegrationFeature(workspaceId, capabilityId, instanceKey, featureKey, request) {
|
|
3285
|
+
return await this.mutateIntegrationFeatureLifecycle(
|
|
3286
|
+
workspaceId,
|
|
3287
|
+
capabilityId,
|
|
3288
|
+
instanceKey,
|
|
3289
|
+
featureKey,
|
|
3290
|
+
"pause",
|
|
3291
|
+
request
|
|
3292
|
+
);
|
|
3293
|
+
}
|
|
3294
|
+
async resumeIntegrationFeature(workspaceId, capabilityId, instanceKey, featureKey, request) {
|
|
3295
|
+
return await this.mutateIntegrationFeatureLifecycle(
|
|
3296
|
+
workspaceId,
|
|
3297
|
+
capabilityId,
|
|
3298
|
+
instanceKey,
|
|
3299
|
+
featureKey,
|
|
3300
|
+
"resume",
|
|
3301
|
+
request
|
|
3302
|
+
);
|
|
3303
|
+
}
|
|
3304
|
+
async removeIntegrationFeature(workspaceId, capabilityId, instanceKey, featureKey, request) {
|
|
3305
|
+
return await this.requestJson(
|
|
3306
|
+
"DELETE",
|
|
3307
|
+
`/v1/workspaces/${workspaceId}/integrations/${encodeURIComponent(capabilityId)}/instances/${encodeURIComponent(instanceKey)}/features/${encodeURIComponent(featureKey)}`,
|
|
3308
|
+
request
|
|
3309
|
+
);
|
|
3310
|
+
}
|
|
3311
|
+
async mutateIntegrationFeatureLifecycle(workspaceId, capabilityId, instanceKey, featureKey, action, request) {
|
|
3312
|
+
return await this.requestJson(
|
|
3313
|
+
"POST",
|
|
3314
|
+
`/v1/workspaces/${workspaceId}/integrations/${encodeURIComponent(capabilityId)}/instances/${encodeURIComponent(instanceKey)}/features/${encodeURIComponent(featureKey)}/${action}`,
|
|
3315
|
+
request
|
|
3316
|
+
);
|
|
3317
|
+
}
|
|
3318
|
+
async previewPlugin(workspaceId, request) {
|
|
3319
|
+
return await this.requestJson(
|
|
3320
|
+
"POST",
|
|
3321
|
+
`/v1/workspaces/${workspaceId}/plugins/preview`,
|
|
3322
|
+
request
|
|
3323
|
+
);
|
|
3324
|
+
}
|
|
3325
|
+
async listInstalledPlugins(workspaceId) {
|
|
3326
|
+
return await this.requestJson(
|
|
3327
|
+
"GET",
|
|
3328
|
+
`/v1/workspaces/${workspaceId}/plugins`
|
|
3329
|
+
);
|
|
3330
|
+
}
|
|
3331
|
+
async installPlugin(workspaceId, request) {
|
|
3332
|
+
return await this.requestJson(
|
|
3333
|
+
"POST",
|
|
3334
|
+
`/v1/workspaces/${workspaceId}/plugins/install`,
|
|
3335
|
+
request
|
|
3336
|
+
);
|
|
3337
|
+
}
|
|
3338
|
+
async previewPluginUninstall(workspaceId, pluginKey) {
|
|
3339
|
+
return await this.requestJson(
|
|
3340
|
+
"GET",
|
|
3341
|
+
`/v1/workspaces/${workspaceId}/plugins/${encodeURIComponent(pluginKey)}/uninstall-preview`
|
|
3342
|
+
);
|
|
3343
|
+
}
|
|
3344
|
+
async uninstallPlugin(workspaceId, pluginKey, request) {
|
|
3345
|
+
return await this.requestJson(
|
|
3346
|
+
"DELETE",
|
|
3347
|
+
`/v1/workspaces/${workspaceId}/plugins/${encodeURIComponent(pluginKey)}`,
|
|
3348
|
+
request
|
|
3349
|
+
);
|
|
3350
|
+
}
|
|
3351
|
+
/** Resolve one public skills.sh or GitHub Skill folder to an immutable review preview. */
|
|
3352
|
+
async previewSkillImport(workspaceId, request) {
|
|
3353
|
+
return await this.requestJson(
|
|
3354
|
+
"POST",
|
|
3355
|
+
`/v1/workspaces/${workspaceId}/skills/preview`,
|
|
3356
|
+
request
|
|
3357
|
+
);
|
|
3358
|
+
}
|
|
3359
|
+
/** Install only the exact commit and full-content digest accepted during preview. */
|
|
3360
|
+
async installSkill(workspaceId, request) {
|
|
3361
|
+
return await this.requestJson(
|
|
3362
|
+
"POST",
|
|
3363
|
+
`/v1/workspaces/${workspaceId}/skills/install`,
|
|
3364
|
+
request
|
|
3365
|
+
);
|
|
3366
|
+
}
|
|
3367
|
+
async previewSkillUninstall(workspaceId, capabilityId) {
|
|
3368
|
+
return await this.requestJson(
|
|
3369
|
+
"GET",
|
|
3370
|
+
`/v1/workspaces/${workspaceId}/skills/${encodeURIComponent(capabilityId)}/uninstall-preview`
|
|
3371
|
+
);
|
|
3372
|
+
}
|
|
3373
|
+
/** Remove the direct owner under an optimistic installation-version fence. */
|
|
3374
|
+
async uninstallSkill(workspaceId, capabilityId, request) {
|
|
3375
|
+
return await this.requestJson(
|
|
3376
|
+
"DELETE",
|
|
3377
|
+
`/v1/workspaces/${workspaceId}/skills/${encodeURIComponent(capabilityId)}`,
|
|
3378
|
+
request
|
|
3379
|
+
);
|
|
3380
|
+
}
|
|
2436
3381
|
// --- Connections -------------------------------------------------------------------------------
|
|
2437
3382
|
async listConnections(workspaceId) {
|
|
2438
3383
|
const response = await this.requestJson(
|
|
@@ -2441,6 +3386,14 @@ var OpenGeniClient = class {
|
|
|
2441
3386
|
);
|
|
2442
3387
|
return response.connections;
|
|
2443
3388
|
}
|
|
3389
|
+
/** List the secret-free Slack team -> OpenGeni tenant routing authority. */
|
|
3390
|
+
async listSlackInstallationBindings(workspaceId) {
|
|
3391
|
+
const response = await this.requestJson(
|
|
3392
|
+
"GET",
|
|
3393
|
+
`/v1/workspaces/${workspaceId}/connections/slack-bot/bindings`
|
|
3394
|
+
);
|
|
3395
|
+
return response.bindings;
|
|
3396
|
+
}
|
|
2444
3397
|
async createConnection(workspaceId, request) {
|
|
2445
3398
|
const response = await this.requestJson(
|
|
2446
3399
|
"POST",
|
|
@@ -2538,8 +3491,13 @@ var OpenGeniClient = class {
|
|
|
2538
3491
|
}
|
|
2539
3492
|
// --- GitHub ----------------------------------------------------------------------------------
|
|
2540
3493
|
/** GitHub App server configuration plus truthful workspace binding status. */
|
|
2541
|
-
async getGitHubApp(workspaceId) {
|
|
2542
|
-
return await this.requestJson(
|
|
3494
|
+
async getGitHubApp(workspaceId, options = {}) {
|
|
3495
|
+
return await this.requestJson(
|
|
3496
|
+
"GET",
|
|
3497
|
+
`/v1/workspaces/${workspaceId}/github/app`,
|
|
3498
|
+
void 0,
|
|
3499
|
+
options.returnPath ? { returnPath: options.returnPath } : void 0
|
|
3500
|
+
);
|
|
2543
3501
|
}
|
|
2544
3502
|
/** Build the GitHub owner-consent entry URL for fresh workspace-bound state. */
|
|
2545
3503
|
githubConnectUrl(workspaceId, state) {
|
|
@@ -2769,6 +3727,7 @@ var OpenGeniClient = class {
|
|
|
2769
3727
|
{ target }
|
|
2770
3728
|
);
|
|
2771
3729
|
}
|
|
3730
|
+
/** Contract-checked JSON transport shared by opt-in typed SDK clients. */
|
|
2772
3731
|
async requestJson(method, path, body, query = {}, options = {}) {
|
|
2773
3732
|
const correlationId = crypto.randomUUID();
|
|
2774
3733
|
let response;
|
|
@@ -2803,6 +3762,29 @@ var OpenGeniClient = class {
|
|
|
2803
3762
|
throw error;
|
|
2804
3763
|
}
|
|
2805
3764
|
}
|
|
3765
|
+
/** Authenticated, contract-checked response for bounded streaming downloads. */
|
|
3766
|
+
async requestResponse(method, path, query = {}, options = {}) {
|
|
3767
|
+
const correlationId = crypto.randomUUID();
|
|
3768
|
+
let response;
|
|
3769
|
+
try {
|
|
3770
|
+
response = await this.fetchImpl(this.url(path, query), {
|
|
3771
|
+
method,
|
|
3772
|
+
headers: {
|
|
3773
|
+
...this.headers(correlationId),
|
|
3774
|
+
Accept: "application/octet-stream"
|
|
3775
|
+
},
|
|
3776
|
+
...options.signal ? { signal: options.signal } : {}
|
|
3777
|
+
});
|
|
3778
|
+
} catch (error) {
|
|
3779
|
+
if (isMutationMethod(method)) throw mutationTransportError(correlationId);
|
|
3780
|
+
throw error;
|
|
3781
|
+
}
|
|
3782
|
+
assertApiContractResponse(response);
|
|
3783
|
+
if (!response.ok) {
|
|
3784
|
+
throw await apiErrorFromResponse(response, { method, correlationId });
|
|
3785
|
+
}
|
|
3786
|
+
return response;
|
|
3787
|
+
}
|
|
2806
3788
|
/** Like `requestJson` for endpoints that respond with no body (204). */
|
|
2807
3789
|
async requestVoid(method, path, body) {
|
|
2808
3790
|
const correlationId = crypto.randomUUID();
|
|
@@ -2843,7 +3825,10 @@ function isTranscribeAudioResponse(value) {
|
|
|
2843
3825
|
function isUploadTranscriptionRecordingChunkResponse(value) {
|
|
2844
3826
|
if (!value || typeof value !== "object" || Array.isArray(value)) return false;
|
|
2845
3827
|
const record = value;
|
|
2846
|
-
if (!isTranscriptionRecordingResponse({
|
|
3828
|
+
if (!isTranscriptionRecordingResponse({
|
|
3829
|
+
recording: record.recording,
|
|
3830
|
+
segments: []
|
|
3831
|
+
})) {
|
|
2847
3832
|
return false;
|
|
2848
3833
|
}
|
|
2849
3834
|
if (!record.chunk || typeof record.chunk !== "object" || Array.isArray(record.chunk)) {
|
|
@@ -2947,9 +3932,39 @@ async function sha256ForUpload(body) {
|
|
|
2947
3932
|
const digest = await globalThis.crypto.subtle.digest("SHA-256", bytes);
|
|
2948
3933
|
return [...new Uint8Array(digest)].map((byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
2949
3934
|
}
|
|
3935
|
+
async function sha256Hex(bytes) {
|
|
3936
|
+
const owned = Uint8Array.from(bytes);
|
|
3937
|
+
const digest = await globalThis.crypto.subtle.digest("SHA-256", owned.buffer);
|
|
3938
|
+
return [...new Uint8Array(digest)].map((byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
3939
|
+
}
|
|
2950
3940
|
async function cancelResponseBody(response, reason) {
|
|
2951
3941
|
await response.body?.cancel(reason).catch(() => void 0);
|
|
2952
3942
|
}
|
|
3943
|
+
function assertRetainedGeneratedImageReceipt(workspaceId, artifact) {
|
|
3944
|
+
if (!parseRetainedGeneratedImageReference(artifact, workspaceId)) {
|
|
3945
|
+
throw new OpenGeniApiError(502, "retained generated image receipt is invalid");
|
|
3946
|
+
}
|
|
3947
|
+
}
|
|
3948
|
+
function assertSafeArtifactDownloadUrl(value) {
|
|
3949
|
+
if (!value || typeof value.url !== "string" || typeof value.expiresAt !== "string" || !Number.isFinite(Date.parse(value.expiresAt))) {
|
|
3950
|
+
throw new OpenGeniApiError(502, "retained artifact download URL is invalid");
|
|
3951
|
+
}
|
|
3952
|
+
let parsed;
|
|
3953
|
+
try {
|
|
3954
|
+
parsed = new URL(value.url);
|
|
3955
|
+
} catch {
|
|
3956
|
+
throw new OpenGeniApiError(502, "retained artifact download URL is invalid");
|
|
3957
|
+
}
|
|
3958
|
+
if (!["http:", "https:"].includes(parsed.protocol) || parsed.username || parsed.password) {
|
|
3959
|
+
throw new OpenGeniApiError(502, "retained artifact download URL is unsafe");
|
|
3960
|
+
}
|
|
3961
|
+
}
|
|
3962
|
+
function assertSafeVideoArtifactPlaybackSource(value, expectedArtifactId) {
|
|
3963
|
+
if (!value || value.schemaVersion !== 1 || value.artifactId !== expectedArtifactId || value.contentType !== "video/mp4" || value.acceptRanges !== "bytes" || !Number.isSafeInteger(value.sizeBytes) || value.sizeBytes <= 0 || value.sizeBytes > GENERATED_VIDEO_MAX_BYTES || !/^[0-9a-f]{64}$/.test(value.sha256)) {
|
|
3964
|
+
throw new OpenGeniApiError(502, "generated-video playback source is invalid");
|
|
3965
|
+
}
|
|
3966
|
+
assertSafeArtifactDownloadUrl({ url: value.url, expiresAt: value.expiresAt });
|
|
3967
|
+
}
|
|
2953
3968
|
function parseBoundedContentLength(value) {
|
|
2954
3969
|
if (value === null) return null;
|
|
2955
3970
|
if (!/^\d+$/.test(value)) {
|
|
@@ -2997,246 +4012,16 @@ async function readBoundedResponseBytes(response, maxBytes, expectedBytes) {
|
|
|
2997
4012
|
return bytes;
|
|
2998
4013
|
}
|
|
2999
4014
|
|
|
3000
|
-
// src/transcription.ts
|
|
3001
|
-
var DEFAULT_WORKSPACE_TRANSCRIPTION_POLICY = {
|
|
3002
|
-
enabled: false,
|
|
3003
|
-
acceptanceId: null,
|
|
3004
|
-
primary: null,
|
|
3005
|
-
language: null,
|
|
3006
|
-
autoDetectLanguage: false,
|
|
3007
|
-
diarization: { enabled: false, maxSpeakers: null },
|
|
3008
|
-
retention: { mode: "none", maxDays: null },
|
|
3009
|
-
privacy: { allowProviderLogging: false, allowProviderTraining: false },
|
|
3010
|
-
fallback: { mode: "disabled", targets: [] },
|
|
3011
|
-
cost: { currency: "USD", maxPerHour: null, maxPerMonth: null }
|
|
3012
|
-
};
|
|
3013
|
-
function resolveWorkspaceVoiceInputEnabled(settings) {
|
|
3014
|
-
if (!isRecord(settings)) return null;
|
|
3015
|
-
const voiceInput = settings.voiceInput;
|
|
3016
|
-
if (isRecord(voiceInput) && typeof voiceInput.enabled === "boolean") {
|
|
3017
|
-
return voiceInput.enabled;
|
|
3018
|
-
}
|
|
3019
|
-
const legacy = settings.transcription;
|
|
3020
|
-
return isRecord(legacy) && typeof legacy.enabled === "boolean" ? legacy.enabled : null;
|
|
3021
|
-
}
|
|
3022
|
-
function resolveWorkspaceTranscriptionPolicy(settings) {
|
|
3023
|
-
if (!isRecord(settings)) return cloneDefaultPolicy();
|
|
3024
|
-
const candidate = settings.transcription;
|
|
3025
|
-
if (!isWorkspaceTranscriptionPolicy(candidate)) return cloneDefaultPolicy();
|
|
3026
|
-
return {
|
|
3027
|
-
...candidate,
|
|
3028
|
-
primary: candidate.primary ? normalizeTarget(candidate.primary) : null,
|
|
3029
|
-
language: candidate.language?.trim() ?? null,
|
|
3030
|
-
diarization: { ...candidate.diarization },
|
|
3031
|
-
retention: { ...candidate.retention },
|
|
3032
|
-
privacy: { ...candidate.privacy },
|
|
3033
|
-
fallback: {
|
|
3034
|
-
mode: candidate.fallback.mode,
|
|
3035
|
-
targets: candidate.fallback.targets.map(normalizeTarget)
|
|
3036
|
-
},
|
|
3037
|
-
cost: { ...candidate.cost }
|
|
3038
|
-
};
|
|
3039
|
-
}
|
|
3040
|
-
function authorizeTranscriptionAdapter(policy, descriptor, selection = { kind: "primary" }) {
|
|
3041
|
-
if (!isWorkspaceTranscriptionPolicy(policy)) {
|
|
3042
|
-
return { authorized: false, reason: "unaccepted" };
|
|
3043
|
-
}
|
|
3044
|
-
if (!policy.enabled) return { authorized: false, reason: "disabled" };
|
|
3045
|
-
if (!policy.acceptanceId) return { authorized: false, reason: "unaccepted" };
|
|
3046
|
-
let target;
|
|
3047
|
-
if (selection.kind === "primary") {
|
|
3048
|
-
target = policy.primary;
|
|
3049
|
-
} else {
|
|
3050
|
-
if (policy.fallback.mode !== "explicit") {
|
|
3051
|
-
return { authorized: false, reason: "fallback_disabled" };
|
|
3052
|
-
}
|
|
3053
|
-
target = policy.fallback.targets[selection.index];
|
|
3054
|
-
if (!target) return { authorized: false, reason: "fallback_unaccepted" };
|
|
3055
|
-
}
|
|
3056
|
-
if (!target) return { authorized: false, reason: "target_missing" };
|
|
3057
|
-
const acceptedTarget = normalizeTarget(target);
|
|
3058
|
-
if (acceptedTarget.provider !== descriptor.provider) {
|
|
3059
|
-
return { authorized: false, reason: "provider_mismatch" };
|
|
3060
|
-
}
|
|
3061
|
-
if (acceptedTarget.model !== descriptor.model) {
|
|
3062
|
-
return { authorized: false, reason: "model_mismatch" };
|
|
3063
|
-
}
|
|
3064
|
-
if (acceptedTarget.credentialMode !== descriptor.credentialMode) {
|
|
3065
|
-
return { authorized: false, reason: "credential_mode_mismatch" };
|
|
3066
|
-
}
|
|
3067
|
-
if (acceptedTarget.region !== descriptor.region) {
|
|
3068
|
-
return { authorized: false, reason: "region_mismatch" };
|
|
3069
|
-
}
|
|
3070
|
-
return {
|
|
3071
|
-
authorized: true,
|
|
3072
|
-
acceptanceId: policy.acceptanceId,
|
|
3073
|
-
target: acceptedTarget,
|
|
3074
|
-
selection
|
|
3075
|
-
};
|
|
3076
|
-
}
|
|
3077
|
-
function createTranscriptionSessionRequest(input) {
|
|
3078
|
-
const sequenceFloor = input.sequenceFloor ?? 0;
|
|
3079
|
-
if (!Number.isSafeInteger(sequenceFloor) || sequenceFloor < 0) return null;
|
|
3080
|
-
const authorization = authorizeTranscriptionAdapter(
|
|
3081
|
-
input.policy,
|
|
3082
|
-
input.adapter.descriptor,
|
|
3083
|
-
input.selection
|
|
3084
|
-
);
|
|
3085
|
-
if (!authorization.authorized) return null;
|
|
3086
|
-
return {
|
|
3087
|
-
localSessionId: input.localSessionId,
|
|
3088
|
-
policyAcceptanceId: authorization.acceptanceId,
|
|
3089
|
-
selection: authorization.selection,
|
|
3090
|
-
target: { ...authorization.target },
|
|
3091
|
-
language: input.policy.language?.trim() ?? null,
|
|
3092
|
-
autoDetectLanguage: input.policy.autoDetectLanguage,
|
|
3093
|
-
diarization: { ...input.policy.diarization },
|
|
3094
|
-
retention: { ...input.policy.retention },
|
|
3095
|
-
privacy: { ...input.policy.privacy },
|
|
3096
|
-
cost: { ...input.policy.cost },
|
|
3097
|
-
sequenceFloor
|
|
3098
|
-
};
|
|
3099
|
-
}
|
|
3100
|
-
function cloneDefaultPolicy() {
|
|
3101
|
-
return {
|
|
3102
|
-
...DEFAULT_WORKSPACE_TRANSCRIPTION_POLICY,
|
|
3103
|
-
diarization: { ...DEFAULT_WORKSPACE_TRANSCRIPTION_POLICY.diarization },
|
|
3104
|
-
retention: { ...DEFAULT_WORKSPACE_TRANSCRIPTION_POLICY.retention },
|
|
3105
|
-
privacy: { ...DEFAULT_WORKSPACE_TRANSCRIPTION_POLICY.privacy },
|
|
3106
|
-
fallback: { mode: "disabled", targets: [] },
|
|
3107
|
-
cost: { ...DEFAULT_WORKSPACE_TRANSCRIPTION_POLICY.cost }
|
|
3108
|
-
};
|
|
3109
|
-
}
|
|
3110
|
-
function isWorkspaceTranscriptionPolicy(value) {
|
|
3111
|
-
if (!isRecord(value) || typeof value.enabled !== "boolean") return false;
|
|
3112
|
-
if (!hasOnlyKeys(value, [
|
|
3113
|
-
"enabled",
|
|
3114
|
-
"acceptanceId",
|
|
3115
|
-
"primary",
|
|
3116
|
-
"language",
|
|
3117
|
-
"autoDetectLanguage",
|
|
3118
|
-
"diarization",
|
|
3119
|
-
"retention",
|
|
3120
|
-
"privacy",
|
|
3121
|
-
"fallback",
|
|
3122
|
-
"cost"
|
|
3123
|
-
])) {
|
|
3124
|
-
return false;
|
|
3125
|
-
}
|
|
3126
|
-
if (!(value.acceptanceId === null || isUuid(value.acceptanceId))) return false;
|
|
3127
|
-
if (!(value.primary === null || isTarget(value.primary))) return false;
|
|
3128
|
-
if (!(value.language === null || isBoundedString(value.language, 64))) return false;
|
|
3129
|
-
if (typeof value.autoDetectLanguage !== "boolean") return false;
|
|
3130
|
-
if (!isRecord(value.diarization) || !hasOnlyKeys(value.diarization, ["enabled", "maxSpeakers"]) || typeof value.diarization.enabled !== "boolean" || !(value.diarization.maxSpeakers === null || isBoundedInteger(value.diarization.maxSpeakers, 100) && value.diarization.maxSpeakers >= 2)) {
|
|
3131
|
-
return false;
|
|
3132
|
-
}
|
|
3133
|
-
if (!value.diarization.enabled && value.diarization.maxSpeakers !== null) return false;
|
|
3134
|
-
if (!isRecord(value.retention) || !hasOnlyKeys(value.retention, ["mode", "maxDays"])) {
|
|
3135
|
-
return false;
|
|
3136
|
-
}
|
|
3137
|
-
if (value.retention.mode !== "none" && value.retention.mode !== "provider-policy") return false;
|
|
3138
|
-
if (!(value.retention.maxDays === null || isBoundedInteger(value.retention.maxDays, 3650))) {
|
|
3139
|
-
return false;
|
|
3140
|
-
}
|
|
3141
|
-
if (!isRecord(value.privacy) || !hasOnlyKeys(value.privacy, ["allowProviderLogging", "allowProviderTraining"]) || typeof value.privacy.allowProviderLogging !== "boolean" || typeof value.privacy.allowProviderTraining !== "boolean") {
|
|
3142
|
-
return false;
|
|
3143
|
-
}
|
|
3144
|
-
if (!isRecord(value.fallback) || !hasOnlyKeys(value.fallback, ["mode", "targets"])) {
|
|
3145
|
-
return false;
|
|
3146
|
-
}
|
|
3147
|
-
if (value.fallback.mode !== "disabled" && value.fallback.mode !== "explicit") return false;
|
|
3148
|
-
if (!Array.isArray(value.fallback.targets) || value.fallback.targets.length > 8 || !value.fallback.targets.every(isTarget)) {
|
|
3149
|
-
return false;
|
|
3150
|
-
}
|
|
3151
|
-
if (value.fallback.mode === "disabled" && value.fallback.targets.length !== 0) return false;
|
|
3152
|
-
if (value.fallback.mode === "explicit" && value.fallback.targets.length === 0) return false;
|
|
3153
|
-
if (!isRecord(value.cost) || !hasOnlyKeys(value.cost, ["currency", "maxPerHour", "maxPerMonth"]) || value.cost.currency !== "USD") {
|
|
3154
|
-
return false;
|
|
3155
|
-
}
|
|
3156
|
-
if (!isNullableBoundedNumber(value.cost.maxPerHour, 1e4)) return false;
|
|
3157
|
-
if (!isNullableBoundedNumber(value.cost.maxPerMonth, 1e6)) return false;
|
|
3158
|
-
if (value.enabled && (!value.acceptanceId || !value.primary)) return false;
|
|
3159
|
-
if (value.enabled && !value.autoDetectLanguage && value.language === null) return false;
|
|
3160
|
-
if (value.autoDetectLanguage && value.language !== null) return false;
|
|
3161
|
-
const targets = [value.primary, ...value.fallback.targets].filter(
|
|
3162
|
-
(target) => target !== null
|
|
3163
|
-
);
|
|
3164
|
-
if (new Set(targets.map(targetKey)).size !== targets.length) return false;
|
|
3165
|
-
return true;
|
|
3166
|
-
}
|
|
3167
|
-
function targetKey(target) {
|
|
3168
|
-
return [
|
|
3169
|
-
target.provider.trim(),
|
|
3170
|
-
target.model?.trim() ?? "",
|
|
3171
|
-
target.credentialMode,
|
|
3172
|
-
target.credentialConnectionId ?? "",
|
|
3173
|
-
target.region?.trim() ?? ""
|
|
3174
|
-
].join("\0");
|
|
3175
|
-
}
|
|
3176
|
-
function isTarget(value) {
|
|
3177
|
-
if (!isRecord(value)) return false;
|
|
3178
|
-
if (!hasOnlyKeys(value, ["provider", "model", "credentialMode", "credentialConnectionId", "region"])) {
|
|
3179
|
-
return false;
|
|
3180
|
-
}
|
|
3181
|
-
if (!isBoundedString(value.provider, 128)) return false;
|
|
3182
|
-
if (!(value.model === null || isBoundedString(value.model, 256))) return false;
|
|
3183
|
-
if (value.credentialMode !== "managed" && value.credentialMode !== "byok") return false;
|
|
3184
|
-
if (value.provider.trim() === "azure-speech" && value.credentialMode !== "byok") return false;
|
|
3185
|
-
if (!(value.credentialConnectionId === null || isUuid(value.credentialConnectionId))) {
|
|
3186
|
-
return false;
|
|
3187
|
-
}
|
|
3188
|
-
if (!(value.region === null || isBoundedString(value.region, 128))) return false;
|
|
3189
|
-
if (value.credentialMode === "byok" && value.credentialConnectionId === null) return false;
|
|
3190
|
-
if (value.credentialMode === "managed" && value.credentialConnectionId !== null) return false;
|
|
3191
|
-
return true;
|
|
3192
|
-
}
|
|
3193
|
-
function normalizeTarget(target) {
|
|
3194
|
-
return {
|
|
3195
|
-
provider: target.provider.trim(),
|
|
3196
|
-
model: target.model?.trim() ?? null,
|
|
3197
|
-
credentialMode: target.credentialMode,
|
|
3198
|
-
credentialConnectionId: target.credentialConnectionId,
|
|
3199
|
-
region: target.region?.trim() ?? null
|
|
3200
|
-
};
|
|
3201
|
-
}
|
|
3202
|
-
function isRecord(value) {
|
|
3203
|
-
return typeof value === "object" && value !== null;
|
|
3204
|
-
}
|
|
3205
|
-
function hasOnlyKeys(value, keys) {
|
|
3206
|
-
const accepted = new Set(keys);
|
|
3207
|
-
return Object.keys(value).every((key) => accepted.has(key));
|
|
3208
|
-
}
|
|
3209
|
-
function isBoundedString(value, maximum) {
|
|
3210
|
-
return typeof value === "string" && value.trim().length > 0 && value.length <= maximum;
|
|
3211
|
-
}
|
|
3212
|
-
function isUuid(value) {
|
|
3213
|
-
return typeof value === "string" && /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value);
|
|
3214
|
-
}
|
|
3215
|
-
function isBoundedInteger(value, maximum) {
|
|
3216
|
-
return Number.isInteger(value) && value >= 0 && value <= maximum;
|
|
3217
|
-
}
|
|
3218
|
-
function isNullableBoundedNumber(value, maximum) {
|
|
3219
|
-
return value === null || typeof value === "number" && Number.isFinite(value) && value >= 0 && value <= maximum;
|
|
3220
|
-
}
|
|
3221
|
-
|
|
3222
4015
|
export {
|
|
3223
4016
|
parseSseStream,
|
|
3224
4017
|
streamSessionEvents,
|
|
3225
4018
|
streamWorkspaceControlEvents,
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
RETAINED_OUTPUT_MAX_PAGE_BYTES,
|
|
3234
|
-
KNOWN_USAGE_EVENT_TYPES,
|
|
3235
|
-
OpenGeniClient,
|
|
3236
|
-
DEFAULT_WORKSPACE_TRANSCRIPTION_POLICY,
|
|
3237
|
-
resolveWorkspaceVoiceInputEnabled,
|
|
3238
|
-
resolveWorkspaceTranscriptionPolicy,
|
|
3239
|
-
authorizeTranscriptionAdapter,
|
|
3240
|
-
createTranscriptionSessionRequest
|
|
4019
|
+
parseRetainedGeneratedImageReference,
|
|
4020
|
+
generatedImageSandboxPathMatches,
|
|
4021
|
+
parseGeneratedImageReceipt,
|
|
4022
|
+
parseRetainedGeneratedVideoReference,
|
|
4023
|
+
parseGeneratedVideoReceipt,
|
|
4024
|
+
parseMediaGenerationResult,
|
|
4025
|
+
OpenGeniClient
|
|
3241
4026
|
};
|
|
3242
|
-
//# sourceMappingURL=chunk-
|
|
4027
|
+
//# sourceMappingURL=chunk-ILQZR5N6.js.map
|