@miosa/sdk 1.2.18 → 1.2.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -1
- package/dist/index.d.ts +378 -3
- package/dist/index.js +970 -425
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -217,10 +217,10 @@ var HttpClient = class {
|
|
|
217
217
|
this.timeout = config.timeout ?? DEFAULT_TIMEOUT;
|
|
218
218
|
this.maxRetries = config.maxRetries ?? DEFAULT_MAX_RETRIES;
|
|
219
219
|
}
|
|
220
|
-
buildUrl(path,
|
|
220
|
+
buildUrl(path, query3) {
|
|
221
221
|
const url = new URL(`${this.baseUrl}${path}`);
|
|
222
|
-
if (
|
|
223
|
-
for (const [key, value] of Object.entries(
|
|
222
|
+
if (query3) {
|
|
223
|
+
for (const [key, value] of Object.entries(query3)) {
|
|
224
224
|
if (value !== void 0) {
|
|
225
225
|
url.searchParams.set(key, String(value));
|
|
226
226
|
}
|
|
@@ -320,11 +320,11 @@ var HttpClient = class {
|
|
|
320
320
|
}
|
|
321
321
|
throw lastError ?? new MiosaError("Max retries exceeded", 0, "MAX_RETRIES_EXCEEDED");
|
|
322
322
|
}
|
|
323
|
-
async get(path,
|
|
323
|
+
async get(path, query3) {
|
|
324
324
|
let fullPath = path;
|
|
325
|
-
if (
|
|
325
|
+
if (query3) {
|
|
326
326
|
const params = new URLSearchParams();
|
|
327
|
-
for (const [k, v] of Object.entries(
|
|
327
|
+
for (const [k, v] of Object.entries(query3)) {
|
|
328
328
|
if (v !== void 0 && v !== null) params.set(k, String(v));
|
|
329
329
|
}
|
|
330
330
|
const qs = params.toString();
|
|
@@ -440,10 +440,10 @@ var Admin = class {
|
|
|
440
440
|
this.http = http;
|
|
441
441
|
}
|
|
442
442
|
/** Escape hatch — call any admin endpoint by method + path. */
|
|
443
|
-
async request(method, path, body4,
|
|
444
|
-
const fullPath =
|
|
443
|
+
async request(method, path, body4, query3) {
|
|
444
|
+
const fullPath = query3 ? (() => {
|
|
445
445
|
const qs = new URLSearchParams();
|
|
446
|
-
for (const [k, v] of Object.entries(
|
|
446
|
+
for (const [k, v] of Object.entries(query3)) {
|
|
447
447
|
if (v !== void 0) qs.set(k, String(v));
|
|
448
448
|
}
|
|
449
449
|
const s = qs.toString();
|
|
@@ -761,9 +761,9 @@ var AgentRunGroups = class {
|
|
|
761
761
|
);
|
|
762
762
|
}
|
|
763
763
|
async get(id, options = {}) {
|
|
764
|
-
const
|
|
764
|
+
const query3 = options.includeRuns ? "?include=runs" : "";
|
|
765
765
|
return unwrap(
|
|
766
|
-
await this.http.get(`/agent-run-groups/${encodeURIComponent(id)}${
|
|
766
|
+
await this.http.get(`/agent-run-groups/${encodeURIComponent(id)}${query3}`)
|
|
767
767
|
);
|
|
768
768
|
}
|
|
769
769
|
async dispatch(id, runs, options = {}) {
|
|
@@ -994,11 +994,11 @@ var AgentRuns = class {
|
|
|
994
994
|
return data.artifacts ?? data.items ?? [];
|
|
995
995
|
}
|
|
996
996
|
async downloadArtifact(id, artifactId, options = {}) {
|
|
997
|
-
const
|
|
997
|
+
const query3 = options.inline ? "?disposition=inline" : "";
|
|
998
998
|
return this.http.getBinary(
|
|
999
999
|
`/agent-runs/${encodeURIComponent(id)}/artifacts/${encodeURIComponent(
|
|
1000
1000
|
artifactId
|
|
1001
|
-
)}/download${
|
|
1001
|
+
)}/download${query3}`
|
|
1002
1002
|
);
|
|
1003
1003
|
}
|
|
1004
1004
|
async events(id) {
|
|
@@ -1096,14 +1096,14 @@ var Analytics = class {
|
|
|
1096
1096
|
http;
|
|
1097
1097
|
/** Get the platform analytics overview. */
|
|
1098
1098
|
async overview(filters = {}) {
|
|
1099
|
-
const
|
|
1100
|
-
const data = await this.http.get("/analytics/overview",
|
|
1099
|
+
const query3 = stripUndefined3(filters);
|
|
1100
|
+
const data = await this.http.get("/analytics/overview", query3);
|
|
1101
1101
|
return unwrap4(data);
|
|
1102
1102
|
}
|
|
1103
1103
|
/** Get a timeseries for a metric over a period. */
|
|
1104
1104
|
async timeseries(params = {}) {
|
|
1105
|
-
const
|
|
1106
|
-
const data = await this.http.get("/analytics/timeseries",
|
|
1105
|
+
const query3 = stripUndefined3(params);
|
|
1106
|
+
const data = await this.http.get("/analytics/timeseries", query3);
|
|
1107
1107
|
return unwrap4(data);
|
|
1108
1108
|
}
|
|
1109
1109
|
};
|
|
@@ -1137,8 +1137,8 @@ var ApiKeys = class {
|
|
|
1137
1137
|
}
|
|
1138
1138
|
http;
|
|
1139
1139
|
async list(params = {}) {
|
|
1140
|
-
const
|
|
1141
|
-
const data = await this.http.get("/api-keys",
|
|
1140
|
+
const query3 = stripUndefined4({ ...params });
|
|
1141
|
+
const data = await this.http.get("/api-keys", query3);
|
|
1142
1142
|
return listItems(data);
|
|
1143
1143
|
}
|
|
1144
1144
|
async create(params) {
|
|
@@ -1192,8 +1192,8 @@ var AuditLog = class {
|
|
|
1192
1192
|
http;
|
|
1193
1193
|
/** List audit-log events with optional filters. */
|
|
1194
1194
|
async list(params = {}) {
|
|
1195
|
-
const
|
|
1196
|
-
const data = await this.http.get("/audit-log",
|
|
1195
|
+
const query3 = stripUndefined5(params);
|
|
1196
|
+
const data = await this.http.get("/audit-log", query3);
|
|
1197
1197
|
const result = unwrap6(data);
|
|
1198
1198
|
if (Array.isArray(result)) return result;
|
|
1199
1199
|
return [];
|
|
@@ -1226,10 +1226,10 @@ var Benchmarks = class {
|
|
|
1226
1226
|
}
|
|
1227
1227
|
http;
|
|
1228
1228
|
async list(filters = {}) {
|
|
1229
|
-
const
|
|
1229
|
+
const query3 = Object.fromEntries(
|
|
1230
1230
|
Object.entries(filters).filter(([, v]) => v !== void 0)
|
|
1231
1231
|
);
|
|
1232
|
-
const data = await this.http.get("/admin/benchmarks",
|
|
1232
|
+
const data = await this.http.get("/admin/benchmarks", query3);
|
|
1233
1233
|
return unwrapList(data);
|
|
1234
1234
|
}
|
|
1235
1235
|
async get(benchmarkId) {
|
|
@@ -1251,12 +1251,12 @@ var Benchmarks = class {
|
|
|
1251
1251
|
}
|
|
1252
1252
|
/** Return per-iteration timing samples for a benchmark run. */
|
|
1253
1253
|
async samples(benchmarkId, filters = {}) {
|
|
1254
|
-
const
|
|
1254
|
+
const query3 = Object.fromEntries(
|
|
1255
1255
|
Object.entries(filters).filter(([, v]) => v !== void 0)
|
|
1256
1256
|
);
|
|
1257
1257
|
const data = await this.http.get(
|
|
1258
1258
|
`/admin/benchmarks/${benchmarkId}/samples`,
|
|
1259
|
-
|
|
1259
|
+
query3
|
|
1260
1260
|
);
|
|
1261
1261
|
return unwrapList(data);
|
|
1262
1262
|
}
|
|
@@ -1297,8 +1297,8 @@ var BuilderSessions = class {
|
|
|
1297
1297
|
}
|
|
1298
1298
|
http;
|
|
1299
1299
|
async list(params = {}) {
|
|
1300
|
-
const
|
|
1301
|
-
return unwrapList2(await this.http.get("/builder/sessions",
|
|
1300
|
+
const query3 = { limit: 50, ...params };
|
|
1301
|
+
return unwrapList2(await this.http.get("/builder/sessions", query3));
|
|
1302
1302
|
}
|
|
1303
1303
|
/**
|
|
1304
1304
|
* Get a single session. The platform router only exposes index +
|
|
@@ -1347,8 +1347,8 @@ var Channels = class {
|
|
|
1347
1347
|
http;
|
|
1348
1348
|
/** List all channels for the tenant. */
|
|
1349
1349
|
async list(params = {}) {
|
|
1350
|
-
const
|
|
1351
|
-
const data = await this.http.get("/channels",
|
|
1350
|
+
const query3 = stripUndefined6(params);
|
|
1351
|
+
const data = await this.http.get("/channels", query3);
|
|
1352
1352
|
const result = unwrap9(data);
|
|
1353
1353
|
if (Array.isArray(result)) return result;
|
|
1354
1354
|
return [];
|
|
@@ -1400,8 +1400,154 @@ var Channels = class {
|
|
|
1400
1400
|
}
|
|
1401
1401
|
};
|
|
1402
1402
|
|
|
1403
|
+
// src/resources/cloud.ts
|
|
1404
|
+
function unwrap10(payload) {
|
|
1405
|
+
if (payload !== null && typeof payload === "object" && "data" in payload && payload.data !== void 0) {
|
|
1406
|
+
return payload.data;
|
|
1407
|
+
}
|
|
1408
|
+
return payload;
|
|
1409
|
+
}
|
|
1410
|
+
function stripUndefined7(input) {
|
|
1411
|
+
return Object.fromEntries(
|
|
1412
|
+
Object.entries(input).filter(([, value]) => value !== void 0)
|
|
1413
|
+
);
|
|
1414
|
+
}
|
|
1415
|
+
function accountBody(params) {
|
|
1416
|
+
return stripUndefined7({
|
|
1417
|
+
provider: params.provider,
|
|
1418
|
+
mode: params.mode,
|
|
1419
|
+
display_name: params.displayName ?? params.display_name,
|
|
1420
|
+
external_account_id: params.externalAccountId ?? params.external_account_id,
|
|
1421
|
+
credential_type: params.credentialType ?? params.credential_type,
|
|
1422
|
+
default_region: params.defaultRegion ?? params.default_region,
|
|
1423
|
+
metadata: params.metadata
|
|
1424
|
+
});
|
|
1425
|
+
}
|
|
1426
|
+
function regionBody(params) {
|
|
1427
|
+
return stripUndefined7({
|
|
1428
|
+
cloud_account_id: params.cloudAccountId ?? params.cloud_account_id,
|
|
1429
|
+
provider_region: params.providerRegion ?? params.provider_region,
|
|
1430
|
+
provider_zone: params.providerZone ?? params.provider_zone,
|
|
1431
|
+
display_name: params.displayName ?? params.display_name,
|
|
1432
|
+
guest_supernet: params.guestSupernet ?? params.guest_supernet,
|
|
1433
|
+
artifact_manifest_uri: params.artifactManifestUri ?? params.artifact_manifest_uri,
|
|
1434
|
+
network_ref: params.networkRef ?? params.network_ref,
|
|
1435
|
+
subnet_ref: params.subnetRef ?? params.subnet_ref,
|
|
1436
|
+
security_group_refs: params.securityGroupRefs ?? params.security_group_refs,
|
|
1437
|
+
instance_profile_ref: params.instanceProfileRef ?? params.instance_profile_ref,
|
|
1438
|
+
metadata: params.metadata
|
|
1439
|
+
});
|
|
1440
|
+
}
|
|
1441
|
+
function poolBody(params) {
|
|
1442
|
+
return stripUndefined7({
|
|
1443
|
+
cloud_region_id: params.cloudRegionId ?? params.cloud_region_id,
|
|
1444
|
+
pool_kind: params.poolKind ?? params.pool_kind,
|
|
1445
|
+
node_type: params.nodeType ?? params.node_type,
|
|
1446
|
+
instance_type: params.instanceType ?? params.instance_type,
|
|
1447
|
+
target_nodes: params.targetNodes ?? params.target_nodes,
|
|
1448
|
+
max_nodes: params.maxNodes ?? params.max_nodes,
|
|
1449
|
+
ttl_seconds: params.ttlSeconds ?? params.ttl_seconds,
|
|
1450
|
+
max_hourly_cents: params.maxHourlyCents ?? params.max_hourly_cents,
|
|
1451
|
+
placement_scope: params.placementScope ?? params.placement_scope,
|
|
1452
|
+
metadata: params.metadata
|
|
1453
|
+
});
|
|
1454
|
+
}
|
|
1455
|
+
function preflightBody(params) {
|
|
1456
|
+
return stripUndefined7({
|
|
1457
|
+
cloud_account_id: params.cloudAccountId ?? params.cloud_account_id,
|
|
1458
|
+
cloud_region_id: params.cloudRegionId ?? params.cloud_region_id,
|
|
1459
|
+
provider: params.provider,
|
|
1460
|
+
status: params.status,
|
|
1461
|
+
checks: params.checks,
|
|
1462
|
+
raw_report: params.rawReport ?? params.raw_report,
|
|
1463
|
+
metadata: params.metadata
|
|
1464
|
+
});
|
|
1465
|
+
}
|
|
1466
|
+
function query(params = {}) {
|
|
1467
|
+
return stripUndefined7({
|
|
1468
|
+
cloud_account_id: params.cloudAccountId ?? params.cloud_account_id,
|
|
1469
|
+
cloud_region_id: params.cloudRegionId ?? params.cloud_region_id,
|
|
1470
|
+
limit: params.limit
|
|
1471
|
+
});
|
|
1472
|
+
}
|
|
1473
|
+
var Cloud = class {
|
|
1474
|
+
constructor(http) {
|
|
1475
|
+
this.http = http;
|
|
1476
|
+
}
|
|
1477
|
+
http;
|
|
1478
|
+
async listAccounts() {
|
|
1479
|
+
return unwrap10(
|
|
1480
|
+
await this.http.get("/cloud/accounts")
|
|
1481
|
+
);
|
|
1482
|
+
}
|
|
1483
|
+
async createAccount(params) {
|
|
1484
|
+
return unwrap10(
|
|
1485
|
+
await this.http.post(
|
|
1486
|
+
"/cloud/accounts",
|
|
1487
|
+
accountBody(params)
|
|
1488
|
+
)
|
|
1489
|
+
);
|
|
1490
|
+
}
|
|
1491
|
+
async attachAwsRole(id, params) {
|
|
1492
|
+
return unwrap10(
|
|
1493
|
+
await this.http.post(
|
|
1494
|
+
`/cloud/accounts/${encodeURIComponent(id)}/aws/role`,
|
|
1495
|
+
stripUndefined7({
|
|
1496
|
+
role_arn: params.roleArn ?? params.role_arn,
|
|
1497
|
+
default_region: params.defaultRegion ?? params.default_region
|
|
1498
|
+
})
|
|
1499
|
+
)
|
|
1500
|
+
);
|
|
1501
|
+
}
|
|
1502
|
+
async listRegions(params = {}) {
|
|
1503
|
+
return unwrap10(
|
|
1504
|
+
await this.http.get(
|
|
1505
|
+
"/cloud/regions",
|
|
1506
|
+
query(params)
|
|
1507
|
+
)
|
|
1508
|
+
);
|
|
1509
|
+
}
|
|
1510
|
+
async createRegion(params) {
|
|
1511
|
+
return unwrap10(
|
|
1512
|
+
await this.http.post(
|
|
1513
|
+
"/cloud/regions",
|
|
1514
|
+
regionBody(params)
|
|
1515
|
+
)
|
|
1516
|
+
);
|
|
1517
|
+
}
|
|
1518
|
+
async listPools(params = {}) {
|
|
1519
|
+
return unwrap10(
|
|
1520
|
+
await this.http.get("/cloud/pools", query(params))
|
|
1521
|
+
);
|
|
1522
|
+
}
|
|
1523
|
+
async createPool(params) {
|
|
1524
|
+
return unwrap10(
|
|
1525
|
+
await this.http.post(
|
|
1526
|
+
"/cloud/pools",
|
|
1527
|
+
poolBody(params)
|
|
1528
|
+
)
|
|
1529
|
+
);
|
|
1530
|
+
}
|
|
1531
|
+
async listPreflights(params = {}) {
|
|
1532
|
+
return unwrap10(
|
|
1533
|
+
await this.http.get(
|
|
1534
|
+
"/cloud/preflights",
|
|
1535
|
+
query(params)
|
|
1536
|
+
)
|
|
1537
|
+
);
|
|
1538
|
+
}
|
|
1539
|
+
async recordPreflight(params) {
|
|
1540
|
+
return unwrap10(
|
|
1541
|
+
await this.http.post(
|
|
1542
|
+
"/cloud/preflights",
|
|
1543
|
+
preflightBody(params)
|
|
1544
|
+
)
|
|
1545
|
+
);
|
|
1546
|
+
}
|
|
1547
|
+
};
|
|
1548
|
+
|
|
1403
1549
|
// src/resources/command-center.ts
|
|
1404
|
-
function
|
|
1550
|
+
function unwrap11(data) {
|
|
1405
1551
|
if (data && typeof data === "object") {
|
|
1406
1552
|
const d = data;
|
|
1407
1553
|
for (const k of [
|
|
@@ -1435,7 +1581,7 @@ var CommandCenter = class {
|
|
|
1435
1581
|
http;
|
|
1436
1582
|
/** Top-level snapshot (GET /command-center). */
|
|
1437
1583
|
async overview() {
|
|
1438
|
-
return
|
|
1584
|
+
return unwrap11(await this.http.get("/command-center"));
|
|
1439
1585
|
}
|
|
1440
1586
|
async agents() {
|
|
1441
1587
|
return unwrapList3(await this.http.get("/command-center/agents"));
|
|
@@ -1446,13 +1592,13 @@ var CommandCenter = class {
|
|
|
1446
1592
|
);
|
|
1447
1593
|
}
|
|
1448
1594
|
async metrics() {
|
|
1449
|
-
return
|
|
1595
|
+
return unwrap11(await this.http.get("/command-center/metrics"));
|
|
1450
1596
|
}
|
|
1451
1597
|
async presets() {
|
|
1452
1598
|
return unwrapList3(await this.http.get("/command-center/presets"));
|
|
1453
1599
|
}
|
|
1454
1600
|
async tiers() {
|
|
1455
|
-
return
|
|
1601
|
+
return unwrap11(await this.http.get("/command-center/tiers"));
|
|
1456
1602
|
}
|
|
1457
1603
|
/** Stream live command-center events via SSE. */
|
|
1458
1604
|
events() {
|
|
@@ -1461,7 +1607,7 @@ var CommandCenter = class {
|
|
|
1461
1607
|
};
|
|
1462
1608
|
|
|
1463
1609
|
// src/resources/community.ts
|
|
1464
|
-
function
|
|
1610
|
+
function unwrap12(data) {
|
|
1465
1611
|
if (data && typeof data === "object") {
|
|
1466
1612
|
const d = data;
|
|
1467
1613
|
for (const k of ["data", "templates", "agents", "items"]) {
|
|
@@ -1487,25 +1633,25 @@ var Community = class {
|
|
|
1487
1633
|
http;
|
|
1488
1634
|
// ── Agents ────────────────────────────────────────────────────────────
|
|
1489
1635
|
async listAgents(filters = {}) {
|
|
1490
|
-
const
|
|
1636
|
+
const query3 = Object.fromEntries(
|
|
1491
1637
|
Object.entries(filters).filter(([, v]) => v !== void 0)
|
|
1492
1638
|
);
|
|
1493
|
-
return unwrapList4(await this.http.get("/community/agents",
|
|
1639
|
+
return unwrapList4(await this.http.get("/community/agents", query3));
|
|
1494
1640
|
}
|
|
1495
1641
|
async getAgent(agentId) {
|
|
1496
|
-
return
|
|
1642
|
+
return unwrap12(await this.http.get(`/community/agents/${agentId}`));
|
|
1497
1643
|
}
|
|
1498
1644
|
// ── Templates ─────────────────────────────────────────────────────────
|
|
1499
1645
|
async listTemplates(filters = {}) {
|
|
1500
|
-
const
|
|
1646
|
+
const query3 = Object.fromEntries(
|
|
1501
1647
|
Object.entries(filters).filter(([, v]) => v !== void 0)
|
|
1502
1648
|
);
|
|
1503
1649
|
return unwrapList4(
|
|
1504
|
-
await this.http.get("/community/templates",
|
|
1650
|
+
await this.http.get("/community/templates", query3)
|
|
1505
1651
|
);
|
|
1506
1652
|
}
|
|
1507
1653
|
async getTemplate(templateId) {
|
|
1508
|
-
return
|
|
1654
|
+
return unwrap12(
|
|
1509
1655
|
await this.http.get(`/community/templates/${templateId}`)
|
|
1510
1656
|
);
|
|
1511
1657
|
}
|
|
@@ -1514,7 +1660,7 @@ var Community = class {
|
|
|
1514
1660
|
const body4 = Object.fromEntries(
|
|
1515
1661
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
1516
1662
|
);
|
|
1517
|
-
return
|
|
1663
|
+
return unwrap12(
|
|
1518
1664
|
await this.http.post(
|
|
1519
1665
|
`/community/templates/${templateId}/install`,
|
|
1520
1666
|
body4
|
|
@@ -1529,7 +1675,7 @@ var Community = class {
|
|
|
1529
1675
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
1530
1676
|
)
|
|
1531
1677
|
};
|
|
1532
|
-
return
|
|
1678
|
+
return unwrap12(
|
|
1533
1679
|
await this.http.post(
|
|
1534
1680
|
`/community/templates/${templateId}/rate`,
|
|
1535
1681
|
body4
|
|
@@ -1539,7 +1685,7 @@ var Community = class {
|
|
|
1539
1685
|
};
|
|
1540
1686
|
|
|
1541
1687
|
// src/resources/completions.ts
|
|
1542
|
-
function
|
|
1688
|
+
function unwrap13(data) {
|
|
1543
1689
|
if (data && typeof data === "object") {
|
|
1544
1690
|
const d = data;
|
|
1545
1691
|
if (Array.isArray(d.choices)) return d;
|
|
@@ -1565,7 +1711,7 @@ var Completions = class {
|
|
|
1565
1711
|
{ method: "POST", body: body4 }
|
|
1566
1712
|
);
|
|
1567
1713
|
}
|
|
1568
|
-
return this.http.post("/intelligence/completions", body4).then(
|
|
1714
|
+
return this.http.post("/intelligence/completions", body4).then(unwrap13);
|
|
1569
1715
|
}
|
|
1570
1716
|
chat(params) {
|
|
1571
1717
|
const body4 = buildBody(params);
|
|
@@ -1575,7 +1721,7 @@ var Completions = class {
|
|
|
1575
1721
|
{ method: "POST", body: body4 }
|
|
1576
1722
|
);
|
|
1577
1723
|
}
|
|
1578
|
-
return this.http.post("/intelligence/chat/completions", body4).then(
|
|
1724
|
+
return this.http.post("/intelligence/chat/completions", body4).then(unwrap13);
|
|
1579
1725
|
}
|
|
1580
1726
|
};
|
|
1581
1727
|
|
|
@@ -1698,7 +1844,7 @@ var Checkpoints = class {
|
|
|
1698
1844
|
};
|
|
1699
1845
|
|
|
1700
1846
|
// src/resources/computer-auto-stop.ts
|
|
1701
|
-
function
|
|
1847
|
+
function unwrap14(data) {
|
|
1702
1848
|
if (data && typeof data === "object") {
|
|
1703
1849
|
const d = data;
|
|
1704
1850
|
if ("data" in d && Object.keys(d).length <= 2) {
|
|
@@ -1716,13 +1862,13 @@ var ComputerAutoStop = class {
|
|
|
1716
1862
|
computerId;
|
|
1717
1863
|
/** Return the current auto-stop configuration. */
|
|
1718
1864
|
async get() {
|
|
1719
|
-
return
|
|
1865
|
+
return unwrap14(
|
|
1720
1866
|
await this.http.get(`/computers/${this.computerId}/auto-stop`)
|
|
1721
1867
|
);
|
|
1722
1868
|
}
|
|
1723
1869
|
/** Set the idle timeout in seconds (0 disables auto-stop). */
|
|
1724
1870
|
async update(seconds) {
|
|
1725
|
-
return
|
|
1871
|
+
return unwrap14(
|
|
1726
1872
|
await this.http.patch(
|
|
1727
1873
|
`/computers/${this.computerId}/auto-stop`,
|
|
1728
1874
|
{ seconds }
|
|
@@ -1732,7 +1878,7 @@ var ComputerAutoStop = class {
|
|
|
1732
1878
|
};
|
|
1733
1879
|
|
|
1734
1880
|
// src/resources/computer-env.ts
|
|
1735
|
-
function
|
|
1881
|
+
function unwrap15(data) {
|
|
1736
1882
|
if (data && typeof data === "object") {
|
|
1737
1883
|
const d = data;
|
|
1738
1884
|
if ("data" in d && Object.keys(d).length <= 2) {
|
|
@@ -1767,11 +1913,11 @@ var ComputerEnv = class {
|
|
|
1767
1913
|
}
|
|
1768
1914
|
/** Create a new env var. Use update() to change an existing one. */
|
|
1769
1915
|
async set(name, value) {
|
|
1770
|
-
return
|
|
1916
|
+
return unwrap15(await this.http.post(this.base(), { name, value }));
|
|
1771
1917
|
}
|
|
1772
1918
|
/** Patch the value of an existing env var by name. */
|
|
1773
1919
|
async update(name, value) {
|
|
1774
|
-
return
|
|
1920
|
+
return unwrap15(
|
|
1775
1921
|
await this.http.patch(`${this.base()}/${name}`, { value })
|
|
1776
1922
|
);
|
|
1777
1923
|
}
|
|
@@ -1788,7 +1934,7 @@ var ComputerEnv = class {
|
|
|
1788
1934
|
};
|
|
1789
1935
|
|
|
1790
1936
|
// src/resources/computer-logs.ts
|
|
1791
|
-
function
|
|
1937
|
+
function unwrap16(data) {
|
|
1792
1938
|
if (data && typeof data === "object") {
|
|
1793
1939
|
const d = data;
|
|
1794
1940
|
if ("data" in d && Object.keys(d).length <= 2) {
|
|
@@ -1806,11 +1952,11 @@ var ComputerLogs = class {
|
|
|
1806
1952
|
computerId;
|
|
1807
1953
|
/** Fetch the most recent log snapshot. */
|
|
1808
1954
|
async get(params = {}) {
|
|
1809
|
-
const
|
|
1955
|
+
const query3 = Object.fromEntries(
|
|
1810
1956
|
Object.entries(params).filter(([, v]) => v !== void 0)
|
|
1811
1957
|
);
|
|
1812
|
-
return
|
|
1813
|
-
await this.http.get(`/computers/${this.computerId}/logs`,
|
|
1958
|
+
return unwrap16(
|
|
1959
|
+
await this.http.get(`/computers/${this.computerId}/logs`, query3)
|
|
1814
1960
|
);
|
|
1815
1961
|
}
|
|
1816
1962
|
/** Stream live log events as SSE dicts `{type, data, id}`. */
|
|
@@ -1822,7 +1968,7 @@ var ComputerLogs = class {
|
|
|
1822
1968
|
};
|
|
1823
1969
|
|
|
1824
1970
|
// src/resources/computer-osa.ts
|
|
1825
|
-
function
|
|
1971
|
+
function unwrap17(data) {
|
|
1826
1972
|
if (data && typeof data === "object") {
|
|
1827
1973
|
const d = data;
|
|
1828
1974
|
if ("data" in d && Object.keys(d).length <= 2) {
|
|
@@ -1846,7 +1992,7 @@ var ComputerOsa = class {
|
|
|
1846
1992
|
Object.entries(params).filter(([, v]) => v !== void 0)
|
|
1847
1993
|
)
|
|
1848
1994
|
};
|
|
1849
|
-
return
|
|
1995
|
+
return unwrap17(
|
|
1850
1996
|
await this.http.post(
|
|
1851
1997
|
`/computers/${this.computerId}/osa/task`,
|
|
1852
1998
|
body4
|
|
@@ -1855,13 +2001,13 @@ var ComputerOsa = class {
|
|
|
1855
2001
|
}
|
|
1856
2002
|
/** Cancel the currently-running OSA task, if any. */
|
|
1857
2003
|
async cancelTask() {
|
|
1858
|
-
return
|
|
2004
|
+
return unwrap17(
|
|
1859
2005
|
await this.http.delete(`/computers/${this.computerId}/osa/task`)
|
|
1860
2006
|
);
|
|
1861
2007
|
}
|
|
1862
2008
|
/** Return OSA's current task / configuration / health snapshot. */
|
|
1863
2009
|
async status() {
|
|
1864
|
-
return
|
|
2010
|
+
return unwrap17(
|
|
1865
2011
|
await this.http.get(`/computers/${this.computerId}/osa/status`)
|
|
1866
2012
|
);
|
|
1867
2013
|
}
|
|
@@ -1870,7 +2016,7 @@ var ComputerOsa = class {
|
|
|
1870
2016
|
const body4 = Object.fromEntries(
|
|
1871
2017
|
Object.entries(config).filter(([, v]) => v !== void 0)
|
|
1872
2018
|
);
|
|
1873
|
-
return
|
|
2019
|
+
return unwrap17(
|
|
1874
2020
|
await this.http.post(
|
|
1875
2021
|
`/computers/${this.computerId}/osa/configure`,
|
|
1876
2022
|
body4
|
|
@@ -1880,7 +2026,7 @@ var ComputerOsa = class {
|
|
|
1880
2026
|
};
|
|
1881
2027
|
|
|
1882
2028
|
// src/resources/computer-ports.ts
|
|
1883
|
-
function
|
|
2029
|
+
function unwrap18(data) {
|
|
1884
2030
|
if (data && typeof data === "object") {
|
|
1885
2031
|
const d = data;
|
|
1886
2032
|
if ("data" in d && Object.keys(d).length <= 2) {
|
|
@@ -1925,14 +2071,14 @@ var ComputerPorts = class {
|
|
|
1925
2071
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
1926
2072
|
)
|
|
1927
2073
|
};
|
|
1928
|
-
return
|
|
2074
|
+
return unwrap18(await this.http.post(this.base(), body4));
|
|
1929
2075
|
}
|
|
1930
2076
|
/** Patch visibility / auth options for port. */
|
|
1931
2077
|
async update(port, opts) {
|
|
1932
2078
|
const body4 = Object.fromEntries(
|
|
1933
2079
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
1934
2080
|
);
|
|
1935
|
-
return
|
|
2081
|
+
return unwrap18(
|
|
1936
2082
|
await this.http.patch(`${this.base()}/${port}`, body4)
|
|
1937
2083
|
);
|
|
1938
2084
|
}
|
|
@@ -1959,7 +2105,7 @@ var ComputerTerminal = class {
|
|
|
1959
2105
|
`/computers/${this.computerId}/terminal`,
|
|
1960
2106
|
body4
|
|
1961
2107
|
);
|
|
1962
|
-
return
|
|
2108
|
+
return unwrap19(raw);
|
|
1963
2109
|
}
|
|
1964
2110
|
/** Resize an existing PTY session. */
|
|
1965
2111
|
async resize(sessionId, cols, rows) {
|
|
@@ -1967,10 +2113,10 @@ var ComputerTerminal = class {
|
|
|
1967
2113
|
`/computers/${this.computerId}/pty/${sessionId}/resize`,
|
|
1968
2114
|
{ cols, rows }
|
|
1969
2115
|
);
|
|
1970
|
-
return
|
|
2116
|
+
return unwrap19(raw);
|
|
1971
2117
|
}
|
|
1972
2118
|
};
|
|
1973
|
-
function
|
|
2119
|
+
function unwrap19(data) {
|
|
1974
2120
|
if (data && typeof data === "object") {
|
|
1975
2121
|
const d = data;
|
|
1976
2122
|
if ("data" in d && Object.keys(d).length <= 2) {
|
|
@@ -1981,7 +2127,7 @@ function unwrap18(data) {
|
|
|
1981
2127
|
}
|
|
1982
2128
|
|
|
1983
2129
|
// src/resources/computer-volumes.ts
|
|
1984
|
-
function
|
|
2130
|
+
function unwrap20(data) {
|
|
1985
2131
|
if (data && typeof data === "object") {
|
|
1986
2132
|
const d = data;
|
|
1987
2133
|
if ("data" in d && Object.keys(d).length <= 2) {
|
|
@@ -2015,7 +2161,7 @@ var ComputerVolumes = class {
|
|
|
2015
2161
|
}
|
|
2016
2162
|
/** Attach volumeId at mountPath inside the VM. */
|
|
2017
2163
|
async attach(volumeId, mountPath) {
|
|
2018
|
-
return
|
|
2164
|
+
return unwrap20(
|
|
2019
2165
|
await this.http.post(this.base(), {
|
|
2020
2166
|
volume_id: volumeId,
|
|
2021
2167
|
mount_path: mountPath
|
|
@@ -2029,7 +2175,7 @@ var ComputerVolumes = class {
|
|
|
2029
2175
|
};
|
|
2030
2176
|
|
|
2031
2177
|
// src/resources/connectors.ts
|
|
2032
|
-
function
|
|
2178
|
+
function unwrap21(payload) {
|
|
2033
2179
|
if (payload && typeof payload === "object") {
|
|
2034
2180
|
const p = payload;
|
|
2035
2181
|
for (const key of ["data", "binding"]) {
|
|
@@ -2048,7 +2194,7 @@ function unwrapList8(payload) {
|
|
|
2048
2194
|
}
|
|
2049
2195
|
return [];
|
|
2050
2196
|
}
|
|
2051
|
-
function
|
|
2197
|
+
function stripUndefined8(input) {
|
|
2052
2198
|
return Object.fromEntries(
|
|
2053
2199
|
Object.entries(input).filter(([, value]) => value !== void 0)
|
|
2054
2200
|
);
|
|
@@ -2071,7 +2217,7 @@ function externalAttributionParams(params = {}) {
|
|
|
2071
2217
|
};
|
|
2072
2218
|
}
|
|
2073
2219
|
function queryFromListParams(params) {
|
|
2074
|
-
return
|
|
2220
|
+
return stripUndefined8({
|
|
2075
2221
|
scope: params.scope,
|
|
2076
2222
|
workspace_id: pickFirst(params.workspaceId, params.workspace_id),
|
|
2077
2223
|
owner_user_id: pickFirst(params.ownerUserId, params.owner_user_id),
|
|
@@ -2087,7 +2233,7 @@ function bodyFromCreateParams(provider, params) {
|
|
|
2087
2233
|
params.api_key,
|
|
2088
2234
|
credential?.value
|
|
2089
2235
|
);
|
|
2090
|
-
return
|
|
2236
|
+
return stripUndefined8({
|
|
2091
2237
|
provider,
|
|
2092
2238
|
type: String(params.type ?? "api_key").replaceAll("-", "_"),
|
|
2093
2239
|
name: params.name,
|
|
@@ -2108,7 +2254,7 @@ function bodyFromCreateParams(provider, params) {
|
|
|
2108
2254
|
});
|
|
2109
2255
|
}
|
|
2110
2256
|
function tokenBody(params = {}) {
|
|
2111
|
-
return
|
|
2257
|
+
return stripUndefined8({
|
|
2112
2258
|
subject: params.subject ?? { type: "app" },
|
|
2113
2259
|
installation_id: pickFirst(params.installationId, params.installation_id),
|
|
2114
2260
|
project_id: pickFirst(params.projectId, params.project_id),
|
|
@@ -2125,7 +2271,7 @@ function tokenBody(params = {}) {
|
|
|
2125
2271
|
});
|
|
2126
2272
|
}
|
|
2127
2273
|
function queryFromLinkParams(params = {}) {
|
|
2128
|
-
return
|
|
2274
|
+
return stripUndefined8({
|
|
2129
2275
|
workspace_id: pickFirst(params.workspaceId, params.workspace_id),
|
|
2130
2276
|
project_id: pickFirst(params.projectId, params.project_id),
|
|
2131
2277
|
connector_id: pickFirst(params.connectorId, params.connector_id),
|
|
@@ -2135,14 +2281,14 @@ function queryFromLinkParams(params = {}) {
|
|
|
2135
2281
|
});
|
|
2136
2282
|
}
|
|
2137
2283
|
function queryFromDefaultParams(params = {}) {
|
|
2138
|
-
return
|
|
2284
|
+
return stripUndefined8({
|
|
2139
2285
|
...queryFromLinkParams(params),
|
|
2140
2286
|
default_scope: pickFirst(params.defaultScope, params.default_scope),
|
|
2141
2287
|
target: params.target
|
|
2142
2288
|
});
|
|
2143
2289
|
}
|
|
2144
2290
|
function queryFromApplicableDefaultParams(params = {}) {
|
|
2145
|
-
return
|
|
2291
|
+
return stripUndefined8({
|
|
2146
2292
|
workspace_id: pickFirst(params.workspaceId, params.workspace_id),
|
|
2147
2293
|
project_id: pickFirst(params.projectId, params.project_id),
|
|
2148
2294
|
environment: params.environment,
|
|
@@ -2153,7 +2299,7 @@ function queryFromApplicableDefaultParams(params = {}) {
|
|
|
2153
2299
|
});
|
|
2154
2300
|
}
|
|
2155
2301
|
function materializeDefaultsBody(params = {}) {
|
|
2156
|
-
return
|
|
2302
|
+
return stripUndefined8({
|
|
2157
2303
|
workspace_id: pickFirst(params.workspaceId, params.workspace_id),
|
|
2158
2304
|
project_id: pickFirst(params.projectId, params.project_id),
|
|
2159
2305
|
environment: params.environment,
|
|
@@ -2165,7 +2311,7 @@ function materializeDefaultsBody(params = {}) {
|
|
|
2165
2311
|
});
|
|
2166
2312
|
}
|
|
2167
2313
|
function projectLinkBody(params) {
|
|
2168
|
-
return
|
|
2314
|
+
return stripUndefined8({
|
|
2169
2315
|
connector: params.connector,
|
|
2170
2316
|
connector_id: pickFirst(params.connectorId, params.connector_id),
|
|
2171
2317
|
installation_id: pickFirst(params.installationId, params.installation_id),
|
|
@@ -2186,14 +2332,14 @@ function projectLinkBody(params) {
|
|
|
2186
2332
|
});
|
|
2187
2333
|
}
|
|
2188
2334
|
function defaultBody(params) {
|
|
2189
|
-
return
|
|
2335
|
+
return stripUndefined8({
|
|
2190
2336
|
...projectLinkBody(params),
|
|
2191
2337
|
default_scope: pickFirst(params.defaultScope, params.default_scope),
|
|
2192
2338
|
target: params.target
|
|
2193
2339
|
});
|
|
2194
2340
|
}
|
|
2195
2341
|
function triggerBody(params) {
|
|
2196
|
-
return
|
|
2342
|
+
return stripUndefined8({
|
|
2197
2343
|
connector: params.connector,
|
|
2198
2344
|
connector_id: pickFirst(params.connectorId, params.connector_id),
|
|
2199
2345
|
workspace_id: pickFirst(params.workspaceId, params.workspace_id),
|
|
@@ -2213,7 +2359,7 @@ function triggerBody(params) {
|
|
|
2213
2359
|
});
|
|
2214
2360
|
}
|
|
2215
2361
|
function queryFromTriggerDeliveryParams(params = {}) {
|
|
2216
|
-
return
|
|
2362
|
+
return stripUndefined8({
|
|
2217
2363
|
...queryFromLinkParams(params),
|
|
2218
2364
|
trigger_id: pickFirst(params.triggerId, params.trigger_id),
|
|
2219
2365
|
event_type: pickFirst(params.eventType, params.event_type)
|
|
@@ -2240,7 +2386,7 @@ var Connectors = class {
|
|
|
2240
2386
|
const data = await this.http.get(
|
|
2241
2387
|
`/connect/connectors/${connectorPath(connector)}`
|
|
2242
2388
|
);
|
|
2243
|
-
return
|
|
2389
|
+
return unwrap21(data);
|
|
2244
2390
|
}
|
|
2245
2391
|
show(connector) {
|
|
2246
2392
|
return this.get(connector);
|
|
@@ -2251,7 +2397,7 @@ var Connectors = class {
|
|
|
2251
2397
|
"/connect/connectors",
|
|
2252
2398
|
bodyFromCreateParams(provider, params)
|
|
2253
2399
|
);
|
|
2254
|
-
return
|
|
2400
|
+
return unwrap21(data);
|
|
2255
2401
|
}
|
|
2256
2402
|
/** Request a runtime provider token for a connector. */
|
|
2257
2403
|
async getToken(connector, params = {}) {
|
|
@@ -2259,7 +2405,7 @@ var Connectors = class {
|
|
|
2259
2405
|
`/connect/token/${connectorPath(connector)}`,
|
|
2260
2406
|
tokenBody(params)
|
|
2261
2407
|
);
|
|
2262
|
-
return
|
|
2408
|
+
return unwrap21(data);
|
|
2263
2409
|
}
|
|
2264
2410
|
token(connector, params = {}) {
|
|
2265
2411
|
return this.getToken(connector, params);
|
|
@@ -2273,7 +2419,7 @@ var Connectors = class {
|
|
|
2273
2419
|
async startOauth(params) {
|
|
2274
2420
|
const data = await this.http.post(
|
|
2275
2421
|
"/connect/oauth/start",
|
|
2276
|
-
|
|
2422
|
+
stripUndefined8({
|
|
2277
2423
|
provider: params.provider,
|
|
2278
2424
|
scope: params.scope,
|
|
2279
2425
|
expose_as_env: pickFirst(params.exposeAsEnv, params.expose_as_env),
|
|
@@ -2281,7 +2427,7 @@ var Connectors = class {
|
|
|
2281
2427
|
...externalAttributionParams(params)
|
|
2282
2428
|
})
|
|
2283
2429
|
);
|
|
2284
|
-
return
|
|
2430
|
+
return unwrap21(data);
|
|
2285
2431
|
}
|
|
2286
2432
|
/** List connector installations/grants. */
|
|
2287
2433
|
async installations(params = {}) {
|
|
@@ -2321,7 +2467,7 @@ var Connectors = class {
|
|
|
2321
2467
|
"/connect/defaults/materialize",
|
|
2322
2468
|
materializeDefaultsBody(params)
|
|
2323
2469
|
);
|
|
2324
|
-
return
|
|
2470
|
+
return unwrap21(data);
|
|
2325
2471
|
}
|
|
2326
2472
|
/** Create an inherited connector default for future runtime resources. */
|
|
2327
2473
|
async createDefault(params) {
|
|
@@ -2329,7 +2475,7 @@ var Connectors = class {
|
|
|
2329
2475
|
"/connect/defaults",
|
|
2330
2476
|
defaultBody(params)
|
|
2331
2477
|
);
|
|
2332
|
-
return
|
|
2478
|
+
return unwrap21(data);
|
|
2333
2479
|
}
|
|
2334
2480
|
/** Delete an inherited connector default. */
|
|
2335
2481
|
async deleteDefault(id) {
|
|
@@ -2349,7 +2495,7 @@ var Connectors = class {
|
|
|
2349
2495
|
"/connect/triggers",
|
|
2350
2496
|
triggerBody(params)
|
|
2351
2497
|
);
|
|
2352
|
-
return
|
|
2498
|
+
return unwrap21(data);
|
|
2353
2499
|
}
|
|
2354
2500
|
/** List inbound provider trigger delivery attempts. */
|
|
2355
2501
|
async triggerDeliveries(params = {}) {
|
|
@@ -2376,7 +2522,7 @@ var Connectors = class {
|
|
|
2376
2522
|
"/connect/project-links",
|
|
2377
2523
|
projectLinkBody(params)
|
|
2378
2524
|
);
|
|
2379
|
-
return
|
|
2525
|
+
return unwrap21(data);
|
|
2380
2526
|
}
|
|
2381
2527
|
/** Delete a project connector link. */
|
|
2382
2528
|
async deleteProjectLink(id) {
|
|
@@ -2399,7 +2545,7 @@ var RuntimeConnectors = class {
|
|
|
2399
2545
|
async attach(params) {
|
|
2400
2546
|
const data = await this.http.post(
|
|
2401
2547
|
this.basePath,
|
|
2402
|
-
|
|
2548
|
+
stripUndefined8({
|
|
2403
2549
|
connector: params.connector,
|
|
2404
2550
|
env_name: params.env,
|
|
2405
2551
|
mode: params.mode?.replaceAll("-", "_"),
|
|
@@ -2412,7 +2558,7 @@ var RuntimeConnectors = class {
|
|
|
2412
2558
|
...externalAttributionParams(params)
|
|
2413
2559
|
})
|
|
2414
2560
|
);
|
|
2415
|
-
return
|
|
2561
|
+
return unwrap21(data);
|
|
2416
2562
|
}
|
|
2417
2563
|
/** Detach a connector binding by binding id or connector UID. */
|
|
2418
2564
|
async detach(bindingOrConnector) {
|
|
@@ -2421,15 +2567,15 @@ var RuntimeConnectors = class {
|
|
|
2421
2567
|
/** Sync or materialize connector placeholder env vars for this runtime resource. */
|
|
2422
2568
|
async sync() {
|
|
2423
2569
|
const data = await this.http.post(`${this.basePath}/sync`, {});
|
|
2424
|
-
return
|
|
2570
|
+
return unwrap21(data);
|
|
2425
2571
|
}
|
|
2426
2572
|
/** Verify a required connector is attached before agent work begins. */
|
|
2427
2573
|
async preflight(params = {}) {
|
|
2428
2574
|
const data = await this.http.post(
|
|
2429
2575
|
`${this.basePath}/preflight`,
|
|
2430
|
-
|
|
2576
|
+
stripUndefined8(params)
|
|
2431
2577
|
);
|
|
2432
|
-
return
|
|
2578
|
+
return unwrap21(data);
|
|
2433
2579
|
}
|
|
2434
2580
|
};
|
|
2435
2581
|
var SandboxConnectors = class extends RuntimeConnectors {
|
|
@@ -2608,7 +2754,7 @@ var Desktop = class {
|
|
|
2608
2754
|
};
|
|
2609
2755
|
|
|
2610
2756
|
// src/resources/egressAudit.ts
|
|
2611
|
-
function
|
|
2757
|
+
function unwrap22(payload) {
|
|
2612
2758
|
if (payload && typeof payload === "object") {
|
|
2613
2759
|
const p = payload;
|
|
2614
2760
|
for (const k of ["data", "event", "items"]) {
|
|
@@ -2627,7 +2773,7 @@ function unwrapList9(payload) {
|
|
|
2627
2773
|
}
|
|
2628
2774
|
return [];
|
|
2629
2775
|
}
|
|
2630
|
-
function
|
|
2776
|
+
function stripUndefined9(input) {
|
|
2631
2777
|
return Object.fromEntries(
|
|
2632
2778
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
2633
2779
|
);
|
|
@@ -2637,7 +2783,7 @@ function pickFirst2(...values) {
|
|
|
2637
2783
|
return void 0;
|
|
2638
2784
|
}
|
|
2639
2785
|
function listQuery(params) {
|
|
2640
|
-
return
|
|
2786
|
+
return stripUndefined9({
|
|
2641
2787
|
resource_id: pickFirst2(params.resourceId, params.resource_id),
|
|
2642
2788
|
resource_type: pickFirst2(params.resourceType, params.resource_type),
|
|
2643
2789
|
host: params.host,
|
|
@@ -2674,7 +2820,7 @@ var EgressAudit = class {
|
|
|
2674
2820
|
const data = await this.http.get(
|
|
2675
2821
|
`/egress/audit/${id}`
|
|
2676
2822
|
);
|
|
2677
|
-
return
|
|
2823
|
+
return unwrap22(data);
|
|
2678
2824
|
}
|
|
2679
2825
|
/**
|
|
2680
2826
|
* Long-poll the audit endpoint and yield new events as they appear.
|
|
@@ -2750,7 +2896,7 @@ var ComputerAudit = class extends SandboxAudit {
|
|
|
2750
2896
|
};
|
|
2751
2897
|
|
|
2752
2898
|
// src/resources/egressNetwork.ts
|
|
2753
|
-
function
|
|
2899
|
+
function unwrap23(payload) {
|
|
2754
2900
|
if (payload && typeof payload === "object") {
|
|
2755
2901
|
const p = payload;
|
|
2756
2902
|
for (const k of ["data", "policy", "rule", "items"]) {
|
|
@@ -2776,7 +2922,7 @@ function unwrapList10(payload) {
|
|
|
2776
2922
|
}
|
|
2777
2923
|
return [];
|
|
2778
2924
|
}
|
|
2779
|
-
function
|
|
2925
|
+
function stripUndefined10(input) {
|
|
2780
2926
|
return Object.fromEntries(
|
|
2781
2927
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
2782
2928
|
);
|
|
@@ -2786,7 +2932,7 @@ function pickFirst3(...values) {
|
|
|
2786
2932
|
return void 0;
|
|
2787
2933
|
}
|
|
2788
2934
|
function ruleBody(host, params, effect) {
|
|
2789
|
-
return
|
|
2935
|
+
return stripUndefined10({
|
|
2790
2936
|
host,
|
|
2791
2937
|
effect,
|
|
2792
2938
|
methods: params.methods,
|
|
@@ -2809,7 +2955,7 @@ var EgressNetwork = class {
|
|
|
2809
2955
|
"/egress/allowlist",
|
|
2810
2956
|
ruleBody(host, params, "allow")
|
|
2811
2957
|
);
|
|
2812
|
-
return
|
|
2958
|
+
return unwrap23(data);
|
|
2813
2959
|
}
|
|
2814
2960
|
/** Add a `deny` rule for `host` to the allowlist. */
|
|
2815
2961
|
async deny(host, params = {}) {
|
|
@@ -2817,16 +2963,16 @@ var EgressNetwork = class {
|
|
|
2817
2963
|
"/egress/allowlist",
|
|
2818
2964
|
ruleBody(host, params, "deny")
|
|
2819
2965
|
);
|
|
2820
|
-
return
|
|
2966
|
+
return unwrap23(data);
|
|
2821
2967
|
}
|
|
2822
2968
|
/** List allowlist rules. */
|
|
2823
2969
|
async rules(params = {}) {
|
|
2824
|
-
const
|
|
2970
|
+
const query3 = stripUndefined10({
|
|
2825
2971
|
policy_id: pickFirst3(params.policyId, params.policy_id),
|
|
2826
2972
|
resource_id: pickFirst3(params.resourceId, params.resource_id),
|
|
2827
2973
|
resource_type: pickFirst3(params.resourceType, params.resource_type)
|
|
2828
2974
|
});
|
|
2829
|
-
const data = await this.http.get("/egress/allowlist",
|
|
2975
|
+
const data = await this.http.get("/egress/allowlist", query3);
|
|
2830
2976
|
return unwrapList10(data);
|
|
2831
2977
|
}
|
|
2832
2978
|
/** Delete an allowlist rule by id. */
|
|
@@ -2836,16 +2982,16 @@ var EgressNetwork = class {
|
|
|
2836
2982
|
// ── policies ──────────────────────────────────────────────────────────────
|
|
2837
2983
|
/** List egress policies. */
|
|
2838
2984
|
async policies(params = {}) {
|
|
2839
|
-
const
|
|
2985
|
+
const query3 = stripUndefined10({
|
|
2840
2986
|
resource_id: pickFirst3(params.resourceId, params.resource_id),
|
|
2841
2987
|
resource_type: pickFirst3(params.resourceType, params.resource_type)
|
|
2842
2988
|
});
|
|
2843
|
-
const data = await this.http.get("/egress/policies",
|
|
2989
|
+
const data = await this.http.get("/egress/policies", query3);
|
|
2844
2990
|
return unwrapList10(data);
|
|
2845
2991
|
}
|
|
2846
2992
|
/** Create an egress policy. */
|
|
2847
2993
|
async createPolicy(params) {
|
|
2848
|
-
const body4 =
|
|
2994
|
+
const body4 = stripUndefined10({
|
|
2849
2995
|
name: params.name,
|
|
2850
2996
|
mode: params.mode ?? "enforce",
|
|
2851
2997
|
default_effect: pickFirst3(
|
|
@@ -2861,11 +3007,11 @@ var EgressNetwork = class {
|
|
|
2861
3007
|
"/egress/policies",
|
|
2862
3008
|
body4
|
|
2863
3009
|
);
|
|
2864
|
-
return
|
|
3010
|
+
return unwrap23(data);
|
|
2865
3011
|
}
|
|
2866
3012
|
/** Update an egress policy by id. */
|
|
2867
3013
|
async updatePolicy(policyId, params) {
|
|
2868
|
-
const body4 =
|
|
3014
|
+
const body4 = stripUndefined10({
|
|
2869
3015
|
mode: params.mode,
|
|
2870
3016
|
default_effect: pickFirst3(params.defaultEffect, params.default_effect),
|
|
2871
3017
|
name: params.name,
|
|
@@ -2875,7 +3021,7 @@ var EgressNetwork = class {
|
|
|
2875
3021
|
`/egress/policies/${policyId}`,
|
|
2876
3022
|
body4
|
|
2877
3023
|
);
|
|
2878
|
-
return
|
|
3024
|
+
return unwrap23(data);
|
|
2879
3025
|
}
|
|
2880
3026
|
// ── mode helpers ──────────────────────────────────────────────────────────
|
|
2881
3027
|
/** Set the policy to `mode="enforce"` — denied egress is blocked. */
|
|
@@ -2893,7 +3039,7 @@ var EgressNetwork = class {
|
|
|
2893
3039
|
if (policyId) {
|
|
2894
3040
|
return this.updatePolicy(policyId, { mode });
|
|
2895
3041
|
}
|
|
2896
|
-
const body4 = resourceId !== void 0 && resourceType !== void 0 ?
|
|
3042
|
+
const body4 = resourceId !== void 0 && resourceType !== void 0 ? stripUndefined10({
|
|
2897
3043
|
mode,
|
|
2898
3044
|
resource_id: resourceId,
|
|
2899
3045
|
resource_type: resourceType
|
|
@@ -2902,19 +3048,19 @@ var EgressNetwork = class {
|
|
|
2902
3048
|
"/egress/policies",
|
|
2903
3049
|
body4
|
|
2904
3050
|
);
|
|
2905
|
-
return
|
|
3051
|
+
return unwrap23(data);
|
|
2906
3052
|
}
|
|
2907
3053
|
// ── suggestions ───────────────────────────────────────────────────────────
|
|
2908
3054
|
/** AI-generated allowlist suggestions from recent denied egress. */
|
|
2909
3055
|
async suggestions(params = {}) {
|
|
2910
|
-
const
|
|
3056
|
+
const query3 = stripUndefined10({
|
|
2911
3057
|
resource_id: pickFirst3(params.resourceId, params.resource_id),
|
|
2912
3058
|
resource_type: pickFirst3(params.resourceType, params.resource_type),
|
|
2913
3059
|
since: params.since ?? "7d"
|
|
2914
3060
|
});
|
|
2915
3061
|
const data = await this.http.get(
|
|
2916
3062
|
"/egress/audit/suggestions",
|
|
2917
|
-
|
|
3063
|
+
query3
|
|
2918
3064
|
);
|
|
2919
3065
|
return unwrapList10(data);
|
|
2920
3066
|
}
|
|
@@ -2993,7 +3139,7 @@ var ComputerNetwork = class extends SandboxNetwork {
|
|
|
2993
3139
|
};
|
|
2994
3140
|
|
|
2995
3141
|
// src/resources/egressSecrets.ts
|
|
2996
|
-
function
|
|
3142
|
+
function unwrap24(payload) {
|
|
2997
3143
|
if (payload && typeof payload === "object") {
|
|
2998
3144
|
const p = payload;
|
|
2999
3145
|
for (const k of ["data", "secret", "binding", "items"]) {
|
|
@@ -3012,7 +3158,7 @@ function unwrapList11(payload) {
|
|
|
3012
3158
|
}
|
|
3013
3159
|
return [];
|
|
3014
3160
|
}
|
|
3015
|
-
function
|
|
3161
|
+
function stripUndefined11(input) {
|
|
3016
3162
|
return Object.fromEntries(
|
|
3017
3163
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
3018
3164
|
);
|
|
@@ -3022,7 +3168,7 @@ function pickFirst4(...values) {
|
|
|
3022
3168
|
return void 0;
|
|
3023
3169
|
}
|
|
3024
3170
|
function setBody(params) {
|
|
3025
|
-
return
|
|
3171
|
+
return stripUndefined11({
|
|
3026
3172
|
name: params.name,
|
|
3027
3173
|
value: params.value,
|
|
3028
3174
|
type: params.type ?? "api_key",
|
|
@@ -3043,7 +3189,7 @@ function setBody(params) {
|
|
|
3043
3189
|
});
|
|
3044
3190
|
}
|
|
3045
3191
|
function listQuery2(params) {
|
|
3046
|
-
return
|
|
3192
|
+
return stripUndefined11({
|
|
3047
3193
|
scope: params.scope,
|
|
3048
3194
|
type: params.type,
|
|
3049
3195
|
workspace_id: pickFirst4(params.workspaceId, params.workspace_id),
|
|
@@ -3058,14 +3204,14 @@ function listQuery2(params) {
|
|
|
3058
3204
|
});
|
|
3059
3205
|
}
|
|
3060
3206
|
function rotateBody(params) {
|
|
3061
|
-
return
|
|
3207
|
+
return stripUndefined11({
|
|
3062
3208
|
value: pickFirst4(params.newValue, params.new_value, params.value),
|
|
3063
3209
|
refresh_token: pickFirst4(params.refreshToken, params.refresh_token),
|
|
3064
3210
|
expires_at: pickFirst4(params.expiresAt, params.expires_at)
|
|
3065
3211
|
});
|
|
3066
3212
|
}
|
|
3067
3213
|
function bindingBody(params) {
|
|
3068
|
-
return
|
|
3214
|
+
return stripUndefined11({
|
|
3069
3215
|
secret_id: pickFirst4(params.secretId, params.secret_id),
|
|
3070
3216
|
resource_id: pickFirst4(params.resourceId, params.resource_id),
|
|
3071
3217
|
resource_type: pickFirst4(params.resourceType, params.resource_type),
|
|
@@ -3073,14 +3219,14 @@ function bindingBody(params) {
|
|
|
3073
3219
|
});
|
|
3074
3220
|
}
|
|
3075
3221
|
function bindingQuery(params) {
|
|
3076
|
-
return
|
|
3222
|
+
return stripUndefined11({
|
|
3077
3223
|
resource_id: pickFirst4(params.resourceId, params.resource_id),
|
|
3078
3224
|
resource_type: pickFirst4(params.resourceType, params.resource_type),
|
|
3079
3225
|
secret_id: pickFirst4(params.secretId, params.secret_id)
|
|
3080
3226
|
});
|
|
3081
3227
|
}
|
|
3082
3228
|
function oauthBody(params) {
|
|
3083
|
-
return
|
|
3229
|
+
return stripUndefined11({
|
|
3084
3230
|
provider: params.provider,
|
|
3085
3231
|
expose_as_env: pickFirst4(params.exposeAsEnv, params.expose_as_env),
|
|
3086
3232
|
scope: params.scope,
|
|
@@ -3129,7 +3275,7 @@ var OAuthFlow = class {
|
|
|
3129
3275
|
const data = await this.http.get("/egress/oauth/status", {
|
|
3130
3276
|
state: this.state
|
|
3131
3277
|
});
|
|
3132
|
-
const payload =
|
|
3278
|
+
const payload = unwrap24(data) ?? {};
|
|
3133
3279
|
const status = payload.status;
|
|
3134
3280
|
if (status === "completed" || status === "ready" || status === "succeeded") {
|
|
3135
3281
|
return payload;
|
|
@@ -3161,7 +3307,7 @@ var EgressSecrets = class {
|
|
|
3161
3307
|
"/egress/secrets",
|
|
3162
3308
|
setBody(params)
|
|
3163
3309
|
);
|
|
3164
|
-
return
|
|
3310
|
+
return unwrap24(data);
|
|
3165
3311
|
}
|
|
3166
3312
|
/** List secrets. */
|
|
3167
3313
|
async list(params = {}) {
|
|
@@ -3176,7 +3322,7 @@ var EgressSecrets = class {
|
|
|
3176
3322
|
const data = await this.http.get(
|
|
3177
3323
|
`/egress/secrets/${id}`
|
|
3178
3324
|
);
|
|
3179
|
-
return
|
|
3325
|
+
return unwrap24(data);
|
|
3180
3326
|
}
|
|
3181
3327
|
/** Rotate the secret's value. */
|
|
3182
3328
|
async rotate(id, params) {
|
|
@@ -3185,7 +3331,7 @@ var EgressSecrets = class {
|
|
|
3185
3331
|
`/egress/secrets/${id}`,
|
|
3186
3332
|
body4
|
|
3187
3333
|
);
|
|
3188
|
-
return
|
|
3334
|
+
return unwrap24(data);
|
|
3189
3335
|
}
|
|
3190
3336
|
/** Delete a secret. */
|
|
3191
3337
|
async delete(id) {
|
|
@@ -3198,7 +3344,7 @@ var EgressSecrets = class {
|
|
|
3198
3344
|
"/egress/bindings",
|
|
3199
3345
|
bindingBody(params)
|
|
3200
3346
|
);
|
|
3201
|
-
return
|
|
3347
|
+
return unwrap24(data);
|
|
3202
3348
|
}
|
|
3203
3349
|
/** List secret bindings. */
|
|
3204
3350
|
async listBindings(params = {}) {
|
|
@@ -3231,7 +3377,7 @@ var EgressSecrets = class {
|
|
|
3231
3377
|
"/egress/oauth/start",
|
|
3232
3378
|
oauthBody(params)
|
|
3233
3379
|
);
|
|
3234
|
-
const payload =
|
|
3380
|
+
const payload = unwrap24(data) ?? {};
|
|
3235
3381
|
return new OAuthFlow(this.http, payload, params.provider);
|
|
3236
3382
|
}
|
|
3237
3383
|
};
|
|
@@ -3917,7 +4063,7 @@ var Computer = class _Computer {
|
|
|
3917
4063
|
}
|
|
3918
4064
|
/** Tenant's preview/base domain, white-label aware. */
|
|
3919
4065
|
get previewDomain() {
|
|
3920
|
-
return this.data.preview_domain || "miosa.
|
|
4066
|
+
return this.data.preview_domain || "miosa.ai";
|
|
3921
4067
|
}
|
|
3922
4068
|
// ─── Lifecycle ─────────────────────────────────────────────────────────────
|
|
3923
4069
|
/** Start the computer. */
|
|
@@ -4082,6 +4228,27 @@ var Computer = class _Computer {
|
|
|
4082
4228
|
await this.http.get(`/computers/${this.id}/vnc-credentials`)
|
|
4083
4229
|
);
|
|
4084
4230
|
}
|
|
4231
|
+
/**
|
|
4232
|
+
* Return whether the external/raw desktop viewer password is set.
|
|
4233
|
+
*
|
|
4234
|
+
* Authenticated MIOSA platform users should use the platform desktop entry
|
|
4235
|
+
* URL and do not need this password. This is only for raw external viewer
|
|
4236
|
+
* links such as `*.computer.miosa.ai/desktop/index.html`.
|
|
4237
|
+
*/
|
|
4238
|
+
async viewerPassword() {
|
|
4239
|
+
return this.http.get(
|
|
4240
|
+
`/computers/${this.id}/viewer-password`
|
|
4241
|
+
);
|
|
4242
|
+
}
|
|
4243
|
+
/**
|
|
4244
|
+
* Rotate the external/raw desktop viewer password and return the plaintext
|
|
4245
|
+
* one time. Store it if you need to share the raw viewer URL.
|
|
4246
|
+
*/
|
|
4247
|
+
async rotateViewerPassword() {
|
|
4248
|
+
return this.http.post(
|
|
4249
|
+
`/computers/${this.id}/viewer-password/rotate`
|
|
4250
|
+
);
|
|
4251
|
+
}
|
|
4085
4252
|
/** List installed apps inside the VM. */
|
|
4086
4253
|
async apps() {
|
|
4087
4254
|
return unwrapData(
|
|
@@ -4214,8 +4381,8 @@ var Computers = class {
|
|
|
4214
4381
|
} = params;
|
|
4215
4382
|
const data = await this.http.post("/computers", {
|
|
4216
4383
|
template_type: "miosa-desktop",
|
|
4217
|
-
size: "small",
|
|
4218
4384
|
...body4,
|
|
4385
|
+
size: normalizeComputerSize(body4.size ?? "small"),
|
|
4219
4386
|
agent_runtime_profile_id: agentRuntimeProfileId ?? params.agent_runtime_profile_id ?? agentProfileId ?? params.agent_profile_id,
|
|
4220
4387
|
skip_agent_runtime_profile: skipAgentRuntimeProfile ?? params.skip_agent_runtime_profile
|
|
4221
4388
|
});
|
|
@@ -4225,14 +4392,14 @@ var Computers = class {
|
|
|
4225
4392
|
* List all computers for the authenticated tenant.
|
|
4226
4393
|
*/
|
|
4227
4394
|
async list(params) {
|
|
4228
|
-
const
|
|
4395
|
+
const query3 = {
|
|
4229
4396
|
page: params?.page,
|
|
4230
4397
|
per_page: params?.per_page,
|
|
4231
4398
|
status: params?.status
|
|
4232
4399
|
};
|
|
4233
4400
|
const response = await this.http.get(
|
|
4234
4401
|
"/computers",
|
|
4235
|
-
|
|
4402
|
+
query3
|
|
4236
4403
|
);
|
|
4237
4404
|
return response.data.map((d) => new Computer(this.http, d));
|
|
4238
4405
|
}
|
|
@@ -4259,7 +4426,31 @@ var Computers = class {
|
|
|
4259
4426
|
async delete(id) {
|
|
4260
4427
|
return this.http.delete(`/computers/${id}`);
|
|
4261
4428
|
}
|
|
4429
|
+
/**
|
|
4430
|
+
* Return whether the external/raw desktop viewer password is set.
|
|
4431
|
+
*
|
|
4432
|
+
* Authenticated MIOSA platform users should use the platform desktop entry
|
|
4433
|
+
* URL and do not need this password. This is only for raw external viewer
|
|
4434
|
+
* links such as `*.computer.miosa.ai/desktop/index.html`.
|
|
4435
|
+
*/
|
|
4436
|
+
async viewerPassword(id) {
|
|
4437
|
+
return this.http.get(
|
|
4438
|
+
`/computers/${id}/viewer-password`
|
|
4439
|
+
);
|
|
4440
|
+
}
|
|
4441
|
+
/**
|
|
4442
|
+
* Rotate the external/raw desktop viewer password and return the plaintext
|
|
4443
|
+
* one time. Store it if you need to share the raw viewer URL.
|
|
4444
|
+
*/
|
|
4445
|
+
async rotateViewerPassword(id) {
|
|
4446
|
+
return this.http.post(
|
|
4447
|
+
`/computers/${id}/viewer-password/rotate`
|
|
4448
|
+
);
|
|
4449
|
+
}
|
|
4262
4450
|
};
|
|
4451
|
+
function normalizeComputerSize(size) {
|
|
4452
|
+
return size === "xlarge" ? "xl" : size;
|
|
4453
|
+
}
|
|
4263
4454
|
|
|
4264
4455
|
// src/resources/credits.ts
|
|
4265
4456
|
var Credits = class {
|
|
@@ -4273,13 +4464,13 @@ var Credits = class {
|
|
|
4273
4464
|
}
|
|
4274
4465
|
/** List credit transactions (purchases, deductions). */
|
|
4275
4466
|
async transactions(params) {
|
|
4276
|
-
const
|
|
4467
|
+
const query3 = {
|
|
4277
4468
|
page: params?.page,
|
|
4278
4469
|
per_page: params?.per_page
|
|
4279
4470
|
};
|
|
4280
4471
|
return this.http.get(
|
|
4281
4472
|
"/credits/transactions",
|
|
4282
|
-
|
|
4473
|
+
query3
|
|
4283
4474
|
);
|
|
4284
4475
|
}
|
|
4285
4476
|
/** Get aggregated credit usage for the current billing period. */
|
|
@@ -4287,7 +4478,7 @@ var Credits = class {
|
|
|
4287
4478
|
return this.http.get("/credits/usage");
|
|
4288
4479
|
}
|
|
4289
4480
|
};
|
|
4290
|
-
function
|
|
4481
|
+
function unwrap25(payload) {
|
|
4291
4482
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
4292
4483
|
return payload.data;
|
|
4293
4484
|
}
|
|
@@ -4303,7 +4494,7 @@ function listItems2(payload, candidateKeys = ["data", "cron_jobs", "executions",
|
|
|
4303
4494
|
}
|
|
4304
4495
|
return [];
|
|
4305
4496
|
}
|
|
4306
|
-
function
|
|
4497
|
+
function stripUndefined12(input) {
|
|
4307
4498
|
return Object.fromEntries(
|
|
4308
4499
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
4309
4500
|
);
|
|
@@ -4317,28 +4508,28 @@ var CronJobs = class {
|
|
|
4317
4508
|
}
|
|
4318
4509
|
http;
|
|
4319
4510
|
async list(params = {}) {
|
|
4320
|
-
const
|
|
4321
|
-
const data = await this.http.get("/cron-jobs",
|
|
4511
|
+
const query3 = stripUndefined12({ ...params });
|
|
4512
|
+
const data = await this.http.get("/cron-jobs", query3);
|
|
4322
4513
|
return listItems2(data);
|
|
4323
4514
|
}
|
|
4324
4515
|
async get(jobId) {
|
|
4325
4516
|
const data = await this.http.get(`/cron-jobs/${jobId}`);
|
|
4326
|
-
return
|
|
4517
|
+
return unwrap25(data);
|
|
4327
4518
|
}
|
|
4328
4519
|
async create(params) {
|
|
4329
4520
|
const { idempotencyKey: ikey, ...rest } = params;
|
|
4330
|
-
const body4 =
|
|
4521
|
+
const body4 = stripUndefined12(rest);
|
|
4331
4522
|
const data = await this.http.request("/cron-jobs", {
|
|
4332
4523
|
method: "POST",
|
|
4333
4524
|
body: body4,
|
|
4334
4525
|
headers: { "Idempotency-Key": idempotencyKey2(ikey) }
|
|
4335
4526
|
});
|
|
4336
|
-
return
|
|
4527
|
+
return unwrap25(data);
|
|
4337
4528
|
}
|
|
4338
4529
|
async update(jobId, params) {
|
|
4339
|
-
const body4 =
|
|
4530
|
+
const body4 = stripUndefined12(params);
|
|
4340
4531
|
const data = await this.http.patch(`/cron-jobs/${jobId}`, body4);
|
|
4341
|
-
return
|
|
4532
|
+
return unwrap25(data);
|
|
4342
4533
|
}
|
|
4343
4534
|
async delete(jobId) {
|
|
4344
4535
|
await this.http.delete(`/cron-jobs/${jobId}`);
|
|
@@ -4346,11 +4537,11 @@ var CronJobs = class {
|
|
|
4346
4537
|
// ── Control ────────────────────────────────────────────────────────────────
|
|
4347
4538
|
async pause(jobId) {
|
|
4348
4539
|
const data = await this.http.post(`/cron-jobs/${jobId}/pause`);
|
|
4349
|
-
return
|
|
4540
|
+
return unwrap25(data);
|
|
4350
4541
|
}
|
|
4351
4542
|
async resume(jobId) {
|
|
4352
4543
|
const data = await this.http.post(`/cron-jobs/${jobId}/resume`);
|
|
4353
|
-
return
|
|
4544
|
+
return unwrap25(data);
|
|
4354
4545
|
}
|
|
4355
4546
|
async runNow(jobId, opts = {}) {
|
|
4356
4547
|
const data = await this.http.request(
|
|
@@ -4360,7 +4551,7 @@ var CronJobs = class {
|
|
|
4360
4551
|
headers: { "Idempotency-Key": idempotencyKey2(opts.idempotencyKey) }
|
|
4361
4552
|
}
|
|
4362
4553
|
);
|
|
4363
|
-
return
|
|
4554
|
+
return unwrap25(data);
|
|
4364
4555
|
}
|
|
4365
4556
|
// ── Execution history ──────────────────────────────────────────────────────
|
|
4366
4557
|
async listExecutions(jobId) {
|
|
@@ -4375,12 +4566,12 @@ var CronJobs = class {
|
|
|
4375
4566
|
const data = await this.http.get(
|
|
4376
4567
|
`/cron-jobs/${jobId}/executions/${executionId}`
|
|
4377
4568
|
);
|
|
4378
|
-
return
|
|
4569
|
+
return unwrap25(data);
|
|
4379
4570
|
}
|
|
4380
4571
|
};
|
|
4381
4572
|
|
|
4382
4573
|
// src/resources/dashboard.ts
|
|
4383
|
-
function
|
|
4574
|
+
function unwrap26(payload) {
|
|
4384
4575
|
if (payload && typeof payload === "object") {
|
|
4385
4576
|
const p = payload;
|
|
4386
4577
|
for (const k of ["data", "dashboard", "overview", "items"]) {
|
|
@@ -4397,15 +4588,15 @@ var Dashboard = class {
|
|
|
4397
4588
|
/** Aggregated user dashboard payload. */
|
|
4398
4589
|
async summary() {
|
|
4399
4590
|
const data = await this.http.get("/dashboard");
|
|
4400
|
-
return
|
|
4591
|
+
return unwrap26(data);
|
|
4401
4592
|
}
|
|
4402
4593
|
/** Status / health overview (public endpoint). */
|
|
4403
4594
|
async overview() {
|
|
4404
4595
|
const data = await this.http.get("/overview");
|
|
4405
|
-
return
|
|
4596
|
+
return unwrap26(data);
|
|
4406
4597
|
}
|
|
4407
4598
|
};
|
|
4408
|
-
function
|
|
4599
|
+
function unwrap27(payload) {
|
|
4409
4600
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
4410
4601
|
return payload.data;
|
|
4411
4602
|
}
|
|
@@ -4421,7 +4612,7 @@ function listItems3(payload, candidateKeys = ["data", "databases", "items"]) {
|
|
|
4421
4612
|
}
|
|
4422
4613
|
return [];
|
|
4423
4614
|
}
|
|
4424
|
-
function
|
|
4615
|
+
function stripUndefined13(input) {
|
|
4425
4616
|
return Object.fromEntries(
|
|
4426
4617
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
4427
4618
|
);
|
|
@@ -4435,13 +4626,13 @@ var Databases = class {
|
|
|
4435
4626
|
}
|
|
4436
4627
|
http;
|
|
4437
4628
|
async list(params = {}) {
|
|
4438
|
-
const
|
|
4439
|
-
const data = await this.http.get("/databases",
|
|
4629
|
+
const query3 = stripUndefined13({ ...params });
|
|
4630
|
+
const data = await this.http.get("/databases", query3);
|
|
4440
4631
|
return listItems3(data);
|
|
4441
4632
|
}
|
|
4442
4633
|
async get(databaseId) {
|
|
4443
4634
|
const data = await this.http.get(`/databases/${databaseId}`);
|
|
4444
|
-
return
|
|
4635
|
+
return unwrap27(data);
|
|
4445
4636
|
}
|
|
4446
4637
|
async create(params) {
|
|
4447
4638
|
const {
|
|
@@ -4452,7 +4643,7 @@ var Databases = class {
|
|
|
4452
4643
|
size: _deprecatedSize,
|
|
4453
4644
|
...rest
|
|
4454
4645
|
} = params;
|
|
4455
|
-
const body4 =
|
|
4646
|
+
const body4 = stripUndefined13({
|
|
4456
4647
|
...rest,
|
|
4457
4648
|
engine_version: engine_version ?? version
|
|
4458
4649
|
});
|
|
@@ -4465,7 +4656,7 @@ var Databases = class {
|
|
|
4465
4656
|
)
|
|
4466
4657
|
}
|
|
4467
4658
|
});
|
|
4468
|
-
return
|
|
4659
|
+
return unwrap27(data);
|
|
4469
4660
|
}
|
|
4470
4661
|
async delete(databaseId) {
|
|
4471
4662
|
await this.http.delete(`/databases/${databaseId}`);
|
|
@@ -4475,33 +4666,33 @@ var Databases = class {
|
|
|
4475
4666
|
const data = await this.http.post(
|
|
4476
4667
|
`/databases/${databaseId}/start`
|
|
4477
4668
|
);
|
|
4478
|
-
return
|
|
4669
|
+
return unwrap27(data);
|
|
4479
4670
|
}
|
|
4480
4671
|
async stop(databaseId) {
|
|
4481
4672
|
const data = await this.http.post(`/databases/${databaseId}/stop`);
|
|
4482
|
-
return
|
|
4673
|
+
return unwrap27(data);
|
|
4483
4674
|
}
|
|
4484
4675
|
async restart(databaseId) {
|
|
4485
4676
|
const data = await this.http.post(
|
|
4486
4677
|
`/databases/${databaseId}/restart`
|
|
4487
4678
|
);
|
|
4488
|
-
return
|
|
4679
|
+
return unwrap27(data);
|
|
4489
4680
|
}
|
|
4490
4681
|
// ── Credentials + logs ────────────────────────────────────────────────────
|
|
4491
4682
|
async credentials(databaseId) {
|
|
4492
4683
|
const data = await this.http.get(
|
|
4493
4684
|
`/databases/${databaseId}/credentials`
|
|
4494
4685
|
);
|
|
4495
|
-
return
|
|
4686
|
+
return unwrap27(data);
|
|
4496
4687
|
}
|
|
4497
4688
|
async logs(databaseId, params = {}) {
|
|
4498
|
-
const
|
|
4689
|
+
const query3 = stripUndefined13({
|
|
4499
4690
|
lines: params.lines,
|
|
4500
4691
|
since: params.since
|
|
4501
4692
|
});
|
|
4502
4693
|
const data = await this.http.get(
|
|
4503
4694
|
`/databases/${databaseId}/logs`,
|
|
4504
|
-
|
|
4695
|
+
query3
|
|
4505
4696
|
);
|
|
4506
4697
|
return data;
|
|
4507
4698
|
}
|
|
@@ -4522,7 +4713,7 @@ function attributionBody(p) {
|
|
|
4522
4713
|
function idempotencyKey4(key) {
|
|
4523
4714
|
return key ?? randomUUID();
|
|
4524
4715
|
}
|
|
4525
|
-
function
|
|
4716
|
+
function unwrap28(payload) {
|
|
4526
4717
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
4527
4718
|
return payload.data;
|
|
4528
4719
|
}
|
|
@@ -4538,7 +4729,7 @@ function listItems4(payload, candidateKeys = ["items", "deployments", "versions"
|
|
|
4538
4729
|
}
|
|
4539
4730
|
return [];
|
|
4540
4731
|
}
|
|
4541
|
-
function
|
|
4732
|
+
function stripUndefined14(input) {
|
|
4542
4733
|
return Object.fromEntries(
|
|
4543
4734
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
4544
4735
|
);
|
|
@@ -4593,7 +4784,7 @@ var DeploymentVersions = class {
|
|
|
4593
4784
|
http;
|
|
4594
4785
|
deploymentId;
|
|
4595
4786
|
async list(params = {}) {
|
|
4596
|
-
const
|
|
4787
|
+
const query3 = stripUndefined14({
|
|
4597
4788
|
state: params.state,
|
|
4598
4789
|
limit: params.limit,
|
|
4599
4790
|
cursor: params.cursor,
|
|
@@ -4601,7 +4792,7 @@ var DeploymentVersions = class {
|
|
|
4601
4792
|
});
|
|
4602
4793
|
const data = await this.http.get(
|
|
4603
4794
|
`/deployments/${this.deploymentId}/versions`,
|
|
4604
|
-
|
|
4795
|
+
query3
|
|
4605
4796
|
);
|
|
4606
4797
|
return listItems4(data);
|
|
4607
4798
|
}
|
|
@@ -4609,10 +4800,10 @@ var DeploymentVersions = class {
|
|
|
4609
4800
|
const data = await this.http.get(
|
|
4610
4801
|
`/deployments/${this.deploymentId}/versions/${versionId}`
|
|
4611
4802
|
);
|
|
4612
|
-
return
|
|
4803
|
+
return unwrap28(data);
|
|
4613
4804
|
}
|
|
4614
4805
|
async promote(versionId, opts = {}) {
|
|
4615
|
-
const body4 =
|
|
4806
|
+
const body4 = stripUndefined14({ environment: opts.environment });
|
|
4616
4807
|
const data = await this.http.request(
|
|
4617
4808
|
`/deployments/${this.deploymentId}/versions/${versionId}/promote`,
|
|
4618
4809
|
{
|
|
@@ -4621,7 +4812,7 @@ var DeploymentVersions = class {
|
|
|
4621
4812
|
headers: { "Idempotency-Key": idempotencyKey4(opts.idempotencyKey) }
|
|
4622
4813
|
}
|
|
4623
4814
|
);
|
|
4624
|
-
return
|
|
4815
|
+
return unwrap28(data);
|
|
4625
4816
|
}
|
|
4626
4817
|
};
|
|
4627
4818
|
var DeploymentReleases = class {
|
|
@@ -4641,7 +4832,7 @@ var DeploymentReleases = class {
|
|
|
4641
4832
|
const data = await this.http.get(
|
|
4642
4833
|
`/deployments/${this.deploymentId}/releases/${releaseId}`
|
|
4643
4834
|
);
|
|
4644
|
-
return
|
|
4835
|
+
return unwrap28(data);
|
|
4645
4836
|
}
|
|
4646
4837
|
};
|
|
4647
4838
|
var DeploymentRuntimeInstances = class {
|
|
@@ -4661,14 +4852,14 @@ var DeploymentRuntimeInstances = class {
|
|
|
4661
4852
|
const data = await this.http.get(
|
|
4662
4853
|
`/deployments/${this.deploymentId}/runtime-instances/${instanceId}`
|
|
4663
4854
|
);
|
|
4664
|
-
return
|
|
4855
|
+
return unwrap28(data);
|
|
4665
4856
|
}
|
|
4666
4857
|
async logs(instanceId, lines = 100) {
|
|
4667
4858
|
const data = await this.http.get(
|
|
4668
4859
|
`/deployments/${this.deploymentId}/runtime-instances/${instanceId}/logs`,
|
|
4669
4860
|
{ lines }
|
|
4670
4861
|
);
|
|
4671
|
-
const unwrapped =
|
|
4862
|
+
const unwrapped = unwrap28(data);
|
|
4672
4863
|
const result = { logs: String(unwrapped.logs ?? "") };
|
|
4673
4864
|
if (typeof unwrapped.runtime_instance_id === "string") {
|
|
4674
4865
|
result.runtime_instance_id = unwrapped.runtime_instance_id;
|
|
@@ -4699,11 +4890,11 @@ var DeploymentDomains = class {
|
|
|
4699
4890
|
`/deployments/${this.deploymentId}/domains`,
|
|
4700
4891
|
{
|
|
4701
4892
|
method: "POST",
|
|
4702
|
-
body:
|
|
4893
|
+
body: stripUndefined14(body4),
|
|
4703
4894
|
headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
|
|
4704
4895
|
}
|
|
4705
4896
|
);
|
|
4706
|
-
return
|
|
4897
|
+
return unwrap28(data);
|
|
4707
4898
|
}
|
|
4708
4899
|
async list(filters = {}) {
|
|
4709
4900
|
const data = await this.http.get(
|
|
@@ -4716,7 +4907,7 @@ var DeploymentDomains = class {
|
|
|
4716
4907
|
const data = await this.http.post(
|
|
4717
4908
|
`/deployments/${this.deploymentId}/domains/${domainId}/verify`
|
|
4718
4909
|
);
|
|
4719
|
-
return
|
|
4910
|
+
return unwrap28(data);
|
|
4720
4911
|
}
|
|
4721
4912
|
async delete(domainId) {
|
|
4722
4913
|
await this.http.delete(
|
|
@@ -4731,7 +4922,7 @@ var Deployments = class {
|
|
|
4731
4922
|
http;
|
|
4732
4923
|
async list(params = {}) {
|
|
4733
4924
|
const projectId = params.projectId ?? params.project_id;
|
|
4734
|
-
const
|
|
4925
|
+
const query3 = stripUndefined14({
|
|
4735
4926
|
project_id: projectId,
|
|
4736
4927
|
state: params.state,
|
|
4737
4928
|
limit: params.limit,
|
|
@@ -4740,16 +4931,16 @@ var Deployments = class {
|
|
|
4740
4931
|
});
|
|
4741
4932
|
const data = await this.http.get(
|
|
4742
4933
|
"/deployments",
|
|
4743
|
-
|
|
4934
|
+
query3
|
|
4744
4935
|
);
|
|
4745
4936
|
return listItems4(data);
|
|
4746
4937
|
}
|
|
4747
4938
|
async get(deploymentId) {
|
|
4748
4939
|
const data = await this.http.get(`/deployments/${deploymentId}`);
|
|
4749
|
-
return
|
|
4940
|
+
return unwrap28(data);
|
|
4750
4941
|
}
|
|
4751
4942
|
async create(params) {
|
|
4752
|
-
const body4 =
|
|
4943
|
+
const body4 = stripUndefined14({
|
|
4753
4944
|
name: params.name,
|
|
4754
4945
|
repo_url: params.repoUrl ?? params.repo_url,
|
|
4755
4946
|
branch: params.branch,
|
|
@@ -4765,7 +4956,7 @@ var Deployments = class {
|
|
|
4765
4956
|
body: body4,
|
|
4766
4957
|
headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
|
|
4767
4958
|
});
|
|
4768
|
-
return
|
|
4959
|
+
return unwrap28(data);
|
|
4769
4960
|
}
|
|
4770
4961
|
/**
|
|
4771
4962
|
* Create a deployment that runs on the workspace's dedicated Docker Deploy
|
|
@@ -4809,7 +5000,7 @@ var Deployments = class {
|
|
|
4809
5000
|
const rawHost = await this.http.get(
|
|
4810
5001
|
`/docker-deploy/hosts/${hostId}`
|
|
4811
5002
|
);
|
|
4812
|
-
host =
|
|
5003
|
+
host = unwrap28(
|
|
4813
5004
|
rawHost
|
|
4814
5005
|
);
|
|
4815
5006
|
addDoctorCheck(
|
|
@@ -4912,7 +5103,7 @@ var Deployments = class {
|
|
|
4912
5103
|
};
|
|
4913
5104
|
}
|
|
4914
5105
|
async update(deploymentId, params) {
|
|
4915
|
-
const body4 =
|
|
5106
|
+
const body4 = stripUndefined14({
|
|
4916
5107
|
name: params.name,
|
|
4917
5108
|
branch: params.branch,
|
|
4918
5109
|
build_command: params.buildCommand ?? params.build_command,
|
|
@@ -4923,13 +5114,13 @@ var Deployments = class {
|
|
|
4923
5114
|
`/deployments/${deploymentId}`,
|
|
4924
5115
|
body4
|
|
4925
5116
|
);
|
|
4926
|
-
return
|
|
5117
|
+
return unwrap28(data);
|
|
4927
5118
|
}
|
|
4928
5119
|
async delete(deploymentId) {
|
|
4929
5120
|
await this.http.delete(`/deployments/${deploymentId}`);
|
|
4930
5121
|
}
|
|
4931
5122
|
async publish(deploymentId, params) {
|
|
4932
|
-
const body4 =
|
|
5123
|
+
const body4 = stripUndefined14({
|
|
4933
5124
|
source_sandbox_id: params.sourceSandboxId ?? params.source_sandbox_id,
|
|
4934
5125
|
output_path: params.outputPath ?? params.output_path,
|
|
4935
5126
|
entrypoint: params.entrypoint,
|
|
@@ -4943,7 +5134,7 @@ var Deployments = class {
|
|
|
4943
5134
|
headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
|
|
4944
5135
|
}
|
|
4945
5136
|
);
|
|
4946
|
-
return
|
|
5137
|
+
return unwrap28(data);
|
|
4947
5138
|
}
|
|
4948
5139
|
/**
|
|
4949
5140
|
* Backward-compatible bridge: POST /sandboxes/:id/deploy. Works today;
|
|
@@ -4951,7 +5142,7 @@ var Deployments = class {
|
|
|
4951
5142
|
* phase. Prefer `publish()` once Phase 2B/3 lands.
|
|
4952
5143
|
*/
|
|
4953
5144
|
async publishFromSandbox(sandboxId, params = {}) {
|
|
4954
|
-
const body4 =
|
|
5145
|
+
const body4 = stripUndefined14({
|
|
4955
5146
|
name: params.name,
|
|
4956
5147
|
deployment_id: params.deploymentId ?? params.deployment_id,
|
|
4957
5148
|
output_path: params.outputPath ?? params.output_path,
|
|
@@ -4968,10 +5159,10 @@ var Deployments = class {
|
|
|
4968
5159
|
headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
|
|
4969
5160
|
}
|
|
4970
5161
|
);
|
|
4971
|
-
return
|
|
5162
|
+
return unwrap28(data);
|
|
4972
5163
|
}
|
|
4973
5164
|
async rollback(deploymentId, params = {}) {
|
|
4974
|
-
const body4 =
|
|
5165
|
+
const body4 = stripUndefined14({
|
|
4975
5166
|
version_id: params.versionId ?? params.version_id
|
|
4976
5167
|
});
|
|
4977
5168
|
const data = await this.http.request(
|
|
@@ -4982,7 +5173,7 @@ var Deployments = class {
|
|
|
4982
5173
|
headers: { "Idempotency-Key": idempotencyKey4(params.idempotencyKey) }
|
|
4983
5174
|
}
|
|
4984
5175
|
);
|
|
4985
|
-
return
|
|
5176
|
+
return unwrap28(data);
|
|
4986
5177
|
}
|
|
4987
5178
|
async listBuilds(deploymentId) {
|
|
4988
5179
|
const data = await this.http.get(
|
|
@@ -4994,7 +5185,7 @@ var Deployments = class {
|
|
|
4994
5185
|
const data = await this.http.get(
|
|
4995
5186
|
`/deployments/${deploymentId}/builds/${buildId}`
|
|
4996
5187
|
);
|
|
4997
|
-
return
|
|
5188
|
+
return unwrap28(data);
|
|
4998
5189
|
}
|
|
4999
5190
|
async listEnv(deploymentId) {
|
|
5000
5191
|
const data = await this.http.get(
|
|
@@ -5003,7 +5194,7 @@ var Deployments = class {
|
|
|
5003
5194
|
return listItems4(data);
|
|
5004
5195
|
}
|
|
5005
5196
|
async setEnv(deploymentId, vars, opts = {}) {
|
|
5006
|
-
const body4 =
|
|
5197
|
+
const body4 = stripUndefined14({ env: vars, environment: opts.environment });
|
|
5007
5198
|
const data = await this.http.post(
|
|
5008
5199
|
`/deployments/${deploymentId}/env`,
|
|
5009
5200
|
body4
|
|
@@ -5040,7 +5231,7 @@ var RUNTIME_BINARIES = {
|
|
|
5040
5231
|
pi: ["pi"],
|
|
5041
5232
|
custom: []
|
|
5042
5233
|
};
|
|
5043
|
-
function
|
|
5234
|
+
function unwrap29(payload, keys = ["data"]) {
|
|
5044
5235
|
if (payload && typeof payload === "object") {
|
|
5045
5236
|
const p = payload;
|
|
5046
5237
|
for (const key of keys) {
|
|
@@ -5059,7 +5250,7 @@ function unwrapList12(payload) {
|
|
|
5059
5250
|
}
|
|
5060
5251
|
return [];
|
|
5061
5252
|
}
|
|
5062
|
-
function
|
|
5253
|
+
function stripUndefined15(input) {
|
|
5063
5254
|
return Object.fromEntries(
|
|
5064
5255
|
Object.entries(input).filter(([, value]) => value !== void 0)
|
|
5065
5256
|
);
|
|
@@ -5069,14 +5260,14 @@ function pickFirst5(...values) {
|
|
|
5069
5260
|
return void 0;
|
|
5070
5261
|
}
|
|
5071
5262
|
function queryFromListParams2(params = {}) {
|
|
5072
|
-
return
|
|
5263
|
+
return stripUndefined15({
|
|
5073
5264
|
kind: pickFirst5(params.kind, params.type),
|
|
5074
5265
|
workspace_id: pickFirst5(params.workspaceId, params.workspace_id),
|
|
5075
5266
|
project_id: pickFirst5(params.projectId, params.project_id)
|
|
5076
5267
|
});
|
|
5077
5268
|
}
|
|
5078
5269
|
function queryFromFileParams(params = {}) {
|
|
5079
|
-
return
|
|
5270
|
+
return stripUndefined15({
|
|
5080
5271
|
path: params.path
|
|
5081
5272
|
});
|
|
5082
5273
|
}
|
|
@@ -5099,7 +5290,7 @@ var Devices = class {
|
|
|
5099
5290
|
/** Show one unified device by id. */
|
|
5100
5291
|
async get(id) {
|
|
5101
5292
|
const data = await this.http.get(`/devices/${devicePath(id)}`);
|
|
5102
|
-
return
|
|
5293
|
+
return unwrap29(data);
|
|
5103
5294
|
}
|
|
5104
5295
|
show(id) {
|
|
5105
5296
|
return this.get(id);
|
|
@@ -5109,20 +5300,20 @@ var Devices = class {
|
|
|
5109
5300
|
const data = await this.http.get(
|
|
5110
5301
|
`/devices/${devicePath(id)}/capabilities`
|
|
5111
5302
|
);
|
|
5112
|
-
return
|
|
5303
|
+
return unwrap29(data);
|
|
5113
5304
|
}
|
|
5114
5305
|
/** Execute a command inside the device. */
|
|
5115
5306
|
async exec(id, params) {
|
|
5116
5307
|
const data = await this.http.post(
|
|
5117
5308
|
`/devices/${devicePath(id)}/exec`,
|
|
5118
|
-
|
|
5309
|
+
stripUndefined15({
|
|
5119
5310
|
command: params.command,
|
|
5120
5311
|
timeout_ms: pickFirst5(params.timeoutMs, params.timeout_ms),
|
|
5121
5312
|
cwd: params.cwd,
|
|
5122
5313
|
env: params.env
|
|
5123
5314
|
})
|
|
5124
5315
|
);
|
|
5125
|
-
return
|
|
5316
|
+
return unwrap29(data);
|
|
5126
5317
|
}
|
|
5127
5318
|
/** List files inside the device filesystem. */
|
|
5128
5319
|
async listFiles(id, params = {}) {
|
|
@@ -5138,19 +5329,19 @@ var Devices = class {
|
|
|
5138
5329
|
`/devices/${devicePath(id)}/files/read`,
|
|
5139
5330
|
queryFromFileParams(params)
|
|
5140
5331
|
);
|
|
5141
|
-
return
|
|
5332
|
+
return unwrap29(data);
|
|
5142
5333
|
}
|
|
5143
5334
|
/** Write a text or base64 payload into the device filesystem. */
|
|
5144
5335
|
async writeFile(id, params) {
|
|
5145
5336
|
const data = await this.http.post(
|
|
5146
5337
|
`/devices/${devicePath(id)}/files/write`,
|
|
5147
|
-
|
|
5338
|
+
stripUndefined15({
|
|
5148
5339
|
path: params.path,
|
|
5149
5340
|
content: params.content,
|
|
5150
5341
|
content_base64: pickFirst5(params.contentBase64, params.content_base64)
|
|
5151
5342
|
})
|
|
5152
5343
|
);
|
|
5153
|
-
return
|
|
5344
|
+
return unwrap29(data);
|
|
5154
5345
|
}
|
|
5155
5346
|
/** Expose a device port through MIOSA routing. */
|
|
5156
5347
|
async expose(id, params) {
|
|
@@ -5158,44 +5349,44 @@ var Devices = class {
|
|
|
5158
5349
|
`/devices/${devicePath(id)}/expose`,
|
|
5159
5350
|
{ port: params.port }
|
|
5160
5351
|
);
|
|
5161
|
-
return
|
|
5352
|
+
return unwrap29(data);
|
|
5162
5353
|
}
|
|
5163
5354
|
/** Return browser/desktop connection details for a computer-backed device. */
|
|
5164
5355
|
async browser(id) {
|
|
5165
5356
|
const data = await this.http.get(`/devices/${devicePath(id)}/browser`);
|
|
5166
|
-
return
|
|
5357
|
+
return unwrap29(data);
|
|
5167
5358
|
}
|
|
5168
5359
|
async pause(id) {
|
|
5169
5360
|
const data = await this.http.post(
|
|
5170
5361
|
`/devices/${devicePath(id)}/pause`,
|
|
5171
5362
|
{}
|
|
5172
5363
|
);
|
|
5173
|
-
return
|
|
5364
|
+
return unwrap29(data);
|
|
5174
5365
|
}
|
|
5175
5366
|
async stop(id) {
|
|
5176
5367
|
const data = await this.http.post(
|
|
5177
5368
|
`/devices/${devicePath(id)}/stop`,
|
|
5178
5369
|
{}
|
|
5179
5370
|
);
|
|
5180
|
-
return
|
|
5371
|
+
return unwrap29(data);
|
|
5181
5372
|
}
|
|
5182
5373
|
async resume(id) {
|
|
5183
5374
|
const data = await this.http.post(
|
|
5184
5375
|
`/devices/${devicePath(id)}/resume`,
|
|
5185
5376
|
{}
|
|
5186
5377
|
);
|
|
5187
|
-
return
|
|
5378
|
+
return unwrap29(data);
|
|
5188
5379
|
}
|
|
5189
5380
|
async extend(id, params) {
|
|
5190
5381
|
const data = await this.http.post(
|
|
5191
5382
|
`/devices/${devicePath(id)}/extend`,
|
|
5192
5383
|
{ timeout_sec: pickFirst5(params.timeoutSec, params.timeout_sec) }
|
|
5193
5384
|
);
|
|
5194
|
-
return
|
|
5385
|
+
return unwrap29(data);
|
|
5195
5386
|
}
|
|
5196
5387
|
async destroy(id) {
|
|
5197
5388
|
const data = await this.http.delete(`/devices/${devicePath(id)}`);
|
|
5198
|
-
return
|
|
5389
|
+
return unwrap29(data);
|
|
5199
5390
|
}
|
|
5200
5391
|
/**
|
|
5201
5392
|
* Write a MIOSA runtime bootstrap manifest and optionally install/probe
|
|
@@ -5365,7 +5556,7 @@ var DockerDeploy = class {
|
|
|
5365
5556
|
};
|
|
5366
5557
|
|
|
5367
5558
|
// src/resources/email.ts
|
|
5368
|
-
function
|
|
5559
|
+
function unwrap30(data) {
|
|
5369
5560
|
if (data && typeof data === "object") {
|
|
5370
5561
|
const d = data;
|
|
5371
5562
|
for (const k of [
|
|
@@ -5417,12 +5608,12 @@ var EmailCampaigns = class {
|
|
|
5417
5608
|
);
|
|
5418
5609
|
}
|
|
5419
5610
|
async create(attrs) {
|
|
5420
|
-
return
|
|
5611
|
+
return unwrap30(
|
|
5421
5612
|
await this.http.post("/admin/email-campaigns", strip(attrs))
|
|
5422
5613
|
);
|
|
5423
5614
|
}
|
|
5424
5615
|
async recipientCount(filters = {}) {
|
|
5425
|
-
return
|
|
5616
|
+
return unwrap30(
|
|
5426
5617
|
await this.http.get(
|
|
5427
5618
|
"/admin/email-campaigns/recipient-count",
|
|
5428
5619
|
filters
|
|
@@ -5430,7 +5621,7 @@ var EmailCampaigns = class {
|
|
|
5430
5621
|
);
|
|
5431
5622
|
}
|
|
5432
5623
|
async send(campaignId, opts = {}) {
|
|
5433
|
-
return
|
|
5624
|
+
return unwrap30(
|
|
5434
5625
|
await this.http.post(
|
|
5435
5626
|
`/admin/email-campaigns/${campaignId}/send`,
|
|
5436
5627
|
strip(opts)
|
|
@@ -5438,7 +5629,7 @@ var EmailCampaigns = class {
|
|
|
5438
5629
|
);
|
|
5439
5630
|
}
|
|
5440
5631
|
async cancel(campaignId) {
|
|
5441
|
-
return
|
|
5632
|
+
return unwrap30(
|
|
5442
5633
|
await this.http.post(
|
|
5443
5634
|
`/admin/email-campaigns/${campaignId}/cancel`
|
|
5444
5635
|
)
|
|
@@ -5464,7 +5655,7 @@ var EmailTemplates = class {
|
|
|
5464
5655
|
);
|
|
5465
5656
|
}
|
|
5466
5657
|
async create(key, attrs = {}) {
|
|
5467
|
-
return
|
|
5658
|
+
return unwrap30(
|
|
5468
5659
|
await this.http.post("/admin/email-templates", {
|
|
5469
5660
|
key,
|
|
5470
5661
|
...strip(attrs)
|
|
@@ -5472,7 +5663,7 @@ var EmailTemplates = class {
|
|
|
5472
5663
|
);
|
|
5473
5664
|
}
|
|
5474
5665
|
async update(key, attrs) {
|
|
5475
|
-
return
|
|
5666
|
+
return unwrap30(
|
|
5476
5667
|
await this.http.put(
|
|
5477
5668
|
`/admin/email-templates/${key}`,
|
|
5478
5669
|
strip(attrs)
|
|
@@ -5480,7 +5671,7 @@ var EmailTemplates = class {
|
|
|
5480
5671
|
);
|
|
5481
5672
|
}
|
|
5482
5673
|
async reset(key) {
|
|
5483
|
-
return
|
|
5674
|
+
return unwrap30(
|
|
5484
5675
|
await this.http.post(`/admin/email-templates/${key}/reset`)
|
|
5485
5676
|
);
|
|
5486
5677
|
}
|
|
@@ -5496,17 +5687,17 @@ var EmailInbox = class {
|
|
|
5496
5687
|
);
|
|
5497
5688
|
}
|
|
5498
5689
|
async send(attrs) {
|
|
5499
|
-
return
|
|
5690
|
+
return unwrap30(
|
|
5500
5691
|
await this.http.post("/admin/email-inbox/send", strip(attrs))
|
|
5501
5692
|
);
|
|
5502
5693
|
}
|
|
5503
5694
|
async markRead(messageId) {
|
|
5504
|
-
return
|
|
5695
|
+
return unwrap30(
|
|
5505
5696
|
await this.http.post(`/admin/email-inbox/${messageId}/read`)
|
|
5506
5697
|
);
|
|
5507
5698
|
}
|
|
5508
5699
|
async archive(messageId) {
|
|
5509
|
-
return
|
|
5700
|
+
return unwrap30(
|
|
5510
5701
|
await this.http.post(`/admin/email-inbox/${messageId}/archive`)
|
|
5511
5702
|
);
|
|
5512
5703
|
}
|
|
@@ -5546,7 +5737,7 @@ var Embeddings = class {
|
|
|
5546
5737
|
};
|
|
5547
5738
|
|
|
5548
5739
|
// src/resources/external-keys.ts
|
|
5549
|
-
function
|
|
5740
|
+
function unwrap31(payload) {
|
|
5550
5741
|
if (payload && typeof payload === "object") {
|
|
5551
5742
|
const p = payload;
|
|
5552
5743
|
for (const k of ["data", "external_keys", "items"]) {
|
|
@@ -5555,7 +5746,7 @@ function unwrap30(payload) {
|
|
|
5555
5746
|
}
|
|
5556
5747
|
return payload;
|
|
5557
5748
|
}
|
|
5558
|
-
function
|
|
5749
|
+
function stripUndefined16(input) {
|
|
5559
5750
|
return Object.fromEntries(
|
|
5560
5751
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
5561
5752
|
);
|
|
@@ -5568,22 +5759,22 @@ var ExternalKeys = class {
|
|
|
5568
5759
|
/** List configured external keys. */
|
|
5569
5760
|
async list() {
|
|
5570
5761
|
const data = await this.http.get("/external-keys");
|
|
5571
|
-
const result =
|
|
5762
|
+
const result = unwrap31(data);
|
|
5572
5763
|
if (Array.isArray(result)) return result;
|
|
5573
5764
|
return [];
|
|
5574
5765
|
}
|
|
5575
5766
|
/** Create / register an external provider key. */
|
|
5576
5767
|
async create(params) {
|
|
5577
|
-
const body4 =
|
|
5768
|
+
const body4 = stripUndefined16(params);
|
|
5578
5769
|
const data = await this.http.post("/external-keys", body4);
|
|
5579
|
-
return
|
|
5770
|
+
return unwrap31(data);
|
|
5580
5771
|
}
|
|
5581
5772
|
/** Resolve (preview) the stored key for a provider. */
|
|
5582
5773
|
async resolve(provider) {
|
|
5583
5774
|
const data = await this.http.get(
|
|
5584
5775
|
`/external-keys/${provider}/resolve`
|
|
5585
5776
|
);
|
|
5586
|
-
return
|
|
5777
|
+
return unwrap31(data);
|
|
5587
5778
|
}
|
|
5588
5779
|
/**
|
|
5589
5780
|
* Delete the stored key for a provider.
|
|
@@ -5593,7 +5784,7 @@ var ExternalKeys = class {
|
|
|
5593
5784
|
await this.http.delete(`/external-keys/${provider}`);
|
|
5594
5785
|
}
|
|
5595
5786
|
};
|
|
5596
|
-
function
|
|
5787
|
+
function unwrap32(payload) {
|
|
5597
5788
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
5598
5789
|
return payload.data;
|
|
5599
5790
|
}
|
|
@@ -5609,7 +5800,7 @@ function listItems5(payload, candidateKeys = ["data", "domains", "items"]) {
|
|
|
5609
5800
|
}
|
|
5610
5801
|
return [];
|
|
5611
5802
|
}
|
|
5612
|
-
function
|
|
5803
|
+
function stripUndefined17(input) {
|
|
5613
5804
|
return Object.fromEntries(
|
|
5614
5805
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
5615
5806
|
);
|
|
@@ -5623,8 +5814,8 @@ var FlatCustomDomains = class {
|
|
|
5623
5814
|
}
|
|
5624
5815
|
http;
|
|
5625
5816
|
async list(params = {}) {
|
|
5626
|
-
const
|
|
5627
|
-
const data = await this.http.get("/custom-domains",
|
|
5817
|
+
const query3 = stripUndefined17({ ...params });
|
|
5818
|
+
const data = await this.http.get("/custom-domains", query3);
|
|
5628
5819
|
return listItems5(data);
|
|
5629
5820
|
}
|
|
5630
5821
|
async create(params) {
|
|
@@ -5635,7 +5826,7 @@ var FlatCustomDomains = class {
|
|
|
5635
5826
|
redirectPolicy,
|
|
5636
5827
|
...rest
|
|
5637
5828
|
} = params;
|
|
5638
|
-
const body4 =
|
|
5829
|
+
const body4 = stripUndefined17({
|
|
5639
5830
|
...rest,
|
|
5640
5831
|
resource_type: resourceType ?? rest.resource_type,
|
|
5641
5832
|
resource_id: resourceId ?? rest.resource_id,
|
|
@@ -5646,13 +5837,13 @@ var FlatCustomDomains = class {
|
|
|
5646
5837
|
body: body4,
|
|
5647
5838
|
headers: { "Idempotency-Key": idempotencyKey5(ikey) }
|
|
5648
5839
|
});
|
|
5649
|
-
return
|
|
5840
|
+
return unwrap32(data);
|
|
5650
5841
|
}
|
|
5651
5842
|
async delete(domainId) {
|
|
5652
5843
|
await this.http.delete(`/custom-domains/${domainId}`);
|
|
5653
5844
|
}
|
|
5654
5845
|
};
|
|
5655
|
-
function
|
|
5846
|
+
function unwrap33(payload) {
|
|
5656
5847
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
5657
5848
|
return payload.data;
|
|
5658
5849
|
}
|
|
@@ -5668,7 +5859,7 @@ function listItems6(payload, candidateKeys = ["data", "functions", "items"]) {
|
|
|
5668
5859
|
}
|
|
5669
5860
|
return [];
|
|
5670
5861
|
}
|
|
5671
|
-
function
|
|
5862
|
+
function stripUndefined18(input) {
|
|
5672
5863
|
return Object.fromEntries(
|
|
5673
5864
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
5674
5865
|
);
|
|
@@ -5682,17 +5873,17 @@ var Functions = class {
|
|
|
5682
5873
|
}
|
|
5683
5874
|
http;
|
|
5684
5875
|
async list(params = {}) {
|
|
5685
|
-
const
|
|
5686
|
-
const data = await this.http.get("/functions",
|
|
5876
|
+
const query3 = stripUndefined18({ ...params });
|
|
5877
|
+
const data = await this.http.get("/functions", query3);
|
|
5687
5878
|
return listItems6(data);
|
|
5688
5879
|
}
|
|
5689
5880
|
async get(functionId) {
|
|
5690
5881
|
const data = await this.http.get(`/functions/${functionId}`);
|
|
5691
|
-
return
|
|
5882
|
+
return unwrap33(data);
|
|
5692
5883
|
}
|
|
5693
5884
|
async create(params) {
|
|
5694
5885
|
const { idempotencyKey: ikey, memoryMb, timeoutSec, ...rest } = params;
|
|
5695
|
-
const body4 =
|
|
5886
|
+
const body4 = stripUndefined18({
|
|
5696
5887
|
...rest,
|
|
5697
5888
|
memory_mb: memoryMb ?? rest.memory_mb,
|
|
5698
5889
|
timeout_sec: timeoutSec ?? rest.timeout_sec
|
|
@@ -5702,11 +5893,11 @@ var Functions = class {
|
|
|
5702
5893
|
body: body4,
|
|
5703
5894
|
headers: { "Idempotency-Key": idempotencyKey6(ikey) }
|
|
5704
5895
|
});
|
|
5705
|
-
return
|
|
5896
|
+
return unwrap33(data);
|
|
5706
5897
|
}
|
|
5707
5898
|
async update(functionId, params) {
|
|
5708
5899
|
const { memoryMb, timeoutSec, ...rest } = params;
|
|
5709
|
-
const body4 =
|
|
5900
|
+
const body4 = stripUndefined18({
|
|
5710
5901
|
...rest,
|
|
5711
5902
|
memory_mb: memoryMb ?? rest.memory_mb,
|
|
5712
5903
|
timeout_sec: timeoutSec ?? rest.timeout_sec
|
|
@@ -5715,7 +5906,7 @@ var Functions = class {
|
|
|
5715
5906
|
`/functions/${functionId}`,
|
|
5716
5907
|
body4
|
|
5717
5908
|
);
|
|
5718
|
-
return
|
|
5909
|
+
return unwrap33(data);
|
|
5719
5910
|
}
|
|
5720
5911
|
async delete(functionId) {
|
|
5721
5912
|
await this.http.delete(`/functions/${functionId}`);
|
|
@@ -5736,7 +5927,7 @@ var Functions = class {
|
|
|
5736
5927
|
return data ?? {};
|
|
5737
5928
|
}
|
|
5738
5929
|
};
|
|
5739
|
-
function
|
|
5930
|
+
function unwrap34(payload) {
|
|
5740
5931
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
5741
5932
|
return payload.data;
|
|
5742
5933
|
}
|
|
@@ -5752,7 +5943,7 @@ function listItems7(payload, candidateKeys = ["data", "health_checks", "items"])
|
|
|
5752
5943
|
}
|
|
5753
5944
|
return [];
|
|
5754
5945
|
}
|
|
5755
|
-
function
|
|
5946
|
+
function stripUndefined19(input) {
|
|
5756
5947
|
return Object.fromEntries(
|
|
5757
5948
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
5758
5949
|
);
|
|
@@ -5766,13 +5957,13 @@ var HealthChecks = class {
|
|
|
5766
5957
|
}
|
|
5767
5958
|
http;
|
|
5768
5959
|
async list(params = {}) {
|
|
5769
|
-
const
|
|
5770
|
-
const data = await this.http.get("/health-checks",
|
|
5960
|
+
const query3 = stripUndefined19({ ...params });
|
|
5961
|
+
const data = await this.http.get("/health-checks", query3);
|
|
5771
5962
|
return listItems7(data);
|
|
5772
5963
|
}
|
|
5773
5964
|
async get(checkId) {
|
|
5774
5965
|
const data = await this.http.get(`/health-checks/${checkId}`);
|
|
5775
|
-
return
|
|
5966
|
+
return unwrap34(data);
|
|
5776
5967
|
}
|
|
5777
5968
|
async create(params) {
|
|
5778
5969
|
const {
|
|
@@ -5782,7 +5973,7 @@ var HealthChecks = class {
|
|
|
5782
5973
|
expectedStatus,
|
|
5783
5974
|
...rest
|
|
5784
5975
|
} = params;
|
|
5785
|
-
const body4 =
|
|
5976
|
+
const body4 = stripUndefined19({
|
|
5786
5977
|
...rest,
|
|
5787
5978
|
interval_sec: intervalSec ?? rest.interval_sec,
|
|
5788
5979
|
timeout_sec: timeoutSec ?? rest.timeout_sec,
|
|
@@ -5793,11 +5984,11 @@ var HealthChecks = class {
|
|
|
5793
5984
|
body: body4,
|
|
5794
5985
|
headers: { "Idempotency-Key": idempotencyKey7(ikey) }
|
|
5795
5986
|
});
|
|
5796
|
-
return
|
|
5987
|
+
return unwrap34(data);
|
|
5797
5988
|
}
|
|
5798
5989
|
async update(checkId, params) {
|
|
5799
5990
|
const { intervalSec, timeoutSec, expectedStatus, ...rest } = params;
|
|
5800
|
-
const body4 =
|
|
5991
|
+
const body4 = stripUndefined19({
|
|
5801
5992
|
...rest,
|
|
5802
5993
|
interval_sec: intervalSec ?? rest.interval_sec,
|
|
5803
5994
|
timeout_sec: timeoutSec ?? rest.timeout_sec,
|
|
@@ -5807,7 +5998,7 @@ var HealthChecks = class {
|
|
|
5807
5998
|
`/health-checks/${checkId}`,
|
|
5808
5999
|
body4
|
|
5809
6000
|
);
|
|
5810
|
-
return
|
|
6001
|
+
return unwrap34(data);
|
|
5811
6002
|
}
|
|
5812
6003
|
async delete(checkId) {
|
|
5813
6004
|
await this.http.delete(`/health-checks/${checkId}`);
|
|
@@ -5815,7 +6006,7 @@ var HealthChecks = class {
|
|
|
5815
6006
|
};
|
|
5816
6007
|
|
|
5817
6008
|
// src/resources/integrations.ts
|
|
5818
|
-
function
|
|
6009
|
+
function unwrap35(payload) {
|
|
5819
6010
|
if (payload && typeof payload === "object") {
|
|
5820
6011
|
const p = payload;
|
|
5821
6012
|
for (const k of ["data", "integrations", "catalog", "items"]) {
|
|
@@ -5825,11 +6016,11 @@ function unwrap34(payload) {
|
|
|
5825
6016
|
return payload;
|
|
5826
6017
|
}
|
|
5827
6018
|
function listItems8(payload) {
|
|
5828
|
-
const result =
|
|
6019
|
+
const result = unwrap35(payload);
|
|
5829
6020
|
if (Array.isArray(result)) return result;
|
|
5830
6021
|
return [];
|
|
5831
6022
|
}
|
|
5832
|
-
function
|
|
6023
|
+
function stripUndefined20(input) {
|
|
5833
6024
|
return Object.fromEntries(
|
|
5834
6025
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
5835
6026
|
);
|
|
@@ -5854,14 +6045,14 @@ var Integrations = class {
|
|
|
5854
6045
|
const data = await this.http.get(
|
|
5855
6046
|
`/integrations/${provider}/start`
|
|
5856
6047
|
);
|
|
5857
|
-
return
|
|
6048
|
+
return unwrap35(data);
|
|
5858
6049
|
}
|
|
5859
6050
|
/** Force-refresh the access token for a provider. */
|
|
5860
6051
|
async refresh(provider) {
|
|
5861
6052
|
const data = await this.http.post(
|
|
5862
6053
|
`/integrations/${provider}/refresh`
|
|
5863
6054
|
);
|
|
5864
|
-
return
|
|
6055
|
+
return unwrap35(data);
|
|
5865
6056
|
}
|
|
5866
6057
|
/** Disconnect (revoke) an integration. */
|
|
5867
6058
|
async disconnect(provider) {
|
|
@@ -5881,41 +6072,41 @@ var Integrations = class {
|
|
|
5881
6072
|
// ── Test hooks ─────────────────────────────────────────────────────────────
|
|
5882
6073
|
/** Send a test message to the connected Slack channel. */
|
|
5883
6074
|
async slackSendTest(params = {}) {
|
|
5884
|
-
const body4 =
|
|
6075
|
+
const body4 = stripUndefined20(params);
|
|
5885
6076
|
const data = await this.http.post(
|
|
5886
6077
|
"/integrations/slack/send-test",
|
|
5887
6078
|
body4
|
|
5888
6079
|
);
|
|
5889
|
-
return
|
|
6080
|
+
return unwrap35(data);
|
|
5890
6081
|
}
|
|
5891
6082
|
/** Send a test message to the connected Discord channel. */
|
|
5892
6083
|
async discordSendTest(params = {}) {
|
|
5893
|
-
const body4 =
|
|
6084
|
+
const body4 = stripUndefined20(params);
|
|
5894
6085
|
const data = await this.http.post(
|
|
5895
6086
|
"/integrations/discord/send-test",
|
|
5896
6087
|
body4
|
|
5897
6088
|
);
|
|
5898
|
-
return
|
|
6089
|
+
return unwrap35(data);
|
|
5899
6090
|
}
|
|
5900
6091
|
// ── Linear dedicated controller ────────────────────────────────────────────
|
|
5901
6092
|
/** Begin Linear OAuth — Linear has provider-specific error shapes. */
|
|
5902
6093
|
async linearStart() {
|
|
5903
6094
|
const data = await this.http.get("/integrations/linear/start");
|
|
5904
|
-
return
|
|
6095
|
+
return unwrap35(data);
|
|
5905
6096
|
}
|
|
5906
6097
|
/** Create a Linear issue via the connected workspace. */
|
|
5907
6098
|
async linearCreateIssue(params = {}) {
|
|
5908
|
-
const body4 =
|
|
6099
|
+
const body4 = stripUndefined20(params);
|
|
5909
6100
|
const data = await this.http.post(
|
|
5910
6101
|
"/integrations/linear/create-issue",
|
|
5911
6102
|
body4
|
|
5912
6103
|
);
|
|
5913
|
-
return
|
|
6104
|
+
return unwrap35(data);
|
|
5914
6105
|
}
|
|
5915
6106
|
};
|
|
5916
6107
|
|
|
5917
6108
|
// src/resources/mcp.ts
|
|
5918
|
-
function
|
|
6109
|
+
function unwrap36(payload) {
|
|
5919
6110
|
if (payload && typeof payload === "object") {
|
|
5920
6111
|
const p = payload;
|
|
5921
6112
|
for (const k of ["data", "mcp", "result", "items"]) {
|
|
@@ -5924,7 +6115,7 @@ function unwrap35(payload) {
|
|
|
5924
6115
|
}
|
|
5925
6116
|
return payload;
|
|
5926
6117
|
}
|
|
5927
|
-
function
|
|
6118
|
+
function stripUndefined21(input) {
|
|
5928
6119
|
return Object.fromEntries(
|
|
5929
6120
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
5930
6121
|
);
|
|
@@ -5936,12 +6127,12 @@ var Mcp = class {
|
|
|
5936
6127
|
http;
|
|
5937
6128
|
/** Send a JSON-RPC request to the MCP endpoint. */
|
|
5938
6129
|
async dispatch(params = {}) {
|
|
5939
|
-
const body4 =
|
|
6130
|
+
const body4 = stripUndefined21(params);
|
|
5940
6131
|
const data = await this.http.post(
|
|
5941
6132
|
"/mcp",
|
|
5942
6133
|
Object.keys(body4).length > 0 ? body4 : void 0
|
|
5943
6134
|
);
|
|
5944
|
-
return
|
|
6135
|
+
return unwrap36(data);
|
|
5945
6136
|
}
|
|
5946
6137
|
/**
|
|
5947
6138
|
* Open the MCP listen channel (GET).
|
|
@@ -5951,7 +6142,7 @@ var Mcp = class {
|
|
|
5951
6142
|
*/
|
|
5952
6143
|
async listen() {
|
|
5953
6144
|
const data = await this.http.get("/mcp");
|
|
5954
|
-
return
|
|
6145
|
+
return unwrap36(data);
|
|
5955
6146
|
}
|
|
5956
6147
|
/** Close (terminate) the MCP session. */
|
|
5957
6148
|
async close() {
|
|
@@ -5960,7 +6151,7 @@ var Mcp = class {
|
|
|
5960
6151
|
};
|
|
5961
6152
|
|
|
5962
6153
|
// src/resources/models.ts
|
|
5963
|
-
function
|
|
6154
|
+
function unwrap37(data) {
|
|
5964
6155
|
if (Array.isArray(data)) return data;
|
|
5965
6156
|
if (data && typeof data === "object") {
|
|
5966
6157
|
const d = data;
|
|
@@ -5977,11 +6168,11 @@ var Models = class {
|
|
|
5977
6168
|
http;
|
|
5978
6169
|
/** List all models available to the calling tenant (OpenAI-compatible shape). */
|
|
5979
6170
|
async list(filters = {}) {
|
|
5980
|
-
const
|
|
6171
|
+
const query3 = Object.fromEntries(
|
|
5981
6172
|
Object.entries(filters).filter(([, v]) => v !== void 0)
|
|
5982
6173
|
);
|
|
5983
|
-
const data = await this.http.get("/intelligence/models",
|
|
5984
|
-
return
|
|
6174
|
+
const data = await this.http.get("/intelligence/models", query3);
|
|
6175
|
+
return unwrap37(data);
|
|
5985
6176
|
}
|
|
5986
6177
|
/**
|
|
5987
6178
|
* Get a single model by id.
|
|
@@ -6624,7 +6815,7 @@ function resourcePayload(params) {
|
|
|
6624
6815
|
return { resource_type, resource_id };
|
|
6625
6816
|
}
|
|
6626
6817
|
function authConfig(params) {
|
|
6627
|
-
return
|
|
6818
|
+
return stripUndefined22({
|
|
6628
6819
|
...params.config ?? {},
|
|
6629
6820
|
signup_enabled: params.signup_enabled ?? params.signupEnabled,
|
|
6630
6821
|
email_confirm_required: params.email_confirm_required ?? params.emailConfirmRequired,
|
|
@@ -6632,12 +6823,12 @@ function authConfig(params) {
|
|
|
6632
6823
|
});
|
|
6633
6824
|
}
|
|
6634
6825
|
function requestBody(params) {
|
|
6635
|
-
return
|
|
6826
|
+
return stripUndefined22({
|
|
6636
6827
|
...resourcePayload(params),
|
|
6637
6828
|
config: authConfig(params)
|
|
6638
6829
|
});
|
|
6639
6830
|
}
|
|
6640
|
-
function
|
|
6831
|
+
function unwrap38(payload) {
|
|
6641
6832
|
if (payload && typeof payload === "object") {
|
|
6642
6833
|
const p = payload;
|
|
6643
6834
|
for (const k of ["data", "project_auth", "config", "items"]) {
|
|
@@ -6646,7 +6837,7 @@ function unwrap37(payload) {
|
|
|
6646
6837
|
}
|
|
6647
6838
|
return payload;
|
|
6648
6839
|
}
|
|
6649
|
-
function
|
|
6840
|
+
function stripUndefined22(input) {
|
|
6650
6841
|
return Object.fromEntries(
|
|
6651
6842
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
6652
6843
|
);
|
|
@@ -6662,13 +6853,13 @@ var ProjectAuth = class {
|
|
|
6662
6853
|
"/project-auth/status",
|
|
6663
6854
|
resourcePayload(params)
|
|
6664
6855
|
);
|
|
6665
|
-
return
|
|
6856
|
+
return unwrap38(data);
|
|
6666
6857
|
}
|
|
6667
6858
|
/** Enable project auth. */
|
|
6668
6859
|
async enable(params) {
|
|
6669
6860
|
const body4 = requestBody(params);
|
|
6670
6861
|
const data = await this.http.post("/project-auth/enable", body4);
|
|
6671
|
-
return
|
|
6862
|
+
return unwrap38(data);
|
|
6672
6863
|
}
|
|
6673
6864
|
/** Disable project auth. */
|
|
6674
6865
|
async disable(params) {
|
|
@@ -6676,18 +6867,18 @@ var ProjectAuth = class {
|
|
|
6676
6867
|
"/project-auth/disable",
|
|
6677
6868
|
resourcePayload(params)
|
|
6678
6869
|
);
|
|
6679
|
-
return
|
|
6870
|
+
return unwrap38(data);
|
|
6680
6871
|
}
|
|
6681
6872
|
/** Update project-auth configuration. */
|
|
6682
6873
|
async update(params) {
|
|
6683
6874
|
const body4 = requestBody(params);
|
|
6684
6875
|
const data = await this.http.patch("/project-auth/config", body4);
|
|
6685
|
-
return
|
|
6876
|
+
return unwrap38(data);
|
|
6686
6877
|
}
|
|
6687
6878
|
};
|
|
6688
6879
|
|
|
6689
6880
|
// src/resources/project-integrations.ts
|
|
6690
|
-
function
|
|
6881
|
+
function unwrap39(payload) {
|
|
6691
6882
|
if (payload && typeof payload === "object") {
|
|
6692
6883
|
const p = payload;
|
|
6693
6884
|
for (const k of ["data", "project_integrations", "catalog", "items"]) {
|
|
@@ -6697,11 +6888,11 @@ function unwrap38(payload) {
|
|
|
6697
6888
|
return payload;
|
|
6698
6889
|
}
|
|
6699
6890
|
function listItems9(payload) {
|
|
6700
|
-
const result =
|
|
6891
|
+
const result = unwrap39(payload);
|
|
6701
6892
|
if (Array.isArray(result)) return result;
|
|
6702
6893
|
return [];
|
|
6703
6894
|
}
|
|
6704
|
-
function
|
|
6895
|
+
function stripUndefined23(input) {
|
|
6705
6896
|
return Object.fromEntries(
|
|
6706
6897
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
6707
6898
|
);
|
|
@@ -6718,8 +6909,8 @@ var ProjectIntegrations = class {
|
|
|
6718
6909
|
http;
|
|
6719
6910
|
/** List project integrations. */
|
|
6720
6911
|
async list(params = {}) {
|
|
6721
|
-
const
|
|
6722
|
-
const data = await this.http.get("/project-integrations",
|
|
6912
|
+
const query3 = stripUndefined23(params);
|
|
6913
|
+
const data = await this.http.get("/project-integrations", query3);
|
|
6723
6914
|
return listItems9(data);
|
|
6724
6915
|
}
|
|
6725
6916
|
/** List supported providers and their schemas. */
|
|
@@ -6732,13 +6923,13 @@ var ProjectIntegrations = class {
|
|
|
6732
6923
|
const data = await this.http.get(
|
|
6733
6924
|
`/project-integrations/${integrationId}`
|
|
6734
6925
|
);
|
|
6735
|
-
return
|
|
6926
|
+
return unwrap39(data);
|
|
6736
6927
|
}
|
|
6737
6928
|
/** Create a project integration. */
|
|
6738
6929
|
async create(params) {
|
|
6739
6930
|
const body4 = stripUndefObj2(params);
|
|
6740
6931
|
const data = await this.http.post("/project-integrations", body4);
|
|
6741
|
-
return
|
|
6932
|
+
return unwrap39(data);
|
|
6742
6933
|
}
|
|
6743
6934
|
/** Update a project integration. */
|
|
6744
6935
|
async update(integrationId, params) {
|
|
@@ -6747,7 +6938,7 @@ var ProjectIntegrations = class {
|
|
|
6747
6938
|
`/project-integrations/${integrationId}`,
|
|
6748
6939
|
body4
|
|
6749
6940
|
);
|
|
6750
|
-
return
|
|
6941
|
+
return unwrap39(data);
|
|
6751
6942
|
}
|
|
6752
6943
|
/** Delete a project integration. */
|
|
6753
6944
|
async delete(integrationId) {
|
|
@@ -6756,7 +6947,7 @@ var ProjectIntegrations = class {
|
|
|
6756
6947
|
};
|
|
6757
6948
|
|
|
6758
6949
|
// src/resources/provider-defaults.ts
|
|
6759
|
-
function
|
|
6950
|
+
function unwrap40(data) {
|
|
6760
6951
|
if (data && typeof data === "object") {
|
|
6761
6952
|
const d = data;
|
|
6762
6953
|
for (const k of ["data", "defaults", "provider_defaults", "config"]) {
|
|
@@ -6772,7 +6963,7 @@ var ProviderDefaults = class {
|
|
|
6772
6963
|
http;
|
|
6773
6964
|
/** Get the current fleet-wide provider defaults. */
|
|
6774
6965
|
async list() {
|
|
6775
|
-
return
|
|
6966
|
+
return unwrap40(await this.http.get("/admin/provider-defaults"));
|
|
6776
6967
|
}
|
|
6777
6968
|
/** Return the defaults entry for a single provider, or {} if missing. */
|
|
6778
6969
|
async get(provider) {
|
|
@@ -6788,13 +6979,13 @@ var ProviderDefaults = class {
|
|
|
6788
6979
|
const body4 = Object.fromEntries(
|
|
6789
6980
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
6790
6981
|
);
|
|
6791
|
-
return
|
|
6982
|
+
return unwrap40(
|
|
6792
6983
|
await this.http.put("/admin/provider-defaults", body4)
|
|
6793
6984
|
);
|
|
6794
6985
|
}
|
|
6795
6986
|
// ── Per-tenant overrides ────────────────────────────────────────────────
|
|
6796
6987
|
async getTenant(tenantId) {
|
|
6797
|
-
return
|
|
6988
|
+
return unwrap40(
|
|
6798
6989
|
await this.http.get(
|
|
6799
6990
|
`/admin/tenants/${tenantId}/provider-config`
|
|
6800
6991
|
)
|
|
@@ -6804,7 +6995,7 @@ var ProviderDefaults = class {
|
|
|
6804
6995
|
const body4 = Object.fromEntries(
|
|
6805
6996
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
6806
6997
|
);
|
|
6807
|
-
return
|
|
6998
|
+
return unwrap40(
|
|
6808
6999
|
await this.http.put(
|
|
6809
7000
|
`/admin/tenants/${tenantId}/provider-config`,
|
|
6810
7001
|
body4
|
|
@@ -6817,7 +7008,7 @@ var ProviderDefaults = class {
|
|
|
6817
7008
|
};
|
|
6818
7009
|
|
|
6819
7010
|
// src/resources/regions.ts
|
|
6820
|
-
function
|
|
7011
|
+
function unwrap41(payload) {
|
|
6821
7012
|
if (payload && typeof payload === "object") {
|
|
6822
7013
|
const p = payload;
|
|
6823
7014
|
for (const k of [
|
|
@@ -6834,7 +7025,7 @@ function unwrap40(payload) {
|
|
|
6834
7025
|
return payload;
|
|
6835
7026
|
}
|
|
6836
7027
|
function listItems10(payload) {
|
|
6837
|
-
const result =
|
|
7028
|
+
const result = unwrap41(payload);
|
|
6838
7029
|
if (Array.isArray(result)) return result;
|
|
6839
7030
|
return [];
|
|
6840
7031
|
}
|
|
@@ -6856,7 +7047,7 @@ var Regions = class {
|
|
|
6856
7047
|
/** Get static compute pricing data. */
|
|
6857
7048
|
async pricing() {
|
|
6858
7049
|
const data = await this.http.get("/compute/pricing");
|
|
6859
|
-
return
|
|
7050
|
+
return unwrap41(data);
|
|
6860
7051
|
}
|
|
6861
7052
|
/** List community computer templates. */
|
|
6862
7053
|
async listTemplates() {
|
|
@@ -6868,12 +7059,12 @@ var Regions = class {
|
|
|
6868
7059
|
const data = await this.http.get(
|
|
6869
7060
|
`/compute/templates/${templateId}`
|
|
6870
7061
|
);
|
|
6871
|
-
return
|
|
7062
|
+
return unwrap41(data);
|
|
6872
7063
|
}
|
|
6873
7064
|
};
|
|
6874
7065
|
|
|
6875
7066
|
// src/resources/runtime-env.ts
|
|
6876
|
-
function
|
|
7067
|
+
function unwrap42(payload) {
|
|
6877
7068
|
if (payload !== null && typeof payload === "object" && "data" in payload && payload.data !== void 0) {
|
|
6878
7069
|
return payload.data;
|
|
6879
7070
|
}
|
|
@@ -6893,7 +7084,7 @@ function body3(params) {
|
|
|
6893
7084
|
}).filter(([, value]) => value !== void 0)
|
|
6894
7085
|
);
|
|
6895
7086
|
}
|
|
6896
|
-
function
|
|
7087
|
+
function query2(params) {
|
|
6897
7088
|
return {
|
|
6898
7089
|
scope: params.scope,
|
|
6899
7090
|
workspace_id: params.workspaceId ?? params.workspace_id,
|
|
@@ -6924,13 +7115,13 @@ var RuntimeEnv = class {
|
|
|
6924
7115
|
async list(params = {}) {
|
|
6925
7116
|
const response = await this.http.get(
|
|
6926
7117
|
"/runtime-env",
|
|
6927
|
-
|
|
7118
|
+
query2(params)
|
|
6928
7119
|
);
|
|
6929
|
-
return
|
|
7120
|
+
return unwrap42(response).map(normalize2);
|
|
6930
7121
|
}
|
|
6931
7122
|
async get(id) {
|
|
6932
7123
|
return normalize2(
|
|
6933
|
-
|
|
7124
|
+
unwrap42(
|
|
6934
7125
|
await this.http.get(
|
|
6935
7126
|
`/runtime-env/${encodeURIComponent(id)}`
|
|
6936
7127
|
)
|
|
@@ -6939,7 +7130,7 @@ var RuntimeEnv = class {
|
|
|
6939
7130
|
}
|
|
6940
7131
|
async set(params) {
|
|
6941
7132
|
return normalize2(
|
|
6942
|
-
|
|
7133
|
+
unwrap42(
|
|
6943
7134
|
await this.http.post(
|
|
6944
7135
|
"/runtime-env",
|
|
6945
7136
|
body3(params)
|
|
@@ -6953,7 +7144,7 @@ var RuntimeEnv = class {
|
|
|
6953
7144
|
};
|
|
6954
7145
|
|
|
6955
7146
|
// src/resources/runtime-capabilities.ts
|
|
6956
|
-
function
|
|
7147
|
+
function unwrap43(payload) {
|
|
6957
7148
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
6958
7149
|
return payload.data;
|
|
6959
7150
|
}
|
|
@@ -6965,7 +7156,7 @@ var RuntimeCapabilitiesResource = class {
|
|
|
6965
7156
|
}
|
|
6966
7157
|
http;
|
|
6967
7158
|
async get() {
|
|
6968
|
-
return
|
|
7159
|
+
return unwrap43(
|
|
6969
7160
|
await this.http.get("/runtime-capabilities")
|
|
6970
7161
|
);
|
|
6971
7162
|
}
|
|
@@ -6985,7 +7176,7 @@ var AGENT_WORKSPACE_TIMEOUT_SEC = 86400;
|
|
|
6985
7176
|
var AGENT_WORKSPACE_IDLE_TIMEOUT_SEC = 1800;
|
|
6986
7177
|
var AGENT_WORKSPACE_SNAPSHOT_EXPIRATION_DAYS = 30;
|
|
6987
7178
|
var AGENT_WORKSPACE_KEEP_LAST_SNAPSHOTS = 1;
|
|
6988
|
-
function
|
|
7179
|
+
function unwrap44(payload) {
|
|
6989
7180
|
if (payload !== null && typeof payload === "object" && "data" in payload && payload.data !== void 0) {
|
|
6990
7181
|
return payload.data;
|
|
6991
7182
|
}
|
|
@@ -7032,7 +7223,7 @@ function createBody(params = {}) {
|
|
|
7032
7223
|
if (keepLastSnapshots !== void 0) {
|
|
7033
7224
|
metadata.keep_last_snapshots = keepLastSnapshots;
|
|
7034
7225
|
}
|
|
7035
|
-
return
|
|
7226
|
+
return stripUndefined24({
|
|
7036
7227
|
template_id: templateId,
|
|
7037
7228
|
cpu_count: params.cpuCount ?? params.cpu_count,
|
|
7038
7229
|
memory_mb: params.memoryMb ?? params.memory_mb,
|
|
@@ -7062,14 +7253,14 @@ function createBody(params = {}) {
|
|
|
7062
7253
|
});
|
|
7063
7254
|
}
|
|
7064
7255
|
function execBody(command, options = {}) {
|
|
7065
|
-
return
|
|
7256
|
+
return stripUndefined24({
|
|
7066
7257
|
command,
|
|
7067
7258
|
cwd: options.cwd ?? options.workingDir ?? options.working_dir,
|
|
7068
7259
|
env: options.env,
|
|
7069
7260
|
timeout: options.timeout ?? options.timeoutSec ?? options.timeout_sec
|
|
7070
7261
|
});
|
|
7071
7262
|
}
|
|
7072
|
-
function
|
|
7263
|
+
function stripUndefined24(input) {
|
|
7073
7264
|
return Object.fromEntries(
|
|
7074
7265
|
Object.entries(input).filter(([, value]) => value !== void 0)
|
|
7075
7266
|
);
|
|
@@ -7162,6 +7353,9 @@ var SandboxPreview = class {
|
|
|
7162
7353
|
expose(port) {
|
|
7163
7354
|
return this.sandbox.expose(port);
|
|
7164
7355
|
}
|
|
7356
|
+
exposeInfo(port) {
|
|
7357
|
+
return this.sandbox.exposeInfo(port);
|
|
7358
|
+
}
|
|
7165
7359
|
};
|
|
7166
7360
|
var SandboxArtifacts = class {
|
|
7167
7361
|
constructor(sandbox) {
|
|
@@ -7211,7 +7405,7 @@ var SandboxTerminal = class {
|
|
|
7211
7405
|
const body4 = Object.fromEntries(
|
|
7212
7406
|
Object.entries(params).filter(([, v]) => v !== void 0)
|
|
7213
7407
|
);
|
|
7214
|
-
const response =
|
|
7408
|
+
const response = unwrap44(
|
|
7215
7409
|
await this.sandbox.http.post(`/sandboxes/${this.sandbox.id}/terminal`, body4)
|
|
7216
7410
|
);
|
|
7217
7411
|
return response;
|
|
@@ -7260,7 +7454,7 @@ var SandboxPreviews = class {
|
|
|
7260
7454
|
Object.entries(opts).filter(([, v]) => v !== void 0)
|
|
7261
7455
|
)
|
|
7262
7456
|
};
|
|
7263
|
-
return
|
|
7457
|
+
return unwrap44(
|
|
7264
7458
|
await this.http.post(
|
|
7265
7459
|
`/sandboxes/${this.sandbox.id}/previews`,
|
|
7266
7460
|
body4
|
|
@@ -7268,7 +7462,7 @@ var SandboxPreviews = class {
|
|
|
7268
7462
|
);
|
|
7269
7463
|
}
|
|
7270
7464
|
async get(previewId) {
|
|
7271
|
-
return
|
|
7465
|
+
return unwrap44(
|
|
7272
7466
|
await this.http.get(
|
|
7273
7467
|
`/sandboxes/${this.sandbox.id}/previews/${previewId}`
|
|
7274
7468
|
)
|
|
@@ -7281,7 +7475,7 @@ var SandboxPreviews = class {
|
|
|
7281
7475
|
}
|
|
7282
7476
|
/** Mint a share token for previewId. */
|
|
7283
7477
|
async share(previewId, opts = {}) {
|
|
7284
|
-
return
|
|
7478
|
+
return unwrap44(
|
|
7285
7479
|
await this.http.post(
|
|
7286
7480
|
`/sandboxes/${this.sandbox.id}/previews/${previewId}/share`,
|
|
7287
7481
|
{ ttl_seconds: opts.ttl_seconds ?? opts.expires_in_sec ?? 3600 }
|
|
@@ -7350,7 +7544,7 @@ var SandboxTags = class {
|
|
|
7350
7544
|
sandbox;
|
|
7351
7545
|
/** Replace the full tag list with tags. */
|
|
7352
7546
|
async set(tags) {
|
|
7353
|
-
return
|
|
7547
|
+
return unwrap44(
|
|
7354
7548
|
await this.sandbox.http.patch(`/sandboxes/${this.sandbox.id}/tags`, { tags })
|
|
7355
7549
|
);
|
|
7356
7550
|
}
|
|
@@ -7421,14 +7615,14 @@ var Sandbox = class _Sandbox {
|
|
|
7421
7615
|
return this.data.template_id ?? this.data.image_id ?? "";
|
|
7422
7616
|
}
|
|
7423
7617
|
async refresh() {
|
|
7424
|
-
this.data =
|
|
7618
|
+
this.data = unwrap44(
|
|
7425
7619
|
await this.http.get(`/sandboxes/${this.id}`)
|
|
7426
7620
|
);
|
|
7427
7621
|
return this;
|
|
7428
7622
|
}
|
|
7429
7623
|
async runExec(command, options) {
|
|
7430
7624
|
this.assertRunning("exec");
|
|
7431
|
-
const response =
|
|
7625
|
+
const response = unwrap44(
|
|
7432
7626
|
await this.http.post(
|
|
7433
7627
|
`/sandboxes/${this.id}/exec`,
|
|
7434
7628
|
execBody(command, options)
|
|
@@ -7473,7 +7667,7 @@ var Sandbox = class _Sandbox {
|
|
|
7473
7667
|
}
|
|
7474
7668
|
async createExport(params) {
|
|
7475
7669
|
const body4 = typeof params === "string" ? { path: params } : Array.isArray(params) ? { paths: params } : params;
|
|
7476
|
-
const response =
|
|
7670
|
+
const response = unwrap44(
|
|
7477
7671
|
await this.http.post(
|
|
7478
7672
|
`/sandboxes/${this.id}/exports`,
|
|
7479
7673
|
body4
|
|
@@ -7482,15 +7676,15 @@ var Sandbox = class _Sandbox {
|
|
|
7482
7676
|
return normalizeExport(response);
|
|
7483
7677
|
}
|
|
7484
7678
|
async downloadExport(paths, options = {}) {
|
|
7485
|
-
const
|
|
7679
|
+
const query3 = new URLSearchParams();
|
|
7486
7680
|
if (Array.isArray(paths)) {
|
|
7487
|
-
for (const path of paths)
|
|
7681
|
+
for (const path of paths) query3.append("paths[]", path);
|
|
7488
7682
|
} else {
|
|
7489
|
-
|
|
7683
|
+
query3.set("path", paths);
|
|
7490
7684
|
}
|
|
7491
|
-
if (options.filename)
|
|
7685
|
+
if (options.filename) query3.set("filename", options.filename);
|
|
7492
7686
|
return this.http.getBinary(
|
|
7493
|
-
`/sandboxes/${this.id}/exports/download?${
|
|
7687
|
+
`/sandboxes/${this.id}/exports/download?${query3.toString()}`
|
|
7494
7688
|
);
|
|
7495
7689
|
}
|
|
7496
7690
|
async readFile(path) {
|
|
@@ -7498,7 +7692,7 @@ var Sandbox = class _Sandbox {
|
|
|
7498
7692
|
}
|
|
7499
7693
|
async listFiles(path = "/workspace") {
|
|
7500
7694
|
this.assertRunning("files.list");
|
|
7501
|
-
const response =
|
|
7695
|
+
const response = unwrap44(
|
|
7502
7696
|
await this.http.get(
|
|
7503
7697
|
`/sandboxes/${this.id}/files`,
|
|
7504
7698
|
{ path }
|
|
@@ -7508,7 +7702,7 @@ var Sandbox = class _Sandbox {
|
|
|
7508
7702
|
}
|
|
7509
7703
|
async statFile(path) {
|
|
7510
7704
|
this.assertRunning("files.stat");
|
|
7511
|
-
return
|
|
7705
|
+
return unwrap44(
|
|
7512
7706
|
await this.http.post(
|
|
7513
7707
|
`/sandboxes/${this.id}/files/stat`,
|
|
7514
7708
|
{ path }
|
|
@@ -7516,18 +7710,21 @@ var Sandbox = class _Sandbox {
|
|
|
7516
7710
|
);
|
|
7517
7711
|
}
|
|
7518
7712
|
async expose(port) {
|
|
7713
|
+
return (await this.exposeInfo(port)).url;
|
|
7714
|
+
}
|
|
7715
|
+
async exposeInfo(port) {
|
|
7519
7716
|
this.assertRunning("expose");
|
|
7520
|
-
const response =
|
|
7717
|
+
const response = unwrap44(
|
|
7521
7718
|
await this.http.post(
|
|
7522
7719
|
`/sandboxes/${this.id}/expose`,
|
|
7523
7720
|
port === void 0 ? {} : { port }
|
|
7524
7721
|
)
|
|
7525
7722
|
);
|
|
7526
|
-
return
|
|
7723
|
+
return previewInfoFromResponse(response);
|
|
7527
7724
|
}
|
|
7528
7725
|
async startTemplate(options = {}) {
|
|
7529
7726
|
this.assertRunning("startTemplate");
|
|
7530
|
-
return
|
|
7727
|
+
return unwrap44(
|
|
7531
7728
|
await this.http.post(
|
|
7532
7729
|
`/sandboxes/${this.id}/template/start`,
|
|
7533
7730
|
options
|
|
@@ -7535,7 +7732,7 @@ var Sandbox = class _Sandbox {
|
|
|
7535
7732
|
);
|
|
7536
7733
|
}
|
|
7537
7734
|
async getArtifacts() {
|
|
7538
|
-
return
|
|
7735
|
+
return unwrap44(
|
|
7539
7736
|
await this.http.get(
|
|
7540
7737
|
`/sandboxes/${this.id}/artifacts`
|
|
7541
7738
|
)
|
|
@@ -7546,7 +7743,7 @@ var Sandbox = class _Sandbox {
|
|
|
7546
7743
|
`/sandboxes/${this.id}/logs`,
|
|
7547
7744
|
{ lines }
|
|
7548
7745
|
);
|
|
7549
|
-
return
|
|
7746
|
+
return unwrap44(response);
|
|
7550
7747
|
}
|
|
7551
7748
|
streamLogs() {
|
|
7552
7749
|
return this.http.stream(
|
|
@@ -7555,7 +7752,7 @@ var Sandbox = class _Sandbox {
|
|
|
7555
7752
|
}
|
|
7556
7753
|
async createSnapshot(comment) {
|
|
7557
7754
|
this.assertRunning("snapshots.create");
|
|
7558
|
-
return
|
|
7755
|
+
return unwrap44(
|
|
7559
7756
|
await this.http.post(
|
|
7560
7757
|
`/sandboxes/${this.id}/snapshots`,
|
|
7561
7758
|
comment ? { comment } : {}
|
|
@@ -7563,14 +7760,14 @@ var Sandbox = class _Sandbox {
|
|
|
7563
7760
|
);
|
|
7564
7761
|
}
|
|
7565
7762
|
async listSnapshots() {
|
|
7566
|
-
return
|
|
7763
|
+
return unwrap44(
|
|
7567
7764
|
await this.http.get(
|
|
7568
7765
|
`/sandboxes/${this.id}/snapshots`
|
|
7569
7766
|
)
|
|
7570
7767
|
);
|
|
7571
7768
|
}
|
|
7572
7769
|
async restoreSnapshot(snapshotId) {
|
|
7573
|
-
const data =
|
|
7770
|
+
const data = unwrap44(
|
|
7574
7771
|
await this.http.post(
|
|
7575
7772
|
`/sandboxes/${this.id}/restore/${snapshotId}`,
|
|
7576
7773
|
{}
|
|
@@ -7590,7 +7787,7 @@ var Sandbox = class _Sandbox {
|
|
|
7590
7787
|
const body4 = {};
|
|
7591
7788
|
if (opts.name !== void 0) body4.name = opts.name;
|
|
7592
7789
|
if (opts.metadata !== void 0) body4.metadata = opts.metadata;
|
|
7593
|
-
const data =
|
|
7790
|
+
const data = unwrap44(
|
|
7594
7791
|
await this.http.post(
|
|
7595
7792
|
`/sandboxes/${this.id}/fork`,
|
|
7596
7793
|
body4
|
|
@@ -7612,7 +7809,7 @@ var Sandbox = class _Sandbox {
|
|
|
7612
7809
|
if (keepLastSnapshots !== void 0) {
|
|
7613
7810
|
metadata.keep_last_snapshots = keepLastSnapshots;
|
|
7614
7811
|
}
|
|
7615
|
-
const body4 =
|
|
7812
|
+
const body4 = stripUndefined24({
|
|
7616
7813
|
name: params.name,
|
|
7617
7814
|
slug: params.slug,
|
|
7618
7815
|
tags: params.tags,
|
|
@@ -7621,7 +7818,7 @@ var Sandbox = class _Sandbox {
|
|
|
7621
7818
|
timeout_sec: params.timeout_sec ?? params.timeoutSec,
|
|
7622
7819
|
idle_timeout_sec: params.idle_timeout_sec ?? params.idleTimeoutSec
|
|
7623
7820
|
});
|
|
7624
|
-
const data =
|
|
7821
|
+
const data = unwrap44(
|
|
7625
7822
|
await this.http.patch(
|
|
7626
7823
|
`/sandboxes/${this.id}`,
|
|
7627
7824
|
body4
|
|
@@ -7631,7 +7828,7 @@ var Sandbox = class _Sandbox {
|
|
|
7631
7828
|
return this;
|
|
7632
7829
|
}
|
|
7633
7830
|
async extend(timeoutSec) {
|
|
7634
|
-
const data =
|
|
7831
|
+
const data = unwrap44(
|
|
7635
7832
|
await this.http.post(
|
|
7636
7833
|
`/sandboxes/${this.id}/extend`,
|
|
7637
7834
|
{ timeout_sec: timeoutSec }
|
|
@@ -7654,7 +7851,7 @@ var Sandbox = class _Sandbox {
|
|
|
7654
7851
|
return raw;
|
|
7655
7852
|
}
|
|
7656
7853
|
async pause() {
|
|
7657
|
-
const data =
|
|
7854
|
+
const data = unwrap44(
|
|
7658
7855
|
await this.http.post(
|
|
7659
7856
|
`/sandboxes/${this.id}/pause`,
|
|
7660
7857
|
{}
|
|
@@ -7664,7 +7861,7 @@ var Sandbox = class _Sandbox {
|
|
|
7664
7861
|
return this;
|
|
7665
7862
|
}
|
|
7666
7863
|
async resume() {
|
|
7667
|
-
const data =
|
|
7864
|
+
const data = unwrap44(
|
|
7668
7865
|
await this.http.post(
|
|
7669
7866
|
`/sandboxes/${this.id}/resume`,
|
|
7670
7867
|
{}
|
|
@@ -7677,7 +7874,7 @@ var Sandbox = class _Sandbox {
|
|
|
7677
7874
|
const idempotencyKey11 = params.idempotencyKey ?? params.idempotency_key;
|
|
7678
7875
|
const requestOptions = {
|
|
7679
7876
|
method: "POST",
|
|
7680
|
-
body:
|
|
7877
|
+
body: stripUndefined24({
|
|
7681
7878
|
name: params.name,
|
|
7682
7879
|
deployment_id: params.deploymentId ?? params.deployment_id,
|
|
7683
7880
|
output_path: params.outputPath ?? params.output_path ?? params.path ?? params.sourcePath ?? params.source_path,
|
|
@@ -7700,7 +7897,7 @@ var Sandbox = class _Sandbox {
|
|
|
7700
7897
|
if (idempotencyKey11) {
|
|
7701
7898
|
requestOptions.headers = { "Idempotency-Key": idempotencyKey11 };
|
|
7702
7899
|
}
|
|
7703
|
-
return
|
|
7900
|
+
return unwrap44(
|
|
7704
7901
|
await this.http.request(
|
|
7705
7902
|
`/sandboxes/${this.id}/deploy`,
|
|
7706
7903
|
requestOptions
|
|
@@ -7712,7 +7909,7 @@ var Sandbox = class _Sandbox {
|
|
|
7712
7909
|
}
|
|
7713
7910
|
/** Check readiness of the sandbox (GET /sandboxes/:id/readiness). */
|
|
7714
7911
|
async readiness() {
|
|
7715
|
-
return
|
|
7912
|
+
return unwrap44(
|
|
7716
7913
|
await this.http.get(
|
|
7717
7914
|
`/sandboxes/${this.id}/readiness`
|
|
7718
7915
|
)
|
|
@@ -7880,7 +8077,7 @@ var Sandboxes = class {
|
|
|
7880
8077
|
if (idempotencyKey11) {
|
|
7881
8078
|
requestOptions.headers = { "Idempotency-Key": idempotencyKey11 };
|
|
7882
8079
|
}
|
|
7883
|
-
const data =
|
|
8080
|
+
const data = unwrap44(
|
|
7884
8081
|
await this.http.request(
|
|
7885
8082
|
"/sandboxes",
|
|
7886
8083
|
requestOptions
|
|
@@ -7899,7 +8096,7 @@ var Sandboxes = class {
|
|
|
7899
8096
|
return listItems11(data).map((item) => new Sandbox(this.http, item));
|
|
7900
8097
|
}
|
|
7901
8098
|
async get(id) {
|
|
7902
|
-
const data =
|
|
8099
|
+
const data = unwrap44(
|
|
7903
8100
|
await this.http.get(`/sandboxes/${id}`)
|
|
7904
8101
|
);
|
|
7905
8102
|
return new Sandbox(this.http, data);
|
|
@@ -7908,7 +8105,7 @@ var Sandboxes = class {
|
|
|
7908
8105
|
return this.get(id);
|
|
7909
8106
|
}
|
|
7910
8107
|
async getByName(name) {
|
|
7911
|
-
const data =
|
|
8108
|
+
const data = unwrap44(
|
|
7912
8109
|
await this.http.get(
|
|
7913
8110
|
`/sandboxes/by-name/${encodeURIComponent(name)}`
|
|
7914
8111
|
)
|
|
@@ -7965,7 +8162,7 @@ var Sandboxes = class {
|
|
|
7965
8162
|
async createTemplate(params) {
|
|
7966
8163
|
const response = await this.http.post(
|
|
7967
8164
|
"/sandbox-templates",
|
|
7968
|
-
|
|
8165
|
+
stripUndefined24({
|
|
7969
8166
|
name: params.name,
|
|
7970
8167
|
slug: params.slug,
|
|
7971
8168
|
description: params.description,
|
|
@@ -7973,29 +8170,29 @@ var Sandboxes = class {
|
|
|
7973
8170
|
metadata: params.metadata
|
|
7974
8171
|
})
|
|
7975
8172
|
);
|
|
7976
|
-
return
|
|
8173
|
+
return unwrap44(response);
|
|
7977
8174
|
}
|
|
7978
8175
|
async createTemplateBuild(templateId, params = {}) {
|
|
7979
8176
|
const response = await this.http.post(
|
|
7980
8177
|
`/sandbox-templates/${templateId}/builds`,
|
|
7981
|
-
|
|
8178
|
+
stripUndefined24({
|
|
7982
8179
|
build_spec: params.buildSpec ?? params.build_spec,
|
|
7983
8180
|
metadata: params.metadata
|
|
7984
8181
|
})
|
|
7985
8182
|
);
|
|
7986
|
-
return
|
|
8183
|
+
return unwrap44(response);
|
|
7987
8184
|
}
|
|
7988
8185
|
async listTemplateBuilds(templateId) {
|
|
7989
8186
|
const response = await this.http.get(
|
|
7990
8187
|
`/sandbox-templates/${templateId}/builds`
|
|
7991
8188
|
);
|
|
7992
|
-
return
|
|
8189
|
+
return unwrap44(response);
|
|
7993
8190
|
}
|
|
7994
8191
|
async getTemplateBuild(buildId) {
|
|
7995
8192
|
const response = await this.http.get(
|
|
7996
8193
|
`/sandbox-template-builds/${buildId}`
|
|
7997
8194
|
);
|
|
7998
|
-
return
|
|
8195
|
+
return unwrap44(response);
|
|
7999
8196
|
}
|
|
8000
8197
|
};
|
|
8001
8198
|
function toBase642(bytes) {
|
|
@@ -8007,7 +8204,27 @@ function toBase642(bytes) {
|
|
|
8007
8204
|
}
|
|
8008
8205
|
return btoa(binary);
|
|
8009
8206
|
}
|
|
8010
|
-
function
|
|
8207
|
+
function previewInfoFromResponse(response) {
|
|
8208
|
+
const url = String(response.url ?? response.preview_url ?? "");
|
|
8209
|
+
const embeddedInfo = response.url_info && typeof response.url_info === "object" ? response.url_info : {};
|
|
8210
|
+
return {
|
|
8211
|
+
...embeddedInfo,
|
|
8212
|
+
url: String(embeddedInfo.url ?? url),
|
|
8213
|
+
class: String(
|
|
8214
|
+
response.class ?? response.url_class ?? embeddedInfo.class ?? embeddedInfo.url_class ?? "temporary_preview"
|
|
8215
|
+
),
|
|
8216
|
+
url_class: String(
|
|
8217
|
+
response.url_class ?? response.class ?? embeddedInfo.url_class ?? embeddedInfo.class ?? "temporary_preview"
|
|
8218
|
+
),
|
|
8219
|
+
stable_for_embedding: Boolean(
|
|
8220
|
+
response.stable_for_embedding ?? embeddedInfo.stable_for_embedding ?? false
|
|
8221
|
+
),
|
|
8222
|
+
recommended_next_action: String(
|
|
8223
|
+
response.recommended_next_action ?? embeddedInfo.recommended_next_action ?? "create_alias_or_publish"
|
|
8224
|
+
)
|
|
8225
|
+
};
|
|
8226
|
+
}
|
|
8227
|
+
function unwrap45(payload) {
|
|
8011
8228
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
8012
8229
|
return payload.data;
|
|
8013
8230
|
}
|
|
@@ -8023,7 +8240,7 @@ function listItems12(payload, candidateKeys = ["data", "templates", "builds", "i
|
|
|
8023
8240
|
}
|
|
8024
8241
|
return [];
|
|
8025
8242
|
}
|
|
8026
|
-
function
|
|
8243
|
+
function stripUndefined25(input) {
|
|
8027
8244
|
return Object.fromEntries(
|
|
8028
8245
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
8029
8246
|
);
|
|
@@ -8038,8 +8255,8 @@ var SandboxTemplates = class {
|
|
|
8038
8255
|
http;
|
|
8039
8256
|
async list(params = {}) {
|
|
8040
8257
|
const includeAliases = params.includeAliases ?? params.include_aliases ?? false;
|
|
8041
|
-
const
|
|
8042
|
-
const data = await this.http.get("/sandbox-templates",
|
|
8258
|
+
const query3 = includeAliases ? { include_aliases: true } : void 0;
|
|
8259
|
+
const data = await this.http.get("/sandbox-templates", query3);
|
|
8043
8260
|
return listItems12(data, [
|
|
8044
8261
|
"data",
|
|
8045
8262
|
"templates",
|
|
@@ -8050,7 +8267,7 @@ var SandboxTemplates = class {
|
|
|
8050
8267
|
const data = await this.http.get(
|
|
8051
8268
|
`/sandbox-templates/${templateId}`
|
|
8052
8269
|
);
|
|
8053
|
-
return
|
|
8270
|
+
return unwrap45(data);
|
|
8054
8271
|
}
|
|
8055
8272
|
async create(params) {
|
|
8056
8273
|
const {
|
|
@@ -8060,7 +8277,7 @@ var SandboxTemplates = class {
|
|
|
8060
8277
|
name,
|
|
8061
8278
|
...rest
|
|
8062
8279
|
} = params;
|
|
8063
|
-
const body4 =
|
|
8280
|
+
const body4 = stripUndefined25({
|
|
8064
8281
|
name,
|
|
8065
8282
|
build_spec: buildSpec ?? build_spec,
|
|
8066
8283
|
...rest
|
|
@@ -8070,7 +8287,7 @@ var SandboxTemplates = class {
|
|
|
8070
8287
|
body: body4,
|
|
8071
8288
|
headers: { "Idempotency-Key": idempotencyKey8(ikey) }
|
|
8072
8289
|
});
|
|
8073
|
-
return
|
|
8290
|
+
return unwrap45(data);
|
|
8074
8291
|
}
|
|
8075
8292
|
async buildSpecSchema() {
|
|
8076
8293
|
const data = await this.http.get("/sandbox-templates/build-spec");
|
|
@@ -8094,7 +8311,7 @@ var SandboxTemplates = class {
|
|
|
8094
8311
|
}
|
|
8095
8312
|
async createBuild(templateId, params = {}) {
|
|
8096
8313
|
const { idempotencyKey: ikey, ...rest } = params;
|
|
8097
|
-
const body4 =
|
|
8314
|
+
const body4 = stripUndefined25(rest);
|
|
8098
8315
|
const data = await this.http.request(
|
|
8099
8316
|
`/sandbox-templates/${templateId}/builds`,
|
|
8100
8317
|
{
|
|
@@ -8103,12 +8320,12 @@ var SandboxTemplates = class {
|
|
|
8103
8320
|
headers: { "Idempotency-Key": idempotencyKey8(ikey) }
|
|
8104
8321
|
}
|
|
8105
8322
|
);
|
|
8106
|
-
return
|
|
8323
|
+
return unwrap45(data);
|
|
8107
8324
|
}
|
|
8108
8325
|
};
|
|
8109
8326
|
|
|
8110
8327
|
// src/resources/settings.ts
|
|
8111
|
-
function
|
|
8328
|
+
function unwrap46(payload) {
|
|
8112
8329
|
if (payload && typeof payload === "object") {
|
|
8113
8330
|
const p = payload;
|
|
8114
8331
|
for (const k of [
|
|
@@ -8124,11 +8341,11 @@ function unwrap45(payload) {
|
|
|
8124
8341
|
return payload;
|
|
8125
8342
|
}
|
|
8126
8343
|
function listItems13(payload) {
|
|
8127
|
-
const result =
|
|
8344
|
+
const result = unwrap46(payload);
|
|
8128
8345
|
if (Array.isArray(result)) return result;
|
|
8129
8346
|
return [];
|
|
8130
8347
|
}
|
|
8131
|
-
function
|
|
8348
|
+
function stripUndefined26(input) {
|
|
8132
8349
|
return Object.fromEntries(
|
|
8133
8350
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
8134
8351
|
);
|
|
@@ -8141,46 +8358,46 @@ var Settings = class {
|
|
|
8141
8358
|
/** Get the current tenant settings. */
|
|
8142
8359
|
async get() {
|
|
8143
8360
|
const data = await this.http.get("/settings");
|
|
8144
|
-
return
|
|
8361
|
+
return unwrap46(data);
|
|
8145
8362
|
}
|
|
8146
8363
|
/** Update tenant settings. */
|
|
8147
8364
|
async update(params) {
|
|
8148
|
-
const body4 =
|
|
8365
|
+
const body4 = stripUndefined26(params);
|
|
8149
8366
|
const data = await this.http.put("/settings", body4);
|
|
8150
|
-
return
|
|
8367
|
+
return unwrap46(data);
|
|
8151
8368
|
}
|
|
8152
8369
|
// ── Branding ──────────────────────────────────────────────────────────────
|
|
8153
8370
|
/** Get tenant branding (logo, colors, custom wordmark). */
|
|
8154
8371
|
async getBranding() {
|
|
8155
8372
|
const data = await this.http.get("/settings/branding");
|
|
8156
|
-
return
|
|
8373
|
+
return unwrap46(data);
|
|
8157
8374
|
}
|
|
8158
8375
|
/** Update tenant branding. */
|
|
8159
8376
|
async updateBranding(params) {
|
|
8160
|
-
const body4 =
|
|
8377
|
+
const body4 = stripUndefined26(params);
|
|
8161
8378
|
const data = await this.http.put("/settings/branding", body4);
|
|
8162
|
-
return
|
|
8379
|
+
return unwrap46(data);
|
|
8163
8380
|
}
|
|
8164
8381
|
// ── Read-only reference data ───────────────────────────────────────────────
|
|
8165
8382
|
/** Get tenant-scoped compute pricing. */
|
|
8166
8383
|
async computePricing() {
|
|
8167
8384
|
const data = await this.http.get("/settings/compute-pricing");
|
|
8168
|
-
return
|
|
8385
|
+
return unwrap46(data);
|
|
8169
8386
|
}
|
|
8170
8387
|
/** Get tenant-scoped GPU pricing. */
|
|
8171
8388
|
async gpuPricing() {
|
|
8172
8389
|
const data = await this.http.get("/settings/gpu-pricing");
|
|
8173
|
-
return
|
|
8390
|
+
return unwrap46(data);
|
|
8174
8391
|
}
|
|
8175
8392
|
/** List models available to this tenant. */
|
|
8176
8393
|
async availableModels() {
|
|
8177
8394
|
const data = await this.http.get("/settings/available-models");
|
|
8178
|
-
return
|
|
8395
|
+
return unwrap46(data);
|
|
8179
8396
|
}
|
|
8180
8397
|
/** List regions enabled for this tenant. */
|
|
8181
8398
|
async regions() {
|
|
8182
8399
|
const data = await this.http.get("/settings/regions");
|
|
8183
|
-
return
|
|
8400
|
+
return unwrap46(data);
|
|
8184
8401
|
}
|
|
8185
8402
|
// ── BYOK provider keys ────────────────────────────────────────────────────
|
|
8186
8403
|
/** List tenant-level BYOK provider keys (Anthropic, OpenAI, etc.). */
|
|
@@ -8190,12 +8407,12 @@ var Settings = class {
|
|
|
8190
8407
|
}
|
|
8191
8408
|
/** Create or update a BYOK provider key. */
|
|
8192
8409
|
async upsertProviderKey(provider, params) {
|
|
8193
|
-
const body4 =
|
|
8410
|
+
const body4 = stripUndefined26(params);
|
|
8194
8411
|
const data = await this.http.put(
|
|
8195
8412
|
`/settings/provider-keys/${provider}`,
|
|
8196
8413
|
body4
|
|
8197
8414
|
);
|
|
8198
|
-
return
|
|
8415
|
+
return unwrap46(data);
|
|
8199
8416
|
}
|
|
8200
8417
|
/** Delete a BYOK provider key. */
|
|
8201
8418
|
async deleteProviderKey(provider) {
|
|
@@ -8204,7 +8421,7 @@ var Settings = class {
|
|
|
8204
8421
|
};
|
|
8205
8422
|
|
|
8206
8423
|
// src/resources/snapshots-standalone.ts
|
|
8207
|
-
function
|
|
8424
|
+
function unwrap47(data) {
|
|
8208
8425
|
if (data && typeof data === "object") {
|
|
8209
8426
|
const d = data;
|
|
8210
8427
|
for (const k of ["data", "snapshots", "items"]) {
|
|
@@ -8229,20 +8446,20 @@ var SnapshotsStandalone = class {
|
|
|
8229
8446
|
}
|
|
8230
8447
|
http;
|
|
8231
8448
|
async list(filters = {}) {
|
|
8232
|
-
const
|
|
8449
|
+
const query3 = Object.fromEntries(
|
|
8233
8450
|
Object.entries(filters).filter(([, v]) => v !== void 0)
|
|
8234
8451
|
);
|
|
8235
|
-
return unwrapList14(await this.http.get("/admin/snapshots",
|
|
8452
|
+
return unwrapList14(await this.http.get("/admin/snapshots", query3));
|
|
8236
8453
|
}
|
|
8237
8454
|
async get(snapshotId) {
|
|
8238
|
-
return
|
|
8455
|
+
return unwrap47(
|
|
8239
8456
|
await this.http.get(`/admin/snapshots/${snapshotId}`)
|
|
8240
8457
|
);
|
|
8241
8458
|
}
|
|
8242
8459
|
};
|
|
8243
8460
|
|
|
8244
8461
|
// src/resources/storage.ts
|
|
8245
|
-
function
|
|
8462
|
+
function unwrap48(payload) {
|
|
8246
8463
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
8247
8464
|
return payload.data;
|
|
8248
8465
|
}
|
|
@@ -8258,7 +8475,7 @@ function listItems14(payload, candidateKeys = ["data", "buckets", "objects", "it
|
|
|
8258
8475
|
}
|
|
8259
8476
|
return [];
|
|
8260
8477
|
}
|
|
8261
|
-
function
|
|
8478
|
+
function stripUndefined27(input) {
|
|
8262
8479
|
return Object.fromEntries(
|
|
8263
8480
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
8264
8481
|
);
|
|
@@ -8275,31 +8492,31 @@ var Storage = class {
|
|
|
8275
8492
|
}
|
|
8276
8493
|
async createBucket(params) {
|
|
8277
8494
|
const { name, public: isPublic, visibility, ...rest } = params;
|
|
8278
|
-
const body4 =
|
|
8495
|
+
const body4 = stripUndefined27({
|
|
8279
8496
|
name,
|
|
8280
8497
|
visibility: visibility ?? (isPublic === void 0 ? void 0 : isPublic ? "public" : "private"),
|
|
8281
8498
|
...rest
|
|
8282
8499
|
});
|
|
8283
8500
|
const data = await this.http.post("/storage/buckets", body4);
|
|
8284
|
-
return
|
|
8501
|
+
return unwrap48(data);
|
|
8285
8502
|
}
|
|
8286
8503
|
async getBucket(bucketId) {
|
|
8287
8504
|
const data = await this.http.get(`/storage/buckets/${bucketId}`);
|
|
8288
|
-
return
|
|
8505
|
+
return unwrap48(data);
|
|
8289
8506
|
}
|
|
8290
8507
|
async deleteBucket(bucketId) {
|
|
8291
8508
|
await this.http.delete(`/storage/buckets/${bucketId}`);
|
|
8292
8509
|
}
|
|
8293
8510
|
// ── Objects ────────────────────────────────────────────────────────────────
|
|
8294
8511
|
async listObjects(bucketId, params = {}) {
|
|
8295
|
-
const
|
|
8512
|
+
const query3 = stripUndefined27({
|
|
8296
8513
|
prefix: params.prefix,
|
|
8297
8514
|
max_keys: params.max_keys ?? params.maxKeys ?? params.limit,
|
|
8298
8515
|
marker: params.marker ?? params.cursor
|
|
8299
8516
|
});
|
|
8300
8517
|
const data = await this.http.get(
|
|
8301
8518
|
`/storage/buckets/${bucketId}/objects`,
|
|
8302
|
-
|
|
8519
|
+
query3
|
|
8303
8520
|
);
|
|
8304
8521
|
return listItems14(data, ["data", "objects", "items"]);
|
|
8305
8522
|
}
|
|
@@ -8326,7 +8543,7 @@ var Storage = class {
|
|
|
8326
8543
|
// ── Presigned URLs ─────────────────────────────────────────────────────────
|
|
8327
8544
|
async presign(bucketId, params) {
|
|
8328
8545
|
const operationMethod = params.operation === "put" ? "PUT" : params.operation === "get" ? "GET" : void 0;
|
|
8329
|
-
const body4 =
|
|
8546
|
+
const body4 = stripUndefined27({
|
|
8330
8547
|
key: params.key,
|
|
8331
8548
|
method: params.method ?? operationMethod ?? "GET",
|
|
8332
8549
|
expires_in: params.expiresIn ?? params.expires_in ?? params.expiresInSec ?? params.expires_in_sec ?? 3600
|
|
@@ -8335,7 +8552,7 @@ var Storage = class {
|
|
|
8335
8552
|
`/storage/buckets/${bucketId}/presign`,
|
|
8336
8553
|
body4
|
|
8337
8554
|
);
|
|
8338
|
-
return
|
|
8555
|
+
return unwrap48(data);
|
|
8339
8556
|
}
|
|
8340
8557
|
};
|
|
8341
8558
|
|
|
@@ -8425,7 +8642,7 @@ var OrgInvites = class {
|
|
|
8425
8642
|
};
|
|
8426
8643
|
|
|
8427
8644
|
// src/resources/tenant.ts
|
|
8428
|
-
function
|
|
8645
|
+
function unwrap49(payload) {
|
|
8429
8646
|
if (payload && typeof payload === "object") {
|
|
8430
8647
|
const p = payload;
|
|
8431
8648
|
for (const k of ["data", "tenant", "branding", "items"]) {
|
|
@@ -8434,7 +8651,7 @@ function unwrap48(payload) {
|
|
|
8434
8651
|
}
|
|
8435
8652
|
return payload;
|
|
8436
8653
|
}
|
|
8437
|
-
function
|
|
8654
|
+
function stripUndefined28(input) {
|
|
8438
8655
|
return Object.fromEntries(
|
|
8439
8656
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
8440
8657
|
);
|
|
@@ -8447,14 +8664,14 @@ var PreviewDomain = class {
|
|
|
8447
8664
|
/** Get the tenant's white-label preview domain settings. */
|
|
8448
8665
|
async get() {
|
|
8449
8666
|
const data = await this.http.get("/tenant/preview-domain");
|
|
8450
|
-
return
|
|
8667
|
+
return unwrap49(data);
|
|
8451
8668
|
}
|
|
8452
8669
|
/** Set the tenant's white-label preview domain. */
|
|
8453
8670
|
async set(domain) {
|
|
8454
8671
|
const data = await this.http.put("/tenant/preview-domain", {
|
|
8455
8672
|
preview_domain: domain
|
|
8456
8673
|
});
|
|
8457
|
-
return
|
|
8674
|
+
return unwrap49(data);
|
|
8458
8675
|
}
|
|
8459
8676
|
/** Re-run DNS verification for the configured preview domain. */
|
|
8460
8677
|
async verify() {
|
|
@@ -8462,7 +8679,7 @@ var PreviewDomain = class {
|
|
|
8462
8679
|
"/tenant/preview-domain/verify",
|
|
8463
8680
|
{}
|
|
8464
8681
|
);
|
|
8465
|
-
return
|
|
8682
|
+
return unwrap49(data);
|
|
8466
8683
|
}
|
|
8467
8684
|
/** Remove the tenant's custom preview domain. */
|
|
8468
8685
|
async delete() {
|
|
@@ -8477,14 +8694,14 @@ var Branding = class {
|
|
|
8477
8694
|
/** Get tenant branding used by white-label hosted surfaces. */
|
|
8478
8695
|
async get() {
|
|
8479
8696
|
const data = await this.http.get("/tenant/branding");
|
|
8480
|
-
return
|
|
8697
|
+
return unwrap49(data);
|
|
8481
8698
|
}
|
|
8482
8699
|
/** Update tenant branding used by white-label hosted surfaces. */
|
|
8483
8700
|
async set(params) {
|
|
8484
8701
|
const data = await this.http.put("/tenant/branding", {
|
|
8485
|
-
branding:
|
|
8702
|
+
branding: stripUndefined28(params)
|
|
8486
8703
|
});
|
|
8487
|
-
return
|
|
8704
|
+
return unwrap49(data);
|
|
8488
8705
|
}
|
|
8489
8706
|
/** Reset tenant branding to platform defaults. */
|
|
8490
8707
|
async delete() {
|
|
@@ -8506,7 +8723,7 @@ var Tenant = class {
|
|
|
8506
8723
|
/** Get the current tenant's plan, limits, and live usage counters. */
|
|
8507
8724
|
async current() {
|
|
8508
8725
|
const data = await this.http.get("/tenant/plan");
|
|
8509
|
-
return
|
|
8726
|
+
return unwrap49(data);
|
|
8510
8727
|
}
|
|
8511
8728
|
/** Convenience alias for `tenant.branding.get()`. */
|
|
8512
8729
|
async getBranding() {
|
|
@@ -8523,7 +8740,7 @@ var Tenant = class {
|
|
|
8523
8740
|
};
|
|
8524
8741
|
|
|
8525
8742
|
// src/resources/usage.ts
|
|
8526
|
-
function
|
|
8743
|
+
function unwrap50(payload) {
|
|
8527
8744
|
if (payload && typeof payload === "object") {
|
|
8528
8745
|
const p = payload;
|
|
8529
8746
|
for (const k of ["data", "usage", "sessions", "summary", "items"]) {
|
|
@@ -8532,7 +8749,7 @@ function unwrap49(payload) {
|
|
|
8532
8749
|
}
|
|
8533
8750
|
return payload;
|
|
8534
8751
|
}
|
|
8535
|
-
function
|
|
8752
|
+
function stripUndefined29(input) {
|
|
8536
8753
|
return Object.fromEntries(
|
|
8537
8754
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
8538
8755
|
);
|
|
@@ -8545,24 +8762,24 @@ var Usage = class {
|
|
|
8545
8762
|
/** Get the current period usage summary. */
|
|
8546
8763
|
async current() {
|
|
8547
8764
|
const data = await this.http.get("/usage/summary");
|
|
8548
|
-
return
|
|
8765
|
+
return unwrap50(data);
|
|
8549
8766
|
}
|
|
8550
8767
|
/** List per-session metering events. */
|
|
8551
8768
|
async sessions(params = {}) {
|
|
8552
|
-
const
|
|
8553
|
-
const data = await this.http.get("/usage/sessions",
|
|
8554
|
-
const result =
|
|
8769
|
+
const query3 = stripUndefined29(params);
|
|
8770
|
+
const data = await this.http.get("/usage/sessions", query3);
|
|
8771
|
+
const result = unwrap50(data);
|
|
8555
8772
|
if (Array.isArray(result)) return result;
|
|
8556
8773
|
return [];
|
|
8557
8774
|
}
|
|
8558
8775
|
/** Get a usage report for a period. */
|
|
8559
8776
|
async report(params = {}) {
|
|
8560
|
-
const
|
|
8561
|
-
const data = await this.http.get("/usage/summary",
|
|
8562
|
-
return
|
|
8777
|
+
const query3 = stripUndefined29(params);
|
|
8778
|
+
const data = await this.http.get("/usage/summary", query3);
|
|
8779
|
+
return unwrap50(data);
|
|
8563
8780
|
}
|
|
8564
8781
|
};
|
|
8565
|
-
function
|
|
8782
|
+
function unwrap51(payload) {
|
|
8566
8783
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
8567
8784
|
return payload.data;
|
|
8568
8785
|
}
|
|
@@ -8578,7 +8795,7 @@ function listItems15(payload, candidateKeys = ["data", "volumes", "items"]) {
|
|
|
8578
8795
|
}
|
|
8579
8796
|
return [];
|
|
8580
8797
|
}
|
|
8581
|
-
function
|
|
8798
|
+
function stripUndefined30(input) {
|
|
8582
8799
|
return Object.fromEntries(
|
|
8583
8800
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
8584
8801
|
);
|
|
@@ -8592,17 +8809,17 @@ var Volumes = class {
|
|
|
8592
8809
|
}
|
|
8593
8810
|
http;
|
|
8594
8811
|
async list(params = {}) {
|
|
8595
|
-
const
|
|
8596
|
-
const data = await this.http.get("/volumes",
|
|
8812
|
+
const query3 = stripUndefined30({ ...params });
|
|
8813
|
+
const data = await this.http.get("/volumes", query3);
|
|
8597
8814
|
return listItems15(data);
|
|
8598
8815
|
}
|
|
8599
8816
|
async get(volumeId) {
|
|
8600
8817
|
const data = await this.http.get(`/volumes/${volumeId}`);
|
|
8601
|
-
return
|
|
8818
|
+
return unwrap51(data);
|
|
8602
8819
|
}
|
|
8603
8820
|
async create(params) {
|
|
8604
8821
|
const { idempotencyKey: ikey, sizeGb, ...rest } = params;
|
|
8605
|
-
const body4 =
|
|
8822
|
+
const body4 = stripUndefined30({
|
|
8606
8823
|
...rest,
|
|
8607
8824
|
size_gb: sizeGb ?? rest.size_gb
|
|
8608
8825
|
});
|
|
@@ -8611,13 +8828,13 @@ var Volumes = class {
|
|
|
8611
8828
|
body: body4,
|
|
8612
8829
|
headers: { "Idempotency-Key": idempotencyKey9(ikey) }
|
|
8613
8830
|
});
|
|
8614
|
-
return
|
|
8831
|
+
return unwrap51(data);
|
|
8615
8832
|
}
|
|
8616
8833
|
async delete(volumeId) {
|
|
8617
8834
|
await this.http.delete(`/volumes/${volumeId}`);
|
|
8618
8835
|
}
|
|
8619
8836
|
};
|
|
8620
|
-
function
|
|
8837
|
+
function unwrap52(payload) {
|
|
8621
8838
|
if (payload && typeof payload === "object" && "data" in payload) {
|
|
8622
8839
|
return payload.data;
|
|
8623
8840
|
}
|
|
@@ -8633,7 +8850,7 @@ function listItems16(payload, candidateKeys = ["data", "webhooks", "deliveries",
|
|
|
8633
8850
|
}
|
|
8634
8851
|
return [];
|
|
8635
8852
|
}
|
|
8636
|
-
function
|
|
8853
|
+
function stripUndefined31(input) {
|
|
8637
8854
|
return Object.fromEntries(
|
|
8638
8855
|
Object.entries(input).filter(([, v]) => v !== void 0)
|
|
8639
8856
|
);
|
|
@@ -8678,28 +8895,28 @@ var Webhooks = class {
|
|
|
8678
8895
|
http;
|
|
8679
8896
|
static verifySignature = verifySignature;
|
|
8680
8897
|
async list(params = {}) {
|
|
8681
|
-
const
|
|
8682
|
-
const data = await this.http.get("/webhooks",
|
|
8898
|
+
const query3 = stripUndefined31({ ...params });
|
|
8899
|
+
const data = await this.http.get("/webhooks", query3);
|
|
8683
8900
|
return listItems16(data);
|
|
8684
8901
|
}
|
|
8685
8902
|
async get(webhookId) {
|
|
8686
8903
|
const data = await this.http.get(`/webhooks/${webhookId}`);
|
|
8687
|
-
return
|
|
8904
|
+
return unwrap52(data);
|
|
8688
8905
|
}
|
|
8689
8906
|
async create(params) {
|
|
8690
8907
|
const { idempotencyKey: ikey, ...rest } = params;
|
|
8691
|
-
const body4 =
|
|
8908
|
+
const body4 = stripUndefined31(rest);
|
|
8692
8909
|
const data = await this.http.request("/webhooks", {
|
|
8693
8910
|
method: "POST",
|
|
8694
8911
|
body: body4,
|
|
8695
8912
|
headers: { "Idempotency-Key": idempotencyKey10(ikey) }
|
|
8696
8913
|
});
|
|
8697
|
-
return
|
|
8914
|
+
return unwrap52(data);
|
|
8698
8915
|
}
|
|
8699
8916
|
async update(webhookId, params) {
|
|
8700
|
-
const body4 =
|
|
8917
|
+
const body4 = stripUndefined31(params);
|
|
8701
8918
|
const data = await this.http.patch(`/webhooks/${webhookId}`, body4);
|
|
8702
|
-
return
|
|
8919
|
+
return unwrap52(data);
|
|
8703
8920
|
}
|
|
8704
8921
|
async delete(webhookId) {
|
|
8705
8922
|
await this.http.delete(`/webhooks/${webhookId}`);
|
|
@@ -8712,7 +8929,7 @@ var Webhooks = class {
|
|
|
8712
8929
|
headers: { "Idempotency-Key": idempotencyKey10(opts.idempotencyKey) }
|
|
8713
8930
|
}
|
|
8714
8931
|
);
|
|
8715
|
-
return
|
|
8932
|
+
return unwrap52(data);
|
|
8716
8933
|
}
|
|
8717
8934
|
async deliveries(webhookId) {
|
|
8718
8935
|
const data = await this.http.get(
|
|
@@ -8909,6 +9126,8 @@ var Miosa = class {
|
|
|
8909
9126
|
usage;
|
|
8910
9127
|
/** Notification channels — Slack, Discord, email, etc. */
|
|
8911
9128
|
channels;
|
|
9129
|
+
/** Cloud accounts / BYOC / cloudburst control-plane state. */
|
|
9130
|
+
cloud;
|
|
8912
9131
|
/** OAuth integrations — GitHub, Slack, Linear, Discord. */
|
|
8913
9132
|
integrations;
|
|
8914
9133
|
/** Per-project integrations (Stripe, Resend, Twilio, etc.). */
|
|
@@ -9030,6 +9249,7 @@ var Miosa = class {
|
|
|
9030
9249
|
this.auditLog = new AuditLog(this.http);
|
|
9031
9250
|
this.usage = new Usage(this.http);
|
|
9032
9251
|
this.channels = new Channels(this.http);
|
|
9252
|
+
this.cloud = new Cloud(this.http);
|
|
9033
9253
|
this.integrations = new Integrations(this.http);
|
|
9034
9254
|
this.projectIntegrations = new ProjectIntegrations(this.http);
|
|
9035
9255
|
this.projectAuth = new ProjectAuth(this.http);
|
|
@@ -9075,6 +9295,331 @@ var Miosa = class {
|
|
|
9075
9295
|
}
|
|
9076
9296
|
};
|
|
9077
9297
|
|
|
9298
|
+
// src/agent-builds.ts
|
|
9299
|
+
var DEFAULT_AGENT_BUILD_PACKET_VERSION = "2026-06-19";
|
|
9300
|
+
var DEFAULT_AGENT_BUILD_OUTPUT_ROOT = "/workspace/output";
|
|
9301
|
+
var DEFAULT_AGENT_BUILD_INPUT_ROOT = "/workspace/inputs";
|
|
9302
|
+
var NEXTJS_RUNTIME_TEMPLATE = {
|
|
9303
|
+
kind: "nextjs_app",
|
|
9304
|
+
template_id: "nextjs",
|
|
9305
|
+
workspace_root: "/workspace",
|
|
9306
|
+
app_dir: "/workspace/app",
|
|
9307
|
+
output_dir: DEFAULT_AGENT_BUILD_OUTPUT_ROOT,
|
|
9308
|
+
expected_preview_port: 3e3,
|
|
9309
|
+
start_command: "npm run dev -- --hostname 0.0.0.0 --port 3000",
|
|
9310
|
+
build_command: "npm run build"
|
|
9311
|
+
};
|
|
9312
|
+
function artifactBundle(kind) {
|
|
9313
|
+
return {
|
|
9314
|
+
kind,
|
|
9315
|
+
workspace_root: "/workspace",
|
|
9316
|
+
output_dir: DEFAULT_AGENT_BUILD_OUTPUT_ROOT
|
|
9317
|
+
};
|
|
9318
|
+
}
|
|
9319
|
+
var COMMON_PLANNER_DOCUMENT_KINDS = [
|
|
9320
|
+
"input_bundle",
|
|
9321
|
+
"client_grounding",
|
|
9322
|
+
"brand_identity",
|
|
9323
|
+
"strategy_context",
|
|
9324
|
+
"quality_rules"
|
|
9325
|
+
];
|
|
9326
|
+
var BUILD_KIND_ALIASES = {
|
|
9327
|
+
ad: "ad_creative",
|
|
9328
|
+
ads: "ad_creative",
|
|
9329
|
+
adcreative: "ad_creative",
|
|
9330
|
+
ad_creative: "ad_creative",
|
|
9331
|
+
booking: "booking_page",
|
|
9332
|
+
booking_form: "booking_page",
|
|
9333
|
+
booking_page: "booking_page",
|
|
9334
|
+
brand: "brand_identity",
|
|
9335
|
+
brand_character: "character",
|
|
9336
|
+
brand_identity: "brand_identity",
|
|
9337
|
+
campaign: "campaign",
|
|
9338
|
+
campaign_plan: "campaign",
|
|
9339
|
+
carousel: "social_content",
|
|
9340
|
+
challenge: "challenge",
|
|
9341
|
+
character: "character",
|
|
9342
|
+
character_pack: "character",
|
|
9343
|
+
content: "social_content",
|
|
9344
|
+
content_batch: "social_content",
|
|
9345
|
+
course: "program",
|
|
9346
|
+
email: "email_sequence",
|
|
9347
|
+
email_sequence: "email_sequence",
|
|
9348
|
+
email_sms_sequence: "email_sequence",
|
|
9349
|
+
funnel: "landing_page",
|
|
9350
|
+
landing: "landing_page",
|
|
9351
|
+
landing_page: "landing_page",
|
|
9352
|
+
lead_magnet: "lead_magnet",
|
|
9353
|
+
leadmagnet: "lead_magnet",
|
|
9354
|
+
offer: "offer",
|
|
9355
|
+
offer_stack: "offer",
|
|
9356
|
+
online_course: "program",
|
|
9357
|
+
page: "landing_page",
|
|
9358
|
+
podcast: "podcast",
|
|
9359
|
+
podcast_audio: "podcast",
|
|
9360
|
+
program: "program",
|
|
9361
|
+
sales_page: "landing_page",
|
|
9362
|
+
sales_script: "sales_script",
|
|
9363
|
+
sales_script_builder: "sales_script",
|
|
9364
|
+
salesscript: "sales_script",
|
|
9365
|
+
site: "website",
|
|
9366
|
+
slides: "slides_deck",
|
|
9367
|
+
slides_deck: "slides_deck",
|
|
9368
|
+
social: "social_content",
|
|
9369
|
+
social_content: "social_content",
|
|
9370
|
+
social_media: "social_content",
|
|
9371
|
+
social_media_post: "social_content",
|
|
9372
|
+
text_card: "social_content",
|
|
9373
|
+
webinar: "webinar",
|
|
9374
|
+
website: "website"
|
|
9375
|
+
};
|
|
9376
|
+
function spec(kind, label, artifactType, runtimeTemplate, artifacts, options = {}) {
|
|
9377
|
+
const resolved = {
|
|
9378
|
+
kind,
|
|
9379
|
+
label,
|
|
9380
|
+
artifactType,
|
|
9381
|
+
runtimeTemplate,
|
|
9382
|
+
requestedOutputs: options.requestedOutputs ?? ["requested deliverables", "manifest"],
|
|
9383
|
+
plannerDocumentKinds: options.plannerDocumentKinds ?? COMMON_PLANNER_DOCUMENT_KINDS,
|
|
9384
|
+
artifacts,
|
|
9385
|
+
designResearchRequired: options.designResearchRequired ?? false
|
|
9386
|
+
};
|
|
9387
|
+
if (options.previewPort !== void 0) resolved.previewPort = options.previewPort;
|
|
9388
|
+
return resolved;
|
|
9389
|
+
}
|
|
9390
|
+
var AGENT_BUILD_KIND_SPECS = {
|
|
9391
|
+
landing_page: spec(
|
|
9392
|
+
"landing_page",
|
|
9393
|
+
"Landing page",
|
|
9394
|
+
"landing_page",
|
|
9395
|
+
NEXTJS_RUNTIME_TEMPLATE,
|
|
9396
|
+
[
|
|
9397
|
+
{ kind: "html", path: "landing-page.html", mime_type: "text/html", name: "Landing page", previewable: true },
|
|
9398
|
+
{ kind: "source", path: "source.zip", mime_type: "application/zip", name: "Source files" }
|
|
9399
|
+
],
|
|
9400
|
+
{ requestedOutputs: ["Next.js landing page", "preview URL", "source files"], designResearchRequired: true, previewPort: 3e3 }
|
|
9401
|
+
),
|
|
9402
|
+
website: spec("website", "Website", "website", NEXTJS_RUNTIME_TEMPLATE, [
|
|
9403
|
+
{ kind: "html", path: "website.html", mime_type: "text/html", name: "Website", previewable: true },
|
|
9404
|
+
{ kind: "source", path: "source.zip", mime_type: "application/zip", name: "Source files" }
|
|
9405
|
+
], { requestedOutputs: ["Next.js website", "preview URL", "source files"], designResearchRequired: true, previewPort: 3e3 }),
|
|
9406
|
+
lead_magnet: spec("lead_magnet", "Lead magnet", "lead_magnet", NEXTJS_RUNTIME_TEMPLATE, [
|
|
9407
|
+
{ kind: "pdf", path: "lead-magnet.pdf", mime_type: "application/pdf", name: "Lead magnet PDF", previewable: true },
|
|
9408
|
+
{ kind: "html", path: "opt-in-page.html", mime_type: "text/html", name: "Opt-in page", previewable: true }
|
|
9409
|
+
], { requestedOutputs: ["PDF lead magnet", "opt-in page", "source files"], designResearchRequired: true, previewPort: 3e3 }),
|
|
9410
|
+
webinar: spec("webinar", "Webinar", "webinar", NEXTJS_RUNTIME_TEMPLATE, [
|
|
9411
|
+
{ kind: "html", path: "webinar-page.html", mime_type: "text/html", name: "Webinar page", previewable: true },
|
|
9412
|
+
{ kind: "markdown", path: "webinar-script.md", mime_type: "text/markdown", name: "Webinar script" }
|
|
9413
|
+
], { requestedOutputs: ["webinar registration page", "script", "slides"], designResearchRequired: true, previewPort: 3e3 }),
|
|
9414
|
+
slides_deck: spec("slides_deck", "Slides deck", "slides_deck", artifactBundle("html_deck"), [
|
|
9415
|
+
{ kind: "html", path: "deck.html", mime_type: "text/html", name: "Slide deck", previewable: true }
|
|
9416
|
+
], { designResearchRequired: true }),
|
|
9417
|
+
email_sequence: spec("email_sequence", "Email sequence", "email_sms_sequence", artifactBundle("email_bundle"), [
|
|
9418
|
+
{ kind: "markdown", path: "email-sequence.md", mime_type: "text/markdown", name: "Email sequence", previewable: true }
|
|
9419
|
+
]),
|
|
9420
|
+
social_content: spec("social_content", "Social content", "social_media_post", artifactBundle("html_image_bundle"), [
|
|
9421
|
+
{ kind: "html", path: "social-carousel.html", mime_type: "text/html", name: "Social carousel", previewable: true },
|
|
9422
|
+
{ kind: "markdown", path: "captions.md", mime_type: "text/markdown", name: "Caption bank" }
|
|
9423
|
+
], { designResearchRequired: true }),
|
|
9424
|
+
ad_creative: spec("ad_creative", "Ad creative", "ad_creative", artifactBundle("html_image_bundle"), [
|
|
9425
|
+
{ kind: "html", path: "ad-creative.html", mime_type: "text/html", name: "Ad creative previews", previewable: true }
|
|
9426
|
+
], { designResearchRequired: true }),
|
|
9427
|
+
booking_page: spec("booking_page", "Booking page", "booking_page", NEXTJS_RUNTIME_TEMPLATE, [
|
|
9428
|
+
{ kind: "html", path: "booking-page.html", mime_type: "text/html", name: "Booking page", previewable: true }
|
|
9429
|
+
], { requestedOutputs: ["booking page", "confirmation copy", "source files"], designResearchRequired: true, previewPort: 3e3 }),
|
|
9430
|
+
brand_identity: spec("brand_identity", "Brand identity", "brand_identity", artifactBundle("brand_bundle"), [
|
|
9431
|
+
{ kind: "markdown", path: "brand-guide.md", mime_type: "text/markdown", name: "Brand guide", previewable: true }
|
|
9432
|
+
], { designResearchRequired: true }),
|
|
9433
|
+
offer: spec("offer", "Offer", "offer", artifactBundle("offer_bundle"), [
|
|
9434
|
+
{ kind: "markdown", path: "offer-stack.md", mime_type: "text/markdown", name: "Offer stack", previewable: true }
|
|
9435
|
+
]),
|
|
9436
|
+
program: spec("program", "Program", "program_lms", artifactBundle("program_lms"), [
|
|
9437
|
+
{ kind: "html", path: "program.html", mime_type: "text/html", name: "Program preview", previewable: true },
|
|
9438
|
+
{ kind: "markdown", path: "program.md", mime_type: "text/markdown", name: "Program outline" }
|
|
9439
|
+
], { designResearchRequired: true }),
|
|
9440
|
+
podcast: spec("podcast", "Podcast", "podcast_audio", artifactBundle("podcast_audio"), [
|
|
9441
|
+
{ kind: "html", path: "podcast.html", mime_type: "text/html", name: "Podcast preview", previewable: true },
|
|
9442
|
+
{ kind: "markdown", path: "show-notes.md", mime_type: "text/markdown", name: "Show notes" }
|
|
9443
|
+
]),
|
|
9444
|
+
sales_script: spec("sales_script", "Sales script", "sales_script", artifactBundle("script_bundle"), [
|
|
9445
|
+
{ kind: "markdown", path: "sales-script.md", mime_type: "text/markdown", name: "Sales script", previewable: true }
|
|
9446
|
+
]),
|
|
9447
|
+
campaign: spec("campaign", "Campaign", "campaign", artifactBundle("campaign_bundle"), [
|
|
9448
|
+
{ kind: "markdown", path: "campaign-plan.md", mime_type: "text/markdown", name: "Campaign plan", previewable: true },
|
|
9449
|
+
{ kind: "html", path: "campaign-assets.html", mime_type: "text/html", name: "Campaign assets", previewable: true }
|
|
9450
|
+
], { designResearchRequired: true }),
|
|
9451
|
+
challenge: spec("challenge", "Challenge", "challenge", artifactBundle("challenge_bundle"), [
|
|
9452
|
+
{ kind: "markdown", path: "challenge-plan.md", mime_type: "text/markdown", name: "Challenge plan", previewable: true }
|
|
9453
|
+
]),
|
|
9454
|
+
character: spec("character", "Character pack", "brand_character", artifactBundle("character_bundle"), [
|
|
9455
|
+
{ kind: "markdown", path: "character-pack.md", mime_type: "text/markdown", name: "Character pack", previewable: true }
|
|
9456
|
+
], { designResearchRequired: true }),
|
|
9457
|
+
custom: spec("custom", "Custom build", "artifact", artifactBundle("artifact_bundle"), [])
|
|
9458
|
+
};
|
|
9459
|
+
function normalizeBuildKind(value) {
|
|
9460
|
+
return (value ?? "").trim().toLowerCase().replace(/[\s-]+/g, "_").replace(/[^a-z0-9_]/g, "");
|
|
9461
|
+
}
|
|
9462
|
+
function resolveAgentBuildKind(value, fallback = "custom") {
|
|
9463
|
+
const normalized = normalizeBuildKind(value);
|
|
9464
|
+
if (!normalized) return fallback;
|
|
9465
|
+
return BUILD_KIND_ALIASES[normalized] ?? fallback;
|
|
9466
|
+
}
|
|
9467
|
+
function getAgentBuildKindSpec(value) {
|
|
9468
|
+
return AGENT_BUILD_KIND_SPECS[resolveAgentBuildKind(value)];
|
|
9469
|
+
}
|
|
9470
|
+
function normalizeArtifactPath(path, outputRoot) {
|
|
9471
|
+
return path.startsWith("/") ? path : `${outputRoot}/${path}`;
|
|
9472
|
+
}
|
|
9473
|
+
function createAgentBuildOutputContract(buildKind, options = {}) {
|
|
9474
|
+
if (options.outputContract) return options.outputContract;
|
|
9475
|
+
const spec2 = getAgentBuildKindSpec(buildKind);
|
|
9476
|
+
const outputRoot = options.outputRoot ?? DEFAULT_AGENT_BUILD_OUTPUT_ROOT;
|
|
9477
|
+
const artifacts = [
|
|
9478
|
+
{
|
|
9479
|
+
path: `${outputRoot}/manifest.json`,
|
|
9480
|
+
kind: "json",
|
|
9481
|
+
mime_type: "application/json",
|
|
9482
|
+
name: "Manifest",
|
|
9483
|
+
downloadable: true
|
|
9484
|
+
},
|
|
9485
|
+
...(options.artifacts ?? spec2.artifacts).map((artifact) => ({
|
|
9486
|
+
...artifact,
|
|
9487
|
+
path: normalizeArtifactPath(artifact.path, outputRoot),
|
|
9488
|
+
downloadable: artifact.downloadable ?? true
|
|
9489
|
+
}))
|
|
9490
|
+
];
|
|
9491
|
+
const contract = withoutUndefined({
|
|
9492
|
+
write_files_under: outputRoot,
|
|
9493
|
+
manifest: `${outputRoot}/manifest.json`,
|
|
9494
|
+
planner_documents_under: "/workspace/planner",
|
|
9495
|
+
inputs_under: DEFAULT_AGENT_BUILD_INPUT_ROOT,
|
|
9496
|
+
artifact_type: options.artifactType ?? spec2.artifactType,
|
|
9497
|
+
required_files: [`${outputRoot}/manifest.json`],
|
|
9498
|
+
artifacts,
|
|
9499
|
+
preview_port: spec2.previewPort,
|
|
9500
|
+
include_downloadable_artifacts: true
|
|
9501
|
+
});
|
|
9502
|
+
return contract;
|
|
9503
|
+
}
|
|
9504
|
+
function normalizePlannerDocuments(documents) {
|
|
9505
|
+
return (documents ?? []).map((document) => ({
|
|
9506
|
+
...document,
|
|
9507
|
+
content_markdown: document.content_markdown ?? document.contentMarkdown ?? ""
|
|
9508
|
+
}));
|
|
9509
|
+
}
|
|
9510
|
+
function withoutUndefined(input) {
|
|
9511
|
+
return Object.fromEntries(
|
|
9512
|
+
Object.entries(input).filter(([, value]) => value !== void 0)
|
|
9513
|
+
);
|
|
9514
|
+
}
|
|
9515
|
+
function createAgentBuildExecutionPacket(params) {
|
|
9516
|
+
const buildKind = resolveAgentBuildKind(params.buildKind ?? params.runType);
|
|
9517
|
+
const spec2 = AGENT_BUILD_KIND_SPECS[buildKind];
|
|
9518
|
+
const artifactType = params.artifactType ?? spec2.artifactType;
|
|
9519
|
+
const runtimeTemplate = params.runtimeTemplate ?? spec2.runtimeTemplate;
|
|
9520
|
+
const outputOptions = { artifactType };
|
|
9521
|
+
if (params.artifacts !== void 0) outputOptions.artifacts = params.artifacts;
|
|
9522
|
+
if (params.outputContract !== void 0) {
|
|
9523
|
+
outputOptions.outputContract = params.outputContract;
|
|
9524
|
+
}
|
|
9525
|
+
if (params.outputRoot !== void 0) outputOptions.outputRoot = params.outputRoot;
|
|
9526
|
+
const outputContract = createAgentBuildOutputContract(buildKind, outputOptions);
|
|
9527
|
+
const inputRefs = params.inputRefs ?? [];
|
|
9528
|
+
const packet = {
|
|
9529
|
+
version: DEFAULT_AGENT_BUILD_PACKET_VERSION,
|
|
9530
|
+
run_type: buildKind,
|
|
9531
|
+
build_kind: buildKind,
|
|
9532
|
+
artifact_type: artifactType,
|
|
9533
|
+
title: params.title,
|
|
9534
|
+
goal: params.goal,
|
|
9535
|
+
source_refs: params.sourceRefs ?? [],
|
|
9536
|
+
input_refs: inputRefs,
|
|
9537
|
+
context_markdown: params.contextMarkdown ?? "",
|
|
9538
|
+
planner_documents: normalizePlannerDocuments(params.plannerDocuments),
|
|
9539
|
+
requested_outputs: params.requestedOutputs ?? spec2.requestedOutputs,
|
|
9540
|
+
quality_rules: params.qualityRules ?? [],
|
|
9541
|
+
output_contract: outputContract,
|
|
9542
|
+
runtime_instructions: {
|
|
9543
|
+
agent: "claude-code",
|
|
9544
|
+
template: runtimeTemplate,
|
|
9545
|
+
input_materialization: {
|
|
9546
|
+
directory: DEFAULT_AGENT_BUILD_INPUT_ROOT,
|
|
9547
|
+
manifest: `${DEFAULT_AGENT_BUILD_INPUT_ROOT}/inputs.json`
|
|
9548
|
+
},
|
|
9549
|
+
design_research: {
|
|
9550
|
+
provider: "refero",
|
|
9551
|
+
required: spec2.designResearchRequired
|
|
9552
|
+
}
|
|
9553
|
+
},
|
|
9554
|
+
metadata: {
|
|
9555
|
+
...params.metadata ?? {},
|
|
9556
|
+
build_kind: buildKind,
|
|
9557
|
+
artifact_type: artifactType,
|
|
9558
|
+
build_target: runtimeTemplate,
|
|
9559
|
+
runtime_template: runtimeTemplate,
|
|
9560
|
+
output_contract: outputContract,
|
|
9561
|
+
input_refs: inputRefs,
|
|
9562
|
+
design_research_required: spec2.designResearchRequired,
|
|
9563
|
+
planner_document_kinds: spec2.plannerDocumentKinds
|
|
9564
|
+
}
|
|
9565
|
+
};
|
|
9566
|
+
if (params.runtimeProfileId) packet.runtime_profile_id = params.runtimeProfileId;
|
|
9567
|
+
return packet;
|
|
9568
|
+
}
|
|
9569
|
+
function createAgentBuildPrompt(packet) {
|
|
9570
|
+
return [
|
|
9571
|
+
`Build: ${packet.title}`,
|
|
9572
|
+
"",
|
|
9573
|
+
packet.goal,
|
|
9574
|
+
"",
|
|
9575
|
+
`Materialize input_refs under ${DEFAULT_AGENT_BUILD_INPUT_ROOT}.`,
|
|
9576
|
+
"Use the execution packet, input bundle, planner documents, brand/context notes, and quality rules.",
|
|
9577
|
+
`Write every deliverable under ${packet.output_contract.write_files_under}.`,
|
|
9578
|
+
`Write a JSON manifest to ${packet.output_contract.manifest}.`,
|
|
9579
|
+
"Do not expose secrets. Do not publish externally unless the approval policy allows it."
|
|
9580
|
+
].join("\n");
|
|
9581
|
+
}
|
|
9582
|
+
function createBuildAgentRunParams(params) {
|
|
9583
|
+
const runtimeProfileId = params.agentRuntimeProfileId ?? params.runtimeProfileId;
|
|
9584
|
+
const packetParams = { ...params };
|
|
9585
|
+
if (runtimeProfileId !== void 0) packetParams.runtimeProfileId = runtimeProfileId;
|
|
9586
|
+
const packet = createAgentBuildExecutionPacket(packetParams);
|
|
9587
|
+
return withoutUndefined({
|
|
9588
|
+
prompt: params.prompt ?? createAgentBuildPrompt(packet),
|
|
9589
|
+
targetKind: params.targetKind ?? (params.computerId ? "computer" : "sandbox"),
|
|
9590
|
+
targetId: params.targetId,
|
|
9591
|
+
sandboxId: params.sandboxId,
|
|
9592
|
+
computerId: params.computerId,
|
|
9593
|
+
provider: params.provider ?? "claude-code",
|
|
9594
|
+
model: params.model,
|
|
9595
|
+
cwd: params.cwd ?? "/workspace",
|
|
9596
|
+
timeout: params.timeout ?? 1800,
|
|
9597
|
+
wait: params.wait ?? false,
|
|
9598
|
+
env: params.env,
|
|
9599
|
+
agentRuntimeProfileId: runtimeProfileId,
|
|
9600
|
+
externalWorkspaceId: params.externalWorkspaceId,
|
|
9601
|
+
externalUserId: params.externalUserId,
|
|
9602
|
+
externalProjectId: params.externalProjectId,
|
|
9603
|
+
executionPacket: packet,
|
|
9604
|
+
outputContract: packet.output_contract,
|
|
9605
|
+
approvalPolicy: params.approvalPolicy ?? {
|
|
9606
|
+
publish: "manual",
|
|
9607
|
+
external_write: "manual",
|
|
9608
|
+
destructive_actions: "forbidden"
|
|
9609
|
+
},
|
|
9610
|
+
capabilityRequirements: params.capabilityRequirements ?? [
|
|
9611
|
+
"filesystem",
|
|
9612
|
+
"shell",
|
|
9613
|
+
"artifact_downloads"
|
|
9614
|
+
],
|
|
9615
|
+
metadata: {
|
|
9616
|
+
...params.metadata ?? {},
|
|
9617
|
+
build_kind: packet.build_kind,
|
|
9618
|
+
artifact_type: packet.artifact_type
|
|
9619
|
+
}
|
|
9620
|
+
});
|
|
9621
|
+
}
|
|
9622
|
+
|
|
9078
9623
|
// src/resources/app-auth.ts
|
|
9079
9624
|
function unwrapSession(data) {
|
|
9080
9625
|
const d = data && typeof data === "object" && "data" in data ? data.data : data;
|
|
@@ -9231,6 +9776,6 @@ var AppAuth = class {
|
|
|
9231
9776
|
}
|
|
9232
9777
|
};
|
|
9233
9778
|
|
|
9234
|
-
export { Admin, AgentRunGroups, AgentRuns, AgentRuntimeProfiles, Analytics, ApiKeys, AppAuth, AuditLog, AuthError, Benchmarks, BuilderSessions, Channels, Checkpoints, CommandCenter, Community, Completions, Computer, ComputerAudit, ComputerAutoStop, ComputerConnectors, ComputerEnv, ComputerInbox, ComputerLogs, ComputerNetwork, ComputerOsa, ComputerPorts, ComputerSecrets, ComputerTerminal, ComputerVolumes, Computers, Connectors, Credits, CronJobs, 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, ProjectAuth, ProjectIntegrations, ProjectNotLinkedError, ProviderDefaults, RateLimitError, Regions, RuntimeCapabilitiesResource, RuntimeEnv, SANDBOX_TEMPLATE, Sandbox, SandboxArtifacts, SandboxAudit, SandboxCommands, SandboxConnectors, SandboxEnv, SandboxEvents, SandboxFiles, SandboxNetwork, SandboxPreview, SandboxPreviews, SandboxSecrets, SandboxTags, SandboxTemplates, SandboxTerminal, Sandboxes, ScopeNotAllowedError, ScopedFs, Settings, SnapshotsStandalone, Storage, SubjectNotAllowedError, Tenant, TimeoutError, TokenRefreshFailedError, Usage, UserAuthorizationRequiredError, ValidationError, Volumes, Webhooks, WorkspaceInvites, WorkspaceMembers, verifySignature };
|
|
9779
|
+
export { AGENT_BUILD_KIND_SPECS, Admin, AgentRunGroups, AgentRuns, 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, ProjectAuth, ProjectIntegrations, ProjectNotLinkedError, ProviderDefaults, RateLimitError, Regions, RuntimeCapabilitiesResource, RuntimeEnv, SANDBOX_TEMPLATE, Sandbox, SandboxArtifacts, SandboxAudit, SandboxCommands, SandboxConnectors, SandboxEnv, SandboxEvents, SandboxFiles, SandboxNetwork, SandboxPreview, SandboxPreviews, SandboxSecrets, SandboxTags, SandboxTemplates, SandboxTerminal, Sandboxes, ScopeNotAllowedError, ScopedFs, Settings, SnapshotsStandalone, Storage, SubjectNotAllowedError, Tenant, TimeoutError, TokenRefreshFailedError, Usage, UserAuthorizationRequiredError, ValidationError, Volumes, Webhooks, WorkspaceInvites, WorkspaceMembers, createAgentBuildExecutionPacket, createAgentBuildOutputContract, createAgentBuildPrompt, createBuildAgentRunParams, getAgentBuildKindSpec, resolveAgentBuildKind, verifySignature };
|
|
9235
9780
|
//# sourceMappingURL=index.js.map
|
|
9236
9781
|
//# sourceMappingURL=index.js.map
|