kenso 0.1.67 → 0.1.69

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
@@ -2421,7 +2421,7 @@ var VERSION;
2421
2421
  var init_version = __esm({
2422
2422
  "src/core/version.ts"() {
2423
2423
  "use strict";
2424
- VERSION = true ? "0.1.67" : "0.0.0-dev";
2424
+ VERSION = true ? "0.1.69" : "0.0.0-dev";
2425
2425
  }
2426
2426
  });
2427
2427
 
@@ -3714,9 +3714,9 @@ async function readRunDir(dir) {
3714
3714
  return null;
3715
3715
  }
3716
3716
  if (!raw) return null;
3717
- const { runId, command: command44, createdAt, status } = raw;
3717
+ const { runId, command: command48, createdAt, status } = raw;
3718
3718
  if (typeof runId !== "string" || !RUN_ID_PATTERN.test(runId)) return null;
3719
- if (typeof command44 !== "string" || typeof createdAt !== "string") return null;
3719
+ if (typeof command48 !== "string" || typeof createdAt !== "string") return null;
3720
3720
  if (typeof status !== "string" || !STATUSES.includes(status)) return null;
3721
3721
  let chunksDone = chunkList(raw.chunksDone) ?? [];
3722
3722
  try {
@@ -3727,7 +3727,7 @@ async function readRunDir(dir) {
3727
3727
  const record = {
3728
3728
  ...raw,
3729
3729
  runId,
3730
- command: command44,
3730
+ command: command48,
3731
3731
  args: asRecord3(raw.args) ?? {},
3732
3732
  createdAt,
3733
3733
  status,
@@ -3782,11 +3782,11 @@ async function loadRun(runId, env = process.env) {
3782
3782
  }
3783
3783
  return run;
3784
3784
  }
3785
- async function findIdentical(command44, args, inputSha256, env, workspaceId, anyWorkspace = false) {
3785
+ async function findIdentical(command48, args, inputSha256, env, workspaceId, anyWorkspace = false) {
3786
3786
  const identity = argsIdentity(args);
3787
3787
  const runs = await listRuns(env);
3788
3788
  return runs.filter(
3789
- (run) => run.command === command44 && (run.inputSha256 || void 0) === (inputSha256 || void 0) && (anyWorkspace || (run.workspaceId || void 0) === (workspaceId || void 0)) && argsIdentity(run.args) === identity
3789
+ (run) => run.command === command48 && (run.inputSha256 || void 0) === (inputSha256 || void 0) && (anyWorkspace || (run.workspaceId || void 0) === (workspaceId || void 0)) && argsIdentity(run.args) === identity
3790
3790
  );
3791
3791
  }
3792
3792
  function isOtherLiveProcess(pid) {
@@ -6938,8 +6938,8 @@ function idValue(value, field) {
6938
6938
  function shellQuote3(arg) {
6939
6939
  return /^[A-Za-z0-9_./:=@%+,-]+$/.test(arg) ? arg : `'${arg.replace(/'/g, `'\\''`)}'`;
6940
6940
  }
6941
- function commandLine2(ctx, command44, args, extra = []) {
6942
- const parts2 = ["kenso", ...command44.split(" "), ...(args.positionals ?? []).map(shellQuote3)];
6941
+ function commandLine2(ctx, command48, args, extra = []) {
6942
+ const parts2 = ["kenso", ...command48.split(" "), ...(args.positionals ?? []).map(shellQuote3)];
6943
6943
  for (const [name, value] of Object.entries(args.flags)) {
6944
6944
  if (value === void 0 || value === false) continue;
6945
6945
  if (value === true) parts2.push(`--${name}`);
@@ -7263,7 +7263,7 @@ var init_batch = __esm({
7263
7263
  var crm_default;
7264
7264
  var init_crm = __esm({
7265
7265
  "docs/crm.md"() {
7266
- 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| `capture status` | Your captured mailbox, its backfill progress and what teammates see of a captured email. Needs the `crm_capture` flag |\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\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## 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';
7266
+ 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| `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\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## 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';
7267
7267
  }
7268
7268
  });
7269
7269
 
@@ -8400,8 +8400,8 @@ var init_browser_login = __esm({
8400
8400
  defaultDeps = {
8401
8401
  sleep: (ms, signal) => delay2(ms, void 0, signal ? { signal } : void 0),
8402
8402
  now: () => Date.now(),
8403
- spawn: (command44, args) => {
8404
- const child = nodeSpawn(command44, args, { detached: true, stdio: "ignore" });
8403
+ spawn: (command48, args) => {
8404
+ const child = nodeSpawn(command48, args, { detached: true, stdio: "ignore" });
8405
8405
  child.on("error", () => {
8406
8406
  });
8407
8407
  child.unref();
@@ -8773,13 +8773,191 @@ var init_status2 = __esm({
8773
8773
  }
8774
8774
  });
8775
8775
 
8776
+ // src/commands/capture/connect.ts
8777
+ var connect_exports = {};
8778
+ __export(connect_exports, {
8779
+ default: () => connect_default
8780
+ });
8781
+ var PROVIDERS, command9, connect_default;
8782
+ var init_connect = __esm({
8783
+ "src/commands/capture/connect.ts"() {
8784
+ "use strict";
8785
+ init_errors();
8786
+ init_exit_codes();
8787
+ init_http();
8788
+ PROVIDERS = ["google", "microsoft"];
8789
+ command9 = {
8790
+ resource: "capture",
8791
+ action: "connect",
8792
+ summary: "Turn capture on for your own mailbox",
8793
+ description: "Sends PUT /v1/capture/mailbox. Kenso then logs your email with people in Kenso on the person, the account and its open deals, starting with the newest mail and going back 90 days; kenso capture status shows the progress. Running it again changes nothing. It uses the Google or Microsoft account you connected in Kenso with email access. With none, the answer is mailbox_not_connected: run it with --provider to get a sign-in link (POST /v1/calendar-accounts/connect-sessions), open the link, sign in, then run kenso capture connect again. other_mailbox_connected means your captured mailbox needs its sign-in again and the account connected now is another one: sign in to the captured mailbox again, or run kenso capture disconnect and then connect.",
8794
+ flags: {
8795
+ private: { type: "boolean", description: "Start with the Private switch on: teammates see none of this mailbox's email" },
8796
+ provider: { type: "string", description: "google or microsoft: when no account is connected yet, print the sign-in link for one" }
8797
+ },
8798
+ examples: ["kenso capture connect", "kenso capture connect --private", "kenso capture connect --provider google"],
8799
+ beta: { featureGates: { all: ["crm_capture"] } },
8800
+ operationIds: ["capture-mailbox.connect", "calendar-accounts.create-connect-session"],
8801
+ async run(ctx, { flags }) {
8802
+ const provider = typeof flags.provider === "string" ? flags.provider : void 0;
8803
+ if (provider !== void 0 && !PROVIDERS.includes(provider)) {
8804
+ throw usageError("--provider is google or microsoft.", { field: "provider" });
8805
+ }
8806
+ try {
8807
+ const res = await ctx.client.request({
8808
+ method: "PUT",
8809
+ path: "/v1/capture/mailbox",
8810
+ body: flags.private === true ? { isPrivate: true } : {},
8811
+ signal: ctx.signal
8812
+ });
8813
+ ctx.output.object(unwrap(res.body));
8814
+ return ExitCode.Ok;
8815
+ } catch (err) {
8816
+ if (!(err instanceof KensoError) || err.code !== "mailbox_not_connected") throw err;
8817
+ if (provider === void 0) {
8818
+ throw new KensoError({
8819
+ code: err.code,
8820
+ message: "No Google or Microsoft account with email access is connected for you in Kenso.",
8821
+ exitCode: err.exitCode,
8822
+ httpStatus: err.httpStatus,
8823
+ requestId: err.requestId,
8824
+ hint: "Get a sign-in link with --provider google or --provider microsoft, open it, then run kenso capture connect again.",
8825
+ next: "kenso capture connect --provider google"
8826
+ });
8827
+ }
8828
+ const session = await ctx.client.request({
8829
+ method: "POST",
8830
+ path: "/v1/calendar-accounts/connect-sessions",
8831
+ body: { provider, access: "calendar_and_email" },
8832
+ signal: ctx.signal
8833
+ });
8834
+ ctx.output.object({ status: "sign_in_needed", ...unwrap(session.body), next: "kenso capture connect" });
8835
+ return ExitCode.Ok;
8836
+ }
8837
+ }
8838
+ };
8839
+ connect_default = command9;
8840
+ }
8841
+ });
8842
+
8843
+ // src/commands/capture/private.ts
8844
+ var private_exports = {};
8845
+ __export(private_exports, {
8846
+ default: () => private_default
8847
+ });
8848
+ var command10, private_default;
8849
+ var init_private = __esm({
8850
+ "src/commands/capture/private.ts"() {
8851
+ "use strict";
8852
+ init_errors();
8853
+ init_exit_codes();
8854
+ init_http();
8855
+ command10 = {
8856
+ resource: "capture",
8857
+ action: "private",
8858
+ summary: "Hide your captured email from teammates, or show it again",
8859
+ description: "Sends PATCH /v1/capture/mailbox with isPrivate. on hides your captured email from teammates, mail already captured included: a teammate sees no trace of a thread only your mailbox holds, and a private mailbox creates no people or accounts. A message a teammate's own mailbox also holds stays visible through theirs. off shows your email again as the workspace setting allows. Email only: meetings stay visible, and Ken still reads the mailbox for you.",
8860
+ flags: {},
8861
+ positionals: [{ name: "state", required: true, description: "on or off" }],
8862
+ examples: ["kenso capture private on", "kenso capture private off"],
8863
+ beta: { featureGates: { all: ["crm_capture"] } },
8864
+ operationIds: ["capture-mailbox.update"],
8865
+ async run(ctx, { positionals }) {
8866
+ const state = positionals[0];
8867
+ if (state !== "on" && state !== "off") throw usageError("Say on or off: kenso capture private on.", { field: "state" });
8868
+ const res = await ctx.client.request({
8869
+ method: "PATCH",
8870
+ path: "/v1/capture/mailbox",
8871
+ body: { isPrivate: state === "on" },
8872
+ signal: ctx.signal
8873
+ });
8874
+ ctx.output.object(unwrap(res.body));
8875
+ return ExitCode.Ok;
8876
+ }
8877
+ };
8878
+ private_default = command10;
8879
+ }
8880
+ });
8881
+
8882
+ // src/commands/capture/disconnect.ts
8883
+ var disconnect_exports = {};
8884
+ __export(disconnect_exports, {
8885
+ default: () => disconnect_default
8886
+ });
8887
+ var command11, disconnect_default;
8888
+ var init_disconnect = __esm({
8889
+ "src/commands/capture/disconnect.ts"() {
8890
+ "use strict";
8891
+ init_confirm();
8892
+ init_exit_codes();
8893
+ command11 = {
8894
+ resource: "capture",
8895
+ action: "disconnect",
8896
+ summary: "Turn capture off for your own mailbox and delete its stored email bodies",
8897
+ description: "Sends DELETE /v1/capture/mailbox. Sync stops and Kenso deletes the stored body of every email only your mailbox holds. Subject, people, time and Ken's summary stay on the records. Your Google or Microsoft account stays connected for calendar and scheduling. Deleted bodies do not come back, so it asks first: add --yes to run it without the question.",
8898
+ flags: {},
8899
+ examples: ["kenso capture disconnect --yes"],
8900
+ beta: { featureGates: { all: ["crm_capture"] } },
8901
+ operationIds: ["capture-mailbox.disconnect"],
8902
+ async run(ctx) {
8903
+ await confirmDestructive(ctx, "This turns capture off and deletes your stored email bodies", "kenso capture disconnect --yes");
8904
+ await ctx.client.request({ method: "DELETE", path: "/v1/capture/mailbox", signal: ctx.signal });
8905
+ ctx.output.object({ disconnected: true });
8906
+ return ExitCode.Ok;
8907
+ }
8908
+ };
8909
+ disconnect_default = command11;
8910
+ }
8911
+ });
8912
+
8913
+ // src/commands/capture/teammates-see.ts
8914
+ var teammates_see_exports = {};
8915
+ __export(teammates_see_exports, {
8916
+ default: () => teammates_see_default
8917
+ });
8918
+ var VALUES, command12, teammates_see_default;
8919
+ var init_teammates_see = __esm({
8920
+ "src/commands/capture/teammates-see.ts"() {
8921
+ "use strict";
8922
+ init_errors();
8923
+ init_exit_codes();
8924
+ init_http();
8925
+ VALUES = ["summary", "full_email"];
8926
+ command12 = {
8927
+ resource: "capture",
8928
+ action: "teammates-see",
8929
+ summary: "Pick what teammates see of captured email: the summary, or the full email (workspace admin)",
8930
+ description: "Sends PATCH /v1/capture with teammatesSee. summary (the default): teammates read subject, people, time and Ken's summary, and only the mailbox owner opens the body. full_email: every member can open a captured body. It applies to every read from then on, mail already captured included. A member's Private switch still hides their email either way. Only a workspace admin can change it.",
8931
+ flags: {},
8932
+ positionals: [{ name: "value", required: true, description: "summary or full_email" }],
8933
+ examples: ["kenso capture teammates-see summary", "kenso capture teammates-see full_email"],
8934
+ beta: { featureGates: { all: ["crm_capture"] } },
8935
+ operationIds: ["capture.update"],
8936
+ async run(ctx, { positionals }) {
8937
+ const value = positionals[0];
8938
+ if (value === void 0 || !VALUES.includes(value)) {
8939
+ throw usageError("Say summary or full_email: kenso capture teammates-see summary.", { field: "value" });
8940
+ }
8941
+ const res = await ctx.client.request({ method: "PATCH", path: "/v1/capture", body: { teammatesSee: value }, signal: ctx.signal });
8942
+ ctx.output.object(unwrap(res.body));
8943
+ return ExitCode.Ok;
8944
+ }
8945
+ };
8946
+ teammates_see_default = command12;
8947
+ }
8948
+ });
8949
+
8776
8950
  // src/commands/capture/index.ts
8777
8951
  var actions5;
8778
8952
  var init_capture = __esm({
8779
8953
  "src/commands/capture/index.ts"() {
8780
8954
  "use strict";
8781
8955
  actions5 = {
8782
- status: () => Promise.resolve().then(() => (init_status2(), status_exports2)).then((m) => m.default)
8956
+ status: () => Promise.resolve().then(() => (init_status2(), status_exports2)).then((m) => m.default),
8957
+ connect: () => Promise.resolve().then(() => (init_connect(), connect_exports)).then((m) => m.default),
8958
+ private: () => Promise.resolve().then(() => (init_private(), private_exports)).then((m) => m.default),
8959
+ disconnect: () => Promise.resolve().then(() => (init_disconnect(), disconnect_exports)).then((m) => m.default),
8960
+ "teammates-see": () => Promise.resolve().then(() => (init_teammates_see(), teammates_see_exports)).then((m) => m.default)
8783
8961
  };
8784
8962
  }
8785
8963
  });
@@ -8790,7 +8968,7 @@ __export(completion_exports, {
8790
8968
  SCRIPTS: () => SCRIPTS,
8791
8969
  default: () => completion_default
8792
8970
  });
8793
- var ZSH, BASH, FISH, SCRIPTS, command9, completion_default;
8971
+ var ZSH, BASH, FISH, SCRIPTS, command13, completion_default;
8794
8972
  var init_completion = __esm({
8795
8973
  "src/commands/completion/completion.ts"() {
8796
8974
  "use strict";
@@ -8854,7 +9032,7 @@ end
8854
9032
  complete -c kenso -f -a '(__kenso_complete)'
8855
9033
  `;
8856
9034
  SCRIPTS = { bash: BASH, zsh: ZSH, fish: FISH };
8857
- command9 = {
9035
+ command13 = {
8858
9036
  resource: "completion",
8859
9037
  action: "",
8860
9038
  summary: "Print the tab-completion script for bash, zsh or fish",
@@ -8882,7 +9060,7 @@ complete -c kenso -f -a '(__kenso_complete)'
8882
9060
  return ExitCode.Ok;
8883
9061
  }
8884
9062
  };
8885
- completion_default = command9;
9063
+ completion_default = command13;
8886
9064
  }
8887
9065
  });
8888
9066
 
@@ -8907,9 +9085,9 @@ function stringFlag2(flags, name) {
8907
9085
  const text3 = value.trim();
8908
9086
  return text3 === "" ? void 0 : text3;
8909
9087
  }
8910
- function requireFlag(flags, name, command44, hint) {
9088
+ function requireFlag(flags, name, command48, hint) {
8911
9089
  const value = stringFlag2(flags, name);
8912
- if (value === void 0) throw usageError(`--${name} is required for ${command44}.`, { field: name, next: `${command44} --help`, ...hint ? { hint } : {} });
9090
+ if (value === void 0) throw usageError(`--${name} is required for ${command48}.`, { field: name, next: `${command48} --help`, ...hint ? { hint } : {} });
8913
9091
  return value;
8914
9092
  }
8915
9093
  function positiveId(value) {
@@ -8918,8 +9096,8 @@ function positiveId(value) {
8918
9096
  const id = Number(text3);
8919
9097
  return Number.isSafeInteger(id) && id > 0 ? id : void 0;
8920
9098
  }
8921
- function idFlag(flags, name, command44) {
8922
- const raw = requireFlag(flags, name, command44);
9099
+ function idFlag(flags, name, command48) {
9100
+ const raw = requireFlag(flags, name, command48);
8923
9101
  const id = positiveId(raw);
8924
9102
  if (id === void 0) throw usageError(`--${name} must be a positive whole number (got "${raw}").`, { field: name });
8925
9103
  return id;
@@ -8939,8 +9117,8 @@ function isDryRun(ctx) {
8939
9117
  function shellQuote4(value) {
8940
9118
  return /^[A-Za-z0-9_\-.,:/@=+%]+$/.test(value) ? value : `'${value.replace(/'/g, `'\\''`)}'`;
8941
9119
  }
8942
- function sameCommand2(command44, flags, ctx, extra = []) {
8943
- const parts2 = [command44];
9120
+ function sameCommand2(command48, flags, ctx, extra = []) {
9121
+ const parts2 = [command48];
8944
9122
  for (const [name, value] of Object.entries(flags)) {
8945
9123
  if (value === void 0 || value === false) continue;
8946
9124
  if (value === true) parts2.push(`--${name}`);
@@ -9540,7 +9718,7 @@ function parseDuration(text3) {
9540
9718
  const ms = Number(match[1]) * (UNIT_MS[(match[2] || "s").toLowerCase()] ?? 1e3);
9541
9719
  return Number.isFinite(ms) ? Math.round(ms) : void 0;
9542
9720
  }
9543
- var UNIT_MS, command10, wait_default;
9721
+ var UNIT_MS, command14, wait_default;
9544
9722
  var init_wait = __esm({
9545
9723
  "src/commands/jobs/wait.ts"() {
9546
9724
  "use strict";
@@ -9548,7 +9726,7 @@ var init_wait = __esm({
9548
9726
  init_errors();
9549
9727
  init_exit_codes();
9550
9728
  UNIT_MS = { s: 1e3, m: 6e4, h: 36e5 };
9551
- command10 = {
9729
+ command14 = {
9552
9730
  resource: "jobs",
9553
9731
  action: "wait",
9554
9732
  summary: "Wait for a background job and print it",
@@ -9587,7 +9765,7 @@ var init_wait = __esm({
9587
9765
  });
9588
9766
  }
9589
9767
  };
9590
- wait_default = command10;
9768
+ wait_default = command14;
9591
9769
  }
9592
9770
  });
9593
9771
 
@@ -9769,7 +9947,7 @@ function summarize2(campaignId) {
9769
9947
  notSendable: results.filter((r) => (r.status === "created" || r.status === "updated") && r.sendable === false).length
9770
9948
  });
9771
9949
  }
9772
- var COMMAND2, CHUNK_SIZE2, LINKEDIN_ONLY_CHANNELS, TEMPLATE_HEADER, command11, import_default2;
9950
+ var COMMAND2, CHUNK_SIZE2, LINKEDIN_ONLY_CHANNELS, TEMPLATE_HEADER, command15, import_default2;
9773
9951
  var init_import2 = __esm({
9774
9952
  "src/commands/contacts/import.ts"() {
9775
9953
  "use strict";
@@ -9788,7 +9966,7 @@ var init_import2 = __esm({
9788
9966
  CHUNK_SIZE2 = 1e3;
9789
9967
  LINKEDIN_ONLY_CHANNELS = /* @__PURE__ */ new Set(["linkedin", "linkedin_only"]);
9790
9968
  TEMPLATE_HEADER = `${CONTACT_FIELDS.join(",")},<your custom columns>`;
9791
- command11 = {
9969
+ command15 = {
9792
9970
  resource: "contacts",
9793
9971
  action: "import",
9794
9972
  summary: "Add leads from a CSV or JSONL file to a campaign",
@@ -9877,7 +10055,7 @@ var init_import2 = __esm({
9877
10055
  return outcome.exitCode;
9878
10056
  }
9879
10057
  };
9880
- import_default2 = command11;
10058
+ import_default2 = command15;
9881
10059
  }
9882
10060
  });
9883
10061
 
@@ -9981,7 +10159,7 @@ async function sendUpdateChunk(chunk, ctx) {
9981
10159
  });
9982
10160
  return { results: mapUpdateAnswer(chunk, res.body), rateLimitRemaining: rateLimitRemaining3(res.headers) };
9983
10161
  }
9984
- var COMMAND3, CHUNK_SIZE3, PAGE_SIZE, command12, update_default;
10162
+ var COMMAND3, CHUNK_SIZE3, PAGE_SIZE, command16, update_default;
9985
10163
  var init_update = __esm({
9986
10164
  "src/commands/contacts/update.ts"() {
9987
10165
  "use strict";
@@ -9995,7 +10173,7 @@ var init_update = __esm({
9995
10173
  COMMAND3 = "kenso contacts update";
9996
10174
  CHUNK_SIZE3 = 1e3;
9997
10175
  PAGE_SIZE = 200;
9998
- command12 = {
10176
+ command16 = {
9999
10177
  resource: "contacts",
10000
10178
  action: "update",
10001
10179
  summary: "Edit leads from a CSV or JSONL file, by id or email (also one lead)",
@@ -10066,7 +10244,7 @@ var init_update = __esm({
10066
10244
  return outcome.exitCode;
10067
10245
  }
10068
10246
  };
10069
- update_default = command12;
10247
+ update_default = command16;
10070
10248
  }
10071
10249
  });
10072
10250
 
@@ -10077,12 +10255,12 @@ import { join as join11 } from "node:path";
10077
10255
  function whereDir(env) {
10078
10256
  return join11(runsRoot(env), WHERE_DIR);
10079
10257
  }
10080
- async function unfinishedWhereIds(ctx, command44, args) {
10258
+ async function unfinishedWhereIds(ctx, command48, args) {
10081
10259
  const dir = whereDir(ctx.env);
10082
10260
  const identity = argsIdentity(args);
10083
10261
  const workspaceId = ctx.client.workspaceId ?? ctx.auth.workspaceId;
10084
10262
  for (const run of await listRuns(ctx.env)) {
10085
- if (run.command !== command44 || run.status === "done" || run.status === "planned") continue;
10263
+ if (run.command !== command48 || run.status === "done" || run.status === "planned") continue;
10086
10264
  if ((run.workspaceId || void 0) !== (workspaceId || void 0) || argsIdentity(run.args) !== identity) continue;
10087
10265
  if (run.inputPath?.startsWith(`${dir}/`) && existsSync5(run.inputPath)) return run.inputPath;
10088
10266
  }
@@ -10228,14 +10406,14 @@ async function idsFromRun(ctx, runId) {
10228
10406
  return { ...idItems(ids2), source: "run" };
10229
10407
  }
10230
10408
  async function collectIds(ctx, flags, kind, dryRun2) {
10231
- const command44 = `kenso contacts ${kind}`;
10409
+ const command48 = `kenso contacts ${kind}`;
10232
10410
  const ids2 = stringFlag2(flags, "ids");
10233
10411
  const where = kind === "restore" ? void 0 : stringFlag2(flags, "where");
10234
10412
  const run = kind === "restore" ? stringFlag2(flags, "run") : void 0;
10235
10413
  const given = [ids2, where, run].filter((v) => v !== void 0).length;
10236
10414
  if (given !== 1) {
10237
10415
  const choices = kind === "restore" ? "--ids <file|-> or --run <runId>" : "--ids <file|-> or --where '<json>'";
10238
- throw usageError(`${command44} needs exactly one of ${choices}.`, { field: "ids", next: `${command44} --help` });
10416
+ throw usageError(`${command48} needs exactly one of ${choices}.`, { field: "ids", next: `${command48} --help` });
10239
10417
  }
10240
10418
  if (ids2 !== void 0) return idsFromFile(ctx, ids2);
10241
10419
  if (where !== void 0) return idsFromWhere(ctx, kind, flags, where, dryRun2);
@@ -10537,7 +10715,7 @@ async function download(ctx, job, exportId, out) {
10537
10715
  }
10538
10716
  return { rows: countRows(body), path };
10539
10717
  }
10540
- var COMMAND4, JOB_TYPE, DEFAULT_TIMEOUT2, CONTENT_PATH, command13, export_default;
10718
+ var COMMAND4, JOB_TYPE, DEFAULT_TIMEOUT2, CONTENT_PATH, command17, export_default;
10541
10719
  var init_export = __esm({
10542
10720
  "src/commands/contacts/export.ts"() {
10543
10721
  "use strict";
@@ -10552,7 +10730,7 @@ var init_export = __esm({
10552
10730
  JOB_TYPE = "contact_export";
10553
10731
  DEFAULT_TIMEOUT2 = "30m";
10554
10732
  CONTENT_PATH = /\/v1\/contact-exports\/([0-9]+)\/content/;
10555
- command13 = {
10733
+ command17 = {
10556
10734
  resource: "contacts",
10557
10735
  action: "export",
10558
10736
  summary: "Export a campaign's contacts to CSV (a segment: contact-exports create)",
@@ -10610,7 +10788,7 @@ var init_export = __esm({
10610
10788
  return ExitCode.Ok;
10611
10789
  }
10612
10790
  };
10613
- export_default = command13;
10791
+ export_default = command17;
10614
10792
  }
10615
10793
  });
10616
10794
 
@@ -10734,7 +10912,7 @@ function unknown(words) {
10734
10912
  next: "kenso describe"
10735
10913
  });
10736
10914
  }
10737
- var command14, describe_default;
10915
+ var command18, describe_default;
10738
10916
  var init_describe = __esm({
10739
10917
  "src/commands/describe/describe.ts"() {
10740
10918
  "use strict";
@@ -10747,7 +10925,7 @@ var init_describe = __esm({
10747
10925
  init_manifest();
10748
10926
  init_help();
10749
10927
  init_registry();
10750
- command14 = {
10928
+ command18 = {
10751
10929
  resource: "describe",
10752
10930
  action: "",
10753
10931
  summary: "The command map as JSON: commands, flags, body schemas",
@@ -10788,7 +10966,7 @@ var init_describe = __esm({
10788
10966
  return ExitCode.Ok;
10789
10967
  }
10790
10968
  };
10791
- describe_default = command14;
10969
+ describe_default = command18;
10792
10970
  }
10793
10971
  });
10794
10972
 
@@ -10812,7 +10990,7 @@ function findTopic(input) {
10812
10990
  const name = input.trim().toLowerCase().replace(/\.md$/, "");
10813
10991
  return TOPICS.find((t) => t.topic === name);
10814
10992
  }
10815
- var NAMES, command15, docs_default;
10993
+ var NAMES, command19, docs_default;
10816
10994
  var init_docs = __esm({
10817
10995
  "src/commands/docs/docs.ts"() {
10818
10996
  "use strict";
@@ -10820,7 +10998,7 @@ var init_docs = __esm({
10820
10998
  init_exit_codes();
10821
10999
  init_content();
10822
11000
  NAMES = TOPICS.map((t) => t.topic).join(", ");
10823
- command15 = {
11001
+ command19 = {
10824
11002
  resource: "docs",
10825
11003
  action: "",
10826
11004
  summary: "Offline docs: the topic list, or one topic",
@@ -10861,7 +11039,7 @@ var init_docs = __esm({
10861
11039
  return ExitCode.Ok;
10862
11040
  }
10863
11041
  };
10864
- docs_default = command15;
11042
+ docs_default = command19;
10865
11043
  }
10866
11044
  });
10867
11045
 
@@ -10899,7 +11077,7 @@ function configCheck(env) {
10899
11077
  const octal = mode.toString(8).padStart(4, "0");
10900
11078
  return mode === 384 ? { name: "config_permissions", ok: true, detail: `${file} is ${octal}` } : { name: "config_permissions", ok: false, detail: `${file} is ${octal}: run chmod 600 ${file}` };
10901
11079
  }
10902
- var MIN_NODE_MAJOR, command16, actions10;
11080
+ var MIN_NODE_MAJOR, command20, actions10;
10903
11081
  var init_doctor = __esm({
10904
11082
  "src/commands/doctor/index.ts"() {
10905
11083
  "use strict";
@@ -10908,7 +11086,7 @@ var init_doctor = __esm({
10908
11086
  init_exit_codes();
10909
11087
  init_http();
10910
11088
  MIN_NODE_MAJOR = 22;
10911
- command16 = {
11089
+ command20 = {
10912
11090
  resource: "doctor",
10913
11091
  action: "",
10914
11092
  summary: "Check Node, the config, the API and the key",
@@ -10973,7 +11151,7 @@ var init_doctor = __esm({
10973
11151
  }
10974
11152
  };
10975
11153
  actions10 = {
10976
- "": async () => command16
11154
+ "": async () => command20
10977
11155
  };
10978
11156
  }
10979
11157
  });
@@ -11016,7 +11194,7 @@ function readable(row) {
11016
11194
  const parts2 = [time, `[${row.status}]`, row.method, row.pathTemplate, row.errorCode, `${row.durationMs}ms`, row.apiKeyId, row.requestId];
11017
11195
  return parts2.filter((p) => p !== void 0 && p !== "").join(" ");
11018
11196
  }
11019
- var MIN_INTERVAL_MS, MAX_INTERVAL_MS, MAX_SINCE_MS, OVERLAP_MS, MAX_PAGES, RATE_LIMITED_WAIT_MS, isOwnPoll, pad, command17, tail_default;
11197
+ var MIN_INTERVAL_MS, MAX_INTERVAL_MS, MAX_SINCE_MS, OVERLAP_MS, MAX_PAGES, RATE_LIMITED_WAIT_MS, isOwnPoll, pad, command21, tail_default;
11020
11198
  var init_tail = __esm({
11021
11199
  "src/commands/logs/tail.ts"() {
11022
11200
  "use strict";
@@ -11032,7 +11210,7 @@ var init_tail = __esm({
11032
11210
  RATE_LIMITED_WAIT_MS = 3e4;
11033
11211
  isOwnPoll = (row) => row.method === "GET" && row.pathTemplate === "/v1/api-requests" && row.userAgent?.startsWith("kenso-cli/") === true;
11034
11212
  pad = (n) => String(n).padStart(2, "0");
11035
- command17 = {
11213
+ command21 = {
11036
11214
  resource: "logs",
11037
11215
  action: "tail",
11038
11216
  summary: "Stream your workspace's new API request log rows",
@@ -11138,7 +11316,7 @@ var init_tail = __esm({
11138
11316
  return ExitCode.Ok;
11139
11317
  }
11140
11318
  };
11141
- tail_default = command17;
11319
+ tail_default = command21;
11142
11320
  }
11143
11321
  });
11144
11322
 
@@ -11183,7 +11361,7 @@ function writeRaw(ctx, text3) {
11183
11361
  ctx.output.writeRaw(text3.endsWith("\n") ? text3 : `${text3}
11184
11362
  `);
11185
11363
  }
11186
- var init_connect = __esm({
11364
+ var init_connect2 = __esm({
11187
11365
  "src/commands/mcp/connect.ts"() {
11188
11366
  "use strict";
11189
11367
  init_errors();
@@ -11203,15 +11381,15 @@ function isRecord6(value) {
11203
11381
  function textOf(result) {
11204
11382
  return (result.content ?? []).filter((part) => part.type === "text" && typeof part.text === "string").map((part) => part.text).join("\n");
11205
11383
  }
11206
- var command18, call_default;
11384
+ var command22, call_default;
11207
11385
  var init_call = __esm({
11208
11386
  "src/commands/mcp/call.ts"() {
11209
11387
  "use strict";
11210
11388
  init_errors();
11211
11389
  init_exit_codes();
11212
11390
  init_input();
11213
- init_connect();
11214
- command18 = {
11391
+ init_connect2();
11392
+ command22 = {
11215
11393
  resource: "mcp",
11216
11394
  action: "call",
11217
11395
  summary: "Call a hosted Kenso MCP tool, such as list_skills",
@@ -11264,7 +11442,7 @@ var init_call = __esm({
11264
11442
  return ExitCode.Ok;
11265
11443
  }
11266
11444
  };
11267
- call_default = command18;
11445
+ call_default = command22;
11268
11446
  }
11269
11447
  });
11270
11448
 
@@ -11273,13 +11451,13 @@ var tools_exports = {};
11273
11451
  __export(tools_exports, {
11274
11452
  default: () => tools_default
11275
11453
  });
11276
- var command19, tools_default;
11454
+ var command23, tools_default;
11277
11455
  var init_tools = __esm({
11278
11456
  "src/commands/mcp/tools.ts"() {
11279
11457
  "use strict";
11280
11458
  init_exit_codes();
11281
- init_connect();
11282
- command19 = {
11459
+ init_connect2();
11460
+ command23 = {
11283
11461
  resource: "mcp",
11284
11462
  action: "tools",
11285
11463
  summary: "List the hosted Kenso MCP's tools",
@@ -11294,7 +11472,7 @@ var init_tools = __esm({
11294
11472
  return ExitCode.Ok;
11295
11473
  }
11296
11474
  };
11297
- tools_default = command19;
11475
+ tools_default = command23;
11298
11476
  }
11299
11477
  });
11300
11478
 
@@ -11315,14 +11493,14 @@ var stage_history_exports = {};
11315
11493
  __export(stage_history_exports, {
11316
11494
  default: () => stage_history_default
11317
11495
  });
11318
- var command20, stage_history_default;
11496
+ var command24, stage_history_default;
11319
11497
  var init_stage_history = __esm({
11320
11498
  "src/commands/opportunities/stage-history.ts"() {
11321
11499
  "use strict";
11322
11500
  init_errors();
11323
11501
  init_exit_codes();
11324
11502
  init_http();
11325
- command20 = {
11503
+ command24 = {
11326
11504
  resource: "opportunities",
11327
11505
  action: "stage-history",
11328
11506
  summary: "Show a deal's stage history: each stage, when, who moved it and how long it sat there",
@@ -11346,7 +11524,7 @@ var init_stage_history = __esm({
11346
11524
  return ExitCode.Ok;
11347
11525
  }
11348
11526
  };
11349
- stage_history_default = command20;
11527
+ stage_history_default = command24;
11350
11528
  }
11351
11529
  });
11352
11530
 
@@ -11432,7 +11610,7 @@ function summarize3(results) {
11432
11610
  }
11433
11611
  return { matched, addedToAccounts, emailFindsQueued };
11434
11612
  }
11435
- var COMMAND5, CHUNK_SIZE6, ALIASES3, PERSON_FIELDS, ACCOUNT_NOT_FOUND, command21, import_default3;
11613
+ var COMMAND5, CHUNK_SIZE6, ALIASES3, PERSON_FIELDS, ACCOUNT_NOT_FOUND, command25, import_default3;
11436
11614
  var init_import3 = __esm({
11437
11615
  "src/commands/people/import.ts"() {
11438
11616
  "use strict";
@@ -11464,7 +11642,7 @@ var init_import3 = __esm({
11464
11642
  };
11465
11643
  PERSON_FIELDS = ["email", "fullName", "firstName", "lastName", "linkedinUrl", "title"];
11466
11644
  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.";
11467
- command21 = {
11645
+ command25 = {
11468
11646
  resource: "people",
11469
11647
  action: "import",
11470
11648
  summary: "Create or match people from a CSV or JSONL file, optionally onto accounts",
@@ -11529,7 +11707,7 @@ var init_import3 = __esm({
11529
11707
  return outcome.exitCode;
11530
11708
  }
11531
11709
  };
11532
- import_default3 = command21;
11710
+ import_default3 = command25;
11533
11711
  }
11534
11712
  });
11535
11713
 
@@ -11549,14 +11727,14 @@ var list_exports = {};
11549
11727
  __export(list_exports, {
11550
11728
  default: () => list_default
11551
11729
  });
11552
- var command22, list_default;
11730
+ var command26, list_default;
11553
11731
  var init_list = __esm({
11554
11732
  "src/commands/runs/list.ts"() {
11555
11733
  "use strict";
11556
11734
  init_runs();
11557
11735
  init_errors();
11558
11736
  init_exit_codes();
11559
- command22 = {
11737
+ command26 = {
11560
11738
  resource: "runs",
11561
11739
  action: "list",
11562
11740
  summary: "List batch runs, newest first (finds an interrupted run)",
@@ -11577,7 +11755,7 @@ var init_list = __esm({
11577
11755
  return ExitCode.Ok;
11578
11756
  }
11579
11757
  };
11580
- list_default = command22;
11758
+ list_default = command26;
11581
11759
  }
11582
11760
  });
11583
11761
 
@@ -11588,7 +11766,7 @@ __export(show_exports, {
11588
11766
  });
11589
11767
  import { existsSync as existsSync6, readFileSync as readFileSync9 } from "node:fs";
11590
11768
  import { join as join12 } from "node:path";
11591
- var FILES, command23, show_default;
11769
+ var FILES, command27, show_default;
11592
11770
  var init_show = __esm({
11593
11771
  "src/commands/runs/show.ts"() {
11594
11772
  "use strict";
@@ -11603,7 +11781,7 @@ var init_show = __esm({
11603
11781
  ["plan", "plan.json"],
11604
11782
  ["summary", "summary.json"]
11605
11783
  ];
11606
- command23 = {
11784
+ command27 = {
11607
11785
  resource: "runs",
11608
11786
  action: "show",
11609
11787
  summary: "Show one batch run and its files",
@@ -11630,7 +11808,7 @@ var init_show = __esm({
11630
11808
  return ExitCode.Ok;
11631
11809
  }
11632
11810
  };
11633
- show_default = command23;
11811
+ show_default = command27;
11634
11812
  }
11635
11813
  });
11636
11814
 
@@ -11689,14 +11867,14 @@ function resumeArgv(run, globals = {}) {
11689
11867
  async function sha256(path) {
11690
11868
  return createHash5("sha256").update(await readFile9(path)).digest("hex");
11691
11869
  }
11692
- var SKIPPED_KEYS, command24, resume_default;
11870
+ var SKIPPED_KEYS, command28, resume_default;
11693
11871
  var init_resume = __esm({
11694
11872
  "src/commands/runs/resume.ts"() {
11695
11873
  "use strict";
11696
11874
  init_runs();
11697
11875
  init_errors();
11698
11876
  SKIPPED_KEYS = /* @__PURE__ */ new Set(["positionals", "yes", "dryRun", "dry-run", "help", "version"]);
11699
- command24 = {
11877
+ command28 = {
11700
11878
  resource: "runs",
11701
11879
  action: "resume",
11702
11880
  summary: "Continue an interrupted batch run (its command with --yes, no dry run)",
@@ -11751,7 +11929,7 @@ var init_resume = __esm({
11751
11929
  }
11752
11930
  }
11753
11931
  };
11754
- resume_default = command24;
11932
+ resume_default = command28;
11755
11933
  }
11756
11934
  });
11757
11935
 
@@ -11859,7 +12037,7 @@ var create_exports = {};
11859
12037
  __export(create_exports, {
11860
12038
  default: () => create_default
11861
12039
  });
11862
- var command25, create_default;
12040
+ var command29, create_default;
11863
12041
  var init_create = __esm({
11864
12042
  "src/commands/sandbox/create.ts"() {
11865
12043
  "use strict";
@@ -11867,7 +12045,7 @@ var init_create = __esm({
11867
12045
  init_exit_codes();
11868
12046
  init_http();
11869
12047
  init_shared();
11870
- command25 = {
12048
+ command29 = {
11871
12049
  resource: "sandbox",
11872
12050
  action: "create",
11873
12051
  summary: "Create your developer sandbox and save its test key as the sandbox profile",
@@ -11909,7 +12087,7 @@ var init_create = __esm({
11909
12087
  return ExitCode.Ok;
11910
12088
  }
11911
12089
  };
11912
- create_default = command25;
12090
+ create_default = command29;
11913
12091
  }
11914
12092
  });
11915
12093
 
@@ -11918,7 +12096,7 @@ var delete_exports = {};
11918
12096
  __export(delete_exports, {
11919
12097
  default: () => delete_default
11920
12098
  });
11921
- var command26, delete_default;
12099
+ var command30, delete_default;
11922
12100
  var init_delete = __esm({
11923
12101
  "src/commands/sandbox/delete.ts"() {
11924
12102
  "use strict";
@@ -11926,7 +12104,7 @@ var init_delete = __esm({
11926
12104
  init_confirm();
11927
12105
  init_exit_codes();
11928
12106
  init_shared();
11929
- command26 = {
12107
+ command30 = {
11930
12108
  resource: "sandbox",
11931
12109
  action: "delete",
11932
12110
  summary: "Delete your sandbox and its test keys",
@@ -11953,7 +12131,7 @@ var init_delete = __esm({
11953
12131
  return ExitCode.Ok;
11954
12132
  }
11955
12133
  };
11956
- delete_default = command26;
12134
+ delete_default = command30;
11957
12135
  }
11958
12136
  });
11959
12137
 
@@ -11962,14 +12140,14 @@ var key_exports = {};
11962
12140
  __export(key_exports, {
11963
12141
  default: () => key_default
11964
12142
  });
11965
- var command27, key_default;
12143
+ var command31, key_default;
11966
12144
  var init_key = __esm({
11967
12145
  "src/commands/sandbox/key.ts"() {
11968
12146
  "use strict";
11969
12147
  init_exit_codes();
11970
12148
  init_http();
11971
12149
  init_shared();
11972
- command27 = {
12150
+ command31 = {
11973
12151
  resource: "sandbox",
11974
12152
  action: "key",
11975
12153
  summary: "Create a new test key for your sandbox and save it as the sandbox profile",
@@ -11989,7 +12167,7 @@ var init_key = __esm({
11989
12167
  return ExitCode.Ok;
11990
12168
  }
11991
12169
  };
11992
- key_default = command27;
12170
+ key_default = command31;
11993
12171
  }
11994
12172
  });
11995
12173
 
@@ -11998,13 +12176,13 @@ var list_exports2 = {};
11998
12176
  __export(list_exports2, {
11999
12177
  default: () => list_default2
12000
12178
  });
12001
- var command28, list_default2;
12179
+ var command32, list_default2;
12002
12180
  var init_list2 = __esm({
12003
12181
  "src/commands/sandbox/list.ts"() {
12004
12182
  "use strict";
12005
12183
  init_exit_codes();
12006
12184
  init_shared();
12007
- command28 = {
12185
+ command32 = {
12008
12186
  resource: "sandbox",
12009
12187
  action: "list",
12010
12188
  summary: "List your developer sandbox",
@@ -12020,7 +12198,7 @@ var init_list2 = __esm({
12020
12198
  return ExitCode.Ok;
12021
12199
  }
12022
12200
  };
12023
- list_default2 = command28;
12201
+ list_default2 = command32;
12024
12202
  }
12025
12203
  });
12026
12204
 
@@ -12029,14 +12207,14 @@ var reset_exports = {};
12029
12207
  __export(reset_exports, {
12030
12208
  default: () => reset_default
12031
12209
  });
12032
- var command29, reset_default;
12210
+ var command33, reset_default;
12033
12211
  var init_reset = __esm({
12034
12212
  "src/commands/sandbox/reset.ts"() {
12035
12213
  "use strict";
12036
12214
  init_exit_codes();
12037
12215
  init_http();
12038
12216
  init_shared();
12039
- command29 = {
12217
+ command33 = {
12040
12218
  resource: "sandbox",
12041
12219
  action: "reset",
12042
12220
  summary: "Reset your sandbox to its seed data",
@@ -12054,7 +12232,7 @@ var init_reset = __esm({
12054
12232
  return ExitCode.Ok;
12055
12233
  }
12056
12234
  };
12057
- reset_default = command29;
12235
+ reset_default = command33;
12058
12236
  }
12059
12237
  });
12060
12238
 
@@ -12314,7 +12492,7 @@ __export(pull_exports, {
12314
12492
  });
12315
12493
  import { mkdir, writeFile as writeFile4 } from "node:fs/promises";
12316
12494
  import { dirname as dirname2, resolve as resolve11 } from "node:path";
12317
- var command30, pull_default;
12495
+ var command34, pull_default;
12318
12496
  var init_pull = __esm({
12319
12497
  "src/commands/studio/pull.ts"() {
12320
12498
  "use strict";
@@ -12324,7 +12502,7 @@ var init_pull = __esm({
12324
12502
  init_common2();
12325
12503
  init_folder();
12326
12504
  init_transfer();
12327
- command30 = {
12505
+ command34 = {
12328
12506
  resource: "studio",
12329
12507
  action: "pull",
12330
12508
  summary: "Write a template version's files to a folder",
@@ -12371,7 +12549,7 @@ var init_pull = __esm({
12371
12549
  return ExitCode.Ok;
12372
12550
  }
12373
12551
  };
12374
- pull_default = command30;
12552
+ pull_default = command34;
12375
12553
  }
12376
12554
  });
12377
12555
 
@@ -12404,7 +12582,7 @@ var push_exports = {};
12404
12582
  __export(push_exports, {
12405
12583
  default: () => push_default
12406
12584
  });
12407
- var BUILT_BY, DEFAULT_MESSAGE, command31, push_default;
12585
+ var BUILT_BY, DEFAULT_MESSAGE, command35, push_default;
12408
12586
  var init_push = __esm({
12409
12587
  "src/commands/studio/push.ts"() {
12410
12588
  "use strict";
@@ -12416,7 +12594,7 @@ var init_push = __esm({
12416
12594
  init_read();
12417
12595
  BUILT_BY = "customer_agent";
12418
12596
  DEFAULT_MESSAGE = "Pushed with the Kenso CLI";
12419
- command31 = {
12597
+ command35 = {
12420
12598
  resource: "studio",
12421
12599
  action: "push",
12422
12600
  summary: "Save a folder's files to a template's draft and print the validation",
@@ -12508,7 +12686,7 @@ var init_push = __esm({
12508
12686
  );
12509
12687
  }
12510
12688
  };
12511
- push_default = command31;
12689
+ push_default = command35;
12512
12690
  }
12513
12691
  });
12514
12692
 
@@ -12517,7 +12695,7 @@ var validate_exports = {};
12517
12695
  __export(validate_exports, {
12518
12696
  default: () => validate_default
12519
12697
  });
12520
- var command32, validate_default;
12698
+ var command36, validate_default;
12521
12699
  var init_validate = __esm({
12522
12700
  "src/commands/studio/validate.ts"() {
12523
12701
  "use strict";
@@ -12526,7 +12704,7 @@ var init_validate = __esm({
12526
12704
  init_columns();
12527
12705
  init_common2();
12528
12706
  init_read();
12529
- command32 = {
12707
+ command36 = {
12530
12708
  resource: "studio",
12531
12709
  action: "validate",
12532
12710
  summary: "Validate a folder's files against a template without saving them",
@@ -12555,7 +12733,7 @@ var init_validate = __esm({
12555
12733
  throw validationFailed(validation, "The files have validation errors", commandLine2(ctx, "studio validate", args));
12556
12734
  }
12557
12735
  };
12558
- validate_default = command32;
12736
+ validate_default = command36;
12559
12737
  }
12560
12738
  });
12561
12739
 
@@ -12604,7 +12782,7 @@ function accountIds(value) {
12604
12782
  }
12605
12783
  return ids2.map(Number);
12606
12784
  }
12607
- var SHOWN, command33, preview_default;
12785
+ var SHOWN, command37, preview_default;
12608
12786
  var init_preview = __esm({
12609
12787
  "src/commands/studio/preview.ts"() {
12610
12788
  "use strict";
@@ -12616,7 +12794,7 @@ var init_preview = __esm({
12616
12794
  init_common2();
12617
12795
  init_folder();
12618
12796
  SHOWN = 5;
12619
- command33 = {
12797
+ command37 = {
12620
12798
  resource: "studio",
12621
12799
  action: "preview",
12622
12800
  summary: "Render a saved version for up to 3 accounts; for local edits, studio push them to the draft first",
@@ -12665,7 +12843,7 @@ var init_preview = __esm({
12665
12843
  return ExitCode.Ok;
12666
12844
  }
12667
12845
  };
12668
- preview_default = command33;
12846
+ preview_default = command37;
12669
12847
  }
12670
12848
  });
12671
12849
 
@@ -12866,7 +13044,7 @@ function estimateOutput(templateId, target, estimate2) {
12866
13044
  ...target.campaignId !== void 0 ? { estimateNote: "An upper bound: it counts one page per lead, and a campaign run builds one page per company." } : {}
12867
13045
  };
12868
13046
  }
12869
- var COMMAND6, sha2562, command34, fill_default;
13047
+ var COMMAND6, sha2562, command38, fill_default;
12870
13048
  var init_fill = __esm({
12871
13049
  "src/commands/studio/fill.ts"() {
12872
13050
  "use strict";
@@ -12882,7 +13060,7 @@ var init_fill = __esm({
12882
13060
  init_fill_runs();
12883
13061
  COMMAND6 = "studio fill";
12884
13062
  sha2562 = (data) => createHash8("sha256").update(data).digest("hex");
12885
- command34 = {
13063
+ command38 = {
12886
13064
  resource: "studio",
12887
13065
  action: "fill",
12888
13066
  summary: "Fill a template on many accounts or campaign leads (estimate first)",
@@ -12942,7 +13120,7 @@ var init_fill = __esm({
12942
13120
  return outcome.exitCode;
12943
13121
  }
12944
13122
  };
12945
- fill_default = command34;
13123
+ fill_default = command38;
12946
13124
  }
12947
13125
  });
12948
13126
 
@@ -13093,7 +13271,7 @@ function readBody(req) {
13093
13271
  function reply(res, status, body) {
13094
13272
  res.writeHead(status, { "content-type": "application/json" }).end(JSON.stringify(body));
13095
13273
  }
13096
- var MIN_POLL_MS, MAX_POLL_MS, MAX_TRIGGER_BYTES, command35, listen_default;
13274
+ var MIN_POLL_MS, MAX_POLL_MS, MAX_TRIGGER_BYTES, command39, listen_default;
13097
13275
  var init_listen = __esm({
13098
13276
  "src/commands/webhooks/listen.ts"() {
13099
13277
  "use strict";
@@ -13104,7 +13282,7 @@ var init_listen = __esm({
13104
13282
  MIN_POLL_MS = 1e3;
13105
13283
  MAX_POLL_MS = 6e4;
13106
13284
  MAX_TRIGGER_BYTES = 1e6;
13107
- command35 = {
13285
+ command39 = {
13108
13286
  resource: "webhooks",
13109
13287
  action: "listen",
13110
13288
  summary: "Stream the workspace's events and forward them, signed, to a local handler",
@@ -13210,7 +13388,7 @@ var init_listen = __esm({
13210
13388
  return ExitCode.Ok;
13211
13389
  }
13212
13390
  };
13213
- listen_default = command35;
13391
+ listen_default = command39;
13214
13392
  }
13215
13393
  });
13216
13394
 
@@ -13229,7 +13407,7 @@ function notRunning() {
13229
13407
  next: LISTEN_NEXT
13230
13408
  });
13231
13409
  }
13232
- var LISTEN_NEXT, command36, trigger_default;
13410
+ var LISTEN_NEXT, command40, trigger_default;
13233
13411
  var init_trigger = __esm({
13234
13412
  "src/commands/webhooks/trigger.ts"() {
13235
13413
  "use strict";
@@ -13238,7 +13416,7 @@ var init_trigger = __esm({
13238
13416
  init_http();
13239
13417
  init_local();
13240
13418
  LISTEN_NEXT = "kenso webhooks listen --forward-to http://localhost:3000/hook";
13241
- command36 = {
13419
+ command40 = {
13242
13420
  resource: "webhooks",
13243
13421
  action: "trigger",
13244
13422
  summary: "Send a sample event of one type through the running kenso webhooks listen",
@@ -13295,7 +13473,7 @@ var init_trigger = __esm({
13295
13473
  return ExitCode.Ok;
13296
13474
  }
13297
13475
  };
13298
- trigger_default = command36;
13476
+ trigger_default = command40;
13299
13477
  }
13300
13478
  });
13301
13479
 
@@ -13499,14 +13677,14 @@ var status_exports3 = {};
13499
13677
  __export(status_exports3, {
13500
13678
  default: () => status_default3
13501
13679
  });
13502
- var command37, status_default3;
13680
+ var command41, status_default3;
13503
13681
  var init_status3 = __esm({
13504
13682
  "src/commands/work/status.ts"() {
13505
13683
  "use strict";
13506
13684
  init_exit_codes();
13507
13685
  init_http();
13508
13686
  init_common3();
13509
- command37 = {
13687
+ command41 = {
13510
13688
  resource: "work",
13511
13689
  action: "status",
13512
13690
  summary: "Show the Kenso AI work waiting for your own agent, per kind",
@@ -13540,7 +13718,7 @@ var init_status3 = __esm({
13540
13718
  return ExitCode.Ok;
13541
13719
  }
13542
13720
  };
13543
- status_default3 = command37;
13721
+ status_default3 = command41;
13544
13722
  }
13545
13723
  });
13546
13724
 
@@ -13672,9 +13850,9 @@ var init_files = __esm({
13672
13850
  import { execFile, spawnSync as spawnSync2 } from "node:child_process";
13673
13851
  import { readFileSync as readFileSync12 } from "node:fs";
13674
13852
  import { isAbsolute as isAbsolute2 } from "node:path";
13675
- function sudoArgs(user, command44, args, keep = [], set = {}) {
13853
+ function sudoArgs(user, command48, args, keep = [], set = {}) {
13676
13854
  const assignments = Object.entries(set).map(([name, value]) => `${name}=${value}`);
13677
- return ["-n", "-u", user, "-H", ...keep.length > 0 ? [`--preserve-env=${keep.join(",")}`] : [], ...assignments, "--", command44, ...args];
13855
+ return ["-n", "-u", user, "-H", ...keep.length > 0 ? [`--preserve-env=${keep.join(",")}`] : [], ...assignments, "--", command48, ...args];
13678
13856
  }
13679
13857
  function agentKensoEnv(opts) {
13680
13858
  return {
@@ -13684,12 +13862,12 @@ function agentKensoEnv(opts) {
13684
13862
  AI_AGENT: opts.agentName
13685
13863
  };
13686
13864
  }
13687
- function sudoExec(user, command44, args, opts = {}) {
13865
+ function sudoExec(user, command48, args, opts = {}) {
13688
13866
  const [sudo = "/usr/bin/sudo", ...lead] = user.sudo;
13689
13867
  return new Promise((resolve16) => {
13690
13868
  execFile(
13691
13869
  sudo,
13692
- [...lead, ...sudoArgs(user.name, command44, args)],
13870
+ [...lead, ...sudoArgs(user.name, command48, args)],
13693
13871
  { env: { PATH: SUDO_PATH }, cwd: "/", timeout: opts.timeoutMs ?? PROBE_TIMEOUT_MS, maxBuffer: opts.maxBuffer ?? 1024 * 1024, encoding: "utf8", windowsHide: true, shell: false },
13694
13872
  (err, stdout, stderr) => {
13695
13873
  const code = err ? err.code : 0;
@@ -13799,9 +13977,9 @@ var init_folder2 = __esm({
13799
13977
  init_redact();
13800
13978
  init_agent_user();
13801
13979
  WorkRunFolder = class {
13802
- constructor(ctx, command44, args, outDir, shared = false) {
13980
+ constructor(ctx, command48, args, outDir, shared = false) {
13803
13981
  this.ctx = ctx;
13804
- this.command = command44;
13982
+ this.command = command48;
13805
13983
  this.args = args;
13806
13984
  this.outDir = outDir;
13807
13985
  this.shared = shared;
@@ -13916,7 +14094,7 @@ var pull_exports2 = {};
13916
14094
  __export(pull_exports2, {
13917
14095
  default: () => pull_default2
13918
14096
  });
13919
- var MAX_FILES, command38, pull_default2;
14097
+ var MAX_FILES, command42, pull_default2;
13920
14098
  var init_pull2 = __esm({
13921
14099
  "src/commands/work/pull.ts"() {
13922
14100
  "use strict";
@@ -13925,7 +14103,7 @@ var init_pull2 = __esm({
13925
14103
  init_common3();
13926
14104
  init_folder2();
13927
14105
  MAX_FILES = 100;
13928
- command38 = {
14106
+ command42 = {
13929
14107
  resource: "work",
13930
14108
  action: "pull",
13931
14109
  summary: "Claim waiting work into local work files, to answer by hand",
@@ -14003,7 +14181,7 @@ var init_pull2 = __esm({
14003
14181
  return interrupted6 ? ExitCode.Interrupted : ExitCode.Ok;
14004
14182
  }
14005
14183
  };
14006
- pull_default2 = command38;
14184
+ pull_default2 = command42;
14007
14185
  }
14008
14186
  });
14009
14187
 
@@ -14145,7 +14323,7 @@ __export(submit_exports, {
14145
14323
  default: () => submit_default
14146
14324
  });
14147
14325
  import { resolve as resolve14 } from "node:path";
14148
- var command39, submit_default;
14326
+ var command43, submit_default;
14149
14327
  var init_submit = __esm({
14150
14328
  "src/commands/work/submit.ts"() {
14151
14329
  "use strict";
@@ -14154,7 +14332,7 @@ var init_submit = __esm({
14154
14332
  init_files();
14155
14333
  init_answers();
14156
14334
  init_common3();
14157
- command39 = {
14335
+ command43 = {
14158
14336
  resource: "work",
14159
14337
  action: "submit",
14160
14338
  summary: "Send answers files to Kenso and write each one's results",
@@ -14186,7 +14364,7 @@ var init_submit = __esm({
14186
14364
  return totals.rejected > 0 ? ExitCode.Partial : ExitCode.Ok;
14187
14365
  }
14188
14366
  };
14189
- submit_default = command39;
14367
+ submit_default = command43;
14190
14368
  }
14191
14369
  });
14192
14370
 
@@ -14207,7 +14385,7 @@ function claimIdOf(arg) {
14207
14385
  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..." });
14208
14386
  return arg;
14209
14387
  }
14210
- var CLAIM_ID, command40, release_default;
14388
+ var CLAIM_ID, command44, release_default;
14211
14389
  var init_release = __esm({
14212
14390
  "src/commands/work/release.ts"() {
14213
14391
  "use strict";
@@ -14216,7 +14394,7 @@ var init_release = __esm({
14216
14394
  init_files();
14217
14395
  init_common3();
14218
14396
  CLAIM_ID = /^[A-Za-z0-9_-]{1,64}$/;
14219
- command40 = {
14397
+ command44 = {
14220
14398
  resource: "work",
14221
14399
  action: "release",
14222
14400
  summary: "Give claimed work back to the queue now",
@@ -14235,7 +14413,7 @@ var init_release = __esm({
14235
14413
  return ExitCode.Ok;
14236
14414
  }
14237
14415
  };
14238
- release_default = command40;
14416
+ release_default = command44;
14239
14417
  }
14240
14418
  });
14241
14419
 
@@ -14574,12 +14752,12 @@ function plain(text3) {
14574
14752
  return text3.replace(/\x1b\[[0-9;?]*[A-Za-z]/g, "");
14575
14753
  }
14576
14754
  function runStatus(bin, args, env, adapter, runAs) {
14577
- const command44 = runAs ? runAs.sudo[0] ?? "/usr/bin/sudo" : bin;
14755
+ const command48 = runAs ? runAs.sudo[0] ?? "/usr/bin/sudo" : bin;
14578
14756
  const commandArgs2 = runAs ? [...runAs.sudo.slice(1), ...sudoArgs(runAs.name, bin, args)] : args;
14579
14757
  const options = runAs ? { env: { PATH: SUDO_PATH }, cwd: "/" } : { env: childEnv(env, adapter) };
14580
14758
  return new Promise((resolve16) => {
14581
14759
  execFile2(
14582
- command44,
14760
+ command48,
14583
14761
  commandArgs2,
14584
14762
  { ...options, timeout: STATUS_TIMEOUT_MS, maxBuffer: 1024 * 1024, windowsHide: true, shell: false },
14585
14763
  (err, stdout, stderr) => {
@@ -15661,7 +15839,7 @@ var run_exports = {};
15661
15839
  __export(run_exports, {
15662
15840
  default: () => run_default
15663
15841
  });
15664
- var FAILURES_IN_A_ROW, command41, run_default;
15842
+ var FAILURES_IN_A_ROW, command45, run_default;
15665
15843
  var init_run = __esm({
15666
15844
  "src/commands/work/run.ts"() {
15667
15845
  "use strict";
@@ -15682,7 +15860,7 @@ var init_run = __esm({
15682
15860
  init_folder2();
15683
15861
  init_stop();
15684
15862
  FAILURES_IN_A_ROW = 3;
15685
- command41 = {
15863
+ command45 = {
15686
15864
  resource: "work",
15687
15865
  action: "run",
15688
15866
  summary: "Run your own coding agent on the waiting work until the queue is empty",
@@ -16007,7 +16185,7 @@ var init_run = __esm({
16007
16185
  return exitCodeFor(reason, totals.rejected > 0 || jobsFailed > 0);
16008
16186
  }
16009
16187
  };
16010
- run_default = command41;
16188
+ run_default = command45;
16011
16189
  }
16012
16190
  });
16013
16191
 
@@ -16040,14 +16218,14 @@ function parseLimit(value) {
16040
16218
  }
16041
16219
  return limit;
16042
16220
  }
16043
- var MAX_LIMIT, command42, list_default3;
16221
+ var MAX_LIMIT, command46, list_default3;
16044
16222
  var init_list3 = __esm({
16045
16223
  "src/commands/workspace/list.ts"() {
16046
16224
  "use strict";
16047
16225
  init_errors();
16048
16226
  init_exit_codes();
16049
16227
  MAX_LIMIT = 200;
16050
- command42 = {
16228
+ command46 = {
16051
16229
  resource: "workspace",
16052
16230
  action: "list",
16053
16231
  summary: "List the workspaces your key can use",
@@ -16075,7 +16253,7 @@ var init_list3 = __esm({
16075
16253
  return ExitCode.Ok;
16076
16254
  }
16077
16255
  };
16078
- list_default3 = command42;
16256
+ list_default3 = command46;
16079
16257
  }
16080
16258
  });
16081
16259
 
@@ -16084,7 +16262,7 @@ var use_exports = {};
16084
16262
  __export(use_exports, {
16085
16263
  default: () => use_default
16086
16264
  });
16087
- var command43, use_default;
16265
+ var command47, use_default;
16088
16266
  var init_use = __esm({
16089
16267
  "src/commands/workspace/use.ts"() {
16090
16268
  "use strict";
@@ -16092,7 +16270,7 @@ var init_use = __esm({
16092
16270
  init_errors();
16093
16271
  init_exit_codes();
16094
16272
  init_http();
16095
- command43 = {
16273
+ command47 = {
16096
16274
  resource: "workspace",
16097
16275
  action: "use",
16098
16276
  summary: "Set the profile's default workspace",
@@ -16149,7 +16327,7 @@ var init_use = __esm({
16149
16327
  return ExitCode.Ok;
16150
16328
  }
16151
16329
  };
16152
- use_default = command43;
16330
+ use_default = command47;
16153
16331
  }
16154
16332
  });
16155
16333
 
@@ -16706,8 +16884,8 @@ function startUpdateNotice(argv, opts = {}) {
16706
16884
  if (!found) return;
16707
16885
  writeCheck(file, { checkedAt: new Date(now).toISOString(), latest: found });
16708
16886
  if (isNewer(found, version)) {
16709
- const command44 = updateCommand(install, opts.platform ?? process.platform);
16710
- stderr.write(`kenso ${found} is out (you have ${version}): ${command44}
16887
+ const command48 = updateCommand(install, opts.platform ?? process.platform);
16888
+ stderr.write(`kenso ${found} is out (you have ${version}): ${command48}
16711
16889
  Turn this off with KENSO_NO_UPDATE_NOTIFIER=1.
16712
16890
  `);
16713
16891
  }