@lotics/cli 0.263.0 → 0.264.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 +30 -50
- package/README.md +49 -205
- package/dist/src/cli.js +31069 -84675
- package/dist/src/cli.js.LEGAL.txt +0 -16
- package/dist/src/client.d.ts +18 -1231
- package/dist/src/client.js +14 -727
- package/dist/src/invocation.d.ts +1 -1
- package/docs/building_an_app.md +88 -409
- package/docs/cli_reference.md +9 -42
- package/docs/knowledge_docs.md +0 -8
- package/docs/migration.md +64 -97
- package/package.json +1 -1
- package/dist/probe_page.js +0 -2381
- package/dist/render_page.js +0 -67559
- package/dist/render_page.js.LEGAL.txt +0 -14
package/docs/migration.md
CHANGED
|
@@ -1,99 +1,66 @@
|
|
|
1
1
|
# @lotics/cli — migration notes
|
|
2
2
|
|
|
3
|
-
What
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
##
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
`
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
A
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
1. **
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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 export` | `lotics model pull [-o <model.json>]` — the workspace's model, rebuilt from what owns each part |
|
|
22
|
+
| `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 |
|
|
23
|
+
| `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 |
|
|
24
|
+
| `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 |
|
|
25
|
+
| `lotics app rename`, `app subdomain`, `package.json#lotics.capabilities` | `lotics run update_app` (`name`, `public_subdomain`, `capabilities`) |
|
|
26
|
+
| `lotics app api publish` / `unpublish` | `lotics run publish_app_api` / `unpublish_app_api` |
|
|
27
|
+
| `lotics field rename` | `lotics run update_table`, then the same label in the model file |
|
|
28
|
+
| `lotics file preview` | `lotics file download <fil_id>`, then open it |
|
|
29
|
+
| `model.json#apply` (`[{package, bind}]`) | state the tables under `entities` — a model carrying `apply` is refused |
|
|
30
|
+
| `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 |
|
|
31
|
+
| `model.json#from` (with `variants`, `rename`) | state every table under `entities` — a model carrying `from` is refused |
|
|
32
|
+
| `lotics library init <apg_id>`, `lotics setup <apg_id>` | nothing copies a package any more: write a `model.json` (`lotics docs model`), then `lotics setup model.json` or `lotics model apply model.json` |
|
|
33
|
+
|
|
34
|
+
`lotics tools` lists every tool, and `lotics tools <name>` prints its input.
|
|
35
|
+
|
|
36
|
+
**An existing JSON app moves on the first `lotics model apply`** of the model it came from: that
|
|
37
|
+
apply binds each app alias to the app it already became and mints its next version from the file.
|
|
38
|
+
A directory an earlier CLI wrote (`app.json`, `src/workflows/`, `.lotics/`, `package.json#lotics`
|
|
39
|
+
with `plan`, `queries` or `workflows`) is no longer read by anything; keep the model file, delete the
|
|
40
|
+
rest.
|
|
41
|
+
|
|
42
|
+
**Authored workflow bodies** an act names (`workflow` on an act) are the live workflow's own body:
|
|
43
|
+
the apply keeps it, and `lotics run set_app_workflow` changes it.
|
|
44
|
+
|
|
45
|
+
## Custom-code apps use `@lotics/app-sdk`
|
|
46
|
+
|
|
47
|
+
A hand-written app depends on `@lotics/app-sdk` alone — the hooks (`useQuery`, `useWorkflow`, …),
|
|
48
|
+
`mount`, and `AppRouter` from `@lotics/app-sdk/router` — and draws with its own React.
|
|
49
|
+
`@lotics/app-runtime` and `@lotics/ui` are no longer published: the runtime is what the platform
|
|
50
|
+
draws a model's app with, and it ships with the platform.
|
|
51
|
+
|
|
52
|
+
An app that listed `@lotics/app-runtime`:
|
|
53
|
+
|
|
54
|
+
1. **The dependency.** `@lotics/app-sdk` replaces `@lotics/app-runtime` in `package.json`.
|
|
55
|
+
2. **The import specifiers.** `@lotics/app-runtime/sdk` becomes `@lotics/app-sdk`, and
|
|
56
|
+
`@lotics/app-runtime/router` becomes `@lotics/app-sdk/router` — in `src/` and in
|
|
57
|
+
`vite.config.ts`.
|
|
58
|
+
3. **The kit.** An app that imports `@lotics/ui` keeps the version it already installed; no newer one
|
|
59
|
+
is published. Its screens can stay on it, or move to plain React (or any library) one screen at a
|
|
60
|
+
time.
|
|
61
|
+
4. **`package.json#lotics`** needs only `app_id`, `workspace_id` and `current_version_id`. The live
|
|
62
|
+
app owns its `queries`, `workflows`, `agents` and `capabilities`, and `lotics app deploy` refuses
|
|
63
|
+
a directory that still declares any of them; delete them, and the unread `synced` block.
|
|
64
|
+
5. `lotics app deploy` builds the directory and uploads it as a new version.
|
|
65
|
+
|
|
66
|
+
A deployed app keeps running on the bundle it shipped until it is deployed again.
|