@ai-setting/roy-agent-cli 1.5.87 → 1.5.88
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/roy-agent.js +91 -84
- package/dist/index.js +91 -84
- package/dist/roy-agent-linux-x64/bin/roy-agent +0 -0
- package/package.json +5 -1
package/dist/bin/roy-agent.js
CHANGED
|
@@ -7320,7 +7320,7 @@ var require_dist = __commonJS((exports) => {
|
|
|
7320
7320
|
var require_package = __commonJS((exports, module) => {
|
|
7321
7321
|
module.exports = {
|
|
7322
7322
|
name: "@ai-setting/roy-agent-cli",
|
|
7323
|
-
version: "1.5.
|
|
7323
|
+
version: "1.5.88",
|
|
7324
7324
|
type: "module",
|
|
7325
7325
|
description: "CLI for roy-agent - Non-interactive command execution",
|
|
7326
7326
|
main: "./dist/index.js",
|
|
@@ -7343,6 +7343,8 @@ var require_package = __commonJS((exports, module) => {
|
|
|
7343
7343
|
scripts: {
|
|
7344
7344
|
build: "bunup",
|
|
7345
7345
|
clean: "rm -rf dist",
|
|
7346
|
+
lint: "eslint --max-warnings 0 src/",
|
|
7347
|
+
"lint:fix": "eslint --fix src/",
|
|
7346
7348
|
typecheck: "npx tsc --noEmit --skipLibCheck"
|
|
7347
7349
|
},
|
|
7348
7350
|
dependencies: {
|
|
@@ -7363,7 +7365,9 @@ var require_package = __commonJS((exports, module) => {
|
|
|
7363
7365
|
devDependencies: {
|
|
7364
7366
|
"@types/node": "^20.10.0",
|
|
7365
7367
|
"@types/yargs": "^17.0.32",
|
|
7368
|
+
"@typescript-eslint/parser": "^8.62.1",
|
|
7366
7369
|
bunup: "^0.16.0",
|
|
7370
|
+
eslint: "^10.6.0",
|
|
7367
7371
|
typescript: "^5.3.0"
|
|
7368
7372
|
},
|
|
7369
7373
|
engines: {
|
|
@@ -10316,6 +10320,8 @@ var ListCommand = {
|
|
|
10316
10320
|
const activeSessionId = sessionComponent.getActiveSessionId();
|
|
10317
10321
|
if (args.json) {
|
|
10318
10322
|
output.json({
|
|
10323
|
+
total: sessions.length,
|
|
10324
|
+
totalCount,
|
|
10319
10325
|
sessions: sessions.map((s) => {
|
|
10320
10326
|
const workflowMeta = s.metadata?.type === "workflow" ? s.metadata : null;
|
|
10321
10327
|
return {
|
|
@@ -10332,9 +10338,7 @@ var ListCommand = {
|
|
|
10332
10338
|
updatedAt: new Date(s.updatedAt).toISOString(),
|
|
10333
10339
|
isActive: s.id === activeSessionId
|
|
10334
10340
|
};
|
|
10335
|
-
})
|
|
10336
|
-
total: sessions.length,
|
|
10337
|
-
totalCount
|
|
10341
|
+
})
|
|
10338
10342
|
});
|
|
10339
10343
|
} else if (args.quiet || args.id) {
|
|
10340
10344
|
sessions.forEach((s) => output.log(s.id));
|
|
@@ -10845,7 +10849,13 @@ var MessagesCommand = {
|
|
|
10845
10849
|
}
|
|
10846
10850
|
if (a.json) {
|
|
10847
10851
|
output.json({
|
|
10852
|
+
total: totalMessages,
|
|
10848
10853
|
sessionId: a.sessionId,
|
|
10854
|
+
pagination: {
|
|
10855
|
+
offset: a.offset,
|
|
10856
|
+
limit: a.limit,
|
|
10857
|
+
hasMore: a.offset + a.limit < totalMessages
|
|
10858
|
+
},
|
|
10849
10859
|
messages: messages.map((m) => ({
|
|
10850
10860
|
id: m.id,
|
|
10851
10861
|
role: m.role,
|
|
@@ -10853,13 +10863,7 @@ var MessagesCommand = {
|
|
|
10853
10863
|
parts: m.parts,
|
|
10854
10864
|
timestamp: new Date(m.timestamp).toISOString(),
|
|
10855
10865
|
isCheckpoint: m.metadata?.isCheckpoint
|
|
10856
|
-
}))
|
|
10857
|
-
total: totalMessages,
|
|
10858
|
-
pagination: {
|
|
10859
|
-
offset: a.offset,
|
|
10860
|
-
limit: a.limit,
|
|
10861
|
-
hasMore: a.offset + a.limit < totalMessages
|
|
10862
|
-
}
|
|
10866
|
+
}))
|
|
10863
10867
|
});
|
|
10864
10868
|
} else {
|
|
10865
10869
|
const checkpointStyle = (content) => {
|
|
@@ -11847,6 +11851,35 @@ var SessionsCommand = {
|
|
|
11847
11851
|
|
|
11848
11852
|
// src/commands/tasks/list.ts
|
|
11849
11853
|
import chalk16 from "chalk";
|
|
11854
|
+
|
|
11855
|
+
// src/commands/tasks/_build-list-json.ts
|
|
11856
|
+
function buildListTasksJson(tasks, total, args, extras) {
|
|
11857
|
+
const projected = tasks.map((t) => ({
|
|
11858
|
+
id: t.id,
|
|
11859
|
+
title: t.title,
|
|
11860
|
+
status: t.status,
|
|
11861
|
+
priority: t.priority,
|
|
11862
|
+
type: t.type,
|
|
11863
|
+
progress: t.progress,
|
|
11864
|
+
current_status: t.current_status,
|
|
11865
|
+
project_path: t.project_path,
|
|
11866
|
+
context: t.context,
|
|
11867
|
+
createdAt: t.createdAt,
|
|
11868
|
+
updatedAt: t.updatedAt
|
|
11869
|
+
}));
|
|
11870
|
+
return {
|
|
11871
|
+
total,
|
|
11872
|
+
count: tasks.length,
|
|
11873
|
+
truncated: total > tasks.length,
|
|
11874
|
+
limit: args.limit,
|
|
11875
|
+
offset: args.offset,
|
|
11876
|
+
depth: args.depth,
|
|
11877
|
+
...extras ?? {},
|
|
11878
|
+
tasks: projected
|
|
11879
|
+
};
|
|
11880
|
+
}
|
|
11881
|
+
|
|
11882
|
+
// src/commands/tasks/list.ts
|
|
11850
11883
|
var ListCommand2 = {
|
|
11851
11884
|
command: "list",
|
|
11852
11885
|
aliases: ["ls"],
|
|
@@ -11901,25 +11934,7 @@ var ListCommand2 = {
|
|
|
11901
11934
|
const tasks = listResult.tasks;
|
|
11902
11935
|
const total = listResult.total;
|
|
11903
11936
|
if (args.json) {
|
|
11904
|
-
output.json(
|
|
11905
|
-
tasks: tasks.map((t) => ({
|
|
11906
|
-
id: t.id,
|
|
11907
|
-
title: t.title,
|
|
11908
|
-
status: t.status,
|
|
11909
|
-
priority: t.priority,
|
|
11910
|
-
type: t.type,
|
|
11911
|
-
progress: t.progress,
|
|
11912
|
-
current_status: t.current_status,
|
|
11913
|
-
project_path: t.project_path,
|
|
11914
|
-
context: t.context,
|
|
11915
|
-
createdAt: t.createdAt,
|
|
11916
|
-
updatedAt: t.updatedAt
|
|
11917
|
-
})),
|
|
11918
|
-
total,
|
|
11919
|
-
count: tasks.length,
|
|
11920
|
-
limit: args.limit,
|
|
11921
|
-
offset: args.offset
|
|
11922
|
-
});
|
|
11937
|
+
output.json(buildListTasksJson(tasks, total, args));
|
|
11923
11938
|
} else if (args.quiet) {
|
|
11924
11939
|
tasks.forEach((t) => output.log(t.id.toString()));
|
|
11925
11940
|
} else {
|
|
@@ -12422,9 +12437,9 @@ var OperationsCommand = {
|
|
|
12422
12437
|
const operations = await taskComponent.listOperations(listOptions);
|
|
12423
12438
|
if (a.json) {
|
|
12424
12439
|
output.json({
|
|
12440
|
+
count: operations.length,
|
|
12425
12441
|
task: { id: task.id, title: task.title },
|
|
12426
|
-
operations
|
|
12427
|
-
count: operations.length
|
|
12442
|
+
operations
|
|
12428
12443
|
});
|
|
12429
12444
|
} else {
|
|
12430
12445
|
output.log(chalk22.bold(`
|
|
@@ -12671,25 +12686,7 @@ var SearchCommand = {
|
|
|
12671
12686
|
const tasks = result.tasks;
|
|
12672
12687
|
const total = result.total;
|
|
12673
12688
|
if (args.json) {
|
|
12674
|
-
output.json({
|
|
12675
|
-
keywords: args.keywords,
|
|
12676
|
-
tasks: tasks.map((t) => ({
|
|
12677
|
-
id: t.id,
|
|
12678
|
-
title: t.title,
|
|
12679
|
-
status: t.status,
|
|
12680
|
-
priority: t.priority,
|
|
12681
|
-
type: t.type,
|
|
12682
|
-
progress: t.progress,
|
|
12683
|
-
parent_task_id: t.parent_task_id,
|
|
12684
|
-
project_path: t.project_path,
|
|
12685
|
-
createdAt: t.createdAt,
|
|
12686
|
-
updatedAt: t.updatedAt
|
|
12687
|
-
})),
|
|
12688
|
-
total,
|
|
12689
|
-
count: tasks.length,
|
|
12690
|
-
limit: args.limit,
|
|
12691
|
-
offset: args.offset
|
|
12692
|
-
});
|
|
12689
|
+
output.json(buildListTasksJson(tasks, total, { limit: args.limit, offset: args.offset }, { keywords: args.keywords }));
|
|
12693
12690
|
} else if (args.quiet) {
|
|
12694
12691
|
tasks.forEach((t) => output.log(t.id.toString()));
|
|
12695
12692
|
} else {
|
|
@@ -13015,12 +13012,12 @@ var ListCommand3 = {
|
|
|
13015
13012
|
const filtered = a.source && a.source !== "all" ? skills.filter((s) => s.source === a.source) : skills;
|
|
13016
13013
|
if (a.json) {
|
|
13017
13014
|
output.json({
|
|
13015
|
+
count: filtered.length,
|
|
13018
13016
|
skills: filtered.map((s) => ({
|
|
13019
13017
|
name: s.name,
|
|
13020
13018
|
description: s.description,
|
|
13021
13019
|
source: s.source
|
|
13022
|
-
}))
|
|
13023
|
-
count: filtered.length
|
|
13020
|
+
}))
|
|
13024
13021
|
});
|
|
13025
13022
|
} else if (a.quiet) {
|
|
13026
13023
|
filtered.forEach((s) => output.log(s.name));
|
|
@@ -13179,14 +13176,14 @@ var SearchCommand2 = {
|
|
|
13179
13176
|
}
|
|
13180
13177
|
if (args.json) {
|
|
13181
13178
|
output.json({
|
|
13179
|
+
count: results.length,
|
|
13180
|
+
term: args.term,
|
|
13182
13181
|
results: results.map((s) => ({
|
|
13183
13182
|
name: s.name,
|
|
13184
13183
|
description: s.description,
|
|
13185
13184
|
source: s.source,
|
|
13186
13185
|
matchedIn: s.name.toLowerCase().includes(term) ? "name" : "description"
|
|
13187
|
-
}))
|
|
13188
|
-
count: results.length,
|
|
13189
|
-
term: args.term
|
|
13186
|
+
}))
|
|
13190
13187
|
});
|
|
13191
13188
|
} else if (args.quiet) {
|
|
13192
13189
|
results.forEach((s) => output.log(s.name));
|
|
@@ -13393,6 +13390,7 @@ var ListCommand4 = {
|
|
|
13393
13390
|
}
|
|
13394
13391
|
if (args.json) {
|
|
13395
13392
|
output.json({
|
|
13393
|
+
count: agents.length,
|
|
13396
13394
|
agents: agents.map((a) => ({
|
|
13397
13395
|
name: a.name,
|
|
13398
13396
|
type: a.type,
|
|
@@ -13401,8 +13399,7 @@ var ListCommand4 = {
|
|
|
13401
13399
|
model: a.model,
|
|
13402
13400
|
systemPromptRef: a.systemPromptRef,
|
|
13403
13401
|
hasInlinePrompt: !!a.systemPrompt
|
|
13404
|
-
}))
|
|
13405
|
-
count: agents.length
|
|
13402
|
+
}))
|
|
13406
13403
|
});
|
|
13407
13404
|
} else if (args.quiet) {
|
|
13408
13405
|
agents.forEach((a) => output.log(a.name));
|
|
@@ -15340,13 +15337,13 @@ var ToolsCommand = {
|
|
|
15340
15337
|
}
|
|
15341
15338
|
if (args.json) {
|
|
15342
15339
|
output.json({
|
|
15340
|
+
count: tools.length,
|
|
15343
15341
|
tools: tools.map((t) => ({
|
|
15344
15342
|
name: t.name,
|
|
15345
15343
|
description: t.description,
|
|
15346
15344
|
category: t.metadata?.category,
|
|
15347
15345
|
tags: t.metadata?.tags
|
|
15348
|
-
}))
|
|
15349
|
-
count: tools.length
|
|
15346
|
+
}))
|
|
15350
15347
|
});
|
|
15351
15348
|
} else if (args.quiet) {
|
|
15352
15349
|
tools.forEach((t) => output.log(t.name));
|
|
@@ -15473,12 +15470,12 @@ var ListCommand7 = {
|
|
|
15473
15470
|
const tools = toolComponent.listTools();
|
|
15474
15471
|
if (args.json) {
|
|
15475
15472
|
output.json({
|
|
15473
|
+
count: tools.length,
|
|
15476
15474
|
tools: tools.map((t) => ({
|
|
15477
15475
|
name: t.name,
|
|
15478
15476
|
description: t.description,
|
|
15479
15477
|
category: t.metadata?.category
|
|
15480
|
-
}))
|
|
15481
|
-
count: tools.length
|
|
15478
|
+
}))
|
|
15482
15479
|
});
|
|
15483
15480
|
} else if (args.quiet) {
|
|
15484
15481
|
tools.forEach((t) => output.log(t.name));
|
|
@@ -17009,6 +17006,7 @@ function statusColor(status) {
|
|
|
17009
17006
|
function renderWorkflowList(workflows, options) {
|
|
17010
17007
|
if (options?.json) {
|
|
17011
17008
|
return JSON.stringify({
|
|
17009
|
+
total: workflows.length,
|
|
17012
17010
|
workflows: workflows.map((w) => ({
|
|
17013
17011
|
id: w.id,
|
|
17014
17012
|
name: w.name,
|
|
@@ -17017,8 +17015,7 @@ function renderWorkflowList(workflows, options) {
|
|
|
17017
17015
|
tags: w.tags,
|
|
17018
17016
|
createdAt: w.createdAt.toISOString(),
|
|
17019
17017
|
updatedAt: w.updatedAt.toISOString()
|
|
17020
|
-
}))
|
|
17021
|
-
total: workflows.length
|
|
17018
|
+
}))
|
|
17022
17019
|
}, null, 2);
|
|
17023
17020
|
}
|
|
17024
17021
|
if (workflows.length === 0) {
|
|
@@ -17096,6 +17093,7 @@ function renderWorkflowDetail(workflow, options) {
|
|
|
17096
17093
|
function renderRunsList(runs, options) {
|
|
17097
17094
|
if (options?.json) {
|
|
17098
17095
|
return JSON.stringify({
|
|
17096
|
+
total: runs.length,
|
|
17099
17097
|
runs: runs.map((r) => ({
|
|
17100
17098
|
id: r.id,
|
|
17101
17099
|
workflowId: r.workflowId,
|
|
@@ -17104,8 +17102,7 @@ function renderRunsList(runs, options) {
|
|
|
17104
17102
|
completedAt: r.completedAt?.toISOString(),
|
|
17105
17103
|
durationMs: r.durationMs,
|
|
17106
17104
|
error: r.error
|
|
17107
|
-
}))
|
|
17108
|
-
total: runs.length
|
|
17105
|
+
}))
|
|
17109
17106
|
}, null, 2);
|
|
17110
17107
|
}
|
|
17111
17108
|
if (runs.length === 0) {
|
|
@@ -17248,6 +17245,19 @@ function renderNodesList(nodes) {
|
|
|
17248
17245
|
// src/commands/workflow/commands/list.ts
|
|
17249
17246
|
import chalk62 from "chalk";
|
|
17250
17247
|
import { createWorkflowListTool } from "@ai-setting/roy-agent-core/env/workflow/tools";
|
|
17248
|
+
function buildListWorkflowsJson(workflows, total, args, availableTags) {
|
|
17249
|
+
const output = {
|
|
17250
|
+
total,
|
|
17251
|
+
count: workflows.length,
|
|
17252
|
+
truncated: total > workflows.length,
|
|
17253
|
+
limit: args.limit,
|
|
17254
|
+
offset: args.offset,
|
|
17255
|
+
page: args.page,
|
|
17256
|
+
...availableTags.length > 0 ? { available_tags: availableTags } : {},
|
|
17257
|
+
workflows
|
|
17258
|
+
};
|
|
17259
|
+
return output;
|
|
17260
|
+
}
|
|
17251
17261
|
var WorkflowListCommand = {
|
|
17252
17262
|
command: "list",
|
|
17253
17263
|
describe: "列出所有已注册的 Workflow",
|
|
@@ -17352,22 +17362,19 @@ var WorkflowListCommand = {
|
|
|
17352
17362
|
const availableTags = data.available_tags || [];
|
|
17353
17363
|
const total = typeof data.total === "number" ? data.total : workflows.length;
|
|
17354
17364
|
if (args.json) {
|
|
17355
|
-
|
|
17356
|
-
|
|
17357
|
-
|
|
17358
|
-
|
|
17359
|
-
|
|
17360
|
-
|
|
17361
|
-
|
|
17362
|
-
|
|
17363
|
-
|
|
17364
|
-
available_tags: availableTags,
|
|
17365
|
-
total,
|
|
17366
|
-
count: workflows.length,
|
|
17365
|
+
const projected = workflows.map((w) => ({
|
|
17366
|
+
name: w.name,
|
|
17367
|
+
version: w.version,
|
|
17368
|
+
description: w.description,
|
|
17369
|
+
tags: w.tags,
|
|
17370
|
+
createdAt: w.created_at,
|
|
17371
|
+
updatedAt: w.created_at
|
|
17372
|
+
}));
|
|
17373
|
+
output.json(buildListWorkflowsJson(projected, total, {
|
|
17367
17374
|
limit: pageSize,
|
|
17368
17375
|
offset: finalOffset,
|
|
17369
17376
|
page: page > 1 ? page : Math.floor(finalOffset / pageSize) + 1
|
|
17370
|
-
});
|
|
17377
|
+
}, availableTags));
|
|
17371
17378
|
} else {
|
|
17372
17379
|
const renderWorkflows = workflows.map((w) => ({
|
|
17373
17380
|
id: w.name,
|
|
@@ -19595,6 +19602,9 @@ var _runWorkflowSearchImpl = async function(opts) {
|
|
|
19595
19602
|
const availableTags = result.available_tags ?? [];
|
|
19596
19603
|
if (asJson) {
|
|
19597
19604
|
output.json({
|
|
19605
|
+
total: workflows.length,
|
|
19606
|
+
available_tags: availableTags,
|
|
19607
|
+
keyword,
|
|
19598
19608
|
workflows: workflows.map((w) => ({
|
|
19599
19609
|
name: w.name,
|
|
19600
19610
|
version: w.version,
|
|
@@ -19603,9 +19613,6 @@ var _runWorkflowSearchImpl = async function(opts) {
|
|
|
19603
19613
|
createdAt: w.createdAt,
|
|
19604
19614
|
updatedAt: w.updatedAt
|
|
19605
19615
|
})),
|
|
19606
|
-
available_tags: availableTags,
|
|
19607
|
-
total: workflows.length,
|
|
19608
|
-
keyword,
|
|
19609
19616
|
tags
|
|
19610
19617
|
});
|
|
19611
19618
|
return;
|
|
@@ -19780,8 +19787,8 @@ var _runWorkflowTagListImpl = async function(opts) {
|
|
|
19780
19787
|
});
|
|
19781
19788
|
if (opts.asJson) {
|
|
19782
19789
|
output.json({
|
|
19783
|
-
|
|
19784
|
-
|
|
19790
|
+
total: result.total,
|
|
19791
|
+
tags: result.tags
|
|
19785
19792
|
});
|
|
19786
19793
|
return;
|
|
19787
19794
|
}
|
package/dist/index.js
CHANGED
|
@@ -7319,7 +7319,7 @@ var require_dist = __commonJS((exports) => {
|
|
|
7319
7319
|
var require_package = __commonJS((exports, module) => {
|
|
7320
7320
|
module.exports = {
|
|
7321
7321
|
name: "@ai-setting/roy-agent-cli",
|
|
7322
|
-
version: "1.5.
|
|
7322
|
+
version: "1.5.88",
|
|
7323
7323
|
type: "module",
|
|
7324
7324
|
description: "CLI for roy-agent - Non-interactive command execution",
|
|
7325
7325
|
main: "./dist/index.js",
|
|
@@ -7342,6 +7342,8 @@ var require_package = __commonJS((exports, module) => {
|
|
|
7342
7342
|
scripts: {
|
|
7343
7343
|
build: "bunup",
|
|
7344
7344
|
clean: "rm -rf dist",
|
|
7345
|
+
lint: "eslint --max-warnings 0 src/",
|
|
7346
|
+
"lint:fix": "eslint --fix src/",
|
|
7345
7347
|
typecheck: "npx tsc --noEmit --skipLibCheck"
|
|
7346
7348
|
},
|
|
7347
7349
|
dependencies: {
|
|
@@ -7362,7 +7364,9 @@ var require_package = __commonJS((exports, module) => {
|
|
|
7362
7364
|
devDependencies: {
|
|
7363
7365
|
"@types/node": "^20.10.0",
|
|
7364
7366
|
"@types/yargs": "^17.0.32",
|
|
7367
|
+
"@typescript-eslint/parser": "^8.62.1",
|
|
7365
7368
|
bunup: "^0.16.0",
|
|
7369
|
+
eslint: "^10.6.0",
|
|
7366
7370
|
typescript: "^5.3.0"
|
|
7367
7371
|
},
|
|
7368
7372
|
engines: {
|
|
@@ -10315,6 +10319,8 @@ var ListCommand = {
|
|
|
10315
10319
|
const activeSessionId = sessionComponent.getActiveSessionId();
|
|
10316
10320
|
if (args.json) {
|
|
10317
10321
|
output.json({
|
|
10322
|
+
total: sessions.length,
|
|
10323
|
+
totalCount,
|
|
10318
10324
|
sessions: sessions.map((s) => {
|
|
10319
10325
|
const workflowMeta = s.metadata?.type === "workflow" ? s.metadata : null;
|
|
10320
10326
|
return {
|
|
@@ -10331,9 +10337,7 @@ var ListCommand = {
|
|
|
10331
10337
|
updatedAt: new Date(s.updatedAt).toISOString(),
|
|
10332
10338
|
isActive: s.id === activeSessionId
|
|
10333
10339
|
};
|
|
10334
|
-
})
|
|
10335
|
-
total: sessions.length,
|
|
10336
|
-
totalCount
|
|
10340
|
+
})
|
|
10337
10341
|
});
|
|
10338
10342
|
} else if (args.quiet || args.id) {
|
|
10339
10343
|
sessions.forEach((s) => output.log(s.id));
|
|
@@ -10844,7 +10848,13 @@ var MessagesCommand = {
|
|
|
10844
10848
|
}
|
|
10845
10849
|
if (a.json) {
|
|
10846
10850
|
output.json({
|
|
10851
|
+
total: totalMessages,
|
|
10847
10852
|
sessionId: a.sessionId,
|
|
10853
|
+
pagination: {
|
|
10854
|
+
offset: a.offset,
|
|
10855
|
+
limit: a.limit,
|
|
10856
|
+
hasMore: a.offset + a.limit < totalMessages
|
|
10857
|
+
},
|
|
10848
10858
|
messages: messages.map((m) => ({
|
|
10849
10859
|
id: m.id,
|
|
10850
10860
|
role: m.role,
|
|
@@ -10852,13 +10862,7 @@ var MessagesCommand = {
|
|
|
10852
10862
|
parts: m.parts,
|
|
10853
10863
|
timestamp: new Date(m.timestamp).toISOString(),
|
|
10854
10864
|
isCheckpoint: m.metadata?.isCheckpoint
|
|
10855
|
-
}))
|
|
10856
|
-
total: totalMessages,
|
|
10857
|
-
pagination: {
|
|
10858
|
-
offset: a.offset,
|
|
10859
|
-
limit: a.limit,
|
|
10860
|
-
hasMore: a.offset + a.limit < totalMessages
|
|
10861
|
-
}
|
|
10865
|
+
}))
|
|
10862
10866
|
});
|
|
10863
10867
|
} else {
|
|
10864
10868
|
const checkpointStyle = (content) => {
|
|
@@ -11846,6 +11850,35 @@ var SessionsCommand = {
|
|
|
11846
11850
|
|
|
11847
11851
|
// src/commands/tasks/list.ts
|
|
11848
11852
|
import chalk16 from "chalk";
|
|
11853
|
+
|
|
11854
|
+
// src/commands/tasks/_build-list-json.ts
|
|
11855
|
+
function buildListTasksJson(tasks, total, args, extras) {
|
|
11856
|
+
const projected = tasks.map((t) => ({
|
|
11857
|
+
id: t.id,
|
|
11858
|
+
title: t.title,
|
|
11859
|
+
status: t.status,
|
|
11860
|
+
priority: t.priority,
|
|
11861
|
+
type: t.type,
|
|
11862
|
+
progress: t.progress,
|
|
11863
|
+
current_status: t.current_status,
|
|
11864
|
+
project_path: t.project_path,
|
|
11865
|
+
context: t.context,
|
|
11866
|
+
createdAt: t.createdAt,
|
|
11867
|
+
updatedAt: t.updatedAt
|
|
11868
|
+
}));
|
|
11869
|
+
return {
|
|
11870
|
+
total,
|
|
11871
|
+
count: tasks.length,
|
|
11872
|
+
truncated: total > tasks.length,
|
|
11873
|
+
limit: args.limit,
|
|
11874
|
+
offset: args.offset,
|
|
11875
|
+
depth: args.depth,
|
|
11876
|
+
...extras ?? {},
|
|
11877
|
+
tasks: projected
|
|
11878
|
+
};
|
|
11879
|
+
}
|
|
11880
|
+
|
|
11881
|
+
// src/commands/tasks/list.ts
|
|
11849
11882
|
var ListCommand2 = {
|
|
11850
11883
|
command: "list",
|
|
11851
11884
|
aliases: ["ls"],
|
|
@@ -11900,25 +11933,7 @@ var ListCommand2 = {
|
|
|
11900
11933
|
const tasks = listResult.tasks;
|
|
11901
11934
|
const total = listResult.total;
|
|
11902
11935
|
if (args.json) {
|
|
11903
|
-
output.json(
|
|
11904
|
-
tasks: tasks.map((t) => ({
|
|
11905
|
-
id: t.id,
|
|
11906
|
-
title: t.title,
|
|
11907
|
-
status: t.status,
|
|
11908
|
-
priority: t.priority,
|
|
11909
|
-
type: t.type,
|
|
11910
|
-
progress: t.progress,
|
|
11911
|
-
current_status: t.current_status,
|
|
11912
|
-
project_path: t.project_path,
|
|
11913
|
-
context: t.context,
|
|
11914
|
-
createdAt: t.createdAt,
|
|
11915
|
-
updatedAt: t.updatedAt
|
|
11916
|
-
})),
|
|
11917
|
-
total,
|
|
11918
|
-
count: tasks.length,
|
|
11919
|
-
limit: args.limit,
|
|
11920
|
-
offset: args.offset
|
|
11921
|
-
});
|
|
11936
|
+
output.json(buildListTasksJson(tasks, total, args));
|
|
11922
11937
|
} else if (args.quiet) {
|
|
11923
11938
|
tasks.forEach((t) => output.log(t.id.toString()));
|
|
11924
11939
|
} else {
|
|
@@ -12421,9 +12436,9 @@ var OperationsCommand = {
|
|
|
12421
12436
|
const operations = await taskComponent.listOperations(listOptions);
|
|
12422
12437
|
if (a.json) {
|
|
12423
12438
|
output.json({
|
|
12439
|
+
count: operations.length,
|
|
12424
12440
|
task: { id: task.id, title: task.title },
|
|
12425
|
-
operations
|
|
12426
|
-
count: operations.length
|
|
12441
|
+
operations
|
|
12427
12442
|
});
|
|
12428
12443
|
} else {
|
|
12429
12444
|
output.log(chalk22.bold(`
|
|
@@ -12670,25 +12685,7 @@ var SearchCommand = {
|
|
|
12670
12685
|
const tasks = result.tasks;
|
|
12671
12686
|
const total = result.total;
|
|
12672
12687
|
if (args.json) {
|
|
12673
|
-
output.json({
|
|
12674
|
-
keywords: args.keywords,
|
|
12675
|
-
tasks: tasks.map((t) => ({
|
|
12676
|
-
id: t.id,
|
|
12677
|
-
title: t.title,
|
|
12678
|
-
status: t.status,
|
|
12679
|
-
priority: t.priority,
|
|
12680
|
-
type: t.type,
|
|
12681
|
-
progress: t.progress,
|
|
12682
|
-
parent_task_id: t.parent_task_id,
|
|
12683
|
-
project_path: t.project_path,
|
|
12684
|
-
createdAt: t.createdAt,
|
|
12685
|
-
updatedAt: t.updatedAt
|
|
12686
|
-
})),
|
|
12687
|
-
total,
|
|
12688
|
-
count: tasks.length,
|
|
12689
|
-
limit: args.limit,
|
|
12690
|
-
offset: args.offset
|
|
12691
|
-
});
|
|
12688
|
+
output.json(buildListTasksJson(tasks, total, { limit: args.limit, offset: args.offset }, { keywords: args.keywords }));
|
|
12692
12689
|
} else if (args.quiet) {
|
|
12693
12690
|
tasks.forEach((t) => output.log(t.id.toString()));
|
|
12694
12691
|
} else {
|
|
@@ -13014,12 +13011,12 @@ var ListCommand3 = {
|
|
|
13014
13011
|
const filtered = a.source && a.source !== "all" ? skills.filter((s) => s.source === a.source) : skills;
|
|
13015
13012
|
if (a.json) {
|
|
13016
13013
|
output.json({
|
|
13014
|
+
count: filtered.length,
|
|
13017
13015
|
skills: filtered.map((s) => ({
|
|
13018
13016
|
name: s.name,
|
|
13019
13017
|
description: s.description,
|
|
13020
13018
|
source: s.source
|
|
13021
|
-
}))
|
|
13022
|
-
count: filtered.length
|
|
13019
|
+
}))
|
|
13023
13020
|
});
|
|
13024
13021
|
} else if (a.quiet) {
|
|
13025
13022
|
filtered.forEach((s) => output.log(s.name));
|
|
@@ -13178,14 +13175,14 @@ var SearchCommand2 = {
|
|
|
13178
13175
|
}
|
|
13179
13176
|
if (args.json) {
|
|
13180
13177
|
output.json({
|
|
13178
|
+
count: results.length,
|
|
13179
|
+
term: args.term,
|
|
13181
13180
|
results: results.map((s) => ({
|
|
13182
13181
|
name: s.name,
|
|
13183
13182
|
description: s.description,
|
|
13184
13183
|
source: s.source,
|
|
13185
13184
|
matchedIn: s.name.toLowerCase().includes(term) ? "name" : "description"
|
|
13186
|
-
}))
|
|
13187
|
-
count: results.length,
|
|
13188
|
-
term: args.term
|
|
13185
|
+
}))
|
|
13189
13186
|
});
|
|
13190
13187
|
} else if (args.quiet) {
|
|
13191
13188
|
results.forEach((s) => output.log(s.name));
|
|
@@ -13392,6 +13389,7 @@ var ListCommand4 = {
|
|
|
13392
13389
|
}
|
|
13393
13390
|
if (args.json) {
|
|
13394
13391
|
output.json({
|
|
13392
|
+
count: agents.length,
|
|
13395
13393
|
agents: agents.map((a) => ({
|
|
13396
13394
|
name: a.name,
|
|
13397
13395
|
type: a.type,
|
|
@@ -13400,8 +13398,7 @@ var ListCommand4 = {
|
|
|
13400
13398
|
model: a.model,
|
|
13401
13399
|
systemPromptRef: a.systemPromptRef,
|
|
13402
13400
|
hasInlinePrompt: !!a.systemPrompt
|
|
13403
|
-
}))
|
|
13404
|
-
count: agents.length
|
|
13401
|
+
}))
|
|
13405
13402
|
});
|
|
13406
13403
|
} else if (args.quiet) {
|
|
13407
13404
|
agents.forEach((a) => output.log(a.name));
|
|
@@ -15339,13 +15336,13 @@ var ToolsCommand = {
|
|
|
15339
15336
|
}
|
|
15340
15337
|
if (args.json) {
|
|
15341
15338
|
output.json({
|
|
15339
|
+
count: tools.length,
|
|
15342
15340
|
tools: tools.map((t) => ({
|
|
15343
15341
|
name: t.name,
|
|
15344
15342
|
description: t.description,
|
|
15345
15343
|
category: t.metadata?.category,
|
|
15346
15344
|
tags: t.metadata?.tags
|
|
15347
|
-
}))
|
|
15348
|
-
count: tools.length
|
|
15345
|
+
}))
|
|
15349
15346
|
});
|
|
15350
15347
|
} else if (args.quiet) {
|
|
15351
15348
|
tools.forEach((t) => output.log(t.name));
|
|
@@ -15472,12 +15469,12 @@ var ListCommand7 = {
|
|
|
15472
15469
|
const tools = toolComponent.listTools();
|
|
15473
15470
|
if (args.json) {
|
|
15474
15471
|
output.json({
|
|
15472
|
+
count: tools.length,
|
|
15475
15473
|
tools: tools.map((t) => ({
|
|
15476
15474
|
name: t.name,
|
|
15477
15475
|
description: t.description,
|
|
15478
15476
|
category: t.metadata?.category
|
|
15479
|
-
}))
|
|
15480
|
-
count: tools.length
|
|
15477
|
+
}))
|
|
15481
15478
|
});
|
|
15482
15479
|
} else if (args.quiet) {
|
|
15483
15480
|
tools.forEach((t) => output.log(t.name));
|
|
@@ -17008,6 +17005,7 @@ function statusColor(status) {
|
|
|
17008
17005
|
function renderWorkflowList(workflows, options) {
|
|
17009
17006
|
if (options?.json) {
|
|
17010
17007
|
return JSON.stringify({
|
|
17008
|
+
total: workflows.length,
|
|
17011
17009
|
workflows: workflows.map((w) => ({
|
|
17012
17010
|
id: w.id,
|
|
17013
17011
|
name: w.name,
|
|
@@ -17016,8 +17014,7 @@ function renderWorkflowList(workflows, options) {
|
|
|
17016
17014
|
tags: w.tags,
|
|
17017
17015
|
createdAt: w.createdAt.toISOString(),
|
|
17018
17016
|
updatedAt: w.updatedAt.toISOString()
|
|
17019
|
-
}))
|
|
17020
|
-
total: workflows.length
|
|
17017
|
+
}))
|
|
17021
17018
|
}, null, 2);
|
|
17022
17019
|
}
|
|
17023
17020
|
if (workflows.length === 0) {
|
|
@@ -17095,6 +17092,7 @@ function renderWorkflowDetail(workflow, options) {
|
|
|
17095
17092
|
function renderRunsList(runs, options) {
|
|
17096
17093
|
if (options?.json) {
|
|
17097
17094
|
return JSON.stringify({
|
|
17095
|
+
total: runs.length,
|
|
17098
17096
|
runs: runs.map((r) => ({
|
|
17099
17097
|
id: r.id,
|
|
17100
17098
|
workflowId: r.workflowId,
|
|
@@ -17103,8 +17101,7 @@ function renderRunsList(runs, options) {
|
|
|
17103
17101
|
completedAt: r.completedAt?.toISOString(),
|
|
17104
17102
|
durationMs: r.durationMs,
|
|
17105
17103
|
error: r.error
|
|
17106
|
-
}))
|
|
17107
|
-
total: runs.length
|
|
17104
|
+
}))
|
|
17108
17105
|
}, null, 2);
|
|
17109
17106
|
}
|
|
17110
17107
|
if (runs.length === 0) {
|
|
@@ -17247,6 +17244,19 @@ function renderNodesList(nodes) {
|
|
|
17247
17244
|
// src/commands/workflow/commands/list.ts
|
|
17248
17245
|
import chalk62 from "chalk";
|
|
17249
17246
|
import { createWorkflowListTool } from "@ai-setting/roy-agent-core/env/workflow/tools";
|
|
17247
|
+
function buildListWorkflowsJson(workflows, total, args, availableTags) {
|
|
17248
|
+
const output = {
|
|
17249
|
+
total,
|
|
17250
|
+
count: workflows.length,
|
|
17251
|
+
truncated: total > workflows.length,
|
|
17252
|
+
limit: args.limit,
|
|
17253
|
+
offset: args.offset,
|
|
17254
|
+
page: args.page,
|
|
17255
|
+
...availableTags.length > 0 ? { available_tags: availableTags } : {},
|
|
17256
|
+
workflows
|
|
17257
|
+
};
|
|
17258
|
+
return output;
|
|
17259
|
+
}
|
|
17250
17260
|
var WorkflowListCommand = {
|
|
17251
17261
|
command: "list",
|
|
17252
17262
|
describe: "列出所有已注册的 Workflow",
|
|
@@ -17351,22 +17361,19 @@ var WorkflowListCommand = {
|
|
|
17351
17361
|
const availableTags = data.available_tags || [];
|
|
17352
17362
|
const total = typeof data.total === "number" ? data.total : workflows.length;
|
|
17353
17363
|
if (args.json) {
|
|
17354
|
-
|
|
17355
|
-
|
|
17356
|
-
|
|
17357
|
-
|
|
17358
|
-
|
|
17359
|
-
|
|
17360
|
-
|
|
17361
|
-
|
|
17362
|
-
|
|
17363
|
-
available_tags: availableTags,
|
|
17364
|
-
total,
|
|
17365
|
-
count: workflows.length,
|
|
17364
|
+
const projected = workflows.map((w) => ({
|
|
17365
|
+
name: w.name,
|
|
17366
|
+
version: w.version,
|
|
17367
|
+
description: w.description,
|
|
17368
|
+
tags: w.tags,
|
|
17369
|
+
createdAt: w.created_at,
|
|
17370
|
+
updatedAt: w.created_at
|
|
17371
|
+
}));
|
|
17372
|
+
output.json(buildListWorkflowsJson(projected, total, {
|
|
17366
17373
|
limit: pageSize,
|
|
17367
17374
|
offset: finalOffset,
|
|
17368
17375
|
page: page > 1 ? page : Math.floor(finalOffset / pageSize) + 1
|
|
17369
|
-
});
|
|
17376
|
+
}, availableTags));
|
|
17370
17377
|
} else {
|
|
17371
17378
|
const renderWorkflows = workflows.map((w) => ({
|
|
17372
17379
|
id: w.name,
|
|
@@ -19594,6 +19601,9 @@ var _runWorkflowSearchImpl = async function(opts) {
|
|
|
19594
19601
|
const availableTags = result.available_tags ?? [];
|
|
19595
19602
|
if (asJson) {
|
|
19596
19603
|
output.json({
|
|
19604
|
+
total: workflows.length,
|
|
19605
|
+
available_tags: availableTags,
|
|
19606
|
+
keyword,
|
|
19597
19607
|
workflows: workflows.map((w) => ({
|
|
19598
19608
|
name: w.name,
|
|
19599
19609
|
version: w.version,
|
|
@@ -19602,9 +19612,6 @@ var _runWorkflowSearchImpl = async function(opts) {
|
|
|
19602
19612
|
createdAt: w.createdAt,
|
|
19603
19613
|
updatedAt: w.updatedAt
|
|
19604
19614
|
})),
|
|
19605
|
-
available_tags: availableTags,
|
|
19606
|
-
total: workflows.length,
|
|
19607
|
-
keyword,
|
|
19608
19615
|
tags
|
|
19609
19616
|
});
|
|
19610
19617
|
return;
|
|
@@ -19779,8 +19786,8 @@ var _runWorkflowTagListImpl = async function(opts) {
|
|
|
19779
19786
|
});
|
|
19780
19787
|
if (opts.asJson) {
|
|
19781
19788
|
output.json({
|
|
19782
|
-
|
|
19783
|
-
|
|
19789
|
+
total: result.total,
|
|
19790
|
+
tags: result.tags
|
|
19784
19791
|
});
|
|
19785
19792
|
return;
|
|
19786
19793
|
}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-setting/roy-agent-cli",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.88",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "CLI for roy-agent - Non-interactive command execution",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
"scripts": {
|
|
24
24
|
"build": "bunup",
|
|
25
25
|
"clean": "rm -rf dist",
|
|
26
|
+
"lint": "eslint --max-warnings 0 src/",
|
|
27
|
+
"lint:fix": "eslint --fix src/",
|
|
26
28
|
"typecheck": "npx tsc --noEmit --skipLibCheck"
|
|
27
29
|
},
|
|
28
30
|
"dependencies": {
|
|
@@ -43,7 +45,9 @@
|
|
|
43
45
|
"devDependencies": {
|
|
44
46
|
"@types/node": "^20.10.0",
|
|
45
47
|
"@types/yargs": "^17.0.32",
|
|
48
|
+
"@typescript-eslint/parser": "^8.62.1",
|
|
46
49
|
"bunup": "^0.16.0",
|
|
50
|
+
"eslint": "^10.6.0",
|
|
47
51
|
"typescript": "^5.3.0"
|
|
48
52
|
},
|
|
49
53
|
"engines": {
|