@usenaive-sdk/vetta-cli 0.1.0 → 0.2.0

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
@@ -1,7 +1,8 @@
1
1
  # @usenaive-sdk/vetta-cli
2
2
 
3
3
  The `vetta` command line — drive the whole Vetta API from a terminal or a script: agents, sessions,
4
- computers, skills, files, identities, vaults, comms, deployments, webhooks and credits.
4
+ computers, skills, files, identities, vaults, comms, deployments, webhooks, the monthly plan and
5
+ credits.
5
6
 
6
7
  It is built on [`@usenaive-sdk/vetta`](https://www.npmjs.com/package/@usenaive-sdk/vetta), the same typed
7
8
  client the dashboard uses, so the CLI and the API never drift apart.
@@ -17,6 +18,7 @@ npm i -g @usenaive-sdk/vetta-cli
17
18
  ```bash
18
19
  vetta login --api-key sk_… # or: vetta login --email … --password …
19
20
  vetta whoami
21
+ vetta plan show # an org with no plan is refused everywhere else
20
22
  ```
21
23
 
22
24
  Credentials are stored on a named profile, so several organizations can be driven from one machine
@@ -29,8 +31,8 @@ vetta <group> <command> [flags]
29
31
  ```
30
32
 
31
33
  Groups: `agent` `audit` `auth` `computer` `connections` `credits` `deploy` `domain` `email` `file`
32
- `identity` `keys` `login` `logout` `models` `org` `phone` `run` `session` `skill` `vault` `webhook`
33
- `whoami`.
34
+ `identity` `keys` `login` `logout` `models` `org` `phone` `plan` `run` `session` `skill` `vault`
35
+ `webhook` `whoami`.
34
36
 
35
37
  `vetta <group> --help` lists a group's commands.
36
38
 
package/dist/index.js CHANGED
@@ -23455,7 +23455,12 @@ var AcknowledgedSchema = external_exports.object({
23455
23455
  var auth = (config2) => ({
23456
23456
  /** Who this credential is. No scope, no org id needed — that is the whole point (§20.1). */
23457
23457
  me: () => request(config2, IdentitySchema22, { method: "GET", path: "/v1/me" }),
23458
- /** Sign in, or re-scope the session already held to another organization (§20.4). */
23458
+ /**
23459
+ * Sign in, finish an external sign-in, or re-scope the session already held to another
23460
+ * organization (§20.4). `provider_token` is the access token an external provider sign-in came
23461
+ * back with; the control plane re-verifies it against the provider and refuses an address the
23462
+ * provider has not proved.
23463
+ */
23459
23464
  session: (body) => request(config2, AuthSessionSchema, { method: "POST", path: "/v1/auth/session", body }),
23460
23465
  register: (body) => request(
23461
23466
  config2,
@@ -24711,6 +24716,17 @@ var credits2 = {
24711
24716
  })
24712
24717
  })
24713
24718
  };
24719
+ var plan = {
24720
+ /** `status`, when the paid period ends, and whether it is already set to stop (§18b). */
24721
+ show: async ({ client }) => ({ out: await client.credits.subscription() }),
24722
+ /**
24723
+ * Opens the hosted checkout and changes **nothing**, exactly like `credits topup`: the plan turns
24724
+ * `active` only when the signed provider callback lands, whenever the customer gets round to
24725
+ * paying. So this prints `action_url` whole and returns, rather than blocking on a purchase it
24726
+ * cannot see, cannot complete and cannot cancel. `vetta plan show` is what reports the outcome.
24727
+ */
24728
+ subscribe: async ({ client }) => ({ out: await client.credits.subscribe() })
24729
+ };
24714
24730
 
24715
24731
  // src/commands/deploy.ts
24716
24732
  function fields(args) {
@@ -24969,8 +24985,16 @@ function exitForStopReason(reason) {
24969
24985
  function exitForError(cause) {
24970
24986
  return cause instanceof UsageError ? EXIT_USAGE : EXIT_ERROR;
24971
24987
  }
24988
+ var REMEDY = {
24989
+ subscription_required: "vetta plan subscribe"
24990
+ };
24972
24991
  function describeError(cause) {
24973
- if (cause instanceof ApiError) return `error: ${cause.code}: ${cause.message} (${cause.requestId})`;
24992
+ if (cause instanceof ApiError) {
24993
+ const remedy = REMEDY[cause.code];
24994
+ const fix = remedy === void 0 ? "" : `
24995
+ fix it with: ${remedy}`;
24996
+ return `error: ${cause.code}: ${cause.message} (${cause.requestId})${fix}`;
24997
+ }
24974
24998
  if (cause instanceof UsageError) return `usage: ${cause.message}`;
24975
24999
  return `error: ${cause instanceof Error ? cause.message : String(cause)}`;
24976
25000
  }
@@ -25309,7 +25333,8 @@ var GROUPS = {
25309
25333
  webhook,
25310
25334
  org,
25311
25335
  keys: keys2,
25312
- credits: credits2
25336
+ credits: credits2,
25337
+ plan
25313
25338
  };
25314
25339
  var FLAGS = {
25315
25340
  auth: {
@@ -25472,7 +25497,12 @@ var FLAGS = {
25472
25497
  remove: ""
25473
25498
  },
25474
25499
  keys: { create: "name scopes", list: "limit after", rotate: "", revoke: "" },
25475
- credits: { show: "", topup: "usd", ledger: "type session agent deployment from to limit after" }
25500
+ credits: { show: "", topup: "usd", ledger: "type session agent deployment from to limit after" },
25501
+ /**
25502
+ * The monthly plan (§18b). Neither command takes a flag: the plan has one price, and `subscribe`
25503
+ * has nothing to configure — it answers a checkout URL for a human to open.
25504
+ */
25505
+ plan: { show: "", subscribe: "" }
25476
25506
  };
25477
25507
  var GLOBAL_FLAGS = "json human profile api-key org api-base-url version help";
25478
25508
  var UNSUPPORTED = {
@@ -25495,7 +25525,7 @@ var ALIASES = {
25495
25525
  };
25496
25526
 
25497
25527
  // src/cli.ts
25498
- var VERSION = true ? "0.1.0" : "0.0.0-dev";
25528
+ var VERSION = true ? "0.2.0" : "0.0.0-dev";
25499
25529
  var GLOBAL_FLAGS_HELP = "global flags: --json (default) --human --profile <name> --api-key <key> --org <org_id> --api-base-url <url>";
25500
25530
  function usage() {
25501
25531
  const groups = [...Object.keys(GROUPS), ...Object.keys(ALIASES)].sort().join(", ");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@usenaive-sdk/vetta-cli",
3
- "version": "0.1.0",
4
- "description": "Vetta command line \u2014 create agents, run sessions, watch events, see cost.",
3
+ "version": "0.2.0",
4
+ "description": "Vetta command line — create agents, run sessions, watch events, see cost.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "bin": {