kenso 0.1.74 → 0.1.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -0
- package/dist/kenso.js +227 -136
- package/dist/operations.json +1 -1
- package/docs/reference.md +25 -5
- 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.75" : "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: command49, createdAt, status } = raw;
|
|
4178
4178
|
if (typeof runId !== "string" || !RUN_ID_PATTERN.test(runId)) return null;
|
|
4179
|
-
if (typeof
|
|
4179
|
+
if (typeof command49 !== "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: command49,
|
|
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(command49, 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 === command49 && (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, command49, args, extra = []) {
|
|
7455
|
+
const parts2 = ["kenso", ...command49.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}`);
|
|
@@ -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: (command49, args) => {
|
|
8980
|
+
const child = nodeSpawn(command49, 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: (command49, args) => {
|
|
10170
|
+
const child = nodeSpawn2(command49, 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, command49, 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 ${command49}.`, { field: name, next: `${command49} --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, command49) {
|
|
10223
|
+
const raw = requireFlag(flags, name, command49);
|
|
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(command49, flags, ctx, extra = []) {
|
|
10244
|
+
const parts2 = [command49];
|
|
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, command49, 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 !== command49 || 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 command49 = `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(`${command49} needs exactly one of ${choices}.`, { field: "ids", next: `${command49} --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);
|
|
@@ -12844,19 +12844,108 @@ var init_people = __esm({
|
|
|
12844
12844
|
}
|
|
12845
12845
|
});
|
|
12846
12846
|
|
|
12847
|
+
// src/commands/reports/run.ts
|
|
12848
|
+
var run_exports2 = {};
|
|
12849
|
+
__export(run_exports2, {
|
|
12850
|
+
default: () => run_default
|
|
12851
|
+
});
|
|
12852
|
+
var REPORTS, command26, run_default;
|
|
12853
|
+
var init_run2 = __esm({
|
|
12854
|
+
"src/commands/reports/run.ts"() {
|
|
12855
|
+
"use strict";
|
|
12856
|
+
init_errors();
|
|
12857
|
+
init_exit_codes();
|
|
12858
|
+
init_http();
|
|
12859
|
+
REPORTS = ["pipeline_by_stage", "won_by_month", "stage_conversion", "time_in_stage", "won_by_source_campaign", "activity_by_member"];
|
|
12860
|
+
command26 = {
|
|
12861
|
+
resource: "reports",
|
|
12862
|
+
action: "run",
|
|
12863
|
+
summary: "Run a stock pipeline report and print its table",
|
|
12864
|
+
description: `Reads GET /v1/reports/{reportKey} and prints one row per bucket: the bucket's label under the dimension's name (stage, closedAt, sourceCampaignId) and each measure under its key (count, sumAmount, weightedAmount, avgAmount). Amounts are in the workspace currency. The report's title, its finding, the days it covers and the totals are printed to stderr. --full prints the whole answer as one object: headline, finding, stats, chart, the stored query, and result with each bucket's filter for opportunities search. Reports: ${REPORTS.join(", ")}; kenso reports list prints the ones your workspace has now.`,
|
|
12865
|
+
flags: {
|
|
12866
|
+
period: {
|
|
12867
|
+
type: "string",
|
|
12868
|
+
description: "this_month, last_month, this_quarter (default), last_quarter, this_year, last_year, last_30_days, last_90_days, a month (2026-03), a quarter (2026-Q1), a year (2026) or a day range (2026-03-01..2026-03-31)"
|
|
12869
|
+
},
|
|
12870
|
+
owner: { type: "string", description: "Only this member's deals (a member id)", aliases: ["owner-member-id"] },
|
|
12871
|
+
"time-zone": { type: "string", description: "IANA zone days start in when you have no app time zone (default UTC)" },
|
|
12872
|
+
full: { type: "boolean", description: "Print the API's whole answer instead of the table" }
|
|
12873
|
+
},
|
|
12874
|
+
positionals: [{ name: "report", required: true, description: `A report key from kenso reports list, such as ${REPORTS.join(", ")}` }],
|
|
12875
|
+
examples: [
|
|
12876
|
+
"kenso reports run pipeline_by_stage",
|
|
12877
|
+
"kenso reports run won_by_month --period this_year --owner 41",
|
|
12878
|
+
"kenso reports run won_by_source_campaign --period 2026-Q4 --full"
|
|
12879
|
+
],
|
|
12880
|
+
beta: { featureGates: { all: ["opportunities", "reports"] } },
|
|
12881
|
+
operationIds: ["reports.get"],
|
|
12882
|
+
async run(ctx, { flags, positionals }) {
|
|
12883
|
+
const report2 = (positionals[0] ?? "").trim();
|
|
12884
|
+
if (!/^[a-z][a-z0-9_]*$/.test(report2)) {
|
|
12885
|
+
throw usageError(`"${report2}" is not a report key. Reports: ${REPORTS.join(", ")}.`, { field: "report", next: "kenso reports list" });
|
|
12886
|
+
}
|
|
12887
|
+
const owner = typeof flags.owner === "string" ? flags.owner.trim() : void 0;
|
|
12888
|
+
if (owner !== void 0 && !/^[1-9]\d*$/.test(owner)) {
|
|
12889
|
+
throw usageError(`--owner must be a member id (got "${owner}").`, { field: "owner", next: "kenso members list" });
|
|
12890
|
+
}
|
|
12891
|
+
const res = await ctx.client.request({
|
|
12892
|
+
method: "GET",
|
|
12893
|
+
path: `/v1/reports/${report2}`,
|
|
12894
|
+
query: {
|
|
12895
|
+
period: typeof flags.period === "string" ? flags.period : void 0,
|
|
12896
|
+
ownerMemberId: owner,
|
|
12897
|
+
timeZone: typeof flags["time-zone"] === "string" ? flags["time-zone"] : void 0
|
|
12898
|
+
},
|
|
12899
|
+
signal: ctx.signal
|
|
12900
|
+
});
|
|
12901
|
+
const data = unwrap(res.body);
|
|
12902
|
+
if (flags.full === true) {
|
|
12903
|
+
ctx.output.object(data);
|
|
12904
|
+
return ExitCode.Ok;
|
|
12905
|
+
}
|
|
12906
|
+
const { result } = data;
|
|
12907
|
+
const names = result.dimensions.map((d) => d.field);
|
|
12908
|
+
ctx.output.info(data.title + (data.period ? ` (${data.period.from} to ${data.period.to})` : ""));
|
|
12909
|
+
ctx.output.info(data.finding);
|
|
12910
|
+
ctx.output.info(`Totals (${result.currency}): ${result.measures.map((m) => `${m.key} ${result.totals[m.key] ?? 0}`).join(", ")}`);
|
|
12911
|
+
await ctx.output.list(
|
|
12912
|
+
result.buckets.map((bucket) => ({
|
|
12913
|
+
...Object.fromEntries(names.map((name, i) => [name, bucket.labels[i] ?? bucket.keys[i] ?? ""])),
|
|
12914
|
+
// A measure a row has no value for (a rate with nothing to divide by) prints as null.
|
|
12915
|
+
...Object.fromEntries(result.measures.map((m) => [m.key, bucket.values[m.key] ?? null]))
|
|
12916
|
+
}))
|
|
12917
|
+
);
|
|
12918
|
+
return ExitCode.Ok;
|
|
12919
|
+
}
|
|
12920
|
+
};
|
|
12921
|
+
run_default = command26;
|
|
12922
|
+
}
|
|
12923
|
+
});
|
|
12924
|
+
|
|
12925
|
+
// src/commands/reports/index.ts
|
|
12926
|
+
var actions17;
|
|
12927
|
+
var init_reports = __esm({
|
|
12928
|
+
"src/commands/reports/index.ts"() {
|
|
12929
|
+
"use strict";
|
|
12930
|
+
actions17 = {
|
|
12931
|
+
run: () => Promise.resolve().then(() => (init_run2(), run_exports2)).then((m) => m.default)
|
|
12932
|
+
};
|
|
12933
|
+
}
|
|
12934
|
+
});
|
|
12935
|
+
|
|
12847
12936
|
// src/commands/runs/list.ts
|
|
12848
12937
|
var list_exports = {};
|
|
12849
12938
|
__export(list_exports, {
|
|
12850
12939
|
default: () => list_default
|
|
12851
12940
|
});
|
|
12852
|
-
var
|
|
12941
|
+
var command27, list_default;
|
|
12853
12942
|
var init_list = __esm({
|
|
12854
12943
|
"src/commands/runs/list.ts"() {
|
|
12855
12944
|
"use strict";
|
|
12856
12945
|
init_runs();
|
|
12857
12946
|
init_errors();
|
|
12858
12947
|
init_exit_codes();
|
|
12859
|
-
|
|
12948
|
+
command27 = {
|
|
12860
12949
|
resource: "runs",
|
|
12861
12950
|
action: "list",
|
|
12862
12951
|
summary: "List batch runs, newest first (finds an interrupted run)",
|
|
@@ -12877,7 +12966,7 @@ var init_list = __esm({
|
|
|
12877
12966
|
return ExitCode.Ok;
|
|
12878
12967
|
}
|
|
12879
12968
|
};
|
|
12880
|
-
list_default =
|
|
12969
|
+
list_default = command27;
|
|
12881
12970
|
}
|
|
12882
12971
|
});
|
|
12883
12972
|
|
|
@@ -12888,7 +12977,7 @@ __export(show_exports, {
|
|
|
12888
12977
|
});
|
|
12889
12978
|
import { existsSync as existsSync7, readFileSync as readFileSync9 } from "node:fs";
|
|
12890
12979
|
import { join as join12 } from "node:path";
|
|
12891
|
-
var FILES,
|
|
12980
|
+
var FILES, command28, show_default;
|
|
12892
12981
|
var init_show = __esm({
|
|
12893
12982
|
"src/commands/runs/show.ts"() {
|
|
12894
12983
|
"use strict";
|
|
@@ -12903,7 +12992,7 @@ var init_show = __esm({
|
|
|
12903
12992
|
["plan", "plan.json"],
|
|
12904
12993
|
["summary", "summary.json"]
|
|
12905
12994
|
];
|
|
12906
|
-
|
|
12995
|
+
command28 = {
|
|
12907
12996
|
resource: "runs",
|
|
12908
12997
|
action: "show",
|
|
12909
12998
|
summary: "Show one batch run and its files",
|
|
@@ -12930,7 +13019,7 @@ var init_show = __esm({
|
|
|
12930
13019
|
return ExitCode.Ok;
|
|
12931
13020
|
}
|
|
12932
13021
|
};
|
|
12933
|
-
show_default =
|
|
13022
|
+
show_default = command28;
|
|
12934
13023
|
}
|
|
12935
13024
|
});
|
|
12936
13025
|
|
|
@@ -12989,14 +13078,14 @@ function resumeArgv(run, globals = {}) {
|
|
|
12989
13078
|
async function sha256(path) {
|
|
12990
13079
|
return createHash5("sha256").update(await readFile9(path)).digest("hex");
|
|
12991
13080
|
}
|
|
12992
|
-
var SKIPPED_KEYS,
|
|
13081
|
+
var SKIPPED_KEYS, command29, resume_default;
|
|
12993
13082
|
var init_resume = __esm({
|
|
12994
13083
|
"src/commands/runs/resume.ts"() {
|
|
12995
13084
|
"use strict";
|
|
12996
13085
|
init_runs();
|
|
12997
13086
|
init_errors();
|
|
12998
13087
|
SKIPPED_KEYS = /* @__PURE__ */ new Set(["positionals", "yes", "dryRun", "dry-run", "help", "version"]);
|
|
12999
|
-
|
|
13088
|
+
command29 = {
|
|
13000
13089
|
resource: "runs",
|
|
13001
13090
|
action: "resume",
|
|
13002
13091
|
summary: "Continue an interrupted batch run (its command with --yes, no dry run)",
|
|
@@ -13051,16 +13140,16 @@ var init_resume = __esm({
|
|
|
13051
13140
|
}
|
|
13052
13141
|
}
|
|
13053
13142
|
};
|
|
13054
|
-
resume_default =
|
|
13143
|
+
resume_default = command29;
|
|
13055
13144
|
}
|
|
13056
13145
|
});
|
|
13057
13146
|
|
|
13058
13147
|
// src/commands/runs/index.ts
|
|
13059
|
-
var
|
|
13148
|
+
var actions18;
|
|
13060
13149
|
var init_runs2 = __esm({
|
|
13061
13150
|
"src/commands/runs/index.ts"() {
|
|
13062
13151
|
"use strict";
|
|
13063
|
-
|
|
13152
|
+
actions18 = {
|
|
13064
13153
|
list: () => Promise.resolve().then(() => (init_list(), list_exports)).then((m) => m.default),
|
|
13065
13154
|
show: () => Promise.resolve().then(() => (init_show(), show_exports)).then((m) => m.default),
|
|
13066
13155
|
resume: () => Promise.resolve().then(() => (init_resume(), resume_exports)).then((m) => m.default)
|
|
@@ -13159,7 +13248,7 @@ var create_exports = {};
|
|
|
13159
13248
|
__export(create_exports, {
|
|
13160
13249
|
default: () => create_default
|
|
13161
13250
|
});
|
|
13162
|
-
var
|
|
13251
|
+
var command30, create_default;
|
|
13163
13252
|
var init_create = __esm({
|
|
13164
13253
|
"src/commands/sandbox/create.ts"() {
|
|
13165
13254
|
"use strict";
|
|
@@ -13167,7 +13256,7 @@ var init_create = __esm({
|
|
|
13167
13256
|
init_exit_codes();
|
|
13168
13257
|
init_http();
|
|
13169
13258
|
init_shared();
|
|
13170
|
-
|
|
13259
|
+
command30 = {
|
|
13171
13260
|
resource: "sandbox",
|
|
13172
13261
|
action: "create",
|
|
13173
13262
|
summary: "Create your developer sandbox and save its test key as the sandbox profile",
|
|
@@ -13209,7 +13298,7 @@ var init_create = __esm({
|
|
|
13209
13298
|
return ExitCode.Ok;
|
|
13210
13299
|
}
|
|
13211
13300
|
};
|
|
13212
|
-
create_default =
|
|
13301
|
+
create_default = command30;
|
|
13213
13302
|
}
|
|
13214
13303
|
});
|
|
13215
13304
|
|
|
@@ -13218,7 +13307,7 @@ var delete_exports = {};
|
|
|
13218
13307
|
__export(delete_exports, {
|
|
13219
13308
|
default: () => delete_default
|
|
13220
13309
|
});
|
|
13221
|
-
var
|
|
13310
|
+
var command31, delete_default;
|
|
13222
13311
|
var init_delete = __esm({
|
|
13223
13312
|
"src/commands/sandbox/delete.ts"() {
|
|
13224
13313
|
"use strict";
|
|
@@ -13226,7 +13315,7 @@ var init_delete = __esm({
|
|
|
13226
13315
|
init_confirm();
|
|
13227
13316
|
init_exit_codes();
|
|
13228
13317
|
init_shared();
|
|
13229
|
-
|
|
13318
|
+
command31 = {
|
|
13230
13319
|
resource: "sandbox",
|
|
13231
13320
|
action: "delete",
|
|
13232
13321
|
summary: "Delete your sandbox and its test keys",
|
|
@@ -13253,7 +13342,7 @@ var init_delete = __esm({
|
|
|
13253
13342
|
return ExitCode.Ok;
|
|
13254
13343
|
}
|
|
13255
13344
|
};
|
|
13256
|
-
delete_default =
|
|
13345
|
+
delete_default = command31;
|
|
13257
13346
|
}
|
|
13258
13347
|
});
|
|
13259
13348
|
|
|
@@ -13262,14 +13351,14 @@ var key_exports = {};
|
|
|
13262
13351
|
__export(key_exports, {
|
|
13263
13352
|
default: () => key_default
|
|
13264
13353
|
});
|
|
13265
|
-
var
|
|
13354
|
+
var command32, key_default;
|
|
13266
13355
|
var init_key = __esm({
|
|
13267
13356
|
"src/commands/sandbox/key.ts"() {
|
|
13268
13357
|
"use strict";
|
|
13269
13358
|
init_exit_codes();
|
|
13270
13359
|
init_http();
|
|
13271
13360
|
init_shared();
|
|
13272
|
-
|
|
13361
|
+
command32 = {
|
|
13273
13362
|
resource: "sandbox",
|
|
13274
13363
|
action: "key",
|
|
13275
13364
|
summary: "Create a new test key for your sandbox and save it as the sandbox profile",
|
|
@@ -13289,7 +13378,7 @@ var init_key = __esm({
|
|
|
13289
13378
|
return ExitCode.Ok;
|
|
13290
13379
|
}
|
|
13291
13380
|
};
|
|
13292
|
-
key_default =
|
|
13381
|
+
key_default = command32;
|
|
13293
13382
|
}
|
|
13294
13383
|
});
|
|
13295
13384
|
|
|
@@ -13298,13 +13387,13 @@ var list_exports2 = {};
|
|
|
13298
13387
|
__export(list_exports2, {
|
|
13299
13388
|
default: () => list_default2
|
|
13300
13389
|
});
|
|
13301
|
-
var
|
|
13390
|
+
var command33, list_default2;
|
|
13302
13391
|
var init_list2 = __esm({
|
|
13303
13392
|
"src/commands/sandbox/list.ts"() {
|
|
13304
13393
|
"use strict";
|
|
13305
13394
|
init_exit_codes();
|
|
13306
13395
|
init_shared();
|
|
13307
|
-
|
|
13396
|
+
command33 = {
|
|
13308
13397
|
resource: "sandbox",
|
|
13309
13398
|
action: "list",
|
|
13310
13399
|
summary: "List your developer sandbox",
|
|
@@ -13320,7 +13409,7 @@ var init_list2 = __esm({
|
|
|
13320
13409
|
return ExitCode.Ok;
|
|
13321
13410
|
}
|
|
13322
13411
|
};
|
|
13323
|
-
list_default2 =
|
|
13412
|
+
list_default2 = command33;
|
|
13324
13413
|
}
|
|
13325
13414
|
});
|
|
13326
13415
|
|
|
@@ -13329,14 +13418,14 @@ var reset_exports = {};
|
|
|
13329
13418
|
__export(reset_exports, {
|
|
13330
13419
|
default: () => reset_default
|
|
13331
13420
|
});
|
|
13332
|
-
var
|
|
13421
|
+
var command34, reset_default;
|
|
13333
13422
|
var init_reset = __esm({
|
|
13334
13423
|
"src/commands/sandbox/reset.ts"() {
|
|
13335
13424
|
"use strict";
|
|
13336
13425
|
init_exit_codes();
|
|
13337
13426
|
init_http();
|
|
13338
13427
|
init_shared();
|
|
13339
|
-
|
|
13428
|
+
command34 = {
|
|
13340
13429
|
resource: "sandbox",
|
|
13341
13430
|
action: "reset",
|
|
13342
13431
|
summary: "Reset your sandbox to its seed data",
|
|
@@ -13354,16 +13443,16 @@ var init_reset = __esm({
|
|
|
13354
13443
|
return ExitCode.Ok;
|
|
13355
13444
|
}
|
|
13356
13445
|
};
|
|
13357
|
-
reset_default =
|
|
13446
|
+
reset_default = command34;
|
|
13358
13447
|
}
|
|
13359
13448
|
});
|
|
13360
13449
|
|
|
13361
13450
|
// src/commands/sandbox/index.ts
|
|
13362
|
-
var
|
|
13451
|
+
var actions19;
|
|
13363
13452
|
var init_sandbox2 = __esm({
|
|
13364
13453
|
"src/commands/sandbox/index.ts"() {
|
|
13365
13454
|
"use strict";
|
|
13366
|
-
|
|
13455
|
+
actions19 = {
|
|
13367
13456
|
create: () => Promise.resolve().then(() => (init_create(), create_exports)).then((m) => m.default),
|
|
13368
13457
|
delete: () => Promise.resolve().then(() => (init_delete(), delete_exports)).then((m) => m.default),
|
|
13369
13458
|
key: () => Promise.resolve().then(() => (init_key(), key_exports)).then((m) => m.default),
|
|
@@ -13374,11 +13463,11 @@ var init_sandbox2 = __esm({
|
|
|
13374
13463
|
});
|
|
13375
13464
|
|
|
13376
13465
|
// src/commands/skill/index.ts
|
|
13377
|
-
var
|
|
13466
|
+
var actions20;
|
|
13378
13467
|
var init_skill = __esm({
|
|
13379
13468
|
"src/commands/skill/index.ts"() {
|
|
13380
13469
|
"use strict";
|
|
13381
|
-
|
|
13470
|
+
actions20 = {
|
|
13382
13471
|
install: () => Promise.resolve().then(() => (init_install(), install_exports)).then((m) => m.default)
|
|
13383
13472
|
};
|
|
13384
13473
|
}
|
|
@@ -13614,7 +13703,7 @@ __export(pull_exports, {
|
|
|
13614
13703
|
});
|
|
13615
13704
|
import { mkdir, writeFile as writeFile4 } from "node:fs/promises";
|
|
13616
13705
|
import { dirname as dirname2, resolve as resolve11 } from "node:path";
|
|
13617
|
-
var
|
|
13706
|
+
var command35, pull_default;
|
|
13618
13707
|
var init_pull = __esm({
|
|
13619
13708
|
"src/commands/studio/pull.ts"() {
|
|
13620
13709
|
"use strict";
|
|
@@ -13624,7 +13713,7 @@ var init_pull = __esm({
|
|
|
13624
13713
|
init_common2();
|
|
13625
13714
|
init_folder();
|
|
13626
13715
|
init_transfer2();
|
|
13627
|
-
|
|
13716
|
+
command35 = {
|
|
13628
13717
|
resource: "studio",
|
|
13629
13718
|
action: "pull",
|
|
13630
13719
|
summary: "Write a template version's files to a folder",
|
|
@@ -13671,7 +13760,7 @@ var init_pull = __esm({
|
|
|
13671
13760
|
return ExitCode.Ok;
|
|
13672
13761
|
}
|
|
13673
13762
|
};
|
|
13674
|
-
pull_default =
|
|
13763
|
+
pull_default = command35;
|
|
13675
13764
|
}
|
|
13676
13765
|
});
|
|
13677
13766
|
|
|
@@ -13704,7 +13793,7 @@ var push_exports = {};
|
|
|
13704
13793
|
__export(push_exports, {
|
|
13705
13794
|
default: () => push_default
|
|
13706
13795
|
});
|
|
13707
|
-
var BUILT_BY, DEFAULT_MESSAGE,
|
|
13796
|
+
var BUILT_BY, DEFAULT_MESSAGE, command36, push_default;
|
|
13708
13797
|
var init_push = __esm({
|
|
13709
13798
|
"src/commands/studio/push.ts"() {
|
|
13710
13799
|
"use strict";
|
|
@@ -13716,7 +13805,7 @@ var init_push = __esm({
|
|
|
13716
13805
|
init_read();
|
|
13717
13806
|
BUILT_BY = "customer_agent";
|
|
13718
13807
|
DEFAULT_MESSAGE = "Pushed with the Kenso CLI";
|
|
13719
|
-
|
|
13808
|
+
command36 = {
|
|
13720
13809
|
resource: "studio",
|
|
13721
13810
|
action: "push",
|
|
13722
13811
|
summary: "Save a folder's files to a template's draft and print the validation",
|
|
@@ -13808,7 +13897,7 @@ var init_push = __esm({
|
|
|
13808
13897
|
);
|
|
13809
13898
|
}
|
|
13810
13899
|
};
|
|
13811
|
-
push_default =
|
|
13900
|
+
push_default = command36;
|
|
13812
13901
|
}
|
|
13813
13902
|
});
|
|
13814
13903
|
|
|
@@ -13817,7 +13906,7 @@ var validate_exports = {};
|
|
|
13817
13906
|
__export(validate_exports, {
|
|
13818
13907
|
default: () => validate_default
|
|
13819
13908
|
});
|
|
13820
|
-
var
|
|
13909
|
+
var command37, validate_default;
|
|
13821
13910
|
var init_validate = __esm({
|
|
13822
13911
|
"src/commands/studio/validate.ts"() {
|
|
13823
13912
|
"use strict";
|
|
@@ -13826,7 +13915,7 @@ var init_validate = __esm({
|
|
|
13826
13915
|
init_columns();
|
|
13827
13916
|
init_common2();
|
|
13828
13917
|
init_read();
|
|
13829
|
-
|
|
13918
|
+
command37 = {
|
|
13830
13919
|
resource: "studio",
|
|
13831
13920
|
action: "validate",
|
|
13832
13921
|
summary: "Validate a folder's files against a template without saving them",
|
|
@@ -13855,7 +13944,7 @@ var init_validate = __esm({
|
|
|
13855
13944
|
throw validationFailed(validation, "The files have validation errors", commandLine2(ctx, "studio validate", args));
|
|
13856
13945
|
}
|
|
13857
13946
|
};
|
|
13858
|
-
validate_default =
|
|
13947
|
+
validate_default = command37;
|
|
13859
13948
|
}
|
|
13860
13949
|
});
|
|
13861
13950
|
|
|
@@ -13904,7 +13993,7 @@ function accountIds(value) {
|
|
|
13904
13993
|
}
|
|
13905
13994
|
return ids2.map(Number);
|
|
13906
13995
|
}
|
|
13907
|
-
var SHOWN,
|
|
13996
|
+
var SHOWN, command38, preview_default;
|
|
13908
13997
|
var init_preview = __esm({
|
|
13909
13998
|
"src/commands/studio/preview.ts"() {
|
|
13910
13999
|
"use strict";
|
|
@@ -13916,7 +14005,7 @@ var init_preview = __esm({
|
|
|
13916
14005
|
init_common2();
|
|
13917
14006
|
init_folder();
|
|
13918
14007
|
SHOWN = 5;
|
|
13919
|
-
|
|
14008
|
+
command38 = {
|
|
13920
14009
|
resource: "studio",
|
|
13921
14010
|
action: "preview",
|
|
13922
14011
|
summary: "Render a saved version for up to 3 accounts; for local edits, studio push them to the draft first",
|
|
@@ -13965,7 +14054,7 @@ var init_preview = __esm({
|
|
|
13965
14054
|
return ExitCode.Ok;
|
|
13966
14055
|
}
|
|
13967
14056
|
};
|
|
13968
|
-
preview_default =
|
|
14057
|
+
preview_default = command38;
|
|
13969
14058
|
}
|
|
13970
14059
|
});
|
|
13971
14060
|
|
|
@@ -14166,7 +14255,7 @@ function estimateOutput(templateId, target, estimate2) {
|
|
|
14166
14255
|
...target.campaignId !== void 0 ? { estimateNote: "An upper bound: it counts one page per lead, and a campaign run builds one page per company." } : {}
|
|
14167
14256
|
};
|
|
14168
14257
|
}
|
|
14169
|
-
var COMMAND6, sha2562,
|
|
14258
|
+
var COMMAND6, sha2562, command39, fill_default;
|
|
14170
14259
|
var init_fill = __esm({
|
|
14171
14260
|
"src/commands/studio/fill.ts"() {
|
|
14172
14261
|
"use strict";
|
|
@@ -14182,7 +14271,7 @@ var init_fill = __esm({
|
|
|
14182
14271
|
init_fill_runs();
|
|
14183
14272
|
COMMAND6 = "studio fill";
|
|
14184
14273
|
sha2562 = (data) => createHash8("sha256").update(data).digest("hex");
|
|
14185
|
-
|
|
14274
|
+
command39 = {
|
|
14186
14275
|
resource: "studio",
|
|
14187
14276
|
action: "fill",
|
|
14188
14277
|
summary: "Fill a template on many accounts or campaign leads (estimate first)",
|
|
@@ -14242,16 +14331,16 @@ var init_fill = __esm({
|
|
|
14242
14331
|
return outcome.exitCode;
|
|
14243
14332
|
}
|
|
14244
14333
|
};
|
|
14245
|
-
fill_default =
|
|
14334
|
+
fill_default = command39;
|
|
14246
14335
|
}
|
|
14247
14336
|
});
|
|
14248
14337
|
|
|
14249
14338
|
// src/commands/studio/index.ts
|
|
14250
|
-
var
|
|
14339
|
+
var actions21;
|
|
14251
14340
|
var init_studio2 = __esm({
|
|
14252
14341
|
"src/commands/studio/index.ts"() {
|
|
14253
14342
|
"use strict";
|
|
14254
|
-
|
|
14343
|
+
actions21 = {
|
|
14255
14344
|
pull: () => Promise.resolve().then(() => (init_pull(), pull_exports)).then((m) => m.default),
|
|
14256
14345
|
push: () => Promise.resolve().then(() => (init_push(), push_exports)).then((m) => m.default),
|
|
14257
14346
|
validate: () => Promise.resolve().then(() => (init_validate(), validate_exports)).then((m) => m.default),
|
|
@@ -14393,7 +14482,7 @@ function readBody(req) {
|
|
|
14393
14482
|
function reply(res, status, body2) {
|
|
14394
14483
|
res.writeHead(status, { "content-type": "application/json" }).end(JSON.stringify(body2));
|
|
14395
14484
|
}
|
|
14396
|
-
var MIN_POLL_MS, MAX_POLL_MS, MAX_TRIGGER_BYTES,
|
|
14485
|
+
var MIN_POLL_MS, MAX_POLL_MS, MAX_TRIGGER_BYTES, command40, listen_default;
|
|
14397
14486
|
var init_listen = __esm({
|
|
14398
14487
|
"src/commands/webhooks/listen.ts"() {
|
|
14399
14488
|
"use strict";
|
|
@@ -14404,7 +14493,7 @@ var init_listen = __esm({
|
|
|
14404
14493
|
MIN_POLL_MS = 1e3;
|
|
14405
14494
|
MAX_POLL_MS = 6e4;
|
|
14406
14495
|
MAX_TRIGGER_BYTES = 1e6;
|
|
14407
|
-
|
|
14496
|
+
command40 = {
|
|
14408
14497
|
resource: "webhooks",
|
|
14409
14498
|
action: "listen",
|
|
14410
14499
|
summary: "Stream the workspace's events and forward them, signed, to a local handler",
|
|
@@ -14510,7 +14599,7 @@ var init_listen = __esm({
|
|
|
14510
14599
|
return ExitCode.Ok;
|
|
14511
14600
|
}
|
|
14512
14601
|
};
|
|
14513
|
-
listen_default =
|
|
14602
|
+
listen_default = command40;
|
|
14514
14603
|
}
|
|
14515
14604
|
});
|
|
14516
14605
|
|
|
@@ -14529,7 +14618,7 @@ function notRunning() {
|
|
|
14529
14618
|
next: LISTEN_NEXT
|
|
14530
14619
|
});
|
|
14531
14620
|
}
|
|
14532
|
-
var LISTEN_NEXT,
|
|
14621
|
+
var LISTEN_NEXT, command41, trigger_default;
|
|
14533
14622
|
var init_trigger = __esm({
|
|
14534
14623
|
"src/commands/webhooks/trigger.ts"() {
|
|
14535
14624
|
"use strict";
|
|
@@ -14538,7 +14627,7 @@ var init_trigger = __esm({
|
|
|
14538
14627
|
init_http();
|
|
14539
14628
|
init_local();
|
|
14540
14629
|
LISTEN_NEXT = "kenso webhooks listen --forward-to http://localhost:3000/hook";
|
|
14541
|
-
|
|
14630
|
+
command41 = {
|
|
14542
14631
|
resource: "webhooks",
|
|
14543
14632
|
action: "trigger",
|
|
14544
14633
|
summary: "Send a sample event of one type through the running kenso webhooks listen",
|
|
@@ -14595,16 +14684,16 @@ var init_trigger = __esm({
|
|
|
14595
14684
|
return ExitCode.Ok;
|
|
14596
14685
|
}
|
|
14597
14686
|
};
|
|
14598
|
-
trigger_default =
|
|
14687
|
+
trigger_default = command41;
|
|
14599
14688
|
}
|
|
14600
14689
|
});
|
|
14601
14690
|
|
|
14602
14691
|
// src/commands/webhooks/index.ts
|
|
14603
|
-
var
|
|
14692
|
+
var actions22;
|
|
14604
14693
|
var init_webhooks2 = __esm({
|
|
14605
14694
|
"src/commands/webhooks/index.ts"() {
|
|
14606
14695
|
"use strict";
|
|
14607
|
-
|
|
14696
|
+
actions22 = {
|
|
14608
14697
|
listen: () => Promise.resolve().then(() => (init_listen(), listen_exports)).then((m) => m.default),
|
|
14609
14698
|
trigger: () => Promise.resolve().then(() => (init_trigger(), trigger_exports)).then((m) => m.default)
|
|
14610
14699
|
};
|
|
@@ -14799,14 +14888,14 @@ var status_exports3 = {};
|
|
|
14799
14888
|
__export(status_exports3, {
|
|
14800
14889
|
default: () => status_default3
|
|
14801
14890
|
});
|
|
14802
|
-
var
|
|
14891
|
+
var command42, status_default3;
|
|
14803
14892
|
var init_status3 = __esm({
|
|
14804
14893
|
"src/commands/work/status.ts"() {
|
|
14805
14894
|
"use strict";
|
|
14806
14895
|
init_exit_codes();
|
|
14807
14896
|
init_http();
|
|
14808
14897
|
init_common3();
|
|
14809
|
-
|
|
14898
|
+
command42 = {
|
|
14810
14899
|
resource: "work",
|
|
14811
14900
|
action: "status",
|
|
14812
14901
|
summary: "Show the Kenso AI work waiting for your own agent, per kind",
|
|
@@ -14840,7 +14929,7 @@ var init_status3 = __esm({
|
|
|
14840
14929
|
return ExitCode.Ok;
|
|
14841
14930
|
}
|
|
14842
14931
|
};
|
|
14843
|
-
status_default3 =
|
|
14932
|
+
status_default3 = command42;
|
|
14844
14933
|
}
|
|
14845
14934
|
});
|
|
14846
14935
|
|
|
@@ -14972,9 +15061,9 @@ var init_files = __esm({
|
|
|
14972
15061
|
import { execFile, spawnSync as spawnSync2 } from "node:child_process";
|
|
14973
15062
|
import { readFileSync as readFileSync12 } from "node:fs";
|
|
14974
15063
|
import { isAbsolute as isAbsolute2 } from "node:path";
|
|
14975
|
-
function sudoArgs(user,
|
|
15064
|
+
function sudoArgs(user, command49, args, keep = [], set = {}) {
|
|
14976
15065
|
const assignments = Object.entries(set).map(([name, value]) => `${name}=${value}`);
|
|
14977
|
-
return ["-n", "-u", user, "-H", ...keep.length > 0 ? [`--preserve-env=${keep.join(",")}`] : [], ...assignments, "--",
|
|
15066
|
+
return ["-n", "-u", user, "-H", ...keep.length > 0 ? [`--preserve-env=${keep.join(",")}`] : [], ...assignments, "--", command49, ...args];
|
|
14978
15067
|
}
|
|
14979
15068
|
function agentKensoEnv(opts) {
|
|
14980
15069
|
return {
|
|
@@ -14984,12 +15073,12 @@ function agentKensoEnv(opts) {
|
|
|
14984
15073
|
AI_AGENT: opts.agentName
|
|
14985
15074
|
};
|
|
14986
15075
|
}
|
|
14987
|
-
function sudoExec(user,
|
|
15076
|
+
function sudoExec(user, command49, args, opts = {}) {
|
|
14988
15077
|
const [sudo = "/usr/bin/sudo", ...lead] = user.sudo;
|
|
14989
15078
|
return new Promise((resolve16) => {
|
|
14990
15079
|
execFile(
|
|
14991
15080
|
sudo,
|
|
14992
|
-
[...lead, ...sudoArgs(user.name,
|
|
15081
|
+
[...lead, ...sudoArgs(user.name, command49, args)],
|
|
14993
15082
|
{ env: { PATH: SUDO_PATH }, cwd: "/", timeout: opts.timeoutMs ?? PROBE_TIMEOUT_MS, maxBuffer: opts.maxBuffer ?? 1024 * 1024, encoding: "utf8", windowsHide: true, shell: false },
|
|
14994
15083
|
(err, stdout, stderr) => {
|
|
14995
15084
|
const code = err ? err.code : 0;
|
|
@@ -15099,9 +15188,9 @@ var init_folder2 = __esm({
|
|
|
15099
15188
|
init_redact();
|
|
15100
15189
|
init_agent_user();
|
|
15101
15190
|
WorkRunFolder = class {
|
|
15102
|
-
constructor(ctx,
|
|
15191
|
+
constructor(ctx, command49, args, outDir, shared = false) {
|
|
15103
15192
|
this.ctx = ctx;
|
|
15104
|
-
this.command =
|
|
15193
|
+
this.command = command49;
|
|
15105
15194
|
this.args = args;
|
|
15106
15195
|
this.outDir = outDir;
|
|
15107
15196
|
this.shared = shared;
|
|
@@ -15216,7 +15305,7 @@ var pull_exports2 = {};
|
|
|
15216
15305
|
__export(pull_exports2, {
|
|
15217
15306
|
default: () => pull_default2
|
|
15218
15307
|
});
|
|
15219
|
-
var MAX_FILES,
|
|
15308
|
+
var MAX_FILES, command43, pull_default2;
|
|
15220
15309
|
var init_pull2 = __esm({
|
|
15221
15310
|
"src/commands/work/pull.ts"() {
|
|
15222
15311
|
"use strict";
|
|
@@ -15225,7 +15314,7 @@ var init_pull2 = __esm({
|
|
|
15225
15314
|
init_common3();
|
|
15226
15315
|
init_folder2();
|
|
15227
15316
|
MAX_FILES = 100;
|
|
15228
|
-
|
|
15317
|
+
command43 = {
|
|
15229
15318
|
resource: "work",
|
|
15230
15319
|
action: "pull",
|
|
15231
15320
|
summary: "Claim waiting work into local work files, to answer by hand",
|
|
@@ -15303,7 +15392,7 @@ var init_pull2 = __esm({
|
|
|
15303
15392
|
return interrupted7 ? ExitCode.Interrupted : ExitCode.Ok;
|
|
15304
15393
|
}
|
|
15305
15394
|
};
|
|
15306
|
-
pull_default2 =
|
|
15395
|
+
pull_default2 = command43;
|
|
15307
15396
|
}
|
|
15308
15397
|
});
|
|
15309
15398
|
|
|
@@ -15445,7 +15534,7 @@ __export(submit_exports, {
|
|
|
15445
15534
|
default: () => submit_default
|
|
15446
15535
|
});
|
|
15447
15536
|
import { resolve as resolve14 } from "node:path";
|
|
15448
|
-
var
|
|
15537
|
+
var command44, submit_default;
|
|
15449
15538
|
var init_submit = __esm({
|
|
15450
15539
|
"src/commands/work/submit.ts"() {
|
|
15451
15540
|
"use strict";
|
|
@@ -15454,7 +15543,7 @@ var init_submit = __esm({
|
|
|
15454
15543
|
init_files();
|
|
15455
15544
|
init_answers();
|
|
15456
15545
|
init_common3();
|
|
15457
|
-
|
|
15546
|
+
command44 = {
|
|
15458
15547
|
resource: "work",
|
|
15459
15548
|
action: "submit",
|
|
15460
15549
|
summary: "Send answers files to Kenso and write each one's results",
|
|
@@ -15486,7 +15575,7 @@ var init_submit = __esm({
|
|
|
15486
15575
|
return totals.rejected > 0 ? ExitCode.Partial : ExitCode.Ok;
|
|
15487
15576
|
}
|
|
15488
15577
|
};
|
|
15489
|
-
submit_default =
|
|
15578
|
+
submit_default = command44;
|
|
15490
15579
|
}
|
|
15491
15580
|
});
|
|
15492
15581
|
|
|
@@ -15507,7 +15596,7 @@ function claimIdOf(arg) {
|
|
|
15507
15596
|
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..." });
|
|
15508
15597
|
return arg;
|
|
15509
15598
|
}
|
|
15510
|
-
var CLAIM_ID,
|
|
15599
|
+
var CLAIM_ID, command45, release_default;
|
|
15511
15600
|
var init_release = __esm({
|
|
15512
15601
|
"src/commands/work/release.ts"() {
|
|
15513
15602
|
"use strict";
|
|
@@ -15516,7 +15605,7 @@ var init_release = __esm({
|
|
|
15516
15605
|
init_files();
|
|
15517
15606
|
init_common3();
|
|
15518
15607
|
CLAIM_ID = /^[A-Za-z0-9_-]{1,64}$/;
|
|
15519
|
-
|
|
15608
|
+
command45 = {
|
|
15520
15609
|
resource: "work",
|
|
15521
15610
|
action: "release",
|
|
15522
15611
|
summary: "Give claimed work back to the queue now",
|
|
@@ -15535,7 +15624,7 @@ var init_release = __esm({
|
|
|
15535
15624
|
return ExitCode.Ok;
|
|
15536
15625
|
}
|
|
15537
15626
|
};
|
|
15538
|
-
release_default =
|
|
15627
|
+
release_default = command45;
|
|
15539
15628
|
}
|
|
15540
15629
|
});
|
|
15541
15630
|
|
|
@@ -15874,12 +15963,12 @@ function plain(text4) {
|
|
|
15874
15963
|
return text4.replace(/\x1b\[[0-9;?]*[A-Za-z]/g, "");
|
|
15875
15964
|
}
|
|
15876
15965
|
function runStatus(bin, args, env, adapter, runAs) {
|
|
15877
|
-
const
|
|
15966
|
+
const command49 = runAs ? runAs.sudo[0] ?? "/usr/bin/sudo" : bin;
|
|
15878
15967
|
const commandArgs2 = runAs ? [...runAs.sudo.slice(1), ...sudoArgs(runAs.name, bin, args)] : args;
|
|
15879
15968
|
const options = runAs ? { env: { PATH: SUDO_PATH }, cwd: "/" } : { env: childEnv(env, adapter) };
|
|
15880
15969
|
return new Promise((resolve16) => {
|
|
15881
15970
|
execFile2(
|
|
15882
|
-
|
|
15971
|
+
command49,
|
|
15883
15972
|
commandArgs2,
|
|
15884
15973
|
{ ...options, timeout: STATUS_TIMEOUT_MS, maxBuffer: 1024 * 1024, windowsHide: true, shell: false },
|
|
15885
15974
|
(err, stdout, stderr) => {
|
|
@@ -16957,12 +17046,12 @@ var init_stop = __esm({
|
|
|
16957
17046
|
});
|
|
16958
17047
|
|
|
16959
17048
|
// src/commands/work/run.ts
|
|
16960
|
-
var
|
|
16961
|
-
__export(
|
|
16962
|
-
default: () =>
|
|
17049
|
+
var run_exports3 = {};
|
|
17050
|
+
__export(run_exports3, {
|
|
17051
|
+
default: () => run_default2
|
|
16963
17052
|
});
|
|
16964
|
-
var FAILURES_IN_A_ROW,
|
|
16965
|
-
var
|
|
17053
|
+
var FAILURES_IN_A_ROW, command46, run_default2;
|
|
17054
|
+
var init_run3 = __esm({
|
|
16966
17055
|
"src/commands/work/run.ts"() {
|
|
16967
17056
|
"use strict";
|
|
16968
17057
|
init_errors();
|
|
@@ -16982,7 +17071,7 @@ var init_run2 = __esm({
|
|
|
16982
17071
|
init_folder2();
|
|
16983
17072
|
init_stop();
|
|
16984
17073
|
FAILURES_IN_A_ROW = 3;
|
|
16985
|
-
|
|
17074
|
+
command46 = {
|
|
16986
17075
|
resource: "work",
|
|
16987
17076
|
action: "run",
|
|
16988
17077
|
summary: "Run your own coding agent on the waiting work until the queue is empty",
|
|
@@ -17307,21 +17396,21 @@ var init_run2 = __esm({
|
|
|
17307
17396
|
return exitCodeFor(reason, totals.rejected > 0 || jobsFailed > 0);
|
|
17308
17397
|
}
|
|
17309
17398
|
};
|
|
17310
|
-
|
|
17399
|
+
run_default2 = command46;
|
|
17311
17400
|
}
|
|
17312
17401
|
});
|
|
17313
17402
|
|
|
17314
17403
|
// src/commands/work/index.ts
|
|
17315
|
-
var
|
|
17404
|
+
var actions23;
|
|
17316
17405
|
var init_work2 = __esm({
|
|
17317
17406
|
"src/commands/work/index.ts"() {
|
|
17318
17407
|
"use strict";
|
|
17319
|
-
|
|
17408
|
+
actions23 = {
|
|
17320
17409
|
status: () => Promise.resolve().then(() => (init_status3(), status_exports3)).then((m) => m.default),
|
|
17321
17410
|
pull: () => Promise.resolve().then(() => (init_pull2(), pull_exports2)).then((m) => m.default),
|
|
17322
17411
|
submit: () => Promise.resolve().then(() => (init_submit(), submit_exports)).then((m) => m.default),
|
|
17323
17412
|
release: () => Promise.resolve().then(() => (init_release(), release_exports)).then((m) => m.default),
|
|
17324
|
-
run: () => Promise.resolve().then(() => (
|
|
17413
|
+
run: () => Promise.resolve().then(() => (init_run3(), run_exports3)).then((m) => m.default)
|
|
17325
17414
|
};
|
|
17326
17415
|
}
|
|
17327
17416
|
});
|
|
@@ -17340,14 +17429,14 @@ function parseLimit(value) {
|
|
|
17340
17429
|
}
|
|
17341
17430
|
return limit;
|
|
17342
17431
|
}
|
|
17343
|
-
var MAX_LIMIT,
|
|
17432
|
+
var MAX_LIMIT, command47, list_default3;
|
|
17344
17433
|
var init_list3 = __esm({
|
|
17345
17434
|
"src/commands/workspace/list.ts"() {
|
|
17346
17435
|
"use strict";
|
|
17347
17436
|
init_errors();
|
|
17348
17437
|
init_exit_codes();
|
|
17349
17438
|
MAX_LIMIT = 200;
|
|
17350
|
-
|
|
17439
|
+
command47 = {
|
|
17351
17440
|
resource: "workspace",
|
|
17352
17441
|
action: "list",
|
|
17353
17442
|
summary: "List the workspaces your key can use",
|
|
@@ -17375,7 +17464,7 @@ var init_list3 = __esm({
|
|
|
17375
17464
|
return ExitCode.Ok;
|
|
17376
17465
|
}
|
|
17377
17466
|
};
|
|
17378
|
-
list_default3 =
|
|
17467
|
+
list_default3 = command47;
|
|
17379
17468
|
}
|
|
17380
17469
|
});
|
|
17381
17470
|
|
|
@@ -17384,7 +17473,7 @@ var use_exports = {};
|
|
|
17384
17473
|
__export(use_exports, {
|
|
17385
17474
|
default: () => use_default
|
|
17386
17475
|
});
|
|
17387
|
-
var
|
|
17476
|
+
var command48, use_default;
|
|
17388
17477
|
var init_use = __esm({
|
|
17389
17478
|
"src/commands/workspace/use.ts"() {
|
|
17390
17479
|
"use strict";
|
|
@@ -17392,7 +17481,7 @@ var init_use = __esm({
|
|
|
17392
17481
|
init_errors();
|
|
17393
17482
|
init_exit_codes();
|
|
17394
17483
|
init_http();
|
|
17395
|
-
|
|
17484
|
+
command48 = {
|
|
17396
17485
|
resource: "workspace",
|
|
17397
17486
|
action: "use",
|
|
17398
17487
|
summary: "Set the profile's default workspace",
|
|
@@ -17449,16 +17538,16 @@ var init_use = __esm({
|
|
|
17449
17538
|
return ExitCode.Ok;
|
|
17450
17539
|
}
|
|
17451
17540
|
};
|
|
17452
|
-
use_default =
|
|
17541
|
+
use_default = command48;
|
|
17453
17542
|
}
|
|
17454
17543
|
});
|
|
17455
17544
|
|
|
17456
17545
|
// src/commands/workspace/index.ts
|
|
17457
|
-
var
|
|
17546
|
+
var actions24;
|
|
17458
17547
|
var init_workspace = __esm({
|
|
17459
17548
|
"src/commands/workspace/index.ts"() {
|
|
17460
17549
|
"use strict";
|
|
17461
|
-
|
|
17550
|
+
actions24 = {
|
|
17462
17551
|
list: () => Promise.resolve().then(() => (init_list3(), list_exports3)).then((m) => m.default),
|
|
17463
17552
|
use: () => Promise.resolve().then(() => (init_use(), use_exports)).then((m) => m.default)
|
|
17464
17553
|
};
|
|
@@ -17494,6 +17583,7 @@ var init_registry = __esm({
|
|
|
17494
17583
|
init_mcp();
|
|
17495
17584
|
init_opportunities();
|
|
17496
17585
|
init_people();
|
|
17586
|
+
init_reports();
|
|
17497
17587
|
init_runs2();
|
|
17498
17588
|
init_sandbox2();
|
|
17499
17589
|
init_skill();
|
|
@@ -17520,14 +17610,15 @@ var init_registry = __esm({
|
|
|
17520
17610
|
mcp: actions14,
|
|
17521
17611
|
opportunities: actions15,
|
|
17522
17612
|
people: actions16,
|
|
17523
|
-
|
|
17524
|
-
|
|
17525
|
-
|
|
17526
|
-
|
|
17527
|
-
|
|
17613
|
+
reports: actions17,
|
|
17614
|
+
runs: actions18,
|
|
17615
|
+
sandbox: actions19,
|
|
17616
|
+
skill: actions20,
|
|
17617
|
+
studio: actions21,
|
|
17618
|
+
webhooks: actions22,
|
|
17528
17619
|
whoami: topLevel("whoami", actions4.status, "kenso auth status"),
|
|
17529
|
-
work:
|
|
17530
|
-
workspace:
|
|
17620
|
+
work: actions23,
|
|
17621
|
+
workspace: actions24
|
|
17531
17622
|
};
|
|
17532
17623
|
resourceAliases = { leads: "contacts" };
|
|
17533
17624
|
}
|
|
@@ -17664,8 +17755,8 @@ async function renderTopHelp(opts) {
|
|
|
17664
17755
|
names.push(withPositionals(spec, spec.action));
|
|
17665
17756
|
groups.set(hint, names);
|
|
17666
17757
|
}
|
|
17667
|
-
const
|
|
17668
|
-
if (
|
|
17758
|
+
const actions26 = [...groups.entries()].map(([hint, names]) => `${names.join(", ")}${hint}`);
|
|
17759
|
+
if (actions26.length > 0) rows.push([resource, actions26.join(", ")]);
|
|
17669
17760
|
}
|
|
17670
17761
|
const at = 4 + Math.min(22, Math.max(0, ...rows.map(([left]) => left.length)));
|
|
17671
17762
|
lines.push(
|
|
@@ -17678,7 +17769,7 @@ async function renderTopHelp(opts) {
|
|
|
17678
17769
|
const [area = "", action = ""] = name.split(" ");
|
|
17679
17770
|
byArea.set(area, [...byArea.get(area) ?? [], action]);
|
|
17680
17771
|
}
|
|
17681
|
-
const named = [...byArea.entries()].map(([area,
|
|
17772
|
+
const named = [...byArea.entries()].map(([area, actions26]) => `${area} ${actions26.join("|")}`);
|
|
17682
17773
|
lines.push(wrap(`Beta, hidden here but they run (the server decides): ${named.join(", ")}.`, " "));
|
|
17683
17774
|
}
|
|
17684
17775
|
const generated = await listGenerated({ features: opts.allCommands ? [] : getFeatures, env: opts.env });
|
|
@@ -17686,13 +17777,13 @@ async function renderTopHelp(opts) {
|
|
|
17686
17777
|
if (visible.length > 0) {
|
|
17687
17778
|
const byResource = /* @__PURE__ */ new Map();
|
|
17688
17779
|
for (const g of visible) {
|
|
17689
|
-
const
|
|
17690
|
-
|
|
17691
|
-
byResource.set(g.resource,
|
|
17780
|
+
const actions26 = byResource.get(g.resource) ?? [];
|
|
17781
|
+
actions26.push(`${g.action}${g.beta ? " (beta)" : ""}`);
|
|
17782
|
+
byResource.set(g.resource, actions26);
|
|
17692
17783
|
}
|
|
17693
17784
|
const sorted2 = [...byResource.entries()].sort(([a], [b]) => a.localeCompare(b));
|
|
17694
17785
|
if (opts.allCommands) {
|
|
17695
|
-
const generatedRows = sorted2.map(([resource,
|
|
17786
|
+
const generatedRows = sorted2.map(([resource, actions26]) => [resource, actions26.sort().join(", ")]);
|
|
17696
17787
|
lines.push("", "API resources (kenso <resource> <action>):", columns(generatedRows));
|
|
17697
17788
|
} else {
|
|
17698
17789
|
const names = new Set(sorted2.map(([resource]) => resource));
|
|
@@ -18008,8 +18099,8 @@ function startUpdateNotice(argv, opts = {}) {
|
|
|
18008
18099
|
if (!found) return;
|
|
18009
18100
|
writeCheck(file, { checkedAt: new Date(now).toISOString(), latest: found });
|
|
18010
18101
|
if (isNewer(found, version)) {
|
|
18011
|
-
const
|
|
18012
|
-
stderr.write(`kenso ${found} is out (you have ${version}): ${
|
|
18102
|
+
const command49 = updateCommand(install, opts.platform ?? process.platform);
|
|
18103
|
+
stderr.write(`kenso ${found} is out (you have ${version}): ${command49}
|
|
18013
18104
|
Turn this off with KENSO_NO_UPDATE_NOTIFIER=1.
|
|
18014
18105
|
`);
|
|
18015
18106
|
}
|
|
@@ -18051,7 +18142,7 @@ function resources() {
|
|
|
18051
18142
|
const names = Object.entries(handWritten).filter(([, area]) => Object.keys(area).length > 0).map(([resource]) => resource);
|
|
18052
18143
|
return sorted([...names, ...Object.keys(resourceAliases), ...loadManifest().operations.map((op) => op.resource)]);
|
|
18053
18144
|
}
|
|
18054
|
-
function
|
|
18145
|
+
function actions25(resource) {
|
|
18055
18146
|
const own = Object.keys(handWritten[resource] ?? {}).filter((action) => action !== "");
|
|
18056
18147
|
return sorted([...own, ...loadManifest().operations.filter((op) => op.resource === resource).map((op) => op.action)]);
|
|
18057
18148
|
}
|
|
@@ -18116,7 +18207,7 @@ async function completions(words, globals) {
|
|
|
18116
18207
|
return flagsOf2(spec, globals, positionals.length === 0);
|
|
18117
18208
|
}
|
|
18118
18209
|
if (positionals.length === 0) return resources();
|
|
18119
|
-
if (!spec) return positionals.length === 1 ?
|
|
18210
|
+
if (!spec) return positionals.length === 1 ? actions25(resourceAliases[positionals[0]] ?? positionals[0]) : [];
|
|
18120
18211
|
const given = positionals.length - commandWords;
|
|
18121
18212
|
const declared = spec.positionals ?? [];
|
|
18122
18213
|
if (given < declared.length || declared.at(-1)?.variadic === true) {
|
|
@@ -18210,9 +18301,9 @@ function normalizeBooleans(argv, names, strict) {
|
|
|
18210
18301
|
async function knownCommands() {
|
|
18211
18302
|
const commands = /* @__PURE__ */ new Set();
|
|
18212
18303
|
for (const [resource, area] of Object.entries(handWritten)) {
|
|
18213
|
-
const
|
|
18214
|
-
if (
|
|
18215
|
-
for (const action of
|
|
18304
|
+
const actions26 = Object.keys(area);
|
|
18305
|
+
if (actions26.length > 0) commands.add(resource);
|
|
18306
|
+
for (const action of actions26) commands.add(action ? `${resource} ${action}` : resource);
|
|
18216
18307
|
}
|
|
18217
18308
|
for (const g of await listGenerated({ features: [] })) {
|
|
18218
18309
|
commands.add(g.resource);
|