@lotics/cli 0.234.0 → 0.235.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
@@ -7,14 +7,15 @@ conventions are, and where the traps are.
7
7
  |---|---|
8
8
  | `lotics --help` | The verb inventory (§ COMMANDS) and global flags. The verb LIST is generated and never stale; the prose beside each verb is hand-written, so where it disagrees with `docs/cli_reference.md`, the reference wins. |
9
9
  | `lotics tools` · `lotics tools <name>` | The agent tool registry and one tool's full JSON Schema. |
10
- | `lotics docs` · `lotics docs <area>[/<section>]` | Every reference the packages installed beside the project actually ship — `@lotics/app-sdk`, `@lotics/ui` and the document engines each carry their own, and this index only covers THIS package. Discovered by looking, not by a list, so it reports the installed VERSION of each: a doc always describes the code that is really there. Capped at a page: a doc that does not fit hands back its opening and the addresses into it, so the next call is smaller than the last. |
10
+ | `lotics docs` · `lotics docs <area>[/<section>]` | Every reference the packages installed beside the project actually ship — `@lotics/app-runtime`, `@lotics/ui` and the document engines each carry their own, and this index only covers THIS package. Discovered by looking, not by a list, so it reports the installed VERSION of each: a doc always describes the code that is really there. Capped at a page: a doc that does not fit hands back its opening and the addresses into it, so the next call is smaller than the last. |
11
11
  | `lotics scaffold docs` | How to write a `model.json` — the file a workspace is built from. Two forms: `{"from": "<preset-slug>", "variants", "rename", "entities", "rows", "apply"}`, which names a preset by slug and carries only what this business differs by, and the full one, spelled out, for when no preset is the trade: every top-level key, every field type with the config it needs, the row format, the rules, and a worked example. Offline, and not part of `lotics docs`. It also covers the `apply` list — published packages copied in after the model's own tables, each with an optional `bind` onto them — and the `preset` block a published model carries. `lotics scaffold check` then proves the file — offline, except for the one read a `from` file's preset needs — including every branch of a preset merged onto its base; `lotics setup` applies it and refuses a table name the workspace already has, `lotics scaffold apply` adopts that table and adds what is missing, and the WORKSPACE remembers what each alias became, so every later run binds by id and a relabel on either side is a rename it reports rather than a second table it adds. `lotics scaffold export` goes the other way — a workspace printed as one of these files, to edit into another business's model; a starting point, never a source of truth. |
12
12
  | [docs/building_an_app.md](./docs/building_an_app.md) | The SEQUENCE — scaffold, model, types, queries, workflows, screens, ship — and the deploy-free inner loop. The other references describe contracts; this one is the order they go in and why. Read it once before starting an app. |
13
+ | [docs/clauses.md](./docs/clauses.md) | Every clause a plan's app or screen can state, what it draws, and a plan fragment stating it — generated from the schema, so it lists no clause the schema lacks and misses none it has. |
13
14
  | [docs/cli_reference.md](./docs/cli_reference.md) | Per-command contracts, flags, exit codes, and gotchas — the detail `--help` compresses. Read it before hand-building a `set_app_*` payload: several tools REPLACE rather than patch, and a CLI verb already owns the safe assembly. |
14
15
  | [docs/data_model.md](./docs/data_model.md) | How tables RELATE — one entity per table and the NAME-OVERLAP probe that says when a split has broken, one vocabulary wherever values are copied between tables, a copy boundary that accounts for every source field, provenance as a link rather than a flag, a declared natural key so find-or-create never compares rendered text, and why derived DEPTH costs more than row count. Separate from building_an_app because every workspace starts with tables and many never get an app. The within-table half (one fact, one column) is stated at `create_table` / `update_table`, where you meet it while deciding. |
15
16
  | [docs/document_templates.md](./docs/document_templates.md) | Generating PDF/Excel/Word/email from reusable templates. |
16
17
  | [docs/knowledge_docs.md](./docs/knowledge_docs.md) | Authoring the workspace facts an agent can't guess; access-vs-activation; catalog-then-stage retrieval. |
17
- | [docs/migration.md](./docs/migration.md) | What to DO when a release changes the shape of a project this CLI owns. Read once, when something already on disk no longer matches what the CLI writes — currently: an app built from a plan is `app.json` rendered by `@lotics/app-runtime`, not a tree of TSX. |
18
+ | [docs/migration.md](./docs/migration.md) | What to DO when a release changes the shape of a project this CLI owns. Read once, when something already on disk no longer matches what the CLI writes — for one, an app built from a plan is `app.json` rendered by `@lotics/app-runtime`, not a tree of TSX. |
18
19
  | [README.md](./README.md) | Install, auth, and worked examples. |
19
20
 
20
21
  ## Two surfaces, and the trap between them
package/README.md CHANGED
@@ -31,6 +31,8 @@ package (reachable at `node_modules/@lotics/cli/docs/*.md` once installed):
31
31
  - [`docs/building_an_app.md`](docs/building_an_app.md) — building a custom-code app end to end:
