@ornncompute/cli 1.0.75 → 1.0.97

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.
Files changed (52) hide show
  1. package/README.md +32 -5
  2. package/package.json +4 -2
  3. package/src/admin-capacity-reservations.mjs +4 -1
  4. package/src/admin-command-handlers.mjs +2 -0
  5. package/src/admin-node-diagnostics.mjs +1 -5
  6. package/src/admin-node-lifecycle.mjs +23 -125
  7. package/src/admin-node-sanitize.mjs +243 -0
  8. package/src/catalog-shell.mjs +6 -6
  9. package/src/evidence-commands.mjs +4 -6
  10. package/src/external-bucket-commands.mjs +71 -23
  11. package/src/interaction-runtime.mjs +3 -0
  12. package/src/kubernetes-commands.mjs +16 -83
  13. package/src/machine-reference.mjs +33 -56
  14. package/src/slurm-commands.mjs +13 -2
  15. package/src/vm-commands.mjs +39 -59
  16. package/vendor/api-client/commerce.js +743 -0
  17. package/vendor/capabilities/cli.js +7688 -7
  18. package/vendor/capabilities/capabilities/admin-capacity-reservations.js +0 -101
  19. package/vendor/capabilities/capabilities/admin-enrollment.js +0 -322
  20. package/vendor/capabilities/capabilities/admin-node-diagnostics.js +0 -88
  21. package/vendor/capabilities/capabilities/admin-nodes-lifecycle.js +0 -137
  22. package/vendor/capabilities/capabilities/admin.js +0 -91
  23. package/vendor/capabilities/capabilities/cli.js +0 -156
  24. package/vendor/capabilities/capabilities/clusters.js +0 -248
  25. package/vendor/capabilities/capabilities/commerce-market.js +0 -405
  26. package/vendor/capabilities/capabilities/compute.js +0 -523
  27. package/vendor/capabilities/capabilities/credits.js +0 -83
  28. package/vendor/capabilities/capabilities/evidence.js +0 -145
  29. package/vendor/capabilities/capabilities/external-buckets.js +0 -191
  30. package/vendor/capabilities/capabilities/fleet.js +0 -386
  31. package/vendor/capabilities/capabilities/identity.js +0 -129
  32. package/vendor/capabilities/capabilities/listings.js +0 -398
  33. package/vendor/capabilities/capabilities/locality.js +0 -42
  34. package/vendor/capabilities/capabilities/market-shared.js +0 -46
  35. package/vendor/capabilities/capabilities/markets.js +0 -482
  36. package/vendor/capabilities/capabilities/mounts.js +0 -176
  37. package/vendor/capabilities/capabilities/native-listing.js +0 -99
  38. package/vendor/capabilities/capabilities/networks.js +0 -1264
  39. package/vendor/capabilities/capabilities/observability.js +0 -253
  40. package/vendor/capabilities/capabilities/organization-invites.js +0 -53
  41. package/vendor/capabilities/capabilities/reservation-list.js +0 -68
  42. package/vendor/capabilities/capabilities/staff-shared.js +0 -64
  43. package/vendor/capabilities/capabilities/tokens.js +0 -161
  44. package/vendor/capabilities/capabilities/users.js +0 -157
  45. package/vendor/capabilities/capabilities/volumes.js +0 -178
  46. package/vendor/capabilities/capability.js +0 -99
  47. package/vendor/capabilities/cli-catalog.js +0 -73
  48. package/vendor/capabilities/cli-migrations.js +0 -264
  49. package/vendor/capabilities/names.js +0 -6
  50. package/vendor/capabilities/software-catalog.js +0 -82
  51. package/vendor/capabilities/spec-catalog.js +0 -151
  52. package/vendor/capabilities/supplier-directory.js +0 -20
