kenso 0.1.97 → 0.1.99

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/kenso.js CHANGED
@@ -2477,7 +2477,7 @@ var VERSION;
2477
2477
  var init_version = __esm({
2478
2478
  "src/core/version.ts"() {
2479
2479
  "use strict";
2480
- VERSION = true ? "0.1.97" : "0.0.0-dev";
2480
+ VERSION = true ? "0.1.99" : "0.0.0-dev";
2481
2481
  }
2482
2482
  });
2483
2483
 
@@ -2664,13 +2664,13 @@ function findOperationById(id) {
2664
2664
  }
2665
2665
  function useManifestForTest(manifest) {
2666
2666
  const previous = override;
2667
- const set = (value) => {
2667
+ const set2 = (value) => {
2668
2668
  override = value;
2669
2669
  byCommand = void 0;
2670
2670
  byId = void 0;
2671
2671
  };
2672
- set(manifest);
2673
- return () => set(previous);
2672
+ set2(manifest);
2673
+ return () => set2(previous);
2674
2674
  }
2675
2675
  var EMPTY, parsed, override, byCommand, byId;
2676
2676
  var init_manifest = __esm({
@@ -7990,19 +7990,19 @@ function jsonValue(text4) {
7990
7990
  }
7991
7991
  }
7992
7992
  function parseSet(pairs, aliases, textFields = []) {
7993
- const set = {};
7993
+ const set2 = {};
7994
7994
  for (const pair of pairs) {
7995
7995
  const at = pair.indexOf("=");
7996
7996
  const key = at > 0 ? pair.slice(0, at).trim() : "";
7997
7997
  if (key === "") throw usageError(`--set takes field=value (got "${pair}").`, { field: "set", hint: "For example --set stage=engaged." });
7998
7998
  const text4 = pair.slice(at + 1).trim();
7999
7999
  const field = aliases[key] ?? key;
8000
- if (field in set) throw usageError(`--set names ${field} twice.`, { field: "set" });
8000
+ if (field in set2) throw usageError(`--set names ${field} twice.`, { field: "set" });
8001
8001
  const json = jsonValue(text4);
8002
8002
  const asText = textFields.includes(field) && json !== null && typeof json !== "string";
8003
- set[field] = asText || json === void 0 ? text4 : json;
8003
+ set2[field] = asText || json === void 0 ? text4 : json;
8004
8004
  }
8005
- return set;
8005
+ return set2;
8006
8006
  }
8007
8007
  function filterBody(flags) {
8008
8008
  const raw = stringFlag2(flags, "filter");
@@ -8262,7 +8262,7 @@ var init_connect = __esm({
8262
8262
  var crm_default;
8263
8263
  var init_crm = __esm({
8264
8264
  "docs/crm.md"() {
8265
- crm_default = '# CRM (beta)\n\nThe CRM commands work on Kenso\'s Accounts lane: accounts (companies), the people on them, and opportunities. They are beta: they need the `accounts` feature flag on your workspace (opportunities need `opportunities`, CRM sync needs `ingestion`). Help and `kenso describe` hide them until your workspace has the flag; `--all-commands` shows them.\n\n| Command | What it does |\n|---|---|\n| `accounts import` | Create accounts from a CSV or JSONL file. Research is charged per created account |\n| `people import` | Create or match people from a file, optionally onto accounts |\n| `accounts update --each`, `people update --each`, `opportunities update --each` | Edit many records from a file, one call per row |\n| `accounts bulk-update`, `people bulk-update`, `opportunities bulk-update` | Set the same fields on many records at once, by ids or by a filter, with a preview first. Needs `bulk_edit` too |\n| `accounts bulk-delete`, `people bulk-delete`, `opportunities bulk-delete` | Delete many records at once, by ids or by a filter, with a preview first. Not undone. Needs `bulk_edit` too |\n| `changes list`, `get`, `rows`, `apply`, `cancel`, `undo` | Follow a bulk change, read what each record got, stop it, or put the old values back for 30 days |\n| `accounts write-research`, `people write-research` | Store research you gathered as a record\'s latest research, free. `--each` writes many |\n| `opportunities move <id> --stage <key> [--reason <key>]` | Move a deal, with its won or lost reason; a field the stage asks for never stops it |\n| `opportunities stage-history <id>` | A deal\'s stage history: each stage, when, who moved it and how long it sat there |\n| `notes list`, `notes add`, `notes edit`, `notes delete` | Notes and comments on accounts, people and deals (needs `record_notes`) |\n| `deleted-accounts list`, `accounts restore <id>` | The accounts deleted in the last 30 days, and bringing one back |\n| `export <accounts\\|people\\|deals>` | The list as CSV: everything, a saved Accounts view, or what the filters match |\n| `capture status` | Your captured mailbox, its backfill progress and what teammates see of a captured email. Needs the `crm_capture` flag |\n| `capture connect` | Turn capture on for your own mailbox. `--private` starts it hidden from teammates; `--provider google` prints a sign-in link when no account is connected yet |\n| `capture private on\\|off` | Hide your captured email from teammates, or show it again. Email only: meetings stay visible. `--thread <id>` sets the switch for one thread |\n| `capture thread <threadId>` | One captured email thread: subject, people, time, Ken\'s summary, and each body you may open. The id is `capturedThread.id` on a timeline row |\n| `capture sync` | Read your captured mailbox now, instead of waiting for the next two-minute poll. Prints what the pass read, logged and created |\n| `capture disconnect` | Turn capture off and delete your stored email bodies. Asks first; `--yes` skips the question |\n| `capture teammates-see summary\\|full_email` | Workspace admin: what teammates see of captured email |\n| `pipelines stage-rules` | List or set the fields a deal should have in each stage |\n| `opportunity-reasons get`, `opportunity-reasons replace` | List or edit why deals are lost and won |\n| `crm-connections`, `crm-imports`, `crm-sync-issues` | Read and run CRM sync. Connecting a CRM stays in the app |\n| `tasks add`, `tasks done`, `tasks assign`, `tasks queue` | Add a to-do for a member on an account, person or deal, complete it, hand it on, or read your open work (needs `tasks`) |\n\nImport accounts first, then people: `people import` never creates an account.\n\n## Import accounts\n\n```bash\nkenso accounts import --file accounts.csv\nkenso accounts import --file accounts.csv --yes\n```\n\n```csv\nname,domain,industry,employeeCount\nAcme,acme.io,Software,120\nGlobex,globex.com,Manufacturing,"1,200"\n```\n\n- **Columns** map by name, ignoring case, spaces and dashes: `name` (or `company`, `companyName`, `accountName`), `domains` (several, split on `,` or `;`) or one `domain` (or `website`, `companyDomain`), `industry`, `employeeCount`, `hqLocation`, `linkedinUrl`, `stage`, `angle`, `whyNow`, `fitScore`, `fundingRound`, `cadenceDays`, `ownerMemberId`, `kenCompanyId`, `sendsFromInboxId`, `sendsFromLinkedInAccountId` and `source`.\n- **A domain is required.** A file with no domain column is a usage error, and a row without a domain is `invalid` (`domain_required`).\n- **The dry run prices the research.** It asks for a credit estimate per 1,000 accounts and puts the sum in the plan: `kind`, `accountCount`, `totalMillicredits`, `availableMillicredits` and `sufficient`.\n- **Rows go 100 per call** to `POST /v1/accounts/bulk-create`.\n\nEach row comes back `created` (`id` is the new account; its research is queued, `researchQueued`, or waits for credits, `researchWaitingCredits`), `skipped` with reason `domain_taken` (already an account; `id` is that account) or `failed` (`reason` is the API\'s code, `error` names the field; an item Kenso failed to save is sent once more first). Rerunning the same file is safe: accounts that exist come back `domain_taken`.\n\n## Import people\n\n```bash\nkenso people import --file people.csv\nkenso people import --file people.csv --find-emails --yes\nkenso people import --file people.jsonl --dry-run\n```\n\n```csv\nfullName,email,title,accountDomain,role\nAnn Lee,ann@acme.io,VP Sales,acme.io,champion\nBob Ray,,CTO,acme.io,\n```\n\n- **Columns** map by name, ignoring case, spaces and dashes: `email`, `fullName` (or `name`), `firstName`, `lastName`, `title`, `linkedinUrl` (or `linkedin`, `profileUrl`), `accountDomain` (or `domain`, `website`, `companyDomain`), `accountId`, `role` and `priority`. Other columns are ignored with one warning.\n- **A person needs a name:** `fullName`, or `firstName`, `lastName` or both (the CLI joins them). A row with none of them is `invalid` (`name_required`).\n- **To put a person on an account,** give `accountDomain` or `accountId`. A row with both sends only `accountId`.\n- **`--find-emails`** queues an email find (charged in credits) for each person without an email.\n- **Rows go 200 per call** to `POST /v1/people/batch`.\n\nPeople already in the workspace are matched by email, then LinkedIn URL, so running the same file again creates nobody twice. A row comes back `created` (a new person), `updated` (an existing person added to the account), `skipped` with reason `already_on_account`, `matched` (no account asked) or `previously_removed`, or `failed`: `account_not_found` saves the person without an account (import the account, then rerun to place them), any other reason is the API\'s. The summary adds `matched`, `addedToAccounts` and `emailFindsQueued`.\n\n## List and search accounts\n\n`accounts list` and `accounts search` sort and page on the server, so they reach every account in the workspace, however many there are.\n\n```bash\nkenso accounts list --sort score:desc --limit 100 # one page; the output\'s next: line is the following one\nkenso accounts list --sort score:desc --limit 100 --all # every page, to the end\nkenso accounts search --search hiring --sort latestSignalAt:desc --data \'{"qFields": ["name", "latestSignal"]}\'\nkenso accounts search --limit 1 --data \'{"countBy": ["stage"]}\' # how many accounts sit in each stage\nkenso accounts search --data \'{"where": {"match": "all", "conditions": [{"field": "tier", "operator": "is", "values": ["1"]}]}, "sort": "tier,-pipelineAmount"}\' --all\nkenso accounts search --data \'{"where": {"match": "all", "conditions": [{"field": "hqLocation", "operator": "contains", "values": ["Germany"]}]}}\' --all\n# tier 1 accounts with no meeting in 30 days: none since then, or none ever\nkenso accounts search --data \'{"where": {"match": "all", "conditions": [{"field": "tier", "operator": "is", "values": ["1"]}, {"match": "any", "conditions": [{"field": "lastMeeting", "operator": "older_than_days", "values": ["30"]}, {"field": "lastMeeting", "operator": "is_empty"}]}]}}\' --all\n```\n\n- **`--sort`** takes up to 3 comma-separated keys, each `field` (ascending), `field:asc` or `field:desc`. The API\'s `-field` form needs the equals sign here, `--sort=-score`, because a value that starts with a dash reads as a flag. Fields: `createdAt`, `name`, `score`, `tier` (ascending is tier 1 first), `latestSignalAt`, `committee`, `pipelineAmount`, `nextTouchAt`, `lastTouchAt`. An account with no value for a key comes last in both directions. The default is `-createdAt`.\n- **`--limit`** is 1 to 1000 (default 50). `--cursor` takes the previous page\'s `nextCursor` with the same filters and sort; `--all` follows the cursors for you.\n- **`--search`** (also `--q`) matches the name or a domain.\n- **Lists and objects go in `--data`** on `search`, as the API takes them (`kenso describe accounts search`); a flag beside it sets or replaces one key:\n - `qFields` picks where the search text looks: `name`, `domain`, `latestSignal` (the latest signal\'s title).\n - `countBy` (`stage`, `stageGroup`) adds `counts` to the output: every value with the number of matching accounts that hold it, whatever the page. The output is then one object: `data`, `pagination` and `counts`.\n - `filters` and `where` narrow the accounts.\n\nAn account\'s timeline pages the same way. `kenso accounts activity 812` returns the newest 100 earlier rows and, when older ones exist, `data.nextCursor`. Pass it back as `--cursor` (with the same `--category`) for the rows before them, until a page comes without one.\n\n## Edit accounts, people and opportunities\n\nTo set the same fields on many records, use `bulk-update` (below; it needs the `bulk_edit` flag). When every row gets its own values, or the workspace has no `bulk_edit`, run the generated `update` command once per row with `--each`. Columns are the command\'s flags by API name or flag name, and the id column fills the route:\n\n```bash\nkenso accounts update --each accounts-edit.csv --dry-run # then the same with --yes\nkenso people update --each people-edit.csv --dry-run\nkenso opportunities update --each deals.csv --dry-run\n```\n\n```csv\naccountId,stage,ownerMemberId,overwritePinned\n501,engaged,42,true\n502,customer,42,true\n```\n\nA row that changes a field someone pinned in the app fails as a whole (`409 conflict`, `pinned_by_user`: nothing on that record changes, the other fields of the row included), unless the row sets `overwritePinned` to `true` (or you pass `--overwrite-pinned`, only with the person\'s OK). Every flag of an update command: `kenso accounts update --help`.\n\n## Change many accounts at once\n\n```bash\nkenso accounts bulk-update --filter \'{"filters":[{"field":"stage","operator":"is","values":["new"]}]}\' --set owner=42 --dry-run\nkenso changes apply --change-id 31\nkenso accounts bulk-update --ids 812,813 --set stage=engaged --set tier=2 --yes\nkenso changes get --change-id 31\n```\n\n`accounts bulk-update` sets the same fields on every account you name: `--ids` (up to 1,000), everything a `--filter` matches (the body `kenso accounts search --data` takes: `filters`, `where`, `q`; up to 50,000), or `--all`. A filter that holds only options and no condition (`--filter \'{"includeImportOnly":true}\'`) takes `--all` beside it. `--exclude-ids` leaves some of a filter\'s accounts out. `--set field=value` takes `ownerMemberId` (or `owner`), `stage`, `tierOverride` (or `tier`), `industry`, `fundingRound`, `employeeCount`, `hqLocation` and `cadenceDays`, and a custom field as `custom.<key>` (`--set custom.region=EMEA`; `kenso api GET \'/v1/fields?object=account\'` gives the keys); a value of `null` clears the field. A text field\'s value is sent as you type it (`--set hqLocation=10001` is the text "10001"); a custom field\'s type is not known to the CLI, so quote its text when it reads as a number or as true or false: `--set \'custom.code="10001"\'`. Use `accounts update --each` when every row gets its own values.\n\nIt makes a change set: the accounts it names and, for each, the field, its value before and its value after. Without `--yes` (or with `--dry-run`) it previews: it prints `count` and a `sample`, writes nothing, and `next` is the `kenso changes apply` command that writes exactly those accounts. With `--yes` it writes in the background and waits (`--timeout`, default 10m), then prints the change with its `counts`: `applied`, `unchanged` (already had the value), `conflict` (the account changed after the preview, so it was left alone) and `failed` (for example `pinned`: a person set the field by hand; `--overwrite-pinned` replaces it). Exit 5 when some accounts failed or conflicted. It needs the `bulk_edit` flag as well as `accounts`.\n\n`kenso accounts bulk-update` used to be the generated command for the route\'s older one-field body, which sets one `accountType` on up to 500 accounts and needs only `accounts`. The route still takes that body, but this command no longer sends it: use `kenso accounts update --each` with an `accountType` column, or `kenso api POST /v1/accounts/bulk-update --data \'{"accountIds":[812,813],"accountType":"lost"}\'`.\n\n`people bulk-update` and `opportunities bulk-update` work the same way. People take `--set` for `ownerMemberId` (or `owner`), `leadStatus`, `title`, `seniority`, `department` and `location`, and a `--filter` of `kenso people search --data` fields (`leadStatus`, `roles`, `tagIds`, `q` and the rest). Deals take `stage` (a live stage key), `ownerMemberId` (or `owner`), `closeDate` (or `close`), `amount`, `dealType` and `nextStep`, and a `--filter` of `kenso opportunities search --data` fields (`filters`, `accountId`, `q`):\n\n```bash\nkenso opportunities bulk-update --filter \'{"filters":[{"field":"stageCategory","operator":"is","values":["open"]}]}\' --set stage=proposal --dry-run\nkenso people bulk-update --ids 501,502 --set owner=42 --yes\n```\n\n### Delete many records at once\n\n```bash\nkenso people bulk-delete --filter \'{"onAccount":"none","leadStatus":["disqualified"]}\' --dry-run\nkenso changes apply --change-id 32\nkenso opportunities bulk-delete --ids 71,72,73 --yes\n```\n\n`accounts bulk-delete`, `people bulk-delete` and `opportunities bulk-delete` name their records the way `bulk-update` does (`--ids`, `--filter`, `--all`, `--exclude-ids`) and take no `--set`. Without `--yes` they preview: `count`, a `sample`, and `next` is the `kenso changes apply` command that deletes exactly those records. The API itself previews a delete whose body leaves `dryRun` out, so `--yes` sends `dryRun: false`. Each record is deleted as its own `delete` command deletes it, so one that cannot be deleted (a person still on an account) is counted as `failed` and the rest go on. A delete is not undone with `kenso changes undo`.\n\n### Follow, stop and undo a change\n\n```bash\nkenso changes list --object accounts\nkenso changes rows --change-id 31 --status conflict,failed\nkenso changes cancel --change-id 31\nkenso changes undo --change-id 31\n```\n\n`changes list` shows the workspace\'s bulk changes, newest first, whoever made them. `changes rows` lists a change\'s records with the value before (`from`) and after (`to`) and a `status`; `--status conflict,failed` reads what a change missed. `changes cancel` drops a preview or stops a change that is still writing; what it already wrote stays. `changes undo` puts the old value back on every record that still holds the value the change wrote, for 30 days after it was applied (`undoUntil`). A record someone changed again since keeps its newer value: `counts.undone` is how many went back, `counts.applied` how many still hold the change. Undo answers `409 invalid_state` with `undo_expired`, `still_running`, `nothing_applied` or `not_undoable` when there is nothing it can put back.\n\n## Search opportunities\n\n`kenso opportunities search` works as `accounts search` does: it takes `--search`, `--sort`, `--limit`, `--cursor`, `--all`, and its lists in `--data`.\n\n```bash\nkenso opportunities search --data \'{"filters": [{"field": "stageCategory", "operator": "is", "values": ["open"]}]}\' --all\nkenso opportunities search --data \'{"filters": [{"field": "ownerMemberId", "operator": "is", "values": ["none"]}, {"field": "closeDate", "operator": "is", "values": ["past_due", "next_30_days"]}]}\'\nkenso opportunities search --limit 1 --data \'{"countBy": ["stage", "ownerMemberId"]}\' # how many opportunities hold each value\n```\n\n- **`filters`** is a list of `{field, operator, values}`, all of which must hold. Fields: `stage` (a stage key), `stageCategory` (`open`, `won`, `lost`), `ownerMemberId`, `closeDate` (`past_due`, `next_30_days`, `later`, `none`) and `sourceCampaignId`. `operator` is `is` or `is_not`; the values of one condition are OR. `none` in `values` matches an opportunity with no owner, no source campaign or no close date.\n- **`countBy`** takes the same field names and adds `counts` to the output: per field, every value with the number of matching opportunities that hold it.\n- `--account-id` keeps the search to one account. `closeDate` counts days in the member\'s app time zone.\n\nOne person\'s deals, meetings and campaign contacts, as their person page lists them:\n\n```bash\nkenso opportunities list --person-id 9001 # the deals they are on, or are the primary person of\nkenso meetings list --person-id 9001 # the meetings they attend, among the ones you can see\nkenso contacts list --person-id 9001 # their contact in each campaign they are in\n```\n\n## Write research you gathered\n\n`accounts write-research` and `people write-research` store research you gathered outside Kenso as the record\'s latest research (`PUT /v1/accounts/{accountId}/research`, `PUT /v1/people/{personId}/research`). The Research tab shows it like a Ken run, with `trigger: agent` and `researchedAt` now. Nothing is charged, and no account or person field changes: set an account\'s own `fitScore`, `whyNow` or `angle` with `accounts update`. They need the `accounts_research` flag and accounts edit.\n\nThe body is the research block `accounts get --expand research` (or `people get-research`) returns, without its read-only fields: leave out `id`, `status`, `trigger`, `errorCode`, `researchedAt`, `isStale` and `appliedPrompt` (for a person also `mode`, `requestedAt`, `researchedMode`, `firecrawlCredits` and `webNote`), or the write fails with `unknown_field`. Pass it with `--data @file`:\n\n```bash\nkenso accounts write-research --account-id 501 --data @acme-dossier.json\nkenso people write-research --person-id 9001 --data @jane.json\n```\n\n```json\n{\n "tagline": { "text": "Payroll for EU contractors", "sourceUrls": ["https://acme.example"] },\n "description": { "text": "Acme runs payroll and compliance for companies hiring contractors in 30 EU countries.", "sourceUrls": ["https://acme.example"] },\n "links": { "website": "https://acme.example" },\n "whyNow": { "text": "Raised a $40M Series B in October", "sourceUrls": ["https://news.example/acme-b"], "date": "2026-10" },\n "fitScore": 82,\n "angle": "Lead with contractor onboarding time."\n}\n```\n\nMany records: one JSONL line per record, with the id next to the block\'s fields. Nested objects are sent as written. Use JSONL, not CSV: the block\'s fields are objects and lists, which a CSV cell cannot carry.\n\n```bash\nkenso accounts write-research --each dossiers.jsonl --dry-run # then the same with --yes\nkenso people write-research --each people-research.jsonl --yes --concurrency 8\n```\n\n```jsonl\n{"accountId": 501, "tagline": {"text": "Payroll for EU contractors"}, "links": {"website": "https://acme.example"}}\n{"accountId": 502, "description": {"text": "Cloud cost tooling for retailers."}, "links": {"website": "https://beta.example"}}\n```\n\nA row fails as a whole with the API\'s code: `validation_failed` (an unknown field is `unknown_field`, and `error.details` names every bad field), `research_in_progress` (`409`: Ken is researching that record now, write it again once the run ends; an account run waiting for credits counts too: it runs once the workspace has credits, and the write stays refused until that run ends) or `not_found`. Rerunning a file is safe: each write replaces the record\'s research shown.\n\n## CRM sync\n\nCRM sync has generated commands only: read connections, preview, start an import, and work through sync issues. Connect the CRM itself in the app.\n\n```bash\nkenso crm-connections list\nkenso crm-connections get --connection-id 7\nkenso crm-imports create --connection-id 7 --dry-run\nkenso crm-sync-issues list --connection-id 7 --all\n```\n\nRun `kenso crm-connections --help` (or add `--all-commands` when the actions are hidden) to see every action.\n\n## Pipelines\n\nA workspace with the `pipelines` flag on can run several deal pipelines, each with its own stages. These are generated commands (beta):\n\n```bash\nkenso pipelines list\nkenso pipelines list --query "[].{id: id, name: name, default: isDefault, stages: stages[].key}"\nkenso pipelines get --pipeline-id 5\n```\n\n`list` prints every pipeline in display order, archived ones included: `id`, `name`, `routingRule` (the one sentence Ken reads to decide whether a new deal belongs there), `isDefault`, `isArchived`, `position`, `opportunityCount`, `amountTotal` and `stages`, each stage as `kenso opportunity-stages list` prints it. A stage key is unique in the workspace, across pipelines, so a deal\'s `stage` names its pipeline and its `pipelineId` repeats it. The first read turns the workspace\'s stage list into its default pipeline, named Sales, with every deal in it. The same rows as the MCP\'s `pipelines(operation="list")`.\n\nShaping them needs the `workspace_settings` permission:\n\n```bash\nkenso pipelines create --name Renewals --routing-rule "The account is already a customer" --data \'{"stages": [{"label": "Up for renewal", "category": "open"}, {"label": "Won", "category": "won"}, {"label": "Lost", "category": "lost"}]}\'\nkenso pipelines update --pipeline-id 6 --name Expansion --position 0\nkenso pipelines update --pipeline-id 6 --data @stages.json\nkenso pipelines archive --pipeline-id 6\nkenso pipelines restore --pipeline-id 6\n```\n\n- **`create`** takes a unique `name`, the pipeline\'s `stages` in display order (at least one `open`, one `won` and one `lost`) and an optional `routingRule`: one sentence that says which deals belong there, which Ken reads to route a new deal that names no pipeline. Each stage gets a key from its label; a key another pipeline already uses gets the pipeline\'s name in front (`renewals_won`). A workspace has at most 10 pipelines.\n- **`update`** changes what you send. `stages` is the pipeline\'s whole stage list: read it with `pipelines get`, keep each stage\'s `key`, and add a new stage without one. A stage with live deals in it cannot be left out; archive it with `"isArchived": true` instead.\n- **`archive`** stops new deals from entering a pipeline and keeps the deals in it. The default pipeline cannot be archived, and nothing is deleted: `restore` brings a pipeline back.\n\n## Restore a deleted account\n\n```bash\nkenso deleted-accounts list\nkenso accounts restore 812\n```\n\nA deleted account can be restored for 30 days. `deleted-accounts list` shows each one with who deleted it, `expiresAt` (restore works until then) and what comes back: `personCount`, `opportunityCount` and `touchCount`. `accounts restore <id>` brings the account back with its domains, its people, its deals and its planned touches, which wait for approval again. A domain another account took since stays with that account and is listed in `domainsTaken`. A merged account is not listed and cannot be restored: a merge has no undo. Both commands are behind the `crm_import_export` feature flag (`404` while it is off).\n\n## Export accounts, people or deals\n\n```bash\nkenso export accounts --out accounts.csv\nkenso export accounts --view 12 --out tier-1.csv\nkenso export deals --filters \'[{"field":"stageCategory","operator":"is","values":["open"]}]\' > open-deals.csv\n```\n\nIt writes the CSV that `POST /v1/accounts/export`, `/v1/people/export` or `/v1/opportunities/export` returns, to stdout or to `--out` (then it prints the file and its row count). With no filter it exports every record. More than 50,000 rows is refused: narrow the filters. `--view <id>` exports a saved Accounts view (`kenso account-views list` shows the ids). `--filters`, `--where` (accounts), `--q` and `--sort` are the search operation\'s own fields, so a deals or people view exports with its filters and sort. The accounts and deals files start with `id` and import back as they are. Each export writes an audit-log entry and needs the export permission. Accounts and deals also need the `crm_import_export` flag while it is in beta.\n\n## A deal\'s stage history\n\n```bash\nkenso opportunities stage-history 77\nkenso opportunities stage-history 77 --query "entries[].{to: stageLabel, at: enteredAt, by: changedBy}"\n```\n\nIt prints `GET /v1/opportunities/{id}/stage-history` as it is, the same rows as the deal page and the MCP\'s `opportunities(operation="get-stage-history")`: the stage now, `isComplete` and `entries`, oldest first, each with `fromStage`, `stage`, `stageLabel`, `enteredAt`, `leftAt`, `durationSeconds`, `actorKind`, `actorMemberId` and Ken\'s `reason` on a move its stage judge made. With the `deal_stage_rules` flag on, each entry also has `changedBy` (`member`, `agent`, `api_key`, `workflow`, `stage_judge`, `crm_sync` or `ken_automation`), `crmProvider` on a CRM sync, and on a move `fromStageLabel` and `fromStageDurationSeconds`, how long the deal sat in the stage it left. `isComplete` false means Kenso has no record of part of the history.\n\n## Notes on accounts, people and deals\n\nWith the `record_notes` feature on, everyone who can see a record reads its notes. Name the record with exactly one of `--account`, `--person` and `--deal`:\n\n```bash\nkenso notes list --account 5\nkenso notes add --account 5 --body \'Budget approved, @[Jane Doe](41) please send the DPA\'\nkenso notes add --parent 900 --body \'Sent it this morning\' # a comment under note 900\ncat call-notes.md | kenso notes add --deal 77 --body - # the body from stdin\nkenso notes edit 900 --body \'Budget approved for Q1\' # the author only\nkenso notes edit 900 --pin\nkenso notes delete 900 --yes # kenso notes restore 900 brings it back\n```\n\nThe body is markdown, up to 20,000 characters. Mention a teammate as `@[Name](memberId)`: they get a notification that opens the note. A note shows on the record\'s Notes tab and its Activity timeline, and Ken\'s account brief quotes the account\'s notes. The MCP\'s `notes` tool does the same. A note on an account needs the accounts plan feature; people and deals work on every plan.\n\n## Required fields per stage\n\n```bash\nkenso pipelines stage-rules\nkenso pipelines stage-rules proposal --require amount,closeDate,custom.tier\nkenso pipelines stage-rules proposal --none\nkenso pipelines stage-rules lost --default\n```\n\nWith the `deal_stage_rules` flag on, each stage can name the fields a deal should have in it. Without a stage the command prints every stage\'s `key`, `label`, `category`, `isArchived`, `requiredFields` and `isDefault`, plus `requirableFields`: `amount`, `closeDate`, `ownerMemberId`, `primaryPersonId`, `nextStep`, `lostReasonKey`, `wonReasonKey` and `custom.<key>` for each custom deal field. `--require` sets the stage\'s whole list, in order, at most 10. `--none` requires nothing, and `--default` goes back to the default: a lost stage asks for `lostReasonKey`, any other stage nothing. Setting a rule needs the `workspace_settings` permission. The same as the MCP\'s `opportunities(operation="stages-set-required-fields")`.\n\nA missing field never stops a move. The deal moves, and it is flagged Missing on the board, the list and the deal page until the field is filled. A rule also applies to deals already in the stage.\n\n```bash\nkenso opportunities update --opportunity-id 4401 --stage proposal\nkenso opportunities list --missing-fields\n```\n\nEvery deal then carries `missingFields` (`[{field, label}]`). A create, or an update that sends a stage, answers `warnings` beside the deal for each field the stage asks for that the deal leaves empty: each prints on stderr as `warning: <message>`, stdout stays the deal and the exit code stays 0. `--missing-fields` keeps only the deals flagged Missing (also `missingFields: true` on `kenso opportunities search`).\n\n## Won and lost reasons\n\n```bash\nkenso opportunity-reasons get\nkenso opportunity-reasons replace --kind lost --data \'{"reasons":[{"key":"no_budget","label":"No budget"},{"label":"Built it in-house"}]}\'\nkenso opportunities move 4401 --stage lost --reason built_it_in_house\n```\n\n`kenso opportunities move <id> --stage <key> [--reason <key>]` sends the reason as `lostReasonKey` for a lost stage or `wonReasonKey` for a won stage; an open stage takes none. Each field the new stage asks for that the deal leaves empty prints a warning on stderr, and the move still goes through.\n\nWith the `deal_stage_rules` flag on, each workspace edits why its deals are lost and won. `get` prints `lost` and `won`, each `{isDefault, reasons: [{key, label, isArchived}]}`. `replace` takes a kind\'s whole list in order, as `get` prints it: keep a reason by its `key`, leave `key` out for a new one, and set `isArchived` to archive a reason or bring one back. A reason left out is archived too: deals keep it, and no write can pick it again. At least one reason stays live and at most 30, and labels stay unique, archived ones included. A deal takes a live key in `lostReasonKey` (a lost stage) or `wonReasonKey` (a won stage). A move to Lost without a reason still goes through, with a warning and "Missing: Lost reason" on the deal. Editing the lists needs the `workspace_settings` permission. The same as the MCP\'s `pipelines(operation="reasons-get")` and `reasons-replace`.\n\n## Tasks\n\nTasks are to-dos a member owes: a title, an optional due day or time, an assignee and at most one account, person or deal. They need the `tasks` flag. The app calls deals "Deals"; the CLI keeps `--deal` for an opportunity id.\n\n```bash\nkenso tasks add "Send the deck" --due tomorrow --account 812\nkenso tasks add "Call Ada back" --due friday --at 16:00 --person 501 --assignee ada@acme.com\nkenso tasks list --assignee me --due overdue,today\nkenso tasks queue --scope mine\nkenso tasks assign 7 me\nkenso tasks done 7 8 9\nkenso tasks done 7 --undo\n```\n\n- `tasks add` sends `POST /v1/tasks`. `--due` takes `today`, `tomorrow`, a weekday (the next one: `friday` or `fri`), a day (`2026-11-20`) or an ISO 8601 time; `--at HH:MM` puts a time on that day (today without `--due`). Day words and `--at` read this computer\'s clock and time zone (`TZ`); a time\'s day is read in the assignee\'s app time zone. `--assignee` takes `me`, a member id or an email; without it the task is yours.\n- `tasks done` completes each task it names, in order (`PATCH /v1/tasks/{id}` with `status: done`); `--undo` reopens them. `tasks assign` gives a task to `me`, a member id or a member\'s email; that member gets a `task_assigned` notification.\n- `tasks queue` is `task-queue list` under the name you would try: the Tasks screen\'s open work by due day, with `--scope mine|assigned_by_me|everyone`. It lists tasks, manual touches, call tasks, inbox threads with a reminder due (when you can view the Inbox) and Ken\'s follow-ups to you, each with the app path in `href` (null for a task, which opens in its panel).\n- `tasks list`, `get`, `update`, `delete`, `restore` and `task-queue list` are generated from the API: `kenso tasks --help` lists them.\n';
8265
+ crm_default = '# CRM (beta)\n\nThe CRM commands work on Kenso\'s Accounts lane: accounts (companies), the people on them, and opportunities. They are beta: they need the `accounts` feature flag on your workspace (opportunities need `opportunities`, CRM sync needs `ingestion`). Help and `kenso describe` hide them until your workspace has the flag; `--all-commands` shows them.\n\n| Command | What it does |\n|---|---|\n| `accounts import` | Create accounts from a CSV or JSONL file. Research is charged per created account |\n| `people import` | Create or match people from a file, optionally onto accounts |\n| `accounts update --each`, `people update --each`, `opportunities update --each` | Edit many records from a file, one call per row |\n| `accounts bulk-update`, `people bulk-update`, `opportunities bulk-update` | Set the same fields on many records at once, by ids or by a filter, with a preview first. Needs `bulk_edit` too |\n| `accounts bulk-delete`, `people bulk-delete`, `opportunities bulk-delete` | Delete many records at once, by ids or by a filter, with a preview first. Not undone. Needs `bulk_edit` too |\n| `changes list`, `get`, `rows`, `apply`, `cancel`, `undo` | Follow a bulk change, read what each record got, stop it, or put the old values back for 30 days |\n| `accounts write-research`, `people write-research` | Store research you gathered as a record\'s latest research, free. `--each` writes many |\n| `opportunities move <id> [--stage <key>] [--pipeline <pipelineId>] [--reason <key>]` | Move a deal to a stage or another pipeline, with its won or lost reason; a field the stage asks for never stops it |\n| `opportunities stage-history <id>` | A deal\'s stage history: each stage, when, who moved it and how long it sat there |\n| `notes list`, `notes add`, `notes edit`, `notes delete` | Notes and comments on accounts, people and deals (needs `record_notes`) |\n| `deleted-accounts list`, `accounts restore <id>` | The accounts deleted in the last 30 days, and bringing one back |\n| `export <accounts\\|people\\|deals>` | The list as CSV: everything, a saved Accounts view, or what the filters match |\n| `capture status` | Your captured mailbox, its backfill progress and what teammates see of a captured email. Needs the `crm_capture` flag |\n| `capture connect` | Turn capture on for your own mailbox. `--private` starts it hidden from teammates; `--provider google` prints a sign-in link when no account is connected yet |\n| `capture private on\\|off` | Hide your captured email from teammates, or show it again. Email only: meetings stay visible. `--thread <id>` sets the switch for one thread |\n| `capture thread <threadId>` | One captured email thread: subject, people, time, Ken\'s summary, and each body you may open. The id is `capturedThread.id` on a timeline row |\n| `capture sync` | Read your captured mailbox now, instead of waiting for the next two-minute poll. Prints what the pass read, logged and created |\n| `capture disconnect` | Turn capture off and delete your stored email bodies. Asks first; `--yes` skips the question |\n| `capture teammates-see summary\\|full_email` | Workspace admin: what teammates see of captured email |\n| `pipelines stage-rules` | List or set the fields a deal should have in each stage |\n| `opportunity-reasons get`, `opportunity-reasons replace` | List or edit why deals are lost and won |\n| `layouts show\\|set\\|reset <object>` | How every account, person or deal page in the workspace lays out its fields: header, rail sections and hidden fields (needs `record_layout`) |\n| `crm-connections`, `crm-imports`, `crm-sync-issues` | Read and run CRM sync. Connecting a CRM stays in the app |\n| `tasks add`, `tasks done`, `tasks assign`, `tasks queue` | Add a to-do for a member on an account, person or deal, complete it, hand it on, or read your open work (needs `tasks`) |\n\nImport accounts first, then people: `people import` never creates an account.\n\n## Import accounts\n\n```bash\nkenso accounts import --file accounts.csv\nkenso accounts import --file accounts.csv --yes\n```\n\n```csv\nname,domain,industry,employeeCount\nAcme,acme.io,Software,120\nGlobex,globex.com,Manufacturing,"1,200"\n```\n\n- **Columns** map by name, ignoring case, spaces and dashes: `name` (or `company`, `companyName`, `accountName`), `domains` (several, split on `,` or `;`) or one `domain` (or `website`, `companyDomain`), `industry`, `employeeCount`, `hqLocation`, `linkedinUrl`, `stage`, `angle`, `whyNow`, `fitScore`, `fundingRound`, `cadenceDays`, `ownerMemberId`, `kenCompanyId`, `sendsFromInboxId`, `sendsFromLinkedInAccountId` and `source`.\n- **A domain is required.** A file with no domain column is a usage error, and a row without a domain is `invalid` (`domain_required`).\n- **The dry run prices the research.** It asks for a credit estimate per 1,000 accounts and puts the sum in the plan: `kind`, `accountCount`, `totalMillicredits`, `availableMillicredits` and `sufficient`.\n- **Rows go 100 per call** to `POST /v1/accounts/bulk-create`.\n\nEach row comes back `created` (`id` is the new account; its research is queued, `researchQueued`, or waits for credits, `researchWaitingCredits`), `skipped` with reason `domain_taken` (already an account; `id` is that account) or `failed` (`reason` is the API\'s code, `error` names the field; an item Kenso failed to save is sent once more first). Rerunning the same file is safe: accounts that exist come back `domain_taken`.\n\n## Import people\n\n```bash\nkenso people import --file people.csv\nkenso people import --file people.csv --find-emails --yes\nkenso people import --file people.jsonl --dry-run\n```\n\n```csv\nfullName,email,title,accountDomain,role\nAnn Lee,ann@acme.io,VP Sales,acme.io,champion\nBob Ray,,CTO,acme.io,\n```\n\n- **Columns** map by name, ignoring case, spaces and dashes: `email`, `fullName` (or `name`), `firstName`, `lastName`, `title`, `linkedinUrl` (or `linkedin`, `profileUrl`), `accountDomain` (or `domain`, `website`, `companyDomain`), `accountId`, `role` and `priority`. Other columns are ignored with one warning.\n- **A person needs a name:** `fullName`, or `firstName`, `lastName` or both (the CLI joins them). A row with none of them is `invalid` (`name_required`).\n- **To put a person on an account,** give `accountDomain` or `accountId`. A row with both sends only `accountId`.\n- **`--find-emails`** queues an email find (charged in credits) for each person without an email.\n- **Rows go 200 per call** to `POST /v1/people/batch`.\n\nPeople already in the workspace are matched by email, then LinkedIn URL, so running the same file again creates nobody twice. A row comes back `created` (a new person), `updated` (an existing person added to the account), `skipped` with reason `already_on_account`, `matched` (no account asked) or `previously_removed`, or `failed`: `account_not_found` saves the person without an account (import the account, then rerun to place them), any other reason is the API\'s. The summary adds `matched`, `addedToAccounts` and `emailFindsQueued`.\n\n## List and search accounts\n\n`accounts list` and `accounts search` sort and page on the server, so they reach every account in the workspace, however many there are.\n\n```bash\nkenso accounts list --sort score:desc --limit 100 # one page; the output\'s next: line is the following one\nkenso accounts list --sort score:desc --limit 100 --all # every page, to the end\nkenso accounts search --search hiring --sort latestSignalAt:desc --data \'{"qFields": ["name", "latestSignal"]}\'\nkenso accounts search --limit 1 --data \'{"countBy": ["stage"]}\' # how many accounts sit in each stage\nkenso accounts search --data \'{"where": {"match": "all", "conditions": [{"field": "tier", "operator": "is", "values": ["1"]}]}, "sort": "tier,-pipelineAmount"}\' --all\nkenso accounts search --data \'{"where": {"match": "all", "conditions": [{"field": "hqLocation", "operator": "contains", "values": ["Germany"]}]}}\' --all\n# tier 1 accounts with no meeting in 30 days: none since then, or none ever\nkenso accounts search --data \'{"where": {"match": "all", "conditions": [{"field": "tier", "operator": "is", "values": ["1"]}, {"match": "any", "conditions": [{"field": "lastMeeting", "operator": "older_than_days", "values": ["30"]}, {"field": "lastMeeting", "operator": "is_empty"}]}]}}\' --all\n```\n\n- **`--sort`** takes up to 3 comma-separated keys, each `field` (ascending), `field:asc` or `field:desc`. The API\'s `-field` form needs the equals sign here, `--sort=-score`, because a value that starts with a dash reads as a flag. Fields: `createdAt`, `name`, `score`, `tier` (ascending is tier 1 first), `latestSignalAt`, `committee`, `pipelineAmount`, `nextTouchAt`, `lastTouchAt`. An account with no value for a key comes last in both directions. The default is `-createdAt`.\n- **`--limit`** is 1 to 1000 (default 50). `--cursor` takes the previous page\'s `nextCursor` with the same filters and sort; `--all` follows the cursors for you.\n- **`--search`** (also `--q`) matches the name or a domain.\n- **Lists and objects go in `--data`** on `search`, as the API takes them (`kenso describe accounts search`); a flag beside it sets or replaces one key:\n - `qFields` picks where the search text looks: `name`, `domain`, `latestSignal` (the latest signal\'s title).\n - `countBy` (`stage`, `stageGroup`) adds `counts` to the output: every value with the number of matching accounts that hold it, whatever the page. The output is then one object: `data`, `pagination` and `counts`.\n - `filters` and `where` narrow the accounts.\n\nAn account\'s timeline pages the same way. `kenso accounts activity 812` returns the newest 100 earlier rows and, when older ones exist, `data.nextCursor`. Pass it back as `--cursor` (with the same `--category`) for the rows before them, until a page comes without one.\n\n## Edit accounts, people and opportunities\n\nTo set the same fields on many records, use `bulk-update` (below; it needs the `bulk_edit` flag). When every row gets its own values, or the workspace has no `bulk_edit`, run the generated `update` command once per row with `--each`. Columns are the command\'s flags by API name or flag name, and the id column fills the route:\n\n```bash\nkenso accounts update --each accounts-edit.csv --dry-run # then the same with --yes\nkenso people update --each people-edit.csv --dry-run\nkenso opportunities update --each deals.csv --dry-run\n```\n\n```csv\naccountId,stage,ownerMemberId,overwritePinned\n501,engaged,42,true\n502,customer,42,true\n```\n\nA row that changes a field someone pinned in the app fails as a whole (`409 conflict`, `pinned_by_user`: nothing on that record changes, the other fields of the row included), unless the row sets `overwritePinned` to `true` (or you pass `--overwrite-pinned`, only with the person\'s OK). Every flag of an update command: `kenso accounts update --help`.\n\n## Change many accounts at once\n\n```bash\nkenso accounts bulk-update --filter \'{"filters":[{"field":"stage","operator":"is","values":["new"]}]}\' --set owner=42 --dry-run\nkenso changes apply --change-id 31\nkenso accounts bulk-update --ids 812,813 --set stage=engaged --set tier=2 --yes\nkenso changes get --change-id 31\n```\n\n`accounts bulk-update` sets the same fields on every account you name: `--ids` (up to 1,000), everything a `--filter` matches (the body `kenso accounts search --data` takes: `filters`, `where`, `q`; up to 50,000), or `--all`. A filter that holds only options and no condition (`--filter \'{"includeImportOnly":true}\'`) takes `--all` beside it. `--exclude-ids` leaves some of a filter\'s accounts out. `--set field=value` takes `ownerMemberId` (or `owner`), `stage`, `tierOverride` (or `tier`), `industry`, `fundingRound`, `employeeCount`, `hqLocation` and `cadenceDays`, and a custom field as `custom.<key>` (`--set custom.region=EMEA`; `kenso api GET \'/v1/fields?object=account\'` gives the keys); a value of `null` clears the field. A text field\'s value is sent as you type it (`--set hqLocation=10001` is the text "10001"); a custom field\'s type is not known to the CLI, so quote its text when it reads as a number or as true or false: `--set \'custom.code="10001"\'`. Use `accounts update --each` when every row gets its own values.\n\nIt makes a change set: the accounts it names and, for each, the field, its value before and its value after. Without `--yes` (or with `--dry-run`) it previews: it prints `count` and a `sample`, writes nothing, and `next` is the `kenso changes apply` command that writes exactly those accounts. With `--yes` it writes in the background and waits (`--timeout`, default 10m), then prints the change with its `counts`: `applied`, `unchanged` (already had the value), `conflict` (the account changed after the preview, so it was left alone) and `failed` (for example `pinned`: a person set the field by hand; `--overwrite-pinned` replaces it). Exit 5 when some accounts failed or conflicted. It needs the `bulk_edit` flag as well as `accounts`.\n\n`kenso accounts bulk-update` used to be the generated command for the route\'s older one-field body, which sets one `accountType` on up to 500 accounts and needs only `accounts`. The route still takes that body, but this command no longer sends it: use `kenso accounts update --each` with an `accountType` column, or `kenso api POST /v1/accounts/bulk-update --data \'{"accountIds":[812,813],"accountType":"lost"}\'`.\n\n`people bulk-update` and `opportunities bulk-update` work the same way. People take `--set` for `ownerMemberId` (or `owner`), `leadStatus`, `title`, `seniority`, `department` and `location`, and a `--filter` of `kenso people search --data` fields (`leadStatus`, `roles`, `tagIds`, `q` and the rest). Deals take `stage` (a live stage key), `ownerMemberId` (or `owner`), `closeDate` (or `close`), `amount`, `dealType` and `nextStep`, and a `--filter` of `kenso opportunities search --data` fields (`filters`, `accountId`, `q`):\n\n```bash\nkenso opportunities bulk-update --filter \'{"filters":[{"field":"stageCategory","operator":"is","values":["open"]}]}\' --set stage=proposal --dry-run\nkenso people bulk-update --ids 501,502 --set owner=42 --yes\n```\n\n### Delete many records at once\n\n```bash\nkenso people bulk-delete --filter \'{"onAccount":"none","leadStatus":["disqualified"]}\' --dry-run\nkenso changes apply --change-id 32\nkenso opportunities bulk-delete --ids 71,72,73 --yes\n```\n\n`accounts bulk-delete`, `people bulk-delete` and `opportunities bulk-delete` name their records the way `bulk-update` does (`--ids`, `--filter`, `--all`, `--exclude-ids`) and take no `--set`. Without `--yes` they preview: `count`, a `sample`, and `next` is the `kenso changes apply` command that deletes exactly those records. The API itself previews a delete whose body leaves `dryRun` out, so `--yes` sends `dryRun: false`. Each record is deleted as its own `delete` command deletes it, so one that cannot be deleted (a person still on an account) is counted as `failed` and the rest go on. A delete is not undone with `kenso changes undo`.\n\n### Follow, stop and undo a change\n\n```bash\nkenso changes list --object accounts\nkenso changes rows --change-id 31 --status conflict,failed\nkenso changes cancel --change-id 31\nkenso changes undo --change-id 31\n```\n\n`changes list` shows the workspace\'s bulk changes, newest first, whoever made them. `changes rows` lists a change\'s records with the value before (`from`) and after (`to`) and a `status`; `--status conflict,failed` reads what a change missed. `changes cancel` drops a preview or stops a change that is still writing; what it already wrote stays. `changes undo` puts the old value back on every record that still holds the value the change wrote, for 30 days after it was applied (`undoUntil`). A record someone changed again since keeps its newer value: `counts.undone` is how many went back, `counts.applied` how many still hold the change. Undo answers `409 invalid_state` with `undo_expired`, `still_running`, `nothing_applied` or `not_undoable` when there is nothing it can put back.\n\n## Search opportunities\n\n`kenso opportunities search` works as `accounts search` does: it takes `--search`, `--sort`, `--limit`, `--cursor`, `--all`, and its lists in `--data`.\n\n```bash\nkenso opportunities search --data \'{"filters": [{"field": "stageCategory", "operator": "is", "values": ["open"]}]}\' --all\nkenso opportunities search --data \'{"filters": [{"field": "ownerMemberId", "operator": "is", "values": ["none"]}, {"field": "closeDate", "operator": "is", "values": ["past_due", "next_30_days"]}]}\'\nkenso opportunities search --limit 1 --data \'{"countBy": ["stage", "ownerMemberId"]}\' # how many opportunities hold each value\n```\n\n- **`filters`** is a list of `{field, operator, values}`, all of which must hold. Fields: `stage` (a stage key), `stageCategory` (`open`, `won`, `lost`), `ownerMemberId`, `closeDate` (`past_due`, `next_30_days`, `later`, `none`) and `sourceCampaignId`. `operator` is `is` or `is_not`; the values of one condition are OR. `none` in `values` matches an opportunity with no owner, no source campaign or no close date.\n- **`countBy`** takes the same field names and adds `counts` to the output: per field, every value with the number of matching opportunities that hold it.\n- `--account-id` keeps the search to one account. `closeDate` counts days in the member\'s app time zone.\n\nOne person\'s deals, meetings and campaign contacts, as their person page lists them:\n\n```bash\nkenso opportunities list --person-id 9001 # the deals they are on, or are the primary person of\nkenso meetings list --person-id 9001 # the meetings they attend, among the ones you can see\nkenso contacts list --person-id 9001 # their contact in each campaign they are in\n```\n\n## Write research you gathered\n\n`accounts write-research` and `people write-research` store research you gathered outside Kenso as the record\'s latest research (`PUT /v1/accounts/{accountId}/research`, `PUT /v1/people/{personId}/research`). The Research tab shows it like a Ken run, with `trigger: agent` and `researchedAt` now. Nothing is charged, and no account or person field changes: set an account\'s own `fitScore`, `whyNow` or `angle` with `accounts update`. They need the `accounts_research` flag and accounts edit.\n\nThe body is the research block `accounts get --expand research` (or `people get-research`) returns, without its read-only fields: leave out `id`, `status`, `trigger`, `errorCode`, `researchedAt`, `isStale` and `appliedPrompt` (for a person also `mode`, `requestedAt`, `researchedMode`, `firecrawlCredits` and `webNote`), or the write fails with `unknown_field`. Pass it with `--data @file`:\n\n```bash\nkenso accounts write-research --account-id 501 --data @acme-dossier.json\nkenso people write-research --person-id 9001 --data @jane.json\n```\n\n```json\n{\n "tagline": { "text": "Payroll for EU contractors", "sourceUrls": ["https://acme.example"] },\n "description": { "text": "Acme runs payroll and compliance for companies hiring contractors in 30 EU countries.", "sourceUrls": ["https://acme.example"] },\n "links": { "website": "https://acme.example" },\n "whyNow": { "text": "Raised a $40M Series B in October", "sourceUrls": ["https://news.example/acme-b"], "date": "2026-10" },\n "fitScore": 82,\n "angle": "Lead with contractor onboarding time."\n}\n```\n\nMany records: one JSONL line per record, with the id next to the block\'s fields. Nested objects are sent as written. Use JSONL, not CSV: the block\'s fields are objects and lists, which a CSV cell cannot carry.\n\n```bash\nkenso accounts write-research --each dossiers.jsonl --dry-run # then the same with --yes\nkenso people write-research --each people-research.jsonl --yes --concurrency 8\n```\n\n```jsonl\n{"accountId": 501, "tagline": {"text": "Payroll for EU contractors"}, "links": {"website": "https://acme.example"}}\n{"accountId": 502, "description": {"text": "Cloud cost tooling for retailers."}, "links": {"website": "https://beta.example"}}\n```\n\nA row fails as a whole with the API\'s code: `validation_failed` (an unknown field is `unknown_field`, and `error.details` names every bad field), `research_in_progress` (`409`: Ken is researching that record now, write it again once the run ends; an account run waiting for credits counts too: it runs once the workspace has credits, and the write stays refused until that run ends) or `not_found`. Rerunning a file is safe: each write replaces the record\'s research shown.\n\n## CRM sync\n\nCRM sync has generated commands only: read connections, preview, start an import, and work through sync issues. Connect the CRM itself in the app.\n\n```bash\nkenso crm-connections list\nkenso crm-connections get --connection-id 7\nkenso crm-imports create --connection-id 7 --dry-run\nkenso crm-sync-issues list --connection-id 7 --all\n```\n\nRun `kenso crm-connections --help` (or add `--all-commands` when the actions are hidden) to see every action.\n\n## Pipelines\n\nA workspace with the `pipelines` flag on can run several deal pipelines, each with its own stages. These are generated commands (beta):\n\n```bash\nkenso pipelines list\nkenso pipelines list --query "[].{id: id, name: name, default: isDefault, stages: stages[].key}"\nkenso pipelines get --pipeline-id 5\n```\n\n`list` prints every pipeline in display order, archived ones included: `id`, `name`, `routingRule` (the one sentence Ken reads to decide whether a new deal belongs there), `isDefault`, `isArchived`, `position`, `opportunityCount`, `amountTotal` and `stages`, each stage as `kenso opportunity-stages list` prints it. A stage key is unique in the workspace, across pipelines, so a deal\'s `stage` names its pipeline and its `pipelineId` repeats it. The first read turns the workspace\'s stage list into its default pipeline, named Sales, with every deal in it. The same rows as the MCP\'s `pipelines(operation="list")`.\n\nShaping them needs the `workspace_settings` permission:\n\n```bash\nkenso pipelines create --name Renewals --routing-rule "The account is already a customer" --data \'{"stages": [{"label": "Up for renewal", "category": "open"}, {"label": "Won", "category": "won"}, {"label": "Lost", "category": "lost"}]}\'\nkenso pipelines update --pipeline-id 6 --name Expansion --position 0\nkenso pipelines update --pipeline-id 6 --data @stages.json\nkenso pipelines archive --pipeline-id 6\nkenso pipelines restore --pipeline-id 6\n```\n\n- **`create`** takes a unique `name`, the pipeline\'s `stages` in display order (at least one `open`, one `won` and one `lost`) and an optional `routingRule`: one sentence that says which deals belong there, which Ken reads to route a new deal that names no pipeline. Each stage gets a key from its label; a key another pipeline already uses gets the pipeline\'s name in front (`renewals_won`). A workspace has at most 10 pipelines.\n- **`update`** changes what you send. `stages` is the pipeline\'s whole stage list: read it with `pipelines get`, keep each stage\'s `key`, and add a new stage without one. A stage with live deals in it cannot be left out; archive it with `"isArchived": true` instead.\n- **`archive`** stops new deals from entering a pipeline and keeps the deals in it. The default pipeline cannot be archived, and nothing is deleted: `restore` brings a pipeline back.\n\n## Deals in a pipeline\n\nA deal\'s stage names its pipeline, and the deal\'s `pipelineId` repeats it. To work one pipeline\'s deals, or move a deal between pipelines:\n\n```bash\nkenso opportunities list --pipeline-id 6\nkenso opportunities search --pipeline-id 6 --data \'{"countBy": ["stage"]}\'\nkenso opportunities create --account-id 501 --pipeline-id 6\nkenso opportunities move 77 --pipeline 6\nkenso opportunities move 77 --pipeline 6 --stage negotiating\n```\n\n- **`create --pipeline-id`** opens the deal in that pipeline\'s first live open stage. Without it, and without a `stage`, the deal opens in the default pipeline.\n- **`move --pipeline`** alone keeps the deal\'s category (`open`, `won` or `lost`): it lands in that pipeline\'s live stage of the category with the same label as its stage now, else in the category\'s first live stage. The printed deal says where it landed. With `--stage`, the stage must be that pipeline\'s; the error lists the pipeline\'s stage keys otherwise.\n- An archived pipeline takes no deal from another pipeline (`pipeline_archived`). The deals already in it still move between its stages.\n- A move is a stage change: it writes the same history, and a stage a person set is refused with `pinned_by_user` unless you pass `--overwrite-pinned`.\n\n## Restore a deleted account\n\n```bash\nkenso deleted-accounts list\nkenso accounts restore 812\n```\n\nA deleted account can be restored for 30 days. `deleted-accounts list` shows each one with who deleted it, `expiresAt` (restore works until then) and what comes back: `personCount`, `opportunityCount` and `touchCount`. `accounts restore <id>` brings the account back with its domains, its people, its deals and its planned touches, which wait for approval again. A domain another account took since stays with that account and is listed in `domainsTaken`. A merged account is not listed and cannot be restored: a merge has no undo. Both commands are behind the `crm_import_export` feature flag (`404` while it is off).\n\n## Export accounts, people or deals\n\n```bash\nkenso export accounts --out accounts.csv\nkenso export accounts --view 12 --out tier-1.csv\nkenso export deals --filters \'[{"field":"stageCategory","operator":"is","values":["open"]}]\' > open-deals.csv\n```\n\nIt writes the CSV that `POST /v1/accounts/export`, `/v1/people/export` or `/v1/opportunities/export` returns, to stdout or to `--out` (then it prints the file and its row count). With no filter it exports every record. More than 50,000 rows is refused: narrow the filters. `--view <id>` exports a saved Accounts view (`kenso account-views list` shows the ids). `--filters`, `--where` (accounts), `--q` and `--sort` are the search operation\'s own fields, so a deals or people view exports with its filters and sort. The accounts and deals files start with `id` and import back as they are. Each export writes an audit-log entry and needs the export permission. Accounts and deals also need the `crm_import_export` flag while it is in beta.\n\n## A deal\'s stage history\n\n```bash\nkenso opportunities stage-history 77\nkenso opportunities stage-history 77 --query "entries[].{to: stageLabel, at: enteredAt, by: changedBy}"\n```\n\nIt prints `GET /v1/opportunities/{id}/stage-history` as it is, the same rows as the deal page and the MCP\'s `opportunities(operation="get-stage-history")`: the stage now, `isComplete` and `entries`, oldest first, each with `fromStage`, `stage`, `stageLabel`, `enteredAt`, `leftAt`, `durationSeconds`, `actorKind`, `actorMemberId` and Ken\'s `reason` on a move its stage judge made. With the `deal_stage_rules` flag on, each entry also has `changedBy` (`member`, `agent`, `api_key`, `workflow`, `stage_judge`, `crm_sync` or `ken_automation`), `crmProvider` on a CRM sync, and on a move `fromStageLabel` and `fromStageDurationSeconds`, how long the deal sat in the stage it left. `isComplete` false means Kenso has no record of part of the history.\n\n## Notes on accounts, people and deals\n\nWith the `record_notes` feature on, everyone who can see a record reads its notes. Name the record with exactly one of `--account`, `--person` and `--deal`:\n\n```bash\nkenso notes list --account 5\nkenso notes add --account 5 --body \'Budget approved, @[Jane Doe](41) please send the DPA\'\nkenso notes add --parent 900 --body \'Sent it this morning\' # a comment under note 900\ncat call-notes.md | kenso notes add --deal 77 --body - # the body from stdin\nkenso notes edit 900 --body \'Budget approved for Q1\' # the author only\nkenso notes edit 900 --pin\nkenso notes delete 900 --yes # kenso notes restore 900 brings it back\n```\n\nThe body is markdown, up to 20,000 characters. Mention a teammate as `@[Name](memberId)`: they get a notification that opens the note. A note shows on the record\'s Notes tab and its Activity timeline, and Ken\'s account brief quotes the account\'s notes. The MCP\'s `notes` tool does the same. A note on an account needs the accounts plan feature; people and deals work on every plan.\n\n## Required fields per stage\n\n```bash\nkenso pipelines stage-rules\nkenso pipelines stage-rules proposal --require amount,closeDate,custom.tier\nkenso pipelines stage-rules proposal --none\nkenso pipelines stage-rules lost --default\n```\n\nWith the `deal_stage_rules` flag on, each stage can name the fields a deal should have in it. Without a stage the command prints every stage\'s `key`, `label`, `category`, `isArchived`, `requiredFields` and `isDefault`, plus `requirableFields`: `amount`, `closeDate`, `ownerMemberId`, `primaryPersonId`, `nextStep`, `lostReasonKey`, `wonReasonKey` and `custom.<key>` for each custom deal field. `--require` sets the stage\'s whole list, in order, at most 10. `--none` requires nothing, and `--default` goes back to the default: a lost stage asks for `lostReasonKey`, any other stage nothing. Setting a rule needs the `workspace_settings` permission. The same as the MCP\'s `opportunities(operation="stages-set-required-fields")`.\n\nA missing field never stops a move. The deal moves, and it is flagged Missing on the board, the list and the deal page until the field is filled. A rule also applies to deals already in the stage.\n\n```bash\nkenso opportunities update --opportunity-id 4401 --stage proposal\nkenso opportunities list --missing-fields\n```\n\nEvery deal then carries `missingFields` (`[{field, label}]`). A create, or an update that sends a stage, answers `warnings` beside the deal for each field the stage asks for that the deal leaves empty: each prints on stderr as `warning: <message>`, stdout stays the deal and the exit code stays 0. `--missing-fields` keeps only the deals flagged Missing (also `missingFields: true` on `kenso opportunities search`).\n\n## Won and lost reasons\n\n```bash\nkenso opportunity-reasons get\nkenso opportunity-reasons replace --kind lost --data \'{"reasons":[{"key":"no_budget","label":"No budget"},{"label":"Built it in-house"}]}\'\nkenso opportunities move 4401 --stage lost --reason built_it_in_house\n```\n\n`kenso opportunities move <id> --stage <key> [--reason <key>]` sends the reason as `lostReasonKey` for a lost stage or `wonReasonKey` for a won stage; an open stage takes none. Each field the new stage asks for that the deal leaves empty prints a warning on stderr, and the move still goes through.\n\nWith the `deal_stage_rules` flag on, each workspace edits why its deals are lost and won. `get` prints `lost` and `won`, each `{isDefault, reasons: [{key, label, isArchived}]}`. `replace` takes a kind\'s whole list in order, as `get` prints it: keep a reason by its `key`, leave `key` out for a new one, and set `isArchived` to archive a reason or bring one back. A reason left out is archived too: deals keep it, and no write can pick it again. At least one reason stays live and at most 30, and labels stay unique, archived ones included. A deal takes a live key in `lostReasonKey` (a lost stage) or `wonReasonKey` (a won stage). A move to Lost without a reason still goes through, with a warning and "Missing: Lost reason" on the deal. Editing the lists needs the `workspace_settings` permission. The same as the MCP\'s `pipelines(operation="reasons-get")` and `reasons-replace`.\n\n## Record page layouts\n\n```bash\nkenso layouts show account\nkenso layouts set account --header tier,ownerMemberId,score,custom.arr\nkenso layouts show account > layout.json && kenso layouts set account --data @layout.json\nkenso layouts reset account\n```\n\nWith the `record_layout` flag on, a workspace lays out each record page once, for every member: `account`, `person` or `opportunity` (a deal). `show` prints `GET /v1/record-layouts/{object}`: `isDefault`, `version`, `headerFields` (up to 6, pinned under the record\'s name), `railSections` (`{name, fields}`), `hiddenFields` (under the rail\'s More), `sections` (`{key, label, placement, locked, hidden}`, in page order) and `availableFields`. Field keys are the field catalog\'s (`ownerMemberId`, `closeDate`, `primaryDomain`); a custom field is `custom.<field_key>`, and a new one joins the last rail section.\n\n`set --header` pins up to 6 fields and keeps the rest of the saved layout; the fields it unpins go to the top of the first rail section. `set --data` saves a whole layout, so group the rail into sections or hide a section that way, starting from `show`. A save made after someone else\'s answers a conflict: show it again. `reset` puts the page back to Kenso\'s default. Saving needs the `workspace_settings` permission, and the account page also needs the `accounts` plan. The same as the MCP\'s `account_views` operations `record-layouts-get`, `record-layouts-replace` and `record-layouts-reset`.\n\n## Tasks\n\nTasks are to-dos a member owes: a title, an optional due day or time, an assignee and at most one account, person or deal. They need the `tasks` flag. The app calls deals "Deals"; the CLI keeps `--deal` for an opportunity id.\n\n```bash\nkenso tasks add "Send the deck" --due tomorrow --account 812\nkenso tasks add "Call Ada back" --due friday --at 16:00 --person 501 --assignee ada@acme.com\nkenso tasks list --assignee me --due overdue,today\nkenso tasks queue --scope mine\nkenso tasks assign 7 me\nkenso tasks done 7 8 9\nkenso tasks done 7 --undo\n```\n\n- `tasks add` sends `POST /v1/tasks`. `--due` takes `today`, `tomorrow`, a weekday (the next one: `friday` or `fri`), a day (`2026-11-20`) or an ISO 8601 time; `--at HH:MM` puts a time on that day (today without `--due`). Day words and `--at` read this computer\'s clock and time zone (`TZ`); a time\'s day is read in the assignee\'s app time zone. `--assignee` takes `me`, a member id or an email; without it the task is yours.\n- `tasks done` completes each task it names, in order (`PATCH /v1/tasks/{id}` with `status: done`); `--undo` reopens them. `tasks assign` gives a task to `me`, a member id or a member\'s email; that member gets a `task_assigned` notification.\n- `tasks queue` is `task-queue list` under the name you would try: the Tasks screen\'s open work by due day, with `--scope mine|assigned_by_me|everyone`. It lists tasks, manual touches, call tasks, inbox threads with a reminder due (when you can view the Inbox) and Ken\'s follow-ups to you, each with the app path in `href` (null for a task, which opens in its panel).\n- `tasks list`, `get`, `update`, `delete`, `restore` and `task-queue list` are generated from the API: `kenso tasks --help` lists them.\n';
8266
8266
  }
8267
8267
  });
8268
8268
 
@@ -12843,6 +12843,146 @@ var init_jobs2 = __esm({
12843
12843
  }
12844
12844
  });
12845
12845
 
12846
+ // src/commands/layouts/layouts.ts
12847
+ var layouts_exports = {};
12848
+ __export(layouts_exports, {
12849
+ reset: () => reset,
12850
+ set: () => set,
12851
+ show: () => show,
12852
+ withHeader: () => withHeader
12853
+ });
12854
+ function objectOf(positionals, action) {
12855
+ const text4 = (positionals[0] ?? "").trim().toLowerCase();
12856
+ if (!OBJECTS2.includes(text4)) {
12857
+ throw usageError(`object must be account, person or opportunity (got "${positionals[0] ?? ""}").`, {
12858
+ field: "object",
12859
+ next: `kenso layouts ${action} account`
12860
+ });
12861
+ }
12862
+ return text4;
12863
+ }
12864
+ async function call(ctx, method, object, body2) {
12865
+ const res = await ctx.client.request({ method, path: `/v1/record-layouts/${object}`, body: body2, signal: ctx.signal });
12866
+ return unwrap(res.body);
12867
+ }
12868
+ function bodyOf(layout) {
12869
+ return {
12870
+ version: layout.version,
12871
+ headerFields: layout.headerFields,
12872
+ railSections: layout.railSections?.map((s) => ({ name: s.name, fields: s.fields })),
12873
+ hiddenFields: layout.hiddenFields,
12874
+ sections: layout.sections?.map((s) => ({ key: s.key, hidden: s.hidden ?? false }))
12875
+ };
12876
+ }
12877
+ function withHeader(layout, header) {
12878
+ const pinned = new Set(header.map((key) => key.toLowerCase()));
12879
+ const unpinned = (layout.headerFields ?? []).filter((f) => !pinned.has(f.toLowerCase()));
12880
+ return bodyOf({
12881
+ version: layout.version,
12882
+ headerFields: header,
12883
+ railSections: (layout.railSections ?? []).map((s, index) => ({
12884
+ name: s.name,
12885
+ fields: [...index === 0 ? unpinned : [], ...s.fields.filter((f) => !pinned.has(f.toLowerCase()))]
12886
+ })),
12887
+ hiddenFields: (layout.hiddenFields ?? []).filter((f) => !pinned.has(f.toLowerCase())),
12888
+ sections: layout.sections ?? []
12889
+ });
12890
+ }
12891
+ var OBJECTS2, BETA, OBJECT_ARG, show, set, reset;
12892
+ var init_layouts = __esm({
12893
+ "src/commands/layouts/layouts.ts"() {
12894
+ "use strict";
12895
+ init_errors();
12896
+ init_exit_codes();
12897
+ init_http();
12898
+ init_input();
12899
+ OBJECTS2 = ["account", "person", "opportunity"];
12900
+ BETA = { featureGates: { all: ["record_layout"] } };
12901
+ OBJECT_ARG = { name: "object", required: true, description: "account, person or opportunity (a deal)" };
12902
+ show = {
12903
+ resource: "layouts",
12904
+ action: "show",
12905
+ summary: "Show how the workspace's account, person or deal pages lay out their fields",
12906
+ description: "Reads GET /v1/record-layouts/{object} and prints it: isDefault, version, headerFields (up to 6, pinned under the record's name), railSections ({name, fields}), hiddenFields (under the rail's More), sections ({key, label, placement, locked, hidden}, in page order) and availableFields ({key, label, custom}). A custom field's key is custom.<field_key>. The default answers while nobody saved a layout.",
12907
+ flags: {},
12908
+ positionals: [OBJECT_ARG],
12909
+ examples: ["kenso layouts show account", "kenso layouts show person --query 'railSections[].name'"],
12910
+ beta: BETA,
12911
+ operationIds: ["record-layouts.get"],
12912
+ async run(ctx, { positionals }) {
12913
+ ctx.output.object(await call(ctx, "GET", objectOf(positionals, "show")));
12914
+ return ExitCode.Ok;
12915
+ }
12916
+ };
12917
+ set = {
12918
+ resource: "layouts",
12919
+ action: "set",
12920
+ summary: "Save the layout every account, person or deal page in the workspace draws",
12921
+ description: "PUT /v1/record-layouts/{object}. --header pins up to 6 fields to the header: it reads the layout, takes those fields out of the rail and the hidden list, puts the fields it unpins at the top of the first rail section, and saves the rest as it was. --data sends a whole layout (headerFields, railSections, hiddenFields, sections, version) inline, from @file or from - (stdin); start from `kenso layouts show <object>`. A save after someone else's answers conflict: show it again. Needs the workspace_settings permission; it changes the page for every member.",
12922
+ flags: {
12923
+ header: { type: "string", description: "Field keys to pin to the header, comma separated (tier,custom.arr)" },
12924
+ data: { type: "string", description: "The whole layout as JSON: inline, @file or - for stdin" }
12925
+ },
12926
+ positionals: [OBJECT_ARG],
12927
+ examples: [
12928
+ "kenso layouts set account --header tier,custom.arr",
12929
+ "kenso layouts show account > layout.json && kenso layouts set account --data @layout.json"
12930
+ ],
12931
+ beta: BETA,
12932
+ operationIds: ["record-layouts.get", "record-layouts.replace"],
12933
+ async run(ctx, { flags, positionals }) {
12934
+ const object = objectOf(positionals, "set");
12935
+ const header = typeof flags.header === "string" ? flags.header : void 0;
12936
+ const data = typeof flags.data === "string" ? flags.data : void 0;
12937
+ if (header === void 0 === (data === void 0)) {
12938
+ throw usageError("Pass one of --header or --data.", { next: `kenso layouts set ${object} --header tier,ownerMemberId` });
12939
+ }
12940
+ let body2;
12941
+ if (header !== void 0) {
12942
+ const keys = header.split(",").map((k) => k.trim()).filter(Boolean);
12943
+ body2 = withHeader(await call(ctx, "GET", object), keys);
12944
+ } else {
12945
+ const parsed2 = await readDataArg(data, ctx.stdin);
12946
+ if (parsed2 === null || typeof parsed2 !== "object" || Array.isArray(parsed2)) {
12947
+ throw usageError("--data must be a JSON object: {headerFields, railSections, hiddenFields, sections, version}.", { field: "data" });
12948
+ }
12949
+ body2 = bodyOf(parsed2);
12950
+ }
12951
+ ctx.output.object(await call(ctx, "PUT", object, body2));
12952
+ return ExitCode.Ok;
12953
+ }
12954
+ };
12955
+ reset = {
12956
+ resource: "layouts",
12957
+ action: "reset",
12958
+ summary: "Put the account, person or deal page back to Kenso's default layout",
12959
+ description: "DELETE /v1/record-layouts/{object}: drops the saved layout for the whole workspace (the version keeps counting) and prints the default.",
12960
+ flags: {},
12961
+ positionals: [OBJECT_ARG],
12962
+ examples: ["kenso layouts reset account"],
12963
+ beta: BETA,
12964
+ operationIds: ["record-layouts.reset"],
12965
+ async run(ctx, { positionals }) {
12966
+ ctx.output.object(await call(ctx, "DELETE", objectOf(positionals, "reset")));
12967
+ return ExitCode.Ok;
12968
+ }
12969
+ };
12970
+ }
12971
+ });
12972
+
12973
+ // src/commands/layouts/index.ts
12974
+ var actions15;
12975
+ var init_layouts2 = __esm({
12976
+ "src/commands/layouts/index.ts"() {
12977
+ "use strict";
12978
+ actions15 = {
12979
+ show: () => Promise.resolve().then(() => (init_layouts(), layouts_exports)).then((m) => m.show),
12980
+ set: () => Promise.resolve().then(() => (init_layouts(), layouts_exports)).then((m) => m.set),
12981
+ reset: () => Promise.resolve().then(() => (init_layouts(), layouts_exports)).then((m) => m.reset)
12982
+ };
12983
+ }
12984
+ });
12985
+
12846
12986
  // src/commands/logs/tail.ts
12847
12987
  var tail_exports = {};
12848
12988
  __export(tail_exports, {
@@ -12997,11 +13137,11 @@ var init_tail = __esm({
12997
13137
  });
12998
13138
 
12999
13139
  // src/commands/logs/index.ts
13000
- var actions15;
13140
+ var actions16;
13001
13141
  var init_logs = __esm({
13002
13142
  "src/commands/logs/index.ts"() {
13003
13143
  "use strict";
13004
- actions15 = {
13144
+ actions16 = {
13005
13145
  tail: () => Promise.resolve().then(() => (init_tail(), tail_exports)).then((m) => m.default)
13006
13146
  };
13007
13147
  }
@@ -13153,11 +13293,11 @@ var init_tools = __esm({
13153
13293
  });
13154
13294
 
13155
13295
  // src/commands/mcp/index.ts
13156
- var actions16;
13296
+ var actions17;
13157
13297
  var init_mcp = __esm({
13158
13298
  "src/commands/mcp/index.ts"() {
13159
13299
  "use strict";
13160
- actions16 = {
13300
+ actions17 = {
13161
13301
  call: () => Promise.resolve().then(() => (init_call(), call_exports)).then((m) => m.default),
13162
13302
  tools: () => Promise.resolve().then(() => (init_tools(), tools_exports)).then((m) => m.default)
13163
13303
  };
@@ -13364,11 +13504,11 @@ var init_delete = __esm({
13364
13504
  });
13365
13505
 
13366
13506
  // src/commands/notes/index.ts
13367
- var actions17;
13507
+ var actions18;
13368
13508
  var init_notes = __esm({
13369
13509
  "src/commands/notes/index.ts"() {
13370
13510
  "use strict";
13371
- actions17 = {
13511
+ actions18 = {
13372
13512
  list: () => Promise.resolve().then(() => (init_list(), list_exports)).then((m) => m.default),
13373
13513
  add: () => Promise.resolve().then(() => (init_add(), add_exports)).then((m) => m.default),
13374
13514
  edit: () => Promise.resolve().then(() => (init_edit(), edit_exports)).then((m) => m.default),
@@ -13395,7 +13535,7 @@ async function categoryOf(ctx, stage) {
13395
13535
  throw err;
13396
13536
  }
13397
13537
  }
13398
- var KEY, command32, move_default;
13538
+ var KEY, ID, command32, move_default;
13399
13539
  var init_move = __esm({
13400
13540
  "src/commands/opportunities/move.ts"() {
13401
13541
  "use strict";
@@ -13403,33 +13543,53 @@ var init_move = __esm({
13403
13543
  init_exit_codes();
13404
13544
  init_http();
13405
13545
  KEY = /^[a-z][a-z0-9_]{0,62}$/;
13546
+ ID = /^[1-9]\d*$/;
13406
13547
  command32 = {
13407
13548
  resource: "opportunities",
13408
13549
  action: "move",
13409
- summary: "Move a deal to a stage, with its won or lost reason",
13410
- description: "Sends PATCH /v1/opportunities/{opportunityId} with stage, and with --reason the reason key as wonReasonKey for a won stage or lostReasonKey for a lost stage (it reads GET /v1/opportunity-stages, and GET /v1/pipelines for a stage of another pipeline, to tell which; an open stage takes no reason). Reason keys come from kenso opportunity-reasons get. Prints the deal. A move never waits for a field the stage asks for: the deal moves, each missing field prints a warning on stderr, and the deal is flagged Missing until the field is filled (kenso opportunities list --missing-fields).",
13550
+ summary: "Move a deal to a stage or another pipeline, with its won or lost reason",
13551
+ description: "Sends PATCH /v1/opportunities/{opportunityId} with stage, pipelineId or both, and prints the deal. With --pipeline alone the deal keeps its category (open, won or lost): it lands in that pipeline's live stage of the category with the same label as its stage now, else in the category's first live stage. Read where it landed from the printed stage. With --stage too, the stage must be that pipeline's. --stage alone moves the deal to that stage, in whichever pipeline holds it. An archived pipeline takes no deal from another one. A stage a person set is refused with pinned_by_user unless --overwrite-pinned. Pipeline ids and stage keys: kenso pipelines list. With --reason (it needs --stage) the reason key goes as wonReasonKey for a won stage or lostReasonKey for a lost stage (it reads GET /v1/opportunity-stages, and GET /v1/pipelines for a stage of another pipeline, to tell which; an open stage takes no reason). Reason keys come from kenso opportunity-reasons get. A move never waits for a field the stage asks for: the deal moves, each missing field prints a warning on stderr, and the deal is flagged Missing until the field is filled (kenso opportunities list --missing-fields).",
13411
13552
  flags: {
13412
- stage: { type: "string", description: "The stage key to move to (kenso opportunity-stages list lists them)" },
13413
- reason: { type: "string", description: "A won or lost reason key (kenso opportunity-reasons get)" }
13553
+ stage: { type: "string", description: "The stage key to move to (kenso pipelines list lists every pipeline's). Without it, --pipeline maps the stage" },
13554
+ pipeline: { type: "string", aliases: ["pipeline-id"], description: "The id of the pipeline to move the deal to (kenso pipelines list)" },
13555
+ reason: { type: "string", description: "A won or lost reason key (kenso opportunity-reasons get). Needs --stage" },
13556
+ "overwrite-pinned": { type: "boolean", description: "Move the deal even when a person set its stage" }
13414
13557
  },
13415
13558
  positionals: [{ name: "opportunityId", description: "The deal's id" }],
13416
13559
  examples: [
13417
13560
  "kenso opportunities move 4401 --stage proposal",
13418
- "kenso opportunities move 4401 --stage lost --reason no_budget"
13561
+ "kenso opportunities move 4401 --stage lost --reason no_budget",
13562
+ "kenso opportunities move 77 --pipeline 6",
13563
+ "kenso opportunities move 77 --pipeline 6 --stage negotiating"
13419
13564
  ],
13420
13565
  beta: { featureGates: { all: ["opportunities"] } },
13421
13566
  operationIds: ["opportunities.update", "opportunity-stages.list", "pipelines.list"],
13422
13567
  async run(ctx, { flags, positionals }) {
13423
13568
  const id = (positionals[0] ?? "").trim();
13424
13569
  const stage = typeof flags.stage === "string" ? flags.stage.trim() : "";
13570
+ const pipeline = typeof flags.pipeline === "string" ? flags.pipeline.trim() : "";
13425
13571
  const reason = typeof flags.reason === "string" ? flags.reason.trim() : void 0;
13426
- const next = "kenso opportunities move <opportunityId> --stage <key> [--reason <key>]";
13427
- if (!/^[1-9]\d*$/.test(id)) throw usageError("Pass the deal's id: " + next, { field: "opportunityId", next });
13428
- if (!KEY.test(stage)) throw usageError("Pass --stage with a stage key (kenso opportunity-stages list lists them).", { field: "stage", next });
13572
+ const next = "kenso opportunities move <opportunityId> [--stage <key>] [--pipeline <pipelineId>] [--reason <key>]";
13573
+ if (!ID.test(id)) throw usageError("Pass the deal's id: " + next, { field: "opportunityId", next });
13574
+ if (!stage && !pipeline) {
13575
+ throw usageError("Say where the deal goes: --stage <key>, --pipeline <pipelineId>, or both.", { field: "stage", next });
13576
+ }
13577
+ if (stage && !KEY.test(stage)) {
13578
+ throw usageError("Pass --stage with a stage key (kenso pipelines list lists them).", { field: "stage", next });
13579
+ }
13580
+ if (pipeline && !(ID.test(pipeline) && Number.isSafeInteger(Number(pipeline)))) {
13581
+ throw usageError(`--pipeline takes a pipeline id (got "${pipeline}").`, { field: "pipeline", next: "kenso pipelines list" });
13582
+ }
13429
13583
  if (reason !== void 0 && !KEY.test(reason)) {
13430
13584
  throw usageError(`"${reason}" is not a reason key. Read the keys with kenso opportunity-reasons get.`, { field: "reason", next });
13431
13585
  }
13432
- const body2 = { stage };
13586
+ if (reason !== void 0 && !stage) {
13587
+ throw usageError("A reason goes with the won or lost stage it explains: pass --stage too.", { field: "reason", next });
13588
+ }
13589
+ const body2 = {};
13590
+ if (pipeline) body2.pipelineId = Number(pipeline);
13591
+ if (stage) body2.stage = stage;
13592
+ if (flags["overwrite-pinned"] === true) body2.overwritePinned = true;
13433
13593
  if (reason !== void 0) {
13434
13594
  const category = await categoryOf(ctx, stage);
13435
13595
  if (category !== "won" && category !== "lost") {
@@ -13545,11 +13705,11 @@ var init_bulk_delete2 = __esm({
13545
13705
  });
13546
13706
 
13547
13707
  // src/commands/opportunities/index.ts
13548
- var actions18;
13708
+ var actions19;
13549
13709
  var init_opportunities = __esm({
13550
13710
  "src/commands/opportunities/index.ts"() {
13551
13711
  "use strict";
13552
- actions18 = {
13712
+ actions19 = {
13553
13713
  move: () => Promise.resolve().then(() => (init_move(), move_exports)).then((m) => m.default),
13554
13714
  "stage-history": () => Promise.resolve().then(() => (init_stage_history(), stage_history_exports)).then((m) => m.default),
13555
13715
  "bulk-update": () => Promise.resolve().then(() => (init_bulk_update3(), bulk_update_exports2)).then((m) => m.default),
@@ -13782,11 +13942,11 @@ var init_bulk_delete3 = __esm({
13782
13942
  });
13783
13943
 
13784
13944
  // src/commands/people/index.ts
13785
- var actions19;
13945
+ var actions20;
13786
13946
  var init_people = __esm({
13787
13947
  "src/commands/people/index.ts"() {
13788
13948
  "use strict";
13789
- actions19 = {
13949
+ actions20 = {
13790
13950
  import: () => Promise.resolve().then(() => (init_import3(), import_exports3)).then((m) => m.default),
13791
13951
  "bulk-update": () => Promise.resolve().then(() => (init_bulk_update4(), bulk_update_exports3)).then((m) => m.default),
13792
13952
  "bulk-delete": () => Promise.resolve().then(() => (init_bulk_delete3(), bulk_delete_exports3)).then((m) => m.default)
@@ -13874,11 +14034,11 @@ var init_stage_rules = __esm({
13874
14034
  });
13875
14035
 
13876
14036
  // src/commands/pipelines/index.ts
13877
- var actions20;
14037
+ var actions21;
13878
14038
  var init_pipelines = __esm({
13879
14039
  "src/commands/pipelines/index.ts"() {
13880
14040
  "use strict";
13881
- actions20 = {
14041
+ actions21 = {
13882
14042
  "stage-rules": () => Promise.resolve().then(() => (init_stage_rules(), stage_rules_exports)).then((m) => m.default)
13883
14043
  };
13884
14044
  }
@@ -14035,11 +14195,11 @@ var init_summary = __esm({
14035
14195
  });
14036
14196
 
14037
14197
  // src/commands/reports/index.ts
14038
- var actions21;
14198
+ var actions22;
14039
14199
  var init_reports = __esm({
14040
14200
  "src/commands/reports/index.ts"() {
14041
14201
  "use strict";
14042
- actions21 = {
14202
+ actions22 = {
14043
14203
  run: () => Promise.resolve().then(() => (init_run2(), run_exports2)).then((m) => m.default),
14044
14204
  summary: () => Promise.resolve().then(() => (init_summary(), summary_exports)).then((m) => m.default)
14045
14205
  };
@@ -14258,11 +14418,11 @@ var init_resume = __esm({
14258
14418
  });
14259
14419
 
14260
14420
  // src/commands/runs/index.ts
14261
- var actions22;
14421
+ var actions23;
14262
14422
  var init_runs2 = __esm({
14263
14423
  "src/commands/runs/index.ts"() {
14264
14424
  "use strict";
14265
- actions22 = {
14425
+ actions23 = {
14266
14426
  list: () => Promise.resolve().then(() => (init_list2(), list_exports2)).then((m) => m.default),
14267
14427
  show: () => Promise.resolve().then(() => (init_show2(), show_exports2)).then((m) => m.default),
14268
14428
  resume: () => Promise.resolve().then(() => (init_resume(), resume_exports)).then((m) => m.default)
@@ -14331,11 +14491,11 @@ function saveTestKey(ctx, sandboxId, key) {
14331
14491
  return;
14332
14492
  }
14333
14493
  ctx.output.info(`Saved as profile "${SANDBOX_PROFILE}". Run commands against it with --profile ${SANDBOX_PROFILE}. The key is shown once.`);
14334
- const set = [ctx.auth.source === "env" ? "KENSO_API_KEY" : "", ctx.env.KENSO_WORKSPACE_ID?.trim() ? "KENSO_WORKSPACE_ID" : ""].filter((name) => name !== "");
14335
- if (set.length > 0) {
14336
- const both = set.length > 1;
14494
+ const set2 = [ctx.auth.source === "env" ? "KENSO_API_KEY" : "", ctx.env.KENSO_WORKSPACE_ID?.trim() ? "KENSO_WORKSPACE_ID" : ""].filter((name) => name !== "");
14495
+ if (set2.length > 0) {
14496
+ const both = set2.length > 1;
14337
14497
  ctx.output.warn(
14338
- `${set.join(" and ")} ${both ? "are set and win" : "is set and wins"} over the saved profile, so --profile ${SANDBOX_PROFILE} will not use the test key and its sandbox. To work in the sandbox, set KENSO_API_KEY=<the test key> KENSO_WORKSPACE_ID=${sandboxId}, or unset ${both ? "them" : "it"}.`
14498
+ `${set2.join(" and ")} ${both ? "are set and win" : "is set and wins"} over the saved profile, so --profile ${SANDBOX_PROFILE} will not use the test key and its sandbox. To work in the sandbox, set KENSO_API_KEY=<the test key> KENSO_WORKSPACE_ID=${sandboxId}, or unset ${both ? "them" : "it"}.`
14339
14499
  );
14340
14500
  }
14341
14501
  }
@@ -14561,11 +14721,11 @@ var init_reset = __esm({
14561
14721
  });
14562
14722
 
14563
14723
  // src/commands/sandbox/index.ts
14564
- var actions23;
14724
+ var actions24;
14565
14725
  var init_sandbox2 = __esm({
14566
14726
  "src/commands/sandbox/index.ts"() {
14567
14727
  "use strict";
14568
- actions23 = {
14728
+ actions24 = {
14569
14729
  create: () => Promise.resolve().then(() => (init_create(), create_exports)).then((m) => m.default),
14570
14730
  delete: () => Promise.resolve().then(() => (init_delete2(), delete_exports2)).then((m) => m.default),
14571
14731
  key: () => Promise.resolve().then(() => (init_key(), key_exports)).then((m) => m.default),
@@ -14576,11 +14736,11 @@ var init_sandbox2 = __esm({
14576
14736
  });
14577
14737
 
14578
14738
  // src/commands/skill/index.ts
14579
- var actions24;
14739
+ var actions25;
14580
14740
  var init_skill = __esm({
14581
14741
  "src/commands/skill/index.ts"() {
14582
14742
  "use strict";
14583
- actions24 = {
14743
+ actions25 = {
14584
14744
  install: () => Promise.resolve().then(() => (init_install(), install_exports)).then((m) => m.default)
14585
14745
  };
14586
14746
  }
@@ -15449,11 +15609,11 @@ var init_fill = __esm({
15449
15609
  });
15450
15610
 
15451
15611
  // src/commands/studio/index.ts
15452
- var actions25;
15612
+ var actions26;
15453
15613
  var init_studio2 = __esm({
15454
15614
  "src/commands/studio/index.ts"() {
15455
15615
  "use strict";
15456
- actions25 = {
15616
+ actions26 = {
15457
15617
  pull: () => Promise.resolve().then(() => (init_pull(), pull_exports)).then((m) => m.default),
15458
15618
  push: () => Promise.resolve().then(() => (init_push(), push_exports)).then((m) => m.default),
15459
15619
  validate: () => Promise.resolve().then(() => (init_validate(), validate_exports)).then((m) => m.default),
@@ -15719,11 +15879,11 @@ var init_queue = __esm({
15719
15879
  });
15720
15880
 
15721
15881
  // src/commands/tasks/index.ts
15722
- var actions26;
15882
+ var actions27;
15723
15883
  var init_tasks = __esm({
15724
15884
  "src/commands/tasks/index.ts"() {
15725
15885
  "use strict";
15726
- actions26 = {
15886
+ actions27 = {
15727
15887
  add: () => Promise.resolve().then(() => (init_add2(), add_exports2)).then((m) => m.default),
15728
15888
  done: () => Promise.resolve().then(() => (init_done(), done_exports)).then((m) => m.default),
15729
15889
  assign: () => Promise.resolve().then(() => (init_assign(), assign_exports)).then((m) => m.default),
@@ -16071,11 +16231,11 @@ var init_trigger = __esm({
16071
16231
  });
16072
16232
 
16073
16233
  // src/commands/webhooks/index.ts
16074
- var actions27;
16234
+ var actions28;
16075
16235
  var init_webhooks2 = __esm({
16076
16236
  "src/commands/webhooks/index.ts"() {
16077
16237
  "use strict";
16078
- actions27 = {
16238
+ actions28 = {
16079
16239
  listen: () => Promise.resolve().then(() => (init_listen(), listen_exports)).then((m) => m.default),
16080
16240
  trigger: () => Promise.resolve().then(() => (init_trigger(), trigger_exports)).then((m) => m.default)
16081
16241
  };
@@ -16098,10 +16258,10 @@ async function pause3(ms, signal) {
16098
16258
  return false;
16099
16259
  }
16100
16260
  }
16101
- async function untilAvailable(ctx, call, signal) {
16261
+ async function untilAvailable(ctx, call2, signal) {
16102
16262
  for (let waits = 0; ; waits++) {
16103
16263
  try {
16104
- return await call();
16264
+ return await call2();
16105
16265
  } catch (err) {
16106
16266
  if (!unavailable(err) || waits >= MAX_UNAVAILABLE_WAITS) throw err;
16107
16267
  const status = err.httpStatus;
@@ -16238,14 +16398,14 @@ async function releaseClaim(ctx, claimId, headers = {}) {
16238
16398
  const data = unwrap(res.body);
16239
16399
  return isRecord8(data) && typeof data.released === "number" ? data.released : 0;
16240
16400
  }
16241
- var BETA, KINDS_TEXT, MAX_PER_FILE, MIN_LEASE_MINUTES, MAX_LEASE_MINUTES, KIND_FLAG, CAMPAIGN_FLAG, LIVE_ONLY_FLAG, PER_FILE_FLAG, LEASE_FLAG, OUT_FLAG3, UNTIL_DONE, WORK_TIMING, MAX_UNAVAILABLE_WAITS;
16401
+ var BETA2, KINDS_TEXT, MAX_PER_FILE, MIN_LEASE_MINUTES, MAX_LEASE_MINUTES, KIND_FLAG, CAMPAIGN_FLAG, LIVE_ONLY_FLAG, PER_FILE_FLAG, LEASE_FLAG, OUT_FLAG3, UNTIL_DONE, WORK_TIMING, MAX_UNAVAILABLE_WAITS;
16242
16402
  var init_common3 = __esm({
16243
16403
  "src/commands/work/common.ts"() {
16244
16404
  "use strict";
16245
16405
  init_errors();
16246
16406
  init_http();
16247
16407
  init_wait();
16248
- BETA = { featureGates: { all: ["agent_work"] } };
16408
+ BETA2 = { featureGates: { all: ["agent_work"] } };
16249
16409
  KINDS_TEXT = "meeting_brief, call_brief, workflow_prompt, qualification, segmentation, personalization, rewriting or background_ai";
16250
16410
  MAX_PER_FILE = 50;
16251
16411
  MIN_LEASE_MINUTES = 5;
@@ -16285,7 +16445,7 @@ var init_status3 = __esm({
16285
16445
  description: "Calls GET /v1/agent-work and prints one row per kind: executor (kenso_ai, or my_agent when the workspace gave the kind to its agent in Settings), waiting (items your agent can claim now), claimed (items held by open claims), heldBy (billing_blocked, out_of_credits or ai_paused when Kenso holds the kind back) and lastAcceptedAt. --live-only counts only the campaigns Kenso's AI works on by itself, as kenso work run --live-only takes them. A table on a terminal, NDJSON when piped, a JSON array with -o json.",
16286
16446
  flags: { campaign: CAMPAIGN_FLAG, "live-only": LIVE_ONLY_FLAG },
16287
16447
  examples: ["kenso work status", "kenso work status --live-only", "kenso work status --campaign 812 -o json"],
16288
- beta: BETA,
16448
+ beta: BETA2,
16289
16449
  operationIds: ["agent-work.get"],
16290
16450
  async run(ctx, { flags }) {
16291
16451
  const campaignId = campaignFlag(flags);
@@ -16443,8 +16603,8 @@ var init_files = __esm({
16443
16603
  import { execFile, spawnSync as spawnSync2 } from "node:child_process";
16444
16604
  import { readFileSync as readFileSync12 } from "node:fs";
16445
16605
  import { isAbsolute as isAbsolute2 } from "node:path";
16446
- function sudoArgs(user, command65, args, keep = [], set = {}) {
16447
- const assignments = Object.entries(set).map(([name, value]) => `${name}=${value}`);
16606
+ function sudoArgs(user, command65, args, keep = [], set2 = {}) {
16607
+ const assignments = Object.entries(set2).map(([name, value]) => `${name}=${value}`);
16448
16608
  return ["-n", "-u", user, "-H", ...keep.length > 0 ? [`--preserve-env=${keep.join(",")}`] : [], ...assignments, "--", command65, ...args];
16449
16609
  }
16450
16610
  function agentKensoEnv(opts) {
@@ -16716,7 +16876,7 @@ var init_pull2 = __esm({
16716
16876
  "kenso work pull --kind personalization --campaign 812 --out ./work"
16717
16877
  ],
16718
16878
  helpFooter: ["Then: answer each <claimId>.work.json into <claimId>.answers.json, and kenso work submit <dir>/*.answers.json."],
16719
- beta: BETA,
16879
+ beta: BETA2,
16720
16880
  operationIds: ["agent-work.create-claim", "agent-work.release-claim"],
16721
16881
  // After Ctrl-C a claim on its way still lands in a work file and the summary, so it can be answered or released.
16722
16882
  interruptGraceMs: 3e4,
@@ -16934,7 +17094,7 @@ var init_submit = __esm({
16934
17094
  flags: {},
16935
17095
  positionals: [{ name: "answers-file", required: true, variadic: true, description: "One or more <claimId>.answers.json files" }],
16936
17096
  examples: ["kenso work submit ./work/awc_8fK2.answers.json", "kenso work submit ~/.kenso/runs/r_ab3dxk2q/*.answers.json"],
16937
- beta: BETA,
17097
+ beta: BETA2,
16938
17098
  operationIds: ["agent-work.submit-answers"],
16939
17099
  async run(ctx, { positionals }) {
16940
17100
  const paths = [...new Set(positionals.map((p) => resolve14(p)))];
@@ -16996,7 +17156,7 @@ var init_release = __esm({
16996
17156
  flags: {},
16997
17157
  positionals: [{ name: "claim", required: true, variadic: true, description: "Claim ids (awc_...) or <claimId>.work.json files" }],
16998
17158
  examples: ["kenso work release awc_8fK2Qm1xYp3Lr7Tn0Va9Bc", "kenso work release ./work/*.work.json"],
16999
- beta: BETA,
17159
+ beta: BETA2,
17000
17160
  operationIds: ["agent-work.release-claim"],
17001
17161
  async run(ctx, { positionals }) {
17002
17162
  const ids2 = [...new Set(positionals.map(claimIdOf))];
@@ -17870,8 +18030,8 @@ var init_scan = __esm({
17870
18030
  addWindows(text4, into) {
17871
18031
  for (let i = 0; i + WINDOW <= text4.length; i++) into.add(this.hash(text4.slice(i, i + WINDOW)));
17872
18032
  }
17873
- anyWindow(text4, set) {
17874
- for (let i = 0; i + WINDOW <= text4.length; i++) if (set.has(this.hash(text4.slice(i, i + WINDOW)))) return true;
18033
+ anyWindow(text4, set2) {
18034
+ for (let i = 0; i + WINDOW <= text4.length; i++) if (set2.has(this.hash(text4.slice(i, i + WINDOW)))) return true;
17875
18035
  return false;
17876
18036
  }
17877
18037
  };
@@ -18487,7 +18647,7 @@ var init_run3 = __esm({
18487
18647
  "kenso docs work explains My agent, the files, the exit codes and what --allow-unconfined means.",
18488
18648
  "--token-stdin, --agent-user and --agent-tools, left out above, are how a Kenso sandbox runs it: see kenso docs work."
18489
18649
  ],
18490
- beta: BETA,
18650
+ beta: BETA2,
18491
18651
  operationIds: ["agent-work.create-claim", "agent-work.submit-answers", "agent-work.release-claim", "agent-work.create-agent-key"],
18492
18652
  // After Ctrl-C the agents stop, answers on their way finish and every open claim is released before the process quits.
18493
18653
  interruptGraceMs: 3e4,
@@ -18783,11 +18943,11 @@ var init_run3 = __esm({
18783
18943
  });
18784
18944
 
18785
18945
  // src/commands/work/index.ts
18786
- var actions28;
18946
+ var actions29;
18787
18947
  var init_work2 = __esm({
18788
18948
  "src/commands/work/index.ts"() {
18789
18949
  "use strict";
18790
- actions28 = {
18950
+ actions29 = {
18791
18951
  status: () => Promise.resolve().then(() => (init_status3(), status_exports3)).then((m) => m.default),
18792
18952
  pull: () => Promise.resolve().then(() => (init_pull2(), pull_exports2)).then((m) => m.default),
18793
18953
  submit: () => Promise.resolve().then(() => (init_submit(), submit_exports)).then((m) => m.default),
@@ -19021,11 +19181,11 @@ var init_use = __esm({
19021
19181
  });
19022
19182
 
19023
19183
  // src/commands/workspace/index.ts
19024
- var actions29;
19184
+ var actions30;
19025
19185
  var init_workspace = __esm({
19026
19186
  "src/commands/workspace/index.ts"() {
19027
19187
  "use strict";
19028
- actions29 = {
19188
+ actions30 = {
19029
19189
  keys: () => Promise.resolve().then(() => (init_keys(), keys_exports)).then((m) => m.default),
19030
19190
  list: () => Promise.resolve().then(() => (init_list4(), list_exports4)).then((m) => m.default),
19031
19191
  use: () => Promise.resolve().then(() => (init_use(), use_exports)).then((m) => m.default)
@@ -19060,6 +19220,7 @@ var init_registry = __esm({
19060
19220
  init_doctor();
19061
19221
  init_export3();
19062
19222
  init_jobs2();
19223
+ init_layouts2();
19063
19224
  init_logs();
19064
19225
  init_mcp();
19065
19226
  init_notes();
@@ -19090,24 +19251,25 @@ var init_registry = __esm({
19090
19251
  doctor: actions12,
19091
19252
  export: actions13,
19092
19253
  jobs: actions14,
19254
+ layouts: actions15,
19093
19255
  login: topLevel("login", actions4.login, "kenso auth login"),
19094
19256
  logout: topLevel("logout", actions4.logout, "kenso auth logout"),
19095
- logs: actions15,
19096
- mcp: actions16,
19097
- notes: actions17,
19098
- opportunities: actions18,
19099
- people: actions19,
19100
- pipelines: actions20,
19101
- reports: actions21,
19102
- runs: actions22,
19103
- sandbox: actions23,
19104
- skill: actions24,
19105
- studio: actions25,
19106
- tasks: actions26,
19107
- webhooks: actions27,
19257
+ logs: actions16,
19258
+ mcp: actions17,
19259
+ notes: actions18,
19260
+ opportunities: actions19,
19261
+ people: actions20,
19262
+ pipelines: actions21,
19263
+ reports: actions22,
19264
+ runs: actions23,
19265
+ sandbox: actions24,
19266
+ skill: actions25,
19267
+ studio: actions26,
19268
+ tasks: actions27,
19269
+ webhooks: actions28,
19108
19270
  whoami: topLevel("whoami", actions4.status, "kenso auth status"),
19109
- work: actions28,
19110
- workspace: actions29
19271
+ work: actions29,
19272
+ workspace: actions30
19111
19273
  };
19112
19274
  resourceAliases = { leads: "contacts" };
19113
19275
  }
@@ -19244,8 +19406,8 @@ async function renderTopHelp(opts) {
19244
19406
  names.push(withPositionals(spec, spec.action));
19245
19407
  groups.set(hint, names);
19246
19408
  }
19247
- const actions31 = [...groups.entries()].map(([hint, names]) => `${names.join(", ")}${hint}`);
19248
- if (actions31.length > 0) rows.push([resource, actions31.join(", ")]);
19409
+ const actions32 = [...groups.entries()].map(([hint, names]) => `${names.join(", ")}${hint}`);
19410
+ if (actions32.length > 0) rows.push([resource, actions32.join(", ")]);
19249
19411
  }
19250
19412
  const at = 4 + Math.min(22, Math.max(0, ...rows.map(([left]) => left.length)));
19251
19413
  lines.push(
@@ -19258,7 +19420,7 @@ async function renderTopHelp(opts) {
19258
19420
  const [area = "", action = ""] = name.split(" ");
19259
19421
  byArea.set(area, [...byArea.get(area) ?? [], action]);
19260
19422
  }
19261
- const named = [...byArea.entries()].map(([area, actions31]) => `${area} ${actions31.join("|")}`);
19423
+ const named = [...byArea.entries()].map(([area, actions32]) => `${area} ${actions32.join("|")}`);
19262
19424
  lines.push(wrap(`Beta, hidden here but they run (the server decides): ${named.join(", ")}.`, " "));
19263
19425
  }
19264
19426
  const generated = await listGenerated({ features: opts.allCommands ? [] : getFeatures, env: opts.env });
@@ -19266,13 +19428,13 @@ async function renderTopHelp(opts) {
19266
19428
  if (visible.length > 0) {
19267
19429
  const byResource = /* @__PURE__ */ new Map();
19268
19430
  for (const g of visible) {
19269
- const actions31 = byResource.get(g.resource) ?? [];
19270
- actions31.push(`${g.action}${g.beta ? " (beta)" : ""}`);
19271
- byResource.set(g.resource, actions31);
19431
+ const actions32 = byResource.get(g.resource) ?? [];
19432
+ actions32.push(`${g.action}${g.beta ? " (beta)" : ""}`);
19433
+ byResource.set(g.resource, actions32);
19272
19434
  }
19273
19435
  const sorted2 = [...byResource.entries()].sort(([a], [b]) => a.localeCompare(b));
19274
19436
  if (opts.allCommands) {
19275
- const generatedRows = sorted2.map(([resource, actions31]) => [resource, actions31.sort().join(", ")]);
19437
+ const generatedRows = sorted2.map(([resource, actions32]) => [resource, actions32.sort().join(", ")]);
19276
19438
  lines.push("", "API resources (kenso <resource> <action>):", columns(generatedRows));
19277
19439
  } else {
19278
19440
  const names = new Set(sorted2.map(([resource]) => resource));
@@ -19631,7 +19793,7 @@ function resources() {
19631
19793
  const names = Object.entries(handWritten).filter(([, area]) => Object.keys(area).length > 0).map(([resource]) => resource);
19632
19794
  return sorted([...names, ...Object.keys(resourceAliases), ...loadManifest().operations.map((op) => op.resource)]);
19633
19795
  }
19634
- function actions30(resource) {
19796
+ function actions31(resource) {
19635
19797
  const own = Object.keys(handWritten[resource] ?? {}).filter((action) => action !== "");
19636
19798
  return sorted([...own, ...loadManifest().operations.filter((op) => op.resource === resource).map((op) => op.action)]);
19637
19799
  }
@@ -19696,7 +19858,7 @@ async function completions(words, globals) {
19696
19858
  return flagsOf2(spec, globals, positionals.length === 0);
19697
19859
  }
19698
19860
  if (positionals.length === 0) return resources();
19699
- if (!spec) return positionals.length === 1 ? actions30(resourceAliases[positionals[0]] ?? positionals[0]) : [];
19861
+ if (!spec) return positionals.length === 1 ? actions31(resourceAliases[positionals[0]] ?? positionals[0]) : [];
19700
19862
  const given = positionals.length - commandWords;
19701
19863
  const declared = spec.positionals ?? [];
19702
19864
  if (given < declared.length || declared.at(-1)?.variadic === true) {
@@ -19790,9 +19952,9 @@ function normalizeBooleans(argv, names, strict) {
19790
19952
  async function knownCommands() {
19791
19953
  const commands = /* @__PURE__ */ new Set();
19792
19954
  for (const [resource, area] of Object.entries(handWritten)) {
19793
- const actions31 = Object.keys(area);
19794
- if (actions31.length > 0) commands.add(resource);
19795
- for (const action of actions31) commands.add(action ? `${resource} ${action}` : resource);
19955
+ const actions32 = Object.keys(area);
19956
+ if (actions32.length > 0) commands.add(resource);
19957
+ for (const action of actions32) commands.add(action ? `${resource} ${action}` : resource);
19796
19958
  }
19797
19959
  for (const g of await listGenerated({ features: [] })) {
19798
19960
  commands.add(g.resource);