@ai-setting/roy-agent-core 1.7.56 → 1.7.58

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.
Files changed (108) hide show
  1. package/dist/config/index.js +8 -8
  2. package/dist/env/agent/agent-component.d.ts +11 -0
  3. package/dist/env/agent/index.js +14 -14
  4. package/dist/env/commands/index.js +8 -8
  5. package/dist/env/context/index.js +4 -4
  6. package/dist/env/debug/index.js +8 -8
  7. package/dist/env/error-reply.d.ts +4 -3
  8. package/dist/env/event-source/event-source-handlers.d.ts +28 -0
  9. package/dist/env/event-source/index.js +18 -17
  10. package/dist/env/hook/index.js +6 -6
  11. package/dist/env/index.js +44 -43
  12. package/dist/env/llm/index.js +9 -9
  13. package/dist/env/log-trace/index.js +8 -8
  14. package/dist/env/log-trace/opentelemetry/tracer-provider.d.ts +86 -1
  15. package/dist/env/mcp/index.js +9 -9
  16. package/dist/env/mcp/tool/index.js +2 -2
  17. package/dist/env/memory/index.js +9 -9
  18. package/dist/env/memory/plugin/index.js +2 -2
  19. package/dist/env/plugin/index.js +11 -9
  20. package/dist/env/plugin/lark-cli-notification-channel.d.ts +11 -2
  21. package/dist/env/prompt/index.js +8 -8
  22. package/dist/env/session/index.js +11 -11
  23. package/dist/env/session/storage/index.js +5 -5
  24. package/dist/env/skill/index.js +8 -8
  25. package/dist/env/task/delegate/delegate-tool.d.ts +26 -0
  26. package/dist/env/task/delegate/index.js +9 -9
  27. package/dist/env/task/index.js +18 -17
  28. package/dist/env/task/plugins/index.js +11 -10
  29. package/dist/env/task/plugins/lark-card-patch-notifier.d.ts +109 -2
  30. package/dist/env/task/plugins/lark-card-state-store.d.ts +137 -0
  31. package/dist/env/task/plugins/lark-cli-task-notify-plugin.d.ts +154 -2
  32. package/dist/env/task/storage/index.js +4 -3
  33. package/dist/env/task/tools/index.js +4 -4
  34. package/dist/env/tool/built-in/index.js +4 -4
  35. package/dist/env/tool/index.js +11 -11
  36. package/dist/env/workflow/engine/index.js +13 -13
  37. package/dist/env/workflow/hooks/index.js +8 -8
  38. package/dist/env/workflow/index.js +23 -23
  39. package/dist/env/workflow/nodes/index.js +3 -3
  40. package/dist/env/workflow/plugins/index.js +9 -9
  41. package/dist/env/workflow/service/index.js +3 -3
  42. package/dist/env/workflow/storage/index.js +4 -4
  43. package/dist/env/workflow/tools/index.js +15 -15
  44. package/dist/env/workflow/utils/index.js +5 -5
  45. package/dist/index.js +58 -57
  46. package/dist/shared/@ai-setting/{roy-agent-core-0b3fdnn3.js → roy-agent-core-029r8kdw.js} +4 -4
  47. package/dist/shared/@ai-setting/{roy-agent-core-nra8vfrs.js → roy-agent-core-08njdcpj.js} +1 -1
  48. package/dist/shared/@ai-setting/{roy-agent-core-40xzbjtm.js → roy-agent-core-0kn3zt1t.js} +2 -2
  49. package/dist/shared/@ai-setting/{roy-agent-core-nhk0dsxr.js → roy-agent-core-0yn7a78e.js} +14 -14
  50. package/dist/shared/@ai-setting/{roy-agent-core-tbrn9wdm.js → roy-agent-core-14bq77wr.js} +1 -1
  51. package/dist/shared/@ai-setting/{roy-agent-core-qyqnmz8c.js → roy-agent-core-20m8je6e.js} +1 -1
  52. package/dist/shared/@ai-setting/{roy-agent-core-zmeka63k.js → roy-agent-core-2ctyjy62.js} +1 -1
  53. package/dist/shared/@ai-setting/{roy-agent-core-heft3j4c.js → roy-agent-core-2fk8c9ax.js} +3 -3
  54. package/dist/shared/@ai-setting/{roy-agent-core-8cgtwytv.js → roy-agent-core-4096f575.js} +4 -4
  55. package/dist/shared/@ai-setting/{roy-agent-core-yg247mk4.js → roy-agent-core-47s81t6g.js} +2 -2
  56. package/dist/shared/@ai-setting/{roy-agent-core-q7zksbw0.js → roy-agent-core-5f7myqnb.js} +5 -5
  57. package/dist/shared/@ai-setting/{roy-agent-core-vmg30n5x.js → roy-agent-core-6bradb0j.js} +15 -10
  58. package/dist/shared/@ai-setting/{roy-agent-core-zjttt2y4.js → roy-agent-core-7nb23tdd.js} +1 -1
  59. package/dist/shared/@ai-setting/roy-agent-core-7q4wdze2.js +7 -0
  60. package/dist/shared/@ai-setting/{roy-agent-core-d4jpn06f.js → roy-agent-core-84rs0c8d.js} +7 -7
  61. package/dist/shared/@ai-setting/{roy-agent-core-c6at31ra.js → roy-agent-core-84xtww7d.js} +3 -3
  62. package/dist/shared/@ai-setting/{roy-agent-core-202v00x4.js → roy-agent-core-89sxsrc7.js} +1 -1
  63. package/dist/shared/@ai-setting/{roy-agent-core-ezsyyjxw.js → roy-agent-core-8bngppw0.js} +580 -83
  64. package/dist/shared/@ai-setting/{roy-agent-core-b599jgyd.js → roy-agent-core-8p63s836.js} +1 -1
  65. package/dist/shared/@ai-setting/{roy-agent-core-e0wbq0qq.js → roy-agent-core-991pk4ss.js} +11 -11
  66. package/dist/shared/@ai-setting/{roy-agent-core-5rxs0ra3.js → roy-agent-core-9zhkdg6w.js} +2 -2
  67. package/dist/shared/@ai-setting/{roy-agent-core-gn8f4rhs.js → roy-agent-core-baaa4wtp.js} +2 -2
  68. package/dist/shared/@ai-setting/{roy-agent-core-nntphgww.js → roy-agent-core-c36335nw.js} +146 -8
  69. package/dist/shared/@ai-setting/{roy-agent-core-tc7gw38m.js → roy-agent-core-c7w2h47a.js} +3 -3
  70. package/dist/shared/@ai-setting/{roy-agent-core-j5c3chtn.js → roy-agent-core-cyefe8z5.js} +1 -1
  71. package/dist/shared/@ai-setting/{roy-agent-core-n3b7ztms.js → roy-agent-core-d75t8gea.js} +1 -1
  72. package/dist/shared/@ai-setting/{roy-agent-core-yv9x4wmg.js → roy-agent-core-e1w17tht.js} +2 -2
  73. package/dist/shared/@ai-setting/{roy-agent-core-f8sp1txg.js → roy-agent-core-e250355z.js} +3 -3
  74. package/dist/shared/@ai-setting/{roy-agent-core-9nv586rw.js → roy-agent-core-eanq305k.js} +22 -16
  75. package/dist/shared/@ai-setting/{roy-agent-core-6qgq7h1g.js → roy-agent-core-em4hks9t.js} +4 -4
  76. package/dist/shared/@ai-setting/{roy-agent-core-0bmk44ye.js → roy-agent-core-en2xqxs9.js} +5 -5
  77. package/dist/shared/@ai-setting/{roy-agent-core-3kz6934b.js → roy-agent-core-fbjd7bt6.js} +3 -7
  78. package/dist/shared/@ai-setting/{roy-agent-core-98aa9r0x.js → roy-agent-core-fw6k4w1h.js} +6 -6
  79. package/dist/shared/@ai-setting/{roy-agent-core-2044fbsd.js → roy-agent-core-fy4mcj6x.js} +40 -47
  80. package/dist/shared/@ai-setting/{roy-agent-core-ns3pbyz4.js → roy-agent-core-ge87xbas.js} +1 -1
  81. package/dist/shared/@ai-setting/{roy-agent-core-r9qe0ghe.js → roy-agent-core-geh6j7bw.js} +2 -2
  82. package/dist/shared/@ai-setting/{roy-agent-core-wafk25ff.js → roy-agent-core-gksw1gjb.js} +1 -1
  83. package/dist/shared/@ai-setting/{roy-agent-core-3dkzqqsd.js → roy-agent-core-hefarcp0.js} +1 -1
  84. package/dist/shared/@ai-setting/{roy-agent-core-5gw6w424.js → roy-agent-core-hs41gx9w.js} +5 -5
  85. package/dist/shared/@ai-setting/{roy-agent-core-d14h726p.js → roy-agent-core-jjhw9am6.js} +4 -4
  86. package/dist/shared/@ai-setting/{roy-agent-core-5psjwd08.js → roy-agent-core-jjxdmedn.js} +2 -2
  87. package/dist/shared/@ai-setting/{roy-agent-core-bwzy00t2.js → roy-agent-core-kq9pz2a7.js} +4 -4
  88. package/dist/shared/@ai-setting/{roy-agent-core-8t7wny6v.js → roy-agent-core-m68z3pw1.js} +1 -1
  89. package/dist/shared/@ai-setting/{roy-agent-core-16t0zfbk.js → roy-agent-core-m97jn2ra.js} +1 -1
  90. package/dist/shared/@ai-setting/{roy-agent-core-kzg1jwt8.js → roy-agent-core-n0p0hwgd.js} +1 -1
  91. package/dist/shared/@ai-setting/{roy-agent-core-xcq04fq0.js → roy-agent-core-psg6f1v6.js} +6 -6
  92. package/dist/shared/@ai-setting/{roy-agent-core-4zy2v3br.js → roy-agent-core-q4gdfypk.js} +3 -3
  93. package/dist/shared/@ai-setting/{roy-agent-core-m8n0dffe.js → roy-agent-core-rcgvmtms.js} +1 -1
  94. package/dist/shared/@ai-setting/{roy-agent-core-8seq65bp.js → roy-agent-core-rt115qfc.js} +44 -1
  95. package/dist/shared/@ai-setting/{roy-agent-core-jszgaevt.js → roy-agent-core-syyw58p9.js} +2 -2
  96. package/dist/shared/@ai-setting/{roy-agent-core-3mc6vmvj.js → roy-agent-core-t4x089js.js} +1 -1
  97. package/dist/shared/@ai-setting/{roy-agent-core-qjjf4tjb.js → roy-agent-core-t64nmayv.js} +2 -2
  98. package/dist/shared/@ai-setting/{roy-agent-core-833t16n1.js → roy-agent-core-txwptxk1.js} +3 -3
  99. package/dist/shared/@ai-setting/{roy-agent-core-w7hnjhvx.js → roy-agent-core-tze5596n.js} +3 -3
  100. package/dist/shared/@ai-setting/{roy-agent-core-pjxa78mp.js → roy-agent-core-vath15kt.js} +6 -6
  101. package/dist/shared/@ai-setting/{roy-agent-core-e677am8e.js → roy-agent-core-vgdhxbx3.js} +2 -2
  102. package/dist/shared/@ai-setting/{roy-agent-core-pemxr5n4.js → roy-agent-core-vh0qzb24.js} +2 -2
  103. package/dist/shared/@ai-setting/{roy-agent-core-v2188rnk.js → roy-agent-core-w93z6a42.js} +8 -8
  104. package/dist/shared/@ai-setting/{roy-agent-core-97eyghsp.js → roy-agent-core-ygn5tzt1.js} +2 -2
  105. package/dist/shared/@ai-setting/{roy-agent-core-1pnfkspm.js → roy-agent-core-yphwdm9x.js} +2 -2
  106. package/dist/shared/@ai-setting/{roy-agent-core-gngjkw3b.js → roy-agent-core-ytd5eztz.js} +1 -1
  107. package/dist/utils/temp-file-manager/index.js +2 -2
  108. package/package.json +1 -1
