kenso 0.1.81 → 0.1.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/kenso.js +326 -177
- package/dist/operations.json +1 -1
- package/docs/crm.md +11 -0
- package/docs/reference.md +30 -4
- 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.82" : "0.0.0-dev";
|
|
2481
2481
|
}
|
|
2482
2482
|
});
|
|
2483
2483
|
|
|
@@ -4174,9 +4174,9 @@ async function readRunDir(dir) {
|
|
|
4174
4174
|
return null;
|
|
4175
4175
|
}
|
|
4176
4176
|
if (!raw) return null;
|
|
4177
|
-
const { runId, command:
|
|
4177
|
+
const { runId, command: command53, createdAt, status } = raw;
|
|
4178
4178
|
if (typeof runId !== "string" || !RUN_ID_PATTERN.test(runId)) return null;
|
|
4179
|
-
if (typeof
|
|
4179
|
+
if (typeof command53 !== "string" || typeof createdAt !== "string") return null;
|
|
4180
4180
|
if (typeof status !== "string" || !STATUSES.includes(status)) return null;
|
|
4181
4181
|
let chunksDone = chunkList(raw.chunksDone) ?? [];
|
|
4182
4182
|
try {
|
|
@@ -4187,7 +4187,7 @@ async function readRunDir(dir) {
|
|
|
4187
4187
|
const record = {
|
|
4188
4188
|
...raw,
|
|
4189
4189
|
runId,
|
|
4190
|
-
command:
|
|
4190
|
+
command: command53,
|
|
4191
4191
|
args: asRecord3(raw.args) ?? {},
|
|
4192
4192
|
createdAt,
|
|
4193
4193
|
status,
|
|
@@ -4242,11 +4242,11 @@ async function loadRun(runId, env = process.env) {
|
|
|
4242
4242
|
}
|
|
4243
4243
|
return run;
|
|
4244
4244
|
}
|
|
4245
|
-
async function findIdentical(
|
|
4245
|
+
async function findIdentical(command53, args, inputSha256, env, workspaceId, anyWorkspace = false) {
|
|
4246
4246
|
const identity = argsIdentity(args);
|
|
4247
4247
|
const runs = await listRuns(env);
|
|
4248
4248
|
return runs.filter(
|
|
4249
|
-
(run) => run.command ===
|
|
4249
|
+
(run) => run.command === command53 && (run.inputSha256 || void 0) === (inputSha256 || void 0) && (anyWorkspace || (run.workspaceId || void 0) === (workspaceId || void 0)) && argsIdentity(run.args) === identity
|
|
4250
4250
|
);
|
|
4251
4251
|
}
|
|
4252
4252
|
function isOtherLiveProcess(pid) {
|
|
@@ -7451,8 +7451,8 @@ function idValue(value, field) {
|
|
|
7451
7451
|
function shellQuote3(arg) {
|
|
7452
7452
|
return /^[A-Za-z0-9_./:=@%+,-]+$/.test(arg) ? arg : `'${arg.replace(/'/g, `'\\''`)}'`;
|
|
7453
7453
|
}
|
|
7454
|
-
function commandLine2(ctx,
|
|
7455
|
-
const parts2 = ["kenso", ...
|
|
7454
|
+
function commandLine2(ctx, command53, args, extra = []) {
|
|
7455
|
+
const parts2 = ["kenso", ...command53.split(" "), ...(args.positionals ?? []).map(shellQuote3)];
|
|
7456
7456
|
for (const [name, value] of Object.entries(args.flags)) {
|
|
7457
7457
|
if (value === void 0 || value === false) continue;
|
|
7458
7458
|
if (value === true) parts2.push(`--${name}`);
|
|
@@ -7784,7 +7784,7 @@ var init_connect = __esm({
|
|
|
7784
7784
|
var crm_default;
|
|
7785
7785
|
var init_crm = __esm({
|
|
7786
7786
|
"docs/crm.md"() {
|
|
7787
|
-
crm_default = '# CRM (beta)\n\nThe CRM commands work on Kenso\'s Accounts lane: accounts (companies), the people on them, and opportunities. They are beta: they need the `accounts` feature flag on your workspace (opportunities need `opportunities`, CRM sync needs `ingestion`). Help and `kenso describe` hide them until your workspace has the flag; `--all-commands` shows them.\n\n| Command | What it does |\n|---|---|\n| `accounts import` | Create accounts from a CSV or JSONL file. Research is charged per created account |\n| `people import` | Create or match people from a file, optionally onto accounts |\n| `accounts update --each`, `people update --each`, `opportunities update --each` | Edit many records from a file, one call per row |\n| `accounts write-research`, `people write-research` | Store research you gathered as a record\'s latest research, free. `--each` writes many |\n| `opportunities stage-history <id>` | A deal\'s stage history: each stage, when, who moved it and how long it sat there |\n| `deleted-accounts list`, `accounts restore <id>` | The accounts deleted in the last 30 days, and bringing one back |\n| `capture status` | Your captured mailbox, its backfill progress and what teammates see of a captured email. Needs the `crm_capture` flag |\n| `capture connect` | Turn capture on for your own mailbox. `--private` starts it hidden from teammates; `--provider google` prints a sign-in link when no account is connected yet |\n| `capture private on\\|off` | Hide your captured email from teammates, or show it again. Email only: meetings stay visible |\n| `capture disconnect` | Turn capture off and delete your stored email bodies. Asks first; `--yes` skips the question |\n| `capture teammates-see summary\\|full_email` | Workspace admin: what teammates see of captured email |\n| `pipelines stage-rules` | List or set the fields a deal should have in each stage |\n| `crm-connections`, `crm-imports`, `crm-sync-issues` | Read and run CRM sync. Connecting a CRM stays in the app |\n\nImport accounts first, then people: `people import` never creates an account.\n\n## Import accounts\n\n```bash\nkenso accounts import --file accounts.csv\nkenso accounts import --file accounts.csv --yes\n```\n\n```csv\nname,domain,industry,employeeCount\nAcme,acme.io,Software,120\nGlobex,globex.com,Manufacturing,"1,200"\n```\n\n- **Columns** map by name, ignoring case, spaces and dashes: `name` (or `company`, `companyName`, `accountName`), `domains` (several, split on `,` or `;`) or one `domain` (or `website`, `companyDomain`), `industry`, `employeeCount`, `hqLocation`, `linkedinUrl`, `stage`, `angle`, `whyNow`, `fitScore`, `fundingRound`, `cadenceDays`, `ownerMemberId`, `kenCompanyId`, `sendsFromInboxId`, `sendsFromLinkedInAccountId` and `source`.\n- **A domain is required.** A file with no domain column is a usage error, and a row without a domain is `invalid` (`domain_required`).\n- **The dry run prices the research.** It asks for a credit estimate per 1,000 accounts and puts the sum in the plan: `kind`, `accountCount`, `totalMillicredits`, `availableMillicredits` and `sufficient`.\n- **Rows go 100 per call** to `POST /v1/accounts/bulk-create`.\n\nEach row comes back `created` (`id` is the new account; its research is queued, `researchQueued`, or waits for credits, `researchWaitingCredits`), `skipped` with reason `domain_taken` (already an account; `id` is that account) or `failed` (`reason` is the API\'s code, `error` names the field; an item Kenso failed to save is sent once more first). Rerunning the same file is safe: accounts that exist come back `domain_taken`.\n\n## Import people\n\n```bash\nkenso people import --file people.csv\nkenso people import --file people.csv --find-emails --yes\nkenso people import --file people.jsonl --dry-run\n```\n\n```csv\nfullName,email,title,accountDomain,role\nAnn Lee,ann@acme.io,VP Sales,acme.io,champion\nBob Ray,,CTO,acme.io,\n```\n\n- **Columns** map by name, ignoring case, spaces and dashes: `email`, `fullName` (or `name`), `firstName`, `lastName`, `title`, `linkedinUrl` (or `linkedin`, `profileUrl`), `accountDomain` (or `domain`, `website`, `companyDomain`), `accountId`, `role` and `priority`. Other columns are ignored with one warning.\n- **A person needs a name:** `fullName`, or `firstName`, `lastName` or both (the CLI joins them). A row with none of them is `invalid` (`name_required`).\n- **To put a person on an account,** give `accountDomain` or `accountId`. A row with both sends only `accountId`.\n- **`--find-emails`** queues an email find (charged in credits) for each person without an email.\n- **Rows go 200 per call** to `POST /v1/people/batch`.\n\nPeople already in the workspace are matched by email, then LinkedIn URL, so running the same file again creates nobody twice. A row comes back `created` (a new person), `updated` (an existing person added to the account), `skipped` with reason `already_on_account`, `matched` (no account asked) or `previously_removed`, or `failed`: `account_not_found` saves the person without an account (import the account, then rerun to place them), any other reason is the API\'s. The summary adds `matched`, `addedToAccounts` and `emailFindsQueued`.\n\n## List and search accounts\n\n`accounts list` and `accounts search` sort and page on the server, so they reach every account in the workspace, however many there are.\n\n```bash\nkenso accounts list --sort score:desc --limit 100 # one page; the output\'s next: line is the following one\nkenso accounts list --sort score:desc --limit 100 --all # every page, to the end\nkenso accounts search --search hiring --sort latestSignalAt:desc --data \'{"qFields": ["name", "latestSignal"]}\'\nkenso accounts search --limit 1 --data \'{"countBy": ["stage"]}\' # how many accounts sit in each stage\nkenso accounts search --data \'{"where": {"match": "all", "conditions": [{"field": "tier", "operator": "is", "values": ["1"]}]}, "sort": "tier,-pipelineAmount"}\' --all\nkenso accounts search --data \'{"where": {"match": "all", "conditions": [{"field": "hqLocation", "operator": "contains", "values": ["Germany"]}]}}\' --all\n# tier 1 accounts with no meeting in 30 days: none since then, or none ever\nkenso accounts search --data \'{"where": {"match": "all", "conditions": [{"field": "tier", "operator": "is", "values": ["1"]}, {"match": "any", "conditions": [{"field": "lastMeeting", "operator": "older_than_days", "values": ["30"]}, {"field": "lastMeeting", "operator": "is_empty"}]}]}}\' --all\n```\n\n- **`--sort`** takes up to 3 comma-separated keys, each `field` (ascending), `field:asc` or `field:desc`. The API\'s `-field` form needs the equals sign here, `--sort=-score`, because a value that starts with a dash reads as a flag. Fields: `createdAt`, `name`, `score`, `tier` (ascending is tier 1 first), `latestSignalAt`, `committee`, `pipelineAmount`, `nextTouchAt`, `lastTouchAt`. An account with no value for a key comes last in both directions. The default is `-createdAt`.\n- **`--limit`** is 1 to 1000 (default 50). `--cursor` takes the previous page\'s `nextCursor` with the same filters and sort; `--all` follows the cursors for you.\n- **`--search`** (also `--q`) matches the name or a domain.\n- **Lists and objects go in `--data`** on `search`, as the API takes them (`kenso describe accounts search`); a flag beside it sets or replaces one key:\n - `qFields` picks where the search text looks: `name`, `domain`, `latestSignal` (the latest signal\'s title).\n - `countBy` (`stage`, `stageGroup`) adds `counts` to the output: every value with the number of matching accounts that hold it, whatever the page. The output is then one object: `data`, `pagination` and `counts`.\n - `filters` and `where` narrow the accounts.\n\nAn account\'s timeline pages the same way. `kenso accounts activity 812` returns the newest 100 earlier rows and, when older ones exist, `data.nextCursor`. Pass it back as `--cursor` (with the same `--category`) for the rows before them, until a page comes without one.\n\n## Edit accounts, people and opportunities\n\nApart from `accounts bulk-update`, which sets one `accountType` on up to 500 accounts, there is no bulk edit route, so run the generated `update` command once per row with `--each`. Columns are the command\'s flags by API name or flag name, and the id column fills the route:\n\n```bash\nkenso accounts update --each accounts-edit.csv --dry-run # then the same with --yes\nkenso people update --each people-edit.csv --dry-run\nkenso opportunities update --each deals.csv --dry-run\n```\n\n```csv\naccountId,stage,ownerMemberId,overwritePinned\n501,engaged,42,true\n502,customer,42,true\n```\n\nA row that changes a field someone pinned in the app fails as a whole (`409 conflict`, `pinned_by_user`: nothing on that record changes, the other fields of the row included), unless the row sets `overwritePinned` to `true` (or you pass `--overwrite-pinned`, only with the person\'s OK). Every flag of an update command: `kenso accounts update --help`.\n\n## Search opportunities\n\n`kenso opportunities search` works as `accounts search` does: it takes `--search`, `--sort`, `--limit`, `--cursor`, `--all`, and its lists in `--data`.\n\n```bash\nkenso opportunities search --data \'{"filters": [{"field": "stageCategory", "operator": "is", "values": ["open"]}]}\' --all\nkenso opportunities search --data \'{"filters": [{"field": "ownerMemberId", "operator": "is", "values": ["none"]}, {"field": "closeDate", "operator": "is", "values": ["past_due", "next_30_days"]}]}\'\nkenso opportunities search --limit 1 --data \'{"countBy": ["stage", "ownerMemberId"]}\' # how many opportunities hold each value\n```\n\n- **`filters`** is a list of `{field, operator, values}`, all of which must hold. Fields: `stage` (a stage key), `stageCategory` (`open`, `won`, `lost`), `ownerMemberId`, `closeDate` (`past_due`, `next_30_days`, `later`, `none`) and `sourceCampaignId`. `operator` is `is` or `is_not`; the values of one condition are OR. `none` in `values` matches an opportunity with no owner, no source campaign or no close date.\n- **`countBy`** takes the same field names and adds `counts` to the output: per field, every value with the number of matching opportunities that hold it.\n- `--account-id` keeps the search to one account. `closeDate` counts days in the member\'s app time zone.\n\nOne person\'s deals, meetings and campaign contacts, as their person page lists them:\n\n```bash\nkenso opportunities list --person-id 9001 # the deals they are on, or are the primary person of\nkenso meetings list --person-id 9001 # the meetings they attend, among the ones you can see\nkenso contacts list --person-id 9001 # their contact in each campaign they are in\n```\n\n## Write research you gathered\n\n`accounts write-research` and `people write-research` store research you gathered outside Kenso as the record\'s latest research (`PUT /v1/accounts/{accountId}/research`, `PUT /v1/people/{personId}/research`). The Research tab shows it like a Ken run, with `trigger: agent` and `researchedAt` now. Nothing is charged, and no account or person field changes: set an account\'s own `fitScore`, `whyNow` or `angle` with `accounts update`. They need the `accounts_research` flag and accounts edit.\n\nThe body is the research block `accounts get --expand research` (or `people get-research`) returns, without its read-only fields: leave out `id`, `status`, `trigger`, `errorCode`, `researchedAt`, `isStale` and `appliedPrompt` (for a person also `mode`, `requestedAt`, `researchedMode`, `firecrawlCredits` and `webNote`), or the write fails with `unknown_field`. Pass it with `--data @file`:\n\n```bash\nkenso accounts write-research --account-id 501 --data @acme-dossier.json\nkenso people write-research --person-id 9001 --data @jane.json\n```\n\n```json\n{\n "tagline": { "text": "Payroll for EU contractors", "sourceUrls": ["https://acme.example"] },\n "description": { "text": "Acme runs payroll and compliance for companies hiring contractors in 30 EU countries.", "sourceUrls": ["https://acme.example"] },\n "links": { "website": "https://acme.example" },\n "whyNow": { "text": "Raised a $40M Series B in October", "sourceUrls": ["https://news.example/acme-b"], "date": "2026-10" },\n "fitScore": 82,\n "angle": "Lead with contractor onboarding time."\n}\n```\n\nMany records: one JSONL line per record, with the id next to the block\'s fields. Nested objects are sent as written. Use JSONL, not CSV: the block\'s fields are objects and lists, which a CSV cell cannot carry.\n\n```bash\nkenso accounts write-research --each dossiers.jsonl --dry-run # then the same with --yes\nkenso people write-research --each people-research.jsonl --yes --concurrency 8\n```\n\n```jsonl\n{"accountId": 501, "tagline": {"text": "Payroll for EU contractors"}, "links": {"website": "https://acme.example"}}\n{"accountId": 502, "description": {"text": "Cloud cost tooling for retailers."}, "links": {"website": "https://beta.example"}}\n```\n\nA row fails as a whole with the API\'s code: `validation_failed` (an unknown field is `unknown_field`, and `error.details` names every bad field), `research_in_progress` (`409`: Ken is researching that record now, write it again once the run ends; an account run waiting for credits counts too: it runs once the workspace has credits, and the write stays refused until that run ends) or `not_found`. Rerunning a file is safe: each write replaces the record\'s research shown.\n\n## CRM sync\n\nCRM sync has generated commands only: read connections, preview, start an import, and work through sync issues. Connect the CRM itself in the app.\n\n```bash\nkenso crm-connections list\nkenso crm-connections get --connection-id 7\nkenso crm-imports create --connection-id 7 --dry-run\nkenso crm-sync-issues list --connection-id 7 --all\n```\n\nRun `kenso crm-connections --help` (or add `--all-commands` when the actions are hidden) to see every action.\n\n## Restore a deleted account\n\n```bash\nkenso deleted-accounts list\nkenso accounts restore 812\n```\n\nA deleted account can be restored for 30 days. `deleted-accounts list` shows each one with who deleted it, `expiresAt` (restore works until then) and what comes back: `personCount`, `opportunityCount` and `touchCount`. `accounts restore <id>` brings the account back with its domains, its people, its deals and its planned touches, which wait for approval again. A domain another account took since stays with that account and is listed in `domainsTaken`. A merged account is not listed and cannot be restored: a merge has no undo. Both commands are behind the `crm_import_export` feature flag (`404` while it is off).\n\n## A deal\'s stage history\n\n```bash\nkenso opportunities stage-history 77\nkenso opportunities stage-history 77 --query "entries[].{to: stageLabel, at: enteredAt, by: changedBy}"\n```\n\nIt prints `GET /v1/opportunities/{id}/stage-history` as it is, the same rows as the deal page and the MCP\'s `opportunities(operation="get-stage-history")`: the stage now, `isComplete` and `entries`, oldest first, each with `fromStage`, `stage`, `stageLabel`, `enteredAt`, `leftAt`, `durationSeconds`, `actorKind`, `actorMemberId` and Ken\'s `reason` on a move its stage judge made. With the `deal_stage_rules` flag on, each entry also has `changedBy` (`member`, `agent`, `api_key`, `workflow`, `stage_judge`, `crm_sync` or `ken_automation`), `crmProvider` on a CRM sync, and on a move `fromStageLabel` and `fromStageDurationSeconds`, how long the deal sat in the stage it left. `isComplete` false means Kenso has no record of part of the history.\n\n## Required fields per stage\n\n```bash\nkenso pipelines stage-rules\nkenso pipelines stage-rules proposal --require amount,closeDate,custom.tier\nkenso pipelines stage-rules proposal --none\nkenso pipelines stage-rules lost --default\n```\n\nWith the `deal_stage_rules` flag on, each stage can name the fields a deal should have in it. Without a stage the command prints every stage\'s `key`, `label`, `category`, `isArchived`, `requiredFields` and `isDefault`, plus `requirableFields`: `amount`, `closeDate`, `ownerMemberId`, `primaryPersonId`, `nextStep`, `lostReasonKey`, `wonReasonKey` and `custom.<key>` for each custom deal field. `--require` sets the stage\'s whole list, in order, at most 10. `--none` requires nothing, and `--default` goes back to the default: a lost stage asks for `lostReasonKey`, any other stage nothing. Setting a rule needs the `workspace_settings` permission. The same as the MCP\'s `opportunities(operation="stages-set-required-fields")`.\n\nA missing field never stops a move. The deal moves, and it is flagged Missing on the board, the list and the deal page until the field is filled. A rule also applies to deals already in the stage.\n';
|
|
7787
|
+
crm_default = '# CRM (beta)\n\nThe CRM commands work on Kenso\'s Accounts lane: accounts (companies), the people on them, and opportunities. They are beta: they need the `accounts` feature flag on your workspace (opportunities need `opportunities`, CRM sync needs `ingestion`). Help and `kenso describe` hide them until your workspace has the flag; `--all-commands` shows them.\n\n| Command | What it does |\n|---|---|\n| `accounts import` | Create accounts from a CSV or JSONL file. Research is charged per created account |\n| `people import` | Create or match people from a file, optionally onto accounts |\n| `accounts update --each`, `people update --each`, `opportunities update --each` | Edit many records from a file, one call per row |\n| `accounts write-research`, `people write-research` | Store research you gathered as a record\'s latest research, free. `--each` writes many |\n| `opportunities stage-history <id>` | A deal\'s stage history: each stage, when, who moved it and how long it sat there |\n| `deleted-accounts list`, `accounts restore <id>` | The accounts deleted in the last 30 days, and bringing one back |\n| `export <accounts\\|people\\|deals>` | The list as CSV: everything, a saved Accounts view, or what the filters match |\n| `capture status` | Your captured mailbox, its backfill progress and what teammates see of a captured email. Needs the `crm_capture` flag |\n| `capture connect` | Turn capture on for your own mailbox. `--private` starts it hidden from teammates; `--provider google` prints a sign-in link when no account is connected yet |\n| `capture private on\\|off` | Hide your captured email from teammates, or show it again. Email only: meetings stay visible |\n| `capture disconnect` | Turn capture off and delete your stored email bodies. Asks first; `--yes` skips the question |\n| `capture teammates-see summary\\|full_email` | Workspace admin: what teammates see of captured email |\n| `pipelines stage-rules` | List or set the fields a deal should have in each stage |\n| `crm-connections`, `crm-imports`, `crm-sync-issues` | Read and run CRM sync. Connecting a CRM stays in the app |\n\nImport accounts first, then people: `people import` never creates an account.\n\n## Import accounts\n\n```bash\nkenso accounts import --file accounts.csv\nkenso accounts import --file accounts.csv --yes\n```\n\n```csv\nname,domain,industry,employeeCount\nAcme,acme.io,Software,120\nGlobex,globex.com,Manufacturing,"1,200"\n```\n\n- **Columns** map by name, ignoring case, spaces and dashes: `name` (or `company`, `companyName`, `accountName`), `domains` (several, split on `,` or `;`) or one `domain` (or `website`, `companyDomain`), `industry`, `employeeCount`, `hqLocation`, `linkedinUrl`, `stage`, `angle`, `whyNow`, `fitScore`, `fundingRound`, `cadenceDays`, `ownerMemberId`, `kenCompanyId`, `sendsFromInboxId`, `sendsFromLinkedInAccountId` and `source`.\n- **A domain is required.** A file with no domain column is a usage error, and a row without a domain is `invalid` (`domain_required`).\n- **The dry run prices the research.** It asks for a credit estimate per 1,000 accounts and puts the sum in the plan: `kind`, `accountCount`, `totalMillicredits`, `availableMillicredits` and `sufficient`.\n- **Rows go 100 per call** to `POST /v1/accounts/bulk-create`.\n\nEach row comes back `created` (`id` is the new account; its research is queued, `researchQueued`, or waits for credits, `researchWaitingCredits`), `skipped` with reason `domain_taken` (already an account; `id` is that account) or `failed` (`reason` is the API\'s code, `error` names the field; an item Kenso failed to save is sent once more first). Rerunning the same file is safe: accounts that exist come back `domain_taken`.\n\n## Import people\n\n```bash\nkenso people import --file people.csv\nkenso people import --file people.csv --find-emails --yes\nkenso people import --file people.jsonl --dry-run\n```\n\n```csv\nfullName,email,title,accountDomain,role\nAnn Lee,ann@acme.io,VP Sales,acme.io,champion\nBob Ray,,CTO,acme.io,\n```\n\n- **Columns** map by name, ignoring case, spaces and dashes: `email`, `fullName` (or `name`), `firstName`, `lastName`, `title`, `linkedinUrl` (or `linkedin`, `profileUrl`), `accountDomain` (or `domain`, `website`, `companyDomain`), `accountId`, `role` and `priority`. Other columns are ignored with one warning.\n- **A person needs a name:** `fullName`, or `firstName`, `lastName` or both (the CLI joins them). A row with none of them is `invalid` (`name_required`).\n- **To put a person on an account,** give `accountDomain` or `accountId`. A row with both sends only `accountId`.\n- **`--find-emails`** queues an email find (charged in credits) for each person without an email.\n- **Rows go 200 per call** to `POST /v1/people/batch`.\n\nPeople already in the workspace are matched by email, then LinkedIn URL, so running the same file again creates nobody twice. A row comes back `created` (a new person), `updated` (an existing person added to the account), `skipped` with reason `already_on_account`, `matched` (no account asked) or `previously_removed`, or `failed`: `account_not_found` saves the person without an account (import the account, then rerun to place them), any other reason is the API\'s. The summary adds `matched`, `addedToAccounts` and `emailFindsQueued`.\n\n## List and search accounts\n\n`accounts list` and `accounts search` sort and page on the server, so they reach every account in the workspace, however many there are.\n\n```bash\nkenso accounts list --sort score:desc --limit 100 # one page; the output\'s next: line is the following one\nkenso accounts list --sort score:desc --limit 100 --all # every page, to the end\nkenso accounts search --search hiring --sort latestSignalAt:desc --data \'{"qFields": ["name", "latestSignal"]}\'\nkenso accounts search --limit 1 --data \'{"countBy": ["stage"]}\' # how many accounts sit in each stage\nkenso accounts search --data \'{"where": {"match": "all", "conditions": [{"field": "tier", "operator": "is", "values": ["1"]}]}, "sort": "tier,-pipelineAmount"}\' --all\nkenso accounts search --data \'{"where": {"match": "all", "conditions": [{"field": "hqLocation", "operator": "contains", "values": ["Germany"]}]}}\' --all\n# tier 1 accounts with no meeting in 30 days: none since then, or none ever\nkenso accounts search --data \'{"where": {"match": "all", "conditions": [{"field": "tier", "operator": "is", "values": ["1"]}, {"match": "any", "conditions": [{"field": "lastMeeting", "operator": "older_than_days", "values": ["30"]}, {"field": "lastMeeting", "operator": "is_empty"}]}]}}\' --all\n```\n\n- **`--sort`** takes up to 3 comma-separated keys, each `field` (ascending), `field:asc` or `field:desc`. The API\'s `-field` form needs the equals sign here, `--sort=-score`, because a value that starts with a dash reads as a flag. Fields: `createdAt`, `name`, `score`, `tier` (ascending is tier 1 first), `latestSignalAt`, `committee`, `pipelineAmount`, `nextTouchAt`, `lastTouchAt`. An account with no value for a key comes last in both directions. The default is `-createdAt`.\n- **`--limit`** is 1 to 1000 (default 50). `--cursor` takes the previous page\'s `nextCursor` with the same filters and sort; `--all` follows the cursors for you.\n- **`--search`** (also `--q`) matches the name or a domain.\n- **Lists and objects go in `--data`** on `search`, as the API takes them (`kenso describe accounts search`); a flag beside it sets or replaces one key:\n - `qFields` picks where the search text looks: `name`, `domain`, `latestSignal` (the latest signal\'s title).\n - `countBy` (`stage`, `stageGroup`) adds `counts` to the output: every value with the number of matching accounts that hold it, whatever the page. The output is then one object: `data`, `pagination` and `counts`.\n - `filters` and `where` narrow the accounts.\n\nAn account\'s timeline pages the same way. `kenso accounts activity 812` returns the newest 100 earlier rows and, when older ones exist, `data.nextCursor`. Pass it back as `--cursor` (with the same `--category`) for the rows before them, until a page comes without one.\n\n## Edit accounts, people and opportunities\n\nApart from `accounts bulk-update`, which sets one `accountType` on up to 500 accounts, there is no bulk edit route, so run the generated `update` command once per row with `--each`. Columns are the command\'s flags by API name or flag name, and the id column fills the route:\n\n```bash\nkenso accounts update --each accounts-edit.csv --dry-run # then the same with --yes\nkenso people update --each people-edit.csv --dry-run\nkenso opportunities update --each deals.csv --dry-run\n```\n\n```csv\naccountId,stage,ownerMemberId,overwritePinned\n501,engaged,42,true\n502,customer,42,true\n```\n\nA row that changes a field someone pinned in the app fails as a whole (`409 conflict`, `pinned_by_user`: nothing on that record changes, the other fields of the row included), unless the row sets `overwritePinned` to `true` (or you pass `--overwrite-pinned`, only with the person\'s OK). Every flag of an update command: `kenso accounts update --help`.\n\n## Search opportunities\n\n`kenso opportunities search` works as `accounts search` does: it takes `--search`, `--sort`, `--limit`, `--cursor`, `--all`, and its lists in `--data`.\n\n```bash\nkenso opportunities search --data \'{"filters": [{"field": "stageCategory", "operator": "is", "values": ["open"]}]}\' --all\nkenso opportunities search --data \'{"filters": [{"field": "ownerMemberId", "operator": "is", "values": ["none"]}, {"field": "closeDate", "operator": "is", "values": ["past_due", "next_30_days"]}]}\'\nkenso opportunities search --limit 1 --data \'{"countBy": ["stage", "ownerMemberId"]}\' # how many opportunities hold each value\n```\n\n- **`filters`** is a list of `{field, operator, values}`, all of which must hold. Fields: `stage` (a stage key), `stageCategory` (`open`, `won`, `lost`), `ownerMemberId`, `closeDate` (`past_due`, `next_30_days`, `later`, `none`) and `sourceCampaignId`. `operator` is `is` or `is_not`; the values of one condition are OR. `none` in `values` matches an opportunity with no owner, no source campaign or no close date.\n- **`countBy`** takes the same field names and adds `counts` to the output: per field, every value with the number of matching opportunities that hold it.\n- `--account-id` keeps the search to one account. `closeDate` counts days in the member\'s app time zone.\n\nOne person\'s deals, meetings and campaign contacts, as their person page lists them:\n\n```bash\nkenso opportunities list --person-id 9001 # the deals they are on, or are the primary person of\nkenso meetings list --person-id 9001 # the meetings they attend, among the ones you can see\nkenso contacts list --person-id 9001 # their contact in each campaign they are in\n```\n\n## Write research you gathered\n\n`accounts write-research` and `people write-research` store research you gathered outside Kenso as the record\'s latest research (`PUT /v1/accounts/{accountId}/research`, `PUT /v1/people/{personId}/research`). The Research tab shows it like a Ken run, with `trigger: agent` and `researchedAt` now. Nothing is charged, and no account or person field changes: set an account\'s own `fitScore`, `whyNow` or `angle` with `accounts update`. They need the `accounts_research` flag and accounts edit.\n\nThe body is the research block `accounts get --expand research` (or `people get-research`) returns, without its read-only fields: leave out `id`, `status`, `trigger`, `errorCode`, `researchedAt`, `isStale` and `appliedPrompt` (for a person also `mode`, `requestedAt`, `researchedMode`, `firecrawlCredits` and `webNote`), or the write fails with `unknown_field`. Pass it with `--data @file`:\n\n```bash\nkenso accounts write-research --account-id 501 --data @acme-dossier.json\nkenso people write-research --person-id 9001 --data @jane.json\n```\n\n```json\n{\n "tagline": { "text": "Payroll for EU contractors", "sourceUrls": ["https://acme.example"] },\n "description": { "text": "Acme runs payroll and compliance for companies hiring contractors in 30 EU countries.", "sourceUrls": ["https://acme.example"] },\n "links": { "website": "https://acme.example" },\n "whyNow": { "text": "Raised a $40M Series B in October", "sourceUrls": ["https://news.example/acme-b"], "date": "2026-10" },\n "fitScore": 82,\n "angle": "Lead with contractor onboarding time."\n}\n```\n\nMany records: one JSONL line per record, with the id next to the block\'s fields. Nested objects are sent as written. Use JSONL, not CSV: the block\'s fields are objects and lists, which a CSV cell cannot carry.\n\n```bash\nkenso accounts write-research --each dossiers.jsonl --dry-run # then the same with --yes\nkenso people write-research --each people-research.jsonl --yes --concurrency 8\n```\n\n```jsonl\n{"accountId": 501, "tagline": {"text": "Payroll for EU contractors"}, "links": {"website": "https://acme.example"}}\n{"accountId": 502, "description": {"text": "Cloud cost tooling for retailers."}, "links": {"website": "https://beta.example"}}\n```\n\nA row fails as a whole with the API\'s code: `validation_failed` (an unknown field is `unknown_field`, and `error.details` names every bad field), `research_in_progress` (`409`: Ken is researching that record now, write it again once the run ends; an account run waiting for credits counts too: it runs once the workspace has credits, and the write stays refused until that run ends) or `not_found`. Rerunning a file is safe: each write replaces the record\'s research shown.\n\n## CRM sync\n\nCRM sync has generated commands only: read connections, preview, start an import, and work through sync issues. Connect the CRM itself in the app.\n\n```bash\nkenso crm-connections list\nkenso crm-connections get --connection-id 7\nkenso crm-imports create --connection-id 7 --dry-run\nkenso crm-sync-issues list --connection-id 7 --all\n```\n\nRun `kenso crm-connections --help` (or add `--all-commands` when the actions are hidden) to see every action.\n\n## Restore a deleted account\n\n```bash\nkenso deleted-accounts list\nkenso accounts restore 812\n```\n\nA deleted account can be restored for 30 days. `deleted-accounts list` shows each one with who deleted it, `expiresAt` (restore works until then) and what comes back: `personCount`, `opportunityCount` and `touchCount`. `accounts restore <id>` brings the account back with its domains, its people, its deals and its planned touches, which wait for approval again. A domain another account took since stays with that account and is listed in `domainsTaken`. A merged account is not listed and cannot be restored: a merge has no undo. Both commands are behind the `crm_import_export` feature flag (`404` while it is off).\n\n## Export accounts, people or deals\n\n```bash\nkenso export accounts --out accounts.csv\nkenso export accounts --view 12 --out tier-1.csv\nkenso export deals --filters \'[{"field":"stageCategory","operator":"is","values":["open"]}]\' > open-deals.csv\n```\n\nIt writes the CSV that `POST /v1/accounts/export`, `/v1/people/export` or `/v1/opportunities/export` returns, to stdout or to `--out` (then it prints the file and its row count). With no filter it exports every record. More than 50,000 rows is refused: narrow the filters. `--view <id>` exports a saved Accounts view (`kenso account-views list` shows the ids). `--filters`, `--where` (accounts), `--q` and `--sort` are the search operation\'s own fields, so a deals or people view exports with its filters and sort. The accounts and deals files start with `id` and import back as they are. Each export writes an audit-log entry and needs the export permission. Accounts and deals also need the `crm_import_export` flag while it is in beta.\n\n## A deal\'s stage history\n\n```bash\nkenso opportunities stage-history 77\nkenso opportunities stage-history 77 --query "entries[].{to: stageLabel, at: enteredAt, by: changedBy}"\n```\n\nIt prints `GET /v1/opportunities/{id}/stage-history` as it is, the same rows as the deal page and the MCP\'s `opportunities(operation="get-stage-history")`: the stage now, `isComplete` and `entries`, oldest first, each with `fromStage`, `stage`, `stageLabel`, `enteredAt`, `leftAt`, `durationSeconds`, `actorKind`, `actorMemberId` and Ken\'s `reason` on a move its stage judge made. With the `deal_stage_rules` flag on, each entry also has `changedBy` (`member`, `agent`, `api_key`, `workflow`, `stage_judge`, `crm_sync` or `ken_automation`), `crmProvider` on a CRM sync, and on a move `fromStageLabel` and `fromStageDurationSeconds`, how long the deal sat in the stage it left. `isComplete` false means Kenso has no record of part of the history.\n\n## Required fields per stage\n\n```bash\nkenso pipelines stage-rules\nkenso pipelines stage-rules proposal --require amount,closeDate,custom.tier\nkenso pipelines stage-rules proposal --none\nkenso pipelines stage-rules lost --default\n```\n\nWith the `deal_stage_rules` flag on, each stage can name the fields a deal should have in it. Without a stage the command prints every stage\'s `key`, `label`, `category`, `isArchived`, `requiredFields` and `isDefault`, plus `requirableFields`: `amount`, `closeDate`, `ownerMemberId`, `primaryPersonId`, `nextStep`, `lostReasonKey`, `wonReasonKey` and `custom.<key>` for each custom deal field. `--require` sets the stage\'s whole list, in order, at most 10. `--none` requires nothing, and `--default` goes back to the default: a lost stage asks for `lostReasonKey`, any other stage nothing. Setting a rule needs the `workspace_settings` permission. The same as the MCP\'s `opportunities(operation="stages-set-required-fields")`.\n\nA missing field never stops a move. The deal moves, and it is flagged Missing on the board, the list and the deal page until the field is filled. A rule also applies to deals already in the stage.\n';
|
|
7788
7788
|
}
|
|
7789
7789
|
});
|
|
7790
7790
|
|
|
@@ -8976,8 +8976,8 @@ var init_browser_login = __esm({
|
|
|
8976
8976
|
defaultDeps = {
|
|
8977
8977
|
sleep: (ms, signal) => delay2(ms, void 0, signal ? { signal } : void 0),
|
|
8978
8978
|
now: () => Date.now(),
|
|
8979
|
-
spawn: (
|
|
8980
|
-
const child = nodeSpawn(
|
|
8979
|
+
spawn: (command53, args) => {
|
|
8980
|
+
const child = nodeSpawn(command53, args, { detached: true, stdio: "ignore" });
|
|
8981
8981
|
child.on("error", () => {
|
|
8982
8982
|
});
|
|
8983
8983
|
child.unref();
|
|
@@ -10166,8 +10166,8 @@ var init_run = __esm({
|
|
|
10166
10166
|
defaultDeps2 = {
|
|
10167
10167
|
sleep: (ms, signal) => delay3(ms, void 0, signal ? { signal } : void 0),
|
|
10168
10168
|
now: () => Date.now(),
|
|
10169
|
-
spawn: (
|
|
10170
|
-
const child = nodeSpawn2(
|
|
10169
|
+
spawn: (command53, args) => {
|
|
10170
|
+
const child = nodeSpawn2(command53, args, { detached: true, stdio: "ignore" });
|
|
10171
10171
|
child.on("error", () => {
|
|
10172
10172
|
});
|
|
10173
10173
|
child.unref();
|
|
@@ -10208,9 +10208,9 @@ function stringFlag2(flags, name) {
|
|
|
10208
10208
|
const text4 = value.trim();
|
|
10209
10209
|
return text4 === "" ? void 0 : text4;
|
|
10210
10210
|
}
|
|
10211
|
-
function requireFlag(flags, name,
|
|
10211
|
+
function requireFlag(flags, name, command53, hint) {
|
|
10212
10212
|
const value = stringFlag2(flags, name);
|
|
10213
|
-
if (value === void 0) throw usageError(`--${name} is required for ${
|
|
10213
|
+
if (value === void 0) throw usageError(`--${name} is required for ${command53}.`, { field: name, next: `${command53} --help`, ...hint ? { hint } : {} });
|
|
10214
10214
|
return value;
|
|
10215
10215
|
}
|
|
10216
10216
|
function positiveId(value) {
|
|
@@ -10219,8 +10219,8 @@ function positiveId(value) {
|
|
|
10219
10219
|
const id = Number(text4);
|
|
10220
10220
|
return Number.isSafeInteger(id) && id > 0 ? id : void 0;
|
|
10221
10221
|
}
|
|
10222
|
-
function idFlag(flags, name,
|
|
10223
|
-
const raw = requireFlag(flags, name,
|
|
10222
|
+
function idFlag(flags, name, command53) {
|
|
10223
|
+
const raw = requireFlag(flags, name, command53);
|
|
10224
10224
|
const id = positiveId(raw);
|
|
10225
10225
|
if (id === void 0) throw usageError(`--${name} must be a positive whole number (got "${raw}").`, { field: name });
|
|
10226
10226
|
return id;
|
|
@@ -10240,8 +10240,8 @@ function isDryRun(ctx) {
|
|
|
10240
10240
|
function shellQuote4(value) {
|
|
10241
10241
|
return /^[A-Za-z0-9_\-.,:/@=+%]+$/.test(value) ? value : `'${value.replace(/'/g, `'\\''`)}'`;
|
|
10242
10242
|
}
|
|
10243
|
-
function sameCommand2(
|
|
10244
|
-
const parts2 = [
|
|
10243
|
+
function sameCommand2(command53, flags, ctx, extra = []) {
|
|
10244
|
+
const parts2 = [command53];
|
|
10245
10245
|
for (const [name, value] of Object.entries(flags)) {
|
|
10246
10246
|
if (value === void 0 || value === false) continue;
|
|
10247
10247
|
if (value === true) parts2.push(`--${name}`);
|
|
@@ -11378,12 +11378,12 @@ import { join as join11 } from "node:path";
|
|
|
11378
11378
|
function whereDir(env) {
|
|
11379
11379
|
return join11(runsRoot(env), WHERE_DIR);
|
|
11380
11380
|
}
|
|
11381
|
-
async function unfinishedWhereIds(ctx,
|
|
11381
|
+
async function unfinishedWhereIds(ctx, command53, args) {
|
|
11382
11382
|
const dir = whereDir(ctx.env);
|
|
11383
11383
|
const identity = argsIdentity(args);
|
|
11384
11384
|
const workspaceId = ctx.client.workspaceId ?? ctx.auth.workspaceId;
|
|
11385
11385
|
for (const run of await listRuns(ctx.env)) {
|
|
11386
|
-
if (run.command !==
|
|
11386
|
+
if (run.command !== command53 || run.status === "done" || run.status === "planned") continue;
|
|
11387
11387
|
if ((run.workspaceId || void 0) !== (workspaceId || void 0) || argsIdentity(run.args) !== identity) continue;
|
|
11388
11388
|
if (run.inputPath?.startsWith(`${dir}/`) && existsSync6(run.inputPath)) return run.inputPath;
|
|
11389
11389
|
}
|
|
@@ -11529,14 +11529,14 @@ async function idsFromRun(ctx, runId) {
|
|
|
11529
11529
|
return { ...idItems(ids2), source: "run" };
|
|
11530
11530
|
}
|
|
11531
11531
|
async function collectIds(ctx, flags, kind, dryRun2) {
|
|
11532
|
-
const
|
|
11532
|
+
const command53 = `kenso contacts ${kind}`;
|
|
11533
11533
|
const ids2 = stringFlag2(flags, "ids");
|
|
11534
11534
|
const where = kind === "restore" ? void 0 : stringFlag2(flags, "where");
|
|
11535
11535
|
const run = kind === "restore" ? stringFlag2(flags, "run") : void 0;
|
|
11536
11536
|
const given = [ids2, where, run].filter((v) => v !== void 0).length;
|
|
11537
11537
|
if (given !== 1) {
|
|
11538
11538
|
const choices = kind === "restore" ? "--ids <file|-> or --run <runId>" : "--ids <file|-> or --where '<json>'";
|
|
11539
|
-
throw usageError(`${
|
|
11539
|
+
throw usageError(`${command53} needs exactly one of ${choices}.`, { field: "ids", next: `${command53} --help` });
|
|
11540
11540
|
}
|
|
11541
11541
|
if (ids2 !== void 0) return idsFromFile(ctx, ids2);
|
|
11542
11542
|
if (where !== void 0) return idsFromWhere(ctx, kind, flags, where, dryRun2);
|
|
@@ -12359,12 +12359,159 @@ var init_doctor = __esm({
|
|
|
12359
12359
|
}
|
|
12360
12360
|
});
|
|
12361
12361
|
|
|
12362
|
-
// src/commands/
|
|
12362
|
+
// src/commands/export/export.ts
|
|
12363
|
+
var export_exports2 = {};
|
|
12364
|
+
__export(export_exports2, {
|
|
12365
|
+
default: () => export_default2,
|
|
12366
|
+
recordCount: () => recordCount
|
|
12367
|
+
});
|
|
12368
|
+
function jsonFlag(flags, name, shape) {
|
|
12369
|
+
const text4 = stringFlag(flags[name]);
|
|
12370
|
+
if (text4 === void 0) return void 0;
|
|
12371
|
+
let value;
|
|
12372
|
+
try {
|
|
12373
|
+
value = JSON.parse(text4);
|
|
12374
|
+
} catch {
|
|
12375
|
+
throw usageError(`--${name} must be JSON (got "${text4}").`, { field: name });
|
|
12376
|
+
}
|
|
12377
|
+
const ok = shape === "array" ? Array.isArray(value) : typeof value === "object" && value !== null && !Array.isArray(value);
|
|
12378
|
+
if (!ok) throw usageError(`--${name} must be a JSON ${shape}.`, { field: name });
|
|
12379
|
+
return value;
|
|
12380
|
+
}
|
|
12381
|
+
function recordCount(csv) {
|
|
12382
|
+
let records = 0;
|
|
12383
|
+
let quoted = false;
|
|
12384
|
+
let hasText = false;
|
|
12385
|
+
for (const ch of csv) {
|
|
12386
|
+
if (ch === '"') quoted = !quoted;
|
|
12387
|
+
if (ch === "\n" && !quoted) {
|
|
12388
|
+
if (hasText) records++;
|
|
12389
|
+
hasText = false;
|
|
12390
|
+
} else if (ch !== "\r") {
|
|
12391
|
+
hasText = true;
|
|
12392
|
+
}
|
|
12393
|
+
}
|
|
12394
|
+
return hasText ? records + 1 : records;
|
|
12395
|
+
}
|
|
12396
|
+
var OBJECTS, command22, export_default2;
|
|
12397
|
+
var init_export2 = __esm({
|
|
12398
|
+
"src/commands/export/export.ts"() {
|
|
12399
|
+
"use strict";
|
|
12400
|
+
init_errors();
|
|
12401
|
+
init_exit_codes();
|
|
12402
|
+
init_http();
|
|
12403
|
+
init_transfer();
|
|
12404
|
+
init_columns();
|
|
12405
|
+
OBJECTS = {
|
|
12406
|
+
accounts: { resource: "accounts", noun: "accounts" },
|
|
12407
|
+
people: { resource: "people", noun: "people" },
|
|
12408
|
+
deals: { resource: "opportunities", noun: "deals" },
|
|
12409
|
+
opportunities: { resource: "opportunities", noun: "deals" }
|
|
12410
|
+
};
|
|
12411
|
+
command22 = {
|
|
12412
|
+
resource: "export",
|
|
12413
|
+
action: "",
|
|
12414
|
+
summary: "Export accounts, people or deals as CSV: everything, a saved view, or what the filters match",
|
|
12415
|
+
brief: "<accounts|people|deals> [--view <id>] [--out <file>]",
|
|
12416
|
+
description: "Writes the CSV that POST /v1/accounts/export, /v1/people/export or /v1/opportunities/export returns, to stdout or to --out. With no filter it exports every record; more than 50,000 rows is refused (narrow the filters). --view exports a saved Accounts view: its filters, as GET /v1/account-views lists them. --filters, --where (accounts), --q and --sort are the search operation's own fields, and add to the view's when both are given (a --filters list replaces the view's). The accounts and deals files start with id and import back as they are. Each export writes an audit-log entry. Needs the export permission.",
|
|
12417
|
+
flags: {
|
|
12418
|
+
view: { type: "string", description: "A saved Accounts view's id: export what that view lists" },
|
|
12419
|
+
filters: { type: "string", description: `Filter conditions as JSON, e.g. '[{"field":"stage","operator":"is","values":["engaged"]}]'` },
|
|
12420
|
+
where: { type: "string", description: "Accounts only: a condition group as JSON, as accounts search takes it" },
|
|
12421
|
+
q: { type: "string", description: "Text to match, as the list's search box does" },
|
|
12422
|
+
sort: { type: "string", description: "The search operation's sort, e.g. name or -createdAt" },
|
|
12423
|
+
out: { type: "string", short: "o", description: "Write the CSV to this file instead of stdout" }
|
|
12424
|
+
},
|
|
12425
|
+
positionals: [{ name: "object", required: true, description: "accounts, people or deals" }],
|
|
12426
|
+
examples: [
|
|
12427
|
+
"kenso export accounts --out accounts.csv",
|
|
12428
|
+
"kenso export accounts --view 12 --out tier-1.csv",
|
|
12429
|
+
`kenso export deals --filters '[{"field":"stageCategory","operator":"is","values":["open"]}]' > open-deals.csv`
|
|
12430
|
+
],
|
|
12431
|
+
beta: { featureGates: { all: ["accounts"] } },
|
|
12432
|
+
operationIds: ["accounts.export", "people.export", "opportunities.export", "account-views.list"],
|
|
12433
|
+
async run(ctx, { flags, positionals }) {
|
|
12434
|
+
const typed = (positionals[0] ?? "").trim().toLowerCase();
|
|
12435
|
+
const object = OBJECTS[typed];
|
|
12436
|
+
if (!object) {
|
|
12437
|
+
throw usageError(`Export takes accounts, people or deals (got "${typed}").`, { field: "object", next: "kenso export accounts" });
|
|
12438
|
+
}
|
|
12439
|
+
const body2 = {};
|
|
12440
|
+
const view = stringFlag(flags.view);
|
|
12441
|
+
if (view !== void 0) {
|
|
12442
|
+
if (object.resource !== "accounts") {
|
|
12443
|
+
throw usageError("--view exports a saved Accounts view. For people and deals, pass the view's --filters and --sort.", { field: "view" });
|
|
12444
|
+
}
|
|
12445
|
+
const id = /^\d+$/.test(view.trim()) ? Number(view.trim()) : Number.NaN;
|
|
12446
|
+
if (!Number.isSafeInteger(id) || id < 1) throw usageError(`--view must be a view id (got "${view}").`, { field: "view" });
|
|
12447
|
+
const listed = await ctx.client.request({ method: "GET", path: "/v1/account-views", signal: ctx.signal });
|
|
12448
|
+
const views = unwrap(listed.body);
|
|
12449
|
+
const found = (views ?? []).find((v) => v.id === id);
|
|
12450
|
+
if (!found) {
|
|
12451
|
+
throw usageError(`No saved Accounts view has id ${id}.`, { field: "view", hint: "List yours with kenso account-views list." });
|
|
12452
|
+
}
|
|
12453
|
+
if (found.filters && found.filters.length > 0) body2.filters = found.filters;
|
|
12454
|
+
}
|
|
12455
|
+
const filters = jsonFlag(flags, "filters", "array");
|
|
12456
|
+
if (filters !== void 0) body2.filters = filters;
|
|
12457
|
+
const where = jsonFlag(flags, "where", "object");
|
|
12458
|
+
if (where !== void 0) {
|
|
12459
|
+
if (object.resource !== "accounts") throw usageError("--where is an accounts filter.", { field: "where" });
|
|
12460
|
+
body2.where = where;
|
|
12461
|
+
}
|
|
12462
|
+
const q = stringFlag(flags.q);
|
|
12463
|
+
if (q !== void 0) body2.q = q;
|
|
12464
|
+
const sort = stringFlag(flags.sort);
|
|
12465
|
+
if (sort !== void 0) body2.sort = sort;
|
|
12466
|
+
let res;
|
|
12467
|
+
try {
|
|
12468
|
+
res = await ctx.client.request({ method: "POST", path: `/v1/${object.resource}/export`, body: body2, signal: ctx.signal });
|
|
12469
|
+
} catch (err) {
|
|
12470
|
+
if (err instanceof KensoError && err.httpStatus === 404 && object.resource !== "people") {
|
|
12471
|
+
throw new KensoError({
|
|
12472
|
+
code: err.code,
|
|
12473
|
+
message: `Exporting ${object.noun} is not on for this workspace yet.`,
|
|
12474
|
+
exitCode: err.exitCode,
|
|
12475
|
+
httpStatus: 404,
|
|
12476
|
+
hint: "It is behind the crm_import_export feature flag.",
|
|
12477
|
+
requestId: err.requestId
|
|
12478
|
+
});
|
|
12479
|
+
}
|
|
12480
|
+
throw err;
|
|
12481
|
+
}
|
|
12482
|
+
const bytes = responseBytes(res);
|
|
12483
|
+
const csv = bytes.toString("utf8");
|
|
12484
|
+
const out = stringFlag(flags.out);
|
|
12485
|
+
if (out === void 0) {
|
|
12486
|
+
ctx.output.writeRaw(csv);
|
|
12487
|
+
return ExitCode.Ok;
|
|
12488
|
+
}
|
|
12489
|
+
const file = await saveFile(out, bytes);
|
|
12490
|
+
ctx.output.object({ object: typed === "opportunities" ? "deals" : typed, file, rows: Math.max(recordCount(csv) - 1, 0) });
|
|
12491
|
+
return ExitCode.Ok;
|
|
12492
|
+
}
|
|
12493
|
+
};
|
|
12494
|
+
export_default2 = command22;
|
|
12495
|
+
}
|
|
12496
|
+
});
|
|
12497
|
+
|
|
12498
|
+
// src/commands/export/index.ts
|
|
12363
12499
|
var actions13;
|
|
12500
|
+
var init_export3 = __esm({
|
|
12501
|
+
"src/commands/export/index.ts"() {
|
|
12502
|
+
"use strict";
|
|
12503
|
+
actions13 = {
|
|
12504
|
+
"": async () => (await Promise.resolve().then(() => (init_export2(), export_exports2))).default
|
|
12505
|
+
};
|
|
12506
|
+
}
|
|
12507
|
+
});
|
|
12508
|
+
|
|
12509
|
+
// src/commands/jobs/index.ts
|
|
12510
|
+
var actions14;
|
|
12364
12511
|
var init_jobs2 = __esm({
|
|
12365
12512
|
"src/commands/jobs/index.ts"() {
|
|
12366
12513
|
"use strict";
|
|
12367
|
-
|
|
12514
|
+
actions14 = {
|
|
12368
12515
|
wait: () => Promise.resolve().then(() => (init_wait(), wait_exports)).then((m) => m.default)
|
|
12369
12516
|
};
|
|
12370
12517
|
}
|
|
@@ -12397,7 +12544,7 @@ function readable(row) {
|
|
|
12397
12544
|
const parts2 = [time, `[${row.status}]`, row.method, row.pathTemplate, row.errorCode, `${row.durationMs}ms`, row.apiKeyId, row.requestId];
|
|
12398
12545
|
return parts2.filter((p) => p !== void 0 && p !== "").join(" ");
|
|
12399
12546
|
}
|
|
12400
|
-
var MIN_INTERVAL_MS, MAX_INTERVAL_MS, MAX_SINCE_MS, OVERLAP_MS, MAX_PAGES, RATE_LIMITED_WAIT_MS, isOwnPoll, pad,
|
|
12547
|
+
var MIN_INTERVAL_MS, MAX_INTERVAL_MS, MAX_SINCE_MS, OVERLAP_MS, MAX_PAGES, RATE_LIMITED_WAIT_MS, isOwnPoll, pad, command23, tail_default;
|
|
12401
12548
|
var init_tail = __esm({
|
|
12402
12549
|
"src/commands/logs/tail.ts"() {
|
|
12403
12550
|
"use strict";
|
|
@@ -12413,7 +12560,7 @@ var init_tail = __esm({
|
|
|
12413
12560
|
RATE_LIMITED_WAIT_MS = 3e4;
|
|
12414
12561
|
isOwnPoll = (row) => row.method === "GET" && row.pathTemplate === "/v1/api-requests" && row.userAgent?.startsWith("kenso-cli/") === true;
|
|
12415
12562
|
pad = (n) => String(n).padStart(2, "0");
|
|
12416
|
-
|
|
12563
|
+
command23 = {
|
|
12417
12564
|
resource: "logs",
|
|
12418
12565
|
action: "tail",
|
|
12419
12566
|
summary: "Stream your workspace's new API request log rows",
|
|
@@ -12519,16 +12666,16 @@ var init_tail = __esm({
|
|
|
12519
12666
|
return ExitCode.Ok;
|
|
12520
12667
|
}
|
|
12521
12668
|
};
|
|
12522
|
-
tail_default =
|
|
12669
|
+
tail_default = command23;
|
|
12523
12670
|
}
|
|
12524
12671
|
});
|
|
12525
12672
|
|
|
12526
12673
|
// src/commands/logs/index.ts
|
|
12527
|
-
var
|
|
12674
|
+
var actions15;
|
|
12528
12675
|
var init_logs = __esm({
|
|
12529
12676
|
"src/commands/logs/index.ts"() {
|
|
12530
12677
|
"use strict";
|
|
12531
|
-
|
|
12678
|
+
actions15 = {
|
|
12532
12679
|
tail: () => Promise.resolve().then(() => (init_tail(), tail_exports)).then((m) => m.default)
|
|
12533
12680
|
};
|
|
12534
12681
|
}
|
|
@@ -12584,7 +12731,7 @@ function isRecord7(value) {
|
|
|
12584
12731
|
function textOf(result) {
|
|
12585
12732
|
return (result.content ?? []).filter((part) => part.type === "text" && typeof part.text === "string").map((part) => part.text).join("\n");
|
|
12586
12733
|
}
|
|
12587
|
-
var
|
|
12734
|
+
var command24, call_default;
|
|
12588
12735
|
var init_call = __esm({
|
|
12589
12736
|
"src/commands/mcp/call.ts"() {
|
|
12590
12737
|
"use strict";
|
|
@@ -12592,7 +12739,7 @@ var init_call = __esm({
|
|
|
12592
12739
|
init_exit_codes();
|
|
12593
12740
|
init_input();
|
|
12594
12741
|
init_connect4();
|
|
12595
|
-
|
|
12742
|
+
command24 = {
|
|
12596
12743
|
resource: "mcp",
|
|
12597
12744
|
action: "call",
|
|
12598
12745
|
summary: "Call a hosted Kenso MCP tool, such as list_skills",
|
|
@@ -12645,7 +12792,7 @@ var init_call = __esm({
|
|
|
12645
12792
|
return ExitCode.Ok;
|
|
12646
12793
|
}
|
|
12647
12794
|
};
|
|
12648
|
-
call_default =
|
|
12795
|
+
call_default = command24;
|
|
12649
12796
|
}
|
|
12650
12797
|
});
|
|
12651
12798
|
|
|
@@ -12654,13 +12801,13 @@ var tools_exports = {};
|
|
|
12654
12801
|
__export(tools_exports, {
|
|
12655
12802
|
default: () => tools_default
|
|
12656
12803
|
});
|
|
12657
|
-
var
|
|
12804
|
+
var command25, tools_default;
|
|
12658
12805
|
var init_tools = __esm({
|
|
12659
12806
|
"src/commands/mcp/tools.ts"() {
|
|
12660
12807
|
"use strict";
|
|
12661
12808
|
init_exit_codes();
|
|
12662
12809
|
init_connect4();
|
|
12663
|
-
|
|
12810
|
+
command25 = {
|
|
12664
12811
|
resource: "mcp",
|
|
12665
12812
|
action: "tools",
|
|
12666
12813
|
summary: "List the hosted Kenso MCP's tools",
|
|
@@ -12675,16 +12822,16 @@ var init_tools = __esm({
|
|
|
12675
12822
|
return ExitCode.Ok;
|
|
12676
12823
|
}
|
|
12677
12824
|
};
|
|
12678
|
-
tools_default =
|
|
12825
|
+
tools_default = command25;
|
|
12679
12826
|
}
|
|
12680
12827
|
});
|
|
12681
12828
|
|
|
12682
12829
|
// src/commands/mcp/index.ts
|
|
12683
|
-
var
|
|
12830
|
+
var actions16;
|
|
12684
12831
|
var init_mcp = __esm({
|
|
12685
12832
|
"src/commands/mcp/index.ts"() {
|
|
12686
12833
|
"use strict";
|
|
12687
|
-
|
|
12834
|
+
actions16 = {
|
|
12688
12835
|
call: () => Promise.resolve().then(() => (init_call(), call_exports)).then((m) => m.default),
|
|
12689
12836
|
tools: () => Promise.resolve().then(() => (init_tools(), tools_exports)).then((m) => m.default)
|
|
12690
12837
|
};
|
|
@@ -12696,14 +12843,14 @@ var stage_history_exports = {};
|
|
|
12696
12843
|
__export(stage_history_exports, {
|
|
12697
12844
|
default: () => stage_history_default
|
|
12698
12845
|
});
|
|
12699
|
-
var
|
|
12846
|
+
var command26, stage_history_default;
|
|
12700
12847
|
var init_stage_history = __esm({
|
|
12701
12848
|
"src/commands/opportunities/stage-history.ts"() {
|
|
12702
12849
|
"use strict";
|
|
12703
12850
|
init_errors();
|
|
12704
12851
|
init_exit_codes();
|
|
12705
12852
|
init_http();
|
|
12706
|
-
|
|
12853
|
+
command26 = {
|
|
12707
12854
|
resource: "opportunities",
|
|
12708
12855
|
action: "stage-history",
|
|
12709
12856
|
summary: "Show a deal's stage history: each stage, when, who moved it and how long it sat there",
|
|
@@ -12727,16 +12874,16 @@ var init_stage_history = __esm({
|
|
|
12727
12874
|
return ExitCode.Ok;
|
|
12728
12875
|
}
|
|
12729
12876
|
};
|
|
12730
|
-
stage_history_default =
|
|
12877
|
+
stage_history_default = command26;
|
|
12731
12878
|
}
|
|
12732
12879
|
});
|
|
12733
12880
|
|
|
12734
12881
|
// src/commands/opportunities/index.ts
|
|
12735
|
-
var
|
|
12882
|
+
var actions17;
|
|
12736
12883
|
var init_opportunities = __esm({
|
|
12737
12884
|
"src/commands/opportunities/index.ts"() {
|
|
12738
12885
|
"use strict";
|
|
12739
|
-
|
|
12886
|
+
actions17 = {
|
|
12740
12887
|
"stage-history": () => Promise.resolve().then(() => (init_stage_history(), stage_history_exports)).then((m) => m.default)
|
|
12741
12888
|
};
|
|
12742
12889
|
}
|
|
@@ -12813,7 +12960,7 @@ function summarize3(results) {
|
|
|
12813
12960
|
}
|
|
12814
12961
|
return { matched, addedToAccounts, emailFindsQueued };
|
|
12815
12962
|
}
|
|
12816
|
-
var COMMAND5, CHUNK_SIZE6, ALIASES3, PERSON_FIELDS, ACCOUNT_NOT_FOUND,
|
|
12963
|
+
var COMMAND5, CHUNK_SIZE6, ALIASES3, PERSON_FIELDS, ACCOUNT_NOT_FOUND, command27, import_default3;
|
|
12817
12964
|
var init_import3 = __esm({
|
|
12818
12965
|
"src/commands/people/import.ts"() {
|
|
12819
12966
|
"use strict";
|
|
@@ -12845,7 +12992,7 @@ var init_import3 = __esm({
|
|
|
12845
12992
|
};
|
|
12846
12993
|
PERSON_FIELDS = ["email", "fullName", "firstName", "lastName", "linkedinUrl", "title"];
|
|
12847
12994
|
ACCOUNT_NOT_FOUND = "No account in this workspace has that domain. The person was saved without an account: add the account (kenso accounts import) and run the same command again.";
|
|
12848
|
-
|
|
12995
|
+
command27 = {
|
|
12849
12996
|
resource: "people",
|
|
12850
12997
|
action: "import",
|
|
12851
12998
|
summary: "Create or match people from a CSV or JSONL file, optionally onto accounts",
|
|
@@ -12910,16 +13057,16 @@ var init_import3 = __esm({
|
|
|
12910
13057
|
return outcome.exitCode;
|
|
12911
13058
|
}
|
|
12912
13059
|
};
|
|
12913
|
-
import_default3 =
|
|
13060
|
+
import_default3 = command27;
|
|
12914
13061
|
}
|
|
12915
13062
|
});
|
|
12916
13063
|
|
|
12917
13064
|
// src/commands/people/index.ts
|
|
12918
|
-
var
|
|
13065
|
+
var actions18;
|
|
12919
13066
|
var init_people = __esm({
|
|
12920
13067
|
"src/commands/people/index.ts"() {
|
|
12921
13068
|
"use strict";
|
|
12922
|
-
|
|
13069
|
+
actions18 = {
|
|
12923
13070
|
import: () => Promise.resolve().then(() => (init_import3(), import_exports3)).then((m) => m.default)
|
|
12924
13071
|
};
|
|
12925
13072
|
}
|
|
@@ -12940,14 +13087,14 @@ function rule(stage) {
|
|
|
12940
13087
|
isDefault: stage.isDefaultRequiredFields
|
|
12941
13088
|
};
|
|
12942
13089
|
}
|
|
12943
|
-
var
|
|
13090
|
+
var command28, stage_rules_default;
|
|
12944
13091
|
var init_stage_rules = __esm({
|
|
12945
13092
|
"src/commands/pipelines/stage-rules.ts"() {
|
|
12946
13093
|
"use strict";
|
|
12947
13094
|
init_errors();
|
|
12948
13095
|
init_exit_codes();
|
|
12949
13096
|
init_http();
|
|
12950
|
-
|
|
13097
|
+
command28 = {
|
|
12951
13098
|
resource: "pipelines",
|
|
12952
13099
|
action: "stage-rules",
|
|
12953
13100
|
summary: "List or set the fields a deal should have in each stage",
|
|
@@ -13000,16 +13147,16 @@ var init_stage_rules = __esm({
|
|
|
13000
13147
|
return ExitCode.Ok;
|
|
13001
13148
|
}
|
|
13002
13149
|
};
|
|
13003
|
-
stage_rules_default =
|
|
13150
|
+
stage_rules_default = command28;
|
|
13004
13151
|
}
|
|
13005
13152
|
});
|
|
13006
13153
|
|
|
13007
13154
|
// src/commands/pipelines/index.ts
|
|
13008
|
-
var
|
|
13155
|
+
var actions19;
|
|
13009
13156
|
var init_pipelines = __esm({
|
|
13010
13157
|
"src/commands/pipelines/index.ts"() {
|
|
13011
13158
|
"use strict";
|
|
13012
|
-
|
|
13159
|
+
actions19 = {
|
|
13013
13160
|
"stage-rules": () => Promise.resolve().then(() => (init_stage_rules(), stage_rules_exports)).then((m) => m.default)
|
|
13014
13161
|
};
|
|
13015
13162
|
}
|
|
@@ -13020,7 +13167,7 @@ var run_exports2 = {};
|
|
|
13020
13167
|
__export(run_exports2, {
|
|
13021
13168
|
default: () => run_default
|
|
13022
13169
|
});
|
|
13023
|
-
var REPORTS,
|
|
13170
|
+
var REPORTS, command29, run_default;
|
|
13024
13171
|
var init_run2 = __esm({
|
|
13025
13172
|
"src/commands/reports/run.ts"() {
|
|
13026
13173
|
"use strict";
|
|
@@ -13028,7 +13175,7 @@ var init_run2 = __esm({
|
|
|
13028
13175
|
init_exit_codes();
|
|
13029
13176
|
init_http();
|
|
13030
13177
|
REPORTS = ["pipeline_by_stage", "won_by_month", "stage_conversion", "time_in_stage", "won_by_source_campaign", "activity_by_member"];
|
|
13031
|
-
|
|
13178
|
+
command29 = {
|
|
13032
13179
|
resource: "reports",
|
|
13033
13180
|
action: "run",
|
|
13034
13181
|
summary: "Run a stock pipeline report and print its table",
|
|
@@ -13090,7 +13237,7 @@ var init_run2 = __esm({
|
|
|
13090
13237
|
return ExitCode.Ok;
|
|
13091
13238
|
}
|
|
13092
13239
|
};
|
|
13093
|
-
run_default =
|
|
13240
|
+
run_default = command29;
|
|
13094
13241
|
}
|
|
13095
13242
|
});
|
|
13096
13243
|
|
|
@@ -13099,14 +13246,14 @@ var summary_exports = {};
|
|
|
13099
13246
|
__export(summary_exports, {
|
|
13100
13247
|
default: () => summary_default
|
|
13101
13248
|
});
|
|
13102
|
-
var
|
|
13249
|
+
var command30, summary_default;
|
|
13103
13250
|
var init_summary = __esm({
|
|
13104
13251
|
"src/commands/reports/summary.ts"() {
|
|
13105
13252
|
"use strict";
|
|
13106
13253
|
init_errors();
|
|
13107
13254
|
init_exit_codes();
|
|
13108
13255
|
init_http();
|
|
13109
|
-
|
|
13256
|
+
command30 = {
|
|
13110
13257
|
resource: "reports",
|
|
13111
13258
|
action: "summary",
|
|
13112
13259
|
summary: "Read where the period stands and what needs you",
|
|
@@ -13161,16 +13308,16 @@ var init_summary = __esm({
|
|
|
13161
13308
|
return ExitCode.Ok;
|
|
13162
13309
|
}
|
|
13163
13310
|
};
|
|
13164
|
-
summary_default =
|
|
13311
|
+
summary_default = command30;
|
|
13165
13312
|
}
|
|
13166
13313
|
});
|
|
13167
13314
|
|
|
13168
13315
|
// src/commands/reports/index.ts
|
|
13169
|
-
var
|
|
13316
|
+
var actions20;
|
|
13170
13317
|
var init_reports = __esm({
|
|
13171
13318
|
"src/commands/reports/index.ts"() {
|
|
13172
13319
|
"use strict";
|
|
13173
|
-
|
|
13320
|
+
actions20 = {
|
|
13174
13321
|
run: () => Promise.resolve().then(() => (init_run2(), run_exports2)).then((m) => m.default),
|
|
13175
13322
|
summary: () => Promise.resolve().then(() => (init_summary(), summary_exports)).then((m) => m.default)
|
|
13176
13323
|
};
|
|
@@ -13182,14 +13329,14 @@ var list_exports = {};
|
|
|
13182
13329
|
__export(list_exports, {
|
|
13183
13330
|
default: () => list_default
|
|
13184
13331
|
});
|
|
13185
|
-
var
|
|
13332
|
+
var command31, list_default;
|
|
13186
13333
|
var init_list = __esm({
|
|
13187
13334
|
"src/commands/runs/list.ts"() {
|
|
13188
13335
|
"use strict";
|
|
13189
13336
|
init_runs();
|
|
13190
13337
|
init_errors();
|
|
13191
13338
|
init_exit_codes();
|
|
13192
|
-
|
|
13339
|
+
command31 = {
|
|
13193
13340
|
resource: "runs",
|
|
13194
13341
|
action: "list",
|
|
13195
13342
|
summary: "List batch runs, newest first (finds an interrupted run)",
|
|
@@ -13210,7 +13357,7 @@ var init_list = __esm({
|
|
|
13210
13357
|
return ExitCode.Ok;
|
|
13211
13358
|
}
|
|
13212
13359
|
};
|
|
13213
|
-
list_default =
|
|
13360
|
+
list_default = command31;
|
|
13214
13361
|
}
|
|
13215
13362
|
});
|
|
13216
13363
|
|
|
@@ -13221,7 +13368,7 @@ __export(show_exports2, {
|
|
|
13221
13368
|
});
|
|
13222
13369
|
import { existsSync as existsSync7, readFileSync as readFileSync9 } from "node:fs";
|
|
13223
13370
|
import { join as join12 } from "node:path";
|
|
13224
|
-
var FILES,
|
|
13371
|
+
var FILES, command32, show_default2;
|
|
13225
13372
|
var init_show2 = __esm({
|
|
13226
13373
|
"src/commands/runs/show.ts"() {
|
|
13227
13374
|
"use strict";
|
|
@@ -13236,7 +13383,7 @@ var init_show2 = __esm({
|
|
|
13236
13383
|
["plan", "plan.json"],
|
|
13237
13384
|
["summary", "summary.json"]
|
|
13238
13385
|
];
|
|
13239
|
-
|
|
13386
|
+
command32 = {
|
|
13240
13387
|
resource: "runs",
|
|
13241
13388
|
action: "show",
|
|
13242
13389
|
summary: "Show one batch run and its files",
|
|
@@ -13263,7 +13410,7 @@ var init_show2 = __esm({
|
|
|
13263
13410
|
return ExitCode.Ok;
|
|
13264
13411
|
}
|
|
13265
13412
|
};
|
|
13266
|
-
show_default2 =
|
|
13413
|
+
show_default2 = command32;
|
|
13267
13414
|
}
|
|
13268
13415
|
});
|
|
13269
13416
|
|
|
@@ -13322,14 +13469,14 @@ function resumeArgv(run, globals = {}) {
|
|
|
13322
13469
|
async function sha256(path) {
|
|
13323
13470
|
return createHash5("sha256").update(await readFile9(path)).digest("hex");
|
|
13324
13471
|
}
|
|
13325
|
-
var SKIPPED_KEYS,
|
|
13472
|
+
var SKIPPED_KEYS, command33, resume_default;
|
|
13326
13473
|
var init_resume = __esm({
|
|
13327
13474
|
"src/commands/runs/resume.ts"() {
|
|
13328
13475
|
"use strict";
|
|
13329
13476
|
init_runs();
|
|
13330
13477
|
init_errors();
|
|
13331
13478
|
SKIPPED_KEYS = /* @__PURE__ */ new Set(["positionals", "yes", "dryRun", "dry-run", "help", "version"]);
|
|
13332
|
-
|
|
13479
|
+
command33 = {
|
|
13333
13480
|
resource: "runs",
|
|
13334
13481
|
action: "resume",
|
|
13335
13482
|
summary: "Continue an interrupted batch run (its command with --yes, no dry run)",
|
|
@@ -13384,16 +13531,16 @@ var init_resume = __esm({
|
|
|
13384
13531
|
}
|
|
13385
13532
|
}
|
|
13386
13533
|
};
|
|
13387
|
-
resume_default =
|
|
13534
|
+
resume_default = command33;
|
|
13388
13535
|
}
|
|
13389
13536
|
});
|
|
13390
13537
|
|
|
13391
13538
|
// src/commands/runs/index.ts
|
|
13392
|
-
var
|
|
13539
|
+
var actions21;
|
|
13393
13540
|
var init_runs2 = __esm({
|
|
13394
13541
|
"src/commands/runs/index.ts"() {
|
|
13395
13542
|
"use strict";
|
|
13396
|
-
|
|
13543
|
+
actions21 = {
|
|
13397
13544
|
list: () => Promise.resolve().then(() => (init_list(), list_exports)).then((m) => m.default),
|
|
13398
13545
|
show: () => Promise.resolve().then(() => (init_show2(), show_exports2)).then((m) => m.default),
|
|
13399
13546
|
resume: () => Promise.resolve().then(() => (init_resume(), resume_exports)).then((m) => m.default)
|
|
@@ -13492,7 +13639,7 @@ var create_exports = {};
|
|
|
13492
13639
|
__export(create_exports, {
|
|
13493
13640
|
default: () => create_default
|
|
13494
13641
|
});
|
|
13495
|
-
var
|
|
13642
|
+
var command34, create_default;
|
|
13496
13643
|
var init_create = __esm({
|
|
13497
13644
|
"src/commands/sandbox/create.ts"() {
|
|
13498
13645
|
"use strict";
|
|
@@ -13500,7 +13647,7 @@ var init_create = __esm({
|
|
|
13500
13647
|
init_exit_codes();
|
|
13501
13648
|
init_http();
|
|
13502
13649
|
init_shared();
|
|
13503
|
-
|
|
13650
|
+
command34 = {
|
|
13504
13651
|
resource: "sandbox",
|
|
13505
13652
|
action: "create",
|
|
13506
13653
|
summary: "Create your developer sandbox and save its test key as the sandbox profile",
|
|
@@ -13542,7 +13689,7 @@ var init_create = __esm({
|
|
|
13542
13689
|
return ExitCode.Ok;
|
|
13543
13690
|
}
|
|
13544
13691
|
};
|
|
13545
|
-
create_default =
|
|
13692
|
+
create_default = command34;
|
|
13546
13693
|
}
|
|
13547
13694
|
});
|
|
13548
13695
|
|
|
@@ -13551,7 +13698,7 @@ var delete_exports = {};
|
|
|
13551
13698
|
__export(delete_exports, {
|
|
13552
13699
|
default: () => delete_default
|
|
13553
13700
|
});
|
|
13554
|
-
var
|
|
13701
|
+
var command35, delete_default;
|
|
13555
13702
|
var init_delete = __esm({
|
|
13556
13703
|
"src/commands/sandbox/delete.ts"() {
|
|
13557
13704
|
"use strict";
|
|
@@ -13559,7 +13706,7 @@ var init_delete = __esm({
|
|
|
13559
13706
|
init_confirm();
|
|
13560
13707
|
init_exit_codes();
|
|
13561
13708
|
init_shared();
|
|
13562
|
-
|
|
13709
|
+
command35 = {
|
|
13563
13710
|
resource: "sandbox",
|
|
13564
13711
|
action: "delete",
|
|
13565
13712
|
summary: "Delete your sandbox and its test keys",
|
|
@@ -13586,7 +13733,7 @@ var init_delete = __esm({
|
|
|
13586
13733
|
return ExitCode.Ok;
|
|
13587
13734
|
}
|
|
13588
13735
|
};
|
|
13589
|
-
delete_default =
|
|
13736
|
+
delete_default = command35;
|
|
13590
13737
|
}
|
|
13591
13738
|
});
|
|
13592
13739
|
|
|
@@ -13595,14 +13742,14 @@ var key_exports = {};
|
|
|
13595
13742
|
__export(key_exports, {
|
|
13596
13743
|
default: () => key_default
|
|
13597
13744
|
});
|
|
13598
|
-
var
|
|
13745
|
+
var command36, key_default;
|
|
13599
13746
|
var init_key = __esm({
|
|
13600
13747
|
"src/commands/sandbox/key.ts"() {
|
|
13601
13748
|
"use strict";
|
|
13602
13749
|
init_exit_codes();
|
|
13603
13750
|
init_http();
|
|
13604
13751
|
init_shared();
|
|
13605
|
-
|
|
13752
|
+
command36 = {
|
|
13606
13753
|
resource: "sandbox",
|
|
13607
13754
|
action: "key",
|
|
13608
13755
|
summary: "Create a new test key for your sandbox and save it as the sandbox profile",
|
|
@@ -13622,7 +13769,7 @@ var init_key = __esm({
|
|
|
13622
13769
|
return ExitCode.Ok;
|
|
13623
13770
|
}
|
|
13624
13771
|
};
|
|
13625
|
-
key_default =
|
|
13772
|
+
key_default = command36;
|
|
13626
13773
|
}
|
|
13627
13774
|
});
|
|
13628
13775
|
|
|
@@ -13631,13 +13778,13 @@ var list_exports2 = {};
|
|
|
13631
13778
|
__export(list_exports2, {
|
|
13632
13779
|
default: () => list_default2
|
|
13633
13780
|
});
|
|
13634
|
-
var
|
|
13781
|
+
var command37, list_default2;
|
|
13635
13782
|
var init_list2 = __esm({
|
|
13636
13783
|
"src/commands/sandbox/list.ts"() {
|
|
13637
13784
|
"use strict";
|
|
13638
13785
|
init_exit_codes();
|
|
13639
13786
|
init_shared();
|
|
13640
|
-
|
|
13787
|
+
command37 = {
|
|
13641
13788
|
resource: "sandbox",
|
|
13642
13789
|
action: "list",
|
|
13643
13790
|
summary: "List your developer sandbox",
|
|
@@ -13653,7 +13800,7 @@ var init_list2 = __esm({
|
|
|
13653
13800
|
return ExitCode.Ok;
|
|
13654
13801
|
}
|
|
13655
13802
|
};
|
|
13656
|
-
list_default2 =
|
|
13803
|
+
list_default2 = command37;
|
|
13657
13804
|
}
|
|
13658
13805
|
});
|
|
13659
13806
|
|
|
@@ -13662,14 +13809,14 @@ var reset_exports = {};
|
|
|
13662
13809
|
__export(reset_exports, {
|
|
13663
13810
|
default: () => reset_default
|
|
13664
13811
|
});
|
|
13665
|
-
var
|
|
13812
|
+
var command38, reset_default;
|
|
13666
13813
|
var init_reset = __esm({
|
|
13667
13814
|
"src/commands/sandbox/reset.ts"() {
|
|
13668
13815
|
"use strict";
|
|
13669
13816
|
init_exit_codes();
|
|
13670
13817
|
init_http();
|
|
13671
13818
|
init_shared();
|
|
13672
|
-
|
|
13819
|
+
command38 = {
|
|
13673
13820
|
resource: "sandbox",
|
|
13674
13821
|
action: "reset",
|
|
13675
13822
|
summary: "Reset your sandbox to its seed data",
|
|
@@ -13687,16 +13834,16 @@ var init_reset = __esm({
|
|
|
13687
13834
|
return ExitCode.Ok;
|
|
13688
13835
|
}
|
|
13689
13836
|
};
|
|
13690
|
-
reset_default =
|
|
13837
|
+
reset_default = command38;
|
|
13691
13838
|
}
|
|
13692
13839
|
});
|
|
13693
13840
|
|
|
13694
13841
|
// src/commands/sandbox/index.ts
|
|
13695
|
-
var
|
|
13842
|
+
var actions22;
|
|
13696
13843
|
var init_sandbox2 = __esm({
|
|
13697
13844
|
"src/commands/sandbox/index.ts"() {
|
|
13698
13845
|
"use strict";
|
|
13699
|
-
|
|
13846
|
+
actions22 = {
|
|
13700
13847
|
create: () => Promise.resolve().then(() => (init_create(), create_exports)).then((m) => m.default),
|
|
13701
13848
|
delete: () => Promise.resolve().then(() => (init_delete(), delete_exports)).then((m) => m.default),
|
|
13702
13849
|
key: () => Promise.resolve().then(() => (init_key(), key_exports)).then((m) => m.default),
|
|
@@ -13707,11 +13854,11 @@ var init_sandbox2 = __esm({
|
|
|
13707
13854
|
});
|
|
13708
13855
|
|
|
13709
13856
|
// src/commands/skill/index.ts
|
|
13710
|
-
var
|
|
13857
|
+
var actions23;
|
|
13711
13858
|
var init_skill = __esm({
|
|
13712
13859
|
"src/commands/skill/index.ts"() {
|
|
13713
13860
|
"use strict";
|
|
13714
|
-
|
|
13861
|
+
actions23 = {
|
|
13715
13862
|
install: () => Promise.resolve().then(() => (init_install(), install_exports)).then((m) => m.default)
|
|
13716
13863
|
};
|
|
13717
13864
|
}
|
|
@@ -13947,7 +14094,7 @@ __export(pull_exports, {
|
|
|
13947
14094
|
});
|
|
13948
14095
|
import { mkdir, writeFile as writeFile4 } from "node:fs/promises";
|
|
13949
14096
|
import { dirname as dirname2, resolve as resolve11 } from "node:path";
|
|
13950
|
-
var
|
|
14097
|
+
var command39, pull_default;
|
|
13951
14098
|
var init_pull = __esm({
|
|
13952
14099
|
"src/commands/studio/pull.ts"() {
|
|
13953
14100
|
"use strict";
|
|
@@ -13957,7 +14104,7 @@ var init_pull = __esm({
|
|
|
13957
14104
|
init_common2();
|
|
13958
14105
|
init_folder();
|
|
13959
14106
|
init_transfer2();
|
|
13960
|
-
|
|
14107
|
+
command39 = {
|
|
13961
14108
|
resource: "studio",
|
|
13962
14109
|
action: "pull",
|
|
13963
14110
|
summary: "Write a template version's files to a folder",
|
|
@@ -14004,7 +14151,7 @@ var init_pull = __esm({
|
|
|
14004
14151
|
return ExitCode.Ok;
|
|
14005
14152
|
}
|
|
14006
14153
|
};
|
|
14007
|
-
pull_default =
|
|
14154
|
+
pull_default = command39;
|
|
14008
14155
|
}
|
|
14009
14156
|
});
|
|
14010
14157
|
|
|
@@ -14037,7 +14184,7 @@ var push_exports = {};
|
|
|
14037
14184
|
__export(push_exports, {
|
|
14038
14185
|
default: () => push_default
|
|
14039
14186
|
});
|
|
14040
|
-
var BUILT_BY, DEFAULT_MESSAGE,
|
|
14187
|
+
var BUILT_BY, DEFAULT_MESSAGE, command40, push_default;
|
|
14041
14188
|
var init_push = __esm({
|
|
14042
14189
|
"src/commands/studio/push.ts"() {
|
|
14043
14190
|
"use strict";
|
|
@@ -14049,7 +14196,7 @@ var init_push = __esm({
|
|
|
14049
14196
|
init_read();
|
|
14050
14197
|
BUILT_BY = "customer_agent";
|
|
14051
14198
|
DEFAULT_MESSAGE = "Pushed with the Kenso CLI";
|
|
14052
|
-
|
|
14199
|
+
command40 = {
|
|
14053
14200
|
resource: "studio",
|
|
14054
14201
|
action: "push",
|
|
14055
14202
|
summary: "Save a folder's files to a template's draft and print the validation",
|
|
@@ -14141,7 +14288,7 @@ var init_push = __esm({
|
|
|
14141
14288
|
);
|
|
14142
14289
|
}
|
|
14143
14290
|
};
|
|
14144
|
-
push_default =
|
|
14291
|
+
push_default = command40;
|
|
14145
14292
|
}
|
|
14146
14293
|
});
|
|
14147
14294
|
|
|
@@ -14150,7 +14297,7 @@ var validate_exports = {};
|
|
|
14150
14297
|
__export(validate_exports, {
|
|
14151
14298
|
default: () => validate_default
|
|
14152
14299
|
});
|
|
14153
|
-
var
|
|
14300
|
+
var command41, validate_default;
|
|
14154
14301
|
var init_validate = __esm({
|
|
14155
14302
|
"src/commands/studio/validate.ts"() {
|
|
14156
14303
|
"use strict";
|
|
@@ -14159,7 +14306,7 @@ var init_validate = __esm({
|
|
|
14159
14306
|
init_columns();
|
|
14160
14307
|
init_common2();
|
|
14161
14308
|
init_read();
|
|
14162
|
-
|
|
14309
|
+
command41 = {
|
|
14163
14310
|
resource: "studio",
|
|
14164
14311
|
action: "validate",
|
|
14165
14312
|
summary: "Validate a folder's files against a template without saving them",
|
|
@@ -14188,7 +14335,7 @@ var init_validate = __esm({
|
|
|
14188
14335
|
throw validationFailed(validation, "The files have validation errors", commandLine2(ctx, "studio validate", args));
|
|
14189
14336
|
}
|
|
14190
14337
|
};
|
|
14191
|
-
validate_default =
|
|
14338
|
+
validate_default = command41;
|
|
14192
14339
|
}
|
|
14193
14340
|
});
|
|
14194
14341
|
|
|
@@ -14237,7 +14384,7 @@ function accountIds(value) {
|
|
|
14237
14384
|
}
|
|
14238
14385
|
return ids2.map(Number);
|
|
14239
14386
|
}
|
|
14240
|
-
var SHOWN,
|
|
14387
|
+
var SHOWN, command42, preview_default;
|
|
14241
14388
|
var init_preview = __esm({
|
|
14242
14389
|
"src/commands/studio/preview.ts"() {
|
|
14243
14390
|
"use strict";
|
|
@@ -14249,7 +14396,7 @@ var init_preview = __esm({
|
|
|
14249
14396
|
init_common2();
|
|
14250
14397
|
init_folder();
|
|
14251
14398
|
SHOWN = 5;
|
|
14252
|
-
|
|
14399
|
+
command42 = {
|
|
14253
14400
|
resource: "studio",
|
|
14254
14401
|
action: "preview",
|
|
14255
14402
|
summary: "Render a saved version for up to 3 accounts; for local edits, studio push them to the draft first",
|
|
@@ -14298,7 +14445,7 @@ var init_preview = __esm({
|
|
|
14298
14445
|
return ExitCode.Ok;
|
|
14299
14446
|
}
|
|
14300
14447
|
};
|
|
14301
|
-
preview_default =
|
|
14448
|
+
preview_default = command42;
|
|
14302
14449
|
}
|
|
14303
14450
|
});
|
|
14304
14451
|
|
|
@@ -14499,7 +14646,7 @@ function estimateOutput(templateId, target, estimate2) {
|
|
|
14499
14646
|
...target.campaignId !== void 0 ? { estimateNote: "An upper bound: it counts one page per lead, and a campaign run builds one page per company." } : {}
|
|
14500
14647
|
};
|
|
14501
14648
|
}
|
|
14502
|
-
var COMMAND6, sha2562,
|
|
14649
|
+
var COMMAND6, sha2562, command43, fill_default;
|
|
14503
14650
|
var init_fill = __esm({
|
|
14504
14651
|
"src/commands/studio/fill.ts"() {
|
|
14505
14652
|
"use strict";
|
|
@@ -14515,7 +14662,7 @@ var init_fill = __esm({
|
|
|
14515
14662
|
init_fill_runs();
|
|
14516
14663
|
COMMAND6 = "studio fill";
|
|
14517
14664
|
sha2562 = (data) => createHash8("sha256").update(data).digest("hex");
|
|
14518
|
-
|
|
14665
|
+
command43 = {
|
|
14519
14666
|
resource: "studio",
|
|
14520
14667
|
action: "fill",
|
|
14521
14668
|
summary: "Fill a template on many accounts or campaign leads (estimate first)",
|
|
@@ -14575,16 +14722,16 @@ var init_fill = __esm({
|
|
|
14575
14722
|
return outcome.exitCode;
|
|
14576
14723
|
}
|
|
14577
14724
|
};
|
|
14578
|
-
fill_default =
|
|
14725
|
+
fill_default = command43;
|
|
14579
14726
|
}
|
|
14580
14727
|
});
|
|
14581
14728
|
|
|
14582
14729
|
// src/commands/studio/index.ts
|
|
14583
|
-
var
|
|
14730
|
+
var actions24;
|
|
14584
14731
|
var init_studio2 = __esm({
|
|
14585
14732
|
"src/commands/studio/index.ts"() {
|
|
14586
14733
|
"use strict";
|
|
14587
|
-
|
|
14734
|
+
actions24 = {
|
|
14588
14735
|
pull: () => Promise.resolve().then(() => (init_pull(), pull_exports)).then((m) => m.default),
|
|
14589
14736
|
push: () => Promise.resolve().then(() => (init_push(), push_exports)).then((m) => m.default),
|
|
14590
14737
|
validate: () => Promise.resolve().then(() => (init_validate(), validate_exports)).then((m) => m.default),
|
|
@@ -14726,7 +14873,7 @@ function readBody(req) {
|
|
|
14726
14873
|
function reply(res, status, body2) {
|
|
14727
14874
|
res.writeHead(status, { "content-type": "application/json" }).end(JSON.stringify(body2));
|
|
14728
14875
|
}
|
|
14729
|
-
var MIN_POLL_MS, MAX_POLL_MS, MAX_TRIGGER_BYTES,
|
|
14876
|
+
var MIN_POLL_MS, MAX_POLL_MS, MAX_TRIGGER_BYTES, command44, listen_default;
|
|
14730
14877
|
var init_listen = __esm({
|
|
14731
14878
|
"src/commands/webhooks/listen.ts"() {
|
|
14732
14879
|
"use strict";
|
|
@@ -14737,7 +14884,7 @@ var init_listen = __esm({
|
|
|
14737
14884
|
MIN_POLL_MS = 1e3;
|
|
14738
14885
|
MAX_POLL_MS = 6e4;
|
|
14739
14886
|
MAX_TRIGGER_BYTES = 1e6;
|
|
14740
|
-
|
|
14887
|
+
command44 = {
|
|
14741
14888
|
resource: "webhooks",
|
|
14742
14889
|
action: "listen",
|
|
14743
14890
|
summary: "Stream the workspace's events and forward them, signed, to a local handler",
|
|
@@ -14843,7 +14990,7 @@ var init_listen = __esm({
|
|
|
14843
14990
|
return ExitCode.Ok;
|
|
14844
14991
|
}
|
|
14845
14992
|
};
|
|
14846
|
-
listen_default =
|
|
14993
|
+
listen_default = command44;
|
|
14847
14994
|
}
|
|
14848
14995
|
});
|
|
14849
14996
|
|
|
@@ -14862,7 +15009,7 @@ function notRunning() {
|
|
|
14862
15009
|
next: LISTEN_NEXT
|
|
14863
15010
|
});
|
|
14864
15011
|
}
|
|
14865
|
-
var LISTEN_NEXT,
|
|
15012
|
+
var LISTEN_NEXT, command45, trigger_default;
|
|
14866
15013
|
var init_trigger = __esm({
|
|
14867
15014
|
"src/commands/webhooks/trigger.ts"() {
|
|
14868
15015
|
"use strict";
|
|
@@ -14871,7 +15018,7 @@ var init_trigger = __esm({
|
|
|
14871
15018
|
init_http();
|
|
14872
15019
|
init_local();
|
|
14873
15020
|
LISTEN_NEXT = "kenso webhooks listen --forward-to http://localhost:3000/hook";
|
|
14874
|
-
|
|
15021
|
+
command45 = {
|
|
14875
15022
|
resource: "webhooks",
|
|
14876
15023
|
action: "trigger",
|
|
14877
15024
|
summary: "Send a sample event of one type through the running kenso webhooks listen",
|
|
@@ -14928,16 +15075,16 @@ var init_trigger = __esm({
|
|
|
14928
15075
|
return ExitCode.Ok;
|
|
14929
15076
|
}
|
|
14930
15077
|
};
|
|
14931
|
-
trigger_default =
|
|
15078
|
+
trigger_default = command45;
|
|
14932
15079
|
}
|
|
14933
15080
|
});
|
|
14934
15081
|
|
|
14935
15082
|
// src/commands/webhooks/index.ts
|
|
14936
|
-
var
|
|
15083
|
+
var actions25;
|
|
14937
15084
|
var init_webhooks2 = __esm({
|
|
14938
15085
|
"src/commands/webhooks/index.ts"() {
|
|
14939
15086
|
"use strict";
|
|
14940
|
-
|
|
15087
|
+
actions25 = {
|
|
14941
15088
|
listen: () => Promise.resolve().then(() => (init_listen(), listen_exports)).then((m) => m.default),
|
|
14942
15089
|
trigger: () => Promise.resolve().then(() => (init_trigger(), trigger_exports)).then((m) => m.default)
|
|
14943
15090
|
};
|
|
@@ -15132,14 +15279,14 @@ var status_exports3 = {};
|
|
|
15132
15279
|
__export(status_exports3, {
|
|
15133
15280
|
default: () => status_default3
|
|
15134
15281
|
});
|
|
15135
|
-
var
|
|
15282
|
+
var command46, status_default3;
|
|
15136
15283
|
var init_status3 = __esm({
|
|
15137
15284
|
"src/commands/work/status.ts"() {
|
|
15138
15285
|
"use strict";
|
|
15139
15286
|
init_exit_codes();
|
|
15140
15287
|
init_http();
|
|
15141
15288
|
init_common3();
|
|
15142
|
-
|
|
15289
|
+
command46 = {
|
|
15143
15290
|
resource: "work",
|
|
15144
15291
|
action: "status",
|
|
15145
15292
|
summary: "Show the Kenso AI work waiting for your own agent, per kind",
|
|
@@ -15173,7 +15320,7 @@ var init_status3 = __esm({
|
|
|
15173
15320
|
return ExitCode.Ok;
|
|
15174
15321
|
}
|
|
15175
15322
|
};
|
|
15176
|
-
status_default3 =
|
|
15323
|
+
status_default3 = command46;
|
|
15177
15324
|
}
|
|
15178
15325
|
});
|
|
15179
15326
|
|
|
@@ -15305,9 +15452,9 @@ var init_files = __esm({
|
|
|
15305
15452
|
import { execFile, spawnSync as spawnSync2 } from "node:child_process";
|
|
15306
15453
|
import { readFileSync as readFileSync12 } from "node:fs";
|
|
15307
15454
|
import { isAbsolute as isAbsolute2 } from "node:path";
|
|
15308
|
-
function sudoArgs(user,
|
|
15455
|
+
function sudoArgs(user, command53, args, keep = [], set = {}) {
|
|
15309
15456
|
const assignments = Object.entries(set).map(([name, value]) => `${name}=${value}`);
|
|
15310
|
-
return ["-n", "-u", user, "-H", ...keep.length > 0 ? [`--preserve-env=${keep.join(",")}`] : [], ...assignments, "--",
|
|
15457
|
+
return ["-n", "-u", user, "-H", ...keep.length > 0 ? [`--preserve-env=${keep.join(",")}`] : [], ...assignments, "--", command53, ...args];
|
|
15311
15458
|
}
|
|
15312
15459
|
function agentKensoEnv(opts) {
|
|
15313
15460
|
return {
|
|
@@ -15317,12 +15464,12 @@ function agentKensoEnv(opts) {
|
|
|
15317
15464
|
AI_AGENT: opts.agentName
|
|
15318
15465
|
};
|
|
15319
15466
|
}
|
|
15320
|
-
function sudoExec(user,
|
|
15467
|
+
function sudoExec(user, command53, args, opts = {}) {
|
|
15321
15468
|
const [sudo = "/usr/bin/sudo", ...lead] = user.sudo;
|
|
15322
15469
|
return new Promise((resolve16) => {
|
|
15323
15470
|
execFile(
|
|
15324
15471
|
sudo,
|
|
15325
|
-
[...lead, ...sudoArgs(user.name,
|
|
15472
|
+
[...lead, ...sudoArgs(user.name, command53, args)],
|
|
15326
15473
|
{ env: { PATH: SUDO_PATH }, cwd: "/", timeout: opts.timeoutMs ?? PROBE_TIMEOUT_MS, maxBuffer: opts.maxBuffer ?? 1024 * 1024, encoding: "utf8", windowsHide: true, shell: false },
|
|
15327
15474
|
(err, stdout, stderr) => {
|
|
15328
15475
|
const code = err ? err.code : 0;
|
|
@@ -15432,9 +15579,9 @@ var init_folder2 = __esm({
|
|
|
15432
15579
|
init_redact();
|
|
15433
15580
|
init_agent_user();
|
|
15434
15581
|
WorkRunFolder = class {
|
|
15435
|
-
constructor(ctx,
|
|
15582
|
+
constructor(ctx, command53, args, outDir, shared = false) {
|
|
15436
15583
|
this.ctx = ctx;
|
|
15437
|
-
this.command =
|
|
15584
|
+
this.command = command53;
|
|
15438
15585
|
this.args = args;
|
|
15439
15586
|
this.outDir = outDir;
|
|
15440
15587
|
this.shared = shared;
|
|
@@ -15549,7 +15696,7 @@ var pull_exports2 = {};
|
|
|
15549
15696
|
__export(pull_exports2, {
|
|
15550
15697
|
default: () => pull_default2
|
|
15551
15698
|
});
|
|
15552
|
-
var MAX_FILES,
|
|
15699
|
+
var MAX_FILES, command47, pull_default2;
|
|
15553
15700
|
var init_pull2 = __esm({
|
|
15554
15701
|
"src/commands/work/pull.ts"() {
|
|
15555
15702
|
"use strict";
|
|
@@ -15558,7 +15705,7 @@ var init_pull2 = __esm({
|
|
|
15558
15705
|
init_common3();
|
|
15559
15706
|
init_folder2();
|
|
15560
15707
|
MAX_FILES = 100;
|
|
15561
|
-
|
|
15708
|
+
command47 = {
|
|
15562
15709
|
resource: "work",
|
|
15563
15710
|
action: "pull",
|
|
15564
15711
|
summary: "Claim waiting work into local work files, to answer by hand",
|
|
@@ -15636,7 +15783,7 @@ var init_pull2 = __esm({
|
|
|
15636
15783
|
return interrupted7 ? ExitCode.Interrupted : ExitCode.Ok;
|
|
15637
15784
|
}
|
|
15638
15785
|
};
|
|
15639
|
-
pull_default2 =
|
|
15786
|
+
pull_default2 = command47;
|
|
15640
15787
|
}
|
|
15641
15788
|
});
|
|
15642
15789
|
|
|
@@ -15778,7 +15925,7 @@ __export(submit_exports, {
|
|
|
15778
15925
|
default: () => submit_default
|
|
15779
15926
|
});
|
|
15780
15927
|
import { resolve as resolve14 } from "node:path";
|
|
15781
|
-
var
|
|
15928
|
+
var command48, submit_default;
|
|
15782
15929
|
var init_submit = __esm({
|
|
15783
15930
|
"src/commands/work/submit.ts"() {
|
|
15784
15931
|
"use strict";
|
|
@@ -15787,7 +15934,7 @@ var init_submit = __esm({
|
|
|
15787
15934
|
init_files();
|
|
15788
15935
|
init_answers();
|
|
15789
15936
|
init_common3();
|
|
15790
|
-
|
|
15937
|
+
command48 = {
|
|
15791
15938
|
resource: "work",
|
|
15792
15939
|
action: "submit",
|
|
15793
15940
|
summary: "Send answers files to Kenso and write each one's results",
|
|
@@ -15819,7 +15966,7 @@ var init_submit = __esm({
|
|
|
15819
15966
|
return totals.rejected > 0 ? ExitCode.Partial : ExitCode.Ok;
|
|
15820
15967
|
}
|
|
15821
15968
|
};
|
|
15822
|
-
submit_default =
|
|
15969
|
+
submit_default = command48;
|
|
15823
15970
|
}
|
|
15824
15971
|
});
|
|
15825
15972
|
|
|
@@ -15840,7 +15987,7 @@ function claimIdOf(arg) {
|
|
|
15840
15987
|
if (!CLAIM_ID.test(arg)) throw usageError(`"${arg}" is neither a claim id nor a work file.`, { field: "claim", hint: "Claim ids look like awc_8fK2..." });
|
|
15841
15988
|
return arg;
|
|
15842
15989
|
}
|
|
15843
|
-
var CLAIM_ID,
|
|
15990
|
+
var CLAIM_ID, command49, release_default;
|
|
15844
15991
|
var init_release = __esm({
|
|
15845
15992
|
"src/commands/work/release.ts"() {
|
|
15846
15993
|
"use strict";
|
|
@@ -15849,7 +15996,7 @@ var init_release = __esm({
|
|
|
15849
15996
|
init_files();
|
|
15850
15997
|
init_common3();
|
|
15851
15998
|
CLAIM_ID = /^[A-Za-z0-9_-]{1,64}$/;
|
|
15852
|
-
|
|
15999
|
+
command49 = {
|
|
15853
16000
|
resource: "work",
|
|
15854
16001
|
action: "release",
|
|
15855
16002
|
summary: "Give claimed work back to the queue now",
|
|
@@ -15868,7 +16015,7 @@ var init_release = __esm({
|
|
|
15868
16015
|
return ExitCode.Ok;
|
|
15869
16016
|
}
|
|
15870
16017
|
};
|
|
15871
|
-
release_default =
|
|
16018
|
+
release_default = command49;
|
|
15872
16019
|
}
|
|
15873
16020
|
});
|
|
15874
16021
|
|
|
@@ -16207,12 +16354,12 @@ function plain(text4) {
|
|
|
16207
16354
|
return text4.replace(/\x1b\[[0-9;?]*[A-Za-z]/g, "");
|
|
16208
16355
|
}
|
|
16209
16356
|
function runStatus(bin, args, env, adapter, runAs) {
|
|
16210
|
-
const
|
|
16357
|
+
const command53 = runAs ? runAs.sudo[0] ?? "/usr/bin/sudo" : bin;
|
|
16211
16358
|
const commandArgs2 = runAs ? [...runAs.sudo.slice(1), ...sudoArgs(runAs.name, bin, args)] : args;
|
|
16212
16359
|
const options = runAs ? { env: { PATH: SUDO_PATH }, cwd: "/" } : { env: childEnv(env, adapter) };
|
|
16213
16360
|
return new Promise((resolve16) => {
|
|
16214
16361
|
execFile2(
|
|
16215
|
-
|
|
16362
|
+
command53,
|
|
16216
16363
|
commandArgs2,
|
|
16217
16364
|
{ ...options, timeout: STATUS_TIMEOUT_MS, maxBuffer: 1024 * 1024, windowsHide: true, shell: false },
|
|
16218
16365
|
(err, stdout, stderr) => {
|
|
@@ -17294,7 +17441,7 @@ var run_exports3 = {};
|
|
|
17294
17441
|
__export(run_exports3, {
|
|
17295
17442
|
default: () => run_default2
|
|
17296
17443
|
});
|
|
17297
|
-
var FAILURES_IN_A_ROW,
|
|
17444
|
+
var FAILURES_IN_A_ROW, command50, run_default2;
|
|
17298
17445
|
var init_run3 = __esm({
|
|
17299
17446
|
"src/commands/work/run.ts"() {
|
|
17300
17447
|
"use strict";
|
|
@@ -17315,7 +17462,7 @@ var init_run3 = __esm({
|
|
|
17315
17462
|
init_folder2();
|
|
17316
17463
|
init_stop();
|
|
17317
17464
|
FAILURES_IN_A_ROW = 3;
|
|
17318
|
-
|
|
17465
|
+
command50 = {
|
|
17319
17466
|
resource: "work",
|
|
17320
17467
|
action: "run",
|
|
17321
17468
|
summary: "Run your own coding agent on the waiting work until the queue is empty",
|
|
@@ -17640,16 +17787,16 @@ var init_run3 = __esm({
|
|
|
17640
17787
|
return exitCodeFor(reason, totals.rejected > 0 || jobsFailed > 0);
|
|
17641
17788
|
}
|
|
17642
17789
|
};
|
|
17643
|
-
run_default2 =
|
|
17790
|
+
run_default2 = command50;
|
|
17644
17791
|
}
|
|
17645
17792
|
});
|
|
17646
17793
|
|
|
17647
17794
|
// src/commands/work/index.ts
|
|
17648
|
-
var
|
|
17795
|
+
var actions26;
|
|
17649
17796
|
var init_work2 = __esm({
|
|
17650
17797
|
"src/commands/work/index.ts"() {
|
|
17651
17798
|
"use strict";
|
|
17652
|
-
|
|
17799
|
+
actions26 = {
|
|
17653
17800
|
status: () => Promise.resolve().then(() => (init_status3(), status_exports3)).then((m) => m.default),
|
|
17654
17801
|
pull: () => Promise.resolve().then(() => (init_pull2(), pull_exports2)).then((m) => m.default),
|
|
17655
17802
|
submit: () => Promise.resolve().then(() => (init_submit(), submit_exports)).then((m) => m.default),
|
|
@@ -17673,14 +17820,14 @@ function parseLimit(value) {
|
|
|
17673
17820
|
}
|
|
17674
17821
|
return limit;
|
|
17675
17822
|
}
|
|
17676
|
-
var MAX_LIMIT,
|
|
17823
|
+
var MAX_LIMIT, command51, list_default3;
|
|
17677
17824
|
var init_list3 = __esm({
|
|
17678
17825
|
"src/commands/workspace/list.ts"() {
|
|
17679
17826
|
"use strict";
|
|
17680
17827
|
init_errors();
|
|
17681
17828
|
init_exit_codes();
|
|
17682
17829
|
MAX_LIMIT = 200;
|
|
17683
|
-
|
|
17830
|
+
command51 = {
|
|
17684
17831
|
resource: "workspace",
|
|
17685
17832
|
action: "list",
|
|
17686
17833
|
summary: "List the workspaces your key can use",
|
|
@@ -17708,7 +17855,7 @@ var init_list3 = __esm({
|
|
|
17708
17855
|
return ExitCode.Ok;
|
|
17709
17856
|
}
|
|
17710
17857
|
};
|
|
17711
|
-
list_default3 =
|
|
17858
|
+
list_default3 = command51;
|
|
17712
17859
|
}
|
|
17713
17860
|
});
|
|
17714
17861
|
|
|
@@ -17717,7 +17864,7 @@ var use_exports = {};
|
|
|
17717
17864
|
__export(use_exports, {
|
|
17718
17865
|
default: () => use_default
|
|
17719
17866
|
});
|
|
17720
|
-
var
|
|
17867
|
+
var command52, use_default;
|
|
17721
17868
|
var init_use = __esm({
|
|
17722
17869
|
"src/commands/workspace/use.ts"() {
|
|
17723
17870
|
"use strict";
|
|
@@ -17725,7 +17872,7 @@ var init_use = __esm({
|
|
|
17725
17872
|
init_errors();
|
|
17726
17873
|
init_exit_codes();
|
|
17727
17874
|
init_http();
|
|
17728
|
-
|
|
17875
|
+
command52 = {
|
|
17729
17876
|
resource: "workspace",
|
|
17730
17877
|
action: "use",
|
|
17731
17878
|
summary: "Set the profile's default workspace",
|
|
@@ -17782,16 +17929,16 @@ var init_use = __esm({
|
|
|
17782
17929
|
return ExitCode.Ok;
|
|
17783
17930
|
}
|
|
17784
17931
|
};
|
|
17785
|
-
use_default =
|
|
17932
|
+
use_default = command52;
|
|
17786
17933
|
}
|
|
17787
17934
|
});
|
|
17788
17935
|
|
|
17789
17936
|
// src/commands/workspace/index.ts
|
|
17790
|
-
var
|
|
17937
|
+
var actions27;
|
|
17791
17938
|
var init_workspace = __esm({
|
|
17792
17939
|
"src/commands/workspace/index.ts"() {
|
|
17793
17940
|
"use strict";
|
|
17794
|
-
|
|
17941
|
+
actions27 = {
|
|
17795
17942
|
list: () => Promise.resolve().then(() => (init_list3(), list_exports3)).then((m) => m.default),
|
|
17796
17943
|
use: () => Promise.resolve().then(() => (init_use(), use_exports)).then((m) => m.default)
|
|
17797
17944
|
};
|
|
@@ -17823,6 +17970,7 @@ var init_registry = __esm({
|
|
|
17823
17970
|
init_describe2();
|
|
17824
17971
|
init_docs2();
|
|
17825
17972
|
init_doctor();
|
|
17973
|
+
init_export3();
|
|
17826
17974
|
init_jobs2();
|
|
17827
17975
|
init_logs();
|
|
17828
17976
|
init_mcp();
|
|
@@ -17850,23 +17998,24 @@ var init_registry = __esm({
|
|
|
17850
17998
|
describe: actions10,
|
|
17851
17999
|
docs: actions11,
|
|
17852
18000
|
doctor: actions12,
|
|
17853
|
-
|
|
18001
|
+
export: actions13,
|
|
18002
|
+
jobs: actions14,
|
|
17854
18003
|
login: topLevel("login", actions4.login, "kenso auth login"),
|
|
17855
18004
|
logout: topLevel("logout", actions4.logout, "kenso auth logout"),
|
|
17856
|
-
logs:
|
|
17857
|
-
mcp:
|
|
17858
|
-
opportunities:
|
|
17859
|
-
people:
|
|
17860
|
-
pipelines:
|
|
17861
|
-
reports:
|
|
17862
|
-
runs:
|
|
17863
|
-
sandbox:
|
|
17864
|
-
skill:
|
|
17865
|
-
studio:
|
|
17866
|
-
webhooks:
|
|
18005
|
+
logs: actions15,
|
|
18006
|
+
mcp: actions16,
|
|
18007
|
+
opportunities: actions17,
|
|
18008
|
+
people: actions18,
|
|
18009
|
+
pipelines: actions19,
|
|
18010
|
+
reports: actions20,
|
|
18011
|
+
runs: actions21,
|
|
18012
|
+
sandbox: actions22,
|
|
18013
|
+
skill: actions23,
|
|
18014
|
+
studio: actions24,
|
|
18015
|
+
webhooks: actions25,
|
|
17867
18016
|
whoami: topLevel("whoami", actions4.status, "kenso auth status"),
|
|
17868
|
-
work:
|
|
17869
|
-
workspace:
|
|
18017
|
+
work: actions26,
|
|
18018
|
+
workspace: actions27
|
|
17870
18019
|
};
|
|
17871
18020
|
resourceAliases = { leads: "contacts" };
|
|
17872
18021
|
}
|
|
@@ -18003,8 +18152,8 @@ async function renderTopHelp(opts) {
|
|
|
18003
18152
|
names.push(withPositionals(spec, spec.action));
|
|
18004
18153
|
groups.set(hint, names);
|
|
18005
18154
|
}
|
|
18006
|
-
const
|
|
18007
|
-
if (
|
|
18155
|
+
const actions29 = [...groups.entries()].map(([hint, names]) => `${names.join(", ")}${hint}`);
|
|
18156
|
+
if (actions29.length > 0) rows.push([resource, actions29.join(", ")]);
|
|
18008
18157
|
}
|
|
18009
18158
|
const at = 4 + Math.min(22, Math.max(0, ...rows.map(([left]) => left.length)));
|
|
18010
18159
|
lines.push(
|
|
@@ -18017,7 +18166,7 @@ async function renderTopHelp(opts) {
|
|
|
18017
18166
|
const [area = "", action = ""] = name.split(" ");
|
|
18018
18167
|
byArea.set(area, [...byArea.get(area) ?? [], action]);
|
|
18019
18168
|
}
|
|
18020
|
-
const named = [...byArea.entries()].map(([area,
|
|
18169
|
+
const named = [...byArea.entries()].map(([area, actions29]) => `${area} ${actions29.join("|")}`);
|
|
18021
18170
|
lines.push(wrap(`Beta, hidden here but they run (the server decides): ${named.join(", ")}.`, " "));
|
|
18022
18171
|
}
|
|
18023
18172
|
const generated = await listGenerated({ features: opts.allCommands ? [] : getFeatures, env: opts.env });
|
|
@@ -18025,13 +18174,13 @@ async function renderTopHelp(opts) {
|
|
|
18025
18174
|
if (visible.length > 0) {
|
|
18026
18175
|
const byResource = /* @__PURE__ */ new Map();
|
|
18027
18176
|
for (const g of visible) {
|
|
18028
|
-
const
|
|
18029
|
-
|
|
18030
|
-
byResource.set(g.resource,
|
|
18177
|
+
const actions29 = byResource.get(g.resource) ?? [];
|
|
18178
|
+
actions29.push(`${g.action}${g.beta ? " (beta)" : ""}`);
|
|
18179
|
+
byResource.set(g.resource, actions29);
|
|
18031
18180
|
}
|
|
18032
18181
|
const sorted2 = [...byResource.entries()].sort(([a], [b]) => a.localeCompare(b));
|
|
18033
18182
|
if (opts.allCommands) {
|
|
18034
|
-
const generatedRows = sorted2.map(([resource,
|
|
18183
|
+
const generatedRows = sorted2.map(([resource, actions29]) => [resource, actions29.sort().join(", ")]);
|
|
18035
18184
|
lines.push("", "API resources (kenso <resource> <action>):", columns(generatedRows));
|
|
18036
18185
|
} else {
|
|
18037
18186
|
const names = new Set(sorted2.map(([resource]) => resource));
|
|
@@ -18347,8 +18496,8 @@ function startUpdateNotice(argv, opts = {}) {
|
|
|
18347
18496
|
if (!found) return;
|
|
18348
18497
|
writeCheck(file, { checkedAt: new Date(now).toISOString(), latest: found });
|
|
18349
18498
|
if (isNewer(found, version)) {
|
|
18350
|
-
const
|
|
18351
|
-
stderr.write(`kenso ${found} is out (you have ${version}): ${
|
|
18499
|
+
const command53 = updateCommand(install, opts.platform ?? process.platform);
|
|
18500
|
+
stderr.write(`kenso ${found} is out (you have ${version}): ${command53}
|
|
18352
18501
|
Turn this off with KENSO_NO_UPDATE_NOTIFIER=1.
|
|
18353
18502
|
`);
|
|
18354
18503
|
}
|
|
@@ -18390,7 +18539,7 @@ function resources() {
|
|
|
18390
18539
|
const names = Object.entries(handWritten).filter(([, area]) => Object.keys(area).length > 0).map(([resource]) => resource);
|
|
18391
18540
|
return sorted([...names, ...Object.keys(resourceAliases), ...loadManifest().operations.map((op) => op.resource)]);
|
|
18392
18541
|
}
|
|
18393
|
-
function
|
|
18542
|
+
function actions28(resource) {
|
|
18394
18543
|
const own = Object.keys(handWritten[resource] ?? {}).filter((action) => action !== "");
|
|
18395
18544
|
return sorted([...own, ...loadManifest().operations.filter((op) => op.resource === resource).map((op) => op.action)]);
|
|
18396
18545
|
}
|
|
@@ -18455,7 +18604,7 @@ async function completions(words, globals) {
|
|
|
18455
18604
|
return flagsOf2(spec, globals, positionals.length === 0);
|
|
18456
18605
|
}
|
|
18457
18606
|
if (positionals.length === 0) return resources();
|
|
18458
|
-
if (!spec) return positionals.length === 1 ?
|
|
18607
|
+
if (!spec) return positionals.length === 1 ? actions28(resourceAliases[positionals[0]] ?? positionals[0]) : [];
|
|
18459
18608
|
const given = positionals.length - commandWords;
|
|
18460
18609
|
const declared = spec.positionals ?? [];
|
|
18461
18610
|
if (given < declared.length || declared.at(-1)?.variadic === true) {
|
|
@@ -18549,9 +18698,9 @@ function normalizeBooleans(argv, names, strict) {
|
|
|
18549
18698
|
async function knownCommands() {
|
|
18550
18699
|
const commands = /* @__PURE__ */ new Set();
|
|
18551
18700
|
for (const [resource, area] of Object.entries(handWritten)) {
|
|
18552
|
-
const
|
|
18553
|
-
if (
|
|
18554
|
-
for (const action of
|
|
18701
|
+
const actions29 = Object.keys(area);
|
|
18702
|
+
if (actions29.length > 0) commands.add(resource);
|
|
18703
|
+
for (const action of actions29) commands.add(action ? `${resource} ${action}` : resource);
|
|
18555
18704
|
}
|
|
18556
18705
|
for (const g of await listGenerated({ features: [] })) {
|
|
18557
18706
|
commands.add(g.resource);
|