@ornncompute/cli 1.0.146 → 1.0.147

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ornncompute/cli",
3
- "version": "1.0.146",
3
+ "version": "1.0.147",
4
4
  "description": "Command-line interface for Ornn compute access workflows.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -955,9 +955,9 @@ async function executeCapability(
955
955
  stderr: io.stderr ?? process.stderr,
956
956
  });
957
957
  },
958
- mounts(command, mountInput) {
958
+ mounts(command, mountInput, context) {
959
959
  return executeMountCommand(command, mountInput, {
960
- fetch: (path, init) => customerCapabilityFetch(io, path, init, authSnapshot),
960
+ fetch: context.fetch,
961
961
  interaction: this,
962
962
  });
963
963
  },
@@ -1,7 +1,12 @@
1
- import * as storageApi from "../vendor/api-client/orchestrator.js";
2
- import * as gatewayApi from "../vendor/api-client/gateway.js";
3
- import { bucketShowCapability, bucketDisconnectCapability } from "../vendor/capabilities/cli.js";
4
- import { createHash } from "node:crypto";
1
+ import {
2
+ bucketConnectCapability,
3
+ bucketDisconnectCapability,
4
+ bucketShowCapability,
5
+ bucketUpdateCredentialsCapability,
6
+ bucketVerifyCapability,
7
+ volumeMountShowCapability,
8
+ volumeMountAttachCapability,
9
+ } from "../vendor/capabilities/cli.js";
5
10
  import { readFile } from "node:fs/promises";
6
11
 
7
12
  import { CliApiError } from "./api-client.mjs";
@@ -406,10 +411,6 @@ async function connectionIntent(input) {
406
411
  };
407
412
  }
408
413
 
