@lotics/cli 0.321.54 → 0.321.56

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/design.md CHANGED
@@ -143,7 +143,7 @@ or its entity is read-only (`edit: false`); a stepped status is not, since Acts
143
143
  **Record**
144
144
 
145
145
  - `entity` (alias, required): The table whose rows open on this page
146
- - `children` (list of (alias | Field | Fieldset | Section | Side | Outside | List | Reading | Statement | Comments | Act | Check) (at least one)): Parts (Section, Side), or for a one-part record its Fields, Fieldsets, Lists, Readings, Statements and Comments directly
146
+ - `children` (list of (List over a Query in a Record | alias | Field | Fieldset | Section | Side | Outside | List | Reading | Statement | Comments | Act | Check) (at least one)): Parts (Section, Side), or for a one-part record its Fields, Fieldsets, Lists, Readings, Statements and Comments directly
147
147
  - `add` (`false` | list of alias (at least one)): What a new row asks where a picker of this entity offers one, anywhere in the App
148
148
  - `row` (Record row): How the App reads this entity's rows wherever it lists them
149
149
  - `door` (`"page"` | `"drawer"`): How a row opens, on a page or in a drawer
@@ -152,7 +152,7 @@ or its entity is read-only (`edit: false`); a stepped status is not, since Acts
152
152
 
153
153
  - `title` (text): The part's heading
154
154
  - `key` (alias): Unique among its siblings
155
- - `children` (list of (alias | Field | Fieldset | List | Reading | Statement | Comments | Act | Check) (at least one)): What the part draws, in reading order
155
+ - `children` (list of (List over a Query in a Record | alias | Field | Fieldset | List | Reading | Statement | Comments | Act | Check) (at least one)): What the part draws, in reading order
156
156
  - `at` (list of alias (at least one)): Options of the record's status during which this part is the work now
157
157
  - `when` (condition): Drawn only while this holds
158
158
 
package/docs/workflows.md CHANGED
@@ -102,7 +102,8 @@ mails it to their own address, with no connection. Its recipients are members by
102
102
  connected Gmail or Outlook (`gmail_send_email`, `outlook_send_email`), which leaves an unsent draft unless `draft` is
103
103
  `false`.
104
104
 
105
- `return` is a call, not a JavaScript `return` statement. `validate` ends the workflow with an error
105
+ `return` is a call, not a JavaScript `return` statement. A `success` may leave out `message`, and a bare
106
+ `return;` is that success; an `error` states its `message`. `validate` ends the workflow with an error
106
107
  when a check's `fail_when` is truthy; the check's `field_key` names the control its message lands on —
107
108
  in an app workflow a declared input, or the alias of a field on a table the body names; in an
108
109
  automation it is not checked.
