@lotics/cli 0.263.0 → 0.266.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/docs/migration.md CHANGED
@@ -1,99 +1,72 @@
1
1
  # @lotics/cli — migration notes
2
2
 
3
- What an app author has to DO when a release changes the shape of a project the CLI owns. Every
4
- other contract is `docs/cli_reference.md`; this file is the one a reader opens once, because
5
- something already on disk no longer matches what the CLI writes.
6
-
7
- ## Opt-in history and starts, `app.json` version 4
8
-
9
- A record's status history and an add's starting values are stated, never inferred. The history is still
10
- written on every move; it is drawn only where the app asks.
11
-
12
- 1. **`record.history: true`** on each app whose record should show its status history beside it (a
13
- shipment, a gate in and out, an order and its logistics). Without it the history is drawn nowhere. A
14
- block of the history entity in a section is refused: `record.history` draws it.
15
- 2. **`records.<e>.starts: { <field>: "today" | "me" }`** where an add should start a date at today (a
16
- moment at now) or a member at the reader. Without it such a field starts empty.
17
- 3. **`lotics app regenerate`** writes `app.json` version 4; a version 3 spec stops at its first render with
18
- `app.json is version 3; this runtime reads version 4`.
19
-
20
- ## A record's `sections`, `app.json` version 3
21
-
22
- A record is its `sections`, stacked in the order the work reaches them, replacing `record.facts` and
23
- `record.blocks`: each section a `title`, its `fields`, the `acts` under them and its `blocks`, and `at`
24
- naming the status options it is the work of. The comment thread is `record.comments: true`, never a
25
- block. `lotics scaffold check` refuses `facts`, `blocks` and a comments block by name.
26
-
27
- 1. **Restate each record.** Each fact group becomes a section with its title and fields; move each
28
- block into the section it belongs to (a leg's fees into that leg's section, narrowed by `where`);
29
- name in `acts` the acts whose inputs live there — an act no section names is a button in the header.
30
- A staged section's acts are offered during its stage alone: an act offered at other stages stands
31
- in their section, in a section with no `at`, or in the header.
32
- 2. **`lotics app regenerate`** in the app directory writes `app.json` version 3. `@lotics/app-runtime`
33
- reads version 3 alone: a version 2 spec stops at its first render with `app.json is version 2; this
34
- runtime reads version 3`.
35
-
36
- ## Apps built from a model: `records` and `apps`
37
-
38
- A model states an app in one vocabulary: `records` says how a row of each entity is recognised (its
39
- title, the line under it, its picture, its status, its figure, its deadlines), and each entry of
40
- `apps` is one register over one entity and the record its rows open — its columns and filters, its
41
- sections, its acts and its checks (`lotics docs model/apps`). How each piece looks is the runtime's;
42
- no key changes it. `lotics app create --from` compiles that into `app.json`, and an older spec stops
43
- at its first render naming the version this runtime reads.
44
-
45
- What a model no longer holds, each refused by name by `lotics scaffold check`:
46
-
47
- - **`field_roles`, screen shapes and their clauses** — `records` and `apps` state what they stated.
48
- - **`table_workflows`** — a model keeps no table automation. A status `history` is appended by the
49
- app's own generated write that moves the status.
50
- - **`connections`** — nothing in a model pushes through an account any more.
51
-
52
- ### Moving an app generated from an earlier model
53
-
54
- 1. **Restate the model.** Replace `field_roles` with a `records` entry per entity the app lists,
55
- opens or picks, and each app with its register, record, acts and checks. `lotics scaffold check`
56
- prints every app as its reader will see it; `lotics app preview <model.json>#<app>` draws it.
57
- 2. **`lotics app regenerate`** in the app directory. It rewrites `app.json`, `src/main.tsx` and the
58
- generated workflow bodies. The generated aliases are new (`<entity>_list`, `create_<entity>`,
59
- `act_<alias>`, …), so the old ones are retired: their bodies are deleted and the next
60
- `lotics app deploy` unbinds them.
61
- 3. **A component the app took over keeps its file, and loses what it wrapped.** The runtime exports
62
- no screen, section or act renderer, and `lotics app eject` is gone. A part the vocabulary now
63
- states goes back into the model; a record part it cannot state is a `component` block (the
64
- component is handed `{ record, spec, refresh }` — `lotics docs components`); an act whose write
65
- `set` cannot say names its own `workflow`, which runs after the generated guards.
66
- 4. **Remove the history automations an earlier `scaffold apply` installed.** They are not deleted
67
- by anything, and beside the app's own history append every move would write two rows.
68
- `lotics run remove_table_workflow` takes each one off its table.
69
- 5. `lotics app check`, then `lotics app deploy`.
70
-
71
- ### What `app regenerate` owns
72
-
73
- - **No three-way merge, and no conflict markers.** The generator owns every file it emits:
74
- `app.json` is compiled whole; a generated workflow body is rewritten and what it replaced is parked
75
- in `.lotics/regenerate-dropped.patch`, file by file.
76
- - **Two things are yours**: `src/components/` (seeded where it is absent, named back where you have
77
- changed it, never rewritten), and an act's own `workflow`, of which only the guard region between
78
- its `<lotics:guards>` markers is rewritten.
79
- - A TSX app with no `app.json` is untouched by all of this. Delete `package.json#lotics.plan` and it
80
- is a hand-written project like any other; `app regenerate` then refuses, which is the correct
81
- answer for a tree nothing generates.
82
-
83
- ## The SDK is part of the runtime
84
-
85
- `@lotics/app-sdk` moved into `@lotics/app-runtime`. One package carries the hooks, the router and
86
- the renderer, so an app lists one range and a kit correction cannot reach the renderer without
87
- reaching the hooks it reads through. An app changes two things:
88
-
89
- - **The dependency.** `@lotics/app-runtime` replaces `@lotics/app-sdk`. `@lotics/ui` stays beside it
90
- only where the app's own code imports the kit, at the range the runtime depends on: two ranges
91
- are two copies of the kit, neither seeing the other's context.
92
- - **The import specifiers.** `@lotics/app-sdk` becomes `@lotics/app-runtime/sdk`, and
93
- `@lotics/app-sdk/router` becomes `@lotics/app-runtime/router` — in `src/`, and in `vite.config.ts`,
94
- whose test optimizer names the SDK in a scaffolded app.
95
-
96
- `lotics app kit --published` makes the first two: it rewrites every quoted specifier, drops the
97
- dependency, installs the runtime and names each file it rewrote. `lotics app regenerate` does the
98
- same, and so does `lotics workspace build` for every app it regenerates; `lotics app check` names
99
- every app still listing `@lotics/app-sdk`. A deployed app keeps running on the bundle it shipped until it is rebuilt.
3
+ What to DO when a release changes the shape of something the CLI once wrote to disk. Every other
4
+ contract is `docs/cli_reference.md`; this file is the one a reader opens once, because something
5
+ already on disk no longer matches what the CLI does.
6
+
7
+ ## Local app projects are gone
8
+
9
+ An app built from a model no longer lives in a directory. The live app is the only edit surface:
10
+ each change mints a new version of it, and rolling back to an earlier version is the undo. What
11
+ the app is — its screens (`app.json`), its queries, workflows, agents and capabilities, and the
12
+ model body it was compiled from — is held by that version, and the model's tables, fields, options,
13
+ templates and roles are the workspace's own.
14
+
15
+ | What you ran | What replaces it |
16
+ |---|---|
17
+ | `lotics scaffold check` + `scaffold apply` | `lotics model apply <model.json>` — checks the file, applies the tables and rows, then mints a version of every app it declares |
18
+ | `lotics workspace build <model.json>` | `lotics model apply <model.json>` |
19
+ | `lotics app create --from <model.json>#<app>` | `lotics model apply <model.json> --app <app>` |
20
+ | `lotics app regenerate` | change the model file, then `lotics model apply` |
21
+ | `lotics scaffold diff` | `lotics model apply <model.json> --plan` — what the apply would change, writing nothing |
22
+ | `lotics scaffold export` | `lotics model pull [-o <model.json>]` — the workspace's model, rebuilt from what owns each part |
23
+ | `lotics app pull`, `app codegen`, `app check`, `app dev`, `app preview` | nothing local: read an app with `lotics run get_app`, and change it through its tools |
24
+ | `lotics app workflow set` / `app query set` / `app agent set` | `lotics run set_app_workflow` / `set_app_query` / `set_app_agent` — each mints a version |
25
+ | `lotics app versions` + a redeploy of an old tree | `lotics run query_app_versions`, then `lotics run rollback_app` — restores the app's earlier version; table changes and data writes stay |
26
+ | `lotics app rename`, `app subdomain`, `package.json#lotics.capabilities` | `lotics run update_app` (`name`, `public_subdomain`, `capabilities`) |
27
+ | `lotics app api publish` / `unpublish` | `lotics run publish_app_api` / `unpublish_app_api` |
28
+ | `lotics field rename` | `lotics run update_table`, then the same label in the model file |
29
+ | `lotics app kit` | nothing: a custom-code app depends on `@lotics/app-sdk` (below) |
30
+ | `@lotics/xlsx` / `@lotics/docx` to build a template's file | any `.xlsx` / `.docx` library, then `lotics upload` (`lotics docs document_templates`) |
31
+ | `lotics file preview` | `lotics file download <fil_id>`, then open it |
32
+ | `model.json#apply` (`[{package, bind}]`) | state the tables under `entities` — a model carrying `apply` is refused |
33
+ | `lotics library list` / `library show <slug>`, `lotics preset list` / `preset show <slug>` | the example models at `https://lotics.ai/presets/index.json`, each a complete `model.json` to adapt |
34
+ | `model.json#from` (with `variants`, `rename`) | state every table under `entities` — a model carrying `from` is refused |
35
+ | `lotics library init <apg_id>`, `lotics setup <apg_id>`, `lotics app upgrade`, `lotics library fixtures` | nothing copies a package any more: write a `model.json` (`lotics docs model`), then `lotics setup model.json` or `lotics model apply model.json` |
36
+
37
+ `lotics tools` lists every tool, and `lotics tools <name>` prints its input.
38
+
39
+ **An existing JSON app moves on the first `lotics model apply`** of the model it came from: that
40
+ apply binds each app alias to the app it already became and mints its next version from the file.
41
+ A directory an earlier CLI wrote (`app.json`, `src/workflows/`, `.lotics/`, `package.json#lotics`
42
+ with `plan`, `queries` or `workflows`) is no longer read by anything; keep the model file, delete the
43
+ rest.
44
+
45
+ **Authored workflow bodies** an act names (`workflow` on an act) are the live workflow's own body:
46
+ the apply keeps it, and `lotics run set_app_workflow` changes it.
47
+
48
+ **A model written before `party`** draws its people and organisations as things — a row with no
49
+ picture shows no initials: state `party` (`person` or `organization`) on those entities' `records`.
50
+
51
+ ## Custom-code apps use `@lotics/app-sdk`
52
+
53
+ A hand-written app depends on `@lotics/app-sdk` alone — the hooks (`useQuery`, `useWorkflow`, …),
54
+ `mount`, and `AppRouter` from `@lotics/app-sdk/router` — and draws with its own React.
55
+ `@lotics/app-runtime` and `@lotics/ui` are no longer published: the runtime is what the platform
56
+ draws a model's app with, and it ships with the platform.
57
+
58
+ An app that listed `@lotics/app-runtime`:
59
+
60
+ 1. **The dependency.** `@lotics/app-sdk` replaces `@lotics/app-runtime` in `package.json`.
61
+ 2. **The import specifiers.** `@lotics/app-runtime/sdk` becomes `@lotics/app-sdk`, and
62
+ `@lotics/app-runtime/router` becomes `@lotics/app-sdk/router` — in `src/` and in
63
+ `vite.config.ts`.
64
+ 3. **The kit.** An app that imports `@lotics/ui` keeps the version it already installed; no newer one
65
+ is published. Its screens can stay on it, or move to plain React (or any library) one screen at a
66
+ time.
67
+ 4. **`package.json#lotics`** needs only `app_id`, `workspace_id` and `current_version_id`. The live
68
+ app owns its `queries`, `workflows`, `agents` and `capabilities`, and `lotics app deploy` refuses
69
+ a directory that still declares any of them; delete them, and the unread `synced` block.
70
+ 5. `lotics app deploy` builds the directory and uploads it as a new version.
71
+
72
+ A deployed app keeps running on the bundle it shipped until it is deployed again.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lotics/cli",
3
- "version": "0.263.0",
3
+ "version": "0.266.0",
4
4
  "description": "Lotics SDK and CLI for AI agents",
5
5
  "type": "module",
6
6
  "bin": {