@lunnoa/client 2.4.0 → 3.0.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/README.md CHANGED
@@ -249,7 +249,7 @@ Re-run codegen whenever entity types, workflows, or agents change on the deploym
249
249
 
250
250
  ## Define, run, and CLI deploy
251
251
 
252
- Author local definitions with `defineWorkflow` / `defineAgent` / `defineEntityType`, run linear chains with `lunnoa.runs.start`, and upsert with the CLI (prefer CLI over calling upsert from app code). Agent and workflow upsert is by slug inside the workspace on the API key. An entity type slug is unique on the deployment. Deploy grants that type to the API key's workspace when the slug is new, and will not rewrite a type already granted to other workspaces. Instance writes reject unknown attribute keys unless `allowUnknownAttributes` is true — use the reserved `extensions` object for flexible bags:
252
+ Author local definitions with `defineWorkflow` / `defineAgent` / `defineEntityType`, run linear chains with `lunnoa.runs.start`, branch deployed workflows with `paths` on Request Approval or Conditional Paths, and upsert with the CLI (prefer CLI over calling upsert from app code). Agent and workflow upsert is by slug inside the workspace on the API key. An entity type slug is unique on the deployment. Deploy grants that type to the API key's workspace when the slug is new, and will not rewrite a type already granted to other workspaces. Instance writes reject unknown attribute keys unless `allowUnknownAttributes` is true — use the reserved `extensions` object for flexible bags:
253
253
 
254
254
  ```bash
255
255
  npx @lunnoa/client entity-types deploy ./human.ts --url https://lunnoa.example --api-key lna_...
@@ -266,6 +266,29 @@ npx @lunnoa/client agents deploy ./agents/triage.ts \
266
266
 
267
267
  `defineAction` binds catalogue actions only; toolkit `createAction` is for in-platform apps. `defineWorkflow` takes an optional `defineTrigger`. Omit it for Manually Run with no input fields. `runs.start` ignores the trigger and runs the steps only. Pass data into step settings with `ref.trigger('caseId')` or `ref.step('load', 'rows', 0)` (give the source step a `key`); the server resolves them on deploy and the builder shows them as mapped fields. See Lunnoa Docs under `guides/develop/client/define`, `runs`, and `cli-deploy`.
268
268
 
269
+ ### Definitions folder
270
+
271
+ JSON definitions round-trip with the UI through `lunnoa/` (override with `definitionsDir` in `lunnoa.config.*` or `--dir`):
272
+
273
+ ```text
274
+ lunnoa/agents/<slug>.json
275
+ lunnoa/agents/<slug>.instructions.md
276
+ lunnoa/workflows/<slug>.json
277
+ lunnoa/lunnoa.lock.json
278
+ ```
279
+
280
+ ```bash
281
+ npx @lunnoa/client pull --all --url https://lunnoa.example --api-key lna_...
282
+ npx @lunnoa/client status
283
+ npx @lunnoa/client push
284
+ ```
285
+
286
+ `pull` writes a definition when the server revision differs from the lock and the local file is unchanged. When the lock revision already matches, pull leaves the file alone, including local edits. `push` sends `codeSource: synced` and `baseRevision` from the lock (omitted when the slug is not in the lock), then writes the definition Lunnoa stored.
287
+
288
+ If the file and the UI both changed, pull prints a diff (`--- local` / `+++ server`) and exits 1 before it writes anything. `pull --force` overwrites the file. `push --force` overwrites the UI. A first push onto a slug that already exists and is not in the lock exits 1: `A workflow with slug "…" already exists in Lunnoa. Run pull first, or push with --force.` `status` prints local and remote state.
289
+
290
+ `agents deploy file.json` and `workflows deploy file.json` are a push of that file. A `.ts`, `.js`, or `.mjs` deploy stays code-generated (`codeSource: generated`) and does not send `--force`. `codeSource` replaces `managedByCode` on agents and workflows.
291
+
269
292
  ### CLI discovery
270
293
 
271
294
  Coding agents (and humans) should list the catalogue for a given key instead of guessing action ids. `--json` is the machine-readable form.