@bty/customer-service-cli 0.1.8 → 0.1.9
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/bin.js +92 -56
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -366,8 +366,8 @@ async function whoami() {
|
|
|
366
366
|
|
|
367
367
|
// src/commands/auth.ts
|
|
368
368
|
function registerAuthCommand(program2) {
|
|
369
|
-
const auth = program2.command("auth").description("\u8BA4\u8BC1\u7BA1\u7406");
|
|
370
|
-
auth.command("login").description("\u767B\u5F55\uFF08\u624B\u673A\u53F7 + \u5BC6\u7801\uFF09").requiredOption("--phone <phone>", "\u624B\u673A\u53F7").requiredOption("--password <password>", "\u5BC6\u7801").action(async (opts) => {
|
|
369
|
+
const auth = program2.command("auth").description("\u8BA4\u8BC1\u7BA1\u7406 \u2014\u2014 \u624B\u673A\u53F7+\u5BC6\u7801\u767B\u5F55\uFF0C\u83B7\u53D6\u8BBF\u95EE\u4EE4\u724C\u3002\u5176\u4ED6\u547D\u4EE4\u4F9D\u8D56\u6B64\u4EE4\u724C");
|
|
370
|
+
auth.command("login").description("\u767B\u5F55\uFF08\u624B\u673A\u53F7 + \u5BC6\u7801\uFF09\uFF0C\u6210\u529F\u540E\u4EE4\u724C\u81EA\u52A8\u6301\u4E45\u5316\u5230\u672C\u5730").requiredOption("--phone <phone>", "\u624B\u673A\u53F7\uFF0811 \u4F4D\uFF09").requiredOption("--password <password>", "\u5BC6\u7801").action(async (opts) => {
|
|
371
371
|
try {
|
|
372
372
|
const result = await login(opts.phone, opts.password);
|
|
373
373
|
formatOutput({ success: true, data: result }, program2.opts().table);
|
|
@@ -380,7 +380,7 @@ function registerAuthCommand(program2) {
|
|
|
380
380
|
clearCredentials();
|
|
381
381
|
formatOutput({ success: true, data: { message: "Logged out" } }, program2.opts().table);
|
|
382
382
|
});
|
|
383
|
-
auth.command("whoami").description("\u67E5\u770B\u5F53\u524D\u767B\u5F55\u7528\u6237\u4FE1\u606F").action(async () => {
|
|
383
|
+
auth.command("whoami").description("\u67E5\u770B\u5F53\u524D\u767B\u5F55\u7528\u6237\u4FE1\u606F\u3002\u9000\u51FA\u7801 2 \u8868\u793A\u672A\u767B\u5F55\u6216\u4EE4\u724C\u8FC7\u671F\uFF0C\u9700\u91CD\u65B0 auth login").action(async () => {
|
|
384
384
|
try {
|
|
385
385
|
const creds = readCredentials();
|
|
386
386
|
if (!creds) {
|
|
@@ -405,7 +405,7 @@ async function listWorkspaces() {
|
|
|
405
405
|
|
|
406
406
|
// src/commands/config.ts
|
|
407
407
|
function registerConfigCommand(program2) {
|
|
408
|
-
const config = program2.command("config").description("\u914D\u7F6E\u7BA1\u7406");
|
|
408
|
+
const config = program2.command("config").description("\u914D\u7F6E\u7BA1\u7406 \u2014\u2014 API \u5730\u5740\u3001\u9ED8\u8BA4\u5DE5\u4F5C\u7A7A\u95F4\u7B49\u6301\u4E45\u5316\u8BBE\u7F6E\u3002\u652F\u6301\u5168\u5C40\u914D\u7F6E\u548C\u76EE\u5F55\u7EA7\u672C\u5730\u914D\u7F6E\uFF08.cs-cli.json\uFF09");
|
|
409
409
|
config.command("set").description("\u8BBE\u7F6E API \u5730\u5740").option("--cs-api <url>", "\u5BA2\u670D API \u5730\u5740").option("--auth-api <url>", "\u8BA4\u8BC1 API \u5730\u5740").option("--ai-api <url>", "AI API \u5730\u5740").option("--agent-api <url>", "Customer Agent API \u5730\u5740").action((opts) => {
|
|
410
410
|
const updates = {};
|
|
411
411
|
if (opts.csApi) updates.customerServiceApiUrl = opts.csApi;
|
|
@@ -415,7 +415,7 @@ function registerConfigCommand(program2) {
|
|
|
415
415
|
writeConfig(updates);
|
|
416
416
|
formatOutput({ success: true, data: readConfig() }, program2.opts().table);
|
|
417
417
|
});
|
|
418
|
-
config.command("get").description("\u67E5\u770B\u5F53\u524D\u914D\u7F6E").action(() => {
|
|
418
|
+
config.command("get").description("\u67E5\u770B\u5F53\u524D\u914D\u7F6E\uFF08\u5168\u5C40 + \u672C\u5730\u5408\u5E76\u540E\u7684\u7ED3\u679C\uFF09").action(() => {
|
|
419
419
|
const globalCfg = readConfig() ?? {};
|
|
420
420
|
const localCfg = readLocalConfig();
|
|
421
421
|
const localPath = findLocalConfigPath();
|
|
@@ -430,7 +430,7 @@ function registerConfigCommand(program2) {
|
|
|
430
430
|
outputInfo(`\u672C\u5730\u914D\u7F6E\u5DF2\u521D\u59CB\u5316: ${filePath}`);
|
|
431
431
|
formatOutput({ success: true, data: { path: filePath } }, program2.opts().table);
|
|
432
432
|
});
|
|
433
|
-
config.command("set-workspace").description("\u8BBE\u7F6E\u9ED8\u8BA4\u5DE5\u4F5C\u7A7A\u95F4").argument("<workspace_id>", "\u5DE5\u4F5C\u7A7A\u95F4 ID").option("--global", "\u5F3A\u5236\u5199\u5165\u5168\u5C40\u914D\u7F6E").action(async (workspaceId, opts) => {
|
|
433
|
+
config.command("set-workspace").description("\u8BBE\u7F6E\u9ED8\u8BA4\u5DE5\u4F5C\u7A7A\u95F4\u3002\u5927\u591A\u6570\u547D\u4EE4\u4F9D\u8D56\u6B64\u914D\u7F6E\u786E\u5B9A\u64CD\u4F5C\u8303\u56F4\u3002\u6709\u672C\u5730\u914D\u7F6E\u65F6\u4F18\u5148\u5199\u5165\u672C\u5730\uFF0C\u5426\u5219\u5199\u5165\u5168\u5C40").argument("<workspace_id>", "\u5DE5\u4F5C\u7A7A\u95F4 ID\uFF08\u4ECE workspace list \u83B7\u53D6\uFF09").option("--global", "\u5F3A\u5236\u5199\u5165\u5168\u5C40\u914D\u7F6E").action(async (workspaceId, opts) => {
|
|
434
434
|
const useLocal = !opts.global && findLocalConfigPath() !== null;
|
|
435
435
|
try {
|
|
436
436
|
const workspaces2 = await listWorkspaces();
|
|
@@ -464,8 +464,8 @@ function registerConfigCommand(program2) {
|
|
|
464
464
|
|
|
465
465
|
// src/commands/workspace.ts
|
|
466
466
|
function registerWorkspaceCommand(program2) {
|
|
467
|
-
const workspace = program2.command("workspace").description("\u5DE5\u4F5C\u7A7A\u95F4\u7BA1\u7406");
|
|
468
|
-
workspace.command("list").description("\u5217\u51FA\u6240\u6709\u5DE5\u4F5C\u7A7A\u95F4").action(async () => {
|
|
467
|
+
const workspace = program2.command("workspace").description("\u5DE5\u4F5C\u7A7A\u95F4\u7BA1\u7406 \u2014\u2014 \u4E00\u4E2A\u5DE5\u4F5C\u7A7A\u95F4\u5BF9\u5E94\u4E00\u4E2A\u5BA2\u6237/\u5E97\u94FA\uFF0C\u5305\u542B\u8BE5\u5BA2\u6237\u7684\u6240\u6709 Agent");
|
|
468
|
+
workspace.command("list").description("\u5217\u51FA\u5F53\u524D\u8D26\u53F7\u53EF\u8BBF\u95EE\u7684\u6240\u6709\u5DE5\u4F5C\u7A7A\u95F4\u3002\u8FD4\u56DE id \u548C name\uFF0C\u7528\u4E8E config set-workspace").action(async () => {
|
|
469
469
|
try {
|
|
470
470
|
const data = await listWorkspaces();
|
|
471
471
|
formatOutput({ success: true, data }, program2.opts().table);
|
|
@@ -526,8 +526,12 @@ function parseDataOption(value) {
|
|
|
526
526
|
|
|
527
527
|
// src/commands/agent.ts
|
|
528
528
|
function registerAgentCommand(program2) {
|
|
529
|
-
const agent = program2.command("agent").description(
|
|
530
|
-
|
|
529
|
+
const agent = program2.command("agent").description(
|
|
530
|
+
"Agent\uFF08AI \u5BA2\u670D\u673A\u5668\u4EBA\uFF09\u7BA1\u7406 \u2014\u2014 \u6BCF\u4E2A Agent \u7ED1\u5B9A\u4E00\u4E2A\u5E97\u94FA/\u6E20\u9053\uFF0C\u62E5\u6709\u72EC\u7ACB\u7684 SA \u7B56\u7565\u3001\u5546\u54C1\u77E5\u8BC6\u548C FAQ"
|
|
531
|
+
);
|
|
532
|
+
agent.command("list").description(
|
|
533
|
+
"\u5217\u51FA\u5F53\u524D\u5DE5\u4F5C\u7A7A\u95F4\u7684 Agent \u5217\u8868\u3002\u8FD4\u56DE config_id\uFF08\u540E\u7EED\u547D\u4EE4\u7684 --agent \u53C2\u6570\uFF09\u548C config_name"
|
|
534
|
+
).option("--page <number>", "\u9875\u7801", "1").option("--page-size <number>", "\u6BCF\u9875\u6570\u91CF", "20").action(async (opts) => {
|
|
531
535
|
try {
|
|
532
536
|
const data = await listAgents({
|
|
533
537
|
page: Number(opts.page),
|
|
@@ -539,7 +543,9 @@ function registerAgentCommand(program2) {
|
|
|
539
543
|
process.exit(toExitCode(err));
|
|
540
544
|
}
|
|
541
545
|
});
|
|
542
|
-
agent.command("get").description(
|
|
546
|
+
agent.command("get").description(
|
|
547
|
+
"\u83B7\u53D6 Agent \u5B8C\u6574\u914D\u7F6E\u8BE6\u60C5\uFF0C\u542B sub_agents\u3001sop_config\u3001customer_config\u3001forbidden_words\u3001knowledge_base_config \u7B49\u5B57\u6BB5"
|
|
548
|
+
).argument("<config_id>", "Agent \u914D\u7F6E ID\uFF08\u4ECE agent list \u83B7\u53D6\uFF09").action(async (configId) => {
|
|
543
549
|
try {
|
|
544
550
|
const data = await getAgent(configId);
|
|
545
551
|
formatOutput({ success: true, data }, program2.opts().table);
|
|
@@ -548,7 +554,12 @@ function registerAgentCommand(program2) {
|
|
|
548
554
|
process.exit(toExitCode(err));
|
|
549
555
|
}
|
|
550
556
|
});
|
|
551
|
-
agent.command("update").description(
|
|
557
|
+
agent.command("update").description(
|
|
558
|
+
"\u66F4\u65B0 Agent \u914D\u7F6E\uFF08\u5982 customer_config\u3001forbidden_words \u7B49\uFF09\u3002\u5EFA\u8BAE\u5148 agent get \u5BFC\u51FA\u5F53\u524D\u914D\u7F6E\u518D\u4FEE\u6539"
|
|
559
|
+
).argument("<config_id>", "Agent \u914D\u7F6E ID\uFF08\u4ECE agent list \u83B7\u53D6\uFF09").requiredOption(
|
|
560
|
+
"--data <json>",
|
|
561
|
+
"JSON \u6570\u636E\u6216 @\u6587\u4EF6\u8DEF\u5F84\u3002\u53EF\u66F4\u65B0\u5B57\u6BB5\u5305\u62EC customer_config\u3001forbidden_words\u3001knowledge_base_config \u7B49"
|
|
562
|
+
).action(async (configId, opts) => {
|
|
552
563
|
try {
|
|
553
564
|
const body = parseDataOption(opts.data);
|
|
554
565
|
const data = await updateAgent(configId, body);
|
|
@@ -638,8 +649,10 @@ async function listSituationActionVersions(opts) {
|
|
|
638
649
|
|
|
639
650
|
// src/commands/sa.ts
|
|
640
651
|
function registerSACommand(program2) {
|
|
641
|
-
const sa = program2.command("sa").description(
|
|
642
|
-
|
|
652
|
+
const sa = program2.command("sa").description(
|
|
653
|
+
"SA\uFF08Situation-Action\uFF09\u7B56\u7565\u7BA1\u7406 \u2014\u2014 Agent \u610F\u56FE\u5339\u914D\u548C\u56DE\u590D\u903B\u8F91\u7684\u6838\u5FC3\u914D\u7F6E\u3002\u6BCF\u6761 SA \u5B9A\u4E49\u4E00\u4E2A\u573A\u666F(situation)\u53CA\u5BF9\u5E94\u52A8\u4F5C(action)\uFF0C\u6309\u4E8C\u7EA7\u6807\u7B7E\u4F53\u7CFB\u7EC4\u7EC7\u3002\u4FEE\u590D Issue \u65F6\u6700\u5E38\u64CD\u4F5C\u7684\u8D44\u6E90"
|
|
654
|
+
);
|
|
655
|
+
sa.command("list").description("\u5217\u51FA SA \u7B56\u7565\u6761\u76EE\u3002\u8FD4\u56DE id\u3001event_first_label\u3001event_second_label\u3001situation\u3001action\u3001transfer_to_human \u7B49\u5B57\u6BB5").requiredOption("--agent <config_id>", "Agent \u914D\u7F6E ID\uFF08\u4ECE agent list \u83B7\u53D6\uFF09").option("--intent <intent>", "\u6309\u5B50\u610F\u56FE\u7B5B\u9009\uFF08\u5982 GENERAL_QA\uFF09\u3002\u4E0D\u4F20\u5219\u8FD4\u56DE\u6240\u6709\u610F\u56FE").option("--first-label <label>", "\u6309\u4E00\u7EA7\u6807\u7B7E\u7B5B\u9009\uFF08\u5982 \u5546\u54C1\u54A8\u8BE2\u3001\u552E\u540E\u54A8\u8BE2\u3001\u53D1\u8D27\u4E0E\u7269\u6D41\u54A8\u8BE2\u3001\u4F18\u60E0\u6D3B\u52A8\u3001\u5546\u54C1\u63A8\u8350\u3001\u552E\u524D\u54A8\u8BE2\u3001\u5176\u4ED6\uFF09").option("--second-label <label>", "\u6309\u4E8C\u7EA7\u6807\u7B7E\u7B5B\u9009\uFF08\u5982 \u5546\u54C1\u5C5E\u6027\u3001\u9000\u6B3E\u3001\u7269\u6D41\u67E5\u8BE2\u7B49\uFF0C\u96B6\u5C5E\u4E8E\u4E00\u7EA7\u6807\u7B7E\uFF09").option("--page <number>", "\u9875\u7801", "1").option("--page-size <number>", "\u6BCF\u9875\u6570\u91CF", "500").action(async (opts) => {
|
|
643
656
|
try {
|
|
644
657
|
const data = await listSituationActions({
|
|
645
658
|
agentConfigId: opts.agent,
|
|
@@ -655,7 +668,7 @@ function registerSACommand(program2) {
|
|
|
655
668
|
process.exit(toExitCode(err));
|
|
656
669
|
}
|
|
657
670
|
});
|
|
658
|
-
sa.command("search").description("\u641C\u7D22\
|
|
671
|
+
sa.command("search").description("\u6309\u5173\u952E\u8BCD\u6A21\u7CCA\u641C\u7D22 SA \u6761\u76EE\uFF08\u5339\u914D situation \u548C action \u5185\u5BB9\uFF09").requiredOption("--agent <config_id>", "Agent \u914D\u7F6E ID\uFF08\u4ECE agent list \u83B7\u53D6\uFF09").requiredOption("--keyword <text>", '\u641C\u7D22\u5173\u952E\u8BCD\uFF08\u5982"\u9000\u6B3E"\u3001"\u5C3A\u7801"\uFF09').action(async (opts) => {
|
|
659
672
|
try {
|
|
660
673
|
const data = await searchSituationActions({
|
|
661
674
|
agentConfigId: opts.agent,
|
|
@@ -667,7 +680,7 @@ function registerSACommand(program2) {
|
|
|
667
680
|
process.exit(toExitCode(err));
|
|
668
681
|
}
|
|
669
682
|
});
|
|
670
|
-
sa.command("create").description("\u521B\u5EFA\
|
|
683
|
+
sa.command("create").description("\u521B\u5EFA\u65B0\u7684 SA \u7B56\u7565\u6761\u76EE").requiredOption("--agent <config_id>", "Agent \u914D\u7F6E ID\uFF08\u4ECE agent list \u83B7\u53D6\uFF09").requiredOption("--first-label <label>", "\u4E00\u7EA7\u6807\u7B7E\uFF08\u5982 \u5546\u54C1\u54A8\u8BE2\u3001\u552E\u540E\u54A8\u8BE2\u3001\u53D1\u8D27\u4E0E\u7269\u6D41\u54A8\u8BE2\u3001\u4F18\u60E0\u6D3B\u52A8\u3001\u5546\u54C1\u63A8\u8350\u3001\u552E\u524D\u54A8\u8BE2\u3001\u5176\u4ED6\uFF09").requiredOption("--second-label <label>", '\u4E8C\u7EA7\u6807\u7B7E\uFF08\u96B6\u5C5E\u4E8E\u4E00\u7EA7\u6807\u7B7E\uFF0C\u5982"\u5546\u54C1\u5C5E\u6027"\u96B6\u5C5E\u4E8E"\u5546\u54C1\u54A8\u8BE2"\uFF09').requiredOption("--situation <text>", '\u573A\u666F\u63CF\u8FF0 \u2014\u2014 \u5B9A\u4E49\u4F55\u65F6\u89E6\u53D1\u6B64\u7B56\u7565\uFF08\u5982"\u5BA2\u6237\u54A8\u8BE2\u5546\u54C1\u5C3A\u7801\u4FE1\u606F"\uFF09').requiredOption("--action <text>", "\u52A8\u4F5C\u6307\u4EE4 \u2014\u2014 Agent \u5339\u914D\u6B64\u573A\u666F\u65F6\u7684\u56DE\u590D\u903B\u8F91/SOP").option("--transfer", "\u547D\u4E2D\u65F6\u8F6C\u63A5\u4EBA\u5DE5\u5BA2\u670D\uFF08\u9ED8\u8BA4\u4E0D\u8F6C\u63A5\uFF09", false).option("--intent <intent>", "\u5B50\u610F\u56FE\uFF08\u9ED8\u8BA4 GENERAL_QA\uFF09\u3002\u901A\u5E38\u65E0\u9700\u6307\u5B9A").action(async (opts) => {
|
|
671
684
|
try {
|
|
672
685
|
const data = await createSituationAction({
|
|
673
686
|
agentConfigId: opts.agent,
|
|
@@ -684,7 +697,7 @@ function registerSACommand(program2) {
|
|
|
684
697
|
process.exit(toExitCode(err));
|
|
685
698
|
}
|
|
686
699
|
});
|
|
687
|
-
sa.command("update").description("\u66F4\u65B0\
|
|
700
|
+
sa.command("update").description("\u66F4\u65B0\u5DF2\u6709 SA \u7B56\u7565\u6761\u76EE\uFF08\u5168\u91CF\u66F4\u65B0\uFF0C\u6240\u6709\u5B57\u6BB5\u5FC5\u4F20\uFF09").requiredOption("--agent <config_id>", "Agent \u914D\u7F6E ID\uFF08\u4ECE agent list \u83B7\u53D6\uFF09").requiredOption("--id <number>", "SA \u6761\u76EE ID\uFF08\u4ECE sa list \u6216 sa search \u83B7\u53D6\uFF09").requiredOption("--first-label <label>", "\u4E00\u7EA7\u6807\u7B7E\uFF08\u5FC5\u987B\u4E0E\u5DF2\u6709\u6761\u76EE\u4E00\u81F4\u6216\u4E3A\u65B0\u503C\uFF09").requiredOption("--second-label <label>", "\u4E8C\u7EA7\u6807\u7B7E\uFF08\u5FC5\u987B\u4E0E\u5DF2\u6709\u6761\u76EE\u4E00\u81F4\u6216\u4E3A\u65B0\u503C\uFF09").requiredOption("--situation <text>", "\u573A\u666F\u63CF\u8FF0 \u2014\u2014 \u66F4\u65B0\u540E\u7684\u89E6\u53D1\u6761\u4EF6").requiredOption("--action <text>", "\u52A8\u4F5C\u6307\u4EE4 \u2014\u2014 \u66F4\u65B0\u540E\u7684\u56DE\u590D\u903B\u8F91/SOP").option("--transfer", "\u547D\u4E2D\u65F6\u8F6C\u63A5\u4EBA\u5DE5\u5BA2\u670D\uFF08\u9ED8\u8BA4\u4E0D\u8F6C\u63A5\uFF09", false).option("--intent <intent>", "\u5B50\u610F\u56FE\uFF08\u9ED8\u8BA4 GENERAL_QA\uFF09\u3002\u901A\u5E38\u65E0\u9700\u6307\u5B9A").action(async (opts) => {
|
|
688
701
|
try {
|
|
689
702
|
const data = await updateSituationAction({
|
|
690
703
|
agentConfigId: opts.agent,
|
|
@@ -702,7 +715,7 @@ function registerSACommand(program2) {
|
|
|
702
715
|
process.exit(toExitCode(err));
|
|
703
716
|
}
|
|
704
717
|
});
|
|
705
|
-
sa.command("delete").description("\u5220\u9664\
|
|
718
|
+
sa.command("delete").description("\u5220\u9664 SA \u7B56\u7565\u6761\u76EE\u3002--first-label \u548C --second-label \u5FC5\u987B\u4E0E\u8BE5\u6761\u76EE\u5B9E\u9645\u503C\u4E00\u81F4\uFF08\u4ECE sa list \u83B7\u53D6\uFF09").requiredOption("--agent <config_id>", "Agent \u914D\u7F6E ID\uFF08\u4ECE agent list \u83B7\u53D6\uFF09").requiredOption("--id <number>", "SA \u6761\u76EE ID\uFF08\u4ECE sa list \u6216 sa search \u83B7\u53D6\uFF09").requiredOption("--first-label <label>", "\u8BE5\u6761\u76EE\u7684\u4E00\u7EA7\u6807\u7B7E\uFF08\u5FC5\u987B\u4E0E\u5B9E\u9645\u503C\u4E00\u81F4\uFF09").requiredOption("--second-label <label>", "\u8BE5\u6761\u76EE\u7684\u4E8C\u7EA7\u6807\u7B7E\uFF08\u5FC5\u987B\u4E0E\u5B9E\u9645\u503C\u4E00\u81F4\uFF09").action(async (opts) => {
|
|
706
719
|
try {
|
|
707
720
|
const data = await deleteSituationAction({
|
|
708
721
|
agentConfigId: opts.agent,
|
|
@@ -716,7 +729,7 @@ function registerSACommand(program2) {
|
|
|
716
729
|
process.exit(toExitCode(err));
|
|
717
730
|
}
|
|
718
731
|
});
|
|
719
|
-
sa.command("versions").description("\u67E5\u770B\
|
|
732
|
+
sa.command("versions").description("\u67E5\u770B SA \u6761\u76EE\u7684\u5386\u53F2\u4FEE\u6539\u8BB0\u5F55\uFF0C\u7528\u4E8E\u5BA1\u8BA1\u53D8\u66F4").requiredOption("--agent <config_id>", "Agent \u914D\u7F6E ID\uFF08\u4ECE agent list \u83B7\u53D6\uFF09").requiredOption("--id <number>", "SA \u6761\u76EE ID\uFF08\u4ECE sa list \u6216 sa search \u83B7\u53D6\uFF09").action(async (opts) => {
|
|
720
733
|
try {
|
|
721
734
|
const data = await listSituationActionVersions({
|
|
722
735
|
agentConfigId: opts.agent,
|
|
@@ -793,8 +806,10 @@ async function findProduct(agentConfigId, productId) {
|
|
|
793
806
|
return matched;
|
|
794
807
|
}
|
|
795
808
|
function registerProductCommand(program2) {
|
|
796
|
-
const product = program2.command("product").description(
|
|
797
|
-
|
|
809
|
+
const product = program2.command("product").description(
|
|
810
|
+
"\u5546\u54C1\u77E5\u8BC6\u5E93\u7BA1\u7406 \u2014\u2014 Agent \u5173\u8054\u7684\u5546\u54C1\u6570\u636E\uFF08\u5356\u70B9\u3001\u8865\u5145\u77E5\u8BC6\u3001SKU\u3001\u53C2\u6570\u3001\u56FE\u7247\u8BC6\u522B\u7ED3\u679C\u7B49\uFF09\u3002Agent \u56DE\u7B54\u5546\u54C1\u76F8\u5173\u95EE\u9898\u65F6\u4F9D\u8D56\u6B64\u6570\u636E\u6E90"
|
|
811
|
+
);
|
|
812
|
+
product.command("list").description("\u5217\u51FA\u5546\u54C1\u5217\u8868\u3002\u8FD4\u56DE product_id\u3001product_name\u3001status\u3001selling_point_summary\u3001tags \u7B49\u5B57\u6BB5").requiredOption("--agent <config_id>", "Agent \u914D\u7F6E ID\uFF08\u4ECE agent list \u83B7\u53D6\uFF09").option("--keyword <text>", "\u6309\u5546\u54C1\u540D\u79F0\u641C\u7D22").option("--status <status...>", "\u6309\u72B6\u6001\u7B5B\u9009: available\uFF08\u5DF2\u5C31\u7EEA\uFF09| pending\uFF08\u5904\u7406\u4E2D\uFF09| failed\uFF08\u5904\u7406\u5931\u8D25\uFF09").option("--tag <tags...>", "\u6309\u6807\u7B7E\u7B5B\u9009\uFF08\u591A\u4E2A\u6807\u7B7E\u7A7A\u683C\u5206\u9694\uFF09").option("--page <number>", "\u9875\u7801", "1").option("--page-size <number>", "\u6BCF\u9875\u6570\u91CF", "20").action(async (opts) => {
|
|
798
813
|
try {
|
|
799
814
|
const data = await listProducts({
|
|
800
815
|
agentConfigId: opts.agent,
|
|
@@ -810,7 +825,7 @@ function registerProductCommand(program2) {
|
|
|
810
825
|
process.exit(toExitCode(err));
|
|
811
826
|
}
|
|
812
827
|
});
|
|
813
|
-
product.command("get").description("\u83B7\u53D6\u5546\u54C1\u8BE6\u60C5").requiredOption("--agent <config_id>", "Agent \u914D\u7F6E ID").requiredOption("--product-id <product_id>", "\u5546\u54C1 ID").action(async (opts) => {
|
|
828
|
+
product.command("get").description("\u83B7\u53D6\u5546\u54C1\u5B8C\u6574\u8BE6\u60C5\uFF0C\u542B\u5356\u70B9\u3001\u8865\u5145\u77E5\u8BC6\u3001\u53C2\u6570\u3001SKU\u3001\u56FE\u7247\u8BC6\u522B\u7ED3\u679C\u7B49\u3002\u5185\u90E8\u81EA\u52A8\u89E3\u6790 database_id").requiredOption("--agent <config_id>", "Agent \u914D\u7F6E ID\uFF08\u4ECE agent list \u83B7\u53D6\uFF09").requiredOption("--product-id <product_id>", "\u5546\u54C1 ID\uFF08\u4ECE product list \u8FD4\u56DE\u7684 product_id \u5B57\u6BB5\u83B7\u53D6\uFF09").action(async (opts) => {
|
|
814
829
|
try {
|
|
815
830
|
const dbId = await getDbId(opts.agent);
|
|
816
831
|
const data = await getProductDetail({
|
|
@@ -824,7 +839,7 @@ function registerProductCommand(program2) {
|
|
|
824
839
|
process.exit(toExitCode(err));
|
|
825
840
|
}
|
|
826
841
|
});
|
|
827
|
-
product.command("update").description("\u66F4\u65B0\u5546\u54C1\u4FE1\u606F\
|
|
842
|
+
product.command("update").description("\u66F4\u65B0\u5546\u54C1\u77E5\u8BC6\u4FE1\u606F\u3002\u53EF\u66F4\u65B0\u5B57\u6BB5: \u5356\u70B9\u3001\u8865\u5145\u77E5\u8BC6\u3001tag\u3001\u53C2\u6570\u3001\u8F6E\u64AD\u56FE\u8BC6\u522B\u7ED3\u679C\u3001\u5546\u54C1\u8BE6\u60C5\u9875\u8BC6\u522B\u7ED3\u679C").requiredOption("--agent <config_id>", "Agent \u914D\u7F6E ID\uFF08\u4ECE agent list \u83B7\u53D6\uFF09").requiredOption("--product-id <product_id>", "\u5546\u54C1 ID\uFF08\u4ECE product list \u8FD4\u56DE\u7684 product_id \u5B57\u6BB5\u83B7\u53D6\uFF09").requiredOption("--update <json>", '\u66F4\u65B0\u5185\u5BB9 JSON \u6216 @\u6587\u4EF6\u8DEF\u5F84\u3002\u793A\u4F8B: {"\u5356\u70B9":"\u65B0\u5356\u70B9"} \u6216 {"\u8865\u5145\u77E5\u8BC6":"[{\\"question\\":\\"Q\\",\\"answer\\":\\"A\\"}]"}').action(async (opts) => {
|
|
828
843
|
try {
|
|
829
844
|
const [dbId, matched] = await Promise.all([
|
|
830
845
|
getDbId(opts.agent),
|
|
@@ -848,7 +863,7 @@ function registerProductCommand(program2) {
|
|
|
848
863
|
process.exit(toExitCode(err));
|
|
849
864
|
}
|
|
850
865
|
});
|
|
851
|
-
product.command("update-sku").description(
|
|
866
|
+
product.command("update-sku").description('\u66F4\u65B0\u6307\u5B9A SKU \u7684\u77E5\u8BC6\u4FE1\u606F\uFF08\u5982\u8865\u5145\u77E5\u8BC6\uFF09\u3002SKU \u540D\u79F0\u9700\u7CBE\u786E\u5339\u914D\uFF08\u5982 "\u989C\u8272\u5206\u7C7B:\u7C89\u7EA2"\uFF09').requiredOption("--agent <config_id>", "Agent \u914D\u7F6E ID\uFF08\u4ECE agent list \u83B7\u53D6\uFF09").requiredOption("--sku <name>", 'SKU \u540D\u79F0\uFF08\u7CBE\u786E\u5339\u914D\uFF0C\u5982 "\u989C\u8272\u5206\u7C7B:\u7C89\u7EA2"\uFF09').requiredOption("--update <json>", '\u66F4\u65B0\u5185\u5BB9 JSON \u6216 @\u6587\u4EF6\u8DEF\u5F84\u3002\u793A\u4F8B: {"\u8865\u5145\u77E5\u8BC6":"\u7C89\u7EA2\u8272\u4E3A\u6D45\u7C89\u8C03"}').action(async (opts) => {
|
|
852
867
|
try {
|
|
853
868
|
const updateDict = parseDataOption(opts.update);
|
|
854
869
|
const data = await updateSku({
|
|
@@ -924,8 +939,10 @@ async function getIssueStats(opts) {
|
|
|
924
939
|
|
|
925
940
|
// src/commands/issue.ts
|
|
926
941
|
function registerIssueCommand(program2) {
|
|
927
|
-
const issue = program2.command("issue").description(
|
|
928
|
-
|
|
942
|
+
const issue = program2.command("issue").description(
|
|
943
|
+
"\u5DE5\u5355\uFF08Issue\uFF09\u7BA1\u7406 \u2014\u2014 \u8BB0\u5F55 Agent \u56DE\u590D\u5F02\u5E38\u3001\u5BA2\u6237\u6295\u8BC9\u7B49\u5F85\u5904\u7406\u95EE\u9898\u3002\u5DE5\u5355\u662F AI \u4FEE\u590D\u6D41\u7A0B\uFF08issue-repair\uFF09\u7684\u8F93\u5165\u6E90"
|
|
944
|
+
);
|
|
945
|
+
issue.command("list").description("\u5217\u51FA\u5DE5\u5355\u3002\u8FD4\u56DE issue_id\u3001title\u3001status\u3001priority\u3001tags\u3001agent_id\u3001created_at \u7B49\u5B57\u6BB5").option("--agent <agent_id>", "\u6309 Agent ID \u7B5B\u9009\uFF08\u4ECE agent list \u83B7\u53D6 config_id\uFF09").option("--status <status...>", "\u6309\u72B6\u6001\u7B5B\u9009: open | closed\uFF08\u591A\u4E2A\u7A7A\u683C\u5206\u9694\uFF09").option("--priority <priority...>", "\u6309\u4F18\u5148\u7EA7\u7B5B\u9009: critical | high | medium | low\uFF08\u591A\u4E2A\u7A7A\u683C\u5206\u9694\uFF09").option("--tags <tags...>", "\u6309\u6807\u7B7E\u7B5B\u9009\uFF08\u591A\u4E2A\u7A7A\u683C\u5206\u9694\uFF09").option("--start <date>", "\u5F00\u59CB\u65E5\u671F\uFF08ISO \u683C\u5F0F\uFF0C\u5982 2026-03-05T00:00:00\uFF09").option("--end <date>", "\u7ED3\u675F\u65E5\u671F\uFF08ISO \u683C\u5F0F\uFF0C\u5982 2026-03-15T23:59:59\uFF09").option("--sort-by <field>", "\u6392\u5E8F\u5B57\u6BB5: created_at | updated_at", "created_at").option("--sort-order <order>", "\u6392\u5E8F\u65B9\u5411: asc | desc", "desc").option("--page <number>", "\u9875\u7801", "1").option("--page-size <number>", "\u6BCF\u9875\u6570\u91CF", "20").action(async (opts) => {
|
|
929
946
|
try {
|
|
930
947
|
const data = await listIssues({
|
|
931
948
|
agentId: opts.agent,
|
|
@@ -945,7 +962,7 @@ function registerIssueCommand(program2) {
|
|
|
945
962
|
process.exit(toExitCode(err));
|
|
946
963
|
}
|
|
947
964
|
});
|
|
948
|
-
issue.command("get").description("\u83B7\u53D6\u5DE5\u5355\u8BE6\u60C5").argument("<issue_id>", "\u5DE5\u5355 ID").action(async (issueId) => {
|
|
965
|
+
issue.command("get").description("\u83B7\u53D6\u5DE5\u5355\u5B8C\u6574\u8BE6\u60C5\uFF0C\u542B title\u3001content\u3001status\u3001priority\u3001tags\u3001conversation_id\u3001agent_id \u7B49\u5B57\u6BB5").argument("<issue_id>", "\u5DE5\u5355 ID").action(async (issueId) => {
|
|
949
966
|
try {
|
|
950
967
|
const data = await getIssue(issueId);
|
|
951
968
|
formatOutput({ success: true, data }, program2.opts().table);
|
|
@@ -954,7 +971,7 @@ function registerIssueCommand(program2) {
|
|
|
954
971
|
process.exit(toExitCode(err));
|
|
955
972
|
}
|
|
956
973
|
});
|
|
957
|
-
issue.command("create").description("\u521B\u5EFA\u5DE5\u5355").requiredOption("--title <title>", "\u5DE5\u5355\u6807\u9898").requiredOption("--content <content>", "\u5DE5\u5355\u5185\u5BB9").option("--priority <priority>", "\u4F18\u5148\u7EA7").option("--tags <tags...>", "\u6807\u7B7E").action(async (opts) => {
|
|
974
|
+
issue.command("create").description("\u624B\u52A8\u521B\u5EFA\u5DE5\u5355").requiredOption("--title <title>", "\u5DE5\u5355\u6807\u9898\uFF08\u7B80\u8981\u63CF\u8FF0\u95EE\u9898\uFF09").requiredOption("--content <content>", "\u5DE5\u5355\u5185\u5BB9\uFF08\u8BE6\u7EC6\u63CF\u8FF0\u95EE\u9898\u73B0\u8C61\u548C\u671F\u671B\u7ED3\u679C\uFF09").option("--priority <priority>", "\u4F18\u5148\u7EA7: critical | high | medium | low").option("--tags <tags...>", "\u6807\u7B7E\uFF08\u591A\u4E2A\u7A7A\u683C\u5206\u9694\uFF0C\u7528\u4E8E\u5206\u7C7B\u7B5B\u9009\uFF09").action(async (opts) => {
|
|
958
975
|
try {
|
|
959
976
|
const data = await createIssue({
|
|
960
977
|
title: opts.title,
|
|
@@ -968,7 +985,7 @@ function registerIssueCommand(program2) {
|
|
|
968
985
|
process.exit(toExitCode(err));
|
|
969
986
|
}
|
|
970
987
|
});
|
|
971
|
-
issue.command("update").description("\u66F4\u65B0\u5DE5\u5355").argument("<issue_id>", "\u5DE5\u5355 ID").requiredOption("--data <json>", "JSON \u6570\u636E\u6216 @\u6587\u4EF6\u8DEF\u5F84").action(async (issueId, opts) => {
|
|
988
|
+
issue.command("update").description("\u66F4\u65B0\u5DE5\u5355\u5B57\u6BB5\uFF08\u5982 status\u3001priority\u3001tags\u3001title\u3001content\uFF09").argument("<issue_id>", "\u5DE5\u5355 ID\uFF08\u4ECE issue list \u83B7\u53D6\uFF09").requiredOption("--data <json>", "JSON \u6570\u636E\u6216 @\u6587\u4EF6\u8DEF\u5F84\u3002\u53EF\u66F4\u65B0: status\uFF08open|closed\uFF09\u3001priority\u3001tags\u3001title\u3001content").action(async (issueId, opts) => {
|
|
972
989
|
try {
|
|
973
990
|
const body = parseDataOption(opts.data);
|
|
974
991
|
const data = await updateIssue(issueId, body);
|
|
@@ -978,7 +995,7 @@ function registerIssueCommand(program2) {
|
|
|
978
995
|
process.exit(toExitCode(err));
|
|
979
996
|
}
|
|
980
997
|
});
|
|
981
|
-
issue.command("stats").description("\
|
|
998
|
+
issue.command("stats").description("\u8DE8\u5DE5\u4F5C\u7A7A\u95F4 Issue \u6570\u91CF\u7EDF\u8BA1\uFF0C\u8FD4\u56DE\u6BCF\u4E2A\u5DE5\u4F5C\u7A7A\u95F4\u7684 open/closed/total \u8BA1\u6570").option("--start <date>", "\u5F00\u59CB\u65E5\u671F\uFF08YYYY-MM-DD \u683C\u5F0F\uFF0C\u5982 2026-03-01\uFF09").option("--end <date>", "\u7ED3\u675F\u65E5\u671F\uFF08YYYY-MM-DD \u683C\u5F0F\uFF0C\u5982 2026-03-23\uFF09").action(async (opts) => {
|
|
982
999
|
try {
|
|
983
1000
|
const data = await getIssueStats({
|
|
984
1001
|
dateStart: opts.start,
|
|
@@ -990,7 +1007,7 @@ function registerIssueCommand(program2) {
|
|
|
990
1007
|
process.exit(toExitCode(err));
|
|
991
1008
|
}
|
|
992
1009
|
});
|
|
993
|
-
const comment = issue.command("comment").description("\u5DE5\u5355\u8BC4\u8BBA\u7BA1\u7406");
|
|
1010
|
+
const comment = issue.command("comment").description("\u5DE5\u5355\u8BC4\u8BBA\u7BA1\u7406 \u2014\u2014 \u5728\u5DE5\u5355\u4E0B\u6DFB\u52A0\u8BA8\u8BBA\u3001\u4FEE\u590D\u8BB0\u5F55\u7B49\u8BC4\u8BBA");
|
|
994
1011
|
comment.command("list").description("\u5217\u51FA\u5DE5\u5355\u8BC4\u8BBA").argument("<issue_id>", "\u5DE5\u5355 ID").action(async (issueId) => {
|
|
995
1012
|
try {
|
|
996
1013
|
const data = await listIssueComments(issueId);
|
|
@@ -1026,7 +1043,9 @@ async function listChatHistory(opts) {
|
|
|
1026
1043
|
|
|
1027
1044
|
// src/commands/chat-history.ts
|
|
1028
1045
|
function registerChatHistoryCommand(program2) {
|
|
1029
|
-
program2.command("chat-history").description(
|
|
1046
|
+
program2.command("chat-history").description(
|
|
1047
|
+
"\u67E5\u8BE2\u5BA2\u6237\u5BFC\u5165\u7684\u539F\u59CB\u804A\u5929\u8BB0\u5F55\uFF08\u7528\u4E8E\u63D0\u70BC SA \u7B56\u7565\uFF09\u3002\u6CE8\u610F\uFF1A\u8FD9\u4E0D\u662F Agent \u7684\u5BF9\u8BDD\u8BB0\u5F55\uFF0CAgent \u5BF9\u8BDD\u8BF7\u7528 conversation \u547D\u4EE4"
|
|
1048
|
+
).requiredOption("--agent <config_id>", "Agent \u914D\u7F6E ID\uFF08\u4ECE agent list \u83B7\u53D6\uFF09").option("--page <number>", "\u9875\u7801", "1").option("--page-size <number>", "\u6BCF\u9875\u6570\u91CF", "20").action(async (opts) => {
|
|
1030
1049
|
try {
|
|
1031
1050
|
const data = await listChatHistory({
|
|
1032
1051
|
agentConfigId: opts.agent,
|
|
@@ -1076,8 +1095,10 @@ async function saveFaqContent(opts) {
|
|
|
1076
1095
|
|
|
1077
1096
|
// src/commands/faq.ts
|
|
1078
1097
|
function registerFaqCommand(program2) {
|
|
1079
|
-
const faq = program2.command("faq").description(
|
|
1080
|
-
|
|
1098
|
+
const faq = program2.command("faq").description(
|
|
1099
|
+
"FAQ \u77E5\u8BC6\u5E93\u7BA1\u7406 \u2014\u2014 Agent \u7684\u95EE\u7B54\u8865\u5145\u77E5\u8BC6\u6E90\uFF0C\u6309\u6587\u4EF6\u7EC4\u7EC7\u3002\u5F53 SA \u7B56\u7565\u672A\u8986\u76D6\u7684\u95EE\u9898\u53EF\u901A\u8FC7 FAQ \u6761\u76EE\u56DE\u7B54"
|
|
1100
|
+
);
|
|
1101
|
+
faq.command("list").description("\u5217\u51FA FAQ \u6587\u4EF6\u3002\u8FD4\u56DE knowledge_id \u548C file_name \u5B57\u6BB5\uFF0Cfile_name \u7528\u4E8E faq add --file \u5339\u914D").requiredOption("--agent <config_id>", "Agent \u914D\u7F6E ID\uFF08\u4ECE agent list \u83B7\u53D6\uFF09").option("--page <number>", "\u9875\u7801", "1").option("--page-size <number>", "\u6BCF\u9875\u6570\u91CF", "20").action(async (opts) => {
|
|
1081
1102
|
try {
|
|
1082
1103
|
const data = await listFaqFiles({
|
|
1083
1104
|
agentConfigId: opts.agent,
|
|
@@ -1090,7 +1111,7 @@ function registerFaqCommand(program2) {
|
|
|
1090
1111
|
process.exit(toExitCode(err));
|
|
1091
1112
|
}
|
|
1092
1113
|
});
|
|
1093
|
-
faq.command("add").description("\u5411 FAQ \u6587\u4EF6\u6DFB\u52A0\
|
|
1114
|
+
faq.command("add").description("\u5411\u6307\u5B9A FAQ \u6587\u4EF6\u6DFB\u52A0\u95EE\u7B54\u6761\u76EE\u3002\u5148\u7528 faq list \u83B7\u53D6\u6587\u4EF6\u540D").requiredOption("--agent <config_id>", "Agent \u914D\u7F6E ID\uFF08\u4ECE agent list \u83B7\u53D6\uFF09").requiredOption("--file <name>", "FAQ \u6587\u4EF6\u540D\uFF08\u9700\u7CBE\u786E\u5339\u914D faq list \u8FD4\u56DE\u7684 file_name\uFF09").requiredOption("--questions <items>", '\u76F8\u4F3C\u95EE\u9898\u5217\u8868\uFF08\u9017\u53F7\u5206\u9694\uFF0C\u5982 "\u600E\u4E48\u9000\u6B3E,\u5982\u4F55\u9000\u6B3E,\u9000\u6B3E\u6D41\u7A0B"\uFF09').requiredOption("--answers <pairs>", '\u7B54\u6848\uFF08\u683C\u5F0F: \u7B54\u6848=\u5185\u5BB9\u3002\u5982 "\u7B54\u6848=\u8BF7\u8054\u7CFB\u5BA2\u670D\u5904\u7406\u9000\u6B3E"\uFF09').option("--page-size <number>", "\u641C\u7D22\u6587\u4EF6\u65F6\u7684\u6BCF\u9875\u6570\u91CF", "100").action(async (opts) => {
|
|
1094
1115
|
try {
|
|
1095
1116
|
const filesResult = await listFaqFiles({
|
|
1096
1117
|
agentConfigId: opts.agent,
|
|
@@ -1156,8 +1177,10 @@ async function listConversations(opts) {
|
|
|
1156
1177
|
|
|
1157
1178
|
// src/commands/conversation.ts
|
|
1158
1179
|
function registerConversationCommand(program2) {
|
|
1159
|
-
const conversation = program2.command("conversation").description(
|
|
1160
|
-
|
|
1180
|
+
const conversation = program2.command("conversation").description(
|
|
1181
|
+
"\u4F1A\u8BDD\u7BA1\u7406 \u2014\u2014 Agent \u4E0E\u771F\u5B9E\u7528\u6237\u7684\u5BF9\u8BDD\u8BB0\u5F55\u3002\u6CE8\u610F\uFF1A\u8FD9\u662F Agent \u7684\u5B9E\u9645\u5BF9\u8BDD\uFF0C\u4E0D\u662F\u5BA2\u6237\u5BFC\u5165\u7684\u804A\u5929\u8BB0\u5F55\uFF08\u540E\u8005\u7528 chat-history \u547D\u4EE4\uFF09"
|
|
1182
|
+
);
|
|
1183
|
+
conversation.command("list").description("\u6309\u6761\u4EF6\u641C\u7D22\u4F1A\u8BDD\u5217\u8868\u3002\u8FD4\u56DE conversation_id\u3001user_name\u3001created_at \u7B49\u5B57\u6BB5").requiredOption("--agent <config_id>", "Agent \u914D\u7F6E ID\uFF08\u4ECE agent list \u83B7\u53D6\uFF09").option("--user <name>", "\u6309\u7528\u6237\u540D\u7B5B\u9009").option("--start <date>", "\u5F00\u59CB\u65E5\u671F\uFF08ISO \u683C\u5F0F\uFF0C\u5982 2026-03-22T00:00:00\uFF09").option("--end <date>", "\u7ED3\u675F\u65E5\u671F\uFF08ISO \u683C\u5F0F\uFF0C\u5982 2026-03-22T23:59:59\uFF09").option("--page <number>", "\u9875\u7801", "1").option("--page-size <number>", "\u6BCF\u9875\u6570\u91CF", "20").action(async (opts) => {
|
|
1161
1184
|
try {
|
|
1162
1185
|
const data = await listConversations({
|
|
1163
1186
|
agentConfigId: opts.agent,
|
|
@@ -1173,7 +1196,7 @@ function registerConversationCommand(program2) {
|
|
|
1173
1196
|
process.exit(toExitCode(err));
|
|
1174
1197
|
}
|
|
1175
1198
|
});
|
|
1176
|
-
conversation.command("records").description("\u83B7\u53D6\u4F1A\u8BDD\u804A\u5929\u8BB0\u5F55").argument("<conversation_id>", "\u4F1A\u8BDD ID").option("--page-size <number>", "\
|
|
1199
|
+
conversation.command("records").description("\u83B7\u53D6\u6307\u5B9A\u4F1A\u8BDD\u7684\u5B8C\u6574\u804A\u5929\u8BB0\u5F55\uFF08\u6D88\u606F\u5217\u8868\uFF09").argument("<conversation_id>", "\u4F1A\u8BDD ID\uFF08\u4ECE conversation list \u6216 issue get \u4E2D\u83B7\u53D6\uFF09").option("--page-size <number>", "\u8FD4\u56DE\u7684\u6D88\u606F\u6761\u6570", "50").option("--direction <dir>", "\u5206\u9875\u65B9\u5411: prev\uFF08\u66F4\u65E9\u7684\u6D88\u606F\uFF09| next\uFF08\u66F4\u65B0\u7684\u6D88\u606F\uFF09", "prev").action(async (conversationId, opts) => {
|
|
1177
1200
|
try {
|
|
1178
1201
|
const data = await getConversationRecords({
|
|
1179
1202
|
conversationId,
|
|
@@ -1268,8 +1291,15 @@ async function getRecordDebugInfo(recordId) {
|
|
|
1268
1291
|
|
|
1269
1292
|
// src/commands/debug.ts
|
|
1270
1293
|
function registerDebugCommand(program2) {
|
|
1271
|
-
const debug = program2.command("debug").description(
|
|
1272
|
-
|
|
1294
|
+
const debug = program2.command("debug").description(
|
|
1295
|
+
"Agent \u8C03\u8BD5\u6D4B\u8BD5 \u2014\u2014 \u5411 Agent \u53D1\u9001\u6D4B\u8BD5\u6D88\u606F\u5E76\u83B7\u53D6\u56DE\u590D\uFF0C\u662F\u9A8C\u8BC1 Agent \u56DE\u590D\u8D28\u91CF\u7684\u4E3B\u8981\u624B\u6BB5\u3002\u652F\u6301\u5355\u6761\u6D88\u606F\u548C\u591A\u8F6E\u5BF9\u8BDD\u91CD\u653E"
|
|
1296
|
+
);
|
|
1297
|
+
debug.command("ask").description(
|
|
1298
|
+
"\u5411 Agent \u53D1\u9001\u6D88\u606F\u5E76\u7B49\u5F85\u56DE\u590D\u3002\u8FD4\u56DE { conversation_id, reply: [{ record_id, content, ... }] }\u3002record_id \u53EF\u4F20\u7ED9 debug record \u67E5\u770B\u5185\u90E8\u63A8\u7406\u94FE\u8DEF"
|
|
1299
|
+
).requiredOption("--agent <config_id>", "Agent \u914D\u7F6E ID\uFF08\u4ECE agent list \u83B7\u53D6\uFF09").option("--text <message>", "\u53D1\u9001\u7684\u6D88\u606F\u5185\u5BB9\uFF08\u4E0E --messages \u4E92\u65A5\uFF0C\u4E8C\u9009\u4E00\uFF09").option(
|
|
1300
|
+
"--messages <json>",
|
|
1301
|
+
'\u5B8C\u6574\u6D88\u606F\u5217\u8868 JSON \u6216 @\u6587\u4EF6\u8DEF\u5F84\uFF0C\u7528\u4E8E\u91CD\u653E\u591A\u8F6E\u5BF9\u8BDD\uFF08\u4E0E --text \u4E92\u65A5\uFF09\u3002\u63A5\u53D7\u4E24\u79CD\u683C\u5F0F\uFF1A(1) JSON \u6570\u7EC4 [{ match_id, content: { text, image_url? }, timestamp, type: "TEXT", role: "user"|"assistant" }, ...] (2) \u542B msg_list \u5B57\u6BB5\u7684\u5BF9\u8C61 { msg_list: [...] }\uFF08conversation records \u7684\u539F\u59CB\u683C\u5F0F\u53EF\u76F4\u63A5\u4F7F\u7528\uFF09'
|
|
1302
|
+
).option("--user <name>", "\u6A21\u62DF\u7684\u7528\u6237\u540D\uFF08\u9ED8\u8BA4\u4F7F\u7528\u767B\u5F55\u7528\u6237\u540D\uFF09").option("--url <image_url>", "\u9644\u5E26\u7684\u56FE\u7247 URL\uFF08\u4EC5 --text \u6A21\u5F0F\u6709\u6548\uFF09").option("--conversation <id>", "\u590D\u7528\u5DF2\u6709\u4F1A\u8BDD ID\uFF0C\u7528\u4E8E\u5728\u540C\u4E00\u4E0A\u4E0B\u6587\u4E2D\u7EE7\u7EED\u5BF9\u8BDD").option("--timeout <seconds>", "\u6700\u5927\u7B49\u5F85\u56DE\u590D\u65F6\u95F4\uFF08\u79D2\uFF09\uFF0C\u590D\u6742 Agent \u5EFA\u8BAE\u8C03\u9AD8", "30").option("--poll-interval <ms>", "\u8F6E\u8BE2\u95F4\u9694\uFF08\u6BEB\u79D2\uFF09", "2000").action(async (opts) => {
|
|
1273
1303
|
try {
|
|
1274
1304
|
if (!opts.text && !opts.messages) {
|
|
1275
1305
|
outputError(1, "\u5FC5\u987B\u6307\u5B9A --text \u6216 --messages \u5176\u4E2D\u4E4B\u4E00");
|
|
@@ -1320,7 +1350,7 @@ function registerDebugCommand(program2) {
|
|
|
1320
1350
|
process.exit(toExitCode(err));
|
|
1321
1351
|
}
|
|
1322
1352
|
});
|
|
1323
|
-
debug.command("record").description("\u83B7\u53D6\
|
|
1353
|
+
debug.command("record").description("\u83B7\u53D6\u67D0\u6761\u56DE\u590D\u7684\u5185\u90E8\u63A8\u7406\u94FE\u8DEF\uFF08flow_info\uFF09\uFF0C\u7528\u4E8E\u8BCA\u65AD Agent \u4E3A\u4F55\u7ED9\u51FA\u7279\u5B9A\u56DE\u590D").argument("<record_id>", "\u56DE\u590D\u8BB0\u5F55 ID\uFF08\u4ECE debug ask \u8FD4\u56DE\u7684 reply[].record_id \u83B7\u53D6\uFF09").action(async (recordId) => {
|
|
1324
1354
|
try {
|
|
1325
1355
|
const data = await getRecordDebugInfo(recordId);
|
|
1326
1356
|
formatOutput({ success: true, data }, program2.opts().table);
|
|
@@ -1653,7 +1683,9 @@ var RESOURCE_NAMES = Object.keys(RESOURCE_DEFS);
|
|
|
1653
1683
|
|
|
1654
1684
|
// src/commands/monitor.ts
|
|
1655
1685
|
function registerMonitorCommand(program2) {
|
|
1656
|
-
const monitor = program2.command("monitor").description(
|
|
1686
|
+
const monitor = program2.command("monitor").description(
|
|
1687
|
+
"\u8FD0\u8425\u76D1\u63A7 \u2014\u2014 Agent \u5065\u5EB7\u5EA6\u3001\u6027\u80FD\u6307\u6807\u3001\u5F02\u5E38\u544A\u8B66\u3001\u8FD0\u8425\u7EDF\u8BA1\u3002\u7528 monitor fields <resource> \u67E5\u770B\u5404\u63A5\u53E3\u8FD4\u56DE\u5B57\u6BB5\u7684\u542B\u4E49"
|
|
1688
|
+
);
|
|
1657
1689
|
monitor.command("fields [resource]").description(`\u67E5\u770B\u63A5\u53E3\u8FD4\u56DE\u5B57\u6BB5\u542B\u4E49\uFF08\u53EF\u9009: ${RESOURCE_NAMES.join(", ")}\uFF09`).action((resource) => {
|
|
1658
1690
|
if (!resource) {
|
|
1659
1691
|
formatOutput({
|
|
@@ -1674,7 +1706,7 @@ function registerMonitorCommand(program2) {
|
|
|
1674
1706
|
}
|
|
1675
1707
|
formatOutput({ success: true, data: def }, program2.opts().table);
|
|
1676
1708
|
});
|
|
1677
|
-
monitor.command("agents").description("Agent \u751F\u547D\u5468\u671F\u5217\u8868").option("--page <number>", "\u9875\u7801", "1").option("--page-size <number>", "\u6BCF\u9875\u6570\u91CF", "200").action(async (opts) => {
|
|
1709
|
+
monitor.command("agents").description("Agent \u751F\u547D\u5468\u671F\u5217\u8868 \u2014\u2014 \u6784\u5EFA\u8FDB\u5EA6\u3001\u4F1A\u8BDD\u7EDF\u8BA1\u3001\u5546\u54C1\u5B66\u4E60\u72B6\u6001\u7B49").option("--page <number>", "\u9875\u7801", "1").option("--page-size <number>", "\u6BCF\u9875\u6570\u91CF", "200").action(async (opts) => {
|
|
1678
1710
|
try {
|
|
1679
1711
|
const data = await listAgentLifecycle({
|
|
1680
1712
|
page: Number(opts.page),
|
|
@@ -1686,8 +1718,8 @@ function registerMonitorCommand(program2) {
|
|
|
1686
1718
|
process.exit(toExitCode(err));
|
|
1687
1719
|
}
|
|
1688
1720
|
});
|
|
1689
|
-
const tickets2 = monitor.command("tickets").description("\u76D1\u63A7\u5DE5\u5355");
|
|
1690
|
-
tickets2.command("list").description("\u5217\u51FA\u76D1\u63A7\u5DE5\u5355").option("--agent <config_id>", "Agent ID").option("--status <status>", "\u5DE5\u5355\u72B6\u6001").option("--severity <severity>", "\u4E25\u91CD\u7EA7\u522B: critical | high | medium | low").option("--page <number>", "\u9875\u7801", "1").option("--page-size <number>", "\u6BCF\u9875\u6570\u91CF", "200").action(async (opts) => {
|
|
1721
|
+
const tickets2 = monitor.command("tickets").description("\u76D1\u63A7\u5DE5\u5355 \u2014\u2014 \u5F02\u5E38\u68C0\u6D4B\u89C4\u5219\u81EA\u52A8\u751F\u6210\u7684\u544A\u8B66\u5DE5\u5355");
|
|
1722
|
+
tickets2.command("list").description("\u5217\u51FA\u76D1\u63A7\u5DE5\u5355\u3002\u8FD4\u56DE ticket_id\u3001title\u3001status\u3001severity\u3001priority\u3001payload \u7B49\u5B57\u6BB5").option("--agent <config_id>", "Agent ID\uFF08\u4ECE agent list \u83B7\u53D6\uFF09").option("--status <status>", "\u5DE5\u5355\u72B6\u6001: open | closed").option("--severity <severity>", "\u4E25\u91CD\u7EA7\u522B: critical | high | medium | low").option("--page <number>", "\u9875\u7801", "1").option("--page-size <number>", "\u6BCF\u9875\u6570\u91CF", "200").action(async (opts) => {
|
|
1691
1723
|
try {
|
|
1692
1724
|
const data = await listTickets({
|
|
1693
1725
|
agentId: opts.agent,
|
|
@@ -1711,8 +1743,8 @@ function registerMonitorCommand(program2) {
|
|
|
1711
1743
|
process.exit(toExitCode(err));
|
|
1712
1744
|
}
|
|
1713
1745
|
});
|
|
1714
|
-
const snapshots = monitor.command("snapshots").description("\u76D1\u63A7\u5FEB\u7167");
|
|
1715
|
-
snapshots.command("hourly").description("\u67E5\u8BE2\u5C0F\u65F6\u5FEB\u7167").option("--agent <config_id>", "Agent ID").option("--workspace-id <id>", "\u5DE5\u4F5C\u7A7A\u95F4 ID").option("--start <datetime>", "\u5F00\u59CB\u65F6\u95F4 (ISO)").option("--end <datetime>", "\u7ED3\u675F\u65F6\u95F4 (ISO)").option("--page <number>", "\u9875\u7801").option("--page-size <number>", "\u6BCF\u9875\u6570\u91CF").action(async (opts) => {
|
|
1746
|
+
const snapshots = monitor.command("snapshots").description("\u76D1\u63A7\u5FEB\u7167 \u2014\u2014 \u6309\u5C0F\u65F6/\u5929\u7C92\u5EA6\u7684 Agent \u6027\u80FD\u6307\u6807\uFF08\u4F1A\u8BDD\u91CF\u3001\u8F6C\u4EBA\u5DE5\u7387\u3001\u54CD\u5E94\u65F6\u95F4\u7B49\uFF09");
|
|
1747
|
+
snapshots.command("hourly").description("\u67E5\u8BE2\u5C0F\u65F6\u7EA7\u6027\u80FD\u5FEB\u7167\uFF08\u7528\u4E8E\u5F02\u5E38\u6392\u67E5\u548C\u7EC6\u7C92\u5EA6\u5206\u6790\uFF09").option("--agent <config_id>", "Agent ID").option("--workspace-id <id>", "\u5DE5\u4F5C\u7A7A\u95F4 ID").option("--start <datetime>", "\u5F00\u59CB\u65F6\u95F4 (ISO)").option("--end <datetime>", "\u7ED3\u675F\u65F6\u95F4 (ISO)").option("--page <number>", "\u9875\u7801").option("--page-size <number>", "\u6BCF\u9875\u6570\u91CF").action(async (opts) => {
|
|
1716
1748
|
try {
|
|
1717
1749
|
const data = await listHourlySnapshots({
|
|
1718
1750
|
agentId: opts.agent,
|
|
@@ -1728,7 +1760,7 @@ function registerMonitorCommand(program2) {
|
|
|
1728
1760
|
process.exit(toExitCode(err));
|
|
1729
1761
|
}
|
|
1730
1762
|
});
|
|
1731
|
-
snapshots.command("daily").description("\u67E5\u8BE2\u65E5\u5FEB\u7167").option("--agent <config_id>", "Agent ID").option("--workspace-id <id>", "\u5DE5\u4F5C\u7A7A\u95F4 ID").option("--start <date>", "\u5F00\u59CB\u65E5\u671F (YYYY-MM-DD)").option("--end <date>", "\u7ED3\u675F\u65E5\u671F (YYYY-MM-DD)").action(async (opts) => {
|
|
1763
|
+
snapshots.command("daily").description("\u67E5\u8BE2\u65E5\u7EA7\u6027\u80FD\u5FEB\u7167\uFF08\u7528\u4E8E\u8D8B\u52BF\u5206\u6790\u548C\u65E5\u62A5\uFF09").option("--agent <config_id>", "Agent ID").option("--workspace-id <id>", "\u5DE5\u4F5C\u7A7A\u95F4 ID").option("--start <date>", "\u5F00\u59CB\u65E5\u671F (YYYY-MM-DD)").option("--end <date>", "\u7ED3\u675F\u65E5\u671F (YYYY-MM-DD)").action(async (opts) => {
|
|
1732
1764
|
try {
|
|
1733
1765
|
const data = await listDailySnapshots({
|
|
1734
1766
|
agentId: opts.agent,
|
|
@@ -1742,7 +1774,7 @@ function registerMonitorCommand(program2) {
|
|
|
1742
1774
|
process.exit(toExitCode(err));
|
|
1743
1775
|
}
|
|
1744
1776
|
});
|
|
1745
|
-
snapshots.command("daily-range").description("\u67E5\u8BE2\u65E5\u5FEB\u7167\uFF08\u8303\u56F4\uFF0C\u542B\u8D8B\u52BF\uFF09").option("--agent <config_id>", "Agent ID").option("--workspace-id <id>", "\u5DE5\u4F5C\u7A7A\u95F4 ID").option("--start <date>", "\u5F00\u59CB\u65E5\u671F (YYYY-MM-DD)").option("--end <date>", "\u7ED3\u675F\u65E5\u671F (YYYY-MM-DD)").option("--page <number>", "\u9875\u7801").option("--page-size <number>", "\u6BCF\u9875\u6570\u91CF", "200").action(async (opts) => {
|
|
1777
|
+
snapshots.command("daily-range").description("\u67E5\u8BE2\u65E5\u5FEB\u7167\uFF08\u8303\u56F4\u67E5\u8BE2\uFF0C\u542B\u8D8B\u52BF\u5BF9\u6BD4\u6570\u636E\uFF09").option("--agent <config_id>", "Agent ID").option("--workspace-id <id>", "\u5DE5\u4F5C\u7A7A\u95F4 ID").option("--start <date>", "\u5F00\u59CB\u65E5\u671F (YYYY-MM-DD)").option("--end <date>", "\u7ED3\u675F\u65E5\u671F (YYYY-MM-DD)").option("--page <number>", "\u9875\u7801").option("--page-size <number>", "\u6BCF\u9875\u6570\u91CF", "200").action(async (opts) => {
|
|
1746
1778
|
try {
|
|
1747
1779
|
const data = await listDailySnapshotsRange({
|
|
1748
1780
|
agentId: opts.agent,
|
|
@@ -1758,7 +1790,7 @@ function registerMonitorCommand(program2) {
|
|
|
1758
1790
|
process.exit(toExitCode(err));
|
|
1759
1791
|
}
|
|
1760
1792
|
});
|
|
1761
|
-
monitor.command("statistics").description("Agent \u8FD0\u8425\u7EDF\u8BA1").option("--start <date>", "\u5F00\u59CB\u65E5\u671F (ISO)").option("--end <date>", "\u7ED3\u675F\u65E5\u671F (ISO)").option("--page <number>", "\u9875\u7801", "1").option("--page-size <number>", "\u6BCF\u9875\u6570\u91CF", "100").action(async (opts) => {
|
|
1793
|
+
monitor.command("statistics").description("Agent \u8FD0\u8425\u7EDF\u8BA1\uFF08\u805A\u5408\u6307\u6807\uFF1A\u4F1A\u8BDD\u603B\u91CF\u3001\u8F6C\u4EBA\u5DE5\u7387\u3001\u5E73\u5747\u54CD\u5E94\u65F6\u95F4\u7B49\uFF09").option("--start <date>", "\u5F00\u59CB\u65E5\u671F (ISO)").option("--end <date>", "\u7ED3\u675F\u65E5\u671F (ISO)").option("--page <number>", "\u9875\u7801", "1").option("--page-size <number>", "\u6BCF\u9875\u6570\u91CF", "100").action(async (opts) => {
|
|
1762
1794
|
try {
|
|
1763
1795
|
const data = await listAgentStatistics({
|
|
1764
1796
|
startDate: opts.start,
|
|
@@ -1772,7 +1804,7 @@ function registerMonitorCommand(program2) {
|
|
|
1772
1804
|
process.exit(toExitCode(err));
|
|
1773
1805
|
}
|
|
1774
1806
|
});
|
|
1775
|
-
monitor.command("workspaces").description("\u8FD0\u8425\u5DE5\u4F5C\u7A7A\u95F4\u5217\u8868").option("--page <number>", "\u9875\u7801", "1").option("--page-size <number>", "\u6BCF\u9875\u6570\u91CF", "200").option("--has-agent", "\u4EC5\u663E\u793A\
|
|
1807
|
+
monitor.command("workspaces").description("\u8FD0\u8425\u5DE5\u4F5C\u7A7A\u95F4\u5217\u8868\uFF08\u542B\u5BA2\u6237\u4FE1\u606F\u3001\u5408\u540C\u72B6\u6001\u7B49\uFF09").option("--page <number>", "\u9875\u7801", "1").option("--page-size <number>", "\u6BCF\u9875\u6570\u91CF", "200").option("--has-agent", "\u4EC5\u663E\u793A\u5DF2\u90E8\u7F72 Agent \u7684\u5DE5\u4F5C\u7A7A\u95F4").action(async (opts) => {
|
|
1776
1808
|
try {
|
|
1777
1809
|
const data = await listOperationWorkspaces({
|
|
1778
1810
|
page: Number(opts.page),
|
|
@@ -1825,8 +1857,10 @@ async function updateRepairRecord(recordId, data) {
|
|
|
1825
1857
|
|
|
1826
1858
|
// src/commands/repair-record.ts
|
|
1827
1859
|
function registerRepairRecordCommand(program2) {
|
|
1828
|
-
const repairRecord = program2.command("repair-record").description(
|
|
1829
|
-
|
|
1860
|
+
const repairRecord = program2.command("repair-record").description(
|
|
1861
|
+
"Issue \u4FEE\u590D\u8BB0\u5F55\u7BA1\u7406 \u2014\u2014 AI \u81EA\u52A8\u4FEE\u590D\u6D41\u7A0B\u7684\u5BA1\u8BA1\u8FFD\u8E2A\u3002\u8BB0\u5F55\u6BCF\u6B21\u4FEE\u590D\u7684\u8BCA\u65AD\u63A8\u7406\u3001\u4FEE\u590D\u7B56\u7565\u3001\u53D8\u66F4\u5FEB\u7167\u548C\u9A8C\u8BC1\u7ED3\u679C\uFF0C\u7528\u4E8E\u81EA\u6211\u8FDB\u5316"
|
|
1862
|
+
);
|
|
1863
|
+
repairRecord.command("list").description("\u5217\u51FA\u4FEE\u590D\u8BB0\u5F55\u3002\u8FD4\u56DE record_id\u3001issue_id\u3001agent_id\u3001repair_action\u3001repair_status\u3001repair_result \u7B49\u5B57\u6BB5").option("--issue <issue_id>", "\u6309\u5DE5\u5355 ID \u7B5B\u9009\uFF08\u4ECE issue list \u83B7\u53D6\uFF09").option("--agent <agent_id>", "\u6309 Agent ID \u7B5B\u9009\uFF08\u4ECE agent list \u83B7\u53D6\uFF09").option("--workspace <workspace_id>", "\u6309\u5DE5\u4F5C\u7A7A\u95F4 ID \u7B5B\u9009").option("--page <number>", "\u9875\u7801", "1").option("--page-size <number>", "\u6BCF\u9875\u6570\u91CF", "20").action(async (opts) => {
|
|
1830
1864
|
try {
|
|
1831
1865
|
const data = await listRepairRecords({
|
|
1832
1866
|
issueId: opts.issue,
|
|
@@ -1841,7 +1875,7 @@ function registerRepairRecordCommand(program2) {
|
|
|
1841
1875
|
process.exit(toExitCode(err));
|
|
1842
1876
|
}
|
|
1843
1877
|
});
|
|
1844
|
-
repairRecord.command("create").description("\u521B\u5EFA\u4FEE\u590D\u8BB0\u5F55").requiredOption("--issue <issue_id>", "\u5DE5\u5355 ID").requiredOption("--agent <agent_id>", "Agent ID").requiredOption("--action <repair_action>",
|
|
1878
|
+
repairRecord.command("create").description("\u521B\u5EFA\u4FEE\u590D\u8BB0\u5F55\u3002\u901A\u5E38\u5728 Issue \u4FEE\u590D\u5B8C\u6210\u540E\u8C03\u7528\uFF0C\u8BB0\u5F55\u5B8C\u6574\u7684\u4FEE\u590D\u8FC7\u7A0B").requiredOption("--issue <issue_id>", "\u5173\u8054\u7684\u5DE5\u5355 ID\uFF08\u4ECE issue list \u83B7\u53D6\uFF09").requiredOption("--agent <agent_id>", "\u5173\u8054\u7684 Agent ID\uFF08\u4ECE agent list \u83B7\u53D6\uFF09").requiredOption("--action <repair_action>", '\u4FEE\u590D\u52A8\u4F5C\u6458\u8981\uFF08\u5982 "\u66F4\u65B0 SA \u7B56\u7565"\u3001"\u65B0\u589E FAQ \u6761\u76EE"\uFF09').option("--agent-name <name>", "Agent \u540D\u79F0\uFF08\u4FBF\u4E8E\u9605\u8BFB\uFF0C\u4E0D\u5F71\u54CD\u5173\u8054\uFF09").option("--type <repair_type>", "\u4FEE\u590D\u7C7B\u578B: update_sa | create_sa | knowledge_update | config_change | prompt_fix | sa_policy_update").option("--status <repair_status>", "\u4FEE\u590D\u72B6\u6001: pending | success | failed | partial").option("--duration <ms>", "\u4FEE\u590D\u8017\u65F6\uFF08\u6BEB\u79D2\uFF09").option("--result <json>", "\u7ED3\u6784\u5316\u4FEE\u590D\u7ED3\u679C\uFF08JSON\uFF09\uFF0C\u542B failure_type\u3001root_component\u3001diagnosis_reasoning\u3001fix_reasoning\u3001changes \u7B49\u5B57\u6BB5").option("--workspace <workspace_id>", "\u5DE5\u4F5C\u7A7A\u95F4 ID").action(async (opts) => {
|
|
1845
1879
|
try {
|
|
1846
1880
|
const data = await createRepairRecord({
|
|
1847
1881
|
issue_id: opts.issue,
|
|
@@ -1860,7 +1894,7 @@ function registerRepairRecordCommand(program2) {
|
|
|
1860
1894
|
process.exit(toExitCode(err));
|
|
1861
1895
|
}
|
|
1862
1896
|
});
|
|
1863
|
-
repairRecord.command("update").description("\u66F4\u65B0\u4FEE\u590D\u8BB0\u5F55").argument("<record_id>", "\u4FEE\u590D\u8BB0\u5F55 ID").requiredOption("--data <json>", "JSON \u6570\u636E\u6216 @\u6587\u4EF6\u8DEF\u5F84").action(async (recordId, opts) => {
|
|
1897
|
+
repairRecord.command("update").description("\u66F4\u65B0\u4FEE\u590D\u8BB0\u5F55\u7684\u72B6\u6001\u6216\u7ED3\u679C\u3002\u53EF\u66F4\u65B0: repair_action\u3001repair_result\uFF08JSON\uFF09\u3001repair_type\u3001repair_status\u3001duration_ms").argument("<record_id>", "\u4FEE\u590D\u8BB0\u5F55 ID\uFF08\u4ECE repair-record list \u8FD4\u56DE\u7684 record_id \u83B7\u53D6\uFF09").requiredOption("--data <json>", "JSON \u6570\u636E\u6216 @\u6587\u4EF6\u8DEF\u5F84\u3002\u53EF\u66F4\u65B0\u5B57\u6BB5: repair_action\u3001repair_result\uFF08JSON \u5BF9\u8C61\uFF09\u3001repair_type\u3001repair_status\uFF08pending|success|failed|partial\uFF09\u3001duration_ms").action(async (recordId, opts) => {
|
|
1864
1898
|
try {
|
|
1865
1899
|
const body = parseDataOption(opts.data);
|
|
1866
1900
|
const data = await updateRepairRecord(recordId, body);
|
|
@@ -1876,7 +1910,9 @@ function registerRepairRecordCommand(program2) {
|
|
|
1876
1910
|
var require2 = createRequire(import.meta.url);
|
|
1877
1911
|
var { version } = require2("../package.json");
|
|
1878
1912
|
var program = new Command();
|
|
1879
|
-
program.name("cs-cli").description(
|
|
1913
|
+
program.name("cs-cli").description(
|
|
1914
|
+
"BetterYeah AI \u5BA2\u670D\u5E73\u53F0 CLI\u3002\u6838\u5FC3\u6982\u5FF5\uFF1Aworkspace\uFF08\u5DE5\u4F5C\u7A7A\u95F4\uFF09\u2192 agent\uFF08AI \u5BA2\u670D\u673A\u5668\u4EBA\uFF09\u2192 SA/product/FAQ\uFF08\u77E5\u8BC6\u914D\u7F6E\uFF09\u2192 issue\uFF08\u5DE5\u5355\uFF09\u2192 debug\uFF08\u8C03\u8BD5\u9A8C\u8BC1\uFF09\u2192 monitor\uFF08\u8FD0\u8425\u76D1\u63A7\uFF09\u2192 repair-record\uFF08\u4FEE\u590D\u5BA1\u8BA1\uFF09\u3002\u6240\u6709\u547D\u4EE4\u9ED8\u8BA4\u8F93\u51FA JSON\uFF0C\u8FFD\u52A0 --table \u53EF\u5207\u6362\u4E3A\u4EBA\u7C7B\u53EF\u8BFB\u8868\u683C"
|
|
1915
|
+
).version(version).option("--table", "\u4EE5\u8868\u683C\u5F62\u5F0F\u8F93\u51FA\uFF08\u9ED8\u8BA4 JSON\uFF09\u3002\u4EBA\u5DE5\u67E5\u770B\u65F6\u4F7F\u7528", false).option("--workspace <id>", "\u4E34\u65F6\u8986\u76D6\u9ED8\u8BA4\u5DE5\u4F5C\u7A7A\u95F4 ID\uFF0C\u4E0D\u4FEE\u6539\u6301\u4E45\u5316\u914D\u7F6E").option("--timeout <ms>", "\u8BF7\u6C42\u8D85\u65F6\u65F6\u95F4\uFF08\u6BEB\u79D2\uFF09\uFF0C\u590D\u6742 Agent \u56DE\u590D\u5EFA\u8BAE\u8C03\u9AD8", "20000");
|
|
1880
1916
|
program.hook("preAction", (thisCommand) => {
|
|
1881
1917
|
const opts = thisCommand.opts();
|
|
1882
1918
|
if (opts.workspace) {
|