@@ -1,145 +0,0 @@
1
- import { z } from "zod";
2
- import { defineCapability, } from "../capability.js";
3
- const positionals = z.array(z.string()).default([]);
4
- export const evidenceInput = z
5
- .object({
6
- $positionals: positionals,
7
- before: z.string().optional(),
8
- count: z.string().optional(),
9
- cursor: z.string().optional(),
10
- end: z.string().optional(),
11
- follow: z.boolean().optional(),
12
- guided: z.boolean().optional(),
13
- interval: z.string().optional(),
14
- limit: z.string().optional(),
15
- maxPoints: z.string().optional(),
16
- start: z.string().optional(),
17
- stream: z.enum(["kernel", "serial"]).optional(),
18
- timeout: z.string().optional(),
19
- })
20
- .strict();
21
- function runtime(context) {
22
- const interaction = context.cli?.interaction;
23
- if (!interaction?.evidence)
24
- throw new Error("The CLI evidence runtime is unavailable.");
25
- return interaction;
26
- }
27
- function execute(command) {
28
- return (context, input) => runtime(context).evidence(command, input, context);
29
- }
30
- function cliOnly({ automation, category, command, description, human, id, order, outcome, references, related, }) {
31
- const executor = command.length === 1 ? "check" : `${command[0]}.${command[1]}`;
32
- return defineCapability({
33
- id,
34
- domain: "observability",
35
- roles: ["user"],
36
- description,
37
- mutation: "read",
38
- input: evidenceInput,
39
- cli: {
40
- command,
41
- vnext: {
42
- arguments: "semantic",
43
- audience: "customer",
44
- category,
45
- order,
46
- outcome,
47
- human,
48
- automation,
49
- acceptedReferences: references,
50
- resumableStates: ["no data", "unavailable", "streaming", "ended", "interrupted"],
51
- related,
52
- },
53
- },
54
- mcp: false,
55
- slack: false,
56
- execute: execute(executor),
57
- });
58
- }
59
- export const checkCapability = cliOnly({
60
- id: "evidence.check",
61
- command: ["check"],
62
- category: "journey",
63
- order: 4,
64
- description: "Compose lifecycle, reachability, authoritative health, metrics, and logs for one machine or cluster.",
65
- outcome: "Check one exact machine or cluster without turning missing evidence into health.",
66
- human: "ornn check [<canonical-resource-id-or-exact-hostname>] [--follow] [--start <time> --end <time>]",
67
- automation: "ornn check <canonical-machine-or-cluster-id> --start <time> --end <time> --max-points 240 --limit 200 --format json",
68
- references: [
69
- "canonical machine ID",
70
- "exact unique machine hostname",
71
- "canonical cluster ID",
72
- "invocation-local guided choice",
73
- ],
74
- related: [
75
- "connect",
76
- "machines metrics",
77
- "machines logs",
78
- "clusters metrics",
79
- "clusters logs",
80
- "cost",
81
- ],
82
- });
83
- export const machineMetricsCapability = cliOnly({
84
- id: "evidence.machine_metrics",
85
- command: ["machines", "metrics"],
86
- category: "resource",
87
- order: 560,
88
- description: "Read or follow bounded customer-safe metrics for one exact machine.",
89
- outcome: "Return normalized machine metrics with explicit evidence state and window.",
90
- human: "ornn machines metrics [<machine-id-or-exact-hostname>] [--guided] [--start <time> --end <time>] [--max-points <1-500>] [--follow]",
91
- automation: "ornn machines metrics <canonical-machine-id> --start <time> --end <time> --max-points 240 --format json",
92
- references: [
93
- "canonical machine ID",
94
- "exact unique machine hostname",
95
- "invocation-local guided choice",
96
- ],
97
- related: ["check", "machines logs"],
98
- });
99
- export const machineLogsCapability = cliOnly({
100
- id: "evidence.machine_logs",
101
- command: ["machines", "logs"],
102
- category: "resource",
103
- order: 561,
104
- description: "Read or follow bounded customer-safe kernel or serial logs for one exact machine.",
105
- outcome: "Return normalized machine logs with opaque pagination and unsafe lines omitted.",
106
- human: "ornn machines logs [<machine-id-or-exact-hostname>] [--guided] [--stream kernel|serial] [--limit <1-500>] [--cursor <cursor>] [--follow]",
107
- automation: "ornn machines logs <canonical-machine-id> --stream kernel --limit 200 --format json",
108
- references: [
109
- "canonical machine ID",
110
- "exact unique machine hostname",
111
- "invocation-local guided choice",
112
- ],
113
- related: ["check", "machines metrics"],
114
- });
115
- export const clusterMetricsCapability = cliOnly({
116
- id: "evidence.cluster_metrics",
117
- command: ["clusters", "metrics"],
118
- category: "resource",
119
- order: 562,
120
- description: "Read or follow bounded customer-safe metrics for every member of one exact cluster.",
121
- outcome: "Return normalized per-machine cluster metrics without changing cluster health.",
122
- human: "ornn clusters metrics [<cluster-id>] [--guided] [--start <time> --end <time>] [--max-points <1-500>] [--follow]",
123
- automation: "ornn clusters metrics <canonical-cluster-id> --start <time> --end <time> --max-points 240 --format json",
124
- references: ["canonical cluster ID", "invocation-local guided choice"],
125
- related: ["check", "clusters logs"],
126
- });
127
- export const clusterLogsCapability = cliOnly({
128
- id: "evidence.cluster_logs",
129
- command: ["clusters", "logs"],
130
- category: "resource",
131
- order: 563,
132
- description: "Read or follow bounded customer-safe logs for every member of one exact cluster.",
133
- outcome: "Return normalized per-machine cluster logs without exposing staff or supplier details.",
134
- human: "ornn clusters logs [<cluster-id>] [--guided] [--stream kernel|serial] [--limit <1-500>] [--follow]",
135
- automation: "ornn clusters logs <canonical-cluster-id> --stream kernel --limit 200 --format json",
136
- references: ["canonical cluster ID", "invocation-local guided choice"],
137
- related: ["check", "clusters metrics"],
138
- });
139
- export const evidenceCapabilities = [
140
- checkCapability,
141
- machineMetricsCapability,
142
- machineLogsCapability,
143
- clusterMetricsCapability,
144
- clusterLogsCapability,
145
- ];
@@ -1,191 +0,0 @@
1
- import { z } from "zod";
2
- import { defineCapability, } from "../capability.js";
3
- const pageInput = z
4
- .object({
5
- $positionals: z.array(z.string()).optional(),
6
- cursor: z.string().optional(),
7
- limit: z.union([z.string(), z.number()]).optional(),
8
- })
9
- .strict();
10
- const showInput = z
11
- .object({
12
- $positionals: z.array(z.string()).optional(),
13
- })
14
- .strict();
15
- const verificationInput = z
16
- .object({
17
- $positionals: z.array(z.string()).optional(),
18
- idempotencyKey: z.string().optional(),
19
- })
20
- .strict();
21
- const disconnectInput = z
22
- .object({
23
- $positionals: z.array(z.string()).optional(),
24
- idempotencyKey: z.string().optional(),
25
- yes: z.boolean().optional(),
26
- })
27
- .strict();
28
- const connectInput = z
29
- .object({
30
- $positionals: z.array(z.string()).optional(),
31
- accessKeyId: z.string().optional(),
32
- accountId: z.string().optional(),
33
- bucket: z.string().optional(),
34
- endpointUrl: z.string().optional(),
35
- idempotencyKey: z.string().optional(),
36
- name: z.string().optional(),
37
- prefix: z.string().optional(),
38
- readOnly: z.boolean().optional(),
39
- readWrite: z.boolean().optional(),
40
- region: z.string().optional(),
41
- secretAccessKeyFile: z.string().optional(),
42
- url: z.string().optional(),
43
- yes: z.boolean().optional(),
44
- })
45
- .strict();
46
- const credentialInput = z
47
- .object({
48
- $positionals: z.array(z.string()).optional(),
49
- accessKeyId: z.string().optional(),
50
- idempotencyKey: z.string().optional(),
51
- secretAccessKeyFile: z.string().optional(),
52
- yes: z.boolean().optional(),
53
- })
54
- .strict();
55
- const importInput = z
56
- .object({
57
- $positionals: z.array(z.string()).optional(),
58
- idempotencyKey: z.string().optional(),
59
- noWait: z.boolean().optional(),
60
- reservation: z.string().optional(),
61
- timeout: z.string().optional(),
62
- wait: z.boolean().optional(),
63
- yes: z.boolean().optional(),
64
- })
65
- .strict();
66
- function externalBucketExecutor(context) {
67
- const interaction = context.cli?.interaction;
68
- if (!interaction?.externalBuckets) {
69
- throw new Error("This capability must execute through the Ornn CLI external-bucket runtime.");
70
- }
71
- return interaction.externalBuckets.bind(interaction);
72
- }
73
- function externalBucketCapability({ acceptedReferences = [], automation, command, description, human, id, input, mutation, outcome, related = [], resumableStates = [], review, }) {
74
- return defineCapability({
75
- id,
76
- domain: "storage",
77
- roles: ["user"],
78
- description,
79
- mutation,
80
- input,
81
- cli: {
82
- command,
83
- vnext: {
84
- arguments: "semantic",
85
- audience: "customer",
86
- category: "resource",
87
- outcome,
88
- human,
89
- automation,
90
- acceptedReferences,
91
- related,
92
- resumableStates,
93
- ...(review ? { review } : {}),
94
- },
95
- },
96
- mcp: false,
97
- slack: false,
98
- execute: async (context, commandInput) => externalBucketExecutor(context)(id, commandInput),
99
- });
100
- }
101
- const gcsImportGuidance = "GCS requires bucket-level read access for Ornn's Storage Transfer service agent, granted with gcloud. CLI 1.x GCS imports are currently blocked by unavailable source verification. Setup and version-specific steps: https://docs.ornn.com/cli#gcs-imports-and-storage-transfer-service";
102
- export const externalBucketCapabilities = [
103
- externalBucketCapability({
104
- id: "storage.external-buckets.list",
105
- command: ["external-buckets", "list"],
106
- description: "List connected GCS, S3, and R2 buckets in one bounded page.",
107
- mutation: "read",
108
- input: pageInput,
109
- outcome: "List external bucket connections without exposing stored credentials.",
110
- human: "ornn external-buckets list [--limit <1-100>] [--cursor <cursor>]",
111
- automation: "ornn external-buckets list --limit 50 --format json",
112
- related: ["external-buckets show", "external-buckets connect"],
113
- }),
114
- externalBucketCapability({
115
- id: "storage.external-buckets.show",
116
- command: ["external-buckets", "show"],
117
- description: "Inspect one connected external bucket by canonical ID or exact unique name.",
118
- mutation: "read",
119
- input: showInput,
120
- outcome: "Inspect one credential-safe external bucket connection.",
121
- human: "ornn external-buckets show <external-bucket>",
122
- automation: "ornn external-buckets show <external-bucket-id> --format json",
123
- acceptedReferences: ["canonical external bucket ID", "exact unique external bucket name"],
124
- related: ["external-buckets verify", "external-buckets import"],
125
- }),
126
- externalBucketCapability({
127
- id: "storage.external-buckets.connect",
128
- command: ["external-buckets", "connect"],
129
- description: "Connect a typed GCS, AWS S3, or Cloudflare R2 source without verifying it implicitly.",
130
- mutation: "preview-confirm",
131
- input: connectInput,
132
- outcome: "Create or rediscover one external bucket connection with verification kept separate.",
133
- 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]",
134
- automation: "ornn external-buckets connect <gcs|s3|r2> --bucket <bucket> <provider-inputs> --idempotency-key <key> --format json",
135
- review: `Review the exact source, access mode, and credential presence before connecting it. ${gcsImportGuidance}`,
136
- related: ["external-buckets verify", "external-buckets import"],
137
- }),
138
- externalBucketCapability({
139
- id: "storage.external-buckets.update-credentials",
140
- command: ["external-buckets", "update-credentials"],
141
- description: "Replace scoped S3 or R2 credentials without returning credential bytes.",
142
- mutation: "preview-confirm",
143
- input: credentialInput,
144
- outcome: "Update one connection's credentials and require a separate verification.",
145
- human: "ornn external-buckets update-credentials <external-bucket> --access-key-id <id> --secret-access-key-file <path>",
146
- automation: "ornn external-buckets update-credentials <external-bucket-id> --access-key-id <id> --secret-access-key-file <path> --idempotency-key <key> --format json",
147
- acceptedReferences: ["canonical external bucket ID", "exact unique external bucket name"],
148
- review: "Credential changes invalidate the prior verification and require renewed review.",
149
- related: ["external-buckets verify"],
150
- }),
151
- externalBucketCapability({
152
- id: "storage.external-buckets.verify",
153
- command: ["external-buckets", "verify"],
154
- description: "Verify current S3 or R2 source access as a separate operation.",
155
- mutation: "preview-confirm",
156
- input: verificationInput,
157
- outcome: "Record current source-access verification without exposing credential material.",
158
- human: "ornn external-buckets verify <external-bucket>",
159
- automation: "ornn external-buckets verify <external-bucket-id> --idempotency-key <key> --format json",
160
- acceptedReferences: ["canonical external bucket ID", "exact unique external bucket name"],
161
- review: gcsImportGuidance,
162
- related: ["external-buckets import", "external-buckets update-credentials"],
163
- }),
164
- externalBucketCapability({
165
- id: "storage.external-buckets.import",
166
- command: ["external-buckets", "import"],
167
- description: "Import a verified GCS or S3 source into its isolated managed working volume.",
168
- mutation: "preview-confirm",
169
- input: importInput,
170
- outcome: "Create or replay exactly one managed working copy with source writeback disabled.",
171
- human: "ornn external-buckets import <gcs|s3|r2> <external-bucket> --reservation <canonical-reservation-id> [--no-wait] [--timeout <duration>]",
172
- automation: "ornn external-buckets import <gcs|s3> <external-bucket-id> --reservation <canonical-reservation-id> --idempotency-key <key> [--wait --timeout <duration>] --format json",
173
- acceptedReferences: ["canonical external bucket ID", "exact unique external bucket name"],
174
- review: `Review the isolated destination and explicit no-writeback guarantee before importing. ${gcsImportGuidance}`,
175
- resumableStates: ["pending", "working", "partial", "failed", "interrupted"],
176
- related: ["external-buckets show", "storage status", "volumes files list"],
177
- }),
178
- externalBucketCapability({
179
- id: "storage.external-buckets.disconnect",
180
- command: ["external-buckets", "disconnect"],
181
- description: "Disconnect an external bucket record after its working volume is detached.",
182
- mutation: "preview-confirm",
183
- input: disconnectInput,
184
- outcome: "Remove one external source connection without writing to its source bucket.",
185
- human: "ornn external-buckets disconnect <external-bucket>",
186
- automation: "ornn external-buckets disconnect <external-bucket-id> --idempotency-key <key> --format json",
187
- acceptedReferences: ["canonical external bucket ID", "exact unique external bucket name"],
188
- review: "Disconnecting reduces access to the source and is blocked while mounts remain.",
189
- related: ["storage detach", "external-buckets show"],
190
- }),
191
- ];