@tinycloud/cli 1.3.0-beta.5 → 1.3.0-beta.50

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
@@ -114,6 +114,9 @@ tc delegation create --to did:pkh:eip155:1:0x...
114
114
  | `tc context` | Show the selected profile, owner, host, space and session state |
115
115
  | `tc auth status` | Show authentication status |
116
116
  | `tc auth whoami` | Show current identity |
117
+ | `tc auth request --preset apps-agent [--app <id>]... [--write]` | Request access for an agent to the user's installed apps: read-only by default, for one app, several, or all. `--write --app <id>` also lets the agent change that app's data: write its `knowledge/` and `prefs/` files and change its tables. It cannot change the app's code, manifest or install record |
118
+ | `tc knowledge list` | List the installed apps that have a knowledge bundle |
119
+ | `tc knowledge read <app_id> [concept]` | Read an app's knowledge index, or one concept with its frontmatter parsed |
117
120
  | `tc kv get <key>` | Retrieve a value |
118
121
  | `tc kv put <key> <value>` | Store a value |
119
122
  | `tc kv list` | List all keys |
@@ -171,23 +174,87 @@ whole space. Whole-space replication requires `kv-sync-root` support and
171
174
  `--replication-allow-secrets`, because it includes `vault/`. Replication needs
172
175
  unrestricted `get` and explicit `sync` on that folder or broader; an exact-key
173
176
  grant never qualifies. Bare replica prefixes are rejected; use `notes/`.
177
+
178
+ An explicit local-owner sign-in saves the verified replica lifecycle stamp with
179
+ its session; later CLI processes validate that stamp before local reads. Without
180
+ it, network sign-in and KV reads still work, but local replica reads stay gated
181
+ until a new verified sign-in. A gated root prefix does not imply `kv-sync-root`
182
+ support.
183
+
184
+ Replica-enabled OpenKey login uses the SDK-prepared SIWE approval URL, not the
185
+ older browser-created session. Specify `--owner did:pkh:eip155:CHAIN:ADDRESS`
186
+ unless this profile already has a verified owner session. The CLI verifies the
187
+ signed result before saving its new key, session and replica stamp. Safari, and
188
+ Chromium browsers that enforce Local Network Access without granting it (headless
189
+ Chromium cannot show the prompt), may block the HTTPS page's plain-HTTP loopback
190
+ callback: use an interactive CLI terminal and paste the same one-line code shown
191
+ by OpenKey, or start with
192
+ `tc auth login --method openkey --replication-prefix notes/ --owner DID --paste`
193
+ for a headless terminal. Non-TTY `--no-popup` cannot accept a paste; if that
194
+ callback fails, it exits nonzero at the five-minute expiry with a `--paste`
195
+ retry hint and discards the candidate key. Restarting requires a new approval
196
+ and cannot reuse the old signed code. Ctrl-C, SIGINT or SIGTERM before approval
197
+ arrives cancels the OpenKey handoff (best effort) and exits 130 `CANCELLED`
198
+ without saving a key or session.
199
+
174
200
  Use `tc replica report` for read-only aggregates of persisted replication events
175
201
  and identity partitions. Live replica status is unavailable there. Report
176
202
  `--purge` and `--clear-pending` refuse with exit 2 `REPORT_READ_ONLY`.
177
203
  `tc replica reset --replica <name> --purge` is a partial alternative for a