@@ -5,7 +5,7 @@ import {
5
5
  init_logger,
6
6
  init_tracer_provider,
7
7
  simplifyFilePath
8
- } from "./roy-agent-core-8seq65bp.js";
8
+ } from "./roy-agent-core-rt115qfc.js";
9
9
  import {
10
10
  __esm
11
11
  } from "./roy-agent-core-fs0mn2jk.js";
@@ -1,10 +1,6 @@
1
1
  import {
2
2
  createQueryBackgroundProcessTool
3
3
  } from "./roy-agent-core-amkqnyzy.js";
4
- import {
5
- SQLiteTaskStore,
6
- getDefaultTaskDbPath
7
- } from "./roy-agent-core-3kz6934b.js";
8
4
  import {
9
5
  batchArchiveTaskTool,
10
6
  batchDeleteTaskTool,
@@ -16,7 +12,7 @@ import {
16
12
  searchTasksTool,
17
13
  treeTasksTool,
18
14
  updateTaskTool
19
- } from "./roy-agent-core-pemxr5n4.js";
15
+ } from "./roy-agent-core-vh0qzb24.js";
20
16
  import {
21
17
  createOperationTool,
22
18
  deleteOperationTool,
@@ -31,7 +27,11 @@ import {
31
27
  BackgroundTaskManager,
32
28
  createDelegateTool,
33
29
  createStopTool
34
- } from "./roy-agent-core-vmg30n5x.js";
30
+ } from "./roy-agent-core-6bradb0j.js";
31
+ import {
32
+ SQLiteTaskStore,
33
+ getDefaultTaskDbPath
34
+ } from "./roy-agent-core-fbjd7bt6.js";
35
35
  import {
36
36
  TaskHookPoints
37
37
  } from "./roy-agent-core-1pg0fepg.js";
