@lotics/cli 0.188.0 → 0.189.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 +6 -0
- package/README.md +53 -2
- package/dist/src/cli.js +3270 -403
- package/dist/src/client.d.ts +298 -10
- package/dist/src/client.js +118 -14
- package/docs/building_an_app.md +1 -1
- package/docs/cli_reference.md +11 -6
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -8,6 +8,7 @@ conventions are, and where the traps are.
|
|
|
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
10
|
| `lotics docs` · `lotics docs <area>` | 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. |
|
|
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. |
|
|
11
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. |
|
|
12
13
|
| [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. |
|
|
13
14
|
| [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. |
|
|
@@ -41,6 +42,11 @@ whether something exists, read `lotics --help` § COMMANDS — the whole section
|
|
|
41
42
|
from a shell serving many. Every command that resolves a workspace echoes its target to **stderr**
|
|
42
43
|
(`lotics → <org> / <workspace>`); read it back before trusting a write. `file preview <fil_…>` is
|
|
43
44
|
the one credentialed command with no echo. Resolution precedence is in README § Organizations.
|
|
45
|
+
- **A machine with no key can still sign in.** `lotics auth login <email>` has Lotics email the
|
|
46
|
+
person a sign-in link; they open it and press Confirm on the page showing the code the command
|
|
47
|
+
printed, and the command finishes holding their credential. `lotics setup` does the same by itself
|
|
48
|
+
when the email it was given already has an account, so a second run of the onboarding prompt
|
|
49
|
+
carries on rather than asking anyone for an API key.
|
|
44
50
|
- **Large payloads bypass `ARG_MAX`** — `lotics run <tool> @args.json` or piped stdin. A leading `@` is
|
|
45
51
|
unambiguously a file path (JSON args start with `{`).
|
|
46
52
|
- **stdout is the payload, stderr is the narration.** Progress, status lines, and the target echo go to
|
package/README.md
CHANGED
|
@@ -36,7 +36,7 @@ package (reachable at `node_modules/@lotics/cli/docs/*.md` once installed):
|
|
|
36
36
|
workspace facts an agent can't guess, the access-vs-activation model, and the
|
|
37
37
|
catalog-then-stage retrieval model agents use to pull only the lines they need.
|
|
38
38
|
|
|
39
|
-
## Start from
|
|
39
|
+
## Start from the library, in one command
|
|
40
40
|
|
|
41
41
|
Install the CLI, then copy a starter — it creates the account, copies the starter into its
|
|
42
42
|
workspace, deploys its apps, and prints a one-time sign-in link:
|
|
@@ -52,7 +52,44 @@ you pull an app's source to change it (`lotics app pull <app_id>`) and build it
|
|
|
52
52
|
|
|
53
53
|
Add `--json` for one machine-readable object instead of progress — the organization, the
|
|
54
54
|
workspace, the app ids, what was created, the sign-in link, and any warnings. Already signed in?
|
|
55
|
-
Drop `--email` and `lotics setup <
|
|
55
|
+
Drop `--email` and `lotics setup <apg_id>` copies into the account you have.
|
|
56
|
+
|
|
57
|
+
`lotics library list` reads both shelves with no account at all. **Presets** are a trade's model,
|
|
58
|
+
named by a slug: read one and write a `model.json` from it — nothing is copied. **Packages** are
|
|
59
|
+
apps and the tables they stand on, named `apg_…`, copied in whole; each row names how many tables
|
|
60
|
+
and which apps a copy creates, so what you actually manage can be matched against them.
|
|
61
|
+
`lotics library show <slug|apg_id>` reads one, with no account either — each table as
|
|
62
|
+
`alias · label`, each field as `alias:type`, and a preset's variants beside the sentence that
|
|
63
|
+
selects each.
|
|
64
|
+
|
|
65
|
+
## Or describe your own workspace
|
|
66
|
+
|
|
67
|
+
A `model.json` names the tables, fields, options, links, views, roles and first rows, and
|
|
68
|
+
`lotics setup` builds them. **Start from a preset when one is your trade** — name it instead of
|
|
69
|
+
restating it:
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"from": "field_service",
|
|
74
|
+
"variants": ["crews"],
|
|
75
|
+
"rename": { "job": { "label": "Jobs", "fields": { "code": "Job no." } } },
|
|
76
|
+
"rows": { "job": [{ "ref": "j1", "fields": { "code": "J-1" } }] }
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
No preset is your trade? Write the full form instead, spelling the tables out. Either way:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
lotics scaffold docs # how to write one, both forms, with a worked example. Offline
|
|
84
|
+
lotics scaffold check model.json # prove it — every problem at once, offline unless it names a preset
|
|
85
|
+
lotics setup model.json --email you@company.com
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
It creates no apps of its own: build one in the workspace afterwards
|
|
89
|
+
(`lotics docs building_an_app`), or name a published package in the file's `apply` list and it is
|
|
90
|
+
copied in — bound onto the tables the model just made — as part of the same run.
|
|
91
|
+
`setup` refuses a table name your workspace already has; `lotics scaffold apply model.json` is the
|
|
92
|
+
additive verb — it adopts that table, adds what the model declares beyond it, and deletes nothing.
|
|
56
93
|
|
|
57
94
|
## Install
|
|
58
95
|
|
|
@@ -81,6 +118,13 @@ lotics auth signup # interactive prompts
|
|
|
81
118
|
lotics auth signup a@b.com --name "Agent" # non-interactive
|
|
82
119
|
```
|
|
83
120
|
|
|
121
|
+
**`lotics auth login`** — Signs in an account that already exists, on a machine that holds no key. Lotics emails a sign-in link; open it and press Confirm on the page showing the code the command printed, and the command finishes with the credential saved as a profile.
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
lotics auth login a@b.com # waits until you press Confirm
|
|
125
|
+
lotics auth login a@b.com --local # pins this directory to that org
|
|
126
|
+
```
|
|
127
|
+
|
|
84
128
|
**`lotics auth web`** — Send a magic link email to access the web app (requires prior signup or setup).
|
|
85
129
|
|
|
86
130
|
```bash
|
|
@@ -289,6 +333,13 @@ lotics app deploy -m "Add quote drawer" # typecheck + build + upload a new ve
|
|
|
289
333
|
lotics app versions # deploy history: version, when, who, -m message (* = live)
|
|
290
334
|
lotics app versions app_... # ...for any app, without pulling it first
|
|
291
335
|
|
|
336
|
+
# Apply the latest version of the package this app was COPIED from. Additive on
|
|
337
|
+
# the schema; a workflow or agent you have edited here is kept and named, and so
|
|
338
|
+
# is a field the new version stopped declaring. Redeploys from the published
|
|
339
|
+
# dist, so nothing local is sent — pull afterwards to edit the new code.
|
|
340
|
+
lotics app upgrade # the app this directory's manifest names
|
|
341
|
+
lotics app upgrade app_... # ...for any app, without pulling it first
|
|
342
|
+
|
|
292
343
|
# Regenerate .lotics/* WITHOUT a deploy: the .d.ts type companions (always) +
|
|
293
344
|
# the runtime app_fields.ts (when authenticated) — F/OPT maps that address
|
|
294
345
|
# fields + select options by stable display-name aliases instead of opaque ids.
|