kenso 0.1.96 → 0.1.98
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/CHANGELOG.md +4 -0
- package/dist/kenso.js +246 -93
- package/dist/operations.json +1 -1
- package/docs/crm.md +15 -1
- package/docs/reference.md +46 -2
- package/package.json +2 -2
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.
|
|
2480
|
+
VERSION = true ? "0.1.98" : "0.0.0-dev";
|
|
2481
2481
|
}
|
|
2482
2482
|
});
|
|
2483
2483
|
|
|
@@ -2664,13 +2664,13 @@ function findOperationById(id) {
|
|
|
2664
2664
|
}
|
|
2665
2665
|
function useManifestForTest(manifest) {
|
|
2666
2666
|
const previous = override;
|
|
2667
|
-
const
|
|
2667
|
+
const set2 = (value) => {
|
|
2668
2668
|
override = value;
|
|
2669
2669
|
byCommand = void 0;
|
|
2670
2670
|
byId = void 0;
|
|
2671
2671
|
};
|
|
2672
|
-
|
|
2673
|
-
return () =>
|
|
2672
|
+
set2(manifest);
|
|
2673
|
+
return () => set2(previous);
|
|
2674
2674
|
}
|
|
2675
2675
|
var EMPTY, parsed, override, byCommand, byId;
|
|
2676
2676
|
var init_manifest = __esm({
|
|
@@ -7982,23 +7982,27 @@ function idList(flags, name) {
|
|
|
7982
7982
|
}
|
|
7983
7983
|
return [...new Set(ids2)];
|
|
7984
7984
|
}
|
|
7985
|
-
function
|
|
7986
|
-
|
|
7985
|
+
function jsonValue(text4) {
|
|
7986
|
+
try {
|
|
7987
|
+
return JSON.parse(text4);
|
|
7988
|
+
} catch {
|
|
7989
|
+
return void 0;
|
|
7990
|
+
}
|
|
7991
|
+
}
|
|
7992
|
+
function parseSet(pairs, aliases, textFields = []) {
|
|
7993
|
+
const set2 = {};
|
|
7987
7994
|
for (const pair of pairs) {
|
|
7988
7995
|
const at = pair.indexOf("=");
|
|
7989
7996
|
const key = at > 0 ? pair.slice(0, at).trim() : "";
|
|
7990
7997
|
if (key === "") throw usageError(`--set takes field=value (got "${pair}").`, { field: "set", hint: "For example --set stage=engaged." });
|
|
7991
7998
|
const text4 = pair.slice(at + 1).trim();
|
|
7992
|
-
let value = text4;
|
|
7993
|
-
try {
|
|
7994
|
-
value = JSON.parse(text4);
|
|
7995
|
-
} catch {
|
|
7996
|
-
}
|
|
7997
7999
|
const field = aliases[key] ?? key;
|
|
7998
|
-
if (field in
|
|
7999
|
-
|
|
8000
|
+
if (field in set2) throw usageError(`--set names ${field} twice.`, { field: "set" });
|
|
8001
|
+
const json = jsonValue(text4);
|
|
8002
|
+
const asText = textFields.includes(field) && json !== null && typeof json !== "string";
|
|
8003
|
+
set2[field] = asText || json === void 0 ? text4 : json;
|
|
8000
8004
|
}
|
|
8001
|
-
return
|
|
8005
|
+
return set2;
|
|
8002
8006
|
}
|
|
8003
8007
|
function filterBody(flags) {
|
|
8004
8008
|
const raw = stringFlag2(flags, "filter");
|
|
@@ -8018,7 +8022,7 @@ function targetBody(flags, target2, command65) {
|
|
|
8018
8022
|
const ids2 = idList(flags, "ids");
|
|
8019
8023
|
const filter = filterBody(flags);
|
|
8020
8024
|
const everything = flags.all === true;
|
|
8021
|
-
if (
|
|
8025
|
+
if (ids2 !== void 0 === (filter !== void 0 || everything)) {
|
|
8022
8026
|
throw usageError(`Name the ${target2.plural} one way: --ids, --filter, or --all for every ${target2.noun} in the workspace.`, { field: "ids", next: `${command65} --help` });
|
|
8023
8027
|
}
|
|
8024
8028
|
const exclude = idList(flags, "exclude-ids");
|
|
@@ -8035,7 +8039,7 @@ function requestBody(flags, target2, dryRun2) {
|
|
|
8035
8039
|
if (pairs.length === 0) throw usageError(`--set is required for ${command65}.`, { field: "set", hint: "For example --set stage=engaged.", next: `${command65} --help` });
|
|
8036
8040
|
return {
|
|
8037
8041
|
...targetBody(flags, target2, command65),
|
|
8038
|
-
set: parseSet(pairs, target2.aliases),
|
|
8042
|
+
set: parseSet(pairs, target2.aliases, target2.textFields),
|
|
8039
8043
|
...dryRun2 ? { dryRun: true } : {},
|
|
8040
8044
|
...flags["overwrite-pinned"] === true ? { overwritePinned: true } : {}
|
|
8041
8045
|
};
|
|
@@ -8078,7 +8082,11 @@ function bulkUpdateCommand(target2) {
|
|
|
8078
8082
|
filter: FLAGS.filter(target2),
|
|
8079
8083
|
all: FLAGS.all(target2),
|
|
8080
8084
|
"exclude-ids": FLAGS.excludeIds,
|
|
8081
|
-
set: {
|
|
8085
|
+
set: {
|
|
8086
|
+
type: "string",
|
|
8087
|
+
multiple: true,
|
|
8088
|
+
description: `field=value; repeat it for more fields (up to 10). For a custom text field, quote text that reads as a number: 'custom.code="10001"'`
|
|
8089
|
+
},
|
|
8082
8090
|
label: FLAGS.label,
|
|
8083
8091
|
"overwrite-pinned": { type: "boolean", description: "Also replace a value a person set by hand" },
|
|
8084
8092
|
timeout: FLAGS.timeout
|
|
@@ -8145,7 +8153,7 @@ var init_bulk_update = __esm({
|
|
|
8145
8153
|
FLAGS = {
|
|
8146
8154
|
ids: (target2) => ({ type: "string", description: `${target2.noun} ids, comma-separated (up to 1,000)` }),
|
|
8147
8155
|
filter: (target2) => ({ type: "string", description: `The search body as JSON, as kenso ${target2.resource} search --data takes it (filters, where, q): everything it matches` }),
|
|
8148
|
-
all: (target2) => ({ type: "boolean", description: `Every ${target2.noun} in the workspace` }),
|
|
8156
|
+
all: (target2) => ({ type: "boolean", description: `Every ${target2.noun} in the workspace. Add it to a --filter that holds only options and no condition` }),
|
|
8149
8157
|
excludeIds: { type: "string", description: "Ids to leave out of --filter or --all, comma-separated (up to 1,000)" },
|
|
8150
8158
|
label: { type: "string", description: "A name for the change in kenso changes list" },
|
|
8151
8159
|
timeout: { type: "string", default: "10m", description: "How long to wait for the change: 90s, 10m, 1h (default 10m)" }
|
|
@@ -8169,6 +8177,7 @@ var init_bulk_update2 = __esm({
|
|
|
8169
8177
|
plural: "accounts",
|
|
8170
8178
|
aliases: { owner: "ownerMemberId", tier: "tierOverride" },
|
|
8171
8179
|
fields: ["ownerMemberId", "stage", "tierOverride", "industry", "fundingRound", "employeeCount", "hqLocation", "cadenceDays"],
|
|
8180
|
+
textFields: ["stage", "industry", "fundingRound", "hqLocation"],
|
|
8172
8181
|
featureGates: ["accounts", "bulk_edit"],
|
|
8173
8182
|
examples: [
|
|
8174
8183
|
`kenso accounts bulk-update --filter '{"filters":[{"field":"stage","operator":"is","values":["new"]}]}' --set owner=42 --dry-run`,
|
|
@@ -8253,7 +8262,7 @@ var init_connect = __esm({
|
|
|
8253
8262
|
var crm_default;
|
|
8254
8263
|
var init_crm = __esm({
|
|
8255
8264
|
"docs/crm.md"() {
|
|
8256
|
-
crm_default = '# CRM (beta)\n\nThe CRM commands work on Kenso\'s Accounts lane: accounts (companies), the people on them, and opportunities. They are beta: they need the `accounts` feature flag on your workspace (opportunities need `opportunities`, CRM sync needs `ingestion`). Help and `kenso describe` hide them until your workspace has the flag; `--all-commands` shows them.\n\n| Command | What it does |\n|---|---|\n| `accounts import` | Create accounts from a CSV or JSONL file. Research is charged per created account |\n| `people import` | Create or match people from a file, optionally onto accounts |\n| `accounts update --each`, `people update --each`, `opportunities update --each` | Edit many records from a file, one call per row |\n| `accounts bulk-update`, `people bulk-update`, `opportunities bulk-update` | Set the same fields on many records at once, by ids or by a filter, with a preview first. Needs `bulk_edit` too |\n| `accounts bulk-delete`, `people bulk-delete`, `opportunities bulk-delete` | Delete many records at once, by ids or by a filter, with a preview first. Not undone. Needs `bulk_edit` too |\n| `changes list`, `get`, `rows`, `apply`, `cancel`, `undo` | Follow a bulk change, read what each record got, stop it, or put the old values back for 30 days |\n| `accounts write-research`, `people write-research` | Store research you gathered as a record\'s latest research, free. `--each` writes many |\n| `opportunities move <id> --stage <key> [--reason <key>]` | Move a deal, with its won or lost reason; a field the stage asks for never stops it |\n| `opportunities stage-history <id>` | A deal\'s stage history: each stage, when, who moved it and how long it sat there |\n| `notes list`, `notes add`, `notes edit`, `notes delete` | Notes and comments on accounts, people and deals (needs `record_notes`) |\n| `deleted-accounts list`, `accounts restore <id>` | The accounts deleted in the last 30 days, and bringing one back |\n| `export <accounts\\|people\\|deals>` | The list as CSV: everything, a saved Accounts view, or what the filters match |\n| `capture status` | Your captured mailbox, its backfill progress and what teammates see of a captured email. Needs the `crm_capture` flag |\n| `capture connect` | Turn capture on for your own mailbox. `--private` starts it hidden from teammates; `--provider google` prints a sign-in link when no account is connected yet |\n| `capture private on\\|off` | Hide your captured email from teammates, or show it again. Email only: meetings stay visible. `--thread <id>` sets the switch for one thread |\n| `capture thread <threadId>` | One captured email thread: subject, people, time, Ken\'s summary, and each body you may open. The id is `capturedThread.id` on a timeline row |\n| `capture sync` | Read your captured mailbox now, instead of waiting for the next two-minute poll. Prints what the pass read, logged and created |\n| `capture disconnect` | Turn capture off and delete your stored email bodies. Asks first; `--yes` skips the question |\n| `capture teammates-see summary\\|full_email` | Workspace admin: what teammates see of captured email |\n| `pipelines stage-rules` | List or set the fields a deal should have in each stage |\n| `opportunity-reasons get`, `opportunity-reasons replace` | List or edit why deals are lost and won |\n| `crm-connections`, `crm-imports`, `crm-sync-issues` | Read and run CRM sync. Connecting a CRM stays in the app |\n| `tasks add`, `tasks done`, `tasks assign`, `tasks queue` | Add a to-do for a member on an account, person or deal, complete it, hand it on, or read your open work (needs `tasks`) |\n\nImport accounts first, then people: `people import` never creates an account.\n\n## Import accounts\n\n```bash\nkenso accounts import --file accounts.csv\nkenso accounts import --file accounts.csv --yes\n```\n\n```csv\nname,domain,industry,employeeCount\nAcme,acme.io,Software,120\nGlobex,globex.com,Manufacturing,"1,200"\n```\n\n- **Columns** map by name, ignoring case, spaces and dashes: `name` (or `company`, `companyName`, `accountName`), `domains` (several, split on `,` or `;`) or one `domain` (or `website`, `companyDomain`), `industry`, `employeeCount`, `hqLocation`, `linkedinUrl`, `stage`, `angle`, `whyNow`, `fitScore`, `fundingRound`, `cadenceDays`, `ownerMemberId`, `kenCompanyId`, `sendsFromInboxId`, `sendsFromLinkedInAccountId` and `source`.\n- **A domain is required.** A file with no domain column is a usage error, and a row without a domain is `invalid` (`domain_required`).\n- **The dry run prices the research.** It asks for a credit estimate per 1,000 accounts and puts the sum in the plan: `kind`, `accountCount`, `totalMillicredits`, `availableMillicredits` and `sufficient`.\n- **Rows go 100 per call** to `POST /v1/accounts/bulk-create`.\n\nEach row comes back `created` (`id` is the new account; its research is queued, `researchQueued`, or waits for credits, `researchWaitingCredits`), `skipped` with reason `domain_taken` (already an account; `id` is that account) or `failed` (`reason` is the API\'s code, `error` names the field; an item Kenso failed to save is sent once more first). Rerunning the same file is safe: accounts that exist come back `domain_taken`.\n\n## Import people\n\n```bash\nkenso people import --file people.csv\nkenso people import --file people.csv --find-emails --yes\nkenso people import --file people.jsonl --dry-run\n```\n\n```csv\nfullName,email,title,accountDomain,role\nAnn Lee,ann@acme.io,VP Sales,acme.io,champion\nBob Ray,,CTO,acme.io,\n```\n\n- **Columns** map by name, ignoring case, spaces and dashes: `email`, `fullName` (or `name`), `firstName`, `lastName`, `title`, `linkedinUrl` (or `linkedin`, `profileUrl`), `accountDomain` (or `domain`, `website`, `companyDomain`), `accountId`, `role` and `priority`. Other columns are ignored with one warning.\n- **A person needs a name:** `fullName`, or `firstName`, `lastName` or both (the CLI joins them). A row with none of them is `invalid` (`name_required`).\n- **To put a person on an account,** give `accountDomain` or `accountId`. A row with both sends only `accountId`.\n- **`--find-emails`** queues an email find (charged in credits) for each person without an email.\n- **Rows go 200 per call** to `POST /v1/people/batch`.\n\nPeople already in the workspace are matched by email, then LinkedIn URL, so running the same file again creates nobody twice. A row comes back `created` (a new person), `updated` (an existing person added to the account), `skipped` with reason `already_on_account`, `matched` (no account asked) or `previously_removed`, or `failed`: `account_not_found` saves the person without an account (import the account, then rerun to place them), any other reason is the API\'s. The summary adds `matched`, `addedToAccounts` and `emailFindsQueued`.\n\n## List and search accounts\n\n`accounts list` and `accounts search` sort and page on the server, so they reach every account in the workspace, however many there are.\n\n```bash\nkenso accounts list --sort score:desc --limit 100 # one page; the output\'s next: line is the following one\nkenso accounts list --sort score:desc --limit 100 --all # every page, to the end\nkenso accounts search --search hiring --sort latestSignalAt:desc --data \'{"qFields": ["name", "latestSignal"]}\'\nkenso accounts search --limit 1 --data \'{"countBy": ["stage"]}\' # how many accounts sit in each stage\nkenso accounts search --data \'{"where": {"match": "all", "conditions": [{"field": "tier", "operator": "is", "values": ["1"]}]}, "sort": "tier,-pipelineAmount"}\' --all\nkenso accounts search --data \'{"where": {"match": "all", "conditions": [{"field": "hqLocation", "operator": "contains", "values": ["Germany"]}]}}\' --all\n# tier 1 accounts with no meeting in 30 days: none since then, or none ever\nkenso accounts search --data \'{"where": {"match": "all", "conditions": [{"field": "tier", "operator": "is", "values": ["1"]}, {"match": "any", "conditions": [{"field": "lastMeeting", "operator": "older_than_days", "values": ["30"]}, {"field": "lastMeeting", "operator": "is_empty"}]}]}}\' --all\n```\n\n- **`--sort`** takes up to 3 comma-separated keys, each `field` (ascending), `field:asc` or `field:desc`. The API\'s `-field` form needs the equals sign here, `--sort=-score`, because a value that starts with a dash reads as a flag. Fields: `createdAt`, `name`, `score`, `tier` (ascending is tier 1 first), `latestSignalAt`, `committee`, `pipelineAmount`, `nextTouchAt`, `lastTouchAt`. An account with no value for a key comes last in both directions. The default is `-createdAt`.\n- **`--limit`** is 1 to 1000 (default 50). `--cursor` takes the previous page\'s `nextCursor` with the same filters and sort; `--all` follows the cursors for you.\n- **`--search`** (also `--q`) matches the name or a domain.\n- **Lists and objects go in `--data`** on `search`, as the API takes them (`kenso describe accounts search`); a flag beside it sets or replaces one key:\n - `qFields` picks where the search text looks: `name`, `domain`, `latestSignal` (the latest signal\'s title).\n - `countBy` (`stage`, `stageGroup`) adds `counts` to the output: every value with the number of matching accounts that hold it, whatever the page. The output is then one object: `data`, `pagination` and `counts`.\n - `filters` and `where` narrow the accounts.\n\nAn account\'s timeline pages the same way. `kenso accounts activity 812` returns the newest 100 earlier rows and, when older ones exist, `data.nextCursor`. Pass it back as `--cursor` (with the same `--category`) for the rows before them, until a page comes without one.\n\n## Edit accounts, people and opportunities\n\nTo set the same fields on many records, use `bulk-update` (below; it needs the `bulk_edit` flag). When every row gets its own values, or the workspace has no `bulk_edit`, run the generated `update` command once per row with `--each`. Columns are the command\'s flags by API name or flag name, and the id column fills the route:\n\n```bash\nkenso accounts update --each accounts-edit.csv --dry-run # then the same with --yes\nkenso people update --each people-edit.csv --dry-run\nkenso opportunities update --each deals.csv --dry-run\n```\n\n```csv\naccountId,stage,ownerMemberId,overwritePinned\n501,engaged,42,true\n502,customer,42,true\n```\n\nA row that changes a field someone pinned in the app fails as a whole (`409 conflict`, `pinned_by_user`: nothing on that record changes, the other fields of the row included), unless the row sets `overwritePinned` to `true` (or you pass `--overwrite-pinned`, only with the person\'s OK). Every flag of an update command: `kenso accounts update --help`.\n\n## Change many accounts at once\n\n```bash\nkenso accounts bulk-update --filter \'{"filters":[{"field":"stage","operator":"is","values":["new"]}]}\' --set owner=42 --dry-run\nkenso changes apply --change-id 31\nkenso accounts bulk-update --ids 812,813 --set stage=engaged --set tier=2 --yes\nkenso changes get --change-id 31\n```\n\n`accounts bulk-update` sets the same fields on every account you name: `--ids` (up to 1,000), everything a `--filter` matches (the body `kenso accounts search --data` takes: `filters`, `where`, `q`; up to 50,000), or `--all`. `--exclude-ids` leaves some of a filter\'s accounts out. `--set field=value` takes `ownerMemberId` (or `owner`), `stage`, `tierOverride` (or `tier`), `industry`, `fundingRound`, `employeeCount`, `hqLocation` and `cadenceDays`, and a custom field as `custom.<key>` (`--set custom.region=EMEA`; `kenso api GET \'/v1/fields?object=account\'` gives the keys); a value of `null` clears the field. Use `accounts update --each` when every row gets its own values.\n\nIt makes a change set: the accounts it names and, for each, the field, its value before and its value after. Without `--yes` (or with `--dry-run`) it previews: it prints `count` and a `sample`, writes nothing, and `next` is the `kenso changes apply` command that writes exactly those accounts. With `--yes` it writes in the background and waits (`--timeout`, default 10m), then prints the change with its `counts`: `applied`, `unchanged` (already had the value), `conflict` (the account changed after the preview, so it was left alone) and `failed` (for example `pinned`: a person set the field by hand; `--overwrite-pinned` replaces it). Exit 5 when some accounts failed or conflicted. It needs the `bulk_edit` flag as well as `accounts`.\n\n`kenso accounts bulk-update` used to be the generated command for the route\'s older one-field body, which sets one `accountType` on up to 500 accounts and needs only `accounts`. The route still takes that body, but this command no longer sends it: use `kenso accounts update --each` with an `accountType` column, or `kenso api POST /v1/accounts/bulk-update --data \'{"accountIds":[812,813],"accountType":"lost"}\'`.\n\n`people bulk-update` and `opportunities bulk-update` work the same way. People take `--set` for `ownerMemberId` (or `owner`), `leadStatus`, `title`, `seniority`, `department` and `location`, and a `--filter` of `kenso people search --data` fields (`leadStatus`, `roles`, `tagIds`, `q` and the rest). Deals take `stage` (a live stage key), `ownerMemberId` (or `owner`), `closeDate` (or `close`), `amount`, `dealType` and `nextStep`, and a `--filter` of `kenso opportunities search --data` fields (`filters`, `accountId`, `q`):\n\n```bash\nkenso opportunities bulk-update --filter \'{"filters":[{"field":"stageCategory","operator":"is","values":["open"]}]}\' --set stage=proposal --dry-run\nkenso people bulk-update --ids 501,502 --set owner=42 --yes\n```\n\n### Delete many records at once\n\n```bash\nkenso people bulk-delete --filter \'{"onAccount":"none","leadStatus":["disqualified"]}\' --dry-run\nkenso changes apply --change-id 32\nkenso opportunities bulk-delete --ids 71,72,73 --yes\n```\n\n`accounts bulk-delete`, `people bulk-delete` and `opportunities bulk-delete` name their records the way `bulk-update` does (`--ids`, `--filter`, `--all`, `--exclude-ids`) and take no `--set`. Without `--yes` they preview: `count`, a `sample`, and `next` is the `kenso changes apply` command that deletes exactly those records. The API itself previews a delete whose body leaves `dryRun` out, so `--yes` sends `dryRun: false`. Each record is deleted as its own `delete` command deletes it, so one that cannot be deleted (a person still on an account) is counted as `failed` and the rest go on. A delete is not undone with `kenso changes undo`.\n\n### Follow, stop and undo a change\n\n```bash\nkenso changes list --object accounts\nkenso changes rows --change-id 31 --status conflict,failed\nkenso changes cancel --change-id 31\nkenso changes undo --change-id 31\n```\n\n`changes list` shows the workspace\'s bulk changes, newest first, whoever made them. `changes rows` lists a change\'s records with the value before (`from`) and after (`to`) and a `status`; `--status conflict,failed` reads what a change missed. `changes cancel` drops a preview or stops a change that is still writing; what it already wrote stays. `changes undo` puts the old value back on every record that still holds the value the change wrote, for 30 days after it was applied (`undoUntil`). A record someone changed again since keeps its newer value: `counts.undone` is how many went back, `counts.applied` how many still hold the change. Undo answers `409 invalid_state` with `undo_expired`, `still_running`, `nothing_applied` or `not_undoable` when there is nothing it can put back.\n\n## Search opportunities\n\n`kenso opportunities search` works as `accounts search` does: it takes `--search`, `--sort`, `--limit`, `--cursor`, `--all`, and its lists in `--data`.\n\n```bash\nkenso opportunities search --data \'{"filters": [{"field": "stageCategory", "operator": "is", "values": ["open"]}]}\' --all\nkenso opportunities search --data \'{"filters": [{"field": "ownerMemberId", "operator": "is", "values": ["none"]}, {"field": "closeDate", "operator": "is", "values": ["past_due", "next_30_days"]}]}\'\nkenso opportunities search --limit 1 --data \'{"countBy": ["stage", "ownerMemberId"]}\' # how many opportunities hold each value\n```\n\n- **`filters`** is a list of `{field, operator, values}`, all of which must hold. Fields: `stage` (a stage key), `stageCategory` (`open`, `won`, `lost`), `ownerMemberId`, `closeDate` (`past_due`, `next_30_days`, `later`, `none`) and `sourceCampaignId`. `operator` is `is` or `is_not`; the values of one condition are OR. `none` in `values` matches an opportunity with no owner, no source campaign or no close date.\n- **`countBy`** takes the same field names and adds `counts` to the output: per field, every value with the number of matching opportunities that hold it.\n- `--account-id` keeps the search to one account. `closeDate` counts days in the member\'s app time zone.\n\nOne person\'s deals, meetings and campaign contacts, as their person page lists them:\n\n```bash\nkenso opportunities list --person-id 9001 # the deals they are on, or are the primary person of\nkenso meetings list --person-id 9001 # the meetings they attend, among the ones you can see\nkenso contacts list --person-id 9001 # their contact in each campaign they are in\n```\n\n## Write research you gathered\n\n`accounts write-research` and `people write-research` store research you gathered outside Kenso as the record\'s latest research (`PUT /v1/accounts/{accountId}/research`, `PUT /v1/people/{personId}/research`). The Research tab shows it like a Ken run, with `trigger: agent` and `researchedAt` now. Nothing is charged, and no account or person field changes: set an account\'s own `fitScore`, `whyNow` or `angle` with `accounts update`. They need the `accounts_research` flag and accounts edit.\n\nThe body is the research block `accounts get --expand research` (or `people get-research`) returns, without its read-only fields: leave out `id`, `status`, `trigger`, `errorCode`, `researchedAt`, `isStale` and `appliedPrompt` (for a person also `mode`, `requestedAt`, `researchedMode`, `firecrawlCredits` and `webNote`), or the write fails with `unknown_field`. Pass it with `--data @file`:\n\n```bash\nkenso accounts write-research --account-id 501 --data @acme-dossier.json\nkenso people write-research --person-id 9001 --data @jane.json\n```\n\n```json\n{\n "tagline": { "text": "Payroll for EU contractors", "sourceUrls": ["https://acme.example"] },\n "description": { "text": "Acme runs payroll and compliance for companies hiring contractors in 30 EU countries.", "sourceUrls": ["https://acme.example"] },\n "links": { "website": "https://acme.example" },\n "whyNow": { "text": "Raised a $40M Series B in October", "sourceUrls": ["https://news.example/acme-b"], "date": "2026-10" },\n "fitScore": 82,\n "angle": "Lead with contractor onboarding time."\n}\n```\n\nMany records: one JSONL line per record, with the id next to the block\'s fields. Nested objects are sent as written. Use JSONL, not CSV: the block\'s fields are objects and lists, which a CSV cell cannot carry.\n\n```bash\nkenso accounts write-research --each dossiers.jsonl --dry-run # then the same with --yes\nkenso people write-research --each people-research.jsonl --yes --concurrency 8\n```\n\n```jsonl\n{"accountId": 501, "tagline": {"text": "Payroll for EU contractors"}, "links": {"website": "https://acme.example"}}\n{"accountId": 502, "description": {"text": "Cloud cost tooling for retailers."}, "links": {"website": "https://beta.example"}}\n```\n\nA row fails as a whole with the API\'s code: `validation_failed` (an unknown field is `unknown_field`, and `error.details` names every bad field), `research_in_progress` (`409`: Ken is researching that record now, write it again once the run ends; an account run waiting for credits counts too: it runs once the workspace has credits, and the write stays refused until that run ends) or `not_found`. Rerunning a file is safe: each write replaces the record\'s research shown.\n\n## CRM sync\n\nCRM sync has generated commands only: read connections, preview, start an import, and work through sync issues. Connect the CRM itself in the app.\n\n```bash\nkenso crm-connections list\nkenso crm-connections get --connection-id 7\nkenso crm-imports create --connection-id 7 --dry-run\nkenso crm-sync-issues list --connection-id 7 --all\n```\n\nRun `kenso crm-connections --help` (or add `--all-commands` when the actions are hidden) to see every action.\n\n## Pipelines\n\nA workspace with the `pipelines` flag on can run several deal pipelines, each with its own stages. These are generated commands (beta):\n\n```bash\nkenso pipelines list\nkenso pipelines list --query "[].{id: id, name: name, default: isDefault, stages: stages[].key}"\nkenso pipelines get --pipeline-id 5\n```\n\n`list` prints every pipeline in display order, archived ones included: `id`, `name`, `routingRule` (the one sentence Ken reads to decide whether a new deal belongs there), `isDefault`, `isArchived`, `position`, `opportunityCount`, `amountTotal` and `stages`, each stage as `kenso opportunity-stages list` prints it. A stage key is unique in the workspace, across pipelines, so a deal\'s `stage` names its pipeline and its `pipelineId` repeats it. The first read turns the workspace\'s stage list into its default pipeline, named Sales, with every deal in it. The same rows as the MCP\'s `pipelines(operation="list")`.\n\nShaping them needs the `workspace_settings` permission:\n\n```bash\nkenso pipelines create --name Renewals --routing-rule "The account is already a customer" --data \'{"stages": [{"label": "Up for renewal", "category": "open"}, {"label": "Won", "category": "won"}, {"label": "Lost", "category": "lost"}]}\'\nkenso pipelines update --pipeline-id 6 --name Expansion --position 0\nkenso pipelines update --pipeline-id 6 --data @stages.json\nkenso pipelines archive --pipeline-id 6\nkenso pipelines restore --pipeline-id 6\n```\n\n- **`create`** takes a unique `name`, the pipeline\'s `stages` in display order (at least one `open`, one `won` and one `lost`) and an optional `routingRule`: one sentence that says which deals belong there, which Ken reads to route a new deal that names no pipeline. Each stage gets a key from its label; a key another pipeline already uses gets the pipeline\'s name in front (`renewals_won`). A workspace has at most 10 pipelines.\n- **`update`** changes what you send. `stages` is the pipeline\'s whole stage list: read it with `pipelines get`, keep each stage\'s `key`, and add a new stage without one. A stage with live deals in it cannot be left out; archive it with `"isArchived": true` instead.\n- **`archive`** stops new deals from entering a pipeline and keeps the deals in it. The default pipeline cannot be archived, and nothing is deleted: `restore` brings a pipeline back.\n\n## Restore a deleted account\n\n```bash\nkenso deleted-accounts list\nkenso accounts restore 812\n```\n\nA deleted account can be restored for 30 days. `deleted-accounts list` shows each one with who deleted it, `expiresAt` (restore works until then) and what comes back: `personCount`, `opportunityCount` and `touchCount`. `accounts restore <id>` brings the account back with its domains, its people, its deals and its planned touches, which wait for approval again. A domain another account took since stays with that account and is listed in `domainsTaken`. A merged account is not listed and cannot be restored: a merge has no undo. Both commands are behind the `crm_import_export` feature flag (`404` while it is off).\n\n## Export accounts, people or deals\n\n```bash\nkenso export accounts --out accounts.csv\nkenso export accounts --view 12 --out tier-1.csv\nkenso export deals --filters \'[{"field":"stageCategory","operator":"is","values":["open"]}]\' > open-deals.csv\n```\n\nIt writes the CSV that `POST /v1/accounts/export`, `/v1/people/export` or `/v1/opportunities/export` returns, to stdout or to `--out` (then it prints the file and its row count). With no filter it exports every record. More than 50,000 rows is refused: narrow the filters. `--view <id>` exports a saved Accounts view (`kenso account-views list` shows the ids). `--filters`, `--where` (accounts), `--q` and `--sort` are the search operation\'s own fields, so a deals or people view exports with its filters and sort. The accounts and deals files start with `id` and import back as they are. Each export writes an audit-log entry and needs the export permission. Accounts and deals also need the `crm_import_export` flag while it is in beta.\n\n## A deal\'s stage history\n\n```bash\nkenso opportunities stage-history 77\nkenso opportunities stage-history 77 --query "entries[].{to: stageLabel, at: enteredAt, by: changedBy}"\n```\n\nIt prints `GET /v1/opportunities/{id}/stage-history` as it is, the same rows as the deal page and the MCP\'s `opportunities(operation="get-stage-history")`: the stage now, `isComplete` and `entries`, oldest first, each with `fromStage`, `stage`, `stageLabel`, `enteredAt`, `leftAt`, `durationSeconds`, `actorKind`, `actorMemberId` and Ken\'s `reason` on a move its stage judge made. With the `deal_stage_rules` flag on, each entry also has `changedBy` (`member`, `agent`, `api_key`, `workflow`, `stage_judge`, `crm_sync` or `ken_automation`), `crmProvider` on a CRM sync, and on a move `fromStageLabel` and `fromStageDurationSeconds`, how long the deal sat in the stage it left. `isComplete` false means Kenso has no record of part of the history.\n\n## Notes on accounts, people and deals\n\nWith the `record_notes` feature on, everyone who can see a record reads its notes. Name the record with exactly one of `--account`, `--person` and `--deal`:\n\n```bash\nkenso notes list --account 5\nkenso notes add --account 5 --body \'Budget approved, @[Jane Doe](41) please send the DPA\'\nkenso notes add --parent 900 --body \'Sent it this morning\' # a comment under note 900\ncat call-notes.md | kenso notes add --deal 77 --body - # the body from stdin\nkenso notes edit 900 --body \'Budget approved for Q1\' # the author only\nkenso notes edit 900 --pin\nkenso notes delete 900 --yes # kenso notes restore 900 brings it back\n```\n\nThe body is markdown, up to 20,000 characters. Mention a teammate as `@[Name](memberId)`: they get a notification that opens the note. A note shows on the record\'s Notes tab and its Activity timeline, and Ken\'s account brief quotes the account\'s notes. The MCP\'s `notes` tool does the same. A note on an account needs the accounts plan feature; people and deals work on every plan.\n\n## Required fields per stage\n\n```bash\nkenso pipelines stage-rules\nkenso pipelines stage-rules proposal --require amount,closeDate,custom.tier\nkenso pipelines stage-rules proposal --none\nkenso pipelines stage-rules lost --default\n```\n\nWith the `deal_stage_rules` flag on, each stage can name the fields a deal should have in it. Without a stage the command prints every stage\'s `key`, `label`, `category`, `isArchived`, `requiredFields` and `isDefault`, plus `requirableFields`: `amount`, `closeDate`, `ownerMemberId`, `primaryPersonId`, `nextStep`, `lostReasonKey`, `wonReasonKey` and `custom.<key>` for each custom deal field. `--require` sets the stage\'s whole list, in order, at most 10. `--none` requires nothing, and `--default` goes back to the default: a lost stage asks for `lostReasonKey`, any other stage nothing. Setting a rule needs the `workspace_settings` permission. The same as the MCP\'s `opportunities(operation="stages-set-required-fields")`.\n\nA missing field never stops a move. The deal moves, and it is flagged Missing on the board, the list and the deal page until the field is filled. A rule also applies to deals already in the stage.\n\n```bash\nkenso opportunities update --opportunity-id 4401 --stage proposal\nkenso opportunities list --missing-fields\n```\n\nEvery deal then carries `missingFields` (`[{field, label}]`). A create, or an update that sends a stage, answers `warnings` beside the deal for each field the stage asks for that the deal leaves empty: each prints on stderr as `warning: <message>`, stdout stays the deal and the exit code stays 0. `--missing-fields` keeps only the deals flagged Missing (also `missingFields: true` on `kenso opportunities search`).\n\n## Won and lost reasons\n\n```bash\nkenso opportunity-reasons get\nkenso opportunity-reasons replace --kind lost --data \'{"reasons":[{"key":"no_budget","label":"No budget"},{"label":"Built it in-house"}]}\'\nkenso opportunities move 4401 --stage lost --reason built_it_in_house\n```\n\n`kenso opportunities move <id> --stage <key> [--reason <key>]` sends the reason as `lostReasonKey` for a lost stage or `wonReasonKey` for a won stage; an open stage takes none. Each field the new stage asks for that the deal leaves empty prints a warning on stderr, and the move still goes through.\n\nWith the `deal_stage_rules` flag on, each workspace edits why its deals are lost and won. `get` prints `lost` and `won`, each `{isDefault, reasons: [{key, label, isArchived}]}`. `replace` takes a kind\'s whole list in order, as `get` prints it: keep a reason by its `key`, leave `key` out for a new one, and set `isArchived` to archive a reason or bring one back. A reason left out is archived too: deals keep it, and no write can pick it again. At least one reason stays live and at most 30, and labels stay unique, archived ones included. A deal takes a live key in `lostReasonKey` (a lost stage) or `wonReasonKey` (a won stage). A move to Lost without a reason still goes through, with a warning and "Missing: Lost reason" on the deal. Editing the lists needs the `workspace_settings` permission. The same as the MCP\'s `pipelines(operation="reasons-get")` and `reasons-replace`.\n\n## Tasks\n\nTasks are to-dos a member owes: a title, an optional due day or time, an assignee and at most one account, person or deal. They need the `tasks` flag. The app calls deals "Deals"; the CLI keeps `--deal` for an opportunity id.\n\n```bash\nkenso tasks add "Send the deck" --due tomorrow --account 812\nkenso tasks add "Call Ada back" --due friday --at 16:00 --person 501 --assignee ada@acme.com\nkenso tasks list --assignee me --due overdue,today\nkenso tasks queue --scope mine\nkenso tasks assign 7 me\nkenso tasks done 7 8 9\nkenso tasks done 7 --undo\n```\n\n- `tasks add` sends `POST /v1/tasks`. `--due` takes `today`, `tomorrow`, a weekday (the next one: `friday` or `fri`), a day (`2026-11-20`) or an ISO 8601 time; `--at HH:MM` puts a time on that day (today without `--due`). Day words and `--at` read this computer\'s clock and time zone (`TZ`); a time\'s day is read in the assignee\'s app time zone. `--assignee` takes `me`, a member id or an email; without it the task is yours.\n- `tasks done` completes each task it names, in order (`PATCH /v1/tasks/{id}` with `status: done`); `--undo` reopens them. `tasks assign` gives a task to `me`, a member id or a member\'s email; that member gets a `task_assigned` notification.\n- `tasks queue` is `task-queue list` under the name you would try: the Tasks screen\'s open work by due day, with `--scope mine|assigned_by_me|everyone`. It lists tasks, manual touches, call tasks, inbox threads with a reminder due (when you can view the Inbox) and Ken\'s follow-ups to you, each with the app path in `href` (null for a task, which opens in its panel).\n- `tasks list`, `get`, `update`, `delete`, `restore` and `task-queue list` are generated from the API: `kenso tasks --help` lists them.\n';
|
|
8265
|
+
crm_default = '# CRM (beta)\n\nThe CRM commands work on Kenso\'s Accounts lane: accounts (companies), the people on them, and opportunities. They are beta: they need the `accounts` feature flag on your workspace (opportunities need `opportunities`, CRM sync needs `ingestion`). Help and `kenso describe` hide them until your workspace has the flag; `--all-commands` shows them.\n\n| Command | What it does |\n|---|---|\n| `accounts import` | Create accounts from a CSV or JSONL file. Research is charged per created account |\n| `people import` | Create or match people from a file, optionally onto accounts |\n| `accounts update --each`, `people update --each`, `opportunities update --each` | Edit many records from a file, one call per row |\n| `accounts bulk-update`, `people bulk-update`, `opportunities bulk-update` | Set the same fields on many records at once, by ids or by a filter, with a preview first. Needs `bulk_edit` too |\n| `accounts bulk-delete`, `people bulk-delete`, `opportunities bulk-delete` | Delete many records at once, by ids or by a filter, with a preview first. Not undone. Needs `bulk_edit` too |\n| `changes list`, `get`, `rows`, `apply`, `cancel`, `undo` | Follow a bulk change, read what each record got, stop it, or put the old values back for 30 days |\n| `accounts write-research`, `people write-research` | Store research you gathered as a record\'s latest research, free. `--each` writes many |\n| `opportunities move <id> --stage <key> [--reason <key>]` | Move a deal, with its won or lost reason; a field the stage asks for never stops it |\n| `opportunities stage-history <id>` | A deal\'s stage history: each stage, when, who moved it and how long it sat there |\n| `notes list`, `notes add`, `notes edit`, `notes delete` | Notes and comments on accounts, people and deals (needs `record_notes`) |\n| `deleted-accounts list`, `accounts restore <id>` | The accounts deleted in the last 30 days, and bringing one back |\n| `export <accounts\\|people\\|deals>` | The list as CSV: everything, a saved Accounts view, or what the filters match |\n| `capture status` | Your captured mailbox, its backfill progress and what teammates see of a captured email. Needs the `crm_capture` flag |\n| `capture connect` | Turn capture on for your own mailbox. `--private` starts it hidden from teammates; `--provider google` prints a sign-in link when no account is connected yet |\n| `capture private on\\|off` | Hide your captured email from teammates, or show it again. Email only: meetings stay visible. `--thread <id>` sets the switch for one thread |\n| `capture thread <threadId>` | One captured email thread: subject, people, time, Ken\'s summary, and each body you may open. The id is `capturedThread.id` on a timeline row |\n| `capture sync` | Read your captured mailbox now, instead of waiting for the next two-minute poll. Prints what the pass read, logged and created |\n| `capture disconnect` | Turn capture off and delete your stored email bodies. Asks first; `--yes` skips the question |\n| `capture teammates-see summary\\|full_email` | Workspace admin: what teammates see of captured email |\n| `pipelines stage-rules` | List or set the fields a deal should have in each stage |\n| `opportunity-reasons get`, `opportunity-reasons replace` | List or edit why deals are lost and won |\n| `layouts show\\|set\\|reset <object>` | How every account, person or deal page in the workspace lays out its fields: header, rail sections and hidden fields (needs `record_layout`) |\n| `crm-connections`, `crm-imports`, `crm-sync-issues` | Read and run CRM sync. Connecting a CRM stays in the app |\n| `tasks add`, `tasks done`, `tasks assign`, `tasks queue` | Add a to-do for a member on an account, person or deal, complete it, hand it on, or read your open work (needs `tasks`) |\n\nImport accounts first, then people: `people import` never creates an account.\n\n## Import accounts\n\n```bash\nkenso accounts import --file accounts.csv\nkenso accounts import --file accounts.csv --yes\n```\n\n```csv\nname,domain,industry,employeeCount\nAcme,acme.io,Software,120\nGlobex,globex.com,Manufacturing,"1,200"\n```\n\n- **Columns** map by name, ignoring case, spaces and dashes: `name` (or `company`, `companyName`, `accountName`), `domains` (several, split on `,` or `;`) or one `domain` (or `website`, `companyDomain`), `industry`, `employeeCount`, `hqLocation`, `linkedinUrl`, `stage`, `angle`, `whyNow`, `fitScore`, `fundingRound`, `cadenceDays`, `ownerMemberId`, `kenCompanyId`, `sendsFromInboxId`, `sendsFromLinkedInAccountId` and `source`.\n- **A domain is required.** A file with no domain column is a usage error, and a row without a domain is `invalid` (`domain_required`).\n- **The dry run prices the research.** It asks for a credit estimate per 1,000 accounts and puts the sum in the plan: `kind`, `accountCount`, `totalMillicredits`, `availableMillicredits` and `sufficient`.\n- **Rows go 100 per call** to `POST /v1/accounts/bulk-create`.\n\nEach row comes back `created` (`id` is the new account; its research is queued, `researchQueued`, or waits for credits, `researchWaitingCredits`), `skipped` with reason `domain_taken` (already an account; `id` is that account) or `failed` (`reason` is the API\'s code, `error` names the field; an item Kenso failed to save is sent once more first). Rerunning the same file is safe: accounts that exist come back `domain_taken`.\n\n## Import people\n\n```bash\nkenso people import --file people.csv\nkenso people import --file people.csv --find-emails --yes\nkenso people import --file people.jsonl --dry-run\n```\n\n```csv\nfullName,email,title,accountDomain,role\nAnn Lee,ann@acme.io,VP Sales,acme.io,champion\nBob Ray,,CTO,acme.io,\n```\n\n- **Columns** map by name, ignoring case, spaces and dashes: `email`, `fullName` (or `name`), `firstName`, `lastName`, `title`, `linkedinUrl` (or `linkedin`, `profileUrl`), `accountDomain` (or `domain`, `website`, `companyDomain`), `accountId`, `role` and `priority`. Other columns are ignored with one warning.\n- **A person needs a name:** `fullName`, or `firstName`, `lastName` or both (the CLI joins them). A row with none of them is `invalid` (`name_required`).\n- **To put a person on an account,** give `accountDomain` or `accountId`. A row with both sends only `accountId`.\n- **`--find-emails`** queues an email find (charged in credits) for each person without an email.\n- **Rows go 200 per call** to `POST /v1/people/batch`.\n\nPeople already in the workspace are matched by email, then LinkedIn URL, so running the same file again creates nobody twice. A row comes back `created` (a new person), `updated` (an existing person added to the account), `skipped` with reason `already_on_account`, `matched` (no account asked) or `previously_removed`, or `failed`: `account_not_found` saves the person without an account (import the account, then rerun to place them), any other reason is the API\'s. The summary adds `matched`, `addedToAccounts` and `emailFindsQueued`.\n\n## List and search accounts\n\n`accounts list` and `accounts search` sort and page on the server, so they reach every account in the workspace, however many there are.\n\n```bash\nkenso accounts list --sort score:desc --limit 100 # one page; the output\'s next: line is the following one\nkenso accounts list --sort score:desc --limit 100 --all # every page, to the end\nkenso accounts search --search hiring --sort latestSignalAt:desc --data \'{"qFields": ["name", "latestSignal"]}\'\nkenso accounts search --limit 1 --data \'{"countBy": ["stage"]}\' # how many accounts sit in each stage\nkenso accounts search --data \'{"where": {"match": "all", "conditions": [{"field": "tier", "operator": "is", "values": ["1"]}]}, "sort": "tier,-pipelineAmount"}\' --all\nkenso accounts search --data \'{"where": {"match": "all", "conditions": [{"field": "hqLocation", "operator": "contains", "values": ["Germany"]}]}}\' --all\n# tier 1 accounts with no meeting in 30 days: none since then, or none ever\nkenso accounts search --data \'{"where": {"match": "all", "conditions": [{"field": "tier", "operator": "is", "values": ["1"]}, {"match": "any", "conditions": [{"field": "lastMeeting", "operator": "older_than_days", "values": ["30"]}, {"field": "lastMeeting", "operator": "is_empty"}]}]}}\' --all\n```\n\n- **`--sort`** takes up to 3 comma-separated keys, each `field` (ascending), `field:asc` or `field:desc`. The API\'s `-field` form needs the equals sign here, `--sort=-score`, because a value that starts with a dash reads as a flag. Fields: `createdAt`, `name`, `score`, `tier` (ascending is tier 1 first), `latestSignalAt`, `committee`, `pipelineAmount`, `nextTouchAt`, `lastTouchAt`. An account with no value for a key comes last in both directions. The default is `-createdAt`.\n- **`--limit`** is 1 to 1000 (default 50). `--cursor` takes the previous page\'s `nextCursor` with the same filters and sort; `--all` follows the cursors for you.\n- **`--search`** (also `--q`) matches the name or a domain.\n- **Lists and objects go in `--data`** on `search`, as the API takes them (`kenso describe accounts search`); a flag beside it sets or replaces one key:\n - `qFields` picks where the search text looks: `name`, `domain`, `latestSignal` (the latest signal\'s title).\n - `countBy` (`stage`, `stageGroup`) adds `counts` to the output: every value with the number of matching accounts that hold it, whatever the page. The output is then one object: `data`, `pagination` and `counts`.\n - `filters` and `where` narrow the accounts.\n\nAn account\'s timeline pages the same way. `kenso accounts activity 812` returns the newest 100 earlier rows and, when older ones exist, `data.nextCursor`. Pass it back as `--cursor` (with the same `--category`) for the rows before them, until a page comes without one.\n\n## Edit accounts, people and opportunities\n\nTo set the same fields on many records, use `bulk-update` (below; it needs the `bulk_edit` flag). When every row gets its own values, or the workspace has no `bulk_edit`, run the generated `update` command once per row with `--each`. Columns are the command\'s flags by API name or flag name, and the id column fills the route:\n\n```bash\nkenso accounts update --each accounts-edit.csv --dry-run # then the same with --yes\nkenso people update --each people-edit.csv --dry-run\nkenso opportunities update --each deals.csv --dry-run\n```\n\n```csv\naccountId,stage,ownerMemberId,overwritePinned\n501,engaged,42,true\n502,customer,42,true\n```\n\nA row that changes a field someone pinned in the app fails as a whole (`409 conflict`, `pinned_by_user`: nothing on that record changes, the other fields of the row included), unless the row sets `overwritePinned` to `true` (or you pass `--overwrite-pinned`, only with the person\'s OK). Every flag of an update command: `kenso accounts update --help`.\n\n## Change many accounts at once\n\n```bash\nkenso accounts bulk-update --filter \'{"filters":[{"field":"stage","operator":"is","values":["new"]}]}\' --set owner=42 --dry-run\nkenso changes apply --change-id 31\nkenso accounts bulk-update --ids 812,813 --set stage=engaged --set tier=2 --yes\nkenso changes get --change-id 31\n```\n\n`accounts bulk-update` sets the same fields on every account you name: `--ids` (up to 1,000), everything a `--filter` matches (the body `kenso accounts search --data` takes: `filters`, `where`, `q`; up to 50,000), or `--all`. A filter that holds only options and no condition (`--filter \'{"includeImportOnly":true}\'`) takes `--all` beside it. `--exclude-ids` leaves some of a filter\'s accounts out. `--set field=value` takes `ownerMemberId` (or `owner`), `stage`, `tierOverride` (or `tier`), `industry`, `fundingRound`, `employeeCount`, `hqLocation` and `cadenceDays`, and a custom field as `custom.<key>` (`--set custom.region=EMEA`; `kenso api GET \'/v1/fields?object=account\'` gives the keys); a value of `null` clears the field. A text field\'s value is sent as you type it (`--set hqLocation=10001` is the text "10001"); a custom field\'s type is not known to the CLI, so quote its text when it reads as a number or as true or false: `--set \'custom.code="10001"\'`. Use `accounts update --each` when every row gets its own values.\n\nIt makes a change set: the accounts it names and, for each, the field, its value before and its value after. Without `--yes` (or with `--dry-run`) it previews: it prints `count` and a `sample`, writes nothing, and `next` is the `kenso changes apply` command that writes exactly those accounts. With `--yes` it writes in the background and waits (`--timeout`, default 10m), then prints the change with its `counts`: `applied`, `unchanged` (already had the value), `conflict` (the account changed after the preview, so it was left alone) and `failed` (for example `pinned`: a person set the field by hand; `--overwrite-pinned` replaces it). Exit 5 when some accounts failed or conflicted. It needs the `bulk_edit` flag as well as `accounts`.\n\n`kenso accounts bulk-update` used to be the generated command for the route\'s older one-field body, which sets one `accountType` on up to 500 accounts and needs only `accounts`. The route still takes that body, but this command no longer sends it: use `kenso accounts update --each` with an `accountType` column, or `kenso api POST /v1/accounts/bulk-update --data \'{"accountIds":[812,813],"accountType":"lost"}\'`.\n\n`people bulk-update` and `opportunities bulk-update` work the same way. People take `--set` for `ownerMemberId` (or `owner`), `leadStatus`, `title`, `seniority`, `department` and `location`, and a `--filter` of `kenso people search --data` fields (`leadStatus`, `roles`, `tagIds`, `q` and the rest). Deals take `stage` (a live stage key), `ownerMemberId` (or `owner`), `closeDate` (or `close`), `amount`, `dealType` and `nextStep`, and a `--filter` of `kenso opportunities search --data` fields (`filters`, `accountId`, `q`):\n\n```bash\nkenso opportunities bulk-update --filter \'{"filters":[{"field":"stageCategory","operator":"is","values":["open"]}]}\' --set stage=proposal --dry-run\nkenso people bulk-update --ids 501,502 --set owner=42 --yes\n```\n\n### Delete many records at once\n\n```bash\nkenso people bulk-delete --filter \'{"onAccount":"none","leadStatus":["disqualified"]}\' --dry-run\nkenso changes apply --change-id 32\nkenso opportunities bulk-delete --ids 71,72,73 --yes\n```\n\n`accounts bulk-delete`, `people bulk-delete` and `opportunities bulk-delete` name their records the way `bulk-update` does (`--ids`, `--filter`, `--all`, `--exclude-ids`) and take no `--set`. Without `--yes` they preview: `count`, a `sample`, and `next` is the `kenso changes apply` command that deletes exactly those records. The API itself previews a delete whose body leaves `dryRun` out, so `--yes` sends `dryRun: false`. Each record is deleted as its own `delete` command deletes it, so one that cannot be deleted (a person still on an account) is counted as `failed` and the rest go on. A delete is not undone with `kenso changes undo`.\n\n### Follow, stop and undo a change\n\n```bash\nkenso changes list --object accounts\nkenso changes rows --change-id 31 --status conflict,failed\nkenso changes cancel --change-id 31\nkenso changes undo --change-id 31\n```\n\n`changes list` shows the workspace\'s bulk changes, newest first, whoever made them. `changes rows` lists a change\'s records with the value before (`from`) and after (`to`) and a `status`; `--status conflict,failed` reads what a change missed. `changes cancel` drops a preview or stops a change that is still writing; what it already wrote stays. `changes undo` puts the old value back on every record that still holds the value the change wrote, for 30 days after it was applied (`undoUntil`). A record someone changed again since keeps its newer value: `counts.undone` is how many went back, `counts.applied` how many still hold the change. Undo answers `409 invalid_state` with `undo_expired`, `still_running`, `nothing_applied` or `not_undoable` when there is nothing it can put back.\n\n## Search opportunities\n\n`kenso opportunities search` works as `accounts search` does: it takes `--search`, `--sort`, `--limit`, `--cursor`, `--all`, and its lists in `--data`.\n\n```bash\nkenso opportunities search --data \'{"filters": [{"field": "stageCategory", "operator": "is", "values": ["open"]}]}\' --all\nkenso opportunities search --data \'{"filters": [{"field": "ownerMemberId", "operator": "is", "values": ["none"]}, {"field": "closeDate", "operator": "is", "values": ["past_due", "next_30_days"]}]}\'\nkenso opportunities search --limit 1 --data \'{"countBy": ["stage", "ownerMemberId"]}\' # how many opportunities hold each value\n```\n\n- **`filters`** is a list of `{field, operator, values}`, all of which must hold. Fields: `stage` (a stage key), `stageCategory` (`open`, `won`, `lost`), `ownerMemberId`, `closeDate` (`past_due`, `next_30_days`, `later`, `none`) and `sourceCampaignId`. `operator` is `is` or `is_not`; the values of one condition are OR. `none` in `values` matches an opportunity with no owner, no source campaign or no close date.\n- **`countBy`** takes the same field names and adds `counts` to the output: per field, every value with the number of matching opportunities that hold it.\n- `--account-id` keeps the search to one account. `closeDate` counts days in the member\'s app time zone.\n\nOne person\'s deals, meetings and campaign contacts, as their person page lists them:\n\n```bash\nkenso opportunities list --person-id 9001 # the deals they are on, or are the primary person of\nkenso meetings list --person-id 9001 # the meetings they attend, among the ones you can see\nkenso contacts list --person-id 9001 # their contact in each campaign they are in\n```\n\n## Write research you gathered\n\n`accounts write-research` and `people write-research` store research you gathered outside Kenso as the record\'s latest research (`PUT /v1/accounts/{accountId}/research`, `PUT /v1/people/{personId}/research`). The Research tab shows it like a Ken run, with `trigger: agent` and `researchedAt` now. Nothing is charged, and no account or person field changes: set an account\'s own `fitScore`, `whyNow` or `angle` with `accounts update`. They need the `accounts_research` flag and accounts edit.\n\nThe body is the research block `accounts get --expand research` (or `people get-research`) returns, without its read-only fields: leave out `id`, `status`, `trigger`, `errorCode`, `researchedAt`, `isStale` and `appliedPrompt` (for a person also `mode`, `requestedAt`, `researchedMode`, `firecrawlCredits` and `webNote`), or the write fails with `unknown_field`. Pass it with `--data @file`:\n\n```bash\nkenso accounts write-research --account-id 501 --data @acme-dossier.json\nkenso people write-research --person-id 9001 --data @jane.json\n```\n\n```json\n{\n "tagline": { "text": "Payroll for EU contractors", "sourceUrls": ["https://acme.example"] },\n "description": { "text": "Acme runs payroll and compliance for companies hiring contractors in 30 EU countries.", "sourceUrls": ["https://acme.example"] },\n "links": { "website": "https://acme.example" },\n "whyNow": { "text": "Raised a $40M Series B in October", "sourceUrls": ["https://news.example/acme-b"], "date": "2026-10" },\n "fitScore": 82,\n "angle": "Lead with contractor onboarding time."\n}\n```\n\nMany records: one JSONL line per record, with the id next to the block\'s fields. Nested objects are sent as written. Use JSONL, not CSV: the block\'s fields are objects and lists, which a CSV cell cannot carry.\n\n```bash\nkenso accounts write-research --each dossiers.jsonl --dry-run # then the same with --yes\nkenso people write-research --each people-research.jsonl --yes --concurrency 8\n```\n\n```jsonl\n{"accountId": 501, "tagline": {"text": "Payroll for EU contractors"}, "links": {"website": "https://acme.example"}}\n{"accountId": 502, "description": {"text": "Cloud cost tooling for retailers."}, "links": {"website": "https://beta.example"}}\n```\n\nA row fails as a whole with the API\'s code: `validation_failed` (an unknown field is `unknown_field`, and `error.details` names every bad field), `research_in_progress` (`409`: Ken is researching that record now, write it again once the run ends; an account run waiting for credits counts too: it runs once the workspace has credits, and the write stays refused until that run ends) or `not_found`. Rerunning a file is safe: each write replaces the record\'s research shown.\n\n## CRM sync\n\nCRM sync has generated commands only: read connections, preview, start an import, and work through sync issues. Connect the CRM itself in the app.\n\n```bash\nkenso crm-connections list\nkenso crm-connections get --connection-id 7\nkenso crm-imports create --connection-id 7 --dry-run\nkenso crm-sync-issues list --connection-id 7 --all\n```\n\nRun `kenso crm-connections --help` (or add `--all-commands` when the actions are hidden) to see every action.\n\n## Pipelines\n\nA workspace with the `pipelines` flag on can run several deal pipelines, each with its own stages. These are generated commands (beta):\n\n```bash\nkenso pipelines list\nkenso pipelines list --query "[].{id: id, name: name, default: isDefault, stages: stages[].key}"\nkenso pipelines get --pipeline-id 5\n```\n\n`list` prints every pipeline in display order, archived ones included: `id`, `name`, `routingRule` (the one sentence Ken reads to decide whether a new deal belongs there), `isDefault`, `isArchived`, `position`, `opportunityCount`, `amountTotal` and `stages`, each stage as `kenso opportunity-stages list` prints it. A stage key is unique in the workspace, across pipelines, so a deal\'s `stage` names its pipeline and its `pipelineId` repeats it. The first read turns the workspace\'s stage list into its default pipeline, named Sales, with every deal in it. The same rows as the MCP\'s `pipelines(operation="list")`.\n\nShaping them needs the `workspace_settings` permission:\n\n```bash\nkenso pipelines create --name Renewals --routing-rule "The account is already a customer" --data \'{"stages": [{"label": "Up for renewal", "category": "open"}, {"label": "Won", "category": "won"}, {"label": "Lost", "category": "lost"}]}\'\nkenso pipelines update --pipeline-id 6 --name Expansion --position 0\nkenso pipelines update --pipeline-id 6 --data @stages.json\nkenso pipelines archive --pipeline-id 6\nkenso pipelines restore --pipeline-id 6\n```\n\n- **`create`** takes a unique `name`, the pipeline\'s `stages` in display order (at least one `open`, one `won` and one `lost`) and an optional `routingRule`: one sentence that says which deals belong there, which Ken reads to route a new deal that names no pipeline. Each stage gets a key from its label; a key another pipeline already uses gets the pipeline\'s name in front (`renewals_won`). A workspace has at most 10 pipelines.\n- **`update`** changes what you send. `stages` is the pipeline\'s whole stage list: read it with `pipelines get`, keep each stage\'s `key`, and add a new stage without one. A stage with live deals in it cannot be left out; archive it with `"isArchived": true` instead.\n- **`archive`** stops new deals from entering a pipeline and keeps the deals in it. The default pipeline cannot be archived, and nothing is deleted: `restore` brings a pipeline back.\n\n## Restore a deleted account\n\n```bash\nkenso deleted-accounts list\nkenso accounts restore 812\n```\n\nA deleted account can be restored for 30 days. `deleted-accounts list` shows each one with who deleted it, `expiresAt` (restore works until then) and what comes back: `personCount`, `opportunityCount` and `touchCount`. `accounts restore <id>` brings the account back with its domains, its people, its deals and its planned touches, which wait for approval again. A domain another account took since stays with that account and is listed in `domainsTaken`. A merged account is not listed and cannot be restored: a merge has no undo. Both commands are behind the `crm_import_export` feature flag (`404` while it is off).\n\n## Export accounts, people or deals\n\n```bash\nkenso export accounts --out accounts.csv\nkenso export accounts --view 12 --out tier-1.csv\nkenso export deals --filters \'[{"field":"stageCategory","operator":"is","values":["open"]}]\' > open-deals.csv\n```\n\nIt writes the CSV that `POST /v1/accounts/export`, `/v1/people/export` or `/v1/opportunities/export` returns, to stdout or to `--out` (then it prints the file and its row count). With no filter it exports every record. More than 50,000 rows is refused: narrow the filters. `--view <id>` exports a saved Accounts view (`kenso account-views list` shows the ids). `--filters`, `--where` (accounts), `--q` and `--sort` are the search operation\'s own fields, so a deals or people view exports with its filters and sort. The accounts and deals files start with `id` and import back as they are. Each export writes an audit-log entry and needs the export permission. Accounts and deals also need the `crm_import_export` flag while it is in beta.\n\n## A deal\'s stage history\n\n```bash\nkenso opportunities stage-history 77\nkenso opportunities stage-history 77 --query "entries[].{to: stageLabel, at: enteredAt, by: changedBy}"\n```\n\nIt prints `GET /v1/opportunities/{id}/stage-history` as it is, the same rows as the deal page and the MCP\'s `opportunities(operation="get-stage-history")`: the stage now, `isComplete` and `entries`, oldest first, each with `fromStage`, `stage`, `stageLabel`, `enteredAt`, `leftAt`, `durationSeconds`, `actorKind`, `actorMemberId` and Ken\'s `reason` on a move its stage judge made. With the `deal_stage_rules` flag on, each entry also has `changedBy` (`member`, `agent`, `api_key`, `workflow`, `stage_judge`, `crm_sync` or `ken_automation`), `crmProvider` on a CRM sync, and on a move `fromStageLabel` and `fromStageDurationSeconds`, how long the deal sat in the stage it left. `isComplete` false means Kenso has no record of part of the history.\n\n## Notes on accounts, people and deals\n\nWith the `record_notes` feature on, everyone who can see a record reads its notes. Name the record with exactly one of `--account`, `--person` and `--deal`:\n\n```bash\nkenso notes list --account 5\nkenso notes add --account 5 --body \'Budget approved, @[Jane Doe](41) please send the DPA\'\nkenso notes add --parent 900 --body \'Sent it this morning\' # a comment under note 900\ncat call-notes.md | kenso notes add --deal 77 --body - # the body from stdin\nkenso notes edit 900 --body \'Budget approved for Q1\' # the author only\nkenso notes edit 900 --pin\nkenso notes delete 900 --yes # kenso notes restore 900 brings it back\n```\n\nThe body is markdown, up to 20,000 characters. Mention a teammate as `@[Name](memberId)`: they get a notification that opens the note. A note shows on the record\'s Notes tab and its Activity timeline, and Ken\'s account brief quotes the account\'s notes. The MCP\'s `notes` tool does the same. A note on an account needs the accounts plan feature; people and deals work on every plan.\n\n## Required fields per stage\n\n```bash\nkenso pipelines stage-rules\nkenso pipelines stage-rules proposal --require amount,closeDate,custom.tier\nkenso pipelines stage-rules proposal --none\nkenso pipelines stage-rules lost --default\n```\n\nWith the `deal_stage_rules` flag on, each stage can name the fields a deal should have in it. Without a stage the command prints every stage\'s `key`, `label`, `category`, `isArchived`, `requiredFields` and `isDefault`, plus `requirableFields`: `amount`, `closeDate`, `ownerMemberId`, `primaryPersonId`, `nextStep`, `lostReasonKey`, `wonReasonKey` and `custom.<key>` for each custom deal field. `--require` sets the stage\'s whole list, in order, at most 10. `--none` requires nothing, and `--default` goes back to the default: a lost stage asks for `lostReasonKey`, any other stage nothing. Setting a rule needs the `workspace_settings` permission. The same as the MCP\'s `opportunities(operation="stages-set-required-fields")`.\n\nA missing field never stops a move. The deal moves, and it is flagged Missing on the board, the list and the deal page until the field is filled. A rule also applies to deals already in the stage.\n\n```bash\nkenso opportunities update --opportunity-id 4401 --stage proposal\nkenso opportunities list --missing-fields\n```\n\nEvery deal then carries `missingFields` (`[{field, label}]`). A create, or an update that sends a stage, answers `warnings` beside the deal for each field the stage asks for that the deal leaves empty: each prints on stderr as `warning: <message>`, stdout stays the deal and the exit code stays 0. `--missing-fields` keeps only the deals flagged Missing (also `missingFields: true` on `kenso opportunities search`).\n\n## Won and lost reasons\n\n```bash\nkenso opportunity-reasons get\nkenso opportunity-reasons replace --kind lost --data \'{"reasons":[{"key":"no_budget","label":"No budget"},{"label":"Built it in-house"}]}\'\nkenso opportunities move 4401 --stage lost --reason built_it_in_house\n```\n\n`kenso opportunities move <id> --stage <key> [--reason <key>]` sends the reason as `lostReasonKey` for a lost stage or `wonReasonKey` for a won stage; an open stage takes none. Each field the new stage asks for that the deal leaves empty prints a warning on stderr, and the move still goes through.\n\nWith the `deal_stage_rules` flag on, each workspace edits why its deals are lost and won. `get` prints `lost` and `won`, each `{isDefault, reasons: [{key, label, isArchived}]}`. `replace` takes a kind\'s whole list in order, as `get` prints it: keep a reason by its `key`, leave `key` out for a new one, and set `isArchived` to archive a reason or bring one back. A reason left out is archived too: deals keep it, and no write can pick it again. At least one reason stays live and at most 30, and labels stay unique, archived ones included. A deal takes a live key in `lostReasonKey` (a lost stage) or `wonReasonKey` (a won stage). A move to Lost without a reason still goes through, with a warning and "Missing: Lost reason" on the deal. Editing the lists needs the `workspace_settings` permission. The same as the MCP\'s `pipelines(operation="reasons-get")` and `reasons-replace`.\n\n## Record page layouts\n\n```bash\nkenso layouts show account\nkenso layouts set account --header tier,ownerMemberId,score,custom.arr\nkenso layouts show account > layout.json && kenso layouts set account --data @layout.json\nkenso layouts reset account\n```\n\nWith the `record_layout` flag on, a workspace lays out each record page once, for every member: `account`, `person` or `opportunity` (a deal). `show` prints `GET /v1/record-layouts/{object}`: `isDefault`, `version`, `headerFields` (up to 6, pinned under the record\'s name), `railSections` (`{name, fields}`), `hiddenFields` (under the rail\'s More), `sections` (`{key, label, placement, locked, hidden}`, in page order) and `availableFields`. Field keys are the field catalog\'s (`ownerMemberId`, `closeDate`, `primaryDomain`); a custom field is `custom.<field_key>`, and a new one joins the last rail section.\n\n`set --header` pins up to 6 fields and keeps the rest of the saved layout; the fields it unpins go to the top of the first rail section. `set --data` saves a whole layout, so group the rail into sections or hide a section that way, starting from `show`. A save made after someone else\'s answers a conflict: show it again. `reset` puts the page back to Kenso\'s default. Saving needs the `workspace_settings` permission, and the account page also needs the `accounts` plan. The same as the MCP\'s `account_views` operations `record-layouts-get`, `record-layouts-replace` and `record-layouts-reset`.\n\n## Tasks\n\nTasks are to-dos a member owes: a title, an optional due day or time, an assignee and at most one account, person or deal. They need the `tasks` flag. The app calls deals "Deals"; the CLI keeps `--deal` for an opportunity id.\n\n```bash\nkenso tasks add "Send the deck" --due tomorrow --account 812\nkenso tasks add "Call Ada back" --due friday --at 16:00 --person 501 --assignee ada@acme.com\nkenso tasks list --assignee me --due overdue,today\nkenso tasks queue --scope mine\nkenso tasks assign 7 me\nkenso tasks done 7 8 9\nkenso tasks done 7 --undo\n```\n\n- `tasks add` sends `POST /v1/tasks`. `--due` takes `today`, `tomorrow`, a weekday (the next one: `friday` or `fri`), a day (`2026-11-20`) or an ISO 8601 time; `--at HH:MM` puts a time on that day (today without `--due`). Day words and `--at` read this computer\'s clock and time zone (`TZ`); a time\'s day is read in the assignee\'s app time zone. `--assignee` takes `me`, a member id or an email; without it the task is yours.\n- `tasks done` completes each task it names, in order (`PATCH /v1/tasks/{id}` with `status: done`); `--undo` reopens them. `tasks assign` gives a task to `me`, a member id or a member\'s email; that member gets a `task_assigned` notification.\n- `tasks queue` is `task-queue list` under the name you would try: the Tasks screen\'s open work by due day, with `--scope mine|assigned_by_me|everyone`. It lists tasks, manual touches, call tasks, inbox threads with a reminder due (when you can view the Inbox) and Ken\'s follow-ups to you, each with the app path in `href` (null for a task, which opens in its panel).\n- `tasks list`, `get`, `update`, `delete`, `restore` and `task-queue list` are generated from the API: `kenso tasks --help` lists them.\n';
|
|
8257
8266
|
}
|
|
8258
8267
|
});
|
|
8259
8268
|
|
|
@@ -12834,6 +12843,146 @@ var init_jobs2 = __esm({
|
|
|
12834
12843
|
}
|
|
12835
12844
|
});
|
|
12836
12845
|
|
|
12846
|
+
// src/commands/layouts/layouts.ts
|
|
12847
|
+
var layouts_exports = {};
|
|
12848
|
+
__export(layouts_exports, {
|
|
12849
|
+
reset: () => reset,
|
|
12850
|
+
set: () => set,
|
|
12851
|
+
show: () => show,
|
|
12852
|
+
withHeader: () => withHeader
|
|
12853
|
+
});
|
|
12854
|
+
function objectOf(positionals, action) {
|
|
12855
|
+
const text4 = (positionals[0] ?? "").trim().toLowerCase();
|
|
12856
|
+
if (!OBJECTS2.includes(text4)) {
|
|
12857
|
+
throw usageError(`object must be account, person or opportunity (got "${positionals[0] ?? ""}").`, {
|
|
12858
|
+
field: "object",
|
|
12859
|
+
next: `kenso layouts ${action} account`
|
|
12860
|
+
});
|
|
12861
|
+
}
|
|
12862
|
+
return text4;
|
|
12863
|
+
}
|
|
12864
|
+
async function call(ctx, method, object, body2) {
|
|
12865
|
+
const res = await ctx.client.request({ method, path: `/v1/record-layouts/${object}`, body: body2, signal: ctx.signal });
|
|
12866
|
+
return unwrap(res.body);
|
|
12867
|
+
}
|
|
12868
|
+
function bodyOf(layout) {
|
|
12869
|
+
return {
|
|
12870
|
+
version: layout.version,
|
|
12871
|
+
headerFields: layout.headerFields,
|
|
12872
|
+
railSections: layout.railSections?.map((s) => ({ name: s.name, fields: s.fields })),
|
|
12873
|
+
hiddenFields: layout.hiddenFields,
|
|
12874
|
+
sections: layout.sections?.map((s) => ({ key: s.key, hidden: s.hidden ?? false }))
|
|
12875
|
+
};
|
|
12876
|
+
}
|
|
12877
|
+
function withHeader(layout, header) {
|
|
12878
|
+
const pinned = new Set(header.map((key) => key.toLowerCase()));
|
|
12879
|
+
const unpinned = (layout.headerFields ?? []).filter((f) => !pinned.has(f.toLowerCase()));
|
|
12880
|
+
return bodyOf({
|
|
12881
|
+
version: layout.version,
|
|
12882
|
+
headerFields: header,
|
|
12883
|
+
railSections: (layout.railSections ?? []).map((s, index) => ({
|
|
12884
|
+
name: s.name,
|
|
12885
|
+
fields: [...index === 0 ? unpinned : [], ...s.fields.filter((f) => !pinned.has(f.toLowerCase()))]
|
|
12886
|
+
})),
|
|
12887
|
+
hiddenFields: (layout.hiddenFields ?? []).filter((f) => !pinned.has(f.toLowerCase())),
|
|
12888
|
+
sections: layout.sections ?? []
|
|
12889
|
+
});
|
|
12890
|
+
}
|
|
12891
|
+
var OBJECTS2, BETA, OBJECT_ARG, show, set, reset;
|
|
12892
|
+
var init_layouts = __esm({
|
|
12893
|
+
"src/commands/layouts/layouts.ts"() {
|
|
12894
|
+
"use strict";
|
|
12895
|
+
init_errors();
|
|
12896
|
+
init_exit_codes();
|
|
12897
|
+
init_http();
|
|
12898
|
+
init_input();
|
|
12899
|
+
OBJECTS2 = ["account", "person", "opportunity"];
|
|
12900
|
+
BETA = { featureGates: { all: ["record_layout"] } };
|
|
12901
|
+
OBJECT_ARG = { name: "object", required: true, description: "account, person or opportunity (a deal)" };
|
|
12902
|
+
show = {
|
|
12903
|
+
resource: "layouts",
|
|
12904
|
+
action: "show",
|
|
12905
|
+
summary: "Show how the workspace's account, person or deal pages lay out their fields",
|
|
12906
|
+
description: "Reads GET /v1/record-layouts/{object} and prints it: isDefault, version, headerFields (up to 6, pinned under the record's name), railSections ({name, fields}), hiddenFields (under the rail's More), sections ({key, label, placement, locked, hidden}, in page order) and availableFields ({key, label, custom}). A custom field's key is custom.<field_key>. The default answers while nobody saved a layout.",
|
|
12907
|
+
flags: {},
|
|
12908
|
+
positionals: [OBJECT_ARG],
|
|
12909
|
+
examples: ["kenso layouts show account", "kenso layouts show person --query 'railSections[].name'"],
|
|
12910
|
+
beta: BETA,
|
|
12911
|
+
operationIds: ["record-layouts.get"],
|
|
12912
|
+
async run(ctx, { positionals }) {
|
|
12913
|
+
ctx.output.object(await call(ctx, "GET", objectOf(positionals, "show")));
|
|
12914
|
+
return ExitCode.Ok;
|
|
12915
|
+
}
|
|
12916
|
+
};
|
|
12917
|
+
set = {
|
|
12918
|
+
resource: "layouts",
|
|
12919
|
+
action: "set",
|
|
12920
|
+
summary: "Save the layout every account, person or deal page in the workspace draws",
|
|
12921
|
+
description: "PUT /v1/record-layouts/{object}. --header pins up to 6 fields to the header: it reads the layout, takes those fields out of the rail and the hidden list, puts the fields it unpins at the top of the first rail section, and saves the rest as it was. --data sends a whole layout (headerFields, railSections, hiddenFields, sections, version) inline, from @file or from - (stdin); start from `kenso layouts show <object>`. A save after someone else's answers conflict: show it again. Needs the workspace_settings permission; it changes the page for every member.",
|
|
12922
|
+
flags: {
|
|
12923
|
+
header: { type: "string", description: "Field keys to pin to the header, comma separated (tier,custom.arr)" },
|
|
12924
|
+
data: { type: "string", description: "The whole layout as JSON: inline, @file or - for stdin" }
|
|
12925
|
+
},
|
|
12926
|
+
positionals: [OBJECT_ARG],
|
|
12927
|
+
examples: [
|
|
12928
|
+
"kenso layouts set account --header tier,custom.arr",
|
|
12929
|
+
"kenso layouts show account > layout.json && kenso layouts set account --data @layout.json"
|
|
12930
|
+
],
|
|
12931
|
+
beta: BETA,
|
|
12932
|
+
operationIds: ["record-layouts.get", "record-layouts.replace"],
|
|
12933
|
+
async run(ctx, { flags, positionals }) {
|
|
12934
|
+
const object = objectOf(positionals, "set");
|
|
12935
|
+
const header = typeof flags.header === "string" ? flags.header : void 0;
|
|
12936
|
+
const data = typeof flags.data === "string" ? flags.data : void 0;
|
|
12937
|
+
if (header === void 0 === (data === void 0)) {
|
|
12938
|
+
throw usageError("Pass one of --header or --data.", { next: `kenso layouts set ${object} --header tier,ownerMemberId` });
|
|
12939
|
+
}
|
|
12940
|
+
let body2;
|
|
12941
|
+
if (header !== void 0) {
|
|
12942
|
+
const keys = header.split(",").map((k) => k.trim()).filter(Boolean);
|
|
12943
|
+
body2 = withHeader(await call(ctx, "GET", object), keys);
|
|
12944
|
+
} else {
|
|
12945
|
+
const parsed2 = await readDataArg(data, ctx.stdin);
|
|
12946
|
+
if (parsed2 === null || typeof parsed2 !== "object" || Array.isArray(parsed2)) {
|
|
12947
|
+
throw usageError("--data must be a JSON object: {headerFields, railSections, hiddenFields, sections, version}.", { field: "data" });
|
|
12948
|
+
}
|
|
12949
|
+
body2 = bodyOf(parsed2);
|
|
12950
|
+
}
|
|
12951
|
+
ctx.output.object(await call(ctx, "PUT", object, body2));
|
|
12952
|
+
return ExitCode.Ok;
|
|
12953
|
+
}
|
|
12954
|
+
};
|
|
12955
|
+
reset = {
|
|
12956
|
+
resource: "layouts",
|
|
12957
|
+
action: "reset",
|
|
12958
|
+
summary: "Put the account, person or deal page back to Kenso's default layout",
|
|
12959
|
+
description: "DELETE /v1/record-layouts/{object}: drops the saved layout for the whole workspace (the version keeps counting) and prints the default.",
|
|
12960
|
+
flags: {},
|
|
12961
|
+
positionals: [OBJECT_ARG],
|
|
12962
|
+
examples: ["kenso layouts reset account"],
|
|
12963
|
+
beta: BETA,
|
|
12964
|
+
operationIds: ["record-layouts.reset"],
|
|
12965
|
+
async run(ctx, { positionals }) {
|
|
12966
|
+
ctx.output.object(await call(ctx, "DELETE", objectOf(positionals, "reset")));
|
|
12967
|
+
return ExitCode.Ok;
|
|
12968
|
+
}
|
|
12969
|
+
};
|
|
12970
|
+
}
|
|
12971
|
+
});
|
|
12972
|
+
|
|
12973
|
+
// src/commands/layouts/index.ts
|
|
12974
|
+
var actions15;
|
|
12975
|
+
var init_layouts2 = __esm({
|
|
12976
|
+
"src/commands/layouts/index.ts"() {
|
|
12977
|
+
"use strict";
|
|
12978
|
+
actions15 = {
|
|
12979
|
+
show: () => Promise.resolve().then(() => (init_layouts(), layouts_exports)).then((m) => m.show),
|
|
12980
|
+
set: () => Promise.resolve().then(() => (init_layouts(), layouts_exports)).then((m) => m.set),
|
|
12981
|
+
reset: () => Promise.resolve().then(() => (init_layouts(), layouts_exports)).then((m) => m.reset)
|
|
12982
|
+
};
|
|
12983
|
+
}
|
|
12984
|
+
});
|
|
12985
|
+
|
|
12837
12986
|
// src/commands/logs/tail.ts
|
|
12838
12987
|
var tail_exports = {};
|
|
12839
12988
|
__export(tail_exports, {
|
|
@@ -12988,11 +13137,11 @@ var init_tail = __esm({
|
|
|
12988
13137
|
});
|
|
12989
13138
|
|
|
12990
13139
|
// src/commands/logs/index.ts
|
|
12991
|
-
var
|
|
13140
|
+
var actions16;
|
|
12992
13141
|
var init_logs = __esm({
|
|
12993
13142
|
"src/commands/logs/index.ts"() {
|
|
12994
13143
|
"use strict";
|
|
12995
|
-
|
|
13144
|
+
actions16 = {
|
|
12996
13145
|
tail: () => Promise.resolve().then(() => (init_tail(), tail_exports)).then((m) => m.default)
|
|
12997
13146
|
};
|
|
12998
13147
|
}
|
|
@@ -13144,11 +13293,11 @@ var init_tools = __esm({
|
|
|
13144
13293
|
});
|
|
13145
13294
|
|
|
13146
13295
|
// src/commands/mcp/index.ts
|
|
13147
|
-
var
|
|
13296
|
+
var actions17;
|
|
13148
13297
|
var init_mcp = __esm({
|
|
13149
13298
|
"src/commands/mcp/index.ts"() {
|
|
13150
13299
|
"use strict";
|
|
13151
|
-
|
|
13300
|
+
actions17 = {
|
|
13152
13301
|
call: () => Promise.resolve().then(() => (init_call(), call_exports)).then((m) => m.default),
|
|
13153
13302
|
tools: () => Promise.resolve().then(() => (init_tools(), tools_exports)).then((m) => m.default)
|
|
13154
13303
|
};
|
|
@@ -13355,11 +13504,11 @@ var init_delete = __esm({
|
|
|
13355
13504
|
});
|
|
13356
13505
|
|
|
13357
13506
|
// src/commands/notes/index.ts
|
|
13358
|
-
var
|
|
13507
|
+
var actions18;
|
|
13359
13508
|
var init_notes = __esm({
|
|
13360
13509
|
"src/commands/notes/index.ts"() {
|
|
13361
13510
|
"use strict";
|
|
13362
|
-
|
|
13511
|
+
actions18 = {
|
|
13363
13512
|
list: () => Promise.resolve().then(() => (init_list(), list_exports)).then((m) => m.default),
|
|
13364
13513
|
add: () => Promise.resolve().then(() => (init_add(), add_exports)).then((m) => m.default),
|
|
13365
13514
|
edit: () => Promise.resolve().then(() => (init_edit(), edit_exports)).then((m) => m.default),
|
|
@@ -13500,6 +13649,7 @@ var init_bulk_update3 = __esm({
|
|
|
13500
13649
|
plural: "deals",
|
|
13501
13650
|
aliases: { owner: "ownerMemberId", close: "closeDate" },
|
|
13502
13651
|
fields: ["stage", "ownerMemberId", "closeDate", "amount", "dealType", "nextStep"],
|
|
13652
|
+
textFields: ["stage", "closeDate", "dealType", "nextStep"],
|
|
13503
13653
|
featureGates: ["opportunities", "bulk_edit"],
|
|
13504
13654
|
examples: [
|
|
13505
13655
|
`kenso opportunities bulk-update --filter '{"filters":[{"field":"stageCategory","operator":"is","values":["open"]}]}' --set stage=proposal --dry-run`,
|
|
@@ -13535,11 +13685,11 @@ var init_bulk_delete2 = __esm({
|
|
|
13535
13685
|
});
|
|
13536
13686
|
|
|
13537
13687
|
// src/commands/opportunities/index.ts
|
|
13538
|
-
var
|
|
13688
|
+
var actions19;
|
|
13539
13689
|
var init_opportunities = __esm({
|
|
13540
13690
|
"src/commands/opportunities/index.ts"() {
|
|
13541
13691
|
"use strict";
|
|
13542
|
-
|
|
13692
|
+
actions19 = {
|
|
13543
13693
|
move: () => Promise.resolve().then(() => (init_move(), move_exports)).then((m) => m.default),
|
|
13544
13694
|
"stage-history": () => Promise.resolve().then(() => (init_stage_history(), stage_history_exports)).then((m) => m.default),
|
|
13545
13695
|
"bulk-update": () => Promise.resolve().then(() => (init_bulk_update3(), bulk_update_exports2)).then((m) => m.default),
|
|
@@ -13736,6 +13886,7 @@ var init_bulk_update4 = __esm({
|
|
|
13736
13886
|
plural: "people",
|
|
13737
13887
|
aliases: { owner: "ownerMemberId" },
|
|
13738
13888
|
fields: ["ownerMemberId", "leadStatus", "title", "seniority", "department", "location"],
|
|
13889
|
+
textFields: ["leadStatus", "title", "seniority", "department", "location"],
|
|
13739
13890
|
featureGates: ["accounts", "bulk_edit"],
|
|
13740
13891
|
examples: [
|
|
13741
13892
|
`kenso people bulk-update --filter '{"leadStatus":["working"]}' --set owner=42 --dry-run`,
|
|
@@ -13771,11 +13922,11 @@ var init_bulk_delete3 = __esm({
|
|
|
13771
13922
|
});
|
|
13772
13923
|
|
|
13773
13924
|
// src/commands/people/index.ts
|
|
13774
|
-
var
|
|
13925
|
+
var actions20;
|
|
13775
13926
|
var init_people = __esm({
|
|
13776
13927
|
"src/commands/people/index.ts"() {
|
|
13777
13928
|
"use strict";
|
|
13778
|
-
|
|
13929
|
+
actions20 = {
|
|
13779
13930
|
import: () => Promise.resolve().then(() => (init_import3(), import_exports3)).then((m) => m.default),
|
|
13780
13931
|
"bulk-update": () => Promise.resolve().then(() => (init_bulk_update4(), bulk_update_exports3)).then((m) => m.default),
|
|
13781
13932
|
"bulk-delete": () => Promise.resolve().then(() => (init_bulk_delete3(), bulk_delete_exports3)).then((m) => m.default)
|
|
@@ -13863,11 +14014,11 @@ var init_stage_rules = __esm({
|
|
|
13863
14014
|
});
|
|
13864
14015
|
|
|
13865
14016
|
// src/commands/pipelines/index.ts
|
|
13866
|
-
var
|
|
14017
|
+
var actions21;
|
|
13867
14018
|
var init_pipelines = __esm({
|
|
13868
14019
|
"src/commands/pipelines/index.ts"() {
|
|
13869
14020
|
"use strict";
|
|
13870
|
-
|
|
14021
|
+
actions21 = {
|
|
13871
14022
|
"stage-rules": () => Promise.resolve().then(() => (init_stage_rules(), stage_rules_exports)).then((m) => m.default)
|
|
13872
14023
|
};
|
|
13873
14024
|
}
|
|
@@ -14024,11 +14175,11 @@ var init_summary = __esm({
|
|
|
14024
14175
|
});
|
|
14025
14176
|
|
|
14026
14177
|
// src/commands/reports/index.ts
|
|
14027
|
-
var
|
|
14178
|
+
var actions22;
|
|
14028
14179
|
var init_reports = __esm({
|
|
14029
14180
|
"src/commands/reports/index.ts"() {
|
|
14030
14181
|
"use strict";
|
|
14031
|
-
|
|
14182
|
+
actions22 = {
|
|
14032
14183
|
run: () => Promise.resolve().then(() => (init_run2(), run_exports2)).then((m) => m.default),
|
|
14033
14184
|
summary: () => Promise.resolve().then(() => (init_summary(), summary_exports)).then((m) => m.default)
|
|
14034
14185
|
};
|
|
@@ -14247,11 +14398,11 @@ var init_resume = __esm({
|
|
|
14247
14398
|
});
|
|
14248
14399
|
|
|
14249
14400
|
// src/commands/runs/index.ts
|
|
14250
|
-
var
|
|
14401
|
+
var actions23;
|
|
14251
14402
|
var init_runs2 = __esm({
|
|
14252
14403
|
"src/commands/runs/index.ts"() {
|
|
14253
14404
|
"use strict";
|
|
14254
|
-
|
|
14405
|
+
actions23 = {
|
|
14255
14406
|
list: () => Promise.resolve().then(() => (init_list2(), list_exports2)).then((m) => m.default),
|
|
14256
14407
|
show: () => Promise.resolve().then(() => (init_show2(), show_exports2)).then((m) => m.default),
|
|
14257
14408
|
resume: () => Promise.resolve().then(() => (init_resume(), resume_exports)).then((m) => m.default)
|
|
@@ -14320,11 +14471,11 @@ function saveTestKey(ctx, sandboxId, key) {
|
|
|
14320
14471
|
return;
|
|
14321
14472
|
}
|
|
14322
14473
|
ctx.output.info(`Saved as profile "${SANDBOX_PROFILE}". Run commands against it with --profile ${SANDBOX_PROFILE}. The key is shown once.`);
|
|
14323
|
-
const
|
|
14324
|
-
if (
|
|
14325
|
-
const both =
|
|
14474
|
+
const set2 = [ctx.auth.source === "env" ? "KENSO_API_KEY" : "", ctx.env.KENSO_WORKSPACE_ID?.trim() ? "KENSO_WORKSPACE_ID" : ""].filter((name) => name !== "");
|
|
14475
|
+
if (set2.length > 0) {
|
|
14476
|
+
const both = set2.length > 1;
|
|
14326
14477
|
ctx.output.warn(
|
|
14327
|
-
`${
|
|
14478
|
+
`${set2.join(" and ")} ${both ? "are set and win" : "is set and wins"} over the saved profile, so --profile ${SANDBOX_PROFILE} will not use the test key and its sandbox. To work in the sandbox, set KENSO_API_KEY=<the test key> KENSO_WORKSPACE_ID=${sandboxId}, or unset ${both ? "them" : "it"}.`
|
|
14328
14479
|
);
|
|
14329
14480
|
}
|
|
14330
14481
|
}
|
|
@@ -14550,11 +14701,11 @@ var init_reset = __esm({
|
|
|
14550
14701
|
});
|
|
14551
14702
|
|
|
14552
14703
|
// src/commands/sandbox/index.ts
|
|
14553
|
-
var
|
|
14704
|
+
var actions24;
|
|
14554
14705
|
var init_sandbox2 = __esm({
|
|
14555
14706
|
"src/commands/sandbox/index.ts"() {
|
|
14556
14707
|
"use strict";
|
|
14557
|
-
|
|
14708
|
+
actions24 = {
|
|
14558
14709
|
create: () => Promise.resolve().then(() => (init_create(), create_exports)).then((m) => m.default),
|
|
14559
14710
|
delete: () => Promise.resolve().then(() => (init_delete2(), delete_exports2)).then((m) => m.default),
|
|
14560
14711
|
key: () => Promise.resolve().then(() => (init_key(), key_exports)).then((m) => m.default),
|
|
@@ -14565,11 +14716,11 @@ var init_sandbox2 = __esm({
|
|
|
14565
14716
|
});
|
|
14566
14717
|
|
|
14567
14718
|
// src/commands/skill/index.ts
|
|
14568
|
-
var
|
|
14719
|
+
var actions25;
|
|
14569
14720
|
var init_skill = __esm({
|
|
14570
14721
|
"src/commands/skill/index.ts"() {
|
|
14571
14722
|
"use strict";
|
|
14572
|
-
|
|
14723
|
+
actions25 = {
|
|
14573
14724
|
install: () => Promise.resolve().then(() => (init_install(), install_exports)).then((m) => m.default)
|
|
14574
14725
|
};
|
|
14575
14726
|
}
|
|
@@ -15438,11 +15589,11 @@ var init_fill = __esm({
|
|
|
15438
15589
|
});
|
|
15439
15590
|
|
|
15440
15591
|
// src/commands/studio/index.ts
|
|
15441
|
-
var
|
|
15592
|
+
var actions26;
|
|
15442
15593
|
var init_studio2 = __esm({
|
|
15443
15594
|
"src/commands/studio/index.ts"() {
|
|
15444
15595
|
"use strict";
|
|
15445
|
-
|
|
15596
|
+
actions26 = {
|
|
15446
15597
|
pull: () => Promise.resolve().then(() => (init_pull(), pull_exports)).then((m) => m.default),
|
|
15447
15598
|
push: () => Promise.resolve().then(() => (init_push(), push_exports)).then((m) => m.default),
|
|
15448
15599
|
validate: () => Promise.resolve().then(() => (init_validate(), validate_exports)).then((m) => m.default),
|
|
@@ -15708,11 +15859,11 @@ var init_queue = __esm({
|
|
|
15708
15859
|
});
|
|
15709
15860
|
|
|
15710
15861
|
// src/commands/tasks/index.ts
|
|
15711
|
-
var
|
|
15862
|
+
var actions27;
|
|
15712
15863
|
var init_tasks = __esm({
|
|
15713
15864
|
"src/commands/tasks/index.ts"() {
|
|
15714
15865
|
"use strict";
|
|
15715
|
-
|
|
15866
|
+
actions27 = {
|
|
15716
15867
|
add: () => Promise.resolve().then(() => (init_add2(), add_exports2)).then((m) => m.default),
|
|
15717
15868
|
done: () => Promise.resolve().then(() => (init_done(), done_exports)).then((m) => m.default),
|
|
15718
15869
|
assign: () => Promise.resolve().then(() => (init_assign(), assign_exports)).then((m) => m.default),
|
|
@@ -16060,11 +16211,11 @@ var init_trigger = __esm({
|
|
|
16060
16211
|
});
|
|
16061
16212
|
|
|
16062
16213
|
// src/commands/webhooks/index.ts
|
|
16063
|
-
var
|
|
16214
|
+
var actions28;
|
|
16064
16215
|
var init_webhooks2 = __esm({
|
|
16065
16216
|
"src/commands/webhooks/index.ts"() {
|
|
16066
16217
|
"use strict";
|
|
16067
|
-
|
|
16218
|
+
actions28 = {
|
|
16068
16219
|
listen: () => Promise.resolve().then(() => (init_listen(), listen_exports)).then((m) => m.default),
|
|
16069
16220
|
trigger: () => Promise.resolve().then(() => (init_trigger(), trigger_exports)).then((m) => m.default)
|
|
16070
16221
|
};
|
|
@@ -16087,10 +16238,10 @@ async function pause3(ms, signal) {
|
|
|
16087
16238
|
return false;
|
|
16088
16239
|
}
|
|
16089
16240
|
}
|
|
16090
|
-
async function untilAvailable(ctx,
|
|
16241
|
+
async function untilAvailable(ctx, call2, signal) {
|
|
16091
16242
|
for (let waits = 0; ; waits++) {
|
|
16092
16243
|
try {
|
|
16093
|
-
return await
|
|
16244
|
+
return await call2();
|
|
16094
16245
|
} catch (err) {
|
|
16095
16246
|
if (!unavailable(err) || waits >= MAX_UNAVAILABLE_WAITS) throw err;
|
|
16096
16247
|
const status = err.httpStatus;
|
|
@@ -16227,14 +16378,14 @@ async function releaseClaim(ctx, claimId, headers = {}) {
|
|
|
16227
16378
|
const data = unwrap(res.body);
|
|
16228
16379
|
return isRecord8(data) && typeof data.released === "number" ? data.released : 0;
|
|
16229
16380
|
}
|
|
16230
|
-
var
|
|
16381
|
+
var BETA2, KINDS_TEXT, MAX_PER_FILE, MIN_LEASE_MINUTES, MAX_LEASE_MINUTES, KIND_FLAG, CAMPAIGN_FLAG, LIVE_ONLY_FLAG, PER_FILE_FLAG, LEASE_FLAG, OUT_FLAG3, UNTIL_DONE, WORK_TIMING, MAX_UNAVAILABLE_WAITS;
|
|
16231
16382
|
var init_common3 = __esm({
|
|
16232
16383
|
"src/commands/work/common.ts"() {
|
|
16233
16384
|
"use strict";
|
|
16234
16385
|
init_errors();
|
|
16235
16386
|
init_http();
|
|
16236
16387
|
init_wait();
|
|
16237
|
-
|
|
16388
|
+
BETA2 = { featureGates: { all: ["agent_work"] } };
|
|
16238
16389
|
KINDS_TEXT = "meeting_brief, call_brief, workflow_prompt, qualification, segmentation, personalization, rewriting or background_ai";
|
|
16239
16390
|
MAX_PER_FILE = 50;
|
|
16240
16391
|
MIN_LEASE_MINUTES = 5;
|
|
@@ -16274,7 +16425,7 @@ var init_status3 = __esm({
|
|
|
16274
16425
|
description: "Calls GET /v1/agent-work and prints one row per kind: executor (kenso_ai, or my_agent when the workspace gave the kind to its agent in Settings), waiting (items your agent can claim now), claimed (items held by open claims), heldBy (billing_blocked, out_of_credits or ai_paused when Kenso holds the kind back) and lastAcceptedAt. --live-only counts only the campaigns Kenso's AI works on by itself, as kenso work run --live-only takes them. A table on a terminal, NDJSON when piped, a JSON array with -o json.",
|
|
16275
16426
|
flags: { campaign: CAMPAIGN_FLAG, "live-only": LIVE_ONLY_FLAG },
|
|
16276
16427
|
examples: ["kenso work status", "kenso work status --live-only", "kenso work status --campaign 812 -o json"],
|
|
16277
|
-
beta:
|
|
16428
|
+
beta: BETA2,
|
|
16278
16429
|
operationIds: ["agent-work.get"],
|
|
16279
16430
|
async run(ctx, { flags }) {
|
|
16280
16431
|
const campaignId = campaignFlag(flags);
|
|
@@ -16432,8 +16583,8 @@ var init_files = __esm({
|
|
|
16432
16583
|
import { execFile, spawnSync as spawnSync2 } from "node:child_process";
|
|
16433
16584
|
import { readFileSync as readFileSync12 } from "node:fs";
|
|
16434
16585
|
import { isAbsolute as isAbsolute2 } from "node:path";
|
|
16435
|
-
function sudoArgs(user, command65, args, keep = [],
|
|
16436
|
-
const assignments = Object.entries(
|
|
16586
|
+
function sudoArgs(user, command65, args, keep = [], set2 = {}) {
|
|
16587
|
+
const assignments = Object.entries(set2).map(([name, value]) => `${name}=${value}`);
|
|
16437
16588
|
return ["-n", "-u", user, "-H", ...keep.length > 0 ? [`--preserve-env=${keep.join(",")}`] : [], ...assignments, "--", command65, ...args];
|
|
16438
16589
|
}
|
|
16439
16590
|
function agentKensoEnv(opts) {
|
|
@@ -16705,7 +16856,7 @@ var init_pull2 = __esm({
|
|
|
16705
16856
|
"kenso work pull --kind personalization --campaign 812 --out ./work"
|
|
16706
16857
|
],
|
|
16707
16858
|
helpFooter: ["Then: answer each <claimId>.work.json into <claimId>.answers.json, and kenso work submit <dir>/*.answers.json."],
|
|
16708
|
-
beta:
|
|
16859
|
+
beta: BETA2,
|
|
16709
16860
|
operationIds: ["agent-work.create-claim", "agent-work.release-claim"],
|
|
16710
16861
|
// After Ctrl-C a claim on its way still lands in a work file and the summary, so it can be answered or released.
|
|
16711
16862
|
interruptGraceMs: 3e4,
|
|
@@ -16923,7 +17074,7 @@ var init_submit = __esm({
|
|
|
16923
17074
|
flags: {},
|
|
16924
17075
|
positionals: [{ name: "answers-file", required: true, variadic: true, description: "One or more <claimId>.answers.json files" }],
|
|
16925
17076
|
examples: ["kenso work submit ./work/awc_8fK2.answers.json", "kenso work submit ~/.kenso/runs/r_ab3dxk2q/*.answers.json"],
|
|
16926
|
-
beta:
|
|
17077
|
+
beta: BETA2,
|
|
16927
17078
|
operationIds: ["agent-work.submit-answers"],
|
|
16928
17079
|
async run(ctx, { positionals }) {
|
|
16929
17080
|
const paths = [...new Set(positionals.map((p) => resolve14(p)))];
|
|
@@ -16985,7 +17136,7 @@ var init_release = __esm({
|
|
|
16985
17136
|
flags: {},
|
|
16986
17137
|
positionals: [{ name: "claim", required: true, variadic: true, description: "Claim ids (awc_...) or <claimId>.work.json files" }],
|
|
16987
17138
|
examples: ["kenso work release awc_8fK2Qm1xYp3Lr7Tn0Va9Bc", "kenso work release ./work/*.work.json"],
|
|
16988
|
-
beta:
|
|
17139
|
+
beta: BETA2,
|
|
16989
17140
|
operationIds: ["agent-work.release-claim"],
|
|
16990
17141
|
async run(ctx, { positionals }) {
|
|
16991
17142
|
const ids2 = [...new Set(positionals.map(claimIdOf))];
|
|
@@ -17859,8 +18010,8 @@ var init_scan = __esm({
|
|
|
17859
18010
|
addWindows(text4, into) {
|
|
17860
18011
|
for (let i = 0; i + WINDOW <= text4.length; i++) into.add(this.hash(text4.slice(i, i + WINDOW)));
|
|
17861
18012
|
}
|
|
17862
|
-
anyWindow(text4,
|
|
17863
|
-
for (let i = 0; i + WINDOW <= text4.length; i++) if (
|
|
18013
|
+
anyWindow(text4, set2) {
|
|
18014
|
+
for (let i = 0; i + WINDOW <= text4.length; i++) if (set2.has(this.hash(text4.slice(i, i + WINDOW)))) return true;
|
|
17864
18015
|
return false;
|
|
17865
18016
|
}
|
|
17866
18017
|
};
|
|
@@ -18476,7 +18627,7 @@ var init_run3 = __esm({
|
|
|
18476
18627
|
"kenso docs work explains My agent, the files, the exit codes and what --allow-unconfined means.",
|
|
18477
18628
|
"--token-stdin, --agent-user and --agent-tools, left out above, are how a Kenso sandbox runs it: see kenso docs work."
|
|
18478
18629
|
],
|
|
18479
|
-
beta:
|
|
18630
|
+
beta: BETA2,
|
|
18480
18631
|
operationIds: ["agent-work.create-claim", "agent-work.submit-answers", "agent-work.release-claim", "agent-work.create-agent-key"],
|
|
18481
18632
|
// After Ctrl-C the agents stop, answers on their way finish and every open claim is released before the process quits.
|
|
18482
18633
|
interruptGraceMs: 3e4,
|
|
@@ -18772,11 +18923,11 @@ var init_run3 = __esm({
|
|
|
18772
18923
|
});
|
|
18773
18924
|
|
|
18774
18925
|
// src/commands/work/index.ts
|
|
18775
|
-
var
|
|
18926
|
+
var actions29;
|
|
18776
18927
|
var init_work2 = __esm({
|
|
18777
18928
|
"src/commands/work/index.ts"() {
|
|
18778
18929
|
"use strict";
|
|
18779
|
-
|
|
18930
|
+
actions29 = {
|
|
18780
18931
|
status: () => Promise.resolve().then(() => (init_status3(), status_exports3)).then((m) => m.default),
|
|
18781
18932
|
pull: () => Promise.resolve().then(() => (init_pull2(), pull_exports2)).then((m) => m.default),
|
|
18782
18933
|
submit: () => Promise.resolve().then(() => (init_submit(), submit_exports)).then((m) => m.default),
|
|
@@ -19010,11 +19161,11 @@ var init_use = __esm({
|
|
|
19010
19161
|
});
|
|
19011
19162
|
|
|
19012
19163
|
// src/commands/workspace/index.ts
|
|
19013
|
-
var
|
|
19164
|
+
var actions30;
|
|
19014
19165
|
var init_workspace = __esm({
|
|
19015
19166
|
"src/commands/workspace/index.ts"() {
|
|
19016
19167
|
"use strict";
|
|
19017
|
-
|
|
19168
|
+
actions30 = {
|
|
19018
19169
|
keys: () => Promise.resolve().then(() => (init_keys(), keys_exports)).then((m) => m.default),
|
|
19019
19170
|
list: () => Promise.resolve().then(() => (init_list4(), list_exports4)).then((m) => m.default),
|
|
19020
19171
|
use: () => Promise.resolve().then(() => (init_use(), use_exports)).then((m) => m.default)
|
|
@@ -19049,6 +19200,7 @@ var init_registry = __esm({
|
|
|
19049
19200
|
init_doctor();
|
|
19050
19201
|
init_export3();
|
|
19051
19202
|
init_jobs2();
|
|
19203
|
+
init_layouts2();
|
|
19052
19204
|
init_logs();
|
|
19053
19205
|
init_mcp();
|
|
19054
19206
|
init_notes();
|
|
@@ -19079,24 +19231,25 @@ var init_registry = __esm({
|
|
|
19079
19231
|
doctor: actions12,
|
|
19080
19232
|
export: actions13,
|
|
19081
19233
|
jobs: actions14,
|
|
19234
|
+
layouts: actions15,
|
|
19082
19235
|
login: topLevel("login", actions4.login, "kenso auth login"),
|
|
19083
19236
|
logout: topLevel("logout", actions4.logout, "kenso auth logout"),
|
|
19084
|
-
logs:
|
|
19085
|
-
mcp:
|
|
19086
|
-
notes:
|
|
19087
|
-
opportunities:
|
|
19088
|
-
people:
|
|
19089
|
-
pipelines:
|
|
19090
|
-
reports:
|
|
19091
|
-
runs:
|
|
19092
|
-
sandbox:
|
|
19093
|
-
skill:
|
|
19094
|
-
studio:
|
|
19095
|
-
tasks:
|
|
19096
|
-
webhooks:
|
|
19237
|
+
logs: actions16,
|
|
19238
|
+
mcp: actions17,
|
|
19239
|
+
notes: actions18,
|
|
19240
|
+
opportunities: actions19,
|
|
19241
|
+
people: actions20,
|
|
19242
|
+
pipelines: actions21,
|
|
19243
|
+
reports: actions22,
|
|
19244
|
+
runs: actions23,
|
|
19245
|
+
sandbox: actions24,
|
|
19246
|
+
skill: actions25,
|
|
19247
|
+
studio: actions26,
|
|
19248
|
+
tasks: actions27,
|
|
19249
|
+
webhooks: actions28,
|
|
19097
19250
|
whoami: topLevel("whoami", actions4.status, "kenso auth status"),
|
|
19098
|
-
work:
|
|
19099
|
-
workspace:
|
|
19251
|
+
work: actions29,
|
|
19252
|
+
workspace: actions30
|
|
19100
19253
|
};
|
|
19101
19254
|
resourceAliases = { leads: "contacts" };
|
|
19102
19255
|
}
|
|
@@ -19233,8 +19386,8 @@ async function renderTopHelp(opts) {
|
|
|
19233
19386
|
names.push(withPositionals(spec, spec.action));
|
|
19234
19387
|
groups.set(hint, names);
|
|
19235
19388
|
}
|
|
19236
|
-
const
|
|
19237
|
-
if (
|
|
19389
|
+
const actions32 = [...groups.entries()].map(([hint, names]) => `${names.join(", ")}${hint}`);
|
|
19390
|
+
if (actions32.length > 0) rows.push([resource, actions32.join(", ")]);
|
|
19238
19391
|
}
|
|
19239
19392
|
const at = 4 + Math.min(22, Math.max(0, ...rows.map(([left]) => left.length)));
|
|
19240
19393
|
lines.push(
|
|
@@ -19247,7 +19400,7 @@ async function renderTopHelp(opts) {
|
|
|
19247
19400
|
const [area = "", action = ""] = name.split(" ");
|
|
19248
19401
|
byArea.set(area, [...byArea.get(area) ?? [], action]);
|
|
19249
19402
|
}
|
|
19250
|
-
const named = [...byArea.entries()].map(([area,
|
|
19403
|
+
const named = [...byArea.entries()].map(([area, actions32]) => `${area} ${actions32.join("|")}`);
|
|
19251
19404
|
lines.push(wrap(`Beta, hidden here but they run (the server decides): ${named.join(", ")}.`, " "));
|
|
19252
19405
|
}
|
|
19253
19406
|
const generated = await listGenerated({ features: opts.allCommands ? [] : getFeatures, env: opts.env });
|
|
@@ -19255,13 +19408,13 @@ async function renderTopHelp(opts) {
|
|
|
19255
19408
|
if (visible.length > 0) {
|
|
19256
19409
|
const byResource = /* @__PURE__ */ new Map();
|
|
19257
19410
|
for (const g of visible) {
|
|
19258
|
-
const
|
|
19259
|
-
|
|
19260
|
-
byResource.set(g.resource,
|
|
19411
|
+
const actions32 = byResource.get(g.resource) ?? [];
|
|
19412
|
+
actions32.push(`${g.action}${g.beta ? " (beta)" : ""}`);
|
|
19413
|
+
byResource.set(g.resource, actions32);
|
|
19261
19414
|
}
|
|
19262
19415
|
const sorted2 = [...byResource.entries()].sort(([a], [b]) => a.localeCompare(b));
|
|
19263
19416
|
if (opts.allCommands) {
|
|
19264
|
-
const generatedRows = sorted2.map(([resource,
|
|
19417
|
+
const generatedRows = sorted2.map(([resource, actions32]) => [resource, actions32.sort().join(", ")]);
|
|
19265
19418
|
lines.push("", "API resources (kenso <resource> <action>):", columns(generatedRows));
|
|
19266
19419
|
} else {
|
|
19267
19420
|
const names = new Set(sorted2.map(([resource]) => resource));
|
|
@@ -19620,7 +19773,7 @@ function resources() {
|
|
|
19620
19773
|
const names = Object.entries(handWritten).filter(([, area]) => Object.keys(area).length > 0).map(([resource]) => resource);
|
|
19621
19774
|
return sorted([...names, ...Object.keys(resourceAliases), ...loadManifest().operations.map((op) => op.resource)]);
|
|
19622
19775
|
}
|
|
19623
|
-
function
|
|
19776
|
+
function actions31(resource) {
|
|
19624
19777
|
const own = Object.keys(handWritten[resource] ?? {}).filter((action) => action !== "");
|
|
19625
19778
|
return sorted([...own, ...loadManifest().operations.filter((op) => op.resource === resource).map((op) => op.action)]);
|
|
19626
19779
|
}
|
|
@@ -19685,7 +19838,7 @@ async function completions(words, globals) {
|
|
|
19685
19838
|
return flagsOf2(spec, globals, positionals.length === 0);
|
|
19686
19839
|
}
|
|
19687
19840
|
if (positionals.length === 0) return resources();
|
|
19688
|
-
if (!spec) return positionals.length === 1 ?
|
|
19841
|
+
if (!spec) return positionals.length === 1 ? actions31(resourceAliases[positionals[0]] ?? positionals[0]) : [];
|
|
19689
19842
|
const given = positionals.length - commandWords;
|
|
19690
19843
|
const declared = spec.positionals ?? [];
|
|
19691
19844
|
if (given < declared.length || declared.at(-1)?.variadic === true) {
|
|
@@ -19779,9 +19932,9 @@ function normalizeBooleans(argv, names, strict) {
|
|
|
19779
19932
|
async function knownCommands() {
|
|
19780
19933
|
const commands = /* @__PURE__ */ new Set();
|
|
19781
19934
|
for (const [resource, area] of Object.entries(handWritten)) {
|
|
19782
|
-
const
|
|
19783
|
-
if (
|
|
19784
|
-
for (const action of
|
|
19935
|
+
const actions32 = Object.keys(area);
|
|
19936
|
+
if (actions32.length > 0) commands.add(resource);
|
|
19937
|
+
for (const action of actions32) commands.add(action ? `${resource} ${action}` : resource);
|
|
19785
19938
|
}
|
|
19786
19939
|
for (const g of await listGenerated({ features: [] })) {
|
|
19787
19940
|
commands.add(g.resource);
|