@ornncompute/cli 1.0.192 → 1.0.194

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,14 @@ The key supplies the existing API's required `adjustmentId`; repeating it with
242
242
  the same details returns the same grant. The admin's session supplies audit
243
243
  identity. See the [credit-adjustment contract](../../services/commerce/README.md#staff-credit-adjustments).
244
244
 
245
+ `ornn admin gifts create --amount-usd 50 [--expires-in-days N] [--note TEXT]`
246
+ creates a single-use gift link worth Ornn credits and prints its `url`. It shares
247
+ its schema and execution with MCP (`admin_gifts_create`) and Slack
248
+ (`gifts_create`). Like grant-credit, it requires an eligible human terminal and
249
+ executes immediately after printing its review of the amount, expiry (30 days
250
+ unless set, at most 365) and internal note. See the
251
+ [gift contract](../../services/commerce/README.md#gift-codes).
252
+
245
253
  `ornn admin nodes --help` lists the authorized node commands. Node health
246
254
  returns the node detail object; metrics preserve the owner `tier` and `windows`;
247
255
  logs return `data.logs` and an opaque continuation cursor in `page.next_cursor`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ornncompute/cli",
3
- "version": "1.0.192",
3
+ "version": "1.0.194",
4
4
  "description": "Command-line interface for Ornn compute access workflows.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -2,6 +2,7 @@ import { adminSupplierNetworkingHandlers } from "./admin-supplier-networking.mjs
2
2
  import { adminSshHandlers } from "./admin-ssh.mjs";
3
3
  import { adminCapacityReservationHandlers } from "./admin-capacity-reservations.mjs";
4
4
  import { adminCreditHandlers } from "./admin-credits.mjs";
5
+ import { adminGiftHandlers } from "./admin-gifts.mjs";
5
6
  import { adminEnrollmentHandlers } from "./admin-enrollment.mjs";
6
7
  import { adminNodeDiagnosticsHandlers } from "./admin-node-diagnostics.mjs";
7
8
  import { adminNodeLifecycleHandlers } from "./admin-node-lifecycle.mjs";
@@ -13,6 +14,7 @@ const handlers = [
13
14
  ...adminSshHandlers,
14
15
  ...adminCapacityReservationHandlers,
15
16
  ...adminCreditHandlers,
17
+ ...adminGiftHandlers,
16
18
  ...adminEnrollmentHandlers,
17
19
  ...adminNodeDiagnosticsHandlers,
18
20
  ...adminNodeLifecycleHandlers,
@@ -0,0 +1,51 @@
1
+ import { ADMIN_MUTATION_SAFETY, AdminMutationError, runAdminMutation } from "./admin-mutations.mjs";
2
+ import { parseSemanticArguments } from "./interaction-runtime.mjs";
3
+
4
+ function parseCreate(argv, capability) {
5
+ const { $positionals, amountUsd, expiresInDays, note, ...extra } = parseSemanticArguments(argv);
6
+ if ($positionals.length || Object.keys(extra).length) {
7
+ throw new AdminMutationError(`Usage: ${capability.cli.vnext.human}`);
8
+ }
9
+ const parsed = capability.input.safeParse({
10
+ amountUsd: amountUsd === undefined ? undefined : Number(amountUsd),
11
+ expiresInDays: expiresInDays === undefined ? undefined : Number(expiresInDays),
12
+ note,
13
+ });
14
+ if (!parsed.success) {
15
+ throw new AdminMutationError(`Usage: ${capability.cli.vnext.human}\n${parsed.error.message}`);
16
+ }
17
+ return {
18
+ input: parsed.data,
19
+ mutation: { safety: ADMIN_MUTATION_SAFETY.eligibleHumanOnly },
20
+ };
21
+ }
22
+
23
+ async function runCreate({ execute, input, mutation, runtime }) {
24
+ return runAdminMutation({
25
+ ...runtime,
26
+ ...mutation,
27
+ prepare: async () => ({
28
+ review: {
29
+ title: "Create a gift link",
30
+ fields: [
31
+ { label: "Amount (USD)", value: `$${input.amountUsd.toFixed(2)}` },
32
+ { label: "Expires in", value: `${input.expiresInDays} days` },
33
+ ...(input.note ? [{ label: "Note", value: input.note }] : []),
34
+ ],
35
+ consequence:
36
+ "Creates a single-use link. Whoever claims it first adds these Ornn credits to their organization.",
37
+ },
38
+ value: input,
39
+ }),
40
+ execute: (value) => execute(value, { confirmed: true }),
41
+ });
42
+ }
43
+
44
+ export const adminGiftHandlers = [
45
+ {
46
+ capabilityId: "gifts.create",
47
+ parse: parseCreate,
48
+ run: runCreate,
49
+ safety: ADMIN_MUTATION_SAFETY.eligibleHumanOnly,
50
+ },
51
+ ];
@@ -15,6 +15,7 @@ import {
15
15
  loadPendingWorkspace,
16
16
  savePendingWorkspace,
17
17
  } from "./auth-store.mjs";
18
+ import { resolveAuthBaseUrl } from "./device-auth.mjs";
18
19
  import {
19
20
  AdminUsageError,
20
21
  adminCommandData,
@@ -765,6 +766,7 @@ function parseCapabilityInput(capability, rawInput) {
765
766
  // retains its native supplier/staff policy after the CLI staff preflight.
766
767
  const DIRECT_GATEWAY_PREFIXES = [
767
768
  "/commerce",
769
+ "/gifts",
768
770
  "/internal/v1",
769
771
  "/v1/markets",
770
772
  "/v1/orchestrator/supplier-connection-configs",
@@ -939,6 +941,7 @@ async function executeCapability(
939
941
  actor: "",
940
942
  confirmed,
941
943
  installerBaseUrl,
944
+ webBaseUrl: resolveAuthBaseUrl({ env: io.env }),
942
945
  role,
943
946
  fetch: async (path, init = {}) => {
944
947
  if (executionRuntime?.transport) return executionRuntime.transport(path, init);
@@ -323,6 +323,26 @@ function getStorageBill(request, organizationId, month, signal) {
323
323
  return request(`/v1/organizations/${encodeURIComponent(organizationId)}/storage-bill?${new URLSearchParams({ month })}`, { method: "GET", signal });
324
324
  }
325
325
 
326
+ // ../../packages/api-client/dist/commerce/gifts.js
327
+ function getGift(request, code, organizationId, signal) {
328
+ return request("/gifts/lookup", {
329
+ method: "POST",
330
+ body: { code },
331
+ headers: { "X-Organization-Id": organizationId },
332
+ signal
333
+ });
334
+ }
335
+ function redeemGift(request, code, organizationId, idempotencyKey) {
336
+ return request("/gifts/redeem", {
337
+ method: "POST",
338
+ body: { code },
339
+ headers: { "X-Organization-Id": organizationId, "Idempotency-Key": idempotencyKey }
340
+ });
341
+ }
342
+ function createGift(request, body) {
343
+ return request("/gifts", { method: "POST", body });
344
+ }
345
+
326
346
  // ../../packages/api-client/dist/commerce/compute-deals.js
327
347
  var deals = "/internal/v1/gtm/compute-deals";
328
348
  var dealPath = (id2) => `${deals}/${encodeURIComponent(id2)}`;
@@ -1203,6 +1223,7 @@ export {
1203
1223
  createGTMDealComment,
1204
1224
  createGTMTask,
1205
1225
  createGTMTaskComment,
1226
+ createGift,
1206
1227
  createReservation,
1207
1228
  createSupplierAccountSession,
1208
1229
  createSupplierIntakeLink,
@@ -1252,6 +1273,7 @@ export {
1252
1273
  getGTMDealDiligence,
1253
1274
  getGTMPersonalWorkspace,
1254
1275
  getGTMTicket,
1276
+ getGift,
1255
1277
  getMarketOutlook,
1256
1278
  getReservation,
1257
1279
  getReservationHour,
@@ -1330,6 +1352,7 @@ export {
1330
1352
  patchFacility,
1331
1353
  patchReservation,
1332
1354
  recordComputeContractCapacityTransfer,
1355
+ redeemGift,
1333
1356
  relistReservation,
1334
1357
  replaceComputeContractLinePricePhases,
1335
1358
  reviewCapacityListing,
@@ -1,5 +1,11 @@
1
1
  // ../../packages/api-client/dist/orchestrator/agent-rollouts.js
2
2
  var path = "/v1/orchestrator/agent-rollouts";
3
+ function listAvailableAgentReleases(request, signal) {
4
+ return request("/v1/orchestrator/agent-releases", {
5
+ method: "GET",
6
+ signal
7
+ });
8
+ }
3
9
  function startAgentRollout(request, body) {
4
10
  return request(path, { method: "POST", body });
5
11
  }
@@ -1094,6 +1100,7 @@ export {
1094
1100
  launchReservation,
1095
1101
  listAgentRollouts,
1096
1102
  listAllEnrollmentProfiles,
1103
+ listAvailableAgentReleases,
1097
1104
  listCatalogImages,
1098
1105
  listControllers,
1099
1106
  listControlplanes,