kenso 0.1.80 → 0.1.81

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.81" : "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: command52, 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 command52 !== "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: command52,
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(command52, 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 === command52 && (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, command52, args, extra = []) {
7455
+ const parts2 = ["kenso", ...command52.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| `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## 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: (command52, args) => {
8980
+ const child = nodeSpawn(command52, 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: (command52, args) => {
10170
+ const child = nodeSpawn2(command52, 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, command52, 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 ${command52}.`, { field: name, next: `${command52} --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, command52) {
10223
+ const raw = requireFlag(flags, name, command52);
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(command52, flags, ctx, extra = []) {
10244
+ const parts2 = [command52];
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, command52, 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 !== command52 || 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 command52 = `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(`${command52} needs exactly one of ${choices}.`, { field: "ids", next: `${command52} --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);
@@ -12925,12 +12925,102 @@ var init_people = __esm({
12925
12925
  }
12926
12926
  });
12927
12927
 
12928
+ // src/commands/pipelines/stage-rules.ts
12929
+ var stage_rules_exports = {};
12930
+ __export(stage_rules_exports, {
12931
+ default: () => stage_rules_default
12932
+ });
12933
+ function rule(stage) {
12934
+ return {
12935
+ key: stage.key,
12936
+ label: stage.label,
12937
+ category: stage.category,
12938
+ isArchived: stage.isArchived,
12939
+ requiredFields: stage.requiredFields,
12940
+ isDefault: stage.isDefaultRequiredFields
12941
+ };
12942
+ }
12943
+ var command27, stage_rules_default;
12944
+ var init_stage_rules = __esm({
12945
+ "src/commands/pipelines/stage-rules.ts"() {
12946
+ "use strict";
12947
+ init_errors();
12948
+ init_exit_codes();
12949
+ init_http();
12950
+ command27 = {
12951
+ resource: "pipelines",
12952
+ action: "stage-rules",
12953
+ summary: "List or set the fields a deal should have in each stage",
12954
+ 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.",
12955
+ flags: {
12956
+ require: { type: "string", description: "Comma-separated field ids the stage requires, in order (amount,closeDate,custom.tier)" },
12957
+ default: { type: "boolean", description: "Put the stage back on the default rule" },
12958
+ none: { type: "boolean", description: "Require nothing in the stage" }
12959
+ },
12960
+ positionals: [{ name: "stage", description: "The stage key to set (kenso pipelines stage-rules lists them)" }],
12961
+ examples: [
12962
+ "kenso pipelines stage-rules",
12963
+ "kenso pipelines stage-rules proposal --require amount,closeDate",
12964
+ "kenso pipelines stage-rules lost --default"
12965
+ ],
12966
+ beta: { featureGates: { all: ["opportunities", "deal_stage_rules"] } },
12967
+ operationIds: ["opportunity-stages.list", "opportunity-stages.set-required-fields"],
12968
+ async run(ctx, { flags, positionals }) {
12969
+ const stage = (positionals[0] ?? "").trim();
12970
+ const require2 = typeof flags.require === "string" ? flags.require : void 0;
12971
+ const chosen = [require2 !== void 0, flags.default === true, flags.none === true].filter(Boolean).length;
12972
+ const next = "kenso pipelines stage-rules <stage> --require amount,closeDate";
12973
+ if (!stage) {
12974
+ if (chosen > 0) throw usageError("Name the stage to set: kenso pipelines stage-rules <stage> ...", { field: "stage", next });
12975
+ const res2 = await ctx.client.request({ method: "GET", path: "/v1/opportunity-stages", signal: ctx.signal });
12976
+ const data = unwrap(res2.body);
12977
+ if (!data.requirableFields) {
12978
+ throw usageError("Stage rules are off in this workspace (the deal_stage_rules flag).", { hint: "Ask Kenso support to turn them on." });
12979
+ }
12980
+ ctx.output.object({ requirableFields: data.requirableFields, stages: (data.items ?? []).map(rule) });
12981
+ return ExitCode.Ok;
12982
+ }
12983
+ if (!/^[a-z][a-z0-9_]{0,62}$/.test(stage)) {
12984
+ throw usageError(`"${stage}" is not a stage key. Read the keys with kenso pipelines stage-rules.`, { field: "stage", next });
12985
+ }
12986
+ if (chosen !== 1) {
12987
+ throw usageError("Pass exactly one of --require <fields>, --default or --none.", { field: "require", next });
12988
+ }
12989
+ const fields = require2 === void 0 ? flags.none === true ? [] : null : require2.split(",").map((f) => f.trim()).filter(Boolean);
12990
+ if (fields?.length === 0 && require2 !== void 0) {
12991
+ throw usageError("--require names no field. Pass the field ids, --none to require nothing, or --default.", { field: "require", next });
12992
+ }
12993
+ const res = await ctx.client.request({
12994
+ method: "PUT",
12995
+ path: `/v1/opportunity-stages/${stage}/required-fields`,
12996
+ body: { fields },
12997
+ signal: ctx.signal
12998
+ });
12999
+ ctx.output.object(rule(unwrap(res.body)));
13000
+ return ExitCode.Ok;
13001
+ }
13002
+ };
13003
+ stage_rules_default = command27;
13004
+ }
13005
+ });
13006
+
13007
+ // src/commands/pipelines/index.ts
13008
+ var actions18;
13009
+ var init_pipelines = __esm({
13010
+ "src/commands/pipelines/index.ts"() {
13011
+ "use strict";
13012
+ actions18 = {
13013
+ "stage-rules": () => Promise.resolve().then(() => (init_stage_rules(), stage_rules_exports)).then((m) => m.default)
13014
+ };
13015
+ }
13016
+ });
13017
+
12928
13018
  // src/commands/reports/run.ts
12929
13019
  var run_exports2 = {};
12930
13020
  __export(run_exports2, {
12931
13021
  default: () => run_default
12932
13022
  });
12933
- var REPORTS, command27, run_default;
13023
+ var REPORTS, command28, run_default;
12934
13024
  var init_run2 = __esm({
12935
13025
  "src/commands/reports/run.ts"() {
12936
13026
  "use strict";
@@ -12938,7 +13028,7 @@ var init_run2 = __esm({
12938
13028
  init_exit_codes();
12939
13029
  init_http();
12940
13030
  REPORTS = ["pipeline_by_stage", "won_by_month", "stage_conversion", "time_in_stage", "won_by_source_campaign", "activity_by_member"];
12941
- command27 = {
13031
+ command28 = {
12942
13032
  resource: "reports",
12943
13033
  action: "run",
12944
13034
  summary: "Run a stock pipeline report and print its table",
@@ -13000,7 +13090,7 @@ var init_run2 = __esm({
13000
13090
  return ExitCode.Ok;
13001
13091
  }
13002
13092
  };
13003
- run_default = command27;
13093
+ run_default = command28;
13004
13094
  }
13005
13095
  });
13006
13096
 
@@ -13009,14 +13099,14 @@ var summary_exports = {};
13009
13099
  __export(summary_exports, {
13010
13100
  default: () => summary_default
13011
13101
  });
13012
- var command28, summary_default;
13102
+ var command29, summary_default;
13013
13103
  var init_summary = __esm({
13014
13104
  "src/commands/reports/summary.ts"() {
13015
13105
  "use strict";
13016
13106
  init_errors();
13017
13107
  init_exit_codes();
13018
13108
  init_http();
13019
- command28 = {
13109
+ command29 = {
13020
13110
  resource: "reports",
13021
13111
  action: "summary",
13022
13112
  summary: "Read where the period stands and what needs you",
@@ -13071,16 +13161,16 @@ var init_summary = __esm({
13071
13161
  return ExitCode.Ok;
13072
13162
  }
13073
13163
  };
13074
- summary_default = command28;
13164
+ summary_default = command29;
13075
13165
  }
13076
13166
  });
13077
13167
 
13078
13168
  // src/commands/reports/index.ts
13079
- var actions18;
13169
+ var actions19;
13080
13170
  var init_reports = __esm({
13081
13171
  "src/commands/reports/index.ts"() {
13082
13172
  "use strict";
13083
- actions18 = {
13173
+ actions19 = {
13084
13174
  run: () => Promise.resolve().then(() => (init_run2(), run_exports2)).then((m) => m.default),
13085
13175
  summary: () => Promise.resolve().then(() => (init_summary(), summary_exports)).then((m) => m.default)
13086
13176
  };
@@ -13092,14 +13182,14 @@ var list_exports = {};
13092
13182
  __export(list_exports, {
13093
13183
  default: () => list_default
13094
13184
  });
13095
- var command29, list_default;
13185
+ var command30, list_default;
13096
13186
  var init_list = __esm({
13097
13187
  "src/commands/runs/list.ts"() {
13098
13188
  "use strict";
13099
13189
  init_runs();
13100
13190
  init_errors();
13101
13191
  init_exit_codes();
13102
- command29 = {
13192
+ command30 = {
13103
13193
  resource: "runs",
13104
13194
  action: "list",
13105
13195
  summary: "List batch runs, newest first (finds an interrupted run)",
@@ -13120,7 +13210,7 @@ var init_list = __esm({
13120
13210
  return ExitCode.Ok;
13121
13211
  }
13122
13212
  };
13123
- list_default = command29;
13213
+ list_default = command30;
13124
13214
  }
13125
13215
  });
13126
13216
 
@@ -13131,7 +13221,7 @@ __export(show_exports2, {
13131
13221
  });
13132
13222
  import { existsSync as existsSync7, readFileSync as readFileSync9 } from "node:fs";
13133
13223
  import { join as join12 } from "node:path";
13134
- var FILES, command30, show_default2;
13224
+ var FILES, command31, show_default2;
13135
13225
  var init_show2 = __esm({
13136
13226
  "src/commands/runs/show.ts"() {
13137
13227
  "use strict";
@@ -13146,7 +13236,7 @@ var init_show2 = __esm({
13146
13236
  ["plan", "plan.json"],
13147
13237
  ["summary", "summary.json"]
13148
13238
  ];
13149
- command30 = {
13239
+ command31 = {
13150
13240
  resource: "runs",
13151
13241
  action: "show",
13152
13242
  summary: "Show one batch run and its files",
@@ -13173,7 +13263,7 @@ var init_show2 = __esm({
13173
13263
  return ExitCode.Ok;
13174
13264
  }
13175
13265
  };
13176
- show_default2 = command30;
13266
+ show_default2 = command31;
13177
13267
  }
13178
13268
  });
13179
13269
 
@@ -13232,14 +13322,14 @@ function resumeArgv(run, globals = {}) {
13232
13322
  async function sha256(path) {
13233
13323
  return createHash5("sha256").update(await readFile9(path)).digest("hex");
13234
13324
  }
13235
- var SKIPPED_KEYS, command31, resume_default;
13325
+ var SKIPPED_KEYS, command32, resume_default;
13236
13326
  var init_resume = __esm({
13237
13327
  "src/commands/runs/resume.ts"() {
13238
13328
  "use strict";
13239
13329
  init_runs();
13240
13330
  init_errors();
13241
13331
  SKIPPED_KEYS = /* @__PURE__ */ new Set(["positionals", "yes", "dryRun", "dry-run", "help", "version"]);
13242
- command31 = {
13332
+ command32 = {
13243
13333
  resource: "runs",
13244
13334
  action: "resume",
13245
13335
  summary: "Continue an interrupted batch run (its command with --yes, no dry run)",
@@ -13294,16 +13384,16 @@ var init_resume = __esm({
13294
13384
  }
13295
13385
  }
13296
13386
  };
13297
- resume_default = command31;
13387
+ resume_default = command32;
13298
13388
  }
13299
13389
  });
13300
13390
 
13301
13391
  // src/commands/runs/index.ts
13302
- var actions19;
13392
+ var actions20;
13303
13393
  var init_runs2 = __esm({
13304
13394
  "src/commands/runs/index.ts"() {
13305
13395
  "use strict";
13306
- actions19 = {
13396
+ actions20 = {
13307
13397
  list: () => Promise.resolve().then(() => (init_list(), list_exports)).then((m) => m.default),
13308
13398
  show: () => Promise.resolve().then(() => (init_show2(), show_exports2)).then((m) => m.default),
13309
13399
  resume: () => Promise.resolve().then(() => (init_resume(), resume_exports)).then((m) => m.default)
@@ -13402,7 +13492,7 @@ var create_exports = {};
13402
13492
  __export(create_exports, {
13403
13493
  default: () => create_default
13404
13494
  });
13405
- var command32, create_default;
13495
+ var command33, create_default;
13406
13496
  var init_create = __esm({
13407
13497
  "src/commands/sandbox/create.ts"() {
13408
13498
  "use strict";
@@ -13410,7 +13500,7 @@ var init_create = __esm({
13410
13500
  init_exit_codes();
13411
13501
  init_http();
13412
13502
  init_shared();
13413
- command32 = {
13503
+ command33 = {
13414
13504
  resource: "sandbox",
13415
13505
  action: "create",
13416
13506
  summary: "Create your developer sandbox and save its test key as the sandbox profile",
@@ -13452,7 +13542,7 @@ var init_create = __esm({
13452
13542
  return ExitCode.Ok;
13453
13543
  }
13454
13544
  };
13455
- create_default = command32;
13545
+ create_default = command33;
13456
13546
  }
13457
13547
  });
13458
13548
 
@@ -13461,7 +13551,7 @@ var delete_exports = {};
13461
13551
  __export(delete_exports, {
13462
13552
  default: () => delete_default
13463
13553
  });
13464
- var command33, delete_default;
13554
+ var command34, delete_default;
13465
13555
  var init_delete = __esm({
13466
13556
  "src/commands/sandbox/delete.ts"() {
13467
13557
  "use strict";
@@ -13469,7 +13559,7 @@ var init_delete = __esm({
13469
13559
  init_confirm();
13470
13560
  init_exit_codes();
13471
13561
  init_shared();
13472
- command33 = {
13562
+ command34 = {
13473
13563
  resource: "sandbox",
13474
13564
  action: "delete",
13475
13565
  summary: "Delete your sandbox and its test keys",
@@ -13496,7 +13586,7 @@ var init_delete = __esm({
13496
13586
  return ExitCode.Ok;
13497
13587
  }
13498
13588
  };
13499
- delete_default = command33;
13589
+ delete_default = command34;
13500
13590
  }
13501
13591
  });
13502
13592
 
@@ -13505,14 +13595,14 @@ var key_exports = {};
13505
13595
  __export(key_exports, {
13506
13596
  default: () => key_default
13507
13597
  });
13508
- var command34, key_default;
13598
+ var command35, key_default;
13509
13599
  var init_key = __esm({
13510
13600
  "src/commands/sandbox/key.ts"() {
13511
13601
  "use strict";
13512
13602
  init_exit_codes();
13513
13603
  init_http();
13514
13604
  init_shared();
13515
- command34 = {
13605
+ command35 = {
13516
13606
  resource: "sandbox",
13517
13607
  action: "key",
13518
13608
  summary: "Create a new test key for your sandbox and save it as the sandbox profile",
@@ -13532,7 +13622,7 @@ var init_key = __esm({
13532
13622
  return ExitCode.Ok;
13533
13623
  }
13534
13624
  };
13535
- key_default = command34;
13625
+ key_default = command35;
13536
13626
  }
13537
13627
  });
13538
13628
 
@@ -13541,13 +13631,13 @@ var list_exports2 = {};
13541
13631
  __export(list_exports2, {
13542
13632
  default: () => list_default2
13543
13633
  });
13544
- var command35, list_default2;
13634
+ var command36, list_default2;
13545
13635
  var init_list2 = __esm({
13546
13636
  "src/commands/sandbox/list.ts"() {
13547
13637
  "use strict";
13548
13638
  init_exit_codes();
13549
13639
  init_shared();
13550
- command35 = {
13640
+ command36 = {
13551
13641
  resource: "sandbox",
13552
13642
  action: "list",
13553
13643
  summary: "List your developer sandbox",
@@ -13563,7 +13653,7 @@ var init_list2 = __esm({
13563
13653
  return ExitCode.Ok;
13564
13654
  }
13565
13655
  };
13566
- list_default2 = command35;
13656
+ list_default2 = command36;
13567
13657
  }
13568
13658
  });
13569
13659
 
@@ -13572,14 +13662,14 @@ var reset_exports = {};
13572
13662
  __export(reset_exports, {
13573
13663
  default: () => reset_default
13574
13664
  });
13575
- var command36, reset_default;
13665
+ var command37, reset_default;
13576
13666
  var init_reset = __esm({
13577
13667
  "src/commands/sandbox/reset.ts"() {
13578
13668
  "use strict";
13579
13669
  init_exit_codes();
13580
13670
  init_http();
13581
13671
  init_shared();
13582
- command36 = {
13672
+ command37 = {
13583
13673
  resource: "sandbox",
13584
13674
  action: "reset",
13585
13675
  summary: "Reset your sandbox to its seed data",
@@ -13597,16 +13687,16 @@ var init_reset = __esm({
13597
13687
  return ExitCode.Ok;
13598
13688
  }
13599
13689
  };
13600
- reset_default = command36;
13690
+ reset_default = command37;
13601
13691
  }
13602
13692
  });
13603
13693
 
13604
13694
  // src/commands/sandbox/index.ts
13605
- var actions20;
13695
+ var actions21;
13606
13696
  var init_sandbox2 = __esm({
13607
13697
  "src/commands/sandbox/index.ts"() {
13608
13698
  "use strict";
13609
- actions20 = {
13699
+ actions21 = {
13610
13700
  create: () => Promise.resolve().then(() => (init_create(), create_exports)).then((m) => m.default),
13611
13701
  delete: () => Promise.resolve().then(() => (init_delete(), delete_exports)).then((m) => m.default),
13612
13702
  key: () => Promise.resolve().then(() => (init_key(), key_exports)).then((m) => m.default),
@@ -13617,11 +13707,11 @@ var init_sandbox2 = __esm({
13617
13707
  });
13618
13708
 
13619
13709
  // src/commands/skill/index.ts
13620
- var actions21;
13710
+ var actions22;
13621
13711
  var init_skill = __esm({
13622
13712
  "src/commands/skill/index.ts"() {
13623
13713
  "use strict";
13624
- actions21 = {
13714
+ actions22 = {
13625
13715
  install: () => Promise.resolve().then(() => (init_install(), install_exports)).then((m) => m.default)
13626
13716
  };
13627
13717
  }
@@ -13857,7 +13947,7 @@ __export(pull_exports, {
13857
13947
  });
13858
13948
  import { mkdir, writeFile as writeFile4 } from "node:fs/promises";
13859
13949
  import { dirname as dirname2, resolve as resolve11 } from "node:path";
13860
- var command37, pull_default;
13950
+ var command38, pull_default;
13861
13951
  var init_pull = __esm({
13862
13952
  "src/commands/studio/pull.ts"() {
13863
13953
  "use strict";
@@ -13867,7 +13957,7 @@ var init_pull = __esm({
13867
13957
  init_common2();
13868
13958
  init_folder();
13869
13959
  init_transfer2();
13870
- command37 = {
13960
+ command38 = {
13871
13961
  resource: "studio",
13872
13962
  action: "pull",
13873
13963
  summary: "Write a template version's files to a folder",
@@ -13914,7 +14004,7 @@ var init_pull = __esm({
13914
14004
  return ExitCode.Ok;
13915
14005
  }
13916
14006
  };
13917
- pull_default = command37;
14007
+ pull_default = command38;
13918
14008
  }
13919
14009
  });
13920
14010
 
@@ -13947,7 +14037,7 @@ var push_exports = {};
13947
14037
  __export(push_exports, {
13948
14038
  default: () => push_default
13949
14039
  });
13950
- var BUILT_BY, DEFAULT_MESSAGE, command38, push_default;
14040
+ var BUILT_BY, DEFAULT_MESSAGE, command39, push_default;
13951
14041
  var init_push = __esm({
13952
14042
  "src/commands/studio/push.ts"() {
13953
14043
  "use strict";
@@ -13959,7 +14049,7 @@ var init_push = __esm({
13959
14049
  init_read();
13960
14050
  BUILT_BY = "customer_agent";
13961
14051
  DEFAULT_MESSAGE = "Pushed with the Kenso CLI";
13962
- command38 = {
14052
+ command39 = {
13963
14053
  resource: "studio",
13964
14054
  action: "push",
13965
14055
  summary: "Save a folder's files to a template's draft and print the validation",
@@ -14051,7 +14141,7 @@ var init_push = __esm({
14051
14141
  );
14052
14142
  }
14053
14143
  };
14054
- push_default = command38;
14144
+ push_default = command39;
14055
14145
  }
14056
14146
  });
14057
14147
 
@@ -14060,7 +14150,7 @@ var validate_exports = {};
14060
14150
  __export(validate_exports, {
14061
14151
  default: () => validate_default
14062
14152
  });
14063
- var command39, validate_default;
14153
+ var command40, validate_default;
14064
14154
  var init_validate = __esm({
14065
14155
  "src/commands/studio/validate.ts"() {
14066
14156
  "use strict";
@@ -14069,7 +14159,7 @@ var init_validate = __esm({
14069
14159
  init_columns();
14070
14160
  init_common2();
14071
14161
  init_read();
14072
- command39 = {
14162
+ command40 = {
14073
14163
  resource: "studio",
14074
14164
  action: "validate",
14075
14165
  summary: "Validate a folder's files against a template without saving them",
@@ -14098,7 +14188,7 @@ var init_validate = __esm({
14098
14188
  throw validationFailed(validation, "The files have validation errors", commandLine2(ctx, "studio validate", args));
14099
14189
  }
14100
14190
  };
14101
- validate_default = command39;
14191
+ validate_default = command40;
14102
14192
  }
14103
14193
  });
14104
14194
 
@@ -14147,7 +14237,7 @@ function accountIds(value) {
14147
14237
  }
14148
14238
  return ids2.map(Number);
14149
14239
  }
14150
- var SHOWN, command40, preview_default;
14240
+ var SHOWN, command41, preview_default;
14151
14241
  var init_preview = __esm({
14152
14242
  "src/commands/studio/preview.ts"() {
14153
14243
  "use strict";
@@ -14159,7 +14249,7 @@ var init_preview = __esm({
14159
14249
  init_common2();
14160
14250
  init_folder();
14161
14251
  SHOWN = 5;
14162
- command40 = {
14252
+ command41 = {
14163
14253
  resource: "studio",
14164
14254
  action: "preview",
14165
14255
  summary: "Render a saved version for up to 3 accounts; for local edits, studio push them to the draft first",
@@ -14208,7 +14298,7 @@ var init_preview = __esm({
14208
14298
  return ExitCode.Ok;
14209
14299
  }
14210
14300
  };
14211
- preview_default = command40;
14301
+ preview_default = command41;
14212
14302
  }
14213
14303
  });
14214
14304
 
@@ -14409,7 +14499,7 @@ function estimateOutput(templateId, target, estimate2) {
14409
14499
  ...target.campaignId !== void 0 ? { estimateNote: "An upper bound: it counts one page per lead, and a campaign run builds one page per company." } : {}
14410
14500
  };
14411
14501
  }
14412
- var COMMAND6, sha2562, command41, fill_default;
14502
+ var COMMAND6, sha2562, command42, fill_default;
14413
14503
  var init_fill = __esm({
14414
14504
  "src/commands/studio/fill.ts"() {
14415
14505
  "use strict";
@@ -14425,7 +14515,7 @@ var init_fill = __esm({
14425
14515
  init_fill_runs();
14426
14516
  COMMAND6 = "studio fill";
14427
14517
  sha2562 = (data) => createHash8("sha256").update(data).digest("hex");
14428
- command41 = {
14518
+ command42 = {
14429
14519
  resource: "studio",
14430
14520
  action: "fill",
14431
14521
  summary: "Fill a template on many accounts or campaign leads (estimate first)",
@@ -14485,16 +14575,16 @@ var init_fill = __esm({
14485
14575
  return outcome.exitCode;
14486
14576
  }
14487
14577
  };
14488
- fill_default = command41;
14578
+ fill_default = command42;
14489
14579
  }
14490
14580
  });
14491
14581
 
14492
14582
  // src/commands/studio/index.ts
14493
- var actions22;
14583
+ var actions23;
14494
14584
  var init_studio2 = __esm({
14495
14585
  "src/commands/studio/index.ts"() {
14496
14586
  "use strict";
14497
- actions22 = {
14587
+ actions23 = {
14498
14588
  pull: () => Promise.resolve().then(() => (init_pull(), pull_exports)).then((m) => m.default),
14499
14589
  push: () => Promise.resolve().then(() => (init_push(), push_exports)).then((m) => m.default),
14500
14590
  validate: () => Promise.resolve().then(() => (init_validate(), validate_exports)).then((m) => m.default),
@@ -14636,7 +14726,7 @@ function readBody(req) {
14636
14726
  function reply(res, status, body2) {
14637
14727
  res.writeHead(status, { "content-type": "application/json" }).end(JSON.stringify(body2));
14638
14728
  }
14639
- var MIN_POLL_MS, MAX_POLL_MS, MAX_TRIGGER_BYTES, command42, listen_default;
14729
+ var MIN_POLL_MS, MAX_POLL_MS, MAX_TRIGGER_BYTES, command43, listen_default;
14640
14730
  var init_listen = __esm({
14641
14731
  "src/commands/webhooks/listen.ts"() {
14642
14732
  "use strict";
@@ -14647,7 +14737,7 @@ var init_listen = __esm({
14647
14737
  MIN_POLL_MS = 1e3;
14648
14738
  MAX_POLL_MS = 6e4;
14649
14739
  MAX_TRIGGER_BYTES = 1e6;
14650
- command42 = {
14740
+ command43 = {
14651
14741
  resource: "webhooks",
14652
14742
  action: "listen",
14653
14743
  summary: "Stream the workspace's events and forward them, signed, to a local handler",
@@ -14753,7 +14843,7 @@ var init_listen = __esm({
14753
14843
  return ExitCode.Ok;
14754
14844
  }
14755
14845
  };
14756
- listen_default = command42;
14846
+ listen_default = command43;
14757
14847
  }
14758
14848
  });
14759
14849
 
@@ -14772,7 +14862,7 @@ function notRunning() {
14772
14862
  next: LISTEN_NEXT
14773
14863
  });
14774
14864
  }
14775
- var LISTEN_NEXT, command43, trigger_default;
14865
+ var LISTEN_NEXT, command44, trigger_default;
14776
14866
  var init_trigger = __esm({
14777
14867
  "src/commands/webhooks/trigger.ts"() {
14778
14868
  "use strict";
@@ -14781,7 +14871,7 @@ var init_trigger = __esm({
14781
14871
  init_http();
14782
14872
  init_local();
14783
14873
  LISTEN_NEXT = "kenso webhooks listen --forward-to http://localhost:3000/hook";
14784
- command43 = {
14874
+ command44 = {
14785
14875
  resource: "webhooks",
14786
14876
  action: "trigger",
14787
14877
  summary: "Send a sample event of one type through the running kenso webhooks listen",
@@ -14838,16 +14928,16 @@ var init_trigger = __esm({
14838
14928
  return ExitCode.Ok;
14839
14929
  }
14840
14930
  };
14841
- trigger_default = command43;
14931
+ trigger_default = command44;
14842
14932
  }
14843
14933
  });
14844
14934
 
14845
14935
  // src/commands/webhooks/index.ts
14846
- var actions23;
14936
+ var actions24;
14847
14937
  var init_webhooks2 = __esm({
14848
14938
  "src/commands/webhooks/index.ts"() {
14849
14939
  "use strict";
14850
- actions23 = {
14940
+ actions24 = {
14851
14941
  listen: () => Promise.resolve().then(() => (init_listen(), listen_exports)).then((m) => m.default),
14852
14942
  trigger: () => Promise.resolve().then(() => (init_trigger(), trigger_exports)).then((m) => m.default)
14853
14943
  };
@@ -15042,14 +15132,14 @@ var status_exports3 = {};
15042
15132
  __export(status_exports3, {
15043
15133
  default: () => status_default3
15044
15134
  });
15045
- var command44, status_default3;
15135
+ var command45, status_default3;
15046
15136
  var init_status3 = __esm({
15047
15137
  "src/commands/work/status.ts"() {
15048
15138
  "use strict";
15049
15139
  init_exit_codes();
15050
15140
  init_http();
15051
15141
  init_common3();
15052
- command44 = {
15142
+ command45 = {
15053
15143
  resource: "work",
15054
15144
  action: "status",
15055
15145
  summary: "Show the Kenso AI work waiting for your own agent, per kind",
@@ -15083,7 +15173,7 @@ var init_status3 = __esm({
15083
15173
  return ExitCode.Ok;
15084
15174
  }
15085
15175
  };
15086
- status_default3 = command44;
15176
+ status_default3 = command45;
15087
15177
  }
15088
15178
  });
15089
15179
 
@@ -15215,9 +15305,9 @@ var init_files = __esm({
15215
15305
  import { execFile, spawnSync as spawnSync2 } from "node:child_process";
15216
15306
  import { readFileSync as readFileSync12 } from "node:fs";
15217
15307
  import { isAbsolute as isAbsolute2 } from "node:path";
15218
- function sudoArgs(user, command51, args, keep = [], set = {}) {
15308
+ function sudoArgs(user, command52, args, keep = [], set = {}) {
15219
15309
  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];
15310
+ return ["-n", "-u", user, "-H", ...keep.length > 0 ? [`--preserve-env=${keep.join(",")}`] : [], ...assignments, "--", command52, ...args];
15221
15311
  }
15222
15312
  function agentKensoEnv(opts) {
15223
15313
  return {
@@ -15227,12 +15317,12 @@ function agentKensoEnv(opts) {
15227
15317
  AI_AGENT: opts.agentName
15228
15318
  };
15229
15319
  }
15230
- function sudoExec(user, command51, args, opts = {}) {
15320
+ function sudoExec(user, command52, args, opts = {}) {
15231
15321
  const [sudo = "/usr/bin/sudo", ...lead] = user.sudo;
15232
15322
  return new Promise((resolve16) => {
15233
15323
  execFile(
15234
15324
  sudo,
15235
- [...lead, ...sudoArgs(user.name, command51, args)],
15325
+ [...lead, ...sudoArgs(user.name, command52, args)],
15236
15326
  { env: { PATH: SUDO_PATH }, cwd: "/", timeout: opts.timeoutMs ?? PROBE_TIMEOUT_MS, maxBuffer: opts.maxBuffer ?? 1024 * 1024, encoding: "utf8", windowsHide: true, shell: false },
15237
15327
  (err, stdout, stderr) => {
15238
15328
  const code = err ? err.code : 0;
@@ -15342,9 +15432,9 @@ var init_folder2 = __esm({
15342
15432
  init_redact();
15343
15433
  init_agent_user();
15344
15434
  WorkRunFolder = class {
15345
- constructor(ctx, command51, args, outDir, shared = false) {
15435
+ constructor(ctx, command52, args, outDir, shared = false) {
15346
15436
  this.ctx = ctx;
15347
- this.command = command51;
15437
+ this.command = command52;
15348
15438
  this.args = args;
15349
15439
  this.outDir = outDir;
15350
15440
  this.shared = shared;
@@ -15459,7 +15549,7 @@ var pull_exports2 = {};
15459
15549
  __export(pull_exports2, {
15460
15550
  default: () => pull_default2
15461
15551
  });
15462
- var MAX_FILES, command45, pull_default2;
15552
+ var MAX_FILES, command46, pull_default2;
15463
15553
  var init_pull2 = __esm({
15464
15554
  "src/commands/work/pull.ts"() {
15465
15555
  "use strict";
@@ -15468,7 +15558,7 @@ var init_pull2 = __esm({
15468
15558
  init_common3();
15469
15559
  init_folder2();
15470
15560
  MAX_FILES = 100;
15471
- command45 = {
15561
+ command46 = {
15472
15562
  resource: "work",
15473
15563
  action: "pull",
15474
15564
  summary: "Claim waiting work into local work files, to answer by hand",
@@ -15546,7 +15636,7 @@ var init_pull2 = __esm({
15546
15636
  return interrupted7 ? ExitCode.Interrupted : ExitCode.Ok;
15547
15637
  }
15548
15638
  };
15549
- pull_default2 = command45;
15639
+ pull_default2 = command46;
15550
15640
  }
15551
15641
  });
15552
15642
 
@@ -15688,7 +15778,7 @@ __export(submit_exports, {
15688
15778
  default: () => submit_default
15689
15779
  });
15690
15780
  import { resolve as resolve14 } from "node:path";
15691
- var command46, submit_default;
15781
+ var command47, submit_default;
15692
15782
  var init_submit = __esm({
15693
15783
  "src/commands/work/submit.ts"() {
15694
15784
  "use strict";
@@ -15697,7 +15787,7 @@ var init_submit = __esm({
15697
15787
  init_files();
15698
15788
  init_answers();
15699
15789
  init_common3();
15700
- command46 = {
15790
+ command47 = {
15701
15791
  resource: "work",
15702
15792
  action: "submit",
15703
15793
  summary: "Send answers files to Kenso and write each one's results",
@@ -15729,7 +15819,7 @@ var init_submit = __esm({
15729
15819
  return totals.rejected > 0 ? ExitCode.Partial : ExitCode.Ok;
15730
15820
  }
15731
15821
  };
15732
- submit_default = command46;
15822
+ submit_default = command47;
15733
15823
  }
15734
15824
  });
15735
15825
 
@@ -15750,7 +15840,7 @@ function claimIdOf(arg) {
15750
15840
  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
15841
  return arg;
15752
15842
  }
15753
- var CLAIM_ID, command47, release_default;
15843
+ var CLAIM_ID, command48, release_default;
15754
15844
  var init_release = __esm({
15755
15845
  "src/commands/work/release.ts"() {
15756
15846
  "use strict";
@@ -15759,7 +15849,7 @@ var init_release = __esm({
15759
15849
  init_files();
15760
15850
  init_common3();
15761
15851
  CLAIM_ID = /^[A-Za-z0-9_-]{1,64}$/;
15762
- command47 = {
15852
+ command48 = {
15763
15853
  resource: "work",
15764
15854
  action: "release",
15765
15855
  summary: "Give claimed work back to the queue now",
@@ -15778,7 +15868,7 @@ var init_release = __esm({
15778
15868
  return ExitCode.Ok;
15779
15869
  }
15780
15870
  };
15781
- release_default = command47;
15871
+ release_default = command48;
15782
15872
  }
15783
15873
  });
15784
15874
 
@@ -16117,12 +16207,12 @@ function plain(text4) {
16117
16207
  return text4.replace(/\x1b\[[0-9;?]*[A-Za-z]/g, "");
16118
16208
  }
16119
16209
  function runStatus(bin, args, env, adapter, runAs) {
16120
- const command51 = runAs ? runAs.sudo[0] ?? "/usr/bin/sudo" : bin;
16210
+ const command52 = runAs ? runAs.sudo[0] ?? "/usr/bin/sudo" : bin;
16121
16211
  const commandArgs2 = runAs ? [...runAs.sudo.slice(1), ...sudoArgs(runAs.name, bin, args)] : args;
16122
16212
  const options = runAs ? { env: { PATH: SUDO_PATH }, cwd: "/" } : { env: childEnv(env, adapter) };
16123
16213
  return new Promise((resolve16) => {
16124
16214
  execFile2(
16125
- command51,
16215
+ command52,
16126
16216
  commandArgs2,
16127
16217
  { ...options, timeout: STATUS_TIMEOUT_MS, maxBuffer: 1024 * 1024, windowsHide: true, shell: false },
16128
16218
  (err, stdout, stderr) => {
@@ -16390,7 +16480,7 @@ ${out.stderr}`;
16390
16480
  "dontAsk",
16391
16481
  "--tools",
16392
16482
  tools.join(","),
16393
- ...rules.flatMap((rule) => ["--allow", rule]),
16483
+ ...rules.flatMap((rule2) => ["--allow", rule2]),
16394
16484
  "--no-subagents"
16395
16485
  ];
16396
16486
  if (!job.allowWeb) args.push("--disable-web-search");
@@ -17204,7 +17294,7 @@ var run_exports3 = {};
17204
17294
  __export(run_exports3, {
17205
17295
  default: () => run_default2
17206
17296
  });
17207
- var FAILURES_IN_A_ROW, command48, run_default2;
17297
+ var FAILURES_IN_A_ROW, command49, run_default2;
17208
17298
  var init_run3 = __esm({
17209
17299
  "src/commands/work/run.ts"() {
17210
17300
  "use strict";
@@ -17225,7 +17315,7 @@ var init_run3 = __esm({
17225
17315
  init_folder2();
17226
17316
  init_stop();
17227
17317
  FAILURES_IN_A_ROW = 3;
17228
- command48 = {
17318
+ command49 = {
17229
17319
  resource: "work",
17230
17320
  action: "run",
17231
17321
  summary: "Run your own coding agent on the waiting work until the queue is empty",
@@ -17550,16 +17640,16 @@ var init_run3 = __esm({
17550
17640
  return exitCodeFor(reason, totals.rejected > 0 || jobsFailed > 0);
17551
17641
  }
17552
17642
  };
17553
- run_default2 = command48;
17643
+ run_default2 = command49;
17554
17644
  }
17555
17645
  });
17556
17646
 
17557
17647
  // src/commands/work/index.ts
17558
- var actions24;
17648
+ var actions25;
17559
17649
  var init_work2 = __esm({
17560
17650
  "src/commands/work/index.ts"() {
17561
17651
  "use strict";
17562
- actions24 = {
17652
+ actions25 = {
17563
17653
  status: () => Promise.resolve().then(() => (init_status3(), status_exports3)).then((m) => m.default),
17564
17654
  pull: () => Promise.resolve().then(() => (init_pull2(), pull_exports2)).then((m) => m.default),
17565
17655
  submit: () => Promise.resolve().then(() => (init_submit(), submit_exports)).then((m) => m.default),
@@ -17583,14 +17673,14 @@ function parseLimit(value) {
17583
17673
  }
17584
17674
  return limit;
17585
17675
  }
17586
- var MAX_LIMIT, command49, list_default3;
17676
+ var MAX_LIMIT, command50, list_default3;
17587
17677
  var init_list3 = __esm({
17588
17678
  "src/commands/workspace/list.ts"() {
17589
17679
  "use strict";
17590
17680
  init_errors();
17591
17681
  init_exit_codes();
17592
17682
  MAX_LIMIT = 200;
17593
- command49 = {
17683
+ command50 = {
17594
17684
  resource: "workspace",
17595
17685
  action: "list",
17596
17686
  summary: "List the workspaces your key can use",
@@ -17618,7 +17708,7 @@ var init_list3 = __esm({
17618
17708
  return ExitCode.Ok;
17619
17709
  }
17620
17710
  };
17621
- list_default3 = command49;
17711
+ list_default3 = command50;
17622
17712
  }
17623
17713
  });
17624
17714
 
@@ -17627,7 +17717,7 @@ var use_exports = {};
17627
17717
  __export(use_exports, {
17628
17718
  default: () => use_default
17629
17719
  });
17630
- var command50, use_default;
17720
+ var command51, use_default;
17631
17721
  var init_use = __esm({
17632
17722
  "src/commands/workspace/use.ts"() {
17633
17723
  "use strict";
@@ -17635,7 +17725,7 @@ var init_use = __esm({
17635
17725
  init_errors();
17636
17726
  init_exit_codes();
17637
17727
  init_http();
17638
- command50 = {
17728
+ command51 = {
17639
17729
  resource: "workspace",
17640
17730
  action: "use",
17641
17731
  summary: "Set the profile's default workspace",
@@ -17692,16 +17782,16 @@ var init_use = __esm({
17692
17782
  return ExitCode.Ok;
17693
17783
  }
17694
17784
  };
17695
- use_default = command50;
17785
+ use_default = command51;
17696
17786
  }
17697
17787
  });
17698
17788
 
17699
17789
  // src/commands/workspace/index.ts
17700
- var actions25;
17790
+ var actions26;
17701
17791
  var init_workspace = __esm({
17702
17792
  "src/commands/workspace/index.ts"() {
17703
17793
  "use strict";
17704
- actions25 = {
17794
+ actions26 = {
17705
17795
  list: () => Promise.resolve().then(() => (init_list3(), list_exports3)).then((m) => m.default),
17706
17796
  use: () => Promise.resolve().then(() => (init_use(), use_exports)).then((m) => m.default)
17707
17797
  };
@@ -17738,6 +17828,7 @@ var init_registry = __esm({
17738
17828
  init_mcp();
17739
17829
  init_opportunities();
17740
17830
  init_people();
17831
+ init_pipelines();
17741
17832
  init_reports();
17742
17833
  init_runs2();
17743
17834
  init_sandbox2();
@@ -17766,15 +17857,16 @@ var init_registry = __esm({
17766
17857
  mcp: actions15,
17767
17858
  opportunities: actions16,
17768
17859
  people: actions17,
17769
- reports: actions18,
17770
- runs: actions19,
17771
- sandbox: actions20,
17772
- skill: actions21,
17773
- studio: actions22,
17774
- webhooks: actions23,
17860
+ pipelines: actions18,
17861
+ reports: actions19,
17862
+ runs: actions20,
17863
+ sandbox: actions21,
17864
+ skill: actions22,
17865
+ studio: actions23,
17866
+ webhooks: actions24,
17775
17867
  whoami: topLevel("whoami", actions4.status, "kenso auth status"),
17776
- work: actions24,
17777
- workspace: actions25
17868
+ work: actions25,
17869
+ workspace: actions26
17778
17870
  };
17779
17871
  resourceAliases = { leads: "contacts" };
17780
17872
  }
@@ -17911,8 +18003,8 @@ async function renderTopHelp(opts) {
17911
18003
  names.push(withPositionals(spec, spec.action));
17912
18004
  groups.set(hint, names);
17913
18005
  }
17914
- const actions27 = [...groups.entries()].map(([hint, names]) => `${names.join(", ")}${hint}`);
17915
- if (actions27.length > 0) rows.push([resource, actions27.join(", ")]);
18006
+ const actions28 = [...groups.entries()].map(([hint, names]) => `${names.join(", ")}${hint}`);
18007
+ if (actions28.length > 0) rows.push([resource, actions28.join(", ")]);
17916
18008
  }
17917
18009
  const at = 4 + Math.min(22, Math.max(0, ...rows.map(([left]) => left.length)));
17918
18010
  lines.push(
@@ -17925,7 +18017,7 @@ async function renderTopHelp(opts) {
17925
18017
  const [area = "", action = ""] = name.split(" ");
17926
18018
  byArea.set(area, [...byArea.get(area) ?? [], action]);
17927
18019
  }
17928
- const named = [...byArea.entries()].map(([area, actions27]) => `${area} ${actions27.join("|")}`);
18020
+ const named = [...byArea.entries()].map(([area, actions28]) => `${area} ${actions28.join("|")}`);
17929
18021
  lines.push(wrap(`Beta, hidden here but they run (the server decides): ${named.join(", ")}.`, " "));
17930
18022
  }
17931
18023
  const generated = await listGenerated({ features: opts.allCommands ? [] : getFeatures, env: opts.env });
@@ -17933,13 +18025,13 @@ async function renderTopHelp(opts) {
17933
18025
  if (visible.length > 0) {
17934
18026
  const byResource = /* @__PURE__ */ new Map();
17935
18027
  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);
18028
+ const actions28 = byResource.get(g.resource) ?? [];
18029
+ actions28.push(`${g.action}${g.beta ? " (beta)" : ""}`);
18030
+ byResource.set(g.resource, actions28);
17939
18031
  }
17940
18032
  const sorted2 = [...byResource.entries()].sort(([a], [b]) => a.localeCompare(b));
17941
18033
  if (opts.allCommands) {
17942
- const generatedRows = sorted2.map(([resource, actions27]) => [resource, actions27.sort().join(", ")]);
18034
+ const generatedRows = sorted2.map(([resource, actions28]) => [resource, actions28.sort().join(", ")]);
17943
18035
  lines.push("", "API resources (kenso <resource> <action>):", columns(generatedRows));
17944
18036
  } else {
17945
18037
  const names = new Set(sorted2.map(([resource]) => resource));
@@ -18255,8 +18347,8 @@ function startUpdateNotice(argv, opts = {}) {
18255
18347
  if (!found) return;
18256
18348
  writeCheck(file, { checkedAt: new Date(now).toISOString(), latest: found });
18257
18349
  if (isNewer(found, version)) {
18258
- const command51 = updateCommand(install, opts.platform ?? process.platform);
18259
- stderr.write(`kenso ${found} is out (you have ${version}): ${command51}
18350
+ const command52 = updateCommand(install, opts.platform ?? process.platform);
18351
+ stderr.write(`kenso ${found} is out (you have ${version}): ${command52}
18260
18352
  Turn this off with KENSO_NO_UPDATE_NOTIFIER=1.
18261
18353
  `);
18262
18354
  }
@@ -18298,7 +18390,7 @@ function resources() {
18298
18390
  const names = Object.entries(handWritten).filter(([, area]) => Object.keys(area).length > 0).map(([resource]) => resource);
18299
18391
  return sorted([...names, ...Object.keys(resourceAliases), ...loadManifest().operations.map((op) => op.resource)]);
18300
18392
  }
18301
- function actions26(resource) {
18393
+ function actions27(resource) {
18302
18394
  const own = Object.keys(handWritten[resource] ?? {}).filter((action) => action !== "");
18303
18395
  return sorted([...own, ...loadManifest().operations.filter((op) => op.resource === resource).map((op) => op.action)]);
18304
18396
  }
@@ -18363,7 +18455,7 @@ async function completions(words, globals) {
18363
18455
  return flagsOf2(spec, globals, positionals.length === 0);
18364
18456
  }
18365
18457
  if (positionals.length === 0) return resources();
18366
- if (!spec) return positionals.length === 1 ? actions26(resourceAliases[positionals[0]] ?? positionals[0]) : [];
18458
+ if (!spec) return positionals.length === 1 ? actions27(resourceAliases[positionals[0]] ?? positionals[0]) : [];
18367
18459
  const given = positionals.length - commandWords;
18368
18460
  const declared = spec.positionals ?? [];
18369
18461
  if (given < declared.length || declared.at(-1)?.variadic === true) {
@@ -18457,9 +18549,9 @@ function normalizeBooleans(argv, names, strict) {
18457
18549
  async function knownCommands() {
18458
18550
  const commands = /* @__PURE__ */ new Set();
18459
18551
  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);
18552
+ const actions28 = Object.keys(area);
18553
+ if (actions28.length > 0) commands.add(resource);
18554
+ for (const action of actions28) commands.add(action ? `${resource} ${action}` : resource);
18463
18555
  }
18464
18556
  for (const g of await listGenerated({ features: [] })) {
18465
18557
  commands.add(g.resource);