@@ -40,23 +40,23 @@ import {
40
40
  } from "./roy-agent-core-7hh0brvs.js";
41
41
  import {
42
42
  BaseComponent
43
- } from "./roy-agent-core-40xzbjtm.js";
43
+ } from "./roy-agent-core-0kn3zt1t.js";
44
44
  import {
45
45
  globalHookManager,
46
46
  init_global_hook_manager
47
- } from "./roy-agent-core-1pnfkspm.js";
47
+ } from "./roy-agent-core-yphwdm9x.js";
48
48
  import {
49
49
  getEnvContextOrEmpty,
50
50
  init_env_context
51
- } from "./roy-agent-core-jszgaevt.js";
51
+ } from "./roy-agent-core-syyw58p9.js";
52
52
  import {
53
53
  TracedAs,
54
54
  init_decorator
55
- } from "./roy-agent-core-b599jgyd.js";
55
+ } from "./roy-agent-core-8p63s836.js";
56
56
  import {
57
57
  createLogger,
58
58
  init_logger
59
- } from "./roy-agent-core-8seq65bp.js";
59
+ } from "./roy-agent-core-rt115qfc.js";
60
60
  import {
61
61
  __legacyDecorateClassTS
62
62
  } from "./roy-agent-core-fs0mn2jk.js";
