@miosa/sdk 3.0.0 → 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/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 = "3.0.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
@@ -198,7 +198,6 @@ async function ensureHttp2Agent() {
198
198
  }
199
199
  }
200
200
  ensureHttp2Agent();
201
- var SSE_ACCEPT = "text/event-stream, application/json;q=0.9";
202
201
  var DEFAULT_TIMEOUT = 3e4;
203
202
  var DEFAULT_MAX_RETRIES = 3;
204
203
  var RETRY_STATUS = /* @__PURE__ */ new Set([429, 500, 502, 503, 504]);
@@ -303,9 +302,8 @@ var HttpClient = class {
303
302
  return new Uint8Array(buffer);
304
303
  }
305
304
  if (response.status === 204) {
306
- return options.rawResponse ? response : void 0;
305
+ return void 0;
307
306
  }
308
- if (options.rawResponse) return response;
309
307
  return await response.json();
310
308
  } catch (err) {
311
309
  clearTimeout(timer);
@@ -371,7 +369,7 @@ var HttpClient = class {
371
369
  async *stream(path, options = {}) {
372
370
  const method = options.method ?? "GET";
373
371
  let headers = this.baseHeaders({
374
- Accept: SSE_ACCEPT,
372
+ Accept: "text/event-stream",
375
373
  ...options.headers
376
374
  });
377
375
  let body5 = null;
@@ -409,14 +407,12 @@ var HttpClient = class {
409
407
  response.headers.get("x-request-id") ?? void 0
410
408
  );
411
409
  }
412
- if (response.status === 204) return;
413
410
  if (!response.body) {
414
411
  throw new MiosaError("SSE stream has no body", 0, "NO_STREAM_BODY");
415
412
  }
416
413
  const reader = response.body.getReader();
417
414
  const decoder = new TextDecoder();
418
415
  let buffer = "";
419
- let eventName;
420
416
  try {
421
417
  while (true) {
422
418
  const { done, value } = await reader.read();
@@ -425,22 +421,11 @@ var HttpClient = class {
425
421
  const lines = buffer.split("\n");
426
422
  buffer = lines.pop() ?? "";
427
423
  for (const line of lines) {
428
- if (line.startsWith("event:")) {
429
- eventName = line.slice(6).trim();
430
- continue;
431
- }
432
- if (line === "") {
433
- eventName = void 0;
434
- continue;
435
- }
436
424
  if (line.startsWith("data:")) {
437
425
  const raw = line.slice(5).trim();
438
- const name = eventName;
439
- eventName = void 0;
440
426
  if (raw === "[DONE]" || raw === "") continue;
441
427
  try {
442
- const parsed = JSON.parse(raw);
443
- yield name !== void 0 && parsed !== null && typeof parsed === "object" && !("type" in parsed) ? { type: name, ...parsed } : parsed;
428
+ yield JSON.parse(raw);
444
429
  } catch {
445
430
  }
446
431
  }
@@ -1273,69 +1258,8 @@ var AgentRuntimeProfiles = class {
1273
1258
  }
1274
1259
  };
1275
1260
 
1276
- // src/resources/agent-definitions.ts
1277
- function unwrap5(payload) {
1278
- if (payload !== null && typeof payload === "object" && "data" in payload && payload.data !== void 0) {
1279
- return payload.data;
1280
- }
1281
- return payload;
1282
- }
1283
- var AgentDefinitions = class {
1284
- constructor(http) {
1285
- this.http = http;
1286
- }
1287
- http;
1288
- async list(params = {}) {
1289
- return unwrap5(
1290
- await this.http.get("/agents", {
1291
- workspace_id: params.workspaceId ?? params.workspace_id,
1292
- project_id: params.projectId ?? params.project_id,
1293
- status: params.status
1294
- })
1295
- );
1296
- }
1297
- async get(id) {
1298
- return unwrap5(
1299
- await this.http.get(
1300
- `/agents/${encodeURIComponent(id)}`
1301
- )
1302
- );
1303
- }
1304
- async create(params) {
1305
- return unwrap5(
1306
- await this.http.post(
1307
- "/agents",
1308
- {
1309
- workspace_id: params.workspaceId ?? params.workspace_id,
1310
- project_id: params.projectId ?? params.project_id,
1311
- name: params.name,
1312
- description: params.description,
1313
- metadata: params.metadata,
1314
- configuration: params.configuration
1315
- }
1316
- )
1317
- );
1318
- }
1319
- async update(id, params) {
1320
- return unwrap5(
1321
- await this.http.patch(`/agents/${encodeURIComponent(id)}`, params)
1322
- );
1323
- }
1324
- async publish(id, configuration) {
1325
- return unwrap5(
1326
- await this.http.post(
1327
- `/agents/${encodeURIComponent(id)}/versions`,
1328
- { configuration }
1329
- )
1330
- );
1331
- }
1332
- async archive(id) {
1333
- await this.http.delete(`/agents/${encodeURIComponent(id)}`);
1334
- }
1335
- };
1336
-
1337
1261
  // src/resources/runs.ts
1338
- function unwrap6(payload) {
1262
+ function unwrap5(payload) {
1339
1263
  if (payload && typeof payload === "object" && "data" in payload) {
1340
1264
  return payload.data;
1341
1265
  }
@@ -1374,24 +1298,24 @@ var Runs = class {
1374
1298
  status: params.status
1375
1299
  })
1376
1300
  );
1377
- const data = unwrap6(
1301
+ const data = unwrap5(
1378
1302
  response
1379
1303
  );
1380
1304
  if (Array.isArray(data)) return data;
1381
1305
  return data.runs ?? data.items ?? [];
1382
1306
  }
1383
1307
  async get(id) {
1384
- return unwrap6(
1308
+ return unwrap5(
1385
1309
  await this.http.get(`/runs/${encodeURIComponent(id)}`)
1386
1310
  );
1387
1311
  }
1388
1312
  async outputs(id) {
1389
- return unwrap6(
1313
+ return unwrap5(
1390
1314
  await this.http.get(`/runs/${encodeURIComponent(id)}/outputs`)
1391
1315
  );
1392
1316
  }
1393
1317
  async files(id) {
1394
- const data = unwrap6(
1318
+ const data = unwrap5(
1395
1319
  await this.http.get(`/runs/${encodeURIComponent(id)}/files`)
1396
1320
  );
1397
1321
  if (Array.isArray(data)) return data;
@@ -1406,33 +1330,33 @@ var Runs = class {
1406
1330
  );
1407
1331
  }
1408
1332
  async messages(id) {
1409
- const data = unwrap6(
1333
+ const data = unwrap5(
1410
1334
  await this.http.get(`/runs/${encodeURIComponent(id)}/messages`)
1411
1335
  );
1412
1336
  if (Array.isArray(data)) return data;
1413
1337
  return data.messages ?? data.items ?? [];
1414
1338
  }
1415
1339
  async commandOutput(id) {
1416
- return unwrap6(
1340
+ return unwrap5(
1417
1341
  await this.http.get(`/runs/${encodeURIComponent(id)}/command-output`)
1418
1342
  );
1419
1343
  }
1420
1344
  async activity(id) {
1421
- const data = unwrap6(
1345
+ const data = unwrap5(
1422
1346
  await this.http.get(`/runs/${encodeURIComponent(id)}/activity`)
1423
1347
  );
1424
1348
  if (Array.isArray(data)) return data;
1425
1349
  return data.activity ?? data.items ?? [];
1426
1350
  }
1427
1351
  async previews(id) {
1428
- const data = unwrap6(
1352
+ const data = unwrap5(
1429
1353
  await this.http.get(`/runs/${encodeURIComponent(id)}/previews`)
1430
1354
  );
1431
1355
  if (Array.isArray(data)) return data;
1432
1356
  return data.previews ?? data.items ?? [];
1433
1357
  }
1434
1358
  async diagnostics(id) {
1435
- const data = unwrap6(await this.http.get(`/runs/${encodeURIComponent(id)}/diagnostics`));
1359
+ const data = unwrap5(await this.http.get(`/runs/${encodeURIComponent(id)}/diagnostics`));
1436
1360
  if (Array.isArray(data)) return data;
1437
1361
  return data.diagnostics ?? data.items ?? [];
1438
1362
  }
@@ -1479,9 +1403,6 @@ var Runs = class {
1479
1403
  env: params.env,
1480
1404
  agent_runtime_profile_id: params.agentRuntimeProfileId,
1481
1405
  agent_profile_id: params.agentProfileId,
1482
- agent_definition_id: params.agentDefinitionId,
1483
- agent_version_id: params.agentVersionId,
1484
- configuration_receipt: params.configurationReceipt,
1485
1406
  run_group_id: params.runGroupId,
1486
1407
  parent_run_id: params.parentRunId,
1487
1408
  orchestration_role: params.orchestrationRole,
@@ -1495,10 +1416,10 @@ var Runs = class {
1495
1416
  capability_requirements: params.capabilityRequirements,
1496
1417
  metadata: params.metadata
1497
1418
  });
1498
- return unwrap6(await this.http.post("/runs", body5));
1419
+ return unwrap5(await this.http.post("/runs", body5));
1499
1420
  }
1500
1421
  async cancel(id) {
1501
- return unwrap6(
1422
+ return unwrap5(
1502
1423
  await this.http.post(
1503
1424
  `/runs/${encodeURIComponent(id)}/cancel`,
1504
1425
  {}
@@ -1508,7 +1429,7 @@ var Runs = class {
1508
1429
  };
1509
1430
 
1510
1431
  // src/resources/analytics.ts
1511
- function unwrap7(payload) {
1432
+ function unwrap6(payload) {
1512
1433
  if (payload && typeof payload === "object") {
1513
1434
  const p = payload;
1514
1435
  for (const k of ["data", "analytics", "series", "items"]) {
@@ -1531,16 +1452,16 @@ var Analytics = class {
1531
1452
  async overview(filters = {}) {
1532
1453
  const query3 = stripUndefined5(filters);
1533
1454
  const data = await this.http.get("/analytics/overview", query3);
1534
- return unwrap7(data);
1455
+ return unwrap6(data);
1535
1456
  }
1536
1457
  /** Get a timeseries for a metric over a period. */
1537
1458
  async timeseries(params = {}) {
1538
1459
  const query3 = stripUndefined5(params);
1539
1460
  const data = await this.http.get("/analytics/timeseries", query3);
1540
- return unwrap7(data);
1461
+ return unwrap6(data);
1541
1462
  }
1542
1463
  };
1543
- function unwrap8(payload) {
1464
+ function unwrap7(payload) {
1544
1465
  if (payload && typeof payload === "object" && "data" in payload) {
1545
1466
  return payload.data;
1546
1467
  }
@@ -1585,7 +1506,7 @@ var ApiKeys = class {
1585
1506
  body: body5,
1586
1507
  headers: { "Idempotency-Key": idempotencyKey(ikey) }
1587
1508
  });
1588
- return unwrap8(data);
1509
+ return unwrap7(data);
1589
1510
  }
1590
1511
  /** POST /api/v1/api-keys/scoped — L2 delegation token bound to one external user. */
1591
1512
  async createScoped(params) {
@@ -1594,7 +1515,7 @@ var ApiKeys = class {
1594
1515
  scopes: params.scopes,
1595
1516
  expires_at: params.expiresAt
1596
1517
  });
1597
- return unwrap8(
1518
+ return unwrap7(
1598
1519
  await this.http.post("/api-keys/scoped", body5)
1599
1520
  );
1600
1521
  }
@@ -1603,190 +1524,8 @@ var ApiKeys = class {
1603
1524
  }
1604
1525
  };
1605
1526
 
1606
- // src/resources/app-documents.ts
1607
- function unwrap9(payload) {
1608
- return payload && typeof payload === "object" && "data" in payload ? payload.data : payload;
1609
- }
1610
- var AppDocuments = class {
1611
- constructor(http) {
1612
- this.http = http;
1613
- }
1614
- http;
1615
- async list(workspaceId2) {
1616
- const payload = await this.http.get(
1617
- "/builder/apps",
1618
- { workspace_id: workspaceId2 }
1619
- );
1620
- return payload.data;
1621
- }
1622
- async get(id) {
1623
- return unwrap9(
1624
- await this.http.get(
1625
- `/builder/apps/${id}`
1626
- )
1627
- );
1628
- }
1629
- async create(params) {
1630
- const { workspaceId: workspaceId2, ...body5 } = params;
1631
- return unwrap9(
1632
- await this.http.post(
1633
- "/builder/apps",
1634
- { ...body5, workspace_id: workspaceId2 }
1635
- )
1636
- );
1637
- }
1638
- async update(id, params) {
1639
- return unwrap9(
1640
- await this.http.patch(`/builder/apps/${id}`, params)
1641
- );
1642
- }
1643
- async archive(id) {
1644
- await this.http.delete(`/builder/apps/${id}`);
1645
- }
1646
- async diagnostics(id) {
1647
- return unwrap9(
1648
- await this.http.get(`/builder/apps/${id}/diagnostics`)
1649
- );
1650
- }
1651
- async stageCandidate(id) {
1652
- return unwrap9(
1653
- await this.http.post(`/builder/apps/${id}/candidates`, {})
1654
- );
1655
- }
1656
- async approveExactVersion(id, releaseId, reason) {
1657
- return unwrap9(
1658
- await this.http.post(`/builder/apps/${id}/approvals`, {
1659
- reason,
1660
- release_id: releaseId
1661
- })
1662
- );
1663
- }
1664
- async publishExactRelease(id) {
1665
- const payload = await this.http.post(`/builder/apps/${id}/publish`, {});
1666
- return unwrap9(payload).app;
1667
- }
1668
- async listData(id, collection) {
1669
- const payload = await this.http.get(
1670
- `/builder/apps/${encodeURIComponent(id)}/data/${encodeURIComponent(collection)}`
1671
- );
1672
- return payload.data;
1673
- }
1674
- async getData(id, collection, key) {
1675
- return unwrap9(
1676
- await this.http.get(
1677
- `/builder/apps/${encodeURIComponent(id)}/data/${encodeURIComponent(collection)}/${encodeURIComponent(key)}`
1678
- )
1679
- );
1680
- }
1681
- async putData(id, collection, key, value, expectedVersion) {
1682
- return unwrap9(
1683
- await this.http.put(
1684
- `/builder/apps/${encodeURIComponent(id)}/data/${encodeURIComponent(collection)}/${encodeURIComponent(key)}`,
1685
- { value, expected_version: expectedVersion }
1686
- )
1687
- );
1688
- }
1689
- async deleteData(id, collection, key, expectedVersion) {
1690
- const suffix = expectedVersion === void 0 ? "" : `?expected_version=${encodeURIComponent(String(expectedVersion))}`;
1691
- await this.http.delete(
1692
- `/builder/apps/${encodeURIComponent(id)}/data/${encodeURIComponent(collection)}/${encodeURIComponent(key)}${suffix}`
1693
- );
1694
- }
1695
- async authorizeAction(id, input) {
1696
- return this.http.request(
1697
- `/actions/apps/${encodeURIComponent(id)}/authorize`,
1698
- {
1699
- method: "POST",
1700
- headers: {
1701
- "x-miosa-app-callback-token": input.callbackToken
1702
- },
1703
- body: {
1704
- release_id: input.releaseId,
1705
- capability: input.capability,
1706
- request_fingerprint: input.requestFingerprint,
1707
- params_fingerprint: input.paramsFingerprint,
1708
- connector_id: input.connectorId
1709
- }
1710
- }
1711
- );
1712
- }
1713
- async mintRuntimeToken(id) {
1714
- return unwrap9(
1715
- await this.http.post(
1716
- `/builder/apps/${encodeURIComponent(id)}/runtime-token`,
1717
- {}
1718
- )
1719
- );
1720
- }
1721
- async resolveBinding(id, bindingId, receiptId, callbackToken) {
1722
- return unwrap9(
1723
- await this.http.request(
1724
- `/builder/apps/${encodeURIComponent(id)}/runtime/bindings/${encodeURIComponent(bindingId)}?receipt_id=${encodeURIComponent(receiptId)}`,
1725
- {
1726
- method: "GET",
1727
- headers: {
1728
- "x-miosa-app-callback-token": callbackToken
1729
- }
1730
- }
1731
- )
1732
- );
1733
- }
1734
- async listAutomationRuns(id) {
1735
- const payload = await this.http.get(
1736
- `/builder/apps/${encodeURIComponent(id)}/automation-runs`
1737
- );
1738
- return payload.data;
1739
- }
1740
- async startAutomationRun(id, automationId, trigger = {}) {
1741
- return unwrap9(
1742
- await this.http.post(
1743
- `/builder/apps/${encodeURIComponent(id)}/automations/${encodeURIComponent(automationId)}/runs`,
1744
- { trigger }
1745
- )
1746
- );
1747
- }
1748
- async claimAutomationStep(id, runId) {
1749
- return unwrap9(
1750
- await this.http.post(
1751
- `/builder/apps/${encodeURIComponent(id)}/automation-runs/${encodeURIComponent(runId)}/claim`,
1752
- {}
1753
- )
1754
- );
1755
- }
1756
- async completeAutomationStep(id, runId, cursor, idempotencyKey11, output = null) {
1757
- return unwrap9(
1758
- await this.http.post(
1759
- `/builder/apps/${encodeURIComponent(id)}/automation-runs/${encodeURIComponent(runId)}/complete`,
1760
- {
1761
- cursor,
1762
- idempotency_key: idempotencyKey11,
1763
- output
1764
- }
1765
- )
1766
- );
1767
- }
1768
- async failAutomationStep(id, runId, cursor, idempotencyKey11, reason) {
1769
- return unwrap9(
1770
- await this.http.post(
1771
- `/builder/apps/${encodeURIComponent(id)}/automation-runs/${encodeURIComponent(runId)}/fail`,
1772
- {
1773
- cursor,
1774
- idempotency_key: idempotencyKey11,
1775
- reason
1776
- }
1777
- )
1778
- );
1779
- }
1780
- async revokeApproval(id, approvalId) {
1781
- await this.http.post(
1782
- `/builder/apps/${id}/approvals/${approvalId}/revoke`,
1783
- {}
1784
- );
1785
- }
1786
- };
1787
-
1788
1527
  // src/resources/audit-log.ts
1789
- function unwrap10(payload) {
1528
+ function unwrap8(payload) {
1790
1529
  if (payload && typeof payload === "object") {
1791
1530
  const p = payload;
1792
1531
  for (const k of ["data", "audit_log", "events", "items"]) {
@@ -1809,14 +1548,14 @@ var AuditLog = class {
1809
1548
  async list(params = {}) {
1810
1549
  const query3 = stripUndefined7(params);
1811
1550
  const data = await this.http.get("/audit-log", query3);
1812
- const result = unwrap10(data);
1551
+ const result = unwrap8(data);
1813
1552
  if (Array.isArray(result)) return result;
1814
1553
  return [];
1815
1554
  }
1816
1555
  };
1817
1556
 
1818
1557
  // src/resources/benchmarks.ts
1819
- function unwrap11(data) {
1558
+ function unwrap9(data) {
1820
1559
  if (data && typeof data === "object") {
1821
1560
  const d = data;
1822
1561
  for (const k of ["data", "benchmarks", "samples", "items"]) {
@@ -1848,7 +1587,7 @@ var Benchmarks = class {
1848
1587
  return unwrapList(data);
1849
1588
  }
1850
1589
  async get(benchmarkId) {
1851
- return unwrap11(
1590
+ return unwrap9(
1852
1591
  await this.http.get(`/admin/benchmarks/${benchmarkId}`)
1853
1592
  );
1854
1593
  }
@@ -1857,10 +1596,10 @@ var Benchmarks = class {
1857
1596
  const body5 = Object.fromEntries(
1858
1597
  Object.entries(params).filter(([, v]) => v !== void 0)
1859
1598
  );
1860
- return unwrap11(await this.http.post("/admin/benchmarks", body5));
1599
+ return unwrap9(await this.http.post("/admin/benchmarks", body5));
1861
1600
  }
1862
1601
  async cancel(benchmarkId) {
1863
- return unwrap11(
1602
+ return unwrap9(
1864
1603
  await this.http.post(`/admin/benchmarks/${benchmarkId}/cancel`)
1865
1604
  );
1866
1605
  }
@@ -1880,14 +1619,14 @@ var Benchmarks = class {
1880
1619
  const body5 = Object.fromEntries(
1881
1620
  Object.entries(params).filter(([, v]) => v !== void 0)
1882
1621
  );
1883
- return unwrap11(
1622
+ return unwrap9(
1884
1623
  await this.http.post("/admin/benchmarks/compare", body5)
1885
1624
  );
1886
1625
  }
1887
1626
  };
1888
1627
 
1889
1628
  // src/resources/builder-sessions.ts
1890
- function unwrap12(data) {
1629
+ function unwrap10(data) {
1891
1630
  if (data && typeof data === "object") {
1892
1631
  const d = data;
1893
1632
  for (const k of ["data", "sessions", "items"]) {
@@ -1924,7 +1663,7 @@ var BuilderSessions = class {
1924
1663
  return all.find((s) => s.id === sessionId) ?? {};
1925
1664
  }
1926
1665
  async updateTitle(sessionId, title) {
1927
- return unwrap12(
1666
+ return unwrap10(
1928
1667
  await this.http.patch(`/builder/sessions/${sessionId}/title`, {
1929
1668
  title
1930
1669
  })
@@ -1936,7 +1675,7 @@ var BuilderSessions = class {
1936
1675
  };
1937
1676
 
1938
1677
  // src/resources/channels.ts
1939
- function unwrap13(payload) {
1678
+ function unwrap11(payload) {
1940
1679
  if (payload && typeof payload === "object") {
1941
1680
  const p = payload;
1942
1681
  for (const k of ["data", "channels", "notifications", "items"]) {
@@ -1964,26 +1703,26 @@ var Channels = class {
1964
1703
  async list(params = {}) {
1965
1704
  const query3 = stripUndefined8(params);
1966
1705
  const data = await this.http.get("/channels", query3);
1967
- const result = unwrap13(data);
1706
+ const result = unwrap11(data);
1968
1707
  if (Array.isArray(result)) return result;
1969
1708
  return [];
1970
1709
  }
1971
1710
  /** Get a single channel. */
1972
1711
  async get(channelId) {
1973
1712
  const data = await this.http.get(`/channels/${channelId}`);
1974
- return unwrap13(data);
1713
+ return unwrap11(data);
1975
1714
  }
1976
1715
  /** Create a new channel. */
1977
1716
  async create(params) {
1978
1717
  const body5 = stripUndefObj(params);
1979
1718
  const data = await this.http.post("/channels", body5);
1980
- return unwrap13(data);
1719
+ return unwrap11(data);
1981
1720
  }
1982
1721
  /** Update a channel. */
1983
1722
  async update(channelId, params) {
1984
1723
  const body5 = stripUndefObj(params);
1985
1724
  const data = await this.http.patch(`/channels/${channelId}`, body5);
1986
- return unwrap13(data);
1725
+ return unwrap11(data);
1987
1726
  }
1988
1727
  /** Delete a channel. */
1989
1728
  async delete(channelId) {
@@ -1993,30 +1732,30 @@ var Channels = class {
1993
1732
  /** Get notification preferences across all channels. */
1994
1733
  async listNotifications() {
1995
1734
  const data = await this.http.get("/channels/notifications");
1996
- return unwrap13(data);
1735
+ return unwrap11(data);
1997
1736
  }
1998
1737
  /** Update notification preferences. */
1999
1738
  async updateNotifications(params) {
2000
1739
  const body5 = stripUndefObj(params);
2001
1740
  const data = await this.http.put("/channels/notifications", body5);
2002
- return unwrap13(data);
1741
+ return unwrap11(data);
2003
1742
  }
2004
1743
  /** Enable a channel. */
2005
1744
  async enable(channelId) {
2006
1745
  const data = await this.http.post(`/channels/${channelId}/enable`);
2007
- return unwrap13(data);
1746
+ return unwrap11(data);
2008
1747
  }
2009
1748
  /** Disable a channel. */
2010
1749
  async disable(channelId) {
2011
1750
  const data = await this.http.post(
2012
1751
  `/channels/${channelId}/disable`
2013
1752
  );
2014
- return unwrap13(data);
1753
+ return unwrap11(data);
2015
1754
  }
2016
1755
  };
2017
1756
 
2018
1757
  // src/resources/cloud.ts
2019
- function unwrap14(payload) {
1758
+ function unwrap12(payload) {
2020
1759
  if (payload !== null && typeof payload === "object" && "data" in payload && payload.data !== void 0) {
2021
1760
  return payload.data;
2022
1761
  }
@@ -2091,12 +1830,12 @@ var Cloud = class {
2091
1830
  }
2092
1831
  http;
2093
1832
  async listAccounts() {
2094
- return unwrap14(
1833
+ return unwrap12(
2095
1834
  await this.http.get("/cloud/accounts")
2096
1835
  );
2097
1836
  }
2098
1837
  async createAccount(params) {
2099
- return unwrap14(
1838
+ return unwrap12(
2100
1839
  await this.http.post(
2101
1840
  "/cloud/accounts",
2102
1841
  accountBody(params)
@@ -2104,7 +1843,7 @@ var Cloud = class {
2104
1843
  );
2105
1844
  }
2106
1845
  async attachAwsRole(id, params) {
2107
- return unwrap14(
1846
+ return unwrap12(
2108
1847
  await this.http.post(
2109
1848
  `/cloud/accounts/${encodeURIComponent(id)}/aws/role`,
2110
1849
  stripUndefined9({
@@ -2115,7 +1854,7 @@ var Cloud = class {
2115
1854
  );
2116
1855
  }
2117
1856
  async listRegions(params = {}) {
2118
- return unwrap14(
1857
+ return unwrap12(
2119
1858
  await this.http.get(
2120
1859
  "/cloud/regions",
2121
1860
  query(params)
@@ -2123,7 +1862,7 @@ var Cloud = class {
2123
1862
  );
2124
1863
  }
2125
1864
  async createRegion(params) {
2126
- return unwrap14(
1865
+ return unwrap12(
2127
1866
  await this.http.post(
2128
1867
  "/cloud/regions",
2129
1868
  regionBody(params)
@@ -2131,12 +1870,12 @@ var Cloud = class {
2131
1870
  );
2132
1871
  }
2133
1872
  async listPools(params = {}) {
2134
- return unwrap14(
1873
+ return unwrap12(
2135
1874
  await this.http.get("/cloud/pools", query(params))
2136
1875
  );
2137
1876
  }
2138
1877
  async createPool(params) {
2139
- return unwrap14(
1878
+ return unwrap12(
2140
1879
  await this.http.post(
2141
1880
  "/cloud/pools",
2142
1881
  poolBody(params)
@@ -2144,7 +1883,7 @@ var Cloud = class {
2144
1883
  );
2145
1884
  }
2146
1885
  async listPreflights(params = {}) {
2147
- return unwrap14(
1886
+ return unwrap12(
2148
1887
  await this.http.get(
2149
1888
  "/cloud/preflights",
2150
1889
  query(params)
@@ -2152,7 +1891,7 @@ var Cloud = class {
2152
1891
  );
2153
1892
  }
2154
1893
  async recordPreflight(params) {
2155
- return unwrap14(
1894
+ return unwrap12(
2156
1895
  await this.http.post(
2157
1896
  "/cloud/preflights",
2158
1897
  preflightBody(params)
@@ -2162,7 +1901,7 @@ var Cloud = class {
2162
1901
  };
2163
1902
 
2164
1903
  // src/resources/command-center.ts
2165
- function unwrap15(data) {
1904
+ function unwrap13(data) {
2166
1905
  if (data && typeof data === "object") {
2167
1906
  const d = data;
2168
1907
  for (const k of [
@@ -2196,7 +1935,7 @@ var CommandCenter = class {
2196
1935
  http;
2197
1936
  /** Top-level snapshot (GET /command-center). */
2198
1937
  async overview() {
2199
- return unwrap15(await this.http.get("/command-center"));
1938
+ return unwrap13(await this.http.get("/command-center"));
2200
1939
  }
2201
1940
  async agents() {
2202
1941
  return unwrapList3(await this.http.get("/command-center/agents"));
@@ -2207,13 +1946,13 @@ var CommandCenter = class {
2207
1946
  );
2208
1947
  }
2209
1948
  async metrics() {
2210
- return unwrap15(await this.http.get("/command-center/metrics"));
1949
+ return unwrap13(await this.http.get("/command-center/metrics"));
2211
1950
  }
2212
1951
  async presets() {
2213
1952
  return unwrapList3(await this.http.get("/command-center/presets"));
2214
1953
  }
2215
1954
  async tiers() {
2216
- return unwrap15(await this.http.get("/command-center/tiers"));
1955
+ return unwrap13(await this.http.get("/command-center/tiers"));
2217
1956
  }
2218
1957
  /** Stream live command-center events via SSE. */
2219
1958
  events() {
@@ -2222,7 +1961,7 @@ var CommandCenter = class {
2222
1961
  };
2223
1962
 
2224
1963
  // src/resources/community.ts
2225
- function unwrap16(data) {
1964
+ function unwrap14(data) {
2226
1965
  if (data && typeof data === "object") {
2227
1966
  const d = data;
2228
1967
  for (const k of ["data", "templates", "agents", "items"]) {
@@ -2254,7 +1993,7 @@ var Community = class {
2254
1993
  return unwrapList4(await this.http.get("/community/agents", query3));
2255
1994
  }
2256
1995
  async getAgent(agentId) {
2257
- return unwrap16(await this.http.get(`/community/agents/${agentId}`));
1996
+ return unwrap14(await this.http.get(`/community/agents/${agentId}`));
2258
1997
  }
2259
1998
  // ── Templates ─────────────────────────────────────────────────────────
2260
1999
  async listTemplates(filters = {}) {
@@ -2266,7 +2005,7 @@ var Community = class {
2266
2005
  );
2267
2006
  }
2268
2007
  async getTemplate(templateId) {
2269
- return unwrap16(
2008
+ return unwrap14(
2270
2009
  await this.http.get(`/community/templates/${templateId}`)
2271
2010
  );
2272
2011
  }
@@ -2275,7 +2014,7 @@ var Community = class {
2275
2014
  const body5 = Object.fromEntries(
2276
2015
  Object.entries(opts).filter(([, v]) => v !== void 0)
2277
2016
  );
2278
- return unwrap16(
2017
+ return unwrap14(
2279
2018
  await this.http.post(
2280
2019
  `/community/templates/${templateId}/install`,
2281
2020
  body5
@@ -2290,7 +2029,7 @@ var Community = class {
2290
2029
  Object.entries(opts).filter(([, v]) => v !== void 0)
2291
2030
  )
2292
2031
  };
2293
- return unwrap16(
2032
+ return unwrap14(
2294
2033
  await this.http.post(
2295
2034
  `/community/templates/${templateId}/rate`,
2296
2035
  body5
@@ -2300,7 +2039,7 @@ var Community = class {
2300
2039
  };
2301
2040
 
2302
2041
  // src/resources/completions.ts
2303
- function unwrap17(data) {
2042
+ function unwrap15(data) {
2304
2043
  if (data && typeof data === "object") {
2305
2044
  const d = data;
2306
2045
  if (Array.isArray(d.choices)) return d;
@@ -2326,7 +2065,7 @@ var Completions = class {
2326
2065
  { method: "POST", body: body5 }
2327
2066
  );
2328
2067
  }
2329
- return this.http.post("/intelligence/completions", body5).then(unwrap17);
2068
+ return this.http.post("/intelligence/completions", body5).then(unwrap15);
2330
2069
  }
2331
2070
  chat(params) {
2332
2071
  const body5 = buildBody(params);
@@ -2336,7 +2075,7 @@ var Completions = class {
2336
2075
  { method: "POST", body: body5 }
2337
2076
  );
2338
2077
  }
2339
- return this.http.post("/intelligence/chat/completions", body5).then(unwrap17);
2078
+ return this.http.post("/intelligence/chat/completions", body5).then(unwrap15);
2340
2079
  }
2341
2080
  };
2342
2081
 
@@ -2459,7 +2198,7 @@ var Checkpoints = class {
2459
2198
  };
2460
2199
 
2461
2200
  // src/resources/computer-auto-stop.ts
2462
- function unwrap18(data) {
2201
+ function unwrap16(data) {
2463
2202
  if (data && typeof data === "object") {
2464
2203
  const d = data;
2465
2204
  if ("data" in d && Object.keys(d).length <= 2) {
@@ -2477,13 +2216,13 @@ var ComputerAutoStop = class {
2477
2216
  computerId;
2478
2217
  /** Return the current auto-stop configuration. */
2479
2218
  async get() {
2480
- return unwrap18(
2219
+ return unwrap16(
2481
2220
  await this.http.get(`/computers/${this.computerId}/auto-stop`)
2482
2221
  );
2483
2222
  }
2484
2223
  /** Set the idle timeout in seconds (0 disables auto-stop). */
2485
2224
  async update(seconds) {
2486
- return unwrap18(
2225
+ return unwrap16(
2487
2226
  await this.http.patch(
2488
2227
  `/computers/${this.computerId}/auto-stop`,
2489
2228
  { seconds }
@@ -2493,7 +2232,7 @@ var ComputerAutoStop = class {
2493
2232
  };
2494
2233
 
2495
2234
  // src/resources/computer-env.ts
2496
- function unwrap19(data) {
2235
+ function unwrap17(data) {
2497
2236
  if (data && typeof data === "object") {
2498
2237
  const d = data;
2499
2238
  if ("data" in d && Object.keys(d).length <= 2) {
@@ -2528,11 +2267,11 @@ var ComputerEnv = class {
2528
2267
  }
2529
2268
  /** Create a new env var. Use update() to change an existing one. */
2530
2269
  async set(name, value) {
2531
- return unwrap19(await this.http.post(this.base(), { name, value }));
2270
+ return unwrap17(await this.http.post(this.base(), { name, value }));
2532
2271
  }
2533
2272
  /** Patch the value of an existing env var by name. */
2534
2273
  async update(name, value) {
2535
- return unwrap19(
2274
+ return unwrap17(
2536
2275
  await this.http.patch(`${this.base()}/${name}`, { value })
2537
2276
  );
2538
2277
  }
@@ -2549,7 +2288,7 @@ var ComputerEnv = class {
2549
2288
  };
2550
2289
 
2551
2290
  // src/resources/computer-logs.ts
2552
- function unwrap20(data) {
2291
+ function unwrap18(data) {
2553
2292
  if (data && typeof data === "object") {
2554
2293
  const d = data;
2555
2294
  if ("data" in d && Object.keys(d).length <= 2) {
@@ -2570,7 +2309,7 @@ var ComputerLogs = class {
2570
2309
  const query3 = Object.fromEntries(
2571
2310
  Object.entries(params).filter(([, v]) => v !== void 0)
2572
2311
  );
2573
- return unwrap20(
2312
+ return unwrap18(
2574
2313
  await this.http.get(`/computers/${this.computerId}/logs`, query3)
2575
2314
  );
2576
2315
  }
@@ -2583,7 +2322,7 @@ var ComputerLogs = class {
2583
2322
  };
2584
2323
 
2585
2324
  // src/resources/computer-osa.ts
2586
- function unwrap21(data) {
2325
+ function unwrap19(data) {
2587
2326
  if (data && typeof data === "object") {
2588
2327
  const d = data;
2589
2328
  if ("data" in d && Object.keys(d).length <= 2) {
@@ -2607,7 +2346,7 @@ var ComputerOsa = class {
2607
2346
  Object.entries(params).filter(([, v]) => v !== void 0)
2608
2347
  )
2609
2348
  };
2610
- return unwrap21(
2349
+ return unwrap19(
2611
2350
  await this.http.post(
2612
2351
  `/computers/${this.computerId}/osa/task`,
2613
2352
  body5
@@ -2616,13 +2355,13 @@ var ComputerOsa = class {
2616
2355
  }
2617
2356
  /** Cancel the currently-running OSA task, if any. */
2618
2357
  async cancelTask() {
2619
- return unwrap21(
2358
+ return unwrap19(
2620
2359
  await this.http.delete(`/computers/${this.computerId}/osa/task`)
2621
2360
  );
2622
2361
  }
2623
2362
  /** Return OSA's current task / configuration / health snapshot. */
2624
2363
  async status() {
2625
- return unwrap21(
2364
+ return unwrap19(
2626
2365
  await this.http.get(`/computers/${this.computerId}/osa/status`)
2627
2366
  );
2628
2367
  }
@@ -2631,7 +2370,7 @@ var ComputerOsa = class {
2631
2370
  const body5 = Object.fromEntries(
2632
2371
  Object.entries(config).filter(([, v]) => v !== void 0)
2633
2372
  );
2634
- return unwrap21(
2373
+ return unwrap19(
2635
2374
  await this.http.post(
2636
2375
  `/computers/${this.computerId}/osa/configure`,
2637
2376
  body5
@@ -2641,7 +2380,7 @@ var ComputerOsa = class {
2641
2380
  };
2642
2381
 
2643
2382
  // src/resources/computer-ports.ts
2644
- function unwrap22(data) {
2383
+ function unwrap20(data) {
2645
2384
  if (data && typeof data === "object") {
2646
2385
  const d = data;
2647
2386
  if ("data" in d && Object.keys(d).length <= 2) {
@@ -2686,14 +2425,14 @@ var ComputerPorts = class {
2686
2425
  Object.entries(opts).filter(([, v]) => v !== void 0)
2687
2426
  )
2688
2427
  };
2689
- return unwrap22(await this.http.post(this.base(), body5));
2428
+ return unwrap20(await this.http.post(this.base(), body5));
2690
2429
  }
2691
2430
  /** Patch visibility / auth options for port. */
2692
2431
  async update(port, opts) {
2693
2432
  const body5 = Object.fromEntries(
2694
2433
  Object.entries(opts).filter(([, v]) => v !== void 0)
2695
2434
  );
2696
- return unwrap22(
2435
+ return unwrap20(
2697
2436
  await this.http.patch(`${this.base()}/${port}`, body5)
2698
2437
  );
2699
2438
  }
@@ -2720,7 +2459,7 @@ var ComputerTerminal = class {
2720
2459
  `/computers/${this.computerId}/terminal`,
2721
2460
  body5
2722
2461
  );
2723
- return unwrap23(raw);
2462
+ return unwrap21(raw);
2724
2463
  }
2725
2464
  /** Resize an existing PTY session. */
2726
2465
  async resize(sessionId, cols, rows) {
@@ -2728,10 +2467,10 @@ var ComputerTerminal = class {
2728
2467
  `/computers/${this.computerId}/pty/${sessionId}/resize`,
2729
2468
  { cols, rows }
2730
2469
  );
2731
- return unwrap23(raw);
2470
+ return unwrap21(raw);
2732
2471
  }
2733
2472
  };
2734
- function unwrap23(data) {
2473
+ function unwrap21(data) {
2735
2474
  if (data && typeof data === "object") {
2736
2475
  const d = data;
2737
2476
  if ("data" in d && Object.keys(d).length <= 2) {
@@ -2742,7 +2481,7 @@ function unwrap23(data) {
2742
2481
  }
2743
2482
 
2744
2483
  // src/resources/computer-volumes.ts
2745
- function unwrap24(data) {
2484
+ function unwrap22(data) {
2746
2485
  if (data && typeof data === "object") {
2747
2486
  const d = data;
2748
2487
  if ("data" in d && Object.keys(d).length <= 2) {
@@ -2776,7 +2515,7 @@ var ComputerVolumes = class {
2776
2515
  }
2777
2516
  /** Attach volumeId at mountPath inside the VM. */
2778
2517
  async attach(volumeId, mountPath) {
2779
- return unwrap24(
2518
+ return unwrap22(
2780
2519
  await this.http.post(this.base(), {
2781
2520
  volume_id: volumeId,
2782
2521
  mount_path: mountPath
@@ -2790,7 +2529,7 @@ var ComputerVolumes = class {
2790
2529
  };
2791
2530
 
2792
2531
  // src/resources/connectors.ts
2793
- function unwrap25(payload) {
2532
+ function unwrap23(payload) {
2794
2533
  if (payload && typeof payload === "object") {
2795
2534
  const p = payload;
2796
2535
  for (const key of ["data", "binding"]) {
@@ -3001,7 +2740,7 @@ var Connectors = class {
3001
2740
  const data = await this.http.get(
3002
2741
  `/connect/connectors/${connectorPath(connector)}`
3003
2742
  );
3004
- return unwrap25(data);
2743
+ return unwrap23(data);
3005
2744
  }
3006
2745
  show(connector) {
3007
2746
  return this.get(connector);
@@ -3012,7 +2751,7 @@ var Connectors = class {
3012
2751
  "/connect/connectors",
3013
2752
  bodyFromCreateParams(provider, params)
3014
2753
  );
3015
- return unwrap25(data);
2754
+ return unwrap23(data);
3016
2755
  }
3017
2756
  /** Request a runtime provider token for a connector. */
3018
2757
  async getToken(connector, params = {}) {
@@ -3020,7 +2759,7 @@ var Connectors = class {
3020
2759
  `/connect/token/${connectorPath(connector)}`,
3021
2760
  tokenBody(params)
3022
2761
  );
3023
- return unwrap25(data);
2762
+ return unwrap23(data);
3024
2763
  }
3025
2764
  token(connector, params = {}) {
3026
2765
  return this.getToken(connector, params);
@@ -3042,7 +2781,7 @@ var Connectors = class {
3042
2781
  ...externalAttributionParams(params)
3043
2782
  })
3044
2783
  );
3045
- return unwrap25(data);
2784
+ return unwrap23(data);
3046
2785
  }
3047
2786
  /** List connector installations/grants. */
3048
2787
  async installations(params = {}) {
@@ -3082,7 +2821,7 @@ var Connectors = class {
3082
2821
  "/connect/defaults/materialize",
3083
2822
  materializeDefaultsBody(params)
3084
2823
  );
3085
- return unwrap25(data);
2824
+ return unwrap23(data);
3086
2825
  }
3087
2826
  /** Create an inherited connector default for future runtime resources. */
3088
2827
  async createDefault(params) {
@@ -3090,7 +2829,7 @@ var Connectors = class {
3090
2829
  "/connect/defaults",
3091
2830
  defaultBody(params)
3092
2831
  );
3093
- return unwrap25(data);
2832
+ return unwrap23(data);
3094
2833
  }
3095
2834
  /** Delete an inherited connector default. */
3096
2835
  async deleteDefault(id) {
@@ -3110,7 +2849,7 @@ var Connectors = class {
3110
2849
  "/connect/triggers",
3111
2850
  triggerBody(params)
3112
2851
  );
3113
- return unwrap25(data);
2852
+ return unwrap23(data);
3114
2853
  }
3115
2854
  /** List inbound provider trigger delivery attempts. */
3116
2855
  async triggerDeliveries(params = {}) {
@@ -3137,7 +2876,7 @@ var Connectors = class {
3137
2876
  "/connect/project-links",
3138
2877
  projectLinkBody(params)
3139
2878
  );
3140
- return unwrap25(data);
2879
+ return unwrap23(data);
3141
2880
  }
3142
2881
  /** Delete a project connector link. */
3143
2882
  async deleteProjectLink(id) {
@@ -3173,7 +2912,7 @@ var RuntimeConnectors = class {
3173
2912
  ...externalAttributionParams(params)
3174
2913
  })
3175
2914
  );
3176
- return unwrap25(data);
2915
+ return unwrap23(data);
3177
2916
  }
3178
2917
  /** Detach a connector binding by binding id or connector UID. */
3179
2918
  async detach(bindingOrConnector) {
@@ -3182,7 +2921,7 @@ var RuntimeConnectors = class {
3182
2921
  /** Sync or materialize connector placeholder env vars for this runtime resource. */
3183
2922
  async sync() {
3184
2923
  const data = await this.http.post(`${this.basePath}/sync`, {});
3185
- return unwrap25(data);
2924
+ return unwrap23(data);
3186
2925
  }
3187
2926
  /** Verify a required connector is attached before agent work begins. */
3188
2927
  async preflight(params = {}) {
@@ -3190,7 +2929,7 @@ var RuntimeConnectors = class {
3190
2929
  `${this.basePath}/preflight`,
3191
2930
  stripUndefined10(params)
3192
2931
  );
3193
- return unwrap25(data);
2932
+ return unwrap23(data);
3194
2933
  }
3195
2934
  };
3196
2935
  var SandboxConnectors = class extends RuntimeConnectors {
@@ -3393,7 +3132,7 @@ var Desktop = class {
3393
3132
  };
3394
3133
 
3395
3134
  // src/resources/egressAudit.ts
3396
- function unwrap26(payload) {
3135
+ function unwrap24(payload) {
3397
3136
  if (payload && typeof payload === "object") {
3398
3137
  const p = payload;
3399
3138
  for (const k of ["data", "event", "items"]) {
@@ -3459,7 +3198,7 @@ var EgressAudit = class {
3459
3198
  const data = await this.http.get(
3460
3199
  `/egress/audit/${id}`
3461
3200
  );
3462
- return unwrap26(data);
3201
+ return unwrap24(data);
3463
3202
  }
3464
3203
  /**
3465
3204
  * Long-poll the audit endpoint and yield new events as they appear.
@@ -3535,7 +3274,7 @@ var ComputerAudit = class extends SandboxAudit {
3535
3274
  };
3536
3275
 
3537
3276
  // src/resources/egressNetwork.ts
3538
- function unwrap27(payload) {
3277
+ function unwrap25(payload) {
3539
3278
  if (payload && typeof payload === "object") {
3540
3279
  const p = payload;
3541
3280
  for (const k of ["data", "policy", "rule", "items"]) {
@@ -3594,7 +3333,7 @@ var EgressNetwork = class {
3594
3333
  "/egress/allowlist",
3595
3334
  ruleBody(host, params, "allow")
3596
3335
  );
3597
- return unwrap27(data);
3336
+ return unwrap25(data);
3598
3337
  }
3599
3338
  /** Add a `deny` rule for `host` to the allowlist. */
3600
3339
  async deny(host, params = {}) {
@@ -3602,7 +3341,7 @@ var EgressNetwork = class {
3602
3341
  "/egress/allowlist",
3603
3342
  ruleBody(host, params, "deny")
3604
3343
  );
3605
- return unwrap27(data);
3344
+ return unwrap25(data);
3606
3345
  }
3607
3346
  /** List allowlist rules. */
3608
3347
  async rules(params = {}) {
@@ -3646,7 +3385,7 @@ var EgressNetwork = class {
3646
3385
  "/egress/policies",
3647
3386
  body5
3648
3387
  );
3649
- return unwrap27(data);
3388
+ return unwrap25(data);
3650
3389
  }
3651
3390
  /** Update an egress policy by id. */
3652
3391
  async updatePolicy(policyId, params) {
@@ -3660,7 +3399,7 @@ var EgressNetwork = class {
3660
3399
  `/egress/policies/${policyId}`,
3661
3400
  body5
3662
3401
  );
3663
- return unwrap27(data);
3402
+ return unwrap25(data);
3664
3403
  }
3665
3404
  // ── mode helpers ──────────────────────────────────────────────────────────
3666
3405
  /** Set the policy to `mode="enforce"` — denied egress is blocked. */
@@ -3687,7 +3426,7 @@ var EgressNetwork = class {
3687
3426
  "/egress/policies",
3688
3427
  body5
3689
3428
  );
3690
- return unwrap27(data);
3429
+ return unwrap25(data);
3691
3430
  }
3692
3431
  // ── suggestions ───────────────────────────────────────────────────────────
3693
3432
  /** AI-generated allowlist suggestions from recent denied egress. */
@@ -3778,7 +3517,7 @@ var ComputerNetwork = class extends SandboxNetwork {
3778
3517
  };
3779
3518
 
3780
3519
  // src/resources/egressSecrets.ts
3781
- function unwrap28(payload) {
3520
+ function unwrap26(payload) {
3782
3521
  if (payload && typeof payload === "object") {
3783
3522
  const p = payload;
3784
3523
  for (const k of ["data", "secret", "binding", "items"]) {
@@ -3914,7 +3653,7 @@ var OAuthFlow = class {
3914
3653
  const data = await this.http.get("/egress/oauth/status", {
3915
3654
  state: this.state
3916
3655
  });
3917
- const payload = unwrap28(data) ?? {};
3656
+ const payload = unwrap26(data) ?? {};
3918
3657
  const status = payload.status;
3919
3658
  if (status === "completed" || status === "ready" || status === "succeeded") {
3920
3659
  return payload;
@@ -3946,7 +3685,7 @@ var EgressSecrets = class {
3946
3685
  "/egress/secrets",
3947
3686
  setBody(params)
3948
3687
  );
3949
- return unwrap28(data);
3688
+ return unwrap26(data);
3950
3689
  }
3951
3690
  /** List secrets. */
3952
3691
  async list(params = {}) {
@@ -3961,7 +3700,7 @@ var EgressSecrets = class {
3961
3700
  const data = await this.http.get(
3962
3701
  `/egress/secrets/${id}`
3963
3702
  );
3964
- return unwrap28(data);
3703
+ return unwrap26(data);
3965
3704
  }
3966
3705
  /** Rotate the secret's value. */
3967
3706
  async rotate(id, params) {
@@ -3970,7 +3709,7 @@ var EgressSecrets = class {
3970
3709
  `/egress/secrets/${id}`,
3971
3710
  body5
3972
3711
  );
3973
- return unwrap28(data);
3712
+ return unwrap26(data);
3974
3713
  }
3975
3714
  /** Delete a secret. */
3976
3715
  async delete(id) {
@@ -3983,7 +3722,7 @@ var EgressSecrets = class {
3983
3722
  "/egress/bindings",
3984
3723
  bindingBody(params)
3985
3724
  );
3986
- return unwrap28(data);
3725
+ return unwrap26(data);
3987
3726
  }
3988
3727
  /** List secret bindings. */
3989
3728
  async listBindings(params = {}) {
@@ -4016,7 +3755,7 @@ var EgressSecrets = class {
4016
3755
  "/egress/oauth/start",
4017
3756
  oauthBody(params)
4018
3757
  );
4019
- const payload = unwrap28(data) ?? {};
3758
+ const payload = unwrap26(data) ?? {};
4020
3759
  return new OAuthFlow(this.http, payload, params.provider);
4021
3760
  }
4022
3761
  };
@@ -5180,7 +4919,7 @@ var Credits = class {
5180
4919
  return this.http.get("/credits/usage");
5181
4920
  }
5182
4921
  };
5183
- function unwrap29(payload) {
4922
+ function unwrap27(payload) {
5184
4923
  if (payload && typeof payload === "object" && "data" in payload) {
5185
4924
  return payload.data;
5186
4925
  }
@@ -5216,7 +4955,7 @@ var CronJobs = class {
5216
4955
  }
5217
4956
  async get(jobId) {
5218
4957
  const data = await this.http.get(`/cron-jobs/${jobId}`);
5219
- return unwrap29(data);
4958
+ return unwrap27(data);
5220
4959
  }
5221
4960
  async create(params) {
5222
4961
  const { idempotencyKey: ikey, ...rest } = params;
@@ -5226,12 +4965,12 @@ var CronJobs = class {
5226
4965
  body: body5,
5227
4966
  headers: { "Idempotency-Key": idempotencyKey2(ikey) }
5228
4967
  });
5229
- return unwrap29(data);
4968
+ return unwrap27(data);
5230
4969
  }
5231
4970
  async update(jobId, params) {
5232
4971
  const body5 = stripUndefined14(params);
5233
4972
  const data = await this.http.patch(`/cron-jobs/${jobId}`, body5);
5234
- return unwrap29(data);
4973
+ return unwrap27(data);
5235
4974
  }
5236
4975
  async delete(jobId) {
5237
4976
  await this.http.delete(`/cron-jobs/${jobId}`);
@@ -5239,11 +4978,11 @@ var CronJobs = class {
5239
4978
  // ── Control ────────────────────────────────────────────────────────────────
5240
4979
  async pause(jobId) {
5241
4980
  const data = await this.http.post(`/cron-jobs/${jobId}/pause`);
5242
- return unwrap29(data);
4981
+ return unwrap27(data);
5243
4982
  }
5244
4983
  async resume(jobId) {
5245
4984
  const data = await this.http.post(`/cron-jobs/${jobId}/resume`);
5246
- return unwrap29(data);
4985
+ return unwrap27(data);
5247
4986
  }
5248
4987
  async runNow(jobId, opts = {}) {
5249
4988
  const data = await this.http.request(
@@ -5253,7 +4992,7 @@ var CronJobs = class {
5253
4992
  headers: { "Idempotency-Key": idempotencyKey2(opts.idempotencyKey) }
5254
4993
  }
5255
4994
  );
5256
- return unwrap29(data);
4995
+ return unwrap27(data);
5257
4996
  }
5258
4997
  // ── Execution history ──────────────────────────────────────────────────────
5259
4998
  async listExecutions(jobId) {
@@ -5268,12 +5007,12 @@ var CronJobs = class {
5268
5007
  const data = await this.http.get(
5269
5008
  `/cron-jobs/${jobId}/executions/${executionId}`
5270
5009
  );
5271
- return unwrap29(data);
5010
+ return unwrap27(data);
5272
5011
  }
5273
5012
  };
5274
5013
 
5275
5014
  // src/resources/dashboard.ts
5276
- function unwrap30(payload) {
5015
+ function unwrap28(payload) {
5277
5016
  if (payload && typeof payload === "object") {
5278
5017
  const p = payload;
5279
5018
  for (const k of ["data", "dashboard", "overview", "items"]) {
@@ -5290,15 +5029,15 @@ var Dashboard = class {
5290
5029
  /** Aggregated user dashboard payload. */
5291
5030
  async summary() {
5292
5031
  const data = await this.http.get("/dashboard");
5293
- return unwrap30(data);
5032
+ return unwrap28(data);
5294
5033
  }
5295
5034
  /** Status / health overview (public endpoint). */
5296
5035
  async overview() {
5297
5036
  const data = await this.http.get("/overview");
5298
- return unwrap30(data);
5037
+ return unwrap28(data);
5299
5038
  }
5300
5039
  };
5301
- function unwrap31(payload) {
5040
+ function unwrap29(payload) {
5302
5041
  if (payload && typeof payload === "object" && "data" in payload) {
5303
5042
  return payload.data;
5304
5043
  }
@@ -5334,7 +5073,7 @@ var Databases = class {
5334
5073
  }
5335
5074
  async get(databaseId) {
5336
5075
  const data = await this.http.get(`/databases/${databaseId}`);
5337
- return unwrap31(data);
5076
+ return unwrap29(data);
5338
5077
  }
5339
5078
  async create(params) {
5340
5079
  const {
@@ -5358,7 +5097,7 @@ var Databases = class {
5358
5097
  )
5359
5098
  }
5360
5099
  });
5361
- return unwrap31(data);
5100
+ return unwrap29(data);
5362
5101
  }
5363
5102
  async delete(databaseId) {
5364
5103
  await this.http.delete(`/databases/${databaseId}`);
@@ -5368,24 +5107,24 @@ var Databases = class {
5368
5107
  const data = await this.http.post(
5369
5108
  `/databases/${databaseId}/start`
5370
5109
  );
5371
- return unwrap31(data);
5110
+ return unwrap29(data);
5372
5111
  }
5373
5112
  async stop(databaseId) {
5374
5113
  const data = await this.http.post(`/databases/${databaseId}/stop`);
5375
- return unwrap31(data);
5114
+ return unwrap29(data);
5376
5115
  }
5377
5116
  async restart(databaseId) {
5378
5117
  const data = await this.http.post(
5379
5118
  `/databases/${databaseId}/restart`
5380
5119
  );
5381
- return unwrap31(data);
5120
+ return unwrap29(data);
5382
5121
  }
5383
5122
  // ── Credentials + logs ────────────────────────────────────────────────────
5384
5123
  async credentials(databaseId) {
5385
5124
  const data = await this.http.get(
5386
5125
  `/databases/${databaseId}/credentials`
5387
5126
  );
5388
- return unwrap31(data);
5127
+ return unwrap29(data);
5389
5128
  }
5390
5129
  async logs(databaseId, params = {}) {
5391
5130
  const query3 = stripUndefined15({
@@ -5415,7 +5154,7 @@ function attributionBody(p) {
5415
5154
  function idempotencyKey4(key) {
5416
5155
  return key ?? randomUUID();
5417
5156
  }
5418
- function unwrap32(payload) {
5157
+ function unwrap30(payload) {
5419
5158
  if (payload && typeof payload === "object" && "data" in payload) {
5420
5159
  return payload.data;
5421
5160
  }
@@ -5524,7 +5263,7 @@ var DeploymentVersions = class {
5524
5263
  const data = await this.http.get(
5525
5264
  `/deployments/${this.deploymentId}/versions/${versionId}`
5526
5265
  );
5527
- return unwrap32(data);
5266
+ return unwrap30(data);
5528
5267
  }
5529
5268
  async promote(versionId, opts = {}) {
5530
5269
  const body5 = stripUndefined16({ environment: opts.environment });
@@ -5536,14 +5275,14 @@ var DeploymentVersions = class {
5536
5275
  headers: { "Idempotency-Key": idempotencyKey4(opts.idempotencyKey) }
5537
5276
  }
5538
5277
  );
5539
- return unwrap32(data);
5278
+ return unwrap30(data);
5540
5279
  }
5541
5280
  async prepareMigrationBackup(versionId) {
5542
5281
  const data = await this.http.request(
5543
5282
  `/deployments/${this.deploymentId}/versions/${versionId}/migration-backup`,
5544
5283
  { method: "POST", body: {} }
5545
5284
  );
5546
- return unwrap32(data);
5285
+ return unwrap30(data);
5547
5286
  }
5548
5287
  };
5549
5288
  var DeploymentReleases = class {
@@ -5563,7 +5302,7 @@ var DeploymentReleases = class {
5563
5302
  const data = await this.http.get(
5564
5303
  `/deployments/${this.deploymentId}/releases/${releaseId}`
5565
5304
  );
5566
- return unwrap32(data);
5305
+ return unwrap30(data);
5567
5306
  }
5568
5307
  async promote(releaseId, idempotencyKey11) {
5569
5308
  const key = idempotencyKey11 ?? `promote:${this.deploymentId}:${releaseId}`;
@@ -5575,7 +5314,7 @@ var DeploymentReleases = class {
5575
5314
  headers: { "Idempotency-Key": key }
5576
5315
  }
5577
5316
  );
5578
- return unwrap32(data);
5317
+ return unwrap30(data);
5579
5318
  }
5580
5319
  };
5581
5320
  var DeploymentRuntimeInstances = class {
@@ -5595,14 +5334,14 @@ var DeploymentRuntimeInstances = class {
5595
5334
  const data = await this.http.get(
5596
5335
  `/deployments/${this.deploymentId}/runtime-instances/${instanceId}`
5597
5336
  );
5598
- return unwrap32(data);
5337
+ return unwrap30(data);
5599
5338
  }
5600
5339
  async logs(instanceId, lines = 100) {
5601
5340
  const data = await this.http.get(
5602
5341
  `/deployments/${this.deploymentId}/runtime-instances/${instanceId}/logs`,
5603
5342
  { lines }
5604
5343
  );
5605
- const unwrapped = unwrap32(data);
5344
+ const unwrapped = unwrap30(data);
5606
5345
  const result = { logs: String(unwrapped.logs ?? "") };
5607
5346
  if (typeof unwrapped.runtime_instance_id === "string") {
5608
5347
  result.runtime_instance_id = unwrapped.runtime_instance_id;
@@ -5637,7 +5376,7 @@ var DeploymentDomains = class {
5637
5376
  headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
5638
5377
  }
5639
5378
  );
5640
- return unwrap32(data);
5379
+ return unwrap30(data);
5641
5380
  }
5642
5381
  async list(filters = {}) {
5643
5382
  const data = await this.http.get(
@@ -5650,7 +5389,7 @@ var DeploymentDomains = class {
5650
5389
  const data = await this.http.post(
5651
5390
  `/deployments/${this.deploymentId}/domains/${domainId}/verify`
5652
5391
  );
5653
- return unwrap32(data);
5392
+ return unwrap30(data);
5654
5393
  }
5655
5394
  async delete(domainId) {
5656
5395
  await this.http.delete(
@@ -5680,7 +5419,7 @@ var Deployments = class {
5680
5419
  }
5681
5420
  async get(deploymentId) {
5682
5421
  const data = await this.http.get(`/deployments/${deploymentId}`);
5683
- return unwrap32(data);
5422
+ return unwrap30(data);
5684
5423
  }
5685
5424
  async create(params) {
5686
5425
  const body5 = stripUndefined16({
@@ -5699,7 +5438,7 @@ var Deployments = class {
5699
5438
  body: body5,
5700
5439
  headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
5701
5440
  });
5702
- return unwrap32(data);
5441
+ return unwrap30(data);
5703
5442
  }
5704
5443
  /**
5705
5444
  * Create a deployment that runs on the workspace's dedicated App Engine
@@ -5743,7 +5482,7 @@ var Deployments = class {
5743
5482
  const rawHost = await this.http.get(
5744
5483
  `/docker-deploy/hosts/${hostId}`
5745
5484
  );
5746
- host = unwrap32(
5485
+ host = unwrap30(
5747
5486
  rawHost
5748
5487
  );
5749
5488
  addDoctorCheck(
@@ -5894,7 +5633,7 @@ var Deployments = class {
5894
5633
  const rawHost = await this.http.get(
5895
5634
  `/docker-deploy/hosts/${hostId}`
5896
5635
  );
5897
- const host = unwrap32(
5636
+ const host = unwrap30(
5898
5637
  rawHost
5899
5638
  );
5900
5639
  addProofCheck(
@@ -6001,7 +5740,7 @@ var Deployments = class {
6001
5740
  `/deployments/${deploymentId}`,
6002
5741
  body5
6003
5742
  );
6004
- return unwrap32(data);
5743
+ return unwrap30(data);
6005
5744
  }
6006
5745
  async delete(deploymentId) {
6007
5746
  await this.http.delete(`/deployments/${deploymentId}`);
@@ -6021,7 +5760,7 @@ var Deployments = class {
6021
5760
  headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
6022
5761
  }
6023
5762
  );
6024
- return unwrap32(data);
5763
+ return unwrap30(data);
6025
5764
  }
6026
5765
  /**
6027
5766
  * Backward-compatible bridge: POST /sandboxes/:id/deploy. Works today;
@@ -6046,7 +5785,7 @@ var Deployments = class {
6046
5785
  headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
6047
5786
  }
6048
5787
  );
6049
- return unwrap32(data);
5788
+ return unwrap30(data);
6050
5789
  }
6051
5790
  async rollback(deploymentId, params = {}) {
6052
5791
  const body5 = stripUndefined16({
@@ -6060,7 +5799,7 @@ var Deployments = class {
6060
5799
  headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
6061
5800
  }
6062
5801
  );
6063
- return unwrap32(data);
5802
+ return unwrap30(data);
6064
5803
  }
6065
5804
  async listBuilds(deploymentId) {
6066
5805
  const data = await this.http.get(
@@ -6072,7 +5811,7 @@ var Deployments = class {
6072
5811
  const data = await this.http.get(
6073
5812
  `/deployments/${deploymentId}/builds/${buildId}`
6074
5813
  );
6075
- return unwrap32(data);
5814
+ return unwrap30(data);
6076
5815
  }
6077
5816
  async listEnv(deploymentId) {
6078
5817
  const data = await this.http.get(
@@ -6118,7 +5857,7 @@ var RUNTIME_BINARIES = {
6118
5857
  pi: ["pi"],
6119
5858
  custom: []
6120
5859
  };
6121
- function unwrap33(payload, keys = ["data"]) {
5860
+ function unwrap31(payload, keys = ["data"]) {
6122
5861
  if (payload && typeof payload === "object") {
6123
5862
  const p = payload;
6124
5863
  for (const key of keys) {
@@ -6177,7 +5916,7 @@ var Devices = class {
6177
5916
  /** Show one unified device by id. */
6178
5917
  async get(id) {
6179
5918
  const data = await this.http.get(`/devices/${devicePath(id)}`);
6180
- return unwrap33(data);
5919
+ return unwrap31(data);
6181
5920
  }
6182
5921
  show(id) {
6183
5922
  return this.get(id);
@@ -6187,7 +5926,7 @@ var Devices = class {
6187
5926
  const data = await this.http.get(
6188
5927
  `/devices/${devicePath(id)}/capabilities`
6189
5928
  );
6190
- return unwrap33(data);
5929
+ return unwrap31(data);
6191
5930
  }
6192
5931
  /** Execute a command inside the device. */
6193
5932
  async exec(id, params) {
@@ -6200,7 +5939,7 @@ var Devices = class {
6200
5939
  env: params.env
6201
5940
  })
6202
5941
  );
6203
- return unwrap33(data);
5942
+ return unwrap31(data);
6204
5943
  }
6205
5944
  /** List files inside the device filesystem. */
6206
5945
  async listFiles(id, params = {}) {
@@ -6216,7 +5955,7 @@ var Devices = class {
6216
5955
  `/devices/${devicePath(id)}/files/read`,
6217
5956
  queryFromFileParams(params)
6218
5957
  );
6219
- return unwrap33(data);
5958
+ return unwrap31(data);
6220
5959
  }
6221
5960
  /** Write a text or base64 payload into the device filesystem. */
6222
5961
  async writeFile(id, params) {
@@ -6228,7 +5967,7 @@ var Devices = class {
6228
5967
  content_base64: pickFirst5(params.contentBase64, params.content_base64)
6229
5968
  })
6230
5969
  );
6231
- return unwrap33(data);
5970
+ return unwrap31(data);
6232
5971
  }
6233
5972
  /** Expose a device port through MIOSA routing. */
6234
5973
  async expose(id, params) {
@@ -6236,44 +5975,44 @@ var Devices = class {
6236
5975
  `/devices/${devicePath(id)}/expose`,
6237
5976
  { port: params.port }
6238
5977
  );
6239
- return unwrap33(data);
5978
+ return unwrap31(data);
6240
5979
  }
6241
5980
  /** Return browser/desktop connection details for a computer-backed device. */
6242
5981
  async browser(id) {
6243
5982
  const data = await this.http.get(`/devices/${devicePath(id)}/browser`);
6244
- return unwrap33(data);
5983
+ return unwrap31(data);
6245
5984
  }
6246
5985
  async pause(id) {
6247
5986
  const data = await this.http.post(
6248
5987
  `/devices/${devicePath(id)}/pause`,
6249
5988
  {}
6250
5989
  );
6251
- return unwrap33(data);
5990
+ return unwrap31(data);
6252
5991
  }
6253
5992
  async stop(id) {
6254
5993
  const data = await this.http.post(
6255
5994
  `/devices/${devicePath(id)}/stop`,
6256
5995
  {}
6257
5996
  );
6258
- return unwrap33(data);
5997
+ return unwrap31(data);
6259
5998
  }
6260
5999
  async resume(id) {
6261
6000
  const data = await this.http.post(
6262
6001
  `/devices/${devicePath(id)}/resume`,
6263
6002
  {}
6264
6003
  );
6265
- return unwrap33(data);
6004
+ return unwrap31(data);
6266
6005
  }
6267
6006
  async extend(id, params) {
6268
6007
  const data = await this.http.post(
6269
6008
  `/devices/${devicePath(id)}/extend`,
6270
6009
  { timeout_sec: pickFirst5(params.timeoutSec, params.timeout_sec) }
6271
6010
  );
6272
- return unwrap33(data);
6011
+ return unwrap31(data);
6273
6012
  }
6274
6013
  async destroy(id) {
6275
6014
  const data = await this.http.delete(`/devices/${devicePath(id)}`);
6276
- return unwrap33(data);
6015
+ return unwrap31(data);
6277
6016
  }
6278
6017
  /**
6279
6018
  * Write a MIOSA runtime bootstrap manifest and optionally install/probe
@@ -6443,7 +6182,7 @@ var DockerDeploy = class {
6443
6182
  };
6444
6183
 
6445
6184
  // src/resources/email.ts
6446
- function unwrap34(data) {
6185
+ function unwrap32(data) {
6447
6186
  if (data && typeof data === "object") {
6448
6187
  const d = data;
6449
6188
  for (const k of [
@@ -6495,12 +6234,12 @@ var EmailCampaigns = class {
6495
6234
  );
6496
6235
  }
6497
6236
  async create(attrs) {
6498
- return unwrap34(
6237
+ return unwrap32(
6499
6238
  await this.http.post("/admin/email-campaigns", strip(attrs))
6500
6239
  );
6501
6240
  }
6502
6241
  async recipientCount(filters = {}) {
6503
- return unwrap34(
6242
+ return unwrap32(
6504
6243
  await this.http.get(
6505
6244
  "/admin/email-campaigns/recipient-count",
6506
6245
  filters
@@ -6508,7 +6247,7 @@ var EmailCampaigns = class {
6508
6247
  );
6509
6248
  }
6510
6249
  async send(campaignId, opts = {}) {
6511
- return unwrap34(
6250
+ return unwrap32(
6512
6251
  await this.http.post(
6513
6252
  `/admin/email-campaigns/${campaignId}/send`,
6514
6253
  strip(opts)
@@ -6516,7 +6255,7 @@ var EmailCampaigns = class {
6516
6255
  );
6517
6256
  }
6518
6257
  async cancel(campaignId) {
6519
- return unwrap34(
6258
+ return unwrap32(
6520
6259
  await this.http.post(
6521
6260
  `/admin/email-campaigns/${campaignId}/cancel`
6522
6261
  )
@@ -6542,7 +6281,7 @@ var EmailTemplates = class {
6542
6281
  );
6543
6282
  }
6544
6283
  async create(key, attrs = {}) {
6545
- return unwrap34(
6284
+ return unwrap32(
6546
6285
  await this.http.post("/admin/email-templates", {
6547
6286
  key,
6548
6287
  ...strip(attrs)
@@ -6550,7 +6289,7 @@ var EmailTemplates = class {
6550
6289
  );
6551
6290
  }
6552
6291
  async update(key, attrs) {
6553
- return unwrap34(
6292
+ return unwrap32(
6554
6293
  await this.http.put(
6555
6294
  `/admin/email-templates/${key}`,
6556
6295
  strip(attrs)
@@ -6558,7 +6297,7 @@ var EmailTemplates = class {
6558
6297
  );
6559
6298
  }
6560
6299
  async reset(key) {
6561
- return unwrap34(
6300
+ return unwrap32(
6562
6301
  await this.http.post(`/admin/email-templates/${key}/reset`)
6563
6302
  );
6564
6303
  }
@@ -6574,17 +6313,17 @@ var EmailInbox = class {
6574
6313
  );
6575
6314
  }
6576
6315
  async send(attrs) {
6577
- return unwrap34(
6316
+ return unwrap32(
6578
6317
  await this.http.post("/admin/email-inbox/send", strip(attrs))
6579
6318
  );
6580
6319
  }
6581
6320
  async markRead(messageId) {
6582
- return unwrap34(
6321
+ return unwrap32(
6583
6322
  await this.http.post(`/admin/email-inbox/${messageId}/read`)
6584
6323
  );
6585
6324
  }
6586
6325
  async archive(messageId) {
6587
- return unwrap34(
6326
+ return unwrap32(
6588
6327
  await this.http.post(`/admin/email-inbox/${messageId}/archive`)
6589
6328
  );
6590
6329
  }
@@ -6624,7 +6363,7 @@ var Embeddings = class {
6624
6363
  };
6625
6364
 
6626
6365
  // src/resources/external-keys.ts
6627
- function unwrap35(payload) {
6366
+ function unwrap33(payload) {
6628
6367
  if (payload && typeof payload === "object") {
6629
6368
  const p = payload;
6630
6369
  for (const k of ["data", "external_keys", "items"]) {
@@ -6646,7 +6385,7 @@ var ExternalKeys = class {
6646
6385
  /** List configured external keys. */
6647
6386
  async list() {
6648
6387
  const data = await this.http.get("/external-keys");
6649
- const result = unwrap35(data);
6388
+ const result = unwrap33(data);
6650
6389
  if (Array.isArray(result)) return result;
6651
6390
  return [];
6652
6391
  }
@@ -6654,14 +6393,14 @@ var ExternalKeys = class {
6654
6393
  async create(params) {
6655
6394
  const body5 = stripUndefined18(params);
6656
6395
  const data = await this.http.post("/external-keys", body5);
6657
- return unwrap35(data);
6396
+ return unwrap33(data);
6658
6397
  }
6659
6398
  /** Resolve (preview) the stored key for a provider. */
6660
6399
  async resolve(provider) {
6661
6400
  const data = await this.http.get(
6662
6401
  `/external-keys/${provider}/resolve`
6663
6402
  );
6664
- return unwrap35(data);
6403
+ return unwrap33(data);
6665
6404
  }
6666
6405
  /**
6667
6406
  * Delete the stored key for a provider.
@@ -6671,7 +6410,7 @@ var ExternalKeys = class {
6671
6410
  await this.http.delete(`/external-keys/${provider}`);
6672
6411
  }
6673
6412
  };
6674
- function unwrap36(payload) {
6413
+ function unwrap34(payload) {
6675
6414
  if (payload && typeof payload === "object" && "data" in payload) {
6676
6415
  return payload.data;
6677
6416
  }
@@ -6724,13 +6463,13 @@ var FlatCustomDomains = class {
6724
6463
  body: body5,
6725
6464
  headers: { "Idempotency-Key": idempotencyKey5(ikey) }
6726
6465
  });
6727
- return unwrap36(data);
6466
+ return unwrap34(data);
6728
6467
  }
6729
6468
  async delete(domainId) {
6730
6469
  await this.http.delete(`/custom-domains/${domainId}`);
6731
6470
  }
6732
6471
  };
6733
- function unwrap37(payload) {
6472
+ function unwrap35(payload) {
6734
6473
  if (payload && typeof payload === "object" && "data" in payload) {
6735
6474
  return payload.data;
6736
6475
  }
@@ -6744,456 +6483,77 @@ function listItems6(payload, candidateKeys = ["data", "functions", "items"]) {
6744
6483
  for (const key of candidateKeys) {
6745
6484
  if (Array.isArray(p[key])) return p[key];
6746
6485
  }
6747
- return [];
6748
- }
6749
- function stripUndefined20(input) {
6750
- return Object.fromEntries(
6751
- Object.entries(input).filter(([, v]) => v !== void 0)
6752
- );
6753
- }
6754
- function idempotencyKey6(key) {
6755
- return key ?? randomUUID();
6756
- }
6757
- var Functions = class {
6758
- constructor(http) {
6759
- this.http = http;
6760
- }
6761
- http;
6762
- async list(params = {}) {
6763
- const query3 = stripUndefined20({ ...params });
6764
- const data = await this.http.get("/functions", query3);
6765
- return listItems6(data);
6766
- }
6767
- async get(functionId) {
6768
- const data = await this.http.get(`/functions/${functionId}`);
6769
- return unwrap37(data);
6770
- }
6771
- async create(params) {
6772
- const { idempotencyKey: ikey, memoryMb, timeoutSec, ...rest } = params;
6773
- const body5 = stripUndefined20({
6774
- ...rest,
6775
- memory_mb: memoryMb ?? rest.memory_mb,
6776
- timeout_sec: timeoutSec ?? rest.timeout_sec
6777
- });
6778
- const data = await this.http.request("/functions", {
6779
- method: "POST",
6780
- body: body5,
6781
- headers: { "Idempotency-Key": idempotencyKey6(ikey) }
6782
- });
6783
- return unwrap37(data);
6784
- }
6785
- async update(functionId, params) {
6786
- const { memoryMb, timeoutSec, ...rest } = params;
6787
- const body5 = stripUndefined20({
6788
- ...rest,
6789
- memory_mb: memoryMb ?? rest.memory_mb,
6790
- timeout_sec: timeoutSec ?? rest.timeout_sec
6791
- });
6792
- const data = await this.http.patch(
6793
- `/functions/${functionId}`,
6794
- body5
6795
- );
6796
- return unwrap37(data);
6797
- }
6798
- async delete(functionId) {
6799
- await this.http.delete(`/functions/${functionId}`);
6800
- }
6801
- async invoke(functionId, params = {}) {
6802
- const { payload = {}, headers, idempotencyKey: ikey } = params;
6803
- const data = await this.http.request(
6804
- `/functions/${functionId}/invoke`,
6805
- {
6806
- method: "POST",
6807
- body: payload,
6808
- headers: {
6809
- "Idempotency-Key": idempotencyKey6(ikey),
6810
- ...headers
6811
- }
6812
- }
6813
- );
6814
- return data ?? {};
6815
- }
6816
- };
6817
-
6818
- // src/resources/forge.ts
6819
- var REPOSITORY_VISIBILITIES = /* @__PURE__ */ new Set([
6820
- "public",
6821
- "private",
6822
- "internal"
6823
- ]);
6824
- var REPOSITORY_STATES = /* @__PURE__ */ new Set([
6825
- "provisioning",
6826
- "active",
6827
- "error",
6828
- "deletion_pending",
6829
- "deleted"
6830
- ]);
6831
- var ForgeContractError = class extends MiosaError {
6832
- constructor(message, details) {
6833
- super(message, 502, "FORGE_CONTRACT_ERROR", details);
6834
- this.name = "ForgeContractError";
6835
- }
6836
- };
6837
- var ForgeUnavailableError = class extends MiosaError {
6838
- constructor(message, cause) {
6839
- super(message, cause.status, "FORGE_DISABLED", cause.details, cause.requestId);
6840
- this.name = "ForgeUnavailableError";
6841
- }
6842
- };
6843
- var ForgeStorageError = class extends MiosaError {
6844
- constructor(message, cause) {
6845
- super(message, cause.status, cause.code, cause.details, cause.requestId);
6846
- this.name = "ForgeStorageError";
6847
- }
6848
- };
6849
- var ForgePolicyViolationError = class extends MiosaError {
6850
- constructor(message, cause) {
6851
- super(message, cause.status, cause.code, cause.details, cause.requestId);
6852
- this.name = "ForgePolicyViolationError";
6853
- }
6854
- };
6855
- function translateError(error) {
6856
- if (!(error instanceof MiosaError)) throw error;
6857
- if (error.code === "FORGE_DISABLED") {
6858
- throw new ForgeUnavailableError("Forge is not enabled for this organization", error);
6859
- }
6860
- if (error.code === "FORGE_STORAGE_UNAVAILABLE" || error.code === "FORGE_OPERATION_FAILED") {
6861
- throw new ForgeStorageError("Forge repository storage is unavailable", error);
6862
- }
6863
- if (error.code === "INVALID_PROJECT_ATTACHMENT") {
6864
- throw new ForgePolicyViolationError("Forge repository policy rejected the operation", error);
6865
- }
6866
- throw error;
6867
- }
6868
- function repositoryPath(id) {
6869
- return `/forge/repositories/${encodeURIComponent(id)}`;
6870
- }
6871
- function compact(value) {
6872
- return Object.fromEntries(
6873
- Object.entries(value).filter(([, item]) => item !== void 0)
6874
- );
6875
- }
6876
- function object(payload, label) {
6877
- if (!payload || typeof payload !== "object" || Array.isArray(payload)) {
6878
- throw new ForgeContractError(`Forge returned invalid ${label}`, { payload });
6879
- }
6880
- return payload;
6881
- }
6882
- function string(value, field, payload) {
6883
- if (typeof value !== "string") {
6884
- throw new ForgeContractError(`Forge content is missing ${field}`, { field, payload });
6885
- }
6886
- return value;
6887
- }
6888
- function nullableString(value, field, payload) {
6889
- if (value !== null && typeof value !== "string") {
6890
- throw new ForgeContractError(`Forge content has invalid ${field}`, { field, payload });
6891
- }
6892
- return value;
6893
- }
6894
- function queryPath(path, params) {
6895
- const query3 = new URLSearchParams();
6896
- for (const [key, value] of Object.entries(params)) {
6897
- if (value !== void 0) query3.set(key, String(value));
6898
- }
6899
- const encoded = query3.toString();
6900
- return encoded ? `${path}?${encoded}` : path;
6901
- }
6902
- function parseNamedRef(payload) {
6903
- const value = object(payload, "repository ref");
6904
- return { name: string(value.name, "name", payload), oid: string(value.oid, "oid", payload) };
6905
- }
6906
- function parseRefs(payload) {
6907
- const value = object(payload, "repository refs");
6908
- if (!Array.isArray(value.branches) || !Array.isArray(value.tags)) {
6909
- throw new ForgeContractError("Forge repository refs have invalid collections", { payload });
6910
- }
6911
- const branches = value.branches.map((item) => {
6912
- const branch = object(item, "branch");
6913
- if (typeof branch.is_default !== "boolean") {
6914
- throw new ForgeContractError("Forge branch is missing is_default", { payload: item });
6915
- }
6916
- return { ...parseNamedRef(item), is_default: branch.is_default };
6917
- });
6918
- return {
6919
- default_branch: string(value.default_branch, "default_branch", payload),
6920
- head_oid: nullableString(value.head_oid, "head_oid", payload),
6921
- branches,
6922
- tags: value.tags.map(parseNamedRef)
6923
- };
6924
- }
6925
- function parseTree(payload) {
6926
- const value = object(payload, "repository tree");
6927
- if (!Array.isArray(value.entries) || typeof value.truncated !== "boolean") {
6928
- throw new ForgeContractError("Forge repository tree has invalid entries", { payload });
6929
- }
6930
- const entries = value.entries.map((item) => {
6931
- const entry = object(item, "tree entry");
6932
- if (entry.type !== "blob" && entry.type !== "tree") {
6933
- throw new ForgeContractError("Forge tree entry has invalid type", { payload: item });
6934
- }
6935
- if (entry.size !== null && (typeof entry.size !== "number" || !Number.isSafeInteger(entry.size) || entry.size < 0)) {
6936
- throw new ForgeContractError("Forge tree entry has invalid size", { payload: item });
6937
- }
6938
- return {
6939
- name: string(entry.name, "name", item),
6940
- path: string(entry.path, "path", item),
6941
- type: entry.type,
6942
- oid: string(entry.oid, "oid", item),
6943
- size: entry.size
6944
- };
6945
- });
6946
- return {
6947
- ref: string(value.ref, "ref", payload),
6948
- commit_oid: string(value.commit_oid, "commit_oid", payload),
6949
- path: string(value.path, "path", payload),
6950
- entries,
6951
- truncated: value.truncated
6952
- };
6953
- }
6954
- function parseBlob(payload) {
6955
- const value = object(payload, "repository blob");
6956
- if (value.encoding !== "utf-8" && value.encoding !== "base64") {
6957
- throw new ForgeContractError("Forge blob has invalid encoding", { payload });
6958
- }
6959
- if (typeof value.size !== "number" || !Number.isSafeInteger(value.size) || value.size < 0) {
6960
- throw new ForgeContractError("Forge blob has invalid size", { payload });
6961
- }
6962
- return {
6963
- ref: string(value.ref, "ref", payload),
6964
- commit_oid: string(value.commit_oid, "commit_oid", payload),
6965
- path: string(value.path, "path", payload),
6966
- oid: string(value.oid, "oid", payload),
6967
- size: value.size,
6968
- encoding: value.encoding,
6969
- content: string(value.content, "content", payload)
6970
- };
6971
- }
6972
- function parseHistory(payload) {
6973
- const value = object(payload, "commit history");
6974
- const page = object(value.page, "commit page");
6975
- if (!Array.isArray(value.commits) || typeof page.has_more !== "boolean") {
6976
- throw new ForgeContractError("Forge commit history has invalid pagination", { payload });
6977
- }
6978
- const commits = value.commits.map((item) => {
6979
- const commit = object(item, "commit");
6980
- if (!Array.isArray(commit.parents) || !commit.parents.every((parent) => typeof parent === "string")) {
6981
- throw new ForgeContractError("Forge commit has invalid parents", { payload: item });
6982
- }
6983
- return {
6984
- oid: string(commit.oid, "oid", item),
6985
- short_oid: string(commit.short_oid, "short_oid", item),
6986
- subject: string(commit.subject, "subject", item),
6987
- author_name: string(commit.author_name, "author_name", item),
6988
- author_email: string(commit.author_email, "author_email", item),
6989
- authored_at: string(commit.authored_at, "authored_at", item),
6990
- committer_name: string(commit.committer_name, "committer_name", item),
6991
- committed_at: string(commit.committed_at, "committed_at", item),
6992
- parents: commit.parents
6993
- };
6994
- });
6995
- return {
6996
- ref: string(value.ref, "ref", payload),
6997
- path: string(value.path, "path", payload),
6998
- commits,
6999
- page: { has_more: page.has_more, next_cursor: nullableString(page.next_cursor, "next_cursor", page) }
7000
- };
7001
- }
7002
- function parseFileReceipt(payload, replayed) {
7003
- const value = object(payload, "file operation receipt");
7004
- const commit = object(value.commit, "file operation commit");
7005
- const policy = object(value.policy, "file operation policy");
7006
- const stringFields = ["operation_id", "repository_id", "branch", "path", "previous_head", "new_head"];
7007
- 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") {
7008
- throw new ForgeContractError("Forge returned invalid file operation receipt", { payload });
7009
- }
7010
- return { ...value, replayed };
7011
- }
7012
- function parseRepository(payload) {
7013
- if (!payload || typeof payload !== "object" || Array.isArray(payload)) {
7014
- throw new ForgeContractError("Forge returned an invalid repository", {
7015
- payload
7016
- });
7017
- }
7018
- const value = payload;
7019
- const requiredStrings = [
7020
- "id",
7021
- "name",
7022
- "slug",
7023
- "default_branch",
7024
- "visibility",
7025
- "state",
7026
- "created_at",
7027
- "updated_at"
7028
- ];
7029
- for (const field of requiredStrings) {
7030
- if (typeof value[field] !== "string" || value[field].length === 0) {
7031
- throw new ForgeContractError(`Forge repository is missing ${field}`, {
7032
- field,
7033
- payload
7034
- });
7035
- }
7036
- }
7037
- if (!REPOSITORY_VISIBILITIES.has(value.visibility)) {
7038
- throw new ForgeContractError("Forge repository has an invalid visibility", {
7039
- payload
7040
- });
7041
- }
7042
- if (!REPOSITORY_STATES.has(value.state)) {
7043
- throw new ForgeContractError("Forge repository has an invalid state", {
7044
- payload
7045
- });
7046
- }
7047
- 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"))
7048
- throw new ForgeContractError("Forge repository has invalid clone or project metadata", { payload });
7049
- if (value.clone_ready !== (value.state === "active") || value.clone_ready && !value.clone_url || !value.clone_ready && value.clone_url !== null)
7050
- throw new ForgeContractError("Forge repository clone readiness is inconsistent", { payload });
7051
- return {
7052
- id: value.id,
7053
- name: value.name,
7054
- slug: value.slug,
7055
- default_branch: value.default_branch,
7056
- visibility: value.visibility,
7057
- state: value.state,
7058
- clone_ready: value.clone_ready,
7059
- clone_url: value.clone_url,
7060
- project_ids: value.project_ids,
7061
- created_at: value.created_at,
7062
- updated_at: value.updated_at
7063
- };
7064
- }
7065
- function parseCapabilities(payload) {
7066
- const value = object(payload, "capabilities");
7067
- 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";
7068
- if (!valid) throw new ForgeContractError("Forge returned invalid capabilities", { payload });
7069
- return value;
7070
- }
7071
- var ForgeRepositories = class {
7072
- constructor(http) {
7073
- this.http = http;
7074
- }
7075
- http;
7076
- async create(params) {
7077
- try {
7078
- const payload = await this.http.request("/forge/repositories", {
7079
- method: "POST",
7080
- headers: { "Idempotency-Key": params.idempotencyKey ?? crypto.randomUUID() },
7081
- body: compact({
7082
- name: params.name,
7083
- slug: params.slug,
7084
- default_branch: params.defaultBranch,
7085
- visibility: params.visibility,
7086
- project_ids: params.projectIds
7087
- })
7088
- });
7089
- return parseRepository(unwrapData2(payload));
7090
- } catch (error) {
7091
- translateError(error);
7092
- }
7093
- }
7094
- async list() {
7095
- const payload = await this.http.get("/forge/repositories");
7096
- if (!payload || typeof payload !== "object" || Array.isArray(payload) || !Array.isArray(payload.data)) {
7097
- throw new ForgeContractError("Forge returned an invalid repository list", {
7098
- payload
7099
- });
7100
- }
7101
- return payload.data.map(
7102
- parseRepository
7103
- );
7104
- }
7105
- async get(id) {
7106
- return parseRepository(unwrapData2(await this.http.get(repositoryPath(id))));
7107
- }
7108
- async refs(id) {
7109
- return parseRefs(unwrapData2(await this.http.get(`${repositoryPath(id)}/refs`)));
7110
- }
7111
- async tree(id, location = {}) {
7112
- const path = queryPath(`${repositoryPath(id)}/tree`, { ref: location.ref, path: location.path });
7113
- return parseTree(unwrapData2(await this.http.get(path)));
7114
- }
7115
- async blob(id, location) {
7116
- const path = queryPath(`${repositoryPath(id)}/blob`, { ref: location.ref, path: location.path });
7117
- return parseBlob(unwrapData2(await this.http.get(path)));
7118
- }
7119
- async readme(id, location = {}) {
7120
- const path = queryPath(`${repositoryPath(id)}/readme`, { ref: location.ref, path: location.path });
7121
- return parseBlob(unwrapData2(await this.http.get(path)));
7122
- }
7123
- async commits(id, query3 = {}) {
7124
- const path = queryPath(`${repositoryPath(id)}/commits`, {
7125
- ref: query3.ref,
7126
- path: query3.path,
7127
- limit: query3.limit,
7128
- cursor: query3.cursor
7129
- });
7130
- return parseHistory(unwrapData2(await this.http.get(path)));
6486
+ return [];
6487
+ }
6488
+ function stripUndefined20(input) {
6489
+ return Object.fromEntries(
6490
+ Object.entries(input).filter(([, v]) => v !== void 0)
6491
+ );
6492
+ }
6493
+ function idempotencyKey6(key) {
6494
+ return key ?? randomUUID();
6495
+ }
6496
+ var Functions = class {
6497
+ constructor(http) {
6498
+ this.http = http;
7131
6499
  }
7132
- async putFile(id, path, params) {
7133
- return this.authorFile(id, path, "PUT", params);
6500
+ http;
6501
+ async list(params = {}) {
6502
+ const query3 = stripUndefined20({ ...params });
6503
+ const data = await this.http.get("/functions", query3);
6504
+ return listItems6(data);
7134
6505
  }
7135
- async deleteFile(id, path, params) {
7136
- return this.authorFile(id, path, "DELETE", params);
6506
+ async get(functionId) {
6507
+ const data = await this.http.get(`/functions/${functionId}`);
6508
+ return unwrap35(data);
7137
6509
  }
7138
- async authorFile(id, path, method, params) {
7139
- const response = await this.http.request(`${repositoryPath(id)}/files/${path.split("/").map(encodeURIComponent).join("/")}`, {
7140
- method,
7141
- rawResponse: true,
7142
- headers: { "Idempotency-Key": params.idempotencyKey ?? crypto.randomUUID() },
7143
- body: compact({ branch: params.branch, expected_head: params.expectedHead, message: params.message, content: params.content })
6510
+ async create(params) {
6511
+ const { idempotencyKey: ikey, memoryMb, timeoutSec, ...rest } = params;
6512
+ const body5 = stripUndefined20({
6513
+ ...rest,
6514
+ memory_mb: memoryMb ?? rest.memory_mb,
6515
+ timeout_sec: timeoutSec ?? rest.timeout_sec
7144
6516
  });
7145
- let payload;
7146
- try {
7147
- payload = await response.json();
7148
- } catch {
7149
- throw new ForgeContractError("Forge returned invalid file operation JSON");
7150
- }
7151
- return parseFileReceipt(unwrapData2(payload), response.headers.get("idempotency-replayed") === "true");
7152
- }
7153
- async update(id, params) {
7154
- try {
7155
- const payload = await this.http.request(repositoryPath(id), { method: "PATCH", body: compact({
7156
- name: params.name,
7157
- slug: params.slug,
7158
- visibility: params.visibility,
7159
- project_ids: params.projectIds
7160
- }) });
7161
- return parseRepository(unwrapData2(payload));
7162
- } catch (error) {
7163
- translateError(error);
7164
- }
6517
+ const data = await this.http.request("/functions", {
6518
+ method: "POST",
6519
+ body: body5,
6520
+ headers: { "Idempotency-Key": idempotencyKey6(ikey) }
6521
+ });
6522
+ return unwrap35(data);
7165
6523
  }
7166
- async delete(id, _options = {}) {
7167
- try {
7168
- const response = await this.http.request(repositoryPath(id), {
7169
- method: "DELETE",
7170
- rawResponse: true
7171
- });
7172
- const operationId = response.headers.get("x-forge-operation-id");
7173
- if (!operationId) throw new ForgeContractError("Forge delete omitted its operation receipt");
7174
- return { operation_id: operationId, replayed: response.headers.get("idempotency-replayed") === "true" };
7175
- } catch (error) {
7176
- translateError(error);
7177
- }
6524
+ async update(functionId, params) {
6525
+ const { memoryMb, timeoutSec, ...rest } = params;
6526
+ const body5 = stripUndefined20({
6527
+ ...rest,
6528
+ memory_mb: memoryMb ?? rest.memory_mb,
6529
+ timeout_sec: timeoutSec ?? rest.timeout_sec
6530
+ });
6531
+ const data = await this.http.patch(
6532
+ `/functions/${functionId}`,
6533
+ body5
6534
+ );
6535
+ return unwrap35(data);
7178
6536
  }
7179
- };
7180
- function unwrapData2(payload) {
7181
- if (!payload || typeof payload !== "object" || Array.isArray(payload) || !("data" in payload))
7182
- throw new ForgeContractError("Forge returned an invalid success envelope", { payload });
7183
- return payload.data;
7184
- }
7185
- var Forge = class {
7186
- repositories;
7187
- constructor(http) {
7188
- this.repositories = new ForgeRepositories(http);
7189
- this.http = http;
6537
+ async delete(functionId) {
6538
+ await this.http.delete(`/functions/${functionId}`);
7190
6539
  }
7191
- http;
7192
- async capabilities() {
7193
- return parseCapabilities(unwrapData2(await this.http.get("/forge/capabilities")));
6540
+ async invoke(functionId, params = {}) {
6541
+ const { payload = {}, headers, idempotencyKey: ikey } = params;
6542
+ const data = await this.http.request(
6543
+ `/functions/${functionId}/invoke`,
6544
+ {
6545
+ method: "POST",
6546
+ body: payload,
6547
+ headers: {
6548
+ "Idempotency-Key": idempotencyKey6(ikey),
6549
+ ...headers
6550
+ }
6551
+ }
6552
+ );
6553
+ return data ?? {};
7194
6554
  }
7195
6555
  };
7196
- function unwrap38(payload) {
6556
+ function unwrap36(payload) {
7197
6557
  if (payload && typeof payload === "object" && "data" in payload) {
7198
6558
  return payload.data;
7199
6559
  }
@@ -7229,7 +6589,7 @@ var HealthChecks = class {
7229
6589
  }
7230
6590
  async get(checkId) {
7231
6591
  const data = await this.http.get(`/health-checks/${checkId}`);
7232
- return unwrap38(data);
6592
+ return unwrap36(data);
7233
6593
  }
7234
6594
  async create(params) {
7235
6595
  const {
@@ -7250,7 +6610,7 @@ var HealthChecks = class {
7250
6610
  body: body5,
7251
6611
  headers: { "Idempotency-Key": idempotencyKey7(ikey) }
7252
6612
  });
7253
- return unwrap38(data);
6613
+ return unwrap36(data);
7254
6614
  }
7255
6615
  async update(checkId, params) {
7256
6616
  const { intervalSec, timeoutSec, expectedStatus, ...rest } = params;
@@ -7264,7 +6624,7 @@ var HealthChecks = class {
7264
6624
  `/health-checks/${checkId}`,
7265
6625
  body5
7266
6626
  );
7267
- return unwrap38(data);
6627
+ return unwrap36(data);
7268
6628
  }
7269
6629
  async delete(checkId) {
7270
6630
  await this.http.delete(`/health-checks/${checkId}`);
@@ -7272,7 +6632,7 @@ var HealthChecks = class {
7272
6632
  };
7273
6633
 
7274
6634
  // src/resources/integrations.ts
7275
- function unwrap39(payload) {
6635
+ function unwrap37(payload) {
7276
6636
  if (payload && typeof payload === "object") {
7277
6637
  const p = payload;
7278
6638
  for (const k of ["data", "integrations", "catalog", "items"]) {
@@ -7282,7 +6642,7 @@ function unwrap39(payload) {
7282
6642
  return payload;
7283
6643
  }
7284
6644
  function listItems8(payload) {
7285
- const result = unwrap39(payload);
6645
+ const result = unwrap37(payload);
7286
6646
  if (Array.isArray(result)) return result;
7287
6647
  return [];
7288
6648
  }
@@ -7311,14 +6671,14 @@ var Integrations = class {
7311
6671
  const data = await this.http.get(
7312
6672
  `/integrations/${provider}/start`
7313
6673
  );
7314
- return unwrap39(data);
6674
+ return unwrap37(data);
7315
6675
  }
7316
6676
  /** Force-refresh the access token for a provider. */
7317
6677
  async refresh(provider) {
7318
6678
  const data = await this.http.post(
7319
6679
  `/integrations/${provider}/refresh`
7320
6680
  );
7321
- return unwrap39(data);
6681
+ return unwrap37(data);
7322
6682
  }
7323
6683
  /** Disconnect (revoke) an integration. */
7324
6684
  async disconnect(provider) {
@@ -7343,7 +6703,7 @@ var Integrations = class {
7343
6703
  "/integrations/slack/send-test",
7344
6704
  body5
7345
6705
  );
7346
- return unwrap39(data);
6706
+ return unwrap37(data);
7347
6707
  }
7348
6708
  /** Send a test message to the connected Discord channel. */
7349
6709
  async discordSendTest(params = {}) {
@@ -7352,13 +6712,13 @@ var Integrations = class {
7352
6712
  "/integrations/discord/send-test",
7353
6713
  body5
7354
6714
  );
7355
- return unwrap39(data);
6715
+ return unwrap37(data);
7356
6716
  }
7357
6717
  // ── Linear dedicated controller ────────────────────────────────────────────
7358
6718
  /** Begin Linear OAuth — Linear has provider-specific error shapes. */
7359
6719
  async linearStart() {
7360
6720
  const data = await this.http.get("/integrations/linear/start");
7361
- return unwrap39(data);
6721
+ return unwrap37(data);
7362
6722
  }
7363
6723
  /** Create a Linear issue via the connected workspace. */
7364
6724
  async linearCreateIssue(params = {}) {
@@ -7367,12 +6727,12 @@ var Integrations = class {
7367
6727
  "/integrations/linear/create-issue",
7368
6728
  body5
7369
6729
  );
7370
- return unwrap39(data);
6730
+ return unwrap37(data);
7371
6731
  }
7372
6732
  };
7373
6733
 
7374
6734
  // src/resources/mcp.ts
7375
- function unwrap40(payload) {
6735
+ function unwrap38(payload) {
7376
6736
  if (payload && typeof payload === "object") {
7377
6737
  const p = payload;
7378
6738
  for (const k of ["data", "mcp", "result", "items"]) {
@@ -7398,7 +6758,7 @@ var Mcp = class {
7398
6758
  "/mcp",
7399
6759
  Object.keys(body5).length > 0 ? body5 : void 0
7400
6760
  );
7401
- return unwrap40(data);
6761
+ return unwrap38(data);
7402
6762
  }
7403
6763
  /**
7404
6764
  * Open the MCP listen channel (GET).
@@ -7408,7 +6768,7 @@ var Mcp = class {
7408
6768
  */
7409
6769
  async listen() {
7410
6770
  const data = await this.http.get("/mcp");
7411
- return unwrap40(data);
6771
+ return unwrap38(data);
7412
6772
  }
7413
6773
  /** Close (terminate) the MCP session. */
7414
6774
  async close() {
@@ -7417,7 +6777,7 @@ var Mcp = class {
7417
6777
  };
7418
6778
 
7419
6779
  // src/resources/models.ts
7420
- function unwrap41(data) {
6780
+ function unwrap39(data) {
7421
6781
  if (Array.isArray(data)) return data;
7422
6782
  if (data && typeof data === "object") {
7423
6783
  const d = data;
@@ -7438,7 +6798,7 @@ var Models = class {
7438
6798
  Object.entries(filters).filter(([, v]) => v !== void 0)
7439
6799
  );
7440
6800
  const data = await this.http.get("/intelligence/models", query3);
7441
- return unwrap41(data);
6801
+ return unwrap39(data);
7442
6802
  }
7443
6803
  /**
7444
6804
  * Get a single model by id.
@@ -7788,130 +7148,41 @@ var Jobs = class {
7788
7148
  return `/opencomputers/hosts/${hostId}`;
7789
7149
  }
7790
7150
  /**
7791
- * Run a command on the host and wait for the buffered result.
7792
- *
7793
- * Sends `stream: false` so the server buffers output and answers with JSON.
7794
- * `stream` defaults to *true* server-side, which answers with a chunked SSE
7795
- * body instead - use {@link runStream} for that.
7796
- *
7797
- * Note this holds the connection open for the life of the command
7798
- * (`timeout_ms`, 30 s default), because the server does not answer until
7799
- * the command finishes.
7151
+ * Dispatch a command to run on the remote host.
7800
7152
  */
7801
7153
  async run(hostId, params) {
7802
- return this.http.post(`${this.base(hostId)}/exec`, {
7803
- ...params,
7804
- stream: false
7805
- });
7806
- }
7807
- /**
7808
- * Run a command on the host and stream its output as it happens.
7809
- *
7810
- * Same endpoint as {@link run} with `stream: true`, which is the server's
7811
- * default mode. Terminates with one `exec_result` or one `exec_error`.
7812
- */
7813
- runStream(hostId, params) {
7814
- return translateExecStream(
7815
- this.http.stream(`${this.base(hostId)}/exec`, {
7816
- method: "POST",
7817
- body: { ...params, stream: true }
7818
- })
7819
- );
7154
+ return this.http.post(`${this.base(hostId)}/exec`, params);
7820
7155
  }
7821
7156
  /**
7822
- * List recent job activity for a host.
7823
- *
7824
- * Hits `/jobs`, not `/exec`: there is no `GET /opencomputers/hosts/{id}/exec`
7825
- * route on the server, so the old path 404'd. The rows are audit-log events
7826
- * about jobs (`job.dispatched` / `job.done` / `job.failed`), newest first,
7827
- * not job records - see {@link JobAuditEvent}.
7828
- *
7829
- * @param limit Server caps this at 100 and defaults to 20.
7157
+ * List all jobs for a host.
7830
7158
  */
7831
- async list(hostId, limit) {
7832
- return this.http.get(
7833
- `${this.base(hostId)}/jobs`,
7834
- limit === void 0 ? void 0 : { limit }
7835
- );
7159
+ async list(hostId) {
7160
+ return this.http.get(`${this.base(hostId)}/exec`);
7836
7161
  }
7837
7162
  /**
7838
7163
  * Fetch the current state of a job.
7839
- *
7840
- * The server wraps the record in a `job` envelope; this unwraps it.
7841
7164
  */
7842
7165
  async get(hostId, jobId) {
7843
- const response = await this.http.get(
7844
- `${this.base(hostId)}/exec/${jobId}`
7845
- );
7846
- if (response && typeof response === "object" && "job" in response) {
7847
- return response.job;
7848
- }
7849
- return response;
7166
+ return this.http.get(`${this.base(hostId)}/exec/${jobId}`);
7850
7167
  }
7851
7168
  /**
7852
- * Re-attach to a job that is already running and stream what is left.
7169
+ * Stream live output from a running job.
7853
7170
  *
7854
- * This is the reconnect endpoint. If the job has already reached a terminal
7855
- * state the server answers `204 No Content` and this yields nothing, rather
7856
- * than replaying output - the server never stored it.
7171
+ * Yields `JobEvent` objects with `type` of `stdout`, `stderr`, `exit`, or
7172
+ * `done`. Break the loop when you receive `done` or `exit`.
7857
7173
  */
7858
7174
  stream(hostId, jobId) {
7859
- return translateExecStream(
7860
- this.http.stream(`${this.base(hostId)}/exec/${jobId}/stream`)
7175
+ return this.http.stream(
7176
+ `${this.base(hostId)}/exec/${jobId}/stream`
7861
7177
  );
7862
7178
  }
7863
7179
  /**
7864
7180
  * Cancel a running or queued job.
7865
- *
7866
- * Answers `204` on success and `409` when the job is already terminal.
7867
7181
  */
7868
7182
  async cancel(hostId, jobId) {
7869
7183
  return this.http.delete(`${this.base(hostId)}/exec/${jobId}`);
7870
7184
  }
7871
7185
  };
7872
- var EXEC_EVENT_NAMES = /* @__PURE__ */ new Set(["exec_chunk", "exec_result", "exec_error"]);
7873
- function asString(value) {
7874
- return typeof value === "string" ? value : null;
7875
- }
7876
- function asNumber(value) {
7877
- return typeof value === "number" ? value : null;
7878
- }
7879
- function toJobEvent(raw) {
7880
- if (raw === null || typeof raw !== "object") return null;
7881
- const record = raw;
7882
- const name = asString(record["type"]);
7883
- if (name === null || !EXEC_EVENT_NAMES.has(name)) return null;
7884
- if (name === "exec_chunk") {
7885
- return {
7886
- type: "exec_chunk",
7887
- // The server defaults this to :stdout when the host omits it; anything
7888
- // other than "stderr" is stdout by the same rule.
7889
- stream: record["stream"] === "stderr" ? "stderr" : "stdout",
7890
- data: asString(record["data"])
7891
- };
7892
- }
7893
- if (name === "exec_result") {
7894
- return {
7895
- type: "exec_result",
7896
- exit_code: asNumber(record["exit_code"]),
7897
- elapsed_ms: asNumber(record["elapsed_ms"])
7898
- };
7899
- }
7900
- const jobId = asString(record["job_id"]);
7901
- return {
7902
- type: "exec_error",
7903
- reason: asString(record["reason"]),
7904
- // Only the timeout path carries job_id. exactOptionalPropertyTypes means
7905
- // the key has to be omitted rather than set to undefined.
7906
- ...jobId === null ? {} : { job_id: jobId }
7907
- };
7908
- }
7909
- async function* translateExecStream(source) {
7910
- for await (const raw of source) {
7911
- const event = toJobEvent(raw);
7912
- if (event !== null) yield event;
7913
- }
7914
- }
7915
7186
 
7916
7187
  // src/resources/open-computers/secrets.ts
7917
7188
  var Secrets = class {
@@ -8183,7 +7454,7 @@ function requestBody(params) {
8183
7454
  config: authConfig(params)
8184
7455
  });
8185
7456
  }
8186
- function unwrap42(payload) {
7457
+ function unwrap40(payload) {
8187
7458
  if (payload && typeof payload === "object") {
8188
7459
  const p = payload;
8189
7460
  for (const k of ["data", "project_auth", "config", "items"]) {
@@ -8208,13 +7479,13 @@ var ProjectAuth = class {
8208
7479
  "/project-auth/status",
8209
7480
  resourcePayload(params)
8210
7481
  );
8211
- return unwrap42(data);
7482
+ return unwrap40(data);
8212
7483
  }
8213
7484
  /** Enable project auth. */
8214
7485
  async enable(params) {
8215
7486
  const body5 = requestBody(params);
8216
7487
  const data = await this.http.post("/project-auth/enable", body5);
8217
- return unwrap42(data);
7488
+ return unwrap40(data);
8218
7489
  }
8219
7490
  /** Disable project auth. */
8220
7491
  async disable(params) {
@@ -8222,18 +7493,18 @@ var ProjectAuth = class {
8222
7493
  "/project-auth/disable",
8223
7494
  resourcePayload(params)
8224
7495
  );
8225
- return unwrap42(data);
7496
+ return unwrap40(data);
8226
7497
  }
8227
7498
  /** Update project-auth configuration. */
8228
7499
  async update(params) {
8229
7500
  const body5 = requestBody(params);
8230
7501
  const data = await this.http.patch("/project-auth/config", body5);
8231
- return unwrap42(data);
7502
+ return unwrap40(data);
8232
7503
  }
8233
7504
  };
8234
7505
 
8235
7506
  // src/resources/project-integrations.ts
8236
- function unwrap43(payload) {
7507
+ function unwrap41(payload) {
8237
7508
  if (payload && typeof payload === "object") {
8238
7509
  const p = payload;
8239
7510
  for (const k of ["data", "project_integrations", "catalog", "items"]) {
@@ -8243,7 +7514,7 @@ function unwrap43(payload) {
8243
7514
  return payload;
8244
7515
  }
8245
7516
  function listItems9(payload) {
8246
- const result = unwrap43(payload);
7517
+ const result = unwrap41(payload);
8247
7518
  if (Array.isArray(result)) return result;
8248
7519
  return [];
8249
7520
  }
@@ -8278,13 +7549,13 @@ var ProjectIntegrations = class {
8278
7549
  const data = await this.http.get(
8279
7550
  `/project-integrations/${integrationId}`
8280
7551
  );
8281
- return unwrap43(data);
7552
+ return unwrap41(data);
8282
7553
  }
8283
7554
  /** Create a project integration. */
8284
7555
  async create(params) {
8285
7556
  const body5 = stripUndefObj2(params);
8286
7557
  const data = await this.http.post("/project-integrations", body5);
8287
- return unwrap43(data);
7558
+ return unwrap41(data);
8288
7559
  }
8289
7560
  /** Update a project integration. */
8290
7561
  async update(integrationId, params) {
@@ -8293,7 +7564,7 @@ var ProjectIntegrations = class {
8293
7564
  `/project-integrations/${integrationId}`,
8294
7565
  body5
8295
7566
  );
8296
- return unwrap43(data);
7567
+ return unwrap41(data);
8297
7568
  }
8298
7569
  /** Delete a project integration. */
8299
7570
  async delete(integrationId) {
@@ -8302,7 +7573,7 @@ var ProjectIntegrations = class {
8302
7573
  };
8303
7574
 
8304
7575
  // src/resources/provider-defaults.ts
8305
- function unwrap44(data) {
7576
+ function unwrap42(data) {
8306
7577
  if (data && typeof data === "object") {
8307
7578
  const d = data;
8308
7579
  for (const k of ["data", "defaults", "provider_defaults", "config"]) {
@@ -8318,7 +7589,7 @@ var ProviderDefaults = class {
8318
7589
  http;
8319
7590
  /** Get the current fleet-wide provider defaults. */
8320
7591
  async list() {
8321
- return unwrap44(await this.http.get("/admin/provider-defaults"));
7592
+ return unwrap42(await this.http.get("/admin/provider-defaults"));
8322
7593
  }
8323
7594
  /** Return the defaults entry for a single provider, or {} if missing. */
8324
7595
  async get(provider) {
@@ -8334,13 +7605,13 @@ var ProviderDefaults = class {
8334
7605
  const body5 = Object.fromEntries(
8335
7606
  Object.entries(opts).filter(([, v]) => v !== void 0)
8336
7607
  );
8337
- return unwrap44(
7608
+ return unwrap42(
8338
7609
  await this.http.put("/admin/provider-defaults", body5)
8339
7610
  );
8340
7611
  }
8341
7612
  // ── Per-tenant overrides ────────────────────────────────────────────────
8342
7613
  async getTenant(tenantId) {
8343
- return unwrap44(
7614
+ return unwrap42(
8344
7615
  await this.http.get(
8345
7616
  `/admin/tenants/${tenantId}/provider-config`
8346
7617
  )
@@ -8350,7 +7621,7 @@ var ProviderDefaults = class {
8350
7621
  const body5 = Object.fromEntries(
8351
7622
  Object.entries(opts).filter(([, v]) => v !== void 0)
8352
7623
  );
8353
- return unwrap44(
7624
+ return unwrap42(
8354
7625
  await this.http.put(
8355
7626
  `/admin/tenants/${tenantId}/provider-config`,
8356
7627
  body5
@@ -8363,7 +7634,7 @@ var ProviderDefaults = class {
8363
7634
  };
8364
7635
 
8365
7636
  // src/resources/regions.ts
8366
- function unwrap45(payload) {
7637
+ function unwrap43(payload) {
8367
7638
  if (payload && typeof payload === "object") {
8368
7639
  const p = payload;
8369
7640
  for (const k of [
@@ -8380,7 +7651,7 @@ function unwrap45(payload) {
8380
7651
  return payload;
8381
7652
  }
8382
7653
  function listItems10(payload) {
8383
- const result = unwrap45(payload);
7654
+ const result = unwrap43(payload);
8384
7655
  if (Array.isArray(result)) return result;
8385
7656
  return [];
8386
7657
  }
@@ -8397,7 +7668,7 @@ var Regions = class {
8397
7668
  /** Get canonical compute catalog, including product templates and readiness. */
8398
7669
  async catalog() {
8399
7670
  const data = await this.http.get("/compute/catalog");
8400
- return unwrap45(data);
7671
+ return unwrap43(data);
8401
7672
  }
8402
7673
  /** List available compute sizes. */
8403
7674
  async listSizes() {
@@ -8407,7 +7678,7 @@ var Regions = class {
8407
7678
  /** Get static compute pricing data. */
8408
7679
  async pricing() {
8409
7680
  const data = await this.http.get("/compute/pricing");
8410
- return unwrap45(data);
7681
+ return unwrap43(data);
8411
7682
  }
8412
7683
  /** List community computer templates. */
8413
7684
  async listTemplates() {
@@ -8419,12 +7690,12 @@ var Regions = class {
8419
7690
  const data = await this.http.get(
8420
7691
  `/compute/templates/${templateId}`
8421
7692
  );
8422
- return unwrap45(data);
7693
+ return unwrap43(data);
8423
7694
  }
8424
7695
  };
8425
7696
 
8426
7697
  // src/resources/runtime-env.ts
8427
- function unwrap46(payload) {
7698
+ function unwrap44(payload) {
8428
7699
  if (payload !== null && typeof payload === "object" && "data" in payload && payload.data !== void 0) {
8429
7700
  return payload.data;
8430
7701
  }
@@ -8477,11 +7748,11 @@ var RuntimeEnv = class {
8477
7748
  "/runtime-env",
8478
7749
  query2(params)
8479
7750
  );
8480
- return unwrap46(response).map(normalize2);
7751
+ return unwrap44(response).map(normalize2);
8481
7752
  }
8482
7753
  async get(id) {
8483
7754
  return normalize2(
8484
- unwrap46(
7755
+ unwrap44(
8485
7756
  await this.http.get(
8486
7757
  `/runtime-env/${encodeURIComponent(id)}`
8487
7758
  )
@@ -8490,7 +7761,7 @@ var RuntimeEnv = class {
8490
7761
  }
8491
7762
  async set(params) {
8492
7763
  return normalize2(
8493
- unwrap46(
7764
+ unwrap44(
8494
7765
  await this.http.post(
8495
7766
  "/runtime-env",
8496
7767
  body4(params)
@@ -8504,7 +7775,7 @@ var RuntimeEnv = class {
8504
7775
  };
8505
7776
 
8506
7777
  // src/resources/runtime-capabilities.ts
8507
- function unwrap47(payload) {
7778
+ function unwrap45(payload) {
8508
7779
  if (payload && typeof payload === "object" && "data" in payload) {
8509
7780
  return payload.data;
8510
7781
  }
@@ -8516,38 +7787,12 @@ var RuntimeCapabilitiesResource = class {
8516
7787
  }
8517
7788
  http;
8518
7789
  async get() {
8519
- return unwrap47(
7790
+ return unwrap45(
8520
7791
  await this.http.get("/runtime-capabilities")
8521
7792
  );
8522
7793
  }
8523
7794
  };
8524
7795
 
8525
- // src/resources/sandbox-host-routes.ts
8526
- var SANDBOXES_HOST_BASE_URL = "https://sandboxes.miosa.ai/api/v1";
8527
- var SANDBOXES_HOST = "sandboxes.miosa.ai";
8528
- function isSandboxesHost(baseUrl) {
8529
- try {
8530
- return new URL(baseUrl).host === SANDBOXES_HOST;
8531
- } catch {
8532
- return false;
8533
- }
8534
- }
8535
- async function* streamSandboxesHostRoute(http, path, alternative) {
8536
- try {
8537
- yield* http.stream(path);
8538
- } catch (err) {
8539
- if (err instanceof MiosaError && err.status === 404 && !isSandboxesHost(http.baseUrl)) {
8540
- throw new NotFoundError(
8541
- `HTTP 404 for GET ${path}. This route is mounted only on the sandboxes host router (${SANDBOXES_HOST}); it is not part of the platform router that serves this client's baseUrl (${http.baseUrl}). Either construct the client with baseUrl: "${SANDBOXES_HOST_BASE_URL}", or ${alternative}. A wrong sandbox id also produces a 404.`,
8542
- err.code,
8543
- err.details,
8544
- err.requestId
8545
- );
8546
- }
8547
- throw err;
8548
- }
8549
- }
8550
-
8551
7796
  // src/resources/sandboxes.ts
8552
7797
  function encodeContent(content) {
8553
7798
  const bytes = typeof content === "string" ? new TextEncoder().encode(content) : content;
@@ -8572,13 +7817,7 @@ var AGENT_WORKSPACE_KEEP_LAST_SNAPSHOTS = 1;
8572
7817
  function isLegacyForkParams(opts) {
8573
7818
  return "name" in opts || "metadata" in opts;
8574
7819
  }
8575
- async function* dropWatchHandshake(source) {
8576
- for await (const event of source) {
8577
- if (event.type === "connected") continue;
8578
- yield event;
8579
- }
8580
- }
8581
- function unwrap48(payload) {
7820
+ function unwrap46(payload) {
8582
7821
  if (payload !== null && typeof payload === "object" && "data" in payload && payload.data !== void 0) {
8583
7822
  return payload.data;
8584
7823
  }
@@ -8681,12 +7920,6 @@ function createBody(params = {}) {
8681
7920
  slug: params.slug,
8682
7921
  agent_runtime_profile_id: params.agentRuntimeProfileId ?? params.agent_runtime_profile_id ?? params.agentProfileId ?? params.agent_profile_id,
8683
7922
  skip_agent_runtime_profile: params.skipRuntimeProfile ?? params.skip_agent_runtime_profile,
8684
- workspace_id: params.workspaceId ?? params.workspace_id,
8685
- workspace_slug: params.workspaceSlug ?? params.workspace_slug,
8686
- workspace_name: params.workspaceName ?? params.workspace_name,
8687
- project_id: params.projectId ?? params.project_id,
8688
- project_slug: params.projectSlug ?? params.project_slug,
8689
- project_name: params.projectName ?? params.project_name,
8690
7923
  external_workspace_id: params.externalWorkspaceId ?? params.external_workspace_id,
8691
7924
  external_user_id: params.externalUserId ?? params.external_user_id,
8692
7925
  external_project_id: params.externalProjectId ?? params.external_project_id
@@ -8777,30 +8010,11 @@ var SandboxFiles = class {
8777
8010
  }
8778
8011
  return response;
8779
8012
  }
8780
- /**
8781
- * GET /api/v1/sandboxes/{id}/files/watch (SSE) — live file change events.
8782
- *
8783
- * SANDBOXES-HOST ONLY. This route is declared in `Web.Router.Sandboxes`
8784
- * and not in `Web.Router.Platform`, so it 404s against the SDK's default
8785
- * `https://api.miosa.ai/api/v1` base URL. Construct the client with
8786
- * `baseUrl: "https://sandboxes.miosa.ai/api/v1"` to reach it, or poll
8787
- * {@link list}/{@link stat} instead. See `./sandbox-host-routes.ts`.
8788
- *
8789
- * The server opens with a handshake record (`event: connected` /
8790
- * `data: {"sandbox_id":...}`) before any change events. That record is
8791
- * not a file change, so it is dropped here rather than yielded as a
8792
- * `SandboxFileChange` with `type: "connected"` and no `path`. Real change
8793
- * records carry their own `type` (`created` | `modified` | `deleted`) in
8794
- * the JSON body, so the SSE `event: file_change` name never overwrites it.
8795
- */
8013
+ /** GET /api/v1/sandboxes/{id}/files/watch (SSE) — live file change events. */
8796
8014
  watch() {
8797
8015
  const http = this.sandbox.http;
8798
- return dropWatchHandshake(
8799
- streamSandboxesHostRoute(
8800
- http,
8801
- `/sandboxes/${this.sandbox.id}/files/watch`,
8802
- "poll list()/stat() instead"
8803
- )
8016
+ return http.stream(
8017
+ `/sandboxes/${this.sandbox.id}/files/watch`
8804
8018
  );
8805
8019
  }
8806
8020
  };
@@ -8864,7 +8078,7 @@ var SandboxTerminal = class {
8864
8078
  const body5 = Object.fromEntries(
8865
8079
  Object.entries(params).filter(([, v]) => v !== void 0)
8866
8080
  );
8867
- const response = unwrap48(
8081
+ const response = unwrap46(
8868
8082
  await this.sandbox.http.post(`/sandboxes/${this.sandbox.id}/terminal`, body5)
8869
8083
  );
8870
8084
  return response;
@@ -8922,7 +8136,7 @@ var SandboxPreviews = class {
8922
8136
  Object.entries(opts).filter(([, v]) => v !== void 0)
8923
8137
  )
8924
8138
  };
8925
- return unwrap48(
8139
+ return unwrap46(
8926
8140
  await this.http.post(
8927
8141
  `/sandboxes/${this.sandbox.id}/previews`,
8928
8142
  body5
@@ -8930,7 +8144,7 @@ var SandboxPreviews = class {
8930
8144
  );
8931
8145
  }
8932
8146
  async get(previewId) {
8933
- return unwrap48(
8147
+ return unwrap46(
8934
8148
  await this.http.get(
8935
8149
  `/sandboxes/${this.sandbox.id}/previews/${previewId}`
8936
8150
  )
@@ -8943,7 +8157,7 @@ var SandboxPreviews = class {
8943
8157
  }
8944
8158
  /** Mint a share token for previewId. */
8945
8159
  async share(previewId, opts = {}) {
8946
- return unwrap48(
8160
+ return unwrap46(
8947
8161
  await this.http.post(
8948
8162
  `/sandboxes/${this.sandbox.id}/previews/${previewId}/share`,
8949
8163
  { ttl_seconds: opts.ttl_seconds ?? opts.expires_in_sec ?? 3600 }
@@ -9012,7 +8226,7 @@ var SandboxTags = class {
9012
8226
  sandbox;
9013
8227
  /** Replace the full tag list with tags. */
9014
8228
  async set(tags) {
9015
- return unwrap48(
8229
+ return unwrap46(
9016
8230
  await this.sandbox.http.patch(`/sandboxes/${this.sandbox.id}/tags`, { tags })
9017
8231
  );
9018
8232
  }
@@ -9086,7 +8300,7 @@ var Sandbox = class _Sandbox {
9086
8300
  return this.data.template_id ?? this.data.image_id ?? "";
9087
8301
  }
9088
8302
  async refresh() {
9089
- this.data = unwrap48(
8303
+ this.data = unwrap46(
9090
8304
  await this.http.get(`/sandboxes/${this.id}`)
9091
8305
  );
9092
8306
  return this;
@@ -9128,7 +8342,7 @@ var Sandbox = class _Sandbox {
9128
8342
  }
9129
8343
  async runExec(command, options) {
9130
8344
  this.assertRunning("exec");
9131
- const response = unwrap48(
8345
+ const response = unwrap46(
9132
8346
  await this.http.post(
9133
8347
  `/sandboxes/${this.id}/exec`,
9134
8348
  execBody(command, options)
@@ -9173,7 +8387,7 @@ var Sandbox = class _Sandbox {
9173
8387
  }
9174
8388
  async createExport(params) {
9175
8389
  const body5 = typeof params === "string" ? { path: params } : Array.isArray(params) ? { paths: params } : params;
9176
- const response = unwrap48(
8390
+ const response = unwrap46(
9177
8391
  await this.http.post(
9178
8392
  `/sandboxes/${this.id}/exports`,
9179
8393
  body5
@@ -9198,7 +8412,7 @@ var Sandbox = class _Sandbox {
9198
8412
  }
9199
8413
  async listFiles(path = "/workspace") {
9200
8414
  this.assertRunning("files.list");
9201
- const response = unwrap48(
8415
+ const response = unwrap46(
9202
8416
  await this.http.get(
9203
8417
  `/sandboxes/${this.id}/files`,
9204
8418
  { path }
@@ -9208,7 +8422,7 @@ var Sandbox = class _Sandbox {
9208
8422
  }
9209
8423
  async statFile(path) {
9210
8424
  this.assertRunning("files.stat");
9211
- return unwrap48(
8425
+ return unwrap46(
9212
8426
  await this.http.post(
9213
8427
  `/sandboxes/${this.id}/files/stat`,
9214
8428
  { path }
@@ -9228,7 +8442,7 @@ var Sandbox = class _Sandbox {
9228
8442
  }
9229
8443
  async exposeInfo(port) {
9230
8444
  this.assertRunning("expose");
9231
- const response = unwrap48(
8445
+ const response = unwrap46(
9232
8446
  await this.http.post(
9233
8447
  `/sandboxes/${this.id}/expose`,
9234
8448
  port === void 0 ? {} : { port }
@@ -9238,7 +8452,7 @@ var Sandbox = class _Sandbox {
9238
8452
  }
9239
8453
  async startTemplate(options = {}) {
9240
8454
  this.assertRunning("startTemplate");
9241
- return unwrap48(
8455
+ return unwrap46(
9242
8456
  await this.http.post(
9243
8457
  `/sandboxes/${this.id}/template/start`,
9244
8458
  options
@@ -9246,7 +8460,7 @@ var Sandbox = class _Sandbox {
9246
8460
  );
9247
8461
  }
9248
8462
  async getArtifacts() {
9249
- return unwrap48(
8463
+ return unwrap46(
9250
8464
  await this.http.get(
9251
8465
  `/sandboxes/${this.id}/artifacts`
9252
8466
  )
@@ -9257,7 +8471,7 @@ var Sandbox = class _Sandbox {
9257
8471
  `/sandboxes/${this.id}/logs`,
9258
8472
  { lines }
9259
8473
  );
9260
- return unwrap48(response);
8474
+ return unwrap46(response);
9261
8475
  }
9262
8476
  streamLogs() {
9263
8477
  return this.http.stream(
@@ -9265,7 +8479,7 @@ var Sandbox = class _Sandbox {
9265
8479
  );
9266
8480
  }
9267
8481
  async metrics(window2 = "1h") {
9268
- return unwrap48(
8482
+ return unwrap46(
9269
8483
  await this.http.get(
9270
8484
  `/sandboxes/${this.id}/metrics`,
9271
8485
  { window: window2 }
@@ -9277,7 +8491,7 @@ var Sandbox = class _Sandbox {
9277
8491
  }
9278
8492
  async createSnapshot(comment) {
9279
8493
  this.assertRunning("snapshots.create");
9280
- return unwrap48(
8494
+ return unwrap46(
9281
8495
  await this.http.post(
9282
8496
  `/sandboxes/${this.id}/snapshots`,
9283
8497
  comment ? { comment } : {}
@@ -9285,14 +8499,14 @@ var Sandbox = class _Sandbox {
9285
8499
  );
9286
8500
  }
9287
8501
  async listSnapshots() {
9288
- return unwrap48(
8502
+ return unwrap46(
9289
8503
  await this.http.get(
9290
8504
  `/sandboxes/${this.id}/snapshots`
9291
8505
  )
9292
8506
  );
9293
8507
  }
9294
8508
  async restoreSnapshot(snapshotId) {
9295
- const data = unwrap48(
8509
+ const data = unwrap46(
9296
8510
  await this.http.post(
9297
8511
  `/sandboxes/${this.id}/restore/${snapshotId}`,
9298
8512
  {}
@@ -9309,12 +8523,11 @@ var Sandbox = class _Sandbox {
9309
8523
  }
9310
8524
  this.assertRunning("fork");
9311
8525
  const body5 = stripUndefined26({
9312
- snapshot_id: opts.snapshotId ?? opts.snapshot_id,
9313
8526
  timeout_sec: opts.timeoutSec ?? opts.timeout_sec,
9314
8527
  template_id: opts.templateId ?? opts.template_id
9315
8528
  });
9316
8529
  const idempotencyKey11 = opts.idempotencyKey ?? opts.idempotency_key;
9317
- const data = unwrap48(
8530
+ const data = unwrap46(
9318
8531
  await this.http.request(
9319
8532
  `/sandboxes/${this.id}/fork`,
9320
8533
  {
@@ -9330,14 +8543,13 @@ var Sandbox = class _Sandbox {
9330
8543
  async forkLegacy(opts = {}) {
9331
8544
  this.assertRunning("fork");
9332
8545
  const body5 = stripUndefined26({
9333
- snapshot_id: opts.snapshotId ?? opts.snapshot_id,
9334
8546
  timeout_sec: opts.timeoutSec ?? opts.timeout_sec,
9335
8547
  template_id: opts.templateId ?? opts.template_id,
9336
8548
  name: opts.name,
9337
8549
  metadata: opts.metadata
9338
8550
  });
9339
8551
  const idempotencyKey11 = opts.idempotencyKey ?? opts.idempotency_key;
9340
- const data = unwrap48(
8552
+ const data = unwrap46(
9341
8553
  await this.http.request(
9342
8554
  `/sandboxes/${this.id}/fork`,
9343
8555
  {
@@ -9373,7 +8585,7 @@ var Sandbox = class _Sandbox {
9373
8585
  timeout_sec: params.timeout_sec ?? params.timeoutSec,
9374
8586
  idle_timeout_sec: params.idle_timeout_sec ?? params.idleTimeoutSec
9375
8587
  });
9376
- const data = unwrap48(
8588
+ const data = unwrap46(
9377
8589
  await this.http.patch(
9378
8590
  `/sandboxes/${this.id}`,
9379
8591
  body5
@@ -9383,7 +8595,7 @@ var Sandbox = class _Sandbox {
9383
8595
  return this;
9384
8596
  }
9385
8597
  async extend(timeoutSec) {
9386
- const data = unwrap48(
8598
+ const data = unwrap46(
9387
8599
  await this.http.post(
9388
8600
  `/sandboxes/${this.id}/extend`,
9389
8601
  timeoutSec === void 0 ? {} : { timeout_sec: timeoutSec }
@@ -9393,7 +8605,7 @@ var Sandbox = class _Sandbox {
9393
8605
  return this;
9394
8606
  }
9395
8607
  async usage() {
9396
- return unwrap48(
8608
+ return unwrap46(
9397
8609
  await this.http.get(
9398
8610
  `/sandboxes/${this.id}/usage`
9399
8611
  )
@@ -9413,7 +8625,7 @@ var Sandbox = class _Sandbox {
9413
8625
  return raw;
9414
8626
  }
9415
8627
  async pause() {
9416
- const data = unwrap48(
8628
+ const data = unwrap46(
9417
8629
  await this.http.post(
9418
8630
  `/sandboxes/${this.id}/pause`,
9419
8631
  {}
@@ -9434,7 +8646,7 @@ var Sandbox = class _Sandbox {
9434
8646
  `/sandboxes/${this.id}/resume`,
9435
8647
  {}
9436
8648
  );
9437
- const data = unwrap48(response);
8649
+ const data = unwrap46(response);
9438
8650
  this.data = { ...this.data, ...data };
9439
8651
  return this;
9440
8652
  }
@@ -9465,7 +8677,7 @@ var Sandbox = class _Sandbox {
9465
8677
  if (idempotencyKey11) {
9466
8678
  requestOptions.headers = { "Idempotency-Key": idempotencyKey11 };
9467
8679
  }
9468
- return unwrap48(
8680
+ return unwrap46(
9469
8681
  await this.http.request(
9470
8682
  `/sandboxes/${this.id}/deploy`,
9471
8683
  requestOptions
@@ -9475,57 +8687,9 @@ var Sandbox = class _Sandbox {
9475
8687
  async deployDocker(params = {}) {
9476
8688
  return this.deploy({ ...params, deploymentType: "docker_deploy" });
9477
8689
  }
9478
- /** Deploy an immutable snapshot without modifying the editable sandbox. */
9479
- async deploySnapshot(snapshotId, params = {}, options = {}) {
9480
- const release = await this.forkLegacy({
9481
- snapshotId,
9482
- name: `release-${snapshotId.slice(0, 12)}`,
9483
- metadata: { release_source_sandbox_id: this.id, snapshot_id: snapshotId },
9484
- ...options.forkIdempotencyKey ? { idempotencyKey: options.forkIdempotencyKey } : {}
9485
- });
9486
- const cleanupRequested = options.cleanup !== false;
9487
- const destroyRelease = async () => {
9488
- if (!cleanupRequested) return void 0;
9489
- try {
9490
- await release.destroy();
9491
- return void 0;
9492
- } catch (error) {
9493
- return error instanceof Error ? error.message : String(error);
9494
- }
9495
- };
9496
- let result;
9497
- try {
9498
- result = await release.deploy(params) ?? {};
9499
- } catch (error) {
9500
- const failedCleanup = await destroyRelease();
9501
- if (cleanupRequested && failedCleanup === void 0) throw error;
9502
- const leak = {
9503
- release_sandbox_id: release.id
9504
- };
9505
- if (failedCleanup !== void 0) {
9506
- leak.release_cleanup_error = failedCleanup;
9507
- }
9508
- if (typeof error === "object" && error !== null) {
9509
- throw Object.assign(error, leak);
9510
- }
9511
- throw Object.assign(
9512
- new Error(`Snapshot deployment failed: ${String(error)}`, {
9513
- cause: error
9514
- }),
9515
- leak
9516
- );
9517
- }
9518
- const cleanupErrorMessage = await destroyRelease();
9519
- result.source_snapshot_id = snapshotId;
9520
- result.release_sandbox_id = release.id;
9521
- if (cleanupErrorMessage !== void 0) {
9522
- result.release_cleanup_error = cleanupErrorMessage;
9523
- }
9524
- return result;
9525
- }
9526
8690
  /** Check readiness of the sandbox (GET /sandboxes/:id/readiness). */
9527
8691
  async readiness() {
9528
- return unwrap48(
8692
+ return unwrap46(
9529
8693
  await this.http.get(
9530
8694
  `/sandboxes/${this.id}/readiness`
9531
8695
  )
@@ -9552,40 +8716,19 @@ var Sandbox = class _Sandbox {
9552
8716
  const stream = options.stream ?? true;
9553
8717
  if (stream) {
9554
8718
  const sseResult = await this.tryReadinessStream(timeout);
9555
- if (sseResult !== null) {
9556
- if (sseResult) await this.adoptReadyState();
9557
- return sseResult;
9558
- }
8719
+ if (sseResult !== null) return sseResult;
9559
8720
  }
9560
8721
  const deadlineMs = Date.now() + timeout * 1e3;
9561
8722
  while (Date.now() < deadlineMs) {
9562
8723
  try {
9563
8724
  const data = await this.readiness();
9564
- if (data.ready === true || data.status === "ready") {
9565
- await this.adoptReadyState();
9566
- return true;
9567
- }
8725
+ if (data.ready === true || data.status === "ready") return true;
9568
8726
  } catch {
9569
8727
  }
9570
8728
  await new Promise((resolve) => setTimeout(resolve, 10));
9571
8729
  }
9572
8730
  return false;
9573
8731
  }
9574
- /**
9575
- * Readiness answers from the server; `assertRunning` reads the local
9576
- * snapshot. Leaving that snapshot behind meant a caller could await
9577
- * `waitUntilReady()`, receive `true`, and have the very next call refused
9578
- * for being "provisioning" — the sandbox was running the whole time, only
9579
- * this object had not been told. Nothing here can fail the wait: readiness
9580
- * has already answered, so a refresh that does not land is not the caller's
9581
- * problem.
9582
- */
9583
- async adoptReadyState() {
9584
- try {
9585
- await this.refresh();
9586
- } catch {
9587
- }
9588
- }
9589
8732
  /**
9590
8733
  * Returns `true` / `false` for terminal SSE events, or `null` if the
9591
8734
  * stream endpoint is unavailable (404 or transport error) so callers
@@ -9714,7 +8857,7 @@ var Sandboxes = class {
9714
8857
  if (idempotencyKey11) {
9715
8858
  requestOptions.headers = { "Idempotency-Key": idempotencyKey11 };
9716
8859
  }
9717
- const data = unwrap48(
8860
+ const data = unwrap46(
9718
8861
  await this.http.request(
9719
8862
  "/sandboxes",
9720
8863
  requestOptions
@@ -9733,7 +8876,7 @@ var Sandboxes = class {
9733
8876
  return listItems11(data).map((item) => new Sandbox(this.http, item));
9734
8877
  }
9735
8878
  async get(id) {
9736
- const data = unwrap48(
8879
+ const data = unwrap46(
9737
8880
  await this.http.get(`/sandboxes/${id}`)
9738
8881
  );
9739
8882
  return new Sandbox(this.http, data);
@@ -9761,7 +8904,7 @@ var Sandboxes = class {
9761
8904
  return this.get(id);
9762
8905
  }
9763
8906
  async getByName(name) {
9764
- const data = unwrap48(
8907
+ const data = unwrap46(
9765
8908
  await this.http.get(
9766
8909
  `/sandboxes/by-name/${encodeURIComponent(name)}`
9767
8910
  )
@@ -9808,7 +8951,7 @@ var Sandboxes = class {
9808
8951
  );
9809
8952
  }
9810
8953
  async validateBuildSpec(buildSpec) {
9811
- return unwrap48(
8954
+ return unwrap46(
9812
8955
  await this.http.post(
9813
8956
  "/sandbox-templates/validate",
9814
8957
  {
@@ -9828,7 +8971,7 @@ var Sandboxes = class {
9828
8971
  metadata: params.metadata
9829
8972
  })
9830
8973
  );
9831
- return unwrap48(response);
8974
+ return unwrap46(response);
9832
8975
  }
9833
8976
  async createTemplateBuild(templateId, params = {}) {
9834
8977
  const response = await this.http.post(
@@ -9838,19 +8981,19 @@ var Sandboxes = class {
9838
8981
  metadata: params.metadata
9839
8982
  })
9840
8983
  );
9841
- return unwrap48(response);
8984
+ return unwrap46(response);
9842
8985
  }
9843
8986
  async listTemplateBuilds(templateId) {
9844
8987
  const response = await this.http.get(
9845
8988
  `/sandbox-templates/${templateId}/builds`
9846
8989
  );
9847
- return unwrap48(response);
8990
+ return unwrap46(response);
9848
8991
  }
9849
8992
  async getTemplateBuild(buildId) {
9850
8993
  const response = await this.http.get(
9851
8994
  `/sandbox-template-builds/${buildId}`
9852
8995
  );
9853
- return unwrap48(response);
8996
+ return unwrap46(response);
9854
8997
  }
9855
8998
  };
9856
8999
  function toBase642(bytes) {
@@ -9882,7 +9025,7 @@ function previewInfoFromResponse(response) {
9882
9025
  )
9883
9026
  };
9884
9027
  }
9885
- function unwrap49(payload) {
9028
+ function unwrap47(payload) {
9886
9029
  if (payload && typeof payload === "object" && "data" in payload) {
9887
9030
  return payload.data;
9888
9031
  }
@@ -9925,7 +9068,7 @@ var SandboxTemplates = class {
9925
9068
  const data = await this.http.get(
9926
9069
  `/sandbox-templates/${templateId}`
9927
9070
  );
9928
- return unwrap49(data);
9071
+ return unwrap47(data);
9929
9072
  }
9930
9073
  async create(params) {
9931
9074
  const {
@@ -9945,7 +9088,7 @@ var SandboxTemplates = class {
9945
9088
  body: body5,
9946
9089
  headers: { "Idempotency-Key": idempotencyKey8(ikey) }
9947
9090
  });
9948
- return unwrap49(data);
9091
+ return unwrap47(data);
9949
9092
  }
9950
9093
  async buildSpecSchema() {
9951
9094
  const data = await this.http.get("/sandbox-templates/build-spec");
@@ -9978,12 +9121,12 @@ var SandboxTemplates = class {
9978
9121
  headers: { "Idempotency-Key": idempotencyKey8(ikey) }
9979
9122
  }
9980
9123
  );
9981
- return unwrap49(data);
9124
+ return unwrap47(data);
9982
9125
  }
9983
9126
  };
9984
9127
 
9985
9128
  // src/resources/settings.ts
9986
- function unwrap50(payload) {
9129
+ function unwrap48(payload) {
9987
9130
  if (payload && typeof payload === "object") {
9988
9131
  const p = payload;
9989
9132
  for (const k of [
@@ -9999,7 +9142,7 @@ function unwrap50(payload) {
9999
9142
  return payload;
10000
9143
  }
10001
9144
  function listItems13(payload) {
10002
- const result = unwrap50(payload);
9145
+ const result = unwrap48(payload);
10003
9146
  if (Array.isArray(result)) return result;
10004
9147
  return [];
10005
9148
  }
@@ -10016,46 +9159,46 @@ var Settings = class {
10016
9159
  /** Get the current tenant settings. */
10017
9160
  async get() {
10018
9161
  const data = await this.http.get("/settings");
10019
- return unwrap50(data);
9162
+ return unwrap48(data);
10020
9163
  }
10021
9164
  /** Update tenant settings. */
10022
9165
  async update(params) {
10023
9166
  const body5 = stripUndefined28(params);
10024
9167
  const data = await this.http.put("/settings", body5);
10025
- return unwrap50(data);
9168
+ return unwrap48(data);
10026
9169
  }
10027
9170
  // ── Branding ──────────────────────────────────────────────────────────────
10028
9171
  /** Get tenant branding (logo, colors, custom wordmark). */
10029
9172
  async getBranding() {
10030
9173
  const data = await this.http.get("/settings/branding");
10031
- return unwrap50(data);
9174
+ return unwrap48(data);
10032
9175
  }
10033
9176
  /** Update tenant branding. */
10034
9177
  async updateBranding(params) {
10035
9178
  const body5 = stripUndefined28(params);
10036
9179
  const data = await this.http.put("/settings/branding", body5);
10037
- return unwrap50(data);
9180
+ return unwrap48(data);
10038
9181
  }
10039
9182
  // ── Read-only reference data ───────────────────────────────────────────────
10040
9183
  /** Get tenant-scoped compute pricing. */
10041
9184
  async computePricing() {
10042
9185
  const data = await this.http.get("/settings/compute-pricing");
10043
- return unwrap50(data);
9186
+ return unwrap48(data);
10044
9187
  }
10045
9188
  /** Get tenant-scoped GPU pricing. */
10046
9189
  async gpuPricing() {
10047
9190
  const data = await this.http.get("/settings/gpu-pricing");
10048
- return unwrap50(data);
9191
+ return unwrap48(data);
10049
9192
  }
10050
9193
  /** List models available to this tenant. */
10051
9194
  async availableModels() {
10052
9195
  const data = await this.http.get("/settings/available-models");
10053
- return unwrap50(data);
9196
+ return unwrap48(data);
10054
9197
  }
10055
9198
  /** List regions enabled for this tenant. */
10056
9199
  async regions() {
10057
9200
  const data = await this.http.get("/settings/regions");
10058
- return unwrap50(data);
9201
+ return unwrap48(data);
10059
9202
  }
10060
9203
  // ── BYOK provider keys ────────────────────────────────────────────────────
10061
9204
  /** List tenant-level BYOK provider keys (Anthropic, OpenAI, etc.). */
@@ -10070,7 +9213,7 @@ var Settings = class {
10070
9213
  `/settings/provider-keys/${provider}`,
10071
9214
  body5
10072
9215
  );
10073
- return unwrap50(data);
9216
+ return unwrap48(data);
10074
9217
  }
10075
9218
  /** Delete a BYOK provider key. */
10076
9219
  async deleteProviderKey(provider) {
@@ -10079,7 +9222,7 @@ var Settings = class {
10079
9222
  };
10080
9223
 
10081
9224
  // src/resources/snapshots-standalone.ts
10082
- function unwrap51(data) {
9225
+ function unwrap49(data) {
10083
9226
  if (data && typeof data === "object") {
10084
9227
  const d = data;
10085
9228
  for (const k of ["data", "snapshots", "items"]) {
@@ -10110,14 +9253,14 @@ var SnapshotsStandalone = class {
10110
9253
  return unwrapList14(await this.http.get("/admin/snapshots", query3));
10111
9254
  }
10112
9255
  async get(snapshotId) {
10113
- return unwrap51(
9256
+ return unwrap49(
10114
9257
  await this.http.get(`/admin/snapshots/${snapshotId}`)
10115
9258
  );
10116
9259
  }
10117
9260
  };
10118
9261
 
10119
9262
  // src/resources/storage.ts
10120
- function unwrap52(payload) {
9263
+ function unwrap50(payload) {
10121
9264
  if (payload && typeof payload === "object" && "data" in payload) {
10122
9265
  return payload.data;
10123
9266
  }
@@ -10156,11 +9299,11 @@ var Storage = class {
10156
9299
  ...rest
10157
9300
  });
10158
9301
  const data = await this.http.post("/storage/buckets", body5);
10159
- return unwrap52(data);
9302
+ return unwrap50(data);
10160
9303
  }
10161
9304
  async getBucket(bucketId) {
10162
9305
  const data = await this.http.get(`/storage/buckets/${bucketId}`);
10163
- return unwrap52(data);
9306
+ return unwrap50(data);
10164
9307
  }
10165
9308
  async deleteBucket(bucketId) {
10166
9309
  await this.http.delete(`/storage/buckets/${bucketId}`);
@@ -10210,7 +9353,7 @@ var Storage = class {
10210
9353
  `/storage/buckets/${bucketId}/presign`,
10211
9354
  body5
10212
9355
  );
10213
- return unwrap52(data);
9356
+ return unwrap50(data);
10214
9357
  }
10215
9358
  };
10216
9359
 
@@ -10350,7 +9493,7 @@ var Organizations = class {
10350
9493
  };
10351
9494
 
10352
9495
  // src/resources/tenant.ts
10353
- function unwrap53(payload) {
9496
+ function unwrap51(payload) {
10354
9497
  if (payload && typeof payload === "object") {
10355
9498
  const p = payload;
10356
9499
  for (const k of ["data", "tenant", "branding", "items"]) {
@@ -10372,14 +9515,14 @@ var PreviewDomain = class {
10372
9515
  /** Get the tenant's white-label preview domain settings. */
10373
9516
  async get() {
10374
9517
  const data = await this.http.get("/tenant/preview-domain");
10375
- return unwrap53(data);
9518
+ return unwrap51(data);
10376
9519
  }
10377
9520
  /** Set the tenant's white-label preview domain. */
10378
9521
  async set(domain) {
10379
9522
  const data = await this.http.put("/tenant/preview-domain", {
10380
9523
  preview_domain: domain
10381
9524
  });
10382
- return unwrap53(data);
9525
+ return unwrap51(data);
10383
9526
  }
10384
9527
  /** Re-run DNS verification for the configured preview domain. */
10385
9528
  async verify() {
@@ -10387,7 +9530,7 @@ var PreviewDomain = class {
10387
9530
  "/tenant/preview-domain/verify",
10388
9531
  {}
10389
9532
  );
10390
- return unwrap53(data);
9533
+ return unwrap51(data);
10391
9534
  }
10392
9535
  /** Remove the tenant's custom preview domain. */
10393
9536
  async delete() {
@@ -10402,14 +9545,14 @@ var Branding = class {
10402
9545
  /** Get tenant branding used by white-label hosted surfaces. */
10403
9546
  async get() {
10404
9547
  const data = await this.http.get("/tenant/branding");
10405
- return unwrap53(data);
9548
+ return unwrap51(data);
10406
9549
  }
10407
9550
  /** Update tenant branding used by white-label hosted surfaces. */
10408
9551
  async set(params) {
10409
9552
  const data = await this.http.put("/tenant/branding", {
10410
9553
  branding: stripUndefined30(params)
10411
9554
  });
10412
- return unwrap53(data);
9555
+ return unwrap51(data);
10413
9556
  }
10414
9557
  /** Reset tenant branding to platform defaults. */
10415
9558
  async delete() {
@@ -10431,7 +9574,7 @@ var Tenant = class {
10431
9574
  /** Get the current tenant's plan, limits, and live usage counters. */
10432
9575
  async current() {
10433
9576
  const data = await this.http.get("/tenant/plan");
10434
- return unwrap53(data);
9577
+ return unwrap51(data);
10435
9578
  }
10436
9579
  /** Convenience alias for `tenant.branding.get()`. */
10437
9580
  async getBranding() {
@@ -10492,7 +9635,7 @@ var Templates = class {
10492
9635
  };
10493
9636
 
10494
9637
  // src/resources/usage.ts
10495
- function unwrap54(payload) {
9638
+ function unwrap52(payload) {
10496
9639
  if (payload && typeof payload === "object") {
10497
9640
  const p = payload;
10498
9641
  for (const k of ["data", "usage", "sessions", "summary", "items"]) {
@@ -10514,13 +9657,13 @@ var Usage = class {
10514
9657
  /** Get the current period usage summary. */
10515
9658
  async current() {
10516
9659
  const data = await this.http.get("/usage/summary");
10517
- return unwrap54(data);
9660
+ return unwrap52(data);
10518
9661
  }
10519
9662
  /** List per-session metering events. */
10520
9663
  async sessions(params = {}) {
10521
9664
  const query3 = stripUndefined31(params);
10522
9665
  const data = await this.http.get("/usage/sessions", query3);
10523
- const result = unwrap54(data);
9666
+ const result = unwrap52(data);
10524
9667
  if (Array.isArray(result)) return result;
10525
9668
  return [];
10526
9669
  }
@@ -10528,10 +9671,10 @@ var Usage = class {
10528
9671
  async report(params = {}) {
10529
9672
  const query3 = stripUndefined31(params);
10530
9673
  const data = await this.http.get("/usage/summary", query3);
10531
- return unwrap54(data);
9674
+ return unwrap52(data);
10532
9675
  }
10533
9676
  };
10534
- function unwrap55(payload) {
9677
+ function unwrap53(payload) {
10535
9678
  if (payload && typeof payload === "object" && "data" in payload) {
10536
9679
  return payload.data;
10537
9680
  }
@@ -10567,7 +9710,7 @@ var Volumes = class {
10567
9710
  }
10568
9711
  async get(volumeId) {
10569
9712
  const data = await this.http.get(`/volumes/${volumeId}`);
10570
- return unwrap55(data);
9713
+ return unwrap53(data);
10571
9714
  }
10572
9715
  async create(params) {
10573
9716
  const { idempotencyKey: ikey, sizeGb, ...rest } = params;
@@ -10580,7 +9723,7 @@ var Volumes = class {
10580
9723
  body: body5,
10581
9724
  headers: { "Idempotency-Key": idempotencyKey9(ikey) }
10582
9725
  });
10583
- return unwrap55(data);
9726
+ return unwrap53(data);
10584
9727
  }
10585
9728
  async delete(volumeId) {
10586
9729
  await this.http.delete(`/volumes/${volumeId}`);
@@ -10611,7 +9754,7 @@ var Volumes = class {
10611
9754
  `/computers/${computerId}/volumes`,
10612
9755
  body5
10613
9756
  );
10614
- return unwrap55(data);
9757
+ return unwrap53(data);
10615
9758
  }
10616
9759
  async detach(computerId, attachmentId) {
10617
9760
  await this.http.delete(
@@ -10619,7 +9762,7 @@ var Volumes = class {
10619
9762
  );
10620
9763
  }
10621
9764
  };
10622
- function unwrap56(payload) {
9765
+ function unwrap54(payload) {
10623
9766
  if (payload && typeof payload === "object" && "data" in payload) {
10624
9767
  return payload.data;
10625
9768
  }
@@ -10686,7 +9829,7 @@ var Webhooks = class {
10686
9829
  }
10687
9830
  async get(webhookId) {
10688
9831
  const data = await this.http.get(`/webhooks/${webhookId}`);
10689
- return unwrap56(data);
9832
+ return unwrap54(data);
10690
9833
  }
10691
9834
  async create(params) {
10692
9835
  const { idempotencyKey: ikey, ...rest } = params;
@@ -10696,12 +9839,12 @@ var Webhooks = class {
10696
9839
  body: body5,
10697
9840
  headers: { "Idempotency-Key": idempotencyKey10(ikey) }
10698
9841
  });
10699
- return unwrap56(data);
9842
+ return unwrap54(data);
10700
9843
  }
10701
9844
  async update(webhookId, params) {
10702
9845
  const body5 = stripUndefined33(params);
10703
9846
  const data = await this.http.patch(`/webhooks/${webhookId}`, body5);
10704
- return unwrap56(data);
9847
+ return unwrap54(data);
10705
9848
  }
10706
9849
  async delete(webhookId) {
10707
9850
  await this.http.delete(`/webhooks/${webhookId}`);
@@ -10714,7 +9857,7 @@ var Webhooks = class {
10714
9857
  headers: { "Idempotency-Key": idempotencyKey10(opts.idempotencyKey) }
10715
9858
  }
10716
9859
  );
10717
- return unwrap56(data);
9860
+ return unwrap54(data);
10718
9861
  }
10719
9862
  async deliveries(webhookId) {
10720
9863
  const data = await this.http.get(
@@ -10897,7 +10040,6 @@ var Miosa = class {
10897
10040
  orgInvites;
10898
10041
  /** Organizations available to the user session, membership, invites, and switching. */
10899
10042
  organizations;
10900
- forge;
10901
10043
  /** Current tenant plan, limits, and live usage counters. */
10902
10044
  tenant;
10903
10045
  /** Datacenter regions, compute sizes, pricing, community templates. */
@@ -10922,8 +10064,6 @@ var Miosa = class {
10922
10064
  projectIntegrations;
10923
10065
  /** Built-in auth for generated apps inside sandboxes/deployments. */
10924
10066
  projectAuth;
10925
- /** Durable generated App Documents, exact-version reviews, and publication bindings. */
10926
- appDocuments;
10927
10067
  /** BYOK encrypted per-user provider keys. */
10928
10068
  externalKeys;
10929
10069
  /** Model Context Protocol — JSON-RPC dispatch + streaming channel. */
@@ -10938,8 +10078,6 @@ var Miosa = class {
10938
10078
  agentRunGroups;
10939
10079
  /** Agent runtime profiles — tenant/workspace defaults for sandbox/computer agents. */
10940
10080
  agentRuntimeProfiles;
10941
- /** Persisted workspace Agent definitions and immutable versions. */
10942
- agents;
10943
10081
  /** MIOSA Connect — provider connectors and runtime tokens. */
10944
10082
  connectors;
10945
10083
  /** Inherited runtime env — tenant/workspace/project defaults for agent runtimes. */
@@ -11045,7 +10183,6 @@ var Miosa = class {
11045
10183
  this.workspaceInvites = new WorkspaceInvites(this.http);
11046
10184
  this.orgInvites = new OrgInvites(this.http);
11047
10185
  this.organizations = new Organizations(this.http);
11048
- this.forge = new Forge(this.http);
11049
10186
  this.tenant = new Tenant(this.http);
11050
10187
  this.regions = new Regions(this.http);
11051
10188
  this.settings = new Settings(this.http);
@@ -11058,7 +10195,6 @@ var Miosa = class {
11058
10195
  this.integrations = new Integrations(this.http);
11059
10196
  this.projectIntegrations = new ProjectIntegrations(this.http);
11060
10197
  this.projectAuth = new ProjectAuth(this.http);
11061
- this.appDocuments = new AppDocuments(this.http);
11062
10198
  this.externalKeys = new ExternalKeys(this.http);
11063
10199
  this.mcp = new Mcp(this.http);
11064
10200
  this.runs = new Runs(this.http);
@@ -11066,7 +10202,6 @@ var Miosa = class {
11066
10202
  this.agentRuns = new AgentRuns(this.http);
11067
10203
  this.agentRunGroups = new AgentRunGroups(this.http);
11068
10204
  this.agentRuntimeProfiles = new AgentRuntimeProfiles(this.http);
11069
- this.agents = new AgentDefinitions(this.http);
11070
10205
  this.connectors = new Connectors(this.http);
11071
10206
  this.runtimeEnv = new RuntimeEnv(this.http);
11072
10207
  this.runtimeCapabilities = new RuntimeCapabilitiesResource(this.http);
@@ -11593,6 +10728,6 @@ var AppAuth = class {
11593
10728
  }
11594
10729
  };
11595
10730
 
11596
- export { AGENT_BUILD_KIND_SPECS, Admin, AgentDefinitions, AgentRuntimeProfiles, Analytics, ApiKeys, AppAuth, AppDocuments, AuditLog, AuthError, Benchmarks, BuilderSessions, Channels, Checkpoints, Cloud, CommandCenter, Community, Completions, Computer, ComputerAudit, ComputerAutoStop, ComputerConnectors, ComputerEnv, ComputerInbox, ComputerLogs, ComputerNetwork, ComputerOsa, ComputerPorts, ComputerSecrets, ComputerTerminal, ComputerVolumes, Computers, Connectors, Credits, CronJobs, DEFAULT_AGENT_BUILD_OUTPUT_ROOT, DEFAULT_AGENT_BUILD_PACKET_VERSION, Dashboard, Databases, DeploymentConnectors, DeploymentDomains, DeploymentReleases, DeploymentRuntimeInstances, DeploymentVersions, Deployments, Desktop, Devices, DockerDeploy, EgressAudit, EgressHostNotAllowedError, EgressNetwork, EgressSecrets, Email, EmailCampaigns, EmailInbox, EmailTemplates, Embeddings, Exec, ExternalKeys, Files, FlatCustomDomains, Forge, ForgeContractError, ForgePolicyViolationError, ForgeRepositories, ForgeStorageError, ForgeUnavailableError, Functions, HealthChecks, InstallationRequiredError, InsufficientCreditsError, Integrations, ManagedProviderBindingOnlyError, Mcp, Miosa, MiosaError, Models, NetworkError, NetworkPolicy, NotFoundError, OAuthFlow, OpenComputers, OrgInvites, OrganizationMembers, Organizations, ProjectAuth, ProjectIntegrations, ProjectNotLinkedError, ProviderDefaults, RateLimitError, Regions, RunGroups, Runs, RuntimeCapabilitiesResource, RuntimeEnv, SANDBOX_TEMPLATE, Sandbox, SandboxAudit, SandboxCommands, SandboxConnectors, SandboxEnv, SandboxEvents, SandboxFiles, SandboxNetwork, SandboxPreview, SandboxPreviews, SandboxSecrets, SandboxTags, SandboxTemplates, SandboxTerminal, Sandboxes, ScopeNotAllowedError, ScopedFs, Settings, SnapshotsStandalone, Storage, SubjectNotAllowedError, Templates, Tenant, TimeoutError, TokenRefreshFailedError, Usage, UserAuthorizationRequiredError, ValidationError, Volumes, Webhooks, WorkspaceInvites, WorkspaceMembers, createAgentBuildExecutionPacket, createAgentBuildExpectedOutputs, createAgentBuildPrompt, createBuildRunParams, getAgentBuildKindSpec, resolveAgentBuildKind, verifySignature };
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 };
11597
10732
  //# sourceMappingURL=index.js.map
11598
10733
  //# sourceMappingURL=index.js.map