32
32
  the sequence the steps go in (clarify → model → types → queries → workflows → screens → ship)
33
33
  and the deploy-free inner loop. Read it once before starting an app.
34
+ - [`docs/clauses.md`](docs/clauses.md) — every clause a plan's app or screen can state, what it
35
+ draws, and a plan fragment stating it, generated from the schema.
34
36
  - [`docs/document_templates.md`](docs/document_templates.md) — generate finished documents
35
37
  (PDF, Excel, Word, email) by filling reusable templates: the five template types, the
36
38
  create → generate → chain lifecycle, and the marker capabilities.
@@ -350,10 +352,10 @@ lotics knowledge rm kdc_... # archive
350
352
  # no app row, no table and no credential in the run — then the same headless walk
351
353
  # `app check --screens` takes, at the same two widths, measured by the same probes.
352
354
  # Exits 1 on any finding and prints what each phase cost. A model with no `rows` is
353
- # refused: a register over nothing measures clean. It renders from a cached scratch
354
- # project beside the model file (`<dir>/.lotics/preview/`), installed once from the
355
- # registry — the kit and the runtime are published packages — and rewritten from the
356
- # plan on every run.
355
+ # refused: a register over nothing measures clean. It renders in the cached project
356
+ # of its dependency set (`~/.lotics/render/`, shared with `app check --screens`),
357
+ # installed once from the registry — the kit and the runtime are published packages
358
+ # — and rewritten from the plan on every run.
357
359
  lotics app preview model.json#sales_desk
358
360
  lotics app preview model.json#sales_desk --shots ./shots --width 375
359
361
 
@@ -393,14 +395,16 @@ lotics app api unpublish # end the promise
393
395
  # use this after a rename, or when a pull ran offline.
394
396
  lotics app codegen # import { F, OPT } from "../.lotics/app_fields"
395
397
 
396
- # Install @lotics/ui or @lotics/app-sdk from your CHECKOUT, to prove a kit change
397
- # on a real app before it is published: build, pack into .lotics/kit/, install by
398
- # file specifier, then hash one built file on both sides — a repack under the same
399
- # name is otherwise served from the lockfile's first tarball. `app check` warns and
398
+ # Install @lotics/app-runtime from your CHECKOUT, to prove a change on a real app
399
+ # before it is published: build, pack into .lotics/kit/, install by file
400
+ # specifier, then hash one built file on both sides — a repack under the same name
401
+ # is otherwise served from the lockfile's first tarball. `app check` warns and
400
402
  # `app deploy` refuses (--allow-local-kit ships it anyway), because that tarball is
401
- # not in the source archive. --published puts the registry version back.
402
- lotics app kit ../lotics/packages/ui
403
- lotics app kit ../lotics/packages/ui --published
403
+ # not in the source archive. --published puts back the range the app listed before
404
+ # the first checkout (an app with none recorded moves to the registry's). Either
405
+ # keeps @lotics/ui at the runtime's range and migrates an app on @lotics/app-sdk.
406
+ lotics app kit ../lotics/packages/app-runtime
407
+ lotics app kit --published
404
408
 
405
409
  # Every deploy pre-flight, WITHOUT the build or the version row: the app's own
406
410
  # typecheck over regenerated .lotics types, agent schemas vs the live app, aliases
@@ -410,9 +414,14 @@ lotics app check
410
414
  # --screens adds the rendered surface: each screen the app's navigation reaches,
411
415
  # and the first record each one opens onto a PAGE, headless in Chrome at 1280
412
416
  # and 375, measured against @lotics/ui docs/reviewing.md. --screen and --width
413
- # narrow it while you iterate on one screen.
417
+ # narrow it while you iterate on one screen. It renders in the cached project of the
418
+ # app's dependency set (~/.lotics/render/, shared with app preview) and prints what
419
+ # each phase cost. --changed walks only when something the screens read has moved
420
+ # since this checkout's last walk (.lotics/screens_check.json), and otherwise
421
+ # reprints that walk's report.
414
422
  lotics app check --screens
415
423
  lotics app check --screens --screen "Đơn hàng" --width 375
424
+ lotics app check --screens --changed
416
425
 
417
426
  # Running an app's alias is a TOOL call, like every other tool. Exits non-zero
418
427
  # when the RUN failed, not only when the call did.
@@ -439,6 +448,7 @@ lotics app workflow set issueInvoice # push the edited src/workflows/issu
439
448
  # to apps.queries (server-validated like a deploy). apps.queries is manifest-
440
449
  # authoritative, so the next `app deploy` re-syncs it — keep the manifest current.
441
450
  lotics app query set openInvoices # push package.json#lotics.queries.openInvoices
451
+ lotics app query run openInvoices --params '{"customer":"rec_..."}' # the bound query's rows, as a screen gets them
442
452
 
443
453
  # Move one alias out of this app and into another of the same workspace — the
444
454
  # declaration (and a workflow's body) land in the target project, the target is