178
- named local replica only.
179
- Flag-owned purge and pending clearing have no equivalent yet (TC-1309).
180
- On macOS and Windows, `replica reset --purge` and `auth logout` with a legacy
181
- `replicas/` tree refuse local removal rather than delete through an unpinned
182
- path; leave that tree intact and retry on a supported platform.
183
- `auth logout` removes both legacy replicas and the flag-owned
184
- `replication/` root; `auth logout --keep-replicas` keeps both. B-int release
185
- acceptance must verify the OpenKey `tc auth request --grant` fallback against
186
- a real OpenKey using a test account and no production writes: approve the
187
- request, confirm the grant is stored, start a fresh process, and verify the
188
- saved prefixes are replayed and the covered read is served locally. If OpenKey
189
- rejects explicit `kv/get` plus `sync`, stop before release and resolve the
190
- protocol contract.
204
+ named local replica only. Flag-owned purge and pending clearing have no
205
+ equivalent yet (TC-1309). On macOS and Windows, `replica reset --purge` and
206
+ `auth logout` with a legacy `replicas/` tree refuse local removal rather than
207
+ delete through an unpinned path; leave that tree intact and retry on a supported
208
+ platform.
209
+
210
+ `auth logout` durably fences replica reads, removes both legacy replicas and the
211
+ flag-owned `replication/` root, and shreds `session.json` and `key.json`. If
212
+ erasure fails, the marker keeps reads denied and startup retries cleanup. An
213
+ explicit logout also blocks implicit sign-in with the stored profile owner key;
214
+ use `auth login` to establish a fresh session. Unknown legacy or flag-owned
215
+ paths, an unverified legacy SQLite schema, or an unreadable gate refuse logout
216
+ before a marker, credential deletion, or node revocation. Sync local writes or
217
+ pass `--discard-local-changes` to approve the displayed paths, types and file
218
+ identities; newly added or changed paths require fresh approval. With `auth
219
+ logout --revoke --discard-local-changes`, physical files and credentials remain
220
+ through partial or failed node revocation. Only after every exact-CID receipt
221
+ does local cleanup begin. After a failed revoke, plain `auth logout` first
222
+ compares the original approved inventory. If it changed, even
223
+ `--discard-local-changes` refuses without deleting credentials or files and
224
+ prints the changed identities and a 32-character approval token. Run a separate
225
+ `auth logout --discard-local-changes --approve-inventory <token>` to approve
226
+ that exact inventory; a new change invalidates the token. After successful
227
+ remote revocation, a cleanup mismatch retains the marker and remaining files
228
+ while the profile stays signed out; `auth logout --discard-local-changes`
229
+ reapproves cleanup without repeating node revocations. OpenKey owner revocation
230
+ fails closed with `REVOCATION_AUTHORITY_UNAVAILABLE`, retaining credentials and
231
+ denied replica files until signed owner revoke authority is supported.
232
+ `--keep-replicas` is available only for legacy-only profiles with no gate,
233
+ flag-owned partition or pending purge; it retains those legacy files but still
234
+ shreds credentials and blocks implicit reauthentication.
235
+ When the profile's replica gate belongs to a different account than the
236
+ signed-in session, `auth logout` signs that session out and removes the
237
+ profile's legacy `replicas/` tree, but leaves the other account's gate and
238
+ flag-owned replicas untouched; startup finishes the legacy removal if it is
239
+ interrupted. If an earlier sign-out was interrupted, logout reports it and a
240
+ second `auth logout` completes it. A gate that no longer matches its logout
241
+ record (for example, restored from an older copy) refuses logout; switch the
242
+ default profile if needed, then run `tc profile delete <name>` and sign in
243
+ again.
244
+
245
+ `tc auth grants list` labels the signed-in delegation CID `(current session)`.
246
+ `tc delegation revoke <cid>` still accepts any eligible exact CID, but when
247
+ `<cid>` is the current session it requires `--yes` or an interactive confirmation
248
+ before contacting the node. An exact-CID success then runs the same durable
249
+ local sign-out and key shred as `auth logout`; revoking another CID leaves the
250
+ session intact.
251
+
252
+ B-int release acceptance must
253
+ verify the OpenKey `tc auth request --grant` fallback against a real OpenKey
254
+ using a test account and no production writes: approve the request, confirm the
255
+ grant is stored, start a fresh process, and verify the saved prefixes are
256
+ replayed and the covered read is served locally. If OpenKey rejects explicit
257
+ `kv/get` plus `sync`, stop before release and resolve the protocol contract.
191
258
 
192
259
  ## Output Modes
193
260