@@ -180,7 +181,7 @@ A body names a table or document template by its alias (`query_records({ table_i
180
181
  5. **`==` against a multi-select means "includes".** `record["tags"] == "urgent"` on a multi-select is stored as
181
182
  `includes(record["tags"], "urgent")`; either spelling works.
182
183
  6. **`option("<field>", "<option>")` names an option where no select is beside it** (a name set once and compared later,
183
- a list of options, a value handed to a tool). It reads as the option, typed as that select's, and is stored as its alias.
184
+ a list of options, a value handed to a tool). It reads as the option, typed as that select's, and is stored as its alias. The field is a select or a formula that states `options`.
184
185
  The field is looked up among the tables the body reaches; a field or option that does not exist is refused naming both, and
185
186
  a field alias that two tables state with different keys for that option is refused naming each table. An option
186
187
  key written out reads as its alias, but write `option()`: a key is a value no one can read.
@@ -470,7 +471,7 @@ longer one starts again, each row written as it is reached, and three thousand r
470
471
  an awaited call gives a run. A sheet of up to about a thousand rows loops; a larger one is written in batches.
471
472
 
472
473
  The batched form reads the table's keys once and writes in calls of up to a thousand rows. `query_records` the table
473
- in pages, `groupBy` the key, split the sheet's rows into those with no row yet and those whose cells differ, then
474
+ in pages (a call reads 50 rows unless it states a `limit`, and 1000 at most), `groupBy` the key, split the sheet's rows into those with no row yet and those whose cells differ, then
474
475
  `create_records` the first and `update_records` the second in its per-record form (`field_keys` and one `rows` entry per
475
476
  `record_ids` entry). Ten thousand rows took about seven seconds, a repeat with nothing changed under three, and the
476
477
  whole of it is one transaction at that size. The body does the comparison, so it writes only what differs:
@@ -895,7 +896,7 @@ keeps the workflow without running it (absent, it runs). `get_table` lists a tab
895
896
  table — `workflow_id`, name, trigger, whether it is on and its failed runs of the last 7 days — and `get_workflow` reads one
896
897
  back. The table and the trigger type (`create`, `update` or `delete`) are fixed once the workflow is made: to change
897
898
  either, delete it and make another. A replace that changes only the gate, the trigger config or `enabled` moves the
898
- workflow's version. `dry_run` with a `record_id` (and `prev_data` and `changes` for an update) says what the workflow would
899
+ workflow's version. `dry_run` with a `record_id` (and, for an update, `prev_data` and `changes`, each changed field as `{ prev_value, next_value }`) says what the workflow would
899
900
  write on that row; reads are real and nothing is written.
900
901
 
901
902
  | part of the header | what it holds |
@@ -912,12 +913,15 @@ await update_records({ table_id: "repairs", record_ids: [trigger.record_id], set
912
913
  ```
913
914
 
914
915
  The body names the table's fields, select options and other tables by alias, and reads the write as `record`,
915
- `prev_record` and `changes` and the row's id as `trigger.record_id`. It operates on records and integrations: a body
916
+ `prev_record` and `changes`, the row's id as `trigger.record_id`, and the member who made the write as
917
+ `runtime.triggered_by_member_id` (null for a write no member made). It operates on records and integrations: a body
916
918
  that calls a tool changing a table, an app or any other structure is refused when it is saved. It runs as the table's owner, so
917
919
  it reaches the tables the owner reaches, and its writes meet the table's checks like any other write; a write refused by a
918
920
  check fails that run and leaves the row as it was. A body names a field by alias where it can tell which table's field it is: a
919
- read of `record`, `prev_record` or `changes`, a row from `query_records` called with a literal `table_id`, and a
920
- loop over such rows, each also when held in an object, a list or a spread. A name it cannot tie to a table, and an option compared to a value of unknown type (not a read of a field, and
921
+ read of `record`, `prev_record` or `changes`, a row from `query_records` called with a literal `table_id`,
922
+ a row `find`, `first`, `at` or an index picks from such rows, and a loop or callback over them, each also when held in an
923
+ object or a list written out, or a spread. A row read through `map` or `push`, or picked by a conditional or `??`, is not
924
+ tied to its table: read its fields where the row itself is in hand (`rows.map((r) => ({ state: r.data.state, n: 1 }))`). A name it cannot tie to a table, and an option compared to a value of unknown type (not a read of a field, and
921
925
  not a text, number or other value the type proves holds no option), are refused with what to change. A link reads as the list of the row ids it holds, a one-row link too: compare `first(record.customer) == id`. A lookup reads as one flat list of what it looks up: `record.x != prev_record.x` on one is refused, so compare `first(record.x)` with `first(prev_record.x)`. A single member, a single select, a number or a text reads as the value itself: `first(record.technician)` is refused at save, naming the read.
922
926
 
923
927
  A write the workflow itself makes sets off the workflows of its table in turn, and a chain of them stops after five. A workflow
@@ -942,7 +946,7 @@ automation or its table, and for an app's workflow the app's owner or an admin,
942
946
 
943
947
  - **Find.** `query_workflow_executions` lists one workflow's runs (`workflow_id`), every run started for one row
944
948
  (`record_id`) — a table workflow's written row, a pressed button's row, an app run's `record_id` input — or both, newest
945
- first, a page at a time (`next_cursor`). Each run names its workflow and kind, what started it, its row and how it ended:
949
+ first, a page at a time (`next_cursor`). A listing naming no workflow and no row covers every workflow whose runs the caller may read. Each run names its workflow and kind, what started it, its row and how it ended:
946
950
  for a failure, the step that threw, its tool and the error; for a waiting run, when it wakes, or the payment. A run started before runs recorded their row carries no `record_id`.
947
951
  - **Read.** `get_workflow_execution` gives one run's steps in order with each one's tool, input, output and error, what it
948
952
  returned, how many rows it wrote (a row's own history is in `query_audit_logs`) and the runs its writes started. Ninety days
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lotics/cli",
3
- "version": "0.321.54",
3
+ "version": "0.321.56",
4
4
  "description": "Lotics SDK and CLI for AI agents",
5
5
  "type": "module",
6
6
  "bin": {