@@ -4,11 +4,11 @@ import {
4
4
  import {
5
5
  TracedAs,
6
6
  init_decorator
7
- } from "./roy-agent-core-b599jgyd.js";
7
+ } from "./roy-agent-core-8p63s836.js";
8
8
  import {
9
9
  createLogger,
10
10
  init_logger
11
- } from "./roy-agent-core-8seq65bp.js";
11
+ } from "./roy-agent-core-rt115qfc.js";
12
12
  import {
13
13
  __legacyDecorateClassTS
14
14
  } from "./roy-agent-core-fs0mn2jk.js";
@@ -6,11 +6,11 @@ import {
6
6
  } from "./roy-agent-core-7hh0brvs.js";
7
7
  import {
8
8
  BaseComponent
9
- } from "./roy-agent-core-40xzbjtm.js";
9
+ } from "./roy-agent-core-0kn3zt1t.js";
10
10
  import {
11
11
  createLogger,
12
12
  init_logger
13
- } from "./roy-agent-core-8seq65bp.js";
13
+ } from "./roy-agent-core-rt115qfc.js";
14
14
 
15
15
  // src/env/memory/types.ts
16
16
  import { z } from "zod";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  TracedAs,
3
3
  init_decorator
4
- } from "./roy-agent-core-b599jgyd.js";
4
+ } from "./roy-agent-core-8p63s836.js";
5
5
  import {
6
6
  createLogger,
7
7
  init_logger
8
- } from "./roy-agent-core-8seq65bp.js";
8
+ } from "./roy-agent-core-rt115qfc.js";
9
9
  import {
10
10
  __legacyDecorateClassTS
11
11
  } from "./roy-agent-core-fs0mn2jk.js";
@@ -19,13 +19,25 @@ var HEADER_TEMPLATE = {
19
19
  running: "blue",
20
20
  completed: "green",
21
21
  failed: "red",
22
- stopped: "grey"
22
+ stopped: "grey",
23
+ cancelled: "grey",
24
+ deleted: "grey"
23
25
  };
24
26
  var STATUS_PHRASE = {
25
27
  running: "实时同步中",
26
28
  completed: "\uD83C\uDF89 全部完成!",
27
29
  failed: "\uD83D\uDEA8 任务失败",
28
- stopped: "⏹️ 已停止"
30
+ stopped: "⏹️ 已停止",
31
+ cancelled: "\uD83D\uDEAB 已取消",
32
+ deleted: "\uD83D\uDDD1️ 已删除"
33
+ };
34
+ var FINAL_MILESTONE_TITLE = {
35
+ running: "Task 进行中",
36
+ completed: "Task 完成",
37
+ failed: "Task 失败",
38
+ stopped: "Task 已暂停",
39
+ cancelled: "Task 已取消",
40
+ deleted: "Task 已删除"
29
41
  };
30
42
  var SPINNER_EMOJIS = ["⏳", "\uD83D\uDD04", "\uD83D\uDD03", "⌛", "⏰", "\uD83D\uDD01"];
31
43
  var PROGRESS_BAR_CELLS = 20;
@@ -265,9 +277,11 @@ function buildTaskCard(opts) {
265
277
  elements.push({ tag: "markdown", content: renderProcessSteps(processSteps) });
266
278
  elements.push({ tag: "hr" });
267
279
  const effectiveProgress = status === "completed" ? 100 : opts.progress;
280
+ const isTerminalStatus = status !== "running";
281
+ const terminalProgressText = status === "deleted" ? "任务已取消(删除),记录已归档" : status === "cancelled" ? "任务已取消" : status === "stopped" ? "任务已停止(可恢复)" : status === "failed" ? "任务失败" : "任务已完成";
268
282
  elements.push({
269
283
  tag: "markdown",
270
- content: effectiveProgress !== undefined ? `**\uD83D\uDCCA 进度**:${renderProgressBar(effectiveProgress)}` : `**\uD83D\uDCCA 进度**:进行中(第 ${updateCount} 次更新,尚未上报百分比)`
284
+ content: effectiveProgress !== undefined ? `**\uD83D\uDCCA 进度**:${renderProgressBar(effectiveProgress)}` : isTerminalStatus ? `**\uD83D\uDCCA 进度**:${terminalProgressText}` : `**\uD83D\uDCCA 进度**:进行中(第 ${updateCount} 次更新,尚未上报百分比)`
271
285
  });
272
286
  const taskLabel = opts.meta.id !== undefined ? `#${opts.meta.id}` : "任务";
273
287
  return {
@@ -291,13 +305,17 @@ var WORKFLOW_STATUS_LABEL = {
291
305
  running: "\uD83D\uDD04 运行中",
292
306
  completed: "✅ 已完成",
293
307
  failed: "\uD83D\uDEA8 已失败",
294
- stopped: "⏹️ 已停止"
308
+ stopped: "⏹️ 已停止",
309
+ cancelled: "\uD83D\uDEAB 已取消",
310
+ deleted: "\uD83D\uDDD1️ 已删除"
295
311
  };
296
312
  var WORKFLOW_STATUS_PHRASE = {
297
313
  running: "实时同步中",
298
314
  completed: "\uD83C\uDF89 流程跑完!",
299
315
  failed: "\uD83D\uDEA8 流程失败",
300
- stopped: "⏹️ 流程已停止"
316
+ stopped: "⏹️ 流程已停止",
317
+ cancelled: "\uD83D\uDEAB 流程已取消",
318
+ deleted: "\uD83D\uDDD1️ 流程已删除"
301
319
  };
302
320
  function formatDurationMs(ms) {
303
321
  if (ms === undefined || ms === null || Number.isNaN(ms))
@@ -519,6 +537,92 @@ class LarkCardPatchNotifier {
519
537
  });
520
538
  });
