@lifesi/genesis-cli 0.1.5 → 0.1.7

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.
@@ -49,15 +49,19 @@ export function registerHivesResources(hives, deps) {
49
49
  objects.command('download <project_id> <bucket_id> <key>').requiredOption('--output-file <path>', 'Create a new file; existing files are never overwritten').action(async (project, id, key, o) => { const response = await (await deps.client()).hives.cells.objects.download(project, id, key); const data = new Uint8Array(await response.arrayBuffer()); await writeFile(o.outputFile, data, { flag: 'wx', mode: 0o600 }); output({ saved: true, bytes: data.byteLength }); });
50
50
  cells.command('presign <project_id> <bucket_id>').requiredOption('--request-file <path>', 'Explicit GET/PUT capability request; PUT requires exact content_length').action(async (project, id, o) => output(await (await deps.client()).hives.cells.presign(project, id, await read(o.requestFile, 64 * 1024))));
51
51
  const queues = hives.command('queues').description('Buzz durable messages and possessed temporary delivery receipts');
52
+ const consumer = queues.command('consumer').description('Persisted standard-queue function binding; inspect state after an unknown mutation outcome');
53
+ for (const action of ['get', 'remove'])
54
+ consumer.command(`${action} <project_id> <queue_id>`).action(async (project, id) => output(await (await deps.client()).hives.queues.consumer[action](project, id)));
55
+ consumer.command('configure <project_id> <queue_id>').requiredOption('--request-file <path>', 'Exact existing queue delivery settings and owned active function').action(async (project, id, o) => output(await (await deps.client()).hives.queues.consumer.configure(project, id, await read(o.requestFile, 4096))));
52
56
  for (const action of ['list'])
53
57
  queues.command(`${action} <project_id>`).action(async (project) => output(await (await deps.client()).hives.queues[action](project)));
54
58
  for (const action of ['get', 'stats', 'consumers', 'pause', 'resume', 'purge', 'remove', 'dead-letter-stats', 'purge-dead-letters']) {
55
59
  const names = { 'dead-letter-stats': 'deadLetterStats', 'purge-dead-letters': 'purgeDeadLetters' };
56
60
  queues.command(`${action} <project_id> <queue_id>`).action(async (project, id) => { const client = await deps.client(); const method = action in names ? names[action] : action; output(await client.hives.queues[method](project, id)); });
57
61
  }
58
- queues.command('create <project_id>').requiredOption('--request-file <path>').action(async (project, o) => output(await (await deps.client()).hives.queues.create(project, await read(o.requestFile, 512 * 1024))));
62
+ queues.command('create <project_id>').requiredOption('--request-file <path>', 'Queue name, standard/dead_letter/fifo type and optional delivery settings').action(async (project, o) => output(await (await deps.client()).hives.queues.create(project, await read(o.requestFile, 512 * 1024))));
59
63
  queues.command('configure <project_id> <queue_id>').requiredOption('--request-file <path>').action(async (project, id, o) => output(await (await deps.client()).hives.queues.configure(project, id, await read(o.requestFile, 512 * 1024))));
60
- queues.command('send <project_id> <queue_id>').requiredOption('--request-file <path>', 'Exactly body or body_base64; decoded body 256 KiB').action(async (project, id, o) => output(await (await deps.client()).hives.queues.send(project, id, await read(o.requestFile, 512 * 1024))));
64
+ queues.command('send <project_id> <queue_id>').requiredOption('--request-file <path>', 'Exactly body or body_base64; decoded body 256 KiB. FIFO also requires message_group_id and deduplication_id').action(async (project, id, o) => output(await (await deps.client()).hives.queues.send(project, id, await read(o.requestFile, 512 * 1024))));
61
65
  queues.command('receive <project_id> <queue_id>').option('--max-messages <number>').option('--wait-seconds <number>').action(async (project, id, o) => output(await (await deps.client()).hives.queues.receive(project, id, { maxMessages: number(o.maxMessages, 1, 10), waitSeconds: number(o.waitSeconds, 0, 10) })));
62
66
  for (const action of ['ack', 'nack'])
63
67
  queues.command(`${action} <project_id> <queue_id> <message_id>`).requiredOption('--receipt-file <path>', 'JSON receiptHandle; not a credential/header/query').action(async (project, id, message, o) => { const body = await read(o.receiptFile, 4096); if (typeof body.receiptHandle !== 'string')
@@ -65,6 +69,16 @@ export function registerHivesResources(hives, deps) {
65
69
  queues.command('dead-letters <project_id> <queue_id>').option('--limit <number>').option('--offset <number>').action(async (project, id, o) => output(await (await deps.client()).hives.queues.deadLetters(project, id, { limit: number(o.limit, 1, 10), offset: number(o.offset, 0, 8192) })));
66
70
  for (const action of ['replay', 'delete-dead-letter'])
67
71
  queues.command(`${action} <project_id> <queue_id> <message_id>`).action(async (project, id, message) => output(await (await deps.client()).hives.queues[action === 'replay' ? 'replay' : 'deleteDeadLetter'](project, id, message)));
72
+ const topics = hives.command('topics').description('Owned Buzz topics; publication persists deliveries, never retries an unknown outcome');
73
+ topics.command('list <project_id>').action(async (project) => output(await (await deps.client()).hives.topics.list(project)));
74
+ for (const action of ['get', 'remove'])
75
+ topics.command(`${action} <project_id> <topic_id>`).action(async (project, id) => output(await (await deps.client()).hives.topics[action](project, id)));
76
+ topics.command('create <project_id>').requiredOption('--request-file <path>', 'JSON topic name').action(async (project, o) => output(await (await deps.client()).hives.topics.create(project, await read(o.requestFile, 4096))));
77
+ topics.command('publish <project_id> <topic_id>').requiredOption('--request-file <path>', 'Exactly body or body_base64 plus optional string attributes; no automatic retry').action(async (project, id, o) => output(await (await deps.client()).hives.topics.publish(project, id, await read(o.requestFile, 512 * 1024))));
78
+ const subscriptions = topics.command('subscriptions').description('Same-project standard queue destinations; removing a subscription retains queued messages');
79
+ subscriptions.command('list <project_id> <topic_id>').action(async (project, id) => output(await (await deps.client()).hives.topics.subscriptions.list(project, id)));
80
+ subscriptions.command('add <project_id> <topic_id> <queue_id>').action(async (project, id, queue) => output(await (await deps.client()).hives.topics.subscriptions.add(project, id, queue)));
81
+ subscriptions.command('remove <project_id> <topic_id> <subscription_id>').action(async (project, id, subscription) => output(await (await deps.client()).hives.topics.subscriptions.remove(project, id, subscription)));
68
82
  const volumes = hives.command('volumes').description('Persistent local storage; refresh saved state after an uncertain acknowledgement');
69
83
  volumes.command('list <project_id>').option('--page <number>').option('--per-page <number>').action(async (project, o) => output(await (await deps.client()).hives.volumes.list(project, { page: number(o.page, 1, 10000), per_page: number(o.perPage, 1, 100) })));
70
84
  for (const action of ['get', 'unmount', 'remove'])
package/dist/index.js CHANGED
@@ -33,7 +33,7 @@ export function buildProgram(deps = {}) {
33
33
  const auth = { ...authConfig(env, f), sleep: deps.sleep };
34
34
  const program = new Command('genesis')
35
35
  .description('One CLI for every Genesis service.')
36
- .version('0.1.5')
36
+ .version('0.1.7')
37
37
  .option('--json', 'machine-readable JSON output')
38
38
  .option('--api-key <key>', 'use this API key (default: GENESIS_API_KEY, then your `genesis login`)')
39
39
  .option('--base-url <url>', 'gateway URL (default: GENESIS_BASE_URL or https://console.life.one/api)')
@@ -49,7 +49,7 @@ export function buildProgram(deps = {}) {
49
49
  const opts = {
50
50
  apiKey: o.apiKey ?? env.GENESIS_API_KEY, token: env.GENESIS_TOKEN,
51
51
  baseUrl: o.baseUrl ?? env.GENESIS_BASE_URL, routing: o.direct || env.GENESIS_ROUTING === 'direct' ? 'direct' : 'gateway',
52
- fetch: f, userAgent: 'genesis-cli/0.1.5',
52
+ fetch: f, userAgent: 'genesis-cli/0.1.7',
53
53
  credentials: store ? savedLoginProvider(auth, store) : undefined,
54
54
  };
55
55
  return new Genesis(hivesTransport ? { ...opts, fetch: createHivesNodeTransport(opts, deps.signal) } : opts);
@@ -179,6 +179,11 @@ export function buildProgram(deps = {}) {
179
179
  });
180
180
  // ---- foundry ---------------------------------------------------------
181
181
  const foundry = program.command('foundry').description('Foundry: models and inference');
182
+ const foundryBilling = foundry.command('billing').description('Current organization’s native TEST billing; original LifeID human login required');
183
+ foundryBilling.command('profile').action(async () => out.log(JSON.stringify(await (await client()).foundry.billing.profile({ signal: deps.signal }), null, 2)));
184
+ foundryBilling.command('ensure').requiredOption('--operation-key <key>', 'Persisted operation key; reconcile unknown outcomes before retrying').action(async (o) => out.log(JSON.stringify(await (await client()).foundry.billing.ensureProfile(o.operationKey, { signal: deps.signal }), null, 2)));
185
+ foundryBilling.command('checkout').requiredOption('--purchase-key <key>', 'Persisted purchase key; server controls the TEST amount').action(async (o) => out.log(JSON.stringify(await (await client()).foundry.billing.checkoutCredits(o.purchaseKey, { signal: deps.signal }), null, 2)));
186
+ foundryBilling.command('balance').action(async () => out.log(JSON.stringify(await (await client()).foundry.billing.creditBalance({ signal: deps.signal }), null, 2)));
182
187
  foundry.command('models').action(async () => {
183
188
  const r = await (await client()).foundry.models.list();
184
189
  const rows = listOf(r).map((m) => ({ id: m.id, owned_by: m.owned_by ?? m.provider ?? '' }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifesi/genesis-cli",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/l1felabs/genesis-api.git",
@@ -18,7 +18,7 @@
18
18
  "dependencies": {
19
19
  "commander": "^14.0.0",
20
20
  "undici": "6.29.0",
21
- "@lifesi/genesis": "0.1.5"
21
+ "@lifesi/genesis": "0.1.7"
22
22
  },
23
23
  "optionalDependencies": {
24
24
  "@napi-rs/keyring": "^1.2.0"