@opengeni/sdk 3.1.0 → 3.3.2
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 +60 -8
- package/dist/accounts.d.ts +5 -1
- package/dist/accounts.js +13 -1
- package/dist/accounts.js.map +1 -1
- package/dist/artifacts.js +5 -5
- package/dist/browser.js +3 -3
- package/dist/{chunk-YTAWBDO2.js → chunk-JUS2UYRP.js} +2 -1
- package/dist/chunk-JUS2UYRP.js.map +1 -0
- package/dist/{chunk-GW3EJ2GP.js → chunk-KKRO2VCP.js} +27 -2
- package/dist/{chunk-GW3EJ2GP.js.map → chunk-KKRO2VCP.js.map} +1 -1
- package/dist/{chunk-VUQZAB3O.js → chunk-QT3KFVDP.js} +2 -2
- package/dist/{chunk-7ZXBPJZP.js → chunk-TRNI7KEO.js} +213 -42
- package/dist/chunk-TRNI7KEO.js.map +1 -0
- package/dist/{chunk-TX3EIENU.js → chunk-YXQX7RQT.js} +2 -2
- package/dist/client.d.ts +35 -11
- package/dist/company-profile.d.ts +13 -0
- package/dist/core.js +4 -4
- package/dist/document-authority.js +4 -4
- package/dist/editable-artifacts.js +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +215 -5
- package/dist/index.js.map +1 -1
- package/dist/interaction.d.ts +3 -0
- package/dist/interaction.js +3 -1
- package/dist/realtime.d.ts +3 -1
- package/dist/realtime.js.map +1 -1
- package/dist/session-titles.d.ts +28 -0
- package/dist/types.d.ts +58 -2
- package/package.json +2 -2
- package/src/accounts.ts +18 -0
- package/src/client.ts +291 -35
- package/src/company-profile.ts +13 -0
- package/src/index.ts +18 -0
- package/src/interaction.ts +32 -0
- package/src/realtime.ts +1 -0
- package/src/session-titles.ts +84 -0
- package/src/types.ts +64 -1
- package/dist/chunk-7ZXBPJZP.js.map +0 -1
- package/dist/chunk-YTAWBDO2.js.map +0 -1
- /package/dist/{chunk-VUQZAB3O.js.map → chunk-QT3KFVDP.js.map} +0 -0
- /package/dist/{chunk-TX3EIENU.js.map → chunk-YXQX7RQT.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
OpenGeniDocumentAuthorityClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YXQX7RQT.js";
|
|
4
4
|
|
|
5
5
|
// src/artifact-client.ts
|
|
6
6
|
var OpenGeniClient = class extends OpenGeniDocumentAuthorityClient {
|
|
@@ -125,4 +125,4 @@ var OpenGeniClient = class extends OpenGeniDocumentAuthorityClient {
|
|
|
125
125
|
export {
|
|
126
126
|
OpenGeniClient
|
|
127
127
|
};
|
|
128
|
-
//# sourceMappingURL=chunk-
|
|
128
|
+
//# sourceMappingURL=chunk-QT3KFVDP.js.map
|
|
@@ -5,10 +5,11 @@ import {
|
|
|
5
5
|
OPENGENI_API_CONTRACT_REVISION,
|
|
6
6
|
OPENGENI_CORRELATION_HEADER,
|
|
7
7
|
RETAINED_OUTPUT_MAX_PAGE_BYTES
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-JUS2UYRP.js";
|
|
9
9
|
import {
|
|
10
|
-
OpenGeniInteractionClient
|
|
11
|
-
|
|
10
|
+
OpenGeniInteractionClient,
|
|
11
|
+
decodeComputerFrameMetadataHeader
|
|
12
|
+
} from "./chunk-KKRO2VCP.js";
|
|
12
13
|
import {
|
|
13
14
|
OpenGeniApiContractMismatchError,
|
|
14
15
|
OpenGeniApiError,
|
|
@@ -772,6 +773,8 @@ function createSingleFlightReadEntry(generation, onRequestStart) {
|
|
|
772
773
|
reject = entryReject;
|
|
773
774
|
});
|
|
774
775
|
return {
|
|
776
|
+
controller: new AbortController(),
|
|
777
|
+
consumers: 0,
|
|
775
778
|
generation,
|
|
776
779
|
promise,
|
|
777
780
|
resolve,
|
|
@@ -787,6 +790,26 @@ function assertNoMessageTools(input) {
|
|
|
787
790
|
);
|
|
788
791
|
}
|
|
789
792
|
}
|
|
793
|
+
function normalizeScheduledTaskMachineTarget(request) {
|
|
794
|
+
if (!("agentConfig" in request) || !request.agentConfig?.machineTarget) {
|
|
795
|
+
return request;
|
|
796
|
+
}
|
|
797
|
+
const { workingDir, ...machineTarget } = request.agentConfig.machineTarget;
|
|
798
|
+
if (workingDir === void 0) {
|
|
799
|
+
return request;
|
|
800
|
+
}
|
|
801
|
+
const normalizedWorkingDir = workingDir.trim();
|
|
802
|
+
return {
|
|
803
|
+
...request,
|
|
804
|
+
agentConfig: {
|
|
805
|
+
...request.agentConfig,
|
|
806
|
+
machineTarget: {
|
|
807
|
+
...machineTarget,
|
|
808
|
+
...normalizedWorkingDir ? { workingDir: normalizedWorkingDir } : {}
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
};
|
|
812
|
+
}
|
|
790
813
|
var OpenGeniClient = class {
|
|
791
814
|
baseUrl;
|
|
792
815
|
options;
|
|
@@ -1007,7 +1030,11 @@ var OpenGeniClient = class {
|
|
|
1007
1030
|
}
|
|
1008
1031
|
async getSession(workspaceId, sessionId, options = {}) {
|
|
1009
1032
|
const path = `/v1/workspaces/${workspaceId}/sessions/${sessionId}`;
|
|
1010
|
-
return await this.sharedRead(
|
|
1033
|
+
return await this.sharedRead(
|
|
1034
|
+
path,
|
|
1035
|
+
(signal) => this.requestJson("GET", path, void 0, {}, { signal }),
|
|
1036
|
+
options
|
|
1037
|
+
);
|
|
1011
1038
|
}
|
|
1012
1039
|
async updateSession(workspaceId, sessionId, request) {
|
|
1013
1040
|
return await this.requestJson(
|
|
@@ -1107,7 +1134,8 @@ var OpenGeniClient = class {
|
|
|
1107
1134
|
...search ? { search } : {},
|
|
1108
1135
|
...options.pinsOnly ? { pinsOnly: "true" } : {},
|
|
1109
1136
|
...options.archivedOnly ? { archivedOnly: "true" } : {}
|
|
1110
|
-
}
|
|
1137
|
+
},
|
|
1138
|
+
{ signal: options.signal }
|
|
1111
1139
|
);
|
|
1112
1140
|
} catch (error) {
|
|
1113
1141
|
if (error instanceof OpenGeniApiError && error.status === 410) {
|
|
@@ -1201,47 +1229,48 @@ var OpenGeniClient = class {
|
|
|
1201
1229
|
const path = `/v1/workspaces/${workspaceId}/sessions/${sessionId}/lineage`;
|
|
1202
1230
|
return await this.sharedRead(
|
|
1203
1231
|
path,
|
|
1204
|
-
() => this.requestJson("GET", path),
|
|
1232
|
+
(signal) => this.requestJson("GET", path, void 0, {}, { signal }),
|
|
1205
1233
|
options
|
|
1206
1234
|
);
|
|
1207
1235
|
}
|
|
1208
1236
|
sharedRead(key, read, options = {}) {
|
|
1237
|
+
if (options.signal?.aborted) {
|
|
1238
|
+
return Promise.reject(
|
|
1239
|
+
options.signal.reason ?? new DOMException("Request aborted", "AbortError")
|
|
1240
|
+
);
|
|
1241
|
+
}
|
|
1209
1242
|
const existing = this.active.get(key);
|
|
1210
1243
|
if (existing) {
|
|
1211
1244
|
if (!options.fresh) {
|
|
1212
1245
|
this.observeRead(existing, options.onRequestStart);
|
|
1213
|
-
return existing.
|
|
1246
|
+
return this.consumeSharedRead(key, existing, options.signal);
|
|
1214
1247
|
}
|
|
1215
1248
|
const requiredGeneration = existing.generation + 1;
|
|
1216
1249
|
const queued2 = this.queued.get(key);
|
|
1217
1250
|
if (queued2 && queued2.generation >= requiredGeneration) {
|
|
1218
1251
|
this.observeRead(queued2, options.onRequestStart);
|
|
1219
|
-
return queued2.
|
|
1252
|
+
return this.consumeSharedRead(key, queued2, options.signal);
|
|
1220
1253
|
}
|
|
1221
1254
|
const predecessor = queued2?.promise ?? existing.promise;
|
|
1222
|
-
return this.queueRead(key, predecessor, requiredGeneration, read, options
|
|
1255
|
+
return this.queueRead(key, predecessor, requiredGeneration, read, options);
|
|
1223
1256
|
}
|
|
1224
1257
|
const queued = this.queued.get(key);
|
|
1225
1258
|
if (queued && (!options.fresh || !queued.started)) {
|
|
1226
1259
|
this.observeRead(queued, options.onRequestStart);
|
|
1227
|
-
return queued.
|
|
1260
|
+
return this.consumeSharedRead(key, queued, options.signal);
|
|
1228
1261
|
}
|
|
1229
1262
|
if (queued) {
|
|
1230
|
-
return this.queueRead(
|
|
1231
|
-
key,
|
|
1232
|
-
queued.promise,
|
|
1233
|
-
queued.generation + 1,
|
|
1234
|
-
read,
|
|
1235
|
-
options.onRequestStart
|
|
1236
|
-
);
|
|
1263
|
+
return this.queueRead(key, queued.promise, queued.generation + 1, read, options);
|
|
1237
1264
|
}
|
|
1238
1265
|
const generation = (this.generations.get(key) ?? 0) + 1;
|
|
1239
1266
|
const entry = createSingleFlightReadEntry(generation, options.onRequestStart);
|
|
1267
|
+
const consumed = this.consumeSharedRead(key, entry, options.signal);
|
|
1240
1268
|
this.launchRead(key, entry, read);
|
|
1241
|
-
return
|
|
1269
|
+
return consumed;
|
|
1242
1270
|
}
|
|
1243
|
-
queueRead(key, predecessor, generation, read,
|
|
1244
|
-
const entry = createSingleFlightReadEntry(generation, onRequestStart);
|
|
1271
|
+
queueRead(key, predecessor, generation, read, options) {
|
|
1272
|
+
const entry = createSingleFlightReadEntry(generation, options.onRequestStart);
|
|
1273
|
+
const consumed = this.consumeSharedRead(key, entry, options.signal);
|
|
1245
1274
|
this.queued.set(key, entry);
|
|
1246
1275
|
const launch = () => this.launchRead(key, entry, read);
|
|
1247
1276
|
void predecessor.then(launch, launch);
|
|
@@ -1251,9 +1280,10 @@ var OpenGeniClient = class {
|
|
|
1251
1280
|
if (!this.active.has(key)) this.generations.delete(key);
|
|
1252
1281
|
};
|
|
1253
1282
|
void entry.promise.then(clear, clear);
|
|
1254
|
-
return
|
|
1283
|
+
return consumed;
|
|
1255
1284
|
}
|
|
1256
1285
|
launchRead(key, entry, read) {
|
|
1286
|
+
if (entry.controller.signal.aborted) return;
|
|
1257
1287
|
entry.started = true;
|
|
1258
1288
|
this.generations.set(key, entry.generation);
|
|
1259
1289
|
this.active.set(key, entry);
|
|
@@ -1275,7 +1305,7 @@ var OpenGeniClient = class {
|
|
|
1275
1305
|
};
|
|
1276
1306
|
let request;
|
|
1277
1307
|
try {
|
|
1278
|
-
request = read();
|
|
1308
|
+
request = read(entry.controller.signal);
|
|
1279
1309
|
} catch (error) {
|
|
1280
1310
|
settle();
|
|
1281
1311
|
entry.reject(error);
|
|
@@ -1292,6 +1322,28 @@ var OpenGeniClient = class {
|
|
|
1292
1322
|
}
|
|
1293
1323
|
);
|
|
1294
1324
|
}
|
|
1325
|
+
consumeSharedRead(key, entry, signal) {
|
|
1326
|
+
entry.consumers += 1;
|
|
1327
|
+
let released = false;
|
|
1328
|
+
const release = () => {
|
|
1329
|
+
if (released) return;
|
|
1330
|
+
released = true;
|
|
1331
|
+
entry.consumers -= 1;
|
|
1332
|
+
if (!signal?.aborted || entry.consumers > 0) return;
|
|
1333
|
+
const reason = signal.reason;
|
|
1334
|
+
entry.controller.abort(reason);
|
|
1335
|
+
if (this.active.get(key) === entry) this.active.delete(key);
|
|
1336
|
+
if (this.queued.get(key) === entry) this.queued.delete(key);
|
|
1337
|
+
if (!this.active.has(key) && !this.queued.has(key)) this.generations.delete(key);
|
|
1338
|
+
entry.reject(reason);
|
|
1339
|
+
};
|
|
1340
|
+
signal?.addEventListener("abort", release, { once: true });
|
|
1341
|
+
const consumed = awaitWithAbort(entry.promise, signal);
|
|
1342
|
+
return consumed.finally(() => {
|
|
1343
|
+
signal?.removeEventListener("abort", release);
|
|
1344
|
+
release();
|
|
1345
|
+
});
|
|
1346
|
+
}
|
|
1295
1347
|
observeRead(entry, listener) {
|
|
1296
1348
|
if (!listener) return;
|
|
1297
1349
|
if (!entry.started) {
|
|
@@ -1384,13 +1436,15 @@ var OpenGeniClient = class {
|
|
|
1384
1436
|
{
|
|
1385
1437
|
...options.limit !== void 0 ? { limit: String(options.limit) } : {},
|
|
1386
1438
|
...options.latestStarted ? { latestStarted: "1" } : {}
|
|
1387
|
-
}
|
|
1439
|
+
},
|
|
1440
|
+
{ signal: options.signal }
|
|
1388
1441
|
);
|
|
1389
1442
|
}
|
|
1390
1443
|
/** Newest turn that durably emitted `turn.started`, or null before any admission. */
|
|
1391
|
-
async getLatestStartedTurn(workspaceId, sessionId) {
|
|
1444
|
+
async getLatestStartedTurn(workspaceId, sessionId, options = {}) {
|
|
1392
1445
|
const turns = await this.listTurns(workspaceId, sessionId, {
|
|
1393
|
-
latestStarted: true
|
|
1446
|
+
latestStarted: true,
|
|
1447
|
+
signal: options.signal
|
|
1394
1448
|
});
|
|
1395
1449
|
return turns[0] ?? null;
|
|
1396
1450
|
}
|
|
@@ -1777,10 +1831,12 @@ var OpenGeniClient = class {
|
|
|
1777
1831
|
request
|
|
1778
1832
|
);
|
|
1779
1833
|
}
|
|
1780
|
-
async getComposerDraft(workspaceId, sessionId) {
|
|
1834
|
+
async getComposerDraft(workspaceId, sessionId, options = {}) {
|
|
1781
1835
|
return await this.requestSessionCommand(
|
|
1782
1836
|
"GET",
|
|
1783
|
-
`/v1/workspaces/${workspaceId}/sessions/${sessionId}/composer-draft
|
|
1837
|
+
`/v1/workspaces/${workspaceId}/sessions/${sessionId}/composer-draft`,
|
|
1838
|
+
void 0,
|
|
1839
|
+
options
|
|
1784
1840
|
);
|
|
1785
1841
|
}
|
|
1786
1842
|
async saveComposerDraft(workspaceId, sessionId, request) {
|
|
@@ -1965,9 +2021,13 @@ var OpenGeniClient = class {
|
|
|
1965
2021
|
}
|
|
1966
2022
|
// --- Goals -------------------------------------------------------------------
|
|
1967
2023
|
/** The session's goal. 404s when the session never had one. */
|
|
1968
|
-
async getGoal(workspaceId, sessionId) {
|
|
2024
|
+
async getGoal(workspaceId, sessionId, options = {}) {
|
|
1969
2025
|
const path = `/v1/workspaces/${workspaceId}/sessions/${sessionId}/goal`;
|
|
1970
|
-
return await this.sharedRead(
|
|
2026
|
+
return await this.sharedRead(
|
|
2027
|
+
path,
|
|
2028
|
+
(signal) => this.requestJson("GET", path, void 0, {}, { signal }),
|
|
2029
|
+
options
|
|
2030
|
+
);
|
|
1971
2031
|
}
|
|
1972
2032
|
async updateGoal(workspaceId, sessionId, request) {
|
|
1973
2033
|
return await this.requestJson(
|
|
@@ -2844,6 +2904,42 @@ var OpenGeniClient = class {
|
|
|
2844
2904
|
options
|
|
2845
2905
|
);
|
|
2846
2906
|
}
|
|
2907
|
+
async captureComputerTarget(workspaceId, computerSessionId, targetId, options = {}) {
|
|
2908
|
+
const response = await this.requestResponse(
|
|
2909
|
+
"GET",
|
|
2910
|
+
`/v1/workspaces/${workspaceId}/computer-sessions/${encodeURIComponent(computerSessionId)}/targets/${encodeURIComponent(targetId)}/screenshot`,
|
|
2911
|
+
{},
|
|
2912
|
+
options
|
|
2913
|
+
);
|
|
2914
|
+
const mediaType = response.headers.get("content-type")?.split(";", 1)[0]?.trim().toLowerCase();
|
|
2915
|
+
if (mediaType !== "image/jpeg" && mediaType !== "image/png") {
|
|
2916
|
+
await cancelResponseBody(response, "computer frame media type is invalid");
|
|
2917
|
+
throw new OpenGeniApiError(502, "computer frame media type is invalid");
|
|
2918
|
+
}
|
|
2919
|
+
const metadataHeader = response.headers.get("x-opengeni-computer-frame");
|
|
2920
|
+
if (!metadataHeader || metadataHeader.length > 32 * 1024) {
|
|
2921
|
+
await cancelResponseBody(response, "computer frame metadata is invalid");
|
|
2922
|
+
throw new OpenGeniApiError(502, "computer frame metadata is invalid");
|
|
2923
|
+
}
|
|
2924
|
+
let metadata;
|
|
2925
|
+
try {
|
|
2926
|
+
metadata = decodeComputerFrameMetadataHeader(metadataHeader);
|
|
2927
|
+
} catch {
|
|
2928
|
+
await cancelResponseBody(response, "computer frame metadata is invalid");
|
|
2929
|
+
throw new OpenGeniApiError(502, "computer frame metadata is invalid");
|
|
2930
|
+
}
|
|
2931
|
+
const bytes = await readBoundedResponseBytes(response, 256 * 1024, null);
|
|
2932
|
+
const mismatchReason = computerFrameEvidenceMismatchReason(metadata, {
|
|
2933
|
+
computerSessionId,
|
|
2934
|
+
targetId,
|
|
2935
|
+
mediaType,
|
|
2936
|
+
sha256: await sha256Hex(bytes)
|
|
2937
|
+
});
|
|
2938
|
+
if (mismatchReason) {
|
|
2939
|
+
throw new OpenGeniApiError(502, "computer frame evidence does not match its request");
|
|
2940
|
+
}
|
|
2941
|
+
return { ...metadata, data: bytes };
|
|
2942
|
+
}
|
|
2847
2943
|
async actInComputer(workspaceId, computerSessionId, request, options = {}) {
|
|
2848
2944
|
return await this.requestJson(
|
|
2849
2945
|
"POST",
|
|
@@ -2897,8 +2993,14 @@ var OpenGeniClient = class {
|
|
|
2897
2993
|
* expected to authenticate. Drives a composer's model picker without prior
|
|
2898
2994
|
* knowledge of the host setup; safe to call before any auth is established.
|
|
2899
2995
|
*/
|
|
2900
|
-
async getClientConfig() {
|
|
2901
|
-
const config = await this.requestJson(
|
|
2996
|
+
async getClientConfig(options = {}) {
|
|
2997
|
+
const config = await this.requestJson(
|
|
2998
|
+
"GET",
|
|
2999
|
+
"/v1/config/client",
|
|
3000
|
+
void 0,
|
|
3001
|
+
{},
|
|
3002
|
+
options
|
|
3003
|
+
);
|
|
2902
3004
|
if (config.apiContractRevision !== OPENGENI_API_CONTRACT_REVISION) {
|
|
2903
3005
|
throw new OpenGeniApiContractMismatchError(
|
|
2904
3006
|
OPENGENI_API_CONTRACT_REVISION,
|
|
@@ -2908,10 +3010,13 @@ var OpenGeniClient = class {
|
|
|
2908
3010
|
return config;
|
|
2909
3011
|
}
|
|
2910
3012
|
/** Authenticated model definitions plus workspace-specific selectability. */
|
|
2911
|
-
async getWorkspaceModelCatalog(workspaceId) {
|
|
3013
|
+
async getWorkspaceModelCatalog(workspaceId, options = {}) {
|
|
2912
3014
|
return await this.requestJson(
|
|
2913
3015
|
"GET",
|
|
2914
|
-
`/v1/workspaces/${workspaceId}/model-catalog
|
|
3016
|
+
`/v1/workspaces/${workspaceId}/model-catalog`,
|
|
3017
|
+
void 0,
|
|
3018
|
+
{},
|
|
3019
|
+
options
|
|
2915
3020
|
);
|
|
2916
3021
|
}
|
|
2917
3022
|
/** Read the workspace's hard provider/model allowlist. */
|
|
@@ -2930,10 +3035,13 @@ var OpenGeniClient = class {
|
|
|
2930
3035
|
);
|
|
2931
3036
|
}
|
|
2932
3037
|
/** Authenticated realtime voice models and credential readiness. */
|
|
2933
|
-
async getWorkspaceRealtimeModelCatalog(workspaceId) {
|
|
3038
|
+
async getWorkspaceRealtimeModelCatalog(workspaceId, options = {}) {
|
|
2934
3039
|
return await this.requestJson(
|
|
2935
3040
|
"GET",
|
|
2936
|
-
`/v1/workspaces/${workspaceId}/realtime-model-catalog
|
|
3041
|
+
`/v1/workspaces/${workspaceId}/realtime-model-catalog`,
|
|
3042
|
+
void 0,
|
|
3043
|
+
{},
|
|
3044
|
+
options
|
|
2937
3045
|
);
|
|
2938
3046
|
}
|
|
2939
3047
|
/** The caller's access context: subject, account + workspace grants, defaults. */
|
|
@@ -3165,6 +3273,17 @@ var OpenGeniClient = class {
|
|
|
3165
3273
|
async createWorkspace(request) {
|
|
3166
3274
|
return await this.requestJson("POST", "/v1/workspaces", request);
|
|
3167
3275
|
}
|
|
3276
|
+
/**
|
|
3277
|
+
* Create an organization workspace once for a stable external tenant
|
|
3278
|
+
* identity, or return the existing workspace without overwriting it.
|
|
3279
|
+
*/
|
|
3280
|
+
async ensureWorkspace(request) {
|
|
3281
|
+
return await this.requestJson(
|
|
3282
|
+
"PUT",
|
|
3283
|
+
"/v1/workspaces/external",
|
|
3284
|
+
request
|
|
3285
|
+
);
|
|
3286
|
+
}
|
|
3168
3287
|
async getWorkspace(workspaceId) {
|
|
3169
3288
|
return await this.requestJson("GET", `/v1/workspaces/${workspaceId}`);
|
|
3170
3289
|
}
|
|
@@ -3346,6 +3465,19 @@ var OpenGeniClient = class {
|
|
|
3346
3465
|
`/v1/workspaces/${workspaceId}/company-profile/revisions/${encodeURIComponent(revisionId)}`
|
|
3347
3466
|
);
|
|
3348
3467
|
}
|
|
3468
|
+
async getCompanyProfileAgentPolicy(workspaceId) {
|
|
3469
|
+
return await this.requestJson(
|
|
3470
|
+
"GET",
|
|
3471
|
+
`/v1/workspaces/${workspaceId}/company-profile/agent-policy`
|
|
3472
|
+
);
|
|
3473
|
+
}
|
|
3474
|
+
async updateCompanyProfileAgentPolicy(workspaceId, request) {
|
|
3475
|
+
return await this.requestJson(
|
|
3476
|
+
"PATCH",
|
|
3477
|
+
`/v1/workspaces/${workspaceId}/company-profile/agent-policy`,
|
|
3478
|
+
request
|
|
3479
|
+
);
|
|
3480
|
+
}
|
|
3349
3481
|
async updateCompanyProfile(workspaceId, request) {
|
|
3350
3482
|
return await this.requestJson(
|
|
3351
3483
|
"PUT",
|
|
@@ -3469,9 +3601,16 @@ var OpenGeniClient = class {
|
|
|
3469
3601
|
);
|
|
3470
3602
|
return response.members;
|
|
3471
3603
|
}
|
|
3604
|
+
/** Active organization members who can be added to this workspace. */
|
|
3605
|
+
async listWorkspaceMemberCandidates(workspaceId) {
|
|
3606
|
+
const response = await this.requestJson(
|
|
3607
|
+
"GET",
|
|
3608
|
+
`/v1/workspaces/${workspaceId}/member-candidates`
|
|
3609
|
+
);
|
|
3610
|
+
return response.members;
|
|
3611
|
+
}
|
|
3472
3612
|
/**
|
|
3473
|
-
* Add
|
|
3474
|
-
* exists (email invites for unknown users are deferred).
|
|
3613
|
+
* Add one active member selected from the workspace candidate inventory.
|
|
3475
3614
|
*/
|
|
3476
3615
|
async addWorkspaceMember(workspaceId, request) {
|
|
3477
3616
|
return await this.requestJson(
|
|
@@ -3551,14 +3690,14 @@ var OpenGeniClient = class {
|
|
|
3551
3690
|
return await this.requestJson(
|
|
3552
3691
|
"POST",
|
|
3553
3692
|
`/v1/workspaces/${workspaceId}/scheduled-tasks`,
|
|
3554
|
-
request
|
|
3693
|
+
normalizeScheduledTaskMachineTarget(request)
|
|
3555
3694
|
);
|
|
3556
3695
|
}
|
|
3557
3696
|
async updateScheduledTask(workspaceId, taskId, request) {
|
|
3558
3697
|
return await this.requestJson(
|
|
3559
3698
|
"PATCH",
|
|
3560
3699
|
`/v1/workspaces/${workspaceId}/scheduled-tasks/${taskId}`,
|
|
3561
|
-
request
|
|
3700
|
+
normalizeScheduledTaskMachineTarget(request)
|
|
3562
3701
|
);
|
|
3563
3702
|
}
|
|
3564
3703
|
async pauseScheduledTask(workspaceId, taskId) {
|
|
@@ -4867,6 +5006,28 @@ var OpenGeniClient = class {
|
|
|
4867
5006
|
`/v1/workspaces/${workspaceId}/api-keys/${apiKeyId}`
|
|
4868
5007
|
);
|
|
4869
5008
|
}
|
|
5009
|
+
async listOrganizationApiKeys(organizationId) {
|
|
5010
|
+
const response = await this.requestJson(
|
|
5011
|
+
"GET",
|
|
5012
|
+
`/v1/organizations/${organizationId}/api-keys`
|
|
5013
|
+
);
|
|
5014
|
+
return response.apiKeys;
|
|
5015
|
+
}
|
|
5016
|
+
/** The returned `token` is shown once; only its prefix is stored. */
|
|
5017
|
+
async createOrganizationApiKey(organizationId, request) {
|
|
5018
|
+
return await this.requestJson(
|
|
5019
|
+
"POST",
|
|
5020
|
+
`/v1/organizations/${organizationId}/api-keys`,
|
|
5021
|
+
request
|
|
5022
|
+
);
|
|
5023
|
+
}
|
|
5024
|
+
/** Revoke an organization-scoped API key. Returns the revoked key. */
|
|
5025
|
+
async deleteOrganizationApiKey(organizationId, apiKeyId) {
|
|
5026
|
+
return await this.requestJson(
|
|
5027
|
+
"DELETE",
|
|
5028
|
+
`/v1/organizations/${organizationId}/api-keys/${apiKeyId}`
|
|
5029
|
+
);
|
|
5030
|
+
}
|
|
4870
5031
|
// --- Billing (account-scoped) --------------------------------------------------------------------
|
|
4871
5032
|
async getBilling(options = {}) {
|
|
4872
5033
|
return await this.requestJson("GET", "/v1/billing", void 0, {
|
|
@@ -5107,14 +5268,15 @@ var OpenGeniClient = class {
|
|
|
5107
5268
|
return await this.requestJson("DELETE", `/v1/workspaces/${workspaceId}/supergrok/accounts/${accountId}`, {});
|
|
5108
5269
|
}
|
|
5109
5270
|
/** Contract-checked JSON transport shared by opt-in typed SDK clients. */
|
|
5110
|
-
async requestSessionCommand(method, path, body) {
|
|
5271
|
+
async requestSessionCommand(method, path, body, options = {}) {
|
|
5111
5272
|
return await this.requestJson(
|
|
5112
5273
|
method,
|
|
5113
5274
|
path,
|
|
5114
5275
|
body,
|
|
5115
5276
|
{},
|
|
5116
5277
|
{
|
|
5117
|
-
|
|
5278
|
+
signal: options.signal,
|
|
5279
|
+
timeoutMs: options.timeoutMs ?? this.sessionCommandTimeoutMs
|
|
5118
5280
|
}
|
|
5119
5281
|
);
|
|
5120
5282
|
}
|
|
@@ -5386,6 +5548,15 @@ async function sha256Hex(bytes) {
|
|
|
5386
5548
|
const digest = await globalThis.crypto.subtle.digest("SHA-256", owned.buffer);
|
|
5387
5549
|
return [...new Uint8Array(digest)].map((byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
5388
5550
|
}
|
|
5551
|
+
function computerFrameEvidenceMismatchReason(metadata, expected) {
|
|
5552
|
+
if (metadata.computerSessionId !== expected.computerSessionId) {
|
|
5553
|
+
return "frame_session_mismatch";
|
|
5554
|
+
}
|
|
5555
|
+
if (metadata.targetId !== expected.targetId) return "frame_target_mismatch";
|
|
5556
|
+
if (metadata.mediaType !== expected.mediaType) return "frame_media_mismatch";
|
|
5557
|
+
if (metadata.sha256 !== expected.sha256) return "frame_digest_mismatch";
|
|
5558
|
+
return null;
|
|
5559
|
+
}
|
|
5389
5560
|
async function cancelResponseBody(response, reason) {
|
|
5390
5561
|
await response.body?.cancel(reason).catch(() => void 0);
|
|
5391
5562
|
}
|
|
@@ -5478,4 +5649,4 @@ export {
|
|
|
5478
5649
|
parseMediaGenerationResult,
|
|
5479
5650
|
OpenGeniClient
|
|
5480
5651
|
};
|
|
5481
|
-
//# sourceMappingURL=chunk-
|
|
5652
|
+
//# sourceMappingURL=chunk-TRNI7KEO.js.map
|