521
539
  }
540
+ exportState(messageId) {
541
+ const state = this.states.get(messageId);
542
+ if (!state)
543
+ return;
544
+ return {
545
+ meta: state.meta,
546
+ startedAt: state.startedAt,
547
+ updateCount: state.updateCount,
548
+ spinnerIndex: state.spinnerIndex,
549
+ milestones: state.milestones,
550
+ processSteps: state.processSteps,
551
+ progress: state.progress,
552
+ chatId: state.chatId,
553
+ profile: state.profile
554
+ };
555
+ }
556
+ hydrateState(messageId, snapshot) {
557
+ if (this.states.has(messageId))
558
+ return;
559
+ this.states.set(messageId, {
560
+ chatId: snapshot.chatId ?? "",
561
+ profile: snapshot.profile,
562
+ meta: snapshot.meta ?? { title: "任务" },
563
+ startedAt: snapshot.startedAt ?? new Date().toISOString(),
564
+ updateCount: snapshot.updateCount ?? 0,
565
+ spinnerIndex: snapshot.spinnerIndex ?? 0,
566
+ milestones: snapshot.milestones ?? [],
567
+ processSteps: snapshot.processSteps ?? [],
568
+ progress: snapshot.progress
569
+ });
570
+ }
571
+ async pauseTask(opts) {
572
+ await this.mutexFor(opts.messageId).run(async () => {
573
+ const state = this.states.get(opts.messageId);
574
+ const now = new Date().toISOString();
575
+ const updateCount = (state?.updateCount ?? 0) + 1;
576
+ const spinner = SPINNER_EMOJIS[updateCount % SPINNER_EMOJIS.length];
577
+ const pauseMilestone = {
578
+ title: opts.pausedMilestoneTitle ?? "Task 已暂停",
579
+ timestamp: now,
580
+ description: opts.finalStep
581
+ };
582
+ const card = buildTaskCard({
583
+ status: opts.status,
584
+ meta: mergeTaskMeta(state?.meta, opts.meta),
585
+ progress: opts.progress ?? state?.progress,
586
+ milestones: mergeUnique(state?.milestones ?? [], [pauseMilestone], milestoneKey),
587
+ processSteps: state?.processSteps ?? [],
588
+ updateCount,
589
+ spinner
590
+ });
591
+ await this.runLarkCli(this.buildPatchCardArgs({
592
+ messageId: opts.messageId,
593
+ profile: opts.profile ?? state?.profile,
594
+ card
595
+ }), "patch");
596
+ this.states.set(opts.messageId, {
597
+ chatId: opts.chatId ?? state?.chatId ?? "",
598
+ profile: opts.profile ?? state?.profile,
599
+ meta: mergeTaskMeta(state?.meta, opts.meta),
600
+ startedAt: state?.startedAt ?? now,
601
+ updateCount,
602
+ spinnerIndex: spinnerIndexFor(updateCount),
603
+ milestones: mergeUnique(state?.milestones ?? [], [pauseMilestone], milestoneKey),
604
+ processSteps: state?.processSteps ?? [],
605
+ progress: opts.progress ?? state?.progress
606
+ });
607
+ });
608
+ if (this.options.unpinOnFinish) {
609
+ const state = this.states.get(opts.messageId);
610
+ try {
611
+ await this.runLarkCli(this.buildUnpinArgs({
612
+ messageId: opts.messageId,
613
+ profile: opts.profile ?? state?.profile
614
+ }), "unpin");
615
+ } catch (unpinErr) {
616
+ logger.warn(`Unpin failed (non-fatal) for ${opts.messageId}: ${unpinErr.message}`);
617
+ }
618
+ }
619
+ }
620
+ async pinMessage(messageId, profile) {
621
+ await this.runLarkCli(this.buildPinArgs({ messageId, profile }), "pin");
622
+ }
623
+ async unpinMessage(messageId, profile) {
624
+ await this.runLarkCli(this.buildUnpinArgs({ messageId, profile }), "unpin");
625
+ }
522
626
  async finishTask(opts) {
523
627
  await this.mutexFor(opts.messageId).run(async () => {
524
628
  const state = this.states.get(opts.messageId);
@@ -526,7 +630,7 @@ class LarkCardPatchNotifier {
526
630
  const updateCount = (state?.updateCount ?? 0) + 1;
527
631
  const spinner = SPINNER_EMOJIS[updateCount % SPINNER_EMOJIS.length];
528
632
  const finalMilestone = {
529
- title: opts.status === "completed" ? "Task 完成" : "Task 失败",
633
+ title: FINAL_MILESTONE_TITLE[opts.status] ?? "Task 结束",
530
634
  timestamp: now,
531
635
  description: opts.finalStep
532
636
  };
@@ -881,6 +985,40 @@ __legacyDecorateClassTS([
881
985
  })
882
986
  })
883
987
  ], LarkCardPatchNotifier.prototype, "updateTask", null);
