@ornncompute/cli 1.0.138 → 1.0.140
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/catalog-shell.mjs +2 -2
- package/src/evidence-commands.mjs +14 -12
- package/src/external-bucket-commands.mjs +20 -6
- package/src/storage-commands.mjs +22 -30
- package/vendor/capabilities/cli.js +393 -298
package/package.json
CHANGED
package/src/catalog-shell.mjs
CHANGED
|
@@ -814,7 +814,7 @@ function assertCustomerResultSafe(value, ownOrganizationId) {
|
|
|
814
814
|
}
|
|
815
815
|
|
|
816
816
|
function parseCapabilityInput(capability, rawInput) {
|
|
817
|
-
const parsed = capability.input.safeParse(rawInput);
|
|
817
|
+
const parsed = (capability.cli?.input ?? capability.input).safeParse(rawInput);
|
|
818
818
|
if (parsed.success) return parsed.data;
|
|
819
819
|
const issue = parsed.error.issues[0];
|
|
820
820
|
if (issue?.path?.[0] === "$positionals") {
|
|
@@ -992,7 +992,7 @@ async function executeCapability(
|
|
|
992
992
|
let ownOrganizationId;
|
|
993
993
|
let data;
|
|
994
994
|
try {
|
|
995
|
-
data = await capability.execute(
|
|
995
|
+
data = await (capability.cli?.execute ?? capability.execute)(
|
|
996
996
|
{
|
|
997
997
|
actor: "",
|
|
998
998
|
confirmed,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { metricsSnapshotCapability, metricsHistoryCapability } from "../vendor/capabilities/cli.js";
|
|
1
2
|
import * as gatewayApi from "../vendor/api-client/gateway.js";
|
|
2
3
|
import { gpuLabeler } from "./gpu-catalog.mjs";
|
|
3
4
|
import { clusterFactLabel, reservationFactsForCluster } from "./kubernetes-commands.mjs";
|
|
@@ -777,19 +778,20 @@ function invalidEvidenceResponse(code) {
|
|
|
777
778
|
async function metricSource(machine, reservation, window, maximum, deps, deadline, signal, live) {
|
|
778
779
|
const response = await fetchEvidence(
|
|
779
780
|
async (requestSignal) => {
|
|
781
|
+
const context = {
|
|
782
|
+
actor: "",
|
|
783
|
+
role: "user",
|
|
784
|
+
fetch: (path, init) => deps.fetch(path, { ...init, signal: requestSignal }),
|
|
785
|
+
};
|
|
786
|
+
const input = { reservationId: reservation, machineId: machine.id };
|
|
780
787
|
const payload = live
|
|
781
|
-
? await
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
deps.fetch,
|
|
789
|
-
reservation,
|
|
790
|
-
{ machine_id: machine.id, start: window.start, end: window.end, max_points: maximum },
|
|
791
|
-
requestSignal
|
|
792
|
-
);
|
|
788
|
+
? (await metricsSnapshotCapability.execute(context, input))[0]
|
|
789
|
+
: await metricsHistoryCapability.execute(context, {
|
|
790
|
+
...input,
|
|
791
|
+
start: window.start,
|
|
792
|
+
end: window.end,
|
|
793
|
+
maxPoints: maximum,
|
|
794
|
+
});
|
|
793
795
|
const points = metricPoints(payload, maximum, window);
|
|
794
796
|
if (points === null) throw invalidEvidenceResponse("invalid_metrics_response");
|
|
795
797
|
return points;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as storageApi from "../vendor/api-client/orchestrator.js";
|
|
2
2
|
import * as gatewayApi from "../vendor/api-client/gateway.js";
|
|
3
|
+
import { bucketShowCapability, bucketDisconnectCapability } from "../vendor/capabilities/cli.js";
|
|
3
4
|
import { createHash } from "node:crypto";
|
|
4
5
|
import { readFile } from "node:fs/promises";
|
|
5
6
|
|
|
@@ -479,7 +480,11 @@ async function listBuckets(input, runtime) {
|
|
|
479
480
|
|
|
480
481
|
async function showBucket(input, runtime) {
|
|
481
482
|
const [reference] = positions(input, 1, "ornn external-buckets show <external-bucket>");
|
|
482
|
-
const
|
|
483
|
+
const source = resolveExternalBucket(await fetchDrives(runtime), reference);
|
|
484
|
+
const bucket = await bucketShowCapability.execute(
|
|
485
|
+
{ actor: "", role: "user", fetch: runtime.fetch },
|
|
486
|
+
{ driveId: source.id }
|
|
487
|
+
);
|
|
483
488
|
return runtime.interaction.result({ data: { external_bucket: safeExternalBucket(bucket) } });
|
|
484
489
|
}
|
|
485
490
|
|
|
@@ -692,11 +697,20 @@ async function disconnectBucket(input, runtime) {
|
|
|
692
697
|
);
|
|
693
698
|
}
|
|
694
699
|
try {
|
|
695
|
-
await
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
+
await bucketDisconnectCapability.execute(
|
|
701
|
+
{
|
|
702
|
+
actor: "",
|
|
703
|
+
role: "user",
|
|
704
|
+
confirmed: true,
|
|
705
|
+
fetch: (path, init) =>
|
|
706
|
+
runtime.fetch(path, {
|
|
707
|
+
...init,
|
|
708
|
+
...(init?.method === "DELETE"
|
|
709
|
+
? { headers: { ...init.headers, ...idempotencyHeaders(input) } }
|
|
710
|
+
: {}),
|
|
711
|
+
}),
|
|
712
|
+
},
|
|
713
|
+
{ driveId: safe.id }
|
|
700
714
|
);
|
|
701
715
|
} catch (error) {
|
|
702
716
|
throw safeExternalError(error, "The external bucket could not be disconnected safely.");
|
package/src/storage-commands.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as storageApi from "../vendor/api-client/orchestrator.js";
|
|
2
|
+
import { bucketListCapability, volumeFilesListCapability } from "../vendor/capabilities/cli.js";
|
|
2
3
|
import { createHash } from "node:crypto";
|
|
3
4
|
import { createReadStream } from "node:fs";
|
|
4
5
|
import { stat } from "node:fs/promises";
|
|
@@ -292,11 +293,14 @@ export async function fetchDrivePage(runtime, { limit = 25, cursor, scope = "all
|
|
|
292
293
|
usage("--limit must be an integer from 1 through 100.", "limit");
|
|
293
294
|
}
|
|
294
295
|
try {
|
|
295
|
-
const
|
|
296
|
-
|
|
297
|
-
scope
|
|
298
|
-
|
|
299
|
-
|
|
296
|
+
const input = { limit: Number(limit), ...(cursor ? { cursor } : {}) };
|
|
297
|
+
const payload =
|
|
298
|
+
scope === "external"
|
|
299
|
+
? await bucketListCapability.execute(
|
|
300
|
+
{ actor: "", role: "user", fetch: runtime.fetch },
|
|
301
|
+
input
|
|
302
|
+
)
|
|
303
|
+
: await storageApi.listDrives(runtime.fetch, { ...input, scope });
|
|
300
304
|
return { drives: volumeRows(payload), next_cursor: payload?.next_cursor ?? null };
|
|
301
305
|
} catch (error) {
|
|
302
306
|
throw safeStorageError(error, "Volumes could not be loaded safely.");
|
|
@@ -552,33 +556,21 @@ function shellQuote(value) {
|
|
|
552
556
|
}
|
|
553
557
|
|
|
554
558
|
async function fetchFileRows(runtime, drive, prefix) {
|
|
555
|
-
const folder = prefix.includes("/") ? prefix.slice(0, prefix.lastIndexOf("/")) : "";
|
|
556
559
|
const entries = [];
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
page = await storageApi.listDriveContents(runtime.fetch, String(drive.id), {
|
|
562
|
-
recursive: true,
|
|
563
|
-
...(folder ? { path: folder } : {}),
|
|
564
|
-
...(cursor ? { cursor } : {}),
|
|
565
|
-
});
|
|
566
|
-
} catch (error) {
|
|
567
|
-
throw safeStorageError(error, "Volume files could not be listed safely.");
|
|
568
|
-
}
|
|
569
|
-
entries.push(...(Array.isArray(page?.entries) ? page.entries : []));
|
|
570
|
-
const next = page?.next_cursor;
|
|
571
|
-
cursor = Number.isInteger(next) || (typeof next === "string" && next) ? next : null;
|
|
572
|
-
}
|
|
573
|
-
return entries
|
|
574
|
-
.filter((entry) => entry?.kind === "file")
|
|
575
|
-
.map(safeFile)
|
|
576
|
-
.filter((entry) => entry.path && entry.path.startsWith(prefix))
|
|
577
|
-
.sort(
|
|
578
|
-
(left, right) =>
|
|
579
|
-
(Date.parse(right.updated_at ?? "") || 0) - (Date.parse(left.updated_at ?? "") || 0) ||
|
|
580
|
-
left.path.localeCompare(right.path)
|
|
560
|
+
try {
|
|
561
|
+
const files = await volumeFilesListCapability.execute(
|
|
562
|
+
{ actor: "", role: "user", fetch: runtime.fetch },
|
|
563
|
+
{ driveId: drive.id, prefix }
|
|
581
564
|
);
|
|
565
|
+
for await (const entry of files) entries.push(safeFile(entry));
|
|
566
|
+
} catch (error) {
|
|
567
|
+
throw safeStorageError(error, "Volume files could not be listed safely.");
|
|
568
|
+
}
|
|
569
|
+
return entries.sort(
|
|
570
|
+
(left, right) =>
|
|
571
|
+
(Date.parse(right.updated_at ?? "") || 0) - (Date.parse(left.updated_at ?? "") || 0) ||
|
|
572
|
+
left.path.localeCompare(right.path)
|
|
573
|
+
);
|
|
582
574
|
}
|
|
583
575
|
|
|
584
576
|
async function listFiles(input, runtime) {
|
|
@@ -333,8 +333,8 @@ function defineCapability(spec) {
|
|
|
333
333
|
...rest,
|
|
334
334
|
...cli !== false && cli !== void 0 ? {
|
|
335
335
|
cli: {
|
|
336
|
-
|
|
337
|
-
|
|
336
|
+
...cli,
|
|
337
|
+
command: cli.command ?? names.cli
|
|
338
338
|
}
|
|
339
339
|
} : {},
|
|
340
340
|
...mcp === false ? {} : { mcp: { name: mcp?.name ?? names.mcp } },
|
|
@@ -4105,43 +4105,6 @@ var machinePushKeysCapability = defineCapability({
|
|
|
4105
4105
|
ssh_key_ids: input.sshKeyIds
|
|
4106
4106
|
})
|
|
4107
4107
|
});
|
|
4108
|
-
var machineMetricsCapabilities = [
|
|
4109
|
-
defineCapability({
|
|
4110
|
-
id: "machine.live_metrics",
|
|
4111
|
-
domain: "access",
|
|
4112
|
-
roles: ["user"],
|
|
4113
|
-
description: "Fetch a live metrics snapshot for one reservation machine.",
|
|
4114
|
-
mutation: "read",
|
|
4115
|
-
input: z17.object({ reservationId: z17.string(), machineId: z17.string() }),
|
|
4116
|
-
mcp: false,
|
|
4117
|
-
slack: false,
|
|
4118
|
-
execute: (ctx, input) => getReservationLiveMetrics(ctx.fetch, input.reservationId, {
|
|
4119
|
-
machine_id: input.machineId
|
|
4120
|
-
})
|
|
4121
|
-
}),
|
|
4122
|
-
defineCapability({
|
|
4123
|
-
id: "machine.telemetry_history",
|
|
4124
|
-
domain: "access",
|
|
4125
|
-
roles: ["user"],
|
|
4126
|
-
description: "Fetch historical telemetry for one reservation machine over a time range.",
|
|
4127
|
-
mutation: "read",
|
|
4128
|
-
input: z17.object({
|
|
4129
|
-
reservationId: z17.string(),
|
|
4130
|
-
machineId: z17.string(),
|
|
4131
|
-
start: z17.string().optional(),
|
|
4132
|
-
end: z17.string().optional(),
|
|
4133
|
-
maxPoints: z17.number().int().positive().optional()
|
|
4134
|
-
}),
|
|
4135
|
-
mcp: false,
|
|
4136
|
-
slack: false,
|
|
4137
|
-
execute: (ctx, input) => getReservationTelemetryHistory(ctx.fetch, input.reservationId, {
|
|
4138
|
-
machine_id: input.machineId,
|
|
4139
|
-
start: input.start || void 0,
|
|
4140
|
-
end: input.end || void 0,
|
|
4141
|
-
max_points: input.maxPoints
|
|
4142
|
-
})
|
|
4143
|
-
})
|
|
4144
|
-
];
|
|
4145
4108
|
|
|
4146
4109
|
// ../../packages/capabilities/dist/capabilities/credits.js
|
|
4147
4110
|
import { z as z18 } from "zod";
|
|
@@ -4730,30 +4693,119 @@ function externalBucketCapability({ acceptedReferences = [], automation, command
|
|
|
4730
4693
|
});
|
|
4731
4694
|
}
|
|
4732
4695
|
var gcsImportGuidance = "GCS requires bucket-level read access for your organization's Ornn transfer account. Connecting prints the account and the two gcloud grants (roles/storage.objectViewer and roles/storage.legacyBucketReader). After granting, deploy the volume from the Ornn console; CLI 1.x import still requires verification, which GCS does not support. Steps: https://docs.ornn.com/cli#gcs-imports-and-storage-transfer-service";
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4696
|
+
function isExternalBucket(drive) {
|
|
4697
|
+
const source = drive.source;
|
|
4698
|
+
if (!source || source.managed === true || source.provider === "ornn_object")
|
|
4699
|
+
return false;
|
|
4700
|
+
return ["external_gcs", "s3", "r2", "cloudflare_r2"].includes(source.provider ?? "") || Boolean(source.bucket);
|
|
4701
|
+
}
|
|
4702
|
+
var bucketInput = z21.object({ driveId: z21.string() });
|
|
4703
|
+
var bucketListCapability = defineCapability({
|
|
4704
|
+
id: "storage.external-buckets.list",
|
|
4705
|
+
domain: "storage",
|
|
4706
|
+
roles: ["user"],
|
|
4707
|
+
description: "List a page of connected external buckets. Pass next_cursor as cursor to continue.",
|
|
4708
|
+
mutation: "read",
|
|
4709
|
+
input: z21.object({
|
|
4710
|
+
limit: z21.number().int().min(1).max(100).optional(),
|
|
4711
|
+
cursor: z21.string().optional()
|
|
4712
|
+
}),
|
|
4713
|
+
mcp: { name: "storage_buckets_list" },
|
|
4714
|
+
slack: false,
|
|
4715
|
+
execute: async (context, input) => {
|
|
4716
|
+
const page = await listDrives(context.fetch, {
|
|
4717
|
+
limit: input.limit ?? 25,
|
|
4718
|
+
scope: "external",
|
|
4719
|
+
...input.cursor ? { cursor: input.cursor } : {}
|
|
4720
|
+
});
|
|
4721
|
+
return { ...page, drives: page.drives.filter(isExternalBucket) };
|
|
4722
|
+
},
|
|
4723
|
+
cli: {
|
|
4736
4724
|
command: ["external-buckets", "list"],
|
|
4737
|
-
description: "List connected GCS, S3, and R2 buckets in one bounded page.",
|
|
4738
|
-
mutation: "read",
|
|
4739
4725
|
input: pageInput2,
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4726
|
+
execute: (context, input) => externalBucketExecutor(context)("storage.external-buckets.list", input),
|
|
4727
|
+
vnext: {
|
|
4728
|
+
arguments: "semantic",
|
|
4729
|
+
audience: "customer",
|
|
4730
|
+
category: "resource",
|
|
4731
|
+
outcome: "List external bucket connections without exposing stored credentials.",
|
|
4732
|
+
human: "ornn external-buckets list [--limit <1-100>] [--cursor <cursor>]",
|
|
4733
|
+
automation: "ornn external-buckets list --limit 50 --format json",
|
|
4734
|
+
acceptedReferences: [],
|
|
4735
|
+
related: ["external-buckets show", "external-buckets connect"],
|
|
4736
|
+
resumableStates: []
|
|
4737
|
+
}
|
|
4738
|
+
}
|
|
4739
|
+
});
|
|
4740
|
+
var bucketShowCapability = defineCapability({
|
|
4741
|
+
id: "storage.external-buckets.show",
|
|
4742
|
+
domain: "storage",
|
|
4743
|
+
roles: ["user"],
|
|
4744
|
+
description: "Show a single connected external bucket by drive id.",
|
|
4745
|
+
mutation: "read",
|
|
4746
|
+
input: bucketInput,
|
|
4747
|
+
mcp: { name: "storage_buckets_show" },
|
|
4748
|
+
slack: false,
|
|
4749
|
+
execute: async (context, input) => {
|
|
4750
|
+
const bucket = await getDrive(context.fetch, input.driveId);
|
|
4751
|
+
if (!isExternalBucket(bucket))
|
|
4752
|
+
throw new Error(`Storage bucket not found: ${input.driveId}`);
|
|
4753
|
+
return bucket;
|
|
4754
|
+
},
|
|
4755
|
+
cli: {
|
|
4747
4756
|
command: ["external-buckets", "show"],
|
|
4748
|
-
description: "Inspect one connected external bucket by canonical ID or exact unique name.",
|
|
4749
|
-
mutation: "read",
|
|
4750
4757
|
input: showInput,
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4758
|
+
execute: (context, input) => externalBucketExecutor(context)("storage.external-buckets.show", input),
|
|
4759
|
+
vnext: {
|
|
4760
|
+
arguments: "semantic",
|
|
4761
|
+
audience: "customer",
|
|
4762
|
+
category: "resource",
|
|
4763
|
+
outcome: "Inspect one credential-safe external bucket connection.",
|
|
4764
|
+
human: "ornn external-buckets show <external-bucket>",
|
|
4765
|
+
automation: "ornn external-buckets show <external-bucket-id> --format json",
|
|
4766
|
+
acceptedReferences: ["canonical external bucket ID", "exact unique external bucket name"],
|
|
4767
|
+
related: ["external-buckets verify", "external-buckets import"],
|
|
4768
|
+
resumableStates: []
|
|
4769
|
+
}
|
|
4770
|
+
}
|
|
4771
|
+
});
|
|
4772
|
+
var bucketDisconnectCapability = defineCapability({
|
|
4773
|
+
id: "storage.external-buckets.disconnect",
|
|
4774
|
+
domain: "storage",
|
|
4775
|
+
roles: ["user"],
|
|
4776
|
+
description: "Disconnect a connected external bucket (deletes the backing drive record).",
|
|
4777
|
+
mutation: "preview-confirm",
|
|
4778
|
+
input: bucketInput,
|
|
4779
|
+
mcp: { name: "storage_buckets_disconnect" },
|
|
4780
|
+
slack: false,
|
|
4781
|
+
execute: async (context, input) => {
|
|
4782
|
+
if (!context.confirmed)
|
|
4783
|
+
return preview("storage.external-buckets.disconnect", input);
|
|
4784
|
+
await bucketShowCapability.execute(context, input);
|
|
4785
|
+
await deleteDrive(context.fetch, input.driveId);
|
|
4786
|
+
return { disconnected: true, drive_id: input.driveId };
|
|
4787
|
+
},
|
|
4788
|
+
cli: {
|
|
4789
|
+
command: ["external-buckets", "disconnect"],
|
|
4790
|
+
input: disconnectInput,
|
|
4791
|
+
execute: (context, input) => externalBucketExecutor(context)("storage.external-buckets.disconnect", input),
|
|
4792
|
+
vnext: {
|
|
4793
|
+
arguments: "semantic",
|
|
4794
|
+
audience: "customer",
|
|
4795
|
+
category: "resource",
|
|
4796
|
+
outcome: "Remove one external source connection without writing to its source bucket.",
|
|
4797
|
+
human: "ornn external-buckets disconnect <external-bucket>",
|
|
4798
|
+
automation: "ornn external-buckets disconnect <external-bucket-id> --idempotency-key <key> --format json",
|
|
4799
|
+
acceptedReferences: ["canonical external bucket ID", "exact unique external bucket name"],
|
|
4800
|
+
review: "Disconnecting reduces access to the source and is blocked while mounts remain.",
|
|
4801
|
+
related: ["storage detach", "external-buckets show"],
|
|
4802
|
+
resumableStates: []
|
|
4803
|
+
}
|
|
4804
|
+
}
|
|
4805
|
+
});
|
|
4806
|
+
var externalBucketCapabilities = [
|
|
4807
|
+
bucketListCapability,
|
|
4808
|
+
bucketShowCapability,
|
|
4757
4809
|
externalBucketCapability({
|
|
4758
4810
|
id: "storage.external-buckets.connect",
|
|
4759
4811
|
command: ["external-buckets", "connect"],
|
|
@@ -4806,19 +4858,7 @@ var externalBucketCapabilities = [
|
|
|
4806
4858
|
resumableStates: ["pending", "working", "partial", "failed", "interrupted"],
|
|
4807
4859
|
related: ["external-buckets show", "storage status", "volumes files list"]
|
|
4808
4860
|
}),
|
|
4809
|
-
|
|
4810
|
-
id: "storage.external-buckets.disconnect",
|
|
4811
|
-
command: ["external-buckets", "disconnect"],
|
|
4812
|
-
description: "Disconnect an external bucket record after its working volume is detached.",
|
|
4813
|
-
mutation: "preview-confirm",
|
|
4814
|
-
input: disconnectInput,
|
|
4815
|
-
outcome: "Remove one external source connection without writing to its source bucket.",
|
|
4816
|
-
human: "ornn external-buckets disconnect <external-bucket>",
|
|
4817
|
-
automation: "ornn external-buckets disconnect <external-bucket-id> --idempotency-key <key> --format json",
|
|
4818
|
-
acceptedReferences: ["canonical external bucket ID", "exact unique external bucket name"],
|
|
4819
|
-
review: "Disconnecting reduces access to the source and is blocked while mounts remain.",
|
|
4820
|
-
related: ["storage detach", "external-buckets show"]
|
|
4821
|
-
})
|
|
4861
|
+
bucketDisconnectCapability
|
|
4822
4862
|
];
|
|
4823
4863
|
|
|
4824
4864
|
// ../../packages/capabilities/dist/capabilities/evidence.js
|
|
@@ -4965,19 +5005,74 @@ var evidenceCapabilities = [
|
|
|
4965
5005
|
clusterLogsCapability
|
|
4966
5006
|
];
|
|
4967
5007
|
|
|
4968
|
-
// ../../packages/capabilities/dist/capabilities/
|
|
5008
|
+
// ../../packages/capabilities/dist/capabilities/metrics.js
|
|
4969
5009
|
import { z as z23 } from "zod";
|
|
4970
|
-
var
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
|
|
5010
|
+
var metricInput = z23.object({ reservationId: z23.string(), machineId: z23.string().optional() });
|
|
5011
|
+
async function nodeIds(context, input) {
|
|
5012
|
+
if (input.machineId)
|
|
5013
|
+
return [input.machineId];
|
|
5014
|
+
const { nodes: nodes2 } = await listNodes(context.fetch, {
|
|
5015
|
+
reservation_id: input.reservationId
|
|
5016
|
+
});
|
|
5017
|
+
if (!nodes2.length)
|
|
5018
|
+
throw new Error("No machines were found for this reservation.");
|
|
5019
|
+
return nodes2.map((node) => node.node_id);
|
|
5020
|
+
}
|
|
5021
|
+
var metricsSnapshotCapability = defineCapability({
|
|
5022
|
+
id: "metrics.snapshot",
|
|
5023
|
+
domain: "access",
|
|
5024
|
+
roles: ["user"],
|
|
5025
|
+
mutation: "read",
|
|
5026
|
+
description: "Fetch a live metrics snapshot for a reservation's machine(s) (GPU/CPU/memory utilization, etc). machineId is optional: omit it to resolve every active machine on the reservation, or pass it to scope to one.",
|
|
5027
|
+
input: metricInput,
|
|
5028
|
+
slack: false,
|
|
5029
|
+
execute: async (context, input) => {
|
|
5030
|
+
const snapshots = [];
|
|
5031
|
+
for (const nodeId3 of await nodeIds(context, input)) {
|
|
5032
|
+
snapshots.push(await getReservationLiveMetrics(context.fetch, input.reservationId, {
|
|
5033
|
+
machine_id: nodeId3
|
|
5034
|
+
}));
|
|
5035
|
+
}
|
|
5036
|
+
return snapshots;
|
|
5037
|
+
}
|
|
5038
|
+
});
|
|
5039
|
+
var metricsHistoryCapability = defineCapability({
|
|
5040
|
+
id: "metrics.history",
|
|
5041
|
+
domain: "access",
|
|
5042
|
+
roles: ["user"],
|
|
5043
|
+
mutation: "read",
|
|
5044
|
+
description: "Fetch historical telemetry for a reservation's machine over a time range. machineId is optional: omit it to use the first active machine on the reservation.",
|
|
5045
|
+
input: metricInput.extend({
|
|
5046
|
+
start: z23.string().optional(),
|
|
5047
|
+
end: z23.string().optional(),
|
|
5048
|
+
maxPoints: z23.number().int().positive().optional()
|
|
5049
|
+
}),
|
|
5050
|
+
slack: false,
|
|
5051
|
+
execute: async (context, input) => {
|
|
5052
|
+
const [nodeId3] = await nodeIds(context, input);
|
|
5053
|
+
return getReservationTelemetryHistory(context.fetch, input.reservationId, {
|
|
5054
|
+
machine_id: nodeId3,
|
|
5055
|
+
start: input.start || void 0,
|
|
5056
|
+
end: input.end || void 0,
|
|
5057
|
+
max_points: input.maxPoints
|
|
5058
|
+
});
|
|
5059
|
+
}
|
|
5060
|
+
});
|
|
5061
|
+
var metricsCapabilities = [metricsSnapshotCapability, metricsHistoryCapability];
|
|
5062
|
+
|
|
5063
|
+
// ../../packages/capabilities/dist/capabilities/mounts.js
|
|
5064
|
+
import { z as z24 } from "zod";
|
|
5065
|
+
var mountInput = z24.object({
|
|
5066
|
+
$positionals: z24.array(z24.string()).default([]),
|
|
5067
|
+
access: z24.string().optional(),
|
|
5068
|
+
cursor: z24.string().optional(),
|
|
5069
|
+
idempotencyKey: z24.string().optional(),
|
|
5070
|
+
limit: z24.union([z24.string(), z24.number()]).optional(),
|
|
5071
|
+
noWait: z24.boolean().optional(),
|
|
5072
|
+
timeout: z24.string().optional(),
|
|
5073
|
+
volume: z24.string().optional(),
|
|
5074
|
+
wait: z24.boolean().optional(),
|
|
5075
|
+
yes: z24.boolean().optional()
|
|
4981
5076
|
}).strict();
|
|
4982
5077
|
function mountExecutor(context) {
|
|
4983
5078
|
const interaction = context.cli?.interaction;
|
|
@@ -5086,13 +5181,13 @@ var mountCapabilities = [
|
|
|
5086
5181
|
];
|
|
5087
5182
|
|
|
5088
5183
|
// ../../packages/capabilities/dist/capabilities/identity.js
|
|
5089
|
-
import { z as
|
|
5090
|
-
var emptyInput3 =
|
|
5091
|
-
var loginInput =
|
|
5092
|
-
authBase:
|
|
5093
|
-
noBrowser:
|
|
5094
|
-
pollInterval:
|
|
5095
|
-
timeout:
|
|
5184
|
+
import { z as z25 } from "zod";
|
|
5185
|
+
var emptyInput3 = z25.object({});
|
|
5186
|
+
var loginInput = z25.object({
|
|
5187
|
+
authBase: z25.string().min(1).optional(),
|
|
5188
|
+
noBrowser: z25.boolean().optional(),
|
|
5189
|
+
pollInterval: z25.number().positive().optional(),
|
|
5190
|
+
timeout: z25.number().positive().optional()
|
|
5096
5191
|
});
|
|
5097
5192
|
function executeSession(context, command, input) {
|
|
5098
5193
|
if (!context.cli?.session) {
|
|
@@ -5211,50 +5306,50 @@ var identityCapabilities = [
|
|
|
5211
5306
|
];
|
|
5212
5307
|
|
|
5213
5308
|
// ../../packages/capabilities/dist/capabilities/listings.js
|
|
5214
|
-
import { z as
|
|
5215
|
-
var listingCreateInput =
|
|
5216
|
-
organizationId:
|
|
5217
|
-
organization_id:
|
|
5218
|
-
facilityId:
|
|
5219
|
-
facility_id:
|
|
5220
|
-
kind:
|
|
5221
|
-
gpu:
|
|
5222
|
-
cpu:
|
|
5223
|
-
site:
|
|
5224
|
-
fabric:
|
|
5225
|
-
min_nodes:
|
|
5226
|
-
starts_after:
|
|
5227
|
-
starts_before:
|
|
5228
|
-
ends_after:
|
|
5229
|
-
ends_before:
|
|
5230
|
-
gpu_type:
|
|
5231
|
-
node_model:
|
|
5232
|
-
fabric_type:
|
|
5233
|
-
node_count:
|
|
5234
|
-
gpus_per_node:
|
|
5235
|
-
cores_per_node:
|
|
5236
|
-
site_nickname:
|
|
5237
|
-
site_supplier:
|
|
5238
|
-
ram:
|
|
5239
|
-
storage:
|
|
5240
|
-
internet:
|
|
5241
|
-
network_hardware:
|
|
5242
|
-
available_start_at:
|
|
5243
|
-
available_end_at:
|
|
5244
|
-
available_from:
|
|
5245
|
-
available_to:
|
|
5246
|
-
buy_now_price_per_gpu_hour:
|
|
5247
|
-
deposit_percent:
|
|
5248
|
-
down_payment_cents:
|
|
5249
|
-
access_mode:
|
|
5250
|
-
state:
|
|
5251
|
-
price_omitted:
|
|
5252
|
-
announce:
|
|
5253
|
-
text:
|
|
5254
|
-
confirm:
|
|
5255
|
-
idempotencyKey:
|
|
5256
|
-
});
|
|
5257
|
-
var catalogTermsInput =
|
|
5309
|
+
import { z as z26 } from "zod";
|
|
5310
|
+
var listingCreateInput = z26.object({
|
|
5311
|
+
organizationId: z26.string().optional(),
|
|
5312
|
+
organization_id: z26.string().optional(),
|
|
5313
|
+
facilityId: z26.string().optional(),
|
|
5314
|
+
facility_id: z26.string().optional(),
|
|
5315
|
+
kind: z26.enum(["gpu", "cpu", "node", "link"]).optional(),
|
|
5316
|
+
gpu: z26.string().optional(),
|
|
5317
|
+
cpu: z26.string().optional(),
|
|
5318
|
+
site: z26.string().optional(),
|
|
5319
|
+
fabric: z26.string().optional(),
|
|
5320
|
+
min_nodes: z26.number().int().optional(),
|
|
5321
|
+
starts_after: z26.string().optional(),
|
|
5322
|
+
starts_before: z26.string().optional(),
|
|
5323
|
+
ends_after: z26.string().optional(),
|
|
5324
|
+
ends_before: z26.string().optional(),
|
|
5325
|
+
gpu_type: z26.string().optional(),
|
|
5326
|
+
node_model: z26.string().optional(),
|
|
5327
|
+
fabric_type: z26.string().optional(),
|
|
5328
|
+
node_count: z26.number().int().optional(),
|
|
5329
|
+
gpus_per_node: z26.number().int().optional(),
|
|
5330
|
+
cores_per_node: z26.number().int().optional().describe('CPU listings: cores per node (2 vCPUs each), at least 1, priced per vCPU-hour. Omit gpu_type or set it to "cpu".'),
|
|
5331
|
+
site_nickname: z26.string().optional().describe("A state, city, address, or catalog region such as us-west-3."),
|
|
5332
|
+
site_supplier: z26.string().optional(),
|
|
5333
|
+
ram: z26.string().optional(),
|
|
5334
|
+
storage: z26.string().optional(),
|
|
5335
|
+
internet: z26.string().optional(),
|
|
5336
|
+
network_hardware: z26.string().optional(),
|
|
5337
|
+
available_start_at: z26.string().optional().describe("Start of the availability window. YYYY-MM-DD or RFC3339."),
|
|
5338
|
+
available_end_at: z26.string().optional().describe("End of the availability window. YYYY-MM-DD or RFC3339."),
|
|
5339
|
+
available_from: z26.string().optional().describe("Alias for available_start_at."),
|
|
5340
|
+
available_to: z26.string().optional().describe("Alias for available_end_at."),
|
|
5341
|
+
buy_now_price_per_gpu_hour: z26.number().optional().describe("Price buyers pay, USD per GPU-hour (per vCPU-hour on CPU listings)."),
|
|
5342
|
+
deposit_percent: z26.number().optional(),
|
|
5343
|
+
down_payment_cents: z26.number().int().nonnegative().optional(),
|
|
5344
|
+
access_mode: z26.enum(["bare-metal", "virtual-machine"]).optional(),
|
|
5345
|
+
state: z26.enum(["available", "draft"]).optional(),
|
|
5346
|
+
price_omitted: z26.boolean().optional(),
|
|
5347
|
+
announce: z26.boolean().optional(),
|
|
5348
|
+
text: z26.string().optional(),
|
|
5349
|
+
confirm: z26.boolean().optional(),
|
|
5350
|
+
idempotencyKey: z26.string().min(1).max(200).optional()
|
|
5351
|
+
});
|
|
5352
|
+
var catalogTermsInput = z26.object({ kind: z26.enum(["gpu", "cpu", "node", "link"]).optional() });
|
|
5258
5353
|
var slackListingCreateParams = {
|
|
5259
5354
|
type: "object",
|
|
5260
5355
|
properties: {
|
|
@@ -5552,12 +5647,12 @@ var listingCapabilities = [
|
|
|
5552
5647
|
];
|
|
5553
5648
|
|
|
5554
5649
|
// ../../packages/capabilities/dist/capabilities/organization-invites.js
|
|
5555
|
-
import { z as
|
|
5556
|
-
var organizationInviteInput =
|
|
5557
|
-
organization_id:
|
|
5558
|
-
email:
|
|
5559
|
-
organization_role:
|
|
5560
|
-
send_email:
|
|
5650
|
+
import { z as z27 } from "zod";
|
|
5651
|
+
var organizationInviteInput = z27.object({
|
|
5652
|
+
organization_id: z27.uuid().optional(),
|
|
5653
|
+
email: z27.string().trim().toLowerCase().pipe(z27.email()),
|
|
5654
|
+
organization_role: z27.enum(["consumer", "supplier"]).optional(),
|
|
5655
|
+
send_email: z27.boolean().optional().describe("Defaults to true for an existing organization; false returns a link. Signup invites cannot be emailed.")
|
|
5561
5656
|
}).superRefine((input, ctx) => {
|
|
5562
5657
|
if (!input.organization_id && input.send_email === true) {
|
|
5563
5658
|
ctx.addIssue({
|
|
@@ -5617,33 +5712,33 @@ var organizationInviteCapability = defineCapability({
|
|
|
5617
5712
|
});
|
|
5618
5713
|
|
|
5619
5714
|
// ../../packages/capabilities/dist/capabilities/networks.js
|
|
5620
|
-
import { z as
|
|
5715
|
+
import { z as z28 } from "zod";
|
|
5621
5716
|
var globalInput = {
|
|
5622
|
-
$positionals:
|
|
5623
|
-
guided:
|
|
5624
|
-
idempotencyKey:
|
|
5625
|
-
noBrowser:
|
|
5626
|
-
noWait:
|
|
5627
|
-
overwrite:
|
|
5628
|
-
print:
|
|
5629
|
-
wait:
|
|
5630
|
-
yes:
|
|
5717
|
+
$positionals: z28.array(z28.string()).optional(),
|
|
5718
|
+
guided: z28.boolean().optional(),
|
|
5719
|
+
idempotencyKey: z28.string().optional(),
|
|
5720
|
+
noBrowser: z28.boolean().optional(),
|
|
5721
|
+
noWait: z28.boolean().optional(),
|
|
5722
|
+
overwrite: z28.boolean().optional(),
|
|
5723
|
+
print: z28.boolean().optional(),
|
|
5724
|
+
wait: z28.boolean().optional(),
|
|
5725
|
+
yes: z28.boolean().optional()
|
|
5631
5726
|
};
|
|
5632
|
-
var noOptionsInput =
|
|
5633
|
-
var connectInput2 =
|
|
5727
|
+
var noOptionsInput = z28.object(globalInput).strict();
|
|
5728
|
+
var connectInput2 = z28.object({
|
|
5634
5729
|
...globalInput,
|
|
5635
|
-
identityFile:
|
|
5636
|
-
output:
|
|
5637
|
-
user:
|
|
5730
|
+
identityFile: z28.string().optional(),
|
|
5731
|
+
output: z28.string().optional(),
|
|
5732
|
+
user: z28.string().optional()
|
|
5638
5733
|
}).strict();
|
|
5639
|
-
var listInput =
|
|
5640
|
-
var networkCreateInput =
|
|
5641
|
-
var networkUpdateInput =
|
|
5642
|
-
var vpnConfigureInput =
|
|
5734
|
+
var listInput = z28.object({ ...globalInput, cursor: z28.string().optional(), limit: z28.string().optional() }).strict();
|
|
5735
|
+
var networkCreateInput = z28.object({ ...globalInput, cidr: z28.string().optional(), name: z28.string().optional() }).strict();
|
|
5736
|
+
var networkUpdateInput = z28.object({ ...globalInput, name: z28.string().optional() }).strict();
|
|
5737
|
+
var vpnConfigureInput = z28.object({
|
|
5643
5738
|
...globalInput,
|
|
5644
|
-
name:
|
|
5645
|
-
output:
|
|
5646
|
-
privateKey:
|
|
5739
|
+
name: z28.string().optional(),
|
|
5740
|
+
output: z28.string().optional(),
|
|
5741
|
+
privateKey: z28.string().optional()
|
|
5647
5742
|
}).strict();
|
|
5648
5743
|
function networkExecutor(context) {
|
|
5649
5744
|
const runtime3 = context.cli?.interaction;
|
|
@@ -5888,12 +5983,12 @@ var networkCapabilities = [
|
|
|
5888
5983
|
vpnConnectionDisconnectCapability,
|
|
5889
5984
|
connectCapability
|
|
5890
5985
|
];
|
|
5891
|
-
var networkUpdateFields =
|
|
5892
|
-
networkId:
|
|
5893
|
-
name:
|
|
5894
|
-
description:
|
|
5895
|
-
clearDescription:
|
|
5896
|
-
confirm:
|
|
5986
|
+
var networkUpdateFields = z28.object({
|
|
5987
|
+
networkId: z28.string(),
|
|
5988
|
+
name: z28.string().optional(),
|
|
5989
|
+
description: z28.string().optional(),
|
|
5990
|
+
clearDescription: z28.boolean().optional(),
|
|
5991
|
+
confirm: z28.boolean().optional()
|
|
5897
5992
|
}).refine((input) => !(input.clearDescription && input.description !== void 0), {
|
|
5898
5993
|
message: "Use either description or clearDescription, not both."
|
|
5899
5994
|
}).refine((input) => input.name !== void 0 || input.description !== void 0 || input.clearDescription, { message: "Provide name, description, or clearDescription." });
|
|
@@ -5904,7 +5999,7 @@ var networkVerbCapabilities = [
|
|
|
5904
5999
|
roles: ["user"],
|
|
5905
6000
|
description: "List this tenant's private networks.",
|
|
5906
6001
|
mutation: "read",
|
|
5907
|
-
input:
|
|
6002
|
+
input: z28.object({}),
|
|
5908
6003
|
mcp: { name: "networks_list" },
|
|
5909
6004
|
slack: false,
|
|
5910
6005
|
execute: (ctx) => listNetworks(ctx.fetch)
|
|
@@ -5915,7 +6010,7 @@ var networkVerbCapabilities = [
|
|
|
5915
6010
|
roles: ["user"],
|
|
5916
6011
|
description: "Show a single private network by id.",
|
|
5917
6012
|
mutation: "read",
|
|
5918
|
-
input:
|
|
6013
|
+
input: z28.object({ networkId: z28.string() }),
|
|
5919
6014
|
mcp: { name: "networks_show" },
|
|
5920
6015
|
slack: false,
|
|
5921
6016
|
execute: (ctx, input) => getNetwork(ctx.fetch, input.networkId)
|
|
@@ -5926,11 +6021,11 @@ var networkVerbCapabilities = [
|
|
|
5926
6021
|
roles: ["user"],
|
|
5927
6022
|
description: "Create a private network.",
|
|
5928
6023
|
mutation: "preview-confirm",
|
|
5929
|
-
input:
|
|
5930
|
-
name:
|
|
5931
|
-
cidr:
|
|
5932
|
-
description:
|
|
5933
|
-
confirm:
|
|
6024
|
+
input: z28.object({
|
|
6025
|
+
name: z28.string(),
|
|
6026
|
+
cidr: z28.string().optional(),
|
|
6027
|
+
description: z28.string().optional(),
|
|
6028
|
+
confirm: z28.boolean().optional()
|
|
5934
6029
|
}),
|
|
5935
6030
|
mcp: { name: "networks_create" },
|
|
5936
6031
|
slack: false,
|
|
@@ -5960,7 +6055,7 @@ var networkVerbCapabilities = [
|
|
|
5960
6055
|
roles: ["user"],
|
|
5961
6056
|
description: "Delete a private network.",
|
|
5962
6057
|
mutation: "preview-confirm",
|
|
5963
|
-
input:
|
|
6058
|
+
input: z28.object({ networkId: z28.string(), confirm: z28.boolean().optional() }),
|
|
5964
6059
|
mcp: { name: "networks_delete" },
|
|
5965
6060
|
slack: false,
|
|
5966
6061
|
// The route answers 204, so report which network went.
|
|
@@ -5975,7 +6070,7 @@ var networkVerbCapabilities = [
|
|
|
5975
6070
|
roles: ["user"],
|
|
5976
6071
|
description: "List WireGuard VPN peers registered on a reservation.",
|
|
5977
6072
|
mutation: "read",
|
|
5978
|
-
input:
|
|
6073
|
+
input: z28.object({ reservationId: z28.string() }),
|
|
5979
6074
|
mcp: { name: "vpn_peers_list" },
|
|
5980
6075
|
slack: false,
|
|
5981
6076
|
execute: (ctx) => listNetworkPeerConfigs(ctx.fetch, "shared")
|
|
@@ -5986,11 +6081,11 @@ var networkVerbCapabilities = [
|
|
|
5986
6081
|
roles: ["user"],
|
|
5987
6082
|
description: "Register a WireGuard VPN peer public key on a reservation.",
|
|
5988
6083
|
mutation: "preview-confirm",
|
|
5989
|
-
input:
|
|
5990
|
-
reservationId:
|
|
5991
|
-
publicKey:
|
|
5992
|
-
label:
|
|
5993
|
-
confirm:
|
|
6084
|
+
input: z28.object({
|
|
6085
|
+
reservationId: z28.string(),
|
|
6086
|
+
publicKey: z28.string(),
|
|
6087
|
+
label: z28.string().optional(),
|
|
6088
|
+
confirm: z28.boolean().optional()
|
|
5994
6089
|
}),
|
|
5995
6090
|
mcp: { name: "vpn_peers_create" },
|
|
5996
6091
|
slack: false,
|
|
@@ -6005,10 +6100,10 @@ var networkVerbCapabilities = [
|
|
|
6005
6100
|
roles: ["user"],
|
|
6006
6101
|
description: "Revoke a WireGuard VPN peer from a reservation.",
|
|
6007
6102
|
mutation: "preview-confirm",
|
|
6008
|
-
input:
|
|
6009
|
-
reservationId:
|
|
6010
|
-
peerId:
|
|
6011
|
-
confirm:
|
|
6103
|
+
input: z28.object({
|
|
6104
|
+
reservationId: z28.string(),
|
|
6105
|
+
peerId: z28.string(),
|
|
6106
|
+
confirm: z28.boolean().optional()
|
|
6012
6107
|
}),
|
|
6013
6108
|
mcp: { name: "vpn_peers_delete" },
|
|
6014
6109
|
slack: false,
|
|
@@ -6017,20 +6112,20 @@ var networkVerbCapabilities = [
|
|
|
6017
6112
|
];
|
|
6018
6113
|
|
|
6019
6114
|
// ../../packages/capabilities/dist/capabilities/registry.js
|
|
6020
|
-
import { z as
|
|
6115
|
+
import { z as z29 } from "zod";
|
|
6021
6116
|
var globalInput2 = {
|
|
6022
|
-
$positionals:
|
|
6023
|
-
yes:
|
|
6117
|
+
$positionals: z29.array(z29.string()).default([]),
|
|
6118
|
+
yes: z29.boolean().optional()
|
|
6024
6119
|
};
|
|
6025
|
-
var emptyInput4 =
|
|
6026
|
-
var repositoryInput =
|
|
6120
|
+
var emptyInput4 = z29.object(globalInput2).strict();
|
|
6121
|
+
var repositoryInput = z29.object({
|
|
6027
6122
|
...globalInput2,
|
|
6028
|
-
repository:
|
|
6123
|
+
repository: z29.string().optional().describe("Repository name, with or without your organization's namespace.")
|
|
6029
6124
|
}).strict();
|
|
6030
|
-
var tagInput =
|
|
6125
|
+
var tagInput = z29.object({
|
|
6031
6126
|
...globalInput2,
|
|
6032
|
-
repository:
|
|
6033
|
-
tag:
|
|
6127
|
+
repository: z29.string().optional().describe("Repository name, with or without your organization's namespace."),
|
|
6128
|
+
tag: z29.string().optional().describe("Tag to delete, such as v1.")
|
|
6034
6129
|
}).strict();
|
|
6035
6130
|
function cliInteraction(context) {
|
|
6036
6131
|
return context.cli?.interaction;
|
|
@@ -6337,14 +6432,14 @@ var registryCapabilities = [
|
|
|
6337
6432
|
];
|
|
6338
6433
|
|
|
6339
6434
|
// ../../packages/capabilities/dist/capabilities/reservation-list.js
|
|
6340
|
-
import { z as
|
|
6341
|
-
var reservationListInput =
|
|
6342
|
-
customerId:
|
|
6343
|
-
listingId:
|
|
6344
|
-
listingTermId:
|
|
6345
|
-
status:
|
|
6346
|
-
cursor:
|
|
6347
|
-
limit:
|
|
6435
|
+
import { z as z30 } from "zod";
|
|
6436
|
+
var reservationListInput = z30.object({
|
|
6437
|
+
customerId: z30.string().uuid().optional(),
|
|
6438
|
+
listingId: z30.string().uuid().optional(),
|
|
6439
|
+
listingTermId: z30.string().uuid().optional(),
|
|
6440
|
+
status: z30.enum(["confirmed", "active", "completed", "cancelled"]).optional(),
|
|
6441
|
+
cursor: z30.string().optional(),
|
|
6442
|
+
limit: z30.number().int().min(1).max(100).optional()
|
|
6348
6443
|
});
|
|
6349
6444
|
var reservationListCapability = defineCapability({
|
|
6350
6445
|
id: "reservation.list",
|
|
@@ -6395,20 +6490,20 @@ var reservationListCapability = defineCapability({
|
|
|
6395
6490
|
});
|
|
6396
6491
|
|
|
6397
6492
|
// ../../packages/capabilities/dist/capabilities/volumes.js
|
|
6398
|
-
import { z as
|
|
6399
|
-
var storageCliInput =
|
|
6400
|
-
$positionals:
|
|
6401
|
-
contentType:
|
|
6402
|
-
cursor:
|
|
6403
|
-
idempotencyKey:
|
|
6404
|
-
limit:
|
|
6405
|
-
name:
|
|
6406
|
-
output:
|
|
6407
|
-
overwrite:
|
|
6408
|
-
path:
|
|
6409
|
-
prefix:
|
|
6410
|
-
source:
|
|
6411
|
-
yes:
|
|
6493
|
+
import { z as z31 } from "zod";
|
|
6494
|
+
var storageCliInput = z31.object({
|
|
6495
|
+
$positionals: z31.array(z31.string()).optional(),
|
|
6496
|
+
contentType: z31.string().optional(),
|
|
6497
|
+
cursor: z31.string().optional(),
|
|
6498
|
+
idempotencyKey: z31.string().optional(),
|
|
6499
|
+
limit: z31.union([z31.string(), z31.number()]).optional(),
|
|
6500
|
+
name: z31.string().optional(),
|
|
6501
|
+
output: z31.string().optional(),
|
|
6502
|
+
overwrite: z31.boolean().optional(),
|
|
6503
|
+
path: z31.string().optional(),
|
|
6504
|
+
prefix: z31.string().optional(),
|
|
6505
|
+
source: z31.string().optional(),
|
|
6506
|
+
yes: z31.boolean().optional()
|
|
6412
6507
|
}).strict();
|
|
6413
6508
|
function storageExecutor(context) {
|
|
6414
6509
|
const interaction = context.cli?.interaction;
|
|
@@ -6444,6 +6539,50 @@ function storageCapability({ id, command, description, mutation, outcome, human,
|
|
|
6444
6539
|
execute: async (context, input) => storageExecutor(context)(id, input)
|
|
6445
6540
|
});
|
|
6446
6541
|
}
|
|
6542
|
+
var filesListInput = z31.object({ driveId: z31.string(), prefix: z31.string().optional() });
|
|
6543
|
+
async function* listFiles(context, input) {
|
|
6544
|
+
const prefix = input.prefix ?? "";
|
|
6545
|
+
const folder = prefix.includes("/") ? prefix.slice(0, prefix.lastIndexOf("/")) : "";
|
|
6546
|
+
let cursor = 0;
|
|
6547
|
+
while (cursor !== null) {
|
|
6548
|
+
const page = await listDriveContents(context.fetch, input.driveId, {
|
|
6549
|
+
recursive: true,
|
|
6550
|
+
...folder ? { path: folder } : {},
|
|
6551
|
+
...cursor ? { cursor } : {}
|
|
6552
|
+
});
|
|
6553
|
+
for (const entry of page.entries) {
|
|
6554
|
+
if (entry.kind === "file" && entry.path.startsWith(prefix))
|
|
6555
|
+
yield entry;
|
|
6556
|
+
}
|
|
6557
|
+
cursor = page.next_cursor ?? null;
|
|
6558
|
+
}
|
|
6559
|
+
}
|
|
6560
|
+
var volumeFilesListCapability = defineCapability({
|
|
6561
|
+
id: "storage.volumes.files.list",
|
|
6562
|
+
domain: "storage",
|
|
6563
|
+
roles: ["user"],
|
|
6564
|
+
description: "List files on a storage volume (drive). Optional prefix filters paths. This is a listing only -- it does not download bytes.",
|
|
6565
|
+
mutation: "read",
|
|
6566
|
+
input: filesListInput,
|
|
6567
|
+
mcp: { name: "storage_files_ls" },
|
|
6568
|
+
slack: false,
|
|
6569
|
+
execute: async (context, input) => listFiles(context, input),
|
|
6570
|
+
cli: {
|
|
6571
|
+
command: ["volumes", "files", "list"],
|
|
6572
|
+
input: storageCliInput,
|
|
6573
|
+
execute: (context, input) => storageExecutor(context)("storage.volumes.files.list", input),
|
|
6574
|
+
vnext: {
|
|
6575
|
+
arguments: "semantic",
|
|
6576
|
+
audience: "customer",
|
|
6577
|
+
category: "resource",
|
|
6578
|
+
outcome: "List nested volume files by semantic remote path.",
|
|
6579
|
+
human: "ornn volumes files list <volume> [--prefix <remote-path>] [--limit <1-500>] [--cursor <cursor>]",
|
|
6580
|
+
automation: "ornn volumes files list <volume-id> --limit 50 --format json",
|
|
6581
|
+
acceptedReferences: ["canonical volume ID", "exact unique volume name"],
|
|
6582
|
+
related: ["volumes files upload", "volumes files download"]
|
|
6583
|
+
}
|
|
6584
|
+
}
|
|
6585
|
+
});
|
|
6447
6586
|
var volumeCapabilities = [
|
|
6448
6587
|
storageCapability({
|
|
6449
6588
|
id: "storage.volumes.list",
|
|
@@ -6512,17 +6651,7 @@ var volumeCapabilities = [
|
|
|
6512
6651
|
review: "The volume and all of its data are permanently deleted.",
|
|
6513
6652
|
related: ["volume-mounts detach", "volumes show"]
|
|
6514
6653
|
}),
|
|
6515
|
-
|
|
6516
|
-
id: "storage.volumes.files.list",
|
|
6517
|
-
command: ["volumes", "files", "list"],
|
|
6518
|
-
description: "List nested files in one volume in a bounded page.",
|
|
6519
|
-
mutation: "read",
|
|
6520
|
-
outcome: "List nested volume files by semantic remote path.",
|
|
6521
|
-
human: "ornn volumes files list <volume> [--prefix <remote-path>] [--limit <1-500>] [--cursor <cursor>]",
|
|
6522
|
-
automation: "ornn volumes files list <volume-id> --limit 50 --format json",
|
|
6523
|
-
acceptedReferences: ["canonical volume ID", "exact unique volume name"],
|
|
6524
|
-
related: ["volumes files upload", "volumes files download"]
|
|
6525
|
-
}),
|
|
6654
|
+
volumeFilesListCapability,
|
|
6526
6655
|
storageCapability({
|
|
6527
6656
|
id: "storage.volumes.files.upload",
|
|
6528
6657
|
command: ["volumes", "files", "upload"],
|
|
@@ -6570,22 +6699,22 @@ var volumeCapabilities = [
|
|
|
6570
6699
|
related: ["volumes files list"]
|
|
6571
6700
|
})
|
|
6572
6701
|
];
|
|
6573
|
-
var reservationInput =
|
|
6574
|
-
var reservationWrite = reservationInput.extend({ confirm:
|
|
6575
|
-
var driveInput =
|
|
6576
|
-
var driveWrite = driveInput.extend({ confirm:
|
|
6577
|
-
var bucketConnectInput =
|
|
6578
|
-
provider:
|
|
6579
|
-
bucket:
|
|
6580
|
-
name:
|
|
6581
|
-
prefix:
|
|
6582
|
-
region:
|
|
6583
|
-
endpointUrl:
|
|
6584
|
-
accountId:
|
|
6585
|
-
accessKeyId:
|
|
6586
|
-
secretAccessKey:
|
|
6587
|
-
readOnly:
|
|
6588
|
-
confirm:
|
|
6702
|
+
var reservationInput = z31.object({ reservationId: z31.string() });
|
|
6703
|
+
var reservationWrite = reservationInput.extend({ confirm: z31.boolean().optional() });
|
|
6704
|
+
var driveInput = z31.object({ driveId: z31.string() });
|
|
6705
|
+
var driveWrite = driveInput.extend({ confirm: z31.boolean().optional() });
|
|
6706
|
+
var bucketConnectInput = z31.object({
|
|
6707
|
+
provider: z31.enum(["gcs", "s3", "r2"]),
|
|
6708
|
+
bucket: z31.string(),
|
|
6709
|
+
name: z31.string().optional(),
|
|
6710
|
+
prefix: z31.string().optional(),
|
|
6711
|
+
region: z31.string().optional(),
|
|
6712
|
+
endpointUrl: z31.string().optional(),
|
|
6713
|
+
accountId: z31.string().optional(),
|
|
6714
|
+
accessKeyId: z31.string().optional(),
|
|
6715
|
+
secretAccessKey: z31.string().optional(),
|
|
6716
|
+
readOnly: z31.boolean().optional(),
|
|
6717
|
+
confirm: z31.boolean().optional()
|
|
6589
6718
|
}).refine((input) => !(input.provider === "gcs" && (input.accessKeyId || input.secretAccessKey)), {
|
|
6590
6719
|
message: "Access key credentials are only supported for S3-compatible buckets."
|
|
6591
6720
|
}).refine((input) => Boolean(input.accessKeyId) === Boolean(input.secretAccessKey), {
|
|
@@ -6600,7 +6729,7 @@ var storageVerbCapabilities = [
|
|
|
6600
6729
|
roles: ["user"],
|
|
6601
6730
|
description: "Attach an existing storage volume (drive) to a reservation -- the inverse of storage_undeploy. Always mounts at the platform path /home/tenant/volume (fuse). There is no customer mount-path override.",
|
|
6602
6731
|
mutation: "preview-confirm",
|
|
6603
|
-
input: reservationWrite.extend({ driveId:
|
|
6732
|
+
input: reservationWrite.extend({ driveId: z31.string(), readOnly: z31.boolean().optional() }),
|
|
6604
6733
|
slack: false,
|
|
6605
6734
|
execute: (ctx, input) => deployReservationStorage(ctx.fetch, input.reservationId, {
|
|
6606
6735
|
drive_id: input.driveId,
|
|
@@ -6633,7 +6762,7 @@ var storageVerbCapabilities = [
|
|
|
6633
6762
|
roles: ["user"],
|
|
6634
6763
|
description: "List reservations that can receive a storage deploy, grouped the same way as the console picker.",
|
|
6635
6764
|
mutation: "read",
|
|
6636
|
-
input:
|
|
6765
|
+
input: z31.object({}),
|
|
6637
6766
|
slack: false,
|
|
6638
6767
|
execute: (ctx) => listStorageTargets(ctx.fetch)
|
|
6639
6768
|
}),
|
|
@@ -6643,9 +6772,9 @@ var storageVerbCapabilities = [
|
|
|
6643
6772
|
roles: ["user"],
|
|
6644
6773
|
description: "List a page of storage volumes, newest updated first. Pass next_cursor as cursor to continue.",
|
|
6645
6774
|
mutation: "read",
|
|
6646
|
-
input:
|
|
6647
|
-
limit:
|
|
6648
|
-
cursor:
|
|
6775
|
+
input: z31.object({
|
|
6776
|
+
limit: z31.number().int().min(1).max(100).optional(),
|
|
6777
|
+
cursor: z31.string().optional()
|
|
6649
6778
|
}),
|
|
6650
6779
|
mcp: { name: "storage_volumes_list" },
|
|
6651
6780
|
slack: false,
|
|
@@ -6671,10 +6800,10 @@ var storageVerbCapabilities = [
|
|
|
6671
6800
|
roles: ["user"],
|
|
6672
6801
|
description: "Create a storage volume (drive), optionally cloned from an existing source drive.",
|
|
6673
6802
|
mutation: "preview-confirm",
|
|
6674
|
-
input:
|
|
6675
|
-
name:
|
|
6676
|
-
sourceDriveId:
|
|
6677
|
-
confirm:
|
|
6803
|
+
input: z31.object({
|
|
6804
|
+
name: z31.string(),
|
|
6805
|
+
sourceDriveId: z31.string().optional(),
|
|
6806
|
+
confirm: z31.boolean().optional()
|
|
6678
6807
|
}),
|
|
6679
6808
|
mcp: { name: "storage_volumes_create" },
|
|
6680
6809
|
slack: false,
|
|
@@ -6767,7 +6896,7 @@ var storageVerbCapabilities = [
|
|
|
6767
6896
|
roles: ["user"],
|
|
6768
6897
|
description: "Update a connected S3-compatible bucket's access key credentials.",
|
|
6769
6898
|
mutation: "preview-confirm",
|
|
6770
|
-
input: driveWrite.extend({ accessKeyId:
|
|
6899
|
+
input: driveWrite.extend({ accessKeyId: z31.string(), secretAccessKey: z31.string() }),
|
|
6771
6900
|
mcp: { name: "storage_buckets_update_credentials" },
|
|
6772
6901
|
slack: false,
|
|
6773
6902
|
execute: (ctx, input) => updateDrive(ctx.fetch, input.driveId, {
|
|
@@ -6778,46 +6907,6 @@ var storageVerbCapabilities = [
|
|
|
6778
6907
|
})
|
|
6779
6908
|
})
|
|
6780
6909
|
];
|
|
6781
|
-
var bucketListCapability = defineCapability({
|
|
6782
|
-
id: "bucket.list",
|
|
6783
|
-
domain: "storage",
|
|
6784
|
-
roles: ["user"],
|
|
6785
|
-
description: "List a page of connected external buckets. Pass next_cursor as cursor to continue.",
|
|
6786
|
-
mutation: "read",
|
|
6787
|
-
input: z30.object({
|
|
6788
|
-
limit: z30.number().int().min(1).max(100).optional(),
|
|
6789
|
-
cursor: z30.string().optional()
|
|
6790
|
-
}),
|
|
6791
|
-
mcp: { name: "storage_buckets_list" },
|
|
6792
|
-
slack: false,
|
|
6793
|
-
execute: (ctx, input) => listDrives(ctx.fetch, {
|
|
6794
|
-
limit: input.limit ?? 25,
|
|
6795
|
-
scope: "external",
|
|
6796
|
-
...input.cursor ? { cursor: input.cursor } : {}
|
|
6797
|
-
})
|
|
6798
|
-
});
|
|
6799
|
-
var storageCompositionCapabilities = [
|
|
6800
|
-
bucketListCapability,
|
|
6801
|
-
defineCapability({
|
|
6802
|
-
id: "volume.contents",
|
|
6803
|
-
domain: "storage",
|
|
6804
|
-
roles: ["user"],
|
|
6805
|
-
description: "List one page of a storage volume's contents.",
|
|
6806
|
-
mutation: "read",
|
|
6807
|
-
input: z30.object({
|
|
6808
|
-
driveId: z30.string(),
|
|
6809
|
-
path: z30.string().optional(),
|
|
6810
|
-
cursor: z30.union([z30.string(), z30.number()]).optional()
|
|
6811
|
-
}),
|
|
6812
|
-
mcp: false,
|
|
6813
|
-
slack: false,
|
|
6814
|
-
execute: (ctx, input) => listDriveContents(ctx.fetch, input.driveId, {
|
|
6815
|
-
recursive: true,
|
|
6816
|
-
...input.path ? { path: input.path } : {},
|
|
6817
|
-
...input.cursor ? { cursor: input.cursor } : {}
|
|
6818
|
-
})
|
|
6819
|
-
})
|
|
6820
|
-
];
|
|
6821
6910
|
|
|
6822
6911
|
// ../../packages/capabilities/dist/cli-catalog.js
|
|
6823
6912
|
function canonicalCliCatalog(capabilities) {
|
|
@@ -6830,6 +6919,7 @@ function canonicalCliCatalog(capabilities) {
|
|
|
6830
6919
|
return {
|
|
6831
6920
|
...capability,
|
|
6832
6921
|
cli: {
|
|
6922
|
+
...capability.cli,
|
|
6833
6923
|
command: [...help3.command ?? capability.cli?.command ?? []],
|
|
6834
6924
|
vnext: help3
|
|
6835
6925
|
}
|
|
@@ -6859,9 +6949,8 @@ var catalog = [
|
|
|
6859
6949
|
...networkVerbCapabilities,
|
|
6860
6950
|
...accessVerbCapabilities,
|
|
6861
6951
|
...storageVerbCapabilities,
|
|
6862
|
-
...storageCompositionCapabilities,
|
|
6863
6952
|
machinePushKeysCapability,
|
|
6864
|
-
...
|
|
6953
|
+
...metricsCapabilities,
|
|
6865
6954
|
...billingCapabilities,
|
|
6866
6955
|
...registryCapabilities,
|
|
6867
6956
|
...adminNodeLifecycleCapabilities
|
|
@@ -7137,11 +7226,17 @@ export {
|
|
|
7137
7226
|
ADMIN_CLI_ROOTS,
|
|
7138
7227
|
CLI_MIGRATION_GUIDE_URL,
|
|
7139
7228
|
LEGACY_CLI_MIGRATIONS,
|
|
7229
|
+
bucketDisconnectCapability,
|
|
7230
|
+
bucketListCapability,
|
|
7231
|
+
bucketShowCapability,
|
|
7140
7232
|
byCliCommand,
|
|
7141
7233
|
byMcpName,
|
|
7142
7234
|
catalog,
|
|
7143
7235
|
findLegacyCliMigration,
|
|
7144
7236
|
forRole,
|
|
7145
7237
|
gpuDisplay,
|
|
7146
|
-
|
|
7238
|
+
metricsHistoryCapability,
|
|
7239
|
+
metricsSnapshotCapability,
|
|
7240
|
+
parseHardwareCatalog,
|
|
7241
|
+
volumeFilesListCapability
|
|
7147
7242
|
};
|