@hyperscale0/cli 1.0.0-beta.9 → 1.0.123

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.
Files changed (3) hide show
  1. package/README.md +85 -72
  2. package/hyperscale.js +61 -124
  3. package/package.json +4 -3
package/README.md CHANGED
@@ -1,76 +1,89 @@
1
1
  # @hyperscale0/cli
2
2
 
3
- The Hyperscale founder command line. It logs a founder in, discovers public
4
- Blueprints, composes Products, manages sandbox API keys, and runs one Product's
5
- frozen public actions.
6
-
7
- ## Use
8
-
9
- Mint a founder PAT in the portal at https://hyperscale0.ai/desk. Open Security,
10
- then Personal access tokens. Unapproved founders can request access at
11
- https://hyperscale0.ai/request-access.
12
-
13
- ```bash
14
- export HYPERSCALE_TOKEN=<your founder PAT>
15
- bunx @hyperscale0/cli auth login --no-browser
16
- bunx @hyperscale0/cli whoami
17
- bunx @hyperscale0/cli start --blueprint vehicle-escrow-marketplace --json
18
- bunx @hyperscale0/cli blueprint list
19
- bunx @hyperscale0/cli product create --blueprint luxury-goods-consignment-escrow --name "Luxury Consignment"
20
- bunx @hyperscale0/cli product select <Product id>
21
- bunx @hyperscale0/cli key create --name "Founder laptop"
22
- bunx @hyperscale0/cli compose check product.hsx
23
- bunx @hyperscale0/cli compose plan product.hsx
24
- bunx @hyperscale0/cli compose apply product.hsx --yes
25
- bunx @hyperscale0/cli team list
26
- bunx @hyperscale0/cli team invite --email developer@example.com --role developer
27
- bunx @hyperscale0/cli activity list
28
- bunx @hyperscale0/cli ops list payment
29
-
30
- export HYPERSCALE_API_KEY=<your Product API key>
31
- bunx @hyperscale0/cli product actions
32
- bunx @hyperscale0/cli product actions escrow_order.placeBuyerHold --json
33
- bunx @hyperscale0/cli product run escrow_order.placeBuyerHold --input '{"escrowOrderId":"eord_sandbox_..."}'
34
- bunx @hyperscale0/cli call account.list --input '{"limit":5}'
3
+ The Hyperscale developer command line.
4
+
5
+ ## Start
6
+
7
+ ```sh
8
+ npm install -g @hyperscale0/cli
9
+ hyperscale auth login --base-url https://dev.hyperscale0.ai
10
+ hyperscale whoami --json
11
+ ```
12
+
13
+ Use `bunx @hyperscale0/cli@latest` or `npx @hyperscale0/cli@latest`
14
+ without a global install. Browser login requests read-only scopes through
15
+ portal consent. Request different scopes with `auth login --scopes <scope,...>`.
16
+ The login summary shows the authority actually returned by the server.
17
+ Headless email login uses `auth login --email founder@example.com --no-browser`
18
+ in sandbox or live. The password prompt requires a TTY. Passwords and temporary sessions never
19
+ enter files or saved replay requests. Use browser sign-in for terms.
20
+ Default scopes include blueprints:read for `compose check`. Creation requires
21
+ explicit reauthorization:
22
+
23
+ ```sh
24
+ env -u HYPERSCALE_TOKEN hyperscale auth login --base-url https://dev.hyperscale0.ai --environment sandbox --scopes activity:read,billing:read,blueprints:read,catalog:read,finance:read,products:read,blueprints:write
25
+ ```
26
+
27
+ Headless callers can use `auth login --no-browser --token <pat>`.
28
+
29
+ ## Product commands
30
+
31
+ `product select <id>` saves a Product. Member PATs use that Product's route.
32
+ Use a Product API key in `HYPERSCALE_API_KEY` for object operations.
33
+ Keep Product identity in the input and omit the global `--product` flag:
34
+
35
+ ```sh
36
+ hyperscale call product.objects.discover --input '{"productId":"<product-id>"}' --json
37
+ hyperscale call product.objects.create --input '{"productId":"<product-id>","kind":"<kind>"}' --idempotency-key object-001 --json
38
+ hyperscale call product.objects.actions --input '{"productId":"<product-id>","kind":"<kind>","objectId":"<object-id>"}' --json
39
+ hyperscale call product.objects.execute --input-file action.json --idempotency-key action-001 --json
35
40
  ```
36
41
 
37
- `product actions` lists the frozen Product surface. Pass one exact public
38
- operation id such as `escrow_order.placeBuyerHold` to return its full input
39
- schema, output schema, policies, build id, surface version, and operation-set
40
- digest.
41
- `start` asks which catalog company to build in a terminal. Scripts and agents
42
- pass `--blueprint <slug>` to skip the prompt. `product select <Product id>`
43
- stores the default Product used by compose, key, and Product commands when
44
- `--product` is absent.
45
- `compose check` compiles textual HSX and runs the independent composer check.
46
- `compose plan` diffs it against the selected Product. `compose apply`
47
- recomposes that Product and requires `--confirm`, or `--yes` for an agent.
48
- Compiler or composer refusal exits 2. Transport and server failure exit 1.
49
- `npx @hyperscale0/cli` runs the same commands. Add
50
- `--json` for machine-readable success and failure output.
51
- `auth login --no-browser` skips the localhost browser callback. Without a PAT,
52
- it prints the PAT desk and request-access URL. With `--token` or
53
- `HYPERSCALE_TOKEN`, it validates and stores that founder PAT without opening a
54
- browser.
55
-
56
- Founder PAT commands are `auth`, `whoami`, `product create/list/show/select`,
57
- `compose plan/apply`, `key`, `team`, and `activity`. They use
58
- `--token`, `HYPERSCALE_TOKEN`, or a stored login in that order. Product API
59
- key commands are `product actions/run`, `ops list`, and `call`. They use
60
- `HYPERSCALE_API_KEY` and need no founder login profile. `compose check`
61
- runs locally when no founder credential exists. On a clean machine, set the
62
- Product API key and pass `--product <id>`. Use `--base-url` and
63
- `--environment` when their defaults do not name the Product's plane.
64
-
65
- Point it at another host with `--base-url`, and at the live plane with
66
- `--environment live`. Live keys and sandbox keys are never interchangeable.
67
- The CLI stores the founder PAT in macOS Keychain by default. If Keychain is
68
- unavailable, it falls back to an owner-only 0600 file under
69
- `HYPERSCALE_CONFIG_DIR`, or `~/.config/hyperscale` by default. Set
70
- `HYPERSCALE_CREDENTIAL_STORE=file` to choose that file store and skip
71
- Keychain access. `auth logout` deletes local state and does not revoke the
72
- PAT. `auth logout --revoke` revokes the active PAT before deleting local
73
- state. Passkey login stays in the portal at
74
- https://hyperscale0.ai/signin.
75
-
76
- Run `bunx @hyperscale0/cli --help` for the full option list.
42
+ Copy action.name, productBuildId, digest and target from the chosen available
43
+ action into action.json. Also include productId, kind, objectId, expectedRevision
44
+ from the actions response, and required fields and input. Copy instanceId when
45
+ present in target. Object creation never enters an agreement or moves money.
46
+ Use product.objects.list and product.objects.retrieve for stored objects.
47
+ See https://hyperscale0.ai/docs/runtime.md for the complete request shape.
48
+
49
+ Low-level `product actions` and `product run` remain for admitted operations.
50
+ Instrument creation stays internal to object attachment execution.
51
+
52
+ `ops list --catalog` browses catalog command data without authentication.
53
+ `ops list` discovers operations for the active credential and Product.
54
+ `call <operation>` calls one with `--input` or `--input-file`.
55
+ `compose check/plan/apply <file.hsx>` uses the server composer.
56
+ Run `hyperscale help <command>` for options and examples.
57
+
58
+ ## Resume
59
+
60
+ A transport failure or interrupted dispatch prints a local resume reference.
61
+ Then run `hyperscale resume <reference>`. Resume replays the same origin,
62
+ environment, credential, path, body bytes and idempotency key from secure local
63
+ storage. Body and credential overrides are refused.
64
+
65
+ A lost response does not mean failure. Keep the printed operation reference
66
+ and read its status before retrying. Resume never creates a new idempotency key.
67
+ Successful requests remove their saved credential copy. Uncertain
68
+ requests remain local until they complete. Logout removes the login credential;
69
+ it does not revoke separately saved pending requests. Use portal token revocation
70
+ if those requests must lose server authority.
71
+
72
+ ## Automation and storage
73
+
74
+ `--json` writes success to stdout and one error object to stderr on failure.
75
+ Errors retain HTTP status, code, message, fix, details and available correlation
76
+ IDs. Exit 0 means success, 1 means failure, and 2 means composer refusal. JSON help is also available.
77
+
78
+ Human output honors non-TTY streams, narrow terminals and NO_COLOR, including
79
+ an empty NO_COLOR value. Identifiers are never shortened.
80
+
81
+ Credentials and saved requests use macOS Keychain with an owner-only 0600 file
82
+ fallback under `HYPERSCALE_CONFIG_DIR` or `~/.config/hyperscale`.
83
+ `HYPERSCALE_CREDENTIAL_STORE=file` explicitly selects file storage.
84
+ Use `--base-url` or `HYPERSCALE_BASE_URL` for the API origin and
85
+ `--environment sandbox|live` for the environment partition.
86
+ Neither current estate connects to real bank infrastructure.
87
+
88
+ License: LicenseRef-Hyperscale-Proprietary.
89
+ Hyperscale is a trademark of Hyperscale LLC.