988
+ __legacyDecorateClassTS([
989
+ TracedAs("lark-card.pauseTask", {
990
+ recordParams: true,
991
+ recordResult: false,
992
+ flattenParamFilter: true,
993
+ paramFilter: (args) => ({
994
+ messageId: args[0]?.messageId,
995
+ profile: args[0]?.profile,
996
+ taskId: args[0]?.taskId
997
+ })
998
+ })
999
+ ], LarkCardPatchNotifier.prototype, "pauseTask", null);
1000
+ __legacyDecorateClassTS([
1001
+ TracedAs("lark-card.pinMessage", {
1002
+ recordParams: true,
1003
+ recordResult: false,
1004
+ flattenParamFilter: true,
1005
+ paramFilter: (args) => ({
1006
+ messageId: args[0],
1007
+ profile: args[1]
1008
+ })
1009
+ })
1010
+ ], LarkCardPatchNotifier.prototype, "pinMessage", null);
1011
+ __legacyDecorateClassTS([
1012
+ TracedAs("lark-card.unpinMessage", {
1013
+ recordParams: true,
1014
+ recordResult: false,
1015
+ flattenParamFilter: true,
1016
+ paramFilter: (args) => ({
1017
+ messageId: args[0],
1018
+ profile: args[1]
1019
+ })
1020
+ })
1021
+ ], LarkCardPatchNotifier.prototype, "unpinMessage", null);
884
1022
  __legacyDecorateClassTS([
885
1023
  TracedAs("lark-card.finishTask", {
886
1024
  recordParams: true,
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  SessionMessageConverter
3
- } from "./roy-agent-core-ns3pbyz4.js";
3
+ } from "./roy-agent-core-ge87xbas.js";
4
4
  import {
5
5
  canonicalizeParts
6
- } from "./roy-agent-core-yv9x4wmg.js";
6
+ } from "./roy-agent-core-e1w17tht.js";
7
7
  import {
8
8
  createLogger,
9
9
  init_logger
10
- } from "./roy-agent-core-8seq65bp.js";
10
+ } from "./roy-agent-core-rt115qfc.js";
11
11
  import {
12
12
  __require
13
13
  } from "./roy-agent-core-fs0mn2jk.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createLogger,
3
3
  init_logger
4
- } from "./roy-agent-core-8seq65bp.js";
4
+ } from "./roy-agent-core-rt115qfc.js";
5
5
  import {
6
6
  __require
7
7
  } from "./roy-agent-core-fs0mn2jk.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  TracedAs,
3
3
  init_decorator
4
- } from "./roy-agent-core-b599jgyd.js";
4
+ } from "./roy-agent-core-8p63s836.js";
5
5
  import {
6
6
  __esm,
7
7
  __legacyDecorateClassTS
@@ -7,11 +7,11 @@ import {
7
7
  embedResultFilter,
8
8
  init_decorator,
9
9
  init_trace_filters
10
- } from "./roy-agent-core-b599jgyd.js";
10
+ } from "./roy-agent-core-8p63s836.js";
11
11
  import {
12
12
  createLogger,
13
13
  init_logger
14
- } from "./roy-agent-core-8seq65bp.js";
14
+ } from "./roy-agent-core-rt115qfc.js";
15
15
  import {
16
16
  __legacyDecorateClassTS,
17
17
  __require
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  TagRepository
3
- } from "./roy-agent-core-m8n0dffe.js";
4
- import"./roy-agent-core-b599jgyd.js";
5
- import"./roy-agent-core-8seq65bp.js";
3
+ } from "./roy-agent-core-rcgvmtms.js";
4
+ import"./roy-agent-core-8p63s836.js";
5
+ import"./roy-agent-core-rt115qfc.js";
6
6
  import"./roy-agent-core-jnszp0jq.js";
7
7
  import"./roy-agent-core-fs0mn2jk.js";
