@vectros-ai/cli 0.9.0 → 0.11.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/AUTHORING.md CHANGED
@@ -142,8 +142,9 @@ accessProfile:
142
142
  allowedActions: [records:r, records:c, records:u, search:r, schemas:r]
143
143
  # dataScope binds the key to specific owners. Include `null` to ALSO grant
144
144
  # tenant-level (shared) records — without it the key sees ONLY the listed
145
- # owners' records, not shared/seed data:
146
- # dataScope: { orgId: [<org-uuid>, null] }
145
+ # owners' records, not shared/seed data. Keys are userId + namespaced scopes
146
+ # (scope:org, scope:client, ...):
147
+ # dataScope: { "scope:org": [<org-uuid>, null] }
147
148
 
148
149
  servicePrincipal:
149
150
  externalId: my-thing-sp # stable; the principal the profile + key bind to
@@ -214,7 +215,7 @@ than one surface, so the surface disambiguates which lookup resolves the link):
214
215
  - fieldId: establishedByDecision
215
216
  fieldType: reference
216
217
  targetTypeName: decision # the typeName it points at
217
- targetSurface: record # record | document | user | org | client (REQUIRED)
218
+ targetSurface: record # record | document | user | a namespace (org, client, ...) — REQUIRED
218
219
  targetField: externalId # the target's UNIQUE lookup to match (defaults to externalId)
219
220
  cardinality: one # one (a single id) | many (an array of ids)
