@lotics/cli 0.316.26 → 0.317.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 +1 -1
- package/dist/src/cli.js +113 -56
- package/docs/agent_surface.md +5 -3
- package/docs/building_an_app.md +4 -3
- package/docs/data_model.md +2 -1
- package/docs/design.md +13 -9
- package/docs/document_templates.md +6 -0
- package/docs/examples.md +659 -678
- package/docs/first_build.md +21 -24
- package/docs/getting_started.md +1 -0
- package/docs/workflows.md +1 -1
- package/package.json +1 -1
package/docs/first_build.md
CHANGED
|
@@ -95,33 +95,36 @@ Every paper the owner sends is made, one template each. A slot is named after a
|
|
|
95
95
|
| Expected against counted, before against after | a List with `compare: {"before": …, "after": …}` | `reference/list-node` |
|
|
96
96
|
| Ranked by a figure | List `sort: {"field": …, "desc": true}` | `reference/list-node` |
|
|
97
97
|
| Moved through a status (stages) | an Act per move, `status.dates`, Readings | `reference/act-node` |
|
|
98
|
-
| Each belonging to another row | a child List on its
|
|
98
|
+
| Each belonging to another row | a child List on its page | `reference/list-node` |
|
|
99
99
|
| Counted over a period | Tabs over one `period`; Readings | `reference/tab-node` |
|
|
100
100
|
| Papers a case gathers | a List with `expect`; an Act's `template` | `reference/list-node` |
|
|
101
101
|
|
|
102
102
|
Any other screen: `design/treatments`.
|
|
103
103
|
|
|
104
|
-
|
|
104
|
+
**Start from one root List.** `{"type": "List", "entity": "cake_order"}` in the App's `children` is a whole app: the platform draws the page every row opens (a Section per stage with its moves, the cakes as a child List), the add and the Delete. `set_app` answers with what it drew and what it placed or folded in what you stated; state only the difference. The tree below states this counter's choices.
|
|
105
|
+
|
|
106
|
+
One app, the counter's job, over the tables and template above. The register lists the orders; its page in `pages` has a Section per stage, and each Act sets the next stage. The cakes are a child List of the open order, added in place with `create`. Starting to bake asks for the deposit, readying makes the slip, collecting waits for payment.
|
|
105
107
|
|
|
106
108
|
```json
|
|
107
109
|
{
|
|
108
110
|
"body": {
|
|
109
111
|
"type": "App", "key": "counter", "name": "Counter", "color": "amber",
|
|
110
112
|
"children": [
|
|
111
|
-
{"type": "List", "entity": "cake_order", "filters": ["customer"], "create": ["customer", "due_on", "pay_by"]
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
]},
|
|
120
|
-
{"type": "
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
113
|
+
{"type": "List", "entity": "cake_order", "filters": ["customer"], "create": ["customer", "due_on", "pay_by"]}
|
|
114
|
+
],
|
|
115
|
+
"pages": [
|
|
116
|
+
{"type": "Record", "entity": "cake_order", "door": "page", "children": [
|
|
117
|
+
{"type": "Section", "key": "order", "title": "Order", "at": ["taken", "baking"], "children": [
|
|
118
|
+
"due_on",
|
|
119
|
+
"pay_by",
|
|
120
|
+
{"type": "List", "entity": "cake_line", "create": ["item", "quantity"]},
|
|
121
|
+
{"type": "Act", "key": "start_baking", "label": "Start baking", "when": {"stage": ["taken"]}, "requires": ["due_on"], "asks": ["prepaid"], "set": {"stage": "baking"}},
|
|
122
|
+
{"type": "Act", "key": "ready", "label": "Ready", "when": {"stage": ["baking"]}, "set": {"stage": "ready"}, "template": "order_slip", "into": "slip"}
|
|
123
|
+
]},
|
|
124
|
+
{"type": "Section", "key": "pickup", "title": "Pickup", "at": ["ready"], "children": [
|
|
125
|
+
{"field": "balance", "edit": false},
|
|
126
|
+
{"field": "slip", "edit": false},
|
|
127
|
+
{"type": "Act", "key": "collect", "label": "Collected", "when": {"stage": ["ready"], "paid": true}, "set": {"stage": "collected"}}
|
|
125
128
|
]}
|
|
126
129
|
]}
|
|
127
130
|
]
|
|
@@ -129,20 +132,14 @@ Here one app, the counter's job, naming the tables and the template by the alias
|
|
|
129
132
|
}
|
|
130
133
|
```
|
|
131
134
|
|
|
132
|
-
`set_app` answers with a note for what the rows call for that the tree leaves out
|
|
135
|
+
`set_app` answers with a note for what the rows call for that the tree leaves out. It places what has one fix and stores the placed tree: a reader's `where` moved to `opens`, a `row.subtitle` made `columns`, Acts alike but for their key made one. These fold with one note: a read-only copy of a placed Field, `create`/`remove: false` on a read-only List, its `app` where one app is over its table, a lone text field's `unique`, a patch address unlike the node's `key`. **What the check refuses**, each with its id (`reference/<id>` is its page; some show a wrong → right):
|
|
133
136
|
|
|
134
|
-
- `record.placed-once`: a Field, child List, Reading, Statement or Act stands once in a Record, whose head draws the title, subtitle, image, status, figure.
|
|
137
|
+
- `record.placed-once`: a Field, child List, Reading, Statement or Act stands once in a Record, whose head draws the title, subtitle, image, status, figure; a read-only repeat is left out and said.
|
|
135
138
|
- `list.filter-unshown`: a `filters` entry (at most 3) is a select, member, link, date, yes/no or number the rows show, or a formula of such; never text, and the status is the chips already.
|
|
136
139
|
- `list.columns-budget`: `columns` fit the room a desk leaves beside the name, status, deadline and figure.
|
|
137
140
|
- `act.requires-drawn`: an Act's `requires` field is drawn in its Section or asked by it.
|
|
138
|
-
- `app.logs`: a further List at the App's root is a log (at most 3) with its own `key`, over another table than the register's.
|
|
139
141
|
- `act.makes-or-runs`: an Act makes a `template` or runs a `workflow`.
|
|
140
|
-
- `reading.list-app`: a List's `app` has its register over that List's table.
|
|
141
|
-
- `list.list-opens`: a read-only child List opens its rows in the drawer, so its table is one a List of the app draws, or its `app` names the app that works it.
|
|
142
|
-
- A Field's `label` or `when` stands only on a gallery or prose Field (files, markdown text, or `block: true`).
|
|
143
|
-
- `entity.unique`: a `unique` set holds two fields or more of one value each (text, number, date, single select, one-row link).
|
|
144
142
|
- `app.names-declared`: each alias a key names exists (a table, field, option, Act `key`, template).
|
|
145
|
-
- A Query's `sort` is `{"field": …, "desc": true}` (`desc` optional) or a list of them, beside `fields`.
|
|
146
143
|
- A workflow writes a link as ids, `[x.id]`; a whole record or bare value is refused.
|
|
147
144
|
|
|
148
145
|
Then `set_access` gives the app to the people whose job it is: a `principal_type` of `member` (id from `get_workspace`, `kind: "member"`), `member_group` (an admin lists them: `kind: "group"`) or `organization`, a `role` of `user` or `manager`; none loses access.
|
package/docs/getting_started.md
CHANGED
|
@@ -5,6 +5,7 @@ A workspace is where one business keeps what it knows and does its daily work. *
|
|
|
5
5
|
Open the one page for the job. Pages are read with the `docs` tool (`docs path="design"`; `lotics docs design` on the CLI).
|
|
6
6
|
|
|
7
7
|
- **Build a workspace from a description:** `docs path="first_build"`. Ask the owner once, only what their papers and your defaults cannot settle, usually their papers and lists first, then a whole bakery built call by call: tables with a check, the paper, the app (which apps, a treatment per kind of row, what the check refuses, who gets it), the owner's rows, then pressing it.
|
|
8
|
+
- **An app starts as one root List:** `{"type": "List", "entity": "order"}` in the App's `children` draws the page, the add and the Delete. The write's answer shows what it drew, placed or folded; change only the difference (`first_build`, § 3).
|
|
8
9
|
- **Change an app:** `docs path="reference/changing-an-app"`. `get_app`, then `set_app` with `nodes` and `base_version_id`. A table is changed with `get_table`, then `set_tables` with its `table_id` (`data_model`).
|
|
9
10
|
- **Enforce a rule on a table:** `docs path="workflows/table-checks"`. A condition no create, update or delete may meet, whoever makes it, and the language it is written in.
|
|
10
11
|
- **Make a document:** `docs path="document_templates"`. A template, its slots and loops, and the act that files it on a record.
|
package/docs/workflows.md
CHANGED
|
@@ -81,7 +81,7 @@ All three carry `trigger.trigger_id`.
|
|
|
81
81
|
| wait | `await wait({ duration_in_minutes: 5 });` |
|
|
82
82
|
| wait for an event | `await wait_for_event({ event_type: "webhook", event_ref: <expr>, timeout_in_minutes: 60 });` |
|
|
83
83
|
| wait for an approval | `await wait_for_approval({ approvers: <expr>, prompt: <expr> });` — see **Waiting for an approval** |
|
|
84
|
-
| return | `return({ status: "success" \| "error", message: <expr>, field_errors: { ... }?, data: { ... }? });` — `data` holds the outputs a Workflow node declares |
|
|
84
|
+
| return | `return({ status: "success" \| "error", message: <expr>, field_errors: { ... }?, data: { ... }? });` — `data` holds the outputs a Workflow node declares — a return of `error` undoes no write a step before it made, so every refusal stands before the body's first write |
|
|
85
85
|
| validate | `validate({ checks: [{ fail_when: <expr>, field_key: "...", message: <expr> }, ...] });` |
|
|
86
86
|
|
|
87
87
|
A delayed run is never cancelled from a workflow: after a `wait`, it reads the row's state and acts only if it still holds.
|