@ornncompute/cli 1.0.72 → 1.0.75
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 +24 -20
- package/package.json +1 -1
- package/src/admin-capacity-reservations.mjs +2 -12
- package/src/admin-command-handlers.mjs +0 -1
- package/src/admin-credits.mjs +1 -2
- package/src/admin-enrollment.mjs +22 -30
- package/src/admin-mutations.mjs +6 -56
- package/src/admin-node-diagnostics.mjs +2 -36
- package/src/admin-node-lifecycle.mjs +25 -43
- package/src/admin-shell.mjs +39 -32
- package/src/external-bucket-commands.mjs +5 -73
- package/src/interaction-runtime.mjs +2 -37
- package/src/kubernetes-commands.mjs +9 -100
- package/src/launch-mode-handlers.mjs +0 -1
- package/src/mount-commands.mjs +25 -131
- package/src/storage-commands.mjs +2 -87
- package/src/vm-commands.mjs +9 -42
- package/vendor/capabilities/capabilities/admin-enrollment.js +18 -17
- package/vendor/capabilities/capabilities/admin-nodes-lifecycle.js +3 -101
- package/vendor/capabilities/capabilities/admin.js +3 -3
- package/vendor/capabilities/capabilities/clusters.js +3 -3
- package/vendor/capabilities/capabilities/commerce-market.js +9 -9
- package/vendor/capabilities/capabilities/compute.js +7 -7
- package/vendor/capabilities/capabilities/credits.js +7 -2
- package/vendor/capabilities/capabilities/external-buckets.js +4 -4
- package/vendor/capabilities/capabilities/fleet.js +109 -29
- package/vendor/capabilities/capabilities/market-shared.js +1 -1
- package/vendor/capabilities/capabilities/markets.js +12 -12
- package/vendor/capabilities/capabilities/mounts.js +4 -4
- package/vendor/capabilities/capabilities/networks.js +5 -5
- package/vendor/capabilities/capabilities/observability.js +49 -14
- package/vendor/capabilities/capabilities/tokens.js +5 -9
- package/vendor/capabilities/capabilities/users.js +8 -10
- package/vendor/capabilities/capabilities/volumes.js +5 -5
|
@@ -3,11 +3,8 @@ import { defineCapability, preview } from "../capability.js";
|
|
|
3
3
|
const optionalText = z.string().nullish();
|
|
4
4
|
const tokenCreateInput = z.object({
|
|
5
5
|
organization_id: z.string().min(1),
|
|
6
|
-
organizationId: optionalText,
|
|
7
6
|
facility_id: optionalText,
|
|
8
|
-
facilityId: optionalText,
|
|
9
7
|
expires_in_seconds: z.number().int().positive().nullish(),
|
|
10
|
-
expiresInSeconds: z.number().int().positive().nullish(),
|
|
11
8
|
filter: z.string().nullish(),
|
|
12
9
|
ip: optionalText,
|
|
13
10
|
installer_base: optionalText,
|
|
@@ -16,7 +13,6 @@ const tokenCreateInput = z.object({
|
|
|
16
13
|
username: optionalText,
|
|
17
14
|
port: z.number().int().min(1).max(65535).nullish(),
|
|
18
15
|
private_key: optionalText,
|
|
19
|
-
privateKey: optionalText,
|
|
20
16
|
yes: z.boolean().optional(),
|
|
21
17
|
});
|
|
22
18
|
const emptyInput = z.object({});
|
|
@@ -62,7 +58,7 @@ export const tokensCreateCapability = defineCapability({
|
|
|
62
58
|
id: "tokens.create",
|
|
63
59
|
domain: "fleet",
|
|
64
60
|
roles: ["admin"],
|
|
65
|
-
description: "Admin-only. Mint an enrollment token. Without a host this returns the curl installer. With host + private_key, orchestrator SSHs and runs that curl (same as Bulk Enroll). Never invent a command.
|
|
61
|
+
description: "Admin-only. Mint an enrollment token. Without a host this returns the curl installer. With host + private_key, orchestrator SSHs and runs that curl (same as Bulk Enroll). Never invent a command. Slack waits for a human confirm. ",
|
|
66
62
|
mutation: "preview-confirm",
|
|
67
63
|
http: { method: "POST", path: "/enrollment-tokens" },
|
|
68
64
|
slack: {
|
|
@@ -99,16 +95,16 @@ export const tokensCreateCapability = defineCapability({
|
|
|
99
95
|
input: tokenCreateInput,
|
|
100
96
|
execute: async (ctx, input) => {
|
|
101
97
|
const parsed = tokenCreateInput.parse(input);
|
|
102
|
-
const organizationId =
|
|
98
|
+
const organizationId = parsed.organization_id.trim();
|
|
103
99
|
const hosts = [
|
|
104
100
|
...(parsed.host?.trim() ? [parsed.host.trim()] : []),
|
|
105
101
|
...(parsed.hosts ?? []).map((host) => host.trim()).filter(Boolean),
|
|
106
102
|
];
|
|
107
|
-
const privateKey = parsed.private_key?.trim() ||
|
|
103
|
+
const privateKey = parsed.private_key?.trim() || "";
|
|
108
104
|
const payload = {
|
|
109
105
|
organization_id: organizationId,
|
|
110
|
-
facility_id: parsed.facility_id
|
|
111
|
-
expires_in_seconds: parsed.expires_in_seconds
|
|
106
|
+
facility_id: parsed.facility_id,
|
|
107
|
+
expires_in_seconds: parsed.expires_in_seconds,
|
|
112
108
|
filter: parsed.filter,
|
|
113
109
|
ip: parsed.ip,
|
|
114
110
|
hosts,
|
|
@@ -17,12 +17,7 @@ export const usersListInput = z.object({
|
|
|
17
17
|
offset: directoryOffset,
|
|
18
18
|
});
|
|
19
19
|
function directoryPath(input) {
|
|
20
|
-
const params = [
|
|
21
|
-
`limit=${input.limit}`,
|
|
22
|
-
`offset=${input.offset}`,
|
|
23
|
-
"sort=name",
|
|
24
|
-
"direction=asc",
|
|
25
|
-
];
|
|
20
|
+
const params = [`limit=${input.limit}`, `offset=${input.offset}`, "sort=name", "direction=asc"];
|
|
26
21
|
if (input.q)
|
|
27
22
|
params.push(`q=${encodeURIComponent(input.q)}`);
|
|
28
23
|
if (input.role)
|
|
@@ -51,7 +46,7 @@ export const organizationListCapability = defineCapability({
|
|
|
51
46
|
id: "organization.list",
|
|
52
47
|
domain: "users",
|
|
53
48
|
roles: ["admin"],
|
|
54
|
-
description: "List organizations from the Authorization directory. Search by company name, contact/member name, or email; filter by role, approval, or UUIDs. Use the organization id as organizationId when recording downtime, and ask the user to choose if matches are ambiguous.",
|
|
49
|
+
description: "List organizations from the Authorization directory. Search by company name, contact/member name, or email; filter by role, approval, or UUIDs. When next_offset is present, pass it back as offset for the next page. Use the organization id as organizationId when recording downtime, and ask the user to choose if matches are ambiguous.",
|
|
55
50
|
mutation: "read",
|
|
56
51
|
http: { method: "GET", path: "/v1/organizations" },
|
|
57
52
|
slack: {
|
|
@@ -80,7 +75,9 @@ export const organizationListCapability = defineCapability({
|
|
|
80
75
|
const parsed = organizationListInput.parse(input);
|
|
81
76
|
const limit = parsed.limit;
|
|
82
77
|
const offset = parsed.offset ?? 0;
|
|
83
|
-
const rows = (await ctx.fetch(directoryPath({ ...parsed, limit, offset }), {
|
|
78
|
+
const rows = (await ctx.fetch(directoryPath({ ...parsed, limit, offset }), {
|
|
79
|
+
method: "GET",
|
|
80
|
+
}));
|
|
84
81
|
return {
|
|
85
82
|
organizations: rows.map((organization) => ({
|
|
86
83
|
id: organization.id,
|
|
@@ -101,7 +98,7 @@ export const usersListCapability = defineCapability({
|
|
|
101
98
|
id: "users.list",
|
|
102
99
|
domain: "users",
|
|
103
100
|
roles: ["admin"],
|
|
104
|
-
description: "List users who belong to an organization, from the Authorization directory. Search by person name, email, or company name; use organization_id to restrict results to one organization.",
|
|
101
|
+
description: "List users who belong to an organization, from the Authorization directory. Search by person name, email, or company name; use organization_id to restrict results to one organization. When next_offset is present, pass it back as offset for the next page.",
|
|
105
102
|
mutation: "read",
|
|
106
103
|
http: { method: "GET", path: "/v1/organizations" },
|
|
107
104
|
slack: {
|
|
@@ -139,7 +136,8 @@ export const usersListCapability = defineCapability({
|
|
|
139
136
|
return members
|
|
140
137
|
.filter((member) => !q ||
|
|
141
138
|
matchesOrganization ||
|
|
142
|
-
(member.name ?? "").toLowerCase().includes(q) ||
|
|
139
|
+
(member.name ?? "").toLowerCase().includes(q) ||
|
|
140
|
+
member.email.toLowerCase().includes(q))
|
|
143
141
|
.map((member) => ({
|
|
144
142
|
user_id: member.user_id,
|
|
145
143
|
email: member.email,
|
|
@@ -78,8 +78,8 @@ export const volumeCapabilities = [
|
|
|
78
78
|
description: "Create or rediscover a uniquely named managed volume.",
|
|
79
79
|
mutation: "preview-confirm",
|
|
80
80
|
outcome: "Create one durable volume or safely replay its normalized intent.",
|
|
81
|
-
human: "ornn volumes create --name <name> [--source <volume>] [
|
|
82
|
-
automation: "ornn volumes create --name <name> [--source <volume-id>]
|
|
81
|
+
human: "ornn volumes create --name <name> [--source <volume>] []",
|
|
82
|
+
automation: "ornn volumes create --name <name> [--source <volume-id>] --idempotency-key <key> --format json",
|
|
83
83
|
acceptedReferences: ["canonical source volume ID", "exact unique source volume name"],
|
|
84
84
|
related: ["volumes show", "volumes files upload"],
|
|
85
85
|
}),
|
|
@@ -113,7 +113,7 @@ export const volumeCapabilities = [
|
|
|
113
113
|
mutation: "preview-confirm",
|
|
114
114
|
outcome: "Delete one detached volume after explicit consent.",
|
|
115
115
|
human: "ornn volumes delete <volume>",
|
|
116
|
-
automation: "ornn volumes delete <volume-id>
|
|
116
|
+
automation: "ornn volumes delete <volume-id> --idempotency-key <key> --format json",
|
|
117
117
|
acceptedReferences: ["canonical volume ID", "exact unique volume name"],
|
|
118
118
|
review: "The volume and all of its data are permanently deleted.",
|
|
119
119
|
related: ["volume-mounts detach", "volumes show"],
|
|
@@ -135,8 +135,8 @@ export const volumeCapabilities = [
|
|
|
135
135
|
description: "Stage, upload, and finalize one local file at a nested volume path.",
|
|
136
136
|
mutation: "preview-confirm",
|
|
137
137
|
outcome: "Upload one file through a reconciled staged transfer.",
|
|
138
|
-
human: "ornn volumes files upload <volume> <local-file> [--path <remote-path>] [--content-type <type>] [
|
|
139
|
-
automation: "ornn volumes files upload <volume-id> <local-file> --path <remote-path>
|
|
138
|
+
human: "ornn volumes files upload <volume> <local-file> [--path <remote-path>] [--content-type <type>] []",
|
|
139
|
+
automation: "ornn volumes files upload <volume-id> <local-file> --path <remote-path> --idempotency-key <key> --format json",
|
|
140
140
|
acceptedReferences: ["canonical volume ID", "exact unique volume name"],
|
|
141
141
|
related: ["volumes files list", "volumes refresh"],
|
|
142
142
|
}),
|