@onesi/genesis-cli 0.2.8 → 0.2.10
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 +1 -1
- package/dist/fleets.js +3 -2
- package/dist/hives-marketplace.js +2 -0
- package/dist/index.js +5 -5
- package/dist/minds.js +3 -3
- package/dist/products.js +5 -1
- package/dist/relays-commands/monitoring.js +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
package/dist/fleets.js
CHANGED
|
@@ -121,9 +121,10 @@ export function registerFleets(program, client, emit, keyInput = readFoundryKey,
|
|
|
121
121
|
throw new Error('Provide --name or --borrow-ceiling.');
|
|
122
122
|
emit(await (await client()).fleets.seats.update(id, body));
|
|
123
123
|
});
|
|
124
|
-
seats.command('top-up <seat_id> <credits>').description('Add credits to the seat
|
|
124
|
+
seats.command('top-up <seat_id> <credits>').description('Add credits (0 with --computer-minutes) and optionally computer minutes to the seat (overdraft is repaid first; helpers take no minutes; pooled seats: top up the pool)')
|
|
125
|
+
.option('--computer-minutes <minutes>', 'add computer minutes to the seat entitlement')
|
|
125
126
|
.requiredOption('--idempotency-key <key>', 'stable key to reuse on retry')
|
|
126
|
-
.action(async (id, credits, options) => emit(await (await client()).fleets.seats.topUp(id, count(credits), options.idempotencyKey)));
|
|
127
|
+
.action(async (id, credits, options) => emit(await (await client()).fleets.seats.topUp(id, count(credits), options.idempotencyKey, options.computerMinutes !== undefined ? count(options.computerMinutes) : undefined)));
|
|
127
128
|
seats.command('upgrade <seat_id> <type>').description('Move to a larger plan (no downgrade)')
|
|
128
129
|
.action(async (id, type) => emit(await (await client()).fleets.seats.upgrade(id, seatType(type))));
|
|
129
130
|
seats.command('hold <seat_id>').description('No new work; a running task is cancelled with a signed receipt').action(async (id) => emit(await (await client()).fleets.seats.hold(id)));
|
|
@@ -19,6 +19,8 @@ export function registerHivesMarketplace(hives, deps) {
|
|
|
19
19
|
m.command(`${action} <project_id>`).action(async (project) => output(await (await api())[action](project)));
|
|
20
20
|
m.command('publish <project_id>').requiredOption('--request-file <path>', 'JSON publication with an owned uploaded module_hash and immutable version')
|
|
21
21
|
.action(async (project, o) => output(await (await api()).publish(project, await read(o.requestFile, 512 * 1024))));
|
|
22
|
+
m.command('unpublish <project_id> <slug>').description('Archive an owned package: existing installs keep running; no new install, update or version')
|
|
23
|
+
.action(async (project, slug) => output(await (await api()).unpublish(project, slug)));
|
|
22
24
|
for (const action of ['install', 'update'])
|
|
23
25
|
m.command(`${action} <project_id> <slug>`).requiredOption('--request-file <path>', 'JSON version and env_overrides; use {} for defaults')
|
|
24
26
|
.action(async (project, slug, o) => output(await (await api())[action](project, slug, await read(o.requestFile, 512 * 1024))));
|
package/dist/index.js
CHANGED
|
@@ -47,7 +47,7 @@ export function buildProgram(deps = {}) {
|
|
|
47
47
|
const auth = { ...authConfig(env, f), sleep: deps.sleep };
|
|
48
48
|
const program = new Command('genesis')
|
|
49
49
|
.description('One CLI for every Genesis service.')
|
|
50
|
-
.version('0.2.
|
|
50
|
+
.version('0.2.10')
|
|
51
51
|
.option('--json', 'machine-readable JSON output')
|
|
52
52
|
.option('--api-key <key>', 'use this API key (default: GENESIS_API_KEY, then your `genesis login`)')
|
|
53
53
|
.option('--base-url <url>', 'gateway URL (default: GENESIS_BASE_URL or https://os.one.ml/api)')
|
|
@@ -63,7 +63,7 @@ export function buildProgram(deps = {}) {
|
|
|
63
63
|
const opts = {
|
|
64
64
|
apiKey: o.apiKey ?? env.GENESIS_API_KEY, token: env.GENESIS_TOKEN,
|
|
65
65
|
baseUrl: o.baseUrl ?? env.GENESIS_BASE_URL, routing: o.direct || env.GENESIS_ROUTING === 'direct' ? 'direct' : 'gateway',
|
|
66
|
-
fetch: f, userAgent: 'genesis-cli/0.2.
|
|
66
|
+
fetch: f, userAgent: 'genesis-cli/0.2.10',
|
|
67
67
|
credentials: store ? savedLoginProvider(auth, store) : undefined,
|
|
68
68
|
};
|
|
69
69
|
return new Genesis(hivesTransport ? { ...opts, fetch: createHivesNodeTransport(opts, deps.signal) } : opts);
|
|
@@ -284,7 +284,7 @@ export function buildProgram(deps = {}) {
|
|
|
284
284
|
if (!key)
|
|
285
285
|
throw new Error('Give the enrollment key with --key-file, --key-stdin or GENESIS_ENROLLMENT_KEY; it is never accepted as an argument.');
|
|
286
286
|
const body = await readFunctionJson(o.bodyFile, 16 * 1024);
|
|
287
|
-
const result = await new Genesis({ baseUrl: g().baseUrl ?? env.GENESIS_BASE_URL, fetch: f, userAgent: 'genesis-cli/0.2.
|
|
287
|
+
const result = await new Genesis({ baseUrl: g().baseUrl ?? env.GENESIS_BASE_URL, fetch: f, userAgent: 'genesis-cli/0.2.10' }).iam.agents.enroll(key, body);
|
|
288
288
|
emit(result, () => JSON.stringify(result, null, 2));
|
|
289
289
|
});
|
|
290
290
|
// ---- auth ------------------------------------------------------------
|
|
@@ -413,7 +413,7 @@ export function buildProgram(deps = {}) {
|
|
|
413
413
|
// ---- foundry ---------------------------------------------------------
|
|
414
414
|
// registerProducts (above) already added the generated `foundry` commands; the hand-written ones join them.
|
|
415
415
|
const foundry = program.commands.find(c => c.name() === 'foundry') ?? program.command('foundry').description('Foundry: models and inference');
|
|
416
|
-
const foundryBilling = foundry.command('billing').description('Current organization’s native TEST billing; original One account human login
|
|
416
|
+
const foundryBilling = foundry.command('billing').description('Current organization’s native TEST billing: profile and balance with a login or an org API key holding genesis.billing.read; ensure and checkout need the original One account human login');
|
|
417
417
|
foundryBilling.command('profile').action(async () => out.log(JSON.stringify(await (await client()).foundry.billing.profile({ signal: deps.signal }), null, 2)));
|
|
418
418
|
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)));
|
|
419
419
|
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)));
|
|
@@ -836,7 +836,7 @@ export function buildProgram(deps = {}) {
|
|
|
836
836
|
const url = `${base.href.replace(/\/+$/, '')}/v1/status`;
|
|
837
837
|
let response;
|
|
838
838
|
try {
|
|
839
|
-
response = await f(url, { method: 'GET', headers: { accept: 'application/json', 'user-agent': 'genesis-cli/0.2.
|
|
839
|
+
response = await f(url, { method: 'GET', headers: { accept: 'application/json', 'user-agent': 'genesis-cli/0.2.10' }, signal: AbortSignal.timeout(15_000) });
|
|
840
840
|
}
|
|
841
841
|
catch (e) {
|
|
842
842
|
throw new Error(`Gateway unreachable at ${safe(url)}: ${safe(e.message)}`);
|
package/dist/minds.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Option } from 'commander';
|
|
|
4
4
|
import { mindsServices } from '@onesi/genesis';
|
|
5
5
|
export function registerMinds(program, client, emit, agentClient = client, signal, ownerClient = client) {
|
|
6
6
|
// `minds engine ...` (generated, products.ts) may already have created the root.
|
|
7
|
-
const minds = (program.commands.find(c => c.name() === 'minds') ?? program.command('minds')).description('Owned Minds and persisted memory; a human Console Sandbox
|
|
7
|
+
const minds = (program.commands.find(c => c.name() === 'minds') ?? program.command('minds')).description('Owned Minds and persisted memory; a human Console session (Sandbox, or Live), or an org API key with minds:read/minds:write/minds:manage; the key or login binding selects the environment');
|
|
8
8
|
registerMindsOwner(minds, ownerClient, emit, signal);
|
|
9
9
|
minds.command('list').option('--after <uuid>').option('--limit <number>').description('List real Minds and the current creation context fingerprint').action(async (options) => {
|
|
10
10
|
emit(await (await client()).minds.list({ ...(options.after ? { after: options.after } : {}), ...(options.limit ? { limit: Number(options.limit) } : {}) }));
|
|
@@ -14,7 +14,7 @@ export function registerMinds(program, client, emit, agentClient = client, signa
|
|
|
14
14
|
.requiredOption('--from <timestamp>', 'RFC3339 window start')
|
|
15
15
|
.requiredOption('--to <timestamp>', 'RFC3339 window end')
|
|
16
16
|
.action(async (options) => emit(await (await client()).minds.usage({ from: options.from, to: options.to })));
|
|
17
|
-
minds.command('create <name>').description('Create a Sandbox Mind; Free/F1 by default or an admitted Pro profile; 202 means provisioning')
|
|
17
|
+
minds.command('create <name>').description('Create a Mind in the selected environment (a Sandbox Mind is named "Sandbox ..."; Live needs Minds Live and your organization admitted); Free/F1 by default or an admitted Pro profile; 202 means provisioning')
|
|
18
18
|
.requiredOption('--idempotency-key <uuid>', 'persist this UUID4 and retain it after an uncertain response')
|
|
19
19
|
.requiredOption('--context-sha256 <hash>', 'context_sha256 from the current minds list response')
|
|
20
20
|
.addOption(new Option('--plan <plan>', 'explicit plan; entitlement remains server-authorized').choices(['free', 'pro']))
|
|
@@ -39,7 +39,7 @@ export function registerMinds(program, client, emit, agentClient = client, signa
|
|
|
39
39
|
.requiredOption('--expected-generation <number>', 'desired_generation from a fresh owned Mind read')
|
|
40
40
|
.requiredOption('--idempotency-key <uuid>', 'persist this UUID4 and original generation; no automatic retry')
|
|
41
41
|
.action(async (id, options) => emit(await (await client()).minds.delete(id, Number(options.expectedGeneration), { idempotencyKey: options.idempotencyKey })));
|
|
42
|
-
minds.command('resize <mind_id>').description('Resize to an existing Pro profile
|
|
42
|
+
minds.command('resize <mind_id>').description('Resize to an existing Pro profile; org API keys with minds:manage only (Console sessions are refused with MINDS_MANAGE_KEY_REQUIRED); 202 means accepted')
|
|
43
43
|
.requiredOption('--expected-generation <number>', 'desired_generation from a fresh owned Mind read')
|
|
44
44
|
.addOption(new Option('--profile-id <profile>', 'existing Pro profile').choices(['F1', 'D1', 'D2']).makeOptionMandatory())
|
|
45
45
|
.requiredOption('--idempotency-key <uuid>', 'persist this UUID4 and original generation; no automatic retry')
|
package/dist/products.js
CHANGED
|
@@ -39,6 +39,10 @@ export const PRODUCT_COMMANDS = {
|
|
|
39
39
|
'quotas get': 'gateway_getOrgQuotas', 'quotas requests list': 'gateway_listQuotaRequests', 'quotas requests create': 'gateway_createQuotaRequest',
|
|
40
40
|
'minds-account': 'gateway_getMindsAccount', invoices: 'gateway_listOrgInvoices', 'usage-report': 'gateway_getOrgUsageReport', catalog: 'gateway_listBillingServices',
|
|
41
41
|
} },
|
|
42
|
+
credits: { description: 'Your One credits: balance, ledger, usage, settings, checkout and subscription (login session, or an org API key with genesis.billing.read / .manage). Stripe test mode: checkout opens checkout.stripe.com and nothing is charged until you pay there.', commands: {
|
|
43
|
+
balance: 'gateway_getCredits', entries: 'gateway_listCreditEntries', usage: 'gateway_listCreditUsage', settings: 'gateway_updateCreditSettings',
|
|
44
|
+
checkout: 'gateway_createCreditCheckout', subscription: 'gateway_changeCreditSubscription', cancel: 'gateway_cancelCreditSubscription',
|
|
45
|
+
} },
|
|
42
46
|
gears: { description: 'Gears: durable workflows, runs, signals and run lifecycle', commands: {
|
|
43
47
|
'workflows list': 'gears_listWorkflows', 'workflows get': 'gears_getWorkflow', 'workflows register': 'gears_registerWorkflow',
|
|
44
48
|
'runs list': 'gears_listRuns', 'runs get': 'gears_getRun', 'runs history': 'gears_getRunHistory',
|
|
@@ -235,7 +239,7 @@ export const PRODUCT_COMMANDS = {
|
|
|
235
239
|
'lineage requests list': 'taps_listAgentLineageRequests', 'lineage requests get': 'taps_getAgentLineageRequest',
|
|
236
240
|
} },
|
|
237
241
|
// `genesis minds engine <family> <verb> <mind_id> [params]`: every Minds engine route, generated from the grant table.
|
|
238
|
-
minds: { description: 'Minds: your
|
|
242
|
+
minds: { description: 'Minds: your Minds in the selected environment (One account login)', commands: mindsEngineCommands },
|
|
239
243
|
boxes: { description: 'Boxes: mail, docs, files, sheets, slides, calendar and identity (org API key; GET boxes:read, writes boxes:write, mail domains boxes:admin)', commands: {
|
|
240
244
|
// boxes:begin
|
|
241
245
|
'mail addresses create': 'boxes_mail_addresses_create',
|
|
@@ -37,5 +37,6 @@ export const monitoringCommands = {
|
|
|
37
37
|
'status-pages incidents list': 'relays_listStatusPageIncidents',
|
|
38
38
|
'status-pages incidents create': 'relays_createStatusPageIncident',
|
|
39
39
|
'status-pages subscribers list': 'relays_listStatusPageSubscribers',
|
|
40
|
+
'status-pages subscribers create': 'relays_createStatusPageSubscriber',
|
|
40
41
|
'status-pages subscribers delete': 'relays_deleteStatusPageSubscriber',
|
|
41
42
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onesi/genesis-cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/l1felabs/genesis-api.git",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"commander": "^14.0.0",
|
|
35
35
|
"undici": "6.29.0",
|
|
36
|
-
"@onesi/genesis": "0.2.
|
|
36
|
+
"@onesi/genesis": "0.2.10"
|
|
37
37
|
},
|
|
38
38
|
"optionalDependencies": {
|
|
39
39
|
"@napi-rs/keyring": "^1.2.0"
|