kenso 0.1.84 → 0.1.85

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.84" : "0.0.0-dev";
2480
+ VERSION = true ? "0.1.85" : "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: command53, createdAt, status } = raw;
4177
+ const { runId, command: command56, createdAt, status } = raw;
4178
4178
  if (typeof runId !== "string" || !RUN_ID_PATTERN.test(runId)) return null;
4179
- if (typeof command53 !== "string" || typeof createdAt !== "string") return null;
4179
+ if (typeof command56 !== "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: command53,
4190
+ command: command56,
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(command53, args, inputSha256, env, workspaceId, anyWorkspace = false) {
4245
+ async function findIdentical(command56, 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 === command53 && (run.inputSha256 || void 0) === (inputSha256 || void 0) && (anyWorkspace || (run.workspaceId || void 0) === (workspaceId || void 0)) && argsIdentity(run.args) === identity
4249
+ (run) => run.command === command56 && (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, command53, args, extra = []) {
7455
- const parts2 = ["kenso", ...command53.split(" "), ...(args.positionals ?? []).map(shellQuote3)];
7454
+ function commandLine2(ctx, command56, args, extra = []) {
7455
+ const parts2 = ["kenso", ...command56.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| `export <accounts\\|people\\|deals>` | The list as CSV: everything, a saved Accounts view, or what the filters match |\n| `capture status` | Your captured mailbox, its backfill progress and what teammates see of a captured email. Needs the `crm_capture` flag |\n| `capture connect` | Turn capture on for your own mailbox. `--private` starts it hidden from teammates; `--provider google` prints a sign-in link when no account is connected yet |\n| `capture private on\\|off` | Hide your captured email from teammates, or show it again. Email only: meetings stay visible |\n| `capture disconnect` | Turn capture off and delete your stored email bodies. Asks first; `--yes` skips the question |\n| `capture teammates-see summary\\|full_email` | Workspace admin: what teammates see of captured email |\n| `pipelines stage-rules` | List or set the fields a deal should have in each stage |\n| `crm-connections`, `crm-imports`, `crm-sync-issues` | Read and run CRM sync. Connecting a CRM stays in the app |\n\nImport accounts first, then people: `people import` never creates an account.\n\n## Import accounts\n\n```bash\nkenso accounts import --file accounts.csv\nkenso accounts import --file accounts.csv --yes\n```\n\n```csv\nname,domain,industry,employeeCount\nAcme,acme.io,Software,120\nGlobex,globex.com,Manufacturing,"1,200"\n```\n\n- **Columns** map by name, ignoring case, spaces and dashes: `name` (or `company`, `companyName`, `accountName`), `domains` (several, split on `,` or `;`) or one `domain` (or `website`, `companyDomain`), `industry`, `employeeCount`, `hqLocation`, `linkedinUrl`, `stage`, `angle`, `whyNow`, `fitScore`, `fundingRound`, `cadenceDays`, `ownerMemberId`, `kenCompanyId`, `sendsFromInboxId`, `sendsFromLinkedInAccountId` and `source`.\n- **A domain is required.** A file with no domain column is a usage error, and a row without a domain is `invalid` (`domain_required`).\n- **The dry run prices the research.** It asks for a credit estimate per 1,000 accounts and puts the sum in the plan: `kind`, `accountCount`, `totalMillicredits`, `availableMillicredits` and `sufficient`.\n- **Rows go 100 per call** to `POST /v1/accounts/bulk-create`.\n\nEach row comes back `created` (`id` is the new account; its research is queued, `researchQueued`, or waits for credits, `researchWaitingCredits`), `skipped` with reason `domain_taken` (already an account; `id` is that account) or `failed` (`reason` is the API\'s code, `error` names the field; an item Kenso failed to save is sent once more first). Rerunning the same file is safe: accounts that exist come back `domain_taken`.\n\n## Import people\n\n```bash\nkenso people import --file people.csv\nkenso people import --file people.csv --find-emails --yes\nkenso people import --file people.jsonl --dry-run\n```\n\n```csv\nfullName,email,title,accountDomain,role\nAnn Lee,ann@acme.io,VP Sales,acme.io,champion\nBob Ray,,CTO,acme.io,\n```\n\n- **Columns** map by name, ignoring case, spaces and dashes: `email`, `fullName` (or `name`), `firstName`, `lastName`, `title`, `linkedinUrl` (or `linkedin`, `profileUrl`), `accountDomain` (or `domain`, `website`, `companyDomain`), `accountId`, `role` and `priority`. Other columns are ignored with one warning.\n- **A person needs a name:** `fullName`, or `firstName`, `lastName` or both (the CLI joins them). A row with none of them is `invalid` (`name_required`).\n- **To put a person on an account,** give `accountDomain` or `accountId`. A row with both sends only `accountId`.\n- **`--find-emails`** queues an email find (charged in credits) for each person without an email.\n- **Rows go 200 per call** to `POST /v1/people/batch`.\n\nPeople already in the workspace are matched by email, then LinkedIn URL, so running the same file again creates nobody twice. A row comes back `created` (a new person), `updated` (an existing person added to the account), `skipped` with reason `already_on_account`, `matched` (no account asked) or `previously_removed`, or `failed`: `account_not_found` saves the person without an account (import the account, then rerun to place them), any other reason is the API\'s. The summary adds `matched`, `addedToAccounts` and `emailFindsQueued`.\n\n## List and search accounts\n\n`accounts list` and `accounts search` sort and page on the server, so they reach every account in the workspace, however many there are.\n\n```bash\nkenso accounts list --sort score:desc --limit 100 # one page; the output\'s next: line is the following one\nkenso accounts list --sort score:desc --limit 100 --all # every page, to the end\nkenso accounts search --search hiring --sort latestSignalAt:desc --data \'{"qFields": ["name", "latestSignal"]}\'\nkenso accounts search --limit 1 --data \'{"countBy": ["stage"]}\' # how many accounts sit in each stage\nkenso accounts search --data \'{"where": {"match": "all", "conditions": [{"field": "tier", "operator": "is", "values": ["1"]}]}, "sort": "tier,-pipelineAmount"}\' --all\nkenso accounts search --data \'{"where": {"match": "all", "conditions": [{"field": "hqLocation", "operator": "contains", "values": ["Germany"]}]}}\' --all\n# tier 1 accounts with no meeting in 30 days: none since then, or none ever\nkenso accounts search --data \'{"where": {"match": "all", "conditions": [{"field": "tier", "operator": "is", "values": ["1"]}, {"match": "any", "conditions": [{"field": "lastMeeting", "operator": "older_than_days", "values": ["30"]}, {"field": "lastMeeting", "operator": "is_empty"}]}]}}\' --all\n```\n\n- **`--sort`** takes up to 3 comma-separated keys, each `field` (ascending), `field:asc` or `field:desc`. The API\'s `-field` form needs the equals sign here, `--sort=-score`, because a value that starts with a dash reads as a flag. Fields: `createdAt`, `name`, `score`, `tier` (ascending is tier 1 first), `latestSignalAt`, `committee`, `pipelineAmount`, `nextTouchAt`, `lastTouchAt`. An account with no value for a key comes last in both directions. The default is `-createdAt`.\n- **`--limit`** is 1 to 1000 (default 50). `--cursor` takes the previous page\'s `nextCursor` with the same filters and sort; `--all` follows the cursors for you.\n- **`--search`** (also `--q`) matches the name or a domain.\n- **Lists and objects go in `--data`** on `search`, as the API takes them (`kenso describe accounts search`); a flag beside it sets or replaces one key:\n - `qFields` picks where the search text looks: `name`, `domain`, `latestSignal` (the latest signal\'s title).\n - `countBy` (`stage`, `stageGroup`) adds `counts` to the output: every value with the number of matching accounts that hold it, whatever the page. The output is then one object: `data`, `pagination` and `counts`.\n - `filters` and `where` narrow the accounts.\n\nAn account\'s timeline pages the same way. `kenso accounts activity 812` returns the newest 100 earlier rows and, when older ones exist, `data.nextCursor`. Pass it back as `--cursor` (with the same `--category`) for the rows before them, until a page comes without one.\n\n## Edit accounts, people and opportunities\n\nApart from `accounts bulk-update`, which sets one `accountType` on up to 500 accounts, there is no bulk edit route, so run the generated `update` command once per row with `--each`. Columns are the command\'s flags by API name or flag name, and the id column fills the route:\n\n```bash\nkenso accounts update --each accounts-edit.csv --dry-run # then the same with --yes\nkenso people update --each people-edit.csv --dry-run\nkenso opportunities update --each deals.csv --dry-run\n```\n\n```csv\naccountId,stage,ownerMemberId,overwritePinned\n501,engaged,42,true\n502,customer,42,true\n```\n\nA row that changes a field someone pinned in the app fails as a whole (`409 conflict`, `pinned_by_user`: nothing on that record changes, the other fields of the row included), unless the row sets `overwritePinned` to `true` (or you pass `--overwrite-pinned`, only with the person\'s OK). Every flag of an update command: `kenso accounts update --help`.\n\n## Search opportunities\n\n`kenso opportunities search` works as `accounts search` does: it takes `--search`, `--sort`, `--limit`, `--cursor`, `--all`, and its lists in `--data`.\n\n```bash\nkenso opportunities search --data \'{"filters": [{"field": "stageCategory", "operator": "is", "values": ["open"]}]}\' --all\nkenso opportunities search --data \'{"filters": [{"field": "ownerMemberId", "operator": "is", "values": ["none"]}, {"field": "closeDate", "operator": "is", "values": ["past_due", "next_30_days"]}]}\'\nkenso opportunities search --limit 1 --data \'{"countBy": ["stage", "ownerMemberId"]}\' # how many opportunities hold each value\n```\n\n- **`filters`** is a list of `{field, operator, values}`, all of which must hold. Fields: `stage` (a stage key), `stageCategory` (`open`, `won`, `lost`), `ownerMemberId`, `closeDate` (`past_due`, `next_30_days`, `later`, `none`) and `sourceCampaignId`. `operator` is `is` or `is_not`; the values of one condition are OR. `none` in `values` matches an opportunity with no owner, no source campaign or no close date.\n- **`countBy`** takes the same field names and adds `counts` to the output: per field, every value with the number of matching opportunities that hold it.\n- `--account-id` keeps the search to one account. `closeDate` counts days in the member\'s app time zone.\n\nOne person\'s deals, meetings and campaign contacts, as their person page lists them:\n\n```bash\nkenso opportunities list --person-id 9001 # the deals they are on, or are the primary person of\nkenso meetings list --person-id 9001 # the meetings they attend, among the ones you can see\nkenso contacts list --person-id 9001 # their contact in each campaign they are in\n```\n\n## Write research you gathered\n\n`accounts write-research` and `people write-research` store research you gathered outside Kenso as the record\'s latest research (`PUT /v1/accounts/{accountId}/research`, `PUT /v1/people/{personId}/research`). The Research tab shows it like a Ken run, with `trigger: agent` and `researchedAt` now. Nothing is charged, and no account or person field changes: set an account\'s own `fitScore`, `whyNow` or `angle` with `accounts update`. They need the `accounts_research` flag and accounts edit.\n\nThe body is the research block `accounts get --expand research` (or `people get-research`) returns, without its read-only fields: leave out `id`, `status`, `trigger`, `errorCode`, `researchedAt`, `isStale` and `appliedPrompt` (for a person also `mode`, `requestedAt`, `researchedMode`, `firecrawlCredits` and `webNote`), or the write fails with `unknown_field`. Pass it with `--data @file`:\n\n```bash\nkenso accounts write-research --account-id 501 --data @acme-dossier.json\nkenso people write-research --person-id 9001 --data @jane.json\n```\n\n```json\n{\n "tagline": { "text": "Payroll for EU contractors", "sourceUrls": ["https://acme.example"] },\n "description": { "text": "Acme runs payroll and compliance for companies hiring contractors in 30 EU countries.", "sourceUrls": ["https://acme.example"] },\n "links": { "website": "https://acme.example" },\n "whyNow": { "text": "Raised a $40M Series B in October", "sourceUrls": ["https://news.example/acme-b"], "date": "2026-10" },\n "fitScore": 82,\n "angle": "Lead with contractor onboarding time."\n}\n```\n\nMany records: one JSONL line per record, with the id next to the block\'s fields. Nested objects are sent as written. Use JSONL, not CSV: the block\'s fields are objects and lists, which a CSV cell cannot carry.\n\n```bash\nkenso accounts write-research --each dossiers.jsonl --dry-run # then the same with --yes\nkenso people write-research --each people-research.jsonl --yes --concurrency 8\n```\n\n```jsonl\n{"accountId": 501, "tagline": {"text": "Payroll for EU contractors"}, "links": {"website": "https://acme.example"}}\n{"accountId": 502, "description": {"text": "Cloud cost tooling for retailers."}, "links": {"website": "https://beta.example"}}\n```\n\nA row fails as a whole with the API\'s code: `validation_failed` (an unknown field is `unknown_field`, and `error.details` names every bad field), `research_in_progress` (`409`: Ken is researching that record now, write it again once the run ends; an account run waiting for credits counts too: it runs once the workspace has credits, and the write stays refused until that run ends) or `not_found`. Rerunning a file is safe: each write replaces the record\'s research shown.\n\n## CRM sync\n\nCRM sync has generated commands only: read connections, preview, start an import, and work through sync issues. Connect the CRM itself in the app.\n\n```bash\nkenso crm-connections list\nkenso crm-connections get --connection-id 7\nkenso crm-imports create --connection-id 7 --dry-run\nkenso crm-sync-issues list --connection-id 7 --all\n```\n\nRun `kenso crm-connections --help` (or add `--all-commands` when the actions are hidden) to see every action.\n\n## Pipelines\n\nA workspace with the `pipelines` flag on can run several deal pipelines, each with its own stages. These are generated commands (beta):\n\n```bash\nkenso pipelines list\nkenso pipelines list --query "[].{id: id, name: name, default: isDefault, stages: stages[].key}"\nkenso pipelines get --pipeline-id 5\n```\n\n`list` prints every pipeline in display order, archived ones included: `id`, `name`, `routingRule` (the one sentence Ken reads to decide whether a new deal belongs there), `isDefault`, `isArchived`, `position`, `opportunityCount`, `amountTotal` and `stages`, each stage as `kenso opportunity-stages list` prints it. A stage key is unique in the workspace, across pipelines, so a deal\'s `stage` names its pipeline and its `pipelineId` repeats it. The first read turns the workspace\'s stage list into its default pipeline, named Sales, with every deal in it. The same rows as the MCP\'s `pipelines(operation="list")`.\n\n## Restore a deleted account\n\n```bash\nkenso deleted-accounts list\nkenso accounts restore 812\n```\n\nA deleted account can be restored for 30 days. `deleted-accounts list` shows each one with who deleted it, `expiresAt` (restore works until then) and what comes back: `personCount`, `opportunityCount` and `touchCount`. `accounts restore <id>` brings the account back with its domains, its people, its deals and its planned touches, which wait for approval again. A domain another account took since stays with that account and is listed in `domainsTaken`. A merged account is not listed and cannot be restored: a merge has no undo. Both commands are behind the `crm_import_export` feature flag (`404` while it is off).\n\n## Export accounts, people or deals\n\n```bash\nkenso export accounts --out accounts.csv\nkenso export accounts --view 12 --out tier-1.csv\nkenso export deals --filters \'[{"field":"stageCategory","operator":"is","values":["open"]}]\' > open-deals.csv\n```\n\nIt writes the CSV that `POST /v1/accounts/export`, `/v1/people/export` or `/v1/opportunities/export` returns, to stdout or to `--out` (then it prints the file and its row count). With no filter it exports every record. More than 50,000 rows is refused: narrow the filters. `--view <id>` exports a saved Accounts view (`kenso account-views list` shows the ids). `--filters`, `--where` (accounts), `--q` and `--sort` are the search operation\'s own fields, so a deals or people view exports with its filters and sort. The accounts and deals files start with `id` and import back as they are. Each export writes an audit-log entry and needs the export permission. Accounts and deals also need the `crm_import_export` flag while it is in beta.\n\n## A deal\'s stage history\n\n```bash\nkenso opportunities stage-history 77\nkenso opportunities stage-history 77 --query "entries[].{to: stageLabel, at: enteredAt, by: changedBy}"\n```\n\nIt prints `GET /v1/opportunities/{id}/stage-history` as it is, the same rows as the deal page and the MCP\'s `opportunities(operation="get-stage-history")`: the stage now, `isComplete` and `entries`, oldest first, each with `fromStage`, `stage`, `stageLabel`, `enteredAt`, `leftAt`, `durationSeconds`, `actorKind`, `actorMemberId` and Ken\'s `reason` on a move its stage judge made. With the `deal_stage_rules` flag on, each entry also has `changedBy` (`member`, `agent`, `api_key`, `workflow`, `stage_judge`, `crm_sync` or `ken_automation`), `crmProvider` on a CRM sync, and on a move `fromStageLabel` and `fromStageDurationSeconds`, how long the deal sat in the stage it left. `isComplete` false means Kenso has no record of part of the history.\n\n## Required fields per stage\n\n```bash\nkenso pipelines stage-rules\nkenso pipelines stage-rules proposal --require amount,closeDate,custom.tier\nkenso pipelines stage-rules proposal --none\nkenso pipelines stage-rules lost --default\n```\n\nWith the `deal_stage_rules` flag on, each stage can name the fields a deal should have in it. Without a stage the command prints every stage\'s `key`, `label`, `category`, `isArchived`, `requiredFields` and `isDefault`, plus `requirableFields`: `amount`, `closeDate`, `ownerMemberId`, `primaryPersonId`, `nextStep`, `lostReasonKey`, `wonReasonKey` and `custom.<key>` for each custom deal field. `--require` sets the stage\'s whole list, in order, at most 10. `--none` requires nothing, and `--default` goes back to the default: a lost stage asks for `lostReasonKey`, any other stage nothing. Setting a rule needs the `workspace_settings` permission. The same as the MCP\'s `opportunities(operation="stages-set-required-fields")`.\n\nA missing field never stops a move. The deal moves, and it is flagged Missing on the board, the list and the deal page until the field is filled. A rule also applies to deals already in the stage.\n';
7787
+ crm_default = '# CRM (beta)\n\nThe CRM commands work on Kenso\'s Accounts lane: accounts (companies), the people on them, and opportunities. They are beta: they need the `accounts` feature flag on your workspace (opportunities need `opportunities`, CRM sync needs `ingestion`). Help and `kenso describe` hide them until your workspace has the flag; `--all-commands` shows them.\n\n| Command | What it does |\n|---|---|\n| `accounts import` | Create accounts from a CSV or JSONL file. Research is charged per created account |\n| `people import` | Create or match people from a file, optionally onto accounts |\n| `accounts update --each`, `people update --each`, `opportunities update --each` | Edit many records from a file, one call per row |\n| `accounts write-research`, `people write-research` | Store research you gathered as a record\'s latest research, free. `--each` writes many |\n| `opportunities stage-history <id>` | A deal\'s stage history: each stage, when, who moved it and how long it sat there |\n| `deleted-accounts list`, `accounts restore <id>` | The accounts deleted in the last 30 days, and bringing one back |\n| `export <accounts\\|people\\|deals>` | The list as CSV: everything, a saved Accounts view, or what the filters match |\n| `capture status` | Your captured mailbox, its backfill progress and what teammates see of a captured email. Needs the `crm_capture` flag |\n| `capture connect` | Turn capture on for your own mailbox. `--private` starts it hidden from teammates; `--provider google` prints a sign-in link when no account is connected yet |\n| `capture private on\\|off` | Hide your captured email from teammates, or show it again. Email only: meetings stay visible |\n| `capture disconnect` | Turn capture off and delete your stored email bodies. Asks first; `--yes` skips the question |\n| `capture teammates-see summary\\|full_email` | Workspace admin: what teammates see of captured email |\n| `pipelines stage-rules` | List or set the fields a deal should have in each stage |\n| `crm-connections`, `crm-imports`, `crm-sync-issues` | Read and run CRM sync. Connecting a CRM stays in the app |\n| `tasks add`, `tasks done`, `tasks assign` | Add a to-do for a member on an account, person or deal, complete it, or hand it on (needs `tasks`) |\n\nImport accounts first, then people: `people import` never creates an account.\n\n## Import accounts\n\n```bash\nkenso accounts import --file accounts.csv\nkenso accounts import --file accounts.csv --yes\n```\n\n```csv\nname,domain,industry,employeeCount\nAcme,acme.io,Software,120\nGlobex,globex.com,Manufacturing,"1,200"\n```\n\n- **Columns** map by name, ignoring case, spaces and dashes: `name` (or `company`, `companyName`, `accountName`), `domains` (several, split on `,` or `;`) or one `domain` (or `website`, `companyDomain`), `industry`, `employeeCount`, `hqLocation`, `linkedinUrl`, `stage`, `angle`, `whyNow`, `fitScore`, `fundingRound`, `cadenceDays`, `ownerMemberId`, `kenCompanyId`, `sendsFromInboxId`, `sendsFromLinkedInAccountId` and `source`.\n- **A domain is required.** A file with no domain column is a usage error, and a row without a domain is `invalid` (`domain_required`).\n- **The dry run prices the research.** It asks for a credit estimate per 1,000 accounts and puts the sum in the plan: `kind`, `accountCount`, `totalMillicredits`, `availableMillicredits` and `sufficient`.\n- **Rows go 100 per call** to `POST /v1/accounts/bulk-create`.\n\nEach row comes back `created` (`id` is the new account; its research is queued, `researchQueued`, or waits for credits, `researchWaitingCredits`), `skipped` with reason `domain_taken` (already an account; `id` is that account) or `failed` (`reason` is the API\'s code, `error` names the field; an item Kenso failed to save is sent once more first). Rerunning the same file is safe: accounts that exist come back `domain_taken`.\n\n## Import people\n\n```bash\nkenso people import --file people.csv\nkenso people import --file people.csv --find-emails --yes\nkenso people import --file people.jsonl --dry-run\n```\n\n```csv\nfullName,email,title,accountDomain,role\nAnn Lee,ann@acme.io,VP Sales,acme.io,champion\nBob Ray,,CTO,acme.io,\n```\n\n- **Columns** map by name, ignoring case, spaces and dashes: `email`, `fullName` (or `name`), `firstName`, `lastName`, `title`, `linkedinUrl` (or `linkedin`, `profileUrl`), `accountDomain` (or `domain`, `website`, `companyDomain`), `accountId`, `role` and `priority`. Other columns are ignored with one warning.\n- **A person needs a name:** `fullName`, or `firstName`, `lastName` or both (the CLI joins them). A row with none of them is `invalid` (`name_required`).\n- **To put a person on an account,** give `accountDomain` or `accountId`. A row with both sends only `accountId`.\n- **`--find-emails`** queues an email find (charged in credits) for each person without an email.\n- **Rows go 200 per call** to `POST /v1/people/batch`.\n\nPeople already in the workspace are matched by email, then LinkedIn URL, so running the same file again creates nobody twice. A row comes back `created` (a new person), `updated` (an existing person added to the account), `skipped` with reason `already_on_account`, `matched` (no account asked) or `previously_removed`, or `failed`: `account_not_found` saves the person without an account (import the account, then rerun to place them), any other reason is the API\'s. The summary adds `matched`, `addedToAccounts` and `emailFindsQueued`.\n\n## List and search accounts\n\n`accounts list` and `accounts search` sort and page on the server, so they reach every account in the workspace, however many there are.\n\n```bash\nkenso accounts list --sort score:desc --limit 100 # one page; the output\'s next: line is the following one\nkenso accounts list --sort score:desc --limit 100 --all # every page, to the end\nkenso accounts search --search hiring --sort latestSignalAt:desc --data \'{"qFields": ["name", "latestSignal"]}\'\nkenso accounts search --limit 1 --data \'{"countBy": ["stage"]}\' # how many accounts sit in each stage\nkenso accounts search --data \'{"where": {"match": "all", "conditions": [{"field": "tier", "operator": "is", "values": ["1"]}]}, "sort": "tier,-pipelineAmount"}\' --all\nkenso accounts search --data \'{"where": {"match": "all", "conditions": [{"field": "hqLocation", "operator": "contains", "values": ["Germany"]}]}}\' --all\n# tier 1 accounts with no meeting in 30 days: none since then, or none ever\nkenso accounts search --data \'{"where": {"match": "all", "conditions": [{"field": "tier", "operator": "is", "values": ["1"]}, {"match": "any", "conditions": [{"field": "lastMeeting", "operator": "older_than_days", "values": ["30"]}, {"field": "lastMeeting", "operator": "is_empty"}]}]}}\' --all\n```\n\n- **`--sort`** takes up to 3 comma-separated keys, each `field` (ascending), `field:asc` or `field:desc`. The API\'s `-field` form needs the equals sign here, `--sort=-score`, because a value that starts with a dash reads as a flag. Fields: `createdAt`, `name`, `score`, `tier` (ascending is tier 1 first), `latestSignalAt`, `committee`, `pipelineAmount`, `nextTouchAt`, `lastTouchAt`. An account with no value for a key comes last in both directions. The default is `-createdAt`.\n- **`--limit`** is 1 to 1000 (default 50). `--cursor` takes the previous page\'s `nextCursor` with the same filters and sort; `--all` follows the cursors for you.\n- **`--search`** (also `--q`) matches the name or a domain.\n- **Lists and objects go in `--data`** on `search`, as the API takes them (`kenso describe accounts search`); a flag beside it sets or replaces one key:\n - `qFields` picks where the search text looks: `name`, `domain`, `latestSignal` (the latest signal\'s title).\n - `countBy` (`stage`, `stageGroup`) adds `counts` to the output: every value with the number of matching accounts that hold it, whatever the page. The output is then one object: `data`, `pagination` and `counts`.\n - `filters` and `where` narrow the accounts.\n\nAn account\'s timeline pages the same way. `kenso accounts activity 812` returns the newest 100 earlier rows and, when older ones exist, `data.nextCursor`. Pass it back as `--cursor` (with the same `--category`) for the rows before them, until a page comes without one.\n\n## Edit accounts, people and opportunities\n\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## Pipelines\n\nA workspace with the `pipelines` flag on can run several deal pipelines, each with its own stages. These are generated commands (beta):\n\n```bash\nkenso pipelines list\nkenso pipelines list --query "[].{id: id, name: name, default: isDefault, stages: stages[].key}"\nkenso pipelines get --pipeline-id 5\n```\n\n`list` prints every pipeline in display order, archived ones included: `id`, `name`, `routingRule` (the one sentence Ken reads to decide whether a new deal belongs there), `isDefault`, `isArchived`, `position`, `opportunityCount`, `amountTotal` and `stages`, each stage as `kenso opportunity-stages list` prints it. A stage key is unique in the workspace, across pipelines, so a deal\'s `stage` names its pipeline and its `pipelineId` repeats it. The first read turns the workspace\'s stage list into its default pipeline, named Sales, with every deal in it. The same rows as the MCP\'s `pipelines(operation="list")`.\n\n## Restore a deleted account\n\n```bash\nkenso deleted-accounts list\nkenso accounts restore 812\n```\n\nA deleted account can be restored for 30 days. `deleted-accounts list` shows each one with who deleted it, `expiresAt` (restore works until then) and what comes back: `personCount`, `opportunityCount` and `touchCount`. `accounts restore <id>` brings the account back with its domains, its people, its deals and its planned touches, which wait for approval again. A domain another account took since stays with that account and is listed in `domainsTaken`. A merged account is not listed and cannot be restored: a merge has no undo. Both commands are behind the `crm_import_export` feature flag (`404` while it is off).\n\n## Export accounts, people or deals\n\n```bash\nkenso export accounts --out accounts.csv\nkenso export accounts --view 12 --out tier-1.csv\nkenso export deals --filters \'[{"field":"stageCategory","operator":"is","values":["open"]}]\' > open-deals.csv\n```\n\nIt writes the CSV that `POST /v1/accounts/export`, `/v1/people/export` or `/v1/opportunities/export` returns, to stdout or to `--out` (then it prints the file and its row count). With no filter it exports every record. More than 50,000 rows is refused: narrow the filters. `--view <id>` exports a saved Accounts view (`kenso account-views list` shows the ids). `--filters`, `--where` (accounts), `--q` and `--sort` are the search operation\'s own fields, so a deals or people view exports with its filters and sort. The accounts and deals files start with `id` and import back as they are. Each export writes an audit-log entry and needs the export permission. Accounts and deals also need the `crm_import_export` flag while it is in beta.\n\n## A deal\'s stage history\n\n```bash\nkenso opportunities stage-history 77\nkenso opportunities stage-history 77 --query "entries[].{to: stageLabel, at: enteredAt, by: changedBy}"\n```\n\nIt prints `GET /v1/opportunities/{id}/stage-history` as it is, the same rows as the deal page and the MCP\'s `opportunities(operation="get-stage-history")`: the stage now, `isComplete` and `entries`, oldest first, each with `fromStage`, `stage`, `stageLabel`, `enteredAt`, `leftAt`, `durationSeconds`, `actorKind`, `actorMemberId` and Ken\'s `reason` on a move its stage judge made. With the `deal_stage_rules` flag on, each entry also has `changedBy` (`member`, `agent`, `api_key`, `workflow`, `stage_judge`, `crm_sync` or `ken_automation`), `crmProvider` on a CRM sync, and on a move `fromStageLabel` and `fromStageDurationSeconds`, how long the deal sat in the stage it left. `isComplete` false means Kenso has no record of part of the history.\n\n## Required fields per stage\n\n```bash\nkenso pipelines stage-rules\nkenso pipelines stage-rules proposal --require amount,closeDate,custom.tier\nkenso pipelines stage-rules proposal --none\nkenso pipelines stage-rules lost --default\n```\n\nWith the `deal_stage_rules` flag on, each stage can name the fields a deal should have in it. Without a stage the command prints every stage\'s `key`, `label`, `category`, `isArchived`, `requiredFields` and `isDefault`, plus `requirableFields`: `amount`, `closeDate`, `ownerMemberId`, `primaryPersonId`, `nextStep`, `lostReasonKey`, `wonReasonKey` and `custom.<key>` for each custom deal field. `--require` sets the stage\'s whole list, in order, at most 10. `--none` requires nothing, and `--default` goes back to the default: a lost stage asks for `lostReasonKey`, any other stage nothing. Setting a rule needs the `workspace_settings` permission. The same as the MCP\'s `opportunities(operation="stages-set-required-fields")`.\n\nA missing field never stops a move. The deal moves, and it is flagged Missing on the board, the list and the deal page until the field is filled. A rule also applies to deals already in the stage.\n\n## Tasks\n\nTasks are to-dos a member owes: a title, an optional due day or time, an assignee and at most one account, person or deal. They need the `tasks` flag. The app calls deals "Deals"; the CLI keeps `--deal` for an opportunity id.\n\n```bash\nkenso tasks add "Send the deck" --due 2026-11-20 --account 812\nkenso tasks add "Call Ada back" --due 2026-11-18T16:00:00Z --person 501 --assignee 42\nkenso tasks list --assignee me --due overdue,today\nkenso task-queue list --scope mine\nkenso tasks assign 7 42\nkenso tasks done 7\nkenso tasks done 7 --undo\n```\n\n- `tasks add` sends `POST /v1/tasks`. Without `--assignee` the task is yours. A `--due` time\'s day is read in the assignee\'s app time zone.\n- `tasks done` completes the task (`PATCH /v1/tasks/{id}` with `status: done`), `--undo` reopens it. `tasks assign` gives it to another member, who gets a `task_assigned` notification.\n- `tasks list`, `get`, `update`, `delete`, `restore` and `task-queue list` are generated from the API: `kenso tasks --help` lists them. `task-queue list` is the Tasks screen\'s open work: tasks, manual touches and call tasks, by due day.\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: (command53, args) => {
8980
- const child = nodeSpawn(command53, args, { detached: true, stdio: "ignore" });
8979
+ spawn: (command56, args) => {
8980
+ const child = nodeSpawn(command56, 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: (command53, args) => {
10170
- const child = nodeSpawn2(command53, args, { detached: true, stdio: "ignore" });
10169
+ spawn: (command56, args) => {
10170
+ const child = nodeSpawn2(command56, 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, command53, hint) {
10211
+ function requireFlag(flags, name, command56, hint) {
10212
10212
  const value = stringFlag2(flags, name);
10213
- if (value === void 0) throw usageError(`--${name} is required for ${command53}.`, { field: name, next: `${command53} --help`, ...hint ? { hint } : {} });
10213
+ if (value === void 0) throw usageError(`--${name} is required for ${command56}.`, { field: name, next: `${command56} --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, command53) {
10223
- const raw = requireFlag(flags, name, command53);
10222
+ function idFlag(flags, name, command56) {
10223
+ const raw = requireFlag(flags, name, command56);
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(command53, flags, ctx, extra = []) {
10244
- const parts2 = [command53];
10243
+ function sameCommand2(command56, flags, ctx, extra = []) {
10244
+ const parts2 = [command56];
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, command53, args) {
11381
+ async function unfinishedWhereIds(ctx, command56, 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 !== command53 || run.status === "done" || run.status === "planned") continue;
11386
+ if (run.command !== command56 || 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 command53 = `kenso contacts ${kind}`;
11532
+ const command56 = `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(`${command53} needs exactly one of ${choices}.`, { field: "ids", next: `${command53} --help` });
11539
+ throw usageError(`${command56} needs exactly one of ${choices}.`, { field: "ids", next: `${command56} --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);
@@ -14741,6 +14741,171 @@ var init_studio2 = __esm({
14741
14741
  }
14742
14742
  });
14743
14743
 
14744
+ // src/commands/tasks/shared.ts
14745
+ function positiveId3(text4, field, next) {
14746
+ const value = (text4 ?? "").trim();
14747
+ const id = /^\d+$/.test(value) ? Number(value) : Number.NaN;
14748
+ if (!Number.isSafeInteger(id) || id < 1) throw usageError(`${field} must be a positive whole number (got "${value}").`, { field, next });
14749
+ return id;
14750
+ }
14751
+ function due(text4) {
14752
+ const value = text4.trim();
14753
+ if (/^\d{4}-\d{2}-\d{2}$/.test(value)) return { dueDate: value };
14754
+ if (/^\d{4}-\d{2}-\d{2}T/.test(value) && !Number.isNaN(Date.parse(value))) return { dueAt: value };
14755
+ throw usageError(`--due must be a day (2026-11-20) or an ISO 8601 time (2026-11-20T15:00:00Z) (got "${value}").`, { field: "due" });
14756
+ }
14757
+ var init_shared2 = __esm({
14758
+ "src/commands/tasks/shared.ts"() {
14759
+ "use strict";
14760
+ init_errors();
14761
+ }
14762
+ });
14763
+
14764
+ // src/commands/tasks/add.ts
14765
+ var add_exports = {};
14766
+ __export(add_exports, {
14767
+ default: () => add_default
14768
+ });
14769
+ var NEXT, command44, add_default;
14770
+ var init_add = __esm({
14771
+ "src/commands/tasks/add.ts"() {
14772
+ "use strict";
14773
+ init_errors();
14774
+ init_exit_codes();
14775
+ init_http();
14776
+ init_shared2();
14777
+ NEXT = 'kenso tasks add "Send the deck" --due 2026-11-20 --account 812';
14778
+ command44 = {
14779
+ resource: "tasks",
14780
+ action: "add",
14781
+ summary: "Add a task: a title, an optional due day or time, assignee and the account, person or deal it is about",
14782
+ description: "Sends POST /v1/tasks and prints the task. The words after add are the title (1-500 characters). --due takes a day (2026-11-20) or a time (2026-11-20T15:00:00Z; its day is read in the assignee's app time zone). Without --assignee the task is yours. Link at most one of --account, --person, --deal: a person's task also shows on their first account, a deal's on its account and primary person. Linking an account on a plan without Accounts is plan_required.",
14783
+ flags: {
14784
+ due: { type: "string", description: "Due day (YYYY-MM-DD) or time (ISO 8601)" },
14785
+ assignee: { type: "string", description: "The member it is for (a member id); default you" },
14786
+ notes: { type: "string", description: "Notes (markdown)" },
14787
+ account: { type: "string", description: "Account id it is about" },
14788
+ person: { type: "string", description: "Person id it is about" },
14789
+ deal: { type: "string", description: "Deal (opportunity) id it is about" }
14790
+ },
14791
+ positionals: [{ name: "title", required: true, variadic: true, description: "The task, such as Send the deck to Maya" }],
14792
+ examples: [NEXT, 'kenso tasks add "Call Ada back" --due 2026-11-18T16:00:00Z --person 501 --assignee 42'],
14793
+ beta: { featureGates: { all: ["tasks"] } },
14794
+ operationIds: ["tasks.create"],
14795
+ async run(ctx, { flags, positionals }) {
14796
+ const title = positionals.join(" ").trim();
14797
+ if (title === "") throw usageError("Give the task a title.", { field: "title", next: NEXT });
14798
+ const links = ["account", "person", "deal"].filter((name) => typeof flags[name] === "string");
14799
+ if (links.length > 1) throw usageError("Link the task to one record: --account, --person or --deal.", { field: links[1], next: NEXT });
14800
+ const body2 = { title };
14801
+ if (typeof flags.notes === "string") body2.notes = flags.notes;
14802
+ if (typeof flags.assignee === "string") body2.assigneeMemberId = positiveId3(flags.assignee, "assignee", NEXT);
14803
+ if (typeof flags.due === "string") Object.assign(body2, due(flags.due));
14804
+ if (typeof flags.account === "string") body2.accountId = positiveId3(flags.account, "account", NEXT);
14805
+ if (typeof flags.person === "string") body2.personId = positiveId3(flags.person, "person", NEXT);
14806
+ if (typeof flags.deal === "string") body2.opportunityId = positiveId3(flags.deal, "deal", NEXT);
14807
+ const res = await ctx.client.request({ method: "POST", path: "/v1/tasks", body: body2, signal: ctx.signal });
14808
+ ctx.output.object(unwrap(res.body));
14809
+ return ExitCode.Ok;
14810
+ }
14811
+ };
14812
+ add_default = command44;
14813
+ }
14814
+ });
14815
+
14816
+ // src/commands/tasks/done.ts
14817
+ var done_exports = {};
14818
+ __export(done_exports, {
14819
+ default: () => done_default,
14820
+ patchTask: () => patchTask
14821
+ });
14822
+ async function patchTask(ctx, taskId, change) {
14823
+ const send2 = () => ctx.client.request({ method: "PATCH", path: `/v1/tasks/${taskId}`, body: change, signal: ctx.signal });
14824
+ try {
14825
+ return unwrap((await send2()).body);
14826
+ } catch (error) {
14827
+ if (!(error instanceof KensoError) || error.httpStatus !== 409) throw error;
14828
+ return unwrap((await send2()).body);
14829
+ }
14830
+ }
14831
+ var command45, done_default;
14832
+ var init_done = __esm({
14833
+ "src/commands/tasks/done.ts"() {
14834
+ "use strict";
14835
+ init_errors();
14836
+ init_exit_codes();
14837
+ init_http();
14838
+ init_shared2();
14839
+ command45 = {
14840
+ resource: "tasks",
14841
+ action: "done",
14842
+ summary: "Complete a task (--undo reopens it)",
14843
+ description: "Sends PATCH /v1/tasks/{taskId} with status done and prints the task: completedAt and completedByMemberId set, and task.completed written on the record's timeline. --undo sends status open, which reopens it.",
14844
+ flags: { undo: { type: "boolean", description: "Reopen the task instead" } },
14845
+ positionals: [{ name: "taskId", required: true, description: "The task id" }],
14846
+ examples: ["kenso tasks done 7", "kenso tasks done 7 --undo"],
14847
+ beta: { featureGates: { all: ["tasks"] } },
14848
+ operationIds: ["tasks.update"],
14849
+ async run(ctx, { flags, positionals }) {
14850
+ const taskId = positiveId3(positionals[0], "taskId", "kenso tasks done <taskId>");
14851
+ ctx.output.object(await patchTask(ctx, taskId, { status: flags.undo === true ? "open" : "done" }));
14852
+ return ExitCode.Ok;
14853
+ }
14854
+ };
14855
+ done_default = command45;
14856
+ }
14857
+ });
14858
+
14859
+ // src/commands/tasks/assign.ts
14860
+ var assign_exports = {};
14861
+ __export(assign_exports, {
14862
+ default: () => assign_default
14863
+ });
14864
+ var NEXT2, command46, assign_default;
14865
+ var init_assign = __esm({
14866
+ "src/commands/tasks/assign.ts"() {
14867
+ "use strict";
14868
+ init_exit_codes();
14869
+ init_done();
14870
+ init_shared2();
14871
+ NEXT2 = "kenso tasks assign <taskId> <memberId>";
14872
+ command46 = {
14873
+ resource: "tasks",
14874
+ action: "assign",
14875
+ summary: "Give a task to a member",
14876
+ description: "Sends PATCH /v1/tasks/{taskId} with assigneeMemberId and prints the task. The member gets a task_assigned notification unless they assigned it themselves. A member id outside the workspace is invalid_member.",
14877
+ flags: {},
14878
+ positionals: [
14879
+ { name: "taskId", required: true, description: "The task id" },
14880
+ { name: "memberId", required: true, description: "The member it is for" }
14881
+ ],
14882
+ examples: ["kenso tasks assign 7 42"],
14883
+ beta: { featureGates: { all: ["tasks"] } },
14884
+ operationIds: ["tasks.update"],
14885
+ async run(ctx, { positionals }) {
14886
+ const taskId = positiveId3(positionals[0], "taskId", NEXT2);
14887
+ const memberId = positiveId3(positionals[1], "memberId", NEXT2);
14888
+ ctx.output.object(await patchTask(ctx, taskId, { assigneeMemberId: memberId }));
14889
+ return ExitCode.Ok;
14890
+ }
14891
+ };
14892
+ assign_default = command46;
14893
+ }
14894
+ });
14895
+
14896
+ // src/commands/tasks/index.ts
14897
+ var actions25;
14898
+ var init_tasks = __esm({
14899
+ "src/commands/tasks/index.ts"() {
14900
+ "use strict";
14901
+ actions25 = {
14902
+ add: () => Promise.resolve().then(() => (init_add(), add_exports)).then((m) => m.default),
14903
+ done: () => Promise.resolve().then(() => (init_done(), done_exports)).then((m) => m.default),
14904
+ assign: () => Promise.resolve().then(() => (init_assign(), assign_exports)).then((m) => m.default)
14905
+ };
14906
+ }
14907
+ });
14908
+
14744
14909
  // src/commands/webhooks/local.ts
14745
14910
  import { createHmac, randomBytes as randomBytes2 } from "node:crypto";
14746
14911
  import { mkdirSync as mkdirSync4, readFileSync as readFileSync10, rmSync as rmSync2, writeFileSync as writeFileSync4 } from "node:fs";
@@ -14873,7 +15038,7 @@ function readBody(req) {
14873
15038
  function reply(res, status, body2) {
14874
15039
  res.writeHead(status, { "content-type": "application/json" }).end(JSON.stringify(body2));
14875
15040
  }
14876
- var MIN_POLL_MS, MAX_POLL_MS, MAX_TRIGGER_BYTES, command44, listen_default;
15041
+ var MIN_POLL_MS, MAX_POLL_MS, MAX_TRIGGER_BYTES, command47, listen_default;
14877
15042
  var init_listen = __esm({
14878
15043
  "src/commands/webhooks/listen.ts"() {
14879
15044
  "use strict";
@@ -14884,7 +15049,7 @@ var init_listen = __esm({
14884
15049
  MIN_POLL_MS = 1e3;
14885
15050
  MAX_POLL_MS = 6e4;
14886
15051
  MAX_TRIGGER_BYTES = 1e6;
14887
- command44 = {
15052
+ command47 = {
14888
15053
  resource: "webhooks",
14889
15054
  action: "listen",
14890
15055
  summary: "Stream the workspace's events and forward them, signed, to a local handler",
@@ -14990,7 +15155,7 @@ var init_listen = __esm({
14990
15155
  return ExitCode.Ok;
14991
15156
  }
14992
15157
  };
14993
- listen_default = command44;
15158
+ listen_default = command47;
14994
15159
  }
14995
15160
  });
14996
15161
 
@@ -15009,7 +15174,7 @@ function notRunning() {
15009
15174
  next: LISTEN_NEXT
15010
15175
  });
15011
15176
  }
15012
- var LISTEN_NEXT, command45, trigger_default;
15177
+ var LISTEN_NEXT, command48, trigger_default;
15013
15178
  var init_trigger = __esm({
15014
15179
  "src/commands/webhooks/trigger.ts"() {
15015
15180
  "use strict";
@@ -15018,7 +15183,7 @@ var init_trigger = __esm({
15018
15183
  init_http();
15019
15184
  init_local();
15020
15185
  LISTEN_NEXT = "kenso webhooks listen --forward-to http://localhost:3000/hook";
15021
- command45 = {
15186
+ command48 = {
15022
15187
  resource: "webhooks",
15023
15188
  action: "trigger",
15024
15189
  summary: "Send a sample event of one type through the running kenso webhooks listen",
@@ -15075,16 +15240,16 @@ var init_trigger = __esm({
15075
15240
  return ExitCode.Ok;
15076
15241
  }
15077
15242
  };
15078
- trigger_default = command45;
15243
+ trigger_default = command48;
15079
15244
  }
15080
15245
  });
15081
15246
 
15082
15247
  // src/commands/webhooks/index.ts
15083
- var actions25;
15248
+ var actions26;
15084
15249
  var init_webhooks2 = __esm({
15085
15250
  "src/commands/webhooks/index.ts"() {
15086
15251
  "use strict";
15087
- actions25 = {
15252
+ actions26 = {
15088
15253
  listen: () => Promise.resolve().then(() => (init_listen(), listen_exports)).then((m) => m.default),
15089
15254
  trigger: () => Promise.resolve().then(() => (init_trigger(), trigger_exports)).then((m) => m.default)
15090
15255
  };
@@ -15279,14 +15444,14 @@ var status_exports3 = {};
15279
15444
  __export(status_exports3, {
15280
15445
  default: () => status_default3
15281
15446
  });
15282
- var command46, status_default3;
15447
+ var command49, status_default3;
15283
15448
  var init_status3 = __esm({
15284
15449
  "src/commands/work/status.ts"() {
15285
15450
  "use strict";
15286
15451
  init_exit_codes();
15287
15452
  init_http();
15288
15453
  init_common3();
15289
- command46 = {
15454
+ command49 = {
15290
15455
  resource: "work",
15291
15456
  action: "status",
15292
15457
  summary: "Show the Kenso AI work waiting for your own agent, per kind",
@@ -15320,7 +15485,7 @@ var init_status3 = __esm({
15320
15485
  return ExitCode.Ok;
15321
15486
  }
15322
15487
  };
15323
- status_default3 = command46;
15488
+ status_default3 = command49;
15324
15489
  }
15325
15490
  });
15326
15491
 
@@ -15452,9 +15617,9 @@ var init_files = __esm({
15452
15617
  import { execFile, spawnSync as spawnSync2 } from "node:child_process";
15453
15618
  import { readFileSync as readFileSync12 } from "node:fs";
15454
15619
  import { isAbsolute as isAbsolute2 } from "node:path";
15455
- function sudoArgs(user, command53, args, keep = [], set = {}) {
15620
+ function sudoArgs(user, command56, args, keep = [], set = {}) {
15456
15621
  const assignments = Object.entries(set).map(([name, value]) => `${name}=${value}`);
15457
- return ["-n", "-u", user, "-H", ...keep.length > 0 ? [`--preserve-env=${keep.join(",")}`] : [], ...assignments, "--", command53, ...args];
15622
+ return ["-n", "-u", user, "-H", ...keep.length > 0 ? [`--preserve-env=${keep.join(",")}`] : [], ...assignments, "--", command56, ...args];
15458
15623
  }
15459
15624
  function agentKensoEnv(opts) {
15460
15625
  return {
@@ -15464,12 +15629,12 @@ function agentKensoEnv(opts) {
15464
15629
  AI_AGENT: opts.agentName
15465
15630
  };
15466
15631
  }
15467
- function sudoExec(user, command53, args, opts = {}) {
15632
+ function sudoExec(user, command56, args, opts = {}) {
15468
15633
  const [sudo = "/usr/bin/sudo", ...lead] = user.sudo;
15469
15634
  return new Promise((resolve16) => {
15470
15635
  execFile(
15471
15636
  sudo,
15472
- [...lead, ...sudoArgs(user.name, command53, args)],
15637
+ [...lead, ...sudoArgs(user.name, command56, args)],
15473
15638
  { env: { PATH: SUDO_PATH }, cwd: "/", timeout: opts.timeoutMs ?? PROBE_TIMEOUT_MS, maxBuffer: opts.maxBuffer ?? 1024 * 1024, encoding: "utf8", windowsHide: true, shell: false },
15474
15639
  (err, stdout, stderr) => {
15475
15640
  const code = err ? err.code : 0;
@@ -15579,9 +15744,9 @@ var init_folder2 = __esm({
15579
15744
  init_redact();
15580
15745
  init_agent_user();
15581
15746
  WorkRunFolder = class {
15582
- constructor(ctx, command53, args, outDir, shared = false) {
15747
+ constructor(ctx, command56, args, outDir, shared = false) {
15583
15748
  this.ctx = ctx;
15584
- this.command = command53;
15749
+ this.command = command56;
15585
15750
  this.args = args;
15586
15751
  this.outDir = outDir;
15587
15752
  this.shared = shared;
@@ -15696,7 +15861,7 @@ var pull_exports2 = {};
15696
15861
  __export(pull_exports2, {
15697
15862
  default: () => pull_default2
15698
15863
  });
15699
- var MAX_FILES, command47, pull_default2;
15864
+ var MAX_FILES, command50, pull_default2;
15700
15865
  var init_pull2 = __esm({
15701
15866
  "src/commands/work/pull.ts"() {
15702
15867
  "use strict";
@@ -15705,7 +15870,7 @@ var init_pull2 = __esm({
15705
15870
  init_common3();
15706
15871
  init_folder2();
15707
15872
  MAX_FILES = 100;
15708
- command47 = {
15873
+ command50 = {
15709
15874
  resource: "work",
15710
15875
  action: "pull",
15711
15876
  summary: "Claim waiting work into local work files, to answer by hand",
@@ -15783,7 +15948,7 @@ var init_pull2 = __esm({
15783
15948
  return interrupted7 ? ExitCode.Interrupted : ExitCode.Ok;
15784
15949
  }
15785
15950
  };
15786
- pull_default2 = command47;
15951
+ pull_default2 = command50;
15787
15952
  }
15788
15953
  });
15789
15954
 
@@ -15925,7 +16090,7 @@ __export(submit_exports, {
15925
16090
  default: () => submit_default
15926
16091
  });
15927
16092
  import { resolve as resolve14 } from "node:path";
15928
- var command48, submit_default;
16093
+ var command51, submit_default;
15929
16094
  var init_submit = __esm({
15930
16095
  "src/commands/work/submit.ts"() {
15931
16096
  "use strict";
@@ -15934,7 +16099,7 @@ var init_submit = __esm({
15934
16099
  init_files();
15935
16100
  init_answers();
15936
16101
  init_common3();
15937
- command48 = {
16102
+ command51 = {
15938
16103
  resource: "work",
15939
16104
  action: "submit",
15940
16105
  summary: "Send answers files to Kenso and write each one's results",
@@ -15966,7 +16131,7 @@ var init_submit = __esm({
15966
16131
  return totals.rejected > 0 ? ExitCode.Partial : ExitCode.Ok;
15967
16132
  }
15968
16133
  };
15969
- submit_default = command48;
16134
+ submit_default = command51;
15970
16135
  }
15971
16136
  });
15972
16137
 
@@ -15987,7 +16152,7 @@ function claimIdOf(arg) {
15987
16152
  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..." });
15988
16153
  return arg;
15989
16154
  }
15990
- var CLAIM_ID, command49, release_default;
16155
+ var CLAIM_ID, command52, release_default;
15991
16156
  var init_release = __esm({
15992
16157
  "src/commands/work/release.ts"() {
15993
16158
  "use strict";
@@ -15996,7 +16161,7 @@ var init_release = __esm({
15996
16161
  init_files();
15997
16162
  init_common3();
15998
16163
  CLAIM_ID = /^[A-Za-z0-9_-]{1,64}$/;
15999
- command49 = {
16164
+ command52 = {
16000
16165
  resource: "work",
16001
16166
  action: "release",
16002
16167
  summary: "Give claimed work back to the queue now",
@@ -16015,7 +16180,7 @@ var init_release = __esm({
16015
16180
  return ExitCode.Ok;
16016
16181
  }
16017
16182
  };
16018
- release_default = command49;
16183
+ release_default = command52;
16019
16184
  }
16020
16185
  });
16021
16186
 
@@ -16354,12 +16519,12 @@ function plain(text4) {
16354
16519
  return text4.replace(/\x1b\[[0-9;?]*[A-Za-z]/g, "");
16355
16520
  }
16356
16521
  function runStatus(bin, args, env, adapter, runAs) {
16357
- const command53 = runAs ? runAs.sudo[0] ?? "/usr/bin/sudo" : bin;
16522
+ const command56 = runAs ? runAs.sudo[0] ?? "/usr/bin/sudo" : bin;
16358
16523
  const commandArgs2 = runAs ? [...runAs.sudo.slice(1), ...sudoArgs(runAs.name, bin, args)] : args;
16359
16524
  const options = runAs ? { env: { PATH: SUDO_PATH }, cwd: "/" } : { env: childEnv(env, adapter) };
16360
16525
  return new Promise((resolve16) => {
16361
16526
  execFile2(
16362
- command53,
16527
+ command56,
16363
16528
  commandArgs2,
16364
16529
  { ...options, timeout: STATUS_TIMEOUT_MS, maxBuffer: 1024 * 1024, windowsHide: true, shell: false },
16365
16530
  (err, stdout, stderr) => {
@@ -17441,7 +17606,7 @@ var run_exports3 = {};
17441
17606
  __export(run_exports3, {
17442
17607
  default: () => run_default2
17443
17608
  });
17444
- var FAILURES_IN_A_ROW, command50, run_default2;
17609
+ var FAILURES_IN_A_ROW, command53, run_default2;
17445
17610
  var init_run3 = __esm({
17446
17611
  "src/commands/work/run.ts"() {
17447
17612
  "use strict";
@@ -17462,7 +17627,7 @@ var init_run3 = __esm({
17462
17627
  init_folder2();
17463
17628
  init_stop();
17464
17629
  FAILURES_IN_A_ROW = 3;
17465
- command50 = {
17630
+ command53 = {
17466
17631
  resource: "work",
17467
17632
  action: "run",
17468
17633
  summary: "Run your own coding agent on the waiting work until the queue is empty",
@@ -17787,16 +17952,16 @@ var init_run3 = __esm({
17787
17952
  return exitCodeFor(reason, totals.rejected > 0 || jobsFailed > 0);
17788
17953
  }
17789
17954
  };
17790
- run_default2 = command50;
17955
+ run_default2 = command53;
17791
17956
  }
17792
17957
  });
17793
17958
 
17794
17959
  // src/commands/work/index.ts
17795
- var actions26;
17960
+ var actions27;
17796
17961
  var init_work2 = __esm({
17797
17962
  "src/commands/work/index.ts"() {
17798
17963
  "use strict";
17799
- actions26 = {
17964
+ actions27 = {
17800
17965
  status: () => Promise.resolve().then(() => (init_status3(), status_exports3)).then((m) => m.default),
17801
17966
  pull: () => Promise.resolve().then(() => (init_pull2(), pull_exports2)).then((m) => m.default),
17802
17967
  submit: () => Promise.resolve().then(() => (init_submit(), submit_exports)).then((m) => m.default),
@@ -17820,14 +17985,14 @@ function parseLimit(value) {
17820
17985
  }
17821
17986
  return limit;
17822
17987
  }
17823
- var MAX_LIMIT, command51, list_default3;
17988
+ var MAX_LIMIT, command54, list_default3;
17824
17989
  var init_list3 = __esm({
17825
17990
  "src/commands/workspace/list.ts"() {
17826
17991
  "use strict";
17827
17992
  init_errors();
17828
17993
  init_exit_codes();
17829
17994
  MAX_LIMIT = 200;
17830
- command51 = {
17995
+ command54 = {
17831
17996
  resource: "workspace",
17832
17997
  action: "list",
17833
17998
  summary: "List the workspaces your key can use",
@@ -17855,7 +18020,7 @@ var init_list3 = __esm({
17855
18020
  return ExitCode.Ok;
17856
18021
  }
17857
18022
  };
17858
- list_default3 = command51;
18023
+ list_default3 = command54;
17859
18024
  }
17860
18025
  });
17861
18026
 
@@ -17864,7 +18029,7 @@ var use_exports = {};
17864
18029
  __export(use_exports, {
17865
18030
  default: () => use_default
17866
18031
  });
17867
- var command52, use_default;
18032
+ var command55, use_default;
17868
18033
  var init_use = __esm({
17869
18034
  "src/commands/workspace/use.ts"() {
17870
18035
  "use strict";
@@ -17872,7 +18037,7 @@ var init_use = __esm({
17872
18037
  init_errors();
17873
18038
  init_exit_codes();
17874
18039
  init_http();
17875
- command52 = {
18040
+ command55 = {
17876
18041
  resource: "workspace",
17877
18042
  action: "use",
17878
18043
  summary: "Set the profile's default workspace",
@@ -17929,16 +18094,16 @@ var init_use = __esm({
17929
18094
  return ExitCode.Ok;
17930
18095
  }
17931
18096
  };
17932
- use_default = command52;
18097
+ use_default = command55;
17933
18098
  }
17934
18099
  });
17935
18100
 
17936
18101
  // src/commands/workspace/index.ts
17937
- var actions27;
18102
+ var actions28;
17938
18103
  var init_workspace = __esm({
17939
18104
  "src/commands/workspace/index.ts"() {
17940
18105
  "use strict";
17941
- actions27 = {
18106
+ actions28 = {
17942
18107
  list: () => Promise.resolve().then(() => (init_list3(), list_exports3)).then((m) => m.default),
17943
18108
  use: () => Promise.resolve().then(() => (init_use(), use_exports)).then((m) => m.default)
17944
18109
  };
@@ -17982,6 +18147,7 @@ var init_registry = __esm({
17982
18147
  init_sandbox2();
17983
18148
  init_skill();
17984
18149
  init_studio2();
18150
+ init_tasks();
17985
18151
  init_webhooks2();
17986
18152
  init_work2();
17987
18153
  init_workspace();
@@ -18012,10 +18178,11 @@ var init_registry = __esm({
18012
18178
  sandbox: actions22,
18013
18179
  skill: actions23,
18014
18180
  studio: actions24,
18015
- webhooks: actions25,
18181
+ tasks: actions25,
18182
+ webhooks: actions26,
18016
18183
  whoami: topLevel("whoami", actions4.status, "kenso auth status"),
18017
- work: actions26,
18018
- workspace: actions27
18184
+ work: actions27,
18185
+ workspace: actions28
18019
18186
  };
18020
18187
  resourceAliases = { leads: "contacts" };
18021
18188
  }
@@ -18152,8 +18319,8 @@ async function renderTopHelp(opts) {
18152
18319
  names.push(withPositionals(spec, spec.action));
18153
18320
  groups.set(hint, names);
18154
18321
  }
18155
- const actions29 = [...groups.entries()].map(([hint, names]) => `${names.join(", ")}${hint}`);
18156
- if (actions29.length > 0) rows.push([resource, actions29.join(", ")]);
18322
+ const actions30 = [...groups.entries()].map(([hint, names]) => `${names.join(", ")}${hint}`);
18323
+ if (actions30.length > 0) rows.push([resource, actions30.join(", ")]);
18157
18324
  }
18158
18325
  const at = 4 + Math.min(22, Math.max(0, ...rows.map(([left]) => left.length)));
18159
18326
  lines.push(
@@ -18166,7 +18333,7 @@ async function renderTopHelp(opts) {
18166
18333
  const [area = "", action = ""] = name.split(" ");
18167
18334
  byArea.set(area, [...byArea.get(area) ?? [], action]);
18168
18335
  }
18169
- const named = [...byArea.entries()].map(([area, actions29]) => `${area} ${actions29.join("|")}`);
18336
+ const named = [...byArea.entries()].map(([area, actions30]) => `${area} ${actions30.join("|")}`);
18170
18337
  lines.push(wrap(`Beta, hidden here but they run (the server decides): ${named.join(", ")}.`, " "));
18171
18338
  }
18172
18339
  const generated = await listGenerated({ features: opts.allCommands ? [] : getFeatures, env: opts.env });
@@ -18174,13 +18341,13 @@ async function renderTopHelp(opts) {
18174
18341
  if (visible.length > 0) {
18175
18342
  const byResource = /* @__PURE__ */ new Map();
18176
18343
  for (const g of visible) {
18177
- const actions29 = byResource.get(g.resource) ?? [];
18178
- actions29.push(`${g.action}${g.beta ? " (beta)" : ""}`);
18179
- byResource.set(g.resource, actions29);
18344
+ const actions30 = byResource.get(g.resource) ?? [];
18345
+ actions30.push(`${g.action}${g.beta ? " (beta)" : ""}`);
18346
+ byResource.set(g.resource, actions30);
18180
18347
  }
18181
18348
  const sorted2 = [...byResource.entries()].sort(([a], [b]) => a.localeCompare(b));
18182
18349
  if (opts.allCommands) {
18183
- const generatedRows = sorted2.map(([resource, actions29]) => [resource, actions29.sort().join(", ")]);
18350
+ const generatedRows = sorted2.map(([resource, actions30]) => [resource, actions30.sort().join(", ")]);
18184
18351
  lines.push("", "API resources (kenso <resource> <action>):", columns(generatedRows));
18185
18352
  } else {
18186
18353
  const names = new Set(sorted2.map(([resource]) => resource));
@@ -18496,8 +18663,8 @@ function startUpdateNotice(argv, opts = {}) {
18496
18663
  if (!found) return;
18497
18664
  writeCheck(file, { checkedAt: new Date(now).toISOString(), latest: found });
18498
18665
  if (isNewer(found, version)) {
18499
- const command53 = updateCommand(install, opts.platform ?? process.platform);
18500
- stderr.write(`kenso ${found} is out (you have ${version}): ${command53}
18666
+ const command56 = updateCommand(install, opts.platform ?? process.platform);
18667
+ stderr.write(`kenso ${found} is out (you have ${version}): ${command56}
18501
18668
  Turn this off with KENSO_NO_UPDATE_NOTIFIER=1.
18502
18669
  `);
18503
18670
  }
@@ -18539,7 +18706,7 @@ function resources() {
18539
18706
  const names = Object.entries(handWritten).filter(([, area]) => Object.keys(area).length > 0).map(([resource]) => resource);
18540
18707
  return sorted([...names, ...Object.keys(resourceAliases), ...loadManifest().operations.map((op) => op.resource)]);
18541
18708
  }
18542
- function actions28(resource) {
18709
+ function actions29(resource) {
18543
18710
  const own = Object.keys(handWritten[resource] ?? {}).filter((action) => action !== "");
18544
18711
  return sorted([...own, ...loadManifest().operations.filter((op) => op.resource === resource).map((op) => op.action)]);
18545
18712
  }
@@ -18604,7 +18771,7 @@ async function completions(words, globals) {
18604
18771
  return flagsOf2(spec, globals, positionals.length === 0);
18605
18772
  }
18606
18773
  if (positionals.length === 0) return resources();
18607
- if (!spec) return positionals.length === 1 ? actions28(resourceAliases[positionals[0]] ?? positionals[0]) : [];
18774
+ if (!spec) return positionals.length === 1 ? actions29(resourceAliases[positionals[0]] ?? positionals[0]) : [];
18608
18775
  const given = positionals.length - commandWords;
18609
18776
  const declared = spec.positionals ?? [];
18610
18777
  if (given < declared.length || declared.at(-1)?.variadic === true) {
@@ -18698,9 +18865,9 @@ function normalizeBooleans(argv, names, strict) {
18698
18865
  async function knownCommands() {
18699
18866
  const commands = /* @__PURE__ */ new Set();
18700
18867
  for (const [resource, area] of Object.entries(handWritten)) {
18701
- const actions29 = Object.keys(area);
18702
- if (actions29.length > 0) commands.add(resource);
18703
- for (const action of actions29) commands.add(action ? `${resource} ${action}` : resource);
18868
+ const actions30 = Object.keys(area);
18869
+ if (actions30.length > 0) commands.add(resource);
18870
+ for (const action of actions30) commands.add(action ? `${resource} ${action}` : resource);
18704
18871
  }
18705
18872
  for (const g of await listGenerated({ features: [] })) {
18706
18873
  commands.add(g.resource);