kenso 0.1.155 → 0.1.156
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/dist/discover.json +1 -1
- package/dist/kenso.js +15 -4
- package/dist/operations.index.json +1 -1
- package/dist/operations.json +1 -1
- package/docs/README.md +1 -0
- package/docs/reference.md +1 -1
- package/docs/workflows.md +209 -0
- package/package.json +2 -2
package/dist/kenso.js
CHANGED
|
@@ -3389,7 +3389,7 @@ var VERSION;
|
|
|
3389
3389
|
var init_version = __esm({
|
|
3390
3390
|
"src/core/version.ts"() {
|
|
3391
3391
|
"use strict";
|
|
3392
|
-
VERSION = true ? "0.1.
|
|
3392
|
+
VERSION = true ? "0.1.156" : "0.0.0-dev";
|
|
3393
3393
|
}
|
|
3394
3394
|
});
|
|
3395
3395
|
|
|
@@ -9789,7 +9789,7 @@ var init_output_and_errors = __esm({
|
|
|
9789
9789
|
var README_default;
|
|
9790
9790
|
var init_README = __esm({
|
|
9791
9791
|
"docs/README.md"() {
|
|
9792
|
-
README_default = '# Kenso CLI\n\nThe Kenso CLI (`kenso`) is the command line for Kenso. It does bulk work in your Kenso workspace from files: add thousands of leads to a campaign, update or clean them up, import accounts and people, and build Studio templates. It is made for coding agents (Claude Code, Codex, Cursor) and the people who drive them: JSON on stdout, fixed exit codes, a dry run before every bulk write, and runs you can resume.\n\nEvery canonical API operation a workspace member can call is also a command, such as `kenso campaigns list` or `kenso tags create`. So the CLI reaches what the Kenso MCP reaches, straight against `https://api.ken.so`. The legacy routes with no canonical successor, such as sequence images, AI variables or thread opens, have no command: reach them with `kenso api <METHOD> <path>`.\n\n## Install\n\nOn macOS or Linux, with or without Node, run the [install script](https://ken.so/install.sh): fetch it with `curl -fsSL` and pipe it to `sh`. It installs a standalone build that brings its own Node.js, checks the download against the release\'s `SHA256SUMS`, puts the CLI in `~/.local/share/kenso` and links `~/.local/bin/kenso`. Run it again to update.\n\nWith Homebrew, on macOS or Linux, the same standalone build:\n\n```bash\nbrew install ken-technology/tap/kenso\n```\n\n`brew upgrade kenso` updates it.\n\nWith Node 22 or newer, on any system, Windows included:\n\n```bash\nnpm i -g kenso\nkenso --version\n```\n\nTo run it once without installing, use `npx kenso --version`. On an older Node, kenso stops with one line that says so.\n\nEvery way to install:\n\n| Way | Systems | Needs |\n|---|---|---|\n| Install script, above | macOS, Linux (glibc) | Nothing |\n| Homebrew, above | macOS, Linux | Homebrew |\n| npm, above | Any | Node 22 or newer |\n| Standalone build: unpack it and put its `bin` folder on your PATH | macOS, Linux, Windows | Nothing |\n\nThe standalone builds are at `https://downloads.ken.so/desktop/cli/<version>/`, one per system: `kenso-<version>-darwin-arm64.tar.gz`, `darwin-x64`, `linux-arm64`, `linux-x64` and `kenso-<version>-windows-x64.zip`, with their `SHA256SUMS`. `https://downloads.ken.so/desktop/cli/latest.yml` names the newest version. The builds come out nightly and Homebrew follows them, so a command added that day reaches npm first.\n\n### Tab completion\n\nTab completes resources, actions and flags once you install the script for your shell. The script asks `kenso` for the candidates on each Tab, so it stays right as the CLI updates: install it once.\n\n```bash\n# zsh: add this line to ~/.zshrc\nsource <(kenso completion zsh)\n# bash: add this line to ~/.bashrc (on bash 3.2, the macOS default, use: eval "$(kenso completion bash)")\nsource <(kenso completion bash)\n# fish: save the script once\nkenso completion fish > ~/.config/fish/completions/kenso.fish\n```\n\n### Update notice\n\nWhen a newer version is out, `kenso` says so on stderr after the command\'s own output, at most once a week: `kenso 0.1.40 is out (you have 0.1.35): npm i -g kenso@latest`. It checks `registry.npmjs.org` at most once every 7 days and never delays a command by more than about a second. A standalone build checks `latest.yml` on `downloads.ken.so` instead and names its own update: the install script, or `brew upgrade kenso` when Homebrew installed it. It stays quiet in CI (`CI` set) and when stderr is not a terminal. Under a coding agent it asks nothing: it prints the line once per agent session, from the last check. Set `KENSO_NO_UPDATE_NOTIFIER=1` to turn it off.\n\n## 60-second quickstart\n\n1. Create an API key in app.ken.so at Settings > Integrations > API keys.\n2. Save the key, pick a workspace, then plan and apply a CSV import:\n\n```bash\necho $KEY | kenso auth login --with-key\nkenso workspace list --search acme\nkenso workspace use 1234\nkenso campaigns list --limit 5\nkenso contacts import --campaign 812 --file leads.csv --dry-run\nkenso contacts import --campaign 812 --file leads.csv --yes\n```\n\n`workspace list` and `workspace use` are only needed when your key reaches more than one workspace.\n\nThe dry run reads the file, maps the columns, checks every row, asks Kenso for a credit estimate, and writes nothing. It prints the plan, with the exact apply command in `next`:\n\n```json\n{"run":"r_tdi5cdnx","dryRun":true,"command":"contacts import","rows":4,"valid":2,"invalid":2,"chunks":1,"chunkSize":1000,"campaignId":812,"mapping":{"Email":"email","First Name":"firstName","Last Name":"lastName","Company":"companyName","Pain Point":"customVariables.pain_point"},"customVariableKeys":["pain_point"],"estimate":{"kind":"leads","totalMillicredits":2000,"availableMillicredits":500000,"sufficient":true},"credits":{"needed":2,"available":500,"sufficient":true},"next":"kenso contacts import --campaign 812 --file leads.csv --yes","plan":"/home/you/.kenso/runs/r_tdi5cdnx/plan.json","invalidRows":"/home/you/.kenso/runs/r_tdi5cdnx/invalid.csv"}\n```\n\nThe apply sends the rows and prints one summary. Every input row has one line in `results.csv`:\n\n```json\n{"run":"r_tdi5cdnx","rows":4,"ok":0,"created":1,"updated":0,"skipped":{"duplicate":1},"failed":0,"notFound":0,"invalid":2,"changed":1,"results":"/home/you/.kenso/runs/r_tdi5cdnx/results.csv","resultsNdjson":"/home/you/.kenso/runs/r_tdi5cdnx/results.ndjson","invalidRows":"/home/you/.kenso/runs/r_tdi5cdnx/invalid.csv","resumed":false,"durationMs":1840,"campaignId":812,"notSendable":0}\n```\n\nThis run exits 5 because two rows were invalid: open `invalid.csv` to see why, fix those rows, and import them again. Running the same command again is safe: an email that is already in the campaign comes back `updated` or `skipped`, never as a second lead.\n\n## CLI or MCP\n\n- **Use the CLI for volume:** anything that starts from a file, anything over about 50 records, anything you may need to rerun or resume. Records never pass through the model\'s context: the agent passes a file path and reads a short summary.\n- **Use the MCP for conversation and single records:** look up a campaign, draft a reply, read a report. The MCP is at `https://mcp.ken.so/mcp`, signs in with OAuth and needs no install ([connection guide](https://ken.so/mcp)).\n- **Both use the same API and the same permissions.** `kenso mcp call` reaches MCP-only tools, such as skills, from the shell.\n\n## Docs\n\nEvery page is in the package and prints offline with `kenso docs <topic>`.\n\n| Page | Topic | What it covers |\n|---|---|---|\n| [Authentication](auth.md) | `auth` | API keys, browser login, profiles, workspaces, `doctor` |\n| [Leads](leads.md) | `leads` | Import, update, remove, pause, tag and export leads, with recipes |\n| [Batch runs](batch.md) | `batch` | Dry run and apply, run folders, results files, resume, rate limits, `--each` |\n| [Output and errors](output-and-errors.md) | `output-and-errors` | The output contract, error JSON, error codes, exit codes, live streams |\n| [CRM (beta)](crm.md) | `crm` | Accounts, people, opportunities and CRM sync |\n| [Studio (beta)](studio.md) | `studio` | Pull, push, validate, preview and fill templates |\n| [Agent work (beta)](work.md) | `work` | My agent: your own coding agent writes Kenso\'s AI work with `kenso work run`, or pull and submit |\n| [Webhooks](webhooks.md) | `webhooks` | Build a webhook handler locally: `kenso webhooks listen --forward-to`, `trigger`, the signature |\n| [Developer sandbox](sandbox.md) | `sandbox` | `kenso sandbox`: a workspace of your own where sends are simulated, its test key, the reserved test leads |\n| [Connect accounts](connect.md) | `connect` | `kenso connect`: an inbox, calendar, CRM, GitHub or other OAuth account, signed in by the person in a browser |\n| [Coding agents](agents.md) | `agents` | Claude Code, Codex, Cursor, the Agent Skill, environment variables, sandboxes |\n| Command reference | `reference` | Every command with its flags, generated from the CLI at build time: `kenso docs reference`, or `docs/reference.md` in the installed package |\n\n```bash\nkenso docs\nkenso docs leads\n```\n\nFor machine-readable help, run `kenso describe`: it prints every command, its flags and its body schema as JSON.\n';
|
|
9792
|
+
README_default = '# Kenso CLI\n\nThe Kenso CLI (`kenso`) is the command line for Kenso. It does bulk work in your Kenso workspace from files: add thousands of leads to a campaign, update or clean them up, import accounts and people, and build Studio templates. It is made for coding agents (Claude Code, Codex, Cursor) and the people who drive them: JSON on stdout, fixed exit codes, a dry run before every bulk write, and runs you can resume.\n\nEvery canonical API operation a workspace member can call is also a command, such as `kenso campaigns list` or `kenso tags create`. So the CLI reaches what the Kenso MCP reaches, straight against `https://api.ken.so`. The legacy routes with no canonical successor, such as sequence images, AI variables or thread opens, have no command: reach them with `kenso api <METHOD> <path>`.\n\n## Install\n\nOn macOS or Linux, with or without Node, run the [install script](https://ken.so/install.sh): fetch it with `curl -fsSL` and pipe it to `sh`. It installs a standalone build that brings its own Node.js, checks the download against the release\'s `SHA256SUMS`, puts the CLI in `~/.local/share/kenso` and links `~/.local/bin/kenso`. Run it again to update.\n\nWith Homebrew, on macOS or Linux, the same standalone build:\n\n```bash\nbrew install ken-technology/tap/kenso\n```\n\n`brew upgrade kenso` updates it.\n\nWith Node 22 or newer, on any system, Windows included:\n\n```bash\nnpm i -g kenso\nkenso --version\n```\n\nTo run it once without installing, use `npx kenso --version`. On an older Node, kenso stops with one line that says so.\n\nEvery way to install:\n\n| Way | Systems | Needs |\n|---|---|---|\n| Install script, above | macOS, Linux (glibc) | Nothing |\n| Homebrew, above | macOS, Linux | Homebrew |\n| npm, above | Any | Node 22 or newer |\n| Standalone build: unpack it and put its `bin` folder on your PATH | macOS, Linux, Windows | Nothing |\n\nThe standalone builds are at `https://downloads.ken.so/desktop/cli/<version>/`, one per system: `kenso-<version>-darwin-arm64.tar.gz`, `darwin-x64`, `linux-arm64`, `linux-x64` and `kenso-<version>-windows-x64.zip`, with their `SHA256SUMS`. `https://downloads.ken.so/desktop/cli/latest.yml` names the newest version. The builds come out nightly and Homebrew follows them, so a command added that day reaches npm first.\n\n### Tab completion\n\nTab completes resources, actions and flags once you install the script for your shell. The script asks `kenso` for the candidates on each Tab, so it stays right as the CLI updates: install it once.\n\n```bash\n# zsh: add this line to ~/.zshrc\nsource <(kenso completion zsh)\n# bash: add this line to ~/.bashrc (on bash 3.2, the macOS default, use: eval "$(kenso completion bash)")\nsource <(kenso completion bash)\n# fish: save the script once\nkenso completion fish > ~/.config/fish/completions/kenso.fish\n```\n\n### Update notice\n\nWhen a newer version is out, `kenso` says so on stderr after the command\'s own output, at most once a week: `kenso 0.1.40 is out (you have 0.1.35): npm i -g kenso@latest`. It checks `registry.npmjs.org` at most once every 7 days and never delays a command by more than about a second. A standalone build checks `latest.yml` on `downloads.ken.so` instead and names its own update: the install script, or `brew upgrade kenso` when Homebrew installed it. It stays quiet in CI (`CI` set) and when stderr is not a terminal. Under a coding agent it asks nothing: it prints the line once per agent session, from the last check. Set `KENSO_NO_UPDATE_NOTIFIER=1` to turn it off.\n\n## 60-second quickstart\n\n1. Create an API key in app.ken.so at Settings > Integrations > API keys.\n2. Save the key, pick a workspace, then plan and apply a CSV import:\n\n```bash\necho $KEY | kenso auth login --with-key\nkenso workspace list --search acme\nkenso workspace use 1234\nkenso campaigns list --limit 5\nkenso contacts import --campaign 812 --file leads.csv --dry-run\nkenso contacts import --campaign 812 --file leads.csv --yes\n```\n\n`workspace list` and `workspace use` are only needed when your key reaches more than one workspace.\n\nThe dry run reads the file, maps the columns, checks every row, asks Kenso for a credit estimate, and writes nothing. It prints the plan, with the exact apply command in `next`:\n\n```json\n{"run":"r_tdi5cdnx","dryRun":true,"command":"contacts import","rows":4,"valid":2,"invalid":2,"chunks":1,"chunkSize":1000,"campaignId":812,"mapping":{"Email":"email","First Name":"firstName","Last Name":"lastName","Company":"companyName","Pain Point":"customVariables.pain_point"},"customVariableKeys":["pain_point"],"estimate":{"kind":"leads","totalMillicredits":2000,"availableMillicredits":500000,"sufficient":true},"credits":{"needed":2,"available":500,"sufficient":true},"next":"kenso contacts import --campaign 812 --file leads.csv --yes","plan":"/home/you/.kenso/runs/r_tdi5cdnx/plan.json","invalidRows":"/home/you/.kenso/runs/r_tdi5cdnx/invalid.csv"}\n```\n\nThe apply sends the rows and prints one summary. Every input row has one line in `results.csv`:\n\n```json\n{"run":"r_tdi5cdnx","rows":4,"ok":0,"created":1,"updated":0,"skipped":{"duplicate":1},"failed":0,"notFound":0,"invalid":2,"changed":1,"results":"/home/you/.kenso/runs/r_tdi5cdnx/results.csv","resultsNdjson":"/home/you/.kenso/runs/r_tdi5cdnx/results.ndjson","invalidRows":"/home/you/.kenso/runs/r_tdi5cdnx/invalid.csv","resumed":false,"durationMs":1840,"campaignId":812,"notSendable":0}\n```\n\nThis run exits 5 because two rows were invalid: open `invalid.csv` to see why, fix those rows, and import them again. Running the same command again is safe: an email that is already in the campaign comes back `updated` or `skipped`, never as a second lead.\n\n## CLI or MCP\n\n- **Use the CLI for volume:** anything that starts from a file, anything over about 50 records, anything you may need to rerun or resume. Records never pass through the model\'s context: the agent passes a file path and reads a short summary.\n- **Use the MCP for conversation and single records:** look up a campaign, draft a reply, read a report. The MCP is at `https://mcp.ken.so/mcp`, signs in with OAuth and needs no install ([connection guide](https://ken.so/mcp)).\n- **Both use the same API and the same permissions.** `kenso mcp call` reaches MCP-only tools, such as skills, from the shell.\n\n## Docs\n\nEvery page is in the package and prints offline with `kenso docs <topic>`.\n\n| Page | Topic | What it covers |\n|---|---|---|\n| [Authentication](auth.md) | `auth` | API keys, browser login, profiles, workspaces, `doctor` |\n| [Leads](leads.md) | `leads` | Import, update, remove, pause, tag and export leads, with recipes |\n| [Batch runs](batch.md) | `batch` | Dry run and apply, run folders, results files, resume, rate limits, `--each` |\n| [Output and errors](output-and-errors.md) | `output-and-errors` | The output contract, error JSON, error codes, exit codes, live streams |\n| [CRM (beta)](crm.md) | `crm` | Accounts, people, opportunities and CRM sync |\n| [Studio (beta)](studio.md) | `studio` | Pull, push, validate, preview and fill templates |\n| [Workflows (beta)](workflows.md) | `workflows` | Keep a workflow as a file: `kenso.json`, init, pull, check, push, test, publish, and run it on ids or a CSV with a credit cap |\n| [Agent work (beta)](work.md) | `work` | My agent: your own coding agent writes Kenso\'s AI work with `kenso work run`, or pull and submit |\n| [Webhooks](webhooks.md) | `webhooks` | Build a webhook handler locally: `kenso webhooks listen --forward-to`, `trigger`, the signature |\n| [Developer sandbox](sandbox.md) | `sandbox` | `kenso sandbox`: a workspace of your own where sends are simulated, its test key, the reserved test leads |\n| [Connect accounts](connect.md) | `connect` | `kenso connect`: an inbox, calendar, CRM, GitHub or other OAuth account, signed in by the person in a browser |\n| [Coding agents](agents.md) | `agents` | Claude Code, Codex, Cursor, the Agent Skill, environment variables, sandboxes |\n| Command reference | `reference` | Every command with its flags, generated from the CLI at build time: `kenso docs reference`, or `docs/reference.md` in the installed package |\n\n```bash\nkenso docs\nkenso docs leads\n```\n\nFor machine-readable help, run `kenso describe`: it prints every command, its flags and its body schema as JSON.\n';
|
|
9793
9793
|
}
|
|
9794
9794
|
});
|
|
9795
9795
|
|
|
@@ -9825,6 +9825,14 @@ var init_work = __esm({
|
|
|
9825
9825
|
}
|
|
9826
9826
|
});
|
|
9827
9827
|
|
|
9828
|
+
// docs/workflows.md
|
|
9829
|
+
var workflows_default;
|
|
9830
|
+
var init_workflows = __esm({
|
|
9831
|
+
"docs/workflows.md"() {
|
|
9832
|
+
workflows_default = '# Workflows (beta)\n\nA workflow is automation in Kenso: one trigger, a list of steps and limits. With the CLI you keep a workflow as a JSON file in your folder or repo: write it, check it, push it to the draft, test the draft, publish the version you tested, and run it on records with a credit cap and a results file.\n\nThe commands are beta: they show where your workspace has the `workflows` feature. Help hides them until your workspace has it; `kenso --help --all-commands` shows them. `kenso workflows test` and `kenso workflows run` also need `workflows_runtime`. Without it `test` stops with `runtime_off` (exit 4), "Workflows cannot run in this workspace yet.", with no retry, and a run that `kenso workflows run` starts stays `queued`, which `--wait` reports at its timeout.\n\n| Command | What it does |\n|---|---|\n| `workflows init [name]` | Write a new workflow file, blank or from a template, and a `kenso.json` |\n| `workflows pull <workflowId>` | Write a saved workflow\'s definition to a file and bind the file |\n| `workflows check <file>` | Validate the file and estimate one record; saves nothing |\n| `workflows push <file>` | Create the workflow or save the file to its draft; with `--publish`, publish it |\n| `workflows test <file>` | Run the saved draft once on one record |\n| `workflows diff <file>` | Compare the file with the published version or the draft |\n| `workflows schema` | Print a JSON Schema for workflow files, for editors |\n| `workflows run <file or id>` | Run the published workflow on ids or a CSV, estimate first |\n| `workflow-runs logs <runId>` | One row per step of a run: status, credits, error |\n\nThe other workflow commands are generated from the API, one per route: `kenso workflows publish`, `unpublish`, `get` and `list`, `kenso workflow-versions`, `kenso workflow-runs list`, `get`, `cancel`, `restart`, `retry` and `replay`, `kenso workflow-templates` and `kenso workflow-step-types`. `kenso <command> --help` shows their flags.\n\n## The file\n\nA workflow file is one JSON object in the `kenWorkflow: "1"` format, named `<name>.workflow.json`:\n\n```json\n{\n "kenWorkflow": "1",\n "name": "Qualify accounts",\n "description": "Scores each account against a simple ICP.",\n "trigger": { "type": "trigger.manual@1", "with": { "recordType": "account" } },\n "steps": [\n { "id": "qualify", "type": "ai.qualify@1", "with": { "criteria": "B2B SaaS, 50+ people", "tier": "cheap" } }\n ],\n "limits": { "creditsPerMonth": 100, "creditsPerRun": 5, "runsPerDay": 50, "atLimit": "ask" }\n}\n```\n\nThe format (trigger, steps, references, formulas, limits) is the `workflows` skill\'s `references/definition-format.md`. `kenso workflows schema` prints a JSON Schema (draft 2020-12) of the file with each step type\'s inputs, for an editor, offline; the server\'s validate stays the authority. `kenso workflow-step-types get` prints one step type\'s inputs and an example.\n\n```bash\nkenso workflows schema --out workflow.schema.json\nkenso workflow-step-types get --type ai.qualify@1\nkenso mcp call load_skill --args \'{"name":"workflows","reference":"references/definition-format.md"}\'\n```\n\n## kenso.json\n\n`kenso.json` binds workflow files to workflow ids and pins the folder\'s workspace. `init`, `pull` and `push` write it; you rarely edit it by hand.\n\n```json\n{\n "workspaceId": "3047",\n "profile": "client-a",\n "workflows": { "workflows/qualify.workflow.json": 412 }\n}\n```\n\n- All three keys are optional. `workspaceId` is a string of digits. `profile` is a profile name. `workflows` maps a path relative to `kenso.json` (forward slashes) to a workflow id. One file holds one workflow and one workflow is bound to one file: binding a second is `already_bound` (exit 7). Other keys are kept when the CLI rewrites the file.\n- The CLI looks for it from the current folder up to the first folder that holds `.git`; for a command given a file, from that file\'s folder.\n- The workspace is `--workspace`, else `KENSO_WORKSPACE_ID`, else `kenso.json`, else the profile\'s. The profile is `--profile`, else `KENSO_PROFILE`, else `kenso.json`, else the active profile. `kenso.json` never changes the API URL or the key.\n- A file command run in another workspace than the one `kenso.json` names stops with `workspace_mismatch` (exit 2): its workflow ids belong to that workspace.\n- It never holds a key or an API URL. A file with `apiKey`, `key`, `token`, a value starting with `kenso_`, or `apiUrl` is `folder_file_invalid` (exit 2), "kenso.json never holds a key or an API URL: remove <name>.", and nothing reads it. Invalid JSON, or a key of the wrong type, is the same error with the path and the key.\n- `kenso whoami` and `kenso auth status` print `workspaceSource` (`flag`, `env`, `folder`, `profile` or `none`) and, for `folder`, `folderFile`.\n\n```bash\nkenso whoami -o json\n```\n\n## The first run\n\nFrom a template to records:\n\n```bash\nkenso workflow-templates list\nkenso workflows init qualify --template <templateKey>\nkenso workflows push qualify.workflow.json\nkenso workflows check qualify.workflow.json --mode publish\nkenso workflows test qualify.workflow.json --record account:<accountId>\nkenso workflows push qualify.workflow.json --publish --expected-hash <definitionHash>\nkenso workflows run qualify.workflow.json --ids ids.txt --dry-run\nkenso workflows run qualify.workflow.json --ids ids.txt --max-credits 10 --yes\n```\n\nFill the template\'s `<fill in: ...>` placeholders and set `limits` in the file before the first push. `check --mode publish` names everything publish would refuse, with a `fix` for each issue.\n\n## The commands\n\n### init\n\n```bash\nkenso workflows init qualify --template <templateKey> --dir workflows\n```\n\nWrites `<name>.workflow.json`: the template\'s definition with `--template`, else a blank definition with `trigger.manual@1` and no steps. Writes `kenso.json` with the resolved workspace when no folder file is found. It never replaces a file (`file_exists`, exit 7), sends no request without `--template`, and creates nothing in Kenso. Prints `{file, template, folderFile, folderFileCreated, workspaceId}`.\n\n### pull\n\n```bash\nkenso workflows pull 412 --out qualify.workflow.json\n```\n\nWrites the draft\'s definition (else the published one; `--published` takes the published one) to `--out` or `<slug of the name>.workflow.json`, with 2-space indents and a final newline, and binds the file in `kenso.json`. An existing file is replaced only when `kenso.json` binds it to this workflow (else `file_exists`, exit 7). When the workflow is bound to another file already, the new file is an unbound copy. Prints `{file, workflowId, draftVersion, draftHash, publishedHash, status}`.\n\n### check\n\n```bash\nkenso workflows check qualify.workflow.json --mode publish\n```\n\nSends the file as the definition to validate (saving nothing) and to the estimate for one record. Prints `{valid, issues, perRecord, draftHash, inSync, next}`: each issue has `path`, `code`, `message`, `fix` and `severity`; `perRecord` is `{expectedCredits, maxCredits}`; `draftHash` is the saved draft\'s hash, and `inSync` says whether the file equals that draft. Exit 0 when valid, 5 when not. `--mode draft` (the default) checks structure, schemas, references and formulas; `--mode publish` also checks limits, secrets and connected apps. An unbound file is `workflow_not_bound` (exit 2), "check needs a workflow id: a draft runs nothing and costs nothing.", with `next: kenso workflows push <file>`.\n\n### push\n\n```bash\nkenso workflows push qualify.workflow.json --note "Raise the size floor"\nkenso workflows push qualify.workflow.json --dry-run\n```\n\nAn unbound file creates the workflow and binds the file. A bound file is saved to the draft when it differs from it, on top of the draft version just read; an identical file saves nothing. Prints `{workflowId, saved, draftVersion, draftHash, published, status, next}`. `--dry-run` prints `wouldSend`: which of create, update and publish it would send. `--publish` publishes after the save, and `--expected-hash` goes with it (see The hash rule).\n\n### test\n\n```bash\nkenso workflows test qualify.workflow.json --record account:<accountId> --wait 50\n```\n\nRuns the saved draft once on one record: `--record <type:id>` (`person:812`; the types are `account`, `person`, `lead` and `place`), else the newest record of the trigger\'s type. `--wait` is the seconds the API waits for the run, 0 to 50 (50 by default). AI and data steps run for real and are charged; sends and CRM writes are simulated. A file that differs from the draft is refused (`draft_out_of_sync`, exit 7, `next: kenso workflows push <file>`). Prints `{testPassed, timedOut, definitionHash, publishPassRecorded, run: {id, status, creditsCharged}, hint, next}`; after a pass, `next` is the publish command with `--expected-hash <definitionHash>`. Exit 1 when the test did not pass.\n\n### diff\n\n```bash\nkenso workflows diff qualify.workflow.json --against draft\n```\n\nCompares the file with the published version (the default; the draft when nothing is published) or with the draft. Prints `{against, same, nameChanged, triggerChanged, limitsChanged, stepsAdded, stepsRemoved, stepsChanged}` with step ids. Exit 0 either way.\n\n### schema\n\n```bash\nkenso workflows schema --out workflow.schema.json\n```\n\nPrints, or writes to `--out`, the JSON Schema of a workflow file. It needs no sign-in and no network, and `--out` replaces only a schema it wrote.\n\n## The hash rule\n\n`definitionHash` is computed by the server for a saved draft and leaves `plain` out; the CLI never computes one. When the CLI compares a file with a saved definition, it compares them as JSON with keys sorted at every level: whitespace and key order never count.\n\n- Publish needs a passed test on the draft\'s hash. Without one the CLI stops with `test_required` (exit 7), "Publish needs a passed test on this exact draft.", and `next: kenso workflows test <file>`.\n- `--expected-hash <hash>` makes push compare the draft\'s hash after the save with the value. A mismatch is `hash_mismatch` (exit 7), "The draft\'s hash is <actual>, not <expected>.", and nothing is published; the saved draft stays. Pass the hash `kenso workflows test` printed.\n- Under a coding agent, `--publish` without `--expected-hash` is refused (`usage_error`, "an agent publishes only the version it tested: pass --expected-hash"). A person at a terminal may publish without it.\n- **The gap.** The publish route takes no hash, so a save that lands between the CLI\'s hash check and the publish call can be published. The server\'s `version_conflict` on a concurrent save and its rule that publish needs a passed test bound it.\n- A save that meets a newer draft is `version_conflict` (exit 7), "Someone saved this workflow since you read it.", with `next: kenso workflows diff <file> --against draft`.\n- A definition the server refuses on save or publish is `invalid_definition` (exit 5) with its issues (`path`, `code`, `message`); on a publish, `next` is `kenso workflows check <file> --mode publish`, which adds a `fix` to each.\n\n## Run on records\n\n```bash\nkenso accounts list --limit 50 -o ids > ids.txt\nkenso workflows run qualify.workflow.json --ids ids.txt --dry-run\nkenso workflows run qualify.workflow.json --ids ids.txt --max-credits 10 --wait --out results.csv --yes\nkenso workflows run 412 --file people.csv --record-type person --dry-run\n```\n\n- **Target.** A number is a workflow id. A file must be bound in `kenso.json` and equal to the published version, else `unpublished_changes` (exit 7), "This file differs from the published version.", with `next` naming the push that publishes it (with `--expected-hash` when the saved draft holds the file). A workflow that is not live is `invalid_state` (exit 7) with `next: kenso workflows publish --workflow-id <id>`. Nothing publishes by itself.\n- **Record type** is the trigger\'s (`trigger.manual@1` takes its `with.recordType`); `--record-type` (`account`, `person`, `lead` or `place`) overrides it. A trigger that names no record type needs the flag (`not_runnable_on_records`, exit 2).\n- **Input.** `--ids` is one id per line (`-` reads stdin). `--file` is a CSV: with an `id` column, those ids; without one and with record type `person`, each row is matched or created as a person in chunks of 200, with the columns `kenso people import` accepts and no email finding. Any other record type without an `id` column is `ids_required` (exit 2), which names `kenso contacts import` or `kenso accounts import`. Duplicated ids run once. A saved list runs through a workflow whose trigger is `trigger.saved_list@1` or `trigger.csv@1`; `--list` is not a flag.\n- **Dry run.** `--dry-run`, and a run without `--yes`, estimate per chunk of up to 1,000 records, start nothing, and print `{dryRun, workflowId, records, recordType, credits: {needed, available, sufficient}, perRecord, expectedCredits, cap, next}`. `needed` is the estimate\'s maximum. A CSV without ids is estimated on its row count and creates no person.\n- **Confirmation.** Without `--yes`, a person at a terminal is asked once with the plan on screen. Under a coding agent the command prints the plan and stops, with `next` naming the same command with `--yes`.\n- **`--max-credits <n>`** is enforced by the CLI; the server is sent no cap. The ceiling per record is the definition\'s `limits.creditsPerRun` when set (`cap.kind: "hard"`), else the estimate\'s maximum per record (`cap.kind: "estimate"`). The CLI starts the first `floor(n / ceiling)` records and reports the rest as `not_started` with reason `over --max-credits`. The plan and the summary print `cap: {maxCredits, kind, perRecord, willStart, notStarted}`. A cap below one record\'s ceiling starts nothing: `cap_too_low` (exit 6), with `next` naming the smallest cap that starts one record. A workspace out of credits starts nothing either (`out_of_credits`, exit 6).\n- **`--wait`** follows each started run, up to 8 reads at a time, until it leaves `queued`, `running` and `waiting`, or `--timeout` (90s, 10m, 1h; default 30m) passes. A run still `waiting` at the timeout is reported as `waiting`. `--timeout` goes with `--wait`.\n- **`--out <results.csv>`** (needs `--wait`) writes one row per input record when the batch ends: `row, id, status, runId, runStatus, creditsCharged, missReason, error`, then one column per step id holding that step\'s output as compact JSON. The path is checked before the first request: its folder must exist, and an existing file is refused (`file_exists`, exit 7) unless it is this run\'s own.\n- **Summary.** One JSON object with `records`, `started`, `deduplicated`, `notStarted`, `succeeded`, `failed`, `waiting`, `missed` (reason to count), `creditsCharged` (`"pending"` without `--wait` or while runs are open), `cap`, `resultsCsv`, `appUrl` (the workflow\'s page in the app) and `next`, and the same counts on one stderr line. With `--wait`, a run that failed makes `next` its `kenso workflow-runs logs <runId>`.\n\n## The run folder\n\nEach applied run writes a run folder (`~/.kenso/runs/<id>`) that records every chunk\'s response, as every batch command does: see [Batch runs](batch.md). `kenso runs resume <runId>` never resends a chunk it has an answer for. A chunk that was sent and has no recorded answer is not resent either: resume stops with `chunk_outcome_unknown` (exit 5), the chunk\'s first and last row, and `next: kenso workflow-runs list --workflow-id <id> --created-after <chunk start time>`, so you can see what started.\n\n```bash\nkenso runs resume <runId>\nkenso workflow-runs list --workflow-id 412 --created-after 2026-11-21T10:00:00Z\n```\n\n## Read a run\n\n```bash\nkenso workflow-runs logs <runId>\nkenso workflow-runs logs <runId> --step qualify --full\n```\n\nOne row per step run in start order: `{nodeId, stepType, status, attempt, startedAt, endedAt, ms, credits, error}`, NDJSON when piped. `--step` keeps one node; `--full` adds each step\'s `input`, `output` and `attempts`. A header line on stderr gives the run\'s status, workflow, record and the credits it charged, and `needs attention: <reason>` when one is set. A failed run ends with `next: kenso workflow-runs retry --run-id <id> --dry-run`.\n\n## Step outputs are kept 7 days\n\nA succeeded run\'s step outputs are dropped 7 days after it finishes, unless the workflow keeps success details. `--out` writes them when the batch ends, so run with `--wait --out` when you need the results later.\n\n## Exit codes\n\n| Exit | When |\n|---|---|\n| 0 | Done. For `run`, every record started and, with `--wait`, none failed |\n| 1 | `test`: the test did not pass |\n| 2 | Usage: `workflow_not_bound`, `folder_file_invalid`, `workspace_mismatch`, `not_runnable_on_records`, `ids_required`, or `--publish` without `--expected-hash` under a coding agent |\n| 4 | `test`: `runtime_off`, the workspace cannot run workflows yet |\n| 5 | `check` found the file not valid, the server refused a definition (`invalid_definition`), `run` has records that failed, were not found or were not started, or resume met `chunk_outcome_unknown` |\n| 6 | `run`: the cap started nothing (`cap_too_low`), or the workspace is out of credits |\n| 7 | A conflict: `file_exists`, `already_bound`, `draft_out_of_sync`, `hash_mismatch`, `test_required`, `version_conflict`, `unpublished_changes`, `invalid_state`, or an existing `--out` file |\n\nEvery error is one JSON line on stderr with `code`, `message`, `hint` and `next`: see [Output and errors](output-and-errors.md).\n';
|
|
9833
|
+
}
|
|
9834
|
+
});
|
|
9835
|
+
|
|
9828
9836
|
// skill/kenso-cli/SKILL.md
|
|
9829
9837
|
var SKILL_default;
|
|
9830
9838
|
var init_SKILL = __esm({
|
|
@@ -9855,6 +9863,7 @@ var init_embedded = __esm({
|
|
|
9855
9863
|
init_studio();
|
|
9856
9864
|
init_webhooks();
|
|
9857
9865
|
init_work();
|
|
9866
|
+
init_workflows();
|
|
9858
9867
|
init_SKILL();
|
|
9859
9868
|
DOCS = {
|
|
9860
9869
|
"README.md": README_default,
|
|
@@ -9864,6 +9873,7 @@ var init_embedded = __esm({
|
|
|
9864
9873
|
"output-and-errors.md": output_and_errors_default,
|
|
9865
9874
|
"crm.md": crm_default,
|
|
9866
9875
|
"studio.md": studio_default,
|
|
9876
|
+
"workflows.md": workflows_default,
|
|
9867
9877
|
"work.md": work_default,
|
|
9868
9878
|
"webhooks.md": webhooks_default,
|
|
9869
9879
|
"sandbox.md": sandbox_default,
|
|
@@ -9903,6 +9913,7 @@ var init_content = __esm({
|
|
|
9903
9913
|
{ topic: "output-and-errors", file: "output-and-errors.md", title: "Output and errors", description: "The output contract, error JSON, error codes, exit codes, live streams" },
|
|
9904
9914
|
{ topic: "crm", file: "crm.md", title: "CRM (beta)", description: "Accounts, people, opportunities and CRM sync" },
|
|
9905
9915
|
{ topic: "studio", file: "studio.md", title: "Studio (beta)", description: "Pull, push, validate, preview and fill templates" },
|
|
9916
|
+
{ topic: "workflows", file: "workflows.md", title: "Workflows (beta)", description: "Keep a workflow as a file: kenso.json, init, pull, check, push, test, publish, and run it on ids or a CSV with a credit cap" },
|
|
9906
9917
|
{ topic: "work", file: "work.md", title: "Agent work (beta)", description: "My agent: your own coding agent writes Kenso AI work with kenso work run, or pull and submit" },
|
|
9907
9918
|
{ topic: "webhooks", file: "webhooks.md", title: "Webhooks", description: "Build a webhook handler locally: kenso webhooks listen --forward-to, trigger, the signature" },
|
|
9908
9919
|
{ topic: "sandbox", file: "sandbox.md", title: "Developer sandbox", description: "kenso sandbox: a workspace of your own where sends are simulated, its test key, the reserved test leads" },
|
|
@@ -24215,7 +24226,7 @@ var init_run_actions = __esm({
|
|
|
24215
24226
|
|
|
24216
24227
|
// src/commands/workflows/index.ts
|
|
24217
24228
|
var actions36;
|
|
24218
|
-
var
|
|
24229
|
+
var init_workflows2 = __esm({
|
|
24219
24230
|
"src/commands/workflows/index.ts"() {
|
|
24220
24231
|
"use strict";
|
|
24221
24232
|
init_file_actions();
|
|
@@ -24530,7 +24541,7 @@ var init_registry = __esm({
|
|
|
24530
24541
|
init_webhooks2();
|
|
24531
24542
|
init_work2();
|
|
24532
24543
|
init_workflow_runs();
|
|
24533
|
-
|
|
24544
|
+
init_workflows2();
|
|
24534
24545
|
init_workspace();
|
|
24535
24546
|
handWritten = {
|
|
24536
24547
|
accounts: actions,
|