8
8
  export {
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  isToolUnavailableError,
3
3
  truncateOutputInline
4
- } from "./roy-agent-core-98aa9r0x.js";
4
+ } from "./roy-agent-core-fw6k4w1h.js";
5
5
  import {
6
6
  AgentRegistry
7
- } from "./roy-agent-core-97eyghsp.js";
7
+ } from "./roy-agent-core-ygn5tzt1.js";
8
8
  import {
9
9
  enqueueToAddFakeUserMessage
10
- } from "./roy-agent-core-wafk25ff.js";
10
+ } from "./roy-agent-core-gksw1gjb.js";
11
11
  import {
12
12
  SessionMessageConverter
13
- } from "./roy-agent-core-ns3pbyz4.js";
13
+ } from "./roy-agent-core-ge87xbas.js";
14
14
  import {
15
15
  parseToolArgsStrict,
16
16
  safeParseToolArgs,
17
17
  withTimeout
18
- } from "./roy-agent-core-yv9x4wmg.js";
18
+ } from "./roy-agent-core-e1w17tht.js";
19
19
  import {
20
20
  getCurrentBgTaskId
21
21
  } from "./roy-agent-core-c1v263jn.js";
@@ -31,20 +31,20 @@ import {
31
31
  } from "./roy-agent-core-7hh0brvs.js";
32
32
  import {
33
33
  BaseComponent
34
- } from "./roy-agent-core-40xzbjtm.js";
34
+ } from "./roy-agent-core-0kn3zt1t.js";
35
35
  import {
36
36
  globalHookManager,
37
37
  init_global_hook_manager
38
- } from "./roy-agent-core-1pnfkspm.js";
38
+ } from "./roy-agent-core-yphwdm9x.js";
39
39
  import {
40
40
  init_context
41
- } from "./roy-agent-core-16t0zfbk.js";
41
+ } from "./roy-agent-core-m97jn2ra.js";
42
42
  import {
43
43
  getCurrentTaskId,
44
44
  getEnvContext,
45
45
  resolveEnvParentTaskId,
46
46
  runWithEnvContextAsync
47
- } from "./roy-agent-core-jszgaevt.js";
47
+ } from "./roy-agent-core-syyw58p9.js";
48
48
  import {
49
49
  TracedAs,
50
50
  agentRunParamFilter,
@@ -56,11 +56,11 @@ import {
56
56
  recordSessionMessagesParamFilter,
57
57
  toolExecParamFilter,
58
58
  toolExecResultFilter
59
- } from "./roy-agent-core-b599jgyd.js";
59
+ } from "./roy-agent-core-8p63s836.js";
60
60
  import {
61
61
  createLogger,
62
62
  init_logger
63
- } from "./roy-agent-core-8seq65bp.js";
63
+ } from "./roy-agent-core-rt115qfc.js";
64
64
  import {
65
65
  __legacyDecorateClassTS,
66
66
  __require
@@ -1541,6 +1541,7 @@ class AgentComponent extends BaseComponent {
1541
1541
  }
1542
1542
  async executeTool(ctx) {
1543
1543
  const toolCall = ctx.currentToolCall;
1544
+ const toolEventSessionId = ctx.context?.sessionId;
1544
1545
  const toolName = toolCall.function?.name || toolCall.name || "unknown";
1545
1546
  logger2.debug(`[executeTool] Looking for tool: "${toolName}"`);
1546
1547
  logger2.debug(`[executeTool] Available tools: [${ctx.tools.map((t) => t.name).join(", ")}]`);
@@ -1554,7 +1555,8 @@ class AgentComponent extends BaseComponent {
1554
1555
  toolName,
1555
1556
  availableTools: ctx.tools.map((t) => t.name),
1556
1557
  agentName: ctx.agent?.name
1557
- }
1558
+ },
1559
+ sessionId: toolEventSessionId
1558
1560
  });
1559
1561
  return {
1560
1562
  id: toolCall.id,
@@ -1574,7 +1576,8 @@ class AgentComponent extends BaseComponent {
1574
1576
  id: toolCall.id,
1575
1577
  name: toolName,
1576
1578
  arguments: toolCall.arguments
1577
- }
1579
+ },
1580
+ sessionId: toolEventSessionId
1578
1581
  });
1579
1582
  const toolContext = {
1580
1583
  session_id: ctx.context.sessionId,
@@ -1624,7 +1627,8 @@ class AgentComponent extends BaseComponent {
1624
1627
  name: toolName,
1625
1628
  result,
1626
1629
  success: result.success
1627
- }
1630
+ },
1631
+ sessionId: toolEventSessionId
1628
1632
  });
1629
1633
  return {
1630
1634
  id: toolCall.id,
@@ -1641,7 +1645,8 @@ class AgentComponent extends BaseComponent {
1641
1645
  payload: {
1642
1646
  error: error instanceof Error ? error.message : String(error),
1643
1647
  toolName
1644
- }
1648
+ },
1649
+ sessionId: toolEventSessionId
1645
1650
  });