220
221
  ```
@@ -243,6 +244,13 @@ principal's `externalId`, the per-machine key name, and each seed record's
243
244
  `externalId`. Bump `version` when you evolve a blueprint. (Note: schema
244
245
  `typeName` is immutable after first apply.)
245
246
 
247
+ **Pair `:r` with every `:c` you request.** Being handed back an existing item
248
+ on a re-apply collision is a read of that item, not part of create authority —
249
+ so a `records:c`-only `accessProfile.allowedActions` converges on first apply
250
+ but fails on every re-apply with an "already exists" error instead of the
251
+ existing record. Request `:r` alongside `:c` on every resource your blueprint
252
+ creates (the bundled blueprints all do this — see the example above).
253
+
246
254
  ## Distribution
247
255
 
248
256
  - **Bundled** — reviewed, versioned blueprints shipped in the library
package/CHANGELOG.md CHANGED
@@ -3,6 +3,95 @@
3
3
  All notable changes to `@vectros-ai/cli` are documented here.
4
4
  This project adheres to [Semantic Versioning](https://semver.org).
5
5
 
6
+ ## 0.11.0
7
+
8
+ ### Fixed
9
+
10
+ - **`access explain` no longer previews access that the platform denies.** A clause keyed on an
11
+ unrecognized ownership dimension — a retired `orgId`/`clientId`, or an invalid
12
+ `scope:<namespace>` — now shows as granting nothing, matching how the server evaluates it,
13
+ instead of appearing to grant records the credential cannot actually reach. The dead clause is
14
+ shown explicitly rather than silently dropped.
15
+
16
+ ### Changed
17
+
18
+ - **Clearer errors for expired sessions and rate limits.** When a command fails because your
19
+ login has expired, the CLI now tells you to run `vectros login` and retry; a rate-limited
20
+ request tells you to wait and retry. Failures that carry a typed error code surface it on the
21
+ support line alongside the request id.
22
+ - **`bootstrap` warns when seeded sample data could not be indexed.** If a seed record or document
23
+ is stored but not (fully) searchable, the run summary now says so — and why — instead of
24
+ reporting it as fully seeded.
25
+
26
+ ## 0.10.0
27
+
28
+ ### Changed (breaking)
29
+
30
+ - **Organization and client identities are now namespaces.** `org` and `client`
31
+ join any namespace you define (teams, projects, …), so the `identity` command
32
+ and ownership flags generalize:
33
+ - `identity create|list|get|delete --type <user|namespace>` — `user` for a
34
+ user, or a namespace (`org`, `client`, or one you define). `--type org` and
35
+ `--type client` keep working.
36
+ - `--scope <namespace>:<value>` (repeatable) replaces `--org <id>` on
37
+ `identity create`, `access grant`, and `join` — e.g. `--scope org:<id>`.
38
+ - Schema ownership in blueprints uses `scopes` instead of `orgId` / `clientId`,
39
+ and `--data-scope` keys use the `scope:<namespace>` form. The old `orgId` /
40
+ `clientId` keys are no longer accepted.
41
+
42
+ ### Added
43
+
44
+ - **Keys are now kept in your OS credential store** (Windows Credential Manager,
45
+ Linux Secret Service) instead of an encrypted file, on machines that have one —
46
+ so a copy of your `~/.vectros` directory no longer gives up a key. Existing
47
+ secrets migrate automatically the first time each key is used. Where no store is
48
+ usable (a headless Linux box, or no prebuilt for the optional native package) the
49
+ encrypted file remains the fallback. Set `VECTROS_KEYRING_BACKEND=file` to opt
50
+ out. macOS keeps using the encrypted file for now. Note: `vectros bootstrap`
51
+ still writes its key as plain JSON to `~/.vectros/<pack>.key.json`, so treat
52
+ `~/.vectros` as a secret if you use it.
53
+ - **The keyring is now a credential helper.** `keyring show --format raw` prints
54
+ the bare secret and is the contract other tools resolve through:
55
+ `@vectros-ai/mcp-server` 0.10.0+ runs it when `VECTROS_API_KEY` is unset, so a
56
+ key lives in the keyring instead of being copied into each tool's config. Set
57
+ `VECTROS_KEYRING_ALIAS` to target a specific entry.
58
+ - **`vectros keyring doctor`** — a health check for the keyring: the active entry,
59
+ whether each secret is readable, where each lives, and which hold live keys.
60
+ Exits non-zero when it finds anything to fix; `--json` for scripts.
61
+ - **`vectros keyring prune`** — drop orphaned entries (an index entry with no
62
+ stored secret). Narrow by design: an entry whose secret is merely unreadable or
63
+ locked is reported, never removed. `--dry-run` previews; `--force` skips the prompt.
64
+ - **`vectros context list` now enumerates the whole tenant**, not just contexts you
65
+ have joined, with an `active`/`purging` status column. `--mine` limits it to the
66
+ contexts you hold an access profile in. Now account-owner-only (a sub-user reads a
67
+ single context with `context get`).
68
+ - **`vectros key list --all-contexts`** — every active scoped key across all your
69
+ contexts and both tenants, the account-wide view a context-scoped `key list`
70
+ cannot show. Owner-only.
71
+ - **Actionable error messages** for known server errors — the active-key limit
72
+ (enumerate → revoke → retry), a 403 (owner/scope), a 404 (`context list`) —
73
+ instead of the raw SDK error. Correlation id under `VECTROS_MCP_DEBUG`.
74
+ - **`bootstrap` apply is now legible** — the preview states that apply is a
75
+ non-destructive reconcile, and each resource reports `created` vs `reconciled`.
76
+
77
+ ### Fixed
78
+
79
+ - **Two `vectros` commands running at once can no longer lose each other's keyring
80
+ entries** — index updates now take a lock and queue instead of overwriting. A
81
+ process killed mid-write leaves a lock the next command clears automatically.
82
+ - **`vectros keyring remove` refuses instead of silently stranding a key.** If it
83
+ cannot confirm the secret was deleted (a locked store), it declines and prints the
84
+ key id rather than discarding the only local record of a still-live key.
85
+ - **`vectros join` now reports a key it had to abandon** — when a replaced key's
86
+ secret cannot be deleted, it prints that key's id and the `vectros key revoke`
87
+ command, the last time you will see the id.
88
+
89
+ ### Changed
90
+
91
+ - The internal `--env` flag is no longer advertised in customer-facing output (help
92
+ text, examples, the post-login hint). It remains fully functional; production is
93
+ the default.
94
+
6
95
  ## 0.9.0
7
96
 
8
97
  ### Added
package/README.md CHANGED
@@ -3,15 +3,17 @@
3
3
  [![npm](https://img.shields.io/npm/v/@vectros-ai/cli)](https://www.npmjs.com/package/@vectros-ai/cli)
4
4
  [![license](https://img.shields.io/npm/l/@vectros-ai/cli)](https://www.apache.org/licenses/LICENSE-2.0)
5
5
 
6
- The Vectros provisioning CLI — the `vectros` binary. Two command groups:
6
+ The Vectros provisioning CLI — the `vectros` binary:
7
7
 
8
8
  - **`vectros bootstrap`** — provision a least-privilege MCP credential (+ optional blueprint).
9
9
  - **`vectros blueprint`** — author + inspect blueprints (`init` / `validate` / `plan` / `list`), creds-free.
10
10
  - **`vectros blueprint-test`** — apply a blueprint to a live env, assert it provisioned a working credential, then tear it down.
11
+ - **`vectros keyring`** — hold several identities on one machine, pick which is active, and let other tools resolve keys from one place.
11
12
 
12
13
  ```bash
