@lotics/cli 0.204.0 → 0.205.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/AGENTS.md CHANGED
@@ -52,6 +52,23 @@ response there is *not* evidence the subcommand is absent. To find out whether s
52
52
  code again; once the 15 minutes are up it says to ask again. `lotics setup` falls into the same
53
53
  flow by itself when the email it was given already has an account: it stops having created
54
54
  nothing, and the SAME command run again carries on.
55
+ - **A credential is either a SIGN-IN or an API KEY, and `logout` treats them differently.** A profile
56
+ from `auth login` / `auth signup` acts as the person who confirmed it and is theirs — `lotics auth
57
+ logout` revokes it server-side, and it lapses on its own after 90 idle days (each use pushes that
58
+ out). A profile from `auth api-key` holds a key an ADMIN issued, which is routinely also on a
59
+ server and on other machines, so logout only forgets it locally and says so; only an admin revokes
60
+ it. A profile that states no kind (saved before the field existed) is resolved against the SERVER
61
+ and revoked only if the answer is a sign-in; a bare `--api-key` / `LOTICS_API_KEY` names no
62
+ profile to remove at all. Nothing is ever revoked on a guess — between two, the destructive one is
63
+ wrong. `lotics auth whoami` prints the kind, asking the server when the store cannot say.
64
+ - **A 401 names its remedy — act on the hint, do not retry.** "This credential expired / was
65
+ revoked / belongs to a member who is no longer active" carries the one remedy that ends this
66
+ credential: run `lotics auth login <email>` for a sign-in, or ask the admin who issued it for a
67
+ new key. A credential minted before that was recorded carries BOTH, because nothing on the row
68
+ tells them apart — so on a box with no browser, take the second. Only an UNRECOGNIZED key gets
69
+ the generic "Invalid or disabled API key", and that one is generic on purpose, so re-sending it
70
+ teaches nothing. A `reason` rides on the body for a script to branch on, since the code stays
71
+ `unauthorized` for every 401.
55
72
  - **Large payloads bypass `ARG_MAX`** — `lotics run <tool> @args.json` or piped stdin. A leading `@` is
56
73
  unambiguously a file path (JSON args start with `{`).
57
74
  - **stdout is the payload, stderr is the narration.** Progress, status lines, and the target echo go to
@@ -66,6 +83,13 @@ response there is *not* evidence the subcommand is absent. To find out whether s
66
83
  so `lotics run … && next-step` cannot walk past a refused run; `workspace doctor` exits non-zero on
67
84
  findings. An unrecognized status exits 0 — the list is an allowlist of failure, so a status added
68
85
  later never turns a working script red — and a parked run (`awaiting_input`) is not a failure.
86
+ - **An app that PUBLISHES an API turns every later manifest write into a release.** `lotics app api
87
+ publish` snapshots what the app's queries and workflows promise to callers outside it — a
88
+ customer's own site or server, which nobody here can redeploy. From then on an additive change
89
+ re-snapshots silently and a breaking one is REFUSED, naming each change;
90
+ `--acknowledge-breaking-api` (on `app deploy`, `app query set`, `app workflow set`, `app upgrade`)
91
+ is the answer that carries it out and snapshots the break as a new contract version. An app that
92
+ publishes nothing is untouched by any of it.
69
93
  - **`--print-created` / `--cleanup` on any call that reports `side_effects`.** The first prints the
70
94
  records created plus a paste-ready cleanup plan and what cannot be auto-undone; the second runs
71
95
  those deletes (records only — never files, integrations or notifications). Neither is a rollback.
package/README.md CHANGED
@@ -124,6 +124,10 @@ The CLI checks for updates once per day and prints a note on stderr, naming the
124
124
 
125
125
  ## Authentication
126
126
 
127
+ **Two kinds of credential, and which you hold decides what `logout` does.** `auth signup` / `auth login` give this machine a **sign-in** — it acts as you, carries whatever role you have, and is yours to see and revoke at Settings → Security → *Keys and terminals*; it lapses after 90 days of disuse, and each use pushes that out. `auth api-key` saves an **API key** an admin issued: it acts as the member it was created for, often lives on a server and on other people's machines too, and only an admin revokes it. `lotics auth whoami` prints which kind this machine holds — from the saved profile, or from the server when the profile does not say.
128
+
129
+ When a credential stops working the refusal says which of the three ways it is dead — "This credential was revoked." / "expired." / "belongs to a member who is no longer active in this organization." — and names both remedies, because a credential acts as a person whether it is their own sign-in or a key an admin issued under their membership, and nothing on the row tells the two apart: sign in again with `lotics auth login <email>`, or ask the admin who issued it for a new key. A key the server does not recognize at all gets one generic answer, deliberately: an unrecognized key learns nothing from being refused.
130
+
127
131
  **`lotics auth signup`** — Creates a new Lotics account, organization, workspace, and API key in one step. Sends a magic link email so you can access the web app.
128
132
 
129
133
  ```bash
@@ -157,7 +161,7 @@ lotics auth api-key # interactive prompt
157
161
  lotics auth api-key ltk_... # registers the key's org as a profile (now active)
158
162
  ```
159
163
 
160
- Run `lotics auth logout [<name|id>]` to remove a profile (default: the active org), or `lotics auth logout --all` to wipe the store. Inside a pinned directory the bare form removes the **pin**, not a profile — name the org to remove its credential.
164
+ Run `lotics auth logout [<name|id>]` to remove a profile (default: the active org), or `lotics auth logout --all` to wipe the store. Inside a pinned directory the bare form removes the **pin**, not a profile — name the org to remove its credential. A profile saved by `auth login` / `auth signup` is a **sign-in**, and logging out revokes it server-side too. One saved by `auth api-key` is an admin-issued key that other machines may also hold, so it is only removed from this machine and stays active until an admin revokes it under Settings → API keys. A profile saved before the kind was recorded states nothing, so the server is asked and the credential is revoked only if the answer is a sign-in.
161
165
 
162
166
  ## Organizations
163
167
 
@@ -349,6 +353,18 @@ lotics app versions app_... # ...for any app, without pulling it
349
353
  lotics app upgrade # the app this directory's manifest names
350
354
  lotics app upgrade app_... # ...for any app, without pulling it first
351
355
 
356
+ # The app's API: what its declared queries and workflows promise to a caller
357
+ # OUTSIDE the app — a customer's own site or server. Publishing snapshots that
358
+ # promise as a numbered contract; from then on a manifest write that would break
359
+ # it is refused and every breaking change is named, unless the write carries
360
+ # --acknowledge-breaking-api (app deploy / app query set / app workflow set /
361
+ # app upgrade). A query that does not name the columns it returns is refused at
362
+ # publish: those field names are the table's, not the app's to promise.
363
+ lotics app api publish # snapshot the contract; prints the version + warnings
364
+ lotics app api status # is one published, and which version callers hold
365
+ lotics app api spec -o api.openapi.json # the OpenAPI 3.1 document, for the consumer's generator
366
+ lotics app api unpublish # end the promise
367
+
352
368
  # Regenerate .lotics/* WITHOUT a deploy: the .d.ts type companions (always) +
353
369
  # the runtime app_fields.ts (when authenticated) — F/OPT maps that address
354
370
  # fields + select options by stable display-name aliases instead of opaque ids.