@miosa/sdk 3.0.1 → 3.0.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 +57 -0
- package/dist/index.d.ts +585 -75
- package/dist/index.js +1148 -405
- package/dist/index.js.map +1 -1
- package/package.json +5 -4
package/dist/index.js
CHANGED
|
@@ -168,7 +168,7 @@ var TokenRefreshFailedError = class extends MiosaError {
|
|
|
168
168
|
};
|
|
169
169
|
|
|
170
170
|
// src/version.ts
|
|
171
|
-
var SDK_VERSION = "2.0.
|
|
171
|
+
var SDK_VERSION = "2.0.7";
|
|
172
172
|
var SDK_USER_AGENT = `@miosa/sdk/${SDK_VERSION}`;
|
|
173
173
|
|
|
174
174
|
// src/http.ts
|
|
@@ -302,8 +302,9 @@ var HttpClient = class {
|
|
|
302
302
|
return new Uint8Array(buffer);
|
|
303
303
|
}
|
|
304
304
|
if (response.status === 204) {
|
|
305
|
-
return void 0;
|
|
305
|
+
return options.rawResponse ? response : void 0;
|
|
306
306
|
}
|
|
307
|
+
if (options.rawResponse) return response;
|
|
307
308
|
return await response.json();
|
|
308
309
|
} catch (err) {
|
|
309
310
|
clearTimeout(timer);
|
|
@@ -363,10 +364,13 @@ var HttpClient = class {
|
|
|
363
364
|
return this.request(path, { method: "POST", formData });
|
|
364
365
|
}
|
|
365
366
|
/**
|
|
366
|
-
* Open a Server-Sent Events stream
|
|
367
|
-
*
|
|
367
|
+
* Open a Server-Sent Events stream and yield each frame's parsed `data:`
|
|
368
|
+
* payload together with its SSE `event:` name (when present). Most callers
|
|
369
|
+
* want {@link stream}; use this when the event name carries meaning — e.g. the
|
|
370
|
+
* sandbox exec stream tags frames as `stdout` / `stderr` / `exit`. The caller
|
|
371
|
+
* is responsible for breaking the loop.
|
|
368
372
|
*/
|
|
369
|
-
async *
|
|
373
|
+
async *streamFrames(path, options = {}) {
|
|
370
374
|
const method = options.method ?? "GET";
|
|
371
375
|
let headers = this.baseHeaders({
|
|
372
376
|
Accept: "text/event-stream",
|
|
@@ -413,6 +417,7 @@ var HttpClient = class {
|
|
|
413
417
|
const reader = response.body.getReader();
|
|
414
418
|
const decoder = new TextDecoder();
|
|
415
419
|
let buffer = "";
|
|
420
|
+
let event = null;
|
|
416
421
|
try {
|
|
417
422
|
while (true) {
|
|
418
423
|
const { done, value } = await reader.read();
|
|
@@ -420,12 +425,22 @@ var HttpClient = class {
|
|
|
420
425
|
buffer += decoder.decode(value, { stream: true });
|
|
421
426
|
const lines = buffer.split("\n");
|
|
422
427
|
buffer = lines.pop() ?? "";
|
|
423
|
-
for (const
|
|
428
|
+
for (const rawLine of lines) {
|
|
429
|
+
const line = rawLine.replace(/\r$/, "");
|
|
430
|
+
if (line === "") {
|
|
431
|
+
event = null;
|
|
432
|
+
continue;
|
|
433
|
+
}
|
|
434
|
+
if (line.startsWith(":")) continue;
|
|
435
|
+
if (line.startsWith("event:")) {
|
|
436
|
+
event = line.slice(6).trim();
|
|
437
|
+
continue;
|
|
438
|
+
}
|
|
424
439
|
if (line.startsWith("data:")) {
|
|
425
440
|
const raw = line.slice(5).trim();
|
|
426
441
|
if (raw === "[DONE]" || raw === "") continue;
|
|
427
442
|
try {
|
|
428
|
-
yield JSON.parse(raw);
|
|
443
|
+
yield { event, data: JSON.parse(raw) };
|
|
429
444
|
} catch {
|
|
430
445
|
}
|
|
431
446
|
}
|
|
@@ -436,6 +451,15 @@ var HttpClient = class {
|
|
|
436
451
|
reader.releaseLock();
|
|
437
452
|
}
|
|
438
453
|
}
|
|
454
|
+
/**
|
|
455
|
+
* Open a Server-Sent Events stream. Returns an AsyncIterableIterator of
|
|
456
|
+
* parsed event data objects. The caller is responsible for breaking the loop.
|
|
457
|
+
*/
|
|
458
|
+
async *stream(path, options = {}) {
|
|
459
|
+
for await (const frame of this.streamFrames(path, options)) {
|
|
460
|
+
yield frame.data;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
439
463
|
};
|
|
440
464
|
|
|
441
465
|
// src/resources/admin.ts
|
|
@@ -1258,8 +1282,69 @@ var AgentRuntimeProfiles = class {
|
|
|
1258
1282
|
}
|
|
1259
1283
|
};
|
|
1260
1284
|
|
|
1261
|
-
// src/resources/
|
|
1285
|
+
// src/resources/agent-definitions.ts
|
|
1262
1286
|
function unwrap5(payload) {
|
|
1287
|
+
if (payload !== null && typeof payload === "object" && "data" in payload && payload.data !== void 0) {
|
|
1288
|
+
return payload.data;
|
|
1289
|
+
}
|
|
1290
|
+
return payload;
|
|
1291
|
+
}
|
|
1292
|
+
var AgentDefinitions = class {
|
|
1293
|
+
constructor(http) {
|
|
1294
|
+
this.http = http;
|
|
1295
|
+
}
|
|
1296
|
+
http;
|
|
1297
|
+
async list(params = {}) {
|
|
1298
|
+
return unwrap5(
|
|
1299
|
+
await this.http.get("/agents", {
|
|
1300
|
+
workspace_id: params.workspaceId ?? params.workspace_id,
|
|
1301
|
+
project_id: params.projectId ?? params.project_id,
|
|
1302
|
+
status: params.status
|
|
1303
|
+
})
|
|
1304
|
+
);
|
|
1305
|
+
}
|
|
1306
|
+
async get(id) {
|
|
1307
|
+
return unwrap5(
|
|
1308
|
+
await this.http.get(
|
|
1309
|
+
`/agents/${encodeURIComponent(id)}`
|
|
1310
|
+
)
|
|
1311
|
+
);
|
|
1312
|
+
}
|
|
1313
|
+
async create(params) {
|
|
1314
|
+
return unwrap5(
|
|
1315
|
+
await this.http.post(
|
|
1316
|
+
"/agents",
|
|
1317
|
+
{
|
|
1318
|
+
workspace_id: params.workspaceId ?? params.workspace_id,
|
|
1319
|
+
project_id: params.projectId ?? params.project_id,
|
|
1320
|
+
name: params.name,
|
|
1321
|
+
description: params.description,
|
|
1322
|
+
metadata: params.metadata,
|
|
1323
|
+
configuration: params.configuration
|
|
1324
|
+
}
|
|
1325
|
+
)
|
|
1326
|
+
);
|
|
1327
|
+
}
|
|
1328
|
+
async update(id, params) {
|
|
1329
|
+
return unwrap5(
|
|
1330
|
+
await this.http.patch(`/agents/${encodeURIComponent(id)}`, params)
|
|
1331
|
+
);
|
|
1332
|
+
}
|
|
1333
|
+
async publish(id, configuration) {
|
|
1334
|
+
return unwrap5(
|
|
1335
|
+
await this.http.post(
|
|
1336
|
+
`/agents/${encodeURIComponent(id)}/versions`,
|
|
1337
|
+
{ configuration }
|
|
1338
|
+
)
|
|
1339
|
+
);
|
|
1340
|
+
}
|
|
1341
|
+
async archive(id) {
|
|
1342
|
+
await this.http.delete(`/agents/${encodeURIComponent(id)}`);
|
|
1343
|
+
}
|
|
1344
|
+
};
|
|
1345
|
+
|
|
1346
|
+
// src/resources/runs.ts
|
|
1347
|
+
function unwrap6(payload) {
|
|
1263
1348
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
1264
1349
|
return payload.data;
|
|
1265
1350
|
}
|
|
@@ -1298,24 +1383,24 @@ var Runs = class {
|
|
|
1298
1383
|
status: params.status
|
|
1299
1384
|
})
|
|
1300
1385
|
);
|
|
1301
|
-
const data =
|
|
1386
|
+
const data = unwrap6(
|
|
1302
1387
|
response
|
|
1303
1388
|
);
|
|
1304
1389
|
if (Array.isArray(data)) return data;
|
|
1305
1390
|
return data.runs ?? data.items ?? [];
|
|
1306
1391
|
}
|
|
1307
1392
|
async get(id) {
|
|
1308
|
-
return
|
|
1393
|
+
return unwrap6(
|
|
1309
1394
|
await this.http.get(`/runs/${encodeURIComponent(id)}`)
|
|
1310
1395
|
);
|
|
1311
1396
|
}
|
|
1312
1397
|
async outputs(id) {
|
|
1313
|
-
return
|
|
1398
|
+
return unwrap6(
|
|
1314
1399
|
await this.http.get(`/runs/${encodeURIComponent(id)}/outputs`)
|
|
1315
1400
|
);
|
|
1316
1401
|
}
|
|
1317
1402
|
async files(id) {
|
|
1318
|
-
const data =
|
|
1403
|
+
const data = unwrap6(
|
|
1319
1404
|
await this.http.get(`/runs/${encodeURIComponent(id)}/files`)
|
|
1320
1405
|
);
|
|
1321
1406
|
if (Array.isArray(data)) return data;
|
|
@@ -1330,33 +1415,33 @@ var Runs = class {
|
|
|
1330
1415
|
);
|
|
1331
1416
|
}
|
|
1332
1417
|
async messages(id) {
|
|
1333
|
-
const data =
|
|
1418
|
+
const data = unwrap6(
|
|
1334
1419
|
await this.http.get(`/runs/${encodeURIComponent(id)}/messages`)
|
|
1335
1420
|
);
|
|
1336
1421
|
if (Array.isArray(data)) return data;
|
|
1337
1422
|
return data.messages ?? data.items ?? [];
|
|
1338
1423
|
}
|
|
1339
1424
|
async commandOutput(id) {
|
|
1340
|
-
return
|
|
1425
|
+
return unwrap6(
|
|
1341
1426
|
await this.http.get(`/runs/${encodeURIComponent(id)}/command-output`)
|
|
1342
1427
|
);
|
|
1343
1428
|
}
|
|
1344
1429
|
async activity(id) {
|
|
1345
|
-
const data =
|
|
1430
|
+
const data = unwrap6(
|
|
1346
1431
|
await this.http.get(`/runs/${encodeURIComponent(id)}/activity`)
|
|
1347
1432
|
);
|
|
1348
1433
|
if (Array.isArray(data)) return data;
|
|
1349
1434
|
return data.activity ?? data.items ?? [];
|
|
1350
1435
|
}
|
|
1351
1436
|
async previews(id) {
|
|
1352
|
-
const data =
|
|
1437
|
+
const data = unwrap6(
|
|
1353
1438
|
await this.http.get(`/runs/${encodeURIComponent(id)}/previews`)
|
|
1354
1439
|
);
|
|
1355
1440
|
if (Array.isArray(data)) return data;
|
|
1356
1441
|
return data.previews ?? data.items ?? [];
|
|
1357
1442
|
}
|
|
1358
1443
|
async diagnostics(id) {
|
|
1359
|
-
const data =
|
|
1444
|
+
const data = unwrap6(await this.http.get(`/runs/${encodeURIComponent(id)}/diagnostics`));
|
|
1360
1445
|
if (Array.isArray(data)) return data;
|
|
1361
1446
|
return data.diagnostics ?? data.items ?? [];
|
|
1362
1447
|
}
|
|
@@ -1403,6 +1488,9 @@ var Runs = class {
|
|
|
1403
1488
|
env: params.env,
|
|
1404
1489
|
agent_runtime_profile_id: params.agentRuntimeProfileId,
|
|
1405
1490
|
agent_profile_id: params.agentProfileId,
|
|
1491
|
+
agent_definition_id: params.agentDefinitionId,
|
|
1492
|
+
agent_version_id: params.agentVersionId,
|
|
1493
|
+
configuration_receipt: params.configurationReceipt,
|
|
1406
1494
|
run_group_id: params.runGroupId,
|
|
1407
1495
|
parent_run_id: params.parentRunId,
|
|
1408
1496
|
orchestration_role: params.orchestrationRole,
|
|
@@ -1416,10 +1504,10 @@ var Runs = class {
|
|
|
1416
1504
|
capability_requirements: params.capabilityRequirements,
|
|
1417
1505
|
metadata: params.metadata
|
|
1418
1506
|
});
|
|
1419
|
-
return
|
|
1507
|
+
return unwrap6(await this.http.post("/runs", body5));
|
|
1420
1508
|
}
|
|
1421
1509
|
async cancel(id) {
|
|
1422
|
-
return
|
|
1510
|
+
return unwrap6(
|
|
1423
1511
|
await this.http.post(
|
|
1424
1512
|
`/runs/${encodeURIComponent(id)}/cancel`,
|
|
1425
1513
|
{}
|
|
@@ -1429,7 +1517,7 @@ var Runs = class {
|
|
|
1429
1517
|
};
|
|
1430
1518
|
|
|
1431
1519
|
// src/resources/analytics.ts
|
|
1432
|
-
function
|
|
1520
|
+
function unwrap7(payload) {
|
|
1433
1521
|
if (payload && typeof payload === "object") {
|
|
1434
1522
|
const p = payload;
|
|
1435
1523
|
for (const k of ["data", "analytics", "series", "items"]) {
|
|
@@ -1452,16 +1540,16 @@ var Analytics = class {
|
|
|
1452
1540
|
async overview(filters = {}) {
|
|
1453
1541
|
const query3 = stripUndefined5(filters);
|
|
1454
1542
|
const data = await this.http.get("/analytics/overview", query3);
|
|
1455
|
-
return
|
|
1543
|
+
return unwrap7(data);
|
|
1456
1544
|
}
|
|
1457
1545
|
/** Get a timeseries for a metric over a period. */
|
|
1458
1546
|
async timeseries(params = {}) {
|
|
1459
1547
|
const query3 = stripUndefined5(params);
|
|
1460
1548
|
const data = await this.http.get("/analytics/timeseries", query3);
|
|
1461
|
-
return
|
|
1549
|
+
return unwrap7(data);
|
|
1462
1550
|
}
|
|
1463
1551
|
};
|
|
1464
|
-
function
|
|
1552
|
+
function unwrap8(payload) {
|
|
1465
1553
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
1466
1554
|
return payload.data;
|
|
1467
1555
|
}
|
|
@@ -1506,7 +1594,7 @@ var ApiKeys = class {
|
|
|
1506
1594
|
body: body5,
|
|
1507
1595
|
headers: { "Idempotency-Key": idempotencyKey(ikey) }
|
|
1508
1596
|
});
|
|
1509
|
-
return
|
|
1597
|
+
return unwrap8(data);
|
|
1510
1598
|
}
|
|
1511
1599
|
/** POST /api/v1/api-keys/scoped — L2 delegation token bound to one external user. */
|
|
1512
1600
|
async createScoped(params) {
|
|
@@ -1515,7 +1603,7 @@ var ApiKeys = class {
|
|
|
1515
1603
|
scopes: params.scopes,
|
|
1516
1604
|
expires_at: params.expiresAt
|
|
1517
1605
|
});
|
|
1518
|
-
return
|
|
1606
|
+
return unwrap8(
|
|
1519
1607
|
await this.http.post("/api-keys/scoped", body5)
|
|
1520
1608
|
);
|
|
1521
1609
|
}
|
|
@@ -1524,8 +1612,190 @@ var ApiKeys = class {
|
|
|
1524
1612
|
}
|
|
1525
1613
|
};
|
|
1526
1614
|
|
|
1615
|
+
// src/resources/app-documents.ts
|
|
1616
|
+
function unwrap9(payload) {
|
|
1617
|
+
return payload && typeof payload === "object" && "data" in payload ? payload.data : payload;
|
|
1618
|
+
}
|
|
1619
|
+
var AppDocuments = class {
|
|
1620
|
+
constructor(http) {
|
|
1621
|
+
this.http = http;
|
|
1622
|
+
}
|
|
1623
|
+
http;
|
|
1624
|
+
async list(workspaceId2) {
|
|
1625
|
+
const payload = await this.http.get(
|
|
1626
|
+
"/builder/apps",
|
|
1627
|
+
{ workspace_id: workspaceId2 }
|
|
1628
|
+
);
|
|
1629
|
+
return payload.data;
|
|
1630
|
+
}
|
|
1631
|
+
async get(id) {
|
|
1632
|
+
return unwrap9(
|
|
1633
|
+
await this.http.get(
|
|
1634
|
+
`/builder/apps/${id}`
|
|
1635
|
+
)
|
|
1636
|
+
);
|
|
1637
|
+
}
|
|
1638
|
+
async create(params) {
|
|
1639
|
+
const { workspaceId: workspaceId2, ...body5 } = params;
|
|
1640
|
+
return unwrap9(
|
|
1641
|
+
await this.http.post(
|
|
1642
|
+
"/builder/apps",
|
|
1643
|
+
{ ...body5, workspace_id: workspaceId2 }
|
|
1644
|
+
)
|
|
1645
|
+
);
|
|
1646
|
+
}
|
|
1647
|
+
async update(id, params) {
|
|
1648
|
+
return unwrap9(
|
|
1649
|
+
await this.http.patch(`/builder/apps/${id}`, params)
|
|
1650
|
+
);
|
|
1651
|
+
}
|
|
1652
|
+
async archive(id) {
|
|
1653
|
+
await this.http.delete(`/builder/apps/${id}`);
|
|
1654
|
+
}
|
|
1655
|
+
async diagnostics(id) {
|
|
1656
|
+
return unwrap9(
|
|
1657
|
+
await this.http.get(`/builder/apps/${id}/diagnostics`)
|
|
1658
|
+
);
|
|
1659
|
+
}
|
|
1660
|
+
async stageCandidate(id) {
|
|
1661
|
+
return unwrap9(
|
|
1662
|
+
await this.http.post(`/builder/apps/${id}/candidates`, {})
|
|
1663
|
+
);
|
|
1664
|
+
}
|
|
1665
|
+
async approveExactVersion(id, releaseId, reason) {
|
|
1666
|
+
return unwrap9(
|
|
1667
|
+
await this.http.post(`/builder/apps/${id}/approvals`, {
|
|
1668
|
+
reason,
|
|
1669
|
+
release_id: releaseId
|
|
1670
|
+
})
|
|
1671
|
+
);
|
|
1672
|
+
}
|
|
1673
|
+
async publishExactRelease(id) {
|
|
1674
|
+
const payload = await this.http.post(`/builder/apps/${id}/publish`, {});
|
|
1675
|
+
return unwrap9(payload).app;
|
|
1676
|
+
}
|
|
1677
|
+
async listData(id, collection) {
|
|
1678
|
+
const payload = await this.http.get(
|
|
1679
|
+
`/builder/apps/${encodeURIComponent(id)}/data/${encodeURIComponent(collection)}`
|
|
1680
|
+
);
|
|
1681
|
+
return payload.data;
|
|
1682
|
+
}
|
|
1683
|
+
async getData(id, collection, key) {
|
|
1684
|
+
return unwrap9(
|
|
1685
|
+
await this.http.get(
|
|
1686
|
+
`/builder/apps/${encodeURIComponent(id)}/data/${encodeURIComponent(collection)}/${encodeURIComponent(key)}`
|
|
1687
|
+
)
|
|
1688
|
+
);
|
|
1689
|
+
}
|
|
1690
|
+
async putData(id, collection, key, value, expectedVersion) {
|
|
1691
|
+
return unwrap9(
|
|
1692
|
+
await this.http.put(
|
|
1693
|
+
`/builder/apps/${encodeURIComponent(id)}/data/${encodeURIComponent(collection)}/${encodeURIComponent(key)}`,
|
|
1694
|
+
{ value, expected_version: expectedVersion }
|
|
1695
|
+
)
|
|
1696
|
+
);
|
|
1697
|
+
}
|
|
1698
|
+
async deleteData(id, collection, key, expectedVersion) {
|
|
1699
|
+
const suffix = expectedVersion === void 0 ? "" : `?expected_version=${encodeURIComponent(String(expectedVersion))}`;
|
|
1700
|
+
await this.http.delete(
|
|
1701
|
+
`/builder/apps/${encodeURIComponent(id)}/data/${encodeURIComponent(collection)}/${encodeURIComponent(key)}${suffix}`
|
|
1702
|
+
);
|
|
1703
|
+
}
|
|
1704
|
+
async authorizeAction(id, input) {
|
|
1705
|
+
return this.http.request(
|
|
1706
|
+
`/actions/apps/${encodeURIComponent(id)}/authorize`,
|
|
1707
|
+
{
|
|
1708
|
+
method: "POST",
|
|
1709
|
+
headers: {
|
|
1710
|
+
"x-miosa-app-callback-token": input.callbackToken
|
|
1711
|
+
},
|
|
1712
|
+
body: {
|
|
1713
|
+
release_id: input.releaseId,
|
|
1714
|
+
capability: input.capability,
|
|
1715
|
+
request_fingerprint: input.requestFingerprint,
|
|
1716
|
+
params_fingerprint: input.paramsFingerprint,
|
|
1717
|
+
connector_id: input.connectorId
|
|
1718
|
+
}
|
|
1719
|
+
}
|
|
1720
|
+
);
|
|
1721
|
+
}
|
|
1722
|
+
async mintRuntimeToken(id) {
|
|
1723
|
+
return unwrap9(
|
|
1724
|
+
await this.http.post(
|
|
1725
|
+
`/builder/apps/${encodeURIComponent(id)}/runtime-token`,
|
|
1726
|
+
{}
|
|
1727
|
+
)
|
|
1728
|
+
);
|
|
1729
|
+
}
|
|
1730
|
+
async resolveBinding(id, bindingId, receiptId, callbackToken) {
|
|
1731
|
+
return unwrap9(
|
|
1732
|
+
await this.http.request(
|
|
1733
|
+
`/builder/apps/${encodeURIComponent(id)}/runtime/bindings/${encodeURIComponent(bindingId)}?receipt_id=${encodeURIComponent(receiptId)}`,
|
|
1734
|
+
{
|
|
1735
|
+
method: "GET",
|
|
1736
|
+
headers: {
|
|
1737
|
+
"x-miosa-app-callback-token": callbackToken
|
|
1738
|
+
}
|
|
1739
|
+
}
|
|
1740
|
+
)
|
|
1741
|
+
);
|
|
1742
|
+
}
|
|
1743
|
+
async listAutomationRuns(id) {
|
|
1744
|
+
const payload = await this.http.get(
|
|
1745
|
+
`/builder/apps/${encodeURIComponent(id)}/automation-runs`
|
|
1746
|
+
);
|
|
1747
|
+
return payload.data;
|
|
1748
|
+
}
|
|
1749
|
+
async startAutomationRun(id, automationId, trigger = {}) {
|
|
1750
|
+
return unwrap9(
|
|
1751
|
+
await this.http.post(
|
|
1752
|
+
`/builder/apps/${encodeURIComponent(id)}/automations/${encodeURIComponent(automationId)}/runs`,
|
|
1753
|
+
{ trigger }
|
|
1754
|
+
)
|
|
1755
|
+
);
|
|
1756
|
+
}
|
|
1757
|
+
async claimAutomationStep(id, runId) {
|
|
1758
|
+
return unwrap9(
|
|
1759
|
+
await this.http.post(
|
|
1760
|
+
`/builder/apps/${encodeURIComponent(id)}/automation-runs/${encodeURIComponent(runId)}/claim`,
|
|
1761
|
+
{}
|
|
1762
|
+
)
|
|
1763
|
+
);
|
|
1764
|
+
}
|
|
1765
|
+
async completeAutomationStep(id, runId, cursor, idempotencyKey11, output = null) {
|
|
1766
|
+
return unwrap9(
|
|
1767
|
+
await this.http.post(
|
|
1768
|
+
`/builder/apps/${encodeURIComponent(id)}/automation-runs/${encodeURIComponent(runId)}/complete`,
|
|
1769
|
+
{
|
|
1770
|
+
cursor,
|
|
1771
|
+
idempotency_key: idempotencyKey11,
|
|
1772
|
+
output
|
|
1773
|
+
}
|
|
1774
|
+
)
|
|
1775
|
+
);
|
|
1776
|
+
}
|
|
1777
|
+
async failAutomationStep(id, runId, cursor, idempotencyKey11, reason) {
|
|
1778
|
+
return unwrap9(
|
|
1779
|
+
await this.http.post(
|
|
1780
|
+
`/builder/apps/${encodeURIComponent(id)}/automation-runs/${encodeURIComponent(runId)}/fail`,
|
|
1781
|
+
{
|
|
1782
|
+
cursor,
|
|
1783
|
+
idempotency_key: idempotencyKey11,
|
|
1784
|
+
reason
|
|
1785
|
+
}
|
|
1786
|
+
)
|
|
1787
|
+
);
|
|
1788
|
+
}
|
|
1789
|
+
async revokeApproval(id, approvalId) {
|
|
1790
|
+
await this.http.post(
|
|
1791
|
+
`/builder/apps/${id}/approvals/${approvalId}/revoke`,
|
|
1792
|
+
{}
|
|
1793
|
+
);
|
|
1794
|
+
}
|
|
1795
|
+
};
|
|
1796
|
+
|
|
1527
1797
|
// src/resources/audit-log.ts
|
|
1528
|
-
function
|
|
1798
|
+
function unwrap10(payload) {
|
|
1529
1799
|
if (payload && typeof payload === "object") {
|
|
1530
1800
|
const p = payload;
|
|
1531
1801
|
for (const k of ["data", "audit_log", "events", "items"]) {
|
|
@@ -1548,14 +1818,14 @@ var AuditLog = class {
|
|
|
1548
1818
|
async list(params = {}) {
|
|
1549
1819
|
const query3 = stripUndefined7(params);
|
|
1550
1820
|
const data = await this.http.get("/audit-log", query3);
|
|
1551
|
-
const result =
|
|
1821
|
+
const result = unwrap10(data);
|
|
1552
1822
|
if (Array.isArray(result)) return result;
|
|
1553
1823
|
return [];
|
|
1554
1824
|
}
|
|
1555
1825
|
};
|
|
1556
1826
|
|
|
1557
1827
|
// src/resources/benchmarks.ts
|
|
1558
|
-
function
|
|
1828
|
+
function unwrap11(data) {
|
|
1559
1829
|
if (data && typeof data === "object") {
|
|
1560
1830
|
const d = data;
|
|
1561
1831
|
for (const k of ["data", "benchmarks", "samples", "items"]) {
|
|
@@ -1587,7 +1857,7 @@ var Benchmarks = class {
|
|
|
1587
1857
|
return unwrapList(data);
|
|
1588
1858
|
}
|
|
1589
1859
|
async get(benchmarkId) {
|
|
1590
|
-
return
|
|
1860
|
+
return unwrap11(
|
|
1591
1861
|
await this.http.get(`/admin/benchmarks/${benchmarkId}`)
|
|
1592
1862
|
);
|
|
1593
1863
|
}
|
|
@@ -1596,10 +1866,10 @@ var Benchmarks = class {
|
|
|
1596
1866
|
const body5 = Object.fromEntries(
|
|
1597
1867
|
Object.entries(params).filter(([, v]) => v !== void 0)
|
|
1598
1868
|
);
|
|
1599
|
-
return
|
|
1869
|
+
return unwrap11(await this.http.post("/admin/benchmarks", body5));
|
|
1600
1870
|
}
|
|
1601
1871
|
async cancel(benchmarkId) {
|
|
1602
|
-
return
|
|
1872
|
+
return unwrap11(
|
|
1603
1873
|
await this.http.post(`/admin/benchmarks/${benchmarkId}/cancel`)
|
|
1604
1874
|
);
|
|
1605
1875
|
}
|
|
@@ -1619,14 +1889,14 @@ var Benchmarks = class {
|
|
|
1619
1889
|
const body5 = Object.fromEntries(
|
|
1620
1890
|
Object.entries(params).filter(([, v]) => v !== void 0)
|
|
1621
1891
|
);
|
|
1622
|
-
return
|
|
1892
|
+
return unwrap11(
|
|
1623
1893
|
await this.http.post("/admin/benchmarks/compare", body5)
|
|
1624
1894
|
);
|
|
1625
1895
|
}
|
|
1626
1896
|
};
|
|
1627
1897
|
|
|
1628
1898
|
// src/resources/builder-sessions.ts
|
|
1629
|
-
function
|
|
1899
|
+
function unwrap12(data) {
|
|
1630
1900
|
if (data && typeof data === "object") {
|
|
1631
1901
|
const d = data;
|
|
1632
1902
|
for (const k of ["data", "sessions", "items"]) {
|
|
@@ -1663,7 +1933,7 @@ var BuilderSessions = class {
|
|
|
1663
1933
|
return all.find((s) => s.id === sessionId) ?? {};
|
|
1664
1934
|
}
|
|
1665
1935
|
async updateTitle(sessionId, title) {
|
|
1666
|
-
return
|
|
1936
|
+
return unwrap12(
|
|
1667
1937
|
await this.http.patch(`/builder/sessions/${sessionId}/title`, {
|
|
1668
1938
|
title
|
|
1669
1939
|
})
|
|
@@ -1675,7 +1945,7 @@ var BuilderSessions = class {
|
|
|
1675
1945
|
};
|
|
1676
1946
|
|
|
1677
1947
|
// src/resources/channels.ts
|
|
1678
|
-
function
|
|
1948
|
+
function unwrap13(payload) {
|
|
1679
1949
|
if (payload && typeof payload === "object") {
|
|
1680
1950
|
const p = payload;
|
|
1681
1951
|
for (const k of ["data", "channels", "notifications", "items"]) {
|
|
@@ -1703,26 +1973,26 @@ var Channels = class {
|
|
|
1703
1973
|
async list(params = {}) {
|
|
1704
1974
|
const query3 = stripUndefined8(params);
|
|
1705
1975
|
const data = await this.http.get("/channels", query3);
|
|
1706
|
-
const result =
|
|
1976
|
+
const result = unwrap13(data);
|
|
1707
1977
|
if (Array.isArray(result)) return result;
|
|
1708
1978
|
return [];
|
|
1709
1979
|
}
|
|
1710
1980
|
/** Get a single channel. */
|
|
1711
1981
|
async get(channelId) {
|
|
1712
1982
|
const data = await this.http.get(`/channels/${channelId}`);
|
|
1713
|
-
return
|
|
1983
|
+
return unwrap13(data);
|
|
1714
1984
|
}
|
|
1715
1985
|
/** Create a new channel. */
|
|
1716
1986
|
async create(params) {
|
|
1717
1987
|
const body5 = stripUndefObj(params);
|
|
1718
1988
|
const data = await this.http.post("/channels", body5);
|
|
1719
|
-
return
|
|
1989
|
+
return unwrap13(data);
|
|
1720
1990
|
}
|
|
1721
1991
|
/** Update a channel. */
|
|
1722
1992
|
async update(channelId, params) {
|
|
1723
1993
|
const body5 = stripUndefObj(params);
|
|
1724
1994
|
const data = await this.http.patch(`/channels/${channelId}`, body5);
|
|
1725
|
-
return
|
|
1995
|
+
return unwrap13(data);
|
|
1726
1996
|
}
|
|
1727
1997
|
/** Delete a channel. */
|
|
1728
1998
|
async delete(channelId) {
|
|
@@ -1732,30 +2002,30 @@ var Channels = class {
|
|
|
1732
2002
|
/** Get notification preferences across all channels. */
|
|
1733
2003
|
async listNotifications() {
|
|
1734
2004
|
const data = await this.http.get("/channels/notifications");
|
|
1735
|
-
return
|
|
2005
|
+
return unwrap13(data);
|
|
1736
2006
|
}
|
|
1737
2007
|
/** Update notification preferences. */
|
|
1738
2008
|
async updateNotifications(params) {
|
|
1739
2009
|
const body5 = stripUndefObj(params);
|
|
1740
2010
|
const data = await this.http.put("/channels/notifications", body5);
|
|
1741
|
-
return
|
|
2011
|
+
return unwrap13(data);
|
|
1742
2012
|
}
|
|
1743
2013
|
/** Enable a channel. */
|
|
1744
2014
|
async enable(channelId) {
|
|
1745
2015
|
const data = await this.http.post(`/channels/${channelId}/enable`);
|
|
1746
|
-
return
|
|
2016
|
+
return unwrap13(data);
|
|
1747
2017
|
}
|
|
1748
2018
|
/** Disable a channel. */
|
|
1749
2019
|
async disable(channelId) {
|
|
1750
2020
|
const data = await this.http.post(
|
|
1751
2021
|
`/channels/${channelId}/disable`
|
|
1752
2022
|
);
|
|
1753
|
-
return
|
|
2023
|
+
return unwrap13(data);
|
|
1754
2024
|
}
|
|
1755
2025
|
};
|
|
1756
2026
|
|
|
1757
2027
|
// src/resources/cloud.ts
|
|
1758
|
-
function
|
|
2028
|
+
function unwrap14(payload) {
|
|
1759
2029
|
if (payload !== null && typeof payload === "object" && "data" in payload && payload.data !== void 0) {
|
|
1760
2030
|
return payload.data;
|
|
1761
2031
|
}
|
|
@@ -1830,12 +2100,12 @@ var Cloud = class {
|
|
|
1830
2100
|
}
|
|
1831
2101
|
http;
|
|
1832
2102
|
async listAccounts() {
|
|
1833
|
-
return
|
|
2103
|
+
return unwrap14(
|
|
1834
2104
|
await this.http.get("/cloud/accounts")
|
|
1835
2105
|
);
|
|
1836
2106
|
}
|
|
1837
2107
|
async createAccount(params) {
|
|
1838
|
-
return
|
|
2108
|
+
return unwrap14(
|
|
1839
2109
|
await this.http.post(
|
|
1840
2110
|
"/cloud/accounts",
|
|
1841
2111
|
accountBody(params)
|
|
@@ -1843,7 +2113,7 @@ var Cloud = class {
|
|
|
1843
2113
|
);
|
|
1844
2114
|
}
|
|
1845
2115
|
async attachAwsRole(id, params) {
|
|
1846
|
-
return
|
|
2116
|
+
return unwrap14(
|
|
1847
2117
|
await this.http.post(
|
|
1848
2118
|
`/cloud/accounts/${encodeURIComponent(id)}/aws/role`,
|
|
1849
2119
|
stripUndefined9({
|
|
@@ -1854,7 +2124,7 @@ var Cloud = class {
|
|
|
1854
2124
|
);
|
|
1855
2125
|
}
|
|
1856
2126
|
async listRegions(params = {}) {
|
|
1857
|
-
return
|
|
2127
|
+
return unwrap14(
|
|
1858
2128
|
await this.http.get(
|
|
1859
2129
|
"/cloud/regions",
|
|
1860
2130
|
query(params)
|
|
@@ -1862,7 +2132,7 @@ var Cloud = class {
|
|
|
1862
2132
|
);
|
|
1863
2133
|
}
|
|
1864
2134
|
async createRegion(params) {
|
|
1865
|
-
return
|
|
2135
|
+
return unwrap14(
|
|
1866
2136
|
await this.http.post(
|
|
1867
2137
|
"/cloud/regions",
|
|
1868
2138
|
regionBody(params)
|
|
@@ -1870,12 +2140,12 @@ var Cloud = class {
|
|
|
1870
2140
|
);
|
|
1871
2141
|
}
|
|
1872
2142
|
async listPools(params = {}) {
|
|
1873
|
-
return
|
|
2143
|
+
return unwrap14(
|
|
1874
2144
|
await this.http.get("/cloud/pools", query(params))
|
|
1875
2145
|
);
|
|
1876
2146
|
}
|
|
1877
2147
|
async createPool(params) {
|
|
1878
|
-
return
|
|
2148
|
+
return unwrap14(
|
|
1879
2149
|
await this.http.post(
|
|
1880
2150
|
"/cloud/pools",
|
|
1881
2151
|
poolBody(params)
|
|
@@ -1883,7 +2153,7 @@ var Cloud = class {
|
|
|
1883
2153
|
);
|
|
1884
2154
|
}
|
|
1885
2155
|
async listPreflights(params = {}) {
|
|
1886
|
-
return
|
|
2156
|
+
return unwrap14(
|
|
1887
2157
|
await this.http.get(
|
|
1888
2158
|
"/cloud/preflights",
|
|
1889
2159
|
query(params)
|
|
@@ -1891,7 +2161,7 @@ var Cloud = class {
|
|
|
1891
2161
|
);
|
|
1892
2162
|
}
|
|
1893
2163
|
async recordPreflight(params) {
|
|
1894
|
-
return
|
|
2164
|
+
return unwrap14(
|
|
1895
2165
|
await this.http.post(
|
|
1896
2166
|
"/cloud/preflights",
|
|
1897
2167
|
preflightBody(params)
|
|
@@ -1901,7 +2171,7 @@ var Cloud = class {
|
|
|
1901
2171
|
};
|
|
1902
2172
|
|
|
1903
2173
|
// src/resources/command-center.ts
|
|
1904
|
-
function
|
|
2174
|
+
function unwrap15(data) {
|
|
1905
2175
|
if (data && typeof data === "object") {
|
|
1906
2176
|
const d = data;
|
|
1907
2177
|
for (const k of [
|
|
@@ -1935,7 +2205,7 @@ var CommandCenter = class {
|
|
|
1935
2205
|
http;
|
|
1936
2206
|
/** Top-level snapshot (GET /command-center). */
|
|
1937
2207
|
async overview() {
|
|
1938
|
-
return
|
|
2208
|
+
return unwrap15(await this.http.get("/command-center"));
|
|
1939
2209
|
}
|
|
1940
2210
|
async agents() {
|
|
1941
2211
|
return unwrapList3(await this.http.get("/command-center/agents"));
|
|
@@ -1946,13 +2216,13 @@ var CommandCenter = class {
|
|
|
1946
2216
|
);
|
|
1947
2217
|
}
|
|
1948
2218
|
async metrics() {
|
|
1949
|
-
return
|
|
2219
|
+
return unwrap15(await this.http.get("/command-center/metrics"));
|
|
1950
2220
|
}
|
|
1951
2221
|
async presets() {
|
|
1952
2222
|
return unwrapList3(await this.http.get("/command-center/presets"));
|
|
1953
2223
|
}
|
|
1954
2224
|
async tiers() {
|
|
1955
|
-
return
|
|
2225
|
+
return unwrap15(await this.http.get("/command-center/tiers"));
|
|
1956
2226
|
}
|
|
1957
2227
|
/** Stream live command-center events via SSE. */
|
|
1958
2228
|
events() {
|
|
@@ -1961,7 +2231,7 @@ var CommandCenter = class {
|
|
|
1961
2231
|
};
|
|
1962
2232
|
|
|
1963
2233
|
// src/resources/community.ts
|
|
1964
|
-
function
|
|
2234
|
+
function unwrap16(data) {
|
|
1965
2235
|
if (data && typeof data === "object") {
|
|
1966
2236
|
const d = data;
|
|
1967
2237
|
for (const k of ["data", "templates", "agents", "items"]) {
|
|
@@ -1993,7 +2263,7 @@ var Community = class {
|
|
|
1993
2263
|
return unwrapList4(await this.http.get("/community/agents", query3));
|
|
1994
2264
|
}
|
|
1995
2265
|
async getAgent(agentId) {
|
|
1996
|
-
return
|
|
2266
|
+
return unwrap16(await this.http.get(`/community/agents/${agentId}`));
|
|
1997
2267
|
}
|
|
1998
2268
|
// ── Templates ─────────────────────────────────────────────────────────
|
|
1999
2269
|
async listTemplates(filters = {}) {
|
|
@@ -2005,7 +2275,7 @@ var Community = class {
|
|
|
2005
2275
|
);
|
|
2006
2276
|
}
|
|
2007
2277
|
async getTemplate(templateId) {
|
|
2008
|
-
return
|
|
2278
|
+
return unwrap16(
|
|
2009
2279
|
await this.http.get(`/community/templates/${templateId}`)
|
|
2010
2280
|
);
|
|
2011
2281
|
}
|
|
@@ -2014,7 +2284,7 @@ var Community = class {
|
|
|
2014
2284
|
const body5 = Object.fromEntries(
|
|
2015
2285
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
2016
2286
|
);
|
|
2017
|
-
return
|
|
2287
|
+
return unwrap16(
|
|
2018
2288
|
await this.http.post(
|
|
2019
2289
|
`/community/templates/${templateId}/install`,
|
|
2020
2290
|
body5
|
|
@@ -2029,7 +2299,7 @@ var Community = class {
|
|
|
2029
2299
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
2030
2300
|
)
|
|
2031
2301
|
};
|
|
2032
|
-
return
|
|
2302
|
+
return unwrap16(
|
|
2033
2303
|
await this.http.post(
|
|
2034
2304
|
`/community/templates/${templateId}/rate`,
|
|
2035
2305
|
body5
|
|
@@ -2039,7 +2309,7 @@ var Community = class {
|
|
|
2039
2309
|
};
|
|
2040
2310
|
|
|
2041
2311
|
// src/resources/completions.ts
|
|
2042
|
-
function
|
|
2312
|
+
function unwrap17(data) {
|
|
2043
2313
|
if (data && typeof data === "object") {
|
|
2044
2314
|
const d = data;
|
|
2045
2315
|
if (Array.isArray(d.choices)) return d;
|
|
@@ -2065,7 +2335,7 @@ var Completions = class {
|
|
|
2065
2335
|
{ method: "POST", body: body5 }
|
|
2066
2336
|
);
|
|
2067
2337
|
}
|
|
2068
|
-
return this.http.post("/intelligence/completions", body5).then(
|
|
2338
|
+
return this.http.post("/intelligence/completions", body5).then(unwrap17);
|
|
2069
2339
|
}
|
|
2070
2340
|
chat(params) {
|
|
2071
2341
|
const body5 = buildBody(params);
|
|
@@ -2075,7 +2345,7 @@ var Completions = class {
|
|
|
2075
2345
|
{ method: "POST", body: body5 }
|
|
2076
2346
|
);
|
|
2077
2347
|
}
|
|
2078
|
-
return this.http.post("/intelligence/chat/completions", body5).then(
|
|
2348
|
+
return this.http.post("/intelligence/chat/completions", body5).then(unwrap17);
|
|
2079
2349
|
}
|
|
2080
2350
|
};
|
|
2081
2351
|
|
|
@@ -2198,7 +2468,7 @@ var Checkpoints = class {
|
|
|
2198
2468
|
};
|
|
2199
2469
|
|
|
2200
2470
|
// src/resources/computer-auto-stop.ts
|
|
2201
|
-
function
|
|
2471
|
+
function unwrap18(data) {
|
|
2202
2472
|
if (data && typeof data === "object") {
|
|
2203
2473
|
const d = data;
|
|
2204
2474
|
if ("data" in d && Object.keys(d).length <= 2) {
|
|
@@ -2216,13 +2486,13 @@ var ComputerAutoStop = class {
|
|
|
2216
2486
|
computerId;
|
|
2217
2487
|
/** Return the current auto-stop configuration. */
|
|
2218
2488
|
async get() {
|
|
2219
|
-
return
|
|
2489
|
+
return unwrap18(
|
|
2220
2490
|
await this.http.get(`/computers/${this.computerId}/auto-stop`)
|
|
2221
2491
|
);
|
|
2222
2492
|
}
|
|
2223
2493
|
/** Set the idle timeout in seconds (0 disables auto-stop). */
|
|
2224
2494
|
async update(seconds) {
|
|
2225
|
-
return
|
|
2495
|
+
return unwrap18(
|
|
2226
2496
|
await this.http.patch(
|
|
2227
2497
|
`/computers/${this.computerId}/auto-stop`,
|
|
2228
2498
|
{ seconds }
|
|
@@ -2232,7 +2502,7 @@ var ComputerAutoStop = class {
|
|
|
2232
2502
|
};
|
|
2233
2503
|
|
|
2234
2504
|
// src/resources/computer-env.ts
|
|
2235
|
-
function
|
|
2505
|
+
function unwrap19(data) {
|
|
2236
2506
|
if (data && typeof data === "object") {
|
|
2237
2507
|
const d = data;
|
|
2238
2508
|
if ("data" in d && Object.keys(d).length <= 2) {
|
|
@@ -2267,11 +2537,11 @@ var ComputerEnv = class {
|
|
|
2267
2537
|
}
|
|
2268
2538
|
/** Create a new env var. Use update() to change an existing one. */
|
|
2269
2539
|
async set(name, value) {
|
|
2270
|
-
return
|
|
2540
|
+
return unwrap19(await this.http.post(this.base(), { name, value }));
|
|
2271
2541
|
}
|
|
2272
2542
|
/** Patch the value of an existing env var by name. */
|
|
2273
2543
|
async update(name, value) {
|
|
2274
|
-
return
|
|
2544
|
+
return unwrap19(
|
|
2275
2545
|
await this.http.patch(`${this.base()}/${name}`, { value })
|
|
2276
2546
|
);
|
|
2277
2547
|
}
|
|
@@ -2288,7 +2558,7 @@ var ComputerEnv = class {
|
|
|
2288
2558
|
};
|
|
2289
2559
|
|
|
2290
2560
|
// src/resources/computer-logs.ts
|
|
2291
|
-
function
|
|
2561
|
+
function unwrap20(data) {
|
|
2292
2562
|
if (data && typeof data === "object") {
|
|
2293
2563
|
const d = data;
|
|
2294
2564
|
if ("data" in d && Object.keys(d).length <= 2) {
|
|
@@ -2309,7 +2579,7 @@ var ComputerLogs = class {
|
|
|
2309
2579
|
const query3 = Object.fromEntries(
|
|
2310
2580
|
Object.entries(params).filter(([, v]) => v !== void 0)
|
|
2311
2581
|
);
|
|
2312
|
-
return
|
|
2582
|
+
return unwrap20(
|
|
2313
2583
|
await this.http.get(`/computers/${this.computerId}/logs`, query3)
|
|
2314
2584
|
);
|
|
2315
2585
|
}
|
|
@@ -2322,7 +2592,7 @@ var ComputerLogs = class {
|
|
|
2322
2592
|
};
|
|
2323
2593
|
|
|
2324
2594
|
// src/resources/computer-osa.ts
|
|
2325
|
-
function
|
|
2595
|
+
function unwrap21(data) {
|
|
2326
2596
|
if (data && typeof data === "object") {
|
|
2327
2597
|
const d = data;
|
|
2328
2598
|
if ("data" in d && Object.keys(d).length <= 2) {
|
|
@@ -2346,7 +2616,7 @@ var ComputerOsa = class {
|
|
|
2346
2616
|
Object.entries(params).filter(([, v]) => v !== void 0)
|
|
2347
2617
|
)
|
|
2348
2618
|
};
|
|
2349
|
-
return
|
|
2619
|
+
return unwrap21(
|
|
2350
2620
|
await this.http.post(
|
|
2351
2621
|
`/computers/${this.computerId}/osa/task`,
|
|
2352
2622
|
body5
|
|
@@ -2355,13 +2625,13 @@ var ComputerOsa = class {
|
|
|
2355
2625
|
}
|
|
2356
2626
|
/** Cancel the currently-running OSA task, if any. */
|
|
2357
2627
|
async cancelTask() {
|
|
2358
|
-
return
|
|
2628
|
+
return unwrap21(
|
|
2359
2629
|
await this.http.delete(`/computers/${this.computerId}/osa/task`)
|
|
2360
2630
|
);
|
|
2361
2631
|
}
|
|
2362
2632
|
/** Return OSA's current task / configuration / health snapshot. */
|
|
2363
2633
|
async status() {
|
|
2364
|
-
return
|
|
2634
|
+
return unwrap21(
|
|
2365
2635
|
await this.http.get(`/computers/${this.computerId}/osa/status`)
|
|
2366
2636
|
);
|
|
2367
2637
|
}
|
|
@@ -2370,7 +2640,7 @@ var ComputerOsa = class {
|
|
|
2370
2640
|
const body5 = Object.fromEntries(
|
|
2371
2641
|
Object.entries(config).filter(([, v]) => v !== void 0)
|
|
2372
2642
|
);
|
|
2373
|
-
return
|
|
2643
|
+
return unwrap21(
|
|
2374
2644
|
await this.http.post(
|
|
2375
2645
|
`/computers/${this.computerId}/osa/configure`,
|
|
2376
2646
|
body5
|
|
@@ -2380,7 +2650,7 @@ var ComputerOsa = class {
|
|
|
2380
2650
|
};
|
|
2381
2651
|
|
|
2382
2652
|
// src/resources/computer-ports.ts
|
|
2383
|
-
function
|
|
2653
|
+
function unwrap22(data) {
|
|
2384
2654
|
if (data && typeof data === "object") {
|
|
2385
2655
|
const d = data;
|
|
2386
2656
|
if ("data" in d && Object.keys(d).length <= 2) {
|
|
@@ -2425,14 +2695,14 @@ var ComputerPorts = class {
|
|
|
2425
2695
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
2426
2696
|
)
|
|
2427
2697
|
};
|
|
2428
|
-
return
|
|
2698
|
+
return unwrap22(await this.http.post(this.base(), body5));
|
|
2429
2699
|
}
|
|
2430
2700
|
/** Patch visibility / auth options for port. */
|
|
2431
2701
|
async update(port, opts) {
|
|
2432
2702
|
const body5 = Object.fromEntries(
|
|
2433
2703
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
2434
2704
|
);
|
|
2435
|
-
return
|
|
2705
|
+
return unwrap22(
|
|
2436
2706
|
await this.http.patch(`${this.base()}/${port}`, body5)
|
|
2437
2707
|
);
|
|
2438
2708
|
}
|
|
@@ -2459,7 +2729,7 @@ var ComputerTerminal = class {
|
|
|
2459
2729
|
`/computers/${this.computerId}/terminal`,
|
|
2460
2730
|
body5
|
|
2461
2731
|
);
|
|
2462
|
-
return
|
|
2732
|
+
return unwrap23(raw);
|
|
2463
2733
|
}
|
|
2464
2734
|
/** Resize an existing PTY session. */
|
|
2465
2735
|
async resize(sessionId, cols, rows) {
|
|
@@ -2467,10 +2737,10 @@ var ComputerTerminal = class {
|
|
|
2467
2737
|
`/computers/${this.computerId}/pty/${sessionId}/resize`,
|
|
2468
2738
|
{ cols, rows }
|
|
2469
2739
|
);
|
|
2470
|
-
return
|
|
2740
|
+
return unwrap23(raw);
|
|
2471
2741
|
}
|
|
2472
2742
|
};
|
|
2473
|
-
function
|
|
2743
|
+
function unwrap23(data) {
|
|
2474
2744
|
if (data && typeof data === "object") {
|
|
2475
2745
|
const d = data;
|
|
2476
2746
|
if ("data" in d && Object.keys(d).length <= 2) {
|
|
@@ -2481,7 +2751,7 @@ function unwrap21(data) {
|
|
|
2481
2751
|
}
|
|
2482
2752
|
|
|
2483
2753
|
// src/resources/computer-volumes.ts
|
|
2484
|
-
function
|
|
2754
|
+
function unwrap24(data) {
|
|
2485
2755
|
if (data && typeof data === "object") {
|
|
2486
2756
|
const d = data;
|
|
2487
2757
|
if ("data" in d && Object.keys(d).length <= 2) {
|
|
@@ -2515,7 +2785,7 @@ var ComputerVolumes = class {
|
|
|
2515
2785
|
}
|
|
2516
2786
|
/** Attach volumeId at mountPath inside the VM. */
|
|
2517
2787
|
async attach(volumeId, mountPath) {
|
|
2518
|
-
return
|
|
2788
|
+
return unwrap24(
|
|
2519
2789
|
await this.http.post(this.base(), {
|
|
2520
2790
|
volume_id: volumeId,
|
|
2521
2791
|
mount_path: mountPath
|
|
@@ -2529,7 +2799,7 @@ var ComputerVolumes = class {
|
|
|
2529
2799
|
};
|
|
2530
2800
|
|
|
2531
2801
|
// src/resources/connectors.ts
|
|
2532
|
-
function
|
|
2802
|
+
function unwrap25(payload) {
|
|
2533
2803
|
if (payload && typeof payload === "object") {
|
|
2534
2804
|
const p = payload;
|
|
2535
2805
|
for (const key of ["data", "binding"]) {
|
|
@@ -2740,7 +3010,7 @@ var Connectors = class {
|
|
|
2740
3010
|
const data = await this.http.get(
|
|
2741
3011
|
`/connect/connectors/${connectorPath(connector)}`
|
|
2742
3012
|
);
|
|
2743
|
-
return
|
|
3013
|
+
return unwrap25(data);
|
|
2744
3014
|
}
|
|
2745
3015
|
show(connector) {
|
|
2746
3016
|
return this.get(connector);
|
|
@@ -2751,7 +3021,7 @@ var Connectors = class {
|
|
|
2751
3021
|
"/connect/connectors",
|
|
2752
3022
|
bodyFromCreateParams(provider, params)
|
|
2753
3023
|
);
|
|
2754
|
-
return
|
|
3024
|
+
return unwrap25(data);
|
|
2755
3025
|
}
|
|
2756
3026
|
/** Request a runtime provider token for a connector. */
|
|
2757
3027
|
async getToken(connector, params = {}) {
|
|
@@ -2759,7 +3029,7 @@ var Connectors = class {
|
|
|
2759
3029
|
`/connect/token/${connectorPath(connector)}`,
|
|
2760
3030
|
tokenBody(params)
|
|
2761
3031
|
);
|
|
2762
|
-
return
|
|
3032
|
+
return unwrap25(data);
|
|
2763
3033
|
}
|
|
2764
3034
|
token(connector, params = {}) {
|
|
2765
3035
|
return this.getToken(connector, params);
|
|
@@ -2781,7 +3051,7 @@ var Connectors = class {
|
|
|
2781
3051
|
...externalAttributionParams(params)
|
|
2782
3052
|
})
|
|
2783
3053
|
);
|
|
2784
|
-
return
|
|
3054
|
+
return unwrap25(data);
|
|
2785
3055
|
}
|
|
2786
3056
|
/** List connector installations/grants. */
|
|
2787
3057
|
async installations(params = {}) {
|
|
@@ -2821,7 +3091,7 @@ var Connectors = class {
|
|
|
2821
3091
|
"/connect/defaults/materialize",
|
|
2822
3092
|
materializeDefaultsBody(params)
|
|
2823
3093
|
);
|
|
2824
|
-
return
|
|
3094
|
+
return unwrap25(data);
|
|
2825
3095
|
}
|
|
2826
3096
|
/** Create an inherited connector default for future runtime resources. */
|
|
2827
3097
|
async createDefault(params) {
|
|
@@ -2829,7 +3099,7 @@ var Connectors = class {
|
|
|
2829
3099
|
"/connect/defaults",
|
|
2830
3100
|
defaultBody(params)
|
|
2831
3101
|
);
|
|
2832
|
-
return
|
|
3102
|
+
return unwrap25(data);
|
|
2833
3103
|
}
|
|
2834
3104
|
/** Delete an inherited connector default. */
|
|
2835
3105
|
async deleteDefault(id) {
|
|
@@ -2849,7 +3119,7 @@ var Connectors = class {
|
|
|
2849
3119
|
"/connect/triggers",
|
|
2850
3120
|
triggerBody(params)
|
|
2851
3121
|
);
|
|
2852
|
-
return
|
|
3122
|
+
return unwrap25(data);
|
|
2853
3123
|
}
|
|
2854
3124
|
/** List inbound provider trigger delivery attempts. */
|
|
2855
3125
|
async triggerDeliveries(params = {}) {
|
|
@@ -2876,7 +3146,7 @@ var Connectors = class {
|
|
|
2876
3146
|
"/connect/project-links",
|
|
2877
3147
|
projectLinkBody(params)
|
|
2878
3148
|
);
|
|
2879
|
-
return
|
|
3149
|
+
return unwrap25(data);
|
|
2880
3150
|
}
|
|
2881
3151
|
/** Delete a project connector link. */
|
|
2882
3152
|
async deleteProjectLink(id) {
|
|
@@ -2912,7 +3182,7 @@ var RuntimeConnectors = class {
|
|
|
2912
3182
|
...externalAttributionParams(params)
|
|
2913
3183
|
})
|
|
2914
3184
|
);
|
|
2915
|
-
return
|
|
3185
|
+
return unwrap25(data);
|
|
2916
3186
|
}
|
|
2917
3187
|
/** Detach a connector binding by binding id or connector UID. */
|
|
2918
3188
|
async detach(bindingOrConnector) {
|
|
@@ -2921,7 +3191,7 @@ var RuntimeConnectors = class {
|
|
|
2921
3191
|
/** Sync or materialize connector placeholder env vars for this runtime resource. */
|
|
2922
3192
|
async sync() {
|
|
2923
3193
|
const data = await this.http.post(`${this.basePath}/sync`, {});
|
|
2924
|
-
return
|
|
3194
|
+
return unwrap25(data);
|
|
2925
3195
|
}
|
|
2926
3196
|
/** Verify a required connector is attached before agent work begins. */
|
|
2927
3197
|
async preflight(params = {}) {
|
|
@@ -2929,7 +3199,7 @@ var RuntimeConnectors = class {
|
|
|
2929
3199
|
`${this.basePath}/preflight`,
|
|
2930
3200
|
stripUndefined10(params)
|
|
2931
3201
|
);
|
|
2932
|
-
return
|
|
3202
|
+
return unwrap25(data);
|
|
2933
3203
|
}
|
|
2934
3204
|
};
|
|
2935
3205
|
var SandboxConnectors = class extends RuntimeConnectors {
|
|
@@ -3132,7 +3402,7 @@ var Desktop = class {
|
|
|
3132
3402
|
};
|
|
3133
3403
|
|
|
3134
3404
|
// src/resources/egressAudit.ts
|
|
3135
|
-
function
|
|
3405
|
+
function unwrap26(payload) {
|
|
3136
3406
|
if (payload && typeof payload === "object") {
|
|
3137
3407
|
const p = payload;
|
|
3138
3408
|
for (const k of ["data", "event", "items"]) {
|
|
@@ -3198,7 +3468,7 @@ var EgressAudit = class {
|
|
|
3198
3468
|
const data = await this.http.get(
|
|
3199
3469
|
`/egress/audit/${id}`
|
|
3200
3470
|
);
|
|
3201
|
-
return
|
|
3471
|
+
return unwrap26(data);
|
|
3202
3472
|
}
|
|
3203
3473
|
/**
|
|
3204
3474
|
* Long-poll the audit endpoint and yield new events as they appear.
|
|
@@ -3274,7 +3544,7 @@ var ComputerAudit = class extends SandboxAudit {
|
|
|
3274
3544
|
};
|
|
3275
3545
|
|
|
3276
3546
|
// src/resources/egressNetwork.ts
|
|
3277
|
-
function
|
|
3547
|
+
function unwrap27(payload) {
|
|
3278
3548
|
if (payload && typeof payload === "object") {
|
|
3279
3549
|
const p = payload;
|
|
3280
3550
|
for (const k of ["data", "policy", "rule", "items"]) {
|
|
@@ -3333,7 +3603,7 @@ var EgressNetwork = class {
|
|
|
3333
3603
|
"/egress/allowlist",
|
|
3334
3604
|
ruleBody(host, params, "allow")
|
|
3335
3605
|
);
|
|
3336
|
-
return
|
|
3606
|
+
return unwrap27(data);
|
|
3337
3607
|
}
|
|
3338
3608
|
/** Add a `deny` rule for `host` to the allowlist. */
|
|
3339
3609
|
async deny(host, params = {}) {
|
|
@@ -3341,7 +3611,7 @@ var EgressNetwork = class {
|
|
|
3341
3611
|
"/egress/allowlist",
|
|
3342
3612
|
ruleBody(host, params, "deny")
|
|
3343
3613
|
);
|
|
3344
|
-
return
|
|
3614
|
+
return unwrap27(data);
|
|
3345
3615
|
}
|
|
3346
3616
|
/** List allowlist rules. */
|
|
3347
3617
|
async rules(params = {}) {
|
|
@@ -3385,7 +3655,7 @@ var EgressNetwork = class {
|
|
|
3385
3655
|
"/egress/policies",
|
|
3386
3656
|
body5
|
|
3387
3657
|
);
|
|
3388
|
-
return
|
|
3658
|
+
return unwrap27(data);
|
|
3389
3659
|
}
|
|
3390
3660
|
/** Update an egress policy by id. */
|
|
3391
3661
|
async updatePolicy(policyId, params) {
|
|
@@ -3399,7 +3669,7 @@ var EgressNetwork = class {
|
|
|
3399
3669
|
`/egress/policies/${policyId}`,
|
|
3400
3670
|
body5
|
|
3401
3671
|
);
|
|
3402
|
-
return
|
|
3672
|
+
return unwrap27(data);
|
|
3403
3673
|
}
|
|
3404
3674
|
// ── mode helpers ──────────────────────────────────────────────────────────
|
|
3405
3675
|
/** Set the policy to `mode="enforce"` — denied egress is blocked. */
|
|
@@ -3426,7 +3696,7 @@ var EgressNetwork = class {
|
|
|
3426
3696
|
"/egress/policies",
|
|
3427
3697
|
body5
|
|
3428
3698
|
);
|
|
3429
|
-
return
|
|
3699
|
+
return unwrap27(data);
|
|
3430
3700
|
}
|
|
3431
3701
|
// ── suggestions ───────────────────────────────────────────────────────────
|
|
3432
3702
|
/** AI-generated allowlist suggestions from recent denied egress. */
|
|
@@ -3517,7 +3787,7 @@ var ComputerNetwork = class extends SandboxNetwork {
|
|
|
3517
3787
|
};
|
|
3518
3788
|
|
|
3519
3789
|
// src/resources/egressSecrets.ts
|
|
3520
|
-
function
|
|
3790
|
+
function unwrap28(payload) {
|
|
3521
3791
|
if (payload && typeof payload === "object") {
|
|
3522
3792
|
const p = payload;
|
|
3523
3793
|
for (const k of ["data", "secret", "binding", "items"]) {
|
|
@@ -3653,7 +3923,7 @@ var OAuthFlow = class {
|
|
|
3653
3923
|
const data = await this.http.get("/egress/oauth/status", {
|
|
3654
3924
|
state: this.state
|
|
3655
3925
|
});
|
|
3656
|
-
const payload =
|
|
3926
|
+
const payload = unwrap28(data) ?? {};
|
|
3657
3927
|
const status = payload.status;
|
|
3658
3928
|
if (status === "completed" || status === "ready" || status === "succeeded") {
|
|
3659
3929
|
return payload;
|
|
@@ -3685,7 +3955,7 @@ var EgressSecrets = class {
|
|
|
3685
3955
|
"/egress/secrets",
|
|
3686
3956
|
setBody(params)
|
|
3687
3957
|
);
|
|
3688
|
-
return
|
|
3958
|
+
return unwrap28(data);
|
|
3689
3959
|
}
|
|
3690
3960
|
/** List secrets. */
|
|
3691
3961
|
async list(params = {}) {
|
|
@@ -3700,7 +3970,7 @@ var EgressSecrets = class {
|
|
|
3700
3970
|
const data = await this.http.get(
|
|
3701
3971
|
`/egress/secrets/${id}`
|
|
3702
3972
|
);
|
|
3703
|
-
return
|
|
3973
|
+
return unwrap28(data);
|
|
3704
3974
|
}
|
|
3705
3975
|
/** Rotate the secret's value. */
|
|
3706
3976
|
async rotate(id, params) {
|
|
@@ -3709,7 +3979,7 @@ var EgressSecrets = class {
|
|
|
3709
3979
|
`/egress/secrets/${id}`,
|
|
3710
3980
|
body5
|
|
3711
3981
|
);
|
|
3712
|
-
return
|
|
3982
|
+
return unwrap28(data);
|
|
3713
3983
|
}
|
|
3714
3984
|
/** Delete a secret. */
|
|
3715
3985
|
async delete(id) {
|
|
@@ -3722,7 +3992,7 @@ var EgressSecrets = class {
|
|
|
3722
3992
|
"/egress/bindings",
|
|
3723
3993
|
bindingBody(params)
|
|
3724
3994
|
);
|
|
3725
|
-
return
|
|
3995
|
+
return unwrap28(data);
|
|
3726
3996
|
}
|
|
3727
3997
|
/** List secret bindings. */
|
|
3728
3998
|
async listBindings(params = {}) {
|
|
@@ -3755,7 +4025,7 @@ var EgressSecrets = class {
|
|
|
3755
4025
|
"/egress/oauth/start",
|
|
3756
4026
|
oauthBody(params)
|
|
3757
4027
|
);
|
|
3758
|
-
const payload =
|
|
4028
|
+
const payload = unwrap28(data) ?? {};
|
|
3759
4029
|
return new OAuthFlow(this.http, payload, params.provider);
|
|
3760
4030
|
}
|
|
3761
4031
|
};
|
|
@@ -4919,7 +5189,7 @@ var Credits = class {
|
|
|
4919
5189
|
return this.http.get("/credits/usage");
|
|
4920
5190
|
}
|
|
4921
5191
|
};
|
|
4922
|
-
function
|
|
5192
|
+
function unwrap29(payload) {
|
|
4923
5193
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
4924
5194
|
return payload.data;
|
|
4925
5195
|
}
|
|
@@ -4955,7 +5225,7 @@ var CronJobs = class {
|
|
|
4955
5225
|
}
|
|
4956
5226
|
async get(jobId) {
|
|
4957
5227
|
const data = await this.http.get(`/cron-jobs/${jobId}`);
|
|
4958
|
-
return
|
|
5228
|
+
return unwrap29(data);
|
|
4959
5229
|
}
|
|
4960
5230
|
async create(params) {
|
|
4961
5231
|
const { idempotencyKey: ikey, ...rest } = params;
|
|
@@ -4965,12 +5235,12 @@ var CronJobs = class {
|
|
|
4965
5235
|
body: body5,
|
|
4966
5236
|
headers: { "Idempotency-Key": idempotencyKey2(ikey) }
|
|
4967
5237
|
});
|
|
4968
|
-
return
|
|
5238
|
+
return unwrap29(data);
|
|
4969
5239
|
}
|
|
4970
5240
|
async update(jobId, params) {
|
|
4971
5241
|
const body5 = stripUndefined14(params);
|
|
4972
5242
|
const data = await this.http.patch(`/cron-jobs/${jobId}`, body5);
|
|
4973
|
-
return
|
|
5243
|
+
return unwrap29(data);
|
|
4974
5244
|
}
|
|
4975
5245
|
async delete(jobId) {
|
|
4976
5246
|
await this.http.delete(`/cron-jobs/${jobId}`);
|
|
@@ -4978,11 +5248,11 @@ var CronJobs = class {
|
|
|
4978
5248
|
// ── Control ────────────────────────────────────────────────────────────────
|
|
4979
5249
|
async pause(jobId) {
|
|
4980
5250
|
const data = await this.http.post(`/cron-jobs/${jobId}/pause`);
|
|
4981
|
-
return
|
|
5251
|
+
return unwrap29(data);
|
|
4982
5252
|
}
|
|
4983
5253
|
async resume(jobId) {
|
|
4984
5254
|
const data = await this.http.post(`/cron-jobs/${jobId}/resume`);
|
|
4985
|
-
return
|
|
5255
|
+
return unwrap29(data);
|
|
4986
5256
|
}
|
|
4987
5257
|
async runNow(jobId, opts = {}) {
|
|
4988
5258
|
const data = await this.http.request(
|
|
@@ -4992,7 +5262,7 @@ var CronJobs = class {
|
|
|
4992
5262
|
headers: { "Idempotency-Key": idempotencyKey2(opts.idempotencyKey) }
|
|
4993
5263
|
}
|
|
4994
5264
|
);
|
|
4995
|
-
return
|
|
5265
|
+
return unwrap29(data);
|
|
4996
5266
|
}
|
|
4997
5267
|
// ── Execution history ──────────────────────────────────────────────────────
|
|
4998
5268
|
async listExecutions(jobId) {
|
|
@@ -5007,12 +5277,12 @@ var CronJobs = class {
|
|
|
5007
5277
|
const data = await this.http.get(
|
|
5008
5278
|
`/cron-jobs/${jobId}/executions/${executionId}`
|
|
5009
5279
|
);
|
|
5010
|
-
return
|
|
5280
|
+
return unwrap29(data);
|
|
5011
5281
|
}
|
|
5012
5282
|
};
|
|
5013
5283
|
|
|
5014
5284
|
// src/resources/dashboard.ts
|
|
5015
|
-
function
|
|
5285
|
+
function unwrap30(payload) {
|
|
5016
5286
|
if (payload && typeof payload === "object") {
|
|
5017
5287
|
const p = payload;
|
|
5018
5288
|
for (const k of ["data", "dashboard", "overview", "items"]) {
|
|
@@ -5029,15 +5299,15 @@ var Dashboard = class {
|
|
|
5029
5299
|
/** Aggregated user dashboard payload. */
|
|
5030
5300
|
async summary() {
|
|
5031
5301
|
const data = await this.http.get("/dashboard");
|
|
5032
|
-
return
|
|
5302
|
+
return unwrap30(data);
|
|
5033
5303
|
}
|
|
5034
5304
|
/** Status / health overview (public endpoint). */
|
|
5035
5305
|
async overview() {
|
|
5036
5306
|
const data = await this.http.get("/overview");
|
|
5037
|
-
return
|
|
5307
|
+
return unwrap30(data);
|
|
5038
5308
|
}
|
|
5039
5309
|
};
|
|
5040
|
-
function
|
|
5310
|
+
function unwrap31(payload) {
|
|
5041
5311
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
5042
5312
|
return payload.data;
|
|
5043
5313
|
}
|
|
@@ -5073,7 +5343,7 @@ var Databases = class {
|
|
|
5073
5343
|
}
|
|
5074
5344
|
async get(databaseId) {
|
|
5075
5345
|
const data = await this.http.get(`/databases/${databaseId}`);
|
|
5076
|
-
return
|
|
5346
|
+
return unwrap31(data);
|
|
5077
5347
|
}
|
|
5078
5348
|
async create(params) {
|
|
5079
5349
|
const {
|
|
@@ -5097,7 +5367,7 @@ var Databases = class {
|
|
|
5097
5367
|
)
|
|
5098
5368
|
}
|
|
5099
5369
|
});
|
|
5100
|
-
return
|
|
5370
|
+
return unwrap31(data);
|
|
5101
5371
|
}
|
|
5102
5372
|
async delete(databaseId) {
|
|
5103
5373
|
await this.http.delete(`/databases/${databaseId}`);
|
|
@@ -5107,24 +5377,24 @@ var Databases = class {
|
|
|
5107
5377
|
const data = await this.http.post(
|
|
5108
5378
|
`/databases/${databaseId}/start`
|
|
5109
5379
|
);
|
|
5110
|
-
return
|
|
5380
|
+
return unwrap31(data);
|
|
5111
5381
|
}
|
|
5112
5382
|
async stop(databaseId) {
|
|
5113
5383
|
const data = await this.http.post(`/databases/${databaseId}/stop`);
|
|
5114
|
-
return
|
|
5384
|
+
return unwrap31(data);
|
|
5115
5385
|
}
|
|
5116
5386
|
async restart(databaseId) {
|
|
5117
5387
|
const data = await this.http.post(
|
|
5118
5388
|
`/databases/${databaseId}/restart`
|
|
5119
5389
|
);
|
|
5120
|
-
return
|
|
5390
|
+
return unwrap31(data);
|
|
5121
5391
|
}
|
|
5122
5392
|
// ── Credentials + logs ────────────────────────────────────────────────────
|
|
5123
5393
|
async credentials(databaseId) {
|
|
5124
5394
|
const data = await this.http.get(
|
|
5125
5395
|
`/databases/${databaseId}/credentials`
|
|
5126
5396
|
);
|
|
5127
|
-
return
|
|
5397
|
+
return unwrap31(data);
|
|
5128
5398
|
}
|
|
5129
5399
|
async logs(databaseId, params = {}) {
|
|
5130
5400
|
const query3 = stripUndefined15({
|
|
@@ -5154,7 +5424,7 @@ function attributionBody(p) {
|
|
|
5154
5424
|
function idempotencyKey4(key) {
|
|
5155
5425
|
return key ?? randomUUID();
|
|
5156
5426
|
}
|
|
5157
|
-
function
|
|
5427
|
+
function unwrap32(payload) {
|
|
5158
5428
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
5159
5429
|
return payload.data;
|
|
5160
5430
|
}
|
|
@@ -5263,7 +5533,7 @@ var DeploymentVersions = class {
|
|
|
5263
5533
|
const data = await this.http.get(
|
|
5264
5534
|
`/deployments/${this.deploymentId}/versions/${versionId}`
|
|
5265
5535
|
);
|
|
5266
|
-
return
|
|
5536
|
+
return unwrap32(data);
|
|
5267
5537
|
}
|
|
5268
5538
|
async promote(versionId, opts = {}) {
|
|
5269
5539
|
const body5 = stripUndefined16({ environment: opts.environment });
|
|
@@ -5275,14 +5545,14 @@ var DeploymentVersions = class {
|
|
|
5275
5545
|
headers: { "Idempotency-Key": idempotencyKey4(opts.idempotencyKey) }
|
|
5276
5546
|
}
|
|
5277
5547
|
);
|
|
5278
|
-
return
|
|
5548
|
+
return unwrap32(data);
|
|
5279
5549
|
}
|
|
5280
5550
|
async prepareMigrationBackup(versionId) {
|
|
5281
5551
|
const data = await this.http.request(
|
|
5282
5552
|
`/deployments/${this.deploymentId}/versions/${versionId}/migration-backup`,
|
|
5283
5553
|
{ method: "POST", body: {} }
|
|
5284
5554
|
);
|
|
5285
|
-
return
|
|
5555
|
+
return unwrap32(data);
|
|
5286
5556
|
}
|
|
5287
5557
|
};
|
|
5288
5558
|
var DeploymentReleases = class {
|
|
@@ -5302,7 +5572,7 @@ var DeploymentReleases = class {
|
|
|
5302
5572
|
const data = await this.http.get(
|
|
5303
5573
|
`/deployments/${this.deploymentId}/releases/${releaseId}`
|
|
5304
5574
|
);
|
|
5305
|
-
return
|
|
5575
|
+
return unwrap32(data);
|
|
5306
5576
|
}
|
|
5307
5577
|
async promote(releaseId, idempotencyKey11) {
|
|
5308
5578
|
const key = idempotencyKey11 ?? `promote:${this.deploymentId}:${releaseId}`;
|
|
@@ -5314,7 +5584,7 @@ var DeploymentReleases = class {
|
|
|
5314
5584
|
headers: { "Idempotency-Key": key }
|
|
5315
5585
|
}
|
|
5316
5586
|
);
|
|
5317
|
-
return
|
|
5587
|
+
return unwrap32(data);
|
|
5318
5588
|
}
|
|
5319
5589
|
};
|
|
5320
5590
|
var DeploymentRuntimeInstances = class {
|
|
@@ -5334,14 +5604,14 @@ var DeploymentRuntimeInstances = class {
|
|
|
5334
5604
|
const data = await this.http.get(
|
|
5335
5605
|
`/deployments/${this.deploymentId}/runtime-instances/${instanceId}`
|
|
5336
5606
|
);
|
|
5337
|
-
return
|
|
5607
|
+
return unwrap32(data);
|
|
5338
5608
|
}
|
|
5339
5609
|
async logs(instanceId, lines = 100) {
|
|
5340
5610
|
const data = await this.http.get(
|
|
5341
5611
|
`/deployments/${this.deploymentId}/runtime-instances/${instanceId}/logs`,
|
|
5342
5612
|
{ lines }
|
|
5343
5613
|
);
|
|
5344
|
-
const unwrapped =
|
|
5614
|
+
const unwrapped = unwrap32(data);
|
|
5345
5615
|
const result = { logs: String(unwrapped.logs ?? "") };
|
|
5346
5616
|
if (typeof unwrapped.runtime_instance_id === "string") {
|
|
5347
5617
|
result.runtime_instance_id = unwrapped.runtime_instance_id;
|
|
@@ -5376,7 +5646,7 @@ var DeploymentDomains = class {
|
|
|
5376
5646
|
headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
|
|
5377
5647
|
}
|
|
5378
5648
|
);
|
|
5379
|
-
return
|
|
5649
|
+
return unwrap32(data);
|
|
5380
5650
|
}
|
|
5381
5651
|
async list(filters = {}) {
|
|
5382
5652
|
const data = await this.http.get(
|
|
@@ -5389,7 +5659,7 @@ var DeploymentDomains = class {
|
|
|
5389
5659
|
const data = await this.http.post(
|
|
5390
5660
|
`/deployments/${this.deploymentId}/domains/${domainId}/verify`
|
|
5391
5661
|
);
|
|
5392
|
-
return
|
|
5662
|
+
return unwrap32(data);
|
|
5393
5663
|
}
|
|
5394
5664
|
async delete(domainId) {
|
|
5395
5665
|
await this.http.delete(
|
|
@@ -5419,7 +5689,7 @@ var Deployments = class {
|
|
|
5419
5689
|
}
|
|
5420
5690
|
async get(deploymentId) {
|
|
5421
5691
|
const data = await this.http.get(`/deployments/${deploymentId}`);
|
|
5422
|
-
return
|
|
5692
|
+
return unwrap32(data);
|
|
5423
5693
|
}
|
|
5424
5694
|
async create(params) {
|
|
5425
5695
|
const body5 = stripUndefined16({
|
|
@@ -5438,7 +5708,7 @@ var Deployments = class {
|
|
|
5438
5708
|
body: body5,
|
|
5439
5709
|
headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
|
|
5440
5710
|
});
|
|
5441
|
-
return
|
|
5711
|
+
return unwrap32(data);
|
|
5442
5712
|
}
|
|
5443
5713
|
/**
|
|
5444
5714
|
* Create a deployment that runs on the workspace's dedicated App Engine
|
|
@@ -5482,7 +5752,7 @@ var Deployments = class {
|
|
|
5482
5752
|
const rawHost = await this.http.get(
|
|
5483
5753
|
`/docker-deploy/hosts/${hostId}`
|
|
5484
5754
|
);
|
|
5485
|
-
host =
|
|
5755
|
+
host = unwrap32(
|
|
5486
5756
|
rawHost
|
|
5487
5757
|
);
|
|
5488
5758
|
addDoctorCheck(
|
|
@@ -5633,7 +5903,7 @@ var Deployments = class {
|
|
|
5633
5903
|
const rawHost = await this.http.get(
|
|
5634
5904
|
`/docker-deploy/hosts/${hostId}`
|
|
5635
5905
|
);
|
|
5636
|
-
const host =
|
|
5906
|
+
const host = unwrap32(
|
|
5637
5907
|
rawHost
|
|
5638
5908
|
);
|
|
5639
5909
|
addProofCheck(
|
|
@@ -5740,7 +6010,7 @@ var Deployments = class {
|
|
|
5740
6010
|
`/deployments/${deploymentId}`,
|
|
5741
6011
|
body5
|
|
5742
6012
|
);
|
|
5743
|
-
return
|
|
6013
|
+
return unwrap32(data);
|
|
5744
6014
|
}
|
|
5745
6015
|
async delete(deploymentId) {
|
|
5746
6016
|
await this.http.delete(`/deployments/${deploymentId}`);
|
|
@@ -5760,7 +6030,7 @@ var Deployments = class {
|
|
|
5760
6030
|
headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
|
|
5761
6031
|
}
|
|
5762
6032
|
);
|
|
5763
|
-
return
|
|
6033
|
+
return unwrap32(data);
|
|
5764
6034
|
}
|
|
5765
6035
|
/**
|
|
5766
6036
|
* Backward-compatible bridge: POST /sandboxes/:id/deploy. Works today;
|
|
@@ -5785,7 +6055,7 @@ var Deployments = class {
|
|
|
5785
6055
|
headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
|
|
5786
6056
|
}
|
|
5787
6057
|
);
|
|
5788
|
-
return
|
|
6058
|
+
return unwrap32(data);
|
|
5789
6059
|
}
|
|
5790
6060
|
async rollback(deploymentId, params = {}) {
|
|
5791
6061
|
const body5 = stripUndefined16({
|
|
@@ -5799,7 +6069,7 @@ var Deployments = class {
|
|
|
5799
6069
|
headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
|
|
5800
6070
|
}
|
|
5801
6071
|
);
|
|
5802
|
-
return
|
|
6072
|
+
return unwrap32(data);
|
|
5803
6073
|
}
|
|
5804
6074
|
async listBuilds(deploymentId) {
|
|
5805
6075
|
const data = await this.http.get(
|
|
@@ -5811,7 +6081,7 @@ var Deployments = class {
|
|
|
5811
6081
|
const data = await this.http.get(
|
|
5812
6082
|
`/deployments/${deploymentId}/builds/${buildId}`
|
|
5813
6083
|
);
|
|
5814
|
-
return
|
|
6084
|
+
return unwrap32(data);
|
|
5815
6085
|
}
|
|
5816
6086
|
async listEnv(deploymentId) {
|
|
5817
6087
|
const data = await this.http.get(
|
|
@@ -5857,7 +6127,7 @@ var RUNTIME_BINARIES = {
|
|
|
5857
6127
|
pi: ["pi"],
|
|
5858
6128
|
custom: []
|
|
5859
6129
|
};
|
|
5860
|
-
function
|
|
6130
|
+
function unwrap33(payload, keys = ["data"]) {
|
|
5861
6131
|
if (payload && typeof payload === "object") {
|
|
5862
6132
|
const p = payload;
|
|
5863
6133
|
for (const key of keys) {
|
|
@@ -5916,7 +6186,7 @@ var Devices = class {
|
|
|
5916
6186
|
/** Show one unified device by id. */
|
|
5917
6187
|
async get(id) {
|
|
5918
6188
|
const data = await this.http.get(`/devices/${devicePath(id)}`);
|
|
5919
|
-
return
|
|
6189
|
+
return unwrap33(data);
|
|
5920
6190
|
}
|
|
5921
6191
|
show(id) {
|
|
5922
6192
|
return this.get(id);
|
|
@@ -5926,7 +6196,7 @@ var Devices = class {
|
|
|
5926
6196
|
const data = await this.http.get(
|
|
5927
6197
|
`/devices/${devicePath(id)}/capabilities`
|
|
5928
6198
|
);
|
|
5929
|
-
return
|
|
6199
|
+
return unwrap33(data);
|
|
5930
6200
|
}
|
|
5931
6201
|
/** Execute a command inside the device. */
|
|
5932
6202
|
async exec(id, params) {
|
|
@@ -5939,7 +6209,7 @@ var Devices = class {
|
|
|
5939
6209
|
env: params.env
|
|
5940
6210
|
})
|
|
5941
6211
|
);
|
|
5942
|
-
return
|
|
6212
|
+
return unwrap33(data);
|
|
5943
6213
|
}
|
|
5944
6214
|
/** List files inside the device filesystem. */
|
|
5945
6215
|
async listFiles(id, params = {}) {
|
|
@@ -5955,7 +6225,7 @@ var Devices = class {
|
|
|
5955
6225
|
`/devices/${devicePath(id)}/files/read`,
|
|
5956
6226
|
queryFromFileParams(params)
|
|
5957
6227
|
);
|
|
5958
|
-
return
|
|
6228
|
+
return unwrap33(data);
|
|
5959
6229
|
}
|
|
5960
6230
|
/** Write a text or base64 payload into the device filesystem. */
|
|
5961
6231
|
async writeFile(id, params) {
|
|
@@ -5967,7 +6237,7 @@ var Devices = class {
|
|
|
5967
6237
|
content_base64: pickFirst5(params.contentBase64, params.content_base64)
|
|
5968
6238
|
})
|
|
5969
6239
|
);
|
|
5970
|
-
return
|
|
6240
|
+
return unwrap33(data);
|
|
5971
6241
|
}
|
|
5972
6242
|
/** Expose a device port through MIOSA routing. */
|
|
5973
6243
|
async expose(id, params) {
|
|
@@ -5975,44 +6245,44 @@ var Devices = class {
|
|
|
5975
6245
|
`/devices/${devicePath(id)}/expose`,
|
|
5976
6246
|
{ port: params.port }
|
|
5977
6247
|
);
|
|
5978
|
-
return
|
|
6248
|
+
return unwrap33(data);
|
|
5979
6249
|
}
|
|
5980
6250
|
/** Return browser/desktop connection details for a computer-backed device. */
|
|
5981
6251
|
async browser(id) {
|
|
5982
6252
|
const data = await this.http.get(`/devices/${devicePath(id)}/browser`);
|
|
5983
|
-
return
|
|
6253
|
+
return unwrap33(data);
|
|
5984
6254
|
}
|
|
5985
6255
|
async pause(id) {
|
|
5986
6256
|
const data = await this.http.post(
|
|
5987
6257
|
`/devices/${devicePath(id)}/pause`,
|
|
5988
6258
|
{}
|
|
5989
6259
|
);
|
|
5990
|
-
return
|
|
6260
|
+
return unwrap33(data);
|
|
5991
6261
|
}
|
|
5992
6262
|
async stop(id) {
|
|
5993
6263
|
const data = await this.http.post(
|
|
5994
6264
|
`/devices/${devicePath(id)}/stop`,
|
|
5995
6265
|
{}
|
|
5996
6266
|
);
|
|
5997
|
-
return
|
|
6267
|
+
return unwrap33(data);
|
|
5998
6268
|
}
|
|
5999
6269
|
async resume(id) {
|
|
6000
6270
|
const data = await this.http.post(
|
|
6001
6271
|
`/devices/${devicePath(id)}/resume`,
|
|
6002
6272
|
{}
|
|
6003
6273
|
);
|
|
6004
|
-
return
|
|
6274
|
+
return unwrap33(data);
|
|
6005
6275
|
}
|
|
6006
6276
|
async extend(id, params) {
|
|
6007
6277
|
const data = await this.http.post(
|
|
6008
6278
|
`/devices/${devicePath(id)}/extend`,
|
|
6009
6279
|
{ timeout_sec: pickFirst5(params.timeoutSec, params.timeout_sec) }
|
|
6010
6280
|
);
|
|
6011
|
-
return
|
|
6281
|
+
return unwrap33(data);
|
|
6012
6282
|
}
|
|
6013
6283
|
async destroy(id) {
|
|
6014
6284
|
const data = await this.http.delete(`/devices/${devicePath(id)}`);
|
|
6015
|
-
return
|
|
6285
|
+
return unwrap33(data);
|
|
6016
6286
|
}
|
|
6017
6287
|
/**
|
|
6018
6288
|
* Write a MIOSA runtime bootstrap manifest and optionally install/probe
|
|
@@ -6182,7 +6452,7 @@ var DockerDeploy = class {
|
|
|
6182
6452
|
};
|
|
6183
6453
|
|
|
6184
6454
|
// src/resources/email.ts
|
|
6185
|
-
function
|
|
6455
|
+
function unwrap34(data) {
|
|
6186
6456
|
if (data && typeof data === "object") {
|
|
6187
6457
|
const d = data;
|
|
6188
6458
|
for (const k of [
|
|
@@ -6234,12 +6504,12 @@ var EmailCampaigns = class {
|
|
|
6234
6504
|
);
|
|
6235
6505
|
}
|
|
6236
6506
|
async create(attrs) {
|
|
6237
|
-
return
|
|
6507
|
+
return unwrap34(
|
|
6238
6508
|
await this.http.post("/admin/email-campaigns", strip(attrs))
|
|
6239
6509
|
);
|
|
6240
6510
|
}
|
|
6241
6511
|
async recipientCount(filters = {}) {
|
|
6242
|
-
return
|
|
6512
|
+
return unwrap34(
|
|
6243
6513
|
await this.http.get(
|
|
6244
6514
|
"/admin/email-campaigns/recipient-count",
|
|
6245
6515
|
filters
|
|
@@ -6247,7 +6517,7 @@ var EmailCampaigns = class {
|
|
|
6247
6517
|
);
|
|
6248
6518
|
}
|
|
6249
6519
|
async send(campaignId, opts = {}) {
|
|
6250
|
-
return
|
|
6520
|
+
return unwrap34(
|
|
6251
6521
|
await this.http.post(
|
|
6252
6522
|
`/admin/email-campaigns/${campaignId}/send`,
|
|
6253
6523
|
strip(opts)
|
|
@@ -6255,7 +6525,7 @@ var EmailCampaigns = class {
|
|
|
6255
6525
|
);
|
|
6256
6526
|
}
|
|
6257
6527
|
async cancel(campaignId) {
|
|
6258
|
-
return
|
|
6528
|
+
return unwrap34(
|
|
6259
6529
|
await this.http.post(
|
|
6260
6530
|
`/admin/email-campaigns/${campaignId}/cancel`
|
|
6261
6531
|
)
|
|
@@ -6281,7 +6551,7 @@ var EmailTemplates = class {
|
|
|
6281
6551
|
);
|
|
6282
6552
|
}
|
|
6283
6553
|
async create(key, attrs = {}) {
|
|
6284
|
-
return
|
|
6554
|
+
return unwrap34(
|
|
6285
6555
|
await this.http.post("/admin/email-templates", {
|
|
6286
6556
|
key,
|
|
6287
6557
|
...strip(attrs)
|
|
@@ -6289,7 +6559,7 @@ var EmailTemplates = class {
|
|
|
6289
6559
|
);
|
|
6290
6560
|
}
|
|
6291
6561
|
async update(key, attrs) {
|
|
6292
|
-
return
|
|
6562
|
+
return unwrap34(
|
|
6293
6563
|
await this.http.put(
|
|
6294
6564
|
`/admin/email-templates/${key}`,
|
|
6295
6565
|
strip(attrs)
|
|
@@ -6297,7 +6567,7 @@ var EmailTemplates = class {
|
|
|
6297
6567
|
);
|
|
6298
6568
|
}
|
|
6299
6569
|
async reset(key) {
|
|
6300
|
-
return
|
|
6570
|
+
return unwrap34(
|
|
6301
6571
|
await this.http.post(`/admin/email-templates/${key}/reset`)
|
|
6302
6572
|
);
|
|
6303
6573
|
}
|
|
@@ -6313,17 +6583,17 @@ var EmailInbox = class {
|
|
|
6313
6583
|
);
|
|
6314
6584
|
}
|
|
6315
6585
|
async send(attrs) {
|
|
6316
|
-
return
|
|
6586
|
+
return unwrap34(
|
|
6317
6587
|
await this.http.post("/admin/email-inbox/send", strip(attrs))
|
|
6318
6588
|
);
|
|
6319
6589
|
}
|
|
6320
6590
|
async markRead(messageId) {
|
|
6321
|
-
return
|
|
6591
|
+
return unwrap34(
|
|
6322
6592
|
await this.http.post(`/admin/email-inbox/${messageId}/read`)
|
|
6323
6593
|
);
|
|
6324
6594
|
}
|
|
6325
6595
|
async archive(messageId) {
|
|
6326
|
-
return
|
|
6596
|
+
return unwrap34(
|
|
6327
6597
|
await this.http.post(`/admin/email-inbox/${messageId}/archive`)
|
|
6328
6598
|
);
|
|
6329
6599
|
}
|
|
@@ -6363,7 +6633,7 @@ var Embeddings = class {
|
|
|
6363
6633
|
};
|
|
6364
6634
|
|
|
6365
6635
|
// src/resources/external-keys.ts
|
|
6366
|
-
function
|
|
6636
|
+
function unwrap35(payload) {
|
|
6367
6637
|
if (payload && typeof payload === "object") {
|
|
6368
6638
|
const p = payload;
|
|
6369
6639
|
for (const k of ["data", "external_keys", "items"]) {
|
|
@@ -6385,7 +6655,7 @@ var ExternalKeys = class {
|
|
|
6385
6655
|
/** List configured external keys. */
|
|
6386
6656
|
async list() {
|
|
6387
6657
|
const data = await this.http.get("/external-keys");
|
|
6388
|
-
const result =
|
|
6658
|
+
const result = unwrap35(data);
|
|
6389
6659
|
if (Array.isArray(result)) return result;
|
|
6390
6660
|
return [];
|
|
6391
6661
|
}
|
|
@@ -6393,14 +6663,14 @@ var ExternalKeys = class {
|
|
|
6393
6663
|
async create(params) {
|
|
6394
6664
|
const body5 = stripUndefined18(params);
|
|
6395
6665
|
const data = await this.http.post("/external-keys", body5);
|
|
6396
|
-
return
|
|
6666
|
+
return unwrap35(data);
|
|
6397
6667
|
}
|
|
6398
6668
|
/** Resolve (preview) the stored key for a provider. */
|
|
6399
6669
|
async resolve(provider) {
|
|
6400
6670
|
const data = await this.http.get(
|
|
6401
6671
|
`/external-keys/${provider}/resolve`
|
|
6402
6672
|
);
|
|
6403
|
-
return
|
|
6673
|
+
return unwrap35(data);
|
|
6404
6674
|
}
|
|
6405
6675
|
/**
|
|
6406
6676
|
* Delete the stored key for a provider.
|
|
@@ -6410,7 +6680,7 @@ var ExternalKeys = class {
|
|
|
6410
6680
|
await this.http.delete(`/external-keys/${provider}`);
|
|
6411
6681
|
}
|
|
6412
6682
|
};
|
|
6413
|
-
function
|
|
6683
|
+
function unwrap36(payload) {
|
|
6414
6684
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
6415
6685
|
return payload.data;
|
|
6416
6686
|
}
|
|
@@ -6463,97 +6733,476 @@ var FlatCustomDomains = class {
|
|
|
6463
6733
|
body: body5,
|
|
6464
6734
|
headers: { "Idempotency-Key": idempotencyKey5(ikey) }
|
|
6465
6735
|
});
|
|
6466
|
-
return
|
|
6736
|
+
return unwrap36(data);
|
|
6737
|
+
}
|
|
6738
|
+
async delete(domainId) {
|
|
6739
|
+
await this.http.delete(`/custom-domains/${domainId}`);
|
|
6740
|
+
}
|
|
6741
|
+
};
|
|
6742
|
+
function unwrap37(payload) {
|
|
6743
|
+
if (payload && typeof payload === "object" && "data" in payload) {
|
|
6744
|
+
return payload.data;
|
|
6745
|
+
}
|
|
6746
|
+
return payload;
|
|
6747
|
+
}
|
|
6748
|
+
function listItems6(payload, candidateKeys = ["data", "functions", "items"]) {
|
|
6749
|
+
if (Array.isArray(payload)) return payload;
|
|
6750
|
+
if (!payload || typeof payload !== "object") return [];
|
|
6751
|
+
const p = payload;
|
|
6752
|
+
if (Array.isArray(p.data)) return p.data;
|
|
6753
|
+
for (const key of candidateKeys) {
|
|
6754
|
+
if (Array.isArray(p[key])) return p[key];
|
|
6755
|
+
}
|
|
6756
|
+
return [];
|
|
6757
|
+
}
|
|
6758
|
+
function stripUndefined20(input) {
|
|
6759
|
+
return Object.fromEntries(
|
|
6760
|
+
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
6761
|
+
);
|
|
6762
|
+
}
|
|
6763
|
+
function idempotencyKey6(key) {
|
|
6764
|
+
return key ?? randomUUID();
|
|
6765
|
+
}
|
|
6766
|
+
var Functions = class {
|
|
6767
|
+
constructor(http) {
|
|
6768
|
+
this.http = http;
|
|
6769
|
+
}
|
|
6770
|
+
http;
|
|
6771
|
+
async list(params = {}) {
|
|
6772
|
+
const query3 = stripUndefined20({ ...params });
|
|
6773
|
+
const data = await this.http.get("/functions", query3);
|
|
6774
|
+
return listItems6(data);
|
|
6775
|
+
}
|
|
6776
|
+
async get(functionId) {
|
|
6777
|
+
const data = await this.http.get(`/functions/${functionId}`);
|
|
6778
|
+
return unwrap37(data);
|
|
6779
|
+
}
|
|
6780
|
+
async create(params) {
|
|
6781
|
+
const { idempotencyKey: ikey, memoryMb, timeoutSec, ...rest } = params;
|
|
6782
|
+
const body5 = stripUndefined20({
|
|
6783
|
+
...rest,
|
|
6784
|
+
memory_mb: memoryMb ?? rest.memory_mb,
|
|
6785
|
+
timeout_sec: timeoutSec ?? rest.timeout_sec
|
|
6786
|
+
});
|
|
6787
|
+
const data = await this.http.request("/functions", {
|
|
6788
|
+
method: "POST",
|
|
6789
|
+
body: body5,
|
|
6790
|
+
headers: { "Idempotency-Key": idempotencyKey6(ikey) }
|
|
6791
|
+
});
|
|
6792
|
+
return unwrap37(data);
|
|
6793
|
+
}
|
|
6794
|
+
async update(functionId, params) {
|
|
6795
|
+
const { memoryMb, timeoutSec, ...rest } = params;
|
|
6796
|
+
const body5 = stripUndefined20({
|
|
6797
|
+
...rest,
|
|
6798
|
+
memory_mb: memoryMb ?? rest.memory_mb,
|
|
6799
|
+
timeout_sec: timeoutSec ?? rest.timeout_sec
|
|
6800
|
+
});
|
|
6801
|
+
const data = await this.http.patch(
|
|
6802
|
+
`/functions/${functionId}`,
|
|
6803
|
+
body5
|
|
6804
|
+
);
|
|
6805
|
+
return unwrap37(data);
|
|
6806
|
+
}
|
|
6807
|
+
async delete(functionId) {
|
|
6808
|
+
await this.http.delete(`/functions/${functionId}`);
|
|
6809
|
+
}
|
|
6810
|
+
async invoke(functionId, params = {}) {
|
|
6811
|
+
const { payload = {}, headers, idempotencyKey: ikey } = params;
|
|
6812
|
+
const data = await this.http.request(
|
|
6813
|
+
`/functions/${functionId}/invoke`,
|
|
6814
|
+
{
|
|
6815
|
+
method: "POST",
|
|
6816
|
+
body: payload,
|
|
6817
|
+
headers: {
|
|
6818
|
+
"Idempotency-Key": idempotencyKey6(ikey),
|
|
6819
|
+
...headers
|
|
6820
|
+
}
|
|
6821
|
+
}
|
|
6822
|
+
);
|
|
6823
|
+
return data ?? {};
|
|
6824
|
+
}
|
|
6825
|
+
};
|
|
6826
|
+
|
|
6827
|
+
// src/resources/forge.ts
|
|
6828
|
+
var REPOSITORY_VISIBILITIES = /* @__PURE__ */ new Set([
|
|
6829
|
+
"public",
|
|
6830
|
+
"private",
|
|
6831
|
+
"internal"
|
|
6832
|
+
]);
|
|
6833
|
+
var REPOSITORY_STATES = /* @__PURE__ */ new Set([
|
|
6834
|
+
"provisioning",
|
|
6835
|
+
"active",
|
|
6836
|
+
"error",
|
|
6837
|
+
"deletion_pending",
|
|
6838
|
+
"deleted"
|
|
6839
|
+
]);
|
|
6840
|
+
var ForgeContractError = class extends MiosaError {
|
|
6841
|
+
constructor(message, details) {
|
|
6842
|
+
super(message, 502, "FORGE_CONTRACT_ERROR", details);
|
|
6843
|
+
this.name = "ForgeContractError";
|
|
6844
|
+
}
|
|
6845
|
+
};
|
|
6846
|
+
var ForgeUnavailableError = class extends MiosaError {
|
|
6847
|
+
constructor(message, cause) {
|
|
6848
|
+
super(message, cause.status, "FORGE_DISABLED", cause.details, cause.requestId);
|
|
6849
|
+
this.name = "ForgeUnavailableError";
|
|
6850
|
+
}
|
|
6851
|
+
};
|
|
6852
|
+
var ForgeStorageError = class extends MiosaError {
|
|
6853
|
+
constructor(message, cause) {
|
|
6854
|
+
super(message, cause.status, cause.code, cause.details, cause.requestId);
|
|
6855
|
+
this.name = "ForgeStorageError";
|
|
6856
|
+
}
|
|
6857
|
+
};
|
|
6858
|
+
var ForgePolicyViolationError = class extends MiosaError {
|
|
6859
|
+
constructor(message, cause) {
|
|
6860
|
+
super(message, cause.status, cause.code, cause.details, cause.requestId);
|
|
6861
|
+
this.name = "ForgePolicyViolationError";
|
|
6862
|
+
}
|
|
6863
|
+
};
|
|
6864
|
+
function translateError(error) {
|
|
6865
|
+
if (!(error instanceof MiosaError)) throw error;
|
|
6866
|
+
if (error.code === "FORGE_DISABLED") {
|
|
6867
|
+
throw new ForgeUnavailableError("Forge is not enabled for this organization", error);
|
|
6868
|
+
}
|
|
6869
|
+
if (error.code === "FORGE_STORAGE_UNAVAILABLE" || error.code === "FORGE_OPERATION_FAILED") {
|
|
6870
|
+
throw new ForgeStorageError("Forge repository storage is unavailable", error);
|
|
6871
|
+
}
|
|
6872
|
+
if (error.code === "INVALID_PROJECT_ATTACHMENT") {
|
|
6873
|
+
throw new ForgePolicyViolationError("Forge repository policy rejected the operation", error);
|
|
6874
|
+
}
|
|
6875
|
+
throw error;
|
|
6876
|
+
}
|
|
6877
|
+
function repositoryPath(id) {
|
|
6878
|
+
return `/forge/repositories/${encodeURIComponent(id)}`;
|
|
6879
|
+
}
|
|
6880
|
+
function compact(value) {
|
|
6881
|
+
return Object.fromEntries(
|
|
6882
|
+
Object.entries(value).filter(([, item]) => item !== void 0)
|
|
6883
|
+
);
|
|
6884
|
+
}
|
|
6885
|
+
function object(payload, label) {
|
|
6886
|
+
if (!payload || typeof payload !== "object" || Array.isArray(payload)) {
|
|
6887
|
+
throw new ForgeContractError(`Forge returned invalid ${label}`, { payload });
|
|
6888
|
+
}
|
|
6889
|
+
return payload;
|
|
6890
|
+
}
|
|
6891
|
+
function string(value, field, payload) {
|
|
6892
|
+
if (typeof value !== "string") {
|
|
6893
|
+
throw new ForgeContractError(`Forge content is missing ${field}`, { field, payload });
|
|
6894
|
+
}
|
|
6895
|
+
return value;
|
|
6896
|
+
}
|
|
6897
|
+
function nullableString(value, field, payload) {
|
|
6898
|
+
if (value !== null && typeof value !== "string") {
|
|
6899
|
+
throw new ForgeContractError(`Forge content has invalid ${field}`, { field, payload });
|
|
6900
|
+
}
|
|
6901
|
+
return value;
|
|
6902
|
+
}
|
|
6903
|
+
function queryPath(path, params) {
|
|
6904
|
+
const query3 = new URLSearchParams();
|
|
6905
|
+
for (const [key, value] of Object.entries(params)) {
|
|
6906
|
+
if (value !== void 0) query3.set(key, String(value));
|
|
6907
|
+
}
|
|
6908
|
+
const encoded = query3.toString();
|
|
6909
|
+
return encoded ? `${path}?${encoded}` : path;
|
|
6910
|
+
}
|
|
6911
|
+
function parseNamedRef(payload) {
|
|
6912
|
+
const value = object(payload, "repository ref");
|
|
6913
|
+
return { name: string(value.name, "name", payload), oid: string(value.oid, "oid", payload) };
|
|
6914
|
+
}
|
|
6915
|
+
function parseRefs(payload) {
|
|
6916
|
+
const value = object(payload, "repository refs");
|
|
6917
|
+
if (!Array.isArray(value.branches) || !Array.isArray(value.tags)) {
|
|
6918
|
+
throw new ForgeContractError("Forge repository refs have invalid collections", { payload });
|
|
6919
|
+
}
|
|
6920
|
+
const branches = value.branches.map((item) => {
|
|
6921
|
+
const branch = object(item, "branch");
|
|
6922
|
+
if (typeof branch.is_default !== "boolean") {
|
|
6923
|
+
throw new ForgeContractError("Forge branch is missing is_default", { payload: item });
|
|
6924
|
+
}
|
|
6925
|
+
return { ...parseNamedRef(item), is_default: branch.is_default };
|
|
6926
|
+
});
|
|
6927
|
+
return {
|
|
6928
|
+
default_branch: string(value.default_branch, "default_branch", payload),
|
|
6929
|
+
head_oid: nullableString(value.head_oid, "head_oid", payload),
|
|
6930
|
+
branches,
|
|
6931
|
+
tags: value.tags.map(parseNamedRef)
|
|
6932
|
+
};
|
|
6933
|
+
}
|
|
6934
|
+
function parseTree(payload) {
|
|
6935
|
+
const value = object(payload, "repository tree");
|
|
6936
|
+
if (!Array.isArray(value.entries) || typeof value.truncated !== "boolean") {
|
|
6937
|
+
throw new ForgeContractError("Forge repository tree has invalid entries", { payload });
|
|
6938
|
+
}
|
|
6939
|
+
const entries = value.entries.map((item) => {
|
|
6940
|
+
const entry = object(item, "tree entry");
|
|
6941
|
+
if (entry.type !== "blob" && entry.type !== "tree") {
|
|
6942
|
+
throw new ForgeContractError("Forge tree entry has invalid type", { payload: item });
|
|
6943
|
+
}
|
|
6944
|
+
if (entry.size !== null && (typeof entry.size !== "number" || !Number.isSafeInteger(entry.size) || entry.size < 0)) {
|
|
6945
|
+
throw new ForgeContractError("Forge tree entry has invalid size", { payload: item });
|
|
6946
|
+
}
|
|
6947
|
+
return {
|
|
6948
|
+
name: string(entry.name, "name", item),
|
|
6949
|
+
path: string(entry.path, "path", item),
|
|
6950
|
+
type: entry.type,
|
|
6951
|
+
oid: string(entry.oid, "oid", item),
|
|
6952
|
+
size: entry.size
|
|
6953
|
+
};
|
|
6954
|
+
});
|
|
6955
|
+
return {
|
|
6956
|
+
ref: string(value.ref, "ref", payload),
|
|
6957
|
+
commit_oid: string(value.commit_oid, "commit_oid", payload),
|
|
6958
|
+
path: string(value.path, "path", payload),
|
|
6959
|
+
entries,
|
|
6960
|
+
truncated: value.truncated
|
|
6961
|
+
};
|
|
6962
|
+
}
|
|
6963
|
+
function parseBlob(payload) {
|
|
6964
|
+
const value = object(payload, "repository blob");
|
|
6965
|
+
if (value.encoding !== "utf-8" && value.encoding !== "base64") {
|
|
6966
|
+
throw new ForgeContractError("Forge blob has invalid encoding", { payload });
|
|
6967
|
+
}
|
|
6968
|
+
if (typeof value.size !== "number" || !Number.isSafeInteger(value.size) || value.size < 0) {
|
|
6969
|
+
throw new ForgeContractError("Forge blob has invalid size", { payload });
|
|
6970
|
+
}
|
|
6971
|
+
return {
|
|
6972
|
+
ref: string(value.ref, "ref", payload),
|
|
6973
|
+
commit_oid: string(value.commit_oid, "commit_oid", payload),
|
|
6974
|
+
path: string(value.path, "path", payload),
|
|
6975
|
+
oid: string(value.oid, "oid", payload),
|
|
6976
|
+
size: value.size,
|
|
6977
|
+
encoding: value.encoding,
|
|
6978
|
+
content: string(value.content, "content", payload)
|
|
6979
|
+
};
|
|
6980
|
+
}
|
|
6981
|
+
function parseHistory(payload) {
|
|
6982
|
+
const value = object(payload, "commit history");
|
|
6983
|
+
const page = object(value.page, "commit page");
|
|
6984
|
+
if (!Array.isArray(value.commits) || typeof page.has_more !== "boolean") {
|
|
6985
|
+
throw new ForgeContractError("Forge commit history has invalid pagination", { payload });
|
|
6986
|
+
}
|
|
6987
|
+
const commits = value.commits.map((item) => {
|
|
6988
|
+
const commit = object(item, "commit");
|
|
6989
|
+
if (!Array.isArray(commit.parents) || !commit.parents.every((parent) => typeof parent === "string")) {
|
|
6990
|
+
throw new ForgeContractError("Forge commit has invalid parents", { payload: item });
|
|
6991
|
+
}
|
|
6992
|
+
return {
|
|
6993
|
+
oid: string(commit.oid, "oid", item),
|
|
6994
|
+
short_oid: string(commit.short_oid, "short_oid", item),
|
|
6995
|
+
subject: string(commit.subject, "subject", item),
|
|
6996
|
+
author_name: string(commit.author_name, "author_name", item),
|
|
6997
|
+
author_email: string(commit.author_email, "author_email", item),
|
|
6998
|
+
authored_at: string(commit.authored_at, "authored_at", item),
|
|
6999
|
+
committer_name: string(commit.committer_name, "committer_name", item),
|
|
7000
|
+
committed_at: string(commit.committed_at, "committed_at", item),
|
|
7001
|
+
parents: commit.parents
|
|
7002
|
+
};
|
|
7003
|
+
});
|
|
7004
|
+
return {
|
|
7005
|
+
ref: string(value.ref, "ref", payload),
|
|
7006
|
+
path: string(value.path, "path", payload),
|
|
7007
|
+
commits,
|
|
7008
|
+
page: { has_more: page.has_more, next_cursor: nullableString(page.next_cursor, "next_cursor", page) }
|
|
7009
|
+
};
|
|
7010
|
+
}
|
|
7011
|
+
function parseFileReceipt(payload, replayed) {
|
|
7012
|
+
const value = object(payload, "file operation receipt");
|
|
7013
|
+
const commit = object(value.commit, "file operation commit");
|
|
7014
|
+
const policy = object(value.policy, "file operation policy");
|
|
7015
|
+
const stringFields = ["operation_id", "repository_id", "branch", "path", "previous_head", "new_head"];
|
|
7016
|
+
if (stringFields.some((field) => typeof value[field] !== "string") || !["create", "update", "delete"].includes(String(value.action)) || policy.decision !== "allowed" || !Array.isArray(policy.receipt_ids) || !policy.receipt_ids.every((id) => typeof id === "string") || typeof commit.oid !== "string" || typeof commit.committed_at !== "string") {
|
|
7017
|
+
throw new ForgeContractError("Forge returned invalid file operation receipt", { payload });
|
|
7018
|
+
}
|
|
7019
|
+
return { ...value, replayed };
|
|
7020
|
+
}
|
|
7021
|
+
function parseRepository(payload) {
|
|
7022
|
+
if (!payload || typeof payload !== "object" || Array.isArray(payload)) {
|
|
7023
|
+
throw new ForgeContractError("Forge returned an invalid repository", {
|
|
7024
|
+
payload
|
|
7025
|
+
});
|
|
6467
7026
|
}
|
|
6468
|
-
|
|
6469
|
-
|
|
7027
|
+
const value = payload;
|
|
7028
|
+
const requiredStrings = [
|
|
7029
|
+
"id",
|
|
7030
|
+
"name",
|
|
7031
|
+
"slug",
|
|
7032
|
+
"default_branch",
|
|
7033
|
+
"visibility",
|
|
7034
|
+
"state",
|
|
7035
|
+
"created_at",
|
|
7036
|
+
"updated_at"
|
|
7037
|
+
];
|
|
7038
|
+
for (const field of requiredStrings) {
|
|
7039
|
+
if (typeof value[field] !== "string" || value[field].length === 0) {
|
|
7040
|
+
throw new ForgeContractError(`Forge repository is missing ${field}`, {
|
|
7041
|
+
field,
|
|
7042
|
+
payload
|
|
7043
|
+
});
|
|
7044
|
+
}
|
|
6470
7045
|
}
|
|
6471
|
-
|
|
6472
|
-
|
|
6473
|
-
|
|
6474
|
-
|
|
7046
|
+
if (!REPOSITORY_VISIBILITIES.has(value.visibility)) {
|
|
7047
|
+
throw new ForgeContractError("Forge repository has an invalid visibility", {
|
|
7048
|
+
payload
|
|
7049
|
+
});
|
|
6475
7050
|
}
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
|
|
6479
|
-
|
|
6480
|
-
if (!payload || typeof payload !== "object") return [];
|
|
6481
|
-
const p = payload;
|
|
6482
|
-
if (Array.isArray(p.data)) return p.data;
|
|
6483
|
-
for (const key of candidateKeys) {
|
|
6484
|
-
if (Array.isArray(p[key])) return p[key];
|
|
7051
|
+
if (!REPOSITORY_STATES.has(value.state)) {
|
|
7052
|
+
throw new ForgeContractError("Forge repository has an invalid state", {
|
|
7053
|
+
payload
|
|
7054
|
+
});
|
|
6485
7055
|
}
|
|
6486
|
-
|
|
6487
|
-
}
|
|
6488
|
-
|
|
6489
|
-
|
|
6490
|
-
|
|
6491
|
-
|
|
7056
|
+
if (typeof value.clone_ready !== "boolean" || value.clone_url !== null && typeof value.clone_url !== "string" || !Array.isArray(value.project_ids) || !value.project_ids.every((id) => typeof id === "string"))
|
|
7057
|
+
throw new ForgeContractError("Forge repository has invalid clone or project metadata", { payload });
|
|
7058
|
+
if (value.clone_ready !== (value.state === "active") || value.clone_ready && !value.clone_url || !value.clone_ready && value.clone_url !== null)
|
|
7059
|
+
throw new ForgeContractError("Forge repository clone readiness is inconsistent", { payload });
|
|
7060
|
+
return {
|
|
7061
|
+
id: value.id,
|
|
7062
|
+
name: value.name,
|
|
7063
|
+
slug: value.slug,
|
|
7064
|
+
default_branch: value.default_branch,
|
|
7065
|
+
visibility: value.visibility,
|
|
7066
|
+
state: value.state,
|
|
7067
|
+
clone_ready: value.clone_ready,
|
|
7068
|
+
clone_url: value.clone_url,
|
|
7069
|
+
project_ids: value.project_ids,
|
|
7070
|
+
created_at: value.created_at,
|
|
7071
|
+
updated_at: value.updated_at
|
|
7072
|
+
};
|
|
6492
7073
|
}
|
|
6493
|
-
function
|
|
6494
|
-
|
|
7074
|
+
function parseCapabilities(payload) {
|
|
7075
|
+
const value = object(payload, "capabilities");
|
|
7076
|
+
const valid = value.api_version === "v1" && value.ownership === "organization" && value.detail_locator === "repository_id" && typeof value.base_url === "string" && Array.isArray(value.lifecycle_states) && Array.isArray(value.visibility_values) && Array.isArray(value.clone_ready_states) && value.clone_ready_states.length === 1 && value.clone_ready_states[0] === "active" && value.features && typeof value.features === "object";
|
|
7077
|
+
if (!valid) throw new ForgeContractError("Forge returned invalid capabilities", { payload });
|
|
7078
|
+
return value;
|
|
6495
7079
|
}
|
|
6496
|
-
var
|
|
7080
|
+
var ForgeRepositories = class {
|
|
6497
7081
|
constructor(http) {
|
|
6498
7082
|
this.http = http;
|
|
6499
7083
|
}
|
|
6500
7084
|
http;
|
|
6501
|
-
async
|
|
6502
|
-
|
|
6503
|
-
|
|
6504
|
-
|
|
7085
|
+
async create(params) {
|
|
7086
|
+
try {
|
|
7087
|
+
const payload = await this.http.request("/forge/repositories", {
|
|
7088
|
+
method: "POST",
|
|
7089
|
+
headers: { "Idempotency-Key": params.idempotencyKey ?? crypto.randomUUID() },
|
|
7090
|
+
body: compact({
|
|
7091
|
+
name: params.name,
|
|
7092
|
+
slug: params.slug,
|
|
7093
|
+
default_branch: params.defaultBranch,
|
|
7094
|
+
visibility: params.visibility,
|
|
7095
|
+
project_ids: params.projectIds
|
|
7096
|
+
})
|
|
7097
|
+
});
|
|
7098
|
+
return parseRepository(unwrapData2(payload));
|
|
7099
|
+
} catch (error) {
|
|
7100
|
+
translateError(error);
|
|
7101
|
+
}
|
|
6505
7102
|
}
|
|
6506
|
-
async
|
|
6507
|
-
const
|
|
6508
|
-
|
|
7103
|
+
async list() {
|
|
7104
|
+
const payload = await this.http.get("/forge/repositories");
|
|
7105
|
+
if (!payload || typeof payload !== "object" || Array.isArray(payload) || !Array.isArray(payload.data)) {
|
|
7106
|
+
throw new ForgeContractError("Forge returned an invalid repository list", {
|
|
7107
|
+
payload
|
|
7108
|
+
});
|
|
7109
|
+
}
|
|
7110
|
+
return payload.data.map(
|
|
7111
|
+
parseRepository
|
|
7112
|
+
);
|
|
6509
7113
|
}
|
|
6510
|
-
async
|
|
6511
|
-
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
|
|
6515
|
-
|
|
6516
|
-
|
|
6517
|
-
const
|
|
6518
|
-
|
|
6519
|
-
|
|
6520
|
-
|
|
7114
|
+
async get(id) {
|
|
7115
|
+
return parseRepository(unwrapData2(await this.http.get(repositoryPath(id))));
|
|
7116
|
+
}
|
|
7117
|
+
async refs(id) {
|
|
7118
|
+
return parseRefs(unwrapData2(await this.http.get(`${repositoryPath(id)}/refs`)));
|
|
7119
|
+
}
|
|
7120
|
+
async tree(id, location = {}) {
|
|
7121
|
+
const path = queryPath(`${repositoryPath(id)}/tree`, { ref: location.ref, path: location.path });
|
|
7122
|
+
return parseTree(unwrapData2(await this.http.get(path)));
|
|
7123
|
+
}
|
|
7124
|
+
async blob(id, location) {
|
|
7125
|
+
const path = queryPath(`${repositoryPath(id)}/blob`, { ref: location.ref, path: location.path });
|
|
7126
|
+
return parseBlob(unwrapData2(await this.http.get(path)));
|
|
7127
|
+
}
|
|
7128
|
+
async readme(id, location = {}) {
|
|
7129
|
+
const path = queryPath(`${repositoryPath(id)}/readme`, { ref: location.ref, path: location.path });
|
|
7130
|
+
return parseBlob(unwrapData2(await this.http.get(path)));
|
|
7131
|
+
}
|
|
7132
|
+
async commits(id, query3 = {}) {
|
|
7133
|
+
const path = queryPath(`${repositoryPath(id)}/commits`, {
|
|
7134
|
+
ref: query3.ref,
|
|
7135
|
+
path: query3.path,
|
|
7136
|
+
limit: query3.limit,
|
|
7137
|
+
cursor: query3.cursor
|
|
6521
7138
|
});
|
|
6522
|
-
return
|
|
7139
|
+
return parseHistory(unwrapData2(await this.http.get(path)));
|
|
6523
7140
|
}
|
|
6524
|
-
async
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
-
|
|
7141
|
+
async putFile(id, path, params) {
|
|
7142
|
+
return this.authorFile(id, path, "PUT", params);
|
|
7143
|
+
}
|
|
7144
|
+
async deleteFile(id, path, params) {
|
|
7145
|
+
return this.authorFile(id, path, "DELETE", params);
|
|
7146
|
+
}
|
|
7147
|
+
async authorFile(id, path, method, params) {
|
|
7148
|
+
const response = await this.http.request(`${repositoryPath(id)}/files/${path.split("/").map(encodeURIComponent).join("/")}`, {
|
|
7149
|
+
method,
|
|
7150
|
+
rawResponse: true,
|
|
7151
|
+
headers: { "Idempotency-Key": params.idempotencyKey ?? crypto.randomUUID() },
|
|
7152
|
+
body: compact({ branch: params.branch, expected_head: params.expectedHead, message: params.message, content: params.content })
|
|
6530
7153
|
});
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
7154
|
+
let payload;
|
|
7155
|
+
try {
|
|
7156
|
+
payload = await response.json();
|
|
7157
|
+
} catch {
|
|
7158
|
+
throw new ForgeContractError("Forge returned invalid file operation JSON");
|
|
7159
|
+
}
|
|
7160
|
+
return parseFileReceipt(unwrapData2(payload), response.headers.get("idempotency-replayed") === "true");
|
|
6536
7161
|
}
|
|
6537
|
-
async
|
|
6538
|
-
|
|
7162
|
+
async update(id, params) {
|
|
7163
|
+
try {
|
|
7164
|
+
const payload = await this.http.request(repositoryPath(id), { method: "PATCH", body: compact({
|
|
7165
|
+
name: params.name,
|
|
7166
|
+
slug: params.slug,
|
|
7167
|
+
visibility: params.visibility,
|
|
7168
|
+
project_ids: params.projectIds
|
|
7169
|
+
}) });
|
|
7170
|
+
return parseRepository(unwrapData2(payload));
|
|
7171
|
+
} catch (error) {
|
|
7172
|
+
translateError(error);
|
|
7173
|
+
}
|
|
6539
7174
|
}
|
|
6540
|
-
async
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
6547
|
-
|
|
6548
|
-
|
|
6549
|
-
|
|
6550
|
-
|
|
6551
|
-
|
|
6552
|
-
);
|
|
6553
|
-
return data ?? {};
|
|
7175
|
+
async delete(id, _options = {}) {
|
|
7176
|
+
try {
|
|
7177
|
+
const response = await this.http.request(repositoryPath(id), {
|
|
7178
|
+
method: "DELETE",
|
|
7179
|
+
rawResponse: true
|
|
7180
|
+
});
|
|
7181
|
+
const operationId = response.headers.get("x-forge-operation-id");
|
|
7182
|
+
if (!operationId) throw new ForgeContractError("Forge delete omitted its operation receipt");
|
|
7183
|
+
return { operation_id: operationId, replayed: response.headers.get("idempotency-replayed") === "true" };
|
|
7184
|
+
} catch (error) {
|
|
7185
|
+
translateError(error);
|
|
7186
|
+
}
|
|
6554
7187
|
}
|
|
6555
7188
|
};
|
|
6556
|
-
function
|
|
7189
|
+
function unwrapData2(payload) {
|
|
7190
|
+
if (!payload || typeof payload !== "object" || Array.isArray(payload) || !("data" in payload))
|
|
7191
|
+
throw new ForgeContractError("Forge returned an invalid success envelope", { payload });
|
|
7192
|
+
return payload.data;
|
|
7193
|
+
}
|
|
7194
|
+
var Forge = class {
|
|
7195
|
+
repositories;
|
|
7196
|
+
constructor(http) {
|
|
7197
|
+
this.repositories = new ForgeRepositories(http);
|
|
7198
|
+
this.http = http;
|
|
7199
|
+
}
|
|
7200
|
+
http;
|
|
7201
|
+
async capabilities() {
|
|
7202
|
+
return parseCapabilities(unwrapData2(await this.http.get("/forge/capabilities")));
|
|
7203
|
+
}
|
|
7204
|
+
};
|
|
7205
|
+
function unwrap38(payload) {
|
|
6557
7206
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
6558
7207
|
return payload.data;
|
|
6559
7208
|
}
|
|
@@ -6589,7 +7238,7 @@ var HealthChecks = class {
|
|
|
6589
7238
|
}
|
|
6590
7239
|
async get(checkId) {
|
|
6591
7240
|
const data = await this.http.get(`/health-checks/${checkId}`);
|
|
6592
|
-
return
|
|
7241
|
+
return unwrap38(data);
|
|
6593
7242
|
}
|
|
6594
7243
|
async create(params) {
|
|
6595
7244
|
const {
|
|
@@ -6610,7 +7259,7 @@ var HealthChecks = class {
|
|
|
6610
7259
|
body: body5,
|
|
6611
7260
|
headers: { "Idempotency-Key": idempotencyKey7(ikey) }
|
|
6612
7261
|
});
|
|
6613
|
-
return
|
|
7262
|
+
return unwrap38(data);
|
|
6614
7263
|
}
|
|
6615
7264
|
async update(checkId, params) {
|
|
6616
7265
|
const { intervalSec, timeoutSec, expectedStatus, ...rest } = params;
|
|
@@ -6624,7 +7273,7 @@ var HealthChecks = class {
|
|
|
6624
7273
|
`/health-checks/${checkId}`,
|
|
6625
7274
|
body5
|
|
6626
7275
|
);
|
|
6627
|
-
return
|
|
7276
|
+
return unwrap38(data);
|
|
6628
7277
|
}
|
|
6629
7278
|
async delete(checkId) {
|
|
6630
7279
|
await this.http.delete(`/health-checks/${checkId}`);
|
|
@@ -6632,7 +7281,7 @@ var HealthChecks = class {
|
|
|
6632
7281
|
};
|
|
6633
7282
|
|
|
6634
7283
|
// src/resources/integrations.ts
|
|
6635
|
-
function
|
|
7284
|
+
function unwrap39(payload) {
|
|
6636
7285
|
if (payload && typeof payload === "object") {
|
|
6637
7286
|
const p = payload;
|
|
6638
7287
|
for (const k of ["data", "integrations", "catalog", "items"]) {
|
|
@@ -6642,7 +7291,7 @@ function unwrap37(payload) {
|
|
|
6642
7291
|
return payload;
|
|
6643
7292
|
}
|
|
6644
7293
|
function listItems8(payload) {
|
|
6645
|
-
const result =
|
|
7294
|
+
const result = unwrap39(payload);
|
|
6646
7295
|
if (Array.isArray(result)) return result;
|
|
6647
7296
|
return [];
|
|
6648
7297
|
}
|
|
@@ -6671,14 +7320,14 @@ var Integrations = class {
|
|
|
6671
7320
|
const data = await this.http.get(
|
|
6672
7321
|
`/integrations/${provider}/start`
|
|
6673
7322
|
);
|
|
6674
|
-
return
|
|
7323
|
+
return unwrap39(data);
|
|
6675
7324
|
}
|
|
6676
7325
|
/** Force-refresh the access token for a provider. */
|
|
6677
7326
|
async refresh(provider) {
|
|
6678
7327
|
const data = await this.http.post(
|
|
6679
7328
|
`/integrations/${provider}/refresh`
|
|
6680
7329
|
);
|
|
6681
|
-
return
|
|
7330
|
+
return unwrap39(data);
|
|
6682
7331
|
}
|
|
6683
7332
|
/** Disconnect (revoke) an integration. */
|
|
6684
7333
|
async disconnect(provider) {
|
|
@@ -6703,7 +7352,7 @@ var Integrations = class {
|
|
|
6703
7352
|
"/integrations/slack/send-test",
|
|
6704
7353
|
body5
|
|
6705
7354
|
);
|
|
6706
|
-
return
|
|
7355
|
+
return unwrap39(data);
|
|
6707
7356
|
}
|
|
6708
7357
|
/** Send a test message to the connected Discord channel. */
|
|
6709
7358
|
async discordSendTest(params = {}) {
|
|
@@ -6712,13 +7361,13 @@ var Integrations = class {
|
|
|
6712
7361
|
"/integrations/discord/send-test",
|
|
6713
7362
|
body5
|
|
6714
7363
|
);
|
|
6715
|
-
return
|
|
7364
|
+
return unwrap39(data);
|
|
6716
7365
|
}
|
|
6717
7366
|
// ── Linear dedicated controller ────────────────────────────────────────────
|
|
6718
7367
|
/** Begin Linear OAuth — Linear has provider-specific error shapes. */
|
|
6719
7368
|
async linearStart() {
|
|
6720
7369
|
const data = await this.http.get("/integrations/linear/start");
|
|
6721
|
-
return
|
|
7370
|
+
return unwrap39(data);
|
|
6722
7371
|
}
|
|
6723
7372
|
/** Create a Linear issue via the connected workspace. */
|
|
6724
7373
|
async linearCreateIssue(params = {}) {
|
|
@@ -6727,12 +7376,12 @@ var Integrations = class {
|
|
|
6727
7376
|
"/integrations/linear/create-issue",
|
|
6728
7377
|
body5
|
|
6729
7378
|
);
|
|
6730
|
-
return
|
|
7379
|
+
return unwrap39(data);
|
|
6731
7380
|
}
|
|
6732
7381
|
};
|
|
6733
7382
|
|
|
6734
7383
|
// src/resources/mcp.ts
|
|
6735
|
-
function
|
|
7384
|
+
function unwrap40(payload) {
|
|
6736
7385
|
if (payload && typeof payload === "object") {
|
|
6737
7386
|
const p = payload;
|
|
6738
7387
|
for (const k of ["data", "mcp", "result", "items"]) {
|
|
@@ -6758,7 +7407,7 @@ var Mcp = class {
|
|
|
6758
7407
|
"/mcp",
|
|
6759
7408
|
Object.keys(body5).length > 0 ? body5 : void 0
|
|
6760
7409
|
);
|
|
6761
|
-
return
|
|
7410
|
+
return unwrap40(data);
|
|
6762
7411
|
}
|
|
6763
7412
|
/**
|
|
6764
7413
|
* Open the MCP listen channel (GET).
|
|
@@ -6768,7 +7417,7 @@ var Mcp = class {
|
|
|
6768
7417
|
*/
|
|
6769
7418
|
async listen() {
|
|
6770
7419
|
const data = await this.http.get("/mcp");
|
|
6771
|
-
return
|
|
7420
|
+
return unwrap40(data);
|
|
6772
7421
|
}
|
|
6773
7422
|
/** Close (terminate) the MCP session. */
|
|
6774
7423
|
async close() {
|
|
@@ -6777,7 +7426,7 @@ var Mcp = class {
|
|
|
6777
7426
|
};
|
|
6778
7427
|
|
|
6779
7428
|
// src/resources/models.ts
|
|
6780
|
-
function
|
|
7429
|
+
function unwrap41(data) {
|
|
6781
7430
|
if (Array.isArray(data)) return data;
|
|
6782
7431
|
if (data && typeof data === "object") {
|
|
6783
7432
|
const d = data;
|
|
@@ -6798,7 +7447,7 @@ var Models = class {
|
|
|
6798
7447
|
Object.entries(filters).filter(([, v]) => v !== void 0)
|
|
6799
7448
|
);
|
|
6800
7449
|
const data = await this.http.get("/intelligence/models", query3);
|
|
6801
|
-
return
|
|
7450
|
+
return unwrap41(data);
|
|
6802
7451
|
}
|
|
6803
7452
|
/**
|
|
6804
7453
|
* Get a single model by id.
|
|
@@ -7454,7 +8103,7 @@ function requestBody(params) {
|
|
|
7454
8103
|
config: authConfig(params)
|
|
7455
8104
|
});
|
|
7456
8105
|
}
|
|
7457
|
-
function
|
|
8106
|
+
function unwrap42(payload) {
|
|
7458
8107
|
if (payload && typeof payload === "object") {
|
|
7459
8108
|
const p = payload;
|
|
7460
8109
|
for (const k of ["data", "project_auth", "config", "items"]) {
|
|
@@ -7479,13 +8128,13 @@ var ProjectAuth = class {
|
|
|
7479
8128
|
"/project-auth/status",
|
|
7480
8129
|
resourcePayload(params)
|
|
7481
8130
|
);
|
|
7482
|
-
return
|
|
8131
|
+
return unwrap42(data);
|
|
7483
8132
|
}
|
|
7484
8133
|
/** Enable project auth. */
|
|
7485
8134
|
async enable(params) {
|
|
7486
8135
|
const body5 = requestBody(params);
|
|
7487
8136
|
const data = await this.http.post("/project-auth/enable", body5);
|
|
7488
|
-
return
|
|
8137
|
+
return unwrap42(data);
|
|
7489
8138
|
}
|
|
7490
8139
|
/** Disable project auth. */
|
|
7491
8140
|
async disable(params) {
|
|
@@ -7493,18 +8142,18 @@ var ProjectAuth = class {
|
|
|
7493
8142
|
"/project-auth/disable",
|
|
7494
8143
|
resourcePayload(params)
|
|
7495
8144
|
);
|
|
7496
|
-
return
|
|
8145
|
+
return unwrap42(data);
|
|
7497
8146
|
}
|
|
7498
8147
|
/** Update project-auth configuration. */
|
|
7499
8148
|
async update(params) {
|
|
7500
8149
|
const body5 = requestBody(params);
|
|
7501
8150
|
const data = await this.http.patch("/project-auth/config", body5);
|
|
7502
|
-
return
|
|
8151
|
+
return unwrap42(data);
|
|
7503
8152
|
}
|
|
7504
8153
|
};
|
|
7505
8154
|
|
|
7506
8155
|
// src/resources/project-integrations.ts
|
|
7507
|
-
function
|
|
8156
|
+
function unwrap43(payload) {
|
|
7508
8157
|
if (payload && typeof payload === "object") {
|
|
7509
8158
|
const p = payload;
|
|
7510
8159
|
for (const k of ["data", "project_integrations", "catalog", "items"]) {
|
|
@@ -7514,7 +8163,7 @@ function unwrap41(payload) {
|
|
|
7514
8163
|
return payload;
|
|
7515
8164
|
}
|
|
7516
8165
|
function listItems9(payload) {
|
|
7517
|
-
const result =
|
|
8166
|
+
const result = unwrap43(payload);
|
|
7518
8167
|
if (Array.isArray(result)) return result;
|
|
7519
8168
|
return [];
|
|
7520
8169
|
}
|
|
@@ -7549,13 +8198,13 @@ var ProjectIntegrations = class {
|
|
|
7549
8198
|
const data = await this.http.get(
|
|
7550
8199
|
`/project-integrations/${integrationId}`
|
|
7551
8200
|
);
|
|
7552
|
-
return
|
|
8201
|
+
return unwrap43(data);
|
|
7553
8202
|
}
|
|
7554
8203
|
/** Create a project integration. */
|
|
7555
8204
|
async create(params) {
|
|
7556
8205
|
const body5 = stripUndefObj2(params);
|
|
7557
8206
|
const data = await this.http.post("/project-integrations", body5);
|
|
7558
|
-
return
|
|
8207
|
+
return unwrap43(data);
|
|
7559
8208
|
}
|
|
7560
8209
|
/** Update a project integration. */
|
|
7561
8210
|
async update(integrationId, params) {
|
|
@@ -7564,7 +8213,7 @@ var ProjectIntegrations = class {
|
|
|
7564
8213
|
`/project-integrations/${integrationId}`,
|
|
7565
8214
|
body5
|
|
7566
8215
|
);
|
|
7567
|
-
return
|
|
8216
|
+
return unwrap43(data);
|
|
7568
8217
|
}
|
|
7569
8218
|
/** Delete a project integration. */
|
|
7570
8219
|
async delete(integrationId) {
|
|
@@ -7573,7 +8222,7 @@ var ProjectIntegrations = class {
|
|
|
7573
8222
|
};
|
|
7574
8223
|
|
|
7575
8224
|
// src/resources/provider-defaults.ts
|
|
7576
|
-
function
|
|
8225
|
+
function unwrap44(data) {
|
|
7577
8226
|
if (data && typeof data === "object") {
|
|
7578
8227
|
const d = data;
|
|
7579
8228
|
for (const k of ["data", "defaults", "provider_defaults", "config"]) {
|
|
@@ -7589,7 +8238,7 @@ var ProviderDefaults = class {
|
|
|
7589
8238
|
http;
|
|
7590
8239
|
/** Get the current fleet-wide provider defaults. */
|
|
7591
8240
|
async list() {
|
|
7592
|
-
return
|
|
8241
|
+
return unwrap44(await this.http.get("/admin/provider-defaults"));
|
|
7593
8242
|
}
|
|
7594
8243
|
/** Return the defaults entry for a single provider, or {} if missing. */
|
|
7595
8244
|
async get(provider) {
|
|
@@ -7605,13 +8254,13 @@ var ProviderDefaults = class {
|
|
|
7605
8254
|
const body5 = Object.fromEntries(
|
|
7606
8255
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
7607
8256
|
);
|
|
7608
|
-
return
|
|
8257
|
+
return unwrap44(
|
|
7609
8258
|
await this.http.put("/admin/provider-defaults", body5)
|
|
7610
8259
|
);
|
|
7611
8260
|
}
|
|
7612
8261
|
// ── Per-tenant overrides ────────────────────────────────────────────────
|
|
7613
8262
|
async getTenant(tenantId) {
|
|
7614
|
-
return
|
|
8263
|
+
return unwrap44(
|
|
7615
8264
|
await this.http.get(
|
|
7616
8265
|
`/admin/tenants/${tenantId}/provider-config`
|
|
7617
8266
|
)
|
|
@@ -7621,7 +8270,7 @@ var ProviderDefaults = class {
|
|
|
7621
8270
|
const body5 = Object.fromEntries(
|
|
7622
8271
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
7623
8272
|
);
|
|
7624
|
-
return
|
|
8273
|
+
return unwrap44(
|
|
7625
8274
|
await this.http.put(
|
|
7626
8275
|
`/admin/tenants/${tenantId}/provider-config`,
|
|
7627
8276
|
body5
|
|
@@ -7634,7 +8283,7 @@ var ProviderDefaults = class {
|
|
|
7634
8283
|
};
|
|
7635
8284
|
|
|
7636
8285
|
// src/resources/regions.ts
|
|
7637
|
-
function
|
|
8286
|
+
function unwrap45(payload) {
|
|
7638
8287
|
if (payload && typeof payload === "object") {
|
|
7639
8288
|
const p = payload;
|
|
7640
8289
|
for (const k of [
|
|
@@ -7651,7 +8300,7 @@ function unwrap43(payload) {
|
|
|
7651
8300
|
return payload;
|
|
7652
8301
|
}
|
|
7653
8302
|
function listItems10(payload) {
|
|
7654
|
-
const result =
|
|
8303
|
+
const result = unwrap45(payload);
|
|
7655
8304
|
if (Array.isArray(result)) return result;
|
|
7656
8305
|
return [];
|
|
7657
8306
|
}
|
|
@@ -7668,7 +8317,7 @@ var Regions = class {
|
|
|
7668
8317
|
/** Get canonical compute catalog, including product templates and readiness. */
|
|
7669
8318
|
async catalog() {
|
|
7670
8319
|
const data = await this.http.get("/compute/catalog");
|
|
7671
|
-
return
|
|
8320
|
+
return unwrap45(data);
|
|
7672
8321
|
}
|
|
7673
8322
|
/** List available compute sizes. */
|
|
7674
8323
|
async listSizes() {
|
|
@@ -7678,7 +8327,7 @@ var Regions = class {
|
|
|
7678
8327
|
/** Get static compute pricing data. */
|
|
7679
8328
|
async pricing() {
|
|
7680
8329
|
const data = await this.http.get("/compute/pricing");
|
|
7681
|
-
return
|
|
8330
|
+
return unwrap45(data);
|
|
7682
8331
|
}
|
|
7683
8332
|
/** List community computer templates. */
|
|
7684
8333
|
async listTemplates() {
|
|
@@ -7690,12 +8339,12 @@ var Regions = class {
|
|
|
7690
8339
|
const data = await this.http.get(
|
|
7691
8340
|
`/compute/templates/${templateId}`
|
|
7692
8341
|
);
|
|
7693
|
-
return
|
|
8342
|
+
return unwrap45(data);
|
|
7694
8343
|
}
|
|
7695
8344
|
};
|
|
7696
8345
|
|
|
7697
8346
|
// src/resources/runtime-env.ts
|
|
7698
|
-
function
|
|
8347
|
+
function unwrap46(payload) {
|
|
7699
8348
|
if (payload !== null && typeof payload === "object" && "data" in payload && payload.data !== void 0) {
|
|
7700
8349
|
return payload.data;
|
|
7701
8350
|
}
|
|
@@ -7748,11 +8397,11 @@ var RuntimeEnv = class {
|
|
|
7748
8397
|
"/runtime-env",
|
|
7749
8398
|
query2(params)
|
|
7750
8399
|
);
|
|
7751
|
-
return
|
|
8400
|
+
return unwrap46(response).map(normalize2);
|
|
7752
8401
|
}
|
|
7753
8402
|
async get(id) {
|
|
7754
8403
|
return normalize2(
|
|
7755
|
-
|
|
8404
|
+
unwrap46(
|
|
7756
8405
|
await this.http.get(
|
|
7757
8406
|
`/runtime-env/${encodeURIComponent(id)}`
|
|
7758
8407
|
)
|
|
@@ -7761,7 +8410,7 @@ var RuntimeEnv = class {
|
|
|
7761
8410
|
}
|
|
7762
8411
|
async set(params) {
|
|
7763
8412
|
return normalize2(
|
|
7764
|
-
|
|
8413
|
+
unwrap46(
|
|
7765
8414
|
await this.http.post(
|
|
7766
8415
|
"/runtime-env",
|
|
7767
8416
|
body4(params)
|
|
@@ -7775,7 +8424,7 @@ var RuntimeEnv = class {
|
|
|
7775
8424
|
};
|
|
7776
8425
|
|
|
7777
8426
|
// src/resources/runtime-capabilities.ts
|
|
7778
|
-
function
|
|
8427
|
+
function unwrap47(payload) {
|
|
7779
8428
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
7780
8429
|
return payload.data;
|
|
7781
8430
|
}
|
|
@@ -7787,7 +8436,7 @@ var RuntimeCapabilitiesResource = class {
|
|
|
7787
8436
|
}
|
|
7788
8437
|
http;
|
|
7789
8438
|
async get() {
|
|
7790
|
-
return
|
|
8439
|
+
return unwrap47(
|
|
7791
8440
|
await this.http.get("/runtime-capabilities")
|
|
7792
8441
|
);
|
|
7793
8442
|
}
|
|
@@ -7803,12 +8452,12 @@ function encodeContent(content) {
|
|
|
7803
8452
|
return btoa(bin);
|
|
7804
8453
|
}
|
|
7805
8454
|
var SANDBOX_TEMPLATE = "miosa-sandbox";
|
|
7806
|
-
var
|
|
7807
|
-
|
|
7808
|
-
|
|
7809
|
-
|
|
7810
|
-
|
|
7811
|
-
|
|
8455
|
+
var SANDBOX_TIER_BY_CPU = {
|
|
8456
|
+
1: { size: "xs", memoryMb: 2048 },
|
|
8457
|
+
2: { size: "small", memoryMb: 4096 },
|
|
8458
|
+
4: { size: "medium", memoryMb: 8192 },
|
|
8459
|
+
8: { size: "large", memoryMb: 16384 },
|
|
8460
|
+
16: { size: "xl", memoryMb: 32768 }
|
|
7812
8461
|
};
|
|
7813
8462
|
var AGENT_WORKSPACE_TIMEOUT_SEC = 86400;
|
|
7814
8463
|
var AGENT_WORKSPACE_IDLE_TIMEOUT_SEC = 1800;
|
|
@@ -7817,7 +8466,7 @@ var AGENT_WORKSPACE_KEEP_LAST_SNAPSHOTS = 1;
|
|
|
7817
8466
|
function isLegacyForkParams(opts) {
|
|
7818
8467
|
return "name" in opts || "metadata" in opts;
|
|
7819
8468
|
}
|
|
7820
|
-
function
|
|
8469
|
+
function unwrap48(payload) {
|
|
7821
8470
|
if (payload !== null && typeof payload === "object" && "data" in payload && payload.data !== void 0) {
|
|
7822
8471
|
return payload.data;
|
|
7823
8472
|
}
|
|
@@ -7861,31 +8510,9 @@ function createBody(params = {}) {
|
|
|
7861
8510
|
if (legacyPersistencePolicy) metadata.miosa_persistent = persistent;
|
|
7862
8511
|
const cpuCount = params.cpuCount ?? params.cpu_count;
|
|
7863
8512
|
const memoryMb = params.memoryMb ?? params.memory_mb;
|
|
7864
|
-
const
|
|
7865
|
-
|
|
7866
|
-
(
|
|
7867
|
-
).length;
|
|
7868
|
-
if (suppliedResources !== 0 && suppliedResources !== 3) {
|
|
7869
|
-
throw new TypeError(
|
|
7870
|
-
"Raw sandbox resources require cpuCount, memoryMb, and diskSizeMb together. Prefer size."
|
|
7871
|
-
);
|
|
7872
|
-
}
|
|
7873
|
-
let resolvedSize = params.size;
|
|
7874
|
-
if (suppliedResources === 3) {
|
|
7875
|
-
const matchingSize = Object.entries(SANDBOX_SHAPE_CONTRACTS).find(
|
|
7876
|
-
([, contract]) => contract.cpuCount === cpuCount && contract.memoryMb === memoryMb && contract.diskSizeMb === diskMb
|
|
7877
|
-
)?.[0];
|
|
7878
|
-
if (!matchingSize) {
|
|
7879
|
-
throw new TypeError(
|
|
7880
|
-
"Raw sandbox resources must exactly match a named size contract."
|
|
7881
|
-
);
|
|
7882
|
-
}
|
|
7883
|
-
if (resolvedSize && resolvedSize !== matchingSize) {
|
|
7884
|
-
throw new TypeError(
|
|
7885
|
-
`Raw sandbox resources match ${matchingSize}, not requested size ${resolvedSize}.`
|
|
7886
|
-
);
|
|
7887
|
-
}
|
|
7888
|
-
resolvedSize = matchingSize;
|
|
8513
|
+
const resolvedSize = params.size;
|
|
8514
|
+
if (cpuCount !== void 0 || memoryMb !== void 0) {
|
|
8515
|
+
assertPublishedShape(cpuCount, memoryMb);
|
|
7889
8516
|
}
|
|
7890
8517
|
if (snapshotExpirationSec !== void 0) {
|
|
7891
8518
|
metadata.snapshot_expiration_sec = snapshotExpirationSec;
|
|
@@ -7920,11 +8547,30 @@ function createBody(params = {}) {
|
|
|
7920
8547
|
slug: params.slug,
|
|
7921
8548
|
agent_runtime_profile_id: params.agentRuntimeProfileId ?? params.agent_runtime_profile_id ?? params.agentProfileId ?? params.agent_profile_id,
|
|
7922
8549
|
skip_agent_runtime_profile: params.skipRuntimeProfile ?? params.skip_agent_runtime_profile,
|
|
8550
|
+
workspace_id: params.workspaceId ?? params.workspace_id,
|
|
8551
|
+
workspace_slug: params.workspaceSlug ?? params.workspace_slug,
|
|
8552
|
+
workspace_name: params.workspaceName ?? params.workspace_name,
|
|
8553
|
+
project_id: params.projectId ?? params.project_id,
|
|
8554
|
+
project_slug: params.projectSlug ?? params.project_slug,
|
|
8555
|
+
project_name: params.projectName ?? params.project_name,
|
|
7923
8556
|
external_workspace_id: params.externalWorkspaceId ?? params.external_workspace_id,
|
|
7924
8557
|
external_user_id: params.externalUserId ?? params.external_user_id,
|
|
7925
8558
|
external_project_id: params.externalProjectId ?? params.external_project_id
|
|
7926
8559
|
});
|
|
7927
8560
|
}
|
|
8561
|
+
function assertPublishedShape(cpuCount, memoryMb) {
|
|
8562
|
+
const tier = cpuCount === void 0 ? void 0 : SANDBOX_TIER_BY_CPU[cpuCount];
|
|
8563
|
+
if (tier && tier.memoryMb === memoryMb) return;
|
|
8564
|
+
const supplied = `${cpuCount ?? "?"} vCPU / ${memoryMb ?? "?"} MiB`;
|
|
8565
|
+
if (tier) {
|
|
8566
|
+
throw new TypeError(
|
|
8567
|
+
`Unsupported cpu/memory combination (${supplied}); nearest supported is ${tier.size} (${cpuCount} vCPU / ${tier.memoryMb} MiB). Pass size: "${tier.size}" or memoryMb: ${tier.memoryMb}. Custom disk sizes are allowed on top of any tier.`
|
|
8568
|
+
);
|
|
8569
|
+
}
|
|
8570
|
+
throw new TypeError(
|
|
8571
|
+
`Unsupported cpu/memory combination (${supplied}). Supported tiers: xs (1/2048), small (2/4096), medium (4/8192), large (8/16384), xl (16/32768). Pass a matching cpuCount + memoryMb (any diskSizeMb is allowed) or use size.`
|
|
8572
|
+
);
|
|
8573
|
+
}
|
|
7928
8574
|
function execBody(command, options = {}) {
|
|
7929
8575
|
return stripUndefined26({
|
|
7930
8576
|
command,
|
|
@@ -7933,6 +8579,19 @@ function execBody(command, options = {}) {
|
|
|
7933
8579
|
timeout: options.timeout ?? options.timeoutSec ?? options.timeout_sec
|
|
7934
8580
|
});
|
|
7935
8581
|
}
|
|
8582
|
+
function normalizeExecEvent(event, payload) {
|
|
8583
|
+
const record = payload !== null && typeof payload === "object" ? payload : {};
|
|
8584
|
+
const isExit = event === "exit" || record.exit_code !== void 0 || record.exitCode !== void 0 || event === null && typeof payload === "number";
|
|
8585
|
+
if (isExit) {
|
|
8586
|
+
const code = Number(
|
|
8587
|
+
record.exit_code ?? record.exitCode ?? (typeof payload === "number" ? payload : 0)
|
|
8588
|
+
);
|
|
8589
|
+
return { type: "exit", exit_code: code, exitCode: code };
|
|
8590
|
+
}
|
|
8591
|
+
const type = event === "stderr" ? "stderr" : "stdout";
|
|
8592
|
+
const data = typeof payload === "string" ? payload : String(record.line ?? record.data ?? "");
|
|
8593
|
+
return { type, data, line: data };
|
|
8594
|
+
}
|
|
7936
8595
|
function stripUndefined26(input) {
|
|
7937
8596
|
return Object.fromEntries(
|
|
7938
8597
|
Object.entries(input).filter(([, value]) => value !== void 0)
|
|
@@ -8078,7 +8737,7 @@ var SandboxTerminal = class {
|
|
|
8078
8737
|
const body5 = Object.fromEntries(
|
|
8079
8738
|
Object.entries(params).filter(([, v]) => v !== void 0)
|
|
8080
8739
|
);
|
|
8081
|
-
const response =
|
|
8740
|
+
const response = unwrap48(
|
|
8082
8741
|
await this.sandbox.http.post(`/sandboxes/${this.sandbox.id}/terminal`, body5)
|
|
8083
8742
|
);
|
|
8084
8743
|
return response;
|
|
@@ -8136,7 +8795,7 @@ var SandboxPreviews = class {
|
|
|
8136
8795
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
8137
8796
|
)
|
|
8138
8797
|
};
|
|
8139
|
-
return
|
|
8798
|
+
return unwrap48(
|
|
8140
8799
|
await this.http.post(
|
|
8141
8800
|
`/sandboxes/${this.sandbox.id}/previews`,
|
|
8142
8801
|
body5
|
|
@@ -8144,7 +8803,7 @@ var SandboxPreviews = class {
|
|
|
8144
8803
|
);
|
|
8145
8804
|
}
|
|
8146
8805
|
async get(previewId) {
|
|
8147
|
-
return
|
|
8806
|
+
return unwrap48(
|
|
8148
8807
|
await this.http.get(
|
|
8149
8808
|
`/sandboxes/${this.sandbox.id}/previews/${previewId}`
|
|
8150
8809
|
)
|
|
@@ -8157,7 +8816,7 @@ var SandboxPreviews = class {
|
|
|
8157
8816
|
}
|
|
8158
8817
|
/** Mint a share token for previewId. */
|
|
8159
8818
|
async share(previewId, opts = {}) {
|
|
8160
|
-
return
|
|
8819
|
+
return unwrap48(
|
|
8161
8820
|
await this.http.post(
|
|
8162
8821
|
`/sandboxes/${this.sandbox.id}/previews/${previewId}/share`,
|
|
8163
8822
|
{ ttl_seconds: opts.ttl_seconds ?? opts.expires_in_sec ?? 3600 }
|
|
@@ -8226,7 +8885,7 @@ var SandboxTags = class {
|
|
|
8226
8885
|
sandbox;
|
|
8227
8886
|
/** Replace the full tag list with tags. */
|
|
8228
8887
|
async set(tags) {
|
|
8229
|
-
return
|
|
8888
|
+
return unwrap48(
|
|
8230
8889
|
await this.sandbox.http.patch(`/sandboxes/${this.sandbox.id}/tags`, { tags })
|
|
8231
8890
|
);
|
|
8232
8891
|
}
|
|
@@ -8300,7 +8959,7 @@ var Sandbox = class _Sandbox {
|
|
|
8300
8959
|
return this.data.template_id ?? this.data.image_id ?? "";
|
|
8301
8960
|
}
|
|
8302
8961
|
async refresh() {
|
|
8303
|
-
this.data =
|
|
8962
|
+
this.data = unwrap48(
|
|
8304
8963
|
await this.http.get(`/sandboxes/${this.id}`)
|
|
8305
8964
|
);
|
|
8306
8965
|
return this;
|
|
@@ -8342,7 +9001,7 @@ var Sandbox = class _Sandbox {
|
|
|
8342
9001
|
}
|
|
8343
9002
|
async runExec(command, options) {
|
|
8344
9003
|
this.assertRunning("exec");
|
|
8345
|
-
const response =
|
|
9004
|
+
const response = unwrap48(
|
|
8346
9005
|
await this.http.post(
|
|
8347
9006
|
`/sandboxes/${this.id}/exec`,
|
|
8348
9007
|
execBody(command, options)
|
|
@@ -8363,13 +9022,18 @@ var Sandbox = class _Sandbox {
|
|
|
8363
9022
|
}
|
|
8364
9023
|
execStream(command, options) {
|
|
8365
9024
|
this.assertRunning("exec.stream");
|
|
8366
|
-
|
|
9025
|
+
const frames = this.http.streamFrames(
|
|
8367
9026
|
`/sandboxes/${this.id}/exec/stream`,
|
|
8368
9027
|
{
|
|
8369
9028
|
method: "POST",
|
|
8370
9029
|
body: execBody(command, options)
|
|
8371
9030
|
}
|
|
8372
9031
|
);
|
|
9032
|
+
return (async function* () {
|
|
9033
|
+
for await (const frame of frames) {
|
|
9034
|
+
yield normalizeExecEvent(frame.event, frame.data);
|
|
9035
|
+
}
|
|
9036
|
+
})();
|
|
8373
9037
|
}
|
|
8374
9038
|
async writeFile(path, content) {
|
|
8375
9039
|
this.assertRunning("writeFile");
|
|
@@ -8387,7 +9051,7 @@ var Sandbox = class _Sandbox {
|
|
|
8387
9051
|
}
|
|
8388
9052
|
async createExport(params) {
|
|
8389
9053
|
const body5 = typeof params === "string" ? { path: params } : Array.isArray(params) ? { paths: params } : params;
|
|
8390
|
-
const response =
|
|
9054
|
+
const response = unwrap48(
|
|
8391
9055
|
await this.http.post(
|
|
8392
9056
|
`/sandboxes/${this.id}/exports`,
|
|
8393
9057
|
body5
|
|
@@ -8412,7 +9076,7 @@ var Sandbox = class _Sandbox {
|
|
|
8412
9076
|
}
|
|
8413
9077
|
async listFiles(path = "/workspace") {
|
|
8414
9078
|
this.assertRunning("files.list");
|
|
8415
|
-
const response =
|
|
9079
|
+
const response = unwrap48(
|
|
8416
9080
|
await this.http.get(
|
|
8417
9081
|
`/sandboxes/${this.id}/files`,
|
|
8418
9082
|
{ path }
|
|
@@ -8422,7 +9086,7 @@ var Sandbox = class _Sandbox {
|
|
|
8422
9086
|
}
|
|
8423
9087
|
async statFile(path) {
|
|
8424
9088
|
this.assertRunning("files.stat");
|
|
8425
|
-
return
|
|
9089
|
+
return unwrap48(
|
|
8426
9090
|
await this.http.post(
|
|
8427
9091
|
`/sandboxes/${this.id}/files/stat`,
|
|
8428
9092
|
{ path }
|
|
@@ -8442,7 +9106,7 @@ var Sandbox = class _Sandbox {
|
|
|
8442
9106
|
}
|
|
8443
9107
|
async exposeInfo(port) {
|
|
8444
9108
|
this.assertRunning("expose");
|
|
8445
|
-
const response =
|
|
9109
|
+
const response = unwrap48(
|
|
8446
9110
|
await this.http.post(
|
|
8447
9111
|
`/sandboxes/${this.id}/expose`,
|
|
8448
9112
|
port === void 0 ? {} : { port }
|
|
@@ -8452,7 +9116,7 @@ var Sandbox = class _Sandbox {
|
|
|
8452
9116
|
}
|
|
8453
9117
|
async startTemplate(options = {}) {
|
|
8454
9118
|
this.assertRunning("startTemplate");
|
|
8455
|
-
return
|
|
9119
|
+
return unwrap48(
|
|
8456
9120
|
await this.http.post(
|
|
8457
9121
|
`/sandboxes/${this.id}/template/start`,
|
|
8458
9122
|
options
|
|
@@ -8460,7 +9124,7 @@ var Sandbox = class _Sandbox {
|
|
|
8460
9124
|
);
|
|
8461
9125
|
}
|
|
8462
9126
|
async getArtifacts() {
|
|
8463
|
-
return
|
|
9127
|
+
return unwrap48(
|
|
8464
9128
|
await this.http.get(
|
|
8465
9129
|
`/sandboxes/${this.id}/artifacts`
|
|
8466
9130
|
)
|
|
@@ -8471,7 +9135,7 @@ var Sandbox = class _Sandbox {
|
|
|
8471
9135
|
`/sandboxes/${this.id}/logs`,
|
|
8472
9136
|
{ lines }
|
|
8473
9137
|
);
|
|
8474
|
-
return
|
|
9138
|
+
return unwrap48(response);
|
|
8475
9139
|
}
|
|
8476
9140
|
streamLogs() {
|
|
8477
9141
|
return this.http.stream(
|
|
@@ -8479,7 +9143,7 @@ var Sandbox = class _Sandbox {
|
|
|
8479
9143
|
);
|
|
8480
9144
|
}
|
|
8481
9145
|
async metrics(window2 = "1h") {
|
|
8482
|
-
return
|
|
9146
|
+
return unwrap48(
|
|
8483
9147
|
await this.http.get(
|
|
8484
9148
|
`/sandboxes/${this.id}/metrics`,
|
|
8485
9149
|
{ window: window2 }
|
|
@@ -8491,7 +9155,7 @@ var Sandbox = class _Sandbox {
|
|
|
8491
9155
|
}
|
|
8492
9156
|
async createSnapshot(comment) {
|
|
8493
9157
|
this.assertRunning("snapshots.create");
|
|
8494
|
-
return
|
|
9158
|
+
return unwrap48(
|
|
8495
9159
|
await this.http.post(
|
|
8496
9160
|
`/sandboxes/${this.id}/snapshots`,
|
|
8497
9161
|
comment ? { comment } : {}
|
|
@@ -8499,14 +9163,14 @@ var Sandbox = class _Sandbox {
|
|
|
8499
9163
|
);
|
|
8500
9164
|
}
|
|
8501
9165
|
async listSnapshots() {
|
|
8502
|
-
return
|
|
9166
|
+
return unwrap48(
|
|
8503
9167
|
await this.http.get(
|
|
8504
9168
|
`/sandboxes/${this.id}/snapshots`
|
|
8505
9169
|
)
|
|
8506
9170
|
);
|
|
8507
9171
|
}
|
|
8508
9172
|
async restoreSnapshot(snapshotId) {
|
|
8509
|
-
const data =
|
|
9173
|
+
const data = unwrap48(
|
|
8510
9174
|
await this.http.post(
|
|
8511
9175
|
`/sandboxes/${this.id}/restore/${snapshotId}`,
|
|
8512
9176
|
{}
|
|
@@ -8523,11 +9187,12 @@ var Sandbox = class _Sandbox {
|
|
|
8523
9187
|
}
|
|
8524
9188
|
this.assertRunning("fork");
|
|
8525
9189
|
const body5 = stripUndefined26({
|
|
9190
|
+
snapshot_id: opts.snapshotId ?? opts.snapshot_id,
|
|
8526
9191
|
timeout_sec: opts.timeoutSec ?? opts.timeout_sec,
|
|
8527
9192
|
template_id: opts.templateId ?? opts.template_id
|
|
8528
9193
|
});
|
|
8529
9194
|
const idempotencyKey11 = opts.idempotencyKey ?? opts.idempotency_key;
|
|
8530
|
-
const data =
|
|
9195
|
+
const data = unwrap48(
|
|
8531
9196
|
await this.http.request(
|
|
8532
9197
|
`/sandboxes/${this.id}/fork`,
|
|
8533
9198
|
{
|
|
@@ -8543,13 +9208,14 @@ var Sandbox = class _Sandbox {
|
|
|
8543
9208
|
async forkLegacy(opts = {}) {
|
|
8544
9209
|
this.assertRunning("fork");
|
|
8545
9210
|
const body5 = stripUndefined26({
|
|
9211
|
+
snapshot_id: opts.snapshotId ?? opts.snapshot_id,
|
|
8546
9212
|
timeout_sec: opts.timeoutSec ?? opts.timeout_sec,
|
|
8547
9213
|
template_id: opts.templateId ?? opts.template_id,
|
|
8548
9214
|
name: opts.name,
|
|
8549
9215
|
metadata: opts.metadata
|
|
8550
9216
|
});
|
|
8551
9217
|
const idempotencyKey11 = opts.idempotencyKey ?? opts.idempotency_key;
|
|
8552
|
-
const data =
|
|
9218
|
+
const data = unwrap48(
|
|
8553
9219
|
await this.http.request(
|
|
8554
9220
|
`/sandboxes/${this.id}/fork`,
|
|
8555
9221
|
{
|
|
@@ -8585,7 +9251,7 @@ var Sandbox = class _Sandbox {
|
|
|
8585
9251
|
timeout_sec: params.timeout_sec ?? params.timeoutSec,
|
|
8586
9252
|
idle_timeout_sec: params.idle_timeout_sec ?? params.idleTimeoutSec
|
|
8587
9253
|
});
|
|
8588
|
-
const data =
|
|
9254
|
+
const data = unwrap48(
|
|
8589
9255
|
await this.http.patch(
|
|
8590
9256
|
`/sandboxes/${this.id}`,
|
|
8591
9257
|
body5
|
|
@@ -8595,7 +9261,7 @@ var Sandbox = class _Sandbox {
|
|
|
8595
9261
|
return this;
|
|
8596
9262
|
}
|
|
8597
9263
|
async extend(timeoutSec) {
|
|
8598
|
-
const data =
|
|
9264
|
+
const data = unwrap48(
|
|
8599
9265
|
await this.http.post(
|
|
8600
9266
|
`/sandboxes/${this.id}/extend`,
|
|
8601
9267
|
timeoutSec === void 0 ? {} : { timeout_sec: timeoutSec }
|
|
@@ -8605,7 +9271,7 @@ var Sandbox = class _Sandbox {
|
|
|
8605
9271
|
return this;
|
|
8606
9272
|
}
|
|
8607
9273
|
async usage() {
|
|
8608
|
-
return
|
|
9274
|
+
return unwrap48(
|
|
8609
9275
|
await this.http.get(
|
|
8610
9276
|
`/sandboxes/${this.id}/usage`
|
|
8611
9277
|
)
|
|
@@ -8625,7 +9291,7 @@ var Sandbox = class _Sandbox {
|
|
|
8625
9291
|
return raw;
|
|
8626
9292
|
}
|
|
8627
9293
|
async pause() {
|
|
8628
|
-
const data =
|
|
9294
|
+
const data = unwrap48(
|
|
8629
9295
|
await this.http.post(
|
|
8630
9296
|
`/sandboxes/${this.id}/pause`,
|
|
8631
9297
|
{}
|
|
@@ -8646,7 +9312,7 @@ var Sandbox = class _Sandbox {
|
|
|
8646
9312
|
`/sandboxes/${this.id}/resume`,
|
|
8647
9313
|
{}
|
|
8648
9314
|
);
|
|
8649
|
-
const data =
|
|
9315
|
+
const data = unwrap48(response);
|
|
8650
9316
|
this.data = { ...this.data, ...data };
|
|
8651
9317
|
return this;
|
|
8652
9318
|
}
|
|
@@ -8677,7 +9343,7 @@ var Sandbox = class _Sandbox {
|
|
|
8677
9343
|
if (idempotencyKey11) {
|
|
8678
9344
|
requestOptions.headers = { "Idempotency-Key": idempotencyKey11 };
|
|
8679
9345
|
}
|
|
8680
|
-
return
|
|
9346
|
+
return unwrap48(
|
|
8681
9347
|
await this.http.request(
|
|
8682
9348
|
`/sandboxes/${this.id}/deploy`,
|
|
8683
9349
|
requestOptions
|
|
@@ -8687,9 +9353,57 @@ var Sandbox = class _Sandbox {
|
|
|
8687
9353
|
async deployDocker(params = {}) {
|
|
8688
9354
|
return this.deploy({ ...params, deploymentType: "docker_deploy" });
|
|
8689
9355
|
}
|
|
9356
|
+
/** Deploy an immutable snapshot without modifying the editable sandbox. */
|
|
9357
|
+
async deploySnapshot(snapshotId, params = {}, options = {}) {
|
|
9358
|
+
const release = await this.forkLegacy({
|
|
9359
|
+
snapshotId,
|
|
9360
|
+
name: `release-${snapshotId.slice(0, 12)}`,
|
|
9361
|
+
metadata: { release_source_sandbox_id: this.id, snapshot_id: snapshotId },
|
|
9362
|
+
...options.forkIdempotencyKey ? { idempotencyKey: options.forkIdempotencyKey } : {}
|
|
9363
|
+
});
|
|
9364
|
+
const cleanupRequested = options.cleanup !== false;
|
|
9365
|
+
const destroyRelease = async () => {
|
|
9366
|
+
if (!cleanupRequested) return void 0;
|
|
9367
|
+
try {
|
|
9368
|
+
await release.destroy();
|
|
9369
|
+
return void 0;
|
|
9370
|
+
} catch (error) {
|
|
9371
|
+
return error instanceof Error ? error.message : String(error);
|
|
9372
|
+
}
|
|
9373
|
+
};
|
|
9374
|
+
let result;
|
|
9375
|
+
try {
|
|
9376
|
+
result = await release.deploy(params) ?? {};
|
|
9377
|
+
} catch (error) {
|
|
9378
|
+
const failedCleanup = await destroyRelease();
|
|
9379
|
+
if (cleanupRequested && failedCleanup === void 0) throw error;
|
|
9380
|
+
const leak = {
|
|
9381
|
+
release_sandbox_id: release.id
|
|
9382
|
+
};
|
|
9383
|
+
if (failedCleanup !== void 0) {
|
|
9384
|
+
leak.release_cleanup_error = failedCleanup;
|
|
9385
|
+
}
|
|
9386
|
+
if (typeof error === "object" && error !== null) {
|
|
9387
|
+
throw Object.assign(error, leak);
|
|
9388
|
+
}
|
|
9389
|
+
throw Object.assign(
|
|
9390
|
+
new Error(`Snapshot deployment failed: ${String(error)}`, {
|
|
9391
|
+
cause: error
|
|
9392
|
+
}),
|
|
9393
|
+
leak
|
|
9394
|
+
);
|
|
9395
|
+
}
|
|
9396
|
+
const cleanupErrorMessage = await destroyRelease();
|
|
9397
|
+
result.source_snapshot_id = snapshotId;
|
|
9398
|
+
result.release_sandbox_id = release.id;
|
|
9399
|
+
if (cleanupErrorMessage !== void 0) {
|
|
9400
|
+
result.release_cleanup_error = cleanupErrorMessage;
|
|
9401
|
+
}
|
|
9402
|
+
return result;
|
|
9403
|
+
}
|
|
8690
9404
|
/** Check readiness of the sandbox (GET /sandboxes/:id/readiness). */
|
|
8691
9405
|
async readiness() {
|
|
8692
|
-
return
|
|
9406
|
+
return unwrap48(
|
|
8693
9407
|
await this.http.get(
|
|
8694
9408
|
`/sandboxes/${this.id}/readiness`
|
|
8695
9409
|
)
|
|
@@ -8716,19 +9430,40 @@ var Sandbox = class _Sandbox {
|
|
|
8716
9430
|
const stream = options.stream ?? true;
|
|
8717
9431
|
if (stream) {
|
|
8718
9432
|
const sseResult = await this.tryReadinessStream(timeout);
|
|
8719
|
-
if (sseResult !== null)
|
|
9433
|
+
if (sseResult !== null) {
|
|
9434
|
+
if (sseResult) await this.adoptReadyState();
|
|
9435
|
+
return sseResult;
|
|
9436
|
+
}
|
|
8720
9437
|
}
|
|
8721
9438
|
const deadlineMs = Date.now() + timeout * 1e3;
|
|
8722
9439
|
while (Date.now() < deadlineMs) {
|
|
8723
9440
|
try {
|
|
8724
9441
|
const data = await this.readiness();
|
|
8725
|
-
if (data.ready === true || data.status === "ready")
|
|
9442
|
+
if (data.ready === true || data.status === "ready") {
|
|
9443
|
+
await this.adoptReadyState();
|
|
9444
|
+
return true;
|
|
9445
|
+
}
|
|
8726
9446
|
} catch {
|
|
8727
9447
|
}
|
|
8728
9448
|
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
8729
9449
|
}
|
|
8730
9450
|
return false;
|
|
8731
9451
|
}
|
|
9452
|
+
/**
|
|
9453
|
+
* Readiness answers from the server; `assertRunning` reads the local
|
|
9454
|
+
* snapshot. Leaving that snapshot behind meant a caller could await
|
|
9455
|
+
* `waitUntilReady()`, receive `true`, and have the very next call refused
|
|
9456
|
+
* for being "provisioning" — the sandbox was running the whole time, only
|
|
9457
|
+
* this object had not been told. Nothing here can fail the wait: readiness
|
|
9458
|
+
* has already answered, so a refresh that does not land is not the caller's
|
|
9459
|
+
* problem.
|
|
9460
|
+
*/
|
|
9461
|
+
async adoptReadyState() {
|
|
9462
|
+
try {
|
|
9463
|
+
await this.refresh();
|
|
9464
|
+
} catch {
|
|
9465
|
+
}
|
|
9466
|
+
}
|
|
8732
9467
|
/**
|
|
8733
9468
|
* Returns `true` / `false` for terminal SSE events, or `null` if the
|
|
8734
9469
|
* stream endpoint is unavailable (404 or transport error) so callers
|
|
@@ -8857,7 +9592,7 @@ var Sandboxes = class {
|
|
|
8857
9592
|
if (idempotencyKey11) {
|
|
8858
9593
|
requestOptions.headers = { "Idempotency-Key": idempotencyKey11 };
|
|
8859
9594
|
}
|
|
8860
|
-
const data =
|
|
9595
|
+
const data = unwrap48(
|
|
8861
9596
|
await this.http.request(
|
|
8862
9597
|
"/sandboxes",
|
|
8863
9598
|
requestOptions
|
|
@@ -8876,7 +9611,7 @@ var Sandboxes = class {
|
|
|
8876
9611
|
return listItems11(data).map((item) => new Sandbox(this.http, item));
|
|
8877
9612
|
}
|
|
8878
9613
|
async get(id) {
|
|
8879
|
-
const data =
|
|
9614
|
+
const data = unwrap48(
|
|
8880
9615
|
await this.http.get(`/sandboxes/${id}`)
|
|
8881
9616
|
);
|
|
8882
9617
|
return new Sandbox(this.http, data);
|
|
@@ -8904,7 +9639,7 @@ var Sandboxes = class {
|
|
|
8904
9639
|
return this.get(id);
|
|
8905
9640
|
}
|
|
8906
9641
|
async getByName(name) {
|
|
8907
|
-
const data =
|
|
9642
|
+
const data = unwrap48(
|
|
8908
9643
|
await this.http.get(
|
|
8909
9644
|
`/sandboxes/by-name/${encodeURIComponent(name)}`
|
|
8910
9645
|
)
|
|
@@ -8951,7 +9686,7 @@ var Sandboxes = class {
|
|
|
8951
9686
|
);
|
|
8952
9687
|
}
|
|
8953
9688
|
async validateBuildSpec(buildSpec) {
|
|
8954
|
-
return
|
|
9689
|
+
return unwrap48(
|
|
8955
9690
|
await this.http.post(
|
|
8956
9691
|
"/sandbox-templates/validate",
|
|
8957
9692
|
{
|
|
@@ -8971,7 +9706,7 @@ var Sandboxes = class {
|
|
|
8971
9706
|
metadata: params.metadata
|
|
8972
9707
|
})
|
|
8973
9708
|
);
|
|
8974
|
-
return
|
|
9709
|
+
return unwrap48(response);
|
|
8975
9710
|
}
|
|
8976
9711
|
async createTemplateBuild(templateId, params = {}) {
|
|
8977
9712
|
const response = await this.http.post(
|
|
@@ -8981,19 +9716,19 @@ var Sandboxes = class {
|
|
|
8981
9716
|
metadata: params.metadata
|
|
8982
9717
|
})
|
|
8983
9718
|
);
|
|
8984
|
-
return
|
|
9719
|
+
return unwrap48(response);
|
|
8985
9720
|
}
|
|
8986
9721
|
async listTemplateBuilds(templateId) {
|
|
8987
9722
|
const response = await this.http.get(
|
|
8988
9723
|
`/sandbox-templates/${templateId}/builds`
|
|
8989
9724
|
);
|
|
8990
|
-
return
|
|
9725
|
+
return unwrap48(response);
|
|
8991
9726
|
}
|
|
8992
9727
|
async getTemplateBuild(buildId) {
|
|
8993
9728
|
const response = await this.http.get(
|
|
8994
9729
|
`/sandbox-template-builds/${buildId}`
|
|
8995
9730
|
);
|
|
8996
|
-
return
|
|
9731
|
+
return unwrap48(response);
|
|
8997
9732
|
}
|
|
8998
9733
|
};
|
|
8999
9734
|
function toBase642(bytes) {
|
|
@@ -9025,7 +9760,7 @@ function previewInfoFromResponse(response) {
|
|
|
9025
9760
|
)
|
|
9026
9761
|
};
|
|
9027
9762
|
}
|
|
9028
|
-
function
|
|
9763
|
+
function unwrap49(payload) {
|
|
9029
9764
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
9030
9765
|
return payload.data;
|
|
9031
9766
|
}
|
|
@@ -9068,7 +9803,7 @@ var SandboxTemplates = class {
|
|
|
9068
9803
|
const data = await this.http.get(
|
|
9069
9804
|
`/sandbox-templates/${templateId}`
|
|
9070
9805
|
);
|
|
9071
|
-
return
|
|
9806
|
+
return unwrap49(data);
|
|
9072
9807
|
}
|
|
9073
9808
|
async create(params) {
|
|
9074
9809
|
const {
|
|
@@ -9088,7 +9823,7 @@ var SandboxTemplates = class {
|
|
|
9088
9823
|
body: body5,
|
|
9089
9824
|
headers: { "Idempotency-Key": idempotencyKey8(ikey) }
|
|
9090
9825
|
});
|
|
9091
|
-
return
|
|
9826
|
+
return unwrap49(data);
|
|
9092
9827
|
}
|
|
9093
9828
|
async buildSpecSchema() {
|
|
9094
9829
|
const data = await this.http.get("/sandbox-templates/build-spec");
|
|
@@ -9121,12 +9856,12 @@ var SandboxTemplates = class {
|
|
|
9121
9856
|
headers: { "Idempotency-Key": idempotencyKey8(ikey) }
|
|
9122
9857
|
}
|
|
9123
9858
|
);
|
|
9124
|
-
return
|
|
9859
|
+
return unwrap49(data);
|
|
9125
9860
|
}
|
|
9126
9861
|
};
|
|
9127
9862
|
|
|
9128
9863
|
// src/resources/settings.ts
|
|
9129
|
-
function
|
|
9864
|
+
function unwrap50(payload) {
|
|
9130
9865
|
if (payload && typeof payload === "object") {
|
|
9131
9866
|
const p = payload;
|
|
9132
9867
|
for (const k of [
|
|
@@ -9142,7 +9877,7 @@ function unwrap48(payload) {
|
|
|
9142
9877
|
return payload;
|
|
9143
9878
|
}
|
|
9144
9879
|
function listItems13(payload) {
|
|
9145
|
-
const result =
|
|
9880
|
+
const result = unwrap50(payload);
|
|
9146
9881
|
if (Array.isArray(result)) return result;
|
|
9147
9882
|
return [];
|
|
9148
9883
|
}
|
|
@@ -9159,46 +9894,46 @@ var Settings = class {
|
|
|
9159
9894
|
/** Get the current tenant settings. */
|
|
9160
9895
|
async get() {
|
|
9161
9896
|
const data = await this.http.get("/settings");
|
|
9162
|
-
return
|
|
9897
|
+
return unwrap50(data);
|
|
9163
9898
|
}
|
|
9164
9899
|
/** Update tenant settings. */
|
|
9165
9900
|
async update(params) {
|
|
9166
9901
|
const body5 = stripUndefined28(params);
|
|
9167
9902
|
const data = await this.http.put("/settings", body5);
|
|
9168
|
-
return
|
|
9903
|
+
return unwrap50(data);
|
|
9169
9904
|
}
|
|
9170
9905
|
// ── Branding ──────────────────────────────────────────────────────────────
|
|
9171
9906
|
/** Get tenant branding (logo, colors, custom wordmark). */
|
|
9172
9907
|
async getBranding() {
|
|
9173
9908
|
const data = await this.http.get("/settings/branding");
|
|
9174
|
-
return
|
|
9909
|
+
return unwrap50(data);
|
|
9175
9910
|
}
|
|
9176
9911
|
/** Update tenant branding. */
|
|
9177
9912
|
async updateBranding(params) {
|
|
9178
9913
|
const body5 = stripUndefined28(params);
|
|
9179
9914
|
const data = await this.http.put("/settings/branding", body5);
|
|
9180
|
-
return
|
|
9915
|
+
return unwrap50(data);
|
|
9181
9916
|
}
|
|
9182
9917
|
// ── Read-only reference data ───────────────────────────────────────────────
|
|
9183
9918
|
/** Get tenant-scoped compute pricing. */
|
|
9184
9919
|
async computePricing() {
|
|
9185
9920
|
const data = await this.http.get("/settings/compute-pricing");
|
|
9186
|
-
return
|
|
9921
|
+
return unwrap50(data);
|
|
9187
9922
|
}
|
|
9188
9923
|
/** Get tenant-scoped GPU pricing. */
|
|
9189
9924
|
async gpuPricing() {
|
|
9190
9925
|
const data = await this.http.get("/settings/gpu-pricing");
|
|
9191
|
-
return
|
|
9926
|
+
return unwrap50(data);
|
|
9192
9927
|
}
|
|
9193
9928
|
/** List models available to this tenant. */
|
|
9194
9929
|
async availableModels() {
|
|
9195
9930
|
const data = await this.http.get("/settings/available-models");
|
|
9196
|
-
return
|
|
9931
|
+
return unwrap50(data);
|
|
9197
9932
|
}
|
|
9198
9933
|
/** List regions enabled for this tenant. */
|
|
9199
9934
|
async regions() {
|
|
9200
9935
|
const data = await this.http.get("/settings/regions");
|
|
9201
|
-
return
|
|
9936
|
+
return unwrap50(data);
|
|
9202
9937
|
}
|
|
9203
9938
|
// ── BYOK provider keys ────────────────────────────────────────────────────
|
|
9204
9939
|
/** List tenant-level BYOK provider keys (Anthropic, OpenAI, etc.). */
|
|
@@ -9213,7 +9948,7 @@ var Settings = class {
|
|
|
9213
9948
|
`/settings/provider-keys/${provider}`,
|
|
9214
9949
|
body5
|
|
9215
9950
|
);
|
|
9216
|
-
return
|
|
9951
|
+
return unwrap50(data);
|
|
9217
9952
|
}
|
|
9218
9953
|
/** Delete a BYOK provider key. */
|
|
9219
9954
|
async deleteProviderKey(provider) {
|
|
@@ -9222,7 +9957,7 @@ var Settings = class {
|
|
|
9222
9957
|
};
|
|
9223
9958
|
|
|
9224
9959
|
// src/resources/snapshots-standalone.ts
|
|
9225
|
-
function
|
|
9960
|
+
function unwrap51(data) {
|
|
9226
9961
|
if (data && typeof data === "object") {
|
|
9227
9962
|
const d = data;
|
|
9228
9963
|
for (const k of ["data", "snapshots", "items"]) {
|
|
@@ -9253,14 +9988,14 @@ var SnapshotsStandalone = class {
|
|
|
9253
9988
|
return unwrapList14(await this.http.get("/admin/snapshots", query3));
|
|
9254
9989
|
}
|
|
9255
9990
|
async get(snapshotId) {
|
|
9256
|
-
return
|
|
9991
|
+
return unwrap51(
|
|
9257
9992
|
await this.http.get(`/admin/snapshots/${snapshotId}`)
|
|
9258
9993
|
);
|
|
9259
9994
|
}
|
|
9260
9995
|
};
|
|
9261
9996
|
|
|
9262
9997
|
// src/resources/storage.ts
|
|
9263
|
-
function
|
|
9998
|
+
function unwrap52(payload) {
|
|
9264
9999
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
9265
10000
|
return payload.data;
|
|
9266
10001
|
}
|
|
@@ -9299,11 +10034,11 @@ var Storage = class {
|
|
|
9299
10034
|
...rest
|
|
9300
10035
|
});
|
|
9301
10036
|
const data = await this.http.post("/storage/buckets", body5);
|
|
9302
|
-
return
|
|
10037
|
+
return unwrap52(data);
|
|
9303
10038
|
}
|
|
9304
10039
|
async getBucket(bucketId) {
|
|
9305
10040
|
const data = await this.http.get(`/storage/buckets/${bucketId}`);
|
|
9306
|
-
return
|
|
10041
|
+
return unwrap52(data);
|
|
9307
10042
|
}
|
|
9308
10043
|
async deleteBucket(bucketId) {
|
|
9309
10044
|
await this.http.delete(`/storage/buckets/${bucketId}`);
|
|
@@ -9353,7 +10088,7 @@ var Storage = class {
|
|
|
9353
10088
|
`/storage/buckets/${bucketId}/presign`,
|
|
9354
10089
|
body5
|
|
9355
10090
|
);
|
|
9356
|
-
return
|
|
10091
|
+
return unwrap52(data);
|
|
9357
10092
|
}
|
|
9358
10093
|
};
|
|
9359
10094
|
|
|
@@ -9493,7 +10228,7 @@ var Organizations = class {
|
|
|
9493
10228
|
};
|
|
9494
10229
|
|
|
9495
10230
|
// src/resources/tenant.ts
|
|
9496
|
-
function
|
|
10231
|
+
function unwrap53(payload) {
|
|
9497
10232
|
if (payload && typeof payload === "object") {
|
|
9498
10233
|
const p = payload;
|
|
9499
10234
|
for (const k of ["data", "tenant", "branding", "items"]) {
|
|
@@ -9515,14 +10250,14 @@ var PreviewDomain = class {
|
|
|
9515
10250
|
/** Get the tenant's white-label preview domain settings. */
|
|
9516
10251
|
async get() {
|
|
9517
10252
|
const data = await this.http.get("/tenant/preview-domain");
|
|
9518
|
-
return
|
|
10253
|
+
return unwrap53(data);
|
|
9519
10254
|
}
|
|
9520
10255
|
/** Set the tenant's white-label preview domain. */
|
|
9521
10256
|
async set(domain) {
|
|
9522
10257
|
const data = await this.http.put("/tenant/preview-domain", {
|
|
9523
10258
|
preview_domain: domain
|
|
9524
10259
|
});
|
|
9525
|
-
return
|
|
10260
|
+
return unwrap53(data);
|
|
9526
10261
|
}
|
|
9527
10262
|
/** Re-run DNS verification for the configured preview domain. */
|
|
9528
10263
|
async verify() {
|
|
@@ -9530,7 +10265,7 @@ var PreviewDomain = class {
|
|
|
9530
10265
|
"/tenant/preview-domain/verify",
|
|
9531
10266
|
{}
|
|
9532
10267
|
);
|
|
9533
|
-
return
|
|
10268
|
+
return unwrap53(data);
|
|
9534
10269
|
}
|
|
9535
10270
|
/** Remove the tenant's custom preview domain. */
|
|
9536
10271
|
async delete() {
|
|
@@ -9545,14 +10280,14 @@ var Branding = class {
|
|
|
9545
10280
|
/** Get tenant branding used by white-label hosted surfaces. */
|
|
9546
10281
|
async get() {
|
|
9547
10282
|
const data = await this.http.get("/tenant/branding");
|
|
9548
|
-
return
|
|
10283
|
+
return unwrap53(data);
|
|
9549
10284
|
}
|
|
9550
10285
|
/** Update tenant branding used by white-label hosted surfaces. */
|
|
9551
10286
|
async set(params) {
|
|
9552
10287
|
const data = await this.http.put("/tenant/branding", {
|
|
9553
10288
|
branding: stripUndefined30(params)
|
|
9554
10289
|
});
|
|
9555
|
-
return
|
|
10290
|
+
return unwrap53(data);
|
|
9556
10291
|
}
|
|
9557
10292
|
/** Reset tenant branding to platform defaults. */
|
|
9558
10293
|
async delete() {
|
|
@@ -9574,7 +10309,7 @@ var Tenant = class {
|
|
|
9574
10309
|
/** Get the current tenant's plan, limits, and live usage counters. */
|
|
9575
10310
|
async current() {
|
|
9576
10311
|
const data = await this.http.get("/tenant/plan");
|
|
9577
|
-
return
|
|
10312
|
+
return unwrap53(data);
|
|
9578
10313
|
}
|
|
9579
10314
|
/** Convenience alias for `tenant.branding.get()`. */
|
|
9580
10315
|
async getBranding() {
|
|
@@ -9635,7 +10370,7 @@ var Templates = class {
|
|
|
9635
10370
|
};
|
|
9636
10371
|
|
|
9637
10372
|
// src/resources/usage.ts
|
|
9638
|
-
function
|
|
10373
|
+
function unwrap54(payload) {
|
|
9639
10374
|
if (payload && typeof payload === "object") {
|
|
9640
10375
|
const p = payload;
|
|
9641
10376
|
for (const k of ["data", "usage", "sessions", "summary", "items"]) {
|
|
@@ -9657,13 +10392,13 @@ var Usage = class {
|
|
|
9657
10392
|
/** Get the current period usage summary. */
|
|
9658
10393
|
async current() {
|
|
9659
10394
|
const data = await this.http.get("/usage/summary");
|
|
9660
|
-
return
|
|
10395
|
+
return unwrap54(data);
|
|
9661
10396
|
}
|
|
9662
10397
|
/** List per-session metering events. */
|
|
9663
10398
|
async sessions(params = {}) {
|
|
9664
10399
|
const query3 = stripUndefined31(params);
|
|
9665
10400
|
const data = await this.http.get("/usage/sessions", query3);
|
|
9666
|
-
const result =
|
|
10401
|
+
const result = unwrap54(data);
|
|
9667
10402
|
if (Array.isArray(result)) return result;
|
|
9668
10403
|
return [];
|
|
9669
10404
|
}
|
|
@@ -9671,10 +10406,10 @@ var Usage = class {
|
|
|
9671
10406
|
async report(params = {}) {
|
|
9672
10407
|
const query3 = stripUndefined31(params);
|
|
9673
10408
|
const data = await this.http.get("/usage/summary", query3);
|
|
9674
|
-
return
|
|
10409
|
+
return unwrap54(data);
|
|
9675
10410
|
}
|
|
9676
10411
|
};
|
|
9677
|
-
function
|
|
10412
|
+
function unwrap55(payload) {
|
|
9678
10413
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
9679
10414
|
return payload.data;
|
|
9680
10415
|
}
|
|
@@ -9710,7 +10445,7 @@ var Volumes = class {
|
|
|
9710
10445
|
}
|
|
9711
10446
|
async get(volumeId) {
|
|
9712
10447
|
const data = await this.http.get(`/volumes/${volumeId}`);
|
|
9713
|
-
return
|
|
10448
|
+
return unwrap55(data);
|
|
9714
10449
|
}
|
|
9715
10450
|
async create(params) {
|
|
9716
10451
|
const { idempotencyKey: ikey, sizeGb, ...rest } = params;
|
|
@@ -9723,7 +10458,7 @@ var Volumes = class {
|
|
|
9723
10458
|
body: body5,
|
|
9724
10459
|
headers: { "Idempotency-Key": idempotencyKey9(ikey) }
|
|
9725
10460
|
});
|
|
9726
|
-
return
|
|
10461
|
+
return unwrap55(data);
|
|
9727
10462
|
}
|
|
9728
10463
|
async delete(volumeId) {
|
|
9729
10464
|
await this.http.delete(`/volumes/${volumeId}`);
|
|
@@ -9754,7 +10489,7 @@ var Volumes = class {
|
|
|
9754
10489
|
`/computers/${computerId}/volumes`,
|
|
9755
10490
|
body5
|
|
9756
10491
|
);
|
|
9757
|
-
return
|
|
10492
|
+
return unwrap55(data);
|
|
9758
10493
|
}
|
|
9759
10494
|
async detach(computerId, attachmentId) {
|
|
9760
10495
|
await this.http.delete(
|
|
@@ -9762,7 +10497,7 @@ var Volumes = class {
|
|
|
9762
10497
|
);
|
|
9763
10498
|
}
|
|
9764
10499
|
};
|
|
9765
|
-
function
|
|
10500
|
+
function unwrap56(payload) {
|
|
9766
10501
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
9767
10502
|
return payload.data;
|
|
9768
10503
|
}
|
|
@@ -9829,7 +10564,7 @@ var Webhooks = class {
|
|
|
9829
10564
|
}
|
|
9830
10565
|
async get(webhookId) {
|
|
9831
10566
|
const data = await this.http.get(`/webhooks/${webhookId}`);
|
|
9832
|
-
return
|
|
10567
|
+
return unwrap56(data);
|
|
9833
10568
|
}
|
|
9834
10569
|
async create(params) {
|
|
9835
10570
|
const { idempotencyKey: ikey, ...rest } = params;
|
|
@@ -9839,12 +10574,12 @@ var Webhooks = class {
|
|
|
9839
10574
|
body: body5,
|
|
9840
10575
|
headers: { "Idempotency-Key": idempotencyKey10(ikey) }
|
|
9841
10576
|
});
|
|
9842
|
-
return
|
|
10577
|
+
return unwrap56(data);
|
|
9843
10578
|
}
|
|
9844
10579
|
async update(webhookId, params) {
|
|
9845
10580
|
const body5 = stripUndefined33(params);
|
|
9846
10581
|
const data = await this.http.patch(`/webhooks/${webhookId}`, body5);
|
|
9847
|
-
return
|
|
10582
|
+
return unwrap56(data);
|
|
9848
10583
|
}
|
|
9849
10584
|
async delete(webhookId) {
|
|
9850
10585
|
await this.http.delete(`/webhooks/${webhookId}`);
|
|
@@ -9857,7 +10592,7 @@ var Webhooks = class {
|
|
|
9857
10592
|
headers: { "Idempotency-Key": idempotencyKey10(opts.idempotencyKey) }
|
|
9858
10593
|
}
|
|
9859
10594
|
);
|
|
9860
|
-
return
|
|
10595
|
+
return unwrap56(data);
|
|
9861
10596
|
}
|
|
9862
10597
|
async deliveries(webhookId) {
|
|
9863
10598
|
const data = await this.http.get(
|
|
@@ -10040,6 +10775,7 @@ var Miosa = class {
|
|
|
10040
10775
|
orgInvites;
|
|
10041
10776
|
/** Organizations available to the user session, membership, invites, and switching. */
|
|
10042
10777
|
organizations;
|
|
10778
|
+
forge;
|
|
10043
10779
|
/** Current tenant plan, limits, and live usage counters. */
|
|
10044
10780
|
tenant;
|
|
10045
10781
|
/** Datacenter regions, compute sizes, pricing, community templates. */
|
|
@@ -10064,6 +10800,8 @@ var Miosa = class {
|
|
|
10064
10800
|
projectIntegrations;
|
|
10065
10801
|
/** Built-in auth for generated apps inside sandboxes/deployments. */
|
|
10066
10802
|
projectAuth;
|
|
10803
|
+
/** Durable generated App Documents, exact-version reviews, and publication bindings. */
|
|
10804
|
+
appDocuments;
|
|
10067
10805
|
/** BYOK encrypted per-user provider keys. */
|
|
10068
10806
|
externalKeys;
|
|
10069
10807
|
/** Model Context Protocol — JSON-RPC dispatch + streaming channel. */
|
|
@@ -10078,6 +10816,8 @@ var Miosa = class {
|
|
|
10078
10816
|
agentRunGroups;
|
|
10079
10817
|
/** Agent runtime profiles — tenant/workspace defaults for sandbox/computer agents. */
|
|
10080
10818
|
agentRuntimeProfiles;
|
|
10819
|
+
/** Persisted workspace Agent definitions and immutable versions. */
|
|
10820
|
+
agents;
|
|
10081
10821
|
/** MIOSA Connect — provider connectors and runtime tokens. */
|
|
10082
10822
|
connectors;
|
|
10083
10823
|
/** Inherited runtime env — tenant/workspace/project defaults for agent runtimes. */
|
|
@@ -10183,6 +10923,7 @@ var Miosa = class {
|
|
|
10183
10923
|
this.workspaceInvites = new WorkspaceInvites(this.http);
|
|
10184
10924
|
this.orgInvites = new OrgInvites(this.http);
|
|
10185
10925
|
this.organizations = new Organizations(this.http);
|
|
10926
|
+
this.forge = new Forge(this.http);
|
|
10186
10927
|
this.tenant = new Tenant(this.http);
|
|
10187
10928
|
this.regions = new Regions(this.http);
|
|
10188
10929
|
this.settings = new Settings(this.http);
|
|
@@ -10195,6 +10936,7 @@ var Miosa = class {
|
|
|
10195
10936
|
this.integrations = new Integrations(this.http);
|
|
10196
10937
|
this.projectIntegrations = new ProjectIntegrations(this.http);
|
|
10197
10938
|
this.projectAuth = new ProjectAuth(this.http);
|
|
10939
|
+
this.appDocuments = new AppDocuments(this.http);
|
|
10198
10940
|
this.externalKeys = new ExternalKeys(this.http);
|
|
10199
10941
|
this.mcp = new Mcp(this.http);
|
|
10200
10942
|
this.runs = new Runs(this.http);
|
|
@@ -10202,6 +10944,7 @@ var Miosa = class {
|
|
|
10202
10944
|
this.agentRuns = new AgentRuns(this.http);
|
|
10203
10945
|
this.agentRunGroups = new AgentRunGroups(this.http);
|
|
10204
10946
|
this.agentRuntimeProfiles = new AgentRuntimeProfiles(this.http);
|
|
10947
|
+
this.agents = new AgentDefinitions(this.http);
|
|
10205
10948
|
this.connectors = new Connectors(this.http);
|
|
10206
10949
|
this.runtimeEnv = new RuntimeEnv(this.http);
|
|
10207
10950
|
this.runtimeCapabilities = new RuntimeCapabilitiesResource(this.http);
|
|
@@ -10728,6 +11471,6 @@ var AppAuth = class {
|
|
|
10728
11471
|
}
|
|
10729
11472
|
};
|
|
10730
11473
|
|
|
10731
|
-
export { AGENT_BUILD_KIND_SPECS, Admin, AgentRuntimeProfiles, Analytics, ApiKeys, AppAuth, AuditLog, AuthError, Benchmarks, BuilderSessions, Channels, Checkpoints, Cloud, CommandCenter, Community, Completions, Computer, ComputerAudit, ComputerAutoStop, ComputerConnectors, ComputerEnv, ComputerInbox, ComputerLogs, ComputerNetwork, ComputerOsa, ComputerPorts, ComputerSecrets, ComputerTerminal, ComputerVolumes, Computers, Connectors, Credits, CronJobs, DEFAULT_AGENT_BUILD_OUTPUT_ROOT, DEFAULT_AGENT_BUILD_PACKET_VERSION, Dashboard, Databases, DeploymentConnectors, DeploymentDomains, DeploymentReleases, DeploymentRuntimeInstances, DeploymentVersions, Deployments, Desktop, Devices, DockerDeploy, EgressAudit, EgressHostNotAllowedError, EgressNetwork, EgressSecrets, Email, EmailCampaigns, EmailInbox, EmailTemplates, Embeddings, Exec, ExternalKeys, Files, FlatCustomDomains, Functions, HealthChecks, InstallationRequiredError, InsufficientCreditsError, Integrations, ManagedProviderBindingOnlyError, Mcp, Miosa, MiosaError, Models, NetworkError, NetworkPolicy, NotFoundError, OAuthFlow, OpenComputers, OrgInvites, OrganizationMembers, Organizations, ProjectAuth, ProjectIntegrations, ProjectNotLinkedError, ProviderDefaults, RateLimitError, Regions, RunGroups, Runs, RuntimeCapabilitiesResource, RuntimeEnv, SANDBOX_TEMPLATE, Sandbox, SandboxAudit, SandboxCommands, SandboxConnectors, SandboxEnv, SandboxEvents, SandboxFiles, SandboxNetwork, SandboxPreview, SandboxPreviews, SandboxSecrets, SandboxTags, SandboxTemplates, SandboxTerminal, Sandboxes, ScopeNotAllowedError, ScopedFs, Settings, SnapshotsStandalone, Storage, SubjectNotAllowedError, Templates, Tenant, TimeoutError, TokenRefreshFailedError, Usage, UserAuthorizationRequiredError, ValidationError, Volumes, Webhooks, WorkspaceInvites, WorkspaceMembers, createAgentBuildExecutionPacket, createAgentBuildExpectedOutputs, createAgentBuildPrompt, createBuildRunParams, getAgentBuildKindSpec, resolveAgentBuildKind, verifySignature };
|
|
11474
|
+
export { AGENT_BUILD_KIND_SPECS, Admin, AgentDefinitions, AgentRuntimeProfiles, Analytics, ApiKeys, AppAuth, AppDocuments, AuditLog, AuthError, Benchmarks, BuilderSessions, Channels, Checkpoints, Cloud, CommandCenter, Community, Completions, Computer, ComputerAudit, ComputerAutoStop, ComputerConnectors, ComputerEnv, ComputerInbox, ComputerLogs, ComputerNetwork, ComputerOsa, ComputerPorts, ComputerSecrets, ComputerTerminal, ComputerVolumes, Computers, Connectors, Credits, CronJobs, DEFAULT_AGENT_BUILD_OUTPUT_ROOT, DEFAULT_AGENT_BUILD_PACKET_VERSION, Dashboard, Databases, DeploymentConnectors, DeploymentDomains, DeploymentReleases, DeploymentRuntimeInstances, DeploymentVersions, Deployments, Desktop, Devices, DockerDeploy, EgressAudit, EgressHostNotAllowedError, EgressNetwork, EgressSecrets, Email, EmailCampaigns, EmailInbox, EmailTemplates, Embeddings, Exec, ExternalKeys, Files, FlatCustomDomains, Forge, ForgeContractError, ForgePolicyViolationError, ForgeRepositories, ForgeStorageError, ForgeUnavailableError, Functions, HealthChecks, InstallationRequiredError, InsufficientCreditsError, Integrations, ManagedProviderBindingOnlyError, Mcp, Miosa, MiosaError, Models, NetworkError, NetworkPolicy, NotFoundError, OAuthFlow, OpenComputers, OrgInvites, OrganizationMembers, Organizations, ProjectAuth, ProjectIntegrations, ProjectNotLinkedError, ProviderDefaults, RateLimitError, Regions, RunGroups, Runs, RuntimeCapabilitiesResource, RuntimeEnv, SANDBOX_TEMPLATE, Sandbox, SandboxAudit, SandboxCommands, SandboxConnectors, SandboxEnv, SandboxEvents, SandboxFiles, SandboxNetwork, SandboxPreview, SandboxPreviews, SandboxSecrets, SandboxTags, SandboxTemplates, SandboxTerminal, Sandboxes, ScopeNotAllowedError, ScopedFs, Settings, SnapshotsStandalone, Storage, SubjectNotAllowedError, Templates, Tenant, TimeoutError, TokenRefreshFailedError, Usage, UserAuthorizationRequiredError, ValidationError, Volumes, Webhooks, WorkspaceInvites, WorkspaceMembers, createAgentBuildExecutionPacket, createAgentBuildExpectedOutputs, createAgentBuildPrompt, createBuildRunParams, getAgentBuildKindSpec, resolveAgentBuildKind, verifySignature };
|
|
10732
11475
|
//# sourceMappingURL=index.js.map
|
|
10733
11476
|
//# sourceMappingURL=index.js.map
|