13
14
  npx -y @vectros-ai/cli bootstrap # provision a credential
14
15
  npx -y @vectros-ai/cli blueprint --help # the authoring commands
16
+ npx -y @vectros-ai/cli keyring list # the identities on this machine
15
17
  ```
16
18
 
17
19
  Every command has `--help`. The authoring loop is documented in
@@ -108,6 +110,76 @@ Exit `0` = applied and every assertion passed; `1` = an assertion failed or appl
108
110
  errored; `2` = no credential, or the blueprint requested control-plane scope.
109
111
  The app-context is intentionally **not** deleted (it's idempotent and reused).
110
112
 
113
+ ## `vectros keyring` — one home for your keys
114
+
115
+ A machine can hold several Vectros identities (one per context or principal).
116
+ The keyring stores them as named entries plus one **active** pointer, so you can
117
+ switch between them without re-issuing keys. `vectros join <context>` adds an
118
+ entry and activates it; `vectros switch <alias>` flips the active one.
119
+
120
+ ```bash
121
+ vectros keyring list # the entries; * marks the active one
122
+ vectros switch <alias> # make <alias> active (= keyring use)
123
+ vectros keyring show # the active entry's fields + its key
124
+ vectros keyring show --format raw # JUST the secret, for scripts (see below)
125
+ vectros keyring doctor # is the keyring healthy? which keys are live?
126
+ vectros keyring prune # drop entries whose stored secret is gone
127
+ vectros keyring remove <alias> # drop one entry + its secret
128
+ ```
129
+
130
+ These are local — no network, no auth. The index itself never holds a secret.
131
+
132
+ **Where your keys are kept.** In your **OS credential store** (Windows Credential
133
+ Manager, Linux Secret Service) where one is available, so they are protected by
134
+ your OS login. Where none is — a headless Linux box with no Secret Service, or a
135
+ platform with no prebuilt for the optional native package — the CLI falls back to
136
+ an encrypted file under `~/.vectros/secrets` rather than failing. Be aware of what
137
+ that fallback does and doesn't buy you: it protects a single stray `.enc` file, but
138
+ its encryption key is derived from material stored alongside it, so anyone with a
139
+ copy of your **whole `~/.vectros` directory** can decrypt it. Treat that directory
140
+ as a secret in its own right. `vectros keyring doctor` tells you which store you
141
+ are on and why; `VECTROS_KEYRING_BACKEND=file` forces the fallback (existing keychain keys keep
142
+ working and move back to the file as you use them).
143
+
144
+ On **macOS** the encrypted file is used for now. A Keychain item grants access to
145
+ the application that created it and prompts for anything else — and the
146
+ "application" here is the `node` binary running this CLI, which is not stable
147
+ across installs. We expect that to put a password prompt in the startup path of
148
+ any tool resolving a key unattended, which on a headless host nobody can answer.
149
+ We have not yet verified it on real hardware, and would rather ship the honest
150
+ fallback than a claim we haven't tested.
151
+
152
+ Upgrading from an older CLI needs no action: an existing encrypted secret moves
153
+ into the credential store the first time that key is used.
154
+
155
+ **Resolving a key from another tool.** `keyring show --format raw` prints the bare
156
+ secret and nothing else, which makes it a credential helper in the shape of
157
+ `git credential` / `docker-credential-*` / `aws credential_process`:
158
+
159
+ ```bash
160
+ export VECTROS_API_KEY=$(vectros keyring show --format raw) # active
161
+ export VECTROS_API_KEY=$(vectros keyring show --format raw --alias support-bot) # a specific entry
162
+ ```
163
+
164
+ [`@vectros-ai/mcp-server`](https://www.npmjs.com/package/@vectros-ai/mcp-server)
165
+ does this for you: leave `VECTROS_API_KEY` unset and it resolves the key from
166
+ this keyring, so you don't paste a copy into its config. Exit codes: `0` secret
167
+ printed, `2` no such (or no active) entry, `1` the entry exists but its secret
168
+ can't be read.
169
+
170
+ **When something's off**, `vectros keyring doctor` is the first stop — it shows
171
+ which entry is active, whether each secret is readable, which entries are live
172
+ keys (the ones that act on real data), and which store is holding them, exiting
173
+ non-zero when it finds something to fix.
174
+
175
+ `vectros keyring prune` drops entries whose secret is gone, but only where "gone"
176
+ is knowable — that is, on the encrypted-file store. **Entries kept in the OS
177
+ credential store are never pruned.** That store can't tell us "no such secret"
178
+ apart from "couldn't read it right now", so a locked keychain would otherwise
179
+ look like a keyring full of dead entries; deleting one would throw away the key
180
+ id you need to revoke a key that may still be live. Use
181
+ `vectros keyring remove <alias>` to drop one deliberately.
182
+
111
183
  ## The scope gate (the trust boundary)
112
184
 
113
185
  Blueprints are **untrusted input** (agent- or community-authored) and the
@@ -0,0 +1,117 @@
1
+ # Third-party notices
2
+
3
+ `@vectros-ai/cli` compiles the following third-party packages directly into its
4
+ published binary (`dist/cli.js`). Their licenses require that these notices travel
5
+ with the code, so they are reproduced in full below.
6
+
7
+ This file is GENERATED by `pipelines/third_party_notices.mjs` from the `noExternal`
8
+ lists in `packages/*/tsup.config.ts`. Do not edit it by hand — run
9
+ `node pipelines/third_party_notices.mjs --write`. CI fails if it is stale, because a
10
+ notices file that silently drifts is worse than none: it asserts a compliance that
11
+ nobody checked.
12
+
13
+ Packages resolved at RUNTIME (ordinary dependencies) are not listed here — the
14
+ consumer's own install carries their licenses.
15
+
16
+ ---
17
+
18
+ ## graceful-fs 4.2.11
19
+
20
+ License: ISC
21
+
22
+ ```
23
+ The ISC License
24
+
25
+ Copyright (c) 2011-2022 Isaac Z. Schlueter, Ben Noordhuis, and Contributors
26
+
27
+ Permission to use, copy, modify, and/or distribute this software for any
28
+ purpose with or without fee is hereby granted, provided that the above
29
+ copyright notice and this permission notice appear in all copies.
30
+
31
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
32
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
33
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
34
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
35
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
36
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
37
+ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
38
+ ```
39
+
40
+ ## proper-lockfile 4.1.2
41
+
42
+ License: MIT
43
+
44
+ ```
45
+ The MIT License (MIT)
46
+
47
+ Copyright (c) 2018 Made With MOXY Lda <hello@moxy.studio>
48
+
49
+ Permission is hereby granted, free of charge, to any person obtaining a copy
50
+ of this software and associated documentation files (the "Software"), to deal
51
+ in the Software without restriction, including without limitation the rights
52
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
53
+ copies of the Software, and to permit persons to whom the Software is
54
+ furnished to do so, subject to the following conditions:
55
+
56
+ The above copyright notice and this permission notice shall be included in
57
+ all copies or substantial portions of the Software.
58
+
59
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
60
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
61
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
62
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
63
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
64
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
65
+ THE SOFTWARE.
66
+ ```
67
+
68
+ ## retry 0.12.0
69
+
70
+ License: MIT
71
+
72
+ ```
73
+ Copyright (c) 2011:
74
+ Tim Koschützki (tim@debuggable.com)
75
+ Felix Geisendörfer (felix@debuggable.com)
76
+
77
+ Permission is hereby granted, free of charge, to any person obtaining a copy
78
+ of this software and associated documentation files (the "Software"), to deal
79
+ in the Software without restriction, including without limitation the rights
80
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
81
+ copies of the Software, and to permit persons to whom the Software is
82
+ furnished to do so, subject to the following conditions:
83
+
84
+ The above copyright notice and this permission notice shall be included in
85
+ all copies or substantial portions of the Software.
86
+
87
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
88
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
89
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
90
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
91
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
92
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
93
+ THE SOFTWARE.
94
+ ```
95
+
96
+ ## signal-exit 3.0.7
97
+
98
+ License: ISC
99
+
100
+ ```
101
+ The ISC License
102
+
103
+ Copyright (c) 2015, Contributors
104
+
105
+ Permission to use, copy, modify, and/or distribute this software
106
+ for any purpose with or without fee is hereby granted, provided
107
+ that the above copyright notice and this permission notice
108
+ appear in all copies.
109
+
110
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
111
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
112
+ OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
113
+ LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
114
+ OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
115
+ WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
116
+ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
117
+ ```