@lotics/app-sdk 0.133.16 → 0.133.17

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/mutations.md CHANGED
@@ -163,8 +163,8 @@ Files travel **only** via `files[]` — never through `return({ data })`, and ne
163
163
 
164
164
  ### Structured results: `return({ data })`
165
165
 
166
- A workflow body ends with a `return({ status, message, field_errors?, data? })` step (the
167
- envelope's grammar — `message` is required, `field_errors` never reaches the app — is
166
+ A workflow body ends with a `return({ status, message?, field_errors?, data? })` step (the
167
+ envelope's grammar — an `error` states its `message`, `field_errors` never reaches the app — is
168
168
  [workflows](./workflows.md#return--the-envelope)). `data` is arbitrary structured data
169
169
  (computed totals, row lists, status objects) the app reads back as `result.data`:
170
170
 
package/docs/workflows.md CHANGED
@@ -139,7 +139,7 @@ The body is a sequence of statements, each of which maps 1:1 onto a stored step.
139
139
  | LLM reasoning | `const x = await agent({ instructions, input, model?, output });` |
140
140
  | Run a declared agent | `const x = await app_agent({ alias, input, wait? });` |
141
141
  | Guard | `validate({ checks: [{ fail_when, field_key?, message }, …] });` |
142
- | End the run | `return({ status, message, field_errors?, data? });` |
142
+ | End the run | `return({ status, message?, field_errors?, data? });` |
143
143
 
144
144
  `validate` and `return` are **calls**, not JS keywords in the usual sense — `return` happens to
145
145
  be spelled with the JS `return` statement, but its argument is a single object literal and the
@@ -206,8 +206,9 @@ step, so no binding may use it.
206
206
  return({ status: "success", message: "Order created.", data: { total: subtotal } });
207
207
  ```
208
208
 
209
- - `status` is a literal `"success"` or `"error"`. `message` is **required** (any string
210
- expression). Both `field_errors` and `data` are optional.
209
+ - `status` is a literal `"success"` or `"error"`. An `error` states its `message` (any string
210
+ expression); a `success` may leave it out, and a bare `return;` is that success. Both
211
+ `field_errors` and `data` are optional.
211
212
  - `data` is what the app reads back as `result.data`; the alias's `outputs` schema is derived at
212
213
  save from its inferred type. Full contract: [mutations](./mutations.md) § "Structured results".
213
214
  - `field_errors` maps a key to a message and reaches the app on `result.field_errors`, so a
@@ -840,7 +841,7 @@ workflow that takes inputs and no row): the draft is walked by the engine an Act
840
841
  app's authority, with the production expression evaluator. Reads are real; writes and service sends are
841
842
  said, not made, and a document a step renders is made as a paper no listing shows. It answers `preview`
842
843
  (the calls the run would make, each with its fully-resolved input, and the reads it made) and `returned`
843
- (`{ status, message }` always, plus `data` and `field_errors` when the body returns them — what the caller
844
+ (`status` always, plus `message`, `data` and `field_errors` when the body returns them — what the caller
844
845
  receives). A draft it cannot rehearse — a step that reads what a call before it answers, a wait, a bound the
845
846
  walk reaches — answers `preview.available: false` and the reason. Nothing is written.
846
847
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lotics/app-sdk",
3
- "version": "0.133.16",
3
+ "version": "0.133.17",
4
4
  "description": "The SDK a Lotics custom-code app reads and writes through — typed hooks over the host bridge, cell readers, mount() and AppRouter",
5
5
  "type": "module",
6
6
  "exports": {