@miosa/sdk 2.0.3 → 2.0.6
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 +24 -0
- package/dist/index.d.ts +326 -70
- package/dist/index.js +815 -316
- package/dist/index.js.map +1 -1
- package/package.json +13 -12
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.6";
|
|
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);
|
|
@@ -1258,8 +1259,69 @@ var AgentRuntimeProfiles = class {
|
|
|
1258
1259
|
}
|
|
1259
1260
|
};
|
|
1260
1261
|
|
|
1261
|
-
// src/resources/
|
|
1262
|
+
// src/resources/agent-definitions.ts
|
|
1262
1263
|
function unwrap5(payload) {
|
|
1264
|
+
if (payload !== null && typeof payload === "object" && "data" in payload && payload.data !== void 0) {
|
|
1265
|
+
return payload.data;
|
|
1266
|
+
}
|
|
1267
|
+
return payload;
|
|
1268
|
+
}
|
|
1269
|
+
var AgentDefinitions = class {
|
|
1270
|
+
constructor(http) {
|
|
1271
|
+
this.http = http;
|
|
1272
|
+
}
|
|
1273
|
+
http;
|
|
1274
|
+
async list(params = {}) {
|
|
1275
|
+
return unwrap5(
|
|
1276
|
+
await this.http.get("/agents", {
|
|
1277
|
+
workspace_id: params.workspaceId ?? params.workspace_id,
|
|
1278
|
+
project_id: params.projectId ?? params.project_id,
|
|
1279
|
+
status: params.status
|
|
1280
|
+
})
|
|
1281
|
+
);
|
|
1282
|
+
}
|
|
1283
|
+
async get(id) {
|
|
1284
|
+
return unwrap5(
|
|
1285
|
+
await this.http.get(
|
|
1286
|
+
`/agents/${encodeURIComponent(id)}`
|
|
1287
|
+
)
|
|
1288
|
+
);
|
|
1289
|
+
}
|
|
1290
|
+
async create(params) {
|
|
1291
|
+
return unwrap5(
|
|
1292
|
+
await this.http.post(
|
|
1293
|
+
"/agents",
|
|
1294
|
+
{
|
|
1295
|
+
workspace_id: params.workspaceId ?? params.workspace_id,
|
|
1296
|
+
project_id: params.projectId ?? params.project_id,
|
|
1297
|
+
name: params.name,
|
|
1298
|
+
description: params.description,
|
|
1299
|
+
metadata: params.metadata,
|
|
1300
|
+
configuration: params.configuration
|
|
1301
|
+
}
|
|
1302
|
+
)
|
|
1303
|
+
);
|
|
1304
|
+
}
|
|
1305
|
+
async update(id, params) {
|
|
1306
|
+
return unwrap5(
|
|
1307
|
+
await this.http.patch(`/agents/${encodeURIComponent(id)}`, params)
|
|
1308
|
+
);
|
|
1309
|
+
}
|
|
1310
|
+
async publish(id, configuration) {
|
|
1311
|
+
return unwrap5(
|
|
1312
|
+
await this.http.post(
|
|
1313
|
+
`/agents/${encodeURIComponent(id)}/versions`,
|
|
1314
|
+
{ configuration }
|
|
1315
|
+
)
|
|
1316
|
+
);
|
|
1317
|
+
}
|
|
1318
|
+
async archive(id) {
|
|
1319
|
+
await this.http.delete(`/agents/${encodeURIComponent(id)}`);
|
|
1320
|
+
}
|
|
1321
|
+
};
|
|
1322
|
+
|
|
1323
|
+
// src/resources/runs.ts
|
|
1324
|
+
function unwrap6(payload) {
|
|
1263
1325
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
1264
1326
|
return payload.data;
|
|
1265
1327
|
}
|
|
@@ -1298,24 +1360,24 @@ var Runs = class {
|
|
|
1298
1360
|
status: params.status
|
|
1299
1361
|
})
|
|
1300
1362
|
);
|
|
1301
|
-
const data =
|
|
1363
|
+
const data = unwrap6(
|
|
1302
1364
|
response
|
|
1303
1365
|
);
|
|
1304
1366
|
if (Array.isArray(data)) return data;
|
|
1305
1367
|
return data.runs ?? data.items ?? [];
|
|
1306
1368
|
}
|
|
1307
1369
|
async get(id) {
|
|
1308
|
-
return
|
|
1370
|
+
return unwrap6(
|
|
1309
1371
|
await this.http.get(`/runs/${encodeURIComponent(id)}`)
|
|
1310
1372
|
);
|
|
1311
1373
|
}
|
|
1312
1374
|
async outputs(id) {
|
|
1313
|
-
return
|
|
1375
|
+
return unwrap6(
|
|
1314
1376
|
await this.http.get(`/runs/${encodeURIComponent(id)}/outputs`)
|
|
1315
1377
|
);
|
|
1316
1378
|
}
|
|
1317
1379
|
async files(id) {
|
|
1318
|
-
const data =
|
|
1380
|
+
const data = unwrap6(
|
|
1319
1381
|
await this.http.get(`/runs/${encodeURIComponent(id)}/files`)
|
|
1320
1382
|
);
|
|
1321
1383
|
if (Array.isArray(data)) return data;
|
|
@@ -1330,33 +1392,33 @@ var Runs = class {
|
|
|
1330
1392
|
);
|
|
1331
1393
|
}
|
|
1332
1394
|
async messages(id) {
|
|
1333
|
-
const data =
|
|
1395
|
+
const data = unwrap6(
|
|
1334
1396
|
await this.http.get(`/runs/${encodeURIComponent(id)}/messages`)
|
|
1335
1397
|
);
|
|
1336
1398
|
if (Array.isArray(data)) return data;
|
|
1337
1399
|
return data.messages ?? data.items ?? [];
|
|
1338
1400
|
}
|
|
1339
1401
|
async commandOutput(id) {
|
|
1340
|
-
return
|
|
1402
|
+
return unwrap6(
|
|
1341
1403
|
await this.http.get(`/runs/${encodeURIComponent(id)}/command-output`)
|
|
1342
1404
|
);
|
|
1343
1405
|
}
|
|
1344
1406
|
async activity(id) {
|
|
1345
|
-
const data =
|
|
1407
|
+
const data = unwrap6(
|
|
1346
1408
|
await this.http.get(`/runs/${encodeURIComponent(id)}/activity`)
|
|
1347
1409
|
);
|
|
1348
1410
|
if (Array.isArray(data)) return data;
|
|
1349
1411
|
return data.activity ?? data.items ?? [];
|
|
1350
1412
|
}
|
|
1351
1413
|
async previews(id) {
|
|
1352
|
-
const data =
|
|
1414
|
+
const data = unwrap6(
|
|
1353
1415
|
await this.http.get(`/runs/${encodeURIComponent(id)}/previews`)
|
|
1354
1416
|
);
|
|
1355
1417
|
if (Array.isArray(data)) return data;
|
|
1356
1418
|
return data.previews ?? data.items ?? [];
|
|
1357
1419
|
}
|
|
1358
1420
|
async diagnostics(id) {
|
|
1359
|
-
const data =
|
|
1421
|
+
const data = unwrap6(await this.http.get(`/runs/${encodeURIComponent(id)}/diagnostics`));
|
|
1360
1422
|
if (Array.isArray(data)) return data;
|
|
1361
1423
|
return data.diagnostics ?? data.items ?? [];
|
|
1362
1424
|
}
|
|
@@ -1403,6 +1465,9 @@ var Runs = class {
|
|
|
1403
1465
|
env: params.env,
|
|
1404
1466
|
agent_runtime_profile_id: params.agentRuntimeProfileId,
|
|
1405
1467
|
agent_profile_id: params.agentProfileId,
|
|
1468
|
+
agent_definition_id: params.agentDefinitionId,
|
|
1469
|
+
agent_version_id: params.agentVersionId,
|
|
1470
|
+
configuration_receipt: params.configurationReceipt,
|
|
1406
1471
|
run_group_id: params.runGroupId,
|
|
1407
1472
|
parent_run_id: params.parentRunId,
|
|
1408
1473
|
orchestration_role: params.orchestrationRole,
|
|
@@ -1416,10 +1481,10 @@ var Runs = class {
|
|
|
1416
1481
|
capability_requirements: params.capabilityRequirements,
|
|
1417
1482
|
metadata: params.metadata
|
|
1418
1483
|
});
|
|
1419
|
-
return
|
|
1484
|
+
return unwrap6(await this.http.post("/runs", body5));
|
|
1420
1485
|
}
|
|
1421
1486
|
async cancel(id) {
|
|
1422
|
-
return
|
|
1487
|
+
return unwrap6(
|
|
1423
1488
|
await this.http.post(
|
|
1424
1489
|
`/runs/${encodeURIComponent(id)}/cancel`,
|
|
1425
1490
|
{}
|
|
@@ -1429,7 +1494,7 @@ var Runs = class {
|
|
|
1429
1494
|
};
|
|
1430
1495
|
|
|
1431
1496
|
// src/resources/analytics.ts
|
|
1432
|
-
function
|
|
1497
|
+
function unwrap7(payload) {
|
|
1433
1498
|
if (payload && typeof payload === "object") {
|
|
1434
1499
|
const p = payload;
|
|
1435
1500
|
for (const k of ["data", "analytics", "series", "items"]) {
|
|
@@ -1452,16 +1517,16 @@ var Analytics = class {
|
|
|
1452
1517
|
async overview(filters = {}) {
|
|
1453
1518
|
const query3 = stripUndefined5(filters);
|
|
1454
1519
|
const data = await this.http.get("/analytics/overview", query3);
|
|
1455
|
-
return
|
|
1520
|
+
return unwrap7(data);
|
|
1456
1521
|
}
|
|
1457
1522
|
/** Get a timeseries for a metric over a period. */
|
|
1458
1523
|
async timeseries(params = {}) {
|
|
1459
1524
|
const query3 = stripUndefined5(params);
|
|
1460
1525
|
const data = await this.http.get("/analytics/timeseries", query3);
|
|
1461
|
-
return
|
|
1526
|
+
return unwrap7(data);
|
|
1462
1527
|
}
|
|
1463
1528
|
};
|
|
1464
|
-
function
|
|
1529
|
+
function unwrap8(payload) {
|
|
1465
1530
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
1466
1531
|
return payload.data;
|
|
1467
1532
|
}
|
|
@@ -1506,7 +1571,7 @@ var ApiKeys = class {
|
|
|
1506
1571
|
body: body5,
|
|
1507
1572
|
headers: { "Idempotency-Key": idempotencyKey(ikey) }
|
|
1508
1573
|
});
|
|
1509
|
-
return
|
|
1574
|
+
return unwrap8(data);
|
|
1510
1575
|
}
|
|
1511
1576
|
/** POST /api/v1/api-keys/scoped — L2 delegation token bound to one external user. */
|
|
1512
1577
|
async createScoped(params) {
|
|
@@ -1515,7 +1580,7 @@ var ApiKeys = class {
|
|
|
1515
1580
|
scopes: params.scopes,
|
|
1516
1581
|
expires_at: params.expiresAt
|
|
1517
1582
|
});
|
|
1518
|
-
return
|
|
1583
|
+
return unwrap8(
|
|
1519
1584
|
await this.http.post("/api-keys/scoped", body5)
|
|
1520
1585
|
);
|
|
1521
1586
|
}
|
|
@@ -1525,7 +1590,7 @@ var ApiKeys = class {
|
|
|
1525
1590
|
};
|
|
1526
1591
|
|
|
1527
1592
|
// src/resources/app-documents.ts
|
|
1528
|
-
function
|
|
1593
|
+
function unwrap9(payload) {
|
|
1529
1594
|
return payload && typeof payload === "object" && "data" in payload ? payload.data : payload;
|
|
1530
1595
|
}
|
|
1531
1596
|
var AppDocuments = class {
|
|
@@ -1541,7 +1606,7 @@ var AppDocuments = class {
|
|
|
1541
1606
|
return payload.data;
|
|
1542
1607
|
}
|
|
1543
1608
|
async get(id) {
|
|
1544
|
-
return
|
|
1609
|
+
return unwrap9(
|
|
1545
1610
|
await this.http.get(
|
|
1546
1611
|
`/builder/apps/${id}`
|
|
1547
1612
|
)
|
|
@@ -1549,7 +1614,7 @@ var AppDocuments = class {
|
|
|
1549
1614
|
}
|
|
1550
1615
|
async create(params) {
|
|
1551
1616
|
const { workspaceId: workspaceId2, ...body5 } = params;
|
|
1552
|
-
return
|
|
1617
|
+
return unwrap9(
|
|
1553
1618
|
await this.http.post(
|
|
1554
1619
|
"/builder/apps",
|
|
1555
1620
|
{ ...body5, workspace_id: workspaceId2 }
|
|
@@ -1557,7 +1622,7 @@ var AppDocuments = class {
|
|
|
1557
1622
|
);
|
|
1558
1623
|
}
|
|
1559
1624
|
async update(id, params) {
|
|
1560
|
-
return
|
|
1625
|
+
return unwrap9(
|
|
1561
1626
|
await this.http.patch(`/builder/apps/${id}`, params)
|
|
1562
1627
|
);
|
|
1563
1628
|
}
|
|
@@ -1565,17 +1630,17 @@ var AppDocuments = class {
|
|
|
1565
1630
|
await this.http.delete(`/builder/apps/${id}`);
|
|
1566
1631
|
}
|
|
1567
1632
|
async diagnostics(id) {
|
|
1568
|
-
return
|
|
1633
|
+
return unwrap9(
|
|
1569
1634
|
await this.http.get(`/builder/apps/${id}/diagnostics`)
|
|
1570
1635
|
);
|
|
1571
1636
|
}
|
|
1572
1637
|
async stageCandidate(id) {
|
|
1573
|
-
return
|
|
1638
|
+
return unwrap9(
|
|
1574
1639
|
await this.http.post(`/builder/apps/${id}/candidates`, {})
|
|
1575
1640
|
);
|
|
1576
1641
|
}
|
|
1577
1642
|
async approveExactVersion(id, releaseId, reason) {
|
|
1578
|
-
return
|
|
1643
|
+
return unwrap9(
|
|
1579
1644
|
await this.http.post(`/builder/apps/${id}/approvals`, {
|
|
1580
1645
|
reason,
|
|
1581
1646
|
release_id: releaseId
|
|
@@ -1584,7 +1649,7 @@ var AppDocuments = class {
|
|
|
1584
1649
|
}
|
|
1585
1650
|
async publishExactRelease(id) {
|
|
1586
1651
|
const payload = await this.http.post(`/builder/apps/${id}/publish`, {});
|
|
1587
|
-
return
|
|
1652
|
+
return unwrap9(payload).app;
|
|
1588
1653
|
}
|
|
1589
1654
|
async listData(id, collection) {
|
|
1590
1655
|
const payload = await this.http.get(
|
|
@@ -1593,14 +1658,14 @@ var AppDocuments = class {
|
|
|
1593
1658
|
return payload.data;
|
|
1594
1659
|
}
|
|
1595
1660
|
async getData(id, collection, key) {
|
|
1596
|
-
return
|
|
1661
|
+
return unwrap9(
|
|
1597
1662
|
await this.http.get(
|
|
1598
1663
|
`/builder/apps/${encodeURIComponent(id)}/data/${encodeURIComponent(collection)}/${encodeURIComponent(key)}`
|
|
1599
1664
|
)
|
|
1600
1665
|
);
|
|
1601
1666
|
}
|
|
1602
1667
|
async putData(id, collection, key, value, expectedVersion) {
|
|
1603
|
-
return
|
|
1668
|
+
return unwrap9(
|
|
1604
1669
|
await this.http.put(
|
|
1605
1670
|
`/builder/apps/${encodeURIComponent(id)}/data/${encodeURIComponent(collection)}/${encodeURIComponent(key)}`,
|
|
1606
1671
|
{ value, expected_version: expectedVersion }
|
|
@@ -1632,7 +1697,7 @@ var AppDocuments = class {
|
|
|
1632
1697
|
);
|
|
1633
1698
|
}
|
|
1634
1699
|
async mintRuntimeToken(id) {
|
|
1635
|
-
return
|
|
1700
|
+
return unwrap9(
|
|
1636
1701
|
await this.http.post(
|
|
1637
1702
|
`/builder/apps/${encodeURIComponent(id)}/runtime-token`,
|
|
1638
1703
|
{}
|
|
@@ -1640,7 +1705,7 @@ var AppDocuments = class {
|
|
|
1640
1705
|
);
|
|
1641
1706
|
}
|
|
1642
1707
|
async resolveBinding(id, bindingId, receiptId, callbackToken) {
|
|
1643
|
-
return
|
|
1708
|
+
return unwrap9(
|
|
1644
1709
|
await this.http.request(
|
|
1645
1710
|
`/builder/apps/${encodeURIComponent(id)}/runtime/bindings/${encodeURIComponent(bindingId)}?receipt_id=${encodeURIComponent(receiptId)}`,
|
|
1646
1711
|
{
|
|
@@ -1659,7 +1724,7 @@ var AppDocuments = class {
|
|
|
1659
1724
|
return payload.data;
|
|
1660
1725
|
}
|
|
1661
1726
|
async startAutomationRun(id, automationId, trigger = {}) {
|
|
1662
|
-
return
|
|
1727
|
+
return unwrap9(
|
|
1663
1728
|
await this.http.post(
|
|
1664
1729
|
`/builder/apps/${encodeURIComponent(id)}/automations/${encodeURIComponent(automationId)}/runs`,
|
|
1665
1730
|
{ trigger }
|
|
@@ -1667,7 +1732,7 @@ var AppDocuments = class {
|
|
|
1667
1732
|
);
|
|
1668
1733
|
}
|
|
1669
1734
|
async claimAutomationStep(id, runId) {
|
|
1670
|
-
return
|
|
1735
|
+
return unwrap9(
|
|
1671
1736
|
await this.http.post(
|
|
1672
1737
|
`/builder/apps/${encodeURIComponent(id)}/automation-runs/${encodeURIComponent(runId)}/claim`,
|
|
1673
1738
|
{}
|
|
@@ -1675,7 +1740,7 @@ var AppDocuments = class {
|
|
|
1675
1740
|
);
|
|
1676
1741
|
}
|
|
1677
1742
|
async completeAutomationStep(id, runId, cursor, idempotencyKey11, output = null) {
|
|
1678
|
-
return
|
|
1743
|
+
return unwrap9(
|
|
1679
1744
|
await this.http.post(
|
|
1680
1745
|
`/builder/apps/${encodeURIComponent(id)}/automation-runs/${encodeURIComponent(runId)}/complete`,
|
|
1681
1746
|
{
|
|
@@ -1687,7 +1752,7 @@ var AppDocuments = class {
|
|
|
1687
1752
|
);
|
|
1688
1753
|
}
|
|
1689
1754
|
async failAutomationStep(id, runId, cursor, idempotencyKey11, reason) {
|
|
1690
|
-
return
|
|
1755
|
+
return unwrap9(
|
|
1691
1756
|
await this.http.post(
|
|
1692
1757
|
`/builder/apps/${encodeURIComponent(id)}/automation-runs/${encodeURIComponent(runId)}/fail`,
|
|
1693
1758
|
{
|
|
@@ -1707,7 +1772,7 @@ var AppDocuments = class {
|
|
|
1707
1772
|
};
|
|
1708
1773
|
|
|
1709
1774
|
// src/resources/audit-log.ts
|
|
1710
|
-
function
|
|
1775
|
+
function unwrap10(payload) {
|
|
1711
1776
|
if (payload && typeof payload === "object") {
|
|
1712
1777
|
const p = payload;
|
|
1713
1778
|
for (const k of ["data", "audit_log", "events", "items"]) {
|
|
@@ -1730,14 +1795,14 @@ var AuditLog = class {
|
|
|
1730
1795
|
async list(params = {}) {
|
|
1731
1796
|
const query3 = stripUndefined7(params);
|
|
1732
1797
|
const data = await this.http.get("/audit-log", query3);
|
|
1733
|
-
const result =
|
|
1798
|
+
const result = unwrap10(data);
|
|
1734
1799
|
if (Array.isArray(result)) return result;
|
|
1735
1800
|
return [];
|
|
1736
1801
|
}
|
|
1737
1802
|
};
|
|
1738
1803
|
|
|
1739
1804
|
// src/resources/benchmarks.ts
|
|
1740
|
-
function
|
|
1805
|
+
function unwrap11(data) {
|
|
1741
1806
|
if (data && typeof data === "object") {
|
|
1742
1807
|
const d = data;
|
|
1743
1808
|
for (const k of ["data", "benchmarks", "samples", "items"]) {
|
|
@@ -1769,7 +1834,7 @@ var Benchmarks = class {
|
|
|
1769
1834
|
return unwrapList(data);
|
|
1770
1835
|
}
|
|
1771
1836
|
async get(benchmarkId) {
|
|
1772
|
-
return
|
|
1837
|
+
return unwrap11(
|
|
1773
1838
|
await this.http.get(`/admin/benchmarks/${benchmarkId}`)
|
|
1774
1839
|
);
|
|
1775
1840
|
}
|
|
@@ -1778,10 +1843,10 @@ var Benchmarks = class {
|
|
|
1778
1843
|
const body5 = Object.fromEntries(
|
|
1779
1844
|
Object.entries(params).filter(([, v]) => v !== void 0)
|
|
1780
1845
|
);
|
|
1781
|
-
return
|
|
1846
|
+
return unwrap11(await this.http.post("/admin/benchmarks", body5));
|
|
1782
1847
|
}
|
|
1783
1848
|
async cancel(benchmarkId) {
|
|
1784
|
-
return
|
|
1849
|
+
return unwrap11(
|
|
1785
1850
|
await this.http.post(`/admin/benchmarks/${benchmarkId}/cancel`)
|
|
1786
1851
|
);
|
|
1787
1852
|
}
|
|
@@ -1801,14 +1866,14 @@ var Benchmarks = class {
|
|
|
1801
1866
|
const body5 = Object.fromEntries(
|
|
1802
1867
|
Object.entries(params).filter(([, v]) => v !== void 0)
|
|
1803
1868
|
);
|
|
1804
|
-
return
|
|
1869
|
+
return unwrap11(
|
|
1805
1870
|
await this.http.post("/admin/benchmarks/compare", body5)
|
|
1806
1871
|
);
|
|
1807
1872
|
}
|
|
1808
1873
|
};
|
|
1809
1874
|
|
|
1810
1875
|
// src/resources/builder-sessions.ts
|
|
1811
|
-
function
|
|
1876
|
+
function unwrap12(data) {
|
|
1812
1877
|
if (data && typeof data === "object") {
|
|
1813
1878
|
const d = data;
|
|
1814
1879
|
for (const k of ["data", "sessions", "items"]) {
|
|
@@ -1845,7 +1910,7 @@ var BuilderSessions = class {
|
|
|
1845
1910
|
return all.find((s) => s.id === sessionId) ?? {};
|
|
1846
1911
|
}
|
|
1847
1912
|
async updateTitle(sessionId, title) {
|
|
1848
|
-
return
|
|
1913
|
+
return unwrap12(
|
|
1849
1914
|
await this.http.patch(`/builder/sessions/${sessionId}/title`, {
|
|
1850
1915
|
title
|
|
1851
1916
|
})
|
|
@@ -1857,7 +1922,7 @@ var BuilderSessions = class {
|
|
|
1857
1922
|
};
|
|
1858
1923
|
|
|
1859
1924
|
// src/resources/channels.ts
|
|
1860
|
-
function
|
|
1925
|
+
function unwrap13(payload) {
|
|
1861
1926
|
if (payload && typeof payload === "object") {
|
|
1862
1927
|
const p = payload;
|
|
1863
1928
|
for (const k of ["data", "channels", "notifications", "items"]) {
|
|
@@ -1885,26 +1950,26 @@ var Channels = class {
|
|
|
1885
1950
|
async list(params = {}) {
|
|
1886
1951
|
const query3 = stripUndefined8(params);
|
|
1887
1952
|
const data = await this.http.get("/channels", query3);
|
|
1888
|
-
const result =
|
|
1953
|
+
const result = unwrap13(data);
|
|
1889
1954
|
if (Array.isArray(result)) return result;
|
|
1890
1955
|
return [];
|
|
1891
1956
|
}
|
|
1892
1957
|
/** Get a single channel. */
|
|
1893
1958
|
async get(channelId) {
|
|
1894
1959
|
const data = await this.http.get(`/channels/${channelId}`);
|
|
1895
|
-
return
|
|
1960
|
+
return unwrap13(data);
|
|
1896
1961
|
}
|
|
1897
1962
|
/** Create a new channel. */
|
|
1898
1963
|
async create(params) {
|
|
1899
1964
|
const body5 = stripUndefObj(params);
|
|
1900
1965
|
const data = await this.http.post("/channels", body5);
|
|
1901
|
-
return
|
|
1966
|
+
return unwrap13(data);
|
|
1902
1967
|
}
|
|
1903
1968
|
/** Update a channel. */
|
|
1904
1969
|
async update(channelId, params) {
|
|
1905
1970
|
const body5 = stripUndefObj(params);
|
|
1906
1971
|
const data = await this.http.patch(`/channels/${channelId}`, body5);
|
|
1907
|
-
return
|
|
1972
|
+
return unwrap13(data);
|
|
1908
1973
|
}
|
|
1909
1974
|
/** Delete a channel. */
|
|
1910
1975
|
async delete(channelId) {
|
|
@@ -1914,30 +1979,30 @@ var Channels = class {
|
|
|
1914
1979
|
/** Get notification preferences across all channels. */
|
|
1915
1980
|
async listNotifications() {
|
|
1916
1981
|
const data = await this.http.get("/channels/notifications");
|
|
1917
|
-
return
|
|
1982
|
+
return unwrap13(data);
|
|
1918
1983
|
}
|
|
1919
1984
|
/** Update notification preferences. */
|
|
1920
1985
|
async updateNotifications(params) {
|
|
1921
1986
|
const body5 = stripUndefObj(params);
|
|
1922
1987
|
const data = await this.http.put("/channels/notifications", body5);
|
|
1923
|
-
return
|
|
1988
|
+
return unwrap13(data);
|
|
1924
1989
|
}
|
|
1925
1990
|
/** Enable a channel. */
|
|
1926
1991
|
async enable(channelId) {
|
|
1927
1992
|
const data = await this.http.post(`/channels/${channelId}/enable`);
|
|
1928
|
-
return
|
|
1993
|
+
return unwrap13(data);
|
|
1929
1994
|
}
|
|
1930
1995
|
/** Disable a channel. */
|
|
1931
1996
|
async disable(channelId) {
|
|
1932
1997
|
const data = await this.http.post(
|
|
1933
1998
|
`/channels/${channelId}/disable`
|
|
1934
1999
|
);
|
|
1935
|
-
return
|
|
2000
|
+
return unwrap13(data);
|
|
1936
2001
|
}
|
|
1937
2002
|
};
|
|
1938
2003
|
|
|
1939
2004
|
// src/resources/cloud.ts
|
|
1940
|
-
function
|
|
2005
|
+
function unwrap14(payload) {
|
|
1941
2006
|
if (payload !== null && typeof payload === "object" && "data" in payload && payload.data !== void 0) {
|
|
1942
2007
|
return payload.data;
|
|
1943
2008
|
}
|
|
@@ -2012,12 +2077,12 @@ var Cloud = class {
|
|
|
2012
2077
|
}
|
|
2013
2078
|
http;
|
|
2014
2079
|
async listAccounts() {
|
|
2015
|
-
return
|
|
2080
|
+
return unwrap14(
|
|
2016
2081
|
await this.http.get("/cloud/accounts")
|
|
2017
2082
|
);
|
|
2018
2083
|
}
|
|
2019
2084
|
async createAccount(params) {
|
|
2020
|
-
return
|
|
2085
|
+
return unwrap14(
|
|
2021
2086
|
await this.http.post(
|
|
2022
2087
|
"/cloud/accounts",
|
|
2023
2088
|
accountBody(params)
|
|
@@ -2025,7 +2090,7 @@ var Cloud = class {
|
|
|
2025
2090
|
);
|
|
2026
2091
|
}
|
|
2027
2092
|
async attachAwsRole(id, params) {
|
|
2028
|
-
return
|
|
2093
|
+
return unwrap14(
|
|
2029
2094
|
await this.http.post(
|
|
2030
2095
|
`/cloud/accounts/${encodeURIComponent(id)}/aws/role`,
|
|
2031
2096
|
stripUndefined9({
|
|
@@ -2036,7 +2101,7 @@ var Cloud = class {
|
|
|
2036
2101
|
);
|
|
2037
2102
|
}
|
|
2038
2103
|
async listRegions(params = {}) {
|
|
2039
|
-
return
|
|
2104
|
+
return unwrap14(
|
|
2040
2105
|
await this.http.get(
|
|
2041
2106
|
"/cloud/regions",
|
|
2042
2107
|
query(params)
|
|
@@ -2044,7 +2109,7 @@ var Cloud = class {
|
|
|
2044
2109
|
);
|
|
2045
2110
|
}
|
|
2046
2111
|
async createRegion(params) {
|
|
2047
|
-
return
|
|
2112
|
+
return unwrap14(
|
|
2048
2113
|
await this.http.post(
|
|
2049
2114
|
"/cloud/regions",
|
|
2050
2115
|
regionBody(params)
|
|
@@ -2052,12 +2117,12 @@ var Cloud = class {
|
|
|
2052
2117
|
);
|
|
2053
2118
|
}
|
|
2054
2119
|
async listPools(params = {}) {
|
|
2055
|
-
return
|
|
2120
|
+
return unwrap14(
|
|
2056
2121
|
await this.http.get("/cloud/pools", query(params))
|
|
2057
2122
|
);
|
|
2058
2123
|
}
|
|
2059
2124
|
async createPool(params) {
|
|
2060
|
-
return
|
|
2125
|
+
return unwrap14(
|
|
2061
2126
|
await this.http.post(
|
|
2062
2127
|
"/cloud/pools",
|
|
2063
2128
|
poolBody(params)
|
|
@@ -2065,7 +2130,7 @@ var Cloud = class {
|
|
|
2065
2130
|
);
|
|
2066
2131
|
}
|
|
2067
2132
|
async listPreflights(params = {}) {
|
|
2068
|
-
return
|
|
2133
|
+
return unwrap14(
|
|
2069
2134
|
await this.http.get(
|
|
2070
2135
|
"/cloud/preflights",
|
|
2071
2136
|
query(params)
|
|
@@ -2073,7 +2138,7 @@ var Cloud = class {
|
|
|
2073
2138
|
);
|
|
2074
2139
|
}
|
|
2075
2140
|
async recordPreflight(params) {
|
|
2076
|
-
return
|
|
2141
|
+
return unwrap14(
|
|
2077
2142
|
await this.http.post(
|
|
2078
2143
|
"/cloud/preflights",
|
|
2079
2144
|
preflightBody(params)
|
|
@@ -2083,7 +2148,7 @@ var Cloud = class {
|
|
|
2083
2148
|
};
|
|
2084
2149
|
|
|
2085
2150
|
// src/resources/command-center.ts
|
|
2086
|
-
function
|
|
2151
|
+
function unwrap15(data) {
|
|
2087
2152
|
if (data && typeof data === "object") {
|
|
2088
2153
|
const d = data;
|
|
2089
2154
|
for (const k of [
|
|
@@ -2117,7 +2182,7 @@ var CommandCenter = class {
|
|
|
2117
2182
|
http;
|
|
2118
2183
|
/** Top-level snapshot (GET /command-center). */
|
|
2119
2184
|
async overview() {
|
|
2120
|
-
return
|
|
2185
|
+
return unwrap15(await this.http.get("/command-center"));
|
|
2121
2186
|
}
|
|
2122
2187
|
async agents() {
|
|
2123
2188
|
return unwrapList3(await this.http.get("/command-center/agents"));
|
|
@@ -2128,13 +2193,13 @@ var CommandCenter = class {
|
|
|
2128
2193
|
);
|
|
2129
2194
|
}
|
|
2130
2195
|
async metrics() {
|
|
2131
|
-
return
|
|
2196
|
+
return unwrap15(await this.http.get("/command-center/metrics"));
|
|
2132
2197
|
}
|
|
2133
2198
|
async presets() {
|
|
2134
2199
|
return unwrapList3(await this.http.get("/command-center/presets"));
|
|
2135
2200
|
}
|
|
2136
2201
|
async tiers() {
|
|
2137
|
-
return
|
|
2202
|
+
return unwrap15(await this.http.get("/command-center/tiers"));
|
|
2138
2203
|
}
|
|
2139
2204
|
/** Stream live command-center events via SSE. */
|
|
2140
2205
|
events() {
|
|
@@ -2143,7 +2208,7 @@ var CommandCenter = class {
|
|
|
2143
2208
|
};
|
|
2144
2209
|
|
|
2145
2210
|
// src/resources/community.ts
|
|
2146
|
-
function
|
|
2211
|
+
function unwrap16(data) {
|
|
2147
2212
|
if (data && typeof data === "object") {
|
|
2148
2213
|
const d = data;
|
|
2149
2214
|
for (const k of ["data", "templates", "agents", "items"]) {
|
|
@@ -2175,7 +2240,7 @@ var Community = class {
|
|
|
2175
2240
|
return unwrapList4(await this.http.get("/community/agents", query3));
|
|
2176
2241
|
}
|
|
2177
2242
|
async getAgent(agentId) {
|
|
2178
|
-
return
|
|
2243
|
+
return unwrap16(await this.http.get(`/community/agents/${agentId}`));
|
|
2179
2244
|
}
|
|
2180
2245
|
// ── Templates ─────────────────────────────────────────────────────────
|
|
2181
2246
|
async listTemplates(filters = {}) {
|
|
@@ -2187,7 +2252,7 @@ var Community = class {
|
|
|
2187
2252
|
);
|
|
2188
2253
|
}
|
|
2189
2254
|
async getTemplate(templateId) {
|
|
2190
|
-
return
|
|
2255
|
+
return unwrap16(
|
|
2191
2256
|
await this.http.get(`/community/templates/${templateId}`)
|
|
2192
2257
|
);
|
|
2193
2258
|
}
|
|
@@ -2196,7 +2261,7 @@ var Community = class {
|
|
|
2196
2261
|
const body5 = Object.fromEntries(
|
|
2197
2262
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
2198
2263
|
);
|
|
2199
|
-
return
|
|
2264
|
+
return unwrap16(
|
|
2200
2265
|
await this.http.post(
|
|
2201
2266
|
`/community/templates/${templateId}/install`,
|
|
2202
2267
|
body5
|
|
@@ -2211,7 +2276,7 @@ var Community = class {
|
|
|
2211
2276
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
2212
2277
|
)
|
|
2213
2278
|
};
|
|
2214
|
-
return
|
|
2279
|
+
return unwrap16(
|
|
2215
2280
|
await this.http.post(
|
|
2216
2281
|
`/community/templates/${templateId}/rate`,
|
|
2217
2282
|
body5
|
|
@@ -2221,7 +2286,7 @@ var Community = class {
|
|
|
2221
2286
|
};
|
|
2222
2287
|
|
|
2223
2288
|
// src/resources/completions.ts
|
|
2224
|
-
function
|
|
2289
|
+
function unwrap17(data) {
|
|
2225
2290
|
if (data && typeof data === "object") {
|
|
2226
2291
|
const d = data;
|
|
2227
2292
|
if (Array.isArray(d.choices)) return d;
|
|
@@ -2247,7 +2312,7 @@ var Completions = class {
|
|
|
2247
2312
|
{ method: "POST", body: body5 }
|
|
2248
2313
|
);
|
|
2249
2314
|
}
|
|
2250
|
-
return this.http.post("/intelligence/completions", body5).then(
|
|
2315
|
+
return this.http.post("/intelligence/completions", body5).then(unwrap17);
|
|
2251
2316
|
}
|
|
2252
2317
|
chat(params) {
|
|
2253
2318
|
const body5 = buildBody(params);
|
|
@@ -2257,7 +2322,7 @@ var Completions = class {
|
|
|
2257
2322
|
{ method: "POST", body: body5 }
|
|
2258
2323
|
);
|
|
2259
2324
|
}
|
|
2260
|
-
return this.http.post("/intelligence/chat/completions", body5).then(
|
|
2325
|
+
return this.http.post("/intelligence/chat/completions", body5).then(unwrap17);
|
|
2261
2326
|
}
|
|
2262
2327
|
};
|
|
2263
2328
|
|
|
@@ -2380,7 +2445,7 @@ var Checkpoints = class {
|
|
|
2380
2445
|
};
|
|
2381
2446
|
|
|
2382
2447
|
// src/resources/computer-auto-stop.ts
|
|
2383
|
-
function
|
|
2448
|
+
function unwrap18(data) {
|
|
2384
2449
|
if (data && typeof data === "object") {
|
|
2385
2450
|
const d = data;
|
|
2386
2451
|
if ("data" in d && Object.keys(d).length <= 2) {
|
|
@@ -2398,13 +2463,13 @@ var ComputerAutoStop = class {
|
|
|
2398
2463
|
computerId;
|
|
2399
2464
|
/** Return the current auto-stop configuration. */
|
|
2400
2465
|
async get() {
|
|
2401
|
-
return
|
|
2466
|
+
return unwrap18(
|
|
2402
2467
|
await this.http.get(`/computers/${this.computerId}/auto-stop`)
|
|
2403
2468
|
);
|
|
2404
2469
|
}
|
|
2405
2470
|
/** Set the idle timeout in seconds (0 disables auto-stop). */
|
|
2406
2471
|
async update(seconds) {
|
|
2407
|
-
return
|
|
2472
|
+
return unwrap18(
|
|
2408
2473
|
await this.http.patch(
|
|
2409
2474
|
`/computers/${this.computerId}/auto-stop`,
|
|
2410
2475
|
{ seconds }
|
|
@@ -2414,7 +2479,7 @@ var ComputerAutoStop = class {
|
|
|
2414
2479
|
};
|
|
2415
2480
|
|
|
2416
2481
|
// src/resources/computer-env.ts
|
|
2417
|
-
function
|
|
2482
|
+
function unwrap19(data) {
|
|
2418
2483
|
if (data && typeof data === "object") {
|
|
2419
2484
|
const d = data;
|
|
2420
2485
|
if ("data" in d && Object.keys(d).length <= 2) {
|
|
@@ -2449,11 +2514,11 @@ var ComputerEnv = class {
|
|
|
2449
2514
|
}
|
|
2450
2515
|
/** Create a new env var. Use update() to change an existing one. */
|
|
2451
2516
|
async set(name, value) {
|
|
2452
|
-
return
|
|
2517
|
+
return unwrap19(await this.http.post(this.base(), { name, value }));
|
|
2453
2518
|
}
|
|
2454
2519
|
/** Patch the value of an existing env var by name. */
|
|
2455
2520
|
async update(name, value) {
|
|
2456
|
-
return
|
|
2521
|
+
return unwrap19(
|
|
2457
2522
|
await this.http.patch(`${this.base()}/${name}`, { value })
|
|
2458
2523
|
);
|
|
2459
2524
|
}
|
|
@@ -2470,7 +2535,7 @@ var ComputerEnv = class {
|
|
|
2470
2535
|
};
|
|
2471
2536
|
|
|
2472
2537
|
// src/resources/computer-logs.ts
|
|
2473
|
-
function
|
|
2538
|
+
function unwrap20(data) {
|
|
2474
2539
|
if (data && typeof data === "object") {
|
|
2475
2540
|
const d = data;
|
|
2476
2541
|
if ("data" in d && Object.keys(d).length <= 2) {
|
|
@@ -2491,7 +2556,7 @@ var ComputerLogs = class {
|
|
|
2491
2556
|
const query3 = Object.fromEntries(
|
|
2492
2557
|
Object.entries(params).filter(([, v]) => v !== void 0)
|
|
2493
2558
|
);
|
|
2494
|
-
return
|
|
2559
|
+
return unwrap20(
|
|
2495
2560
|
await this.http.get(`/computers/${this.computerId}/logs`, query3)
|
|
2496
2561
|
);
|
|
2497
2562
|
}
|
|
@@ -2504,7 +2569,7 @@ var ComputerLogs = class {
|
|
|
2504
2569
|
};
|
|
2505
2570
|
|
|
2506
2571
|
// src/resources/computer-osa.ts
|
|
2507
|
-
function
|
|
2572
|
+
function unwrap21(data) {
|
|
2508
2573
|
if (data && typeof data === "object") {
|
|
2509
2574
|
const d = data;
|
|
2510
2575
|
if ("data" in d && Object.keys(d).length <= 2) {
|
|
@@ -2528,7 +2593,7 @@ var ComputerOsa = class {
|
|
|
2528
2593
|
Object.entries(params).filter(([, v]) => v !== void 0)
|
|
2529
2594
|
)
|
|
2530
2595
|
};
|
|
2531
|
-
return
|
|
2596
|
+
return unwrap21(
|
|
2532
2597
|
await this.http.post(
|
|
2533
2598
|
`/computers/${this.computerId}/osa/task`,
|
|
2534
2599
|
body5
|
|
@@ -2537,13 +2602,13 @@ var ComputerOsa = class {
|
|
|
2537
2602
|
}
|
|
2538
2603
|
/** Cancel the currently-running OSA task, if any. */
|
|
2539
2604
|
async cancelTask() {
|
|
2540
|
-
return
|
|
2605
|
+
return unwrap21(
|
|
2541
2606
|
await this.http.delete(`/computers/${this.computerId}/osa/task`)
|
|
2542
2607
|
);
|
|
2543
2608
|
}
|
|
2544
2609
|
/** Return OSA's current task / configuration / health snapshot. */
|
|
2545
2610
|
async status() {
|
|
2546
|
-
return
|
|
2611
|
+
return unwrap21(
|
|
2547
2612
|
await this.http.get(`/computers/${this.computerId}/osa/status`)
|
|
2548
2613
|
);
|
|
2549
2614
|
}
|
|
@@ -2552,7 +2617,7 @@ var ComputerOsa = class {
|
|
|
2552
2617
|
const body5 = Object.fromEntries(
|
|
2553
2618
|
Object.entries(config).filter(([, v]) => v !== void 0)
|
|
2554
2619
|
);
|
|
2555
|
-
return
|
|
2620
|
+
return unwrap21(
|
|
2556
2621
|
await this.http.post(
|
|
2557
2622
|
`/computers/${this.computerId}/osa/configure`,
|
|
2558
2623
|
body5
|
|
@@ -2562,7 +2627,7 @@ var ComputerOsa = class {
|
|
|
2562
2627
|
};
|
|
2563
2628
|
|
|
2564
2629
|
// src/resources/computer-ports.ts
|
|
2565
|
-
function
|
|
2630
|
+
function unwrap22(data) {
|
|
2566
2631
|
if (data && typeof data === "object") {
|
|
2567
2632
|
const d = data;
|
|
2568
2633
|
if ("data" in d && Object.keys(d).length <= 2) {
|
|
@@ -2607,14 +2672,14 @@ var ComputerPorts = class {
|
|
|
2607
2672
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
2608
2673
|
)
|
|
2609
2674
|
};
|
|
2610
|
-
return
|
|
2675
|
+
return unwrap22(await this.http.post(this.base(), body5));
|
|
2611
2676
|
}
|
|
2612
2677
|
/** Patch visibility / auth options for port. */
|
|
2613
2678
|
async update(port, opts) {
|
|
2614
2679
|
const body5 = Object.fromEntries(
|
|
2615
2680
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
2616
2681
|
);
|
|
2617
|
-
return
|
|
2682
|
+
return unwrap22(
|
|
2618
2683
|
await this.http.patch(`${this.base()}/${port}`, body5)
|
|
2619
2684
|
);
|
|
2620
2685
|
}
|
|
@@ -2641,7 +2706,7 @@ var ComputerTerminal = class {
|
|
|
2641
2706
|
`/computers/${this.computerId}/terminal`,
|
|
2642
2707
|
body5
|
|
2643
2708
|
);
|
|
2644
|
-
return
|
|
2709
|
+
return unwrap23(raw);
|
|
2645
2710
|
}
|
|
2646
2711
|
/** Resize an existing PTY session. */
|
|
2647
2712
|
async resize(sessionId, cols, rows) {
|
|
@@ -2649,10 +2714,10 @@ var ComputerTerminal = class {
|
|
|
2649
2714
|
`/computers/${this.computerId}/pty/${sessionId}/resize`,
|
|
2650
2715
|
{ cols, rows }
|
|
2651
2716
|
);
|
|
2652
|
-
return
|
|
2717
|
+
return unwrap23(raw);
|
|
2653
2718
|
}
|
|
2654
2719
|
};
|
|
2655
|
-
function
|
|
2720
|
+
function unwrap23(data) {
|
|
2656
2721
|
if (data && typeof data === "object") {
|
|
2657
2722
|
const d = data;
|
|
2658
2723
|
if ("data" in d && Object.keys(d).length <= 2) {
|
|
@@ -2663,7 +2728,7 @@ function unwrap22(data) {
|
|
|
2663
2728
|
}
|
|
2664
2729
|
|
|
2665
2730
|
// src/resources/computer-volumes.ts
|
|
2666
|
-
function
|
|
2731
|
+
function unwrap24(data) {
|
|
2667
2732
|
if (data && typeof data === "object") {
|
|
2668
2733
|
const d = data;
|
|
2669
2734
|
if ("data" in d && Object.keys(d).length <= 2) {
|
|
@@ -2697,7 +2762,7 @@ var ComputerVolumes = class {
|
|
|
2697
2762
|
}
|
|
2698
2763
|
/** Attach volumeId at mountPath inside the VM. */
|
|
2699
2764
|
async attach(volumeId, mountPath) {
|
|
2700
|
-
return
|
|
2765
|
+
return unwrap24(
|
|
2701
2766
|
await this.http.post(this.base(), {
|
|
2702
2767
|
volume_id: volumeId,
|
|
2703
2768
|
mount_path: mountPath
|
|
@@ -2711,7 +2776,7 @@ var ComputerVolumes = class {
|
|
|
2711
2776
|
};
|
|
2712
2777
|
|
|
2713
2778
|
// src/resources/connectors.ts
|
|
2714
|
-
function
|
|
2779
|
+
function unwrap25(payload) {
|
|
2715
2780
|
if (payload && typeof payload === "object") {
|
|
2716
2781
|
const p = payload;
|
|
2717
2782
|
for (const key of ["data", "binding"]) {
|
|
@@ -2922,7 +2987,7 @@ var Connectors = class {
|
|
|
2922
2987
|
const data = await this.http.get(
|
|
2923
2988
|
`/connect/connectors/${connectorPath(connector)}`
|
|
2924
2989
|
);
|
|
2925
|
-
return
|
|
2990
|
+
return unwrap25(data);
|
|
2926
2991
|
}
|
|
2927
2992
|
show(connector) {
|
|
2928
2993
|
return this.get(connector);
|
|
@@ -2933,7 +2998,7 @@ var Connectors = class {
|
|
|
2933
2998
|
"/connect/connectors",
|
|
2934
2999
|
bodyFromCreateParams(provider, params)
|
|
2935
3000
|
);
|
|
2936
|
-
return
|
|
3001
|
+
return unwrap25(data);
|
|
2937
3002
|
}
|
|
2938
3003
|
/** Request a runtime provider token for a connector. */
|
|
2939
3004
|
async getToken(connector, params = {}) {
|
|
@@ -2941,7 +3006,7 @@ var Connectors = class {
|
|
|
2941
3006
|
`/connect/token/${connectorPath(connector)}`,
|
|
2942
3007
|
tokenBody(params)
|
|
2943
3008
|
);
|
|
2944
|
-
return
|
|
3009
|
+
return unwrap25(data);
|
|
2945
3010
|
}
|
|
2946
3011
|
token(connector, params = {}) {
|
|
2947
3012
|
return this.getToken(connector, params);
|
|
@@ -2963,7 +3028,7 @@ var Connectors = class {
|
|
|
2963
3028
|
...externalAttributionParams(params)
|
|
2964
3029
|
})
|
|
2965
3030
|
);
|
|
2966
|
-
return
|
|
3031
|
+
return unwrap25(data);
|
|
2967
3032
|
}
|
|
2968
3033
|
/** List connector installations/grants. */
|
|
2969
3034
|
async installations(params = {}) {
|
|
@@ -3003,7 +3068,7 @@ var Connectors = class {
|
|
|
3003
3068
|
"/connect/defaults/materialize",
|
|
3004
3069
|
materializeDefaultsBody(params)
|
|
3005
3070
|
);
|
|
3006
|
-
return
|
|
3071
|
+
return unwrap25(data);
|
|
3007
3072
|
}
|
|
3008
3073
|
/** Create an inherited connector default for future runtime resources. */
|
|
3009
3074
|
async createDefault(params) {
|
|
@@ -3011,7 +3076,7 @@ var Connectors = class {
|
|
|
3011
3076
|
"/connect/defaults",
|
|
3012
3077
|
defaultBody(params)
|
|
3013
3078
|
);
|
|
3014
|
-
return
|
|
3079
|
+
return unwrap25(data);
|
|
3015
3080
|
}
|
|
3016
3081
|
/** Delete an inherited connector default. */
|
|
3017
3082
|
async deleteDefault(id) {
|
|
@@ -3031,7 +3096,7 @@ var Connectors = class {
|
|
|
3031
3096
|
"/connect/triggers",
|
|
3032
3097
|
triggerBody(params)
|
|
3033
3098
|
);
|
|
3034
|
-
return
|
|
3099
|
+
return unwrap25(data);
|
|
3035
3100
|
}
|
|
3036
3101
|
/** List inbound provider trigger delivery attempts. */
|
|
3037
3102
|
async triggerDeliveries(params = {}) {
|
|
@@ -3058,7 +3123,7 @@ var Connectors = class {
|
|
|
3058
3123
|
"/connect/project-links",
|
|
3059
3124
|
projectLinkBody(params)
|
|
3060
3125
|
);
|
|
3061
|
-
return
|
|
3126
|
+
return unwrap25(data);
|
|
3062
3127
|
}
|
|
3063
3128
|
/** Delete a project connector link. */
|
|
3064
3129
|
async deleteProjectLink(id) {
|
|
@@ -3094,7 +3159,7 @@ var RuntimeConnectors = class {
|
|
|
3094
3159
|
...externalAttributionParams(params)
|
|
3095
3160
|
})
|
|
3096
3161
|
);
|
|
3097
|
-
return
|
|
3162
|
+
return unwrap25(data);
|
|
3098
3163
|
}
|
|
3099
3164
|
/** Detach a connector binding by binding id or connector UID. */
|
|
3100
3165
|
async detach(bindingOrConnector) {
|
|
@@ -3103,7 +3168,7 @@ var RuntimeConnectors = class {
|
|
|
3103
3168
|
/** Sync or materialize connector placeholder env vars for this runtime resource. */
|
|
3104
3169
|
async sync() {
|
|
3105
3170
|
const data = await this.http.post(`${this.basePath}/sync`, {});
|
|
3106
|
-
return
|
|
3171
|
+
return unwrap25(data);
|
|
3107
3172
|
}
|
|
3108
3173
|
/** Verify a required connector is attached before agent work begins. */
|
|
3109
3174
|
async preflight(params = {}) {
|
|
@@ -3111,7 +3176,7 @@ var RuntimeConnectors = class {
|
|
|
3111
3176
|
`${this.basePath}/preflight`,
|
|
3112
3177
|
stripUndefined10(params)
|
|
3113
3178
|
);
|
|
3114
|
-
return
|
|
3179
|
+
return unwrap25(data);
|
|
3115
3180
|
}
|
|
3116
3181
|
};
|
|
3117
3182
|
var SandboxConnectors = class extends RuntimeConnectors {
|
|
@@ -3314,7 +3379,7 @@ var Desktop = class {
|
|
|
3314
3379
|
};
|
|
3315
3380
|
|
|
3316
3381
|
// src/resources/egressAudit.ts
|
|
3317
|
-
function
|
|
3382
|
+
function unwrap26(payload) {
|
|
3318
3383
|
if (payload && typeof payload === "object") {
|
|
3319
3384
|
const p = payload;
|
|
3320
3385
|
for (const k of ["data", "event", "items"]) {
|
|
@@ -3380,7 +3445,7 @@ var EgressAudit = class {
|
|
|
3380
3445
|
const data = await this.http.get(
|
|
3381
3446
|
`/egress/audit/${id}`
|
|
3382
3447
|
);
|
|
3383
|
-
return
|
|
3448
|
+
return unwrap26(data);
|
|
3384
3449
|
}
|
|
3385
3450
|
/**
|
|
3386
3451
|
* Long-poll the audit endpoint and yield new events as they appear.
|
|
@@ -3456,7 +3521,7 @@ var ComputerAudit = class extends SandboxAudit {
|
|
|
3456
3521
|
};
|
|
3457
3522
|
|
|
3458
3523
|
// src/resources/egressNetwork.ts
|
|
3459
|
-
function
|
|
3524
|
+
function unwrap27(payload) {
|
|
3460
3525
|
if (payload && typeof payload === "object") {
|
|
3461
3526
|
const p = payload;
|
|
3462
3527
|
for (const k of ["data", "policy", "rule", "items"]) {
|
|
@@ -3515,7 +3580,7 @@ var EgressNetwork = class {
|
|
|
3515
3580
|
"/egress/allowlist",
|
|
3516
3581
|
ruleBody(host, params, "allow")
|
|
3517
3582
|
);
|
|
3518
|
-
return
|
|
3583
|
+
return unwrap27(data);
|
|
3519
3584
|
}
|
|
3520
3585
|
/** Add a `deny` rule for `host` to the allowlist. */
|
|
3521
3586
|
async deny(host, params = {}) {
|
|
@@ -3523,7 +3588,7 @@ var EgressNetwork = class {
|
|
|
3523
3588
|
"/egress/allowlist",
|
|
3524
3589
|
ruleBody(host, params, "deny")
|
|
3525
3590
|
);
|
|
3526
|
-
return
|
|
3591
|
+
return unwrap27(data);
|
|
3527
3592
|
}
|
|
3528
3593
|
/** List allowlist rules. */
|
|
3529
3594
|
async rules(params = {}) {
|
|
@@ -3567,7 +3632,7 @@ var EgressNetwork = class {
|
|
|
3567
3632
|
"/egress/policies",
|
|
3568
3633
|
body5
|
|
3569
3634
|
);
|
|
3570
|
-
return
|
|
3635
|
+
return unwrap27(data);
|
|
3571
3636
|
}
|
|
3572
3637
|
/** Update an egress policy by id. */
|
|
3573
3638
|
async updatePolicy(policyId, params) {
|
|
@@ -3581,7 +3646,7 @@ var EgressNetwork = class {
|
|
|
3581
3646
|
`/egress/policies/${policyId}`,
|
|
3582
3647
|
body5
|
|
3583
3648
|
);
|
|
3584
|
-
return
|
|
3649
|
+
return unwrap27(data);
|
|
3585
3650
|
}
|
|
3586
3651
|
// ── mode helpers ──────────────────────────────────────────────────────────
|
|
3587
3652
|
/** Set the policy to `mode="enforce"` — denied egress is blocked. */
|
|
@@ -3608,7 +3673,7 @@ var EgressNetwork = class {
|
|
|
3608
3673
|
"/egress/policies",
|
|
3609
3674
|
body5
|
|
3610
3675
|
);
|
|
3611
|
-
return
|
|
3676
|
+
return unwrap27(data);
|
|
3612
3677
|
}
|
|
3613
3678
|
// ── suggestions ───────────────────────────────────────────────────────────
|
|
3614
3679
|
/** AI-generated allowlist suggestions from recent denied egress. */
|
|
@@ -3699,7 +3764,7 @@ var ComputerNetwork = class extends SandboxNetwork {
|
|
|
3699
3764
|
};
|
|
3700
3765
|
|
|
3701
3766
|
// src/resources/egressSecrets.ts
|
|
3702
|
-
function
|
|
3767
|
+
function unwrap28(payload) {
|
|
3703
3768
|
if (payload && typeof payload === "object") {
|
|
3704
3769
|
const p = payload;
|
|
3705
3770
|
for (const k of ["data", "secret", "binding", "items"]) {
|
|
@@ -3835,7 +3900,7 @@ var OAuthFlow = class {
|
|
|
3835
3900
|
const data = await this.http.get("/egress/oauth/status", {
|
|
3836
3901
|
state: this.state
|
|
3837
3902
|
});
|
|
3838
|
-
const payload =
|
|
3903
|
+
const payload = unwrap28(data) ?? {};
|
|
3839
3904
|
const status = payload.status;
|
|
3840
3905
|
if (status === "completed" || status === "ready" || status === "succeeded") {
|
|
3841
3906
|
return payload;
|
|
@@ -3867,7 +3932,7 @@ var EgressSecrets = class {
|
|
|
3867
3932
|
"/egress/secrets",
|
|
3868
3933
|
setBody(params)
|
|
3869
3934
|
);
|
|
3870
|
-
return
|
|
3935
|
+
return unwrap28(data);
|
|
3871
3936
|
}
|
|
3872
3937
|
/** List secrets. */
|
|
3873
3938
|
async list(params = {}) {
|
|
@@ -3882,7 +3947,7 @@ var EgressSecrets = class {
|
|
|
3882
3947
|
const data = await this.http.get(
|
|
3883
3948
|
`/egress/secrets/${id}`
|
|
3884
3949
|
);
|
|
3885
|
-
return
|
|
3950
|
+
return unwrap28(data);
|
|
3886
3951
|
}
|
|
3887
3952
|
/** Rotate the secret's value. */
|
|
3888
3953
|
async rotate(id, params) {
|
|
@@ -3891,7 +3956,7 @@ var EgressSecrets = class {
|
|
|
3891
3956
|
`/egress/secrets/${id}`,
|
|
3892
3957
|
body5
|
|
3893
3958
|
);
|
|
3894
|
-
return
|
|
3959
|
+
return unwrap28(data);
|
|
3895
3960
|
}
|
|
3896
3961
|
/** Delete a secret. */
|
|
3897
3962
|
async delete(id) {
|
|
@@ -3904,7 +3969,7 @@ var EgressSecrets = class {
|
|
|
3904
3969
|
"/egress/bindings",
|
|
3905
3970
|
bindingBody(params)
|
|
3906
3971
|
);
|
|
3907
|
-
return
|
|
3972
|
+
return unwrap28(data);
|
|
3908
3973
|
}
|
|
3909
3974
|
/** List secret bindings. */
|
|
3910
3975
|
async listBindings(params = {}) {
|
|
@@ -3937,7 +4002,7 @@ var EgressSecrets = class {
|
|
|
3937
4002
|
"/egress/oauth/start",
|
|
3938
4003
|
oauthBody(params)
|
|
3939
4004
|
);
|
|
3940
|
-
const payload =
|
|
4005
|
+
const payload = unwrap28(data) ?? {};
|
|
3941
4006
|
return new OAuthFlow(this.http, payload, params.provider);
|
|
3942
4007
|
}
|
|
3943
4008
|
};
|
|
@@ -5101,7 +5166,7 @@ var Credits = class {
|
|
|
5101
5166
|
return this.http.get("/credits/usage");
|
|
5102
5167
|
}
|
|
5103
5168
|
};
|
|
5104
|
-
function
|
|
5169
|
+
function unwrap29(payload) {
|
|
5105
5170
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
5106
5171
|
return payload.data;
|
|
5107
5172
|
}
|
|
@@ -5137,7 +5202,7 @@ var CronJobs = class {
|
|
|
5137
5202
|
}
|
|
5138
5203
|
async get(jobId) {
|
|
5139
5204
|
const data = await this.http.get(`/cron-jobs/${jobId}`);
|
|
5140
|
-
return
|
|
5205
|
+
return unwrap29(data);
|
|
5141
5206
|
}
|
|
5142
5207
|
async create(params) {
|
|
5143
5208
|
const { idempotencyKey: ikey, ...rest } = params;
|
|
@@ -5147,12 +5212,12 @@ var CronJobs = class {
|
|
|
5147
5212
|
body: body5,
|
|
5148
5213
|
headers: { "Idempotency-Key": idempotencyKey2(ikey) }
|
|
5149
5214
|
});
|
|
5150
|
-
return
|
|
5215
|
+
return unwrap29(data);
|
|
5151
5216
|
}
|
|
5152
5217
|
async update(jobId, params) {
|
|
5153
5218
|
const body5 = stripUndefined14(params);
|
|
5154
5219
|
const data = await this.http.patch(`/cron-jobs/${jobId}`, body5);
|
|
5155
|
-
return
|
|
5220
|
+
return unwrap29(data);
|
|
5156
5221
|
}
|
|
5157
5222
|
async delete(jobId) {
|
|
5158
5223
|
await this.http.delete(`/cron-jobs/${jobId}`);
|
|
@@ -5160,11 +5225,11 @@ var CronJobs = class {
|
|
|
5160
5225
|
// ── Control ────────────────────────────────────────────────────────────────
|
|
5161
5226
|
async pause(jobId) {
|
|
5162
5227
|
const data = await this.http.post(`/cron-jobs/${jobId}/pause`);
|
|
5163
|
-
return
|
|
5228
|
+
return unwrap29(data);
|
|
5164
5229
|
}
|
|
5165
5230
|
async resume(jobId) {
|
|
5166
5231
|
const data = await this.http.post(`/cron-jobs/${jobId}/resume`);
|
|
5167
|
-
return
|
|
5232
|
+
return unwrap29(data);
|
|
5168
5233
|
}
|
|
5169
5234
|
async runNow(jobId, opts = {}) {
|
|
5170
5235
|
const data = await this.http.request(
|
|
@@ -5174,7 +5239,7 @@ var CronJobs = class {
|
|
|
5174
5239
|
headers: { "Idempotency-Key": idempotencyKey2(opts.idempotencyKey) }
|
|
5175
5240
|
}
|
|
5176
5241
|
);
|
|
5177
|
-
return
|
|
5242
|
+
return unwrap29(data);
|
|
5178
5243
|
}
|
|
5179
5244
|
// ── Execution history ──────────────────────────────────────────────────────
|
|
5180
5245
|
async listExecutions(jobId) {
|
|
@@ -5189,12 +5254,12 @@ var CronJobs = class {
|
|
|
5189
5254
|
const data = await this.http.get(
|
|
5190
5255
|
`/cron-jobs/${jobId}/executions/${executionId}`
|
|
5191
5256
|
);
|
|
5192
|
-
return
|
|
5257
|
+
return unwrap29(data);
|
|
5193
5258
|
}
|
|
5194
5259
|
};
|
|
5195
5260
|
|
|
5196
5261
|
// src/resources/dashboard.ts
|
|
5197
|
-
function
|
|
5262
|
+
function unwrap30(payload) {
|
|
5198
5263
|
if (payload && typeof payload === "object") {
|
|
5199
5264
|
const p = payload;
|
|
5200
5265
|
for (const k of ["data", "dashboard", "overview", "items"]) {
|
|
@@ -5211,15 +5276,15 @@ var Dashboard = class {
|
|
|
5211
5276
|
/** Aggregated user dashboard payload. */
|
|
5212
5277
|
async summary() {
|
|
5213
5278
|
const data = await this.http.get("/dashboard");
|
|
5214
|
-
return
|
|
5279
|
+
return unwrap30(data);
|
|
5215
5280
|
}
|
|
5216
5281
|
/** Status / health overview (public endpoint). */
|
|
5217
5282
|
async overview() {
|
|
5218
5283
|
const data = await this.http.get("/overview");
|
|
5219
|
-
return
|
|
5284
|
+
return unwrap30(data);
|
|
5220
5285
|
}
|
|
5221
5286
|
};
|
|
5222
|
-
function
|
|
5287
|
+
function unwrap31(payload) {
|
|
5223
5288
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
5224
5289
|
return payload.data;
|
|
5225
5290
|
}
|
|
@@ -5255,7 +5320,7 @@ var Databases = class {
|
|
|
5255
5320
|
}
|
|
5256
5321
|
async get(databaseId) {
|
|
5257
5322
|
const data = await this.http.get(`/databases/${databaseId}`);
|
|
5258
|
-
return
|
|
5323
|
+
return unwrap31(data);
|
|
5259
5324
|
}
|
|
5260
5325
|
async create(params) {
|
|
5261
5326
|
const {
|
|
@@ -5279,7 +5344,7 @@ var Databases = class {
|
|
|
5279
5344
|
)
|
|
5280
5345
|
}
|
|
5281
5346
|
});
|
|
5282
|
-
return
|
|
5347
|
+
return unwrap31(data);
|
|
5283
5348
|
}
|
|
5284
5349
|
async delete(databaseId) {
|
|
5285
5350
|
await this.http.delete(`/databases/${databaseId}`);
|
|
@@ -5289,24 +5354,24 @@ var Databases = class {
|
|
|
5289
5354
|
const data = await this.http.post(
|
|
5290
5355
|
`/databases/${databaseId}/start`
|
|
5291
5356
|
);
|
|
5292
|
-
return
|
|
5357
|
+
return unwrap31(data);
|
|
5293
5358
|
}
|
|
5294
5359
|
async stop(databaseId) {
|
|
5295
5360
|
const data = await this.http.post(`/databases/${databaseId}/stop`);
|
|
5296
|
-
return
|
|
5361
|
+
return unwrap31(data);
|
|
5297
5362
|
}
|
|
5298
5363
|
async restart(databaseId) {
|
|
5299
5364
|
const data = await this.http.post(
|
|
5300
5365
|
`/databases/${databaseId}/restart`
|
|
5301
5366
|
);
|
|
5302
|
-
return
|
|
5367
|
+
return unwrap31(data);
|
|
5303
5368
|
}
|
|
5304
5369
|
// ── Credentials + logs ────────────────────────────────────────────────────
|
|
5305
5370
|
async credentials(databaseId) {
|
|
5306
5371
|
const data = await this.http.get(
|
|
5307
5372
|
`/databases/${databaseId}/credentials`
|
|
5308
5373
|
);
|
|
5309
|
-
return
|
|
5374
|
+
return unwrap31(data);
|
|
5310
5375
|
}
|
|
5311
5376
|
async logs(databaseId, params = {}) {
|
|
5312
5377
|
const query3 = stripUndefined15({
|
|
@@ -5336,7 +5401,7 @@ function attributionBody(p) {
|
|
|
5336
5401
|
function idempotencyKey4(key) {
|
|
5337
5402
|
return key ?? randomUUID();
|
|
5338
5403
|
}
|
|
5339
|
-
function
|
|
5404
|
+
function unwrap32(payload) {
|
|
5340
5405
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
5341
5406
|
return payload.data;
|
|
5342
5407
|
}
|
|
@@ -5445,7 +5510,7 @@ var DeploymentVersions = class {
|
|
|
5445
5510
|
const data = await this.http.get(
|
|
5446
5511
|
`/deployments/${this.deploymentId}/versions/${versionId}`
|
|
5447
5512
|
);
|
|
5448
|
-
return
|
|
5513
|
+
return unwrap32(data);
|
|
5449
5514
|
}
|
|
5450
5515
|
async promote(versionId, opts = {}) {
|
|
5451
5516
|
const body5 = stripUndefined16({ environment: opts.environment });
|
|
@@ -5457,14 +5522,14 @@ var DeploymentVersions = class {
|
|
|
5457
5522
|
headers: { "Idempotency-Key": idempotencyKey4(opts.idempotencyKey) }
|
|
5458
5523
|
}
|
|
5459
5524
|
);
|
|
5460
|
-
return
|
|
5525
|
+
return unwrap32(data);
|
|
5461
5526
|
}
|
|
5462
5527
|
async prepareMigrationBackup(versionId) {
|
|
5463
5528
|
const data = await this.http.request(
|
|
5464
5529
|
`/deployments/${this.deploymentId}/versions/${versionId}/migration-backup`,
|
|
5465
5530
|
{ method: "POST", body: {} }
|
|
5466
5531
|
);
|
|
5467
|
-
return
|
|
5532
|
+
return unwrap32(data);
|
|
5468
5533
|
}
|
|
5469
5534
|
};
|
|
5470
5535
|
var DeploymentReleases = class {
|
|
@@ -5484,7 +5549,7 @@ var DeploymentReleases = class {
|
|
|
5484
5549
|
const data = await this.http.get(
|
|
5485
5550
|
`/deployments/${this.deploymentId}/releases/${releaseId}`
|
|
5486
5551
|
);
|
|
5487
|
-
return
|
|
5552
|
+
return unwrap32(data);
|
|
5488
5553
|
}
|
|
5489
5554
|
async promote(releaseId, idempotencyKey11) {
|
|
5490
5555
|
const key = idempotencyKey11 ?? `promote:${this.deploymentId}:${releaseId}`;
|
|
@@ -5496,7 +5561,7 @@ var DeploymentReleases = class {
|
|
|
5496
5561
|
headers: { "Idempotency-Key": key }
|
|
5497
5562
|
}
|
|
5498
5563
|
);
|
|
5499
|
-
return
|
|
5564
|
+
return unwrap32(data);
|
|
5500
5565
|
}
|
|
5501
5566
|
};
|
|
5502
5567
|
var DeploymentRuntimeInstances = class {
|
|
@@ -5516,14 +5581,14 @@ var DeploymentRuntimeInstances = class {
|
|
|
5516
5581
|
const data = await this.http.get(
|
|
5517
5582
|
`/deployments/${this.deploymentId}/runtime-instances/${instanceId}`
|
|
5518
5583
|
);
|
|
5519
|
-
return
|
|
5584
|
+
return unwrap32(data);
|
|
5520
5585
|
}
|
|
5521
5586
|
async logs(instanceId, lines = 100) {
|
|
5522
5587
|
const data = await this.http.get(
|
|
5523
5588
|
`/deployments/${this.deploymentId}/runtime-instances/${instanceId}/logs`,
|
|
5524
5589
|
{ lines }
|
|
5525
5590
|
);
|
|
5526
|
-
const unwrapped =
|
|
5591
|
+
const unwrapped = unwrap32(data);
|
|
5527
5592
|
const result = { logs: String(unwrapped.logs ?? "") };
|
|
5528
5593
|
if (typeof unwrapped.runtime_instance_id === "string") {
|
|
5529
5594
|
result.runtime_instance_id = unwrapped.runtime_instance_id;
|
|
@@ -5558,7 +5623,7 @@ var DeploymentDomains = class {
|
|
|
5558
5623
|
headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
|
|
5559
5624
|
}
|
|
5560
5625
|
);
|
|
5561
|
-
return
|
|
5626
|
+
return unwrap32(data);
|
|
5562
5627
|
}
|
|
5563
5628
|
async list(filters = {}) {
|
|
5564
5629
|
const data = await this.http.get(
|
|
@@ -5571,7 +5636,7 @@ var DeploymentDomains = class {
|
|
|
5571
5636
|
const data = await this.http.post(
|
|
5572
5637
|
`/deployments/${this.deploymentId}/domains/${domainId}/verify`
|
|
5573
5638
|
);
|
|
5574
|
-
return
|
|
5639
|
+
return unwrap32(data);
|
|
5575
5640
|
}
|
|
5576
5641
|
async delete(domainId) {
|
|
5577
5642
|
await this.http.delete(
|
|
@@ -5601,7 +5666,7 @@ var Deployments = class {
|
|
|
5601
5666
|
}
|
|
5602
5667
|
async get(deploymentId) {
|
|
5603
5668
|
const data = await this.http.get(`/deployments/${deploymentId}`);
|
|
5604
|
-
return
|
|
5669
|
+
return unwrap32(data);
|
|
5605
5670
|
}
|
|
5606
5671
|
async create(params) {
|
|
5607
5672
|
const body5 = stripUndefined16({
|
|
@@ -5620,7 +5685,7 @@ var Deployments = class {
|
|
|
5620
5685
|
body: body5,
|
|
5621
5686
|
headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
|
|
5622
5687
|
});
|
|
5623
|
-
return
|
|
5688
|
+
return unwrap32(data);
|
|
5624
5689
|
}
|
|
5625
5690
|
/**
|
|
5626
5691
|
* Create a deployment that runs on the workspace's dedicated App Engine
|
|
@@ -5664,7 +5729,7 @@ var Deployments = class {
|
|
|
5664
5729
|
const rawHost = await this.http.get(
|
|
5665
5730
|
`/docker-deploy/hosts/${hostId}`
|
|
5666
5731
|
);
|
|
5667
|
-
host =
|
|
5732
|
+
host = unwrap32(
|
|
5668
5733
|
rawHost
|
|
5669
5734
|
);
|
|
5670
5735
|
addDoctorCheck(
|
|
@@ -5815,7 +5880,7 @@ var Deployments = class {
|
|
|
5815
5880
|
const rawHost = await this.http.get(
|
|
5816
5881
|
`/docker-deploy/hosts/${hostId}`
|
|
5817
5882
|
);
|
|
5818
|
-
const host =
|
|
5883
|
+
const host = unwrap32(
|
|
5819
5884
|
rawHost
|
|
5820
5885
|
);
|
|
5821
5886
|
addProofCheck(
|
|
@@ -5922,7 +5987,7 @@ var Deployments = class {
|
|
|
5922
5987
|
`/deployments/${deploymentId}`,
|
|
5923
5988
|
body5
|
|
5924
5989
|
);
|
|
5925
|
-
return
|
|
5990
|
+
return unwrap32(data);
|
|
5926
5991
|
}
|
|
5927
5992
|
async delete(deploymentId) {
|
|
5928
5993
|
await this.http.delete(`/deployments/${deploymentId}`);
|
|
@@ -5942,7 +6007,7 @@ var Deployments = class {
|
|
|
5942
6007
|
headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
|
|
5943
6008
|
}
|
|
5944
6009
|
);
|
|
5945
|
-
return
|
|
6010
|
+
return unwrap32(data);
|
|
5946
6011
|
}
|
|
5947
6012
|
/**
|
|
5948
6013
|
* Backward-compatible bridge: POST /sandboxes/:id/deploy. Works today;
|
|
@@ -5967,7 +6032,7 @@ var Deployments = class {
|
|
|
5967
6032
|
headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
|
|
5968
6033
|
}
|
|
5969
6034
|
);
|
|
5970
|
-
return
|
|
6035
|
+
return unwrap32(data);
|
|
5971
6036
|
}
|
|
5972
6037
|
async rollback(deploymentId, params = {}) {
|
|
5973
6038
|
const body5 = stripUndefined16({
|
|
@@ -5981,7 +6046,7 @@ var Deployments = class {
|
|
|
5981
6046
|
headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
|
|
5982
6047
|
}
|
|
5983
6048
|
);
|
|
5984
|
-
return
|
|
6049
|
+
return unwrap32(data);
|
|
5985
6050
|
}
|
|
5986
6051
|
async listBuilds(deploymentId) {
|
|
5987
6052
|
const data = await this.http.get(
|
|
@@ -5993,7 +6058,7 @@ var Deployments = class {
|
|
|
5993
6058
|
const data = await this.http.get(
|
|
5994
6059
|
`/deployments/${deploymentId}/builds/${buildId}`
|
|
5995
6060
|
);
|
|
5996
|
-
return
|
|
6061
|
+
return unwrap32(data);
|
|
5997
6062
|
}
|
|
5998
6063
|
async listEnv(deploymentId) {
|
|
5999
6064
|
const data = await this.http.get(
|
|
@@ -6039,7 +6104,7 @@ var RUNTIME_BINARIES = {
|
|
|
6039
6104
|
pi: ["pi"],
|
|
6040
6105
|
custom: []
|
|
6041
6106
|
};
|
|
6042
|
-
function
|
|
6107
|
+
function unwrap33(payload, keys = ["data"]) {
|
|
6043
6108
|
if (payload && typeof payload === "object") {
|
|
6044
6109
|
const p = payload;
|
|
6045
6110
|
for (const key of keys) {
|
|
@@ -6098,7 +6163,7 @@ var Devices = class {
|
|
|
6098
6163
|
/** Show one unified device by id. */
|
|
6099
6164
|
async get(id) {
|
|
6100
6165
|
const data = await this.http.get(`/devices/${devicePath(id)}`);
|
|
6101
|
-
return
|
|
6166
|
+
return unwrap33(data);
|
|
6102
6167
|
}
|
|
6103
6168
|
show(id) {
|
|
6104
6169
|
return this.get(id);
|
|
@@ -6108,7 +6173,7 @@ var Devices = class {
|
|
|
6108
6173
|
const data = await this.http.get(
|
|
6109
6174
|
`/devices/${devicePath(id)}/capabilities`
|
|
6110
6175
|
);
|
|
6111
|
-
return
|
|
6176
|
+
return unwrap33(data);
|
|
6112
6177
|
}
|
|
6113
6178
|
/** Execute a command inside the device. */
|
|
6114
6179
|
async exec(id, params) {
|
|
@@ -6121,7 +6186,7 @@ var Devices = class {
|
|
|
6121
6186
|
env: params.env
|
|
6122
6187
|
})
|
|
6123
6188
|
);
|
|
6124
|
-
return
|
|
6189
|
+
return unwrap33(data);
|
|
6125
6190
|
}
|
|
6126
6191
|
/** List files inside the device filesystem. */
|
|
6127
6192
|
async listFiles(id, params = {}) {
|
|
@@ -6137,7 +6202,7 @@ var Devices = class {
|
|
|
6137
6202
|
`/devices/${devicePath(id)}/files/read`,
|
|
6138
6203
|
queryFromFileParams(params)
|
|
6139
6204
|
);
|
|
6140
|
-
return
|
|
6205
|
+
return unwrap33(data);
|
|
6141
6206
|
}
|
|
6142
6207
|
/** Write a text or base64 payload into the device filesystem. */
|
|
6143
6208
|
async writeFile(id, params) {
|
|
@@ -6149,7 +6214,7 @@ var Devices = class {
|
|
|
6149
6214
|
content_base64: pickFirst5(params.contentBase64, params.content_base64)
|
|
6150
6215
|
})
|
|
6151
6216
|
);
|
|
6152
|
-
return
|
|
6217
|
+
return unwrap33(data);
|
|
6153
6218
|
}
|
|
6154
6219
|
/** Expose a device port through MIOSA routing. */
|
|
6155
6220
|
async expose(id, params) {
|
|
@@ -6157,44 +6222,44 @@ var Devices = class {
|
|
|
6157
6222
|
`/devices/${devicePath(id)}/expose`,
|
|
6158
6223
|
{ port: params.port }
|
|
6159
6224
|
);
|
|
6160
|
-
return
|
|
6225
|
+
return unwrap33(data);
|
|
6161
6226
|
}
|
|
6162
6227
|
/** Return browser/desktop connection details for a computer-backed device. */
|
|
6163
6228
|
async browser(id) {
|
|
6164
6229
|
const data = await this.http.get(`/devices/${devicePath(id)}/browser`);
|
|
6165
|
-
return
|
|
6230
|
+
return unwrap33(data);
|
|
6166
6231
|
}
|
|
6167
6232
|
async pause(id) {
|
|
6168
6233
|
const data = await this.http.post(
|
|
6169
6234
|
`/devices/${devicePath(id)}/pause`,
|
|
6170
6235
|
{}
|
|
6171
6236
|
);
|
|
6172
|
-
return
|
|
6237
|
+
return unwrap33(data);
|
|
6173
6238
|
}
|
|
6174
6239
|
async stop(id) {
|
|
6175
6240
|
const data = await this.http.post(
|
|
6176
6241
|
`/devices/${devicePath(id)}/stop`,
|
|
6177
6242
|
{}
|
|
6178
6243
|
);
|
|
6179
|
-
return
|
|
6244
|
+
return unwrap33(data);
|
|
6180
6245
|
}
|
|
6181
6246
|
async resume(id) {
|
|
6182
6247
|
const data = await this.http.post(
|
|
6183
6248
|
`/devices/${devicePath(id)}/resume`,
|
|
6184
6249
|
{}
|
|
6185
6250
|
);
|
|
6186
|
-
return
|
|
6251
|
+
return unwrap33(data);
|
|
6187
6252
|
}
|
|
6188
6253
|
async extend(id, params) {
|
|
6189
6254
|
const data = await this.http.post(
|
|
6190
6255
|
`/devices/${devicePath(id)}/extend`,
|
|
6191
6256
|
{ timeout_sec: pickFirst5(params.timeoutSec, params.timeout_sec) }
|
|
6192
6257
|
);
|
|
6193
|
-
return
|
|
6258
|
+
return unwrap33(data);
|
|
6194
6259
|
}
|
|
6195
6260
|
async destroy(id) {
|
|
6196
6261
|
const data = await this.http.delete(`/devices/${devicePath(id)}`);
|
|
6197
|
-
return
|
|
6262
|
+
return unwrap33(data);
|
|
6198
6263
|
}
|
|
6199
6264
|
/**
|
|
6200
6265
|
* Write a MIOSA runtime bootstrap manifest and optionally install/probe
|
|
@@ -6364,7 +6429,7 @@ var DockerDeploy = class {
|
|
|
6364
6429
|
};
|
|
6365
6430
|
|
|
6366
6431
|
// src/resources/email.ts
|
|
6367
|
-
function
|
|
6432
|
+
function unwrap34(data) {
|
|
6368
6433
|
if (data && typeof data === "object") {
|
|
6369
6434
|
const d = data;
|
|
6370
6435
|
for (const k of [
|
|
@@ -6416,12 +6481,12 @@ var EmailCampaigns = class {
|
|
|
6416
6481
|
);
|
|
6417
6482
|
}
|
|
6418
6483
|
async create(attrs) {
|
|
6419
|
-
return
|
|
6484
|
+
return unwrap34(
|
|
6420
6485
|
await this.http.post("/admin/email-campaigns", strip(attrs))
|
|
6421
6486
|
);
|
|
6422
6487
|
}
|
|
6423
6488
|
async recipientCount(filters = {}) {
|
|
6424
|
-
return
|
|
6489
|
+
return unwrap34(
|
|
6425
6490
|
await this.http.get(
|
|
6426
6491
|
"/admin/email-campaigns/recipient-count",
|
|
6427
6492
|
filters
|
|
@@ -6429,7 +6494,7 @@ var EmailCampaigns = class {
|
|
|
6429
6494
|
);
|
|
6430
6495
|
}
|
|
6431
6496
|
async send(campaignId, opts = {}) {
|
|
6432
|
-
return
|
|
6497
|
+
return unwrap34(
|
|
6433
6498
|
await this.http.post(
|
|
6434
6499
|
`/admin/email-campaigns/${campaignId}/send`,
|
|
6435
6500
|
strip(opts)
|
|
@@ -6437,7 +6502,7 @@ var EmailCampaigns = class {
|
|
|
6437
6502
|
);
|
|
6438
6503
|
}
|
|
6439
6504
|
async cancel(campaignId) {
|
|
6440
|
-
return
|
|
6505
|
+
return unwrap34(
|
|
6441
6506
|
await this.http.post(
|
|
6442
6507
|
`/admin/email-campaigns/${campaignId}/cancel`
|
|
6443
6508
|
)
|
|
@@ -6463,7 +6528,7 @@ var EmailTemplates = class {
|
|
|
6463
6528
|
);
|
|
6464
6529
|
}
|
|
6465
6530
|
async create(key, attrs = {}) {
|
|
6466
|
-
return
|
|
6531
|
+
return unwrap34(
|
|
6467
6532
|
await this.http.post("/admin/email-templates", {
|
|
6468
6533
|
key,
|
|
6469
6534
|
...strip(attrs)
|
|
@@ -6471,7 +6536,7 @@ var EmailTemplates = class {
|
|
|
6471
6536
|
);
|
|
6472
6537
|
}
|
|
6473
6538
|
async update(key, attrs) {
|
|
6474
|
-
return
|
|
6539
|
+
return unwrap34(
|
|
6475
6540
|
await this.http.put(
|
|
6476
6541
|
`/admin/email-templates/${key}`,
|
|
6477
6542
|
strip(attrs)
|
|
@@ -6479,7 +6544,7 @@ var EmailTemplates = class {
|
|
|
6479
6544
|
);
|
|
6480
6545
|
}
|
|
6481
6546
|
async reset(key) {
|
|
6482
|
-
return
|
|
6547
|
+
return unwrap34(
|
|
6483
6548
|
await this.http.post(`/admin/email-templates/${key}/reset`)
|
|
6484
6549
|
);
|
|
6485
6550
|
}
|
|
@@ -6495,17 +6560,17 @@ var EmailInbox = class {
|
|
|
6495
6560
|
);
|
|
6496
6561
|
}
|
|
6497
6562
|
async send(attrs) {
|
|
6498
|
-
return
|
|
6563
|
+
return unwrap34(
|
|
6499
6564
|
await this.http.post("/admin/email-inbox/send", strip(attrs))
|
|
6500
6565
|
);
|
|
6501
6566
|
}
|
|
6502
6567
|
async markRead(messageId) {
|
|
6503
|
-
return
|
|
6568
|
+
return unwrap34(
|
|
6504
6569
|
await this.http.post(`/admin/email-inbox/${messageId}/read`)
|
|
6505
6570
|
);
|
|
6506
6571
|
}
|
|
6507
6572
|
async archive(messageId) {
|
|
6508
|
-
return
|
|
6573
|
+
return unwrap34(
|
|
6509
6574
|
await this.http.post(`/admin/email-inbox/${messageId}/archive`)
|
|
6510
6575
|
);
|
|
6511
6576
|
}
|
|
@@ -6545,7 +6610,7 @@ var Embeddings = class {
|
|
|
6545
6610
|
};
|
|
6546
6611
|
|
|
6547
6612
|
// src/resources/external-keys.ts
|
|
6548
|
-
function
|
|
6613
|
+
function unwrap35(payload) {
|
|
6549
6614
|
if (payload && typeof payload === "object") {
|
|
6550
6615
|
const p = payload;
|
|
6551
6616
|
for (const k of ["data", "external_keys", "items"]) {
|
|
@@ -6567,7 +6632,7 @@ var ExternalKeys = class {
|
|
|
6567
6632
|
/** List configured external keys. */
|
|
6568
6633
|
async list() {
|
|
6569
6634
|
const data = await this.http.get("/external-keys");
|
|
6570
|
-
const result =
|
|
6635
|
+
const result = unwrap35(data);
|
|
6571
6636
|
if (Array.isArray(result)) return result;
|
|
6572
6637
|
return [];
|
|
6573
6638
|
}
|
|
@@ -6575,14 +6640,14 @@ var ExternalKeys = class {
|
|
|
6575
6640
|
async create(params) {
|
|
6576
6641
|
const body5 = stripUndefined18(params);
|
|
6577
6642
|
const data = await this.http.post("/external-keys", body5);
|
|
6578
|
-
return
|
|
6643
|
+
return unwrap35(data);
|
|
6579
6644
|
}
|
|
6580
6645
|
/** Resolve (preview) the stored key for a provider. */
|
|
6581
6646
|
async resolve(provider) {
|
|
6582
6647
|
const data = await this.http.get(
|
|
6583
6648
|
`/external-keys/${provider}/resolve`
|
|
6584
6649
|
);
|
|
6585
|
-
return
|
|
6650
|
+
return unwrap35(data);
|
|
6586
6651
|
}
|
|
6587
6652
|
/**
|
|
6588
6653
|
* Delete the stored key for a provider.
|
|
@@ -6592,7 +6657,7 @@ var ExternalKeys = class {
|
|
|
6592
6657
|
await this.http.delete(`/external-keys/${provider}`);
|
|
6593
6658
|
}
|
|
6594
6659
|
};
|
|
6595
|
-
function
|
|
6660
|
+
function unwrap36(payload) {
|
|
6596
6661
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
6597
6662
|
return payload.data;
|
|
6598
6663
|
}
|
|
@@ -6645,13 +6710,13 @@ var FlatCustomDomains = class {
|
|
|
6645
6710
|
body: body5,
|
|
6646
6711
|
headers: { "Idempotency-Key": idempotencyKey5(ikey) }
|
|
6647
6712
|
});
|
|
6648
|
-
return
|
|
6713
|
+
return unwrap36(data);
|
|
6649
6714
|
}
|
|
6650
6715
|
async delete(domainId) {
|
|
6651
6716
|
await this.http.delete(`/custom-domains/${domainId}`);
|
|
6652
6717
|
}
|
|
6653
6718
|
};
|
|
6654
|
-
function
|
|
6719
|
+
function unwrap37(payload) {
|
|
6655
6720
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
6656
6721
|
return payload.data;
|
|
6657
6722
|
}
|
|
@@ -6687,7 +6752,7 @@ var Functions = class {
|
|
|
6687
6752
|
}
|
|
6688
6753
|
async get(functionId) {
|
|
6689
6754
|
const data = await this.http.get(`/functions/${functionId}`);
|
|
6690
|
-
return
|
|
6755
|
+
return unwrap37(data);
|
|
6691
6756
|
}
|
|
6692
6757
|
async create(params) {
|
|
6693
6758
|
const { idempotencyKey: ikey, memoryMb, timeoutSec, ...rest } = params;
|
|
@@ -6701,7 +6766,7 @@ var Functions = class {
|
|
|
6701
6766
|
body: body5,
|
|
6702
6767
|
headers: { "Idempotency-Key": idempotencyKey6(ikey) }
|
|
6703
6768
|
});
|
|
6704
|
-
return
|
|
6769
|
+
return unwrap37(data);
|
|
6705
6770
|
}
|
|
6706
6771
|
async update(functionId, params) {
|
|
6707
6772
|
const { memoryMb, timeoutSec, ...rest } = params;
|
|
@@ -6714,7 +6779,7 @@ var Functions = class {
|
|
|
6714
6779
|
`/functions/${functionId}`,
|
|
6715
6780
|
body5
|
|
6716
6781
|
);
|
|
6717
|
-
return
|
|
6782
|
+
return unwrap37(data);
|
|
6718
6783
|
}
|
|
6719
6784
|
async delete(functionId) {
|
|
6720
6785
|
await this.http.delete(`/functions/${functionId}`);
|
|
@@ -6735,7 +6800,386 @@ var Functions = class {
|
|
|
6735
6800
|
return data ?? {};
|
|
6736
6801
|
}
|
|
6737
6802
|
};
|
|
6738
|
-
|
|
6803
|
+
|
|
6804
|
+
// src/resources/forge.ts
|
|
6805
|
+
var REPOSITORY_VISIBILITIES = /* @__PURE__ */ new Set([
|
|
6806
|
+
"public",
|
|
6807
|
+
"private",
|
|
6808
|
+
"internal"
|
|
6809
|
+
]);
|
|
6810
|
+
var REPOSITORY_STATES = /* @__PURE__ */ new Set([
|
|
6811
|
+
"provisioning",
|
|
6812
|
+
"active",
|
|
6813
|
+
"error",
|
|
6814
|
+
"deletion_pending",
|
|
6815
|
+
"deleted"
|
|
6816
|
+
]);
|
|
6817
|
+
var ForgeContractError = class extends MiosaError {
|
|
6818
|
+
constructor(message, details) {
|
|
6819
|
+
super(message, 502, "FORGE_CONTRACT_ERROR", details);
|
|
6820
|
+
this.name = "ForgeContractError";
|
|
6821
|
+
}
|
|
6822
|
+
};
|
|
6823
|
+
var ForgeUnavailableError = class extends MiosaError {
|
|
6824
|
+
constructor(message, cause) {
|
|
6825
|
+
super(message, cause.status, "FORGE_DISABLED", cause.details, cause.requestId);
|
|
6826
|
+
this.name = "ForgeUnavailableError";
|
|
6827
|
+
}
|
|
6828
|
+
};
|
|
6829
|
+
var ForgeStorageError = class extends MiosaError {
|
|
6830
|
+
constructor(message, cause) {
|
|
6831
|
+
super(message, cause.status, cause.code, cause.details, cause.requestId);
|
|
6832
|
+
this.name = "ForgeStorageError";
|
|
6833
|
+
}
|
|
6834
|
+
};
|
|
6835
|
+
var ForgePolicyViolationError = class extends MiosaError {
|
|
6836
|
+
constructor(message, cause) {
|
|
6837
|
+
super(message, cause.status, cause.code, cause.details, cause.requestId);
|
|
6838
|
+
this.name = "ForgePolicyViolationError";
|
|
6839
|
+
}
|
|
6840
|
+
};
|
|
6841
|
+
function translateError(error) {
|
|
6842
|
+
if (!(error instanceof MiosaError)) throw error;
|
|
6843
|
+
if (error.code === "FORGE_DISABLED") {
|
|
6844
|
+
throw new ForgeUnavailableError("Forge is not enabled for this organization", error);
|
|
6845
|
+
}
|
|
6846
|
+
if (error.code === "FORGE_STORAGE_UNAVAILABLE" || error.code === "FORGE_OPERATION_FAILED") {
|
|
6847
|
+
throw new ForgeStorageError("Forge repository storage is unavailable", error);
|
|
6848
|
+
}
|
|
6849
|
+
if (error.code === "INVALID_PROJECT_ATTACHMENT") {
|
|
6850
|
+
throw new ForgePolicyViolationError("Forge repository policy rejected the operation", error);
|
|
6851
|
+
}
|
|
6852
|
+
throw error;
|
|
6853
|
+
}
|
|
6854
|
+
function repositoryPath(id) {
|
|
6855
|
+
return `/forge/repositories/${encodeURIComponent(id)}`;
|
|
6856
|
+
}
|
|
6857
|
+
function compact(value) {
|
|
6858
|
+
return Object.fromEntries(
|
|
6859
|
+
Object.entries(value).filter(([, item]) => item !== void 0)
|
|
6860
|
+
);
|
|
6861
|
+
}
|
|
6862
|
+
function object(payload, label) {
|
|
6863
|
+
if (!payload || typeof payload !== "object" || Array.isArray(payload)) {
|
|
6864
|
+
throw new ForgeContractError(`Forge returned invalid ${label}`, { payload });
|
|
6865
|
+
}
|
|
6866
|
+
return payload;
|
|
6867
|
+
}
|
|
6868
|
+
function string(value, field, payload) {
|
|
6869
|
+
if (typeof value !== "string") {
|
|
6870
|
+
throw new ForgeContractError(`Forge content is missing ${field}`, { field, payload });
|
|
6871
|
+
}
|
|
6872
|
+
return value;
|
|
6873
|
+
}
|
|
6874
|
+
function nullableString(value, field, payload) {
|
|
6875
|
+
if (value !== null && typeof value !== "string") {
|
|
6876
|
+
throw new ForgeContractError(`Forge content has invalid ${field}`, { field, payload });
|
|
6877
|
+
}
|
|
6878
|
+
return value;
|
|
6879
|
+
}
|
|
6880
|
+
function queryPath(path, params) {
|
|
6881
|
+
const query3 = new URLSearchParams();
|
|
6882
|
+
for (const [key, value] of Object.entries(params)) {
|
|
6883
|
+
if (value !== void 0) query3.set(key, String(value));
|
|
6884
|
+
}
|
|
6885
|
+
const encoded = query3.toString();
|
|
6886
|
+
return encoded ? `${path}?${encoded}` : path;
|
|
6887
|
+
}
|
|
6888
|
+
function parseNamedRef(payload) {
|
|
6889
|
+
const value = object(payload, "repository ref");
|
|
6890
|
+
return { name: string(value.name, "name", payload), oid: string(value.oid, "oid", payload) };
|
|
6891
|
+
}
|
|
6892
|
+
function parseRefs(payload) {
|
|
6893
|
+
const value = object(payload, "repository refs");
|
|
6894
|
+
if (!Array.isArray(value.branches) || !Array.isArray(value.tags)) {
|
|
6895
|
+
throw new ForgeContractError("Forge repository refs have invalid collections", { payload });
|
|
6896
|
+
}
|
|
6897
|
+
const branches = value.branches.map((item) => {
|
|
6898
|
+
const branch = object(item, "branch");
|
|
6899
|
+
if (typeof branch.is_default !== "boolean") {
|
|
6900
|
+
throw new ForgeContractError("Forge branch is missing is_default", { payload: item });
|
|
6901
|
+
}
|
|
6902
|
+
return { ...parseNamedRef(item), is_default: branch.is_default };
|
|
6903
|
+
});
|
|
6904
|
+
return {
|
|
6905
|
+
default_branch: string(value.default_branch, "default_branch", payload),
|
|
6906
|
+
head_oid: nullableString(value.head_oid, "head_oid", payload),
|
|
6907
|
+
branches,
|
|
6908
|
+
tags: value.tags.map(parseNamedRef)
|
|
6909
|
+
};
|
|
6910
|
+
}
|
|
6911
|
+
function parseTree(payload) {
|
|
6912
|
+
const value = object(payload, "repository tree");
|
|
6913
|
+
if (!Array.isArray(value.entries) || typeof value.truncated !== "boolean") {
|
|
6914
|
+
throw new ForgeContractError("Forge repository tree has invalid entries", { payload });
|
|
6915
|
+
}
|
|
6916
|
+
const entries = value.entries.map((item) => {
|
|
6917
|
+
const entry = object(item, "tree entry");
|
|
6918
|
+
if (entry.type !== "blob" && entry.type !== "tree") {
|
|
6919
|
+
throw new ForgeContractError("Forge tree entry has invalid type", { payload: item });
|
|
6920
|
+
}
|
|
6921
|
+
if (entry.size !== null && (typeof entry.size !== "number" || !Number.isSafeInteger(entry.size) || entry.size < 0)) {
|
|
6922
|
+
throw new ForgeContractError("Forge tree entry has invalid size", { payload: item });
|
|
6923
|
+
}
|
|
6924
|
+
return {
|
|
6925
|
+
name: string(entry.name, "name", item),
|
|
6926
|
+
path: string(entry.path, "path", item),
|
|
6927
|
+
type: entry.type,
|
|
6928
|
+
oid: string(entry.oid, "oid", item),
|
|
6929
|
+
size: entry.size
|
|
6930
|
+
};
|
|
6931
|
+
});
|
|
6932
|
+
return {
|
|
6933
|
+
ref: string(value.ref, "ref", payload),
|
|
6934
|
+
commit_oid: string(value.commit_oid, "commit_oid", payload),
|
|
6935
|
+
path: string(value.path, "path", payload),
|
|
6936
|
+
entries,
|
|
6937
|
+
truncated: value.truncated
|
|
6938
|
+
};
|
|
6939
|
+
}
|
|
6940
|
+
function parseBlob(payload) {
|
|
6941
|
+
const value = object(payload, "repository blob");
|
|
6942
|
+
if (value.encoding !== "utf-8" && value.encoding !== "base64") {
|
|
6943
|
+
throw new ForgeContractError("Forge blob has invalid encoding", { payload });
|
|
6944
|
+
}
|
|
6945
|
+
if (typeof value.size !== "number" || !Number.isSafeInteger(value.size) || value.size < 0) {
|
|
6946
|
+
throw new ForgeContractError("Forge blob has invalid size", { payload });
|
|
6947
|
+
}
|
|
6948
|
+
return {
|
|
6949
|
+
ref: string(value.ref, "ref", payload),
|
|
6950
|
+
commit_oid: string(value.commit_oid, "commit_oid", payload),
|
|
6951
|
+
path: string(value.path, "path", payload),
|
|
6952
|
+
oid: string(value.oid, "oid", payload),
|
|
6953
|
+
size: value.size,
|
|
6954
|
+
encoding: value.encoding,
|
|
6955
|
+
content: string(value.content, "content", payload)
|
|
6956
|
+
};
|
|
6957
|
+
}
|
|
6958
|
+
function parseHistory(payload) {
|
|
6959
|
+
const value = object(payload, "commit history");
|
|
6960
|
+
const page = object(value.page, "commit page");
|
|
6961
|
+
if (!Array.isArray(value.commits) || typeof page.has_more !== "boolean") {
|
|
6962
|
+
throw new ForgeContractError("Forge commit history has invalid pagination", { payload });
|
|
6963
|
+
}
|
|
6964
|
+
const commits = value.commits.map((item) => {
|
|
6965
|
+
const commit = object(item, "commit");
|
|
6966
|
+
if (!Array.isArray(commit.parents) || !commit.parents.every((parent) => typeof parent === "string")) {
|
|
6967
|
+
throw new ForgeContractError("Forge commit has invalid parents", { payload: item });
|
|
6968
|
+
}
|
|
6969
|
+
return {
|
|
6970
|
+
oid: string(commit.oid, "oid", item),
|
|
6971
|
+
short_oid: string(commit.short_oid, "short_oid", item),
|
|
6972
|
+
subject: string(commit.subject, "subject", item),
|
|
6973
|
+
author_name: string(commit.author_name, "author_name", item),
|
|
6974
|
+
author_email: string(commit.author_email, "author_email", item),
|
|
6975
|
+
authored_at: string(commit.authored_at, "authored_at", item),
|
|
6976
|
+
committer_name: string(commit.committer_name, "committer_name", item),
|
|
6977
|
+
committed_at: string(commit.committed_at, "committed_at", item),
|
|
6978
|
+
parents: commit.parents
|
|
6979
|
+
};
|
|
6980
|
+
});
|
|
6981
|
+
return {
|
|
6982
|
+
ref: string(value.ref, "ref", payload),
|
|
6983
|
+
path: string(value.path, "path", payload),
|
|
6984
|
+
commits,
|
|
6985
|
+
page: { has_more: page.has_more, next_cursor: nullableString(page.next_cursor, "next_cursor", page) }
|
|
6986
|
+
};
|
|
6987
|
+
}
|
|
6988
|
+
function parseFileReceipt(payload, replayed) {
|
|
6989
|
+
const value = object(payload, "file operation receipt");
|
|
6990
|
+
const commit = object(value.commit, "file operation commit");
|
|
6991
|
+
const policy = object(value.policy, "file operation policy");
|
|
6992
|
+
const stringFields = ["operation_id", "repository_id", "branch", "path", "previous_head", "new_head"];
|
|
6993
|
+
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") {
|
|
6994
|
+
throw new ForgeContractError("Forge returned invalid file operation receipt", { payload });
|
|
6995
|
+
}
|
|
6996
|
+
return { ...value, replayed };
|
|
6997
|
+
}
|
|
6998
|
+
function parseRepository(payload) {
|
|
6999
|
+
if (!payload || typeof payload !== "object" || Array.isArray(payload)) {
|
|
7000
|
+
throw new ForgeContractError("Forge returned an invalid repository", {
|
|
7001
|
+
payload
|
|
7002
|
+
});
|
|
7003
|
+
}
|
|
7004
|
+
const value = payload;
|
|
7005
|
+
const requiredStrings = [
|
|
7006
|
+
"id",
|
|
7007
|
+
"name",
|
|
7008
|
+
"slug",
|
|
7009
|
+
"default_branch",
|
|
7010
|
+
"visibility",
|
|
7011
|
+
"state",
|
|
7012
|
+
"created_at",
|
|
7013
|
+
"updated_at"
|
|
7014
|
+
];
|
|
7015
|
+
for (const field of requiredStrings) {
|
|
7016
|
+
if (typeof value[field] !== "string" || value[field].length === 0) {
|
|
7017
|
+
throw new ForgeContractError(`Forge repository is missing ${field}`, {
|
|
7018
|
+
field,
|
|
7019
|
+
payload
|
|
7020
|
+
});
|
|
7021
|
+
}
|
|
7022
|
+
}
|
|
7023
|
+
if (!REPOSITORY_VISIBILITIES.has(value.visibility)) {
|
|
7024
|
+
throw new ForgeContractError("Forge repository has an invalid visibility", {
|
|
7025
|
+
payload
|
|
7026
|
+
});
|
|
7027
|
+
}
|
|
7028
|
+
if (!REPOSITORY_STATES.has(value.state)) {
|
|
7029
|
+
throw new ForgeContractError("Forge repository has an invalid state", {
|
|
7030
|
+
payload
|
|
7031
|
+
});
|
|
7032
|
+
}
|
|
7033
|
+
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"))
|
|
7034
|
+
throw new ForgeContractError("Forge repository has invalid clone or project metadata", { payload });
|
|
7035
|
+
if (value.clone_ready !== (value.state === "active") || value.clone_ready && !value.clone_url || !value.clone_ready && value.clone_url !== null)
|
|
7036
|
+
throw new ForgeContractError("Forge repository clone readiness is inconsistent", { payload });
|
|
7037
|
+
return {
|
|
7038
|
+
id: value.id,
|
|
7039
|
+
name: value.name,
|
|
7040
|
+
slug: value.slug,
|
|
7041
|
+
default_branch: value.default_branch,
|
|
7042
|
+
visibility: value.visibility,
|
|
7043
|
+
state: value.state,
|
|
7044
|
+
clone_ready: value.clone_ready,
|
|
7045
|
+
clone_url: value.clone_url,
|
|
7046
|
+
project_ids: value.project_ids,
|
|
7047
|
+
created_at: value.created_at,
|
|
7048
|
+
updated_at: value.updated_at
|
|
7049
|
+
};
|
|
7050
|
+
}
|
|
7051
|
+
function parseCapabilities(payload) {
|
|
7052
|
+
const value = object(payload, "capabilities");
|
|
7053
|
+
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";
|
|
7054
|
+
if (!valid) throw new ForgeContractError("Forge returned invalid capabilities", { payload });
|
|
7055
|
+
return value;
|
|
7056
|
+
}
|
|
7057
|
+
var ForgeRepositories = class {
|
|
7058
|
+
constructor(http) {
|
|
7059
|
+
this.http = http;
|
|
7060
|
+
}
|
|
7061
|
+
http;
|
|
7062
|
+
async create(params) {
|
|
7063
|
+
try {
|
|
7064
|
+
const payload = await this.http.request("/forge/repositories", {
|
|
7065
|
+
method: "POST",
|
|
7066
|
+
headers: { "Idempotency-Key": params.idempotencyKey ?? crypto.randomUUID() },
|
|
7067
|
+
body: compact({
|
|
7068
|
+
name: params.name,
|
|
7069
|
+
slug: params.slug,
|
|
7070
|
+
default_branch: params.defaultBranch,
|
|
7071
|
+
visibility: params.visibility,
|
|
7072
|
+
project_ids: params.projectIds
|
|
7073
|
+
})
|
|
7074
|
+
});
|
|
7075
|
+
return parseRepository(unwrapData2(payload));
|
|
7076
|
+
} catch (error) {
|
|
7077
|
+
translateError(error);
|
|
7078
|
+
}
|
|
7079
|
+
}
|
|
7080
|
+
async list() {
|
|
7081
|
+
const payload = await this.http.get("/forge/repositories");
|
|
7082
|
+
if (!payload || typeof payload !== "object" || Array.isArray(payload) || !Array.isArray(payload.data)) {
|
|
7083
|
+
throw new ForgeContractError("Forge returned an invalid repository list", {
|
|
7084
|
+
payload
|
|
7085
|
+
});
|
|
7086
|
+
}
|
|
7087
|
+
return payload.data.map(
|
|
7088
|
+
parseRepository
|
|
7089
|
+
);
|
|
7090
|
+
}
|
|
7091
|
+
async get(id) {
|
|
7092
|
+
return parseRepository(unwrapData2(await this.http.get(repositoryPath(id))));
|
|
7093
|
+
}
|
|
7094
|
+
async refs(id) {
|
|
7095
|
+
return parseRefs(unwrapData2(await this.http.get(`${repositoryPath(id)}/refs`)));
|
|
7096
|
+
}
|
|
7097
|
+
async tree(id, location = {}) {
|
|
7098
|
+
const path = queryPath(`${repositoryPath(id)}/tree`, { ref: location.ref, path: location.path });
|
|
7099
|
+
return parseTree(unwrapData2(await this.http.get(path)));
|
|
7100
|
+
}
|
|
7101
|
+
async blob(id, location) {
|
|
7102
|
+
const path = queryPath(`${repositoryPath(id)}/blob`, { ref: location.ref, path: location.path });
|
|
7103
|
+
return parseBlob(unwrapData2(await this.http.get(path)));
|
|
7104
|
+
}
|
|
7105
|
+
async readme(id, location = {}) {
|
|
7106
|
+
const path = queryPath(`${repositoryPath(id)}/readme`, { ref: location.ref, path: location.path });
|
|
7107
|
+
return parseBlob(unwrapData2(await this.http.get(path)));
|
|
7108
|
+
}
|
|
7109
|
+
async commits(id, query3 = {}) {
|
|
7110
|
+
const path = queryPath(`${repositoryPath(id)}/commits`, {
|
|
7111
|
+
ref: query3.ref,
|
|
7112
|
+
path: query3.path,
|
|
7113
|
+
limit: query3.limit,
|
|
7114
|
+
cursor: query3.cursor
|
|
7115
|
+
});
|
|
7116
|
+
return parseHistory(unwrapData2(await this.http.get(path)));
|
|
7117
|
+
}
|
|
7118
|
+
async putFile(id, path, params) {
|
|
7119
|
+
return this.authorFile(id, path, "PUT", params);
|
|
7120
|
+
}
|
|
7121
|
+
async deleteFile(id, path, params) {
|
|
7122
|
+
return this.authorFile(id, path, "DELETE", params);
|
|
7123
|
+
}
|
|
7124
|
+
async authorFile(id, path, method, params) {
|
|
7125
|
+
const response = await this.http.request(`${repositoryPath(id)}/files/${path.split("/").map(encodeURIComponent).join("/")}`, {
|
|
7126
|
+
method,
|
|
7127
|
+
rawResponse: true,
|
|
7128
|
+
headers: { "Idempotency-Key": params.idempotencyKey ?? crypto.randomUUID() },
|
|
7129
|
+
body: compact({ branch: params.branch, expected_head: params.expectedHead, message: params.message, content: params.content })
|
|
7130
|
+
});
|
|
7131
|
+
let payload;
|
|
7132
|
+
try {
|
|
7133
|
+
payload = await response.json();
|
|
7134
|
+
} catch {
|
|
7135
|
+
throw new ForgeContractError("Forge returned invalid file operation JSON");
|
|
7136
|
+
}
|
|
7137
|
+
return parseFileReceipt(unwrapData2(payload), response.headers.get("idempotency-replayed") === "true");
|
|
7138
|
+
}
|
|
7139
|
+
async update(id, params) {
|
|
7140
|
+
try {
|
|
7141
|
+
const payload = await this.http.request(repositoryPath(id), { method: "PATCH", body: compact({
|
|
7142
|
+
name: params.name,
|
|
7143
|
+
slug: params.slug,
|
|
7144
|
+
visibility: params.visibility,
|
|
7145
|
+
project_ids: params.projectIds
|
|
7146
|
+
}) });
|
|
7147
|
+
return parseRepository(unwrapData2(payload));
|
|
7148
|
+
} catch (error) {
|
|
7149
|
+
translateError(error);
|
|
7150
|
+
}
|
|
7151
|
+
}
|
|
7152
|
+
async delete(id, _options = {}) {
|
|
7153
|
+
try {
|
|
7154
|
+
const response = await this.http.request(repositoryPath(id), {
|
|
7155
|
+
method: "DELETE",
|
|
7156
|
+
rawResponse: true
|
|
7157
|
+
});
|
|
7158
|
+
const operationId = response.headers.get("x-forge-operation-id");
|
|
7159
|
+
if (!operationId) throw new ForgeContractError("Forge delete omitted its operation receipt");
|
|
7160
|
+
return { operation_id: operationId, replayed: response.headers.get("idempotency-replayed") === "true" };
|
|
7161
|
+
} catch (error) {
|
|
7162
|
+
translateError(error);
|
|
7163
|
+
}
|
|
7164
|
+
}
|
|
7165
|
+
};
|
|
7166
|
+
function unwrapData2(payload) {
|
|
7167
|
+
if (!payload || typeof payload !== "object" || Array.isArray(payload) || !("data" in payload))
|
|
7168
|
+
throw new ForgeContractError("Forge returned an invalid success envelope", { payload });
|
|
7169
|
+
return payload.data;
|
|
7170
|
+
}
|
|
7171
|
+
var Forge = class {
|
|
7172
|
+
repositories;
|
|
7173
|
+
constructor(http) {
|
|
7174
|
+
this.repositories = new ForgeRepositories(http);
|
|
7175
|
+
this.http = http;
|
|
7176
|
+
}
|
|
7177
|
+
http;
|
|
7178
|
+
async capabilities() {
|
|
7179
|
+
return parseCapabilities(unwrapData2(await this.http.get("/forge/capabilities")));
|
|
7180
|
+
}
|
|
7181
|
+
};
|
|
7182
|
+
function unwrap38(payload) {
|
|
6739
7183
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
6740
7184
|
return payload.data;
|
|
6741
7185
|
}
|
|
@@ -6771,7 +7215,7 @@ var HealthChecks = class {
|
|
|
6771
7215
|
}
|
|
6772
7216
|
async get(checkId) {
|
|
6773
7217
|
const data = await this.http.get(`/health-checks/${checkId}`);
|
|
6774
|
-
return
|
|
7218
|
+
return unwrap38(data);
|
|
6775
7219
|
}
|
|
6776
7220
|
async create(params) {
|
|
6777
7221
|
const {
|
|
@@ -6792,7 +7236,7 @@ var HealthChecks = class {
|
|
|
6792
7236
|
body: body5,
|
|
6793
7237
|
headers: { "Idempotency-Key": idempotencyKey7(ikey) }
|
|
6794
7238
|
});
|
|
6795
|
-
return
|
|
7239
|
+
return unwrap38(data);
|
|
6796
7240
|
}
|
|
6797
7241
|
async update(checkId, params) {
|
|
6798
7242
|
const { intervalSec, timeoutSec, expectedStatus, ...rest } = params;
|
|
@@ -6806,7 +7250,7 @@ var HealthChecks = class {
|
|
|
6806
7250
|
`/health-checks/${checkId}`,
|
|
6807
7251
|
body5
|
|
6808
7252
|
);
|
|
6809
|
-
return
|
|
7253
|
+
return unwrap38(data);
|
|
6810
7254
|
}
|
|
6811
7255
|
async delete(checkId) {
|
|
6812
7256
|
await this.http.delete(`/health-checks/${checkId}`);
|
|
@@ -6814,7 +7258,7 @@ var HealthChecks = class {
|
|
|
6814
7258
|
};
|
|
6815
7259
|
|
|
6816
7260
|
// src/resources/integrations.ts
|
|
6817
|
-
function
|
|
7261
|
+
function unwrap39(payload) {
|
|
6818
7262
|
if (payload && typeof payload === "object") {
|
|
6819
7263
|
const p = payload;
|
|
6820
7264
|
for (const k of ["data", "integrations", "catalog", "items"]) {
|
|
@@ -6824,7 +7268,7 @@ function unwrap38(payload) {
|
|
|
6824
7268
|
return payload;
|
|
6825
7269
|
}
|
|
6826
7270
|
function listItems8(payload) {
|
|
6827
|
-
const result =
|
|
7271
|
+
const result = unwrap39(payload);
|
|
6828
7272
|
if (Array.isArray(result)) return result;
|
|
6829
7273
|
return [];
|
|
6830
7274
|
}
|
|
@@ -6853,14 +7297,14 @@ var Integrations = class {
|
|
|
6853
7297
|
const data = await this.http.get(
|
|
6854
7298
|
`/integrations/${provider}/start`
|
|
6855
7299
|
);
|
|
6856
|
-
return
|
|
7300
|
+
return unwrap39(data);
|
|
6857
7301
|
}
|
|
6858
7302
|
/** Force-refresh the access token for a provider. */
|
|
6859
7303
|
async refresh(provider) {
|
|
6860
7304
|
const data = await this.http.post(
|
|
6861
7305
|
`/integrations/${provider}/refresh`
|
|
6862
7306
|
);
|
|
6863
|
-
return
|
|
7307
|
+
return unwrap39(data);
|
|
6864
7308
|
}
|
|
6865
7309
|
/** Disconnect (revoke) an integration. */
|
|
6866
7310
|
async disconnect(provider) {
|
|
@@ -6885,7 +7329,7 @@ var Integrations = class {
|
|
|
6885
7329
|
"/integrations/slack/send-test",
|
|
6886
7330
|
body5
|
|
6887
7331
|
);
|
|
6888
|
-
return
|
|
7332
|
+
return unwrap39(data);
|
|
6889
7333
|
}
|
|
6890
7334
|
/** Send a test message to the connected Discord channel. */
|
|
6891
7335
|
async discordSendTest(params = {}) {
|
|
@@ -6894,13 +7338,13 @@ var Integrations = class {
|
|
|
6894
7338
|
"/integrations/discord/send-test",
|
|
6895
7339
|
body5
|
|
6896
7340
|
);
|
|
6897
|
-
return
|
|
7341
|
+
return unwrap39(data);
|
|
6898
7342
|
}
|
|
6899
7343
|
// ── Linear dedicated controller ────────────────────────────────────────────
|
|
6900
7344
|
/** Begin Linear OAuth — Linear has provider-specific error shapes. */
|
|
6901
7345
|
async linearStart() {
|
|
6902
7346
|
const data = await this.http.get("/integrations/linear/start");
|
|
6903
|
-
return
|
|
7347
|
+
return unwrap39(data);
|
|
6904
7348
|
}
|
|
6905
7349
|
/** Create a Linear issue via the connected workspace. */
|
|
6906
7350
|
async linearCreateIssue(params = {}) {
|
|
@@ -6909,12 +7353,12 @@ var Integrations = class {
|
|
|
6909
7353
|
"/integrations/linear/create-issue",
|
|
6910
7354
|
body5
|
|
6911
7355
|
);
|
|
6912
|
-
return
|
|
7356
|
+
return unwrap39(data);
|
|
6913
7357
|
}
|
|
6914
7358
|
};
|
|
6915
7359
|
|
|
6916
7360
|
// src/resources/mcp.ts
|
|
6917
|
-
function
|
|
7361
|
+
function unwrap40(payload) {
|
|
6918
7362
|
if (payload && typeof payload === "object") {
|
|
6919
7363
|
const p = payload;
|
|
6920
7364
|
for (const k of ["data", "mcp", "result", "items"]) {
|
|
@@ -6940,7 +7384,7 @@ var Mcp = class {
|
|
|
6940
7384
|
"/mcp",
|
|
6941
7385
|
Object.keys(body5).length > 0 ? body5 : void 0
|
|
6942
7386
|
);
|
|
6943
|
-
return
|
|
7387
|
+
return unwrap40(data);
|
|
6944
7388
|
}
|
|
6945
7389
|
/**
|
|
6946
7390
|
* Open the MCP listen channel (GET).
|
|
@@ -6950,7 +7394,7 @@ var Mcp = class {
|
|
|
6950
7394
|
*/
|
|
6951
7395
|
async listen() {
|
|
6952
7396
|
const data = await this.http.get("/mcp");
|
|
6953
|
-
return
|
|
7397
|
+
return unwrap40(data);
|
|
6954
7398
|
}
|
|
6955
7399
|
/** Close (terminate) the MCP session. */
|
|
6956
7400
|
async close() {
|
|
@@ -6959,7 +7403,7 @@ var Mcp = class {
|
|
|
6959
7403
|
};
|
|
6960
7404
|
|
|
6961
7405
|
// src/resources/models.ts
|
|
6962
|
-
function
|
|
7406
|
+
function unwrap41(data) {
|
|
6963
7407
|
if (Array.isArray(data)) return data;
|
|
6964
7408
|
if (data && typeof data === "object") {
|
|
6965
7409
|
const d = data;
|
|
@@ -6980,7 +7424,7 @@ var Models = class {
|
|
|
6980
7424
|
Object.entries(filters).filter(([, v]) => v !== void 0)
|
|
6981
7425
|
);
|
|
6982
7426
|
const data = await this.http.get("/intelligence/models", query3);
|
|
6983
|
-
return
|
|
7427
|
+
return unwrap41(data);
|
|
6984
7428
|
}
|
|
6985
7429
|
/**
|
|
6986
7430
|
* Get a single model by id.
|
|
@@ -7636,7 +8080,7 @@ function requestBody(params) {
|
|
|
7636
8080
|
config: authConfig(params)
|
|
7637
8081
|
});
|
|
7638
8082
|
}
|
|
7639
|
-
function
|
|
8083
|
+
function unwrap42(payload) {
|
|
7640
8084
|
if (payload && typeof payload === "object") {
|
|
7641
8085
|
const p = payload;
|
|
7642
8086
|
for (const k of ["data", "project_auth", "config", "items"]) {
|
|
@@ -7661,13 +8105,13 @@ var ProjectAuth = class {
|
|
|
7661
8105
|
"/project-auth/status",
|
|
7662
8106
|
resourcePayload(params)
|
|
7663
8107
|
);
|
|
7664
|
-
return
|
|
8108
|
+
return unwrap42(data);
|
|
7665
8109
|
}
|
|
7666
8110
|
/** Enable project auth. */
|
|
7667
8111
|
async enable(params) {
|
|
7668
8112
|
const body5 = requestBody(params);
|
|
7669
8113
|
const data = await this.http.post("/project-auth/enable", body5);
|
|
7670
|
-
return
|
|
8114
|
+
return unwrap42(data);
|
|
7671
8115
|
}
|
|
7672
8116
|
/** Disable project auth. */
|
|
7673
8117
|
async disable(params) {
|
|
@@ -7675,18 +8119,18 @@ var ProjectAuth = class {
|
|
|
7675
8119
|
"/project-auth/disable",
|
|
7676
8120
|
resourcePayload(params)
|
|
7677
8121
|
);
|
|
7678
|
-
return
|
|
8122
|
+
return unwrap42(data);
|
|
7679
8123
|
}
|
|
7680
8124
|
/** Update project-auth configuration. */
|
|
7681
8125
|
async update(params) {
|
|
7682
8126
|
const body5 = requestBody(params);
|
|
7683
8127
|
const data = await this.http.patch("/project-auth/config", body5);
|
|
7684
|
-
return
|
|
8128
|
+
return unwrap42(data);
|
|
7685
8129
|
}
|
|
7686
8130
|
};
|
|
7687
8131
|
|
|
7688
8132
|
// src/resources/project-integrations.ts
|
|
7689
|
-
function
|
|
8133
|
+
function unwrap43(payload) {
|
|
7690
8134
|
if (payload && typeof payload === "object") {
|
|
7691
8135
|
const p = payload;
|
|
7692
8136
|
for (const k of ["data", "project_integrations", "catalog", "items"]) {
|
|
@@ -7696,7 +8140,7 @@ function unwrap42(payload) {
|
|
|
7696
8140
|
return payload;
|
|
7697
8141
|
}
|
|
7698
8142
|
function listItems9(payload) {
|
|
7699
|
-
const result =
|
|
8143
|
+
const result = unwrap43(payload);
|
|
7700
8144
|
if (Array.isArray(result)) return result;
|
|
7701
8145
|
return [];
|
|
7702
8146
|
}
|
|
@@ -7731,13 +8175,13 @@ var ProjectIntegrations = class {
|
|
|
7731
8175
|
const data = await this.http.get(
|
|
7732
8176
|
`/project-integrations/${integrationId}`
|
|
7733
8177
|
);
|
|
7734
|
-
return
|
|
8178
|
+
return unwrap43(data);
|
|
7735
8179
|
}
|
|
7736
8180
|
/** Create a project integration. */
|
|
7737
8181
|
async create(params) {
|
|
7738
8182
|
const body5 = stripUndefObj2(params);
|
|
7739
8183
|
const data = await this.http.post("/project-integrations", body5);
|
|
7740
|
-
return
|
|
8184
|
+
return unwrap43(data);
|
|
7741
8185
|
}
|
|
7742
8186
|
/** Update a project integration. */
|
|
7743
8187
|
async update(integrationId, params) {
|
|
@@ -7746,7 +8190,7 @@ var ProjectIntegrations = class {
|
|
|
7746
8190
|
`/project-integrations/${integrationId}`,
|
|
7747
8191
|
body5
|
|
7748
8192
|
);
|
|
7749
|
-
return
|
|
8193
|
+
return unwrap43(data);
|
|
7750
8194
|
}
|
|
7751
8195
|
/** Delete a project integration. */
|
|
7752
8196
|
async delete(integrationId) {
|
|
@@ -7755,7 +8199,7 @@ var ProjectIntegrations = class {
|
|
|
7755
8199
|
};
|
|
7756
8200
|
|
|
7757
8201
|
// src/resources/provider-defaults.ts
|
|
7758
|
-
function
|
|
8202
|
+
function unwrap44(data) {
|
|
7759
8203
|
if (data && typeof data === "object") {
|
|
7760
8204
|
const d = data;
|
|
7761
8205
|
for (const k of ["data", "defaults", "provider_defaults", "config"]) {
|
|
@@ -7771,7 +8215,7 @@ var ProviderDefaults = class {
|
|
|
7771
8215
|
http;
|
|
7772
8216
|
/** Get the current fleet-wide provider defaults. */
|
|
7773
8217
|
async list() {
|
|
7774
|
-
return
|
|
8218
|
+
return unwrap44(await this.http.get("/admin/provider-defaults"));
|
|
7775
8219
|
}
|
|
7776
8220
|
/** Return the defaults entry for a single provider, or {} if missing. */
|
|
7777
8221
|
async get(provider) {
|
|
@@ -7787,13 +8231,13 @@ var ProviderDefaults = class {
|
|
|
7787
8231
|
const body5 = Object.fromEntries(
|
|
7788
8232
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
7789
8233
|
);
|
|
7790
|
-
return
|
|
8234
|
+
return unwrap44(
|
|
7791
8235
|
await this.http.put("/admin/provider-defaults", body5)
|
|
7792
8236
|
);
|
|
7793
8237
|
}
|
|
7794
8238
|
// ── Per-tenant overrides ────────────────────────────────────────────────
|
|
7795
8239
|
async getTenant(tenantId) {
|
|
7796
|
-
return
|
|
8240
|
+
return unwrap44(
|
|
7797
8241
|
await this.http.get(
|
|
7798
8242
|
`/admin/tenants/${tenantId}/provider-config`
|
|
7799
8243
|
)
|
|
@@ -7803,7 +8247,7 @@ var ProviderDefaults = class {
|
|
|
7803
8247
|
const body5 = Object.fromEntries(
|
|
7804
8248
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
7805
8249
|
);
|
|
7806
|
-
return
|
|
8250
|
+
return unwrap44(
|
|
7807
8251
|
await this.http.put(
|
|
7808
8252
|
`/admin/tenants/${tenantId}/provider-config`,
|
|
7809
8253
|
body5
|
|
@@ -7816,7 +8260,7 @@ var ProviderDefaults = class {
|
|
|
7816
8260
|
};
|
|
7817
8261
|
|
|
7818
8262
|
// src/resources/regions.ts
|
|
7819
|
-
function
|
|
8263
|
+
function unwrap45(payload) {
|
|
7820
8264
|
if (payload && typeof payload === "object") {
|
|
7821
8265
|
const p = payload;
|
|
7822
8266
|
for (const k of [
|
|
@@ -7833,7 +8277,7 @@ function unwrap44(payload) {
|
|
|
7833
8277
|
return payload;
|
|
7834
8278
|
}
|
|
7835
8279
|
function listItems10(payload) {
|
|
7836
|
-
const result =
|
|
8280
|
+
const result = unwrap45(payload);
|
|
7837
8281
|
if (Array.isArray(result)) return result;
|
|
7838
8282
|
return [];
|
|
7839
8283
|
}
|
|
@@ -7850,7 +8294,7 @@ var Regions = class {
|
|
|
7850
8294
|
/** Get canonical compute catalog, including product templates and readiness. */
|
|
7851
8295
|
async catalog() {
|
|
7852
8296
|
const data = await this.http.get("/compute/catalog");
|
|
7853
|
-
return
|
|
8297
|
+
return unwrap45(data);
|
|
7854
8298
|
}
|
|
7855
8299
|
/** List available compute sizes. */
|
|
7856
8300
|
async listSizes() {
|
|
@@ -7860,7 +8304,7 @@ var Regions = class {
|
|
|
7860
8304
|
/** Get static compute pricing data. */
|
|
7861
8305
|
async pricing() {
|
|
7862
8306
|
const data = await this.http.get("/compute/pricing");
|
|
7863
|
-
return
|
|
8307
|
+
return unwrap45(data);
|
|
7864
8308
|
}
|
|
7865
8309
|
/** List community computer templates. */
|
|
7866
8310
|
async listTemplates() {
|
|
@@ -7872,12 +8316,12 @@ var Regions = class {
|
|
|
7872
8316
|
const data = await this.http.get(
|
|
7873
8317
|
`/compute/templates/${templateId}`
|
|
7874
8318
|
);
|
|
7875
|
-
return
|
|
8319
|
+
return unwrap45(data);
|
|
7876
8320
|
}
|
|
7877
8321
|
};
|
|
7878
8322
|
|
|
7879
8323
|
// src/resources/runtime-env.ts
|
|
7880
|
-
function
|
|
8324
|
+
function unwrap46(payload) {
|
|
7881
8325
|
if (payload !== null && typeof payload === "object" && "data" in payload && payload.data !== void 0) {
|
|
7882
8326
|
return payload.data;
|
|
7883
8327
|
}
|
|
@@ -7930,11 +8374,11 @@ var RuntimeEnv = class {
|
|
|
7930
8374
|
"/runtime-env",
|
|
7931
8375
|
query2(params)
|
|
7932
8376
|
);
|
|
7933
|
-
return
|
|
8377
|
+
return unwrap46(response).map(normalize2);
|
|
7934
8378
|
}
|
|
7935
8379
|
async get(id) {
|
|
7936
8380
|
return normalize2(
|
|
7937
|
-
|
|
8381
|
+
unwrap46(
|
|
7938
8382
|
await this.http.get(
|
|
7939
8383
|
`/runtime-env/${encodeURIComponent(id)}`
|
|
7940
8384
|
)
|
|
@@ -7943,7 +8387,7 @@ var RuntimeEnv = class {
|
|
|
7943
8387
|
}
|
|
7944
8388
|
async set(params) {
|
|
7945
8389
|
return normalize2(
|
|
7946
|
-
|
|
8390
|
+
unwrap46(
|
|
7947
8391
|
await this.http.post(
|
|
7948
8392
|
"/runtime-env",
|
|
7949
8393
|
body4(params)
|
|
@@ -7957,7 +8401,7 @@ var RuntimeEnv = class {
|
|
|
7957
8401
|
};
|
|
7958
8402
|
|
|
7959
8403
|
// src/resources/runtime-capabilities.ts
|
|
7960
|
-
function
|
|
8404
|
+
function unwrap47(payload) {
|
|
7961
8405
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
7962
8406
|
return payload.data;
|
|
7963
8407
|
}
|
|
@@ -7969,7 +8413,7 @@ var RuntimeCapabilitiesResource = class {
|
|
|
7969
8413
|
}
|
|
7970
8414
|
http;
|
|
7971
8415
|
async get() {
|
|
7972
|
-
return
|
|
8416
|
+
return unwrap47(
|
|
7973
8417
|
await this.http.get("/runtime-capabilities")
|
|
7974
8418
|
);
|
|
7975
8419
|
}
|
|
@@ -7999,7 +8443,7 @@ var AGENT_WORKSPACE_KEEP_LAST_SNAPSHOTS = 1;
|
|
|
7999
8443
|
function isLegacyForkParams(opts) {
|
|
8000
8444
|
return "name" in opts || "metadata" in opts;
|
|
8001
8445
|
}
|
|
8002
|
-
function
|
|
8446
|
+
function unwrap48(payload) {
|
|
8003
8447
|
if (payload !== null && typeof payload === "object" && "data" in payload && payload.data !== void 0) {
|
|
8004
8448
|
return payload.data;
|
|
8005
8449
|
}
|
|
@@ -8266,7 +8710,7 @@ var SandboxTerminal = class {
|
|
|
8266
8710
|
const body5 = Object.fromEntries(
|
|
8267
8711
|
Object.entries(params).filter(([, v]) => v !== void 0)
|
|
8268
8712
|
);
|
|
8269
|
-
const response =
|
|
8713
|
+
const response = unwrap48(
|
|
8270
8714
|
await this.sandbox.http.post(`/sandboxes/${this.sandbox.id}/terminal`, body5)
|
|
8271
8715
|
);
|
|
8272
8716
|
return response;
|
|
@@ -8324,7 +8768,7 @@ var SandboxPreviews = class {
|
|
|
8324
8768
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
8325
8769
|
)
|
|
8326
8770
|
};
|
|
8327
|
-
return
|
|
8771
|
+
return unwrap48(
|
|
8328
8772
|
await this.http.post(
|
|
8329
8773
|
`/sandboxes/${this.sandbox.id}/previews`,
|
|
8330
8774
|
body5
|
|
@@ -8332,7 +8776,7 @@ var SandboxPreviews = class {
|
|
|
8332
8776
|
);
|
|
8333
8777
|
}
|
|
8334
8778
|
async get(previewId) {
|
|
8335
|
-
return
|
|
8779
|
+
return unwrap48(
|
|
8336
8780
|
await this.http.get(
|
|
8337
8781
|
`/sandboxes/${this.sandbox.id}/previews/${previewId}`
|
|
8338
8782
|
)
|
|
@@ -8345,7 +8789,7 @@ var SandboxPreviews = class {
|
|
|
8345
8789
|
}
|
|
8346
8790
|
/** Mint a share token for previewId. */
|
|
8347
8791
|
async share(previewId, opts = {}) {
|
|
8348
|
-
return
|
|
8792
|
+
return unwrap48(
|
|
8349
8793
|
await this.http.post(
|
|
8350
8794
|
`/sandboxes/${this.sandbox.id}/previews/${previewId}/share`,
|
|
8351
8795
|
{ ttl_seconds: opts.ttl_seconds ?? opts.expires_in_sec ?? 3600 }
|
|
@@ -8414,7 +8858,7 @@ var SandboxTags = class {
|
|
|
8414
8858
|
sandbox;
|
|
8415
8859
|
/** Replace the full tag list with tags. */
|
|
8416
8860
|
async set(tags) {
|
|
8417
|
-
return
|
|
8861
|
+
return unwrap48(
|
|
8418
8862
|
await this.sandbox.http.patch(`/sandboxes/${this.sandbox.id}/tags`, { tags })
|
|
8419
8863
|
);
|
|
8420
8864
|
}
|
|
@@ -8488,7 +8932,7 @@ var Sandbox = class _Sandbox {
|
|
|
8488
8932
|
return this.data.template_id ?? this.data.image_id ?? "";
|
|
8489
8933
|
}
|
|
8490
8934
|
async refresh() {
|
|
8491
|
-
this.data =
|
|
8935
|
+
this.data = unwrap48(
|
|
8492
8936
|
await this.http.get(`/sandboxes/${this.id}`)
|
|
8493
8937
|
);
|
|
8494
8938
|
return this;
|
|
@@ -8530,7 +8974,7 @@ var Sandbox = class _Sandbox {
|
|
|
8530
8974
|
}
|
|
8531
8975
|
async runExec(command, options) {
|
|
8532
8976
|
this.assertRunning("exec");
|
|
8533
|
-
const response =
|
|
8977
|
+
const response = unwrap48(
|
|
8534
8978
|
await this.http.post(
|
|
8535
8979
|
`/sandboxes/${this.id}/exec`,
|
|
8536
8980
|
execBody(command, options)
|
|
@@ -8575,7 +9019,7 @@ var Sandbox = class _Sandbox {
|
|
|
8575
9019
|
}
|
|
8576
9020
|
async createExport(params) {
|
|
8577
9021
|
const body5 = typeof params === "string" ? { path: params } : Array.isArray(params) ? { paths: params } : params;
|
|
8578
|
-
const response =
|
|
9022
|
+
const response = unwrap48(
|
|
8579
9023
|
await this.http.post(
|
|
8580
9024
|
`/sandboxes/${this.id}/exports`,
|
|
8581
9025
|
body5
|
|
@@ -8600,7 +9044,7 @@ var Sandbox = class _Sandbox {
|
|
|
8600
9044
|
}
|
|
8601
9045
|
async listFiles(path = "/workspace") {
|
|
8602
9046
|
this.assertRunning("files.list");
|
|
8603
|
-
const response =
|
|
9047
|
+
const response = unwrap48(
|
|
8604
9048
|
await this.http.get(
|
|
8605
9049
|
`/sandboxes/${this.id}/files`,
|
|
8606
9050
|
{ path }
|
|
@@ -8610,7 +9054,7 @@ var Sandbox = class _Sandbox {
|
|
|
8610
9054
|
}
|
|
8611
9055
|
async statFile(path) {
|
|
8612
9056
|
this.assertRunning("files.stat");
|
|
8613
|
-
return
|
|
9057
|
+
return unwrap48(
|
|
8614
9058
|
await this.http.post(
|
|
8615
9059
|
`/sandboxes/${this.id}/files/stat`,
|
|
8616
9060
|
{ path }
|
|
@@ -8630,7 +9074,7 @@ var Sandbox = class _Sandbox {
|
|
|
8630
9074
|
}
|
|
8631
9075
|
async exposeInfo(port) {
|
|
8632
9076
|
this.assertRunning("expose");
|
|
8633
|
-
const response =
|
|
9077
|
+
const response = unwrap48(
|
|
8634
9078
|
await this.http.post(
|
|
8635
9079
|
`/sandboxes/${this.id}/expose`,
|
|
8636
9080
|
port === void 0 ? {} : { port }
|
|
@@ -8640,7 +9084,7 @@ var Sandbox = class _Sandbox {
|
|
|
8640
9084
|
}
|
|
8641
9085
|
async startTemplate(options = {}) {
|
|
8642
9086
|
this.assertRunning("startTemplate");
|
|
8643
|
-
return
|
|
9087
|
+
return unwrap48(
|
|
8644
9088
|
await this.http.post(
|
|
8645
9089
|
`/sandboxes/${this.id}/template/start`,
|
|
8646
9090
|
options
|
|
@@ -8648,7 +9092,7 @@ var Sandbox = class _Sandbox {
|
|
|
8648
9092
|
);
|
|
8649
9093
|
}
|
|
8650
9094
|
async getArtifacts() {
|
|
8651
|
-
return
|
|
9095
|
+
return unwrap48(
|
|
8652
9096
|
await this.http.get(
|
|
8653
9097
|
`/sandboxes/${this.id}/artifacts`
|
|
8654
9098
|
)
|
|
@@ -8659,7 +9103,7 @@ var Sandbox = class _Sandbox {
|
|
|
8659
9103
|
`/sandboxes/${this.id}/logs`,
|
|
8660
9104
|
{ lines }
|
|
8661
9105
|
);
|
|
8662
|
-
return
|
|
9106
|
+
return unwrap48(response);
|
|
8663
9107
|
}
|
|
8664
9108
|
streamLogs() {
|
|
8665
9109
|
return this.http.stream(
|
|
@@ -8667,7 +9111,7 @@ var Sandbox = class _Sandbox {
|
|
|
8667
9111
|
);
|
|
8668
9112
|
}
|
|
8669
9113
|
async metrics(window2 = "1h") {
|
|
8670
|
-
return
|
|
9114
|
+
return unwrap48(
|
|
8671
9115
|
await this.http.get(
|
|
8672
9116
|
`/sandboxes/${this.id}/metrics`,
|
|
8673
9117
|
{ window: window2 }
|
|
@@ -8679,7 +9123,7 @@ var Sandbox = class _Sandbox {
|
|
|
8679
9123
|
}
|
|
8680
9124
|
async createSnapshot(comment) {
|
|
8681
9125
|
this.assertRunning("snapshots.create");
|
|
8682
|
-
return
|
|
9126
|
+
return unwrap48(
|
|
8683
9127
|
await this.http.post(
|
|
8684
9128
|
`/sandboxes/${this.id}/snapshots`,
|
|
8685
9129
|
comment ? { comment } : {}
|
|
@@ -8687,14 +9131,14 @@ var Sandbox = class _Sandbox {
|
|
|
8687
9131
|
);
|
|
8688
9132
|
}
|
|
8689
9133
|
async listSnapshots() {
|
|
8690
|
-
return
|
|
9134
|
+
return unwrap48(
|
|
8691
9135
|
await this.http.get(
|
|
8692
9136
|
`/sandboxes/${this.id}/snapshots`
|
|
8693
9137
|
)
|
|
8694
9138
|
);
|
|
8695
9139
|
}
|
|
8696
9140
|
async restoreSnapshot(snapshotId) {
|
|
8697
|
-
const data =
|
|
9141
|
+
const data = unwrap48(
|
|
8698
9142
|
await this.http.post(
|
|
8699
9143
|
`/sandboxes/${this.id}/restore/${snapshotId}`,
|
|
8700
9144
|
{}
|
|
@@ -8711,11 +9155,12 @@ var Sandbox = class _Sandbox {
|
|
|
8711
9155
|
}
|
|
8712
9156
|
this.assertRunning("fork");
|
|
8713
9157
|
const body5 = stripUndefined26({
|
|
9158
|
+
snapshot_id: opts.snapshotId ?? opts.snapshot_id,
|
|
8714
9159
|
timeout_sec: opts.timeoutSec ?? opts.timeout_sec,
|
|
8715
9160
|
template_id: opts.templateId ?? opts.template_id
|
|
8716
9161
|
});
|
|
8717
9162
|
const idempotencyKey11 = opts.idempotencyKey ?? opts.idempotency_key;
|
|
8718
|
-
const data =
|
|
9163
|
+
const data = unwrap48(
|
|
8719
9164
|
await this.http.request(
|
|
8720
9165
|
`/sandboxes/${this.id}/fork`,
|
|
8721
9166
|
{
|
|
@@ -8731,13 +9176,14 @@ var Sandbox = class _Sandbox {
|
|
|
8731
9176
|
async forkLegacy(opts = {}) {
|
|
8732
9177
|
this.assertRunning("fork");
|
|
8733
9178
|
const body5 = stripUndefined26({
|
|
9179
|
+
snapshot_id: opts.snapshotId ?? opts.snapshot_id,
|
|
8734
9180
|
timeout_sec: opts.timeoutSec ?? opts.timeout_sec,
|
|
8735
9181
|
template_id: opts.templateId ?? opts.template_id,
|
|
8736
9182
|
name: opts.name,
|
|
8737
9183
|
metadata: opts.metadata
|
|
8738
9184
|
});
|
|
8739
9185
|
const idempotencyKey11 = opts.idempotencyKey ?? opts.idempotency_key;
|
|
8740
|
-
const data =
|
|
9186
|
+
const data = unwrap48(
|
|
8741
9187
|
await this.http.request(
|
|
8742
9188
|
`/sandboxes/${this.id}/fork`,
|
|
8743
9189
|
{
|
|
@@ -8773,7 +9219,7 @@ var Sandbox = class _Sandbox {
|
|
|
8773
9219
|
timeout_sec: params.timeout_sec ?? params.timeoutSec,
|
|
8774
9220
|
idle_timeout_sec: params.idle_timeout_sec ?? params.idleTimeoutSec
|
|
8775
9221
|
});
|
|
8776
|
-
const data =
|
|
9222
|
+
const data = unwrap48(
|
|
8777
9223
|
await this.http.patch(
|
|
8778
9224
|
`/sandboxes/${this.id}`,
|
|
8779
9225
|
body5
|
|
@@ -8783,7 +9229,7 @@ var Sandbox = class _Sandbox {
|
|
|
8783
9229
|
return this;
|
|
8784
9230
|
}
|
|
8785
9231
|
async extend(timeoutSec) {
|
|
8786
|
-
const data =
|
|
9232
|
+
const data = unwrap48(
|
|
8787
9233
|
await this.http.post(
|
|
8788
9234
|
`/sandboxes/${this.id}/extend`,
|
|
8789
9235
|
timeoutSec === void 0 ? {} : { timeout_sec: timeoutSec }
|
|
@@ -8793,7 +9239,7 @@ var Sandbox = class _Sandbox {
|
|
|
8793
9239
|
return this;
|
|
8794
9240
|
}
|
|
8795
9241
|
async usage() {
|
|
8796
|
-
return
|
|
9242
|
+
return unwrap48(
|
|
8797
9243
|
await this.http.get(
|
|
8798
9244
|
`/sandboxes/${this.id}/usage`
|
|
8799
9245
|
)
|
|
@@ -8813,7 +9259,7 @@ var Sandbox = class _Sandbox {
|
|
|
8813
9259
|
return raw;
|
|
8814
9260
|
}
|
|
8815
9261
|
async pause() {
|
|
8816
|
-
const data =
|
|
9262
|
+
const data = unwrap48(
|
|
8817
9263
|
await this.http.post(
|
|
8818
9264
|
`/sandboxes/${this.id}/pause`,
|
|
8819
9265
|
{}
|
|
@@ -8834,7 +9280,7 @@ var Sandbox = class _Sandbox {
|
|
|
8834
9280
|
`/sandboxes/${this.id}/resume`,
|
|
8835
9281
|
{}
|
|
8836
9282
|
);
|
|
8837
|
-
const data =
|
|
9283
|
+
const data = unwrap48(response);
|
|
8838
9284
|
this.data = { ...this.data, ...data };
|
|
8839
9285
|
return this;
|
|
8840
9286
|
}
|
|
@@ -8865,7 +9311,7 @@ var Sandbox = class _Sandbox {
|
|
|
8865
9311
|
if (idempotencyKey11) {
|
|
8866
9312
|
requestOptions.headers = { "Idempotency-Key": idempotencyKey11 };
|
|
8867
9313
|
}
|
|
8868
|
-
return
|
|
9314
|
+
return unwrap48(
|
|
8869
9315
|
await this.http.request(
|
|
8870
9316
|
`/sandboxes/${this.id}/deploy`,
|
|
8871
9317
|
requestOptions
|
|
@@ -8875,9 +9321,57 @@ var Sandbox = class _Sandbox {
|
|
|
8875
9321
|
async deployDocker(params = {}) {
|
|
8876
9322
|
return this.deploy({ ...params, deploymentType: "docker_deploy" });
|
|
8877
9323
|
}
|
|
9324
|
+
/** Deploy an immutable snapshot without modifying the editable sandbox. */
|
|
9325
|
+
async deploySnapshot(snapshotId, params = {}, options = {}) {
|
|
9326
|
+
const release = await this.forkLegacy({
|
|
9327
|
+
snapshotId,
|
|
9328
|
+
name: `release-${snapshotId.slice(0, 12)}`,
|
|
9329
|
+
metadata: { release_source_sandbox_id: this.id, snapshot_id: snapshotId },
|
|
9330
|
+
...options.forkIdempotencyKey ? { idempotencyKey: options.forkIdempotencyKey } : {}
|
|
9331
|
+
});
|
|
9332
|
+
const cleanupRequested = options.cleanup !== false;
|
|
9333
|
+
const destroyRelease = async () => {
|
|
9334
|
+
if (!cleanupRequested) return void 0;
|
|
9335
|
+
try {
|
|
9336
|
+
await release.destroy();
|
|
9337
|
+
return void 0;
|
|
9338
|
+
} catch (error) {
|
|
9339
|
+
return error instanceof Error ? error.message : String(error);
|
|
9340
|
+
}
|
|
9341
|
+
};
|
|
9342
|
+
let result;
|
|
9343
|
+
try {
|
|
9344
|
+
result = await release.deploy(params) ?? {};
|
|
9345
|
+
} catch (error) {
|
|
9346
|
+
const failedCleanup = await destroyRelease();
|
|
9347
|
+
if (cleanupRequested && failedCleanup === void 0) throw error;
|
|
9348
|
+
const leak = {
|
|
9349
|
+
release_sandbox_id: release.id
|
|
9350
|
+
};
|
|
9351
|
+
if (failedCleanup !== void 0) {
|
|
9352
|
+
leak.release_cleanup_error = failedCleanup;
|
|
9353
|
+
}
|
|
9354
|
+
if (typeof error === "object" && error !== null) {
|
|
9355
|
+
throw Object.assign(error, leak);
|
|
9356
|
+
}
|
|
9357
|
+
throw Object.assign(
|
|
9358
|
+
new Error(`Snapshot deployment failed: ${String(error)}`, {
|
|
9359
|
+
cause: error
|
|
9360
|
+
}),
|
|
9361
|
+
leak
|
|
9362
|
+
);
|
|
9363
|
+
}
|
|
9364
|
+
const cleanupErrorMessage = await destroyRelease();
|
|
9365
|
+
result.source_snapshot_id = snapshotId;
|
|
9366
|
+
result.release_sandbox_id = release.id;
|
|
9367
|
+
if (cleanupErrorMessage !== void 0) {
|
|
9368
|
+
result.release_cleanup_error = cleanupErrorMessage;
|
|
9369
|
+
}
|
|
9370
|
+
return result;
|
|
9371
|
+
}
|
|
8878
9372
|
/** Check readiness of the sandbox (GET /sandboxes/:id/readiness). */
|
|
8879
9373
|
async readiness() {
|
|
8880
|
-
return
|
|
9374
|
+
return unwrap48(
|
|
8881
9375
|
await this.http.get(
|
|
8882
9376
|
`/sandboxes/${this.id}/readiness`
|
|
8883
9377
|
)
|
|
@@ -9045,7 +9539,7 @@ var Sandboxes = class {
|
|
|
9045
9539
|
if (idempotencyKey11) {
|
|
9046
9540
|
requestOptions.headers = { "Idempotency-Key": idempotencyKey11 };
|
|
9047
9541
|
}
|
|
9048
|
-
const data =
|
|
9542
|
+
const data = unwrap48(
|
|
9049
9543
|
await this.http.request(
|
|
9050
9544
|
"/sandboxes",
|
|
9051
9545
|
requestOptions
|
|
@@ -9064,7 +9558,7 @@ var Sandboxes = class {
|
|
|
9064
9558
|
return listItems11(data).map((item) => new Sandbox(this.http, item));
|
|
9065
9559
|
}
|
|
9066
9560
|
async get(id) {
|
|
9067
|
-
const data =
|
|
9561
|
+
const data = unwrap48(
|
|
9068
9562
|
await this.http.get(`/sandboxes/${id}`)
|
|
9069
9563
|
);
|
|
9070
9564
|
return new Sandbox(this.http, data);
|
|
@@ -9092,7 +9586,7 @@ var Sandboxes = class {
|
|
|
9092
9586
|
return this.get(id);
|
|
9093
9587
|
}
|
|
9094
9588
|
async getByName(name) {
|
|
9095
|
-
const data =
|
|
9589
|
+
const data = unwrap48(
|
|
9096
9590
|
await this.http.get(
|
|
9097
9591
|
`/sandboxes/by-name/${encodeURIComponent(name)}`
|
|
9098
9592
|
)
|
|
@@ -9139,7 +9633,7 @@ var Sandboxes = class {
|
|
|
9139
9633
|
);
|
|
9140
9634
|
}
|
|
9141
9635
|
async validateBuildSpec(buildSpec) {
|
|
9142
|
-
return
|
|
9636
|
+
return unwrap48(
|
|
9143
9637
|
await this.http.post(
|
|
9144
9638
|
"/sandbox-templates/validate",
|
|
9145
9639
|
{
|
|
@@ -9159,7 +9653,7 @@ var Sandboxes = class {
|
|
|
9159
9653
|
metadata: params.metadata
|
|
9160
9654
|
})
|
|
9161
9655
|
);
|
|
9162
|
-
return
|
|
9656
|
+
return unwrap48(response);
|
|
9163
9657
|
}
|
|
9164
9658
|
async createTemplateBuild(templateId, params = {}) {
|
|
9165
9659
|
const response = await this.http.post(
|
|
@@ -9169,19 +9663,19 @@ var Sandboxes = class {
|
|
|
9169
9663
|
metadata: params.metadata
|
|
9170
9664
|
})
|
|
9171
9665
|
);
|
|
9172
|
-
return
|
|
9666
|
+
return unwrap48(response);
|
|
9173
9667
|
}
|
|
9174
9668
|
async listTemplateBuilds(templateId) {
|
|
9175
9669
|
const response = await this.http.get(
|
|
9176
9670
|
`/sandbox-templates/${templateId}/builds`
|
|
9177
9671
|
);
|
|
9178
|
-
return
|
|
9672
|
+
return unwrap48(response);
|
|
9179
9673
|
}
|
|
9180
9674
|
async getTemplateBuild(buildId) {
|
|
9181
9675
|
const response = await this.http.get(
|
|
9182
9676
|
`/sandbox-template-builds/${buildId}`
|
|
9183
9677
|
);
|
|
9184
|
-
return
|
|
9678
|
+
return unwrap48(response);
|
|
9185
9679
|
}
|
|
9186
9680
|
};
|
|
9187
9681
|
function toBase642(bytes) {
|
|
@@ -9213,7 +9707,7 @@ function previewInfoFromResponse(response) {
|
|
|
9213
9707
|
)
|
|
9214
9708
|
};
|
|
9215
9709
|
}
|
|
9216
|
-
function
|
|
9710
|
+
function unwrap49(payload) {
|
|
9217
9711
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
9218
9712
|
return payload.data;
|
|
9219
9713
|
}
|
|
@@ -9256,7 +9750,7 @@ var SandboxTemplates = class {
|
|
|
9256
9750
|
const data = await this.http.get(
|
|
9257
9751
|
`/sandbox-templates/${templateId}`
|
|
9258
9752
|
);
|
|
9259
|
-
return
|
|
9753
|
+
return unwrap49(data);
|
|
9260
9754
|
}
|
|
9261
9755
|
async create(params) {
|
|
9262
9756
|
const {
|
|
@@ -9276,7 +9770,7 @@ var SandboxTemplates = class {
|
|
|
9276
9770
|
body: body5,
|
|
9277
9771
|
headers: { "Idempotency-Key": idempotencyKey8(ikey) }
|
|
9278
9772
|
});
|
|
9279
|
-
return
|
|
9773
|
+
return unwrap49(data);
|
|
9280
9774
|
}
|
|
9281
9775
|
async buildSpecSchema() {
|
|
9282
9776
|
const data = await this.http.get("/sandbox-templates/build-spec");
|
|
@@ -9309,12 +9803,12 @@ var SandboxTemplates = class {
|
|
|
9309
9803
|
headers: { "Idempotency-Key": idempotencyKey8(ikey) }
|
|
9310
9804
|
}
|
|
9311
9805
|
);
|
|
9312
|
-
return
|
|
9806
|
+
return unwrap49(data);
|
|
9313
9807
|
}
|
|
9314
9808
|
};
|
|
9315
9809
|
|
|
9316
9810
|
// src/resources/settings.ts
|
|
9317
|
-
function
|
|
9811
|
+
function unwrap50(payload) {
|
|
9318
9812
|
if (payload && typeof payload === "object") {
|
|
9319
9813
|
const p = payload;
|
|
9320
9814
|
for (const k of [
|
|
@@ -9330,7 +9824,7 @@ function unwrap49(payload) {
|
|
|
9330
9824
|
return payload;
|
|
9331
9825
|
}
|
|
9332
9826
|
function listItems13(payload) {
|
|
9333
|
-
const result =
|
|
9827
|
+
const result = unwrap50(payload);
|
|
9334
9828
|
if (Array.isArray(result)) return result;
|
|
9335
9829
|
return [];
|
|
9336
9830
|
}
|
|
@@ -9347,46 +9841,46 @@ var Settings = class {
|
|
|
9347
9841
|
/** Get the current tenant settings. */
|
|
9348
9842
|
async get() {
|
|
9349
9843
|
const data = await this.http.get("/settings");
|
|
9350
|
-
return
|
|
9844
|
+
return unwrap50(data);
|
|
9351
9845
|
}
|
|
9352
9846
|
/** Update tenant settings. */
|
|
9353
9847
|
async update(params) {
|
|
9354
9848
|
const body5 = stripUndefined28(params);
|
|
9355
9849
|
const data = await this.http.put("/settings", body5);
|
|
9356
|
-
return
|
|
9850
|
+
return unwrap50(data);
|
|
9357
9851
|
}
|
|
9358
9852
|
// ── Branding ──────────────────────────────────────────────────────────────
|
|
9359
9853
|
/** Get tenant branding (logo, colors, custom wordmark). */
|
|
9360
9854
|
async getBranding() {
|
|
9361
9855
|
const data = await this.http.get("/settings/branding");
|
|
9362
|
-
return
|
|
9856
|
+
return unwrap50(data);
|
|
9363
9857
|
}
|
|
9364
9858
|
/** Update tenant branding. */
|
|
9365
9859
|
async updateBranding(params) {
|
|
9366
9860
|
const body5 = stripUndefined28(params);
|
|
9367
9861
|
const data = await this.http.put("/settings/branding", body5);
|
|
9368
|
-
return
|
|
9862
|
+
return unwrap50(data);
|
|
9369
9863
|
}
|
|
9370
9864
|
// ── Read-only reference data ───────────────────────────────────────────────
|
|
9371
9865
|
/** Get tenant-scoped compute pricing. */
|
|
9372
9866
|
async computePricing() {
|
|
9373
9867
|
const data = await this.http.get("/settings/compute-pricing");
|
|
9374
|
-
return
|
|
9868
|
+
return unwrap50(data);
|
|
9375
9869
|
}
|
|
9376
9870
|
/** Get tenant-scoped GPU pricing. */
|
|
9377
9871
|
async gpuPricing() {
|
|
9378
9872
|
const data = await this.http.get("/settings/gpu-pricing");
|
|
9379
|
-
return
|
|
9873
|
+
return unwrap50(data);
|
|
9380
9874
|
}
|
|
9381
9875
|
/** List models available to this tenant. */
|
|
9382
9876
|
async availableModels() {
|
|
9383
9877
|
const data = await this.http.get("/settings/available-models");
|
|
9384
|
-
return
|
|
9878
|
+
return unwrap50(data);
|
|
9385
9879
|
}
|
|
9386
9880
|
/** List regions enabled for this tenant. */
|
|
9387
9881
|
async regions() {
|
|
9388
9882
|
const data = await this.http.get("/settings/regions");
|
|
9389
|
-
return
|
|
9883
|
+
return unwrap50(data);
|
|
9390
9884
|
}
|
|
9391
9885
|
// ── BYOK provider keys ────────────────────────────────────────────────────
|
|
9392
9886
|
/** List tenant-level BYOK provider keys (Anthropic, OpenAI, etc.). */
|
|
@@ -9401,7 +9895,7 @@ var Settings = class {
|
|
|
9401
9895
|
`/settings/provider-keys/${provider}`,
|
|
9402
9896
|
body5
|
|
9403
9897
|
);
|
|
9404
|
-
return
|
|
9898
|
+
return unwrap50(data);
|
|
9405
9899
|
}
|
|
9406
9900
|
/** Delete a BYOK provider key. */
|
|
9407
9901
|
async deleteProviderKey(provider) {
|
|
@@ -9410,7 +9904,7 @@ var Settings = class {
|
|
|
9410
9904
|
};
|
|
9411
9905
|
|
|
9412
9906
|
// src/resources/snapshots-standalone.ts
|
|
9413
|
-
function
|
|
9907
|
+
function unwrap51(data) {
|
|
9414
9908
|
if (data && typeof data === "object") {
|
|
9415
9909
|
const d = data;
|
|
9416
9910
|
for (const k of ["data", "snapshots", "items"]) {
|
|
@@ -9441,14 +9935,14 @@ var SnapshotsStandalone = class {
|
|
|
9441
9935
|
return unwrapList14(await this.http.get("/admin/snapshots", query3));
|
|
9442
9936
|
}
|
|
9443
9937
|
async get(snapshotId) {
|
|
9444
|
-
return
|
|
9938
|
+
return unwrap51(
|
|
9445
9939
|
await this.http.get(`/admin/snapshots/${snapshotId}`)
|
|
9446
9940
|
);
|
|
9447
9941
|
}
|
|
9448
9942
|
};
|
|
9449
9943
|
|
|
9450
9944
|
// src/resources/storage.ts
|
|
9451
|
-
function
|
|
9945
|
+
function unwrap52(payload) {
|
|
9452
9946
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
9453
9947
|
return payload.data;
|
|
9454
9948
|
}
|
|
@@ -9487,11 +9981,11 @@ var Storage = class {
|
|
|
9487
9981
|
...rest
|
|
9488
9982
|
});
|
|
9489
9983
|
const data = await this.http.post("/storage/buckets", body5);
|
|
9490
|
-
return
|
|
9984
|
+
return unwrap52(data);
|
|
9491
9985
|
}
|
|
9492
9986
|
async getBucket(bucketId) {
|
|
9493
9987
|
const data = await this.http.get(`/storage/buckets/${bucketId}`);
|
|
9494
|
-
return
|
|
9988
|
+
return unwrap52(data);
|
|
9495
9989
|
}
|
|
9496
9990
|
async deleteBucket(bucketId) {
|
|
9497
9991
|
await this.http.delete(`/storage/buckets/${bucketId}`);
|
|
@@ -9541,7 +10035,7 @@ var Storage = class {
|
|
|
9541
10035
|
`/storage/buckets/${bucketId}/presign`,
|
|
9542
10036
|
body5
|
|
9543
10037
|
);
|
|
9544
|
-
return
|
|
10038
|
+
return unwrap52(data);
|
|
9545
10039
|
}
|
|
9546
10040
|
};
|
|
9547
10041
|
|
|
@@ -9681,7 +10175,7 @@ var Organizations = class {
|
|
|
9681
10175
|
};
|
|
9682
10176
|
|
|
9683
10177
|
// src/resources/tenant.ts
|
|
9684
|
-
function
|
|
10178
|
+
function unwrap53(payload) {
|
|
9685
10179
|
if (payload && typeof payload === "object") {
|
|
9686
10180
|
const p = payload;
|
|
9687
10181
|
for (const k of ["data", "tenant", "branding", "items"]) {
|
|
@@ -9703,14 +10197,14 @@ var PreviewDomain = class {
|
|
|
9703
10197
|
/** Get the tenant's white-label preview domain settings. */
|
|
9704
10198
|
async get() {
|
|
9705
10199
|
const data = await this.http.get("/tenant/preview-domain");
|
|
9706
|
-
return
|
|
10200
|
+
return unwrap53(data);
|
|
9707
10201
|
}
|
|
9708
10202
|
/** Set the tenant's white-label preview domain. */
|
|
9709
10203
|
async set(domain) {
|
|
9710
10204
|
const data = await this.http.put("/tenant/preview-domain", {
|
|
9711
10205
|
preview_domain: domain
|
|
9712
10206
|
});
|
|
9713
|
-
return
|
|
10207
|
+
return unwrap53(data);
|
|
9714
10208
|
}
|
|
9715
10209
|
/** Re-run DNS verification for the configured preview domain. */
|
|
9716
10210
|
async verify() {
|
|
@@ -9718,7 +10212,7 @@ var PreviewDomain = class {
|
|
|
9718
10212
|
"/tenant/preview-domain/verify",
|
|
9719
10213
|
{}
|
|
9720
10214
|
);
|
|
9721
|
-
return
|
|
10215
|
+
return unwrap53(data);
|
|
9722
10216
|
}
|
|
9723
10217
|
/** Remove the tenant's custom preview domain. */
|
|
9724
10218
|
async delete() {
|
|
@@ -9733,14 +10227,14 @@ var Branding = class {
|
|
|
9733
10227
|
/** Get tenant branding used by white-label hosted surfaces. */
|
|
9734
10228
|
async get() {
|
|
9735
10229
|
const data = await this.http.get("/tenant/branding");
|
|
9736
|
-
return
|
|
10230
|
+
return unwrap53(data);
|
|
9737
10231
|
}
|
|
9738
10232
|
/** Update tenant branding used by white-label hosted surfaces. */
|
|
9739
10233
|
async set(params) {
|
|
9740
10234
|
const data = await this.http.put("/tenant/branding", {
|
|
9741
10235
|
branding: stripUndefined30(params)
|
|
9742
10236
|
});
|
|
9743
|
-
return
|
|
10237
|
+
return unwrap53(data);
|
|
9744
10238
|
}
|
|
9745
10239
|
/** Reset tenant branding to platform defaults. */
|
|
9746
10240
|
async delete() {
|
|
@@ -9762,7 +10256,7 @@ var Tenant = class {
|
|
|
9762
10256
|
/** Get the current tenant's plan, limits, and live usage counters. */
|
|
9763
10257
|
async current() {
|
|
9764
10258
|
const data = await this.http.get("/tenant/plan");
|
|
9765
|
-
return
|
|
10259
|
+
return unwrap53(data);
|
|
9766
10260
|
}
|
|
9767
10261
|
/** Convenience alias for `tenant.branding.get()`. */
|
|
9768
10262
|
async getBranding() {
|
|
@@ -9823,7 +10317,7 @@ var Templates = class {
|
|
|
9823
10317
|
};
|
|
9824
10318
|
|
|
9825
10319
|
// src/resources/usage.ts
|
|
9826
|
-
function
|
|
10320
|
+
function unwrap54(payload) {
|
|
9827
10321
|
if (payload && typeof payload === "object") {
|
|
9828
10322
|
const p = payload;
|
|
9829
10323
|
for (const k of ["data", "usage", "sessions", "summary", "items"]) {
|
|
@@ -9845,13 +10339,13 @@ var Usage = class {
|
|
|
9845
10339
|
/** Get the current period usage summary. */
|
|
9846
10340
|
async current() {
|
|
9847
10341
|
const data = await this.http.get("/usage/summary");
|
|
9848
|
-
return
|
|
10342
|
+
return unwrap54(data);
|
|
9849
10343
|
}
|
|
9850
10344
|
/** List per-session metering events. */
|
|
9851
10345
|
async sessions(params = {}) {
|
|
9852
10346
|
const query3 = stripUndefined31(params);
|
|
9853
10347
|
const data = await this.http.get("/usage/sessions", query3);
|
|
9854
|
-
const result =
|
|
10348
|
+
const result = unwrap54(data);
|
|
9855
10349
|
if (Array.isArray(result)) return result;
|
|
9856
10350
|
return [];
|
|
9857
10351
|
}
|
|
@@ -9859,10 +10353,10 @@ var Usage = class {
|
|
|
9859
10353
|
async report(params = {}) {
|
|
9860
10354
|
const query3 = stripUndefined31(params);
|
|
9861
10355
|
const data = await this.http.get("/usage/summary", query3);
|
|
9862
|
-
return
|
|
10356
|
+
return unwrap54(data);
|
|
9863
10357
|
}
|
|
9864
10358
|
};
|
|
9865
|
-
function
|
|
10359
|
+
function unwrap55(payload) {
|
|
9866
10360
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
9867
10361
|
return payload.data;
|
|
9868
10362
|
}
|
|
@@ -9898,7 +10392,7 @@ var Volumes = class {
|
|
|
9898
10392
|
}
|
|
9899
10393
|
async get(volumeId) {
|
|
9900
10394
|
const data = await this.http.get(`/volumes/${volumeId}`);
|
|
9901
|
-
return
|
|
10395
|
+
return unwrap55(data);
|
|
9902
10396
|
}
|
|
9903
10397
|
async create(params) {
|
|
9904
10398
|
const { idempotencyKey: ikey, sizeGb, ...rest } = params;
|
|
@@ -9911,7 +10405,7 @@ var Volumes = class {
|
|
|
9911
10405
|
body: body5,
|
|
9912
10406
|
headers: { "Idempotency-Key": idempotencyKey9(ikey) }
|
|
9913
10407
|
});
|
|
9914
|
-
return
|
|
10408
|
+
return unwrap55(data);
|
|
9915
10409
|
}
|
|
9916
10410
|
async delete(volumeId) {
|
|
9917
10411
|
await this.http.delete(`/volumes/${volumeId}`);
|
|
@@ -9942,7 +10436,7 @@ var Volumes = class {
|
|
|
9942
10436
|
`/computers/${computerId}/volumes`,
|
|
9943
10437
|
body5
|
|
9944
10438
|
);
|
|
9945
|
-
return
|
|
10439
|
+
return unwrap55(data);
|
|
9946
10440
|
}
|
|
9947
10441
|
async detach(computerId, attachmentId) {
|
|
9948
10442
|
await this.http.delete(
|
|
@@ -9950,7 +10444,7 @@ var Volumes = class {
|
|
|
9950
10444
|
);
|
|
9951
10445
|
}
|
|
9952
10446
|
};
|
|
9953
|
-
function
|
|
10447
|
+
function unwrap56(payload) {
|
|
9954
10448
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
9955
10449
|
return payload.data;
|
|
9956
10450
|
}
|
|
@@ -10017,7 +10511,7 @@ var Webhooks = class {
|
|
|
10017
10511
|
}
|
|
10018
10512
|
async get(webhookId) {
|
|
10019
10513
|
const data = await this.http.get(`/webhooks/${webhookId}`);
|
|
10020
|
-
return
|
|
10514
|
+
return unwrap56(data);
|
|
10021
10515
|
}
|
|
10022
10516
|
async create(params) {
|
|
10023
10517
|
const { idempotencyKey: ikey, ...rest } = params;
|
|
@@ -10027,12 +10521,12 @@ var Webhooks = class {
|
|
|
10027
10521
|
body: body5,
|
|
10028
10522
|
headers: { "Idempotency-Key": idempotencyKey10(ikey) }
|
|
10029
10523
|
});
|
|
10030
|
-
return
|
|
10524
|
+
return unwrap56(data);
|
|
10031
10525
|
}
|
|
10032
10526
|
async update(webhookId, params) {
|
|
10033
10527
|
const body5 = stripUndefined33(params);
|
|
10034
10528
|
const data = await this.http.patch(`/webhooks/${webhookId}`, body5);
|
|
10035
|
-
return
|
|
10529
|
+
return unwrap56(data);
|
|
10036
10530
|
}
|
|
10037
10531
|
async delete(webhookId) {
|
|
10038
10532
|
await this.http.delete(`/webhooks/${webhookId}`);
|
|
@@ -10045,7 +10539,7 @@ var Webhooks = class {
|
|
|
10045
10539
|
headers: { "Idempotency-Key": idempotencyKey10(opts.idempotencyKey) }
|
|
10046
10540
|
}
|
|
10047
10541
|
);
|
|
10048
|
-
return
|
|
10542
|
+
return unwrap56(data);
|
|
10049
10543
|
}
|
|
10050
10544
|
async deliveries(webhookId) {
|
|
10051
10545
|
const data = await this.http.get(
|
|
@@ -10228,6 +10722,7 @@ var Miosa = class {
|
|
|
10228
10722
|
orgInvites;
|
|
10229
10723
|
/** Organizations available to the user session, membership, invites, and switching. */
|
|
10230
10724
|
organizations;
|
|
10725
|
+
forge;
|
|
10231
10726
|
/** Current tenant plan, limits, and live usage counters. */
|
|
10232
10727
|
tenant;
|
|
10233
10728
|
/** Datacenter regions, compute sizes, pricing, community templates. */
|
|
@@ -10268,6 +10763,8 @@ var Miosa = class {
|
|
|
10268
10763
|
agentRunGroups;
|
|
10269
10764
|
/** Agent runtime profiles — tenant/workspace defaults for sandbox/computer agents. */
|
|
10270
10765
|
agentRuntimeProfiles;
|
|
10766
|
+
/** Persisted workspace Agent definitions and immutable versions. */
|
|
10767
|
+
agents;
|
|
10271
10768
|
/** MIOSA Connect — provider connectors and runtime tokens. */
|
|
10272
10769
|
connectors;
|
|
10273
10770
|
/** Inherited runtime env — tenant/workspace/project defaults for agent runtimes. */
|
|
@@ -10373,6 +10870,7 @@ var Miosa = class {
|
|
|
10373
10870
|
this.workspaceInvites = new WorkspaceInvites(this.http);
|
|
10374
10871
|
this.orgInvites = new OrgInvites(this.http);
|
|
10375
10872
|
this.organizations = new Organizations(this.http);
|
|
10873
|
+
this.forge = new Forge(this.http);
|
|
10376
10874
|
this.tenant = new Tenant(this.http);
|
|
10377
10875
|
this.regions = new Regions(this.http);
|
|
10378
10876
|
this.settings = new Settings(this.http);
|
|
@@ -10393,6 +10891,7 @@ var Miosa = class {
|
|
|
10393
10891
|
this.agentRuns = new AgentRuns(this.http);
|
|
10394
10892
|
this.agentRunGroups = new AgentRunGroups(this.http);
|
|
10395
10893
|
this.agentRuntimeProfiles = new AgentRuntimeProfiles(this.http);
|
|
10894
|
+
this.agents = new AgentDefinitions(this.http);
|
|
10396
10895
|
this.connectors = new Connectors(this.http);
|
|
10397
10896
|
this.runtimeEnv = new RuntimeEnv(this.http);
|
|
10398
10897
|
this.runtimeCapabilities = new RuntimeCapabilitiesResource(this.http);
|
|
@@ -10919,6 +11418,6 @@ var AppAuth = class {
|
|
|
10919
11418
|
}
|
|
10920
11419
|
};
|
|
10921
11420
|
|
|
10922
|
-
export { AGENT_BUILD_KIND_SPECS, Admin, 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, 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 };
|
|
11421
|
+
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 };
|
|
10923
11422
|
//# sourceMappingURL=index.js.map
|
|
10924
11423
|
//# sourceMappingURL=index.js.map
|