@miosa/sdk 2.0.7 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -57
- package/dist/index.d.ts +70 -541
- package/dist/index.js +302 -1013
- package/dist/index.js.map +1 -1
- package/package.json +4 -5
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.0";
|
|
172
172
|
var SDK_USER_AGENT = `@miosa/sdk/${SDK_VERSION}`;
|
|
173
173
|
|
|
174
174
|
// src/http.ts
|
|
@@ -302,9 +302,8 @@ var HttpClient = class {
|
|
|
302
302
|
return new Uint8Array(buffer);
|
|
303
303
|
}
|
|
304
304
|
if (response.status === 204) {
|
|
305
|
-
return
|
|
305
|
+
return void 0;
|
|
306
306
|
}
|
|
307
|
-
if (options.rawResponse) return response;
|
|
308
307
|
return await response.json();
|
|
309
308
|
} catch (err) {
|
|
310
309
|
clearTimeout(timer);
|
|
@@ -1259,69 +1258,8 @@ var AgentRuntimeProfiles = class {
|
|
|
1259
1258
|
}
|
|
1260
1259
|
};
|
|
1261
1260
|
|
|
1262
|
-
// src/resources/agent-definitions.ts
|
|
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
1261
|
// src/resources/runs.ts
|
|
1324
|
-
function
|
|
1262
|
+
function unwrap5(payload) {
|
|
1325
1263
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
1326
1264
|
return payload.data;
|
|
1327
1265
|
}
|
|
@@ -1360,24 +1298,24 @@ var Runs = class {
|
|
|
1360
1298
|
status: params.status
|
|
1361
1299
|
})
|
|
1362
1300
|
);
|
|
1363
|
-
const data =
|
|
1301
|
+
const data = unwrap5(
|
|
1364
1302
|
response
|
|
1365
1303
|
);
|
|
1366
1304
|
if (Array.isArray(data)) return data;
|
|
1367
1305
|
return data.runs ?? data.items ?? [];
|
|
1368
1306
|
}
|
|
1369
1307
|
async get(id) {
|
|
1370
|
-
return
|
|
1308
|
+
return unwrap5(
|
|
1371
1309
|
await this.http.get(`/runs/${encodeURIComponent(id)}`)
|
|
1372
1310
|
);
|
|
1373
1311
|
}
|
|
1374
1312
|
async outputs(id) {
|
|
1375
|
-
return
|
|
1313
|
+
return unwrap5(
|
|
1376
1314
|
await this.http.get(`/runs/${encodeURIComponent(id)}/outputs`)
|
|
1377
1315
|
);
|
|
1378
1316
|
}
|
|
1379
1317
|
async files(id) {
|
|
1380
|
-
const data =
|
|
1318
|
+
const data = unwrap5(
|
|
1381
1319
|
await this.http.get(`/runs/${encodeURIComponent(id)}/files`)
|
|
1382
1320
|
);
|
|
1383
1321
|
if (Array.isArray(data)) return data;
|
|
@@ -1392,33 +1330,33 @@ var Runs = class {
|
|
|
1392
1330
|
);
|
|
1393
1331
|
}
|
|
1394
1332
|
async messages(id) {
|
|
1395
|
-
const data =
|
|
1333
|
+
const data = unwrap5(
|
|
1396
1334
|
await this.http.get(`/runs/${encodeURIComponent(id)}/messages`)
|
|
1397
1335
|
);
|
|
1398
1336
|
if (Array.isArray(data)) return data;
|
|
1399
1337
|
return data.messages ?? data.items ?? [];
|
|
1400
1338
|
}
|
|
1401
1339
|
async commandOutput(id) {
|
|
1402
|
-
return
|
|
1340
|
+
return unwrap5(
|
|
1403
1341
|
await this.http.get(`/runs/${encodeURIComponent(id)}/command-output`)
|
|
1404
1342
|
);
|
|
1405
1343
|
}
|
|
1406
1344
|
async activity(id) {
|
|
1407
|
-
const data =
|
|
1345
|
+
const data = unwrap5(
|
|
1408
1346
|
await this.http.get(`/runs/${encodeURIComponent(id)}/activity`)
|
|
1409
1347
|
);
|
|
1410
1348
|
if (Array.isArray(data)) return data;
|
|
1411
1349
|
return data.activity ?? data.items ?? [];
|
|
1412
1350
|
}
|
|
1413
1351
|
async previews(id) {
|
|
1414
|
-
const data =
|
|
1352
|
+
const data = unwrap5(
|
|
1415
1353
|
await this.http.get(`/runs/${encodeURIComponent(id)}/previews`)
|
|
1416
1354
|
);
|
|
1417
1355
|
if (Array.isArray(data)) return data;
|
|
1418
1356
|
return data.previews ?? data.items ?? [];
|
|
1419
1357
|
}
|
|
1420
1358
|
async diagnostics(id) {
|
|
1421
|
-
const data =
|
|
1359
|
+
const data = unwrap5(await this.http.get(`/runs/${encodeURIComponent(id)}/diagnostics`));
|
|
1422
1360
|
if (Array.isArray(data)) return data;
|
|
1423
1361
|
return data.diagnostics ?? data.items ?? [];
|
|
1424
1362
|
}
|
|
@@ -1465,9 +1403,6 @@ var Runs = class {
|
|
|
1465
1403
|
env: params.env,
|
|
1466
1404
|
agent_runtime_profile_id: params.agentRuntimeProfileId,
|
|
1467
1405
|
agent_profile_id: params.agentProfileId,
|
|
1468
|
-
agent_definition_id: params.agentDefinitionId,
|
|
1469
|
-
agent_version_id: params.agentVersionId,
|
|
1470
|
-
configuration_receipt: params.configurationReceipt,
|
|
1471
1406
|
run_group_id: params.runGroupId,
|
|
1472
1407
|
parent_run_id: params.parentRunId,
|
|
1473
1408
|
orchestration_role: params.orchestrationRole,
|
|
@@ -1481,10 +1416,10 @@ var Runs = class {
|
|
|
1481
1416
|
capability_requirements: params.capabilityRequirements,
|
|
1482
1417
|
metadata: params.metadata
|
|
1483
1418
|
});
|
|
1484
|
-
return
|
|
1419
|
+
return unwrap5(await this.http.post("/runs", body5));
|
|
1485
1420
|
}
|
|
1486
1421
|
async cancel(id) {
|
|
1487
|
-
return
|
|
1422
|
+
return unwrap5(
|
|
1488
1423
|
await this.http.post(
|
|
1489
1424
|
`/runs/${encodeURIComponent(id)}/cancel`,
|
|
1490
1425
|
{}
|
|
@@ -1494,7 +1429,7 @@ var Runs = class {
|
|
|
1494
1429
|
};
|
|
1495
1430
|
|
|
1496
1431
|
// src/resources/analytics.ts
|
|
1497
|
-
function
|
|
1432
|
+
function unwrap6(payload) {
|
|
1498
1433
|
if (payload && typeof payload === "object") {
|
|
1499
1434
|
const p = payload;
|
|
1500
1435
|
for (const k of ["data", "analytics", "series", "items"]) {
|
|
@@ -1517,16 +1452,16 @@ var Analytics = class {
|
|
|
1517
1452
|
async overview(filters = {}) {
|
|
1518
1453
|
const query3 = stripUndefined5(filters);
|
|
1519
1454
|
const data = await this.http.get("/analytics/overview", query3);
|
|
1520
|
-
return
|
|
1455
|
+
return unwrap6(data);
|
|
1521
1456
|
}
|
|
1522
1457
|
/** Get a timeseries for a metric over a period. */
|
|
1523
1458
|
async timeseries(params = {}) {
|
|
1524
1459
|
const query3 = stripUndefined5(params);
|
|
1525
1460
|
const data = await this.http.get("/analytics/timeseries", query3);
|
|
1526
|
-
return
|
|
1461
|
+
return unwrap6(data);
|
|
1527
1462
|
}
|
|
1528
1463
|
};
|
|
1529
|
-
function
|
|
1464
|
+
function unwrap7(payload) {
|
|
1530
1465
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
1531
1466
|
return payload.data;
|
|
1532
1467
|
}
|
|
@@ -1571,7 +1506,7 @@ var ApiKeys = class {
|
|
|
1571
1506
|
body: body5,
|
|
1572
1507
|
headers: { "Idempotency-Key": idempotencyKey(ikey) }
|
|
1573
1508
|
});
|
|
1574
|
-
return
|
|
1509
|
+
return unwrap7(data);
|
|
1575
1510
|
}
|
|
1576
1511
|
/** POST /api/v1/api-keys/scoped — L2 delegation token bound to one external user. */
|
|
1577
1512
|
async createScoped(params) {
|
|
@@ -1580,7 +1515,7 @@ var ApiKeys = class {
|
|
|
1580
1515
|
scopes: params.scopes,
|
|
1581
1516
|
expires_at: params.expiresAt
|
|
1582
1517
|
});
|
|
1583
|
-
return
|
|
1518
|
+
return unwrap7(
|
|
1584
1519
|
await this.http.post("/api-keys/scoped", body5)
|
|
1585
1520
|
);
|
|
1586
1521
|
}
|
|
@@ -1589,190 +1524,8 @@ var ApiKeys = class {
|
|
|
1589
1524
|
}
|
|
1590
1525
|
};
|
|
1591
1526
|
|
|
1592
|
-
// src/resources/app-documents.ts
|
|
1593
|
-
function unwrap9(payload) {
|
|
1594
|
-
return payload && typeof payload === "object" && "data" in payload ? payload.data : payload;
|
|
1595
|
-
}
|
|
1596
|
-
var AppDocuments = class {
|
|
1597
|
-
constructor(http) {
|
|
1598
|
-
this.http = http;
|
|
1599
|
-
}
|
|
1600
|
-
http;
|
|
1601
|
-
async list(workspaceId2) {
|
|
1602
|
-
const payload = await this.http.get(
|
|
1603
|
-
"/builder/apps",
|
|
1604
|
-
{ workspace_id: workspaceId2 }
|
|
1605
|
-
);
|
|
1606
|
-
return payload.data;
|
|
1607
|
-
}
|
|
1608
|
-
async get(id) {
|
|
1609
|
-
return unwrap9(
|
|
1610
|
-
await this.http.get(
|
|
1611
|
-
`/builder/apps/${id}`
|
|
1612
|
-
)
|
|
1613
|
-
);
|
|
1614
|
-
}
|
|
1615
|
-
async create(params) {
|
|
1616
|
-
const { workspaceId: workspaceId2, ...body5 } = params;
|
|
1617
|
-
return unwrap9(
|
|
1618
|
-
await this.http.post(
|
|
1619
|
-
"/builder/apps",
|
|
1620
|
-
{ ...body5, workspace_id: workspaceId2 }
|
|
1621
|
-
)
|
|
1622
|
-
);
|
|
1623
|
-
}
|
|
1624
|
-
async update(id, params) {
|
|
1625
|
-
return unwrap9(
|
|
1626
|
-
await this.http.patch(`/builder/apps/${id}`, params)
|
|
1627
|
-
);
|
|
1628
|
-
}
|
|
1629
|
-
async archive(id) {
|
|
1630
|
-
await this.http.delete(`/builder/apps/${id}`);
|
|
1631
|
-
}
|
|
1632
|
-
async diagnostics(id) {
|
|
1633
|
-
return unwrap9(
|
|
1634
|
-
await this.http.get(`/builder/apps/${id}/diagnostics`)
|
|
1635
|
-
);
|
|
1636
|
-
}
|
|
1637
|
-
async stageCandidate(id) {
|
|
1638
|
-
return unwrap9(
|
|
1639
|
-
await this.http.post(`/builder/apps/${id}/candidates`, {})
|
|
1640
|
-
);
|
|
1641
|
-
}
|
|
1642
|
-
async approveExactVersion(id, releaseId, reason) {
|
|
1643
|
-
return unwrap9(
|
|
1644
|
-
await this.http.post(`/builder/apps/${id}/approvals`, {
|
|
1645
|
-
reason,
|
|
1646
|
-
release_id: releaseId
|
|
1647
|
-
})
|
|
1648
|
-
);
|
|
1649
|
-
}
|
|
1650
|
-
async publishExactRelease(id) {
|
|
1651
|
-
const payload = await this.http.post(`/builder/apps/${id}/publish`, {});
|
|
1652
|
-
return unwrap9(payload).app;
|
|
1653
|
-
}
|
|
1654
|
-
async listData(id, collection) {
|
|
1655
|
-
const payload = await this.http.get(
|
|
1656
|
-
`/builder/apps/${encodeURIComponent(id)}/data/${encodeURIComponent(collection)}`
|
|
1657
|
-
);
|
|
1658
|
-
return payload.data;
|
|
1659
|
-
}
|
|
1660
|
-
async getData(id, collection, key) {
|
|
1661
|
-
return unwrap9(
|
|
1662
|
-
await this.http.get(
|
|
1663
|
-
`/builder/apps/${encodeURIComponent(id)}/data/${encodeURIComponent(collection)}/${encodeURIComponent(key)}`
|
|
1664
|
-
)
|
|
1665
|
-
);
|
|
1666
|
-
}
|
|
1667
|
-
async putData(id, collection, key, value, expectedVersion) {
|
|
1668
|
-
return unwrap9(
|
|
1669
|
-
await this.http.put(
|
|
1670
|
-
`/builder/apps/${encodeURIComponent(id)}/data/${encodeURIComponent(collection)}/${encodeURIComponent(key)}`,
|
|
1671
|
-
{ value, expected_version: expectedVersion }
|
|
1672
|
-
)
|
|
1673
|
-
);
|
|
1674
|
-
}
|
|
1675
|
-
async deleteData(id, collection, key, expectedVersion) {
|
|
1676
|
-
const suffix = expectedVersion === void 0 ? "" : `?expected_version=${encodeURIComponent(String(expectedVersion))}`;
|
|
1677
|
-
await this.http.delete(
|
|
1678
|
-
`/builder/apps/${encodeURIComponent(id)}/data/${encodeURIComponent(collection)}/${encodeURIComponent(key)}${suffix}`
|
|
1679
|
-
);
|
|
1680
|
-
}
|
|
1681
|
-
async authorizeAction(id, input) {
|
|
1682
|
-
return this.http.request(
|
|
1683
|
-
`/actions/apps/${encodeURIComponent(id)}/authorize`,
|
|
1684
|
-
{
|
|
1685
|
-
method: "POST",
|
|
1686
|
-
headers: {
|
|
1687
|
-
"x-miosa-app-callback-token": input.callbackToken
|
|
1688
|
-
},
|
|
1689
|
-
body: {
|
|
1690
|
-
release_id: input.releaseId,
|
|
1691
|
-
capability: input.capability,
|
|
1692
|
-
request_fingerprint: input.requestFingerprint,
|
|
1693
|
-
params_fingerprint: input.paramsFingerprint,
|
|
1694
|
-
connector_id: input.connectorId
|
|
1695
|
-
}
|
|
1696
|
-
}
|
|
1697
|
-
);
|
|
1698
|
-
}
|
|
1699
|
-
async mintRuntimeToken(id) {
|
|
1700
|
-
return unwrap9(
|
|
1701
|
-
await this.http.post(
|
|
1702
|
-
`/builder/apps/${encodeURIComponent(id)}/runtime-token`,
|
|
1703
|
-
{}
|
|
1704
|
-
)
|
|
1705
|
-
);
|
|
1706
|
-
}
|
|
1707
|
-
async resolveBinding(id, bindingId, receiptId, callbackToken) {
|
|
1708
|
-
return unwrap9(
|
|
1709
|
-
await this.http.request(
|
|
1710
|
-
`/builder/apps/${encodeURIComponent(id)}/runtime/bindings/${encodeURIComponent(bindingId)}?receipt_id=${encodeURIComponent(receiptId)}`,
|
|
1711
|
-
{
|
|
1712
|
-
method: "GET",
|
|
1713
|
-
headers: {
|
|
1714
|
-
"x-miosa-app-callback-token": callbackToken
|
|
1715
|
-
}
|
|
1716
|
-
}
|
|
1717
|
-
)
|
|
1718
|
-
);
|
|
1719
|
-
}
|
|
1720
|
-
async listAutomationRuns(id) {
|
|
1721
|
-
const payload = await this.http.get(
|
|
1722
|
-
`/builder/apps/${encodeURIComponent(id)}/automation-runs`
|
|
1723
|
-
);
|
|
1724
|
-
return payload.data;
|
|
1725
|
-
}
|
|
1726
|
-
async startAutomationRun(id, automationId, trigger = {}) {
|
|
1727
|
-
return unwrap9(
|
|
1728
|
-
await this.http.post(
|
|
1729
|
-
`/builder/apps/${encodeURIComponent(id)}/automations/${encodeURIComponent(automationId)}/runs`,
|
|
1730
|
-
{ trigger }
|
|
1731
|
-
)
|
|
1732
|
-
);
|
|
1733
|
-
}
|
|
1734
|
-
async claimAutomationStep(id, runId) {
|
|
1735
|
-
return unwrap9(
|
|
1736
|
-
await this.http.post(
|
|
1737
|
-
`/builder/apps/${encodeURIComponent(id)}/automation-runs/${encodeURIComponent(runId)}/claim`,
|
|
1738
|
-
{}
|
|
1739
|
-
)
|
|
1740
|
-
);
|
|
1741
|
-
}
|
|
1742
|
-
async completeAutomationStep(id, runId, cursor, idempotencyKey11, output = null) {
|
|
1743
|
-
return unwrap9(
|
|
1744
|
-
await this.http.post(
|
|
1745
|
-
`/builder/apps/${encodeURIComponent(id)}/automation-runs/${encodeURIComponent(runId)}/complete`,
|
|
1746
|
-
{
|
|
1747
|
-
cursor,
|
|
1748
|
-
idempotency_key: idempotencyKey11,
|
|
1749
|
-
output
|
|
1750
|
-
}
|
|
1751
|
-
)
|
|
1752
|
-
);
|
|
1753
|
-
}
|
|
1754
|
-
async failAutomationStep(id, runId, cursor, idempotencyKey11, reason) {
|
|
1755
|
-
return unwrap9(
|
|
1756
|
-
await this.http.post(
|
|
1757
|
-
`/builder/apps/${encodeURIComponent(id)}/automation-runs/${encodeURIComponent(runId)}/fail`,
|
|
1758
|
-
{
|
|
1759
|
-
cursor,
|
|
1760
|
-
idempotency_key: idempotencyKey11,
|
|
1761
|
-
reason
|
|
1762
|
-
}
|
|
1763
|
-
)
|
|
1764
|
-
);
|
|
1765
|
-
}
|
|
1766
|
-
async revokeApproval(id, approvalId) {
|
|
1767
|
-
await this.http.post(
|
|
1768
|
-
`/builder/apps/${id}/approvals/${approvalId}/revoke`,
|
|
1769
|
-
{}
|
|
1770
|
-
);
|
|
1771
|
-
}
|
|
1772
|
-
};
|
|
1773
|
-
|
|
1774
1527
|
// src/resources/audit-log.ts
|
|
1775
|
-
function
|
|
1528
|
+
function unwrap8(payload) {
|
|
1776
1529
|
if (payload && typeof payload === "object") {
|
|
1777
1530
|
const p = payload;
|
|
1778
1531
|
for (const k of ["data", "audit_log", "events", "items"]) {
|
|
@@ -1795,14 +1548,14 @@ var AuditLog = class {
|
|
|
1795
1548
|
async list(params = {}) {
|
|
1796
1549
|
const query3 = stripUndefined7(params);
|
|
1797
1550
|
const data = await this.http.get("/audit-log", query3);
|
|
1798
|
-
const result =
|
|
1551
|
+
const result = unwrap8(data);
|
|
1799
1552
|
if (Array.isArray(result)) return result;
|
|
1800
1553
|
return [];
|
|
1801
1554
|
}
|
|
1802
1555
|
};
|
|
1803
1556
|
|
|
1804
1557
|
// src/resources/benchmarks.ts
|
|
1805
|
-
function
|
|
1558
|
+
function unwrap9(data) {
|
|
1806
1559
|
if (data && typeof data === "object") {
|
|
1807
1560
|
const d = data;
|
|
1808
1561
|
for (const k of ["data", "benchmarks", "samples", "items"]) {
|
|
@@ -1834,7 +1587,7 @@ var Benchmarks = class {
|
|
|
1834
1587
|
return unwrapList(data);
|
|
1835
1588
|
}
|
|
1836
1589
|
async get(benchmarkId) {
|
|
1837
|
-
return
|
|
1590
|
+
return unwrap9(
|
|
1838
1591
|
await this.http.get(`/admin/benchmarks/${benchmarkId}`)
|
|
1839
1592
|
);
|
|
1840
1593
|
}
|
|
@@ -1843,10 +1596,10 @@ var Benchmarks = class {
|
|
|
1843
1596
|
const body5 = Object.fromEntries(
|
|
1844
1597
|
Object.entries(params).filter(([, v]) => v !== void 0)
|
|
1845
1598
|
);
|
|
1846
|
-
return
|
|
1599
|
+
return unwrap9(await this.http.post("/admin/benchmarks", body5));
|
|
1847
1600
|
}
|
|
1848
1601
|
async cancel(benchmarkId) {
|
|
1849
|
-
return
|
|
1602
|
+
return unwrap9(
|
|
1850
1603
|
await this.http.post(`/admin/benchmarks/${benchmarkId}/cancel`)
|
|
1851
1604
|
);
|
|
1852
1605
|
}
|
|
@@ -1866,14 +1619,14 @@ var Benchmarks = class {
|
|
|
1866
1619
|
const body5 = Object.fromEntries(
|
|
1867
1620
|
Object.entries(params).filter(([, v]) => v !== void 0)
|
|
1868
1621
|
);
|
|
1869
|
-
return
|
|
1622
|
+
return unwrap9(
|
|
1870
1623
|
await this.http.post("/admin/benchmarks/compare", body5)
|
|
1871
1624
|
);
|
|
1872
1625
|
}
|
|
1873
1626
|
};
|
|
1874
1627
|
|
|
1875
1628
|
// src/resources/builder-sessions.ts
|
|
1876
|
-
function
|
|
1629
|
+
function unwrap10(data) {
|
|
1877
1630
|
if (data && typeof data === "object") {
|
|
1878
1631
|
const d = data;
|
|
1879
1632
|
for (const k of ["data", "sessions", "items"]) {
|
|
@@ -1910,7 +1663,7 @@ var BuilderSessions = class {
|
|
|
1910
1663
|
return all.find((s) => s.id === sessionId) ?? {};
|
|
1911
1664
|
}
|
|
1912
1665
|
async updateTitle(sessionId, title) {
|
|
1913
|
-
return
|
|
1666
|
+
return unwrap10(
|
|
1914
1667
|
await this.http.patch(`/builder/sessions/${sessionId}/title`, {
|
|
1915
1668
|
title
|
|
1916
1669
|
})
|
|
@@ -1922,7 +1675,7 @@ var BuilderSessions = class {
|
|
|
1922
1675
|
};
|
|
1923
1676
|
|
|
1924
1677
|
// src/resources/channels.ts
|
|
1925
|
-
function
|
|
1678
|
+
function unwrap11(payload) {
|
|
1926
1679
|
if (payload && typeof payload === "object") {
|
|
1927
1680
|
const p = payload;
|
|
1928
1681
|
for (const k of ["data", "channels", "notifications", "items"]) {
|
|
@@ -1950,26 +1703,26 @@ var Channels = class {
|
|
|
1950
1703
|
async list(params = {}) {
|
|
1951
1704
|
const query3 = stripUndefined8(params);
|
|
1952
1705
|
const data = await this.http.get("/channels", query3);
|
|
1953
|
-
const result =
|
|
1706
|
+
const result = unwrap11(data);
|
|
1954
1707
|
if (Array.isArray(result)) return result;
|
|
1955
1708
|
return [];
|
|
1956
1709
|
}
|
|
1957
1710
|
/** Get a single channel. */
|
|
1958
1711
|
async get(channelId) {
|
|
1959
1712
|
const data = await this.http.get(`/channels/${channelId}`);
|
|
1960
|
-
return
|
|
1713
|
+
return unwrap11(data);
|
|
1961
1714
|
}
|
|
1962
1715
|
/** Create a new channel. */
|
|
1963
1716
|
async create(params) {
|
|
1964
1717
|
const body5 = stripUndefObj(params);
|
|
1965
1718
|
const data = await this.http.post("/channels", body5);
|
|
1966
|
-
return
|
|
1719
|
+
return unwrap11(data);
|
|
1967
1720
|
}
|
|
1968
1721
|
/** Update a channel. */
|
|
1969
1722
|
async update(channelId, params) {
|
|
1970
1723
|
const body5 = stripUndefObj(params);
|
|
1971
1724
|
const data = await this.http.patch(`/channels/${channelId}`, body5);
|
|
1972
|
-
return
|
|
1725
|
+
return unwrap11(data);
|
|
1973
1726
|
}
|
|
1974
1727
|
/** Delete a channel. */
|
|
1975
1728
|
async delete(channelId) {
|
|
@@ -1979,30 +1732,30 @@ var Channels = class {
|
|
|
1979
1732
|
/** Get notification preferences across all channels. */
|
|
1980
1733
|
async listNotifications() {
|
|
1981
1734
|
const data = await this.http.get("/channels/notifications");
|
|
1982
|
-
return
|
|
1735
|
+
return unwrap11(data);
|
|
1983
1736
|
}
|
|
1984
1737
|
/** Update notification preferences. */
|
|
1985
1738
|
async updateNotifications(params) {
|
|
1986
1739
|
const body5 = stripUndefObj(params);
|
|
1987
1740
|
const data = await this.http.put("/channels/notifications", body5);
|
|
1988
|
-
return
|
|
1741
|
+
return unwrap11(data);
|
|
1989
1742
|
}
|
|
1990
1743
|
/** Enable a channel. */
|
|
1991
1744
|
async enable(channelId) {
|
|
1992
1745
|
const data = await this.http.post(`/channels/${channelId}/enable`);
|
|
1993
|
-
return
|
|
1746
|
+
return unwrap11(data);
|
|
1994
1747
|
}
|
|
1995
1748
|
/** Disable a channel. */
|
|
1996
1749
|
async disable(channelId) {
|
|
1997
1750
|
const data = await this.http.post(
|
|
1998
1751
|
`/channels/${channelId}/disable`
|
|
1999
1752
|
);
|
|
2000
|
-
return
|
|
1753
|
+
return unwrap11(data);
|
|
2001
1754
|
}
|
|
2002
1755
|
};
|
|
2003
1756
|
|
|
2004
1757
|
// src/resources/cloud.ts
|
|
2005
|
-
function
|
|
1758
|
+
function unwrap12(payload) {
|
|
2006
1759
|
if (payload !== null && typeof payload === "object" && "data" in payload && payload.data !== void 0) {
|
|
2007
1760
|
return payload.data;
|
|
2008
1761
|
}
|
|
@@ -2077,12 +1830,12 @@ var Cloud = class {
|
|
|
2077
1830
|
}
|
|
2078
1831
|
http;
|
|
2079
1832
|
async listAccounts() {
|
|
2080
|
-
return
|
|
1833
|
+
return unwrap12(
|
|
2081
1834
|
await this.http.get("/cloud/accounts")
|
|
2082
1835
|
);
|
|
2083
1836
|
}
|
|
2084
1837
|
async createAccount(params) {
|
|
2085
|
-
return
|
|
1838
|
+
return unwrap12(
|
|
2086
1839
|
await this.http.post(
|
|
2087
1840
|
"/cloud/accounts",
|
|
2088
1841
|
accountBody(params)
|
|
@@ -2090,7 +1843,7 @@ var Cloud = class {
|
|
|
2090
1843
|
);
|
|
2091
1844
|
}
|
|
2092
1845
|
async attachAwsRole(id, params) {
|
|
2093
|
-
return
|
|
1846
|
+
return unwrap12(
|
|
2094
1847
|
await this.http.post(
|
|
2095
1848
|
`/cloud/accounts/${encodeURIComponent(id)}/aws/role`,
|
|
2096
1849
|
stripUndefined9({
|
|
@@ -2101,7 +1854,7 @@ var Cloud = class {
|
|
|
2101
1854
|
);
|
|
2102
1855
|
}
|
|
2103
1856
|
async listRegions(params = {}) {
|
|
2104
|
-
return
|
|
1857
|
+
return unwrap12(
|
|
2105
1858
|
await this.http.get(
|
|
2106
1859
|
"/cloud/regions",
|
|
2107
1860
|
query(params)
|
|
@@ -2109,7 +1862,7 @@ var Cloud = class {
|
|
|
2109
1862
|
);
|
|
2110
1863
|
}
|
|
2111
1864
|
async createRegion(params) {
|
|
2112
|
-
return
|
|
1865
|
+
return unwrap12(
|
|
2113
1866
|
await this.http.post(
|
|
2114
1867
|
"/cloud/regions",
|
|
2115
1868
|
regionBody(params)
|
|
@@ -2117,12 +1870,12 @@ var Cloud = class {
|
|
|
2117
1870
|
);
|
|
2118
1871
|
}
|
|
2119
1872
|
async listPools(params = {}) {
|
|
2120
|
-
return
|
|
1873
|
+
return unwrap12(
|
|
2121
1874
|
await this.http.get("/cloud/pools", query(params))
|
|
2122
1875
|
);
|
|
2123
1876
|
}
|
|
2124
1877
|
async createPool(params) {
|
|
2125
|
-
return
|
|
1878
|
+
return unwrap12(
|
|
2126
1879
|
await this.http.post(
|
|
2127
1880
|
"/cloud/pools",
|
|
2128
1881
|
poolBody(params)
|
|
@@ -2130,7 +1883,7 @@ var Cloud = class {
|
|
|
2130
1883
|
);
|
|
2131
1884
|
}
|
|
2132
1885
|
async listPreflights(params = {}) {
|
|
2133
|
-
return
|
|
1886
|
+
return unwrap12(
|
|
2134
1887
|
await this.http.get(
|
|
2135
1888
|
"/cloud/preflights",
|
|
2136
1889
|
query(params)
|
|
@@ -2138,7 +1891,7 @@ var Cloud = class {
|
|
|
2138
1891
|
);
|
|
2139
1892
|
}
|
|
2140
1893
|
async recordPreflight(params) {
|
|
2141
|
-
return
|
|
1894
|
+
return unwrap12(
|
|
2142
1895
|
await this.http.post(
|
|
2143
1896
|
"/cloud/preflights",
|
|
2144
1897
|
preflightBody(params)
|
|
@@ -2148,7 +1901,7 @@ var Cloud = class {
|
|
|
2148
1901
|
};
|
|
2149
1902
|
|
|
2150
1903
|
// src/resources/command-center.ts
|
|
2151
|
-
function
|
|
1904
|
+
function unwrap13(data) {
|
|
2152
1905
|
if (data && typeof data === "object") {
|
|
2153
1906
|
const d = data;
|
|
2154
1907
|
for (const k of [
|
|
@@ -2182,7 +1935,7 @@ var CommandCenter = class {
|
|
|
2182
1935
|
http;
|
|
2183
1936
|
/** Top-level snapshot (GET /command-center). */
|
|
2184
1937
|
async overview() {
|
|
2185
|
-
return
|
|
1938
|
+
return unwrap13(await this.http.get("/command-center"));
|
|
2186
1939
|
}
|
|
2187
1940
|
async agents() {
|
|
2188
1941
|
return unwrapList3(await this.http.get("/command-center/agents"));
|
|
@@ -2193,13 +1946,13 @@ var CommandCenter = class {
|
|
|
2193
1946
|
);
|
|
2194
1947
|
}
|
|
2195
1948
|
async metrics() {
|
|
2196
|
-
return
|
|
1949
|
+
return unwrap13(await this.http.get("/command-center/metrics"));
|
|
2197
1950
|
}
|
|
2198
1951
|
async presets() {
|
|
2199
1952
|
return unwrapList3(await this.http.get("/command-center/presets"));
|
|
2200
1953
|
}
|
|
2201
1954
|
async tiers() {
|
|
2202
|
-
return
|
|
1955
|
+
return unwrap13(await this.http.get("/command-center/tiers"));
|
|
2203
1956
|
}
|
|
2204
1957
|
/** Stream live command-center events via SSE. */
|
|
2205
1958
|
events() {
|
|
@@ -2208,7 +1961,7 @@ var CommandCenter = class {
|
|
|
2208
1961
|
};
|
|
2209
1962
|
|
|
2210
1963
|
// src/resources/community.ts
|
|
2211
|
-
function
|
|
1964
|
+
function unwrap14(data) {
|
|
2212
1965
|
if (data && typeof data === "object") {
|
|
2213
1966
|
const d = data;
|
|
2214
1967
|
for (const k of ["data", "templates", "agents", "items"]) {
|
|
@@ -2240,7 +1993,7 @@ var Community = class {
|
|
|
2240
1993
|
return unwrapList4(await this.http.get("/community/agents", query3));
|
|
2241
1994
|
}
|
|
2242
1995
|
async getAgent(agentId) {
|
|
2243
|
-
return
|
|
1996
|
+
return unwrap14(await this.http.get(`/community/agents/${agentId}`));
|
|
2244
1997
|
}
|
|
2245
1998
|
// ── Templates ─────────────────────────────────────────────────────────
|
|
2246
1999
|
async listTemplates(filters = {}) {
|
|
@@ -2252,7 +2005,7 @@ var Community = class {
|
|
|
2252
2005
|
);
|
|
2253
2006
|
}
|
|
2254
2007
|
async getTemplate(templateId) {
|
|
2255
|
-
return
|
|
2008
|
+
return unwrap14(
|
|
2256
2009
|
await this.http.get(`/community/templates/${templateId}`)
|
|
2257
2010
|
);
|
|
2258
2011
|
}
|
|
@@ -2261,7 +2014,7 @@ var Community = class {
|
|
|
2261
2014
|
const body5 = Object.fromEntries(
|
|
2262
2015
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
2263
2016
|
);
|
|
2264
|
-
return
|
|
2017
|
+
return unwrap14(
|
|
2265
2018
|
await this.http.post(
|
|
2266
2019
|
`/community/templates/${templateId}/install`,
|
|
2267
2020
|
body5
|
|
@@ -2276,7 +2029,7 @@ var Community = class {
|
|
|
2276
2029
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
2277
2030
|
)
|
|
2278
2031
|
};
|
|
2279
|
-
return
|
|
2032
|
+
return unwrap14(
|
|
2280
2033
|
await this.http.post(
|
|
2281
2034
|
`/community/templates/${templateId}/rate`,
|
|
2282
2035
|
body5
|
|
@@ -2286,7 +2039,7 @@ var Community = class {
|
|
|
2286
2039
|
};
|
|
2287
2040
|
|
|
2288
2041
|
// src/resources/completions.ts
|
|
2289
|
-
function
|
|
2042
|
+
function unwrap15(data) {
|
|
2290
2043
|
if (data && typeof data === "object") {
|
|
2291
2044
|
const d = data;
|
|
2292
2045
|
if (Array.isArray(d.choices)) return d;
|
|
@@ -2312,7 +2065,7 @@ var Completions = class {
|
|
|
2312
2065
|
{ method: "POST", body: body5 }
|
|
2313
2066
|
);
|
|
2314
2067
|
}
|
|
2315
|
-
return this.http.post("/intelligence/completions", body5).then(
|
|
2068
|
+
return this.http.post("/intelligence/completions", body5).then(unwrap15);
|
|
2316
2069
|
}
|
|
2317
2070
|
chat(params) {
|
|
2318
2071
|
const body5 = buildBody(params);
|
|
@@ -2322,7 +2075,7 @@ var Completions = class {
|
|
|
2322
2075
|
{ method: "POST", body: body5 }
|
|
2323
2076
|
);
|
|
2324
2077
|
}
|
|
2325
|
-
return this.http.post("/intelligence/chat/completions", body5).then(
|
|
2078
|
+
return this.http.post("/intelligence/chat/completions", body5).then(unwrap15);
|
|
2326
2079
|
}
|
|
2327
2080
|
};
|
|
2328
2081
|
|
|
@@ -2445,7 +2198,7 @@ var Checkpoints = class {
|
|
|
2445
2198
|
};
|
|
2446
2199
|
|
|
2447
2200
|
// src/resources/computer-auto-stop.ts
|
|
2448
|
-
function
|
|
2201
|
+
function unwrap16(data) {
|
|
2449
2202
|
if (data && typeof data === "object") {
|
|
2450
2203
|
const d = data;
|
|
2451
2204
|
if ("data" in d && Object.keys(d).length <= 2) {
|
|
@@ -2463,13 +2216,13 @@ var ComputerAutoStop = class {
|
|
|
2463
2216
|
computerId;
|
|
2464
2217
|
/** Return the current auto-stop configuration. */
|
|
2465
2218
|
async get() {
|
|
2466
|
-
return
|
|
2219
|
+
return unwrap16(
|
|
2467
2220
|
await this.http.get(`/computers/${this.computerId}/auto-stop`)
|
|
2468
2221
|
);
|
|
2469
2222
|
}
|
|
2470
2223
|
/** Set the idle timeout in seconds (0 disables auto-stop). */
|
|
2471
2224
|
async update(seconds) {
|
|
2472
|
-
return
|
|
2225
|
+
return unwrap16(
|
|
2473
2226
|
await this.http.patch(
|
|
2474
2227
|
`/computers/${this.computerId}/auto-stop`,
|
|
2475
2228
|
{ seconds }
|
|
@@ -2479,7 +2232,7 @@ var ComputerAutoStop = class {
|
|
|
2479
2232
|
};
|
|
2480
2233
|
|
|
2481
2234
|
// src/resources/computer-env.ts
|
|
2482
|
-
function
|
|
2235
|
+
function unwrap17(data) {
|
|
2483
2236
|
if (data && typeof data === "object") {
|
|
2484
2237
|
const d = data;
|
|
2485
2238
|
if ("data" in d && Object.keys(d).length <= 2) {
|
|
@@ -2514,11 +2267,11 @@ var ComputerEnv = class {
|
|
|
2514
2267
|
}
|
|
2515
2268
|
/** Create a new env var. Use update() to change an existing one. */
|
|
2516
2269
|
async set(name, value) {
|
|
2517
|
-
return
|
|
2270
|
+
return unwrap17(await this.http.post(this.base(), { name, value }));
|
|
2518
2271
|
}
|
|
2519
2272
|
/** Patch the value of an existing env var by name. */
|
|
2520
2273
|
async update(name, value) {
|
|
2521
|
-
return
|
|
2274
|
+
return unwrap17(
|
|
2522
2275
|
await this.http.patch(`${this.base()}/${name}`, { value })
|
|
2523
2276
|
);
|
|
2524
2277
|
}
|
|
@@ -2535,7 +2288,7 @@ var ComputerEnv = class {
|
|
|
2535
2288
|
};
|
|
2536
2289
|
|
|
2537
2290
|
// src/resources/computer-logs.ts
|
|
2538
|
-
function
|
|
2291
|
+
function unwrap18(data) {
|
|
2539
2292
|
if (data && typeof data === "object") {
|
|
2540
2293
|
const d = data;
|
|
2541
2294
|
if ("data" in d && Object.keys(d).length <= 2) {
|
|
@@ -2556,7 +2309,7 @@ var ComputerLogs = class {
|
|
|
2556
2309
|
const query3 = Object.fromEntries(
|
|
2557
2310
|
Object.entries(params).filter(([, v]) => v !== void 0)
|
|
2558
2311
|
);
|
|
2559
|
-
return
|
|
2312
|
+
return unwrap18(
|
|
2560
2313
|
await this.http.get(`/computers/${this.computerId}/logs`, query3)
|
|
2561
2314
|
);
|
|
2562
2315
|
}
|
|
@@ -2569,7 +2322,7 @@ var ComputerLogs = class {
|
|
|
2569
2322
|
};
|
|
2570
2323
|
|
|
2571
2324
|
// src/resources/computer-osa.ts
|
|
2572
|
-
function
|
|
2325
|
+
function unwrap19(data) {
|
|
2573
2326
|
if (data && typeof data === "object") {
|
|
2574
2327
|
const d = data;
|
|
2575
2328
|
if ("data" in d && Object.keys(d).length <= 2) {
|
|
@@ -2593,7 +2346,7 @@ var ComputerOsa = class {
|
|
|
2593
2346
|
Object.entries(params).filter(([, v]) => v !== void 0)
|
|
2594
2347
|
)
|
|
2595
2348
|
};
|
|
2596
|
-
return
|
|
2349
|
+
return unwrap19(
|
|
2597
2350
|
await this.http.post(
|
|
2598
2351
|
`/computers/${this.computerId}/osa/task`,
|
|
2599
2352
|
body5
|
|
@@ -2602,13 +2355,13 @@ var ComputerOsa = class {
|
|
|
2602
2355
|
}
|
|
2603
2356
|
/** Cancel the currently-running OSA task, if any. */
|
|
2604
2357
|
async cancelTask() {
|
|
2605
|
-
return
|
|
2358
|
+
return unwrap19(
|
|
2606
2359
|
await this.http.delete(`/computers/${this.computerId}/osa/task`)
|
|
2607
2360
|
);
|
|
2608
2361
|
}
|
|
2609
2362
|
/** Return OSA's current task / configuration / health snapshot. */
|
|
2610
2363
|
async status() {
|
|
2611
|
-
return
|
|
2364
|
+
return unwrap19(
|
|
2612
2365
|
await this.http.get(`/computers/${this.computerId}/osa/status`)
|
|
2613
2366
|
);
|
|
2614
2367
|
}
|
|
@@ -2617,7 +2370,7 @@ var ComputerOsa = class {
|
|
|
2617
2370
|
const body5 = Object.fromEntries(
|
|
2618
2371
|
Object.entries(config).filter(([, v]) => v !== void 0)
|
|
2619
2372
|
);
|
|
2620
|
-
return
|
|
2373
|
+
return unwrap19(
|
|
2621
2374
|
await this.http.post(
|
|
2622
2375
|
`/computers/${this.computerId}/osa/configure`,
|
|
2623
2376
|
body5
|
|
@@ -2627,7 +2380,7 @@ var ComputerOsa = class {
|
|
|
2627
2380
|
};
|
|
2628
2381
|
|
|
2629
2382
|
// src/resources/computer-ports.ts
|
|
2630
|
-
function
|
|
2383
|
+
function unwrap20(data) {
|
|
2631
2384
|
if (data && typeof data === "object") {
|
|
2632
2385
|
const d = data;
|
|
2633
2386
|
if ("data" in d && Object.keys(d).length <= 2) {
|
|
@@ -2672,14 +2425,14 @@ var ComputerPorts = class {
|
|
|
2672
2425
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
2673
2426
|
)
|
|
2674
2427
|
};
|
|
2675
|
-
return
|
|
2428
|
+
return unwrap20(await this.http.post(this.base(), body5));
|
|
2676
2429
|
}
|
|
2677
2430
|
/** Patch visibility / auth options for port. */
|
|
2678
2431
|
async update(port, opts) {
|
|
2679
2432
|
const body5 = Object.fromEntries(
|
|
2680
2433
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
2681
2434
|
);
|
|
2682
|
-
return
|
|
2435
|
+
return unwrap20(
|
|
2683
2436
|
await this.http.patch(`${this.base()}/${port}`, body5)
|
|
2684
2437
|
);
|
|
2685
2438
|
}
|
|
@@ -2706,7 +2459,7 @@ var ComputerTerminal = class {
|
|
|
2706
2459
|
`/computers/${this.computerId}/terminal`,
|
|
2707
2460
|
body5
|
|
2708
2461
|
);
|
|
2709
|
-
return
|
|
2462
|
+
return unwrap21(raw);
|
|
2710
2463
|
}
|
|
2711
2464
|
/** Resize an existing PTY session. */
|
|
2712
2465
|
async resize(sessionId, cols, rows) {
|
|
@@ -2714,10 +2467,10 @@ var ComputerTerminal = class {
|
|
|
2714
2467
|
`/computers/${this.computerId}/pty/${sessionId}/resize`,
|
|
2715
2468
|
{ cols, rows }
|
|
2716
2469
|
);
|
|
2717
|
-
return
|
|
2470
|
+
return unwrap21(raw);
|
|
2718
2471
|
}
|
|
2719
2472
|
};
|
|
2720
|
-
function
|
|
2473
|
+
function unwrap21(data) {
|
|
2721
2474
|
if (data && typeof data === "object") {
|
|
2722
2475
|
const d = data;
|
|
2723
2476
|
if ("data" in d && Object.keys(d).length <= 2) {
|
|
@@ -2728,7 +2481,7 @@ function unwrap23(data) {
|
|
|
2728
2481
|
}
|
|
2729
2482
|
|
|
2730
2483
|
// src/resources/computer-volumes.ts
|
|
2731
|
-
function
|
|
2484
|
+
function unwrap22(data) {
|
|
2732
2485
|
if (data && typeof data === "object") {
|
|
2733
2486
|
const d = data;
|
|
2734
2487
|
if ("data" in d && Object.keys(d).length <= 2) {
|
|
@@ -2762,7 +2515,7 @@ var ComputerVolumes = class {
|
|
|
2762
2515
|
}
|
|
2763
2516
|
/** Attach volumeId at mountPath inside the VM. */
|
|
2764
2517
|
async attach(volumeId, mountPath) {
|
|
2765
|
-
return
|
|
2518
|
+
return unwrap22(
|
|
2766
2519
|
await this.http.post(this.base(), {
|
|
2767
2520
|
volume_id: volumeId,
|
|
2768
2521
|
mount_path: mountPath
|
|
@@ -2776,7 +2529,7 @@ var ComputerVolumes = class {
|
|
|
2776
2529
|
};
|
|
2777
2530
|
|
|
2778
2531
|
// src/resources/connectors.ts
|
|
2779
|
-
function
|
|
2532
|
+
function unwrap23(payload) {
|
|
2780
2533
|
if (payload && typeof payload === "object") {
|
|
2781
2534
|
const p = payload;
|
|
2782
2535
|
for (const key of ["data", "binding"]) {
|
|
@@ -2987,7 +2740,7 @@ var Connectors = class {
|
|
|
2987
2740
|
const data = await this.http.get(
|
|
2988
2741
|
`/connect/connectors/${connectorPath(connector)}`
|
|
2989
2742
|
);
|
|
2990
|
-
return
|
|
2743
|
+
return unwrap23(data);
|
|
2991
2744
|
}
|
|
2992
2745
|
show(connector) {
|
|
2993
2746
|
return this.get(connector);
|
|
@@ -2998,7 +2751,7 @@ var Connectors = class {
|
|
|
2998
2751
|
"/connect/connectors",
|
|
2999
2752
|
bodyFromCreateParams(provider, params)
|
|
3000
2753
|
);
|
|
3001
|
-
return
|
|
2754
|
+
return unwrap23(data);
|
|
3002
2755
|
}
|
|
3003
2756
|
/** Request a runtime provider token for a connector. */
|
|
3004
2757
|
async getToken(connector, params = {}) {
|
|
@@ -3006,7 +2759,7 @@ var Connectors = class {
|
|
|
3006
2759
|
`/connect/token/${connectorPath(connector)}`,
|
|
3007
2760
|
tokenBody(params)
|
|
3008
2761
|
);
|
|
3009
|
-
return
|
|
2762
|
+
return unwrap23(data);
|
|
3010
2763
|
}
|
|
3011
2764
|
token(connector, params = {}) {
|
|
3012
2765
|
return this.getToken(connector, params);
|
|
@@ -3028,7 +2781,7 @@ var Connectors = class {
|
|
|
3028
2781
|
...externalAttributionParams(params)
|
|
3029
2782
|
})
|
|
3030
2783
|
);
|
|
3031
|
-
return
|
|
2784
|
+
return unwrap23(data);
|
|
3032
2785
|
}
|
|
3033
2786
|
/** List connector installations/grants. */
|
|
3034
2787
|
async installations(params = {}) {
|
|
@@ -3068,7 +2821,7 @@ var Connectors = class {
|
|
|
3068
2821
|
"/connect/defaults/materialize",
|
|
3069
2822
|
materializeDefaultsBody(params)
|
|
3070
2823
|
);
|
|
3071
|
-
return
|
|
2824
|
+
return unwrap23(data);
|
|
3072
2825
|
}
|
|
3073
2826
|
/** Create an inherited connector default for future runtime resources. */
|
|
3074
2827
|
async createDefault(params) {
|
|
@@ -3076,7 +2829,7 @@ var Connectors = class {
|
|
|
3076
2829
|
"/connect/defaults",
|
|
3077
2830
|
defaultBody(params)
|
|
3078
2831
|
);
|
|
3079
|
-
return
|
|
2832
|
+
return unwrap23(data);
|
|
3080
2833
|
}
|
|
3081
2834
|
/** Delete an inherited connector default. */
|
|
3082
2835
|
async deleteDefault(id) {
|
|
@@ -3096,7 +2849,7 @@ var Connectors = class {
|
|
|
3096
2849
|
"/connect/triggers",
|
|
3097
2850
|
triggerBody(params)
|
|
3098
2851
|
);
|
|
3099
|
-
return
|
|
2852
|
+
return unwrap23(data);
|
|
3100
2853
|
}
|
|
3101
2854
|
/** List inbound provider trigger delivery attempts. */
|
|
3102
2855
|
async triggerDeliveries(params = {}) {
|
|
@@ -3123,7 +2876,7 @@ var Connectors = class {
|
|
|
3123
2876
|
"/connect/project-links",
|
|
3124
2877
|
projectLinkBody(params)
|
|
3125
2878
|
);
|
|
3126
|
-
return
|
|
2879
|
+
return unwrap23(data);
|
|
3127
2880
|
}
|
|
3128
2881
|
/** Delete a project connector link. */
|
|
3129
2882
|
async deleteProjectLink(id) {
|
|
@@ -3159,7 +2912,7 @@ var RuntimeConnectors = class {
|
|
|
3159
2912
|
...externalAttributionParams(params)
|
|
3160
2913
|
})
|
|
3161
2914
|
);
|
|
3162
|
-
return
|
|
2915
|
+
return unwrap23(data);
|
|
3163
2916
|
}
|
|
3164
2917
|
/** Detach a connector binding by binding id or connector UID. */
|
|
3165
2918
|
async detach(bindingOrConnector) {
|
|
@@ -3168,7 +2921,7 @@ var RuntimeConnectors = class {
|
|
|
3168
2921
|
/** Sync or materialize connector placeholder env vars for this runtime resource. */
|
|
3169
2922
|
async sync() {
|
|
3170
2923
|
const data = await this.http.post(`${this.basePath}/sync`, {});
|
|
3171
|
-
return
|
|
2924
|
+
return unwrap23(data);
|
|
3172
2925
|
}
|
|
3173
2926
|
/** Verify a required connector is attached before agent work begins. */
|
|
3174
2927
|
async preflight(params = {}) {
|
|
@@ -3176,7 +2929,7 @@ var RuntimeConnectors = class {
|
|
|
3176
2929
|
`${this.basePath}/preflight`,
|
|
3177
2930
|
stripUndefined10(params)
|
|
3178
2931
|
);
|
|
3179
|
-
return
|
|
2932
|
+
return unwrap23(data);
|
|
3180
2933
|
}
|
|
3181
2934
|
};
|
|
3182
2935
|
var SandboxConnectors = class extends RuntimeConnectors {
|
|
@@ -3379,7 +3132,7 @@ var Desktop = class {
|
|
|
3379
3132
|
};
|
|
3380
3133
|
|
|
3381
3134
|
// src/resources/egressAudit.ts
|
|
3382
|
-
function
|
|
3135
|
+
function unwrap24(payload) {
|
|
3383
3136
|
if (payload && typeof payload === "object") {
|
|
3384
3137
|
const p = payload;
|
|
3385
3138
|
for (const k of ["data", "event", "items"]) {
|
|
@@ -3445,7 +3198,7 @@ var EgressAudit = class {
|
|
|
3445
3198
|
const data = await this.http.get(
|
|
3446
3199
|
`/egress/audit/${id}`
|
|
3447
3200
|
);
|
|
3448
|
-
return
|
|
3201
|
+
return unwrap24(data);
|
|
3449
3202
|
}
|
|
3450
3203
|
/**
|
|
3451
3204
|
* Long-poll the audit endpoint and yield new events as they appear.
|
|
@@ -3521,7 +3274,7 @@ var ComputerAudit = class extends SandboxAudit {
|
|
|
3521
3274
|
};
|
|
3522
3275
|
|
|
3523
3276
|
// src/resources/egressNetwork.ts
|
|
3524
|
-
function
|
|
3277
|
+
function unwrap25(payload) {
|
|
3525
3278
|
if (payload && typeof payload === "object") {
|
|
3526
3279
|
const p = payload;
|
|
3527
3280
|
for (const k of ["data", "policy", "rule", "items"]) {
|
|
@@ -3580,7 +3333,7 @@ var EgressNetwork = class {
|
|
|
3580
3333
|
"/egress/allowlist",
|
|
3581
3334
|
ruleBody(host, params, "allow")
|
|
3582
3335
|
);
|
|
3583
|
-
return
|
|
3336
|
+
return unwrap25(data);
|
|
3584
3337
|
}
|
|
3585
3338
|
/** Add a `deny` rule for `host` to the allowlist. */
|
|
3586
3339
|
async deny(host, params = {}) {
|
|
@@ -3588,7 +3341,7 @@ var EgressNetwork = class {
|
|
|
3588
3341
|
"/egress/allowlist",
|
|
3589
3342
|
ruleBody(host, params, "deny")
|
|
3590
3343
|
);
|
|
3591
|
-
return
|
|
3344
|
+
return unwrap25(data);
|
|
3592
3345
|
}
|
|
3593
3346
|
/** List allowlist rules. */
|
|
3594
3347
|
async rules(params = {}) {
|
|
@@ -3632,7 +3385,7 @@ var EgressNetwork = class {
|
|
|
3632
3385
|
"/egress/policies",
|
|
3633
3386
|
body5
|
|
3634
3387
|
);
|
|
3635
|
-
return
|
|
3388
|
+
return unwrap25(data);
|
|
3636
3389
|
}
|
|
3637
3390
|
/** Update an egress policy by id. */
|
|
3638
3391
|
async updatePolicy(policyId, params) {
|
|
@@ -3646,7 +3399,7 @@ var EgressNetwork = class {
|
|
|
3646
3399
|
`/egress/policies/${policyId}`,
|
|
3647
3400
|
body5
|
|
3648
3401
|
);
|
|
3649
|
-
return
|
|
3402
|
+
return unwrap25(data);
|
|
3650
3403
|
}
|
|
3651
3404
|
// ── mode helpers ──────────────────────────────────────────────────────────
|
|
3652
3405
|
/** Set the policy to `mode="enforce"` — denied egress is blocked. */
|
|
@@ -3673,7 +3426,7 @@ var EgressNetwork = class {
|
|
|
3673
3426
|
"/egress/policies",
|
|
3674
3427
|
body5
|
|
3675
3428
|
);
|
|
3676
|
-
return
|
|
3429
|
+
return unwrap25(data);
|
|
3677
3430
|
}
|
|
3678
3431
|
// ── suggestions ───────────────────────────────────────────────────────────
|
|
3679
3432
|
/** AI-generated allowlist suggestions from recent denied egress. */
|
|
@@ -3764,7 +3517,7 @@ var ComputerNetwork = class extends SandboxNetwork {
|
|
|
3764
3517
|
};
|
|
3765
3518
|
|
|
3766
3519
|
// src/resources/egressSecrets.ts
|
|
3767
|
-
function
|
|
3520
|
+
function unwrap26(payload) {
|
|
3768
3521
|
if (payload && typeof payload === "object") {
|
|
3769
3522
|
const p = payload;
|
|
3770
3523
|
for (const k of ["data", "secret", "binding", "items"]) {
|
|
@@ -3900,7 +3653,7 @@ var OAuthFlow = class {
|
|
|
3900
3653
|
const data = await this.http.get("/egress/oauth/status", {
|
|
3901
3654
|
state: this.state
|
|
3902
3655
|
});
|
|
3903
|
-
const payload =
|
|
3656
|
+
const payload = unwrap26(data) ?? {};
|
|
3904
3657
|
const status = payload.status;
|
|
3905
3658
|
if (status === "completed" || status === "ready" || status === "succeeded") {
|
|
3906
3659
|
return payload;
|
|
@@ -3932,7 +3685,7 @@ var EgressSecrets = class {
|
|
|
3932
3685
|
"/egress/secrets",
|
|
3933
3686
|
setBody(params)
|
|
3934
3687
|
);
|
|
3935
|
-
return
|
|
3688
|
+
return unwrap26(data);
|
|
3936
3689
|
}
|
|
3937
3690
|
/** List secrets. */
|
|
3938
3691
|
async list(params = {}) {
|
|
@@ -3947,7 +3700,7 @@ var EgressSecrets = class {
|
|
|
3947
3700
|
const data = await this.http.get(
|
|
3948
3701
|
`/egress/secrets/${id}`
|
|
3949
3702
|
);
|
|
3950
|
-
return
|
|
3703
|
+
return unwrap26(data);
|
|
3951
3704
|
}
|
|
3952
3705
|
/** Rotate the secret's value. */
|
|
3953
3706
|
async rotate(id, params) {
|
|
@@ -3956,7 +3709,7 @@ var EgressSecrets = class {
|
|
|
3956
3709
|
`/egress/secrets/${id}`,
|
|
3957
3710
|
body5
|
|
3958
3711
|
);
|
|
3959
|
-
return
|
|
3712
|
+
return unwrap26(data);
|
|
3960
3713
|
}
|
|
3961
3714
|
/** Delete a secret. */
|
|
3962
3715
|
async delete(id) {
|
|
@@ -3969,7 +3722,7 @@ var EgressSecrets = class {
|
|
|
3969
3722
|
"/egress/bindings",
|
|
3970
3723
|
bindingBody(params)
|
|
3971
3724
|
);
|
|
3972
|
-
return
|
|
3725
|
+
return unwrap26(data);
|
|
3973
3726
|
}
|
|
3974
3727
|
/** List secret bindings. */
|
|
3975
3728
|
async listBindings(params = {}) {
|
|
@@ -4002,7 +3755,7 @@ var EgressSecrets = class {
|
|
|
4002
3755
|
"/egress/oauth/start",
|
|
4003
3756
|
oauthBody(params)
|
|
4004
3757
|
);
|
|
4005
|
-
const payload =
|
|
3758
|
+
const payload = unwrap26(data) ?? {};
|
|
4006
3759
|
return new OAuthFlow(this.http, payload, params.provider);
|
|
4007
3760
|
}
|
|
4008
3761
|
};
|
|
@@ -5166,7 +4919,7 @@ var Credits = class {
|
|
|
5166
4919
|
return this.http.get("/credits/usage");
|
|
5167
4920
|
}
|
|
5168
4921
|
};
|
|
5169
|
-
function
|
|
4922
|
+
function unwrap27(payload) {
|
|
5170
4923
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
5171
4924
|
return payload.data;
|
|
5172
4925
|
}
|
|
@@ -5202,7 +4955,7 @@ var CronJobs = class {
|
|
|
5202
4955
|
}
|
|
5203
4956
|
async get(jobId) {
|
|
5204
4957
|
const data = await this.http.get(`/cron-jobs/${jobId}`);
|
|
5205
|
-
return
|
|
4958
|
+
return unwrap27(data);
|
|
5206
4959
|
}
|
|
5207
4960
|
async create(params) {
|
|
5208
4961
|
const { idempotencyKey: ikey, ...rest } = params;
|
|
@@ -5212,12 +4965,12 @@ var CronJobs = class {
|
|
|
5212
4965
|
body: body5,
|
|
5213
4966
|
headers: { "Idempotency-Key": idempotencyKey2(ikey) }
|
|
5214
4967
|
});
|
|
5215
|
-
return
|
|
4968
|
+
return unwrap27(data);
|
|
5216
4969
|
}
|
|
5217
4970
|
async update(jobId, params) {
|
|
5218
4971
|
const body5 = stripUndefined14(params);
|
|
5219
4972
|
const data = await this.http.patch(`/cron-jobs/${jobId}`, body5);
|
|
5220
|
-
return
|
|
4973
|
+
return unwrap27(data);
|
|
5221
4974
|
}
|
|
5222
4975
|
async delete(jobId) {
|
|
5223
4976
|
await this.http.delete(`/cron-jobs/${jobId}`);
|
|
@@ -5225,11 +4978,11 @@ var CronJobs = class {
|
|
|
5225
4978
|
// ── Control ────────────────────────────────────────────────────────────────
|
|
5226
4979
|
async pause(jobId) {
|
|
5227
4980
|
const data = await this.http.post(`/cron-jobs/${jobId}/pause`);
|
|
5228
|
-
return
|
|
4981
|
+
return unwrap27(data);
|
|
5229
4982
|
}
|
|
5230
4983
|
async resume(jobId) {
|
|
5231
4984
|
const data = await this.http.post(`/cron-jobs/${jobId}/resume`);
|
|
5232
|
-
return
|
|
4985
|
+
return unwrap27(data);
|
|
5233
4986
|
}
|
|
5234
4987
|
async runNow(jobId, opts = {}) {
|
|
5235
4988
|
const data = await this.http.request(
|
|
@@ -5239,7 +4992,7 @@ var CronJobs = class {
|
|
|
5239
4992
|
headers: { "Idempotency-Key": idempotencyKey2(opts.idempotencyKey) }
|
|
5240
4993
|
}
|
|
5241
4994
|
);
|
|
5242
|
-
return
|
|
4995
|
+
return unwrap27(data);
|
|
5243
4996
|
}
|
|
5244
4997
|
// ── Execution history ──────────────────────────────────────────────────────
|
|
5245
4998
|
async listExecutions(jobId) {
|
|
@@ -5254,12 +5007,12 @@ var CronJobs = class {
|
|
|
5254
5007
|
const data = await this.http.get(
|
|
5255
5008
|
`/cron-jobs/${jobId}/executions/${executionId}`
|
|
5256
5009
|
);
|
|
5257
|
-
return
|
|
5010
|
+
return unwrap27(data);
|
|
5258
5011
|
}
|
|
5259
5012
|
};
|
|
5260
5013
|
|
|
5261
5014
|
// src/resources/dashboard.ts
|
|
5262
|
-
function
|
|
5015
|
+
function unwrap28(payload) {
|
|
5263
5016
|
if (payload && typeof payload === "object") {
|
|
5264
5017
|
const p = payload;
|
|
5265
5018
|
for (const k of ["data", "dashboard", "overview", "items"]) {
|
|
@@ -5276,15 +5029,15 @@ var Dashboard = class {
|
|
|
5276
5029
|
/** Aggregated user dashboard payload. */
|
|
5277
5030
|
async summary() {
|
|
5278
5031
|
const data = await this.http.get("/dashboard");
|
|
5279
|
-
return
|
|
5032
|
+
return unwrap28(data);
|
|
5280
5033
|
}
|
|
5281
5034
|
/** Status / health overview (public endpoint). */
|
|
5282
5035
|
async overview() {
|
|
5283
5036
|
const data = await this.http.get("/overview");
|
|
5284
|
-
return
|
|
5037
|
+
return unwrap28(data);
|
|
5285
5038
|
}
|
|
5286
5039
|
};
|
|
5287
|
-
function
|
|
5040
|
+
function unwrap29(payload) {
|
|
5288
5041
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
5289
5042
|
return payload.data;
|
|
5290
5043
|
}
|
|
@@ -5320,7 +5073,7 @@ var Databases = class {
|
|
|
5320
5073
|
}
|
|
5321
5074
|
async get(databaseId) {
|
|
5322
5075
|
const data = await this.http.get(`/databases/${databaseId}`);
|
|
5323
|
-
return
|
|
5076
|
+
return unwrap29(data);
|
|
5324
5077
|
}
|
|
5325
5078
|
async create(params) {
|
|
5326
5079
|
const {
|
|
@@ -5344,7 +5097,7 @@ var Databases = class {
|
|
|
5344
5097
|
)
|
|
5345
5098
|
}
|
|
5346
5099
|
});
|
|
5347
|
-
return
|
|
5100
|
+
return unwrap29(data);
|
|
5348
5101
|
}
|
|
5349
5102
|
async delete(databaseId) {
|
|
5350
5103
|
await this.http.delete(`/databases/${databaseId}`);
|
|
@@ -5354,24 +5107,24 @@ var Databases = class {
|
|
|
5354
5107
|
const data = await this.http.post(
|
|
5355
5108
|
`/databases/${databaseId}/start`
|
|
5356
5109
|
);
|
|
5357
|
-
return
|
|
5110
|
+
return unwrap29(data);
|
|
5358
5111
|
}
|
|
5359
5112
|
async stop(databaseId) {
|
|
5360
5113
|
const data = await this.http.post(`/databases/${databaseId}/stop`);
|
|
5361
|
-
return
|
|
5114
|
+
return unwrap29(data);
|
|
5362
5115
|
}
|
|
5363
5116
|
async restart(databaseId) {
|
|
5364
5117
|
const data = await this.http.post(
|
|
5365
5118
|
`/databases/${databaseId}/restart`
|
|
5366
5119
|
);
|
|
5367
|
-
return
|
|
5120
|
+
return unwrap29(data);
|
|
5368
5121
|
}
|
|
5369
5122
|
// ── Credentials + logs ────────────────────────────────────────────────────
|
|
5370
5123
|
async credentials(databaseId) {
|
|
5371
5124
|
const data = await this.http.get(
|
|
5372
5125
|
`/databases/${databaseId}/credentials`
|
|
5373
5126
|
);
|
|
5374
|
-
return
|
|
5127
|
+
return unwrap29(data);
|
|
5375
5128
|
}
|
|
5376
5129
|
async logs(databaseId, params = {}) {
|
|
5377
5130
|
const query3 = stripUndefined15({
|
|
@@ -5401,7 +5154,7 @@ function attributionBody(p) {
|
|
|
5401
5154
|
function idempotencyKey4(key) {
|
|
5402
5155
|
return key ?? randomUUID();
|
|
5403
5156
|
}
|
|
5404
|
-
function
|
|
5157
|
+
function unwrap30(payload) {
|
|
5405
5158
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
5406
5159
|
return payload.data;
|
|
5407
5160
|
}
|
|
@@ -5510,7 +5263,7 @@ var DeploymentVersions = class {
|
|
|
5510
5263
|
const data = await this.http.get(
|
|
5511
5264
|
`/deployments/${this.deploymentId}/versions/${versionId}`
|
|
5512
5265
|
);
|
|
5513
|
-
return
|
|
5266
|
+
return unwrap30(data);
|
|
5514
5267
|
}
|
|
5515
5268
|
async promote(versionId, opts = {}) {
|
|
5516
5269
|
const body5 = stripUndefined16({ environment: opts.environment });
|
|
@@ -5522,14 +5275,14 @@ var DeploymentVersions = class {
|
|
|
5522
5275
|
headers: { "Idempotency-Key": idempotencyKey4(opts.idempotencyKey) }
|
|
5523
5276
|
}
|
|
5524
5277
|
);
|
|
5525
|
-
return
|
|
5278
|
+
return unwrap30(data);
|
|
5526
5279
|
}
|
|
5527
5280
|
async prepareMigrationBackup(versionId) {
|
|
5528
5281
|
const data = await this.http.request(
|
|
5529
5282
|
`/deployments/${this.deploymentId}/versions/${versionId}/migration-backup`,
|
|
5530
5283
|
{ method: "POST", body: {} }
|
|
5531
5284
|
);
|
|
5532
|
-
return
|
|
5285
|
+
return unwrap30(data);
|
|
5533
5286
|
}
|
|
5534
5287
|
};
|
|
5535
5288
|
var DeploymentReleases = class {
|
|
@@ -5549,7 +5302,7 @@ var DeploymentReleases = class {
|
|
|
5549
5302
|
const data = await this.http.get(
|
|
5550
5303
|
`/deployments/${this.deploymentId}/releases/${releaseId}`
|
|
5551
5304
|
);
|
|
5552
|
-
return
|
|
5305
|
+
return unwrap30(data);
|
|
5553
5306
|
}
|
|
5554
5307
|
async promote(releaseId, idempotencyKey11) {
|
|
5555
5308
|
const key = idempotencyKey11 ?? `promote:${this.deploymentId}:${releaseId}`;
|
|
@@ -5561,7 +5314,7 @@ var DeploymentReleases = class {
|
|
|
5561
5314
|
headers: { "Idempotency-Key": key }
|
|
5562
5315
|
}
|
|
5563
5316
|
);
|
|
5564
|
-
return
|
|
5317
|
+
return unwrap30(data);
|
|
5565
5318
|
}
|
|
5566
5319
|
};
|
|
5567
5320
|
var DeploymentRuntimeInstances = class {
|
|
@@ -5581,14 +5334,14 @@ var DeploymentRuntimeInstances = class {
|
|
|
5581
5334
|
const data = await this.http.get(
|
|
5582
5335
|
`/deployments/${this.deploymentId}/runtime-instances/${instanceId}`
|
|
5583
5336
|
);
|
|
5584
|
-
return
|
|
5337
|
+
return unwrap30(data);
|
|
5585
5338
|
}
|
|
5586
5339
|
async logs(instanceId, lines = 100) {
|
|
5587
5340
|
const data = await this.http.get(
|
|
5588
5341
|
`/deployments/${this.deploymentId}/runtime-instances/${instanceId}/logs`,
|
|
5589
5342
|
{ lines }
|
|
5590
5343
|
);
|
|
5591
|
-
const unwrapped =
|
|
5344
|
+
const unwrapped = unwrap30(data);
|
|
5592
5345
|
const result = { logs: String(unwrapped.logs ?? "") };
|
|
5593
5346
|
if (typeof unwrapped.runtime_instance_id === "string") {
|
|
5594
5347
|
result.runtime_instance_id = unwrapped.runtime_instance_id;
|
|
@@ -5623,7 +5376,7 @@ var DeploymentDomains = class {
|
|
|
5623
5376
|
headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
|
|
5624
5377
|
}
|
|
5625
5378
|
);
|
|
5626
|
-
return
|
|
5379
|
+
return unwrap30(data);
|
|
5627
5380
|
}
|
|
5628
5381
|
async list(filters = {}) {
|
|
5629
5382
|
const data = await this.http.get(
|
|
@@ -5636,7 +5389,7 @@ var DeploymentDomains = class {
|
|
|
5636
5389
|
const data = await this.http.post(
|
|
5637
5390
|
`/deployments/${this.deploymentId}/domains/${domainId}/verify`
|
|
5638
5391
|
);
|
|
5639
|
-
return
|
|
5392
|
+
return unwrap30(data);
|
|
5640
5393
|
}
|
|
5641
5394
|
async delete(domainId) {
|
|
5642
5395
|
await this.http.delete(
|
|
@@ -5666,7 +5419,7 @@ var Deployments = class {
|
|
|
5666
5419
|
}
|
|
5667
5420
|
async get(deploymentId) {
|
|
5668
5421
|
const data = await this.http.get(`/deployments/${deploymentId}`);
|
|
5669
|
-
return
|
|
5422
|
+
return unwrap30(data);
|
|
5670
5423
|
}
|
|
5671
5424
|
async create(params) {
|
|
5672
5425
|
const body5 = stripUndefined16({
|
|
@@ -5685,7 +5438,7 @@ var Deployments = class {
|
|
|
5685
5438
|
body: body5,
|
|
5686
5439
|
headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
|
|
5687
5440
|
});
|
|
5688
|
-
return
|
|
5441
|
+
return unwrap30(data);
|
|
5689
5442
|
}
|
|
5690
5443
|
/**
|
|
5691
5444
|
* Create a deployment that runs on the workspace's dedicated App Engine
|
|
@@ -5729,7 +5482,7 @@ var Deployments = class {
|
|
|
5729
5482
|
const rawHost = await this.http.get(
|
|
5730
5483
|
`/docker-deploy/hosts/${hostId}`
|
|
5731
5484
|
);
|
|
5732
|
-
host =
|
|
5485
|
+
host = unwrap30(
|
|
5733
5486
|
rawHost
|
|
5734
5487
|
);
|
|
5735
5488
|
addDoctorCheck(
|
|
@@ -5880,7 +5633,7 @@ var Deployments = class {
|
|
|
5880
5633
|
const rawHost = await this.http.get(
|
|
5881
5634
|
`/docker-deploy/hosts/${hostId}`
|
|
5882
5635
|
);
|
|
5883
|
-
const host =
|
|
5636
|
+
const host = unwrap30(
|
|
5884
5637
|
rawHost
|
|
5885
5638
|
);
|
|
5886
5639
|
addProofCheck(
|
|
@@ -5987,7 +5740,7 @@ var Deployments = class {
|
|
|
5987
5740
|
`/deployments/${deploymentId}`,
|
|
5988
5741
|
body5
|
|
5989
5742
|
);
|
|
5990
|
-
return
|
|
5743
|
+
return unwrap30(data);
|
|
5991
5744
|
}
|
|
5992
5745
|
async delete(deploymentId) {
|
|
5993
5746
|
await this.http.delete(`/deployments/${deploymentId}`);
|
|
@@ -6007,7 +5760,7 @@ var Deployments = class {
|
|
|
6007
5760
|
headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
|
|
6008
5761
|
}
|
|
6009
5762
|
);
|
|
6010
|
-
return
|
|
5763
|
+
return unwrap30(data);
|
|
6011
5764
|
}
|
|
6012
5765
|
/**
|
|
6013
5766
|
* Backward-compatible bridge: POST /sandboxes/:id/deploy. Works today;
|
|
@@ -6032,7 +5785,7 @@ var Deployments = class {
|
|
|
6032
5785
|
headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
|
|
6033
5786
|
}
|
|
6034
5787
|
);
|
|
6035
|
-
return
|
|
5788
|
+
return unwrap30(data);
|
|
6036
5789
|
}
|
|
6037
5790
|
async rollback(deploymentId, params = {}) {
|
|
6038
5791
|
const body5 = stripUndefined16({
|
|
@@ -6046,7 +5799,7 @@ var Deployments = class {
|
|
|
6046
5799
|
headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
|
|
6047
5800
|
}
|
|
6048
5801
|
);
|
|
6049
|
-
return
|
|
5802
|
+
return unwrap30(data);
|
|
6050
5803
|
}
|
|
6051
5804
|
async listBuilds(deploymentId) {
|
|
6052
5805
|
const data = await this.http.get(
|
|
@@ -6058,7 +5811,7 @@ var Deployments = class {
|
|
|
6058
5811
|
const data = await this.http.get(
|
|
6059
5812
|
`/deployments/${deploymentId}/builds/${buildId}`
|
|
6060
5813
|
);
|
|
6061
|
-
return
|
|
5814
|
+
return unwrap30(data);
|
|
6062
5815
|
}
|
|
6063
5816
|
async listEnv(deploymentId) {
|
|
6064
5817
|
const data = await this.http.get(
|
|
@@ -6104,7 +5857,7 @@ var RUNTIME_BINARIES = {
|
|
|
6104
5857
|
pi: ["pi"],
|
|
6105
5858
|
custom: []
|
|
6106
5859
|
};
|
|
6107
|
-
function
|
|
5860
|
+
function unwrap31(payload, keys = ["data"]) {
|
|
6108
5861
|
if (payload && typeof payload === "object") {
|
|
6109
5862
|
const p = payload;
|
|
6110
5863
|
for (const key of keys) {
|
|
@@ -6163,7 +5916,7 @@ var Devices = class {
|
|
|
6163
5916
|
/** Show one unified device by id. */
|
|
6164
5917
|
async get(id) {
|
|
6165
5918
|
const data = await this.http.get(`/devices/${devicePath(id)}`);
|
|
6166
|
-
return
|
|
5919
|
+
return unwrap31(data);
|
|
6167
5920
|
}
|
|
6168
5921
|
show(id) {
|
|
6169
5922
|
return this.get(id);
|
|
@@ -6173,7 +5926,7 @@ var Devices = class {
|
|
|
6173
5926
|
const data = await this.http.get(
|
|
6174
5927
|
`/devices/${devicePath(id)}/capabilities`
|
|
6175
5928
|
);
|
|
6176
|
-
return
|
|
5929
|
+
return unwrap31(data);
|
|
6177
5930
|
}
|
|
6178
5931
|
/** Execute a command inside the device. */
|
|
6179
5932
|
async exec(id, params) {
|
|
@@ -6186,7 +5939,7 @@ var Devices = class {
|
|
|
6186
5939
|
env: params.env
|
|
6187
5940
|
})
|
|
6188
5941
|
);
|
|
6189
|
-
return
|
|
5942
|
+
return unwrap31(data);
|
|
6190
5943
|
}
|
|
6191
5944
|
/** List files inside the device filesystem. */
|
|
6192
5945
|
async listFiles(id, params = {}) {
|
|
@@ -6202,7 +5955,7 @@ var Devices = class {
|
|
|
6202
5955
|
`/devices/${devicePath(id)}/files/read`,
|
|
6203
5956
|
queryFromFileParams(params)
|
|
6204
5957
|
);
|
|
6205
|
-
return
|
|
5958
|
+
return unwrap31(data);
|
|
6206
5959
|
}
|
|
6207
5960
|
/** Write a text or base64 payload into the device filesystem. */
|
|
6208
5961
|
async writeFile(id, params) {
|
|
@@ -6214,7 +5967,7 @@ var Devices = class {
|
|
|
6214
5967
|
content_base64: pickFirst5(params.contentBase64, params.content_base64)
|
|
6215
5968
|
})
|
|
6216
5969
|
);
|
|
6217
|
-
return
|
|
5970
|
+
return unwrap31(data);
|
|
6218
5971
|
}
|
|
6219
5972
|
/** Expose a device port through MIOSA routing. */
|
|
6220
5973
|
async expose(id, params) {
|
|
@@ -6222,44 +5975,44 @@ var Devices = class {
|
|
|
6222
5975
|
`/devices/${devicePath(id)}/expose`,
|
|
6223
5976
|
{ port: params.port }
|
|
6224
5977
|
);
|
|
6225
|
-
return
|
|
5978
|
+
return unwrap31(data);
|
|
6226
5979
|
}
|
|
6227
5980
|
/** Return browser/desktop connection details for a computer-backed device. */
|
|
6228
5981
|
async browser(id) {
|
|
6229
5982
|
const data = await this.http.get(`/devices/${devicePath(id)}/browser`);
|
|
6230
|
-
return
|
|
5983
|
+
return unwrap31(data);
|
|
6231
5984
|
}
|
|
6232
5985
|
async pause(id) {
|
|
6233
5986
|
const data = await this.http.post(
|
|
6234
5987
|
`/devices/${devicePath(id)}/pause`,
|
|
6235
5988
|
{}
|
|
6236
5989
|
);
|
|
6237
|
-
return
|
|
5990
|
+
return unwrap31(data);
|
|
6238
5991
|
}
|
|
6239
5992
|
async stop(id) {
|
|
6240
5993
|
const data = await this.http.post(
|
|
6241
5994
|
`/devices/${devicePath(id)}/stop`,
|
|
6242
5995
|
{}
|
|
6243
5996
|
);
|
|
6244
|
-
return
|
|
5997
|
+
return unwrap31(data);
|
|
6245
5998
|
}
|
|
6246
5999
|
async resume(id) {
|
|
6247
6000
|
const data = await this.http.post(
|
|
6248
6001
|
`/devices/${devicePath(id)}/resume`,
|
|
6249
6002
|
{}
|
|
6250
6003
|
);
|
|
6251
|
-
return
|
|
6004
|
+
return unwrap31(data);
|
|
6252
6005
|
}
|
|
6253
6006
|
async extend(id, params) {
|
|
6254
6007
|
const data = await this.http.post(
|
|
6255
6008
|
`/devices/${devicePath(id)}/extend`,
|
|
6256
6009
|
{ timeout_sec: pickFirst5(params.timeoutSec, params.timeout_sec) }
|
|
6257
6010
|
);
|
|
6258
|
-
return
|
|
6011
|
+
return unwrap31(data);
|
|
6259
6012
|
}
|
|
6260
6013
|
async destroy(id) {
|
|
6261
6014
|
const data = await this.http.delete(`/devices/${devicePath(id)}`);
|
|
6262
|
-
return
|
|
6015
|
+
return unwrap31(data);
|
|
6263
6016
|
}
|
|
6264
6017
|
/**
|
|
6265
6018
|
* Write a MIOSA runtime bootstrap manifest and optionally install/probe
|
|
@@ -6429,7 +6182,7 @@ var DockerDeploy = class {
|
|
|
6429
6182
|
};
|
|
6430
6183
|
|
|
6431
6184
|
// src/resources/email.ts
|
|
6432
|
-
function
|
|
6185
|
+
function unwrap32(data) {
|
|
6433
6186
|
if (data && typeof data === "object") {
|
|
6434
6187
|
const d = data;
|
|
6435
6188
|
for (const k of [
|
|
@@ -6481,12 +6234,12 @@ var EmailCampaigns = class {
|
|
|
6481
6234
|
);
|
|
6482
6235
|
}
|
|
6483
6236
|
async create(attrs) {
|
|
6484
|
-
return
|
|
6237
|
+
return unwrap32(
|
|
6485
6238
|
await this.http.post("/admin/email-campaigns", strip(attrs))
|
|
6486
6239
|
);
|
|
6487
6240
|
}
|
|
6488
6241
|
async recipientCount(filters = {}) {
|
|
6489
|
-
return
|
|
6242
|
+
return unwrap32(
|
|
6490
6243
|
await this.http.get(
|
|
6491
6244
|
"/admin/email-campaigns/recipient-count",
|
|
6492
6245
|
filters
|
|
@@ -6494,7 +6247,7 @@ var EmailCampaigns = class {
|
|
|
6494
6247
|
);
|
|
6495
6248
|
}
|
|
6496
6249
|
async send(campaignId, opts = {}) {
|
|
6497
|
-
return
|
|
6250
|
+
return unwrap32(
|
|
6498
6251
|
await this.http.post(
|
|
6499
6252
|
`/admin/email-campaigns/${campaignId}/send`,
|
|
6500
6253
|
strip(opts)
|
|
@@ -6502,7 +6255,7 @@ var EmailCampaigns = class {
|
|
|
6502
6255
|
);
|
|
6503
6256
|
}
|
|
6504
6257
|
async cancel(campaignId) {
|
|
6505
|
-
return
|
|
6258
|
+
return unwrap32(
|
|
6506
6259
|
await this.http.post(
|
|
6507
6260
|
`/admin/email-campaigns/${campaignId}/cancel`
|
|
6508
6261
|
)
|
|
@@ -6528,7 +6281,7 @@ var EmailTemplates = class {
|
|
|
6528
6281
|
);
|
|
6529
6282
|
}
|
|
6530
6283
|
async create(key, attrs = {}) {
|
|
6531
|
-
return
|
|
6284
|
+
return unwrap32(
|
|
6532
6285
|
await this.http.post("/admin/email-templates", {
|
|
6533
6286
|
key,
|
|
6534
6287
|
...strip(attrs)
|
|
@@ -6536,7 +6289,7 @@ var EmailTemplates = class {
|
|
|
6536
6289
|
);
|
|
6537
6290
|
}
|
|
6538
6291
|
async update(key, attrs) {
|
|
6539
|
-
return
|
|
6292
|
+
return unwrap32(
|
|
6540
6293
|
await this.http.put(
|
|
6541
6294
|
`/admin/email-templates/${key}`,
|
|
6542
6295
|
strip(attrs)
|
|
@@ -6544,7 +6297,7 @@ var EmailTemplates = class {
|
|
|
6544
6297
|
);
|
|
6545
6298
|
}
|
|
6546
6299
|
async reset(key) {
|
|
6547
|
-
return
|
|
6300
|
+
return unwrap32(
|
|
6548
6301
|
await this.http.post(`/admin/email-templates/${key}/reset`)
|
|
6549
6302
|
);
|
|
6550
6303
|
}
|
|
@@ -6560,17 +6313,17 @@ var EmailInbox = class {
|
|
|
6560
6313
|
);
|
|
6561
6314
|
}
|
|
6562
6315
|
async send(attrs) {
|
|
6563
|
-
return
|
|
6316
|
+
return unwrap32(
|
|
6564
6317
|
await this.http.post("/admin/email-inbox/send", strip(attrs))
|
|
6565
6318
|
);
|
|
6566
6319
|
}
|
|
6567
6320
|
async markRead(messageId) {
|
|
6568
|
-
return
|
|
6321
|
+
return unwrap32(
|
|
6569
6322
|
await this.http.post(`/admin/email-inbox/${messageId}/read`)
|
|
6570
6323
|
);
|
|
6571
6324
|
}
|
|
6572
6325
|
async archive(messageId) {
|
|
6573
|
-
return
|
|
6326
|
+
return unwrap32(
|
|
6574
6327
|
await this.http.post(`/admin/email-inbox/${messageId}/archive`)
|
|
6575
6328
|
);
|
|
6576
6329
|
}
|
|
@@ -6610,7 +6363,7 @@ var Embeddings = class {
|
|
|
6610
6363
|
};
|
|
6611
6364
|
|
|
6612
6365
|
// src/resources/external-keys.ts
|
|
6613
|
-
function
|
|
6366
|
+
function unwrap33(payload) {
|
|
6614
6367
|
if (payload && typeof payload === "object") {
|
|
6615
6368
|
const p = payload;
|
|
6616
6369
|
for (const k of ["data", "external_keys", "items"]) {
|
|
@@ -6632,7 +6385,7 @@ var ExternalKeys = class {
|
|
|
6632
6385
|
/** List configured external keys. */
|
|
6633
6386
|
async list() {
|
|
6634
6387
|
const data = await this.http.get("/external-keys");
|
|
6635
|
-
const result =
|
|
6388
|
+
const result = unwrap33(data);
|
|
6636
6389
|
if (Array.isArray(result)) return result;
|
|
6637
6390
|
return [];
|
|
6638
6391
|
}
|
|
@@ -6640,14 +6393,14 @@ var ExternalKeys = class {
|
|
|
6640
6393
|
async create(params) {
|
|
6641
6394
|
const body5 = stripUndefined18(params);
|
|
6642
6395
|
const data = await this.http.post("/external-keys", body5);
|
|
6643
|
-
return
|
|
6396
|
+
return unwrap33(data);
|
|
6644
6397
|
}
|
|
6645
6398
|
/** Resolve (preview) the stored key for a provider. */
|
|
6646
6399
|
async resolve(provider) {
|
|
6647
6400
|
const data = await this.http.get(
|
|
6648
6401
|
`/external-keys/${provider}/resolve`
|
|
6649
6402
|
);
|
|
6650
|
-
return
|
|
6403
|
+
return unwrap33(data);
|
|
6651
6404
|
}
|
|
6652
6405
|
/**
|
|
6653
6406
|
* Delete the stored key for a provider.
|
|
@@ -6657,7 +6410,7 @@ var ExternalKeys = class {
|
|
|
6657
6410
|
await this.http.delete(`/external-keys/${provider}`);
|
|
6658
6411
|
}
|
|
6659
6412
|
};
|
|
6660
|
-
function
|
|
6413
|
+
function unwrap34(payload) {
|
|
6661
6414
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
6662
6415
|
return payload.data;
|
|
6663
6416
|
}
|
|
@@ -6710,13 +6463,13 @@ var FlatCustomDomains = class {
|
|
|
6710
6463
|
body: body5,
|
|
6711
6464
|
headers: { "Idempotency-Key": idempotencyKey5(ikey) }
|
|
6712
6465
|
});
|
|
6713
|
-
return
|
|
6466
|
+
return unwrap34(data);
|
|
6714
6467
|
}
|
|
6715
6468
|
async delete(domainId) {
|
|
6716
6469
|
await this.http.delete(`/custom-domains/${domainId}`);
|
|
6717
6470
|
}
|
|
6718
6471
|
};
|
|
6719
|
-
function
|
|
6472
|
+
function unwrap35(payload) {
|
|
6720
6473
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
6721
6474
|
return payload.data;
|
|
6722
6475
|
}
|
|
@@ -6752,7 +6505,7 @@ var Functions = class {
|
|
|
6752
6505
|
}
|
|
6753
6506
|
async get(functionId) {
|
|
6754
6507
|
const data = await this.http.get(`/functions/${functionId}`);
|
|
6755
|
-
return
|
|
6508
|
+
return unwrap35(data);
|
|
6756
6509
|
}
|
|
6757
6510
|
async create(params) {
|
|
6758
6511
|
const { idempotencyKey: ikey, memoryMb, timeoutSec, ...rest } = params;
|
|
@@ -6766,7 +6519,7 @@ var Functions = class {
|
|
|
6766
6519
|
body: body5,
|
|
6767
6520
|
headers: { "Idempotency-Key": idempotencyKey6(ikey) }
|
|
6768
6521
|
});
|
|
6769
|
-
return
|
|
6522
|
+
return unwrap35(data);
|
|
6770
6523
|
}
|
|
6771
6524
|
async update(functionId, params) {
|
|
6772
6525
|
const { memoryMb, timeoutSec, ...rest } = params;
|
|
@@ -6779,7 +6532,7 @@ var Functions = class {
|
|
|
6779
6532
|
`/functions/${functionId}`,
|
|
6780
6533
|
body5
|
|
6781
6534
|
);
|
|
6782
|
-
return
|
|
6535
|
+
return unwrap35(data);
|
|
6783
6536
|
}
|
|
6784
6537
|
async delete(functionId) {
|
|
6785
6538
|
await this.http.delete(`/functions/${functionId}`);
|
|
@@ -6800,386 +6553,7 @@ var Functions = class {
|
|
|
6800
6553
|
return data ?? {};
|
|
6801
6554
|
}
|
|
6802
6555
|
};
|
|
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) {
|
|
6556
|
+
function unwrap36(payload) {
|
|
7183
6557
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
7184
6558
|
return payload.data;
|
|
7185
6559
|
}
|
|
@@ -7215,7 +6589,7 @@ var HealthChecks = class {
|
|
|
7215
6589
|
}
|
|
7216
6590
|
async get(checkId) {
|
|
7217
6591
|
const data = await this.http.get(`/health-checks/${checkId}`);
|
|
7218
|
-
return
|
|
6592
|
+
return unwrap36(data);
|
|
7219
6593
|
}
|
|
7220
6594
|
async create(params) {
|
|
7221
6595
|
const {
|
|
@@ -7236,7 +6610,7 @@ var HealthChecks = class {
|
|
|
7236
6610
|
body: body5,
|
|
7237
6611
|
headers: { "Idempotency-Key": idempotencyKey7(ikey) }
|
|
7238
6612
|
});
|
|
7239
|
-
return
|
|
6613
|
+
return unwrap36(data);
|
|
7240
6614
|
}
|
|
7241
6615
|
async update(checkId, params) {
|
|
7242
6616
|
const { intervalSec, timeoutSec, expectedStatus, ...rest } = params;
|
|
@@ -7250,7 +6624,7 @@ var HealthChecks = class {
|
|
|
7250
6624
|
`/health-checks/${checkId}`,
|
|
7251
6625
|
body5
|
|
7252
6626
|
);
|
|
7253
|
-
return
|
|
6627
|
+
return unwrap36(data);
|
|
7254
6628
|
}
|
|
7255
6629
|
async delete(checkId) {
|
|
7256
6630
|
await this.http.delete(`/health-checks/${checkId}`);
|
|
@@ -7258,7 +6632,7 @@ var HealthChecks = class {
|
|
|
7258
6632
|
};
|
|
7259
6633
|
|
|
7260
6634
|
// src/resources/integrations.ts
|
|
7261
|
-
function
|
|
6635
|
+
function unwrap37(payload) {
|
|
7262
6636
|
if (payload && typeof payload === "object") {
|
|
7263
6637
|
const p = payload;
|
|
7264
6638
|
for (const k of ["data", "integrations", "catalog", "items"]) {
|
|
@@ -7268,7 +6642,7 @@ function unwrap39(payload) {
|
|
|
7268
6642
|
return payload;
|
|
7269
6643
|
}
|
|
7270
6644
|
function listItems8(payload) {
|
|
7271
|
-
const result =
|
|
6645
|
+
const result = unwrap37(payload);
|
|
7272
6646
|
if (Array.isArray(result)) return result;
|
|
7273
6647
|
return [];
|
|
7274
6648
|
}
|
|
@@ -7297,14 +6671,14 @@ var Integrations = class {
|
|
|
7297
6671
|
const data = await this.http.get(
|
|
7298
6672
|
`/integrations/${provider}/start`
|
|
7299
6673
|
);
|
|
7300
|
-
return
|
|
6674
|
+
return unwrap37(data);
|
|
7301
6675
|
}
|
|
7302
6676
|
/** Force-refresh the access token for a provider. */
|
|
7303
6677
|
async refresh(provider) {
|
|
7304
6678
|
const data = await this.http.post(
|
|
7305
6679
|
`/integrations/${provider}/refresh`
|
|
7306
6680
|
);
|
|
7307
|
-
return
|
|
6681
|
+
return unwrap37(data);
|
|
7308
6682
|
}
|
|
7309
6683
|
/** Disconnect (revoke) an integration. */
|
|
7310
6684
|
async disconnect(provider) {
|
|
@@ -7329,7 +6703,7 @@ var Integrations = class {
|
|
|
7329
6703
|
"/integrations/slack/send-test",
|
|
7330
6704
|
body5
|
|
7331
6705
|
);
|
|
7332
|
-
return
|
|
6706
|
+
return unwrap37(data);
|
|
7333
6707
|
}
|
|
7334
6708
|
/** Send a test message to the connected Discord channel. */
|
|
7335
6709
|
async discordSendTest(params = {}) {
|
|
@@ -7338,13 +6712,13 @@ var Integrations = class {
|
|
|
7338
6712
|
"/integrations/discord/send-test",
|
|
7339
6713
|
body5
|
|
7340
6714
|
);
|
|
7341
|
-
return
|
|
6715
|
+
return unwrap37(data);
|
|
7342
6716
|
}
|
|
7343
6717
|
// ── Linear dedicated controller ────────────────────────────────────────────
|
|
7344
6718
|
/** Begin Linear OAuth — Linear has provider-specific error shapes. */
|
|
7345
6719
|
async linearStart() {
|
|
7346
6720
|
const data = await this.http.get("/integrations/linear/start");
|
|
7347
|
-
return
|
|
6721
|
+
return unwrap37(data);
|
|
7348
6722
|
}
|
|
7349
6723
|
/** Create a Linear issue via the connected workspace. */
|
|
7350
6724
|
async linearCreateIssue(params = {}) {
|
|
@@ -7353,12 +6727,12 @@ var Integrations = class {
|
|
|
7353
6727
|
"/integrations/linear/create-issue",
|
|
7354
6728
|
body5
|
|
7355
6729
|
);
|
|
7356
|
-
return
|
|
6730
|
+
return unwrap37(data);
|
|
7357
6731
|
}
|
|
7358
6732
|
};
|
|
7359
6733
|
|
|
7360
6734
|
// src/resources/mcp.ts
|
|
7361
|
-
function
|
|
6735
|
+
function unwrap38(payload) {
|
|
7362
6736
|
if (payload && typeof payload === "object") {
|
|
7363
6737
|
const p = payload;
|
|
7364
6738
|
for (const k of ["data", "mcp", "result", "items"]) {
|
|
@@ -7384,7 +6758,7 @@ var Mcp = class {
|
|
|
7384
6758
|
"/mcp",
|
|
7385
6759
|
Object.keys(body5).length > 0 ? body5 : void 0
|
|
7386
6760
|
);
|
|
7387
|
-
return
|
|
6761
|
+
return unwrap38(data);
|
|
7388
6762
|
}
|
|
7389
6763
|
/**
|
|
7390
6764
|
* Open the MCP listen channel (GET).
|
|
@@ -7394,7 +6768,7 @@ var Mcp = class {
|
|
|
7394
6768
|
*/
|
|
7395
6769
|
async listen() {
|
|
7396
6770
|
const data = await this.http.get("/mcp");
|
|
7397
|
-
return
|
|
6771
|
+
return unwrap38(data);
|
|
7398
6772
|
}
|
|
7399
6773
|
/** Close (terminate) the MCP session. */
|
|
7400
6774
|
async close() {
|
|
@@ -7403,7 +6777,7 @@ var Mcp = class {
|
|
|
7403
6777
|
};
|
|
7404
6778
|
|
|
7405
6779
|
// src/resources/models.ts
|
|
7406
|
-
function
|
|
6780
|
+
function unwrap39(data) {
|
|
7407
6781
|
if (Array.isArray(data)) return data;
|
|
7408
6782
|
if (data && typeof data === "object") {
|
|
7409
6783
|
const d = data;
|
|
@@ -7424,7 +6798,7 @@ var Models = class {
|
|
|
7424
6798
|
Object.entries(filters).filter(([, v]) => v !== void 0)
|
|
7425
6799
|
);
|
|
7426
6800
|
const data = await this.http.get("/intelligence/models", query3);
|
|
7427
|
-
return
|
|
6801
|
+
return unwrap39(data);
|
|
7428
6802
|
}
|
|
7429
6803
|
/**
|
|
7430
6804
|
* Get a single model by id.
|
|
@@ -8080,7 +7454,7 @@ function requestBody(params) {
|
|
|
8080
7454
|
config: authConfig(params)
|
|
8081
7455
|
});
|
|
8082
7456
|
}
|
|
8083
|
-
function
|
|
7457
|
+
function unwrap40(payload) {
|
|
8084
7458
|
if (payload && typeof payload === "object") {
|
|
8085
7459
|
const p = payload;
|
|
8086
7460
|
for (const k of ["data", "project_auth", "config", "items"]) {
|
|
@@ -8105,13 +7479,13 @@ var ProjectAuth = class {
|
|
|
8105
7479
|
"/project-auth/status",
|
|
8106
7480
|
resourcePayload(params)
|
|
8107
7481
|
);
|
|
8108
|
-
return
|
|
7482
|
+
return unwrap40(data);
|
|
8109
7483
|
}
|
|
8110
7484
|
/** Enable project auth. */
|
|
8111
7485
|
async enable(params) {
|
|
8112
7486
|
const body5 = requestBody(params);
|
|
8113
7487
|
const data = await this.http.post("/project-auth/enable", body5);
|
|
8114
|
-
return
|
|
7488
|
+
return unwrap40(data);
|
|
8115
7489
|
}
|
|
8116
7490
|
/** Disable project auth. */
|
|
8117
7491
|
async disable(params) {
|
|
@@ -8119,18 +7493,18 @@ var ProjectAuth = class {
|
|
|
8119
7493
|
"/project-auth/disable",
|
|
8120
7494
|
resourcePayload(params)
|
|
8121
7495
|
);
|
|
8122
|
-
return
|
|
7496
|
+
return unwrap40(data);
|
|
8123
7497
|
}
|
|
8124
7498
|
/** Update project-auth configuration. */
|
|
8125
7499
|
async update(params) {
|
|
8126
7500
|
const body5 = requestBody(params);
|
|
8127
7501
|
const data = await this.http.patch("/project-auth/config", body5);
|
|
8128
|
-
return
|
|
7502
|
+
return unwrap40(data);
|
|
8129
7503
|
}
|
|
8130
7504
|
};
|
|
8131
7505
|
|
|
8132
7506
|
// src/resources/project-integrations.ts
|
|
8133
|
-
function
|
|
7507
|
+
function unwrap41(payload) {
|
|
8134
7508
|
if (payload && typeof payload === "object") {
|
|
8135
7509
|
const p = payload;
|
|
8136
7510
|
for (const k of ["data", "project_integrations", "catalog", "items"]) {
|
|
@@ -8140,7 +7514,7 @@ function unwrap43(payload) {
|
|
|
8140
7514
|
return payload;
|
|
8141
7515
|
}
|
|
8142
7516
|
function listItems9(payload) {
|
|
8143
|
-
const result =
|
|
7517
|
+
const result = unwrap41(payload);
|
|
8144
7518
|
if (Array.isArray(result)) return result;
|
|
8145
7519
|
return [];
|
|
8146
7520
|
}
|
|
@@ -8175,13 +7549,13 @@ var ProjectIntegrations = class {
|
|
|
8175
7549
|
const data = await this.http.get(
|
|
8176
7550
|
`/project-integrations/${integrationId}`
|
|
8177
7551
|
);
|
|
8178
|
-
return
|
|
7552
|
+
return unwrap41(data);
|
|
8179
7553
|
}
|
|
8180
7554
|
/** Create a project integration. */
|
|
8181
7555
|
async create(params) {
|
|
8182
7556
|
const body5 = stripUndefObj2(params);
|
|
8183
7557
|
const data = await this.http.post("/project-integrations", body5);
|
|
8184
|
-
return
|
|
7558
|
+
return unwrap41(data);
|
|
8185
7559
|
}
|
|
8186
7560
|
/** Update a project integration. */
|
|
8187
7561
|
async update(integrationId, params) {
|
|
@@ -8190,7 +7564,7 @@ var ProjectIntegrations = class {
|
|
|
8190
7564
|
`/project-integrations/${integrationId}`,
|
|
8191
7565
|
body5
|
|
8192
7566
|
);
|
|
8193
|
-
return
|
|
7567
|
+
return unwrap41(data);
|
|
8194
7568
|
}
|
|
8195
7569
|
/** Delete a project integration. */
|
|
8196
7570
|
async delete(integrationId) {
|
|
@@ -8199,7 +7573,7 @@ var ProjectIntegrations = class {
|
|
|
8199
7573
|
};
|
|
8200
7574
|
|
|
8201
7575
|
// src/resources/provider-defaults.ts
|
|
8202
|
-
function
|
|
7576
|
+
function unwrap42(data) {
|
|
8203
7577
|
if (data && typeof data === "object") {
|
|
8204
7578
|
const d = data;
|
|
8205
7579
|
for (const k of ["data", "defaults", "provider_defaults", "config"]) {
|
|
@@ -8215,7 +7589,7 @@ var ProviderDefaults = class {
|
|
|
8215
7589
|
http;
|
|
8216
7590
|
/** Get the current fleet-wide provider defaults. */
|
|
8217
7591
|
async list() {
|
|
8218
|
-
return
|
|
7592
|
+
return unwrap42(await this.http.get("/admin/provider-defaults"));
|
|
8219
7593
|
}
|
|
8220
7594
|
/** Return the defaults entry for a single provider, or {} if missing. */
|
|
8221
7595
|
async get(provider) {
|
|
@@ -8231,13 +7605,13 @@ var ProviderDefaults = class {
|
|
|
8231
7605
|
const body5 = Object.fromEntries(
|
|
8232
7606
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
8233
7607
|
);
|
|
8234
|
-
return
|
|
7608
|
+
return unwrap42(
|
|
8235
7609
|
await this.http.put("/admin/provider-defaults", body5)
|
|
8236
7610
|
);
|
|
8237
7611
|
}
|
|
8238
7612
|
// ── Per-tenant overrides ────────────────────────────────────────────────
|
|
8239
7613
|
async getTenant(tenantId) {
|
|
8240
|
-
return
|
|
7614
|
+
return unwrap42(
|
|
8241
7615
|
await this.http.get(
|
|
8242
7616
|
`/admin/tenants/${tenantId}/provider-config`
|
|
8243
7617
|
)
|
|
@@ -8247,7 +7621,7 @@ var ProviderDefaults = class {
|
|
|
8247
7621
|
const body5 = Object.fromEntries(
|
|
8248
7622
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
8249
7623
|
);
|
|
8250
|
-
return
|
|
7624
|
+
return unwrap42(
|
|
8251
7625
|
await this.http.put(
|
|
8252
7626
|
`/admin/tenants/${tenantId}/provider-config`,
|
|
8253
7627
|
body5
|
|
@@ -8260,7 +7634,7 @@ var ProviderDefaults = class {
|
|
|
8260
7634
|
};
|
|
8261
7635
|
|
|
8262
7636
|
// src/resources/regions.ts
|
|
8263
|
-
function
|
|
7637
|
+
function unwrap43(payload) {
|
|
8264
7638
|
if (payload && typeof payload === "object") {
|
|
8265
7639
|
const p = payload;
|
|
8266
7640
|
for (const k of [
|
|
@@ -8277,7 +7651,7 @@ function unwrap45(payload) {
|
|
|
8277
7651
|
return payload;
|
|
8278
7652
|
}
|
|
8279
7653
|
function listItems10(payload) {
|
|
8280
|
-
const result =
|
|
7654
|
+
const result = unwrap43(payload);
|
|
8281
7655
|
if (Array.isArray(result)) return result;
|
|
8282
7656
|
return [];
|
|
8283
7657
|
}
|
|
@@ -8294,7 +7668,7 @@ var Regions = class {
|
|
|
8294
7668
|
/** Get canonical compute catalog, including product templates and readiness. */
|
|
8295
7669
|
async catalog() {
|
|
8296
7670
|
const data = await this.http.get("/compute/catalog");
|
|
8297
|
-
return
|
|
7671
|
+
return unwrap43(data);
|
|
8298
7672
|
}
|
|
8299
7673
|
/** List available compute sizes. */
|
|
8300
7674
|
async listSizes() {
|
|
@@ -8304,7 +7678,7 @@ var Regions = class {
|
|
|
8304
7678
|
/** Get static compute pricing data. */
|
|
8305
7679
|
async pricing() {
|
|
8306
7680
|
const data = await this.http.get("/compute/pricing");
|
|
8307
|
-
return
|
|
7681
|
+
return unwrap43(data);
|
|
8308
7682
|
}
|
|
8309
7683
|
/** List community computer templates. */
|
|
8310
7684
|
async listTemplates() {
|
|
@@ -8316,12 +7690,12 @@ var Regions = class {
|
|
|
8316
7690
|
const data = await this.http.get(
|
|
8317
7691
|
`/compute/templates/${templateId}`
|
|
8318
7692
|
);
|
|
8319
|
-
return
|
|
7693
|
+
return unwrap43(data);
|
|
8320
7694
|
}
|
|
8321
7695
|
};
|
|
8322
7696
|
|
|
8323
7697
|
// src/resources/runtime-env.ts
|
|
8324
|
-
function
|
|
7698
|
+
function unwrap44(payload) {
|
|
8325
7699
|
if (payload !== null && typeof payload === "object" && "data" in payload && payload.data !== void 0) {
|
|
8326
7700
|
return payload.data;
|
|
8327
7701
|
}
|
|
@@ -8374,11 +7748,11 @@ var RuntimeEnv = class {
|
|
|
8374
7748
|
"/runtime-env",
|
|
8375
7749
|
query2(params)
|
|
8376
7750
|
);
|
|
8377
|
-
return
|
|
7751
|
+
return unwrap44(response).map(normalize2);
|
|
8378
7752
|
}
|
|
8379
7753
|
async get(id) {
|
|
8380
7754
|
return normalize2(
|
|
8381
|
-
|
|
7755
|
+
unwrap44(
|
|
8382
7756
|
await this.http.get(
|
|
8383
7757
|
`/runtime-env/${encodeURIComponent(id)}`
|
|
8384
7758
|
)
|
|
@@ -8387,7 +7761,7 @@ var RuntimeEnv = class {
|
|
|
8387
7761
|
}
|
|
8388
7762
|
async set(params) {
|
|
8389
7763
|
return normalize2(
|
|
8390
|
-
|
|
7764
|
+
unwrap44(
|
|
8391
7765
|
await this.http.post(
|
|
8392
7766
|
"/runtime-env",
|
|
8393
7767
|
body4(params)
|
|
@@ -8401,7 +7775,7 @@ var RuntimeEnv = class {
|
|
|
8401
7775
|
};
|
|
8402
7776
|
|
|
8403
7777
|
// src/resources/runtime-capabilities.ts
|
|
8404
|
-
function
|
|
7778
|
+
function unwrap45(payload) {
|
|
8405
7779
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
8406
7780
|
return payload.data;
|
|
8407
7781
|
}
|
|
@@ -8413,7 +7787,7 @@ var RuntimeCapabilitiesResource = class {
|
|
|
8413
7787
|
}
|
|
8414
7788
|
http;
|
|
8415
7789
|
async get() {
|
|
8416
|
-
return
|
|
7790
|
+
return unwrap45(
|
|
8417
7791
|
await this.http.get("/runtime-capabilities")
|
|
8418
7792
|
);
|
|
8419
7793
|
}
|
|
@@ -8443,7 +7817,7 @@ var AGENT_WORKSPACE_KEEP_LAST_SNAPSHOTS = 1;
|
|
|
8443
7817
|
function isLegacyForkParams(opts) {
|
|
8444
7818
|
return "name" in opts || "metadata" in opts;
|
|
8445
7819
|
}
|
|
8446
|
-
function
|
|
7820
|
+
function unwrap46(payload) {
|
|
8447
7821
|
if (payload !== null && typeof payload === "object" && "data" in payload && payload.data !== void 0) {
|
|
8448
7822
|
return payload.data;
|
|
8449
7823
|
}
|
|
@@ -8546,12 +7920,6 @@ function createBody(params = {}) {
|
|
|
8546
7920
|
slug: params.slug,
|
|
8547
7921
|
agent_runtime_profile_id: params.agentRuntimeProfileId ?? params.agent_runtime_profile_id ?? params.agentProfileId ?? params.agent_profile_id,
|
|
8548
7922
|
skip_agent_runtime_profile: params.skipRuntimeProfile ?? params.skip_agent_runtime_profile,
|
|
8549
|
-
workspace_id: params.workspaceId ?? params.workspace_id,
|
|
8550
|
-
workspace_slug: params.workspaceSlug ?? params.workspace_slug,
|
|
8551
|
-
workspace_name: params.workspaceName ?? params.workspace_name,
|
|
8552
|
-
project_id: params.projectId ?? params.project_id,
|
|
8553
|
-
project_slug: params.projectSlug ?? params.project_slug,
|
|
8554
|
-
project_name: params.projectName ?? params.project_name,
|
|
8555
7923
|
external_workspace_id: params.externalWorkspaceId ?? params.external_workspace_id,
|
|
8556
7924
|
external_user_id: params.externalUserId ?? params.external_user_id,
|
|
8557
7925
|
external_project_id: params.externalProjectId ?? params.external_project_id
|
|
@@ -8710,7 +8078,7 @@ var SandboxTerminal = class {
|
|
|
8710
8078
|
const body5 = Object.fromEntries(
|
|
8711
8079
|
Object.entries(params).filter(([, v]) => v !== void 0)
|
|
8712
8080
|
);
|
|
8713
|
-
const response =
|
|
8081
|
+
const response = unwrap46(
|
|
8714
8082
|
await this.sandbox.http.post(`/sandboxes/${this.sandbox.id}/terminal`, body5)
|
|
8715
8083
|
);
|
|
8716
8084
|
return response;
|
|
@@ -8768,7 +8136,7 @@ var SandboxPreviews = class {
|
|
|
8768
8136
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
8769
8137
|
)
|
|
8770
8138
|
};
|
|
8771
|
-
return
|
|
8139
|
+
return unwrap46(
|
|
8772
8140
|
await this.http.post(
|
|
8773
8141
|
`/sandboxes/${this.sandbox.id}/previews`,
|
|
8774
8142
|
body5
|
|
@@ -8776,7 +8144,7 @@ var SandboxPreviews = class {
|
|
|
8776
8144
|
);
|
|
8777
8145
|
}
|
|
8778
8146
|
async get(previewId) {
|
|
8779
|
-
return
|
|
8147
|
+
return unwrap46(
|
|
8780
8148
|
await this.http.get(
|
|
8781
8149
|
`/sandboxes/${this.sandbox.id}/previews/${previewId}`
|
|
8782
8150
|
)
|
|
@@ -8789,7 +8157,7 @@ var SandboxPreviews = class {
|
|
|
8789
8157
|
}
|
|
8790
8158
|
/** Mint a share token for previewId. */
|
|
8791
8159
|
async share(previewId, opts = {}) {
|
|
8792
|
-
return
|
|
8160
|
+
return unwrap46(
|
|
8793
8161
|
await this.http.post(
|
|
8794
8162
|
`/sandboxes/${this.sandbox.id}/previews/${previewId}/share`,
|
|
8795
8163
|
{ ttl_seconds: opts.ttl_seconds ?? opts.expires_in_sec ?? 3600 }
|
|
@@ -8858,7 +8226,7 @@ var SandboxTags = class {
|
|
|
8858
8226
|
sandbox;
|
|
8859
8227
|
/** Replace the full tag list with tags. */
|
|
8860
8228
|
async set(tags) {
|
|
8861
|
-
return
|
|
8229
|
+
return unwrap46(
|
|
8862
8230
|
await this.sandbox.http.patch(`/sandboxes/${this.sandbox.id}/tags`, { tags })
|
|
8863
8231
|
);
|
|
8864
8232
|
}
|
|
@@ -8932,7 +8300,7 @@ var Sandbox = class _Sandbox {
|
|
|
8932
8300
|
return this.data.template_id ?? this.data.image_id ?? "";
|
|
8933
8301
|
}
|
|
8934
8302
|
async refresh() {
|
|
8935
|
-
this.data =
|
|
8303
|
+
this.data = unwrap46(
|
|
8936
8304
|
await this.http.get(`/sandboxes/${this.id}`)
|
|
8937
8305
|
);
|
|
8938
8306
|
return this;
|
|
@@ -8974,7 +8342,7 @@ var Sandbox = class _Sandbox {
|
|
|
8974
8342
|
}
|
|
8975
8343
|
async runExec(command, options) {
|
|
8976
8344
|
this.assertRunning("exec");
|
|
8977
|
-
const response =
|
|
8345
|
+
const response = unwrap46(
|
|
8978
8346
|
await this.http.post(
|
|
8979
8347
|
`/sandboxes/${this.id}/exec`,
|
|
8980
8348
|
execBody(command, options)
|
|
@@ -9019,7 +8387,7 @@ var Sandbox = class _Sandbox {
|
|
|
9019
8387
|
}
|
|
9020
8388
|
async createExport(params) {
|
|
9021
8389
|
const body5 = typeof params === "string" ? { path: params } : Array.isArray(params) ? { paths: params } : params;
|
|
9022
|
-
const response =
|
|
8390
|
+
const response = unwrap46(
|
|
9023
8391
|
await this.http.post(
|
|
9024
8392
|
`/sandboxes/${this.id}/exports`,
|
|
9025
8393
|
body5
|
|
@@ -9044,7 +8412,7 @@ var Sandbox = class _Sandbox {
|
|
|
9044
8412
|
}
|
|
9045
8413
|
async listFiles(path = "/workspace") {
|
|
9046
8414
|
this.assertRunning("files.list");
|
|
9047
|
-
const response =
|
|
8415
|
+
const response = unwrap46(
|
|
9048
8416
|
await this.http.get(
|
|
9049
8417
|
`/sandboxes/${this.id}/files`,
|
|
9050
8418
|
{ path }
|
|
@@ -9054,7 +8422,7 @@ var Sandbox = class _Sandbox {
|
|
|
9054
8422
|
}
|
|
9055
8423
|
async statFile(path) {
|
|
9056
8424
|
this.assertRunning("files.stat");
|
|
9057
|
-
return
|
|
8425
|
+
return unwrap46(
|
|
9058
8426
|
await this.http.post(
|
|
9059
8427
|
`/sandboxes/${this.id}/files/stat`,
|
|
9060
8428
|
{ path }
|
|
@@ -9074,7 +8442,7 @@ var Sandbox = class _Sandbox {
|
|
|
9074
8442
|
}
|
|
9075
8443
|
async exposeInfo(port) {
|
|
9076
8444
|
this.assertRunning("expose");
|
|
9077
|
-
const response =
|
|
8445
|
+
const response = unwrap46(
|
|
9078
8446
|
await this.http.post(
|
|
9079
8447
|
`/sandboxes/${this.id}/expose`,
|
|
9080
8448
|
port === void 0 ? {} : { port }
|
|
@@ -9084,7 +8452,7 @@ var Sandbox = class _Sandbox {
|
|
|
9084
8452
|
}
|
|
9085
8453
|
async startTemplate(options = {}) {
|
|
9086
8454
|
this.assertRunning("startTemplate");
|
|
9087
|
-
return
|
|
8455
|
+
return unwrap46(
|
|
9088
8456
|
await this.http.post(
|
|
9089
8457
|
`/sandboxes/${this.id}/template/start`,
|
|
9090
8458
|
options
|
|
@@ -9092,7 +8460,7 @@ var Sandbox = class _Sandbox {
|
|
|
9092
8460
|
);
|
|
9093
8461
|
}
|
|
9094
8462
|
async getArtifacts() {
|
|
9095
|
-
return
|
|
8463
|
+
return unwrap46(
|
|
9096
8464
|
await this.http.get(
|
|
9097
8465
|
`/sandboxes/${this.id}/artifacts`
|
|
9098
8466
|
)
|
|
@@ -9103,7 +8471,7 @@ var Sandbox = class _Sandbox {
|
|
|
9103
8471
|
`/sandboxes/${this.id}/logs`,
|
|
9104
8472
|
{ lines }
|
|
9105
8473
|
);
|
|
9106
|
-
return
|
|
8474
|
+
return unwrap46(response);
|
|
9107
8475
|
}
|
|
9108
8476
|
streamLogs() {
|
|
9109
8477
|
return this.http.stream(
|
|
@@ -9111,7 +8479,7 @@ var Sandbox = class _Sandbox {
|
|
|
9111
8479
|
);
|
|
9112
8480
|
}
|
|
9113
8481
|
async metrics(window2 = "1h") {
|
|
9114
|
-
return
|
|
8482
|
+
return unwrap46(
|
|
9115
8483
|
await this.http.get(
|
|
9116
8484
|
`/sandboxes/${this.id}/metrics`,
|
|
9117
8485
|
{ window: window2 }
|
|
@@ -9123,7 +8491,7 @@ var Sandbox = class _Sandbox {
|
|
|
9123
8491
|
}
|
|
9124
8492
|
async createSnapshot(comment) {
|
|
9125
8493
|
this.assertRunning("snapshots.create");
|
|
9126
|
-
return
|
|
8494
|
+
return unwrap46(
|
|
9127
8495
|
await this.http.post(
|
|
9128
8496
|
`/sandboxes/${this.id}/snapshots`,
|
|
9129
8497
|
comment ? { comment } : {}
|
|
@@ -9131,14 +8499,14 @@ var Sandbox = class _Sandbox {
|
|
|
9131
8499
|
);
|
|
9132
8500
|
}
|
|
9133
8501
|
async listSnapshots() {
|
|
9134
|
-
return
|
|
8502
|
+
return unwrap46(
|
|
9135
8503
|
await this.http.get(
|
|
9136
8504
|
`/sandboxes/${this.id}/snapshots`
|
|
9137
8505
|
)
|
|
9138
8506
|
);
|
|
9139
8507
|
}
|
|
9140
8508
|
async restoreSnapshot(snapshotId) {
|
|
9141
|
-
const data =
|
|
8509
|
+
const data = unwrap46(
|
|
9142
8510
|
await this.http.post(
|
|
9143
8511
|
`/sandboxes/${this.id}/restore/${snapshotId}`,
|
|
9144
8512
|
{}
|
|
@@ -9155,12 +8523,11 @@ var Sandbox = class _Sandbox {
|
|
|
9155
8523
|
}
|
|
9156
8524
|
this.assertRunning("fork");
|
|
9157
8525
|
const body5 = stripUndefined26({
|
|
9158
|
-
snapshot_id: opts.snapshotId ?? opts.snapshot_id,
|
|
9159
8526
|
timeout_sec: opts.timeoutSec ?? opts.timeout_sec,
|
|
9160
8527
|
template_id: opts.templateId ?? opts.template_id
|
|
9161
8528
|
});
|
|
9162
8529
|
const idempotencyKey11 = opts.idempotencyKey ?? opts.idempotency_key;
|
|
9163
|
-
const data =
|
|
8530
|
+
const data = unwrap46(
|
|
9164
8531
|
await this.http.request(
|
|
9165
8532
|
`/sandboxes/${this.id}/fork`,
|
|
9166
8533
|
{
|
|
@@ -9176,14 +8543,13 @@ var Sandbox = class _Sandbox {
|
|
|
9176
8543
|
async forkLegacy(opts = {}) {
|
|
9177
8544
|
this.assertRunning("fork");
|
|
9178
8545
|
const body5 = stripUndefined26({
|
|
9179
|
-
snapshot_id: opts.snapshotId ?? opts.snapshot_id,
|
|
9180
8546
|
timeout_sec: opts.timeoutSec ?? opts.timeout_sec,
|
|
9181
8547
|
template_id: opts.templateId ?? opts.template_id,
|
|
9182
8548
|
name: opts.name,
|
|
9183
8549
|
metadata: opts.metadata
|
|
9184
8550
|
});
|
|
9185
8551
|
const idempotencyKey11 = opts.idempotencyKey ?? opts.idempotency_key;
|
|
9186
|
-
const data =
|
|
8552
|
+
const data = unwrap46(
|
|
9187
8553
|
await this.http.request(
|
|
9188
8554
|
`/sandboxes/${this.id}/fork`,
|
|
9189
8555
|
{
|
|
@@ -9219,7 +8585,7 @@ var Sandbox = class _Sandbox {
|
|
|
9219
8585
|
timeout_sec: params.timeout_sec ?? params.timeoutSec,
|
|
9220
8586
|
idle_timeout_sec: params.idle_timeout_sec ?? params.idleTimeoutSec
|
|
9221
8587
|
});
|
|
9222
|
-
const data =
|
|
8588
|
+
const data = unwrap46(
|
|
9223
8589
|
await this.http.patch(
|
|
9224
8590
|
`/sandboxes/${this.id}`,
|
|
9225
8591
|
body5
|
|
@@ -9229,7 +8595,7 @@ var Sandbox = class _Sandbox {
|
|
|
9229
8595
|
return this;
|
|
9230
8596
|
}
|
|
9231
8597
|
async extend(timeoutSec) {
|
|
9232
|
-
const data =
|
|
8598
|
+
const data = unwrap46(
|
|
9233
8599
|
await this.http.post(
|
|
9234
8600
|
`/sandboxes/${this.id}/extend`,
|
|
9235
8601
|
timeoutSec === void 0 ? {} : { timeout_sec: timeoutSec }
|
|
@@ -9239,7 +8605,7 @@ var Sandbox = class _Sandbox {
|
|
|
9239
8605
|
return this;
|
|
9240
8606
|
}
|
|
9241
8607
|
async usage() {
|
|
9242
|
-
return
|
|
8608
|
+
return unwrap46(
|
|
9243
8609
|
await this.http.get(
|
|
9244
8610
|
`/sandboxes/${this.id}/usage`
|
|
9245
8611
|
)
|
|
@@ -9259,7 +8625,7 @@ var Sandbox = class _Sandbox {
|
|
|
9259
8625
|
return raw;
|
|
9260
8626
|
}
|
|
9261
8627
|
async pause() {
|
|
9262
|
-
const data =
|
|
8628
|
+
const data = unwrap46(
|
|
9263
8629
|
await this.http.post(
|
|
9264
8630
|
`/sandboxes/${this.id}/pause`,
|
|
9265
8631
|
{}
|
|
@@ -9280,7 +8646,7 @@ var Sandbox = class _Sandbox {
|
|
|
9280
8646
|
`/sandboxes/${this.id}/resume`,
|
|
9281
8647
|
{}
|
|
9282
8648
|
);
|
|
9283
|
-
const data =
|
|
8649
|
+
const data = unwrap46(response);
|
|
9284
8650
|
this.data = { ...this.data, ...data };
|
|
9285
8651
|
return this;
|
|
9286
8652
|
}
|
|
@@ -9311,7 +8677,7 @@ var Sandbox = class _Sandbox {
|
|
|
9311
8677
|
if (idempotencyKey11) {
|
|
9312
8678
|
requestOptions.headers = { "Idempotency-Key": idempotencyKey11 };
|
|
9313
8679
|
}
|
|
9314
|
-
return
|
|
8680
|
+
return unwrap46(
|
|
9315
8681
|
await this.http.request(
|
|
9316
8682
|
`/sandboxes/${this.id}/deploy`,
|
|
9317
8683
|
requestOptions
|
|
@@ -9321,57 +8687,9 @@ var Sandbox = class _Sandbox {
|
|
|
9321
8687
|
async deployDocker(params = {}) {
|
|
9322
8688
|
return this.deploy({ ...params, deploymentType: "docker_deploy" });
|
|
9323
8689
|
}
|
|
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
|
-
}
|
|
9372
8690
|
/** Check readiness of the sandbox (GET /sandboxes/:id/readiness). */
|
|
9373
8691
|
async readiness() {
|
|
9374
|
-
return
|
|
8692
|
+
return unwrap46(
|
|
9375
8693
|
await this.http.get(
|
|
9376
8694
|
`/sandboxes/${this.id}/readiness`
|
|
9377
8695
|
)
|
|
@@ -9398,40 +8716,19 @@ var Sandbox = class _Sandbox {
|
|
|
9398
8716
|
const stream = options.stream ?? true;
|
|
9399
8717
|
if (stream) {
|
|
9400
8718
|
const sseResult = await this.tryReadinessStream(timeout);
|
|
9401
|
-
if (sseResult !== null)
|
|
9402
|
-
if (sseResult) await this.adoptReadyState();
|
|
9403
|
-
return sseResult;
|
|
9404
|
-
}
|
|
8719
|
+
if (sseResult !== null) return sseResult;
|
|
9405
8720
|
}
|
|
9406
8721
|
const deadlineMs = Date.now() + timeout * 1e3;
|
|
9407
8722
|
while (Date.now() < deadlineMs) {
|
|
9408
8723
|
try {
|
|
9409
8724
|
const data = await this.readiness();
|
|
9410
|
-
if (data.ready === true || data.status === "ready")
|
|
9411
|
-
await this.adoptReadyState();
|
|
9412
|
-
return true;
|
|
9413
|
-
}
|
|
8725
|
+
if (data.ready === true || data.status === "ready") return true;
|
|
9414
8726
|
} catch {
|
|
9415
8727
|
}
|
|
9416
8728
|
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
9417
8729
|
}
|
|
9418
8730
|
return false;
|
|
9419
8731
|
}
|
|
9420
|
-
/**
|
|
9421
|
-
* Readiness answers from the server; `assertRunning` reads the local
|
|
9422
|
-
* snapshot. Leaving that snapshot behind meant a caller could await
|
|
9423
|
-
* `waitUntilReady()`, receive `true`, and have the very next call refused
|
|
9424
|
-
* for being "provisioning" — the sandbox was running the whole time, only
|
|
9425
|
-
* this object had not been told. Nothing here can fail the wait: readiness
|
|
9426
|
-
* has already answered, so a refresh that does not land is not the caller's
|
|
9427
|
-
* problem.
|
|
9428
|
-
*/
|
|
9429
|
-
async adoptReadyState() {
|
|
9430
|
-
try {
|
|
9431
|
-
await this.refresh();
|
|
9432
|
-
} catch {
|
|
9433
|
-
}
|
|
9434
|
-
}
|
|
9435
8732
|
/**
|
|
9436
8733
|
* Returns `true` / `false` for terminal SSE events, or `null` if the
|
|
9437
8734
|
* stream endpoint is unavailable (404 or transport error) so callers
|
|
@@ -9560,7 +8857,7 @@ var Sandboxes = class {
|
|
|
9560
8857
|
if (idempotencyKey11) {
|
|
9561
8858
|
requestOptions.headers = { "Idempotency-Key": idempotencyKey11 };
|
|
9562
8859
|
}
|
|
9563
|
-
const data =
|
|
8860
|
+
const data = unwrap46(
|
|
9564
8861
|
await this.http.request(
|
|
9565
8862
|
"/sandboxes",
|
|
9566
8863
|
requestOptions
|
|
@@ -9579,7 +8876,7 @@ var Sandboxes = class {
|
|
|
9579
8876
|
return listItems11(data).map((item) => new Sandbox(this.http, item));
|
|
9580
8877
|
}
|
|
9581
8878
|
async get(id) {
|
|
9582
|
-
const data =
|
|
8879
|
+
const data = unwrap46(
|
|
9583
8880
|
await this.http.get(`/sandboxes/${id}`)
|
|
9584
8881
|
);
|
|
9585
8882
|
return new Sandbox(this.http, data);
|
|
@@ -9607,7 +8904,7 @@ var Sandboxes = class {
|
|
|
9607
8904
|
return this.get(id);
|
|
9608
8905
|
}
|
|
9609
8906
|
async getByName(name) {
|
|
9610
|
-
const data =
|
|
8907
|
+
const data = unwrap46(
|
|
9611
8908
|
await this.http.get(
|
|
9612
8909
|
`/sandboxes/by-name/${encodeURIComponent(name)}`
|
|
9613
8910
|
)
|
|
@@ -9654,7 +8951,7 @@ var Sandboxes = class {
|
|
|
9654
8951
|
);
|
|
9655
8952
|
}
|
|
9656
8953
|
async validateBuildSpec(buildSpec) {
|
|
9657
|
-
return
|
|
8954
|
+
return unwrap46(
|
|
9658
8955
|
await this.http.post(
|
|
9659
8956
|
"/sandbox-templates/validate",
|
|
9660
8957
|
{
|
|
@@ -9674,7 +8971,7 @@ var Sandboxes = class {
|
|
|
9674
8971
|
metadata: params.metadata
|
|
9675
8972
|
})
|
|
9676
8973
|
);
|
|
9677
|
-
return
|
|
8974
|
+
return unwrap46(response);
|
|
9678
8975
|
}
|
|
9679
8976
|
async createTemplateBuild(templateId, params = {}) {
|
|
9680
8977
|
const response = await this.http.post(
|
|
@@ -9684,19 +8981,19 @@ var Sandboxes = class {
|
|
|
9684
8981
|
metadata: params.metadata
|
|
9685
8982
|
})
|
|
9686
8983
|
);
|
|
9687
|
-
return
|
|
8984
|
+
return unwrap46(response);
|
|
9688
8985
|
}
|
|
9689
8986
|
async listTemplateBuilds(templateId) {
|
|
9690
8987
|
const response = await this.http.get(
|
|
9691
8988
|
`/sandbox-templates/${templateId}/builds`
|
|
9692
8989
|
);
|
|
9693
|
-
return
|
|
8990
|
+
return unwrap46(response);
|
|
9694
8991
|
}
|
|
9695
8992
|
async getTemplateBuild(buildId) {
|
|
9696
8993
|
const response = await this.http.get(
|
|
9697
8994
|
`/sandbox-template-builds/${buildId}`
|
|
9698
8995
|
);
|
|
9699
|
-
return
|
|
8996
|
+
return unwrap46(response);
|
|
9700
8997
|
}
|
|
9701
8998
|
};
|
|
9702
8999
|
function toBase642(bytes) {
|
|
@@ -9728,7 +9025,7 @@ function previewInfoFromResponse(response) {
|
|
|
9728
9025
|
)
|
|
9729
9026
|
};
|
|
9730
9027
|
}
|
|
9731
|
-
function
|
|
9028
|
+
function unwrap47(payload) {
|
|
9732
9029
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
9733
9030
|
return payload.data;
|
|
9734
9031
|
}
|
|
@@ -9771,7 +9068,7 @@ var SandboxTemplates = class {
|
|
|
9771
9068
|
const data = await this.http.get(
|
|
9772
9069
|
`/sandbox-templates/${templateId}`
|
|
9773
9070
|
);
|
|
9774
|
-
return
|
|
9071
|
+
return unwrap47(data);
|
|
9775
9072
|
}
|
|
9776
9073
|
async create(params) {
|
|
9777
9074
|
const {
|
|
@@ -9791,7 +9088,7 @@ var SandboxTemplates = class {
|
|
|
9791
9088
|
body: body5,
|
|
9792
9089
|
headers: { "Idempotency-Key": idempotencyKey8(ikey) }
|
|
9793
9090
|
});
|
|
9794
|
-
return
|
|
9091
|
+
return unwrap47(data);
|
|
9795
9092
|
}
|
|
9796
9093
|
async buildSpecSchema() {
|
|
9797
9094
|
const data = await this.http.get("/sandbox-templates/build-spec");
|
|
@@ -9824,12 +9121,12 @@ var SandboxTemplates = class {
|
|
|
9824
9121
|
headers: { "Idempotency-Key": idempotencyKey8(ikey) }
|
|
9825
9122
|
}
|
|
9826
9123
|
);
|
|
9827
|
-
return
|
|
9124
|
+
return unwrap47(data);
|
|
9828
9125
|
}
|
|
9829
9126
|
};
|
|
9830
9127
|
|
|
9831
9128
|
// src/resources/settings.ts
|
|
9832
|
-
function
|
|
9129
|
+
function unwrap48(payload) {
|
|
9833
9130
|
if (payload && typeof payload === "object") {
|
|
9834
9131
|
const p = payload;
|
|
9835
9132
|
for (const k of [
|
|
@@ -9845,7 +9142,7 @@ function unwrap50(payload) {
|
|
|
9845
9142
|
return payload;
|
|
9846
9143
|
}
|
|
9847
9144
|
function listItems13(payload) {
|
|
9848
|
-
const result =
|
|
9145
|
+
const result = unwrap48(payload);
|
|
9849
9146
|
if (Array.isArray(result)) return result;
|
|
9850
9147
|
return [];
|
|
9851
9148
|
}
|
|
@@ -9862,46 +9159,46 @@ var Settings = class {
|
|
|
9862
9159
|
/** Get the current tenant settings. */
|
|
9863
9160
|
async get() {
|
|
9864
9161
|
const data = await this.http.get("/settings");
|
|
9865
|
-
return
|
|
9162
|
+
return unwrap48(data);
|
|
9866
9163
|
}
|
|
9867
9164
|
/** Update tenant settings. */
|
|
9868
9165
|
async update(params) {
|
|
9869
9166
|
const body5 = stripUndefined28(params);
|
|
9870
9167
|
const data = await this.http.put("/settings", body5);
|
|
9871
|
-
return
|
|
9168
|
+
return unwrap48(data);
|
|
9872
9169
|
}
|
|
9873
9170
|
// ── Branding ──────────────────────────────────────────────────────────────
|
|
9874
9171
|
/** Get tenant branding (logo, colors, custom wordmark). */
|
|
9875
9172
|
async getBranding() {
|
|
9876
9173
|
const data = await this.http.get("/settings/branding");
|
|
9877
|
-
return
|
|
9174
|
+
return unwrap48(data);
|
|
9878
9175
|
}
|
|
9879
9176
|
/** Update tenant branding. */
|
|
9880
9177
|
async updateBranding(params) {
|
|
9881
9178
|
const body5 = stripUndefined28(params);
|
|
9882
9179
|
const data = await this.http.put("/settings/branding", body5);
|
|
9883
|
-
return
|
|
9180
|
+
return unwrap48(data);
|
|
9884
9181
|
}
|
|
9885
9182
|
// ── Read-only reference data ───────────────────────────────────────────────
|
|
9886
9183
|
/** Get tenant-scoped compute pricing. */
|
|
9887
9184
|
async computePricing() {
|
|
9888
9185
|
const data = await this.http.get("/settings/compute-pricing");
|
|
9889
|
-
return
|
|
9186
|
+
return unwrap48(data);
|
|
9890
9187
|
}
|
|
9891
9188
|
/** Get tenant-scoped GPU pricing. */
|
|
9892
9189
|
async gpuPricing() {
|
|
9893
9190
|
const data = await this.http.get("/settings/gpu-pricing");
|
|
9894
|
-
return
|
|
9191
|
+
return unwrap48(data);
|
|
9895
9192
|
}
|
|
9896
9193
|
/** List models available to this tenant. */
|
|
9897
9194
|
async availableModels() {
|
|
9898
9195
|
const data = await this.http.get("/settings/available-models");
|
|
9899
|
-
return
|
|
9196
|
+
return unwrap48(data);
|
|
9900
9197
|
}
|
|
9901
9198
|
/** List regions enabled for this tenant. */
|
|
9902
9199
|
async regions() {
|
|
9903
9200
|
const data = await this.http.get("/settings/regions");
|
|
9904
|
-
return
|
|
9201
|
+
return unwrap48(data);
|
|
9905
9202
|
}
|
|
9906
9203
|
// ── BYOK provider keys ────────────────────────────────────────────────────
|
|
9907
9204
|
/** List tenant-level BYOK provider keys (Anthropic, OpenAI, etc.). */
|
|
@@ -9916,7 +9213,7 @@ var Settings = class {
|
|
|
9916
9213
|
`/settings/provider-keys/${provider}`,
|
|
9917
9214
|
body5
|
|
9918
9215
|
);
|
|
9919
|
-
return
|
|
9216
|
+
return unwrap48(data);
|
|
9920
9217
|
}
|
|
9921
9218
|
/** Delete a BYOK provider key. */
|
|
9922
9219
|
async deleteProviderKey(provider) {
|
|
@@ -9925,7 +9222,7 @@ var Settings = class {
|
|
|
9925
9222
|
};
|
|
9926
9223
|
|
|
9927
9224
|
// src/resources/snapshots-standalone.ts
|
|
9928
|
-
function
|
|
9225
|
+
function unwrap49(data) {
|
|
9929
9226
|
if (data && typeof data === "object") {
|
|
9930
9227
|
const d = data;
|
|
9931
9228
|
for (const k of ["data", "snapshots", "items"]) {
|
|
@@ -9956,14 +9253,14 @@ var SnapshotsStandalone = class {
|
|
|
9956
9253
|
return unwrapList14(await this.http.get("/admin/snapshots", query3));
|
|
9957
9254
|
}
|
|
9958
9255
|
async get(snapshotId) {
|
|
9959
|
-
return
|
|
9256
|
+
return unwrap49(
|
|
9960
9257
|
await this.http.get(`/admin/snapshots/${snapshotId}`)
|
|
9961
9258
|
);
|
|
9962
9259
|
}
|
|
9963
9260
|
};
|
|
9964
9261
|
|
|
9965
9262
|
// src/resources/storage.ts
|
|
9966
|
-
function
|
|
9263
|
+
function unwrap50(payload) {
|
|
9967
9264
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
9968
9265
|
return payload.data;
|
|
9969
9266
|
}
|
|
@@ -10002,11 +9299,11 @@ var Storage = class {
|
|
|
10002
9299
|
...rest
|
|
10003
9300
|
});
|
|
10004
9301
|
const data = await this.http.post("/storage/buckets", body5);
|
|
10005
|
-
return
|
|
9302
|
+
return unwrap50(data);
|
|
10006
9303
|
}
|
|
10007
9304
|
async getBucket(bucketId) {
|
|
10008
9305
|
const data = await this.http.get(`/storage/buckets/${bucketId}`);
|
|
10009
|
-
return
|
|
9306
|
+
return unwrap50(data);
|
|
10010
9307
|
}
|
|
10011
9308
|
async deleteBucket(bucketId) {
|
|
10012
9309
|
await this.http.delete(`/storage/buckets/${bucketId}`);
|
|
@@ -10056,7 +9353,7 @@ var Storage = class {
|
|
|
10056
9353
|
`/storage/buckets/${bucketId}/presign`,
|
|
10057
9354
|
body5
|
|
10058
9355
|
);
|
|
10059
|
-
return
|
|
9356
|
+
return unwrap50(data);
|
|
10060
9357
|
}
|
|
10061
9358
|
};
|
|
10062
9359
|
|
|
@@ -10196,7 +9493,7 @@ var Organizations = class {
|
|
|
10196
9493
|
};
|
|
10197
9494
|
|
|
10198
9495
|
// src/resources/tenant.ts
|
|
10199
|
-
function
|
|
9496
|
+
function unwrap51(payload) {
|
|
10200
9497
|
if (payload && typeof payload === "object") {
|
|
10201
9498
|
const p = payload;
|
|
10202
9499
|
for (const k of ["data", "tenant", "branding", "items"]) {
|
|
@@ -10218,14 +9515,14 @@ var PreviewDomain = class {
|
|
|
10218
9515
|
/** Get the tenant's white-label preview domain settings. */
|
|
10219
9516
|
async get() {
|
|
10220
9517
|
const data = await this.http.get("/tenant/preview-domain");
|
|
10221
|
-
return
|
|
9518
|
+
return unwrap51(data);
|
|
10222
9519
|
}
|
|
10223
9520
|
/** Set the tenant's white-label preview domain. */
|
|
10224
9521
|
async set(domain) {
|
|
10225
9522
|
const data = await this.http.put("/tenant/preview-domain", {
|
|
10226
9523
|
preview_domain: domain
|
|
10227
9524
|
});
|
|
10228
|
-
return
|
|
9525
|
+
return unwrap51(data);
|
|
10229
9526
|
}
|
|
10230
9527
|
/** Re-run DNS verification for the configured preview domain. */
|
|
10231
9528
|
async verify() {
|
|
@@ -10233,7 +9530,7 @@ var PreviewDomain = class {
|
|
|
10233
9530
|
"/tenant/preview-domain/verify",
|
|
10234
9531
|
{}
|
|
10235
9532
|
);
|
|
10236
|
-
return
|
|
9533
|
+
return unwrap51(data);
|
|
10237
9534
|
}
|
|
10238
9535
|
/** Remove the tenant's custom preview domain. */
|
|
10239
9536
|
async delete() {
|
|
@@ -10248,14 +9545,14 @@ var Branding = class {
|
|
|
10248
9545
|
/** Get tenant branding used by white-label hosted surfaces. */
|
|
10249
9546
|
async get() {
|
|
10250
9547
|
const data = await this.http.get("/tenant/branding");
|
|
10251
|
-
return
|
|
9548
|
+
return unwrap51(data);
|
|
10252
9549
|
}
|
|
10253
9550
|
/** Update tenant branding used by white-label hosted surfaces. */
|
|
10254
9551
|
async set(params) {
|
|
10255
9552
|
const data = await this.http.put("/tenant/branding", {
|
|
10256
9553
|
branding: stripUndefined30(params)
|
|
10257
9554
|
});
|
|
10258
|
-
return
|
|
9555
|
+
return unwrap51(data);
|
|
10259
9556
|
}
|
|
10260
9557
|
/** Reset tenant branding to platform defaults. */
|
|
10261
9558
|
async delete() {
|
|
@@ -10277,7 +9574,7 @@ var Tenant = class {
|
|
|
10277
9574
|
/** Get the current tenant's plan, limits, and live usage counters. */
|
|
10278
9575
|
async current() {
|
|
10279
9576
|
const data = await this.http.get("/tenant/plan");
|
|
10280
|
-
return
|
|
9577
|
+
return unwrap51(data);
|
|
10281
9578
|
}
|
|
10282
9579
|
/** Convenience alias for `tenant.branding.get()`. */
|
|
10283
9580
|
async getBranding() {
|
|
@@ -10338,7 +9635,7 @@ var Templates = class {
|
|
|
10338
9635
|
};
|
|
10339
9636
|
|
|
10340
9637
|
// src/resources/usage.ts
|
|
10341
|
-
function
|
|
9638
|
+
function unwrap52(payload) {
|
|
10342
9639
|
if (payload && typeof payload === "object") {
|
|
10343
9640
|
const p = payload;
|
|
10344
9641
|
for (const k of ["data", "usage", "sessions", "summary", "items"]) {
|
|
@@ -10360,13 +9657,13 @@ var Usage = class {
|
|
|
10360
9657
|
/** Get the current period usage summary. */
|
|
10361
9658
|
async current() {
|
|
10362
9659
|
const data = await this.http.get("/usage/summary");
|
|
10363
|
-
return
|
|
9660
|
+
return unwrap52(data);
|
|
10364
9661
|
}
|
|
10365
9662
|
/** List per-session metering events. */
|
|
10366
9663
|
async sessions(params = {}) {
|
|
10367
9664
|
const query3 = stripUndefined31(params);
|
|
10368
9665
|
const data = await this.http.get("/usage/sessions", query3);
|
|
10369
|
-
const result =
|
|
9666
|
+
const result = unwrap52(data);
|
|
10370
9667
|
if (Array.isArray(result)) return result;
|
|
10371
9668
|
return [];
|
|
10372
9669
|
}
|
|
@@ -10374,10 +9671,10 @@ var Usage = class {
|
|
|
10374
9671
|
async report(params = {}) {
|
|
10375
9672
|
const query3 = stripUndefined31(params);
|
|
10376
9673
|
const data = await this.http.get("/usage/summary", query3);
|
|
10377
|
-
return
|
|
9674
|
+
return unwrap52(data);
|
|
10378
9675
|
}
|
|
10379
9676
|
};
|
|
10380
|
-
function
|
|
9677
|
+
function unwrap53(payload) {
|
|
10381
9678
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
10382
9679
|
return payload.data;
|
|
10383
9680
|
}
|
|
@@ -10413,7 +9710,7 @@ var Volumes = class {
|
|
|
10413
9710
|
}
|
|
10414
9711
|
async get(volumeId) {
|
|
10415
9712
|
const data = await this.http.get(`/volumes/${volumeId}`);
|
|
10416
|
-
return
|
|
9713
|
+
return unwrap53(data);
|
|
10417
9714
|
}
|
|
10418
9715
|
async create(params) {
|
|
10419
9716
|
const { idempotencyKey: ikey, sizeGb, ...rest } = params;
|
|
@@ -10426,7 +9723,7 @@ var Volumes = class {
|
|
|
10426
9723
|
body: body5,
|
|
10427
9724
|
headers: { "Idempotency-Key": idempotencyKey9(ikey) }
|
|
10428
9725
|
});
|
|
10429
|
-
return
|
|
9726
|
+
return unwrap53(data);
|
|
10430
9727
|
}
|
|
10431
9728
|
async delete(volumeId) {
|
|
10432
9729
|
await this.http.delete(`/volumes/${volumeId}`);
|
|
@@ -10457,7 +9754,7 @@ var Volumes = class {
|
|
|
10457
9754
|
`/computers/${computerId}/volumes`,
|
|
10458
9755
|
body5
|
|
10459
9756
|
);
|
|
10460
|
-
return
|
|
9757
|
+
return unwrap53(data);
|
|
10461
9758
|
}
|
|
10462
9759
|
async detach(computerId, attachmentId) {
|
|
10463
9760
|
await this.http.delete(
|
|
@@ -10465,7 +9762,7 @@ var Volumes = class {
|
|
|
10465
9762
|
);
|
|
10466
9763
|
}
|
|
10467
9764
|
};
|
|
10468
|
-
function
|
|
9765
|
+
function unwrap54(payload) {
|
|
10469
9766
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
10470
9767
|
return payload.data;
|
|
10471
9768
|
}
|
|
@@ -10532,7 +9829,7 @@ var Webhooks = class {
|
|
|
10532
9829
|
}
|
|
10533
9830
|
async get(webhookId) {
|
|
10534
9831
|
const data = await this.http.get(`/webhooks/${webhookId}`);
|
|
10535
|
-
return
|
|
9832
|
+
return unwrap54(data);
|
|
10536
9833
|
}
|
|
10537
9834
|
async create(params) {
|
|
10538
9835
|
const { idempotencyKey: ikey, ...rest } = params;
|
|
@@ -10542,12 +9839,12 @@ var Webhooks = class {
|
|
|
10542
9839
|
body: body5,
|
|
10543
9840
|
headers: { "Idempotency-Key": idempotencyKey10(ikey) }
|
|
10544
9841
|
});
|
|
10545
|
-
return
|
|
9842
|
+
return unwrap54(data);
|
|
10546
9843
|
}
|
|
10547
9844
|
async update(webhookId, params) {
|
|
10548
9845
|
const body5 = stripUndefined33(params);
|
|
10549
9846
|
const data = await this.http.patch(`/webhooks/${webhookId}`, body5);
|
|
10550
|
-
return
|
|
9847
|
+
return unwrap54(data);
|
|
10551
9848
|
}
|
|
10552
9849
|
async delete(webhookId) {
|
|
10553
9850
|
await this.http.delete(`/webhooks/${webhookId}`);
|
|
@@ -10560,7 +9857,7 @@ var Webhooks = class {
|
|
|
10560
9857
|
headers: { "Idempotency-Key": idempotencyKey10(opts.idempotencyKey) }
|
|
10561
9858
|
}
|
|
10562
9859
|
);
|
|
10563
|
-
return
|
|
9860
|
+
return unwrap54(data);
|
|
10564
9861
|
}
|
|
10565
9862
|
async deliveries(webhookId) {
|
|
10566
9863
|
const data = await this.http.get(
|
|
@@ -10743,7 +10040,6 @@ var Miosa = class {
|
|
|
10743
10040
|
orgInvites;
|
|
10744
10041
|
/** Organizations available to the user session, membership, invites, and switching. */
|
|
10745
10042
|
organizations;
|
|
10746
|
-
forge;
|
|
10747
10043
|
/** Current tenant plan, limits, and live usage counters. */
|
|
10748
10044
|
tenant;
|
|
10749
10045
|
/** Datacenter regions, compute sizes, pricing, community templates. */
|
|
@@ -10768,8 +10064,6 @@ var Miosa = class {
|
|
|
10768
10064
|
projectIntegrations;
|
|
10769
10065
|
/** Built-in auth for generated apps inside sandboxes/deployments. */
|
|
10770
10066
|
projectAuth;
|
|
10771
|
-
/** Durable generated App Documents, exact-version reviews, and publication bindings. */
|
|
10772
|
-
appDocuments;
|
|
10773
10067
|
/** BYOK encrypted per-user provider keys. */
|
|
10774
10068
|
externalKeys;
|
|
10775
10069
|
/** Model Context Protocol — JSON-RPC dispatch + streaming channel. */
|
|
@@ -10784,8 +10078,6 @@ var Miosa = class {
|
|
|
10784
10078
|
agentRunGroups;
|
|
10785
10079
|
/** Agent runtime profiles — tenant/workspace defaults for sandbox/computer agents. */
|
|
10786
10080
|
agentRuntimeProfiles;
|
|
10787
|
-
/** Persisted workspace Agent definitions and immutable versions. */
|
|
10788
|
-
agents;
|
|
10789
10081
|
/** MIOSA Connect — provider connectors and runtime tokens. */
|
|
10790
10082
|
connectors;
|
|
10791
10083
|
/** Inherited runtime env — tenant/workspace/project defaults for agent runtimes. */
|
|
@@ -10891,7 +10183,6 @@ var Miosa = class {
|
|
|
10891
10183
|
this.workspaceInvites = new WorkspaceInvites(this.http);
|
|
10892
10184
|
this.orgInvites = new OrgInvites(this.http);
|
|
10893
10185
|
this.organizations = new Organizations(this.http);
|
|
10894
|
-
this.forge = new Forge(this.http);
|
|
10895
10186
|
this.tenant = new Tenant(this.http);
|
|
10896
10187
|
this.regions = new Regions(this.http);
|
|
10897
10188
|
this.settings = new Settings(this.http);
|
|
@@ -10904,7 +10195,6 @@ var Miosa = class {
|
|
|
10904
10195
|
this.integrations = new Integrations(this.http);
|
|
10905
10196
|
this.projectIntegrations = new ProjectIntegrations(this.http);
|
|
10906
10197
|
this.projectAuth = new ProjectAuth(this.http);
|
|
10907
|
-
this.appDocuments = new AppDocuments(this.http);
|
|
10908
10198
|
this.externalKeys = new ExternalKeys(this.http);
|
|
10909
10199
|
this.mcp = new Mcp(this.http);
|
|
10910
10200
|
this.runs = new Runs(this.http);
|
|
@@ -10912,7 +10202,6 @@ var Miosa = class {
|
|
|
10912
10202
|
this.agentRuns = new AgentRuns(this.http);
|
|
10913
10203
|
this.agentRunGroups = new AgentRunGroups(this.http);
|
|
10914
10204
|
this.agentRuntimeProfiles = new AgentRuntimeProfiles(this.http);
|
|
10915
|
-
this.agents = new AgentDefinitions(this.http);
|
|
10916
10205
|
this.connectors = new Connectors(this.http);
|
|
10917
10206
|
this.runtimeEnv = new RuntimeEnv(this.http);
|
|
10918
10207
|
this.runtimeCapabilities = new RuntimeCapabilitiesResource(this.http);
|
|
@@ -11439,6 +10728,6 @@ var AppAuth = class {
|
|
|
11439
10728
|
}
|
|
11440
10729
|
};
|
|
11441
10730
|
|
|
11442
|
-
export { AGENT_BUILD_KIND_SPECS, Admin,
|
|
10731
|
+
export { AGENT_BUILD_KIND_SPECS, Admin, AgentRuntimeProfiles, Analytics, ApiKeys, AppAuth, AuditLog, AuthError, Benchmarks, BuilderSessions, Channels, Checkpoints, Cloud, CommandCenter, Community, Completions, Computer, ComputerAudit, ComputerAutoStop, ComputerConnectors, ComputerEnv, ComputerInbox, ComputerLogs, ComputerNetwork, ComputerOsa, ComputerPorts, ComputerSecrets, ComputerTerminal, ComputerVolumes, Computers, Connectors, Credits, CronJobs, DEFAULT_AGENT_BUILD_OUTPUT_ROOT, DEFAULT_AGENT_BUILD_PACKET_VERSION, Dashboard, Databases, DeploymentConnectors, DeploymentDomains, DeploymentReleases, DeploymentRuntimeInstances, DeploymentVersions, Deployments, Desktop, Devices, DockerDeploy, EgressAudit, EgressHostNotAllowedError, EgressNetwork, EgressSecrets, Email, EmailCampaigns, EmailInbox, EmailTemplates, Embeddings, Exec, ExternalKeys, Files, FlatCustomDomains, Functions, HealthChecks, InstallationRequiredError, InsufficientCreditsError, Integrations, ManagedProviderBindingOnlyError, Mcp, Miosa, MiosaError, Models, NetworkError, NetworkPolicy, NotFoundError, OAuthFlow, OpenComputers, OrgInvites, OrganizationMembers, Organizations, ProjectAuth, ProjectIntegrations, ProjectNotLinkedError, ProviderDefaults, RateLimitError, Regions, RunGroups, Runs, RuntimeCapabilitiesResource, RuntimeEnv, SANDBOX_TEMPLATE, Sandbox, SandboxAudit, SandboxCommands, SandboxConnectors, SandboxEnv, SandboxEvents, SandboxFiles, SandboxNetwork, SandboxPreview, SandboxPreviews, SandboxSecrets, SandboxTags, SandboxTemplates, SandboxTerminal, Sandboxes, ScopeNotAllowedError, ScopedFs, Settings, SnapshotsStandalone, Storage, SubjectNotAllowedError, Templates, Tenant, TimeoutError, TokenRefreshFailedError, Usage, UserAuthorizationRequiredError, ValidationError, Volumes, Webhooks, WorkspaceInvites, WorkspaceMembers, createAgentBuildExecutionPacket, createAgentBuildExpectedOutputs, createAgentBuildPrompt, createBuildRunParams, getAgentBuildKindSpec, resolveAgentBuildKind, verifySignature };
|
|
11443
10732
|
//# sourceMappingURL=index.js.map
|
|
11444
10733
|
//# sourceMappingURL=index.js.map
|