callkaro-cli-unofficial 0.7.2 → 0.8.0
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/commands/agentVersions.js +153 -0
- package/dist/commands/aiTools.js +64 -0
- package/dist/commands/analytics.js +66 -0
- package/dist/commands/analyzers.js +99 -0
- package/dist/commands/dnd.js +105 -0
- package/dist/commands/feedback.js +84 -0
- package/dist/commands/knowledge.js +33 -0
- package/dist/commands/kpi.js +262 -1
- package/dist/commands/simulations.js +68 -0
- package/dist/index.js +227 -1
- package/dist/lib/dashboardApi.js +171 -0
- package/package.json +1 -1
package/dist/commands/kpi.js
CHANGED
|
@@ -22,6 +22,18 @@ exports.kpiReportAddVarCommand = kpiReportAddVarCommand;
|
|
|
22
22
|
exports.kpiReportRemoveVarCommand = kpiReportRemoveVarCommand;
|
|
23
23
|
exports.kpiReportAddElementCommand = kpiReportAddElementCommand;
|
|
24
24
|
exports.kpiReportRemoveElementCommand = kpiReportRemoveElementCommand;
|
|
25
|
+
exports.kpiImportCommand = kpiImportCommand;
|
|
26
|
+
exports.kpiDetachCommand = kpiDetachCommand;
|
|
27
|
+
exports.kpiRcaReportsCommand = kpiRcaReportsCommand;
|
|
28
|
+
exports.kpiRcaTimelineCommand = kpiRcaTimelineCommand;
|
|
29
|
+
exports.kpiRcaPdfCommand = kpiRcaPdfCommand;
|
|
30
|
+
exports.kpiRcaDraftPromptCommand = kpiRcaDraftPromptCommand;
|
|
31
|
+
exports.kpiSourceAddApiCommand = kpiSourceAddApiCommand;
|
|
32
|
+
exports.kpiSourceAddPythonCommand = kpiSourceAddPythonCommand;
|
|
33
|
+
exports.kpiSourceAddExprCommand = kpiSourceAddExprCommand;
|
|
34
|
+
exports.kpiSourceRemoveCommand = kpiSourceRemoveCommand;
|
|
35
|
+
exports.kpiMetricSetCommand = kpiMetricSetCommand;
|
|
36
|
+
exports.kpiMetricRemoveCommand = kpiMetricRemoveCommand;
|
|
25
37
|
const fs_1 = require("fs");
|
|
26
38
|
const dashboardApi_1 = require("../lib/dashboardApi");
|
|
27
39
|
const setJson_1 = require("./setJson");
|
|
@@ -348,7 +360,11 @@ async function kpiHistoryCommand(opts) {
|
|
|
348
360
|
if (!agentIds.length) {
|
|
349
361
|
return (0, ui_1.handleError)(new Error(`No agent ids in --agents "${opts.agents}".\n Use a comma-separated list, e.g. --agents abc123,def456`));
|
|
350
362
|
}
|
|
351
|
-
const res = await (0, dashboardApi_1.dashboardApi)().kpiHistory({
|
|
363
|
+
const res = await (0, dashboardApi_1.dashboardApi)().kpiHistory({
|
|
364
|
+
agentIds: agentIds.join(','),
|
|
365
|
+
startDate: opts.since ? dateBound(opts.since, false) : undefined,
|
|
366
|
+
endDate: opts.until ? dateBound(opts.until, true) : undefined,
|
|
367
|
+
});
|
|
352
368
|
if (opts.json)
|
|
353
369
|
return void console.log(JSON.stringify(res, null, 2));
|
|
354
370
|
// Deliberately generic: this response's shape was not confirmed field by field,
|
|
@@ -494,6 +510,18 @@ async function kpiCommentCommand(taskId, text, opts = {}) {
|
|
|
494
510
|
*/
|
|
495
511
|
async function kpiAssignCommand(taskId, opts) {
|
|
496
512
|
try {
|
|
513
|
+
if (opts.unassign) {
|
|
514
|
+
const res = await (0, dashboardApi_1.dashboardApi)().savePendingAssignments([
|
|
515
|
+
{ taskId, unassign: true, versionIds: splitList(opts.versions), versionNames: splitList(opts.versionNames) },
|
|
516
|
+
]);
|
|
517
|
+
const result = Array.isArray(res?.results) ? res.results[0] : undefined;
|
|
518
|
+
if (result && result.success === false) {
|
|
519
|
+
return (0, ui_1.handleError)(new Error(result.error || 'The server refused the unassignment.'));
|
|
520
|
+
}
|
|
521
|
+
if (opts.json)
|
|
522
|
+
return void console.log(JSON.stringify(res, null, 2));
|
|
523
|
+
return void (0, ui_1.success)(`Unassigned ${taskId}.`);
|
|
524
|
+
}
|
|
497
525
|
let to = String(opts.to || '').trim();
|
|
498
526
|
if (!to) {
|
|
499
527
|
return (0, ui_1.handleError)(new Error('--to <who> is required.\n' +
|
|
@@ -1042,3 +1070,236 @@ async function kpiReportRemoveElementCommand(agentId, elementId, opts) {
|
|
|
1042
1070
|
(0, ui_1.handleError)(err);
|
|
1043
1071
|
}
|
|
1044
1072
|
}
|
|
1073
|
+
// --- import / detach / RCA reports / data sources -----------------------------
|
|
1074
|
+
/** `cku kpi import --file <rows.json>` — bulk-create cards. */
|
|
1075
|
+
async function kpiImportCommand(opts) {
|
|
1076
|
+
try {
|
|
1077
|
+
const raw = (0, setJson_1.readSetJson)(opts.file.startsWith('@') ? opts.file : '@' + opts.file);
|
|
1078
|
+
const list = Array.isArray(raw) ? raw : raw?.rows;
|
|
1079
|
+
if (!Array.isArray(list) || !list.length) {
|
|
1080
|
+
throw new Error('File must hold a non-empty JSON array of task rows, or {"rows": [...]}.');
|
|
1081
|
+
}
|
|
1082
|
+
const rows = list.map((r) => (r && r.columnId ? { ...r, columnId: columnId(r.columnId) } : r));
|
|
1083
|
+
const res = await (0, dashboardApi_1.dashboardApi)().importPendingTasks(rows);
|
|
1084
|
+
if (opts.json)
|
|
1085
|
+
return void console.log(JSON.stringify(res, null, 2));
|
|
1086
|
+
(0, ui_1.success)(`Imported ${res?.created ?? 0} card(s)${res?.skipped?.length ? ` (${res.skipped.length} skipped)` : ''}.`);
|
|
1087
|
+
}
|
|
1088
|
+
catch (err) {
|
|
1089
|
+
(0, ui_1.handleError)(err);
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
/** `cku kpi detach <taskId> <url>` — remove one attachment. */
|
|
1093
|
+
async function kpiDetachCommand(taskId, url, opts) {
|
|
1094
|
+
try {
|
|
1095
|
+
const res = await (0, dashboardApi_1.dashboardApi)().deletePendingTaskAttachment(taskId, url);
|
|
1096
|
+
if (opts.json)
|
|
1097
|
+
return void console.log(JSON.stringify(res ?? { taskId, url }, null, 2));
|
|
1098
|
+
(0, ui_1.success)(`Detached attachment from ${taskId}.`);
|
|
1099
|
+
}
|
|
1100
|
+
catch (err) {
|
|
1101
|
+
(0, ui_1.handleError)(err);
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
/** `cku kpi rca-reports` — daywise RCA reports. */
|
|
1105
|
+
async function kpiRcaReportsCommand(opts) {
|
|
1106
|
+
try {
|
|
1107
|
+
const res = await (0, dashboardApi_1.dashboardApi)().daywiseRcaReports({
|
|
1108
|
+
agentId: opts.agent,
|
|
1109
|
+
startDate: opts.since ? dateBound(opts.since, false) : undefined,
|
|
1110
|
+
endDate: opts.until ? dateBound(opts.until, true) : undefined,
|
|
1111
|
+
source: opts.source,
|
|
1112
|
+
page: Number(opts.page) || 1,
|
|
1113
|
+
pageSize: pageSize(opts.limit, 20),
|
|
1114
|
+
});
|
|
1115
|
+
if (opts.json)
|
|
1116
|
+
return void console.log(JSON.stringify(res?.data || res, null, 2));
|
|
1117
|
+
const rows = Array.isArray(res?.data) ? res.data : [];
|
|
1118
|
+
if (!rows.length)
|
|
1119
|
+
return void (0, ui_1.info)('No RCA reports.');
|
|
1120
|
+
(0, ui_1.table)(['DATE', 'AGENT', 'SOURCE', 'AUDITED', 'ROOT CAUSES', 'CONFIDENCE', 'GAPS'], rows.map((r) => [
|
|
1121
|
+
r.rcaDate || r.date || '',
|
|
1122
|
+
r.agentName || r.agentId || '',
|
|
1123
|
+
r.source || r.reportSource || '',
|
|
1124
|
+
r.auditedCalls ?? r.audited ?? '',
|
|
1125
|
+
r.rootCauseCount ?? '',
|
|
1126
|
+
r.confidence ?? '',
|
|
1127
|
+
Array.isArray(r.metricGaps) && r.metricGaps.length
|
|
1128
|
+
? r.metricGaps.map((g) => `${g.metricName}: ${g.actualPct}% vs ${g.targetPct}% (${g.gapPct > 0 ? '+' : ''}${g.gapPct}pp)`).join('; ')
|
|
1129
|
+
: '',
|
|
1130
|
+
]));
|
|
1131
|
+
}
|
|
1132
|
+
catch (err) {
|
|
1133
|
+
(0, ui_1.handleError)(err);
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
/** `cku kpi rca-timeline <agentId>` — day-by-day RCA execution events. */
|
|
1137
|
+
async function kpiRcaTimelineCommand(agentId, opts) {
|
|
1138
|
+
try {
|
|
1139
|
+
const res = await (0, dashboardApi_1.dashboardApi)().daywiseRcaTimeline(agentId, {
|
|
1140
|
+
startDate: opts.since ? dateBound(opts.since, false) : undefined,
|
|
1141
|
+
endDate: opts.until ? dateBound(opts.until, true) : undefined,
|
|
1142
|
+
});
|
|
1143
|
+
if (opts.json)
|
|
1144
|
+
return void console.log(JSON.stringify(res?.data || res, null, 2));
|
|
1145
|
+
const days = res?.data?.days || [];
|
|
1146
|
+
if (!days.length)
|
|
1147
|
+
return void (0, ui_1.info)('No timeline events.');
|
|
1148
|
+
for (const day of days) {
|
|
1149
|
+
(0, ui_1.info)(`\n${day.date || day.rcaDate || ''}`);
|
|
1150
|
+
(0, ui_1.table)(['TIME', 'STAGE', 'STEP', 'STATUS', 'TITLE', 'DETAIL'], (day.events || []).map((e) => [e.at || '', e.stage || '', e.step || '', e.status || '', clip(e.title, 40), clip(e.detail, 60)]));
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
catch (err) {
|
|
1154
|
+
(0, ui_1.handleError)(err);
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
/** `cku kpi rca-pdf <agentId> <date>` — download one RCA report PDF. */
|
|
1158
|
+
async function kpiRcaPdfCommand(agentId, rcaDate, opts) {
|
|
1159
|
+
try {
|
|
1160
|
+
const { bytes, filename } = await (0, dashboardApi_1.dashboardApi)().daywiseRcaPdf(agentId, rcaDate, opts.manual ? 'manual' : undefined);
|
|
1161
|
+
const file = opts.file || filename || `rca_${agentId}_${rcaDate}.pdf`;
|
|
1162
|
+
(0, fs_1.writeFileSync)(file, bytes);
|
|
1163
|
+
(0, ui_1.success)(`Wrote ${file} (${bytes.length} bytes).`);
|
|
1164
|
+
}
|
|
1165
|
+
catch (err) {
|
|
1166
|
+
(0, ui_1.handleError)(err);
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
/** `cku kpi rca-draft-prompt <agentId> --prompt <text>` — AI-draft the RCA prompt. */
|
|
1170
|
+
async function kpiRcaDraftPromptCommand(agentId, opts) {
|
|
1171
|
+
try {
|
|
1172
|
+
const current = await loadKpiConfig(agentId);
|
|
1173
|
+
const res = await (0, dashboardApi_1.dashboardApi)().generateRcaPromptDraft({
|
|
1174
|
+
agentId,
|
|
1175
|
+
text_input: opts.prompt,
|
|
1176
|
+
...(current.rca_prompt ? { existingRcaPrompt: current.rca_prompt } : {}),
|
|
1177
|
+
...(current.kpi_metrics ? { kpi_metrics: current.kpi_metrics } : {}),
|
|
1178
|
+
});
|
|
1179
|
+
const draft = res?.response || res?.data || '';
|
|
1180
|
+
if (opts.save) {
|
|
1181
|
+
return void (await saveKpiConfig(agentId, current, { rca_prompt: String(draft) }, opts.json, 'Saved generated RCA prompt.'));
|
|
1182
|
+
}
|
|
1183
|
+
if (opts.json)
|
|
1184
|
+
return void console.log(JSON.stringify(res, null, 2));
|
|
1185
|
+
console.log(typeof draft === 'string' ? draft : JSON.stringify(draft, null, 2));
|
|
1186
|
+
}
|
|
1187
|
+
catch (err) {
|
|
1188
|
+
(0, ui_1.handleError)(err);
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
const PHONE_PARAM = { key_name: 'phone_number', value: 'user_phone_number' };
|
|
1192
|
+
/** Parameters with the mandatory phone_number entry first (bundle's `PXe`). */
|
|
1193
|
+
function withPhoneParam(raw) {
|
|
1194
|
+
const extra = raw ? (0, setJson_1.readSetJson)(raw) : [];
|
|
1195
|
+
if (!Array.isArray(extra))
|
|
1196
|
+
throw new Error('--params must be a JSON array of {key_name, value}.');
|
|
1197
|
+
return [PHONE_PARAM, ...extra.filter((p) => p?.key_name !== 'phone_number')];
|
|
1198
|
+
}
|
|
1199
|
+
/** Replace the entry with the same name, or append. */
|
|
1200
|
+
function upsertByName(list, item) {
|
|
1201
|
+
const out = [...(list || [])];
|
|
1202
|
+
const i = out.findIndex((x) => x?.name === item.name);
|
|
1203
|
+
if (i >= 0)
|
|
1204
|
+
out[i] = item;
|
|
1205
|
+
else
|
|
1206
|
+
out.push(item);
|
|
1207
|
+
return out;
|
|
1208
|
+
}
|
|
1209
|
+
/** `cku kpi source add-api <agentId>` */
|
|
1210
|
+
async function kpiSourceAddApiCommand(agentId, opts) {
|
|
1211
|
+
try {
|
|
1212
|
+
if (!opts.name?.trim())
|
|
1213
|
+
throw new Error('--name is required.');
|
|
1214
|
+
if (!opts.url?.trim())
|
|
1215
|
+
throw new Error('--url is required.');
|
|
1216
|
+
const headers = opts.headers ? (0, setJson_1.readSetJson)(opts.headers) : {};
|
|
1217
|
+
const current = await loadKpiConfig(agentId);
|
|
1218
|
+
const item = { name: opts.name.trim(), url: opts.url.trim(), method: 'POST', headers, parameters: withPhoneParam(opts.params) };
|
|
1219
|
+
await saveKpiConfig(agentId, current, { api_endpoints: upsertByName(current.api_endpoints, item) }, opts.json, `API data source ${item.name} saved.`);
|
|
1220
|
+
}
|
|
1221
|
+
catch (err) {
|
|
1222
|
+
(0, ui_1.handleError)(err);
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
/** `cku kpi source add-python <agentId>` */
|
|
1226
|
+
async function kpiSourceAddPythonCommand(agentId, opts) {
|
|
1227
|
+
try {
|
|
1228
|
+
if (!opts.name?.trim())
|
|
1229
|
+
throw new Error('--name is required.');
|
|
1230
|
+
if (!opts.code)
|
|
1231
|
+
throw new Error('--code is required (inline, or @file.py).');
|
|
1232
|
+
const code = opts.code.startsWith('@') ? (0, fs_1.readFileSync)(opts.code.slice(1), 'utf8') : opts.code;
|
|
1233
|
+
if (!opts.skipVerify)
|
|
1234
|
+
await (0, dashboardApi_1.dashboardApi)().verifyKpiPythonCode(code);
|
|
1235
|
+
const current = await loadKpiConfig(agentId);
|
|
1236
|
+
const item = { name: opts.name.trim(), source_code: code, parameters: withPhoneParam(opts.params) };
|
|
1237
|
+
await saveKpiConfig(agentId, current, { python_data_sources: upsertByName(current.python_data_sources, item) }, opts.json, `Python data source ${item.name} saved.`);
|
|
1238
|
+
}
|
|
1239
|
+
catch (err) {
|
|
1240
|
+
(0, ui_1.handleError)(err);
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
/** `cku kpi source add-expr <agentId>` */
|
|
1244
|
+
async function kpiSourceAddExprCommand(agentId, opts) {
|
|
1245
|
+
try {
|
|
1246
|
+
if (!/^[A-Za-z][A-Za-z0-9_-]{0,63}$/.test(opts.name || '')) {
|
|
1247
|
+
throw new Error('--name must start with a letter, then letters, digits, _ or -, max 64 chars.');
|
|
1248
|
+
}
|
|
1249
|
+
const item = {
|
|
1250
|
+
name: opts.name,
|
|
1251
|
+
mode: opts.conditions ? 'conditions' : 'expression',
|
|
1252
|
+
conditions: opts.conditions ? (0, setJson_1.readSetJson)(opts.conditions) : [],
|
|
1253
|
+
expression: opts.expression || '',
|
|
1254
|
+
equals: true,
|
|
1255
|
+
consider_for: opts.considerFor === 'unique' ? 'unique' : 'all',
|
|
1256
|
+
};
|
|
1257
|
+
const current = await loadKpiConfig(agentId);
|
|
1258
|
+
await saveKpiConfig(agentId, current, { expression_data_sources: upsertByName(current.expression_data_sources, item) }, opts.json, `Expression data source ${item.name} saved.`);
|
|
1259
|
+
}
|
|
1260
|
+
catch (err) {
|
|
1261
|
+
(0, ui_1.handleError)(err);
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
/** `cku kpi source remove <agentId> <name>` */
|
|
1265
|
+
async function kpiSourceRemoveCommand(agentId, name, opts) {
|
|
1266
|
+
try {
|
|
1267
|
+
const current = await loadKpiConfig(agentId);
|
|
1268
|
+
const drop = (l) => (l || []).filter((x) => x?.name !== name);
|
|
1269
|
+
await saveKpiConfig(agentId, current, {
|
|
1270
|
+
api_endpoints: drop(current.api_endpoints),
|
|
1271
|
+
python_data_sources: drop(current.python_data_sources),
|
|
1272
|
+
expression_data_sources: drop(current.expression_data_sources),
|
|
1273
|
+
}, opts.json, `Data source ${name} removed.`);
|
|
1274
|
+
}
|
|
1275
|
+
catch (err) {
|
|
1276
|
+
(0, ui_1.handleError)(err);
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
/** `cku kpi metric set <agentId>` */
|
|
1280
|
+
async function kpiMetricSetCommand(agentId, opts) {
|
|
1281
|
+
try {
|
|
1282
|
+
if (!opts.name?.trim() || !opts.source?.trim() || opts.value === undefined || String(opts.value).trim() === '') {
|
|
1283
|
+
throw new Error('--name, --source and --value are all required.');
|
|
1284
|
+
}
|
|
1285
|
+
const current = await loadKpiConfig(agentId);
|
|
1286
|
+
const item = { name: opts.name.trim(), source: opts.source.trim(), value: String(opts.value) };
|
|
1287
|
+
await saveKpiConfig(agentId, current, { kpi_metrics: upsertByName(current.kpi_metrics, item) }, opts.json, `Metric ${item.name} saved.`);
|
|
1288
|
+
}
|
|
1289
|
+
catch (err) {
|
|
1290
|
+
(0, ui_1.handleError)(err);
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
/** `cku kpi metric remove <agentId> <name>` */
|
|
1294
|
+
async function kpiMetricRemoveCommand(agentId, name, opts) {
|
|
1295
|
+
try {
|
|
1296
|
+
if (name === 'connected_to_conversion_percentage') {
|
|
1297
|
+
throw new Error('connected_to_conversion_percentage is locked by the server and cannot be removed. Change it with: cku kpi target');
|
|
1298
|
+
}
|
|
1299
|
+
const current = await loadKpiConfig(agentId);
|
|
1300
|
+
await saveKpiConfig(agentId, current, { kpi_metrics: (current.kpi_metrics || []).filter((m) => m?.name !== name) }, opts.json, `Metric ${name} removed.`);
|
|
1301
|
+
}
|
|
1302
|
+
catch (err) {
|
|
1303
|
+
(0, ui_1.handleError)(err);
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
@@ -15,8 +15,11 @@ exports.waitForBatch = waitForBatch;
|
|
|
15
15
|
exports.simRunCommand = simRunCommand;
|
|
16
16
|
exports.simRunsListCommand = simRunsListCommand;
|
|
17
17
|
exports.simResultsCommand = simResultsCommand;
|
|
18
|
+
exports.simDraftFromCallCommand = simDraftFromCallCommand;
|
|
19
|
+
exports.simGenerateCommand = simGenerateCommand;
|
|
18
20
|
const prompts_1 = __importDefault(require("prompts"));
|
|
19
21
|
const session_1 = require("../lib/session");
|
|
22
|
+
const dashboardApi_1 = require("../lib/dashboardApi");
|
|
20
23
|
const ui_1 = require("../lib/ui");
|
|
21
24
|
const jsonInput_1 = require("./jsonInput");
|
|
22
25
|
/**
|
|
@@ -312,3 +315,68 @@ async function simResultsCommand(batchId, opts) {
|
|
|
312
315
|
(0, ui_1.handleError)(err);
|
|
313
316
|
}
|
|
314
317
|
}
|
|
318
|
+
/** `cku sim draft-from-call <callId>` — AI-draft a test case from a real call. */
|
|
319
|
+
async function simDraftFromCallCommand(callId, opts) {
|
|
320
|
+
try {
|
|
321
|
+
const res = await (0, dashboardApi_1.dashboardApi)().generateSimFromCall({
|
|
322
|
+
callId,
|
|
323
|
+
versionId: opts.version,
|
|
324
|
+
includeMetadata: opts.metadata !== false,
|
|
325
|
+
includeFunctions: opts.functions !== false,
|
|
326
|
+
});
|
|
327
|
+
const draft = res?.draft || res;
|
|
328
|
+
let saved;
|
|
329
|
+
if (opts.save && draft?.agentId) {
|
|
330
|
+
saved = await (0, session_1.requireApi)().createTestCase({
|
|
331
|
+
agentId: draft.agentId,
|
|
332
|
+
testcaseName: draft.testcaseName || `call-${callId}`,
|
|
333
|
+
userPersona: draft.userPersona,
|
|
334
|
+
userPrompt: draft.userPrompt,
|
|
335
|
+
successCriteria: draft.successCriteria,
|
|
336
|
+
testVariables: draft.testVariables || {},
|
|
337
|
+
testFunctions: draft.testFunctions || [],
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
if (opts.json)
|
|
341
|
+
return void console.log(JSON.stringify(saved ?? draft, null, 2));
|
|
342
|
+
(0, ui_1.keyValue)({ name: draft?.testcaseName, persona: draft?.userPersona, prompt: draft?.userPrompt, criteria: draft?.successCriteria });
|
|
343
|
+
if (saved)
|
|
344
|
+
(0, ui_1.success)('Test case saved.');
|
|
345
|
+
else if (opts.save)
|
|
346
|
+
(0, ui_1.info)('Draft has no agentId; nothing saved.');
|
|
347
|
+
else
|
|
348
|
+
(0, ui_1.info)('Draft only. Re-run with --save to create it.');
|
|
349
|
+
}
|
|
350
|
+
catch (err) {
|
|
351
|
+
(0, ui_1.handleError)(err);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
/** `cku sim generate <agentId> --hint <text>` — AI-draft a test case from a hint. */
|
|
355
|
+
async function simGenerateCommand(agentId, opts) {
|
|
356
|
+
try {
|
|
357
|
+
const res = await (0, dashboardApi_1.dashboardApi)().generateSimFromPrompt({ agentId, versionId: opts.version, hint: opts.hint });
|
|
358
|
+
const tc = res?.testCase || res;
|
|
359
|
+
let saved;
|
|
360
|
+
if (opts.save) {
|
|
361
|
+
saved = await (0, session_1.requireApi)().createTestCase({
|
|
362
|
+
agentId,
|
|
363
|
+
testcaseName: tc.testcaseName || 'generated-test',
|
|
364
|
+
userPersona: tc.userPersona,
|
|
365
|
+
userPrompt: tc.userPrompt,
|
|
366
|
+
successCriteria: tc.successCriteria,
|
|
367
|
+
testVariables: {},
|
|
368
|
+
testFunctions: [],
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
if (opts.json)
|
|
372
|
+
return void console.log(JSON.stringify(saved ?? tc, null, 2));
|
|
373
|
+
(0, ui_1.keyValue)({ name: tc?.testcaseName, persona: tc?.userPersona, prompt: tc?.userPrompt, criteria: tc?.successCriteria });
|
|
374
|
+
if (saved)
|
|
375
|
+
(0, ui_1.success)('Test case saved.');
|
|
376
|
+
else
|
|
377
|
+
(0, ui_1.info)('Draft only. Re-run with --save to create it.');
|
|
378
|
+
}
|
|
379
|
+
catch (err) {
|
|
380
|
+
(0, ui_1.handleError)(err);
|
|
381
|
+
}
|
|
382
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -34,6 +34,10 @@ const contacts_1 = require("./commands/contacts");
|
|
|
34
34
|
const skills_1 = require("./commands/skills");
|
|
35
35
|
const update_1 = require("./commands/update");
|
|
36
36
|
const analytics_1 = require("./commands/analytics");
|
|
37
|
+
const dnd_1 = require("./commands/dnd");
|
|
38
|
+
const feedback_1 = require("./commands/feedback");
|
|
39
|
+
const knowledge_1 = require("./commands/knowledge");
|
|
40
|
+
const aiTools_1 = require("./commands/aiTools");
|
|
37
41
|
const batches_1 = require("./commands/batches");
|
|
38
42
|
const simulations_1 = require("./commands/simulations");
|
|
39
43
|
const simVariables_1 = require("./commands/simVariables");
|
|
@@ -342,7 +346,8 @@ kpi
|
|
|
342
346
|
.command('assign')
|
|
343
347
|
.description('assign a card to a person, or to AI FDE')
|
|
344
348
|
.argument('<taskId>', 'task id — quote it in shells')
|
|
345
|
-
.
|
|
349
|
+
.option('--to <who>', 'team member id or name, or "ai_fde" (required unless --unassign)')
|
|
350
|
+
.option('--unassign', 'unassign the card')
|
|
346
351
|
.option('--agent <id>', 'agent to change (required for ai_fde)')
|
|
347
352
|
.option('--versions <ids>', 'destination version ids (required for ai_fde)')
|
|
348
353
|
.option('--version-names <names>', 'display names for the version ids')
|
|
@@ -462,8 +467,73 @@ kpi
|
|
|
462
467
|
.command('history')
|
|
463
468
|
.description('metric history for the given agents')
|
|
464
469
|
.requiredOption('--agents <ids>', 'comma-separated agent ids (see `cku kpi agents`)')
|
|
470
|
+
.option('--since <date>', 'start date')
|
|
471
|
+
.option('--until <date>', 'end date')
|
|
465
472
|
.option('--json', 'output raw JSON')
|
|
466
473
|
.action(kpi_1.kpiHistoryCommand);
|
|
474
|
+
kpi.command('import').description('import KPI cards from a JSON file')
|
|
475
|
+
.requiredOption('--file <path>', 'JSON file')
|
|
476
|
+
.option('--json', 'output raw JSON')
|
|
477
|
+
.action(kpi_1.kpiImportCommand);
|
|
478
|
+
kpi.command('detach <taskId> <url>').description('remove an attachment from a card')
|
|
479
|
+
.option('--json', 'output raw JSON')
|
|
480
|
+
.action(kpi_1.kpiDetachCommand);
|
|
481
|
+
kpi.command('rca-reports').description('daywise RCA reports')
|
|
482
|
+
.option('--agent <id>', 'agent id')
|
|
483
|
+
.option('--since <date>', 'start date')
|
|
484
|
+
.option('--until <date>', 'end date')
|
|
485
|
+
.option('--source <src>', 'report source')
|
|
486
|
+
.option('--page <n>', 'page number')
|
|
487
|
+
.option('--limit <n>', 'rows per page')
|
|
488
|
+
.option('--json', 'output raw JSON')
|
|
489
|
+
.action(kpi_1.kpiRcaReportsCommand);
|
|
490
|
+
kpi.command('rca-timeline <agentId>').description('day-by-day RCA execution events')
|
|
491
|
+
.option('--since <date>', 'start date')
|
|
492
|
+
.option('--until <date>', 'end date')
|
|
493
|
+
.option('--json', 'output raw JSON')
|
|
494
|
+
.action(kpi_1.kpiRcaTimelineCommand);
|
|
495
|
+
kpi.command('rca-pdf <agentId> <rcaDate>').description('download one RCA report as PDF')
|
|
496
|
+
.option('--manual', 'the manual-run report')
|
|
497
|
+
.option('--file <path>', 'output path')
|
|
498
|
+
.action(kpi_1.kpiRcaPdfCommand);
|
|
499
|
+
kpi.command('rca-draft <agentId>').description('AI-draft the RCA prompt')
|
|
500
|
+
.requiredOption('--prompt <text>', 'what the RCA should focus on')
|
|
501
|
+
.option('--save', 'save the draft to the agent KPI config')
|
|
502
|
+
.option('--json', 'output raw JSON')
|
|
503
|
+
.action(kpi_1.kpiRcaDraftPromptCommand);
|
|
504
|
+
kpi.command('add-api-source <agentId>').description('add or replace an API data source')
|
|
505
|
+
.requiredOption('--name <name>', 'source name')
|
|
506
|
+
.requiredOption('--url <url>', 'endpoint URL')
|
|
507
|
+
.option('--headers <json>', 'headers JSON or @file')
|
|
508
|
+
.option('--params <json>', 'parameters JSON or @file')
|
|
509
|
+
.option('--json', 'output raw JSON')
|
|
510
|
+
.action(kpi_1.kpiSourceAddApiCommand);
|
|
511
|
+
kpi.command('add-python-source <agentId>').description('add or replace a Python data source')
|
|
512
|
+
.requiredOption('--name <name>', 'source name')
|
|
513
|
+
.requiredOption('--code <code|@file>', 'Python code, or @file')
|
|
514
|
+
.option('--params <json>', 'parameters JSON or @file')
|
|
515
|
+
.option('--skip-verify', 'skip the verification run')
|
|
516
|
+
.option('--json', 'output raw JSON')
|
|
517
|
+
.action(kpi_1.kpiSourceAddPythonCommand);
|
|
518
|
+
kpi.command('add-expr-source <agentId>').description('add or replace an expression data source')
|
|
519
|
+
.requiredOption('--name <name>', 'source name')
|
|
520
|
+
.option('--expression <rule>', 'rule expression')
|
|
521
|
+
.option('--conditions <json>', 'conditions JSON or @file')
|
|
522
|
+
.option('--consider-for <all|unique>', 'count all calls or unique callers')
|
|
523
|
+
.option('--json', 'output raw JSON')
|
|
524
|
+
.action(kpi_1.kpiSourceAddExprCommand);
|
|
525
|
+
kpi.command('remove-source <agentId> <name>').description('remove a data source')
|
|
526
|
+
.option('--json', 'output raw JSON')
|
|
527
|
+
.action(kpi_1.kpiSourceRemoveCommand);
|
|
528
|
+
kpi.command('set-metric <agentId>').description('add or replace a metric')
|
|
529
|
+
.requiredOption('--name <name>', 'metric name')
|
|
530
|
+
.requiredOption('--source <src>', 'data source name')
|
|
531
|
+
.requiredOption('--value <val>', 'value to match')
|
|
532
|
+
.option('--json', 'output raw JSON')
|
|
533
|
+
.action(kpi_1.kpiMetricSetCommand);
|
|
534
|
+
kpi.command('remove-metric <agentId> <name>').description('remove a metric')
|
|
535
|
+
.option('--json', 'output raw JSON')
|
|
536
|
+
.action(kpi_1.kpiMetricRemoveCommand);
|
|
467
537
|
// Call analyzers and audit reports — also dashboard-side.
|
|
468
538
|
const analyzers = program
|
|
469
539
|
.command('analyzers')
|
|
@@ -490,6 +560,31 @@ analyzers
|
|
|
490
560
|
.description('per-strategy audit rollup')
|
|
491
561
|
.option('--json', 'output raw JSON')
|
|
492
562
|
.action(analyzers_1.analyzersAuditStrategiesCommand);
|
|
563
|
+
analyzers.command('summary <id>').description('analyzer summary rollup')
|
|
564
|
+
.option('--batch', 'id is a batch audit, not a call analyzer')
|
|
565
|
+
.option('--severity <sev>', 'filter by severity')
|
|
566
|
+
.option('--dimension <dim>', 'filter by dimension')
|
|
567
|
+
.option('--since <date>', 'start date')
|
|
568
|
+
.option('--until <date>', 'end date')
|
|
569
|
+
.option('--json', 'output raw JSON')
|
|
570
|
+
.action(analyzers_1.analyzersSummaryCommand);
|
|
571
|
+
analyzers.command('calls <id>').description('audited calls for an analyzer')
|
|
572
|
+
.option('--batch', 'id is a batch audit')
|
|
573
|
+
.option('--below-80', 'only calls scoring under 80')
|
|
574
|
+
.option('--severity <sev>', 'filter by severity')
|
|
575
|
+
.option('--dimension <dim>', 'filter by dimension')
|
|
576
|
+
.option('--category <cat>', 'filter by category')
|
|
577
|
+
.option('--var-name <name>', 'filter by call variable name')
|
|
578
|
+
.option('--var-value <val>', 'filter by call variable value')
|
|
579
|
+
.option('--sort <sort>', 'sort order')
|
|
580
|
+
.option('--page <n>', 'page number')
|
|
581
|
+
.option('--limit <n>', 'rows per page')
|
|
582
|
+
.option('--json', 'output raw JSON')
|
|
583
|
+
.action(analyzers_1.analyzersCallsCommand);
|
|
584
|
+
analyzers.command('call <id> <callId>').description('one call audit in full')
|
|
585
|
+
.option('--batch', 'id is a batch audit')
|
|
586
|
+
.option('--json', 'output raw JSON')
|
|
587
|
+
.action(analyzers_1.analyzersCallDetailCommand);
|
|
493
588
|
program
|
|
494
589
|
.command('config')
|
|
495
590
|
.description('show effective CLI settings and session status')
|
|
@@ -749,6 +844,39 @@ agents.command('ab-advanced <agentId>').description('rule-based A/B: if/elseif/e
|
|
|
749
844
|
.option('--disable', 'turn off advanced A/B testing')
|
|
750
845
|
.option('--json', 'raw JSON (with --show)')
|
|
751
846
|
.action(agentVersions_1.agentsAbAdvancedCommand);
|
|
847
|
+
agents.command('commits <agentId>').description('commit history of an agent (needs `cku dashboard login`)')
|
|
848
|
+
.option('--versions <id>', 'limit to one version')
|
|
849
|
+
.option('--page <n>', 'page number')
|
|
850
|
+
.option('--limit <n>', 'rows per page')
|
|
851
|
+
.option('--json', 'raw JSON')
|
|
852
|
+
.action(agentVersions_1.agentsCommitsCommand);
|
|
853
|
+
agents.command('commit <commitId>').description('show one commit')
|
|
854
|
+
.option('--json', 'raw JSON')
|
|
855
|
+
.action(agentVersions_1.agentsCommitShowCommand);
|
|
856
|
+
agents.command('diff <agentId>').description('diff two commits or two versions')
|
|
857
|
+
.option('--commits <idA,idB>', 'two commit ids')
|
|
858
|
+
.option('--versions <vA,vB>', 'two version ids')
|
|
859
|
+
.option('--json', 'raw JSON')
|
|
860
|
+
.action(agentVersions_1.agentsDiffCommand);
|
|
861
|
+
agents.command('revert <agentId> <commitId>').description('revert a version to a commit')
|
|
862
|
+
.option('--yes', 'skip confirmation')
|
|
863
|
+
.option('--json', 'raw JSON')
|
|
864
|
+
.action(agentVersions_1.agentsRevertCommand);
|
|
865
|
+
agents.command('save-v2 <agentId>').description('save a version with a commit message')
|
|
866
|
+
.option('--versions <v>', 'version id')
|
|
867
|
+
.requiredOption('--set <json|@file>', 'fields to save, JSON or @file')
|
|
868
|
+
.option('--message <msg>', 'commit message')
|
|
869
|
+
.option('--json', 'raw JSON')
|
|
870
|
+
.action(agentVersions_1.agentsSaveV2Command);
|
|
871
|
+
agents.command('delete-version <agentId> <versionId>').description('delete a version')
|
|
872
|
+
.option('--yes', 'skip confirmation')
|
|
873
|
+
.option('--json', 'raw JSON')
|
|
874
|
+
.action(agentVersions_1.agentsDeleteVersionCommand);
|
|
875
|
+
agents.command('duplicate <agentId>').description('duplicate an agent under a new name')
|
|
876
|
+
.requiredOption('--name <name>', 'name of the copy')
|
|
877
|
+
.option('--versions <ids>', 'version ids to copy')
|
|
878
|
+
.option('--json', 'raw JSON')
|
|
879
|
+
.action(agentVersions_1.agentsDuplicateCommand);
|
|
752
880
|
// --- chat agents -----------------------------------------------------------
|
|
753
881
|
const chatAgents = program.command('chat-agents').description('manage chat agents');
|
|
754
882
|
chatAgents.command('models').description('list models available for chat agents')
|
|
@@ -975,6 +1103,26 @@ analytics.command('version <agentId>').description('per-version analytics for an
|
|
|
975
1103
|
.option('--end <date>', 'end date')
|
|
976
1104
|
.option('--json', 'raw JSON')
|
|
977
1105
|
.action(analytics_1.analyticsVersionCommand);
|
|
1106
|
+
analytics.command('failed-responses').description('failed-response buckets (needs `cku dashboard login`)')
|
|
1107
|
+
.option('--agent <ids>', 'agent id(s), comma-separated')
|
|
1108
|
+
.option('--start <YYYY-MM-DD>', 'start date')
|
|
1109
|
+
.option('--end <YYYY-MM-DD>', 'end date')
|
|
1110
|
+
.option('--response <bucket>', 'drill into one bucket')
|
|
1111
|
+
.option('--limit <n>', 'rows')
|
|
1112
|
+
.option('--json', 'raw JSON')
|
|
1113
|
+
.action(analytics_1.analyticsFailedResponsesCommand);
|
|
1114
|
+
analytics.command('functions').description('function-call stats (needs `cku dashboard login`)')
|
|
1115
|
+
.option('--agent <ids>', 'agent id(s), comma-separated')
|
|
1116
|
+
.option('--start <YYYY-MM-DD>', 'start date')
|
|
1117
|
+
.option('--end <YYYY-MM-DD>', 'end date')
|
|
1118
|
+
.option('--json', 'raw JSON')
|
|
1119
|
+
.action(analytics_1.analyticsFunctionsCommand);
|
|
1120
|
+
analytics.command('chat').description('chat agent analytics (needs `cku dashboard login`)')
|
|
1121
|
+
.option('--agent <id>', 'chat agent id')
|
|
1122
|
+
.option('--start <YYYY-MM-DD>', 'start date')
|
|
1123
|
+
.option('--end <YYYY-MM-DD>', 'end date')
|
|
1124
|
+
.option('--json', 'raw JSON')
|
|
1125
|
+
.action(analytics_1.analyticsChatCommand);
|
|
978
1126
|
// --- batches ---------------------------------------------------------------
|
|
979
1127
|
const batches = program.command('batches').description('batch calls');
|
|
980
1128
|
batches.command('create').description('create a batch from a local CSV (uploads + starts dialing)')
|
|
@@ -1052,6 +1200,19 @@ sim.command('results <batchId>').description('results of a simulation run').opti
|
|
|
1052
1200
|
.option('--agent <agentId>', 'with --wait, the agent the batch belongs to')
|
|
1053
1201
|
.option('--timeout <seconds>', 'with --wait, give up after this long (default 600)')
|
|
1054
1202
|
.action(simulations_1.simResultsCommand);
|
|
1203
|
+
sim.command('draft-from-call <callId>').description('AI-draft a test case from a real call (needs `cku dashboard login`)')
|
|
1204
|
+
.requiredOption('--version <versionId>', 'agent version the call ran on')
|
|
1205
|
+
.option('--no-metadata', 'leave out call metadata')
|
|
1206
|
+
.option('--no-functions', 'leave out function mocks')
|
|
1207
|
+
.option('--save', 'save the draft as a test case')
|
|
1208
|
+
.option('--json', 'raw JSON')
|
|
1209
|
+
.action(simulations_1.simDraftFromCallCommand);
|
|
1210
|
+
sim.command('generate <agentId>').description('AI-draft a test case from a hint (needs `cku dashboard login`)')
|
|
1211
|
+
.requiredOption('--hint <text>', 'scenario to test')
|
|
1212
|
+
.option('--version <versionId>', 'agent version')
|
|
1213
|
+
.option('--save', 'save the draft as a test case')
|
|
1214
|
+
.option('--json', 'raw JSON')
|
|
1215
|
+
.action(simulations_1.simGenerateCommand);
|
|
1055
1216
|
// Saved variable sets are dashboard-only (cookie-authed): they need `cku dashboard login`.
|
|
1056
1217
|
const simVars = sim.command('variables').description('saved variable sets for test cases (needs `cku dashboard login`)');
|
|
1057
1218
|
simVars.command('list <agentId>').description('list saved variable sets').option('--json', 'raw JSON')
|
|
@@ -1174,6 +1335,71 @@ ${chalk_1.default.bold('Examples:')}
|
|
|
1174
1335
|
${chalk_1.default.cyan(`${name} agents update <agentId> --set '{"name":"New"}' --commit "rename"`)}
|
|
1175
1336
|
${chalk_1.default.cyan(`${name} calls make --agent <id> --to <number> --test`)} place a test call
|
|
1176
1337
|
`);
|
|
1338
|
+
// --- DND, feedback, knowledge, AI helpers (dashboard session) ---------------
|
|
1339
|
+
const dnd = program.command('dnd').description('do-not-disturb list (needs `cku dashboard login`)');
|
|
1340
|
+
dnd.command('list').description('list DND numbers')
|
|
1341
|
+
.option('--page <n>', 'page').option('--limit <n>', 'rows').option('--search <text>', 'search')
|
|
1342
|
+
.option('--since <date>', 'from').option('--until <date>', 'to').option('--json', 'raw JSON')
|
|
1343
|
+
.action(dnd_1.dndListCommand);
|
|
1344
|
+
dnd.command('add <phone>').description('add a number').option('--json', 'raw JSON').action(dnd_1.dndAddCommand);
|
|
1345
|
+
dnd.command('update <id> <phone>').description('change a number').option('--json', 'raw JSON').action(dnd_1.dndUpdateCommand);
|
|
1346
|
+
dnd.command('remove <ids>').description('remove entries (comma-separated ids)')
|
|
1347
|
+
.option('--yes', 'skip confirmation').option('--json', 'raw JSON').action(dnd_1.dndRemoveCommand);
|
|
1348
|
+
dnd.command('import').description('bulk add numbers')
|
|
1349
|
+
.option('--phones <csv>', 'comma-separated numbers')
|
|
1350
|
+
.option('--file <path>', 'file with numbers (comma/newline list or JSON array)')
|
|
1351
|
+
.option('--json', 'raw JSON').action(dnd_1.dndImportCommand);
|
|
1352
|
+
const feedback = program.command('feedback').description('call feedback tickets (needs `cku dashboard login`)');
|
|
1353
|
+
feedback.command('list').description('list tickets')
|
|
1354
|
+
.option('--status <status>', 'ticket status (default processing)').option('--page <n>', 'page').option('--json', 'raw JSON')
|
|
1355
|
+
.action(feedback_1.feedbackListCommand);
|
|
1356
|
+
feedback.command('create').description('open a ticket about a call')
|
|
1357
|
+
.option('--call <callId>', 'call with the issue')
|
|
1358
|
+
.option('--version <versionId>', 'agent version')
|
|
1359
|
+
.option('--engineer <id>', 'engineer to assign')
|
|
1360
|
+
.option('--name <title>', 'ticket title')
|
|
1361
|
+
.option('--issue <text>', 'what went wrong')
|
|
1362
|
+
.option('--json', 'raw JSON')
|
|
1363
|
+
.action(feedback_1.feedbackCreateCommand);
|
|
1364
|
+
feedback.command('comment <id> <text>').description('comment on a ticket').option('--json', 'raw JSON').action(feedback_1.feedbackCommentCommand);
|
|
1365
|
+
feedback.command('submit-review <id>').description('submit a ticket for review')
|
|
1366
|
+
.option('--calls <urls>', 'resolved call URLs, comma-separated')
|
|
1367
|
+
.option('--version-url <url>', 'resolved version URL')
|
|
1368
|
+
.option('--comment <text>', 'comment')
|
|
1369
|
+
.option('--json', 'raw JSON')
|
|
1370
|
+
.action(feedback_1.feedbackSubmitReviewCommand);
|
|
1371
|
+
feedback.command('reopen <id>').description('reopen a ticket')
|
|
1372
|
+
.option('--comment <text>', 'why').option('--json', 'raw JSON').action(feedback_1.feedbackReopenCommand);
|
|
1373
|
+
feedback.command('resolve <id>').description('resolve a ticket')
|
|
1374
|
+
.option('--comment <text>', 'comment').option('--json', 'raw JSON').action(feedback_1.feedbackResolveCommand);
|
|
1375
|
+
const knowledge = program.command('knowledge').description('knowledge base (needs `cku dashboard login`)');
|
|
1376
|
+
knowledge.command('list').description('list knowledge documents').option('--json', 'raw JSON').action(knowledge_1.knowledgeListCommand);
|
|
1377
|
+
knowledge.command('delete <id>').description('delete a document')
|
|
1378
|
+
.option('--yes', 'skip confirmation').option('--json', 'raw JSON').action(knowledge_1.knowledgeDeleteCommand);
|
|
1379
|
+
const ai = program.command('ai').description('AI drafting helpers (needs `cku dashboard login`)');
|
|
1380
|
+
ai.command('function').description('draft function code from a prompt')
|
|
1381
|
+
.option('--prompt <text>', 'what the function should do')
|
|
1382
|
+
.option('--name <name>', 'function name').option('--description <desc>', 'function description')
|
|
1383
|
+
.option('--type <type>', 'function type')
|
|
1384
|
+
.option('--code <code|@file>', 'existing code to edit')
|
|
1385
|
+
.option('--vars <csv>', 'prompt variables, comma-separated')
|
|
1386
|
+
.option('--chat', 'chat-agent function')
|
|
1387
|
+
.option('--json', 'raw JSON')
|
|
1388
|
+
.action(aiTools_1.aiGenerateFunctionCommand);
|
|
1389
|
+
ai.command('postcall').description('draft post-call config')
|
|
1390
|
+
.option('--set <json|@file>', 'request body, JSON or @file').option('--json', 'raw JSON')
|
|
1391
|
+
.action(aiTools_1.aiGeneratePostcallCommand);
|
|
1392
|
+
ai.command('audit-strategy <agentId>').description('draft an audit strategy for an agent')
|
|
1393
|
+
.option('--prompt <text>', 'guidance').option('--existing <text>', 'existing strategy to refine').option('--json', 'raw JSON')
|
|
1394
|
+
.action(aiTools_1.aiGenerateAuditStrategyCommand);
|
|
1395
|
+
ai.command('callflow-summary <agentId>').description('draft a call-flow summary for an agent')
|
|
1396
|
+
.option('--prompt <text>', 'guidance').option('--existing <text>', 'existing summary to refine').option('--json', 'raw JSON')
|
|
1397
|
+
.action(aiTools_1.aiGenerateCallflowSummaryCommand);
|
|
1398
|
+
ai.command('workflow-code').description('draft workflow step code')
|
|
1399
|
+
.option('--prompt <text>', 'what the step should do').option('--name <name>', 'step name')
|
|
1400
|
+
.option('--key <key>', 'step key').option('--existing <code|@file>', 'existing code')
|
|
1401
|
+
.option('--json', 'raw JSON')
|
|
1402
|
+
.action(aiTools_1.aiGenerateWorkflowCodeCommand);
|
|
1177
1403
|
// Bare invocation → show help instead of an error.
|
|
1178
1404
|
if (process.argv.length <= 2) {
|
|
1179
1405
|
program.outputHelp();
|