@ai-setting/roy-agent-cli 1.5.86 → 1.5.87

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/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.86",
7322
+ version: "1.5.87",
7323
7323
  type: "module",
7324
7324
  description: "CLI for roy-agent - Non-interactive command execution",
7325
7325
  main: "./dist/index.js",
@@ -7455,7 +7455,7 @@ import { globalHookManager } from "@ai-setting/roy-agent-core";
7455
7455
  // src/services/output.service.ts
7456
7456
  import chalk from "chalk";
7457
7457
 
7458
- class OutputService {
7458
+ class OutputService2 {
7459
7459
  quiet = false;
7460
7460
  jsonOutput = false;
7461
7461
  noColor = false;
@@ -7545,7 +7545,7 @@ class EnvironmentService {
7545
7545
  workflowComponent;
7546
7546
  pluginComponent;
7547
7547
  constructor(output) {
7548
- this.output = output ?? new OutputService;
7548
+ this.output = output ?? new OutputService2;
7549
7549
  }
7550
7550
  getEnvironment() {
7551
7551
  return this.environment;
@@ -8419,7 +8419,7 @@ function createActCommand(externalEnvService) {
8419
8419
  async handler(args) {
8420
8420
  const quiet = args.quiet ?? true;
8421
8421
  CliQuietModeService.getInstance().setQuiet(quiet);
8422
- const output = new OutputService;
8422
+ const output = new OutputService2;
8423
8423
  output.configure({ quiet });
8424
8424
  if (!args.message) {
8425
8425
  output.error("请提供要执行的消息,使用方式:roy-agent act <消息>");
@@ -9274,6 +9274,130 @@ class InputHandler {
9274
9274
  }
9275
9275
  }
9276
9276
 
9277
+ // src/commands/interactive-event-sources.ts
9278
+ import { TracedAs as TracedAs4 } from "@ai-setting/roy-agent-core";
9279
+ async function startSingleEventSource(eventSourceComponent, output, eventSourceId) {
9280
+ return EventSourceStarter.instance.runSingle(eventSourceComponent, output, eventSourceId);
9281
+ }
9282
+ async function startEventSources(eventSourceIds, eventSourceComponent, output) {
9283
+ return EventSourceStarter.instance.run(eventSourceIds, eventSourceComponent, output);
9284
+ }
9285
+
9286
+ class EventSourceStarter {
9287
+ static instance = new EventSourceStarter;
9288
+ async run(eventSourceIds, eventSourceComponent, output) {
9289
+ return startEventSourcesImpl(eventSourceIds, eventSourceComponent, output);
9290
+ }
9291
+ async runSingle(eventSourceComponent, output, eventSourceId) {
9292
+ return startSingleEventSourceImpl(eventSourceComponent, output, eventSourceId);
9293
+ }
9294
+ }
9295
+ __legacyDecorateClassTS([
9296
+ TracedAs4("interactive.startEventSources", { recordParams: false, log: false }),
9297
+ __legacyMetadataTS("design:type", Function),
9298
+ __legacyMetadataTS("design:paramtypes", [
9299
+ Array,
9300
+ typeof EventSourceComponentInterface === "undefined" ? Object : EventSourceComponentInterface,
9301
+ typeof OutputService === "undefined" ? Object : OutputService
9302
+ ]),
9303
+ __legacyMetadataTS("design:returntype", typeof Promise === "undefined" ? Object : Promise)
9304
+ ], EventSourceStarter.prototype, "run", null);
9305
+ __legacyDecorateClassTS([
9306
+ TracedAs4("interactive.startSingleEventSource", { recordParams: false, log: false }),
9307
+ __legacyMetadataTS("design:type", Function),
9308
+ __legacyMetadataTS("design:paramtypes", [
9309
+ typeof EventSourceComponentInterface === "undefined" ? Object : EventSourceComponentInterface,
9310
+ typeof OutputService === "undefined" ? Object : OutputService,
9311
+ String
9312
+ ]),
9313
+ __legacyMetadataTS("design:returntype", typeof Promise === "undefined" ? Object : Promise)
9314
+ ], EventSourceStarter.prototype, "runSingle", null);
9315
+ async function startEventSourcesImpl(eventSourceIds, eventSourceComponent, output) {
9316
+ const results = [];
9317
+ if (!eventSourceIds || eventSourceIds.length === 0) {
9318
+ return { results, total: 0, successCount: 0, failedCount: 0 };
9319
+ }
9320
+ for (const id of eventSourceIds) {
9321
+ if (!id)
9322
+ continue;
9323
+ const result = await startSingleEventSource(eventSourceComponent, output, id);
9324
+ results.push(result);
9325
+ }
9326
+ const successCount = results.filter((r) => r.success).length;
9327
+ const failedCount = results.length - successCount;
9328
+ if (results.length > 1) {
9329
+ if (failedCount > 0) {
9330
+ output.info(`
9331
+ ✅ 成功启动 ${successCount}/${results.length} 个事件源`);
9332
+ } else {
9333
+ output.success(`
9334
+ ✅ 成功启动 ${successCount}/${results.length} 个事件源`);
9335
+ }
9336
+ }
9337
+ return { results, total: results.length, successCount, failedCount };
9338
+ }
9339
+ async function startSingleEventSourceImpl(eventSourceComponent, output, eventSourceId) {
9340
+ const sources = eventSourceComponent.list();
9341
+ const matchedSource = sources.find((s) => s.id === eventSourceId || s.id.startsWith(eventSourceId));
9342
+ if (!matchedSource) {
9343
+ output.error(`❌ 事件源不存在: ${eventSourceId}`);
9344
+ output.info(`可用的事件源:`);
9345
+ for (const s of sources) {
9346
+ output.info(` - ${s.id.substring(0, 8)}: ${s.name} (${s.type})`);
9347
+ }
9348
+ return {
9349
+ id: eventSourceId,
9350
+ name: eventSourceId,
9351
+ success: false,
9352
+ status: "not_found",
9353
+ error: `EventSource not found: ${eventSourceId}`
9354
+ };
9355
+ }
9356
+ const actualId = matchedSource.id;
9357
+ const status = eventSourceComponent.getStatus(actualId);
9358
+ if (status === "running") {
9359
+ output.info(`\uD83D\uDCE1 事件源 ${matchedSource.name} 已在运行中`);
9360
+ return {
9361
+ id: actualId,
9362
+ name: matchedSource.name,
9363
+ success: true,
9364
+ status: "skipped"
9365
+ };
9366
+ }
9367
+ try {
9368
+ await eventSourceComponent.startSource(actualId);
9369
+ const verifyStatus = eventSourceComponent.getStatus(actualId);
9370
+ if (verifyStatus !== "running") {
9371
+ const errMsg = `启动后状态异常: ${verifyStatus}`;
9372
+ output.error(`❌ ${errMsg}`);
9373
+ return {
9374
+ id: actualId,
9375
+ name: matchedSource.name,
9376
+ success: false,
9377
+ status: "failed",
9378
+ error: errMsg
9379
+ };
9380
+ }
9381
+ output.success(`\uD83D\uDCE1 已启动事件源: ${matchedSource.name} (${verifyStatus})`);
9382
+ return {
9383
+ id: actualId,
9384
+ name: matchedSource.name,
9385
+ success: true,
9386
+ status: "started"
9387
+ };
9388
+ } catch (error) {
9389
+ const errMsg = error instanceof Error ? error.message : String(error);
9390
+ output.error(`❌ 启动事件源失败: ${matchedSource.name} - ${errMsg}`);
9391
+ return {
9392
+ id: actualId,
9393
+ name: matchedSource.name,
9394
+ success: false,
9395
+ status: "failed",
9396
+ error: errMsg
9397
+ };
9398
+ }
9399
+ }
9400
+
9277
9401
  // src/commands/shared/ask-user-handler.ts
9278
9402
  import * as readline from "readline";
9279
9403
  import chalk3 from "chalk";
@@ -9814,8 +9938,9 @@ function createInteractiveCommand(externalEnvService) {
9814
9938
  default: false
9815
9939
  }).option("event-source", {
9816
9940
  alias: "es",
9817
- describe: "启动时一并启动的事件源 ID",
9818
- type: "string"
9941
+ describe: "启动时一并启动的事件源 ID(可多次指定,支持 --es a --es b)",
9942
+ type: "array",
9943
+ string: true
9819
9944
  }).option("plugin", {
9820
9945
  alias: "p",
9821
9946
  describe: "启用 plugin (tslsp, pylsp, mdlsp, lsp, code-check, reminder, memory, task-tag)",
@@ -9831,7 +9956,7 @@ function createInteractiveCommand(externalEnvService) {
9831
9956
  }),
9832
9957
  async handler(args) {
9833
9958
  CliQuietModeService.getInstance().setQuiet(true);
9834
- const output = new OutputService;
9959
+ const output = new OutputService2;
9835
9960
  const shouldDisposeEnvService = !externalEnvService;
9836
9961
  const envService = externalEnvService ?? new EnvironmentService(output);
9837
9962
  const CODER_HARNESS_PLUGINS = new Set([
@@ -10078,47 +10203,19 @@ function createInteractiveCommand(externalEnvService) {
10078
10203
  }
10079
10204
  });
10080
10205
  const stopEventHandler = eventHandler.start();
10081
- const eventSourceId = args.eventSource;
10082
- if (eventSourceId) {
10206
+ const rawEventSourceIds = args.eventSource;
10207
+ const eventSourceIds = Array.isArray(rawEventSourceIds) ? rawEventSourceIds.filter((s) => !!s) : rawEventSourceIds ? [rawEventSourceIds] : [];
10208
+ if (eventSourceIds.length > 0) {
10083
10209
  const eventSourceComponent = env.getComponent("event-source");
10084
10210
  if (!eventSourceComponent || typeof eventSourceComponent.startSource !== "function") {
10085
10211
  output.error(`❌ 未找到事件源组件或 startSource 方法`);
10086
10212
  output.info(`请确保 EventSourceComponent 已正确注册`);
10087
10213
  process.exit(1);
10088
10214
  }
10089
- const sources = eventSourceComponent.list();
10090
- const matchedSource = sources.find((s) => s.id === eventSourceId || s.id.startsWith(eventSourceId));
10091
- if (!matchedSource) {
10092
- output.error(`❌ 事件源不存在: ${eventSourceId}`);
10093
- output.info(`可用的事件源:`);
10094
- for (const s of sources) {
10095
- output.info(` - ${s.id}: ${s.name} (${s.type})`);
10096
- }
10215
+ const summary = await startEventSources(eventSourceIds, eventSourceComponent, output);
10216
+ if (eventSourceIds.length === 1 && summary.failedCount > 0) {
10097
10217
  process.exit(1);
10098
10218
  }
10099
- const actualId = matchedSource.id;
10100
- const status = eventSourceComponent.getStatus(actualId);
10101
- if (status === "running") {
10102
- output.info(`\uD83D\uDCE1 事件源 ${matchedSource.name} 已在运行中`);
10103
- } else {
10104
- try {
10105
- await eventSourceComponent.startSource(actualId);
10106
- const verifyStatus = eventSourceComponent.getStatus(actualId);
10107
- if (verifyStatus !== "running") {
10108
- output.error(`❌ 事件源启动后状态异常: ${verifyStatus}`);
10109
- output.info(`请检查日志确认后台进程是否正常运行`);
10110
- process.exit(1);
10111
- }
10112
- output.success(`\uD83D\uDCE1 已启动事件源: ${matchedSource.name} (${verifyStatus})`);
10113
- } catch (error) {
10114
- output.error(`❌ 启动事件源失败: ${error}`);
10115
- output.info(`常见问题:`);
10116
- output.info(` - lark-cli 事件源:确保已安装并登录 lark-cli`);
10117
- output.info(` - websocket 事件源:确保目标服务器可达`);
10118
- output.info(` - timer 事件源:检查配置是否正确`);
10119
- process.exit(1);
10120
- }
10121
- }
10122
10219
  }
10123
10220
  let sigintHandler;
10124
10221
  sigintHandler = () => {
@@ -10181,7 +10278,7 @@ var ListCommand = {
10181
10278
  if (isQuiet) {
10182
10279
  CliQuietModeService.getInstance().setQuiet(true);
10183
10280
  }
10184
- const output = new OutputService;
10281
+ const output = new OutputService2;
10185
10282
  output.configure({ quiet: isQuiet });
10186
10283
  const envService = new EnvironmentService(output);
10187
10284
  try {
@@ -10310,7 +10407,7 @@ var GetCommand = {
10310
10407
  }).option("messages", { type: "boolean", default: false }).option("checkpoints", { alias: "c", type: "boolean", default: false }).option("json", { alias: "j", type: "boolean", default: false }),
10311
10408
  async handler(args) {
10312
10409
  const a = args;
10313
- const output = new OutputService;
10410
+ const output = new OutputService2;
10314
10411
  const envService = new EnvironmentService(output);
10315
10412
  try {
10316
10413
  await envService.create({ configPath: a.config });
@@ -10410,7 +10507,7 @@ var NewCommand = {
10410
10507
  describe: "创建新会话",
10411
10508
  builder: (yargs) => yargs.option("title", { alias: "t", type: "string" }).option("directory", { alias: "d", type: "string" }).option("active", { alias: "s", type: "boolean", default: false }).option("json", { type: "boolean", default: false }),
10412
10509
  async handler(args) {
10413
- const output = new OutputService;
10510
+ const output = new OutputService2;
10414
10511
  const envService = new EnvironmentService(output);
10415
10512
  try {
10416
10513
  await envService.create({ configPath: args.config });
@@ -10476,7 +10573,7 @@ var RenameCommand = {
10476
10573
  }),
10477
10574
  async handler(args) {
10478
10575
  const a = args;
10479
- const output = new OutputService;
10576
+ const output = new OutputService2;
10480
10577
  const envService = new EnvironmentService(output);
10481
10578
  try {
10482
10579
  await envService.create({ configPath: a.config });
@@ -10569,7 +10666,7 @@ var DeleteCommand = {
10569
10666
  }),
10570
10667
  async handler(args) {
10571
10668
  const a = args;
10572
- const output = new OutputService;
10669
+ const output = new OutputService2;
10573
10670
  const envService = new EnvironmentService(output);
10574
10671
  try {
10575
10672
  await envService.create({ configPath: a.config });
@@ -10716,7 +10813,7 @@ var MessagesCommand = {
10716
10813
  }).option("limit", { alias: "n", type: "number", demandOption: true, describe: "返回消息数量" }).option("offset", { alias: "o", type: "number", demandOption: true, describe: "起始偏移量" }).option("reverse", { alias: "r", type: "boolean", default: false }).option("json", { alias: "j", type: "boolean", default: false }),
10717
10814
  async handler(args) {
10718
10815
  const a = args;
10719
- const output = new OutputService;
10816
+ const output = new OutputService2;
10720
10817
  const envService = new EnvironmentService(output);
10721
10818
  try {
10722
10819
  await envService.create({ configPath: a.config });
@@ -10926,7 +11023,7 @@ var CompactCommand = {
10926
11023
  }).option("process-key-points", { type: "string", description: "过程要点(逗号分隔)" }).option("current-state", { type: "string", description: "当前状态" }).option("next-steps", { type: "string", description: "后续待跟进(逗号分隔)" }).option("dry-run", { alias: "d", type: "boolean", default: false, description: "预览压缩效果" }).option("json", { alias: "j", type: "boolean", default: false }),
10927
11024
  async handler(args) {
10928
11025
  const a = args;
10929
- const output = new OutputService;
11026
+ const output = new OutputService2;
10930
11027
  const envService = new EnvironmentService(output);
10931
11028
  try {
10932
11029
  await envService.create({ configPath: a.config });
@@ -11118,7 +11215,7 @@ var CheckpointsCommand = {
11118
11215
  }).option("detail", { alias: "d", type: "boolean", default: false }).option("json", { alias: "j", type: "boolean", default: false }),
11119
11216
  async handler(args) {
11120
11217
  const a = args;
11121
- const output = new OutputService;
11218
+ const output = new OutputService2;
11122
11219
  const envService = new EnvironmentService(output);
11123
11220
  try {
11124
11221
  await envService.create({ configPath: a.config });
@@ -11232,7 +11329,7 @@ var ActiveCommand = {
11232
11329
  describe: "查看/设置当前活跃会话",
11233
11330
  builder: (yargs) => yargs.option("clear", { type: "boolean", default: false }).option("json", { alias: "j", type: "boolean", default: false }),
11234
11331
  async handler(args) {
11235
- const output = new OutputService;
11332
+ const output = new OutputService2;
11236
11333
  const envService = new EnvironmentService(output);
11237
11334
  try {
11238
11335
  await envService.create({ configPath: args.config });
@@ -11311,7 +11408,7 @@ var AddMessageCommand = {
11311
11408
  }).option("json", { alias: "j", type: "boolean", default: false }),
11312
11409
  async handler(args) {
11313
11410
  const a = args;
11314
- const output = new OutputService;
11411
+ const output = new OutputService2;
11315
11412
  const envService = new EnvironmentService(output);
11316
11413
  try {
11317
11414
  await envService.create({ configPath: a.config });
@@ -11460,7 +11557,7 @@ var MockCommand = {
11460
11557
  }).option("json", { alias: "j", type: "boolean", default: false }),
11461
11558
  async handler(args) {
11462
11559
  const a = args;
11463
- const output = new OutputService;
11560
+ const output = new OutputService2;
11464
11561
  const envService = new EnvironmentService(output);
11465
11562
  try {
11466
11563
  await envService.create({ configPath: a.config });
@@ -11600,7 +11697,7 @@ var GrepCommand = {
11600
11697
  if (isQuiet) {
11601
11698
  CliQuietModeService.getInstance().setQuiet(true);
11602
11699
  }
11603
- const output = new OutputService;
11700
+ const output = new OutputService2;
11604
11701
  output.configure({ quiet: isQuiet });
11605
11702
  const envService = new EnvironmentService(output);
11606
11703
  try {
@@ -11776,7 +11873,7 @@ var ListCommand2 = {
11776
11873
  description: "是否包含已归档任务(status=archived 的任务默认被排除)"
11777
11874
  }).option("json", { alias: "j", type: "boolean", default: false, description: "JSON 输出" }).option("quiet", { alias: "q", type: "boolean", hidden: true }),
11778
11875
  async handler(args) {
11779
- const output = new OutputService;
11876
+ const output = new OutputService2;
11780
11877
  const envService = new EnvironmentService(output);
11781
11878
  try {
11782
11879
  await envService.create({ configPath: args.config });
@@ -11886,7 +11983,7 @@ var GetCommand2 = {
11886
11983
  description: "包含操作记录"
11887
11984
  }).option("json", { alias: "j", type: "boolean", default: false, description: "JSON 输出" }),
11888
11985
  async handler(args) {
11889
- const output = new OutputService;
11986
+ const output = new OutputService2;
11890
11987
  const envService = new EnvironmentService(output);
11891
11988
  try {
11892
11989
  await envService.create({ configPath: args.config });
@@ -12013,7 +12110,7 @@ var CreateCommand = {
12013
12110
  description: "任务上下文 (JSON 字符串)"
12014
12111
  }).option("json", { alias: "j", type: "boolean", default: false, description: "JSON 输出" }),
12015
12112
  async handler(args) {
12016
- const output = new OutputService;
12113
+ const output = new OutputService2;
12017
12114
  const envService = new EnvironmentService(output);
12018
12115
  try {
12019
12116
  await envService.create({ configPath: args.config });
@@ -12075,7 +12172,7 @@ var UpdateCommand = {
12075
12172
  demandOption: true
12076
12173
  }).option("title", { alias: "t", type: "string", description: "标题" }).option("description", { alias: "d", type: "string", description: "描述" }).option("status", { alias: "s", type: "string", choices: ["todo", "active", "completed", "paused", "cancelled"], description: "状态" }).option("priority", { alias: "p", type: "string", choices: ["low", "medium", "high"], description: "优先级" }).option("type", { type: "string", choices: ["normal", "cycle", "longterm"], description: "任务类型 (normal/cycle/longterm)" }).option("progress", { type: "number", min: 0, max: 100, description: "进度 (0-100)" }).option("current_status", { alias: "c", type: "string", description: "当前状态描述" }).option("project-path", { type: "string", description: "项目路径" }).option("context", { type: "string", description: "任务上下文 (JSON 字符串)" }).option("json", { alias: "j", type: "boolean", default: false, description: "JSON 输出" }),
12077
12174
  async handler(args) {
12078
- const output = new OutputService;
12175
+ const output = new OutputService2;
12079
12176
  const envService = new EnvironmentService(output);
12080
12177
  try {
12081
12178
  await envService.create({ configPath: args.config });
@@ -12161,7 +12258,7 @@ var DeleteCommand2 = {
12161
12258
  description: "强制删除,不确认"
12162
12259
  }),
12163
12260
  async handler(args) {
12164
- const output = new OutputService;
12261
+ const output = new OutputService2;
12165
12262
  const envService = new EnvironmentService(output);
12166
12263
  try {
12167
12264
  await envService.create({ configPath: args.config });
@@ -12222,7 +12319,7 @@ var CompleteCommand = {
12222
12319
  description: "Enable plugin (e.g., --plugin task-tag)"
12223
12320
  }),
12224
12321
  async handler(args) {
12225
- const output = new OutputService;
12322
+ const output = new OutputService2;
12226
12323
  const envService = new EnvironmentService(output);
12227
12324
  try {
12228
12325
  await envService.create({
@@ -12296,7 +12393,7 @@ var OperationsCommand = {
12296
12393
  }).option("limit", { alias: "n", type: "number", default: 20, description: "返回数量" }).option("offset", { type: "number", default: 0, description: "偏移量" }).option("json", { alias: "j", type: "boolean", default: false, description: "JSON 输出" }),
12297
12394
  async handler(args) {
12298
12395
  const a = args;
12299
- const output = new OutputService;
12396
+ const output = new OutputService2;
12300
12397
  const envService = new EnvironmentService(output);
12301
12398
  try {
12302
12399
  await envService.create({ configPath: a.config });
@@ -12444,7 +12541,7 @@ var TreeCommand = {
12444
12541
  description: "以 JSON 格式输出树形结构"
12445
12542
  }),
12446
12543
  async handler(args) {
12447
- const output = new OutputService;
12544
+ const output = new OutputService2;
12448
12545
  const envService = new EnvironmentService(output);
12449
12546
  try {
12450
12547
  await envService.create({ configPath: args.config });
@@ -12547,7 +12644,7 @@ var SearchCommand = {
12547
12644
  description: "是否包含已归档任务"
12548
12645
  }).option("json", { alias: "j", type: "boolean", default: false, description: "JSON 输出" }).option("quiet", { alias: "q", type: "boolean", hidden: true }),
12549
12646
  async handler(args) {
12550
- const output = new OutputService;
12647
+ const output = new OutputService2;
12551
12648
  const envService = new EnvironmentService(output);
12552
12649
  try {
12553
12650
  await envService.create({ configPath: args.config });
@@ -12899,7 +12996,7 @@ var ListCommand3 = {
12899
12996
  }),
12900
12997
  async handler(args) {
12901
12998
  const a = args;
12902
- const output = new OutputService;
12999
+ const output = new OutputService2;
12903
13000
  const envService = new EnvironmentService(output);
12904
13001
  try {
12905
13002
  await envService.create({ configPath: a.config });
@@ -12988,7 +13085,7 @@ var GetCommand3 = {
12988
13085
  description: "JSON 输出"
12989
13086
  }),
12990
13087
  async handler(args) {
12991
- const output = new OutputService;
13088
+ const output = new OutputService2;
12992
13089
  const envService = new EnvironmentService(output);
12993
13090
  try {
12994
13091
  await envService.create({ configPath: args.config });
@@ -13058,7 +13155,7 @@ var SearchCommand2 = {
13058
13155
  description: "简洁输出"
13059
13156
  }),
13060
13157
  async handler(args) {
13061
- const output = new OutputService;
13158
+ const output = new OutputService2;
13062
13159
  const envService = new EnvironmentService(output);
13063
13160
  try {
13064
13161
  await envService.create({ configPath: args.config });
@@ -13140,7 +13237,7 @@ var ReloadCommand = {
13140
13237
  description: "配置文件路径"
13141
13238
  }),
13142
13239
  async handler(args) {
13143
- const output = new OutputService;
13240
+ const output = new OutputService2;
13144
13241
  const envService = new EnvironmentService(output);
13145
13242
  try {
13146
13243
  await envService.create({ configPath: args.config });
@@ -13178,7 +13275,7 @@ var ShowConfigCommand = {
13178
13275
  description: "配置文件路径"
13179
13276
  }),
13180
13277
  async handler(args) {
13181
- const output = new OutputService;
13278
+ const output = new OutputService2;
13182
13279
  const envService = new EnvironmentService(output);
13183
13280
  try {
13184
13281
  await envService.create({ configPath: args.config });
@@ -13268,7 +13365,7 @@ var ListCommand4 = {
13268
13365
  description: "简洁输出"
13269
13366
  }),
13270
13367
  async handler(args) {
13271
- const output = new OutputService;
13368
+ const output = new OutputService2;
13272
13369
  const envService = new EnvironmentService(output);
13273
13370
  try {
13274
13371
  await envService.create({ configPath: args.config });
@@ -13377,7 +13474,7 @@ var GetCommand4 = {
13377
13474
  description: "JSON 输出"
13378
13475
  }),
13379
13476
  async handler(args) {
13380
- const output = new OutputService;
13477
+ const output = new OutputService2;
13381
13478
  const envService = new EnvironmentService(output);
13382
13479
  try {
13383
13480
  await envService.create({ configPath: args.config });
@@ -13547,7 +13644,7 @@ var AddCommand = {
13547
13644
  description: "JSON 输出"
13548
13645
  }),
13549
13646
  async handler(args) {
13550
- const output = new OutputService;
13647
+ const output = new OutputService2;
13551
13648
  const envService = new EnvironmentService(output);
13552
13649
  try {
13553
13650
  await envService.create({ configPath: args.config });
@@ -13623,7 +13720,7 @@ var DeleteCommand3 = {
13623
13720
  description: "JSON 输出"
13624
13721
  }),
13625
13722
  async handler(args) {
13626
- const output = new OutputService;
13723
+ const output = new OutputService2;
13627
13724
  const envService = new EnvironmentService(output);
13628
13725
  try {
13629
13726
  await envService.create({ configPath: args.config });
@@ -13679,7 +13776,7 @@ var ConfigDirCommand = {
13679
13776
  description: "JSON 输出"
13680
13777
  }),
13681
13778
  async handler(args) {
13682
- const output = new OutputService;
13779
+ const output = new OutputService2;
13683
13780
  const envService = new EnvironmentService(output);
13684
13781
  try {
13685
13782
  await envService.create({ configPath: args.config });
@@ -13746,7 +13843,7 @@ var ListCommand5 = {
13746
13843
  description: "简洁输出"
13747
13844
  }),
13748
13845
  async handler(args) {
13749
- const output = new OutputService;
13846
+ const output = new OutputService2;
13750
13847
  const envService = new EnvironmentService(output);
13751
13848
  try {
13752
13849
  await envService.create({ configPath: args.config });
@@ -13833,7 +13930,7 @@ var GetCommand5 = {
13833
13930
  description: "变量替换,格式:key=value"
13834
13931
  }),
13835
13932
  async handler(args) {
13836
- const output = new OutputService;
13933
+ const output = new OutputService2;
13837
13934
  const envService = new EnvironmentService(output);
13838
13935
  try {
13839
13936
  await envService.create({ configPath: args.config });
@@ -13922,7 +14019,7 @@ var AddCommand2 = {
13922
14019
  description: "JSON 输出"
13923
14020
  }),
13924
14021
  async handler(args) {
13925
- const output = new OutputService;
14022
+ const output = new OutputService2;
13926
14023
  const envService = new EnvironmentService(output);
13927
14024
  try {
13928
14025
  if (!args.file && !args.content) {
@@ -13974,7 +14071,7 @@ var ConfigDirCommand2 = {
13974
14071
  description: "JSON 输出"
13975
14072
  }),
13976
14073
  async handler(args) {
13977
- const output = new OutputService;
14074
+ const output = new OutputService2;
13978
14075
  const envService = new EnvironmentService(output);
13979
14076
  try {
13980
14077
  await envService.create({ configPath: args.config });
@@ -14069,7 +14166,7 @@ var CommandsListCommand = {
14069
14166
  type: "string"
14070
14167
  }),
14071
14168
  async handler(args) {
14072
- const output = new OutputService;
14169
+ const output = new OutputService2;
14073
14170
  const envService = new EnvironmentService(output);
14074
14171
  try {
14075
14172
  await envService.create({ configPath: args.config });
@@ -14152,7 +14249,7 @@ var CommandsAddCommand = {
14152
14249
  type: "string"
14153
14250
  }),
14154
14251
  async handler(args) {
14155
- const output = new OutputService;
14252
+ const output = new OutputService2;
14156
14253
  const envService = new EnvironmentService(output);
14157
14254
  try {
14158
14255
  await envService.create({ configPath: args.config });
@@ -14214,7 +14311,7 @@ var CommandsRemoveCommand = {
14214
14311
  type: "string"
14215
14312
  }),
14216
14313
  async handler(args) {
14217
- const output = new OutputService;
14314
+ const output = new OutputService2;
14218
14315
  const envService = new EnvironmentService(output);
14219
14316
  try {
14220
14317
  await envService.create({ configPath: args.config });
@@ -14311,7 +14408,7 @@ var CommandsInfoCommand = {
14311
14408
  type: "string"
14312
14409
  }),
14313
14410
  async handler(args) {
14314
- const output = new OutputService;
14411
+ const output = new OutputService2;
14315
14412
  const envService = new EnvironmentService(output);
14316
14413
  try {
14317
14414
  await envService.create({ configPath: args.config });
@@ -14372,7 +14469,7 @@ var CommandsDirsCommand = {
14372
14469
  type: "string"
14373
14470
  }),
14374
14471
  async handler(args) {
14375
- const output = new OutputService;
14472
+ const output = new OutputService2;
14376
14473
  const envService = new EnvironmentService(output);
14377
14474
  try {
14378
14475
  await envService.create({ configPath: args.config });
@@ -14687,7 +14784,7 @@ var ConfigListCommand = {
14687
14784
  alias: "c"
14688
14785
  }).example("roy-agent config list", "显示帮助信息").example("roy-agent config list tool", "查看 tool component 配置").example("roy-agent config list session", "查看 session component 配置").example("roy-agent config list all", "查看所有 components 概览").example("roy-agent config list tool --json", "JSON 格式输出").example("roy-agent config list tool --keys", "只显示配置键"),
14689
14786
  async handler(args) {
14690
- const output = new OutputService;
14787
+ const output = new OutputService2;
14691
14788
  const envService = new EnvironmentService(output);
14692
14789
  try {
14693
14790
  await envService.create({ configPath: args.config });
@@ -14979,7 +15076,7 @@ var ConfigExportCommand = {
14979
15076
  alias: "c"
14980
15077
  }).example("roy-agent config export agent --file agent-config.json", "导出 agent 配置").example("roy-agent config export session --file session-config.json", "导出 session 配置"),
14981
15078
  async handler(args) {
14982
- const output = new OutputService;
15079
+ const output = new OutputService2;
14983
15080
  const envService = new EnvironmentService(output);
14984
15081
  try {
14985
15082
  await envService.create({ configPath: args.config });
@@ -15047,7 +15144,7 @@ var ConfigImportCommand = {
15047
15144
  alias: "c"
15048
15145
  }).example("roy-agent config import session --file session-config.json", "导入 session 配置").example("roy-agent config import session --file session-config.json --dry-run", "预览变更").example("roy-agent config import session --file session-config.json --verbose", "显示详细信息"),
15049
15146
  async handler(args) {
15050
- const output = new OutputService;
15147
+ const output = new OutputService2;
15051
15148
  const envService = new EnvironmentService(output);
15052
15149
  try {
15053
15150
  await envService.create({ configPath: args.config });
@@ -15124,7 +15221,7 @@ var ListCommand6 = {
15124
15221
  description: "简洁输出"
15125
15222
  }),
15126
15223
  async handler(args) {
15127
- const output = new OutputService;
15224
+ const output = new OutputService2;
15128
15225
  const envService = new EnvironmentService(output);
15129
15226
  try {
15130
15227
  await envService.create({ configPath: args.config });
@@ -15222,7 +15319,7 @@ var ToolsCommand = {
15222
15319
  description: "简洁输出"
15223
15320
  }),
15224
15321
  async handler(args) {
15225
- const output = new OutputService;
15322
+ const output = new OutputService2;
15226
15323
  const envService = new EnvironmentService(output);
15227
15324
  try {
15228
15325
  await envService.create({ configPath: args.config });
@@ -15294,7 +15391,7 @@ var ReloadCommand2 = {
15294
15391
  describe: "重新加载 MCP 服务器",
15295
15392
  builder: (yargs) => yargs,
15296
15393
  async handler(args) {
15297
- const output = new OutputService;
15394
+ const output = new OutputService2;
15298
15395
  const envService = new EnvironmentService(output);
15299
15396
  try {
15300
15397
  await envService.create({ configPath: args.config });
@@ -15358,7 +15455,7 @@ var ListCommand7 = {
15358
15455
  description: "简洁输出(仅名称)"
15359
15456
  }),
15360
15457
  async handler(args) {
15361
- const output = new OutputService;
15458
+ const output = new OutputService2;
15362
15459
  const envService = new EnvironmentService(output);
15363
15460
  try {
15364
15461
  await envService.create({ configPath: args.config });
@@ -15458,7 +15555,7 @@ var GetCommand6 = {
15458
15555
  description: "JSON 输出"
15459
15556
  }),
15460
15557
  async handler(args) {
15461
- const output = new OutputService;
15558
+ const output = new OutputService2;
15462
15559
  const envService = new EnvironmentService(output);
15463
15560
  try {
15464
15561
  await envService.create({ configPath: args.config });
@@ -15533,7 +15630,7 @@ var ExecToolCommand = {
15533
15630
  }).strict(false);
15534
15631
  },
15535
15632
  async handler(args) {
15536
- const output = new OutputService;
15633
+ const output = new OutputService2;
15537
15634
  const envService = new EnvironmentService(output);
15538
15635
  const toolName = args.name;
15539
15636
  try {
@@ -15766,7 +15863,7 @@ var RecordCommand = {
15766
15863
  }),
15767
15864
  async handler(args) {
15768
15865
  const a = args;
15769
- const output = new OutputService;
15866
+ const output = new OutputService2;
15770
15867
  const envService = new EnvironmentService(output);
15771
15868
  try {
15772
15869
  await envService.create({ configPath: a.config });
@@ -15847,7 +15944,7 @@ var RecallCommand = {
15847
15944
  }),
15848
15945
  async handler(args) {
15849
15946
  const a = args;
15850
- const output = new OutputService;
15947
+ const output = new OutputService2;
15851
15948
  const envService = new EnvironmentService(output);
15852
15949
  try {
15853
15950
  await envService.create({ configPath: a.config });
@@ -15948,7 +16045,7 @@ var EventSourceListCommand = {
15948
16045
  default: false
15949
16046
  }),
15950
16047
  async handler(args) {
15951
- const output = new OutputService;
16048
+ const output = new OutputService2;
15952
16049
  output.configure({ quiet: args.quiet });
15953
16050
  const envService = new EnvironmentService(output);
15954
16051
  try {
@@ -16050,10 +16147,13 @@ var EventSourceAddCommand = {
16050
16147
  }).option("cron", {
16051
16148
  describe: "Cron 表达式",
16052
16149
  type: "string"
16150
+ }).option("prompt", {
16151
+ describe: "自定义 prompt 消息(timer 类型,替换默认 SelfReminder 内容)",
16152
+ type: "string"
16053
16153
  }),
16054
16154
  async handler(args) {
16055
16155
  const a = args;
16056
- const output = new OutputService;
16156
+ const output = new OutputService2;
16057
16157
  const envService = new EnvironmentService(output);
16058
16158
  try {
16059
16159
  await envService.create({ configPath: a.config });
@@ -16077,7 +16177,8 @@ var EventSourceAddCommand = {
16077
16177
  command: a.command,
16078
16178
  url: a.url,
16079
16179
  interval: a.interval,
16080
- cron: a.cron
16180
+ cron: a.cron,
16181
+ options: a.prompt ? { prompt: a.prompt } : undefined
16081
16182
  };
16082
16183
  esComponent.register(config);
16083
16184
  output.success(chalk55.green(`事件源 '${a.name}' 添加成功!`));
@@ -16093,6 +16194,9 @@ var EventSourceAddCommand = {
16093
16194
  if (a.interval) {
16094
16195
  output.log(` Interval: ${chalk55.gray(`${a.interval}ms`)}`);
16095
16196
  }
16197
+ if (a.prompt) {
16198
+ output.log(` Prompt: ${chalk55.gray(a.prompt.length > 60 ? a.prompt.slice(0, 60) + "..." : a.prompt)}`);
16199
+ }
16096
16200
  output.log("");
16097
16201
  output.log(chalk55.gray(`使用 'roy-agent eventsource start ${config.id.substring(0, 8)}' 启动它。`));
16098
16202
  } finally {
@@ -16101,8 +16205,132 @@ var EventSourceAddCommand = {
16101
16205
  }
16102
16206
  };
16103
16207
 
16104
- // src/commands/eventsource/remove.ts
16208
+ // src/commands/eventsource/update.ts
16105
16209
  import chalk56 from "chalk";
16210
+ function findSource(esComponent, id) {
16211
+ const sources = esComponent.list();
16212
+ const matched = sources.find((s) => s.id === id || s.id.startsWith(id));
16213
+ if (!matched)
16214
+ return null;
16215
+ return { source: matched, fullId: matched.id };
16216
+ }
16217
+ var EventSourceUpdateCommand = {
16218
+ command: "update <id>",
16219
+ describe: "更新事件源配置(部分更新,type 不可改)",
16220
+ builder: (yargs) => yargs.positional("id", {
16221
+ describe: "事件源 ID(支持前缀匹配)",
16222
+ type: "string",
16223
+ demandOption: true
16224
+ }).option("name", {
16225
+ describe: "事件源名称",
16226
+ type: "string"
16227
+ }).option("interval", {
16228
+ alias: "i",
16229
+ describe: "定时器间隔(毫秒)",
16230
+ type: "number"
16231
+ }).option("event-types", {
16232
+ alias: "e",
16233
+ describe: "事件类型过滤(逗号分隔)",
16234
+ type: "string"
16235
+ }).option("command", {
16236
+ alias: "c",
16237
+ describe: "执行的命令(lark-cli 类型)",
16238
+ type: "string"
16239
+ }).option("url", {
16240
+ alias: "u",
16241
+ describe: "WebSocket URL",
16242
+ type: "string"
16243
+ }).option("cron", {
16244
+ describe: "Cron 表达式",
16245
+ type: "string"
16246
+ }).option("prompt", {
16247
+ describe: "自定义 prompt 消息(timer 类型)",
16248
+ type: "string"
16249
+ }).option("enabled", {
16250
+ describe: "是否启用",
16251
+ type: "boolean"
16252
+ }),
16253
+ async handler(args) {
16254
+ const a = args;
16255
+ const output = new OutputService2;
16256
+ const envService = new EnvironmentService(output);
16257
+ try {
16258
+ await envService.create({ configPath: a.config });
16259
+ const env = envService.getEnvironment();
16260
+ if (!env) {
16261
+ output.error("Failed to create environment");
16262
+ process.exit(1);
16263
+ }
16264
+ const esComponent = env.getComponent("event-source");
16265
+ if (!esComponent) {
16266
+ output.error("EventSourceComponent not available");
16267
+ process.exit(1);
16268
+ }
16269
+ const match = findSource(esComponent, a.id);
16270
+ if (!match) {
16271
+ output.error(`❌ 事件源不存在: ${a.id}`);
16272
+ const all = esComponent.list();
16273
+ if (all.length > 0) {
16274
+ output.info("");
16275
+ output.info(chalk56.gray("可用的事件源:"));
16276
+ for (const s of all) {
16277
+ output.info(` - ${s.id.substring(0, 8)}: ${s.name} (${s.type})`);
16278
+ }
16279
+ }
16280
+ process.exit(1);
16281
+ }
16282
+ const partial = {};
16283
+ if (a.name !== undefined)
16284
+ partial.name = a.name;
16285
+ if (a.interval !== undefined)
16286
+ partial.interval = a.interval;
16287
+ if (a.eventTypes !== undefined) {
16288
+ partial.eventTypes = a.eventTypes.split(",").map((s) => s.trim()).filter(Boolean);
16289
+ }
16290
+ if (a.command !== undefined)
16291
+ partial.command = a.command;
16292
+ if (a.url !== undefined)
16293
+ partial.url = a.url;
16294
+ if (a.cron !== undefined)
16295
+ partial.cron = a.cron;
16296
+ if (a.enabled !== undefined)
16297
+ partial.enabled = a.enabled;
16298
+ if (a.prompt !== undefined) {
16299
+ const existingOptions = match.source.options ?? {};
16300
+ partial.options = { ...existingOptions, prompt: a.prompt };
16301
+ }
16302
+ if (Object.keys(partial).length === 0) {
16303
+ output.error("❌ 请至少提供一个要更新的字段(如 --interval, --prompt 等)");
16304
+ process.exit(1);
16305
+ }
16306
+ try {
16307
+ const result = await esComponent.update(match.fullId, partial);
16308
+ output.success(chalk56.green(`✅ 事件源已更新: ${match.source.name}`));
16309
+ output.log("");
16310
+ output.log(chalk56.bold("修改字段:"));
16311
+ const before = match.source;
16312
+ const after = result.updated;
16313
+ for (const field of result.fields) {
16314
+ const beforeVal = JSON.stringify(before[field] ?? before.options?.[field]);
16315
+ const afterVal = JSON.stringify(after[field] ?? after.options?.[field]);
16316
+ output.log(` ${chalk56.cyan(field)}: ${chalk56.gray(beforeVal)} ${chalk56.gray("→")} ${chalk56.green(afterVal)}`);
16317
+ }
16318
+ output.log("");
16319
+ if (result.wasRunning) {
16320
+ output.info(chalk56.yellow(`⚠️ 事件源在更新前正在运行,已自动停止。请使用 'roy-agent eventsource start ${match.fullId.substring(0, 8)}' 手动启动以应用新配置。`));
16321
+ }
16322
+ } catch (error) {
16323
+ output.error(`❌ 更新失败: ${error instanceof Error ? error.message : String(error)}`);
16324
+ process.exit(1);
16325
+ }
16326
+ } finally {
16327
+ await envService.dispose();
16328
+ }
16329
+ }
16330
+ };
16331
+
16332
+ // src/commands/eventsource/remove.ts
16333
+ import chalk57 from "chalk";
16106
16334
  var EventSourceRemoveCommand = {
16107
16335
  command: "remove <id>",
16108
16336
  aliases: ["rm"],
@@ -16118,7 +16346,7 @@ var EventSourceRemoveCommand = {
16118
16346
  default: false
16119
16347
  }),
16120
16348
  async handler(args) {
16121
- const output = new OutputService;
16349
+ const output = new OutputService2;
16122
16350
  const envService = new EnvironmentService(output);
16123
16351
  try {
16124
16352
  await envService.create({ configPath: args.config });
@@ -16141,7 +16369,7 @@ var EventSourceRemoveCommand = {
16141
16369
  const status = esComponent.getStatus(matchedSource.id);
16142
16370
  if (status === "running" && !args.force) {
16143
16371
  output.error(`事件源正在运行中,请先停止: ${matchedSource.name} (${status})`);
16144
- output.log(chalk56.gray(`使用 --force 强制移除或 'roy-agent eventsource stop ${matchedSource.id.substring(0, 8)}' 先停止`));
16372
+ output.log(chalk57.gray(`使用 --force 强制移除或 'roy-agent eventsource stop ${matchedSource.id.substring(0, 8)}' 先停止`));
16145
16373
  process.exit(1);
16146
16374
  }
16147
16375
  if (status === "running") {
@@ -16150,7 +16378,7 @@ var EventSourceRemoveCommand = {
16150
16378
  }
16151
16379
  const result = esComponent.unregister(matchedSource.id);
16152
16380
  if (result) {
16153
- output.success(chalk56.green(`事件源已移除: ${matchedSource.name}`));
16381
+ output.success(chalk57.green(`事件源已移除: ${matchedSource.name}`));
16154
16382
  } else {
16155
16383
  output.error("移除失败");
16156
16384
  process.exit(1);
@@ -16162,7 +16390,7 @@ var EventSourceRemoveCommand = {
16162
16390
  };
16163
16391
 
16164
16392
  // src/commands/eventsource/start.ts
16165
- import chalk57 from "chalk";
16393
+ import chalk58 from "chalk";
16166
16394
  var EventSourceStartCommand = {
16167
16395
  command: "start <id>",
16168
16396
  describe: "启动指定的事件源",
@@ -16177,7 +16405,7 @@ var EventSourceStartCommand = {
16177
16405
  default: false
16178
16406
  }),
16179
16407
  async handler(args) {
16180
- const output = new OutputService;
16408
+ const output = new OutputService2;
16181
16409
  const envService = new EnvironmentService(output);
16182
16410
  try {
16183
16411
  await envService.create({ configPath: args.config });
@@ -16199,15 +16427,15 @@ var EventSourceStartCommand = {
16199
16427
  }
16200
16428
  const status = esComponent.getStatus(matchedSource.id);
16201
16429
  if (status === "running") {
16202
- output.log(chalk57.yellow(`事件源已在运行: ${matchedSource.name}`));
16430
+ output.log(chalk58.yellow(`事件源已在运行: ${matchedSource.name}`));
16203
16431
  return;
16204
16432
  }
16205
16433
  output.info(`正在启动事件源 '${matchedSource.name}'...`);
16206
16434
  try {
16207
16435
  await esComponent.startSource(matchedSource.id);
16208
- output.success(chalk57.green(`事件源已启动: ${matchedSource.name}`));
16436
+ output.success(chalk58.green(`事件源已启动: ${matchedSource.name}`));
16209
16437
  if (!args.background) {
16210
- output.log(chalk57.gray("按 Ctrl+C 停止..."));
16438
+ output.log(chalk58.gray("按 Ctrl+C 停止..."));
16211
16439
  await new Promise((resolve) => {
16212
16440
  const cleanup = () => {
16213
16441
  process.removeListener("SIGINT", cleanup);
@@ -16229,7 +16457,7 @@ var EventSourceStartCommand = {
16229
16457
  };
16230
16458
 
16231
16459
  // src/commands/eventsource/stop.ts
16232
- import chalk58 from "chalk";
16460
+ import chalk59 from "chalk";
16233
16461
  var EventSourceStopCommand = {
16234
16462
  command: "stop <id>",
16235
16463
  aliases: ["kill"],
@@ -16245,7 +16473,7 @@ var EventSourceStopCommand = {
16245
16473
  default: false
16246
16474
  }),
16247
16475
  async handler(args) {
16248
- const output = new OutputService;
16476
+ const output = new OutputService2;
16249
16477
  const envService = new EnvironmentService(output);
16250
16478
  try {
16251
16479
  await envService.create({ configPath: args.config });
@@ -16267,13 +16495,13 @@ var EventSourceStopCommand = {
16267
16495
  }
16268
16496
  const status = esComponent.getStatus(matchedSource.id);
16269
16497
  if (status !== "running") {
16270
- output.log(chalk58.yellow(`事件源未运行: ${matchedSource.name} (${status || "unknown"})`));
16498
+ output.log(chalk59.yellow(`事件源未运行: ${matchedSource.name} (${status || "unknown"})`));
16271
16499
  return;
16272
16500
  }
16273
16501
  output.info(`正在停止事件源 '${matchedSource.name}'...`);
16274
16502
  try {
16275
16503
  await esComponent.stopSource(matchedSource.id);
16276
- output.success(chalk58.green(`事件源已停止: ${matchedSource.name}`));
16504
+ output.success(chalk59.green(`事件源已停止: ${matchedSource.name}`));
16277
16505
  } catch (error) {
16278
16506
  output.error(`停止失败: ${error}`);
16279
16507
  process.exit(1);
@@ -16285,14 +16513,14 @@ var EventSourceStopCommand = {
16285
16513
  };
16286
16514
 
16287
16515
  // src/commands/eventsource/status.ts
16288
- import chalk59 from "chalk";
16516
+ import chalk60 from "chalk";
16289
16517
  var STATUS_COLORS = {
16290
- created: chalk59.gray,
16291
- starting: chalk59.yellow,
16292
- running: chalk59.green,
16293
- stopping: chalk59.yellow,
16294
- stopped: chalk59.gray,
16295
- error: chalk59.red
16518
+ created: chalk60.gray,
16519
+ starting: chalk60.yellow,
16520
+ running: chalk60.green,
16521
+ stopping: chalk60.yellow,
16522
+ stopped: chalk60.gray,
16523
+ error: chalk60.red
16296
16524
  };
16297
16525
  var STATUS_ICONS = {
16298
16526
  created: "○",
@@ -16324,7 +16552,7 @@ var EventSourceStatusCommand = {
16324
16552
  default: false
16325
16553
  }),
16326
16554
  async handler(args) {
16327
- const output = new OutputService;
16555
+ const output = new OutputService2;
16328
16556
  const envService = new EnvironmentService(output);
16329
16557
  try {
16330
16558
  await envService.create({ configPath: args.config });
@@ -16346,7 +16574,7 @@ var EventSourceStatusCommand = {
16346
16574
  process.exit(1);
16347
16575
  }
16348
16576
  const status = esComponent.getStatus(matchedSource.id) || "unknown";
16349
- const statusColor = STATUS_COLORS[status] || chalk59.gray;
16577
+ const statusColor = STATUS_COLORS[status] || chalk60.gray;
16350
16578
  if (args.json) {
16351
16579
  output.json({
16352
16580
  id: matchedSource.id,
@@ -16363,31 +16591,31 @@ var EventSourceStatusCommand = {
16363
16591
  });
16364
16592
  return;
16365
16593
  }
16366
- output.log(chalk59.bold("事件源详情"));
16594
+ output.log(chalk60.bold("事件源详情"));
16367
16595
  output.log("─".repeat(50));
16368
- output.log(` ID: ${chalk59.gray(matchedSource.id)}`);
16369
- output.log(` Name: ${chalk59.cyan(matchedSource.name)}`);
16370
- output.log(` Type: ${chalk59.cyan(matchedSource.type)}`);
16596
+ output.log(` ID: ${chalk60.gray(matchedSource.id)}`);
16597
+ output.log(` Name: ${chalk60.cyan(matchedSource.name)}`);
16598
+ output.log(` Type: ${chalk60.cyan(matchedSource.type)}`);
16371
16599
  output.log(` Status: ${statusColor(`${STATUS_ICONS[status]} ${STATUS_LABELS[status]}`)}`);
16372
- output.log(` Enabled: ${matchedSource.enabled ? chalk59.green("是") : chalk59.gray("否")}`);
16600
+ output.log(` Enabled: ${matchedSource.enabled ? chalk60.green("是") : chalk60.gray("否")}`);
16373
16601
  if (matchedSource.eventTypes?.length) {
16374
- output.log(` Events: ${chalk59.gray(matchedSource.eventTypes.join(", "))}`);
16602
+ output.log(` Events: ${chalk60.gray(matchedSource.eventTypes.join(", "))}`);
16375
16603
  }
16376
16604
  if (matchedSource.command) {
16377
- output.log(` Command: ${chalk59.gray(matchedSource.command)}`);
16605
+ output.log(` Command: ${chalk60.gray(matchedSource.command)}`);
16378
16606
  }
16379
16607
  if (matchedSource.interval) {
16380
- output.log(` Interval: ${chalk59.gray(`${matchedSource.interval}ms`)}`);
16608
+ output.log(` Interval: ${chalk60.gray(`${matchedSource.interval}ms`)}`);
16381
16609
  }
16382
16610
  if (matchedSource.url) {
16383
- output.log(` URL: ${chalk59.gray(matchedSource.url)}`);
16611
+ output.log(` URL: ${chalk60.gray(matchedSource.url)}`);
16384
16612
  }
16385
16613
  output.log("");
16386
16614
  return;
16387
16615
  }
16388
16616
  const sources = esComponent.list();
16389
16617
  if (sources.length === 0) {
16390
- output.log(chalk59.yellow("没有配置的事件源"));
16618
+ output.log(chalk60.yellow("没有配置的事件源"));
16391
16619
  return;
16392
16620
  }
16393
16621
  if (args.json) {
@@ -16401,21 +16629,21 @@ var EventSourceStatusCommand = {
16401
16629
  output.json({ sources: sourcesWithStatus, count: sources.length });
16402
16630
  return;
16403
16631
  }
16404
- output.log(chalk59.bold("事件源状态概览"));
16632
+ output.log(chalk60.bold("事件源状态概览"));
16405
16633
  output.log("─".repeat(60));
16406
16634
  for (const source of sources) {
16407
16635
  const status = esComponent.getStatus(source.id) || "unknown";
16408
- const statusColor = STATUS_COLORS[status] || chalk59.gray;
16636
+ const statusColor = STATUS_COLORS[status] || chalk60.gray;
16409
16637
  const icon = STATUS_ICONS[status] || "?";
16410
16638
  const label = STATUS_LABELS[status] || status;
16411
16639
  output.log("");
16412
- output.log(` ${chalk59.cyan(source.name)} ${chalk59.gray(`(${source.type})`)}`);
16640
+ output.log(` ${chalk60.cyan(source.name)} ${chalk60.gray(`(${source.type})`)}`);
16413
16641
  output.log(` └─ Status: ${statusColor(`${icon} ${label}`)}`);
16414
- output.log(` ID: ${chalk59.gray(source.id.substring(0, 8))}...`);
16642
+ output.log(` ID: ${chalk60.gray(source.id.substring(0, 8))}...`);
16415
16643
  }
16416
16644
  output.log("");
16417
16645
  const runningCount = sources.filter((s) => esComponent.getStatus(s.id) === "running").length;
16418
- output.log(chalk59.green(`✅ ${runningCount}/${sources.length} 运行中`));
16646
+ output.log(chalk60.green(`✅ ${runningCount}/${sources.length} 运行中`));
16419
16647
  } finally {
16420
16648
  await envService.dispose();
16421
16649
  }
@@ -16427,7 +16655,7 @@ var EventSourceCommand = {
16427
16655
  command: "eventsource",
16428
16656
  aliases: ["es", "event-source"],
16429
16657
  describe: "事件源管理 - 添加、启动、停止各种事件源(lark-cli、timer、websocket)",
16430
- builder: (yargs) => yargs.command(EventSourceListCommand).command(EventSourceAddCommand).command(EventSourceRemoveCommand).command(EventSourceStartCommand).command(EventSourceStopCommand).command(EventSourceStatusCommand).demandCommand().help(),
16658
+ builder: (yargs) => yargs.command(EventSourceListCommand).command(EventSourceAddCommand).command(EventSourceUpdateCommand).command(EventSourceRemoveCommand).command(EventSourceStartCommand).command(EventSourceStopCommand).command(EventSourceStatusCommand).demandCommand().help(),
16431
16659
  handler: () => {}
16432
16660
  };
16433
16661
 
@@ -16728,7 +16956,7 @@ var DebugCommand = {
16728
16956
  };
16729
16957
 
16730
16958
  // src/commands/workflow/renderers.ts
16731
- import chalk60 from "chalk";
16959
+ import chalk61 from "chalk";
16732
16960
  function truncateVisual3(str, maxWidth) {
16733
16961
  if (!str)
16734
16962
  return "-";
@@ -16763,18 +16991,18 @@ function formatDuration(ms) {
16763
16991
  function statusColor(status) {
16764
16992
  switch (status) {
16765
16993
  case "completed":
16766
- return chalk60.green;
16994
+ return chalk61.green;
16767
16995
  case "running":
16768
16996
  case "idle":
16769
- return chalk60.blue;
16997
+ return chalk61.blue;
16770
16998
  case "paused":
16771
- return chalk60.yellow;
16999
+ return chalk61.yellow;
16772
17000
  case "failed":
16773
- return chalk60.red;
17001
+ return chalk61.red;
16774
17002
  case "stopped":
16775
- return chalk60.gray;
17003
+ return chalk61.gray;
16776
17004
  default:
16777
- return chalk60.white;
17005
+ return chalk61.white;
16778
17006
  }
16779
17007
  }
16780
17008
  function renderWorkflowList(workflows, options) {
@@ -16793,7 +17021,7 @@ function renderWorkflowList(workflows, options) {
16793
17021
  }, null, 2);
16794
17022
  }
16795
17023
  if (workflows.length === 0) {
16796
- return chalk60.yellow("No workflows found");
17024
+ return chalk61.yellow("No workflows found");
16797
17025
  }
16798
17026
  const NAME_WIDTH = 30;
16799
17027
  const VERSION_WIDTH = 10;
@@ -16801,10 +17029,10 @@ function renderWorkflowList(workflows, options) {
16801
17029
  const UPDATED_WIDTH = 20;
16802
17030
  const GAP = " ";
16803
17031
  const headerLine = [
16804
- chalk60.bold("NAME".padEnd(NAME_WIDTH)),
16805
- chalk60.bold("VER".padEnd(VERSION_WIDTH)),
16806
- chalk60.bold("TAGS".padEnd(TAGS_WIDTH)),
16807
- chalk60.bold("UPDATED")
17032
+ chalk61.bold("NAME".padEnd(NAME_WIDTH)),
17033
+ chalk61.bold("VER".padEnd(VERSION_WIDTH)),
17034
+ chalk61.bold("TAGS".padEnd(TAGS_WIDTH)),
17035
+ chalk61.bold("UPDATED")
16808
17036
  ].join(GAP);
16809
17037
  const sepLine = "─".repeat(NAME_WIDTH + VERSION_WIDTH + TAGS_WIDTH + UPDATED_WIDTH + GAP.length * 3);
16810
17038
  const rows = workflows.map((w) => {
@@ -16819,18 +17047,18 @@ function renderWorkflowList(workflows, options) {
16819
17047
  }
16820
17048
  function renderWorkflowDetail(workflow, options) {
16821
17049
  const lines = [];
16822
- lines.push(chalk60.bold(`
17050
+ lines.push(chalk61.bold(`
16823
17051
  \uD83D\uDCCB Workflow Details
16824
17052
  `));
16825
- lines.push(` ${chalk60.cyan("ID:")} ${workflow.id}`);
16826
- lines.push(` ${chalk60.cyan("Name:")} ${workflow.name}`);
16827
- lines.push(` ${chalk60.cyan("Version:")} ${workflow.version}`);
16828
- lines.push(` ${chalk60.cyan("Description:")} ${workflow.description || "-"}`);
16829
- lines.push(` ${chalk60.cyan("Tags:")} ${workflow.tags.join(", ") || "-"}`);
16830
- lines.push(` ${chalk60.cyan("Created:")} ${formatDate(workflow.createdAt)}`);
16831
- lines.push(` ${chalk60.cyan("Updated:")} ${formatDate(workflow.updatedAt)}`);
17053
+ lines.push(` ${chalk61.cyan("ID:")} ${workflow.id}`);
17054
+ lines.push(` ${chalk61.cyan("Name:")} ${workflow.name}`);
17055
+ lines.push(` ${chalk61.cyan("Version:")} ${workflow.version}`);
17056
+ lines.push(` ${chalk61.cyan("Description:")} ${workflow.description || "-"}`);
17057
+ lines.push(` ${chalk61.cyan("Tags:")} ${workflow.tags.join(", ") || "-"}`);
17058
+ lines.push(` ${chalk61.cyan("Created:")} ${formatDate(workflow.createdAt)}`);
17059
+ lines.push(` ${chalk61.cyan("Updated:")} ${formatDate(workflow.updatedAt)}`);
16832
17060
  const nodeCount = workflow.definition.nodes.length;
16833
- lines.push(chalk60.bold(`
17061
+ lines.push(chalk61.bold(`
16834
17062
  \uD83D\uDCCA Nodes Summary
16835
17063
  `));
16836
17064
  lines.push(` Total: ${nodeCount} nodes`);
@@ -16842,7 +17070,7 @@ function renderWorkflowDetail(workflow, options) {
16842
17070
  lines.push(` - ${type}: ${count}`);
16843
17071
  }
16844
17072
  if (workflow.definition.config) {
16845
- lines.push(chalk60.bold(`
17073
+ lines.push(chalk61.bold(`
16846
17074
  ⚙️ Configuration
16847
17075
  `));
16848
17076
  if (workflow.definition.config.parallel_limit !== undefined) {
@@ -16856,7 +17084,7 @@ function renderWorkflowDetail(workflow, options) {
16856
17084
  }
16857
17085
  }
16858
17086
  if (options?.includeRuns && options.includeRuns.length > 0) {
16859
- lines.push(chalk60.bold(`
17087
+ lines.push(chalk61.bold(`
16860
17088
  \uD83D\uDCDC Recent Runs
16861
17089
  `));
16862
17090
  lines.push(renderRunsList(options.includeRuns.slice(0, 5)));
@@ -16880,7 +17108,7 @@ function renderRunsList(runs, options) {
16880
17108
  }, null, 2);
16881
17109
  }
16882
17110
  if (runs.length === 0) {
16883
- return chalk60.yellow("No runs found");
17111
+ return chalk61.yellow("No runs found");
16884
17112
  }
16885
17113
  const ID_WIDTH = 20;
16886
17114
  const STATUS_WIDTH = 12;
@@ -16888,10 +17116,10 @@ function renderRunsList(runs, options) {
16888
17116
  const UPDATED_WIDTH = 20;
16889
17117
  const GAP = " ";
16890
17118
  const headerLine = [
16891
- chalk60.bold("RUN ID".padEnd(ID_WIDTH)),
16892
- chalk60.bold("STATUS".padEnd(STATUS_WIDTH)),
16893
- chalk60.bold("DURATION".padEnd(DURATION_WIDTH)),
16894
- chalk60.bold("STARTED")
17119
+ chalk61.bold("RUN ID".padEnd(ID_WIDTH)),
17120
+ chalk61.bold("STATUS".padEnd(STATUS_WIDTH)),
17121
+ chalk61.bold("DURATION".padEnd(DURATION_WIDTH)),
17122
+ chalk61.bold("STARTED")
16895
17123
  ].join(GAP);
16896
17124
  const sepLine = "─".repeat(ID_WIDTH + STATUS_WIDTH + DURATION_WIDTH + UPDATED_WIDTH + GAP.length * 3);
16897
17125
  const rows = runs.map((r) => {
@@ -16906,34 +17134,34 @@ function renderRunsList(runs, options) {
16906
17134
  }
16907
17135
  function renderRunDetail(run) {
16908
17136
  const lines = [];
16909
- lines.push(chalk60.bold(`
17137
+ lines.push(chalk61.bold(`
16910
17138
  \uD83C\uDFC3 Run Details
16911
17139
  `));
16912
- lines.push(` ${chalk60.cyan("Run ID:")} ${run.id}`);
16913
- lines.push(` ${chalk60.cyan("Workflow:")} ${run.workflowId}`);
16914
- lines.push(` ${chalk60.cyan("Status:")} ${statusColor(run.status)(run.status)}`);
16915
- lines.push(` ${chalk60.cyan("Started:")} ${formatDate(run.startedAt)}`);
17140
+ lines.push(` ${chalk61.cyan("Run ID:")} ${run.id}`);
17141
+ lines.push(` ${chalk61.cyan("Workflow:")} ${run.workflowId}`);
17142
+ lines.push(` ${chalk61.cyan("Status:")} ${statusColor(run.status)(run.status)}`);
17143
+ lines.push(` ${chalk61.cyan("Started:")} ${formatDate(run.startedAt)}`);
16916
17144
  if (run.pausedAt) {
16917
- lines.push(` ${chalk60.cyan("Paused:")} ${formatDate(run.pausedAt)}`);
17145
+ lines.push(` ${chalk61.cyan("Paused:")} ${formatDate(run.pausedAt)}`);
16918
17146
  }
16919
17147
  if (run.resumedAt) {
16920
- lines.push(` ${chalk60.cyan("Resumed:")} ${formatDate(run.resumedAt)}`);
17148
+ lines.push(` ${chalk61.cyan("Resumed:")} ${formatDate(run.resumedAt)}`);
16921
17149
  }
16922
17150
  if (run.stoppedAt) {
16923
- lines.push(` ${chalk60.cyan("Stopped:")} ${formatDate(run.stoppedAt)}`);
17151
+ lines.push(` ${chalk61.cyan("Stopped:")} ${formatDate(run.stoppedAt)}`);
16924
17152
  }
16925
17153
  if (run.completedAt) {
16926
- lines.push(` ${chalk60.cyan("Completed:")} ${formatDate(run.completedAt)}`);
17154
+ lines.push(` ${chalk61.cyan("Completed:")} ${formatDate(run.completedAt)}`);
16927
17155
  }
16928
- lines.push(` ${chalk60.cyan("Duration:")} ${formatDuration(run.durationMs)}`);
17156
+ lines.push(` ${chalk61.cyan("Duration:")} ${formatDuration(run.durationMs)}`);
16929
17157
  if (run.error) {
16930
- lines.push(chalk60.bold(`
17158
+ lines.push(chalk61.bold(`
16931
17159
  ❌ Error
16932
17160
  `));
16933
- lines.push(` ${chalk60.red(run.error)}`);
17161
+ lines.push(` ${chalk61.red(run.error)}`);
16934
17162
  }
16935
17163
  if (run.output) {
16936
- lines.push(chalk60.bold(`
17164
+ lines.push(chalk61.bold(`
16937
17165
  \uD83D\uDCE4 Output
16938
17166
  `));
16939
17167
  lines.push(" " + JSON.stringify(run.output, null, 2).split(`
@@ -16944,36 +17172,36 @@ function renderRunDetail(run) {
16944
17172
  `);
16945
17173
  }
16946
17174
  function renderWorkflowAdded(workflow) {
16947
- return chalk60.green(`
17175
+ return chalk61.green(`
16948
17176
  ✅ Workflow '${workflow.name}' added successfully
16949
17177
  `) + ` ID: ${workflow.id}
16950
17178
  ` + ` Version: ${workflow.version}
16951
17179
  `;
16952
17180
  }
16953
17181
  function renderWorkflowUpdated(workflow) {
16954
- return chalk60.green(`
17182
+ return chalk61.green(`
16955
17183
  ✅ Workflow '${workflow.name}' updated successfully
16956
17184
  `) + ` ID: ${workflow.id}
16957
17185
  `;
16958
17186
  }
16959
17187
  function renderWorkflowDeleted(name) {
16960
- return chalk60.green(`
17188
+ return chalk61.green(`
16961
17189
  ✅ Workflow '${name}' deleted successfully
16962
17190
  `);
16963
17191
  }
16964
17192
  function renderRunResult(result) {
16965
17193
  const lines = [];
16966
17194
  if (result.status === "completed") {
16967
- lines.push(chalk60.green(`
17195
+ lines.push(chalk61.green(`
16968
17196
  ✅ Workflow completed successfully`));
16969
17197
  } else if (result.status === "failed") {
16970
- lines.push(chalk60.red(`
17198
+ lines.push(chalk61.red(`
16971
17199
  ❌ Workflow failed`));
16972
17200
  } else if (result.status === "stopped") {
16973
- lines.push(chalk60.yellow(`
17201
+ lines.push(chalk61.yellow(`
16974
17202
  ⚠️ Workflow stopped`));
16975
17203
  } else {
16976
- lines.push(chalk60.blue(`
17204
+ lines.push(chalk61.blue(`
16977
17205
  \uD83D\uDD04 Workflow ${result.status}`));
16978
17206
  }
16979
17207
  lines.push(` Run ID: ${result.runId}`);
@@ -16981,11 +17209,11 @@ function renderRunResult(result) {
16981
17209
  lines.push(` Duration: ${formatDuration(result.durationMs)}`);
16982
17210
  }
16983
17211
  if (result.error) {
16984
- lines.push(chalk60.red(`
17212
+ lines.push(chalk61.red(`
16985
17213
  Error: ${result.error}`));
16986
17214
  }
16987
17215
  if (result.output) {
16988
- lines.push(chalk60.bold(`
17216
+ lines.push(chalk61.bold(`
16989
17217
  \uD83D\uDCE4 Output:`));
16990
17218
  lines.push(JSON.stringify(result.output, null, 2));
16991
17219
  }
@@ -16999,10 +17227,10 @@ function renderNodesList(nodes) {
16999
17227
  const DEPS_WIDTH = 20;
17000
17228
  const GAP = " ";
17001
17229
  const headerLine = [
17002
- chalk60.bold("NODE ID".padEnd(ID_WIDTH)),
17003
- chalk60.bold("TYPE".padEnd(TYPE_WIDTH)),
17004
- chalk60.bold("NAME".padEnd(NAME_WIDTH)),
17005
- chalk60.bold("DEPENDS ON")
17230
+ chalk61.bold("NODE ID".padEnd(ID_WIDTH)),
17231
+ chalk61.bold("TYPE".padEnd(TYPE_WIDTH)),
17232
+ chalk61.bold("NAME".padEnd(NAME_WIDTH)),
17233
+ chalk61.bold("DEPENDS ON")
17006
17234
  ].join(GAP);
17007
17235
  const sepLine = "─".repeat(ID_WIDTH + TYPE_WIDTH + NAME_WIDTH + DEPS_WIDTH + GAP.length * 3);
17008
17236
  const rows = nodes.map((n) => {
@@ -17017,7 +17245,7 @@ function renderNodesList(nodes) {
17017
17245
  }
17018
17246
 
17019
17247
  // src/commands/workflow/commands/list.ts
17020
- import chalk61 from "chalk";
17248
+ import chalk62 from "chalk";
17021
17249
  import { createWorkflowListTool } from "@ai-setting/roy-agent-core/env/workflow/tools";
17022
17250
  var WorkflowListCommand = {
17023
17251
  command: "list",
@@ -17080,7 +17308,7 @@ var WorkflowListCommand = {
17080
17308
  type: "string"
17081
17309
  }),
17082
17310
  async handler(args) {
17083
- const output = new OutputService;
17311
+ const output = new OutputService2;
17084
17312
  const envService = new EnvironmentService(output);
17085
17313
  try {
17086
17314
  await envService.create({ configPath: args.config });
@@ -17155,20 +17383,20 @@ var WorkflowListCommand = {
17155
17383
  if (total > workflows.length) {
17156
17384
  const start = finalOffset + 1;
17157
17385
  const end = finalOffset + workflows.length;
17158
- output.log(chalk61.green(`
17386
+ output.log(chalk62.green(`
17159
17387
  ✅ 显示 ${start}-${end} / 共 ${total} 个 Workflow`));
17160
17388
  const totalPages = Math.ceil(total / pageSize);
17161
17389
  const currentPage = Math.floor(finalOffset / pageSize) + 1;
17162
17390
  if (totalPages > 1) {
17163
- output.log(chalk61.cyan(`\uD83D\uDCC4 第 ${currentPage} / ${totalPages} 页`));
17391
+ output.log(chalk62.cyan(`\uD83D\uDCC4 第 ${currentPage} / ${totalPages} 页`));
17164
17392
  }
17165
17393
  } else {
17166
- output.log(chalk61.green(`
17394
+ output.log(chalk62.green(`
17167
17395
  ✅ 共 ${total} 个 Workflow`));
17168
17396
  }
17169
17397
  if (availableTags.length > 0) {
17170
17398
  const tagsLine = availableTags.map((t) => `${t.name}(${t.count})`).join(", ");
17171
- output.log(chalk61.cyan(`
17399
+ output.log(chalk62.cyan(`
17172
17400
  \uD83C\uDFF7️ Available tags: ${tagsLine}`));
17173
17401
  }
17174
17402
  }
@@ -17771,7 +17999,7 @@ class WorkflowValidator {
17771
17999
  }
17772
18000
 
17773
18001
  // src/commands/workflow/commands/add.ts
17774
- import chalk62 from "chalk";
18002
+ import chalk63 from "chalk";
17775
18003
  import fs3 from "fs";
17776
18004
  import path6 from "path";
17777
18005
  import { createWorkflowExtractorAgent } from "@ai-setting/roy-agent-core/env/task/plugins";
@@ -17864,7 +18092,7 @@ var WorkflowAddCommand = {
17864
18092
  不要用 bash tool + command 输出多行内容(shell 会执行失败)。`),
17865
18093
  async handler(args) {
17866
18094
  const a = args;
17867
- const output = new OutputService;
18095
+ const output = new OutputService2;
17868
18096
  const envService = new EnvironmentService(output);
17869
18097
  try {
17870
18098
  let parseTags = function(input) {
@@ -17914,7 +18142,7 @@ var WorkflowAddCommand = {
17914
18142
  definition = await parseWorkflowContent(content, filePath);
17915
18143
  workflowName = a.name || definition.name || path6.basename(filePath);
17916
18144
  if (a.validate) {
17917
- output.log(chalk62.blue("\uD83D\uDD0D Validating workflow..."));
18145
+ output.log(chalk63.blue("\uD83D\uDD0D Validating workflow..."));
17918
18146
  const validator = new WorkflowValidator;
17919
18147
  const result = validator.validate(definition);
17920
18148
  if (!result.valid) {
@@ -17929,11 +18157,11 @@ var WorkflowAddCommand = {
17929
18157
  });
17930
18158
  process.exit(1);
17931
18159
  }
17932
- output.log(chalk62.green(`✅ Workflow validation passed
18160
+ output.log(chalk63.green(`✅ Workflow validation passed
17933
18161
  `));
17934
18162
  }
17935
18163
  } else if (a.desc) {
17936
- output.log(chalk62.blue(`\uD83E\uDD16 Generating workflow from description...
18164
+ output.log(chalk63.blue(`\uD83E\uDD16 Generating workflow from description...
17937
18165
  `));
17938
18166
  const agentComponent = env.getComponent("agent");
17939
18167
  if (!agentComponent) {
@@ -17941,10 +18169,10 @@ var WorkflowAddCommand = {
17941
18169
  process.exit(1);
17942
18170
  }
17943
18171
  if (!agentComponent.getAgent("workflow-extractor")) {
17944
- output.log(chalk62.gray("Auto-registering workflow-extractor agent..."));
18172
+ output.log(chalk63.gray("Auto-registering workflow-extractor agent..."));
17945
18173
  const extractorConfig = createWorkflowExtractorAgent();
17946
18174
  agentComponent.registerAgent(extractorConfig.name, extractorConfig);
17947
- output.log(chalk62.green(`✅ workflow-extractor agent registered
18175
+ output.log(chalk63.green(`✅ workflow-extractor agent registered
17948
18176
  `));
17949
18177
  }
17950
18178
  const prompt = `## 任务
@@ -17958,20 +18186,20 @@ ${a.desc}
17958
18186
  1. 先用 \`roy-agent workflow nodes\` 查看可用的节点类型
17959
18187
  2. 生成的 YAML 必须通过 \`roy-agent workflow validate --yaml "<yaml>"\` 验证
17960
18188
  3. 验证通过后才输出最终 YAML`;
17961
- output.log(chalk62.gray("Running workflow-extractor agent..."));
18189
+ output.log(chalk63.gray("Running workflow-extractor agent..."));
17962
18190
  const result = await agentComponent.run("workflow-extractor", prompt);
17963
18191
  const agentOutput = result.finalText || "";
17964
18192
  definition = parseYamlFromAgentOutput(agentOutput);
17965
18193
  if (definition === null) {
17966
18194
  output.error("Failed to parse workflow from agent output");
17967
- output.log(chalk62.gray(`
18195
+ output.log(chalk63.gray(`
17968
18196
  Agent output:
17969
18197
  ` + agentOutput.slice(0, 500)));
17970
18198
  process.exit(1);
17971
18199
  }
17972
18200
  workflowName = a.name || definition.name;
17973
18201
  if (a.validate) {
17974
- output.log(chalk62.blue(`
18202
+ output.log(chalk63.blue(`
17975
18203
  \uD83D\uDD0D Validating generated workflow...`));
17976
18204
  const validator = new WorkflowValidator;
17977
18205
  const result2 = validator.validate(definition);
@@ -17985,16 +18213,16 @@ Agent output:
17985
18213
  output.error(` Fix: ${error.fix}
17986
18214
  `);
17987
18215
  });
17988
- output.log(chalk62.yellow("请修正描述后重新尝试,或使用 --file 选项直接提供 YAML"));
18216
+ output.log(chalk63.yellow("请修正描述后重新尝试,或使用 --file 选项直接提供 YAML"));
17989
18217
  process.exit(1);
17990
18218
  }
17991
- output.log(chalk62.green(`✅ Generated workflow validation passed
18219
+ output.log(chalk63.green(`✅ Generated workflow validation passed
17992
18220
  `));
17993
18221
  }
17994
18222
  const yaml = await Promise.resolve().then(() => __toESM(require_dist(), 1));
17995
- output.log(chalk62.gray("--- Generated YAML ---"));
18223
+ output.log(chalk63.gray("--- Generated YAML ---"));
17996
18224
  output.log(yaml.stringify(definition));
17997
- output.log(chalk62.gray(`------------------------
18225
+ output.log(chalk63.gray(`------------------------
17998
18226
  `));
17999
18227
  } else {
18000
18228
  output.error("Please provide --file or --desc option");
@@ -18020,10 +18248,10 @@ Agent output:
18020
18248
  force: a.force
18021
18249
  });
18022
18250
  output.log(renderWorkflowAdded(workflow));
18023
- output.log(chalk62.bold(`
18251
+ output.log(chalk63.bold(`
18024
18252
  \uD83D\uDCCA Nodes Summary:`));
18025
18253
  output.log(renderNodesList(definition.nodes));
18026
- output.log(chalk62.green(`
18254
+ output.log(chalk63.green(`
18027
18255
  ✅ Workflow '${workflowName}' added successfully`));
18028
18256
  } catch (error) {
18029
18257
  if (error.message?.includes("already exists") && !a.force) {
@@ -18040,7 +18268,7 @@ Agent output:
18040
18268
  };
18041
18269
 
18042
18270
  // src/commands/workflow/commands/get.ts
18043
- import chalk63 from "chalk";
18271
+ import chalk64 from "chalk";
18044
18272
  import { createWorkflowGetTool } from "@ai-setting/roy-agent-core/env/workflow/tools";
18045
18273
  var WorkflowGetCommand = {
18046
18274
  command: "get <identifier>",
@@ -18076,7 +18304,7 @@ var WorkflowGetCommand = {
18076
18304
  type: "string"
18077
18305
  }),
18078
18306
  async handler(args) {
18079
- const output = new OutputService;
18307
+ const output = new OutputService2;
18080
18308
  const envService = new EnvironmentService(output);
18081
18309
  try {
18082
18310
  await envService.create({ configPath: args.config });
@@ -18178,15 +18406,15 @@ var WorkflowGetCommand = {
18178
18406
  } else {
18179
18407
  output.log(renderWorkflowDetail(workflow, { includeRuns: runs }));
18180
18408
  if (args.includeNodes) {
18181
- output.log(chalk63.bold(`
18409
+ output.log(chalk64.bold(`
18182
18410
  \uD83D\uDCCB All Nodes:`));
18183
18411
  output.log(renderNodesList(data.nodes || []));
18184
18412
  }
18185
18413
  const yaml = await Promise.resolve().then(() => __toESM(require_dist(), 1));
18186
18414
  const defYaml = yaml.stringify(data.definition || {}, { indent: 2 });
18187
- output.log(chalk63.bold(`
18415
+ output.log(chalk64.bold(`
18188
18416
  \uD83D\uDCC4 Definition (YAML):`));
18189
- output.log(chalk63.gray(defYaml));
18417
+ output.log(chalk64.gray(defYaml));
18190
18418
  }
18191
18419
  }
18192
18420
  } catch (error) {
@@ -18199,7 +18427,7 @@ var WorkflowGetCommand = {
18199
18427
  };
18200
18428
 
18201
18429
  // src/commands/workflow/commands/update.ts
18202
- import chalk64 from "chalk";
18430
+ import chalk65 from "chalk";
18203
18431
  import fs4 from "fs";
18204
18432
  import path7 from "path";
18205
18433
  import { parseWorkflowFile } from "@ai-setting/roy-agent-core/env/workflow/types";
@@ -18232,7 +18460,7 @@ var WorkflowUpdateCommand = {
18232
18460
  }),
18233
18461
  async handler(args) {
18234
18462
  const a = args;
18235
- const output = new OutputService;
18463
+ const output = new OutputService2;
18236
18464
  const envService = new EnvironmentService(output);
18237
18465
  try {
18238
18466
  await envService.create({ configPath: a.config });
@@ -18272,7 +18500,7 @@ var WorkflowUpdateCommand = {
18272
18500
  const tags = a.tags ? a.tags.split(",").map((t) => t.trim()) : undefined;
18273
18501
  const workflow = await service.updateWorkflow(a.name, updates, { tags });
18274
18502
  output.log(renderWorkflowUpdated(workflow));
18275
- output.log(chalk64.green(`
18503
+ output.log(chalk65.green(`
18276
18504
  ✅ Workflow '${a.name}' updated successfully`));
18277
18505
  } catch (error) {
18278
18506
  output.error(`Failed to update workflow: ${error}`);
@@ -18284,7 +18512,7 @@ var WorkflowUpdateCommand = {
18284
18512
  };
18285
18513
 
18286
18514
  // src/commands/workflow/commands/remove.ts
18287
- import chalk65 from "chalk";
18515
+ import chalk66 from "chalk";
18288
18516
  var WorkflowRemoveCommand = {
18289
18517
  command: "remove <name>",
18290
18518
  describe: "删除 Workflow",
@@ -18302,7 +18530,7 @@ var WorkflowRemoveCommand = {
18302
18530
  type: "string"
18303
18531
  }),
18304
18532
  async handler(args) {
18305
- const output = new OutputService;
18533
+ const output = new OutputService2;
18306
18534
  const envService = new EnvironmentService(output);
18307
18535
  try {
18308
18536
  await envService.create({ configPath: args.config });
@@ -18323,8 +18551,8 @@ var WorkflowRemoveCommand = {
18323
18551
  process.exit(1);
18324
18552
  }
18325
18553
  if (!args.force) {
18326
- output.log(chalk65.yellow(`Are you sure you want to delete workflow '${args.name}'?`));
18327
- output.log(chalk65.gray("Use --force to skip confirmation"));
18554
+ output.log(chalk66.yellow(`Are you sure you want to delete workflow '${args.name}'?`));
18555
+ output.log(chalk66.gray("Use --force to skip confirmation"));
18328
18556
  process.exit(1);
18329
18557
  }
18330
18558
  const deleted = await service.deleteWorkflow(args.name);
@@ -18344,13 +18572,13 @@ var WorkflowRemoveCommand = {
18344
18572
 
18345
18573
  // src/commands/workflow/commands/run.ts
18346
18574
  var import_yaml = __toESM(require_dist(), 1);
18347
- import chalk66 from "chalk";
18575
+ import chalk67 from "chalk";
18348
18576
  import fs5 from "fs";
18349
18577
  import path8 from "path";
18350
18578
  import { createRunWorkflowTool } from "@ai-setting/roy-agent-core/env/workflow/tools";
18351
18579
  import { getTracerProvider as getTracerProvider4, propagation, wrapFunction } from "@ai-setting/roy-agent-core";
18352
18580
  var runWorkflow = wrapFunction(async function runWorkflowImpl(args) {
18353
- const output = new OutputService;
18581
+ const output = new OutputService2;
18354
18582
  const envService = new EnvironmentService(output);
18355
18583
  const traceparent = process.env.TRACEPARENT;
18356
18584
  let traceId;
@@ -18418,7 +18646,7 @@ var runWorkflow = wrapFunction(async function runWorkflowImpl(args) {
18418
18646
  };
18419
18647
  if (args.sessionId) {
18420
18648
  const sessionId = args.sessionId.startsWith("workflow_") ? args.sessionId : `workflow_${args.sessionId}`;
18421
- output.log(chalk66.blue(`\uD83D\uDD04 Resuming workflow from session: ${sessionId}`));
18649
+ output.log(chalk67.blue(`\uD83D\uDD04 Resuming workflow from session: ${sessionId}`));
18422
18650
  const sessionComponent = workflowComponent.sessionComponent;
18423
18651
  if (!sessionComponent) {
18424
18652
  output.error("SessionComponent not available");
@@ -18480,17 +18708,17 @@ var runWorkflow = wrapFunction(async function runWorkflowImpl(args) {
18480
18708
  definition = { ...definition, name: args.name };
18481
18709
  }
18482
18710
  const workflow = await service.createWorkflow(definition, { force: true });
18483
- output.log(chalk66.blue(`\uD83D\uDCDD Registering workflow: ${registrationName}`));
18484
- output.log(chalk66.green(`✅ Workflow registered: ${workflow.name} (${workflow.id})`));
18711
+ output.log(chalk67.blue(`\uD83D\uDCDD Registering workflow: ${registrationName}`));
18712
+ output.log(chalk67.green(`✅ Workflow registered: ${workflow.name} (${workflow.id})`));
18485
18713
  if (args.registerOnly) {
18486
- output.log(chalk66.gray("ℹ️ Use --register-only, skipping execution"));
18714
+ output.log(chalk67.gray("ℹ️ Use --register-only, skipping execution"));
18487
18715
  if (workflowSpan) {
18488
18716
  workflowSpan.end();
18489
18717
  }
18490
18718
  await envService.dispose();
18491
18719
  process.exit(0);
18492
18720
  }
18493
- output.log(chalk66.blue(`\uD83D\uDE80 Running workflow: ${workflow.name}`));
18721
+ output.log(chalk67.blue(`\uD83D\uDE80 Running workflow: ${workflow.name}`));
18494
18722
  const result = await service.runWorkflow(definition, input, runOptions);
18495
18723
  output.log(renderRunResult({
18496
18724
  runId: result.runId,
@@ -18500,7 +18728,7 @@ var runWorkflow = wrapFunction(async function runWorkflowImpl(args) {
18500
18728
  durationMs: result.durationMs
18501
18729
  }));
18502
18730
  if (result.status === "paused") {
18503
- output.log(chalk66.gray(`
18731
+ output.log(chalk67.gray(`
18504
18732
  \uD83D\uDCA1 Use "roy-agent workflow run ${result.runId} --session-id ${result.runId} --input '<response>'" to resume`));
18505
18733
  }
18506
18734
  } else {
@@ -18523,7 +18751,7 @@ var runWorkflow = wrapFunction(async function runWorkflowImpl(args) {
18523
18751
  durationMs: runData.duration_ms
18524
18752
  }));
18525
18753
  if (runData.status === "paused") {
18526
- output.log(chalk66.gray(`
18754
+ output.log(chalk67.gray(`
18527
18755
  \uD83D\uDCA1 Use "roy-agent workflow run ${runData.run_id} --session-id ${runData.run_id} --input '<response>'" to resume`));
18528
18756
  }
18529
18757
  }
@@ -18595,11 +18823,11 @@ var WorkflowRunCommand = {
18595
18823
  };
18596
18824
 
18597
18825
  // src/commands/workflow/commands/stop.ts
18598
- import chalk67 from "chalk";
18826
+ import chalk68 from "chalk";
18599
18827
  import { createWorkflowRunStopTool } from "@ai-setting/roy-agent-core/env/workflow/tools";
18600
18828
  import { wrapFunction as wrapFunction2 } from "@ai-setting/roy-agent-core";
18601
18829
  var stopWorkflow = wrapFunction2(async function stopWorkflowImpl(args) {
18602
- const output = new OutputService;
18830
+ const output = new OutputService2;
18603
18831
  const envService = new EnvironmentService(output);
18604
18832
  try {
18605
18833
  await envService.create({ configPath: args.config });
@@ -18620,7 +18848,7 @@ var stopWorkflow = wrapFunction2(async function stopWorkflowImpl(args) {
18620
18848
  output.error(result.error || `Failed to stop workflow: ${args.runId}`);
18621
18849
  process.exit(1);
18622
18850
  }
18623
- output.log(chalk67.red(`
18851
+ output.log(chalk68.red(`
18624
18852
  ⏹️ Workflow stopped: ${args.runId}`));
18625
18853
  } catch (error) {
18626
18854
  output.error(`Failed to stop workflow: ${error}`);
@@ -18644,7 +18872,7 @@ var WorkflowStopCommand = {
18644
18872
  };
18645
18873
 
18646
18874
  // src/commands/workflow/commands/status.ts
18647
- import chalk68 from "chalk";
18875
+ import chalk69 from "chalk";
18648
18876
  import { createWorkflowRunStatusTool } from "@ai-setting/roy-agent-core/env/workflow/tools";
18649
18877
  var WorkflowStatusCommand = {
18650
18878
  command: "status <runId>",
@@ -18668,7 +18896,7 @@ var WorkflowStatusCommand = {
18668
18896
  type: "string"
18669
18897
  }),
18670
18898
  async handler(args) {
18671
- const output = new OutputService;
18899
+ const output = new OutputService2;
18672
18900
  const envService = new EnvironmentService(output);
18673
18901
  try {
18674
18902
  await envService.create({ configPath: args.config });
@@ -18737,7 +18965,7 @@ var WorkflowStatusCommand = {
18737
18965
  stopped: "⏹️"
18738
18966
  };
18739
18967
  const emoji = statusEmoji[status] || "❓";
18740
- output.log(chalk68.bold(`
18968
+ output.log(chalk69.bold(`
18741
18969
  ${emoji} Status: ${status.toUpperCase()}`));
18742
18970
  }
18743
18971
  } catch (error) {
@@ -18750,7 +18978,7 @@ ${emoji} Status: ${status.toUpperCase()}`));
18750
18978
  };
18751
18979
 
18752
18980
  // src/commands/workflow/commands/nodes.ts
18753
- import chalk69 from "chalk";
18981
+ import chalk70 from "chalk";
18754
18982
  var BUILT_IN_NODES = [
18755
18983
  {
18756
18984
  name: "ToolNode",
@@ -19087,7 +19315,7 @@ nodes:
19087
19315
  ];
19088
19316
  function renderNodeTypesTable(nodes) {
19089
19317
  const lines = [];
19090
- lines.push(chalk69.bold(`
19318
+ lines.push(chalk70.bold(`
19091
19319
  \uD83D\uDCE6 Built-in Node Types
19092
19320
  `));
19093
19321
  lines.push("┌────────────┬────────────────────┬─────────────────────────────────────────────────────────────┐");
@@ -19105,29 +19333,29 @@ function renderNodeTypesTable(nodes) {
19105
19333
  }
19106
19334
  function renderNodeDetail(node) {
19107
19335
  const lines = [];
19108
- lines.push(chalk69.bold(`
19336
+ lines.push(chalk70.bold(`
19109
19337
  [${node.type}] ${node.name}`));
19110
- lines.push(chalk69.dim("─".repeat(60)) + `
19338
+ lines.push(chalk70.dim("─".repeat(60)) + `
19111
19339
  `);
19112
- lines.push(chalk69.bold("Description:"));
19340
+ lines.push(chalk70.bold("Description:"));
19113
19341
  lines.push(` ${node.description}
19114
19342
  `);
19115
- lines.push(chalk69.bold("Configuration:"));
19343
+ lines.push(chalk70.bold("Configuration:"));
19116
19344
  lines.push(' type: "' + node.type + '"');
19117
19345
  lines.push(" config:");
19118
19346
  for (const input of node.inputs) {
19119
- const required = input.required ? chalk69.red("*") : " ";
19347
+ const required = input.required ? chalk70.red("*") : " ";
19120
19348
  lines.push(` ${input.name} (${input.type})${required}`);
19121
19349
  lines.push(` ${input.description}`);
19122
19350
  }
19123
19351
  lines.push(`
19124
- ${chalk69.bold("Output:")} ${node.output}`);
19352
+ ${chalk70.bold("Output:")} ${node.output}`);
19125
19353
  if (node.example) {
19126
- lines.push(chalk69.bold(`
19354
+ lines.push(chalk70.bold(`
19127
19355
  Example:`));
19128
- lines.push(chalk69.gray("```yaml"));
19356
+ lines.push(chalk70.gray("```yaml"));
19129
19357
  lines.push(node.example);
19130
- lines.push(chalk69.gray("```"));
19358
+ lines.push(chalk70.gray("```"));
19131
19359
  }
19132
19360
  return lines.join(`
19133
19361
  `);
@@ -19143,16 +19371,16 @@ var WorkflowNodesCommand = {
19143
19371
  const nodeType = args.type?.toLowerCase();
19144
19372
  if (!nodeType) {
19145
19373
  console.log(renderNodeTypesTable(BUILT_IN_NODES));
19146
- console.log(chalk69.gray(`
19147
- Use `) + chalk69.cyan("roy-agent workflow nodes <type>") + chalk69.gray(" for detailed information"));
19148
- console.log(chalk69.gray("Available types: ") + chalk69.yellow(BUILT_IN_NODES.map((n) => n.type).join(", ")));
19374
+ console.log(chalk70.gray(`
19375
+ Use `) + chalk70.cyan("roy-agent workflow nodes <type>") + chalk70.gray(" for detailed information"));
19376
+ console.log(chalk70.gray("Available types: ") + chalk70.yellow(BUILT_IN_NODES.map((n) => n.type).join(", ")));
19149
19377
  return;
19150
19378
  }
19151
19379
  const node = BUILT_IN_NODES.find((n) => n.type === nodeType);
19152
19380
  if (!node) {
19153
- console.log(chalk69.red(`
19381
+ console.log(chalk70.red(`
19154
19382
  ❌ Unknown node type: ${nodeType}`));
19155
- console.log(chalk69.gray("Available types: ") + chalk69.yellow(BUILT_IN_NODES.map((n) => n.type).join(", ")));
19383
+ console.log(chalk70.gray("Available types: ") + chalk70.yellow(BUILT_IN_NODES.map((n) => n.type).join(", ")));
19156
19384
  process.exit(1);
19157
19385
  }
19158
19386
  console.log(renderNodeDetail(node));
@@ -19160,7 +19388,7 @@ Use `) + chalk69.cyan("roy-agent workflow nodes <type>") + chalk69.gray(" for de
19160
19388
  };
19161
19389
 
19162
19390
  // src/commands/workflow/commands/validate.ts
19163
- import chalk70 from "chalk";
19391
+ import chalk71 from "chalk";
19164
19392
  import { readFileSync } from "fs";
19165
19393
  async function parseWorkflowInput(input, yamlStr) {
19166
19394
  const parseYaml = async (content) => {
@@ -19193,25 +19421,25 @@ function renderResult(result, options) {
19193
19421
  return;
19194
19422
  }
19195
19423
  if (result.valid) {
19196
- console.log(chalk70.green(`
19424
+ console.log(chalk71.green(`
19197
19425
  ✅ Workflow validation PASSED
19198
19426
  `));
19199
- console.log(chalk70.bold(`Workflow: ${result.workflowName}`));
19427
+ console.log(chalk71.bold(`Workflow: ${result.workflowName}`));
19200
19428
  console.log(`Nodes: ${result.nodeCount}`);
19201
19429
  console.log(`
19202
19430
  Valid nodes:`);
19203
- console.log(chalk70.green(" ✓ All nodes passed validation"));
19431
+ console.log(chalk71.green(" ✓ All nodes passed validation"));
19204
19432
  } else {
19205
- console.log(chalk70.red(`
19433
+ console.log(chalk71.red(`
19206
19434
  ❌ Workflow validation FAILED (${result.errors.length} errors found)
19207
19435
  `));
19208
19436
  result.errors.forEach((error, index) => {
19209
- console.log(chalk70.red(`[Error ${index + 1}/${result.errors.length}]${error.nodeId ? ` Node "${error.nodeId}"` : ""}`));
19210
- console.log(` ${chalk70.bold("Type:")} ${error.type}`);
19211
- console.log(` ${chalk70.bold("Description:")} ${error.description}`);
19212
- console.log(` ${chalk70.bold("Expected:")} ${error.expected}`);
19213
- console.log(` ${chalk70.bold("Actual:")} ${error.actual}`);
19214
- console.log(` ${chalk70.green("Fix:")} ${error.fix}`);
19437
+ console.log(chalk71.red(`[Error ${index + 1}/${result.errors.length}]${error.nodeId ? ` Node "${error.nodeId}"` : ""}`));
19438
+ console.log(` ${chalk71.bold("Type:")} ${error.type}`);
19439
+ console.log(` ${chalk71.bold("Description:")} ${error.description}`);
19440
+ console.log(` ${chalk71.bold("Expected:")} ${error.expected}`);
19441
+ console.log(` ${chalk71.bold("Actual:")} ${error.actual}`);
19442
+ console.log(` ${chalk71.green("Fix:")} ${error.fix}`);
19215
19443
  console.log();
19216
19444
  });
19217
19445
  }
@@ -19236,7 +19464,7 @@ var WorkflowValidateCommand = {
19236
19464
  try {
19237
19465
  const workflow = await parseWorkflowInput(options.input, options.yaml);
19238
19466
  if (!workflow) {
19239
- console.error(chalk70.red("Failed to parse workflow input"));
19467
+ console.error(chalk71.red("Failed to parse workflow input"));
19240
19468
  process.exit(1);
19241
19469
  }
19242
19470
  const validator = new WorkflowValidator;
@@ -19244,7 +19472,7 @@ var WorkflowValidateCommand = {
19244
19472
  renderResult(result, options);
19245
19473
  process.exit(result.valid ? 0 : 1);
19246
19474
  } catch (error) {
19247
- console.error(chalk70.red(`
19475
+ console.error(chalk71.red(`
19248
19476
  Error: ${error.message}`));
19249
19477
  process.exit(1);
19250
19478
  }
@@ -19252,7 +19480,7 @@ Error: ${error.message}`));
19252
19480
  };
19253
19481
 
19254
19482
  // src/commands/workflow/commands/search.ts
19255
- import chalk71 from "chalk";
19483
+ import chalk72 from "chalk";
19256
19484
  import { wrapFunction as wrapFunction3 } from "@ai-setting/roy-agent-core";
19257
19485
  var WorkflowSearchCommand = {
19258
19486
  command: "search",
@@ -19312,7 +19540,7 @@ var WorkflowSearchCommand = {
19312
19540
  }),
19313
19541
  async handler(args) {
19314
19542
  const a = args;
19315
- const output = new OutputService;
19543
+ const output = new OutputService2;
19316
19544
  const envService = new EnvironmentService(output);
19317
19545
  try {
19318
19546
  await runWorkflowSearch({
@@ -19409,22 +19637,22 @@ var _runWorkflowSearchImpl = async function(opts) {
19409
19637
  metadata: {}
19410
19638
  }));
19411
19639
  if (renderWorkflows.length === 0) {
19412
- output.log(chalk71.yellow("\uD83D\uDD0D No workflows matched the search criteria."));
19413
- output.log(chalk71.gray(` keyword: ${keyword || "(none)"}`));
19414
- output.log(chalk71.gray(` tags: ${tags && tags.length > 0 ? tags.join(", ") : "(none)"}`));
19640
+ output.log(chalk72.yellow("\uD83D\uDD0D No workflows matched the search criteria."));
19641
+ output.log(chalk72.gray(` keyword: ${keyword || "(none)"}`));
19642
+ output.log(chalk72.gray(` tags: ${tags && tags.length > 0 ? tags.join(", ") : "(none)"}`));
19415
19643
  } else {
19416
- output.log(chalk71.bold(`\uD83D\uDD0D Search results (${renderWorkflows.length}):`));
19644
+ output.log(chalk72.bold(`\uD83D\uDD0D Search results (${renderWorkflows.length}):`));
19417
19645
  output.log(renderWorkflowList(renderWorkflows));
19418
- output.log(chalk71.green(`
19646
+ output.log(chalk72.green(`
19419
19647
  ✅ Found ${renderWorkflows.length} workflow(s)`));
19420
19648
  }
19421
19649
  if (availableTags.length > 0) {
19422
19650
  output.log("");
19423
- output.log(chalk71.bold("\uD83D\uDCDA Available tags (sorted by usage_count):"));
19651
+ output.log(chalk72.bold("\uD83D\uDCDA Available tags (sorted by usage_count):"));
19424
19652
  for (const t of availableTags) {
19425
19653
  const name = t.name ?? t.tag;
19426
19654
  const count = t.count ?? t.usage_count;
19427
- output.log(chalk71.gray(` - ${name} (${count})`));
19655
+ output.log(chalk72.gray(` - ${name} (${count})`));
19428
19656
  }
19429
19657
  }
19430
19658
  };
@@ -19436,7 +19664,7 @@ var runWorkflowSearch = wrapFunction3(_runWorkflowSearchImpl, "workflow.cli.sear
19436
19664
 
19437
19665
  // src/commands/workflow/commands/tag.ts
19438
19666
  import { wrapFunction as wrapFunction4 } from "@ai-setting/roy-agent-core";
19439
- import chalk72 from "chalk";
19667
+ import chalk73 from "chalk";
19440
19668
  var WorkflowTagListCommand = {
19441
19669
  command: "list",
19442
19670
  describe: "List all workflow tags from the workflow_tags table (sorted by usage_count DESC by default). Use this BEFORE `workflow add` to discover existing tags and reuse them for semantic consistency.",
@@ -19463,7 +19691,7 @@ var WorkflowTagListCommand = {
19463
19691
  }),
19464
19692
  async handler(args) {
19465
19693
  const a = args;
19466
- const output = new OutputService;
19694
+ const output = new OutputService2;
19467
19695
  const envService = new EnvironmentService(output);
19468
19696
  try {
19469
19697
  await runWorkflowTagList({
@@ -19508,7 +19736,7 @@ var WorkflowTagGetCommand = {
19508
19736
  }),
19509
19737
  async handler(args) {
19510
19738
  const a = args;
19511
- const output = new OutputService;
19739
+ const output = new OutputService2;
19512
19740
  const envService = new EnvironmentService(output);
19513
19741
  try {
19514
19742
  await runWorkflowTagGet({
@@ -19557,17 +19785,17 @@ var _runWorkflowTagListImpl = async function(opts) {
19557
19785
  return;
19558
19786
  }
19559
19787
  if (result.tags.length === 0) {
19560
- output.log(chalk72.yellow("\uD83C\uDFF7️ No tags in the workflow_tags table yet."));
19561
- output.log(chalk72.gray(" Tags are created automatically when you run `workflow add --tags <name>`."));
19788
+ output.log(chalk73.yellow("\uD83C\uDFF7️ No tags in the workflow_tags table yet."));
19789
+ output.log(chalk73.gray(" Tags are created automatically when you run `workflow add --tags <name>`."));
19562
19790
  return;
19563
19791
  }
19564
- output.log(chalk72.bold(`\uD83C\uDFF7️ Workflow tags (${result.total}):`));
19565
- output.log(chalk72.gray(` ${padRight("NAME", 24)}${padRight("USAGE", 8)}${padRight("CREATED", 22)}`));
19792
+ output.log(chalk73.bold(`\uD83C\uDFF7️ Workflow tags (${result.total}):`));
19793
+ output.log(chalk73.gray(` ${padRight("NAME", 24)}${padRight("USAGE", 8)}${padRight("CREATED", 22)}`));
19566
19794
  for (const t of result.tags) {
19567
19795
  const line = ` ${padRight(t.name, 24)}${padRight(String(t.usage_count), 8)}${padRight(formatDate2(t.created_at), 22)}`;
19568
19796
  output.log(line);
19569
19797
  }
19570
- output.log(chalk72.gray(`
19798
+ output.log(chalk73.gray(`
19571
19799
  \uD83D\uDCA1 Tip: when adding a new workflow, prefer tags from this list to ensure semantic consistency.`));
19572
19800
  };
19573
19801
  var _runWorkflowTagGetImpl = async function(opts) {
@@ -19594,7 +19822,7 @@ var _runWorkflowTagGetImpl = async function(opts) {
19594
19822
  output.json({ error: "Tag not found", name: opts.name });
19595
19823
  } else {
19596
19824
  output.error(`Tag "${opts.name}" not found in the workflow_tags table.`);
19597
- output.log(chalk72.gray(`Tip: run \`roy-agent workflow tag list\` to see available tags.`));
19825
+ output.log(chalk73.gray(`Tip: run \`roy-agent workflow tag list\` to see available tags.`));
19598
19826
  }
19599
19827
  process.exitCode = 1;
19600
19828
  return;
@@ -19603,10 +19831,10 @@ var _runWorkflowTagGetImpl = async function(opts) {
19603
19831
  output.json(tag);
19604
19832
  return;
19605
19833
  }
19606
- output.log(chalk72.bold(`\uD83C\uDFF7️ Tag: ${tag.name}`));
19607
- output.log(chalk72.gray(` usage_count: ${tag.usage_count}`));
19608
- output.log(chalk72.gray(` created_at: ${tag.created_at}`));
19609
- output.log(chalk72.gray(` updated_at: ${tag.updated_at}`));
19834
+ output.log(chalk73.bold(`\uD83C\uDFF7️ Tag: ${tag.name}`));
19835
+ output.log(chalk73.gray(` usage_count: ${tag.usage_count}`));
19836
+ output.log(chalk73.gray(` created_at: ${tag.created_at}`));
19837
+ output.log(chalk73.gray(` updated_at: ${tag.updated_at}`));
19610
19838
  };
19611
19839
  async function callListTags(service, options) {
19612
19840
  if (typeof service.listTags !== "function") {
@@ -20330,7 +20558,7 @@ export {
20330
20558
  SpanCommand,
20331
20559
  SkillsCommand,
20332
20560
  SessionsCommand,
20333
- OutputService,
20561
+ OutputService2 as OutputService,
20334
20562
  MemoryCommand,
20335
20563
  McpCommand,
20336
20564
  LspListCommand,
@@ -20339,6 +20567,7 @@ export {
20339
20567
  LspCheckCommand,
20340
20568
  LogCommand,
20341
20569
  InteractiveCommand,
20570
+ EventSourceUpdateCommand,
20342
20571
  EventSourceStopCommand,
20343
20572
  EventSourceStatusCommand,
20344
20573
  EventSourceStartCommand,