@ornncompute/cli 1.0.142 → 1.0.143

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,7 +5,7 @@ client for customer compute journeys and the explicit staff namespace. It
5
5
  sends browser and CLI traffic only through the API gateway.
6
6
 
7
7
  For the customer install and usage guide, see [`docs/cli.md`](../../docs/cli.md).
8
- The shared capability catalog in `packages/capabilities` is the authority for
8
+ The [shared capability catalog](../../packages/capabilities/README.md) is the authority for
9
9
  command identity, role visibility, input schemas, help, and resource discovery.
10
10
  The CLI imports `@ornn/capabilities/cli`; packaging includes its dependencies,
11
11
  including `@ornn/api-client`, and excludes MCP-only catalog handlers. These
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ornncompute/cli",
3
- "version": "1.0.142",
3
+ "version": "1.0.143",
4
4
  "description": "Command-line interface for Ornn compute access workflows.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -2,6 +2,8 @@ import {
2
2
  sshKeyListCapability,
3
3
  sshKeyAddCapability,
4
4
  sshKeyDeleteCapability,
5
+ sshKeyAssignmentListCapability,
6
+ sshKeyAssignmentAssignCapability,
5
7
  sshKeyAssignmentStatusCapability,
6
8
  sshKeyDeliveryStatus,
7
9
  } from "../vendor/capabilities/cli.js";
@@ -687,7 +689,7 @@ export async function materializeKey(context, plan, interaction, idempotencyKey)
687
689
 
688
690
  async function fetchAssignedKeys(context, reservationId) {
689
691
  return activeKeys(
690
- keysFromPayload(await orchestrator.listReservationSshKeys(context.fetch, reservationId))
692
+ keysFromPayload(await sshKeyAssignmentListCapability.execute(context, { reservationId }))
691
693
  );
692
694
  }
693
695
 