409
- function credentialFingerprint(accessKeyId, secret) {
410
- return createHash("sha256").update(accessKeyId).update("\0").update(secret).digest("hex");
411
- }
412
-
413
414
  function keyHintMatches(source, accessKeyId) {
414
415
  if (!accessKeyId) return source.credentials_configured !== true;
415
416
  const hint = safeOptionalText(source.access_key_id_hint);
@@ -491,11 +492,6 @@ async function showBucket(input, runtime) {
491
492
  async function connectBucket(input, runtime) {
492
493
  const intent = await connectionIntent(input);
493
494
  requireMutationPreflight(input, runtime);
494
- const fingerprint =
495
- intent.accessKeyId && intent.secretAccessKey
496
- ? credentialFingerprint(intent.accessKeyId, intent.secretAccessKey)
497
- : null;
498
-
499
495
  const rows = await fetchDrives(runtime);
500
496
  const sameName = bucketRows(rows).filter(
501
497
  (drive) => normalizedNameKey(drive?.name) === normalizedNameKey(intent.name)
@@ -543,23 +539,20 @@ async function connectBucket(input, runtime) {
543
539
 
544
540
  let created;
545
541
  try {
546
- created = await storageApi.createDrive(
547
- runtime.fetch,
542
+ created = await bucketConnectCapability.execute(
543
+ { actor: "", role: "user", fetch: runtime.fetch },
548
544
  {
549
545
  name: intent.name,
550
- provider: "ornn_volume",
551
- source_provider: intent.kind === "gcs" ? "external_gcs" : "s3",
552
- external_bucket: intent.bucket,
553
- external_prefix: intent.prefix,
554
- external_region: intent.region,
555
- external_read_only: intent.readOnly,
556
- ...(intent.kind === "s3" ? { external_s3_provider: "aws_s3" } : {}),
557
- ...(intent.kind === "r2" ? { external_s3_provider: "cloudflare_r2" } : {}),
558
- ...(intent.endpoint ? { external_endpoint_url: intent.endpoint } : {}),
559
- ...(intent.accessKeyId ? { external_access_key_id: intent.accessKeyId } : {}),
560
- ...(intent.secretAccessKey ? { external_secret_access_key: intent.secretAccessKey } : {}),
561
- },
562
- { headers: idempotencyHeaders(input) }
546
+ provider: intent.kind,
547
+ bucket: intent.bucket,
548
+ prefix: intent.prefix ?? undefined,
549
+ region: intent.region ?? undefined,
550
+ readOnly: intent.readOnly,
551
+ endpointUrl: intent.endpoint ?? undefined,
552
+ accessKeyId: intent.accessKeyId ?? undefined,
553
+ secretAccessKey: intent.secretAccessKey ?? undefined,
554
+ idempotencyKey: String(input.idempotencyKey ?? "").trim() || undefined,
555
+ }
563
556
  );
564
557
  } catch (error) {
565
558
  throw safeExternalError(error, "The external bucket could not be connected safely.");
@@ -592,11 +585,9 @@ async function verifyBucket(input, runtime) {
592
585
  const id = safeIdentifier(source.id);
593
586
  let verified;
594
587
  try {
595
- verified = await storageApi.updateDrive(
596
- runtime.fetch,
597
- id,
598
- { verify_source: true },
599
- { headers: idempotencyHeaders(input) }
588
+ verified = await bucketVerifyCapability.execute(
589
+ { actor: "", role: "user", fetch: runtime.fetch },
590
+ { driveId: id, idempotencyKey: String(input.idempotencyKey ?? "").trim() || undefined }
600
591
  );
601
592
  } catch (error) {
602
593
  throw safeExternalError(error, "External bucket verification could not be completed safely.");
@@ -638,7 +629,6 @@ async function updateCredentials(input, runtime) {
638
629
  const accessKeyId = requiredText(input.accessKeyId, "--access-key-id", "access-key-id");
639
630
  const secret = await readCredentialFile(input.secretAccessKeyFile);
640
631
  requireMutationPreflight(input, runtime);
641
- const fingerprint = credentialFingerprint(accessKeyId, secret);
642
632
  const source = resolveExternalBucket(await fetchDrives(runtime), reference);
643
633
  const kind = externalKind(source);
644
634
  if (kind === "gcs") {
@@ -650,16 +640,14 @@ async function updateCredentials(input, runtime) {
650
640
  const id = safeIdentifier(source.id);
651
641
  let updated;
652
642
  try {
653
- updated = await storageApi.updateDrive(
654
- runtime.fetch,
655
- id,
643
+ updated = await bucketUpdateCredentialsCapability.execute(
644
+ { actor: "", role: "user", fetch: runtime.fetch },
656
645
  {
657
- source_credentials: {
658
- external_access_key_id: accessKeyId,
659
- external_secret_access_key: secret,
660
- },
661
- },
662
- { headers: idempotencyHeaders(input) }
646
+ driveId: id,
647
+ accessKeyId,
648
+ secretAccessKey: secret,
649
+ idempotencyKey: String(input.idempotencyKey ?? "").trim() || undefined,
650
+ }
663
651
  );
664
652
  } catch (error) {
665
653
  throw safeExternalError(error, "External bucket credentials could not be updated safely.");
@@ -762,10 +750,13 @@ function attachmentFrom(payload) {
762
750
 
763
751
  async function fetchImportAttachment(runtime, reservationId, { signal } = {}) {
764
752
  try {
765
- const payload = await gatewayApi.getReservationStorageAttachment(
766
- runtime.fetch,
767
- reservationId,
768
- signal
753
+ const payload = await volumeMountShowCapability.execute(
754
+ {
755
+ actor: "",
756
+ role: "user",
757
+ fetch: (path, init) => runtime.fetch(path, { ...init, ...(signal ? { signal } : {}) }),
758
+ },
759
+ { reservationId }
769
760
  );
770
761
  return attachmentFrom(payload);
771
762
  } catch (error) {
@@ -1211,16 +1202,20 @@ async function importBucket(input, runtime) {
1211
1202
  const replayed = attachment !== null;
1212
1203
  if (!attachment) {
1213
1204
  try {
1214
- const payload = await gatewayApi.deployReservationStorage(
1215
- runtime.fetch,
1216
- reservationId,
1205
+ const payload = await volumeMountAttachCapability.execute(
1217
1206
  {
1218
- drive_id: bucket.id,
1219
- mount_path: "/home/tenant/volume",
1220
- mount_mode: "fuse",
1221
- access_mode: "read-write",
1207
+ actor: "",
1208
+ role: "user",
1209
+ fetch: (path, init) => runtime.fetch(path, { ...init, signal: runtime.signal }),
1222
1210
  },
1223
- { headers: idempotencyHeaders(input), signal: runtime.signal }
1211
+ {
1212
+ reservationId,
1213
+ driveId: bucket.id,
1214
+ mountPath: "/home/tenant/volume",
1215
+ mountMode: "fuse",
1216
+ readOnly: false,
1217
+ idempotencyKey: String(input.idempotencyKey ?? "").trim() || undefined,
1218
+ }
1224
1219
  );
1225
1220
  attachment = attachmentFrom(payload);
1226
1221
  if (!attachment || String(attachment.drive_id ?? "") !== bucket.id) {
@@ -1,5 +1,9 @@
1
- import * as storageApi from "../vendor/api-client/orchestrator.js";
2
- import * as gatewayApi from "../vendor/api-client/gateway.js";
1
+ import {
2
+ volumeMountCandidatesCapability,
3
+ volumeMountShowCapability,
4
+ volumeMountAttachCapability,
5
+ volumeMountDetachCapability,
6
+ } from "../vendor/capabilities/cli.js";
3
7
  import { CliApiError } from "./api-client.mjs";
4
8
  import { isRecoverableWaitFailure } from "./interaction-runtime.mjs";
5
9
  import { resolveVolume, safeVolume } from "./storage-commands.mjs";
@@ -87,11 +91,6 @@ function requireMachineMutation(input, interaction) {
87
91
  }
88
92
  }
89
93
 
90
- function idempotencyHeaders(input) {
91
- const key = text(input.idempotencyKey);
92
- return key ? { "Idempotency-Key": key } : undefined;
93
- }
94
-
95
94
  function ownerCode(error) {
96
95
  const top = record(error?.detail);
97
96
  const detail = record(top.detail ?? top.error ?? top);
@@ -315,7 +314,16 @@ async function reservationMachineCount(runtime, reservationId, signal) {
315
314
  if (cache.has(reservationId)) return cache.get(reservationId);
316
315
  let count = 0;
317
316
  try {
318
- const rows = candidateRows(await storageApi.listStorageTargets(runtime.fetch, signal));
317
+ const rows = candidateRows(
318
+ await volumeMountCandidatesCapability.execute(
319
+ {
320
+ actor: "",
321
+ role: "user",
322
+ fetch: (path, init) => runtime.fetch(path, { ...init, ...(signal ? { signal } : {}) }),
323
+ },
324
+ {}
325
+ )
326
+ );
319
327
  const row = rows.find(
320
328
  (candidate) =>
321
329
  candidate.id === reservationId || candidate.reservation_ids.includes(reservationId)
@@ -340,10 +348,13 @@ async function withMachineCount(runtime, mount, reservationId, signal) {
340
348
 
341
349
  async function fetchMount(runtime, reservationId, { preserveFailure = false, signal } = {}) {
342
350
  try {
343
- const payload = await gatewayApi.getReservationStorageAttachment(
344
- runtime.fetch,
345
- reservationId,
346
- signal
351
+ const payload = await volumeMountShowCapability.execute(
352
+ {
353
+ actor: "",
354
+ role: "user",
355
+ fetch: (path, init) => runtime.fetch(path, { ...init, ...(signal ? { signal } : {}) }),
356
+ },
357
+ { reservationId }
347
358
  );
348
359
  return withMachineCount(
349
360
  runtime,
@@ -556,7 +567,12 @@ async function candidates(input, runtime) {
556
567
  "ornn volume-mounts candidates [--limit <1-500>] [--cursor <cursor>]",
557
568
  runtime.interaction
558
569
  );
559
- const rows = candidateRows(await storageApi.listStorageTargets(runtime.fetch));
570
+ const rows = candidateRows(
571
+ await volumeMountCandidatesCapability.execute(
572
+ { actor: "", role: "user", fetch: runtime.fetch },
573
+ {}
574
+ )
575
+ );
560
576
  const offset = cursorOffset(input.cursor, runtime.interaction);
561
577
  const limit = pageLimit(input.limit, runtime.interaction);
562
578
  if (offset > rows.length) {
@@ -663,11 +679,15 @@ export async function attachVolumeMount(input, runtime) {
663
679
  }
664
680
 
665
681
  try {
666
- const payload = await gatewayApi.deployReservationStorage(
667
- runtime.fetch,
668
- reservationId,
669
- { drive_id: projectedVolume.id, mount_mode: "fuse", access_mode: access },
670
- { headers: idempotencyHeaders(input) }
682
+ const payload = await volumeMountAttachCapability.execute(
683
+ { actor: "", role: "user", fetch: runtime.fetch },
684
+ {
685
+ reservationId,
686
+ driveId: projectedVolume.id,
687
+ mountMode: "fuse",
688
+ readOnly: access === "read-only",
689
+ idempotencyKey: text(input.idempotencyKey) ?? undefined,
690
+ }
671
691
  );
672
692
  current = await withMachineCount(
673
693
  runtime,
@@ -768,11 +788,9 @@ export async function detachVolumeMount(input, runtime) {
768
788
  }
769
789
  current = refreshed;
770
790
  try {
771
- await gatewayApi.detachReservationStorage(
772
- runtime.fetch,
773
- reservationId,
774
- {},
775
- { headers: idempotencyHeaders(input) }
791
+ await volumeMountDetachCapability.execute(
792
+ { actor: "", role: "user", fetch: runtime.fetch },
793
+ { reservationId, idempotencyKey: text(input.idempotencyKey) ?? undefined }
776
794
  );
777
795
  } catch (error) {
778
796
  if (error instanceof CliApiError && (error.status === undefined || error.status >= 500)) {
@@ -6,6 +6,7 @@ import {
6
6
  sshKeyAssignmentAssignCapability,
7
7
  sshKeyAssignmentStatusCapability,
8
8
  sshKeyDeliveryStatus,
9
+ volumeMountShowCapability,
9
10
  } from "../vendor/capabilities/cli.js";
10
11
  import * as orchestrator from "../vendor/api-client/orchestrator.js";
11
12
  import * as gatewayApi from "../vendor/api-client/gateway.js";
@@ -1506,9 +1507,7 @@ async function bareMetalRelationships(context, reservationId) {
1506
1507
  };
1507
1508
  const [network, storage] = await Promise.all([
1508
1509
  orchestrator.getNetwork(context.fetch, "shared"),
1509
- gatewayApi
1510
- .getReservationStorageAttachment(context.fetch, reservationId)
1511
- .catch(missingAttachment),
1510
+ volumeMountShowCapability.execute(context, { reservationId }).catch(missingAttachment),
1512
1511
  ]);
1513
1512
  return {
1514
1513
  network: projectOrganizationNetwork(network),
@@ -4628,34 +4628,6 @@ function externalBucketExecutor(context) {
4628
4628
  }
4629
4629
  return interaction.externalBuckets.bind(interaction);
4630
4630
  }
4631
- function externalBucketCapability({ acceptedReferences = [], automation, command, description, human, id, input, mutation, outcome, related = [], resumableStates = [], review }) {
4632
- return defineCapability({
4633
- id,
4634
- domain: "storage",
4635
- roles: ["user"],
4636
- description,
4637
- mutation,
4638
- input,
4639
- cli: {
4640
- command,
4641
- vnext: {
4642
- arguments: "semantic",
4643
- audience: "customer",
4644
- category: "resource",
4645
- outcome,
4646
- human,
4647
- automation,
4648
- acceptedReferences,
4649
- related,
4650
- resumableStates,
4651
- ...review ? { review } : {}
4652
- }
4653
- },
4654
- mcp: false,
4655
- slack: false,
4656
- execute: async (context, commandInput) => externalBucketExecutor(context)(id, commandInput)
4657
- });
4658
- }
4659
4631
  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";
4660
4632
  function isExternalBucket(drive) {
4661
4633
  const source = drive.source;
@@ -4767,60 +4739,166 @@ var bucketDisconnectCapability = defineCapability({
4767
4739
  }
4768
4740
  }
4769
4741
  });
4770
- var externalBucketCapabilities = [
4771
- bucketListCapability,
4772
- bucketShowCapability,
4773
- externalBucketCapability({
4774
- id: "storage.external-buckets.connect",
4742
+ var bucketConnectInput = z22.object({
4743
+ provider: z22.enum(["gcs", "s3", "r2"]),
4744
+ bucket: z22.string(),
4745
+ name: z22.string().optional(),
4746
+ prefix: z22.string().optional(),
4747
+ region: z22.string().optional(),
4748
+ endpointUrl: z22.string().optional(),
4749
+ accountId: z22.string().optional(),
4750
+ accessKeyId: z22.string().optional(),
4751
+ secretAccessKey: z22.string().optional(),
4752
+ readOnly: z22.boolean().optional(),
4753
+ confirm: z22.boolean().optional()
4754
+ }).refine((input) => !(input.provider === "gcs" && (input.accessKeyId || input.secretAccessKey)), {
4755
+ message: "Access key credentials are only supported for S3-compatible buckets."
4756
+ }).refine((input) => Boolean(input.accessKeyId) === Boolean(input.secretAccessKey), {
4757
+ message: "Provide both accessKeyId and secretAccessKey, or neither."
4758
+ }).refine((input) => input.provider !== "r2" || Boolean(input.endpointUrl || input.accountId), {
4759
+ message: "R2 buckets require either --endpointUrl or --accountId."
4760
+ });
4761
+ var bucketWriteInput = bucketInput.extend({ confirm: z22.boolean().optional() });
4762
+ var bucketCredentialInput = bucketWriteInput.extend({
4763
+ accessKeyId: z22.string(),
4764
+ secretAccessKey: z22.string()
4765
+ });
4766
+ var bucketConnectCapability = defineCapability({
4767
+ id: "storage.external-buckets.connect",
4768
+ domain: "storage",
4769
+ roles: ["user"],
4770
+ description: "Connect an external bucket (GCS, S3, or Cloudflare R2) as a storage volume. Cloudflare R2 deployment support is coming soon (connect succeeds, but deployment is not yet available).",
4771
+ mutation: "preview-confirm",
4772
+ input: bucketConnectInput.safeExtend({ idempotencyKey: z22.string().optional() }),
4773
+ mcp: { name: "storage_buckets_connect", input: bucketConnectInput },
4774
+ slack: false,
4775
+ execute: (context, input) => {
4776
+ const endpoint = input.endpointUrl ?? (input.provider === "r2" && input.accountId ? `https://${input.accountId}.r2.cloudflarestorage.com` : void 0);
4777
+ return createDrive(context.fetch, {
4778
+ name: input.name ?? input.bucket,
4779
+ provider: "ornn_volume",
4780
+ source_provider: input.provider === "gcs" ? "external_gcs" : "s3",
4781
+ external_bucket: input.bucket,
4782
+ external_prefix: input.prefix ?? null,
4783
+ external_region: input.region ?? (input.provider === "r2" ? "auto" : null),
4784
+ external_read_only: input.readOnly !== false,
4785
+ ...input.provider === "r2" ? { external_s3_provider: "cloudflare_r2" } : {},
4786
+ ...input.provider === "s3" ? { external_s3_provider: "aws_s3" } : {},
4787
+ ...endpoint ? { external_endpoint_url: endpoint } : {},
4788
+ ...input.accessKeyId ? { external_access_key_id: input.accessKeyId } : {},
4789
+ ...input.secretAccessKey ? { external_secret_access_key: input.secretAccessKey } : {}
4790
+ }, input.idempotencyKey ? { headers: { "Idempotency-Key": input.idempotencyKey } } : void 0);
4791
+ },
4792
+ cli: {
4775
4793
  command: ["external-buckets", "connect"],
4776
- description: "Connect a typed GCS, AWS S3, or Cloudflare R2 source without verifying it implicitly.",
4777
- mutation: "preview-confirm",
4778
4794
  input: connectInput,
4779
- outcome: "Create or rediscover one external bucket connection with verification kept separate.",
4780
- human: "ornn external-buckets connect <gcs|s3|r2> --bucket <bucket> [--name <name>] [--prefix <prefix>] [--region <region>] [--account-id <id>|--endpoint-url <url>] [--access-key-id <id> --secret-access-key-file <path>] [--read-only|--read-write]",
4781
- automation: "ornn external-buckets connect <gcs|s3|r2> --bucket <bucket> <provider-inputs> --idempotency-key <key> --format json",
4782
- review: `Review the exact source, access mode, and credential presence before connecting it. ${gcsImportGuidance}`,
4783
- related: ["external-buckets verify", "external-buckets import"]
4784
- }),
4785
- externalBucketCapability({
4786
- id: "storage.external-buckets.update-credentials",
4795
+ execute: (context, input) => externalBucketExecutor(context)("storage.external-buckets.connect", input),
4796
+ vnext: {
4797
+ arguments: "semantic",
4798
+ audience: "customer",
4799
+ category: "resource",
4800
+ outcome: "Create or rediscover one external bucket connection with verification kept separate.",
4801
+ human: "ornn external-buckets connect <gcs|s3|r2> --bucket <bucket> [--name <name>] [--prefix <prefix>] [--region <region>] [--account-id <id>|--endpoint-url <url>] [--access-key-id <id> --secret-access-key-file <path>] [--read-only|--read-write]",
4802
+ automation: "ornn external-buckets connect <gcs|s3|r2> --bucket <bucket> <provider-inputs> --idempotency-key <key> --format json",
4803
+ review: `Review the exact source, access mode, and credential presence before connecting it. ${gcsImportGuidance}`,
4804
+ related: ["external-buckets verify", "external-buckets import"],
4805
+ acceptedReferences: [],
4806
+ resumableStates: []
4807
+ }
4808
+ }
4809
+ });
4810
+ var bucketUpdateCredentialsCapability = defineCapability({
4811
+ id: "storage.external-buckets.update-credentials",
4812
+ domain: "storage",
4813
+ roles: ["user"],
4814
+ description: "Update a connected S3-compatible bucket's access key credentials.",
4815
+ mutation: "preview-confirm",
4816
+ input: bucketCredentialInput.extend({ idempotencyKey: z22.string().optional() }),
4817
+ mcp: { name: "storage_buckets_update_credentials", input: bucketCredentialInput },
4818
+ slack: false,
4819
+ execute: (context, input) => updateDrive(context.fetch, input.driveId, {
4820
+ source_credentials: {
4821
+ external_access_key_id: input.accessKeyId,
4822
+ external_secret_access_key: input.secretAccessKey
4823
+ }
4824
+ }, input.idempotencyKey ? { headers: { "Idempotency-Key": input.idempotencyKey } } : void 0),
4825
+ cli: {
4787
4826
  command: ["external-buckets", "update-credentials"],
4788
- description: "Replace scoped S3 or R2 credentials without returning credential bytes.",
4789
- mutation: "preview-confirm",
4790
4827
  input: credentialInput,
4791
- outcome: "Update one connection's credentials and require a separate verification.",
4792
- human: "ornn external-buckets update-credentials <external-bucket> --access-key-id <id> --secret-access-key-file <path>",
4793
- automation: "ornn external-buckets update-credentials <external-bucket-id> --access-key-id <id> --secret-access-key-file <path> --idempotency-key <key> --format json",
4794
- acceptedReferences: ["canonical external bucket ID", "exact unique external bucket name"],
4795
- review: "Credential changes invalidate the prior verification and require renewed review.",
4796
- related: ["external-buckets verify"]
4797
- }),
4798
- externalBucketCapability({
4799
- id: "storage.external-buckets.verify",
4828
+ execute: (context, input) => externalBucketExecutor(context)("storage.external-buckets.update-credentials", input),
4829
+ vnext: {
4830
+ arguments: "semantic",
4831
+ audience: "customer",
4832
+ category: "resource",
4833
+ outcome: "Update one connection's credentials and require a separate verification.",
4834
+ human: "ornn external-buckets update-credentials <external-bucket> --access-key-id <id> --secret-access-key-file <path>",
4835
+ automation: "ornn external-buckets update-credentials <external-bucket-id> --access-key-id <id> --secret-access-key-file <path> --idempotency-key <key> --format json",
4836
+ acceptedReferences: ["canonical external bucket ID", "exact unique external bucket name"],
4837
+ review: "Credential changes invalidate the prior verification and require renewed review.",
4838
+ related: ["external-buckets verify"],
4839
+ resumableStates: []
4840
+ }
4841
+ }
4842
+ });
4843
+ var bucketVerifyCapability = defineCapability({
4844
+ id: "storage.external-buckets.verify",
4845
+ domain: "storage",
4846
+ roles: ["user"],
4847
+ description: "Verify a connected S3-compatible bucket's source credentials/connectivity.",
4848
+ mutation: "preview-confirm",
4849
+ input: bucketWriteInput.extend({ idempotencyKey: z22.string().optional() }),
4850
+ mcp: { name: "storage_buckets_verify", input: bucketWriteInput },
4851
+ slack: false,
4852
+ execute: (context, input) => updateDrive(context.fetch, input.driveId, { verify_source: true }, input.idempotencyKey ? { headers: { "Idempotency-Key": input.idempotencyKey } } : void 0),
4853
+ cli: {
4800
4854
  command: ["external-buckets", "verify"],
4801
- description: "Verify current S3 or R2 source access as a separate operation.",
4802
- mutation: "preview-confirm",
4803
4855
  input: verificationInput,
4804
- outcome: "Record current source-access verification without exposing credential material.",
4805
- human: "ornn external-buckets verify <external-bucket>",
4806
- automation: "ornn external-buckets verify <external-bucket-id> --idempotency-key <key> --format json",
4807
- acceptedReferences: ["canonical external bucket ID", "exact unique external bucket name"],
4808
- review: gcsImportGuidance,
4809
- related: ["external-buckets import", "external-buckets update-credentials"]
4810
- }),
4811
- externalBucketCapability({
4856
+ execute: (context, input) => externalBucketExecutor(context)("storage.external-buckets.verify", input),
4857
+ vnext: {
4858
+ arguments: "semantic",
4859
+ audience: "customer",
4860
+ category: "resource",
4861
+ outcome: "Record current source-access verification without exposing credential material.",
4862
+ human: "ornn external-buckets verify <external-bucket>",
4863
+ automation: "ornn external-buckets verify <external-bucket-id> --idempotency-key <key> --format json",
4864
+ acceptedReferences: ["canonical external bucket ID", "exact unique external bucket name"],
4865
+ review: gcsImportGuidance,
4866
+ related: ["external-buckets import", "external-buckets update-credentials"],
4867
+ resumableStates: []
4868
+ }
4869
+ }
4870
+ });
4871
+ var externalBucketCapabilities = [
4872
+ bucketListCapability,
4873
+ bucketShowCapability,
4874
+ bucketConnectCapability,
4875
+ bucketUpdateCredentialsCapability,
4876
+ bucketVerifyCapability,
4877
+ defineCapability({
4812
4878
  id: "storage.external-buckets.import",
4813
- command: ["external-buckets", "import"],
4879
+ domain: "storage",
4880
+ roles: ["user"],
4814
4881
  description: "Import a verified GCS or S3 source into its isolated managed working volume.",
4815
4882
  mutation: "preview-confirm",
4816
4883
  input: importInput,
4817
- outcome: "Create or replay exactly one managed working copy with source writeback disabled.",
4818
- human: "ornn external-buckets import <gcs|s3|r2> <external-bucket> --reservation <canonical-reservation-id> [--no-wait] [--timeout <duration>]",
4819
- automation: "ornn external-buckets import <gcs|s3> <external-bucket-id> --reservation <canonical-reservation-id> --idempotency-key <key> [--wait --timeout <duration>] --format json",
4820
- acceptedReferences: ["canonical external bucket ID", "exact unique external bucket name"],
4821
- review: `Review the isolated destination and explicit no-writeback guarantee before importing. ${gcsImportGuidance}`,
4822
- resumableStates: ["pending", "working", "partial", "failed", "interrupted"],
4823
- related: ["external-buckets show", "storage status", "volumes files list"]
4884
+ mcp: false,
4885
+ slack: false,
4886
+ execute: (context, input) => externalBucketExecutor(context)("storage.external-buckets.import", input),
4887
+ cli: {
4888
+ command: ["external-buckets", "import"],
4889
+ vnext: {
4890
+ arguments: "semantic",
4891
+ audience: "customer",
4892
+ category: "resource",
4893
+ outcome: "Create or replay exactly one managed working copy with source writeback disabled.",
4894
+ human: "ornn external-buckets import <gcs|s3|r2> <external-bucket> --reservation <canonical-reservation-id> [--no-wait] [--timeout <duration>]",
4895
+ automation: "ornn external-buckets import <gcs|s3> <external-bucket-id> --reservation <canonical-reservation-id> --idempotency-key <key> [--wait --timeout <duration>] --format json",
4896
+ acceptedReferences: ["canonical external bucket ID", "exact unique external bucket name"],
4897
+ review: `Review the isolated destination and explicit no-writeback guarantee before importing. ${gcsImportGuidance}`,
4898
+ resumableStates: ["pending", "working", "partial", "failed", "interrupted"],
4899
+ related: ["external-buckets show", "storage status", "volumes files list"]
4900
+ }
4901
+ }
4824
4902
  }),
4825
4903
  bucketDisconnectCapability
4826
4904
  ];
@@ -5026,7 +5104,7 @@ var metricsCapabilities = [metricsSnapshotCapability, metricsHistoryCapability];
5026
5104
 
5027
5105
  // ../../packages/capabilities/dist/capabilities/mounts.js
5028
5106
  import { z as z25 } from "zod";
5029
- var mountInput = z25.object({
5107
+ var mountCliInput = z25.object({
5030
5108
  $positionals: z25.array(z25.string()).default([]),
5031
5109
  access: z25.string().optional(),
5032
5110
  cursor: z25.string().optional(),
@@ -5038,110 +5116,181 @@ var mountInput = z25.object({
5038
5116
  wait: z25.boolean().optional(),
5039
5117
  yes: z25.boolean().optional()
5040
5118
  }).strict();
5041
- function mountExecutor(context) {
5042
- const interaction = context.cli?.interaction;
5043
- if (!interaction?.mounts) {
5044
- throw new Error("This capability must execute through the Ornn CLI mount runtime.");
5045
- }
5046
- return interaction.mounts.bind(interaction);
5119
+ function executeMount(command) {
5120
+ return (context, input) => {
5121
+ const interaction = context.cli?.interaction;
5122
+ if (!interaction?.mounts) {
5123
+ throw new Error("This capability must execute through the Ornn CLI mount runtime.");
5124
+ }
5125
+ return interaction.mounts(command, input, context);
5126
+ };
5047
5127
  }
5048
- function mountCapability({ acceptedReferences = [], automation, command, description, human, id, mutation, order, outcome, related = [], resumableStates = [], review }) {
5049
- return defineCapability({
5050
- id,
5128
+ function mutationOptions(idempotencyKey) {
5129
+ return idempotencyKey ? { headers: { "Idempotency-Key": idempotencyKey } } : void 0;
5130
+ }
5131
+ var reservationInput = z25.object({ reservationId: z25.string() });
5132
+ var reservationWrite = reservationInput.extend({ confirm: z25.boolean().optional() });
5133
+ var attachInput = reservationWrite.extend({
5134
+ driveId: z25.string(),
5135
+ readOnly: z25.boolean().optional()
5136
+ });
5137
+ var volumeMountCandidatesCapability = defineCapability({
5138
+ id: "storage.volume-mounts.candidates",
5139
+ domain: "storage",
5140
+ roles: ["user"],
5141
+ description: "List reservations that can receive a storage deploy, grouped the same way as the console picker.",
5142
+ mutation: "read",
5143
+ input: z25.object({}),
5144
+ mcp: { name: "storage_targets" },
5145
+ slack: false,
5146
+ cli: {
5147
+ command: ["volume-mounts", "candidates"],
5148
+ input: mountCliInput,
5149
+ execute: executeMount("storage.volume-mounts.candidates"),
5150
+ vnext: {
5151
+ arguments: "semantic",
5152
+ audience: "customer",
5153
+ category: "resource",
5154
+ order: 540,
5155
+ outcome: "List one bounded page of safe Bare Metal volume-mount candidates.",
5156
+ human: "ornn volume-mounts candidates [--limit <1-500>] [--cursor <cursor>]",
5157
+ automation: "ornn volume-mounts candidates --limit 50 --format json",
5158
+ acceptedReferences: [],
5159
+ related: ["volume-mounts attach", "volumes list"],
5160
+ resumableStates: []
5161
+ }
5162
+ },
5163
+ execute: (ctx) => listStorageTargets(ctx.fetch)
5164
+ });
5165
+ var volumeMountShowCapability = defineCapability({
5166
+ id: "storage.volume-mounts.show",
5167
+ domain: "storage",
5168
+ roles: ["user"],
5169
+ description: "Show a reservation's storage deployment (attachment) status.",
5170
+ mutation: "read",
5171
+ input: reservationInput,
5172
+ mcp: { name: "storage_deployment_status" },
5173
+ slack: false,
5174
+ cli: {
5175
+ command: ["volume-mounts", "show"],
5176
+ input: mountCliInput,
5177
+ execute: executeMount("storage.volume-mounts.show"),
5178
+ vnext: {
5179
+ arguments: "semantic",
5180
+ audience: "customer",
5181
+ category: "resource",
5182
+ order: 541,
5183
+ outcome: "Show actual per-machine mount state without rewriting volume lifecycle.",
5184
+ human: "ornn volume-mounts show <canonical-reservation-id>",
5185
+ automation: "ornn volume-mounts show <canonical-reservation-id> --format json",
5186
+ acceptedReferences: ["canonical capacity-reservation ID"],
5187
+ related: ["volume-mounts wait", "volumes show"],
5188
+ resumableStates: []
5189
+ }
5190
+ },
5191
+ execute: (ctx, input) => getReservationStorageAttachment(ctx.fetch, input.reservationId)
5192
+ });
5193
+ var volumeMountAttachCapability = defineCapability({
5194
+ id: "storage.volume-mounts.attach",
5195
+ domain: "storage",
5196
+ roles: ["user"],
5197
+ 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.",
5198
+ mutation: "preview-confirm",
5199
+ input: attachInput.extend({
5200
+ mountPath: z25.string().optional(),
5201
+ mountMode: z25.literal("fuse").optional(),
5202
+ idempotencyKey: z25.string().optional()
5203
+ }),
5204
+ mcp: { name: "storage_deploy", input: attachInput },
5205
+ slack: false,
5206
+ cli: {
5207
+ command: ["volume-mounts", "attach"],
5208
+ input: mountCliInput,
5209
+ execute: executeMount("storage.volume-mounts.attach"),
5210
+ vnext: {
5211
+ arguments: "semantic",
5212
+ audience: "customer",
5213
+ category: "resource",
5214
+ order: 542,
5215
+ outcome: "Reconcile one exact volume-mount goal and preserve per-machine readiness.",
5216
+ human: "ornn volume-mounts attach <canonical-reservation-id> --volume <exact-name-or-id> --access read-only|read-write [--no-wait]",
5217
+ automation: "ornn volume-mounts attach <canonical-reservation-id> --volume <canonical-volume-id> --access read-only|read-write --idempotency-key <key> --format json",
5218
+ acceptedReferences: [
5219
+ "canonical capacity-reservation ID",
5220
+ "canonical or exact unique managed-volume reference"
5221
+ ],
5222
+ review: "Review the exact capacity reservation, volume, and access mode.",
5223
+ resumableStates: ["accepted", "partial", "ready"],
5224
+ related: ["volume-mounts wait", "volume-mounts detach"]
5225
+ }
5226
+ },
5227
+ execute: (ctx, input) => deployReservationStorage(ctx.fetch, input.reservationId, {
5228
+ drive_id: input.driveId,
5229
+ access_mode: input.readOnly ? "read-only" : "read-write",
5230
+ ...input.mountPath !== void 0 ? { mount_path: input.mountPath } : {},
5231
+ ...input.mountMode !== void 0 ? { mount_mode: input.mountMode } : {}
5232
+ }, mutationOptions(input.idempotencyKey))
5233
+ });
5234
+ var volumeMountDetachCapability = defineCapability({
5235
+ id: "storage.volume-mounts.detach",
5236
+ domain: "storage",
5237
+ roles: ["user"],
5238
+ description: "Detach the reservation storage attachment (after unmount) so the volume can be deleted.",
5239
+ mutation: "preview-confirm",
5240
+ input: reservationWrite.extend({ idempotencyKey: z25.string().optional() }),
5241
+ mcp: { name: "storage_undeploy", input: reservationWrite },
5242
+ slack: false,
5243
+ cli: {
5244
+ command: ["volume-mounts", "detach"],
5245
+ input: mountCliInput,
5246
+ execute: executeMount("storage.volume-mounts.detach"),
5247
+ vnext: {
5248
+ arguments: "semantic",
5249
+ audience: "customer",
5250
+ category: "resource",
5251
+ order: 544,
5252
+ outcome: "Reconcile an exact detached goal and preserve the underlying volume.",
5253
+ human: "ornn volume-mounts detach <canonical-reservation-id>",
5254
+ automation: "ornn volume-mounts detach <canonical-reservation-id> --idempotency-key <key> --format json",
5255
+ acceptedReferences: ["canonical capacity-reservation ID"],
5256
+ review: "Review the exact relationship and access loss; the managed volume remains.",
5257
+ resumableStates: ["detaching", "ended"],
5258
+ related: ["volumes show", "private-networks list"]
5259
+ }
5260
+ },
5261
+ execute: (ctx, input) => detachReservationStorage(ctx.fetch, input.reservationId, {}, mutationOptions(input.idempotencyKey))
5262
+ });
5263
+ var mountCapabilities = [
5264
+ volumeMountCandidatesCapability,
5265
+ volumeMountShowCapability,
5266
+ volumeMountAttachCapability,
5267
+ defineCapability({
5268
+ id: "storage.volume-mounts.wait",
5051
5269
  domain: "storage",
5052
5270
  roles: ["user"],
5053
- description,
5054
- mutation,
5055
- input: mountInput,
5271
+ description: "Wait locally for every requested machine mount to reach a durable terminal state.",
5272
+ mutation: "read",
5273
+ input: mountCliInput,
5274
+ mcp: false,
5275
+ slack: false,
5056
5276
  cli: {
5057
- command,
5277
+ command: ["volume-mounts", "wait"],
5058
5278
  vnext: {
5059
5279
  arguments: "semantic",
5060
5280
  audience: "customer",
5061
5281
  category: "resource",
5062
- order,
5063
- outcome,
5064
- human,
5065
- automation,
5066
- acceptedReferences,
5067
- related,
5068
- resumableStates,
5069
- ...review ? { review } : {}
5282
+ order: 543,
5283
+ outcome: "Wait with a bounded deadline while preserving useful per-machine partial data.",
5284
+ human: "ornn volume-mounts wait <canonical-reservation-id> [--timeout <duration>]",
5285
+ automation: "ornn volume-mounts wait <canonical-reservation-id> --timeout <duration> --format json",
5286
+ acceptedReferences: ["canonical capacity-reservation ID"],
5287
+ resumableStates: ["partial", "ready"],
5288
+ related: ["volume-mounts show", "volume-mounts detach"]
5070
5289
  }
5071
5290
  },
5072
- mcp: false,
5073
- slack: false,
5074
- execute: async (context, input) => mountExecutor(context)(id, input)
5075
- });
5076
- }
5077
- var mountCapabilities = [
5078
- mountCapability({
5079
- id: "storage.volume-mounts.candidates",
5080
- command: ["volume-mounts", "candidates"],
5081
- description: "List capacity reservations eligible for a managed-volume mount.",
5082
- mutation: "read",
5083
- order: 540,
5084
- outcome: "List one bounded page of safe Bare Metal volume-mount candidates.",
5085
- human: "ornn volume-mounts candidates [--limit <1-500>] [--cursor <cursor>]",
5086
- automation: "ornn volume-mounts candidates --limit 50 --format json",
5087
- related: ["volume-mounts attach", "volumes list"]
5088
- }),
5089
- mountCapability({
5090
- id: "storage.volume-mounts.show",
5091
- command: ["volume-mounts", "show"],
5092
- description: "Show one reservation's exact managed-volume relationship and per-machine readiness.",
5093
- mutation: "read",
5094
- order: 541,
5095
- outcome: "Show actual per-machine mount state without rewriting volume lifecycle.",
5096
- human: "ornn volume-mounts show <canonical-reservation-id>",
5097
- automation: "ornn volume-mounts show <canonical-reservation-id> --format json",
5098
- acceptedReferences: ["canonical capacity-reservation ID"],
5099
- related: ["volume-mounts wait", "volumes show"]
5291
+ execute: executeMount("storage.volume-mounts.wait")
5100
5292
  }),
5101
- mountCapability({
5102
- id: "storage.volume-mounts.attach",
5103
- command: ["volume-mounts", "attach"],
5104
- description: "Attach one exact managed volume to every machine in one exact capacity reservation.",
5105
- mutation: "preview-confirm",
5106
- order: 542,
5107
- outcome: "Reconcile one exact volume-mount goal and preserve per-machine readiness.",
5108
- human: "ornn volume-mounts attach <canonical-reservation-id> --volume <exact-name-or-id> --access read-only|read-write [--no-wait]",
5109
- automation: "ornn volume-mounts attach <canonical-reservation-id> --volume <canonical-volume-id> --access read-only|read-write --idempotency-key <key> --format json",
5110
- acceptedReferences: [
5111
- "canonical capacity-reservation ID",
5112
- "canonical or exact unique managed-volume reference"
5113
- ],
5114
- review: "Review the exact capacity reservation, volume, and access mode.",
5115
- resumableStates: ["accepted", "partial", "ready"],
5116
- related: ["volume-mounts wait", "volume-mounts detach"]
5117
- }),
5118
- mountCapability({
5119
- id: "storage.volume-mounts.wait",
5120
- command: ["volume-mounts", "wait"],
5121
- description: "Wait locally for every requested machine mount to reach a durable terminal state.",
5122
- mutation: "read",
5123
- order: 543,
5124
- outcome: "Wait with a bounded deadline while preserving useful per-machine partial data.",
5125
- human: "ornn volume-mounts wait <canonical-reservation-id> [--timeout <duration>]",
5126
- automation: "ornn volume-mounts wait <canonical-reservation-id> --timeout <duration> --format json",
5127
- acceptedReferences: ["canonical capacity-reservation ID"],
5128
- resumableStates: ["partial", "ready"],
5129
- related: ["volume-mounts show", "volume-mounts detach"]
5130
- }),
5131
- mountCapability({
5132
- id: "storage.volume-mounts.detach",
5133
- command: ["volume-mounts", "detach"],
5134
- description: "Detach one exact reservation relationship without deleting its volume.",
5135
- mutation: "preview-confirm",
5136
- order: 544,
5137
- outcome: "Reconcile an exact detached goal and preserve the underlying volume.",
5138
- human: "ornn volume-mounts detach <canonical-reservation-id>",
5139
- automation: "ornn volume-mounts detach <canonical-reservation-id> --idempotency-key <key> --format json",
5140
- acceptedReferences: ["canonical capacity-reservation ID"],
5141
- review: "Review the exact relationship and access loss; the managed volume remains.",
5142
- resumableStates: ["detaching", "ended"],
5143
- related: ["volumes show", "private-networks list"]
5144
- })
5293
+ volumeMountDetachCapability
5145
5294
  ];
5146
5295
 
5147
5296
  // ../../packages/capabilities/dist/capabilities/identity.js
@@ -5712,7 +5861,7 @@ function executeNetwork(command) {
5712
5861
  return runtime3.networks(command, input, context);
5713
5862
  };
5714
5863
  }
5715
- function mutationOptions(idempotencyKey) {
5864
+ function mutationOptions2(idempotencyKey) {
5716
5865
  return idempotencyKey ? { headers: { "Idempotency-Key": idempotencyKey } } : void 0;
5717
5866
  }
5718
5867
  var networkIdInput = z29.object({ networkId: z29.string() });
@@ -5738,7 +5887,7 @@ var vpnPeerCreateInput = z29.object({
5738
5887
  confirm: z29.boolean().optional()
5739
5888
  });
5740
5889
  var vpnPeerDeleteInput = z29.object({ peerId: z29.string(), confirm: z29.boolean().optional() });
5741
- var reservationInput = { reservationId: z29.string() };
5890
+ var reservationInput2 = { reservationId: z29.string() };
5742
5891
  var privateNetworkListCapability = defineCapability({
5743
5892
  id: "networks.list",
5744
5893
  domain: "networks",
@@ -5818,7 +5967,7 @@ var privateNetworkCreateCapability = defineCapability({
5818
5967
  related: ["private-networks list"]
5819
5968
  }
5820
5969
  },
5821
- execute: (ctx, input) => createNetwork(ctx.fetch, { name: input.name, cidr: input.cidr ?? null, description: input.description ?? null }, mutationOptions(input.idempotencyKey))
5970
+ execute: (ctx, input) => createNetwork(ctx.fetch, { name: input.name, cidr: input.cidr ?? null, description: input.description ?? null }, mutationOptions2(input.idempotencyKey))
5822
5971
  });
5823
5972
  var privateNetworkUpdateCapability = defineCapability({
5824
5973
  id: "networks.update",
@@ -5849,7 +5998,7 @@ var privateNetworkUpdateCapability = defineCapability({
5849
5998
  execute: (ctx, input) => updateNetwork(ctx.fetch, input.networkId, {
5850
5999
  ...input.name !== void 0 ? { name: input.name } : {},
5851
6000
  ...input.clearDescription ? { description: null } : input.description !== void 0 ? { description: input.description } : {}
5852
- }, mutationOptions(input.idempotencyKey))
6001
+ }, mutationOptions2(input.idempotencyKey))
5853
6002
  });
5854
6003
  var privateNetworkDeleteCapability = defineCapability({
5855
6004
  id: "networks.delete",
@@ -5878,7 +6027,7 @@ var privateNetworkDeleteCapability = defineCapability({
5878
6027
  }
5879
6028
  },
5880
6029
  execute: async (ctx, input) => {
5881
- await deleteNetwork(ctx.fetch, input.networkId, mutationOptions(input.idempotencyKey));
6030
+ await deleteNetwork(ctx.fetch, input.networkId, mutationOptions2(input.idempotencyKey));
5882
6031
  return { deleted: true, network_id: input.networkId };
5883
6032
  }
5884
6033
  });
@@ -5889,7 +6038,7 @@ var vpnConnectionListCapability = defineCapability({
5889
6038
  mutation: "read",
5890
6039
  input: z29.object({}),
5891
6040
  description: "List WireGuard VPN peers registered on a reservation.",
5892
- mcp: { name: "vpn_peers_list", input: z29.object(reservationInput) },
6041
+ mcp: { name: "vpn_peers_list", input: z29.object(reservationInput2) },
5893
6042
  slack: false,
5894
6043
  cli: {
5895
6044
  command: ["vpn-connections", "list"],
@@ -5918,7 +6067,7 @@ var vpnConnectionConfigureCapability = defineCapability({
5918
6067
  description: "Register a WireGuard VPN peer public key on a reservation.",
5919
6068
  mcp: {
5920
6069
  name: "vpn_peers_create",
5921
- input: z29.object({ ...reservationInput, ...vpnPeerCreateInput.shape })
6070
+ input: z29.object({ ...reservationInput2, ...vpnPeerCreateInput.shape })
5922
6071
  },
5923
6072
  slack: false,
5924
6073
  cli: {
@@ -5939,7 +6088,7 @@ var vpnConnectionConfigureCapability = defineCapability({
5939
6088
  related: ["connect", "vpn-connections disconnect"]
5940
6089
  }
5941
6090
  },
5942
- execute: (ctx, input) => createNetworkPeer(ctx.fetch, "shared", { public_key: input.publicKey, label: input.label ?? null }, mutationOptions(input.idempotencyKey))
6091
+ execute: (ctx, input) => createNetworkPeer(ctx.fetch, "shared", { public_key: input.publicKey, label: input.label ?? null }, mutationOptions2(input.idempotencyKey))
5943
6092
  });
5944
6093
  var vpnConnectionDisconnectCapability = defineCapability({
5945
6094
  id: "vpn.connections.disconnect",
@@ -5950,7 +6099,7 @@ var vpnConnectionDisconnectCapability = defineCapability({
5950
6099
  description: "Revoke a WireGuard VPN peer from a reservation.",
5951
6100
  mcp: {
5952
6101
  name: "vpn_peers_delete",
5953
- input: z29.object({ ...reservationInput, ...vpnPeerDeleteInput.shape })
6102
+ input: z29.object({ ...reservationInput2, ...vpnPeerDeleteInput.shape })
5954
6103
  },
5955
6104
  slack: false,
5956
6105
  cli: {
@@ -5974,7 +6123,7 @@ var vpnConnectionDisconnectCapability = defineCapability({
5974
6123
  related: ["vpn-connections configure"]
5975
6124
  }
5976
6125
  },
5977
- execute: async (ctx, input) => await deleteNetworkPeer(ctx.fetch, "shared", input.peerId, mutationOptions(input.idempotencyKey)) ?? { deleted: true }
6126
+ execute: async (ctx, input) => await deleteNetworkPeer(ctx.fetch, "shared", input.peerId, mutationOptions2(input.idempotencyKey)) ?? { deleted: true }
5978
6127
  });
5979
6128
  var connectCapability = defineCapability({
5980
6129
  id: "vpn.connect",
@@ -6722,126 +6871,6 @@ var volumeCapabilities = [
6722
6871
  related: ["volumes files list"]
6723
6872
  })
6724
6873
  ];
6725
- var reservationInput2 = z32.object({ reservationId: z32.string() });
6726
- var reservationWrite = reservationInput2.extend({ confirm: z32.boolean().optional() });
6727
- var bucketConnectInput = z32.object({
6728
- provider: z32.enum(["gcs", "s3", "r2"]),
6729
- bucket: z32.string(),
6730
- name: z32.string().optional(),
6731
- prefix: z32.string().optional(),
6732
- region: z32.string().optional(),
6733
- endpointUrl: z32.string().optional(),
6734
- accountId: z32.string().optional(),
6735
- accessKeyId: z32.string().optional(),
6736
- secretAccessKey: z32.string().optional(),
6737
- readOnly: z32.boolean().optional(),
6738
- confirm: z32.boolean().optional()
6739
- }).refine((input) => !(input.provider === "gcs" && (input.accessKeyId || input.secretAccessKey)), {
6740
- message: "Access key credentials are only supported for S3-compatible buckets."
6741
- }).refine((input) => Boolean(input.accessKeyId) === Boolean(input.secretAccessKey), {
6742
- message: "Provide both accessKeyId and secretAccessKey, or neither."
6743
- }).refine((input) => input.provider !== "r2" || Boolean(input.endpointUrl || input.accountId), {
6744
- message: "R2 buckets require either --endpointUrl or --accountId."
6745
- });
6746
- var storageVerbCapabilities = [
6747
- defineCapability({
6748
- id: "storage.deploy",
6749
- domain: "storage",
6750
- roles: ["user"],
6751
- 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.",
6752
- mutation: "preview-confirm",
6753
- input: reservationWrite.extend({ driveId: z32.string(), readOnly: z32.boolean().optional() }),
6754
- slack: false,
6755
- execute: (ctx, input) => deployReservationStorage(ctx.fetch, input.reservationId, {
6756
- drive_id: input.driveId,
6757
- access_mode: input.readOnly ? "read-only" : "read-write"
6758
- })
6759
- }),
6760
- defineCapability({
6761
- id: "storage.undeploy",
6762
- domain: "storage",
6763
- roles: ["user"],
6764
- description: "Detach the reservation storage attachment (after unmount) so the volume can be deleted.",
6765
- mutation: "preview-confirm",
6766
- input: reservationWrite,
6767
- slack: false,
6768
- execute: (ctx, input) => detachReservationStorage(ctx.fetch, input.reservationId)
6769
- }),
6770
- defineCapability({
6771
- id: "storage.deployment_status",
6772
- domain: "storage",
6773
- roles: ["user"],
6774
- description: "Show a reservation's storage deployment (attachment) status.",
6775
- mutation: "read",
6776
- input: reservationInput2,
6777
- slack: false,
6778
- execute: (ctx, input) => getReservationStorageAttachment(ctx.fetch, input.reservationId)
6779
- }),
6780
- defineCapability({
6781
- id: "storage.targets",
6782
- domain: "storage",
6783
- roles: ["user"],
6784
- description: "List reservations that can receive a storage deploy, grouped the same way as the console picker.",
6785
- mutation: "read",
6786
- input: z32.object({}),
6787
- slack: false,
6788
- execute: (ctx) => listStorageTargets(ctx.fetch)
6789
- }),
6790
- defineCapability({
6791
- id: "bucket.connect",
6792
- domain: "storage",
6793
- roles: ["user"],
6794
- description: "Connect an external bucket (GCS, S3, or Cloudflare R2) as a storage volume. Cloudflare R2 deployment support is coming soon (connect succeeds, but deployment is not yet available).",
6795
- mutation: "preview-confirm",
6796
- input: bucketConnectInput,
6797
- mcp: { name: "storage_buckets_connect" },
6798
- slack: false,
6799
- execute: (ctx, input) => {
6800
- const endpoint = input.endpointUrl ?? (input.provider === "r2" && input.accountId ? `https://${input.accountId}.r2.cloudflarestorage.com` : void 0);
6801
- return createDrive(ctx.fetch, {
6802
- name: input.name ?? input.bucket,
6803
- provider: "ornn_volume",
6804
- source_provider: input.provider === "gcs" ? "external_gcs" : "s3",
6805
- external_bucket: input.bucket,
6806
- external_prefix: input.prefix ?? null,
6807
- external_region: input.region ?? (input.provider === "r2" ? "auto" : null),
6808
- external_read_only: input.readOnly !== false,
6809
- ...input.provider === "r2" ? { external_s3_provider: "cloudflare_r2" } : {},
6810
- ...input.provider === "s3" ? { external_s3_provider: "aws_s3" } : {},
6811
- ...endpoint ? { external_endpoint_url: endpoint } : {},
6812
- ...input.accessKeyId ? { external_access_key_id: input.accessKeyId } : {},
6813
- ...input.secretAccessKey ? { external_secret_access_key: input.secretAccessKey } : {}
6814
- });
6815
- }
6816
- }),
6817
- defineCapability({
6818
- id: "bucket.verify",
6819
- domain: "storage",
6820
- roles: ["user"],
6821
- description: "Verify a connected S3-compatible bucket's source credentials/connectivity.",
6822
- mutation: "preview-confirm",
6823
- input: driveWrite,
6824
- mcp: { name: "storage_buckets_verify" },
6825
- slack: false,
6826
- execute: (ctx, input) => updateDrive(ctx.fetch, input.driveId, { verify_source: true })
6827
- }),
6828
- defineCapability({
6829
- id: "bucket.update_credentials",
6830
- domain: "storage",
6831
- roles: ["user"],
6832
- description: "Update a connected S3-compatible bucket's access key credentials.",
6833
- mutation: "preview-confirm",
6834
- input: driveWrite.extend({ accessKeyId: z32.string(), secretAccessKey: z32.string() }),
6835
- mcp: { name: "storage_buckets_update_credentials" },
6836
- slack: false,
6837
- execute: (ctx, input) => updateDrive(ctx.fetch, input.driveId, {
6838
- source_credentials: {
6839
- external_access_key_id: input.accessKeyId,
6840
- external_secret_access_key: input.secretAccessKey
6841
- }
6842
- })
6843
- })
6844
- ];
6845
6874
 
6846
6875
  // ../../packages/capabilities/dist/cli-catalog.js
6847
6876
  function canonicalCliCatalog(capabilities) {
@@ -6882,7 +6911,6 @@ var catalog = [
6882
6911
  ...observabilityCapabilities,
6883
6912
  ...clusterCapabilities,
6884
6913
  ...accessVerbCapabilities,
6885
- ...storageVerbCapabilities,
6886
6914
  reservationKeysPushCapability,
6887
6915
  ...metricsCapabilities,
6888
6916
  ...billingCapabilities,
@@ -7160,9 +7188,12 @@ export {
7160
7188
  ADMIN_CLI_ROOTS,
7161
7189
  CLI_MIGRATION_GUIDE_URL,
7162
7190
  LEGACY_CLI_MIGRATIONS,
7191
+ bucketConnectCapability,
7163
7192
  bucketDisconnectCapability,
7164
7193
  bucketListCapability,
7165
7194
  bucketShowCapability,
7195
+ bucketUpdateCredentialsCapability,
7196
+ bucketVerifyCapability,
7166
7197
  byCliCommand,
7167
7198
  byMcpName,
7168
7199
  catalog,
@@ -7189,6 +7220,10 @@ export {
7189
7220
  volumeDeleteCapability,
7190
7221
  volumeFilesListCapability,
7191
7222
  volumeListCapability,
7223
+ volumeMountAttachCapability,
7224
+ volumeMountCandidatesCapability,
7225
+ volumeMountDetachCapability,
7226
+ volumeMountShowCapability,
7192
7227
  volumeRefreshCapability,
7193
7228
  volumeShowCapability,
7194
7229
  vpnConnectionConfigureCapability,