1646
1651
  return {
1647
1652
  id: toolCall.id,
@@ -1783,7 +1788,8 @@ class AgentComponent extends BaseComponent {
1783
1788
  timestamp: Date.now(),
1784
1789
  metadata: {
1785
1790
  source: "agent",
1786
- agent_name: this.name
1791
+ agent_name: this.name,
1792
+ ...event.sessionId ? { sessionId: event.sessionId } : {}
1787
1793
  },
1788
1794
  payload: event.payload
1789
1795
  };
@@ -10,18 +10,18 @@ import {
10
10
  } from "./roy-agent-core-7hh0brvs.js";
11
11
  import {
12
12
  BaseComponent
13
- } from "./roy-agent-core-40xzbjtm.js";
13
+ } from "./roy-agent-core-0kn3zt1t.js";
14
14
  import {
15
15
  createHook
16
- } from "./roy-agent-core-gngjkw3b.js";
16
+ } from "./roy-agent-core-ytd5eztz.js";
17
17
  import {
18
18
  globalHookManager,
19
19
  init_global_hook_manager
20
- } from "./roy-agent-core-1pnfkspm.js";
20
+ } from "./roy-agent-core-yphwdm9x.js";
21
21
  import {
22
22
  createLogger,
23
23
  init_logger
24
- } from "./roy-agent-core-8seq65bp.js";
24
+ } from "./roy-agent-core-rt115qfc.js";
25
25
 
26
26
  // src/env/prompt/types.ts
27
27
  import { z } from "zod";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  isValidSessionId
3
- } from "./roy-agent-core-bwzy00t2.js";
3
+ } from "./roy-agent-core-kq9pz2a7.js";
4
4
  import {
5
5
  TAG_MAX_COUNT,
6
6
  TAG_MIN_COUNT
7
- } from "./roy-agent-core-5rxs0ra3.js";
7
+ } from "./roy-agent-core-9zhkdg6w.js";
8
8
  import {
9
9
  validateWorkflowDefinition
10
- } from "./roy-agent-core-202v00x4.js";
10
+ } from "./roy-agent-core-89sxsrc7.js";
11
11
  import {
12
12
  getCurrentBgTaskId
13
13
  } from "./roy-agent-core-c1v263jn.js";
@@ -18,11 +18,11 @@ import {
18
18
  import {
19
19
  TracedAs,
20
20
  init_decorator
21
- } from "./roy-agent-core-b599jgyd.js";
21
+ } from "./roy-agent-core-8p63s836.js";
22
22
  import {
23
23
  createLogger,
24
24
  init_logger
25
- } from "./roy-agent-core-8seq65bp.js";
25
+ } from "./roy-agent-core-rt115qfc.js";
26
26
  import {
27
27
  __legacyDecorateClassTS,
28
28
  __require
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  TracedAs,
3
3
  init_decorator
4
- } from "./roy-agent-core-b599jgyd.js";
4
+ } from "./roy-agent-core-8p63s836.js";
5
5
  import {
6
6
  createLogger,
7
7
  init_logger
8
- } from "./roy-agent-core-8seq65bp.js";
8
+ } from "./roy-agent-core-rt115qfc.js";
9
9
  import {
10
10
  __esm,
11
11
  __export,
@@ -1153,8 +1153,4 @@ var init_sqlite_task_store = __esm(() => {
1153
1153
  ], SQLiteTaskStore.prototype, "searchTasksByKeywords", null);
1154
1154
  });
1155
1155
 
1156
- // src/env/task/storage/index.ts
1157
- init_sqlite_task_store();
1158
- init_sqlite_task_store();
1159
-
1160
- export { getDefaultDataDir, getDefaultTaskDbPath, SQLiteTaskStore };
1156
+ export { createCompatibleDatabase, getDefaultDataDir, getDefaultTaskDbPath, SQLiteTaskStore, init_sqlite_task_store };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  TempFileManager
3
- } from "./roy-agent-core-kzg1jwt8.js";
3
+ } from "./roy-agent-core-n0p0hwgd.js";
4
4
  import {
5
5
  AskUserError,
6
6
  init_workflow_hil
@@ -11,27 +11,27 @@ import {
11
11
  } from "./roy-agent-core-7hh0brvs.js";
12
12
  import {
13
13
  BaseComponent
14
- } from "./roy-agent-core-40xzbjtm.js";
14
+ } from "./roy-agent-core-0kn3zt1t.js";
15
15
  import {
16
16
  ToolHookPoints,
17
17
  globalHookManager,
18
18
  init_global_hook_manager
19
- } from "./roy-agent-core-1pnfkspm.js";
19
+ } from "./roy-agent-core-yphwdm9x.js";
20
20
  import {
21
21
  getCurrentTaskId,
22
22
  init_env_context
23
- } from "./roy-agent-core-jszgaevt.js";
23
+ } from "./roy-agent-core-syyw58p9.js";
24
24
  import {
25
25
  TracedAs,
26
26
  init_decorator,
27
27
  init_trace_filters,
28
28
  toolExecResultFilter,
29
29
  toolInvokeParamFilter
30
- } from "./roy-agent-core-b599jgyd.js";
30
+ } from "./roy-agent-core-8p63s836.js";
31
31
  import {
32
32
  createLogger,
33
33
  init_logger
34
- } from "./roy-agent-core-8seq65bp.js";
34
+ } from "./roy-agent-core-rt115qfc.js";
35
35
  import {
36
36
  __legacyDecorateClassTS,
37
37
  __require