@@ -697,12 +699,11 @@ async function ensureAssignment(context, reservationId, key, idempotencyKey, int
697
699
  const existing = assigned.find((candidate) => resourceId(candidate) === keyId);
698
700
  if (existing) return { created: false, key: existing };
699
701
  const created = record(
700
- await orchestrator.addReservationSshKey(
701
- context.fetch,
702
+ await sshKeyAssignmentAssignCapability.execute(context, {
702
703
  reservationId,
703
- { ssh_key_id: keyId },
704
- { headers: { "Idempotency-Key": idempotencyKey } }
705
- )
704
+ keyId,
705
+ idempotencyKey,
706
+ })
706
707
  );
707
708
  if (resourceId(created) !== keyId) {
708
709
  interaction.error("The SSH-key assignment did not match the reviewed key.", {
@@ -1668,7 +1669,7 @@ async function executeWorkspaceCapability(
1668
1669
  code: "workspace_capability_unavailable",
1669
1670
  });
1670
1671
  }
1671
- const execution = await capability.execute(
1672
+ const execution = await (capability.cli?.execute ?? capability.execute)(
1672
1673
  workspaceStepContext(context, interaction, signal),
1673
1674
  input
1674
1675
  );
@@ -231,19 +231,6 @@ function deleteAccountSshKey(request, id, options) {
231
231
  method: "DELETE"
232
232
  });
233
233
  }
234
- function listClusterUserKeys(request, input) {
235
- return request(`${compute}/nodes/organizations/me/cluster-users${query2(input)}`, {
236
- method: "GET"
237
- });
238
- }
239
- function createClusterUserKey(request, body) {
240
- return request(`${compute}/nodes/organizations/me/cluster-users`, { method: "POST", body });
241
- }
242
- function deleteClusterUserKey(request, id) {
243
- return request(`${compute}/nodes/organizations/me/cluster-users/${encodeURIComponent(id)}`, {
244
- method: "DELETE"
245
- });
246
- }
247
234
 
248
235
  // ../../packages/api-client/dist/gateway/staff.js
249
236
  function addStaffReservationKey(request, id, body) {
@@ -307,12 +294,10 @@ export {
307
294
  claimSupplierIntakeEditor,
308
295
  consoleMcpPath,
309
296
  createAccountSshKey,
310
- createClusterUserKey,
311
297
  createPylonIssue,
312
298
  createStaffTestMember,
313
299
  createSupportThread,
314
300
  deleteAccountSshKey,
315
- deleteClusterUserKey,
316
301
  deleteSupplierIntakeDocument,
317
302
  deployReservationStorage,
318
303
  deployStaffNode,
@@ -338,7 +323,6 @@ export {
338
323
  linkPylonAccount,
339
324
  linkPylonIssue,
340
325
  listAccountSshKeys,
341
- listClusterUserKeys,
342
326
  listClusters,
343
327
  listGithubCommitPulls,
344
328
  listGithubCommits,
@@ -3359,19 +3359,6 @@ function deleteAccountSshKey(request, id, options) {
3359
3359
  method: "DELETE"
3360
3360
  });
3361
3361
  }
3362
- function listClusterUserKeys(request, input) {
3363
- return request(`${compute}/nodes/organizations/me/cluster-users${query2(input)}`, {
3364
- method: "GET"
3365
- });
3366
- }
3367
- function createClusterUserKey(request, body2) {
3368
- return request(`${compute}/nodes/organizations/me/cluster-users`, { method: "POST", body: body2 });
3369
- }
3370
- function deleteClusterUserKey(request, id) {
3371
- return request(`${compute}/nodes/organizations/me/cluster-users/${encodeURIComponent(id)}`, {
3372
- method: "DELETE"
3373
- });
3374
- }
3375
3362
 
3376
3363
  // ../../packages/api-client/dist/gateway/index.js
3377
3364
  function getCliStatus(request) {
@@ -3474,6 +3461,7 @@ var publicKeyInput = z18.object({
3474
3461
  confirm: z18.boolean().optional()
3475
3462
  });
3476
3463
  var keyIdInput = z18.object({ keyId: z18.string(), confirm: z18.boolean().optional() });
3464
+ var reservationKeyInput = publicKeyInput.extend({ reservationId: z18.string() });
3477
3465
  var ADDED_KEY_OUTCOME = "The response's outcome field says whether the key was created, was already_registered (returned unchanged, so the submitted label is not applied), or was reactivated from a revoked key.";
3478
3466
  var keyListInput = z18.object({
3479
3467
  $positionals: positionals2,
@@ -3768,7 +3756,7 @@ var sshKeyListCapability = defineCapability({
3768
3756
  mutation: "read",
3769
3757
  input: pageInput.extend({ status: z18.enum(["active", "all"]).optional() }),
3770
3758
  description: "List a page of account SSH keys. Pass next_cursor as cursor to continue.",
3771
- mcp: { name: "ssh_keys_list", input: pageInput },
3759
+ mcp: { name: "ssh_keys_list", aliases: ["cluster_users_list"], input: pageInput },
3772
3760
  slack: false,
3773
3761
  cli: {
3774
3762
  command: ["ssh-keys", "list"],
@@ -3802,7 +3790,7 @@ var sshKeyAddCapability = defineCapability({
3802
3790
  idempotencyKey: z18.string().optional()
3803
3791
  }),
3804
3792
  description: `Add an SSH public key to the account. ${ADDED_KEY_OUTCOME}`,
3805
- mcp: { name: "ssh_keys_add", input: publicKeyInput },
3793
+ mcp: { name: "ssh_keys_add", aliases: ["cluster_users_add"], input: publicKeyInput },
3806
3794
  slack: false,
3807
3795
  cli: {
3808
3796
  command: ["ssh-keys", "add"],
@@ -3830,7 +3818,7 @@ var sshKeyDeleteCapability = defineCapability({
3830
3818
  mutation: "preview-confirm",
3831
3819
  input: keyIdInput.extend({ idempotencyKey: z18.string().optional() }),
3832
3820
  description: "Delete an SSH key from the account.",
3833
- mcp: { name: "ssh_keys_delete", input: keyIdInput },
3821
+ mcp: { name: "ssh_keys_delete", aliases: ["cluster_users_revoke"], input: keyIdInput },
3834
3822
  slack: false,
3835
3823
  cli: {
3836
3824
  command: ["ssh-keys", "delete"],
@@ -3855,15 +3843,19 @@ var sshKeyDeleteCapability = defineCapability({
3855
3843
  },
3856
3844
  execute: async (context, input) => await deleteAccountSshKey(context.fetch, input.keyId, input.idempotencyKey ? { headers: { "Idempotency-Key": input.idempotencyKey } } : void 0) ?? { deleted: true }
3857
3845
  });
3858
- var sshKeyAssignmentListCapability = cliOnly({
3846
+ var sshKeyAssignmentListCapability = defineCapability({
3859
3847
  id: "access.ssh_key_assignments.list",
3860
3848
  domain: "access",
3861
3849
  roles: ["user"],
3862
3850
  mutation: "read",
3863
- input: keyListInput,
3864
- description: "List SSH keys assigned to one capacity reservation.",
3851
+ input: z18.object({ reservationId: z18.string() }),
3852
+ description: "List SSH keys registered for a reservation.",
3853
+ mcp: { name: "access_keys_list" },
3854
+ slack: false,
3865
3855
  cli: {
3866
3856
  command: ["ssh-keys", "assignments", "list"],
3857
+ input: keyListInput,
3858
+ execute: executeSshKeys("assignments.list"),
3867
3859
  vnext: {
3868
3860
  arguments: "semantic",
3869
3861
  audience: "customer",
@@ -3876,17 +3868,24 @@ var sshKeyAssignmentListCapability = cliOnly({
3876
3868
  related: ["ssh-keys assignments status"]
3877
3869
  }
3878
3870
  },
3879
- execute: executeSshKeys("assignments.list")
3871
+ execute: (context, input) => listReservationSshKeys(context.fetch, input.reservationId)
3880
3872
  });
3881
- var sshKeyAssignmentAssignCapability = cliOnly({
3873
+ var sshKeyAssignmentAssignCapability = defineCapability({
3882
3874
  id: "access.ssh_key_assignments.assign",
3883
3875
  domain: "access",
3884
3876
  roles: ["user"],
3885
3877
  mutation: "preview-confirm",
3886
- input: keyMutationInput,
3887
- description: "Assign one existing organization SSH key to one capacity reservation.",
3878
+ input: z18.union([
3879
+ reservationKeyInput.extend({ idempotencyKey: z18.string().optional() }),
3880
+ keyIdInput.extend({ reservationId: z18.string(), idempotencyKey: z18.string().optional() })
3881
+ ]),
3882
+ description: `Add an SSH key to a reservation. ${ADDED_KEY_OUTCOME}`,
3883
+ mcp: { name: "access_keys_add", input: reservationKeyInput },
3884
+ slack: false,
3888
3885
  cli: {
3889
3886
  command: ["ssh-keys", "assignments", "assign"],
3887
+ input: keyMutationInput,
3888
+ execute: executeSshKeys("assignments.assign"),
3890
3889
  vnext: {
3891
3890
  arguments: "semantic",
3892
3891
  audience: "customer",
@@ -3905,7 +3904,7 @@ var sshKeyAssignmentAssignCapability = cliOnly({
3905
3904
  related: ["ssh-keys assignments status"]
3906
3905
  }
3907
3906
  },
3908
- execute: executeSshKeys("assignments.assign")
3907
+ execute: (context, input) => addReservationSshKey(context.fetch, input.reservationId, "keyId" in input ? { ssh_key_id: input.keyId } : { public_key: input.publicKey, label: input.label ?? null }, input.idempotencyKey ? { headers: { "Idempotency-Key": input.idempotencyKey } } : void 0)
3909
3908
  });
3910
3909
  var sshKeyAssignmentSyncCapability = cliOnly({
3911
3910
  id: "access.ssh_key_assignments.sync",
@@ -4047,29 +4046,6 @@ var accessVerbCapabilities = [
4047
4046
  ssh_key_ids: input.sshKeyIds
4048
4047
  })
4049
4048
  }),
4050
- defineCapability({
4051
- id: "access.keys.list",
4052
- domain: "access",
4053
- roles: ["user"],
4054
- description: "List SSH keys registered for a reservation.",
4055
- mutation: "read",
4056
- input: z18.object({ reservationId: z18.string() }),
4057
- slack: false,
4058
- execute: (ctx, input) => listReservationSshKeys(ctx.fetch, input.reservationId)
4059
- }),
4060
- defineCapability({
4061
- id: "access.keys.add",
4062
- domain: "access",
4063
- roles: ["user"],
4064
- description: `Add an SSH key to a reservation. ${ADDED_KEY_OUTCOME}`,
4065
- mutation: "preview-confirm",
4066
- input: publicKeyInput.extend({ reservationId: z18.string() }),
4067
- slack: false,
4068
- execute: (ctx, input) => addReservationSshKey(ctx.fetch, input.reservationId, {
4069
- label: input.label ?? null,
4070
- public_key: input.publicKey
4071
- })
4072
- }),
4073
4049
  defineCapability({
4074
4050
  id: "machine.reboot",
4075
4051
  domain: "access",
@@ -4091,43 +4067,6 @@ var accessVerbCapabilities = [
4091
4067
  mcp: { name: "nodes_hard_reset" },
4092
4068
  slack: false,
4093
4069
  execute: rebootMachine("hard_reset")
4094
- }),
4095
- defineCapability({
4096
- id: "cluster_users.list",
4097
- domain: "access",
4098
- roles: ["user"],
4099
- description: "List a page of organization cluster-user SSH keys. Pass next_cursor as cursor to continue.",
4100
- mutation: "read",
4101
- input: pageInput,
4102
- slack: false,
4103
- execute: (ctx, input) => listClusterUserKeys(ctx.fetch, {
4104
- status: "all",
4105
- limit: input.limit ?? 25,
4106
- ...input.cursor ? { cursor: input.cursor } : {}
4107
- })
4108
- }),
4109
- defineCapability({
4110
- id: "cluster_users.add",
4111
- domain: "access",
4112
- roles: ["user"],
4113
- description: "Add a cluster-user SSH public key to the organization. Registers the same organization key as ssh_keys_add; a key already registered is returned as-is with its existing label.",
4114
- mutation: "preview-confirm",
4115
- input: publicKeyInput,
4116
- slack: false,
4117
- execute: (ctx, input) => createClusterUserKey(ctx.fetch, {
4118
- public_key: input.publicKey,
4119
- label: input.label
4120
- })
4121
- }),
4122
- defineCapability({
4123
- id: "cluster_users.revoke",
4124
- domain: "access",
4125
- roles: ["user"],
4126
- description: "Revoke a cluster-user SSH key from the organization.",
4127
- mutation: "preview-confirm",
4128
- input: keyIdInput,
4129
- slack: false,
4130
- execute: async (ctx, input) => await deleteClusterUserKey(ctx.fetch, input.keyId) ?? { deleted: true }
4131
4070
  })
4132
4071
  ];
4133
4072
 
@@ -7264,6 +7203,8 @@ export {
7264
7203
  metricsSnapshotCapability,
7265
7204
  parseHardwareCatalog,
7266
7205
  sshKeyAddCapability,
7206
+ sshKeyAssignmentAssignCapability,
7207
+ sshKeyAssignmentListCapability,
7267
7208
  sshKeyAssignmentStatusCapability,
7268
7209
  sshKeyDeleteCapability,
7269
7210
  sshKeyDeliveryStatus,