@ornncompute/cli 1.0.120 → 1.0.122
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/package.json +1 -1
- package/src/external-bucket-commands.mjs +25 -46
- package/src/mount-commands.mjs +3 -9
- package/src/registry-commands.mjs +2 -1
- package/src/storage-commands.mjs +54 -95
- package/vendor/api-client/commerce.js +152 -0
- package/vendor/api-client/orchestrator.js +334 -1
- package/vendor/capabilities/cli.js +146 -72
|
@@ -1339,6 +1339,102 @@ function geolocate(request, query3, signal) {
|
|
|
1339
1339
|
});
|
|
1340
1340
|
}
|
|
1341
1341
|
|
|
1342
|
+
// ../../packages/api-client/dist/orchestrator/registry.js
|
|
1343
|
+
function getContainerRegistry(request) {
|
|
1344
|
+
return request("/v1/orchestrator/registry", { method: "GET" });
|
|
1345
|
+
}
|
|
1346
|
+
function listRegistryRepositories(request) {
|
|
1347
|
+
return request("/v1/orchestrator/registry/repositories", { method: "GET" });
|
|
1348
|
+
}
|
|
1349
|
+
function listRegistryTags(request, repository) {
|
|
1350
|
+
return request(`/v1/orchestrator/registry/tags?${new URLSearchParams({ repository })}`, {
|
|
1351
|
+
method: "GET"
|
|
1352
|
+
});
|
|
1353
|
+
}
|
|
1354
|
+
function getRegistryUsage(request) {
|
|
1355
|
+
return request("/v1/orchestrator/registry/usage", { method: "GET" });
|
|
1356
|
+
}
|
|
1357
|
+
function listRegistryCaches(request, query3 = {}) {
|
|
1358
|
+
const params = new URLSearchParams();
|
|
1359
|
+
if (query3.controller_id !== void 0)
|
|
1360
|
+
params.set("controller_id", query3.controller_id);
|
|
1361
|
+
return request(`/v1/orchestrator/registry/caches${params.size ? `?${params}` : ""}`, {
|
|
1362
|
+
method: "GET"
|
|
1363
|
+
});
|
|
1364
|
+
}
|
|
1365
|
+
function deleteRegistryTag(request, repository, tag) {
|
|
1366
|
+
return request(`/v1/orchestrator/registry/tags?${new URLSearchParams({ repository, tag })}`, {
|
|
1367
|
+
method: "DELETE"
|
|
1368
|
+
});
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
// ../../packages/api-client/dist/orchestrator/drives.js
|
|
1372
|
+
function queryPath3(path, query3) {
|
|
1373
|
+
const params = new URLSearchParams();
|
|
1374
|
+
for (const [key, value] of Object.entries(query3)) {
|
|
1375
|
+
if (value !== void 0 && value !== null)
|
|
1376
|
+
params.set(key, String(value));
|
|
1377
|
+
}
|
|
1378
|
+
return `${path}${params.size ? `?${params}` : ""}`;
|
|
1379
|
+
}
|
|
1380
|
+
function listDrives(request, query3 = {}, signal) {
|
|
1381
|
+
return request(queryPath3("/v1/orchestrator/drives", query3), {
|
|
1382
|
+
method: "GET",
|
|
1383
|
+
...signal ? { signal } : {}
|
|
1384
|
+
});
|
|
1385
|
+
}
|
|
1386
|
+
function getDrive(request, id, query3 = {}, options = {}) {
|
|
1387
|
+
return request(queryPath3(`/v1/orchestrator/drives/${encodeURIComponent(id)}`, query3), {
|
|
1388
|
+
method: "GET",
|
|
1389
|
+
...options
|
|
1390
|
+
});
|
|
1391
|
+
}
|
|
1392
|
+
function createDrive(request, body2, options = {}) {
|
|
1393
|
+
return request("/v1/orchestrator/drives", {
|
|
1394
|
+
method: "POST",
|
|
1395
|
+
body: body2,
|
|
1396
|
+
...options
|
|
1397
|
+
});
|
|
1398
|
+
}
|
|
1399
|
+
function updateDrive(request, id, body2, options = {}) {
|
|
1400
|
+
return request(`/v1/orchestrator/drives/${encodeURIComponent(id)}`, {
|
|
1401
|
+
method: "PATCH",
|
|
1402
|
+
body: body2,
|
|
1403
|
+
...options
|
|
1404
|
+
});
|
|
1405
|
+
}
|
|
1406
|
+
function deleteDrive(request, id, query3 = {}, options = {}) {
|
|
1407
|
+
return request(queryPath3(`/v1/orchestrator/drives/${encodeURIComponent(id)}`, query3), {
|
|
1408
|
+
method: "DELETE",
|
|
1409
|
+
...options
|
|
1410
|
+
});
|
|
1411
|
+
}
|
|
1412
|
+
function listStorageTargets(request, signal) {
|
|
1413
|
+
return request("/v1/orchestrator/storage-targets", {
|
|
1414
|
+
method: "GET",
|
|
1415
|
+
...signal ? { signal } : {}
|
|
1416
|
+
});
|
|
1417
|
+
}
|
|
1418
|
+
|
|
1419
|
+
// ../../packages/api-client/dist/orchestrator/drive-files.js
|
|
1420
|
+
function drivePath(id) {
|
|
1421
|
+
return `/v1/orchestrator/drives/${encodeURIComponent(id)}`;
|
|
1422
|
+
}
|
|
1423
|
+
function listDriveContents(request, id, query3 = {}, signal) {
|
|
1424
|
+
const params = new URLSearchParams();
|
|
1425
|
+
for (const [key, value] of Object.entries(query3)) {
|
|
1426
|
+
if (value !== void 0)
|
|
1427
|
+
params.set(key, String(value));
|
|
1428
|
+
}
|
|
1429
|
+
return request(`${drivePath(id)}/contents${params.size ? `?${params}` : ""}`, {
|
|
1430
|
+
method: "GET",
|
|
1431
|
+
...signal ? { signal } : {}
|
|
1432
|
+
});
|
|
1433
|
+
}
|
|
1434
|
+
function clearDriveContents(request, id) {
|
|
1435
|
+
return request(`${drivePath(id)}/contents`, { method: "DELETE" });
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1342
1438
|
// ../../packages/capabilities/dist/capabilities/staff-shared.js
|
|
1343
1439
|
function statusOf(error) {
|
|
1344
1440
|
if (error && typeof error === "object" && "status" in error) {
|
|
@@ -6955,9 +7051,6 @@ function formatBytes(bytes) {
|
|
|
6955
7051
|
}
|
|
6956
7052
|
return `${value >= 10 || unit === 0 ? Math.round(value) : value.toFixed(1)} ${units[unit]}`;
|
|
6957
7053
|
}
|
|
6958
|
-
async function registryOf(context) {
|
|
6959
|
-
return await context.fetch(REGISTRY_PATH, { method: "GET" });
|
|
6960
|
-
}
|
|
6961
7054
|
function repositoryArgument(input, interaction2) {
|
|
6962
7055
|
const raw = input.repository ?? input.$positionals[0];
|
|
6963
7056
|
if (!raw) {
|
|
@@ -6996,7 +7089,7 @@ var registryShowCapability = defineCapability({
|
|
|
6996
7089
|
},
|
|
6997
7090
|
slack: false,
|
|
6998
7091
|
execute: async (context) => {
|
|
6999
|
-
const registry = await
|
|
7092
|
+
const registry = await getContainerRegistry(context.fetch);
|
|
7000
7093
|
const interaction2 = cliInteraction(context);
|
|
7001
7094
|
if (!interaction2)
|
|
7002
7095
|
return registry;
|
|
@@ -7031,11 +7124,11 @@ var registryRepositoriesListCapability = defineCapability({
|
|
|
7031
7124
|
},
|
|
7032
7125
|
slack: false,
|
|
7033
7126
|
execute: async (context) => {
|
|
7034
|
-
const listed = await context.fetch
|
|
7127
|
+
const listed = await listRegistryRepositories(context.fetch);
|
|
7035
7128
|
const interaction2 = cliInteraction(context);
|
|
7036
7129
|
if (!interaction2)
|
|
7037
7130
|
return listed;
|
|
7038
|
-
const registry = await
|
|
7131
|
+
const registry = await getContainerRegistry(context.fetch);
|
|
7039
7132
|
return interaction2.result({
|
|
7040
7133
|
data: listed,
|
|
7041
7134
|
presentation: {
|
|
@@ -7069,9 +7162,9 @@ var registryTagsListCapability = defineCapability({
|
|
|
7069
7162
|
slack: false,
|
|
7070
7163
|
execute: async (context, input) => {
|
|
7071
7164
|
const interaction2 = cliInteraction(context);
|
|
7072
|
-
const registry = await
|
|
7165
|
+
const registry = await getContainerRegistry(context.fetch);
|
|
7073
7166
|
const repository = qualifiedRepository(repositoryArgument(input, interaction2).repository, registry);
|
|
7074
|
-
const listed = await context.fetch
|
|
7167
|
+
const listed = await listRegistryTags(context.fetch, repository);
|
|
7075
7168
|
if (!interaction2)
|
|
7076
7169
|
return listed;
|
|
7077
7170
|
return interaction2.result({
|
|
@@ -7108,7 +7201,7 @@ var registryTagsDeleteCapability = defineCapability({
|
|
|
7108
7201
|
slack: false,
|
|
7109
7202
|
execute: async (context, input) => {
|
|
7110
7203
|
const interaction2 = cliInteraction(context);
|
|
7111
|
-
const registry = await
|
|
7204
|
+
const registry = await getContainerRegistry(context.fetch);
|
|
7112
7205
|
const argument = repositoryArgument(input, interaction2);
|
|
7113
7206
|
const repository = qualifiedRepository(argument.repository, registry);
|
|
7114
7207
|
if (!argument.tag) {
|
|
@@ -7142,9 +7235,7 @@ var registryTagsDeleteCapability = defineCapability({
|
|
|
7142
7235
|
} else if (!context.confirmed) {
|
|
7143
7236
|
return preview("registry.tags.delete", target);
|
|
7144
7237
|
}
|
|
7145
|
-
await context.fetch
|
|
7146
|
-
method: "DELETE"
|
|
7147
|
-
});
|
|
7238
|
+
await deleteRegistryTag(context.fetch, target.repository, target.tag);
|
|
7148
7239
|
const deleted = { deleted: true, ...target };
|
|
7149
7240
|
if (!interaction2)
|
|
7150
7241
|
return deleted;
|
|
@@ -7176,7 +7267,7 @@ var registryUsageCapability = defineCapability({
|
|
|
7176
7267
|
},
|
|
7177
7268
|
slack: false,
|
|
7178
7269
|
execute: async (context) => {
|
|
7179
|
-
const usage = await context.fetch
|
|
7270
|
+
const usage = await getRegistryUsage(context.fetch);
|
|
7180
7271
|
const interaction2 = cliInteraction(context);
|
|
7181
7272
|
if (!interaction2)
|
|
7182
7273
|
return usage;
|
|
@@ -7207,7 +7298,7 @@ var registryCopiesListCapability = defineCapability({
|
|
|
7207
7298
|
}
|
|
7208
7299
|
},
|
|
7209
7300
|
slack: false,
|
|
7210
|
-
execute:
|
|
7301
|
+
execute: (context) => listRegistryCaches(context.fetch)
|
|
7211
7302
|
});
|
|
7212
7303
|
var registryLoginCapability = defineCapability({
|
|
7213
7304
|
id: "registry.login",
|
|
@@ -7484,13 +7575,6 @@ var volumeCapabilities = [
|
|
|
7484
7575
|
})
|
|
7485
7576
|
];
|
|
7486
7577
|
var DRIVES_ROUTE = "/v1/orchestrator/drives";
|
|
7487
|
-
function drivePath(driveId) {
|
|
7488
|
-
return `${DRIVES_ROUTE}/${encodeURIComponent(driveId)}`;
|
|
7489
|
-
}
|
|
7490
|
-
var STORAGE_DRIVES_ROUTE = "/v1/workflows/compute/nodes/storage-drives";
|
|
7491
|
-
function storageDrivePath(driveId, action) {
|
|
7492
|
-
return `${STORAGE_DRIVES_ROUTE}/${encodeURIComponent(driveId)}/${action}`;
|
|
7493
|
-
}
|
|
7494
7578
|
var reservationInput = z30.object({ reservationId: z30.string() });
|
|
7495
7579
|
var reservationWrite = reservationInput.extend({ confirm: z30.boolean().optional() });
|
|
7496
7580
|
var driveInput = z30.object({ driveId: z30.string() });
|
|
@@ -7569,7 +7653,7 @@ var storageVerbCapabilities = [
|
|
|
7569
7653
|
http: { method: "GET", path: "/v1/orchestrator/storage-targets" },
|
|
7570
7654
|
input: z30.object({}),
|
|
7571
7655
|
slack: false,
|
|
7572
|
-
execute: (ctx) => ctx.fetch
|
|
7656
|
+
execute: (ctx) => listStorageTargets(ctx.fetch)
|
|
7573
7657
|
}),
|
|
7574
7658
|
defineCapability({
|
|
7575
7659
|
id: "volume.list",
|
|
@@ -7584,12 +7668,10 @@ var storageVerbCapabilities = [
|
|
|
7584
7668
|
}),
|
|
7585
7669
|
mcp: { name: "storage_volumes_list" },
|
|
7586
7670
|
slack: false,
|
|
7587
|
-
execute: (ctx, input) => {
|
|
7588
|
-
|
|
7589
|
-
|
|
7590
|
-
|
|
7591
|
-
return ctx.fetch(`${DRIVES_ROUTE}?${query3}`, { method: "GET" });
|
|
7592
|
-
}
|
|
7671
|
+
execute: (ctx, input) => listDrives(ctx.fetch, {
|
|
7672
|
+
limit: input.limit ?? 25,
|
|
7673
|
+
...input.cursor ? { cursor: input.cursor } : {}
|
|
7674
|
+
})
|
|
7593
7675
|
}),
|
|
7594
7676
|
defineCapability({
|
|
7595
7677
|
id: "volume.show",
|
|
@@ -7601,7 +7683,7 @@ var storageVerbCapabilities = [
|
|
|
7601
7683
|
input: driveInput,
|
|
7602
7684
|
mcp: { name: "storage_volumes_show" },
|
|
7603
7685
|
slack: false,
|
|
7604
|
-
execute: (ctx, input) => ctx.fetch
|
|
7686
|
+
execute: (ctx, input) => getDrive(ctx.fetch, input.driveId)
|
|
7605
7687
|
}),
|
|
7606
7688
|
defineCapability({
|
|
7607
7689
|
id: "volume.create",
|
|
@@ -7617,9 +7699,9 @@ var storageVerbCapabilities = [
|
|
|
7617
7699
|
}),
|
|
7618
7700
|
mcp: { name: "storage_volumes_create" },
|
|
7619
7701
|
slack: false,
|
|
7620
|
-
execute: (ctx, input) => ctx.fetch
|
|
7621
|
-
|
|
7622
|
-
|
|
7702
|
+
execute: (ctx, input) => createDrive(ctx.fetch, {
|
|
7703
|
+
name: input.name,
|
|
7704
|
+
source_drive_id: input.sourceDriveId ?? null
|
|
7623
7705
|
})
|
|
7624
7706
|
}),
|
|
7625
7707
|
defineCapability({
|
|
@@ -7628,11 +7710,11 @@ var storageVerbCapabilities = [
|
|
|
7628
7710
|
roles: ["user"],
|
|
7629
7711
|
description: "Refresh a storage volume's (drive's) reported usage/state.",
|
|
7630
7712
|
mutation: "preview-confirm",
|
|
7631
|
-
http: { method: "
|
|
7713
|
+
http: { method: "GET", path: `${DRIVES_ROUTE}/{driveId}` },
|
|
7632
7714
|
input: driveWrite,
|
|
7633
7715
|
mcp: { name: "storage_volumes_refresh" },
|
|
7634
7716
|
slack: false,
|
|
7635
|
-
execute: (ctx, input) => ctx.fetch
|
|
7717
|
+
execute: (ctx, input) => getDrive(ctx.fetch, input.driveId, { refresh: true })
|
|
7636
7718
|
}),
|
|
7637
7719
|
defineCapability({
|
|
7638
7720
|
id: "volume.clear",
|
|
@@ -7646,7 +7728,7 @@ var storageVerbCapabilities = [
|
|
|
7646
7728
|
slack: false,
|
|
7647
7729
|
// The route answers 204, so report which volume was cleared.
|
|
7648
7730
|
execute: async (ctx, input) => {
|
|
7649
|
-
await ctx.fetch
|
|
7731
|
+
await clearDriveContents(ctx.fetch, input.driveId);
|
|
7650
7732
|
return { cleared: true, drive_id: input.driveId };
|
|
7651
7733
|
}
|
|
7652
7734
|
}),
|
|
@@ -7661,7 +7743,7 @@ var storageVerbCapabilities = [
|
|
|
7661
7743
|
mcp: { name: "storage_volumes_delete" },
|
|
7662
7744
|
slack: false,
|
|
7663
7745
|
execute: async (ctx, input) => {
|
|
7664
|
-
await ctx.fetch
|
|
7746
|
+
await deleteDrive(ctx.fetch, input.driveId);
|
|
7665
7747
|
return { deleted: true, drive_id: input.driveId };
|
|
7666
7748
|
}
|
|
7667
7749
|
}),
|
|
@@ -7677,22 +7759,19 @@ var storageVerbCapabilities = [
|
|
|
7677
7759
|
slack: false,
|
|
7678
7760
|
execute: (ctx, input) => {
|
|
7679
7761
|
const endpoint = input.endpointUrl ?? (input.provider === "r2" && input.accountId ? `https://${input.accountId}.r2.cloudflarestorage.com` : void 0);
|
|
7680
|
-
return ctx.fetch
|
|
7681
|
-
|
|
7682
|
-
|
|
7683
|
-
|
|
7684
|
-
|
|
7685
|
-
|
|
7686
|
-
|
|
7687
|
-
|
|
7688
|
-
|
|
7689
|
-
|
|
7690
|
-
|
|
7691
|
-
|
|
7692
|
-
|
|
7693
|
-
...input.accessKeyId ? { external_access_key_id: input.accessKeyId } : {},
|
|
7694
|
-
...input.secretAccessKey ? { external_secret_access_key: input.secretAccessKey } : {}
|
|
7695
|
-
}
|
|
7762
|
+
return createDrive(ctx.fetch, {
|
|
7763
|
+
name: input.name ?? input.bucket,
|
|
7764
|
+
provider: "ornn_volume",
|
|
7765
|
+
source_provider: input.provider === "gcs" ? "external_gcs" : "s3",
|
|
7766
|
+
external_bucket: input.bucket,
|
|
7767
|
+
external_prefix: input.prefix ?? null,
|
|
7768
|
+
external_region: input.region ?? (input.provider === "r2" ? "auto" : null),
|
|
7769
|
+
external_read_only: input.readOnly !== false,
|
|
7770
|
+
...input.provider === "r2" ? { external_s3_provider: "cloudflare_r2" } : {},
|
|
7771
|
+
...input.provider === "s3" ? { external_s3_provider: "aws_s3" } : {},
|
|
7772
|
+
...endpoint ? { external_endpoint_url: endpoint } : {},
|
|
7773
|
+
...input.accessKeyId ? { external_access_key_id: input.accessKeyId } : {},
|
|
7774
|
+
...input.secretAccessKey ? { external_secret_access_key: input.secretAccessKey } : {}
|
|
7696
7775
|
});
|
|
7697
7776
|
}
|
|
7698
7777
|
}),
|
|
@@ -7702,11 +7781,11 @@ var storageVerbCapabilities = [
|
|
|
7702
7781
|
roles: ["user"],
|
|
7703
7782
|
description: "Verify a connected S3-compatible bucket's source credentials/connectivity.",
|
|
7704
7783
|
mutation: "preview-confirm",
|
|
7705
|
-
http: { method: "
|
|
7784
|
+
http: { method: "PATCH", path: `${DRIVES_ROUTE}/{driveId}` },
|
|
7706
7785
|
input: driveWrite,
|
|
7707
7786
|
mcp: { name: "storage_buckets_verify" },
|
|
7708
7787
|
slack: false,
|
|
7709
|
-
execute: (ctx, input) => ctx.fetch
|
|
7788
|
+
execute: (ctx, input) => updateDrive(ctx.fetch, input.driveId, { verify_source: true })
|
|
7710
7789
|
}),
|
|
7711
7790
|
defineCapability({
|
|
7712
7791
|
id: "bucket.update_credentials",
|
|
@@ -7714,13 +7793,12 @@ var storageVerbCapabilities = [
|
|
|
7714
7793
|
roles: ["user"],
|
|
7715
7794
|
description: "Update a connected S3-compatible bucket's access key credentials.",
|
|
7716
7795
|
mutation: "preview-confirm",
|
|
7717
|
-
http: { method: "PATCH", path: `${
|
|
7796
|
+
http: { method: "PATCH", path: `${DRIVES_ROUTE}/{driveId}` },
|
|
7718
7797
|
input: driveWrite.extend({ accessKeyId: z30.string(), secretAccessKey: z30.string() }),
|
|
7719
7798
|
mcp: { name: "storage_buckets_update_credentials" },
|
|
7720
7799
|
slack: false,
|
|
7721
|
-
execute: (ctx, input) => ctx.fetch
|
|
7722
|
-
|
|
7723
|
-
body: {
|
|
7800
|
+
execute: (ctx, input) => updateDrive(ctx.fetch, input.driveId, {
|
|
7801
|
+
source_credentials: {
|
|
7724
7802
|
external_access_key_id: input.accessKeyId,
|
|
7725
7803
|
external_secret_access_key: input.secretAccessKey
|
|
7726
7804
|
}
|
|
@@ -7741,12 +7819,11 @@ var storageCompositionCapabilities = [
|
|
|
7741
7819
|
}),
|
|
7742
7820
|
mcp: false,
|
|
7743
7821
|
slack: false,
|
|
7744
|
-
execute: (ctx, input) => {
|
|
7745
|
-
|
|
7746
|
-
|
|
7747
|
-
|
|
7748
|
-
|
|
7749
|
-
}
|
|
7822
|
+
execute: (ctx, input) => listDrives(ctx.fetch, {
|
|
7823
|
+
limit: input.limit ?? 25,
|
|
7824
|
+
scope: "external",
|
|
7825
|
+
...input.cursor ? { cursor: input.cursor } : {}
|
|
7826
|
+
})
|
|
7750
7827
|
}),
|
|
7751
7828
|
defineCapability({
|
|
7752
7829
|
id: "volume.contents",
|
|
@@ -7762,14 +7839,11 @@ var storageCompositionCapabilities = [
|
|
|
7762
7839
|
}),
|
|
7763
7840
|
mcp: false,
|
|
7764
7841
|
slack: false,
|
|
7765
|
-
execute: (ctx, input) => {
|
|
7766
|
-
|
|
7767
|
-
|
|
7768
|
-
|
|
7769
|
-
|
|
7770
|
-
query3.set("cursor", String(input.cursor));
|
|
7771
|
-
return ctx.fetch(`${drivePath(input.driveId)}/contents?${query3}`, { method: "GET" });
|
|
7772
|
-
}
|
|
7842
|
+
execute: (ctx, input) => listDriveContents(ctx.fetch, input.driveId, {
|
|
7843
|
+
recursive: true,
|
|
7844
|
+
...input.path ? { path: input.path } : {},
|
|
7845
|
+
...input.cursor ? { cursor: input.cursor } : {}
|
|
7846
|
+
})
|
|
7773
7847
|
})
|
|
7774
7848
|
];
|
|
7775
7849
|
|