kenso 0.1.80 → 0.1.82

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.80" : "0.0.0-dev";
2480
+ VERSION = true ? "0.1.82" : "0.0.0-dev";
2481
2481
  }
2482
2482
  });
2483
2483
 
@@ -4174,9 +4174,9 @@ async function readRunDir(dir) {
4174
4174
  return null;
4175
4175
  }
4176
4176
  if (!raw) return null;
4177
- const { runId, command: command51, createdAt, status } = raw;
4177
+ const { runId, command: command53, createdAt, status } = raw;
4178
4178
  if (typeof runId !== "string" || !RUN_ID_PATTERN.test(runId)) return null;
4179
- if (typeof command51 !== "string" || typeof createdAt !== "string") return null;
4179
+ if (typeof command53 !== "string" || typeof createdAt !== "string") return null;
4180
4180
  if (typeof status !== "string" || !STATUSES.includes(status)) return null;
4181
4181
  let chunksDone = chunkList(raw.chunksDone) ?? [];
4182
4182
  try {
@@ -4187,7 +4187,7 @@ async function readRunDir(dir) {
4187
4187
  const record = {
4188
4188
  ...raw,
4189
4189
  runId,
4190
- command: command51,
4190
+ command: command53,
4191
4191
  args: asRecord3(raw.args) ?? {},
4192
4192
  createdAt,
4193
4193
  status,
@@ -4242,11 +4242,11 @@ async function loadRun(runId, env = process.env) {
4242
4242
  }
4243
4243
  return run;
4244
4244
  }
4245
- async function findIdentical(command51, args, inputSha256, env, workspaceId, anyWorkspace = false) {
4245
+ async function findIdentical(command53, args, inputSha256, env, workspaceId, anyWorkspace = false) {
4246
4246
  const identity = argsIdentity(args);
4247
4247
  const runs = await listRuns(env);
4248
4248
  return runs.filter(
4249
- (run) => run.command === command51 && (run.inputSha256 || void 0) === (inputSha256 || void 0) && (anyWorkspace || (run.workspaceId || void 0) === (workspaceId || void 0)) && argsIdentity(run.args) === identity
4249
+ (run) => run.command === command53 && (run.inputSha256 || void 0) === (inputSha256 || void 0) && (anyWorkspace || (run.workspaceId || void 0) === (workspaceId || void 0)) && argsIdentity(run.args) === identity
4250
4250
  );
4251
4251
  }
4252
4252
  function isOtherLiveProcess(pid) {
@@ -7451,8 +7451,8 @@ function idValue(value, field) {
7451
7451
  function shellQuote3(arg) {
7452
7452
  return /^[A-Za-z0-9_./:=@%+,-]+$/.test(arg) ? arg : `'${arg.replace(/'/g, `'\\''`)}'`;
7453
7453
  }
7454
- function commandLine2(ctx, command51, args, extra = []) {
7455
- const parts2 = ["kenso", ...command51.split(" "), ...(args.positionals ?? []).map(shellQuote3)];
7454
+ function commandLine2(ctx, command53, args, extra = []) {
7455
+ const parts2 = ["kenso", ...command53.split(" "), ...(args.positionals ?? []).map(shellQuote3)];
7456
7456
  for (const [name, value] of Object.entries(args.flags)) {
7457
7457
  if (value === void 0 || value === false) continue;
7458
7458
  if (value === true) parts2.push(`--${name}`);
@@ -7784,7 +7784,7 @@ var init_connect = __esm({
7784
7784
  var crm_default;
7785
7785
  var init_crm = __esm({
7786
7786
  "docs/crm.md"() {
7787
- 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 write-research`, `people write-research` | Store research you gathered as a record\'s latest research, free. `--each` writes many |\n| `opportunities stage-history <id>` | A deal\'s stage history: each stage, when, who moved it and how long it sat there |\n| `deleted-accounts list`, `accounts restore <id>` | The accounts deleted in the last 30 days, and bringing one back |\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 |\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| `crm-connections`, `crm-imports`, `crm-sync-issues` | Read and run CRM sync. Connecting a CRM stays in the app |\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\nApart from `accounts bulk-update`, which sets one `accountType` on up to 500 accounts, there is no bulk edit route, so 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## 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## 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## 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';
7787
+ 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 write-research`, `people write-research` | Store research you gathered as a record\'s latest research, free. `--each` writes many |\n| `opportunities stage-history <id>` | A deal\'s stage history: each stage, when, who moved it and how long it sat there |\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 |\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| `crm-connections`, `crm-imports`, `crm-sync-issues` | Read and run CRM sync. Connecting a CRM stays in the app |\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\nApart from `accounts bulk-update`, which sets one `accountType` on up to 500 accounts, there is no bulk edit route, so 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## 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## 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## 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';
7788
7788
  }
7789
7789
  });
7790
7790
 
@@ -8976,8 +8976,8 @@ var init_browser_login = __esm({
8976
8976
  defaultDeps = {
8977
8977
  sleep: (ms, signal) => delay2(ms, void 0, signal ? { signal } : void 0),
8978
8978
  now: () => Date.now(),
8979
- spawn: (command51, args) => {
8980
- const child = nodeSpawn(command51, args, { detached: true, stdio: "ignore" });
8979
+ spawn: (command53, args) => {
8980
+ const child = nodeSpawn(command53, args, { detached: true, stdio: "ignore" });
8981
8981
  child.on("error", () => {
8982
8982
  });
8983
8983
  child.unref();
@@ -10166,8 +10166,8 @@ var init_run = __esm({
10166
10166
  defaultDeps2 = {
10167
10167
  sleep: (ms, signal) => delay3(ms, void 0, signal ? { signal } : void 0),
10168
10168
  now: () => Date.now(),
10169
- spawn: (command51, args) => {
10170
- const child = nodeSpawn2(command51, args, { detached: true, stdio: "ignore" });
10169
+ spawn: (command53, args) => {
10170
+ const child = nodeSpawn2(command53, args, { detached: true, stdio: "ignore" });
10171
10171
  child.on("error", () => {
10172
10172
  });
10173
10173
  child.unref();
@@ -10208,9 +10208,9 @@ function stringFlag2(flags, name) {
10208
10208
  const text4 = value.trim();
10209
10209
  return text4 === "" ? void 0 : text4;
10210
10210
  }
10211
- function requireFlag(flags, name, command51, hint) {
10211
+ function requireFlag(flags, name, command53, hint) {
10212
10212
  const value = stringFlag2(flags, name);
10213
- if (value === void 0) throw usageError(`--${name} is required for ${command51}.`, { field: name, next: `${command51} --help`, ...hint ? { hint } : {} });
10213
+ if (value === void 0) throw usageError(`--${name} is required for ${command53}.`, { field: name, next: `${command53} --help`, ...hint ? { hint } : {} });
10214
10214
  return value;
10215
10215
  }
10216
10216
  function positiveId(value) {
@@ -10219,8 +10219,8 @@ function positiveId(value) {
10219
10219
  const id = Number(text4);
10220
10220
  return Number.isSafeInteger(id) && id > 0 ? id : void 0;
10221
10221
  }
10222
- function idFlag(flags, name, command51) {
10223
- const raw = requireFlag(flags, name, command51);
10222
+ function idFlag(flags, name, command53) {
10223
+ const raw = requireFlag(flags, name, command53);
10224
10224
  const id = positiveId(raw);
10225
10225
  if (id === void 0) throw usageError(`--${name} must be a positive whole number (got "${raw}").`, { field: name });
10226
10226
  return id;
@@ -10240,8 +10240,8 @@ function isDryRun(ctx) {
10240
10240
  function shellQuote4(value) {
10241
10241
  return /^[A-Za-z0-9_\-.,:/@=+%]+$/.test(value) ? value : `'${value.replace(/'/g, `'\\''`)}'`;
10242
10242
  }
10243
- function sameCommand2(command51, flags, ctx, extra = []) {
10244
- const parts2 = [command51];
10243
+ function sameCommand2(command53, flags, ctx, extra = []) {
10244
+ const parts2 = [command53];
10245
10245
  for (const [name, value] of Object.entries(flags)) {
10246
10246
  if (value === void 0 || value === false) continue;
10247
10247
  if (value === true) parts2.push(`--${name}`);
@@ -11378,12 +11378,12 @@ import { join as join11 } from "node:path";
11378
11378
  function whereDir(env) {
11379
11379
  return join11(runsRoot(env), WHERE_DIR);
11380
11380
  }
11381
- async function unfinishedWhereIds(ctx, command51, args) {
11381
+ async function unfinishedWhereIds(ctx, command53, args) {
11382
11382
  const dir = whereDir(ctx.env);
11383
11383
  const identity = argsIdentity(args);
11384
11384
  const workspaceId = ctx.client.workspaceId ?? ctx.auth.workspaceId;
11385
11385
  for (const run of await listRuns(ctx.env)) {
11386
- if (run.command !== command51 || run.status === "done" || run.status === "planned") continue;
11386
+ if (run.command !== command53 || run.status === "done" || run.status === "planned") continue;
11387
11387
  if ((run.workspaceId || void 0) !== (workspaceId || void 0) || argsIdentity(run.args) !== identity) continue;
11388
11388
  if (run.inputPath?.startsWith(`${dir}/`) && existsSync6(run.inputPath)) return run.inputPath;
11389
11389
  }
@@ -11529,14 +11529,14 @@ async function idsFromRun(ctx, runId) {
11529
11529
  return { ...idItems(ids2), source: "run" };
11530
11530
  }
11531
11531
  async function collectIds(ctx, flags, kind, dryRun2) {
11532
- const command51 = `kenso contacts ${kind}`;
11532
+ const command53 = `kenso contacts ${kind}`;
11533
11533
  const ids2 = stringFlag2(flags, "ids");
11534
11534
  const where = kind === "restore" ? void 0 : stringFlag2(flags, "where");
11535
11535
  const run = kind === "restore" ? stringFlag2(flags, "run") : void 0;
11536
11536
  const given = [ids2, where, run].filter((v) => v !== void 0).length;
11537
11537
  if (given !== 1) {
11538
11538
  const choices = kind === "restore" ? "--ids <file|-> or --run <runId>" : "--ids <file|-> or --where '<json>'";
11539
- throw usageError(`${command51} needs exactly one of ${choices}.`, { field: "ids", next: `${command51} --help` });
11539
+ throw usageError(`${command53} needs exactly one of ${choices}.`, { field: "ids", next: `${command53} --help` });
11540
11540
  }
11541
11541
  if (ids2 !== void 0) return idsFromFile(ctx, ids2);
11542
11542
  if (where !== void 0) return idsFromWhere(ctx, kind, flags, where, dryRun2);
@@ -12359,12 +12359,159 @@ var init_doctor = __esm({
12359
12359
  }
12360
12360
  });
12361
12361
 
12362
- // src/commands/jobs/index.ts
12362
+ // src/commands/export/export.ts
12363
+ var export_exports2 = {};
12364
+ __export(export_exports2, {
12365
+ default: () => export_default2,
12366
+ recordCount: () => recordCount
12367
+ });
12368
+ function jsonFlag(flags, name, shape) {
12369
+ const text4 = stringFlag(flags[name]);
12370
+ if (text4 === void 0) return void 0;
12371
+ let value;
12372
+ try {
12373
+ value = JSON.parse(text4);
12374
+ } catch {
12375
+ throw usageError(`--${name} must be JSON (got "${text4}").`, { field: name });
12376
+ }
12377
+ const ok = shape === "array" ? Array.isArray(value) : typeof value === "object" && value !== null && !Array.isArray(value);
12378
+ if (!ok) throw usageError(`--${name} must be a JSON ${shape}.`, { field: name });
12379
+ return value;
12380
+ }
12381
+ function recordCount(csv) {
12382
+ let records = 0;
12383
+ let quoted = false;
12384
+ let hasText = false;
12385
+ for (const ch of csv) {
12386
+ if (ch === '"') quoted = !quoted;
12387
+ if (ch === "\n" && !quoted) {
12388
+ if (hasText) records++;
12389
+ hasText = false;
12390
+ } else if (ch !== "\r") {
12391
+ hasText = true;
12392
+ }
12393
+ }
12394
+ return hasText ? records + 1 : records;
12395
+ }
12396
+ var OBJECTS, command22, export_default2;
12397
+ var init_export2 = __esm({
12398
+ "src/commands/export/export.ts"() {
12399
+ "use strict";
12400
+ init_errors();
12401
+ init_exit_codes();
12402
+ init_http();
12403
+ init_transfer();
12404
+ init_columns();
12405
+ OBJECTS = {
12406
+ accounts: { resource: "accounts", noun: "accounts" },
12407
+ people: { resource: "people", noun: "people" },
12408
+ deals: { resource: "opportunities", noun: "deals" },
12409
+ opportunities: { resource: "opportunities", noun: "deals" }
12410
+ };
12411
+ command22 = {
12412
+ resource: "export",
12413
+ action: "",
12414
+ summary: "Export accounts, people or deals as CSV: everything, a saved view, or what the filters match",
12415
+ brief: "<accounts|people|deals> [--view <id>] [--out <file>]",
12416
+ description: "Writes the CSV that POST /v1/accounts/export, /v1/people/export or /v1/opportunities/export returns, to stdout or to --out. With no filter it exports every record; more than 50,000 rows is refused (narrow the filters). --view exports a saved Accounts view: its filters, as GET /v1/account-views lists them. --filters, --where (accounts), --q and --sort are the search operation's own fields, and add to the view's when both are given (a --filters list replaces the view's). The accounts and deals files start with id and import back as they are. Each export writes an audit-log entry. Needs the export permission.",
12417
+ flags: {
12418
+ view: { type: "string", description: "A saved Accounts view's id: export what that view lists" },
12419
+ filters: { type: "string", description: `Filter conditions as JSON, e.g. '[{"field":"stage","operator":"is","values":["engaged"]}]'` },
12420
+ where: { type: "string", description: "Accounts only: a condition group as JSON, as accounts search takes it" },
12421
+ q: { type: "string", description: "Text to match, as the list's search box does" },
12422
+ sort: { type: "string", description: "The search operation's sort, e.g. name or -createdAt" },
12423
+ out: { type: "string", short: "o", description: "Write the CSV to this file instead of stdout" }
12424
+ },
12425
+ positionals: [{ name: "object", required: true, description: "accounts, people or deals" }],
12426
+ examples: [
12427
+ "kenso export accounts --out accounts.csv",
12428
+ "kenso export accounts --view 12 --out tier-1.csv",
12429
+ `kenso export deals --filters '[{"field":"stageCategory","operator":"is","values":["open"]}]' > open-deals.csv`
12430
+ ],
12431
+ beta: { featureGates: { all: ["accounts"] } },
12432
+ operationIds: ["accounts.export", "people.export", "opportunities.export", "account-views.list"],
12433
+ async run(ctx, { flags, positionals }) {
12434
+ const typed = (positionals[0] ?? "").trim().toLowerCase();
12435
+ const object = OBJECTS[typed];
12436
+ if (!object) {
12437
+ throw usageError(`Export takes accounts, people or deals (got "${typed}").`, { field: "object", next: "kenso export accounts" });
12438
+ }
12439
+ const body2 = {};
12440
+ const view = stringFlag(flags.view);
12441
+ if (view !== void 0) {
12442
+ if (object.resource !== "accounts") {
12443
+ throw usageError("--view exports a saved Accounts view. For people and deals, pass the view's --filters and --sort.", { field: "view" });
12444
+ }
12445
+ const id = /^\d+$/.test(view.trim()) ? Number(view.trim()) : Number.NaN;
12446
+ if (!Number.isSafeInteger(id) || id < 1) throw usageError(`--view must be a view id (got "${view}").`, { field: "view" });
12447
+ const listed = await ctx.client.request({ method: "GET", path: "/v1/account-views", signal: ctx.signal });
12448
+ const views = unwrap(listed.body);
12449
+ const found = (views ?? []).find((v) => v.id === id);
12450
+ if (!found) {
12451
+ throw usageError(`No saved Accounts view has id ${id}.`, { field: "view", hint: "List yours with kenso account-views list." });
12452
+ }
12453
+ if (found.filters && found.filters.length > 0) body2.filters = found.filters;
12454
+ }
12455
+ const filters = jsonFlag(flags, "filters", "array");
12456
+ if (filters !== void 0) body2.filters = filters;
12457
+ const where = jsonFlag(flags, "where", "object");
12458
+ if (where !== void 0) {
12459
+ if (object.resource !== "accounts") throw usageError("--where is an accounts filter.", { field: "where" });
12460
+ body2.where = where;
12461
+ }
12462
+ const q = stringFlag(flags.q);
12463
+ if (q !== void 0) body2.q = q;
12464
+ const sort = stringFlag(flags.sort);
12465
+ if (sort !== void 0) body2.sort = sort;
12466
+ let res;
12467
+ try {
12468
+ res = await ctx.client.request({ method: "POST", path: `/v1/${object.resource}/export`, body: body2, signal: ctx.signal });
12469
+ } catch (err) {
12470
+ if (err instanceof KensoError && err.httpStatus === 404 && object.resource !== "people") {
12471
+ throw new KensoError({
12472
+ code: err.code,
12473
+ message: `Exporting ${object.noun} is not on for this workspace yet.`,
12474
+ exitCode: err.exitCode,
12475
+ httpStatus: 404,
12476
+ hint: "It is behind the crm_import_export feature flag.",
12477
+ requestId: err.requestId
12478
+ });
12479
+ }
12480
+ throw err;
12481
+ }
12482
+ const bytes = responseBytes(res);
12483
+ const csv = bytes.toString("utf8");
12484
+ const out = stringFlag(flags.out);
12485
+ if (out === void 0) {
12486
+ ctx.output.writeRaw(csv);
12487
+ return ExitCode.Ok;
12488
+ }
12489
+ const file = await saveFile(out, bytes);
12490
+ ctx.output.object({ object: typed === "opportunities" ? "deals" : typed, file, rows: Math.max(recordCount(csv) - 1, 0) });
12491
+ return ExitCode.Ok;
12492
+ }
12493
+ };
12494
+ export_default2 = command22;
12495
+ }
12496
+ });
12497
+
12498
+ // src/commands/export/index.ts
12363
12499
  var actions13;
12500
+ var init_export3 = __esm({
12501
+ "src/commands/export/index.ts"() {
12502
+ "use strict";
12503
+ actions13 = {
12504
+ "": async () => (await Promise.resolve().then(() => (init_export2(), export_exports2))).default
12505
+ };
12506
+ }
12507
+ });
12508
+
12509
+ // src/commands/jobs/index.ts
12510
+ var actions14;
12364
12511
  var init_jobs2 = __esm({
12365
12512
  "src/commands/jobs/index.ts"() {
12366
12513
  "use strict";
12367
- actions13 = {
12514
+ actions14 = {
12368
12515
  wait: () => Promise.resolve().then(() => (init_wait(), wait_exports)).then((m) => m.default)
12369
12516
  };
12370
12517
  }
@@ -12397,7 +12544,7 @@ function readable(row) {
12397
12544
  const parts2 = [time, `[${row.status}]`, row.method, row.pathTemplate, row.errorCode, `${row.durationMs}ms`, row.apiKeyId, row.requestId];
12398
12545
  return parts2.filter((p) => p !== void 0 && p !== "").join(" ");
12399
12546
  }
12400
- var MIN_INTERVAL_MS, MAX_INTERVAL_MS, MAX_SINCE_MS, OVERLAP_MS, MAX_PAGES, RATE_LIMITED_WAIT_MS, isOwnPoll, pad, command22, tail_default;
12547
+ var MIN_INTERVAL_MS, MAX_INTERVAL_MS, MAX_SINCE_MS, OVERLAP_MS, MAX_PAGES, RATE_LIMITED_WAIT_MS, isOwnPoll, pad, command23, tail_default;
12401
12548
  var init_tail = __esm({
12402
12549
  "src/commands/logs/tail.ts"() {
12403
12550
  "use strict";
@@ -12413,7 +12560,7 @@ var init_tail = __esm({
12413
12560
  RATE_LIMITED_WAIT_MS = 3e4;
12414
12561
  isOwnPoll = (row) => row.method === "GET" && row.pathTemplate === "/v1/api-requests" && row.userAgent?.startsWith("kenso-cli/") === true;
12415
12562
  pad = (n) => String(n).padStart(2, "0");
12416
- command22 = {
12563
+ command23 = {
12417
12564
  resource: "logs",
12418
12565
  action: "tail",
12419
12566
  summary: "Stream your workspace's new API request log rows",
@@ -12519,16 +12666,16 @@ var init_tail = __esm({
12519
12666
  return ExitCode.Ok;
12520
12667
  }
12521
12668
  };
12522
- tail_default = command22;
12669
+ tail_default = command23;
12523
12670
  }
12524
12671
  });
12525
12672
 
12526
12673
  // src/commands/logs/index.ts
12527
- var actions14;
12674
+ var actions15;
12528
12675
  var init_logs = __esm({
12529
12676
  "src/commands/logs/index.ts"() {
12530
12677
  "use strict";
12531
- actions14 = {
12678
+ actions15 = {
12532
12679
  tail: () => Promise.resolve().then(() => (init_tail(), tail_exports)).then((m) => m.default)
12533
12680
  };
12534
12681
  }
@@ -12584,7 +12731,7 @@ function isRecord7(value) {
12584
12731
  function textOf(result) {
12585
12732
  return (result.content ?? []).filter((part) => part.type === "text" && typeof part.text === "string").map((part) => part.text).join("\n");
12586
12733
  }
12587
- var command23, call_default;
12734
+ var command24, call_default;
12588
12735
  var init_call = __esm({
12589
12736
  "src/commands/mcp/call.ts"() {
12590
12737
  "use strict";
@@ -12592,7 +12739,7 @@ var init_call = __esm({
12592
12739
  init_exit_codes();
12593
12740
  init_input();
12594
12741
  init_connect4();
12595
- command23 = {
12742
+ command24 = {
12596
12743
  resource: "mcp",
12597
12744
  action: "call",
12598
12745
  summary: "Call a hosted Kenso MCP tool, such as list_skills",
@@ -12645,7 +12792,7 @@ var init_call = __esm({
12645
12792
  return ExitCode.Ok;
12646
12793
  }
12647
12794
  };
12648
- call_default = command23;
12795
+ call_default = command24;
12649
12796
  }
12650
12797
  });
12651
12798
 
@@ -12654,13 +12801,13 @@ var tools_exports = {};
12654
12801
  __export(tools_exports, {
12655
12802
  default: () => tools_default
12656
12803
  });
12657
- var command24, tools_default;
12804
+ var command25, tools_default;
12658
12805
  var init_tools = __esm({
12659
12806
  "src/commands/mcp/tools.ts"() {
12660
12807
  "use strict";
12661
12808
  init_exit_codes();
12662
12809
  init_connect4();
12663
- command24 = {
12810
+ command25 = {
12664
12811
  resource: "mcp",
12665
12812
  action: "tools",
12666
12813
  summary: "List the hosted Kenso MCP's tools",
@@ -12675,16 +12822,16 @@ var init_tools = __esm({
12675
12822
  return ExitCode.Ok;
12676
12823
  }
12677
12824
  };
12678
- tools_default = command24;
12825
+ tools_default = command25;
12679
12826
  }
12680
12827
  });
12681
12828
 
12682
12829
  // src/commands/mcp/index.ts
12683
- var actions15;
12830
+ var actions16;
12684
12831
  var init_mcp = __esm({
12685
12832
  "src/commands/mcp/index.ts"() {
12686
12833
  "use strict";
12687
- actions15 = {
12834
+ actions16 = {
12688
12835
  call: () => Promise.resolve().then(() => (init_call(), call_exports)).then((m) => m.default),
12689
12836
  tools: () => Promise.resolve().then(() => (init_tools(), tools_exports)).then((m) => m.default)
12690
12837
  };
@@ -12696,14 +12843,14 @@ var stage_history_exports = {};
12696
12843
  __export(stage_history_exports, {
12697
12844
  default: () => stage_history_default
12698
12845
  });
12699
- var command25, stage_history_default;
12846
+ var command26, stage_history_default;
12700
12847
  var init_stage_history = __esm({
12701
12848
  "src/commands/opportunities/stage-history.ts"() {
12702
12849
  "use strict";
12703
12850
  init_errors();
12704
12851
  init_exit_codes();
12705
12852
  init_http();
12706
- command25 = {
12853
+ command26 = {
12707
12854
  resource: "opportunities",
12708
12855
  action: "stage-history",
12709
12856
  summary: "Show a deal's stage history: each stage, when, who moved it and how long it sat there",
@@ -12727,16 +12874,16 @@ var init_stage_history = __esm({
12727
12874
  return ExitCode.Ok;
12728
12875
  }
12729
12876
  };
12730
- stage_history_default = command25;
12877
+ stage_history_default = command26;
12731
12878
  }
12732
12879
  });
12733
12880
 
12734
12881
  // src/commands/opportunities/index.ts
12735
- var actions16;
12882
+ var actions17;
12736
12883
  var init_opportunities = __esm({
12737
12884
  "src/commands/opportunities/index.ts"() {
12738
12885
  "use strict";
12739
- actions16 = {
12886
+ actions17 = {
12740
12887
  "stage-history": () => Promise.resolve().then(() => (init_stage_history(), stage_history_exports)).then((m) => m.default)
12741
12888
  };
12742
12889
  }
@@ -12813,7 +12960,7 @@ function summarize3(results) {
12813
12960
  }
12814
12961
  return { matched, addedToAccounts, emailFindsQueued };
12815
12962
  }
12816
- var COMMAND5, CHUNK_SIZE6, ALIASES3, PERSON_FIELDS, ACCOUNT_NOT_FOUND, command26, import_default3;
12963
+ var COMMAND5, CHUNK_SIZE6, ALIASES3, PERSON_FIELDS, ACCOUNT_NOT_FOUND, command27, import_default3;
12817
12964
  var init_import3 = __esm({
12818
12965
  "src/commands/people/import.ts"() {
12819
12966
  "use strict";
@@ -12845,7 +12992,7 @@ var init_import3 = __esm({
12845
12992
  };
12846
12993
  PERSON_FIELDS = ["email", "fullName", "firstName", "lastName", "linkedinUrl", "title"];
12847
12994
  ACCOUNT_NOT_FOUND = "No account in this workspace has that domain. The person was saved without an account: add the account (kenso accounts import) and run the same command again.";
12848
- command26 = {
12995
+ command27 = {
12849
12996
  resource: "people",
12850
12997
  action: "import",
12851
12998
  summary: "Create or match people from a CSV or JSONL file, optionally onto accounts",
@@ -12910,27 +13057,117 @@ var init_import3 = __esm({
12910
13057
  return outcome.exitCode;
12911
13058
  }
12912
13059
  };
12913
- import_default3 = command26;
13060
+ import_default3 = command27;
12914
13061
  }
12915
13062
  });
12916
13063
 
12917
13064
  // src/commands/people/index.ts
12918
- var actions17;
13065
+ var actions18;
12919
13066
  var init_people = __esm({
12920
13067
  "src/commands/people/index.ts"() {
12921
13068
  "use strict";
12922
- actions17 = {
13069
+ actions18 = {
12923
13070
  import: () => Promise.resolve().then(() => (init_import3(), import_exports3)).then((m) => m.default)
12924
13071
  };
12925
13072
  }
12926
13073
  });
12927
13074
 
13075
+ // src/commands/pipelines/stage-rules.ts
13076
+ var stage_rules_exports = {};
13077
+ __export(stage_rules_exports, {
13078
+ default: () => stage_rules_default
13079
+ });
13080
+ function rule(stage) {
13081
+ return {
13082
+ key: stage.key,
13083
+ label: stage.label,
13084
+ category: stage.category,
13085
+ isArchived: stage.isArchived,
13086
+ requiredFields: stage.requiredFields,
13087
+ isDefault: stage.isDefaultRequiredFields
13088
+ };
13089
+ }
13090
+ var command28, stage_rules_default;
13091
+ var init_stage_rules = __esm({
13092
+ "src/commands/pipelines/stage-rules.ts"() {
13093
+ "use strict";
13094
+ init_errors();
13095
+ init_exit_codes();
13096
+ init_http();
13097
+ command28 = {
13098
+ resource: "pipelines",
13099
+ action: "stage-rules",
13100
+ summary: "List or set the fields a deal should have in each stage",
13101
+ description: "Without a stage, reads GET /v1/opportunity-stages and prints each stage's key, label, category, isArchived, requiredFields and isDefault, plus requirableFields: every field a stage can require (amount, closeDate, ownerMemberId, primaryPersonId, nextStep, lostReasonKey, wonReasonKey, and custom.<key> for each custom deal field). With a stage and --require, --default or --none, sends PUT /v1/opportunity-stages/{stageKey}/required-fields and prints that stage's rule. --require is the stage's whole list, in order, at most 10. --default puts it back on the default: a lost stage asks for lostReasonKey, any other stage nothing. A missing field never stops a move: the deal moves, the move prints a warning, and the deal is flagged Missing until the field is filled. Setting a rule needs the workspace_settings permission.",
13102
+ flags: {
13103
+ require: { type: "string", description: "Comma-separated field ids the stage requires, in order (amount,closeDate,custom.tier)" },
13104
+ default: { type: "boolean", description: "Put the stage back on the default rule" },
13105
+ none: { type: "boolean", description: "Require nothing in the stage" }
13106
+ },
13107
+ positionals: [{ name: "stage", description: "The stage key to set (kenso pipelines stage-rules lists them)" }],
13108
+ examples: [
13109
+ "kenso pipelines stage-rules",
13110
+ "kenso pipelines stage-rules proposal --require amount,closeDate",
13111
+ "kenso pipelines stage-rules lost --default"
13112
+ ],
13113
+ beta: { featureGates: { all: ["opportunities", "deal_stage_rules"] } },
13114
+ operationIds: ["opportunity-stages.list", "opportunity-stages.set-required-fields"],
13115
+ async run(ctx, { flags, positionals }) {
13116
+ const stage = (positionals[0] ?? "").trim();
13117
+ const require2 = typeof flags.require === "string" ? flags.require : void 0;
13118
+ const chosen = [require2 !== void 0, flags.default === true, flags.none === true].filter(Boolean).length;
13119
+ const next = "kenso pipelines stage-rules <stage> --require amount,closeDate";
13120
+ if (!stage) {
13121
+ if (chosen > 0) throw usageError("Name the stage to set: kenso pipelines stage-rules <stage> ...", { field: "stage", next });
13122
+ const res2 = await ctx.client.request({ method: "GET", path: "/v1/opportunity-stages", signal: ctx.signal });
13123
+ const data = unwrap(res2.body);
13124
+ if (!data.requirableFields) {
13125
+ throw usageError("Stage rules are off in this workspace (the deal_stage_rules flag).", { hint: "Ask Kenso support to turn them on." });
13126
+ }
13127
+ ctx.output.object({ requirableFields: data.requirableFields, stages: (data.items ?? []).map(rule) });
13128
+ return ExitCode.Ok;
13129
+ }
13130
+ if (!/^[a-z][a-z0-9_]{0,62}$/.test(stage)) {
13131
+ throw usageError(`"${stage}" is not a stage key. Read the keys with kenso pipelines stage-rules.`, { field: "stage", next });
13132
+ }
13133
+ if (chosen !== 1) {
13134
+ throw usageError("Pass exactly one of --require <fields>, --default or --none.", { field: "require", next });
13135
+ }
13136
+ const fields = require2 === void 0 ? flags.none === true ? [] : null : require2.split(",").map((f) => f.trim()).filter(Boolean);
13137
+ if (fields?.length === 0 && require2 !== void 0) {
13138
+ throw usageError("--require names no field. Pass the field ids, --none to require nothing, or --default.", { field: "require", next });
13139
+ }
13140
+ const res = await ctx.client.request({
13141
+ method: "PUT",
13142
+ path: `/v1/opportunity-stages/${stage}/required-fields`,
13143
+ body: { fields },
13144
+ signal: ctx.signal
13145
+ });
13146
+ ctx.output.object(rule(unwrap(res.body)));
13147
+ return ExitCode.Ok;
13148
+ }
13149
+ };
13150
+ stage_rules_default = command28;
13151
+ }
13152
+ });
13153
+
13154
+ // src/commands/pipelines/index.ts
13155
+ var actions19;
13156
+ var init_pipelines = __esm({
13157
+ "src/commands/pipelines/index.ts"() {
13158
+ "use strict";
13159
+ actions19 = {
13160
+ "stage-rules": () => Promise.resolve().then(() => (init_stage_rules(), stage_rules_exports)).then((m) => m.default)
13161
+ };
13162
+ }
13163
+ });
13164
+
12928
13165
  // src/commands/reports/run.ts
12929
13166
  var run_exports2 = {};
12930
13167
  __export(run_exports2, {
12931
13168
  default: () => run_default
12932
13169
  });
12933
- var REPORTS, command27, run_default;
13170
+ var REPORTS, command29, run_default;
12934
13171
  var init_run2 = __esm({
12935
13172
  "src/commands/reports/run.ts"() {
12936
13173
  "use strict";
@@ -12938,7 +13175,7 @@ var init_run2 = __esm({
12938
13175
  init_exit_codes();
12939
13176
  init_http();
12940
13177
  REPORTS = ["pipeline_by_stage", "won_by_month", "stage_conversion", "time_in_stage", "won_by_source_campaign", "activity_by_member"];
12941
- command27 = {
13178
+ command29 = {
12942
13179
  resource: "reports",
12943
13180
  action: "run",
12944
13181
  summary: "Run a stock pipeline report and print its table",
@@ -13000,7 +13237,7 @@ var init_run2 = __esm({
13000
13237
  return ExitCode.Ok;
13001
13238
  }
13002
13239
  };
13003
- run_default = command27;
13240
+ run_default = command29;
13004
13241
  }
13005
13242
  });
13006
13243
 
@@ -13009,14 +13246,14 @@ var summary_exports = {};
13009
13246
  __export(summary_exports, {
13010
13247
  default: () => summary_default
13011
13248
  });
13012
- var command28, summary_default;
13249
+ var command30, summary_default;
13013
13250
  var init_summary = __esm({
13014
13251
  "src/commands/reports/summary.ts"() {
13015
13252
  "use strict";
13016
13253
  init_errors();
13017
13254
  init_exit_codes();
13018
13255
  init_http();
13019
- command28 = {
13256
+ command30 = {
13020
13257
  resource: "reports",
13021
13258
  action: "summary",
13022
13259
  summary: "Read where the period stands and what needs you",
@@ -13071,16 +13308,16 @@ var init_summary = __esm({
13071
13308
  return ExitCode.Ok;
13072
13309
  }
13073
13310
  };
13074
- summary_default = command28;
13311
+ summary_default = command30;
13075
13312
  }
13076
13313
  });
13077
13314
 
13078
13315
  // src/commands/reports/index.ts
13079
- var actions18;
13316
+ var actions20;
13080
13317
  var init_reports = __esm({
13081
13318
  "src/commands/reports/index.ts"() {
13082
13319
  "use strict";
13083
- actions18 = {
13320
+ actions20 = {
13084
13321
  run: () => Promise.resolve().then(() => (init_run2(), run_exports2)).then((m) => m.default),
13085
13322
  summary: () => Promise.resolve().then(() => (init_summary(), summary_exports)).then((m) => m.default)
13086
13323
  };
@@ -13092,14 +13329,14 @@ var list_exports = {};
13092
13329
  __export(list_exports, {
13093
13330
  default: () => list_default
13094
13331
  });
13095
- var command29, list_default;
13332
+ var command31, list_default;
13096
13333
  var init_list = __esm({
13097
13334
  "src/commands/runs/list.ts"() {
13098
13335
  "use strict";
13099
13336
  init_runs();
13100
13337
  init_errors();
13101
13338
  init_exit_codes();
13102
- command29 = {
13339
+ command31 = {
13103
13340
  resource: "runs",
13104
13341
  action: "list",
13105
13342
  summary: "List batch runs, newest first (finds an interrupted run)",
@@ -13120,7 +13357,7 @@ var init_list = __esm({
13120
13357
  return ExitCode.Ok;
13121
13358
  }
13122
13359
  };
13123
- list_default = command29;
13360
+ list_default = command31;
13124
13361
  }
13125
13362
  });
13126
13363
 
@@ -13131,7 +13368,7 @@ __export(show_exports2, {
13131
13368
  });
13132
13369
  import { existsSync as existsSync7, readFileSync as readFileSync9 } from "node:fs";
13133
13370
  import { join as join12 } from "node:path";
13134
- var FILES, command30, show_default2;
13371
+ var FILES, command32, show_default2;
13135
13372
  var init_show2 = __esm({
13136
13373
  "src/commands/runs/show.ts"() {
13137
13374
  "use strict";
@@ -13146,7 +13383,7 @@ var init_show2 = __esm({
13146
13383
  ["plan", "plan.json"],
13147
13384
  ["summary", "summary.json"]
13148
13385
  ];
13149
- command30 = {
13386
+ command32 = {
13150
13387
  resource: "runs",
13151
13388
  action: "show",
13152
13389
  summary: "Show one batch run and its files",
@@ -13173,7 +13410,7 @@ var init_show2 = __esm({
13173
13410
  return ExitCode.Ok;
13174
13411
  }
13175
13412
  };
13176
- show_default2 = command30;
13413
+ show_default2 = command32;
13177
13414
  }
13178
13415
  });
13179
13416
 
@@ -13232,14 +13469,14 @@ function resumeArgv(run, globals = {}) {
13232
13469
  async function sha256(path) {
13233
13470
  return createHash5("sha256").update(await readFile9(path)).digest("hex");
13234
13471
  }
13235
- var SKIPPED_KEYS, command31, resume_default;
13472
+ var SKIPPED_KEYS, command33, resume_default;
13236
13473
  var init_resume = __esm({
13237
13474
  "src/commands/runs/resume.ts"() {
13238
13475
  "use strict";
13239
13476
  init_runs();
13240
13477
  init_errors();
13241
13478
  SKIPPED_KEYS = /* @__PURE__ */ new Set(["positionals", "yes", "dryRun", "dry-run", "help", "version"]);
13242
- command31 = {
13479
+ command33 = {
13243
13480
  resource: "runs",
13244
13481
  action: "resume",
13245
13482
  summary: "Continue an interrupted batch run (its command with --yes, no dry run)",
@@ -13294,16 +13531,16 @@ var init_resume = __esm({
13294
13531
  }
13295
13532
  }
13296
13533
  };
13297
- resume_default = command31;
13534
+ resume_default = command33;
13298
13535
  }
13299
13536
  });
13300
13537
 
13301
13538
  // src/commands/runs/index.ts
13302
- var actions19;
13539
+ var actions21;
13303
13540
  var init_runs2 = __esm({
13304
13541
  "src/commands/runs/index.ts"() {
13305
13542
  "use strict";
13306
- actions19 = {
13543
+ actions21 = {
13307
13544
  list: () => Promise.resolve().then(() => (init_list(), list_exports)).then((m) => m.default),
13308
13545
  show: () => Promise.resolve().then(() => (init_show2(), show_exports2)).then((m) => m.default),
13309
13546
  resume: () => Promise.resolve().then(() => (init_resume(), resume_exports)).then((m) => m.default)
@@ -13402,7 +13639,7 @@ var create_exports = {};
13402
13639
  __export(create_exports, {
13403
13640
  default: () => create_default
13404
13641
  });
13405
- var command32, create_default;
13642
+ var command34, create_default;
13406
13643
  var init_create = __esm({
13407
13644
  "src/commands/sandbox/create.ts"() {
13408
13645
  "use strict";
@@ -13410,7 +13647,7 @@ var init_create = __esm({
13410
13647
  init_exit_codes();
13411
13648
  init_http();
13412
13649
  init_shared();
13413
- command32 = {
13650
+ command34 = {
13414
13651
  resource: "sandbox",
13415
13652
  action: "create",
13416
13653
  summary: "Create your developer sandbox and save its test key as the sandbox profile",
@@ -13452,7 +13689,7 @@ var init_create = __esm({
13452
13689
  return ExitCode.Ok;
13453
13690
  }
13454
13691
  };
13455
- create_default = command32;
13692
+ create_default = command34;
13456
13693
  }
13457
13694
  });
13458
13695
 
@@ -13461,7 +13698,7 @@ var delete_exports = {};
13461
13698
  __export(delete_exports, {
13462
13699
  default: () => delete_default
13463
13700
  });
13464
- var command33, delete_default;
13701
+ var command35, delete_default;
13465
13702
  var init_delete = __esm({
13466
13703
  "src/commands/sandbox/delete.ts"() {
13467
13704
  "use strict";
@@ -13469,7 +13706,7 @@ var init_delete = __esm({
13469
13706
  init_confirm();
13470
13707
  init_exit_codes();
13471
13708
  init_shared();
13472
- command33 = {
13709
+ command35 = {
13473
13710
  resource: "sandbox",
13474
13711
  action: "delete",
13475
13712
  summary: "Delete your sandbox and its test keys",
@@ -13496,7 +13733,7 @@ var init_delete = __esm({
13496
13733
  return ExitCode.Ok;
13497
13734
  }
13498
13735
  };
13499
- delete_default = command33;
13736
+ delete_default = command35;
13500
13737
  }
13501
13738
  });
13502
13739
 
@@ -13505,14 +13742,14 @@ var key_exports = {};
13505
13742
  __export(key_exports, {
13506
13743
  default: () => key_default
13507
13744
  });
13508
- var command34, key_default;
13745
+ var command36, key_default;
13509
13746
  var init_key = __esm({
13510
13747
  "src/commands/sandbox/key.ts"() {
13511
13748
  "use strict";
13512
13749
  init_exit_codes();
13513
13750
  init_http();
13514
13751
  init_shared();
13515
- command34 = {
13752
+ command36 = {
13516
13753
  resource: "sandbox",
13517
13754
  action: "key",
13518
13755
  summary: "Create a new test key for your sandbox and save it as the sandbox profile",
@@ -13532,7 +13769,7 @@ var init_key = __esm({
13532
13769
  return ExitCode.Ok;
13533
13770
  }
13534
13771
  };
13535
- key_default = command34;
13772
+ key_default = command36;
13536
13773
  }
13537
13774
  });
13538
13775
 
@@ -13541,13 +13778,13 @@ var list_exports2 = {};
13541
13778
  __export(list_exports2, {
13542
13779
  default: () => list_default2
13543
13780
  });
13544
- var command35, list_default2;
13781
+ var command37, list_default2;
13545
13782
  var init_list2 = __esm({
13546
13783
  "src/commands/sandbox/list.ts"() {
13547
13784
  "use strict";
13548
13785
  init_exit_codes();
13549
13786
  init_shared();
13550
- command35 = {
13787
+ command37 = {
13551
13788
  resource: "sandbox",
13552
13789
  action: "list",
13553
13790
  summary: "List your developer sandbox",
@@ -13563,7 +13800,7 @@ var init_list2 = __esm({
13563
13800
  return ExitCode.Ok;
13564
13801
  }
13565
13802
  };
13566
- list_default2 = command35;
13803
+ list_default2 = command37;
13567
13804
  }
13568
13805
  });
13569
13806
 
@@ -13572,14 +13809,14 @@ var reset_exports = {};
13572
13809
  __export(reset_exports, {
13573
13810
  default: () => reset_default
13574
13811
  });
13575
- var command36, reset_default;
13812
+ var command38, reset_default;
13576
13813
  var init_reset = __esm({
13577
13814
  "src/commands/sandbox/reset.ts"() {
13578
13815
  "use strict";
13579
13816
  init_exit_codes();
13580
13817
  init_http();
13581
13818
  init_shared();
13582
- command36 = {
13819
+ command38 = {
13583
13820
  resource: "sandbox",
13584
13821
  action: "reset",
13585
13822
  summary: "Reset your sandbox to its seed data",
@@ -13597,16 +13834,16 @@ var init_reset = __esm({
13597
13834
  return ExitCode.Ok;
13598
13835
  }
13599
13836
  };
13600
- reset_default = command36;
13837
+ reset_default = command38;
13601
13838
  }
13602
13839
  });
13603
13840
 
13604
13841
  // src/commands/sandbox/index.ts
13605
- var actions20;
13842
+ var actions22;
13606
13843
  var init_sandbox2 = __esm({
13607
13844
  "src/commands/sandbox/index.ts"() {
13608
13845
  "use strict";
13609
- actions20 = {
13846
+ actions22 = {
13610
13847
  create: () => Promise.resolve().then(() => (init_create(), create_exports)).then((m) => m.default),
13611
13848
  delete: () => Promise.resolve().then(() => (init_delete(), delete_exports)).then((m) => m.default),
13612
13849
  key: () => Promise.resolve().then(() => (init_key(), key_exports)).then((m) => m.default),
@@ -13617,11 +13854,11 @@ var init_sandbox2 = __esm({
13617
13854
  });
13618
13855
 
13619
13856
  // src/commands/skill/index.ts
13620
- var actions21;
13857
+ var actions23;
13621
13858
  var init_skill = __esm({
13622
13859
  "src/commands/skill/index.ts"() {
13623
13860
  "use strict";
13624
- actions21 = {
13861
+ actions23 = {
13625
13862
  install: () => Promise.resolve().then(() => (init_install(), install_exports)).then((m) => m.default)
13626
13863
  };
13627
13864
  }
@@ -13857,7 +14094,7 @@ __export(pull_exports, {
13857
14094
  });
13858
14095
  import { mkdir, writeFile as writeFile4 } from "node:fs/promises";
13859
14096
  import { dirname as dirname2, resolve as resolve11 } from "node:path";
13860
- var command37, pull_default;
14097
+ var command39, pull_default;
13861
14098
  var init_pull = __esm({
13862
14099
  "src/commands/studio/pull.ts"() {
13863
14100
  "use strict";
@@ -13867,7 +14104,7 @@ var init_pull = __esm({
13867
14104
  init_common2();
13868
14105
  init_folder();
13869
14106
  init_transfer2();
13870
- command37 = {
14107
+ command39 = {
13871
14108
  resource: "studio",
13872
14109
  action: "pull",
13873
14110
  summary: "Write a template version's files to a folder",
@@ -13914,7 +14151,7 @@ var init_pull = __esm({
13914
14151
  return ExitCode.Ok;
13915
14152
  }
13916
14153
  };
13917
- pull_default = command37;
14154
+ pull_default = command39;
13918
14155
  }
13919
14156
  });
13920
14157
 
@@ -13947,7 +14184,7 @@ var push_exports = {};
13947
14184
  __export(push_exports, {
13948
14185
  default: () => push_default
13949
14186
  });
13950
- var BUILT_BY, DEFAULT_MESSAGE, command38, push_default;
14187
+ var BUILT_BY, DEFAULT_MESSAGE, command40, push_default;
13951
14188
  var init_push = __esm({
13952
14189
  "src/commands/studio/push.ts"() {
13953
14190
  "use strict";
@@ -13959,7 +14196,7 @@ var init_push = __esm({
13959
14196
  init_read();
13960
14197
  BUILT_BY = "customer_agent";
13961
14198
  DEFAULT_MESSAGE = "Pushed with the Kenso CLI";
13962
- command38 = {
14199
+ command40 = {
13963
14200
  resource: "studio",
13964
14201
  action: "push",
13965
14202
  summary: "Save a folder's files to a template's draft and print the validation",
@@ -14051,7 +14288,7 @@ var init_push = __esm({
14051
14288
  );
14052
14289
  }
14053
14290
  };
14054
- push_default = command38;
14291
+ push_default = command40;
14055
14292
  }
14056
14293
  });
14057
14294
 
@@ -14060,7 +14297,7 @@ var validate_exports = {};
14060
14297
  __export(validate_exports, {
14061
14298
  default: () => validate_default
14062
14299
  });
14063
- var command39, validate_default;
14300
+ var command41, validate_default;
14064
14301
  var init_validate = __esm({
14065
14302
  "src/commands/studio/validate.ts"() {
14066
14303
  "use strict";
@@ -14069,7 +14306,7 @@ var init_validate = __esm({
14069
14306
  init_columns();
14070
14307
  init_common2();
14071
14308
  init_read();
14072
- command39 = {
14309
+ command41 = {
14073
14310
  resource: "studio",
14074
14311
  action: "validate",
14075
14312
  summary: "Validate a folder's files against a template without saving them",
@@ -14098,7 +14335,7 @@ var init_validate = __esm({
14098
14335
  throw validationFailed(validation, "The files have validation errors", commandLine2(ctx, "studio validate", args));
14099
14336
  }
14100
14337
  };
14101
- validate_default = command39;
14338
+ validate_default = command41;
14102
14339
  }
14103
14340
  });
14104
14341
 
@@ -14147,7 +14384,7 @@ function accountIds(value) {
14147
14384
  }
14148
14385
  return ids2.map(Number);
14149
14386
  }
14150
- var SHOWN, command40, preview_default;
14387
+ var SHOWN, command42, preview_default;
14151
14388
  var init_preview = __esm({
14152
14389
  "src/commands/studio/preview.ts"() {
14153
14390
  "use strict";
@@ -14159,7 +14396,7 @@ var init_preview = __esm({
14159
14396
  init_common2();
14160
14397
  init_folder();
14161
14398
  SHOWN = 5;
14162
- command40 = {
14399
+ command42 = {
14163
14400
  resource: "studio",
14164
14401
  action: "preview",
14165
14402
  summary: "Render a saved version for up to 3 accounts; for local edits, studio push them to the draft first",
@@ -14208,7 +14445,7 @@ var init_preview = __esm({
14208
14445
  return ExitCode.Ok;
14209
14446
  }
14210
14447
  };
14211
- preview_default = command40;
14448
+ preview_default = command42;
14212
14449
  }
14213
14450
  });
14214
14451
 
@@ -14409,7 +14646,7 @@ function estimateOutput(templateId, target, estimate2) {
14409
14646
  ...target.campaignId !== void 0 ? { estimateNote: "An upper bound: it counts one page per lead, and a campaign run builds one page per company." } : {}
14410
14647
  };
14411
14648
  }
14412
- var COMMAND6, sha2562, command41, fill_default;
14649
+ var COMMAND6, sha2562, command43, fill_default;
14413
14650
  var init_fill = __esm({
14414
14651
  "src/commands/studio/fill.ts"() {
14415
14652
  "use strict";
@@ -14425,7 +14662,7 @@ var init_fill = __esm({
14425
14662
  init_fill_runs();
14426
14663
  COMMAND6 = "studio fill";
14427
14664
  sha2562 = (data) => createHash8("sha256").update(data).digest("hex");
14428
- command41 = {
14665
+ command43 = {
14429
14666
  resource: "studio",
14430
14667
  action: "fill",
14431
14668
  summary: "Fill a template on many accounts or campaign leads (estimate first)",
@@ -14485,16 +14722,16 @@ var init_fill = __esm({
14485
14722
  return outcome.exitCode;
14486
14723
  }
14487
14724
  };
14488
- fill_default = command41;
14725
+ fill_default = command43;
14489
14726
  }
14490
14727
  });
14491
14728
 
14492
14729
  // src/commands/studio/index.ts
14493
- var actions22;
14730
+ var actions24;
14494
14731
  var init_studio2 = __esm({
14495
14732
  "src/commands/studio/index.ts"() {
14496
14733
  "use strict";
14497
- actions22 = {
14734
+ actions24 = {
14498
14735
  pull: () => Promise.resolve().then(() => (init_pull(), pull_exports)).then((m) => m.default),
14499
14736
  push: () => Promise.resolve().then(() => (init_push(), push_exports)).then((m) => m.default),
14500
14737
  validate: () => Promise.resolve().then(() => (init_validate(), validate_exports)).then((m) => m.default),
@@ -14636,7 +14873,7 @@ function readBody(req) {
14636
14873
  function reply(res, status, body2) {
14637
14874
  res.writeHead(status, { "content-type": "application/json" }).end(JSON.stringify(body2));
14638
14875
  }
14639
- var MIN_POLL_MS, MAX_POLL_MS, MAX_TRIGGER_BYTES, command42, listen_default;
14876
+ var MIN_POLL_MS, MAX_POLL_MS, MAX_TRIGGER_BYTES, command44, listen_default;
14640
14877
  var init_listen = __esm({
14641
14878
  "src/commands/webhooks/listen.ts"() {
14642
14879
  "use strict";
@@ -14647,7 +14884,7 @@ var init_listen = __esm({
14647
14884
  MIN_POLL_MS = 1e3;
14648
14885
  MAX_POLL_MS = 6e4;
14649
14886
  MAX_TRIGGER_BYTES = 1e6;
14650
- command42 = {
14887
+ command44 = {
14651
14888
  resource: "webhooks",
14652
14889
  action: "listen",
14653
14890
  summary: "Stream the workspace's events and forward them, signed, to a local handler",
@@ -14753,7 +14990,7 @@ var init_listen = __esm({
14753
14990
  return ExitCode.Ok;
14754
14991
  }
14755
14992
  };
14756
- listen_default = command42;
14993
+ listen_default = command44;
14757
14994
  }
14758
14995
  });
14759
14996
 
@@ -14772,7 +15009,7 @@ function notRunning() {
14772
15009
  next: LISTEN_NEXT
14773
15010
  });
14774
15011
  }
14775
- var LISTEN_NEXT, command43, trigger_default;
15012
+ var LISTEN_NEXT, command45, trigger_default;
14776
15013
  var init_trigger = __esm({
14777
15014
  "src/commands/webhooks/trigger.ts"() {
14778
15015
  "use strict";
@@ -14781,7 +15018,7 @@ var init_trigger = __esm({
14781
15018
  init_http();
14782
15019
  init_local();
14783
15020
  LISTEN_NEXT = "kenso webhooks listen --forward-to http://localhost:3000/hook";
14784
- command43 = {
15021
+ command45 = {
14785
15022
  resource: "webhooks",
14786
15023
  action: "trigger",
14787
15024
  summary: "Send a sample event of one type through the running kenso webhooks listen",
@@ -14838,16 +15075,16 @@ var init_trigger = __esm({
14838
15075
  return ExitCode.Ok;
14839
15076
  }
14840
15077
  };
14841
- trigger_default = command43;
15078
+ trigger_default = command45;
14842
15079
  }
14843
15080
  });
14844
15081
 
14845
15082
  // src/commands/webhooks/index.ts
14846
- var actions23;
15083
+ var actions25;
14847
15084
  var init_webhooks2 = __esm({
14848
15085
  "src/commands/webhooks/index.ts"() {
14849
15086
  "use strict";
14850
- actions23 = {
15087
+ actions25 = {
14851
15088
  listen: () => Promise.resolve().then(() => (init_listen(), listen_exports)).then((m) => m.default),
14852
15089
  trigger: () => Promise.resolve().then(() => (init_trigger(), trigger_exports)).then((m) => m.default)
14853
15090
  };
@@ -15042,14 +15279,14 @@ var status_exports3 = {};
15042
15279
  __export(status_exports3, {
15043
15280
  default: () => status_default3
15044
15281
  });
15045
- var command44, status_default3;
15282
+ var command46, status_default3;
15046
15283
  var init_status3 = __esm({
15047
15284
  "src/commands/work/status.ts"() {
15048
15285
  "use strict";
15049
15286
  init_exit_codes();
15050
15287
  init_http();
15051
15288
  init_common3();
15052
- command44 = {
15289
+ command46 = {
15053
15290
  resource: "work",
15054
15291
  action: "status",
15055
15292
  summary: "Show the Kenso AI work waiting for your own agent, per kind",
@@ -15083,7 +15320,7 @@ var init_status3 = __esm({
15083
15320
  return ExitCode.Ok;
15084
15321
  }
15085
15322
  };
15086
- status_default3 = command44;
15323
+ status_default3 = command46;
15087
15324
  }
15088
15325
  });
15089
15326
 
@@ -15215,9 +15452,9 @@ var init_files = __esm({
15215
15452
  import { execFile, spawnSync as spawnSync2 } from "node:child_process";
15216
15453
  import { readFileSync as readFileSync12 } from "node:fs";
15217
15454
  import { isAbsolute as isAbsolute2 } from "node:path";
15218
- function sudoArgs(user, command51, args, keep = [], set = {}) {
15455
+ function sudoArgs(user, command53, args, keep = [], set = {}) {
15219
15456
  const assignments = Object.entries(set).map(([name, value]) => `${name}=${value}`);
15220
- return ["-n", "-u", user, "-H", ...keep.length > 0 ? [`--preserve-env=${keep.join(",")}`] : [], ...assignments, "--", command51, ...args];
15457
+ return ["-n", "-u", user, "-H", ...keep.length > 0 ? [`--preserve-env=${keep.join(",")}`] : [], ...assignments, "--", command53, ...args];
15221
15458
  }
15222
15459
  function agentKensoEnv(opts) {
15223
15460
  return {
@@ -15227,12 +15464,12 @@ function agentKensoEnv(opts) {
15227
15464
  AI_AGENT: opts.agentName
15228
15465
  };
15229
15466
  }
15230
- function sudoExec(user, command51, args, opts = {}) {
15467
+ function sudoExec(user, command53, args, opts = {}) {
15231
15468
  const [sudo = "/usr/bin/sudo", ...lead] = user.sudo;
15232
15469
  return new Promise((resolve16) => {
15233
15470
  execFile(
15234
15471
  sudo,
15235
- [...lead, ...sudoArgs(user.name, command51, args)],
15472
+ [...lead, ...sudoArgs(user.name, command53, args)],
15236
15473
  { env: { PATH: SUDO_PATH }, cwd: "/", timeout: opts.timeoutMs ?? PROBE_TIMEOUT_MS, maxBuffer: opts.maxBuffer ?? 1024 * 1024, encoding: "utf8", windowsHide: true, shell: false },
15237
15474
  (err, stdout, stderr) => {
15238
15475
  const code = err ? err.code : 0;
@@ -15342,9 +15579,9 @@ var init_folder2 = __esm({
15342
15579
  init_redact();
15343
15580
  init_agent_user();
15344
15581
  WorkRunFolder = class {
15345
- constructor(ctx, command51, args, outDir, shared = false) {
15582
+ constructor(ctx, command53, args, outDir, shared = false) {
15346
15583
  this.ctx = ctx;
15347
- this.command = command51;
15584
+ this.command = command53;
15348
15585
  this.args = args;
15349
15586
  this.outDir = outDir;
15350
15587
  this.shared = shared;
@@ -15459,7 +15696,7 @@ var pull_exports2 = {};
15459
15696
  __export(pull_exports2, {
15460
15697
  default: () => pull_default2
15461
15698
  });
15462
- var MAX_FILES, command45, pull_default2;
15699
+ var MAX_FILES, command47, pull_default2;
15463
15700
  var init_pull2 = __esm({
15464
15701
  "src/commands/work/pull.ts"() {
15465
15702
  "use strict";
@@ -15468,7 +15705,7 @@ var init_pull2 = __esm({
15468
15705
  init_common3();
15469
15706
  init_folder2();
15470
15707
  MAX_FILES = 100;
15471
- command45 = {
15708
+ command47 = {
15472
15709
  resource: "work",
15473
15710
  action: "pull",
15474
15711
  summary: "Claim waiting work into local work files, to answer by hand",
@@ -15546,7 +15783,7 @@ var init_pull2 = __esm({
15546
15783
  return interrupted7 ? ExitCode.Interrupted : ExitCode.Ok;
15547
15784
  }
15548
15785
  };
15549
- pull_default2 = command45;
15786
+ pull_default2 = command47;
15550
15787
  }
15551
15788
  });
15552
15789
 
@@ -15688,7 +15925,7 @@ __export(submit_exports, {
15688
15925
  default: () => submit_default
15689
15926
  });
15690
15927
  import { resolve as resolve14 } from "node:path";
15691
- var command46, submit_default;
15928
+ var command48, submit_default;
15692
15929
  var init_submit = __esm({
15693
15930
  "src/commands/work/submit.ts"() {
15694
15931
  "use strict";
@@ -15697,7 +15934,7 @@ var init_submit = __esm({
15697
15934
  init_files();
15698
15935
  init_answers();
15699
15936
  init_common3();
15700
- command46 = {
15937
+ command48 = {
15701
15938
  resource: "work",
15702
15939
  action: "submit",
15703
15940
  summary: "Send answers files to Kenso and write each one's results",
@@ -15729,7 +15966,7 @@ var init_submit = __esm({
15729
15966
  return totals.rejected > 0 ? ExitCode.Partial : ExitCode.Ok;
15730
15967
  }
15731
15968
  };
15732
- submit_default = command46;
15969
+ submit_default = command48;
15733
15970
  }
15734
15971
  });
15735
15972
 
@@ -15750,7 +15987,7 @@ function claimIdOf(arg) {
15750
15987
  if (!CLAIM_ID.test(arg)) throw usageError(`"${arg}" is neither a claim id nor a work file.`, { field: "claim", hint: "Claim ids look like awc_8fK2..." });
15751
15988
  return arg;
15752
15989
  }
15753
- var CLAIM_ID, command47, release_default;
15990
+ var CLAIM_ID, command49, release_default;
15754
15991
  var init_release = __esm({
15755
15992
  "src/commands/work/release.ts"() {
15756
15993
  "use strict";
@@ -15759,7 +15996,7 @@ var init_release = __esm({
15759
15996
  init_files();
15760
15997
  init_common3();
15761
15998
  CLAIM_ID = /^[A-Za-z0-9_-]{1,64}$/;
15762
- command47 = {
15999
+ command49 = {
15763
16000
  resource: "work",
15764
16001
  action: "release",
15765
16002
  summary: "Give claimed work back to the queue now",
@@ -15778,7 +16015,7 @@ var init_release = __esm({
15778
16015
  return ExitCode.Ok;
15779
16016
  }
15780
16017
  };
15781
- release_default = command47;
16018
+ release_default = command49;
15782
16019
  }
15783
16020
  });
15784
16021
 
@@ -16117,12 +16354,12 @@ function plain(text4) {
16117
16354
  return text4.replace(/\x1b\[[0-9;?]*[A-Za-z]/g, "");
16118
16355
  }
16119
16356
  function runStatus(bin, args, env, adapter, runAs) {
16120
- const command51 = runAs ? runAs.sudo[0] ?? "/usr/bin/sudo" : bin;
16357
+ const command53 = runAs ? runAs.sudo[0] ?? "/usr/bin/sudo" : bin;
16121
16358
  const commandArgs2 = runAs ? [...runAs.sudo.slice(1), ...sudoArgs(runAs.name, bin, args)] : args;
16122
16359
  const options = runAs ? { env: { PATH: SUDO_PATH }, cwd: "/" } : { env: childEnv(env, adapter) };
16123
16360
  return new Promise((resolve16) => {
16124
16361
  execFile2(
16125
- command51,
16362
+ command53,
16126
16363
  commandArgs2,
16127
16364
  { ...options, timeout: STATUS_TIMEOUT_MS, maxBuffer: 1024 * 1024, windowsHide: true, shell: false },
16128
16365
  (err, stdout, stderr) => {
@@ -16390,7 +16627,7 @@ ${out.stderr}`;
16390
16627
  "dontAsk",
16391
16628
  "--tools",
16392
16629
  tools.join(","),
16393
- ...rules.flatMap((rule) => ["--allow", rule]),
16630
+ ...rules.flatMap((rule2) => ["--allow", rule2]),
16394
16631
  "--no-subagents"
16395
16632
  ];
16396
16633
  if (!job.allowWeb) args.push("--disable-web-search");
@@ -17204,7 +17441,7 @@ var run_exports3 = {};
17204
17441
  __export(run_exports3, {
17205
17442
  default: () => run_default2
17206
17443
  });
17207
- var FAILURES_IN_A_ROW, command48, run_default2;
17444
+ var FAILURES_IN_A_ROW, command50, run_default2;
17208
17445
  var init_run3 = __esm({
17209
17446
  "src/commands/work/run.ts"() {
17210
17447
  "use strict";
@@ -17225,7 +17462,7 @@ var init_run3 = __esm({
17225
17462
  init_folder2();
17226
17463
  init_stop();
17227
17464
  FAILURES_IN_A_ROW = 3;
17228
- command48 = {
17465
+ command50 = {
17229
17466
  resource: "work",
17230
17467
  action: "run",
17231
17468
  summary: "Run your own coding agent on the waiting work until the queue is empty",
@@ -17550,16 +17787,16 @@ var init_run3 = __esm({
17550
17787
  return exitCodeFor(reason, totals.rejected > 0 || jobsFailed > 0);
17551
17788
  }
17552
17789
  };
17553
- run_default2 = command48;
17790
+ run_default2 = command50;
17554
17791
  }
17555
17792
  });
17556
17793
 
17557
17794
  // src/commands/work/index.ts
17558
- var actions24;
17795
+ var actions26;
17559
17796
  var init_work2 = __esm({
17560
17797
  "src/commands/work/index.ts"() {
17561
17798
  "use strict";
17562
- actions24 = {
17799
+ actions26 = {
17563
17800
  status: () => Promise.resolve().then(() => (init_status3(), status_exports3)).then((m) => m.default),
17564
17801
  pull: () => Promise.resolve().then(() => (init_pull2(), pull_exports2)).then((m) => m.default),
17565
17802
  submit: () => Promise.resolve().then(() => (init_submit(), submit_exports)).then((m) => m.default),
@@ -17583,14 +17820,14 @@ function parseLimit(value) {
17583
17820
  }
17584
17821
  return limit;
17585
17822
  }
17586
- var MAX_LIMIT, command49, list_default3;
17823
+ var MAX_LIMIT, command51, list_default3;
17587
17824
  var init_list3 = __esm({
17588
17825
  "src/commands/workspace/list.ts"() {
17589
17826
  "use strict";
17590
17827
  init_errors();
17591
17828
  init_exit_codes();
17592
17829
  MAX_LIMIT = 200;
17593
- command49 = {
17830
+ command51 = {
17594
17831
  resource: "workspace",
17595
17832
  action: "list",
17596
17833
  summary: "List the workspaces your key can use",
@@ -17618,7 +17855,7 @@ var init_list3 = __esm({
17618
17855
  return ExitCode.Ok;
17619
17856
  }
17620
17857
  };
17621
- list_default3 = command49;
17858
+ list_default3 = command51;
17622
17859
  }
17623
17860
  });
17624
17861
 
@@ -17627,7 +17864,7 @@ var use_exports = {};
17627
17864
  __export(use_exports, {
17628
17865
  default: () => use_default
17629
17866
  });
17630
- var command50, use_default;
17867
+ var command52, use_default;
17631
17868
  var init_use = __esm({
17632
17869
  "src/commands/workspace/use.ts"() {
17633
17870
  "use strict";
@@ -17635,7 +17872,7 @@ var init_use = __esm({
17635
17872
  init_errors();
17636
17873
  init_exit_codes();
17637
17874
  init_http();
17638
- command50 = {
17875
+ command52 = {
17639
17876
  resource: "workspace",
17640
17877
  action: "use",
17641
17878
  summary: "Set the profile's default workspace",
@@ -17692,16 +17929,16 @@ var init_use = __esm({
17692
17929
  return ExitCode.Ok;
17693
17930
  }
17694
17931
  };
17695
- use_default = command50;
17932
+ use_default = command52;
17696
17933
  }
17697
17934
  });
17698
17935
 
17699
17936
  // src/commands/workspace/index.ts
17700
- var actions25;
17937
+ var actions27;
17701
17938
  var init_workspace = __esm({
17702
17939
  "src/commands/workspace/index.ts"() {
17703
17940
  "use strict";
17704
- actions25 = {
17941
+ actions27 = {
17705
17942
  list: () => Promise.resolve().then(() => (init_list3(), list_exports3)).then((m) => m.default),
17706
17943
  use: () => Promise.resolve().then(() => (init_use(), use_exports)).then((m) => m.default)
17707
17944
  };
@@ -17733,11 +17970,13 @@ var init_registry = __esm({
17733
17970
  init_describe2();
17734
17971
  init_docs2();
17735
17972
  init_doctor();
17973
+ init_export3();
17736
17974
  init_jobs2();
17737
17975
  init_logs();
17738
17976
  init_mcp();
17739
17977
  init_opportunities();
17740
17978
  init_people();
17979
+ init_pipelines();
17741
17980
  init_reports();
17742
17981
  init_runs2();
17743
17982
  init_sandbox2();
@@ -17759,22 +17998,24 @@ var init_registry = __esm({
17759
17998
  describe: actions10,
17760
17999
  docs: actions11,
17761
18000
  doctor: actions12,
17762
- jobs: actions13,
18001
+ export: actions13,
18002
+ jobs: actions14,
17763
18003
  login: topLevel("login", actions4.login, "kenso auth login"),
17764
18004
  logout: topLevel("logout", actions4.logout, "kenso auth logout"),
17765
- logs: actions14,
17766
- mcp: actions15,
17767
- opportunities: actions16,
17768
- people: actions17,
17769
- reports: actions18,
17770
- runs: actions19,
17771
- sandbox: actions20,
17772
- skill: actions21,
17773
- studio: actions22,
17774
- webhooks: actions23,
18005
+ logs: actions15,
18006
+ mcp: actions16,
18007
+ opportunities: actions17,
18008
+ people: actions18,
18009
+ pipelines: actions19,
18010
+ reports: actions20,
18011
+ runs: actions21,
18012
+ sandbox: actions22,
18013
+ skill: actions23,
18014
+ studio: actions24,
18015
+ webhooks: actions25,
17775
18016
  whoami: topLevel("whoami", actions4.status, "kenso auth status"),
17776
- work: actions24,
17777
- workspace: actions25
18017
+ work: actions26,
18018
+ workspace: actions27
17778
18019
  };
17779
18020
  resourceAliases = { leads: "contacts" };
17780
18021
  }
@@ -17911,8 +18152,8 @@ async function renderTopHelp(opts) {
17911
18152
  names.push(withPositionals(spec, spec.action));
17912
18153
  groups.set(hint, names);
17913
18154
  }
17914
- const actions27 = [...groups.entries()].map(([hint, names]) => `${names.join(", ")}${hint}`);
17915
- if (actions27.length > 0) rows.push([resource, actions27.join(", ")]);
18155
+ const actions29 = [...groups.entries()].map(([hint, names]) => `${names.join(", ")}${hint}`);
18156
+ if (actions29.length > 0) rows.push([resource, actions29.join(", ")]);
17916
18157
  }
17917
18158
  const at = 4 + Math.min(22, Math.max(0, ...rows.map(([left]) => left.length)));
17918
18159
  lines.push(
@@ -17925,7 +18166,7 @@ async function renderTopHelp(opts) {
17925
18166
  const [area = "", action = ""] = name.split(" ");
17926
18167
  byArea.set(area, [...byArea.get(area) ?? [], action]);
17927
18168
  }
17928
- const named = [...byArea.entries()].map(([area, actions27]) => `${area} ${actions27.join("|")}`);
18169
+ const named = [...byArea.entries()].map(([area, actions29]) => `${area} ${actions29.join("|")}`);
17929
18170
  lines.push(wrap(`Beta, hidden here but they run (the server decides): ${named.join(", ")}.`, " "));
17930
18171
  }
17931
18172
  const generated = await listGenerated({ features: opts.allCommands ? [] : getFeatures, env: opts.env });
@@ -17933,13 +18174,13 @@ async function renderTopHelp(opts) {
17933
18174
  if (visible.length > 0) {
17934
18175
  const byResource = /* @__PURE__ */ new Map();
17935
18176
  for (const g of visible) {
17936
- const actions27 = byResource.get(g.resource) ?? [];
17937
- actions27.push(`${g.action}${g.beta ? " (beta)" : ""}`);
17938
- byResource.set(g.resource, actions27);
18177
+ const actions29 = byResource.get(g.resource) ?? [];
18178
+ actions29.push(`${g.action}${g.beta ? " (beta)" : ""}`);
18179
+ byResource.set(g.resource, actions29);
17939
18180
  }
17940
18181
  const sorted2 = [...byResource.entries()].sort(([a], [b]) => a.localeCompare(b));
17941
18182
  if (opts.allCommands) {
17942
- const generatedRows = sorted2.map(([resource, actions27]) => [resource, actions27.sort().join(", ")]);
18183
+ const generatedRows = sorted2.map(([resource, actions29]) => [resource, actions29.sort().join(", ")]);
17943
18184
  lines.push("", "API resources (kenso <resource> <action>):", columns(generatedRows));
17944
18185
  } else {
17945
18186
  const names = new Set(sorted2.map(([resource]) => resource));
@@ -18255,8 +18496,8 @@ function startUpdateNotice(argv, opts = {}) {
18255
18496
  if (!found) return;
18256
18497
  writeCheck(file, { checkedAt: new Date(now).toISOString(), latest: found });
18257
18498
  if (isNewer(found, version)) {
18258
- const command51 = updateCommand(install, opts.platform ?? process.platform);
18259
- stderr.write(`kenso ${found} is out (you have ${version}): ${command51}
18499
+ const command53 = updateCommand(install, opts.platform ?? process.platform);
18500
+ stderr.write(`kenso ${found} is out (you have ${version}): ${command53}
18260
18501
  Turn this off with KENSO_NO_UPDATE_NOTIFIER=1.
18261
18502
  `);
18262
18503
  }
@@ -18298,7 +18539,7 @@ function resources() {
18298
18539
  const names = Object.entries(handWritten).filter(([, area]) => Object.keys(area).length > 0).map(([resource]) => resource);
18299
18540
  return sorted([...names, ...Object.keys(resourceAliases), ...loadManifest().operations.map((op) => op.resource)]);
18300
18541
  }
18301
- function actions26(resource) {
18542
+ function actions28(resource) {
18302
18543
  const own = Object.keys(handWritten[resource] ?? {}).filter((action) => action !== "");
18303
18544
  return sorted([...own, ...loadManifest().operations.filter((op) => op.resource === resource).map((op) => op.action)]);
18304
18545
  }
@@ -18363,7 +18604,7 @@ async function completions(words, globals) {
18363
18604
  return flagsOf2(spec, globals, positionals.length === 0);
18364
18605
  }
18365
18606
  if (positionals.length === 0) return resources();
18366
- if (!spec) return positionals.length === 1 ? actions26(resourceAliases[positionals[0]] ?? positionals[0]) : [];
18607
+ if (!spec) return positionals.length === 1 ? actions28(resourceAliases[positionals[0]] ?? positionals[0]) : [];
18367
18608
  const given = positionals.length - commandWords;
18368
18609
  const declared = spec.positionals ?? [];
18369
18610
  if (given < declared.length || declared.at(-1)?.variadic === true) {
@@ -18457,9 +18698,9 @@ function normalizeBooleans(argv, names, strict) {
18457
18698
  async function knownCommands() {
18458
18699
  const commands = /* @__PURE__ */ new Set();
18459
18700
  for (const [resource, area] of Object.entries(handWritten)) {
18460
- const actions27 = Object.keys(area);
18461
- if (actions27.length > 0) commands.add(resource);
18462
- for (const action of actions27) commands.add(action ? `${resource} ${action}` : resource);
18701
+ const actions29 = Object.keys(area);
18702
+ if (actions29.length > 0) commands.add(resource);
18703
+ for (const action of actions29) commands.add(action ? `${resource} ${action}` : resource);
18463
18704
  }
18464
18705
  for (const g of await listGenerated({ features: [] })) {
18465
18706
  commands.add(g.resource);