callkaro-cli-unofficial 0.7.2 → 0.9.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/admin.js +144 -0
- package/dist/commands/agentVersions.js +192 -0
- package/dist/commands/aiTools.js +64 -0
- package/dist/commands/analytics.js +66 -0
- package/dist/commands/analyzers.js +149 -0
- package/dist/commands/chatAgents.js +22 -0
- package/dist/commands/chatAuditStrategies.js +20 -0
- package/dist/commands/dashboardApiCmd.js +7 -1
- package/dist/commands/dnd.js +105 -0
- package/dist/commands/feedback.js +84 -0
- package/dist/commands/folders.js +75 -0
- package/dist/commands/knowledge.js +33 -0
- package/dist/commands/kpi.js +262 -1
- package/dist/commands/platformExtras.js +374 -0
- package/dist/commands/simulations.js +68 -0
- package/dist/commands/voices.js +29 -0
- package/dist/index.js +414 -1
- package/dist/lib/adminApi.js +50 -3
- package/dist/lib/dashboardApi.js +394 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
3
36
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
37
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
38
|
};
|
|
@@ -28,12 +61,18 @@ const calls_1 = require("./commands/calls");
|
|
|
28
61
|
const ongoing_1 = require("./commands/ongoing");
|
|
29
62
|
const transcribers_1 = require("./commands/transcribers");
|
|
30
63
|
const voices_1 = require("./commands/voices");
|
|
64
|
+
const px = __importStar(require("./commands/platformExtras"));
|
|
65
|
+
const folders_1 = require("./commands/folders");
|
|
31
66
|
const secrets_1 = require("./commands/secrets");
|
|
32
67
|
const workflows_1 = require("./commands/workflows");
|
|
33
68
|
const contacts_1 = require("./commands/contacts");
|
|
34
69
|
const skills_1 = require("./commands/skills");
|
|
35
70
|
const update_1 = require("./commands/update");
|
|
36
71
|
const analytics_1 = require("./commands/analytics");
|
|
72
|
+
const dnd_1 = require("./commands/dnd");
|
|
73
|
+
const feedback_1 = require("./commands/feedback");
|
|
74
|
+
const knowledge_1 = require("./commands/knowledge");
|
|
75
|
+
const aiTools_1 = require("./commands/aiTools");
|
|
37
76
|
const batches_1 = require("./commands/batches");
|
|
38
77
|
const simulations_1 = require("./commands/simulations");
|
|
39
78
|
const simVariables_1 = require("./commands/simVariables");
|
|
@@ -256,6 +295,41 @@ admin
|
|
|
256
295
|
.description('clear the console-wide voice cache')
|
|
257
296
|
.option('--yes', 'skip the confirmation')
|
|
258
297
|
.action(admin_1.adminVoiceCacheCommand);
|
|
298
|
+
admin
|
|
299
|
+
.command('bot-failures <agentId>')
|
|
300
|
+
.description('failed LLM/TTS responses (or --api: failed external API calls) for a bot')
|
|
301
|
+
.option('--api', 'show failed external API responses instead')
|
|
302
|
+
.option('--response <text>', 'drill into one failed response: list its call ids')
|
|
303
|
+
.option('--endpoint <url>', 'with --api --response: narrow to one endpoint')
|
|
304
|
+
.option('--version <id>', 'limit to one agent version')
|
|
305
|
+
.option('--start <YYYY-MM-DD>', 'window start (default: a month ago)')
|
|
306
|
+
.option('--end <YYYY-MM-DD>', 'window end (default: today)')
|
|
307
|
+
.option('--limit <n>', 'max call ids with --response', '20')
|
|
308
|
+
.option('--json', 'raw JSON')
|
|
309
|
+
.action(admin_1.adminBotFailuresCommand);
|
|
310
|
+
admin.command('client-agents <clientId>').description("list a client account's agents")
|
|
311
|
+
.option('--json', 'raw JSON').action(admin_1.adminClientAgentsCommand);
|
|
312
|
+
admin.command('client-versions <agentId>').description("list an agent's versions via the console")
|
|
313
|
+
.option('--json', 'raw JSON').action(admin_1.adminClientAgentVersionsCommand);
|
|
314
|
+
const adminContext = admin.command('context').description('FDE reference agent library & semantic search (fde-api.callkaro.ai)');
|
|
315
|
+
adminContext.command('list').description('list indexed reference versions')
|
|
316
|
+
.option('--search <text>', 'filter by version id, use case, description or tags').option('--json', 'raw JSON')
|
|
317
|
+
.action(admin_1.adminContextListCommand);
|
|
318
|
+
adminContext.command('search <query>').description('semantic search over reference versions')
|
|
319
|
+
.option('--top-k <n>', 'max results', '3').option('--min-score <n>', 'minimum score', '0.5').option('--json', 'raw JSON')
|
|
320
|
+
.action(admin_1.adminContextSearchCommand);
|
|
321
|
+
for (const [name, update] of [['add', false], ['update', true]]) {
|
|
322
|
+
adminContext.command(`${name} <versionId>`).description(`${update ? 'update' : 'index'} a reference version`)
|
|
323
|
+
.option('--description <text>', 'what the agent does (required)')
|
|
324
|
+
.option('--use-case <text>', 'use case label')
|
|
325
|
+
.option('--tags <csv>', 'comma-separated tags')
|
|
326
|
+
.option('--set <json|@file>', 'JSON with description/useCase/tags/metadata')
|
|
327
|
+
.option('--json', 'raw JSON')
|
|
328
|
+
.action((versionId, opts) => (0, admin_1.adminContextSetCommand)(versionId, { ...opts, update }));
|
|
329
|
+
}
|
|
330
|
+
adminContext.command('remove <versionId>').description('remove a reference version from the index')
|
|
331
|
+
.option('--yes', 'skip the confirmation').option('--json', 'raw JSON')
|
|
332
|
+
.action(admin_1.adminContextRemoveCommand);
|
|
259
333
|
admin
|
|
260
334
|
.command('api <method> <path>')
|
|
261
335
|
.description('call any admin route with the stored session (the token never leaves the CLI)')
|
|
@@ -342,7 +416,8 @@ kpi
|
|
|
342
416
|
.command('assign')
|
|
343
417
|
.description('assign a card to a person, or to AI FDE')
|
|
344
418
|
.argument('<taskId>', 'task id — quote it in shells')
|
|
345
|
-
.
|
|
419
|
+
.option('--to <who>', 'team member id or name, or "ai_fde" (required unless --unassign)')
|
|
420
|
+
.option('--unassign', 'unassign the card')
|
|
346
421
|
.option('--agent <id>', 'agent to change (required for ai_fde)')
|
|
347
422
|
.option('--versions <ids>', 'destination version ids (required for ai_fde)')
|
|
348
423
|
.option('--version-names <names>', 'display names for the version ids')
|
|
@@ -462,8 +537,73 @@ kpi
|
|
|
462
537
|
.command('history')
|
|
463
538
|
.description('metric history for the given agents')
|
|
464
539
|
.requiredOption('--agents <ids>', 'comma-separated agent ids (see `cku kpi agents`)')
|
|
540
|
+
.option('--since <date>', 'start date')
|
|
541
|
+
.option('--until <date>', 'end date')
|
|
465
542
|
.option('--json', 'output raw JSON')
|
|
466
543
|
.action(kpi_1.kpiHistoryCommand);
|
|
544
|
+
kpi.command('import').description('import KPI cards from a JSON file')
|
|
545
|
+
.requiredOption('--file <path>', 'JSON file')
|
|
546
|
+
.option('--json', 'output raw JSON')
|
|
547
|
+
.action(kpi_1.kpiImportCommand);
|
|
548
|
+
kpi.command('detach <taskId> <url>').description('remove an attachment from a card')
|
|
549
|
+
.option('--json', 'output raw JSON')
|
|
550
|
+
.action(kpi_1.kpiDetachCommand);
|
|
551
|
+
kpi.command('rca-reports').description('daywise RCA reports')
|
|
552
|
+
.option('--agent <id>', 'agent id')
|
|
553
|
+
.option('--since <date>', 'start date')
|
|
554
|
+
.option('--until <date>', 'end date')
|
|
555
|
+
.option('--source <src>', 'report source')
|
|
556
|
+
.option('--page <n>', 'page number')
|
|
557
|
+
.option('--limit <n>', 'rows per page')
|
|
558
|
+
.option('--json', 'output raw JSON')
|
|
559
|
+
.action(kpi_1.kpiRcaReportsCommand);
|
|
560
|
+
kpi.command('rca-timeline <agentId>').description('day-by-day RCA execution events')
|
|
561
|
+
.option('--since <date>', 'start date')
|
|
562
|
+
.option('--until <date>', 'end date')
|
|
563
|
+
.option('--json', 'output raw JSON')
|
|
564
|
+
.action(kpi_1.kpiRcaTimelineCommand);
|
|
565
|
+
kpi.command('rca-pdf <agentId> <rcaDate>').description('download one RCA report as PDF')
|
|
566
|
+
.option('--manual', 'the manual-run report')
|
|
567
|
+
.option('--file <path>', 'output path')
|
|
568
|
+
.action(kpi_1.kpiRcaPdfCommand);
|
|
569
|
+
kpi.command('rca-draft <agentId>').description('AI-draft the RCA prompt')
|
|
570
|
+
.requiredOption('--prompt <text>', 'what the RCA should focus on')
|
|
571
|
+
.option('--save', 'save the draft to the agent KPI config')
|
|
572
|
+
.option('--json', 'output raw JSON')
|
|
573
|
+
.action(kpi_1.kpiRcaDraftPromptCommand);
|
|
574
|
+
kpi.command('add-api-source <agentId>').description('add or replace an API data source')
|
|
575
|
+
.requiredOption('--name <name>', 'source name')
|
|
576
|
+
.requiredOption('--url <url>', 'endpoint URL')
|
|
577
|
+
.option('--headers <json>', 'headers JSON or @file')
|
|
578
|
+
.option('--params <json>', 'parameters JSON or @file')
|
|
579
|
+
.option('--json', 'output raw JSON')
|
|
580
|
+
.action(kpi_1.kpiSourceAddApiCommand);
|
|
581
|
+
kpi.command('add-python-source <agentId>').description('add or replace a Python data source')
|
|
582
|
+
.requiredOption('--name <name>', 'source name')
|
|
583
|
+
.requiredOption('--code <code|@file>', 'Python code, or @file')
|
|
584
|
+
.option('--params <json>', 'parameters JSON or @file')
|
|
585
|
+
.option('--skip-verify', 'skip the verification run')
|
|
586
|
+
.option('--json', 'output raw JSON')
|
|
587
|
+
.action(kpi_1.kpiSourceAddPythonCommand);
|
|
588
|
+
kpi.command('add-expr-source <agentId>').description('add or replace an expression data source')
|
|
589
|
+
.requiredOption('--name <name>', 'source name')
|
|
590
|
+
.option('--expression <rule>', 'rule expression')
|
|
591
|
+
.option('--conditions <json>', 'conditions JSON or @file')
|
|
592
|
+
.option('--consider-for <all|unique>', 'count all calls or unique callers')
|
|
593
|
+
.option('--json', 'output raw JSON')
|
|
594
|
+
.action(kpi_1.kpiSourceAddExprCommand);
|
|
595
|
+
kpi.command('remove-source <agentId> <name>').description('remove a data source')
|
|
596
|
+
.option('--json', 'output raw JSON')
|
|
597
|
+
.action(kpi_1.kpiSourceRemoveCommand);
|
|
598
|
+
kpi.command('set-metric <agentId>').description('add or replace a metric')
|
|
599
|
+
.requiredOption('--name <name>', 'metric name')
|
|
600
|
+
.requiredOption('--source <src>', 'data source name')
|
|
601
|
+
.requiredOption('--value <val>', 'value to match')
|
|
602
|
+
.option('--json', 'output raw JSON')
|
|
603
|
+
.action(kpi_1.kpiMetricSetCommand);
|
|
604
|
+
kpi.command('remove-metric <agentId> <name>').description('remove a metric')
|
|
605
|
+
.option('--json', 'output raw JSON')
|
|
606
|
+
.action(kpi_1.kpiMetricRemoveCommand);
|
|
467
607
|
// Call analyzers and audit reports — also dashboard-side.
|
|
468
608
|
const analyzers = program
|
|
469
609
|
.command('analyzers')
|
|
@@ -490,6 +630,37 @@ analyzers
|
|
|
490
630
|
.description('per-strategy audit rollup')
|
|
491
631
|
.option('--json', 'output raw JSON')
|
|
492
632
|
.action(analyzers_1.analyzersAuditStrategiesCommand);
|
|
633
|
+
analyzers.command('batches').description('list batch analysis runs').option('--json', 'raw JSON').action(analyzers_1.analyzersBatchListCommand);
|
|
634
|
+
analyzers.command('batch-create').description('start a batch analysis run')
|
|
635
|
+
.requiredOption('--set <json|@file>', 'request body').option('--json', 'raw JSON').action(analyzers_1.analyzersBatchCreateCommand);
|
|
636
|
+
analyzers.command('batch-calls <batchId>').description('calls in a batch analysis run')
|
|
637
|
+
.option('--page <n>', 'page number', '1').option('--export', 'export mode').option('--json', 'raw JSON')
|
|
638
|
+
.action(analyzers_1.analyzersBatchCallsCommand);
|
|
639
|
+
analyzers.command('summary <id>').description('analyzer summary rollup')
|
|
640
|
+
.option('--batch', 'id is a batch audit, not a call analyzer')
|
|
641
|
+
.option('--severity <sev>', 'filter by severity')
|
|
642
|
+
.option('--dimension <dim>', 'filter by dimension')
|
|
643
|
+
.option('--since <date>', 'start date')
|
|
644
|
+
.option('--until <date>', 'end date')
|
|
645
|
+
.option('--json', 'output raw JSON')
|
|
646
|
+
.action(analyzers_1.analyzersSummaryCommand);
|
|
647
|
+
analyzers.command('calls <id>').description('audited calls for an analyzer')
|
|
648
|
+
.option('--batch', 'id is a batch audit')
|
|
649
|
+
.option('--below-80', 'only calls scoring under 80')
|
|
650
|
+
.option('--severity <sev>', 'filter by severity')
|
|
651
|
+
.option('--dimension <dim>', 'filter by dimension')
|
|
652
|
+
.option('--category <cat>', 'filter by category')
|
|
653
|
+
.option('--var-name <name>', 'filter by call variable name')
|
|
654
|
+
.option('--var-value <val>', 'filter by call variable value')
|
|
655
|
+
.option('--sort <sort>', 'sort order')
|
|
656
|
+
.option('--page <n>', 'page number')
|
|
657
|
+
.option('--limit <n>', 'rows per page')
|
|
658
|
+
.option('--json', 'output raw JSON')
|
|
659
|
+
.action(analyzers_1.analyzersCallsCommand);
|
|
660
|
+
analyzers.command('call <id> <callId>').description('one call audit in full')
|
|
661
|
+
.option('--batch', 'id is a batch audit')
|
|
662
|
+
.option('--json', 'output raw JSON')
|
|
663
|
+
.action(analyzers_1.analyzersCallDetailCommand);
|
|
493
664
|
program
|
|
494
665
|
.command('config')
|
|
495
666
|
.description('show effective CLI settings and session status')
|
|
@@ -725,6 +896,12 @@ agents.command('set-whatsapp-outbound <agentId>').description("set/clear an agen
|
|
|
725
896
|
.option('--clear', 'clear the outbound number')
|
|
726
897
|
.action(agentPhone_1.setWhatsappOutboundCommand);
|
|
727
898
|
// Version management: clone, publish, activate, A/B testing
|
|
899
|
+
agents.command('set-languages <agentId>').description('set switchable languages on several versions at once (dashboard session)')
|
|
900
|
+
.requiredOption('--languages <csv>', 'language codes, e.g. en,hi')
|
|
901
|
+
.requiredOption('--versions <ids>', 'comma-separated version ids')
|
|
902
|
+
.option('--json', 'raw JSON').action(agentVersions_1.agentsSetLanguagesCommand);
|
|
903
|
+
agents.command('postcall-info <agentId>').description('post-call variables and drop-off reasons (dashboard session)')
|
|
904
|
+
.option('--json', 'raw JSON').action(agentVersions_1.agentsPostcallInfoCommand);
|
|
728
905
|
agents.command('clone-version <agentId>').description('clone a version with a required target prompt mode and language')
|
|
729
906
|
.option('--versions <id>', 'source version id')
|
|
730
907
|
.option('--name <name>', 'name for the new version')
|
|
@@ -749,8 +926,44 @@ agents.command('ab-advanced <agentId>').description('rule-based A/B: if/elseif/e
|
|
|
749
926
|
.option('--disable', 'turn off advanced A/B testing')
|
|
750
927
|
.option('--json', 'raw JSON (with --show)')
|
|
751
928
|
.action(agentVersions_1.agentsAbAdvancedCommand);
|
|
929
|
+
agents.command('commits <agentId>').description('commit history of an agent (needs `cku dashboard login`)')
|
|
930
|
+
.option('--versions <id>', 'limit to one version')
|
|
931
|
+
.option('--page <n>', 'page number')
|
|
932
|
+
.option('--limit <n>', 'rows per page')
|
|
933
|
+
.option('--json', 'raw JSON')
|
|
934
|
+
.action(agentVersions_1.agentsCommitsCommand);
|
|
935
|
+
agents.command('commit <commitId>').description('show one commit')
|
|
936
|
+
.option('--json', 'raw JSON')
|
|
937
|
+
.action(agentVersions_1.agentsCommitShowCommand);
|
|
938
|
+
agents.command('diff <agentId>').description('diff two commits or two versions')
|
|
939
|
+
.option('--commits <idA,idB>', 'two commit ids')
|
|
940
|
+
.option('--versions <vA,vB>', 'two version ids')
|
|
941
|
+
.option('--json', 'raw JSON')
|
|
942
|
+
.action(agentVersions_1.agentsDiffCommand);
|
|
943
|
+
agents.command('revert <agentId> <commitId>').description('revert a version to a commit')
|
|
944
|
+
.option('--yes', 'skip confirmation')
|
|
945
|
+
.option('--json', 'raw JSON')
|
|
946
|
+
.action(agentVersions_1.agentsRevertCommand);
|
|
947
|
+
agents.command('save-v2 <agentId>').description('save a version with a commit message')
|
|
948
|
+
.option('--versions <v>', 'version id')
|
|
949
|
+
.requiredOption('--set <json|@file>', 'fields to save, JSON or @file')
|
|
950
|
+
.option('--message <msg>', 'commit message')
|
|
951
|
+
.option('--json', 'raw JSON')
|
|
952
|
+
.action(agentVersions_1.agentsSaveV2Command);
|
|
953
|
+
agents.command('delete-version <agentId> <versionId>').description('delete a version')
|
|
954
|
+
.option('--yes', 'skip confirmation')
|
|
955
|
+
.option('--json', 'raw JSON')
|
|
956
|
+
.action(agentVersions_1.agentsDeleteVersionCommand);
|
|
957
|
+
agents.command('duplicate <agentId>').description('duplicate an agent under a new name')
|
|
958
|
+
.requiredOption('--name <name>', 'name of the copy')
|
|
959
|
+
.option('--versions <ids>', 'version ids to copy')
|
|
960
|
+
.option('--json', 'raw JSON')
|
|
961
|
+
.action(agentVersions_1.agentsDuplicateCommand);
|
|
752
962
|
// --- chat agents -----------------------------------------------------------
|
|
753
963
|
const chatAgents = program.command('chat-agents').description('manage chat agents');
|
|
964
|
+
chatAgents.command('diff <chatAgentId>').description('compare two versions or two commits of a chat agent (dashboard session)')
|
|
965
|
+
.option('--versions <vA,vB>', 'two version ids').option('--commits <cA,cB>', 'two commit ids').option('--json', 'raw JSON')
|
|
966
|
+
.action(chatAgents_1.chatAgentsDiffCommand);
|
|
754
967
|
chatAgents.command('models').description('list models available for chat agents')
|
|
755
968
|
.option('--json', 'output raw JSON').option('--file <path>', 'save JSON to a file')
|
|
756
969
|
.action(chatAgents_1.chatAgentsModelsCommand);
|
|
@@ -888,6 +1101,105 @@ program
|
|
|
888
1101
|
.option('--fields', 'show the voice_configuration keys a provider takes (needs --provider)')
|
|
889
1102
|
.option('--json', 'raw JSON')
|
|
890
1103
|
.action(voices_1.voicesCommand);
|
|
1104
|
+
program
|
|
1105
|
+
.command('voice-preview')
|
|
1106
|
+
.description('synthesize TTS preview audio to a file (POST /v2/agents/voice-preview)')
|
|
1107
|
+
.requiredOption('--text <text>', 'text to speak')
|
|
1108
|
+
.option('--agent <agentId>', 'read voice_configuration from this agent')
|
|
1109
|
+
.option('--versions <versionId>', 'version of --agent')
|
|
1110
|
+
.option('--set <json|@file>', 'voice_configuration JSON object')
|
|
1111
|
+
.option('--file <path>', 'output audio file (default: voice_preview.mp3)')
|
|
1112
|
+
.action(voices_1.voicesPreviewCommand);
|
|
1113
|
+
const folders = program.command('folders').description('manage agent folders (dashboard session)');
|
|
1114
|
+
folders.command('list').description('list folders with agent counts').option('--json', 'raw JSON').action(folders_1.foldersListCommand);
|
|
1115
|
+
folders.command('create <name>').description('create a folder').option('--json', 'raw JSON').action(folders_1.foldersCreateCommand);
|
|
1116
|
+
folders.command('rename <folderId> <name>').description('rename a folder').option('--json', 'raw JSON').action(folders_1.foldersRenameCommand);
|
|
1117
|
+
folders.command('delete <folderId>').description('delete a folder').option('--yes', 'skip the confirmation').option('--json', 'raw JSON').action(folders_1.foldersDeleteCommand);
|
|
1118
|
+
folders.command('move <folderId>').description('move agents into a folder')
|
|
1119
|
+
.requiredOption('--agents <ids>', 'comma-separated agent ids').option('--json', 'raw JSON').action(folders_1.foldersMoveCommand);
|
|
1120
|
+
// --- Platform extras (dashboard session): inbox, wa-campaigns, finetune, team, compliance, verified-numbers, integrations ---
|
|
1121
|
+
const J = '--json';
|
|
1122
|
+
const JD = 'raw JSON';
|
|
1123
|
+
const YD = 'skip the confirmation';
|
|
1124
|
+
const inbox = program.command('inbox').description('WhatsApp/voice inbox and human handoff (dashboard session)');
|
|
1125
|
+
inbox.command('list').description('list inbox threads')
|
|
1126
|
+
.option('--page <n>', 'page').option('--channel <c>', 'channel filter').option('--search <q>', 'search text')
|
|
1127
|
+
.option('--number <agentPhone>', 'agent phone number').option('--since <date>', 'from date').option('--until <date>', 'to date')
|
|
1128
|
+
.option(J, JD).action(px.inboxListCommand);
|
|
1129
|
+
inbox.command('unread').description('contacts with unread messages').option(J, JD).action(px.inboxUnreadCommand);
|
|
1130
|
+
inbox.command('handoffs').description('chats currently handed to a human')
|
|
1131
|
+
.option('--channel <c>', 'channel filter').option(J, JD).action(px.inboxHandoffsCommand);
|
|
1132
|
+
inbox.command('release <fromId>').description('release a human handoff back to the agent')
|
|
1133
|
+
.requiredOption('--channel <c>', 'channel of the handoff').option('--to-id <id>', 'hand to this id instead').option(J, JD).action(px.inboxReleaseHandoffCommand);
|
|
1134
|
+
inbox.command('contact <phone>').description('message history for one contact')
|
|
1135
|
+
.option('--page <n>', 'page').option('--limit <n>', 'page size (default 25)')
|
|
1136
|
+
.option('--number <agentPhone>', 'agent phone number').option('--channel <c>', 'channel').option(J, JD).action(px.inboxContactCommand);
|
|
1137
|
+
inbox.command('clear <phone>').description('delete a contact\'s chat history')
|
|
1138
|
+
.option('--number <agentPhone>', 'agent phone number').option('--yes', YD).option(J, JD).action(px.inboxClearCommand);
|
|
1139
|
+
inbox.command('deassign <phone>').description('deassign a chat from its agent')
|
|
1140
|
+
.option('--number <agentPhone>', 'agent phone number').option(J, JD).action(px.inboxDeassignCommand);
|
|
1141
|
+
const waCampaigns = program.command('wa-campaigns').description('WhatsApp campaigns (dashboard session)');
|
|
1142
|
+
waCampaigns.command('list').description('list campaigns').option(J, JD).action(px.waCampaignsListCommand);
|
|
1143
|
+
waCampaigns.command('analytics <id>').description('campaign analytics').option(J, JD).action(px.waCampaignAnalyticsCommand);
|
|
1144
|
+
waCampaigns.command('timeseries <id>').description('campaign timeseries')
|
|
1145
|
+
.option('--start <date>', 'from date').option('--end <date>', 'to date').option(J, JD).action(px.waCampaignTimeseriesCommand);
|
|
1146
|
+
waCampaigns.command('export <id>').description('export campaign contacts to CSV')
|
|
1147
|
+
.option('--fields <csv>', 'export_fields').option('--include-chat', 'include chat transcripts')
|
|
1148
|
+
.option('--file <path>', 'output file (default wa_campaign_<id>.csv)').action(px.waCampaignExportCommand);
|
|
1149
|
+
waCampaigns.command('send').description('send a bulk template message')
|
|
1150
|
+
.requiredOption('--set <json|@file>', 'request body').option(J, JD).action(px.waCampaignSendCommand);
|
|
1151
|
+
const finetune = program.command('finetune').description('fine-tuning records, buckets and jobs (dashboard session)');
|
|
1152
|
+
finetune.command('list').description('list fine-tune records').option('--page <n>', 'page').option(J, JD).action(px.finetuneListCommand);
|
|
1153
|
+
finetune.command('buckets').description('list buckets').option(J, JD).action(px.finetuneBucketsCommand);
|
|
1154
|
+
finetune.command('create-bucket <name>').description('create a bucket').option(J, JD).action(px.finetuneCreateBucketCommand);
|
|
1155
|
+
finetune.command('jobs').description('list jobs').option('--page <n>', 'page').option('--limit <n>', 'page size (default 100)').option(J, JD).action(px.finetuneJobsCommand);
|
|
1156
|
+
finetune.command('status <jobId>').description('job status').option(J, JD).action(px.finetuneStatusCommand);
|
|
1157
|
+
finetune.command('start').description('start a fine-tune job')
|
|
1158
|
+
.requiredOption('--set <json|@file>', 'request body').option(J, JD).action(px.finetuneStartCommand);
|
|
1159
|
+
finetune.command('add-model <jobId>').description('register a finished job\'s model').option(J, JD).action(px.finetuneAddModelCommand);
|
|
1160
|
+
finetune.command('cancel <jobId>').description('cancel a job').option(J, JD).action(px.finetuneCancelCommand);
|
|
1161
|
+
finetune.command('delete-record <callId>').description('delete a fine-tune record')
|
|
1162
|
+
.option('--yes', YD).option(J, JD).action(px.finetuneDeleteRecordCommand);
|
|
1163
|
+
const team = program.command('team').description('team members, roles and webhooks (dashboard session)');
|
|
1164
|
+
team.command('members').description('list members').option(J, JD).action(px.teamMembersCommand);
|
|
1165
|
+
team.command('roles').description('list roles').option(J, JD).action(px.teamRolesCommand);
|
|
1166
|
+
team.command('create-role <name>').description('create a role')
|
|
1167
|
+
.requiredOption('--permissions <csv>', 'comma-separated permissions').option(J, JD).action(px.teamCreateRoleCommand);
|
|
1168
|
+
team.command('add-member').description('add a member')
|
|
1169
|
+
.requiredOption('--name <name>', 'name').requiredOption('--email <email>', 'email')
|
|
1170
|
+
.option('--password <pw>', 'password').option('--permissions <csv>', 'comma-separated permissions').option(J, JD).action(px.teamAddMemberCommand);
|
|
1171
|
+
team.command('update-member <id>').description('update a member')
|
|
1172
|
+
.option('--name <name>', 'name').option('--email <email>', 'email').option('--password <pw>', 'password')
|
|
1173
|
+
.option('--permissions <csv>', 'comma-separated permissions').option(J, JD).action(px.teamUpdateMemberCommand);
|
|
1174
|
+
team.command('remove-member <id>').description('remove a member').option('--yes', YD).option(J, JD).action(px.teamRemoveMemberCommand);
|
|
1175
|
+
team.command('set-webhook').description('set the team webhook and/or call-analysis webhook')
|
|
1176
|
+
.option('--url <url>', 'team webhook URL').option('--analysis-url <url>', 'call analysis webhook URL')
|
|
1177
|
+
.option('--headers <k:v,...>', 'webhook headers as Key:Value pairs').option('--events <csv>', 'webhook events').option(J, JD).action(px.teamSetWebhookCommand);
|
|
1178
|
+
const compliance = program.command('compliance').description('compliance records (dashboard session)');
|
|
1179
|
+
compliance.command('list').description('list records').option(J, JD).action(px.complianceListCommand);
|
|
1180
|
+
compliance.command('create').description('create a record')
|
|
1181
|
+
.requiredOption('--gst <number>', 'GST number').requiredOption('--username <name>', 'username').requiredOption('--company <name>', 'company name')
|
|
1182
|
+
.option('--gst-url <url>', 'GST file URL').option('--cin-url <url>', 'CIN file URL').option(J, JD).action(px.complianceCreateCommand);
|
|
1183
|
+
compliance.command('delete <id>').description('delete a record').option('--yes', YD).option(J, JD).action(px.complianceDeleteCommand);
|
|
1184
|
+
const verified = program.command('verified-numbers').description('verified phone numbers (dashboard session)');
|
|
1185
|
+
verified.command('list').description('list numbers').option(J, JD).action(px.verifiedNumbersListCommand);
|
|
1186
|
+
verified.command('add <phoneNumber>').description('add a number (sends an OTP)').option(J, JD).action(px.verifiedNumbersAddCommand);
|
|
1187
|
+
verified.command('verify <phoneNumber>').description('confirm a number with its OTP')
|
|
1188
|
+
.requiredOption('--otp <code>', 'OTP received').option(J, JD).action(px.verifiedNumbersVerifyCommand);
|
|
1189
|
+
verified.command('delete <id>').description('delete a number').option('--yes', YD).option(J, JD).action(px.verifiedNumbersDeleteCommand);
|
|
1190
|
+
const integrations = program.command('integrations').description('third-party integrations (dashboard session)');
|
|
1191
|
+
integrations.command('list').description('list integrations').option(J, JD).action(px.integrationsListCommand);
|
|
1192
|
+
integrations.command('create').description('create an integration')
|
|
1193
|
+
.requiredOption('--type <type>', 'integration type').option('--set <json|@file>', 'credentials JSON').option('--tag <tag>', 'tag').option(J, JD).action(px.integrationsCreateCommand);
|
|
1194
|
+
integrations.command('update <id>').description('update an integration')
|
|
1195
|
+
.option('--type <type>', 'integration type').option('--set <json|@file>', 'credentials JSON').option('--tag <tag>', 'tag').option(J, JD).action(px.integrationsUpdateCommand);
|
|
1196
|
+
integrations.command('delete <id>').description('delete an integration').option('--yes', YD).option(J, JD).action(px.integrationsDeleteCommand);
|
|
1197
|
+
integrations.command('sip').description('list SIP trunks').option(J, JD).action(px.integrationsSipCommand);
|
|
1198
|
+
integrations.command('aisensy').description('list AiSensy campaigns, or link an agent with --agent')
|
|
1199
|
+
.option('--agent <agentId>', 'link this agent').option('--campaigns', 'list campaigns (default)').option(J, JD).action(px.integrationsAisensyCommand);
|
|
1200
|
+
integrations.command('hubspot <agentId>').description('link HubSpot to an agent').option(J, JD).action(px.integrationsHubspotCommand);
|
|
1201
|
+
integrations.command('shopify').description('save Shopify config')
|
|
1202
|
+
.requiredOption('--set <json|@file>', 'config JSON').option(J, JD).action(px.integrationsShopifyCommand);
|
|
891
1203
|
program
|
|
892
1204
|
.command('transcribers')
|
|
893
1205
|
.description('list transcriber providers, models and languages')
|
|
@@ -975,6 +1287,26 @@ analytics.command('version <agentId>').description('per-version analytics for an
|
|
|
975
1287
|
.option('--end <date>', 'end date')
|
|
976
1288
|
.option('--json', 'raw JSON')
|
|
977
1289
|
.action(analytics_1.analyticsVersionCommand);
|
|
1290
|
+
analytics.command('failed-responses').description('failed-response buckets (needs `cku dashboard login`)')
|
|
1291
|
+
.option('--agent <ids>', 'agent id(s), comma-separated')
|
|
1292
|
+
.option('--start <YYYY-MM-DD>', 'start date')
|
|
1293
|
+
.option('--end <YYYY-MM-DD>', 'end date')
|
|
1294
|
+
.option('--response <bucket>', 'drill into one bucket')
|
|
1295
|
+
.option('--limit <n>', 'rows')
|
|
1296
|
+
.option('--json', 'raw JSON')
|
|
1297
|
+
.action(analytics_1.analyticsFailedResponsesCommand);
|
|
1298
|
+
analytics.command('functions').description('function-call stats (needs `cku dashboard login`)')
|
|
1299
|
+
.option('--agent <ids>', 'agent id(s), comma-separated')
|
|
1300
|
+
.option('--start <YYYY-MM-DD>', 'start date')
|
|
1301
|
+
.option('--end <YYYY-MM-DD>', 'end date')
|
|
1302
|
+
.option('--json', 'raw JSON')
|
|
1303
|
+
.action(analytics_1.analyticsFunctionsCommand);
|
|
1304
|
+
analytics.command('chat').description('chat agent analytics (needs `cku dashboard login`)')
|
|
1305
|
+
.option('--agent <id>', 'chat agent id')
|
|
1306
|
+
.option('--start <YYYY-MM-DD>', 'start date')
|
|
1307
|
+
.option('--end <YYYY-MM-DD>', 'end date')
|
|
1308
|
+
.option('--json', 'raw JSON')
|
|
1309
|
+
.action(analytics_1.analyticsChatCommand);
|
|
978
1310
|
// --- batches ---------------------------------------------------------------
|
|
979
1311
|
const batches = program.command('batches').description('batch calls');
|
|
980
1312
|
batches.command('create').description('create a batch from a local CSV (uploads + starts dialing)')
|
|
@@ -1052,6 +1384,19 @@ sim.command('results <batchId>').description('results of a simulation run').opti
|
|
|
1052
1384
|
.option('--agent <agentId>', 'with --wait, the agent the batch belongs to')
|
|
1053
1385
|
.option('--timeout <seconds>', 'with --wait, give up after this long (default 600)')
|
|
1054
1386
|
.action(simulations_1.simResultsCommand);
|
|
1387
|
+
sim.command('draft-from-call <callId>').description('AI-draft a test case from a real call (needs `cku dashboard login`)')
|
|
1388
|
+
.requiredOption('--version <versionId>', 'agent version the call ran on')
|
|
1389
|
+
.option('--no-metadata', 'leave out call metadata')
|
|
1390
|
+
.option('--no-functions', 'leave out function mocks')
|
|
1391
|
+
.option('--save', 'save the draft as a test case')
|
|
1392
|
+
.option('--json', 'raw JSON')
|
|
1393
|
+
.action(simulations_1.simDraftFromCallCommand);
|
|
1394
|
+
sim.command('generate <agentId>').description('AI-draft a test case from a hint (needs `cku dashboard login`)')
|
|
1395
|
+
.requiredOption('--hint <text>', 'scenario to test')
|
|
1396
|
+
.option('--version <versionId>', 'agent version')
|
|
1397
|
+
.option('--save', 'save the draft as a test case')
|
|
1398
|
+
.option('--json', 'raw JSON')
|
|
1399
|
+
.action(simulations_1.simGenerateCommand);
|
|
1055
1400
|
// Saved variable sets are dashboard-only (cookie-authed): they need `cku dashboard login`.
|
|
1056
1401
|
const simVars = sim.command('variables').description('saved variable sets for test cases (needs `cku dashboard login`)');
|
|
1057
1402
|
simVars.command('list <agentId>').description('list saved variable sets').option('--json', 'raw JSON')
|
|
@@ -1121,6 +1466,9 @@ chatAudit.command('update <agentId> <strategyId>').description('update a chat au
|
|
|
1121
1466
|
.option('--min-messages <n>', 'skip conversations with fewer total messages')
|
|
1122
1467
|
.option('--set <json|@file>', 'JSON for audit_filters/extra_variables/llms; each replaces the stored value')
|
|
1123
1468
|
.action(chatAuditStrategies_1.chatAuditUpdateCommand);
|
|
1469
|
+
chatAudit.command('reports').description('list chat audit report batches (dashboard session)')
|
|
1470
|
+
.option('--agent <id>', 'chat agent id').option('--page <n>', 'page number').option('--json', 'raw JSON')
|
|
1471
|
+
.action(chatAuditStrategies_1.chatAuditReportsCommand);
|
|
1124
1472
|
chatAudit.command('delete <strategyId>').description('delete a chat audit strategy').action(chatAuditStrategies_1.chatAuditDeleteCommand);
|
|
1125
1473
|
chatAudit.command('batch <agentId> <strategyId>')
|
|
1126
1474
|
.description('audit up to N conversations now (uses credits; only messages since each last audit)')
|
|
@@ -1174,6 +1522,71 @@ ${chalk_1.default.bold('Examples:')}
|
|
|
1174
1522
|
${chalk_1.default.cyan(`${name} agents update <agentId> --set '{"name":"New"}' --commit "rename"`)}
|
|
1175
1523
|
${chalk_1.default.cyan(`${name} calls make --agent <id> --to <number> --test`)} place a test call
|
|
1176
1524
|
`);
|
|
1525
|
+
// --- DND, feedback, knowledge, AI helpers (dashboard session) ---------------
|
|
1526
|
+
const dnd = program.command('dnd').description('do-not-disturb list (needs `cku dashboard login`)');
|
|
1527
|
+
dnd.command('list').description('list DND numbers')
|
|
1528
|
+
.option('--page <n>', 'page').option('--limit <n>', 'rows').option('--search <text>', 'search')
|
|
1529
|
+
.option('--since <date>', 'from').option('--until <date>', 'to').option('--json', 'raw JSON')
|
|
1530
|
+
.action(dnd_1.dndListCommand);
|
|
1531
|
+
dnd.command('add <phone>').description('add a number').option('--json', 'raw JSON').action(dnd_1.dndAddCommand);
|
|
1532
|
+
dnd.command('update <id> <phone>').description('change a number').option('--json', 'raw JSON').action(dnd_1.dndUpdateCommand);
|
|
1533
|
+
dnd.command('remove <ids>').description('remove entries (comma-separated ids)')
|
|
1534
|
+
.option('--yes', 'skip confirmation').option('--json', 'raw JSON').action(dnd_1.dndRemoveCommand);
|
|
1535
|
+
dnd.command('import').description('bulk add numbers')
|
|
1536
|
+
.option('--phones <csv>', 'comma-separated numbers')
|
|
1537
|
+
.option('--file <path>', 'file with numbers (comma/newline list or JSON array)')
|
|
1538
|
+
.option('--json', 'raw JSON').action(dnd_1.dndImportCommand);
|
|
1539
|
+
const feedback = program.command('feedback').description('call feedback tickets (needs `cku dashboard login`)');
|
|
1540
|
+
feedback.command('list').description('list tickets')
|
|
1541
|
+
.option('--status <status>', 'ticket status (default processing)').option('--page <n>', 'page').option('--json', 'raw JSON')
|
|
1542
|
+
.action(feedback_1.feedbackListCommand);
|
|
1543
|
+
feedback.command('create').description('open a ticket about a call')
|
|
1544
|
+
.option('--call <callId>', 'call with the issue')
|
|
1545
|
+
.option('--version <versionId>', 'agent version')
|
|
1546
|
+
.option('--engineer <id>', 'engineer to assign')
|
|
1547
|
+
.option('--name <title>', 'ticket title')
|
|
1548
|
+
.option('--issue <text>', 'what went wrong')
|
|
1549
|
+
.option('--json', 'raw JSON')
|
|
1550
|
+
.action(feedback_1.feedbackCreateCommand);
|
|
1551
|
+
feedback.command('comment <id> <text>').description('comment on a ticket').option('--json', 'raw JSON').action(feedback_1.feedbackCommentCommand);
|
|
1552
|
+
feedback.command('submit-review <id>').description('submit a ticket for review')
|
|
1553
|
+
.option('--calls <urls>', 'resolved call URLs, comma-separated')
|
|
1554
|
+
.option('--version-url <url>', 'resolved version URL')
|
|
1555
|
+
.option('--comment <text>', 'comment')
|
|
1556
|
+
.option('--json', 'raw JSON')
|
|
1557
|
+
.action(feedback_1.feedbackSubmitReviewCommand);
|
|
1558
|
+
feedback.command('reopen <id>').description('reopen a ticket')
|
|
1559
|
+
.option('--comment <text>', 'why').option('--json', 'raw JSON').action(feedback_1.feedbackReopenCommand);
|
|
1560
|
+
feedback.command('resolve <id>').description('resolve a ticket')
|
|
1561
|
+
.option('--comment <text>', 'comment').option('--json', 'raw JSON').action(feedback_1.feedbackResolveCommand);
|
|
1562
|
+
const knowledge = program.command('knowledge').description('knowledge base (needs `cku dashboard login`)');
|
|
1563
|
+
knowledge.command('list').description('list knowledge documents').option('--json', 'raw JSON').action(knowledge_1.knowledgeListCommand);
|
|
1564
|
+
knowledge.command('delete <id>').description('delete a document')
|
|
1565
|
+
.option('--yes', 'skip confirmation').option('--json', 'raw JSON').action(knowledge_1.knowledgeDeleteCommand);
|
|
1566
|
+
const ai = program.command('ai').description('AI drafting helpers (needs `cku dashboard login`)');
|
|
1567
|
+
ai.command('function').description('draft function code from a prompt')
|
|
1568
|
+
.option('--prompt <text>', 'what the function should do')
|
|
1569
|
+
.option('--name <name>', 'function name').option('--description <desc>', 'function description')
|
|
1570
|
+
.option('--type <type>', 'function type')
|
|
1571
|
+
.option('--code <code|@file>', 'existing code to edit')
|
|
1572
|
+
.option('--vars <csv>', 'prompt variables, comma-separated')
|
|
1573
|
+
.option('--chat', 'chat-agent function')
|
|
1574
|
+
.option('--json', 'raw JSON')
|
|
1575
|
+
.action(aiTools_1.aiGenerateFunctionCommand);
|
|
1576
|
+
ai.command('postcall').description('draft post-call config')
|
|
1577
|
+
.option('--set <json|@file>', 'request body, JSON or @file').option('--json', 'raw JSON')
|
|
1578
|
+
.action(aiTools_1.aiGeneratePostcallCommand);
|
|
1579
|
+
ai.command('audit-strategy <agentId>').description('draft an audit strategy for an agent')
|
|
1580
|
+
.option('--prompt <text>', 'guidance').option('--existing <text>', 'existing strategy to refine').option('--json', 'raw JSON')
|
|
1581
|
+
.action(aiTools_1.aiGenerateAuditStrategyCommand);
|
|
1582
|
+
ai.command('callflow-summary <agentId>').description('draft a call-flow summary for an agent')
|
|
1583
|
+
.option('--prompt <text>', 'guidance').option('--existing <text>', 'existing summary to refine').option('--json', 'raw JSON')
|
|
1584
|
+
.action(aiTools_1.aiGenerateCallflowSummaryCommand);
|
|
1585
|
+
ai.command('workflow-code').description('draft workflow step code')
|
|
1586
|
+
.option('--prompt <text>', 'what the step should do').option('--name <name>', 'step name')
|
|
1587
|
+
.option('--key <key>', 'step key').option('--existing <code|@file>', 'existing code')
|
|
1588
|
+
.option('--json', 'raw JSON')
|
|
1589
|
+
.action(aiTools_1.aiGenerateWorkflowCodeCommand);
|
|
1177
1590
|
// Bare invocation → show help instead of an error.
|
|
1178
1591
|
if (process.argv.length <= 2) {
|
|
1179
1592
|
program.outputHelp();
|
package/dist/lib/adminApi.js
CHANGED
|
@@ -42,6 +42,7 @@ const adminAuth_1 = require("./adminAuth");
|
|
|
42
42
|
* `err.status` the same way on every surface. Extends Error so existing
|
|
43
43
|
* `handleError` paths and message-based assertions keep working.
|
|
44
44
|
*/
|
|
45
|
+
const FDE_URL = process.env.CK_FDE_URL || 'https://fde-api.callkaro.ai';
|
|
45
46
|
class AdminError extends Error {
|
|
46
47
|
status;
|
|
47
48
|
data;
|
|
@@ -68,7 +69,8 @@ class AdminApi {
|
|
|
68
69
|
* per request rather than once at construction: it is what proves the stored
|
|
69
70
|
* 24h session is still valid, and a long-lived client must not outlive it.
|
|
70
71
|
*/
|
|
71
|
-
async request(method, path, body) {
|
|
72
|
+
async request(method, path, body, hostOverride) {
|
|
73
|
+
const base = hostOverride || this.baseUrl;
|
|
72
74
|
// baseUrl + path is the whole URL, so a path that does not start with "/"
|
|
73
75
|
// can rewrite the host ("https://backend.callkaro.ai" + "@evil.com/x") and
|
|
74
76
|
// carry the session cookie with it.
|
|
@@ -81,7 +83,7 @@ class AdminApi {
|
|
|
81
83
|
};
|
|
82
84
|
let res;
|
|
83
85
|
try {
|
|
84
|
-
res = await fetch(`${
|
|
86
|
+
res = await fetch(`${base}${path}`, {
|
|
85
87
|
method,
|
|
86
88
|
headers,
|
|
87
89
|
body: body === undefined ? undefined : JSON.stringify(body),
|
|
@@ -91,7 +93,7 @@ class AdminApi {
|
|
|
91
93
|
});
|
|
92
94
|
}
|
|
93
95
|
catch (err) {
|
|
94
|
-
throw new Error(`Cannot reach ${
|
|
96
|
+
throw new Error(`Cannot reach ${base} (${err.message})`);
|
|
95
97
|
}
|
|
96
98
|
const text = await res.text();
|
|
97
99
|
let data;
|
|
@@ -196,6 +198,51 @@ class AdminApi {
|
|
|
196
198
|
botFunctions(query = {}) {
|
|
197
199
|
return this.request('GET', `/monitor/bots/functions${qs(query)}`);
|
|
198
200
|
}
|
|
201
|
+
/** List agents belonging to one or more client user_ids (`GET /monitor/agents?user_ids=`). */
|
|
202
|
+
clientAgents(userIds) {
|
|
203
|
+
return this.request('GET', `/monitor/agents${qs({ user_ids: userIds })}`);
|
|
204
|
+
}
|
|
205
|
+
/** List versions of an agent from monitor (`GET /monitor/agents/:agentId/versions`). */
|
|
206
|
+
clientAgentVersions(agentId) {
|
|
207
|
+
return this.request('GET', `/monitor/agents/${encodeURIComponent(agentId)}/versions`);
|
|
208
|
+
}
|
|
209
|
+
/** Failed LLM/TTS response buckets for a bot (`GET /monitor/bots/:agentId/failed-responses`). */
|
|
210
|
+
botFailedResponses(agentId, query = {}) {
|
|
211
|
+
return this.request('GET', `/monitor/bots/${encodeURIComponent(agentId)}/failed-responses${qs(query)}`);
|
|
212
|
+
}
|
|
213
|
+
/** Call ids that hit a specific failed response (`GET /monitor/bots/:agentId/failed-response-calls`). */
|
|
214
|
+
botFailedResponseCalls(agentId, query) {
|
|
215
|
+
return this.request('GET', `/monitor/bots/${encodeURIComponent(agentId)}/failed-response-calls${qs(query)}`);
|
|
216
|
+
}
|
|
217
|
+
/** Failed external API endpoints for a bot (`GET /monitor/bots/:agentId/failed-api-responses`). */
|
|
218
|
+
botFailedApiResponses(agentId, query = {}) {
|
|
219
|
+
return this.request('GET', `/monitor/bots/${encodeURIComponent(agentId)}/failed-api-responses${qs(query)}`);
|
|
220
|
+
}
|
|
221
|
+
/** Call ids that hit a failed API response (`GET /monitor/bots/:agentId/failed-api-response-calls`). */
|
|
222
|
+
botFailedApiResponseCalls(agentId, query) {
|
|
223
|
+
return this.request('GET', `/monitor/bots/${encodeURIComponent(agentId)}/failed-api-response-calls${qs(query)}`);
|
|
224
|
+
}
|
|
225
|
+
// --- FDE reference library (`https://fde-api.callkaro.ai/monitor/agent-context`) ---
|
|
226
|
+
/** List all curated reference agent versions in the FDE library. */
|
|
227
|
+
listAgentContext() {
|
|
228
|
+
return this.request('GET', '/monitor/agent-context', undefined, FDE_URL);
|
|
229
|
+
}
|
|
230
|
+
/** Semantic search over reference agent versions (`GET .../monitor/agent-context/search`). */
|
|
231
|
+
searchAgentContext(query) {
|
|
232
|
+
return this.request('GET', `/monitor/agent-context/search${qs(query)}`, undefined, FDE_URL);
|
|
233
|
+
}
|
|
234
|
+
/** Index a new reference agent version (`POST .../monitor/agent-context`). */
|
|
235
|
+
createAgentContext(body) {
|
|
236
|
+
return this.request('POST', '/monitor/agent-context', body, FDE_URL);
|
|
237
|
+
}
|
|
238
|
+
/** Update an indexed reference agent version (`PUT .../monitor/agent-context/:versionId`). */
|
|
239
|
+
updateAgentContext(versionId, body) {
|
|
240
|
+
return this.request('PUT', `/monitor/agent-context/${encodeURIComponent(versionId)}`, body, FDE_URL);
|
|
241
|
+
}
|
|
242
|
+
/** Remove a reference agent version from the index (`DELETE .../monitor/agent-context/:versionId`). */
|
|
243
|
+
deleteAgentContext(versionId) {
|
|
244
|
+
return this.request('DELETE', `/monitor/agent-context/${encodeURIComponent(versionId)}`, undefined, FDE_URL);
|
|
245
|
+
}
|
|
199
246
|
// --- observability --------------------------------------------------------
|
|
200
247
|
/** Sentry transactions over the last 24h. */
|
|
201
248
|
sentryTransactions(query = {}) {
|