@ornncompute/cli 1.0.223 → 1.0.225

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
@@ -242,6 +242,10 @@ credits to the organization. Find the organization with the directory commands
242
242
  above. Like admin reservation creation, it requires an eligible human terminal
243
243
  and executes immediately after validating the organization, USD amount, note,
244
244
  and UUID.
245
+ Add `--direction debit` to remove credits; the displayed review then says removal.
246
+ `--direction credit` and omitted direction add credits. Read both kinds with
247
+ `ornn admin organizations credit-adjustments --organization UUID`, using the same
248
+ read as MCP and Slack.
245
249
  The key supplies the existing API's required `adjustmentId`; repeating it with
246
250
  the same details returns the same grant. The admin's session supplies audit
247
251
  identity. See the [credit-adjustment contract](../../services/commerce/README.md#staff-credit-adjustments).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ornncompute/cli",
3
- "version": "1.0.223",
3
+ "version": "1.0.225",
4
4
  "description": "Command-line interface for Ornn compute access workflows.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -2,7 +2,7 @@ import { ADMIN_MUTATION_SAFETY, AdminMutationError, runAdminMutation } from "./a
2
2
  import { parseSemanticArguments } from "./interaction-runtime.mjs";
3
3
 
4
4
  function parseGrant(argv, capability) {
5
- const { $positionals, organization, amountCents, note, idempotencyKey, ...extra } =
5
+ const { $positionals, organization, amountCents, direction, note, idempotencyKey, ...extra } =
6
6
  parseSemanticArguments(argv);
7
7
  if ($positionals.length || Object.keys(extra).length) {
8
8
  throw new AdminMutationError(`Usage: ${capability.cli.vnext.human}`);
@@ -11,6 +11,7 @@ function parseGrant(argv, capability) {
11
11
  organizationId: organization,
12
12
  adjustmentId: idempotencyKey,
13
13
  amountCents: amountCents === undefined ? undefined : Number(amountCents),
14
+ direction,
14
15
  note,
15
16
  });
16
17
  if (!parsed.success) {
@@ -31,14 +32,17 @@ async function runGrant({ execute, input, mutation, runtime }) {
31
32
  ...mutation,
32
33
  prepare: async () => ({
33
34
  review: {
34
- title: "Grant Ornn credits",
35
+ title: input.direction === "debit" ? "Remove Ornn credits" : "Grant Ornn credits",
35
36
  fields: [
36
37
  { label: "Customer organization", value: input.organizationId },
37
38
  { label: "Amount (USD)", value: `$${(input.amountCents / 100).toFixed(2)}` },
38
39
  { label: "Note", value: input.note },
39
40
  { label: "Grant UUID", value: input.adjustmentId },
40
41
  ],
41
- consequence: "Adds spendable Ornn credits to the selected organization.",
42
+ consequence:
43
+ input.direction === "debit"
44
+ ? "Removes spendable Ornn credits from the selected organization."
45
+ : "Adds spendable Ornn credits to the selected organization.",
42
46
  },
43
47
  value: input,
44
48
  }),
@@ -211,6 +211,7 @@ function parseAdminInput(capability, argv) {
211
211
  if (options.organization && ["users.list", "organization.invite"].includes(capability.id)) {
212
212
  input.organization_id = options.organization;
213
213
  }
214
+ if (capability.id === "credits.adjustments.list") input.organizationId = options.organization;
214
215
  if (options.facility) input.facility_id = options.facility;
215
216
  if (options.status) input.status = options.status;
216
217
  if (options.email) input.email = options.email;
@@ -1,26 +1,16 @@
1
- // ../../packages/api-client/dist/orchestrator/agent-rollouts.js
2
- var path = "/v1/orchestrator/agent-rollouts";
1
+ // ../../packages/api-client/dist/orchestrator/agent-updates.js
3
2
  function listAvailableAgentReleases(request, signal) {
4
3
  return request("/v1/orchestrator/agent-releases", {
5
4
  method: "GET",
6
5
  signal
7
6
  });
8
7
  }
9
- function startAgentRollout(request, body) {
10
- return request(path, { method: "POST", body });
11
- }
12
- function listAgentRollouts(request, signal) {
13
- return request(path, { method: "GET", ...signal ? { signal } : {} });
14
- }
15
- function getAgentRollout(request, id, signal) {
16
- return request(`${path}/${encodeURIComponent(id)}`, {
17
- method: "GET",
18
- ...signal ? { signal } : {}
8
+ function requestAgentUpdate(request, nodeId, body) {
9
+ return request(`/v1/orchestrator/nodes/${encodeURIComponent(nodeId)}/update`, {
10
+ method: "POST",
11
+ body
19
12
  });
20
13
  }
21
- async function cancelAgentRollout(request, id) {
22
- await request(`${path}/${encodeURIComponent(id)}/cancel`, { method: "POST" });
23
- }
24
14
 
25
15
  // ../../packages/api-client/dist/orchestrator/catalog.js
26
16
  var hardwareCatalogPath = "/v1/orchestrator/catalog/hardware";
@@ -178,8 +168,8 @@ function teardownController(request, id, { tenant_id, ...options } = {}) {
178
168
  });
179
169
  }
180
170
  function controllerWorkerPath(id, resource, workerId, tenantId) {
181
- const path6 = `${controllerPath(id)}/${resource}/${encodeURIComponent(workerId)}`;
182
- return tenantId === void 0 ? path6 : `${path6}?${new URLSearchParams({ tenant_id: tenantId })}`;
171
+ const path5 = `${controllerPath(id)}/${resource}/${encodeURIComponent(workerId)}`;
172
+ return tenantId === void 0 ? path5 : `${path5}?${new URLSearchParams({ tenant_id: tenantId })}`;
183
173
  }
184
174
  function addControllerNode(request, id, nodeId, { tenant_id, ...options } = {}) {
185
175
  return request(controllerWorkerPath(id, "nodes", nodeId, tenant_id), {
@@ -207,24 +197,24 @@ function removeControllerVirtualMachine(request, id, virtualMachineId, { tenant_
207
197
  }
208
198
 
209
199
  // ../../packages/api-client/dist/orchestrator/controlplanes.js
210
- var path2 = "/v1/orchestrator/controlplanes";
200
+ var path = "/v1/orchestrator/controlplanes";
211
201
  function listControlplanes(request, signal) {
212
- return request(path2, {
202
+ return request(path, {
213
203
  method: "GET",
214
204
  ...signal ? { signal } : {}
215
205
  });
216
206
  }
217
207
  function setControlplaneSize(request, controllerId, body) {
218
- return request(`${path2}/${encodeURIComponent(controllerId)}/size`, {
208
+ return request(`${path}/${encodeURIComponent(controllerId)}/size`, {
219
209
  method: "POST",
220
210
  body
221
211
  });
222
212
  }
223
213
  function controlplaneSplashPath(replicaIp) {
224
- return `${path2}/${encodeURIComponent(replicaIp)}/`;
214
+ return `${path}/${encodeURIComponent(replicaIp)}/`;
225
215
  }
226
216
  function controlplaneDownloadPath(query) {
227
- return `${path2}/download?${new URLSearchParams(query)}`;
217
+ return `${path}/download?${new URLSearchParams(query)}`;
228
218
  }
229
219
 
230
220
  // ../../packages/api-client/dist/orchestrator/disks.js
@@ -283,20 +273,20 @@ function importDisk(request, body) {
283
273
  function drivePath(id) {
284
274
  return `/v1/orchestrator/drives/${encodeURIComponent(id)}`;
285
275
  }
286
- function filePath(path6) {
287
- return path6.replace(/\\/g, "/").split("/").filter(Boolean).map(encodeURIComponent).join("/");
276
+ function filePath(path5) {
277
+ return path5.replace(/\\/g, "/").split("/").filter(Boolean).map(encodeURIComponent).join("/");
288
278
  }
289
- function driveFilePath(id, path6) {
290
- return `${drivePath(id)}/files/${filePath(path6)}`;
279
+ function driveFilePath(id, path5) {
280
+ return `${drivePath(id)}/files/${filePath(path5)}`;
291
281
  }
292
282
  function driveArchivePath(id) {
293
283
  return `${drivePath(id)}/archive`;
294
284
  }
295
- function driveFolderArchivePath(id, path6) {
296
- return `${drivePath(id)}/folders/${filePath(path6)}/archive`;
285
+ function driveFolderArchivePath(id, path5) {
286
+ return `${drivePath(id)}/folders/${filePath(path5)}/archive`;
297
287
  }
298
- function downloadDriveFile(fetch, id, path6, signal) {
299
- return fetch(driveFilePath(id, path6), { method: "GET", ...signal ? { signal } : {} });
288
+ function downloadDriveFile(fetch, id, path5, signal) {
289
+ return fetch(driveFilePath(id, path5), { method: "GET", ...signal ? { signal } : {} });
300
290
  }
301
291
  function listDriveContents(request, id, query = {}, signal) {
302
292
  const params = new URLSearchParams();
@@ -309,11 +299,11 @@ function listDriveContents(request, id, query = {}, signal) {
309
299
  ...signal ? { signal } : {}
310
300
  });
311
301
  }
312
- function deleteDriveFile(request, id, path6) {
313
- return request(driveFilePath(id, path6), { method: "DELETE" });
302
+ function deleteDriveFile(request, id, path5) {
303
+ return request(driveFilePath(id, path5), { method: "DELETE" });
314
304
  }
315
- function deleteDriveFolder(request, id, path6) {
316
- return request(`${drivePath(id)}/folders/${filePath(path6)}`, { method: "DELETE" });
305
+ function deleteDriveFolder(request, id, path5) {
306
+ return request(`${drivePath(id)}/folders/${filePath(path5)}`, { method: "DELETE" });
317
307
  }
318
308
  function clearDriveContents(request, id) {
319
309
  return request(`${drivePath(id)}/contents`, { method: "DELETE" });
@@ -339,13 +329,13 @@ function keepDriveUploadsAlive(request, id) {
339
329
  }
340
330
 
341
331
  // ../../packages/api-client/dist/orchestrator/drives.js
342
- function queryPath(path6, query) {
332
+ function queryPath(path5, query) {
343
333
  const params = new URLSearchParams();
344
334
  for (const [key, value] of Object.entries(query)) {
345
335
  if (value !== void 0 && value !== null)
346
336
  params.set(key, String(value));
347
337
  }
348
- return `${path6}${params.size ? `?${params}` : ""}`;
338
+ return `${path5}${params.size ? `?${params}` : ""}`;
349
339
  }
350
340
  function listDrives(request, query = {}, signal) {
351
341
  return request(queryPath("/v1/orchestrator/drives", query), {
@@ -795,26 +785,26 @@ function shellSessionAttachPath(id) {
795
785
  }
796
786
 
797
787
  // ../../packages/api-client/dist/orchestrator/ssh-bastions.js
798
- var path3 = "/v1/orchestrator/ssh-bastions";
788
+ var path2 = "/v1/orchestrator/ssh-bastions";
799
789
  function listSshBastions(request, query, signal) {
800
790
  const params = new URLSearchParams({ organization_id: query.organization_id });
801
791
  if (query.after !== void 0)
802
792
  params.set("after", query.after);
803
793
  if (query.limit !== void 0)
804
794
  params.set("limit", String(query.limit));
805
- return request(`${path3}?${params}`, { method: "GET", ...signal ? { signal } : {} });
795
+ return request(`${path2}?${params}`, { method: "GET", ...signal ? { signal } : {} });
806
796
  }
807
797
  function createSshBastion(request, body) {
808
- return request(path3, { method: "POST", body });
798
+ return request(path2, { method: "POST", body });
809
799
  }
810
800
  function updateSshBastion(request, id, body) {
811
- return request(`${path3}/${encodeURIComponent(id)}`, {
801
+ return request(`${path2}/${encodeURIComponent(id)}`, {
812
802
  method: "PUT",
813
803
  body
814
804
  });
815
805
  }
816
806
  async function deleteSshBastion(request, id, query) {
817
- await request(`${path3}/${encodeURIComponent(id)}?${new URLSearchParams(query)}`, {
807
+ await request(`${path2}/${encodeURIComponent(id)}?${new URLSearchParams(query)}`, {
818
808
  method: "DELETE"
819
809
  });
820
810
  }
@@ -823,13 +813,13 @@ async function deleteSshBastion(request, id, query) {
823
813
  var storageEventsPath = "/v1/orchestrator/storage/ws";
824
814
 
825
815
  // ../../packages/api-client/dist/orchestrator/storage-usage.js
826
- function queryPath2(path6, query) {
816
+ function queryPath2(path5, query) {
827
817
  const params = new URLSearchParams();
828
818
  for (const [key, value] of Object.entries(query)) {
829
819
  if (value !== void 0)
830
820
  params.set(key, String(value));
831
821
  }
832
- return `${path6}${params.size ? `?${params}` : ""}`;
822
+ return `${path5}${params.size ? `?${params}` : ""}`;
833
823
  }
834
824
  function listStorageInventory(request, query = {}, signal) {
835
825
  return request(queryPath2("/v1/staff/storage/volumes", query), {
@@ -851,9 +841,9 @@ function getOrganizationStorageUsage(request, organizationId, query, signal) {
851
841
  }
852
842
 
853
843
  // ../../packages/api-client/dist/orchestrator/supplier-gateways.js
854
- var path4 = "/v1/orchestrator/supplier-gateways";
844
+ var path3 = "/v1/orchestrator/supplier-gateways";
855
845
  function createSupplierGateway(request, body) {
856
- return request(path4, { method: "POST", body });
846
+ return request(path3, { method: "POST", body });
857
847
  }
858
848
  function listSupplierGatewayRegions(request, signal) {
859
849
  return request("/v1/orchestrator/supplier-gateway-regions", {
@@ -862,13 +852,13 @@ function listSupplierGatewayRegions(request, signal) {
862
852
  });
863
853
  }
864
854
  function getSupplierGateway(request, id, signal) {
865
- return request(`${path4}/${encodeURIComponent(id)}`, {
855
+ return request(`${path3}/${encodeURIComponent(id)}`, {
866
856
  method: "GET",
867
857
  ...signal ? { signal } : {}
868
858
  });
869
859
  }
870
860
  function registerSupplierGateway(request, body) {
871
- return request(`${path4}/register`, { method: "POST", body });
861
+ return request(`${path3}/register`, { method: "POST", body });
872
862
  }
873
863
  function configureEnrollmentConnection(request, body) {
874
864
  return request("/v1/orchestrator/enrollment/configurable/connection", {
@@ -884,7 +874,7 @@ function verifyEnrollmentConnection(request) {
884
874
  }
885
875
 
886
876
  // ../../packages/api-client/dist/orchestrator/supplier-connection-configs.js
887
- var path5 = "/v1/orchestrator/supplier-connection-configs";
877
+ var path4 = "/v1/orchestrator/supplier-connection-configs";
888
878
  function listSupplierConnectionTypes(request, signal) {
889
879
  return request("/v1/orchestrator/supplier-connection-types", {
890
880
  method: "GET",
@@ -901,28 +891,28 @@ function listSupplierConnectionConfigs(request, query = {}, signal) {
901
891
  params.set("after", query.after);
902
892
  if (query.limit !== void 0)
903
893
  params.set("limit", String(query.limit));
904
- return request(`${path5}${params.size ? `?${params}` : ""}`, {
894
+ return request(`${path4}${params.size ? `?${params}` : ""}`, {
905
895
  method: "GET",
906
896
  ...signal ? { signal } : {}
907
897
  });
908
898
  }
909
899
  function getSupplierConnectionConfig(request, id, signal) {
910
- return request(`${path5}/${encodeURIComponent(id)}`, {
900
+ return request(`${path4}/${encodeURIComponent(id)}`, {
911
901
  method: "GET",
912
902
  ...signal ? { signal } : {}
913
903
  });
914
904
  }
915
905
  function createSupplierConnectionConfig(request, body) {
916
- return request(path5, { method: "POST", body });
906
+ return request(path4, { method: "POST", body });
917
907
  }
918
908
  function patchSupplierConnectionConfig(request, id, body) {
919
- return request(`${path5}/${encodeURIComponent(id)}`, {
909
+ return request(`${path4}/${encodeURIComponent(id)}`, {
920
910
  method: "PATCH",
921
911
  body
922
912
  });
923
913
  }
924
914
  function deleteSupplierConnectionConfig(request, id) {
925
- return request(`${path5}/${encodeURIComponent(id)}`, { method: "DELETE" });
915
+ return request(`${path4}/${encodeURIComponent(id)}`, { method: "DELETE" });
926
916
  }
927
917
 
928
918
  // ../../packages/api-client/dist/orchestrator/supplier-node-configs.js
@@ -1046,7 +1036,6 @@ export {
1046
1036
  addControllerVirtualMachine,
1047
1037
  addReservationSshKey,
1048
1038
  assignNode,
1049
- cancelAgentRollout,
1050
1039
  cancelDriveUpload,
1051
1040
  cancelEnrollmentRun,
1052
1041
  clearDriveContents,
@@ -1096,7 +1085,6 @@ export {
1096
1085
  enrollmentTokensPath,
1097
1086
  fakeEnroll,
1098
1087
  geolocate,
1099
- getAgentRollout,
1100
1088
  getContainerRegistry,
1101
1089
  getControllerAccess,
1102
1090
  getCurrentShellSession,
@@ -1133,7 +1121,6 @@ export {
1133
1121
  keepDriveUploadsAlive,
1134
1122
  launchEnrollmentRun,
1135
1123
  launchReservation,
1136
- listAgentRollouts,
1137
1124
  listAllEnrollmentProfiles,
1138
1125
  listAvailableAgentReleases,
1139
1126
  listCatalogImages,
@@ -1191,6 +1178,7 @@ export {
1191
1178
  remoteRunPath,
1192
1179
  removeControllerNode,
1193
1180
  removeControllerVirtualMachine,
1181
+ requestAgentUpdate,
1194
1182
  reservationEventsPath,
1195
1183
  revokeEnrollmentToken,
1196
1184
  rotateEnrollmentAdminSshKey,
@@ -1198,7 +1186,6 @@ export {
1198
1186
  saveServicingRequirement,
1199
1187
  setControlplaneSize,
1200
1188
  shellSessionAttachPath,
1201
- startAgentRollout,
1202
1189
  startDiskUpload,
1203
1190
  startDriveUpload,
1204
1191
  startGitHubConnection,