@ai-setting/roy-agent-core 1.7.61 → 1.7.62

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 (119) hide show
  1. package/dist/config/index.js +8 -8
  2. package/dist/env/agent/agent-component.js +41 -0
  3. package/dist/env/agent/index.js +18 -16
  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.js +18 -0
  8. package/dist/env/event-source/cli-command-handler.js +17 -0
  9. package/dist/env/event-source/event-source-handlers.js +58 -0
  10. package/dist/env/event-source/event-store.js +18 -0
  11. package/dist/env/event-source/idempotency-key.js +20 -0
  12. package/dist/env/event-source/index.js +30 -25
  13. package/dist/env/hook/index.js +6 -6
  14. package/dist/env/index.js +52 -46
  15. package/dist/env/lark-mention-utils.js +9 -0
  16. package/dist/env/llm/index.js +9 -9
  17. package/dist/env/log-trace/index.js +8 -8
  18. package/dist/env/log-trace/logger.js +39 -0
  19. package/dist/env/mcp/index.js +9 -9
  20. package/dist/env/mcp/tool/index.js +2 -2
  21. package/dist/env/memory/index.js +9 -9
  22. package/dist/env/memory/plugin/index.js +2 -2
  23. package/dist/env/plugin/index.js +9 -9
  24. package/dist/env/prompt/index.js +8 -8
  25. package/dist/env/session/index.js +11 -11
  26. package/dist/env/session/storage/index.js +5 -5
  27. package/dist/env/skill/index.js +8 -8
  28. package/dist/env/task/delegate/delegate-tool.js +42 -0
  29. package/dist/env/task/delegate/index.js +13 -11
  30. package/dist/env/task/index.js +16 -15
  31. package/dist/env/task/mcp/index.js +4 -4
  32. package/dist/env/task/plugins/index.js +11 -11
  33. package/dist/env/task/plugins/lark-card-patch-notifier.js +42 -0
  34. package/dist/env/task/storage/index.js +4 -4
  35. package/dist/env/task/tools/index.js +4 -4
  36. package/dist/env/tool/built-in/index.js +4 -4
  37. package/dist/env/tool/index.js +12 -11
  38. package/dist/env/tool/types.js +1 -0
  39. package/dist/env/workflow/engine/index.js +13 -13
  40. package/dist/env/workflow/hooks/index.js +8 -8
  41. package/dist/env/workflow/index.js +23 -23
  42. package/dist/env/workflow/nodes/index.js +3 -3
  43. package/dist/env/workflow/plugins/index.js +9 -9
  44. package/dist/env/workflow/service/index.js +3 -3
  45. package/dist/env/workflow/storage/index.js +4 -4
  46. package/dist/env/workflow/tools/index.js +15 -15
  47. package/dist/env/workflow/utils/index.js +5 -5
  48. package/dist/index.js +70 -62
  49. package/dist/shared/@ai-setting/{roy-agent-core-dythsgkn.js → roy-agent-core-06jakebr.js} +2 -2
  50. package/dist/shared/@ai-setting/{roy-agent-core-jsn21cb9.js → roy-agent-core-084zthqx.js} +1 -1
  51. package/dist/shared/@ai-setting/{roy-agent-core-x1m0gs0q.js → roy-agent-core-2hkyp51n.js} +1 -1
  52. package/dist/shared/@ai-setting/{roy-agent-core-q212q0w1.js → roy-agent-core-2pma868e.js} +4 -4
  53. package/dist/shared/@ai-setting/{roy-agent-core-vmfk4m1v.js → roy-agent-core-2veqhrxa.js} +3 -3
  54. package/dist/shared/@ai-setting/{roy-agent-core-mw0bc9g6.js → roy-agent-core-32ck9rqt.js} +2 -2
  55. package/dist/shared/@ai-setting/{roy-agent-core-bdzdw1g3.js → roy-agent-core-33hn1beg.js} +1 -1
  56. package/dist/shared/@ai-setting/{roy-agent-core-2qkrpc7m.js → roy-agent-core-386wa4wy.js} +1 -1
  57. package/dist/shared/@ai-setting/{roy-agent-core-rnzm0tpf.js → roy-agent-core-48h4zh60.js} +4 -4
  58. package/dist/shared/@ai-setting/{roy-agent-core-yr5eqyhz.js → roy-agent-core-5bj0xfjk.js} +13 -27
  59. package/dist/shared/@ai-setting/{roy-agent-core-khc23qs1.js → roy-agent-core-5mrynf9g.js} +1 -1
  60. package/dist/shared/@ai-setting/{roy-agent-core-y0k9kaxz.js → roy-agent-core-6awgfh3x.js} +1 -1
  61. package/dist/shared/@ai-setting/{roy-agent-core-ygfjgk9b.js → roy-agent-core-6wxww10t.js} +2 -2
  62. package/dist/shared/@ai-setting/{roy-agent-core-xc0es9zc.js → roy-agent-core-79gyka2q.js} +2 -2
  63. package/dist/shared/@ai-setting/{roy-agent-core-expvav8a.js → roy-agent-core-7tce05jt.js} +1 -1
  64. package/dist/shared/@ai-setting/roy-agent-core-9nvyffxg.js +414 -0
  65. package/dist/shared/@ai-setting/{roy-agent-core-m2tv4pj0.js → roy-agent-core-9qgrc9dy.js} +158 -158
  66. package/dist/shared/@ai-setting/{roy-agent-core-z51jktet.js → roy-agent-core-a08dpf71.js} +17 -2
  67. package/dist/shared/@ai-setting/{roy-agent-core-22r4zmkw.js → roy-agent-core-a6cz4d23.js} +3 -3
  68. package/dist/shared/@ai-setting/{roy-agent-core-0f989bnp.js → roy-agent-core-anb53t3v.js} +3 -3
  69. package/dist/shared/@ai-setting/{roy-agent-core-ymcvsdzn.js → roy-agent-core-as0dd70m.js} +2 -2
  70. package/dist/shared/@ai-setting/{roy-agent-core-nd5171pv.js → roy-agent-core-bpvz1dqr.js} +8 -8
  71. package/dist/shared/@ai-setting/{roy-agent-core-aa514zm8.js → roy-agent-core-c4t4y18j.js} +5 -5
  72. package/dist/shared/@ai-setting/{roy-agent-core-sf9tsj0g.js → roy-agent-core-c57278kx.js} +1 -1
  73. package/dist/shared/@ai-setting/{roy-agent-core-e6k448ka.js → roy-agent-core-c8xvy6hj.js} +4 -4
  74. package/dist/shared/@ai-setting/{roy-agent-core-gtb4fj8j.js → roy-agent-core-cqpd41gf.js} +12 -10
  75. package/dist/shared/@ai-setting/{roy-agent-core-qgapy83x.js → roy-agent-core-cxpgd415.js} +6 -6
  76. package/dist/shared/@ai-setting/{roy-agent-core-g44nbgtt.js → roy-agent-core-dfqhc9ey.js} +2 -2
  77. package/dist/shared/@ai-setting/{roy-agent-core-cndvj1hv.js → roy-agent-core-fqandv0a.js} +9 -107
  78. package/dist/shared/@ai-setting/{roy-agent-core-4m5spt7m.js → roy-agent-core-fr296a53.js} +5 -5
  79. package/dist/shared/@ai-setting/{roy-agent-core-3p59ap0x.js → roy-agent-core-gc6wcd7z.js} +1 -1
  80. package/dist/shared/@ai-setting/{roy-agent-core-s7w47mnn.js → roy-agent-core-gjsvehfs.js} +1 -1
  81. package/dist/shared/@ai-setting/{roy-agent-core-9s3payp1.js → roy-agent-core-gtdtzbs7.js} +2 -2
  82. package/dist/shared/@ai-setting/{roy-agent-core-jrksyqb6.js → roy-agent-core-gz2jnaan.js} +7 -7
  83. package/dist/shared/@ai-setting/{roy-agent-core-6cyjps72.js → roy-agent-core-h3fwjbhp.js} +14 -14
  84. package/dist/shared/@ai-setting/{roy-agent-core-mhppywse.js → roy-agent-core-hczj1ryh.js} +4 -4
  85. package/dist/shared/@ai-setting/{roy-agent-core-qrjs2500.js → roy-agent-core-hfyxv2kx.js} +2 -2
  86. package/dist/shared/@ai-setting/{roy-agent-core-dg286rpd.js → roy-agent-core-hwkc0bg2.js} +1 -1
  87. package/dist/shared/@ai-setting/{roy-agent-core-bc3v8pw4.js → roy-agent-core-ja4sr63d.js} +6 -6
  88. package/dist/shared/@ai-setting/roy-agent-core-jagkferh.js +16 -0
  89. package/dist/shared/@ai-setting/roy-agent-core-jm136jzh.js +99 -0
  90. package/dist/shared/@ai-setting/{roy-agent-core-g5sw19fa.js → roy-agent-core-jw63js86.js} +1 -1
  91. package/dist/shared/@ai-setting/{roy-agent-core-8fy467qs.js → roy-agent-core-kmvw6b4v.js} +1 -1
  92. package/dist/shared/@ai-setting/{roy-agent-core-3bpntd80.js → roy-agent-core-kvq4a4p6.js} +2 -2
  93. package/dist/shared/@ai-setting/{roy-agent-core-yd85623y.js → roy-agent-core-m3w3ytxt.js} +2 -2
  94. package/dist/shared/@ai-setting/{roy-agent-core-64f22h1g.js → roy-agent-core-m880qz3y.js} +7 -1
  95. package/dist/shared/@ai-setting/{roy-agent-core-5knpegzr.js → roy-agent-core-mbwaxqs0.js} +3 -3
  96. package/dist/shared/@ai-setting/{roy-agent-core-tn96n4wz.js → roy-agent-core-mkpsz128.js} +4 -4
  97. package/dist/shared/@ai-setting/{roy-agent-core-9k8ms63r.js → roy-agent-core-mrrv80jy.js} +1 -1
  98. package/dist/shared/@ai-setting/{roy-agent-core-ytnedzks.js → roy-agent-core-nmn853z0.js} +333 -1332
  99. package/dist/shared/@ai-setting/roy-agent-core-p37kh0kt.js +155 -0
  100. package/dist/shared/@ai-setting/{roy-agent-core-60p2380d.js → roy-agent-core-p6a4v4fq.js} +1 -1
  101. package/dist/shared/@ai-setting/{roy-agent-core-hf0t8agb.js → roy-agent-core-p8rf4z89.js} +1 -1
  102. package/dist/shared/@ai-setting/roy-agent-core-pnj0zh25.js +0 -0
  103. package/dist/shared/@ai-setting/{roy-agent-core-dp1hp24k.js → roy-agent-core-prnry2mw.js} +3 -3
  104. package/dist/shared/@ai-setting/{roy-agent-core-qw5fpa24.js → roy-agent-core-qmqe8ds3.js} +3 -3
  105. package/dist/shared/@ai-setting/{roy-agent-core-j0x9yf96.js → roy-agent-core-sj4y3wdm.js} +3 -3
  106. package/dist/shared/@ai-setting/{roy-agent-core-xeqp659x.js → roy-agent-core-th92f833.js} +2 -2
  107. package/dist/shared/@ai-setting/{roy-agent-core-ajmgyawx.js → roy-agent-core-v7mwj8eq.js} +2 -2
  108. package/dist/shared/@ai-setting/{roy-agent-core-5565cvw8.js → roy-agent-core-vvb4cyyy.js} +5 -5
  109. package/dist/shared/@ai-setting/{roy-agent-core-qpqqx1wd.js → roy-agent-core-vwzan9v0.js} +2 -2
  110. package/dist/shared/@ai-setting/{roy-agent-core-pj5tfmn5.js → roy-agent-core-w2ev3z5q.js} +12 -14
  111. package/dist/shared/@ai-setting/roy-agent-core-w2h6xt6k.js +473 -0
  112. package/dist/shared/@ai-setting/{roy-agent-core-kfmrfaft.js → roy-agent-core-wzp4tbsn.js} +1 -1
  113. package/dist/shared/@ai-setting/{roy-agent-core-jsdqzfbj.js → roy-agent-core-x1d6edkh.js} +1 -1
  114. package/dist/shared/@ai-setting/{roy-agent-core-n1ck0x1r.js → roy-agent-core-ye4bfzqg.js} +11 -11
  115. package/dist/shared/@ai-setting/{roy-agent-core-p2dpcyrz.js → roy-agent-core-zjgckbdd.js} +2 -2
  116. package/dist/shared/@ai-setting/{roy-agent-core-a5nh5q6v.js → roy-agent-core-zy8vkbnk.js} +1 -1
  117. package/dist/test-utils/child-process-mock.js +23 -0
  118. package/dist/utils/temp-file-manager/index.js +2 -2
  119. package/package.json +61 -1
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  ProcessRegistry,
3
3
  runWithProcessRegistryAsync
4
- } from "./roy-agent-core-g5sw19fa.js";
4
+ } from "./roy-agent-core-jw63js86.js";
5
5
  import {
6
6
  getSharedEventStore
7
- } from "./roy-agent-core-z51jktet.js";
7
+ } from "./roy-agent-core-a08dpf71.js";
8
8
  import {
9
9
  TaskHookPoints
10
10
  } from "./roy-agent-core-1pg0fepg.js";
@@ -13,30 +13,30 @@ import {
13
13
  } from "./roy-agent-core-6masakz4.js";
14
14
  import {
15
15
  DEFAULT_SUBAGENT_PROMPT
16
- } from "./roy-agent-core-dythsgkn.js";
16
+ } from "./roy-agent-core-06jakebr.js";
17
17
  import {
18
18
  runWithBgTaskIdAsync
19
19
  } from "./roy-agent-core-c1v263jn.js";
20
20
  import {
21
21
  globalHookManager,
22
22
  init_global_hook_manager
23
- } from "./roy-agent-core-ajmgyawx.js";
23
+ } from "./roy-agent-core-v7mwj8eq.js";
24
24
  import {
25
25
  init_context
26
- } from "./roy-agent-core-bdzdw1g3.js";
26
+ } from "./roy-agent-core-33hn1beg.js";
27
27
  import {
28
28
  getCurrentTaskId,
29
29
  getEnvContext
30
- } from "./roy-agent-core-qrjs2500.js";
30
+ } from "./roy-agent-core-hfyxv2kx.js";
31
31
  import {
32
32
  TracedAs,
33
33
  init_decorator,
34
34
  wrapFunction
35
- } from "./roy-agent-core-2qkrpc7m.js";
35
+ } from "./roy-agent-core-386wa4wy.js";
36
36
  import {
37
37
  createLogger,
38
38
  init_logger
39
- } from "./roy-agent-core-y0k9kaxz.js";
39
+ } from "./roy-agent-core-6awgfh3x.js";
40
40
  import {
41
41
  __legacyDecorateClassTS
42
42
  } from "./roy-agent-core-fs0mn2jk.js";
@@ -2107,102 +2107,4 @@ async function handleBackgroundTask(backgroundTaskManager, parentSessionId, desc
2107
2107
  };
2108
2108
  }
2109
2109
  }
2110
- // src/env/task/delegate/stop-tool.ts
2111
- import { z as z2 } from "zod";
2112
- var StopTaskToolParameters = z2.object({
2113
- task_id: z2.string().describe("The ID of the background task to stop")
2114
- });
2115
- var STOP_TASK_DESCRIPTION = `Stop a running background task.
2116
-
2117
- Use this tool to stop a background task that is currently running. This is useful when:
2118
- - The user wants to cancel a long-running task
2119
- - The task is taking too long and needs to be stopped
2120
- - The user wants to change direction and doesn't need the task result anymore
2121
-
2122
- When stopped, the task will be terminated immediately and you will receive a confirmation.
2123
-
2124
- Parameters:
2125
- - task_id: The ID of the background task to stop (obtained from the delegate_task response)`;
2126
- function formatDuration(ms) {
2127
- const seconds = Math.floor(ms / 1000);
2128
- const minutes = Math.floor(seconds / 60);
2129
- const hours = Math.floor(minutes / 60);
2130
- if (hours > 0) {
2131
- return `${hours}h ${minutes % 60}m ${seconds % 60}s`;
2132
- } else if (minutes > 0) {
2133
- return `${minutes}m ${seconds % 60}s`;
2134
- } else {
2135
- return `${seconds}s`;
2136
- }
2137
- }
2138
- function createStopTool(taskManager) {
2139
- return {
2140
- name: "stop_task",
2141
- description: STOP_TASK_DESCRIPTION,
2142
- parameters: StopTaskToolParameters,
2143
- execute: async (args, ctx) => {
2144
- const startTime = Date.now();
2145
- const params = StopTaskToolParameters.parse(args);
2146
- const { task_id } = params;
2147
- const result = await taskManager.stopTask(task_id);
2148
- if (result.success) {
2149
- const task = result.task;
2150
- const elapsedMs = task.startedAt ? Date.now() - task.startedAt : Date.now() - task.createdAt;
2151
- const output = [
2152
- `✅ Task stopped successfully`,
2153
- "",
2154
- `\uD83D\uDCCB Task ID: ${task_id}`,
2155
- `\uD83D\uDCDD Description: ${task.description}`,
2156
- `\uD83D\uDD04 Status: ${task.status} → stopped`,
2157
- `⏱️ Elapsed Time: ${formatDuration(elapsedMs)}`,
2158
- "",
2159
- result.message
2160
- ].join(`
2161
- `);
2162
- return {
2163
- success: true,
2164
- output,
2165
- metadata: {
2166
- execution_time_ms: Date.now() - startTime,
2167
- task_id,
2168
- previous_status: task.status
2169
- }
2170
- };
2171
- } else {
2172
- const task = result.task;
2173
- let output;
2174
- if (task) {
2175
- output = [
2176
- `⚠️ Cannot stop task`,
2177
- "",
2178
- `\uD83D\uDCCB Task ID: ${task_id}`,
2179
- `\uD83D\uDCDD Description: ${task.description}`,
2180
- `\uD83D\uDD04 Current Status: ${task.status}`,
2181
- "",
2182
- result.message
2183
- ].join(`
2184
- `);
2185
- } else {
2186
- output = [
2187
- `❌ Task not found`,
2188
- "",
2189
- `\uD83D\uDCCB Task ID: ${task_id}`,
2190
- "",
2191
- result.message
2192
- ].join(`
2193
- `);
2194
- }
2195
- return {
2196
- success: false,
2197
- output,
2198
- error: result.message,
2199
- metadata: {
2200
- execution_time_ms: Date.now() - startTime,
2201
- task_id
2202
- }
2203
- };
2204
- }
2205
- }
2206
- };
2207
- }
2208
- export { BackgroundTaskEventTypes, BackgroundTaskManager, createDelegateTool, createStopTool };
2110
+ export { BackgroundTaskEventTypes, builtInSubAgents, getSubAgentSpec, DelegateToolParameters, buildEntryAgentPrompt, WORKFLOW_COMPAT_ALIASES, DEFAULT_TIMEOUT, BackgroundTaskManager, createDelegateTool, deriveTriggerEventIdFromEnvContext, captureReplyChannelSnapshot, handleBackgroundTask };
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  isValidSessionId
3
- } from "./roy-agent-core-rnzm0tpf.js";
3
+ } from "./roy-agent-core-48h4zh60.js";
4
4
  import {
5
5
  TAG_MAX_COUNT,
6
6
  TAG_MIN_COUNT
7
- } from "./roy-agent-core-ygfjgk9b.js";
7
+ } from "./roy-agent-core-6wxww10t.js";
8
8
  import {
9
9
  validateWorkflowDefinition
10
- } from "./roy-agent-core-8fy467qs.js";
10
+ } from "./roy-agent-core-kmvw6b4v.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-2qkrpc7m.js";
21
+ } from "./roy-agent-core-386wa4wy.js";
22
22
  import {
23
23
  createLogger,
24
24
  init_logger
25
- } from "./roy-agent-core-y0k9kaxz.js";
25
+ } from "./roy-agent-core-6awgfh3x.js";
26
26
  import {
27
27
  __legacyDecorateClassTS,
28
28
  __require
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  TracedAs,
3
3
  init_decorator
4
- } from "./roy-agent-core-2qkrpc7m.js";
4
+ } from "./roy-agent-core-386wa4wy.js";
5
5
  import {
6
6
  __legacyDecorateClassTS
7
7
  } from "./roy-agent-core-fs0mn2jk.js";
@@ -4,7 +4,7 @@ import {
4
4
  init_tracer_provider,
5
5
  resetTracerProvider,
6
6
  setTracerProvider
7
- } from "./roy-agent-core-y0k9kaxz.js";
7
+ } from "./roy-agent-core-6awgfh3x.js";
8
8
  import"./roy-agent-core-jnszp0jq.js";
9
9
  import"./roy-agent-core-fs0mn2jk.js";
10
10
  init_tracer_provider();
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  createHook,
3
3
  init_hook
4
- } from "./roy-agent-core-expvav8a.js";
4
+ } from "./roy-agent-core-7tce05jt.js";
5
5
  import {
6
6
  HookManager
7
- } from "./roy-agent-core-ajmgyawx.js";
7
+ } from "./roy-agent-core-v7mwj8eq.js";
8
8
 
9
9
  // src/env/component.ts
10
10
  init_hook();
@@ -1,34 +1,34 @@
1
1
  import {
2
2
  createAutoTaskPlugin
3
- } from "./roy-agent-core-n1ck0x1r.js";
3
+ } from "./roy-agent-core-ye4bfzqg.js";
4
4
  import {
5
5
  ContextError,
6
6
  ErrorCodes
7
7
  } from "./roy-agent-core-ctdhjv68.js";
8
8
  import {
9
9
  BaseComponent
10
- } from "./roy-agent-core-9s3payp1.js";
10
+ } from "./roy-agent-core-gtdtzbs7.js";
11
11
  import {
12
12
  init_hook
13
- } from "./roy-agent-core-expvav8a.js";
13
+ } from "./roy-agent-core-7tce05jt.js";
14
14
  import {
15
15
  init_context
16
- } from "./roy-agent-core-bdzdw1g3.js";
16
+ } from "./roy-agent-core-33hn1beg.js";
17
17
  import {
18
18
  getEnvContext,
19
19
  init_env_context,
20
20
  runWithEnvContextAsync
21
- } from "./roy-agent-core-qrjs2500.js";
21
+ } from "./roy-agent-core-hfyxv2kx.js";
22
22
  import {
23
23
  TracedAs,
24
24
  envQueryParamFilter,
25
25
  init_decorator,
26
26
  init_trace_filters
27
- } from "./roy-agent-core-2qkrpc7m.js";
27
+ } from "./roy-agent-core-386wa4wy.js";
28
28
  import {
29
29
  createLogger,
30
30
  init_logger
31
- } from "./roy-agent-core-y0k9kaxz.js";
31
+ } from "./roy-agent-core-6awgfh3x.js";
32
32
  import {
33
33
  __legacyDecorateClassTS
34
34
  } from "./roy-agent-core-fs0mn2jk.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  exports_node_registry_helper,
3
3
  init_node_registry_helper
4
- } from "./roy-agent-core-g44nbgtt.js";
4
+ } from "./roy-agent-core-dfqhc9ey.js";
5
5
  import {
6
6
  askUserTool,
7
7
  createRunWorkflowTool,
@@ -13,22 +13,22 @@ import {
13
13
  createWorkflowSearchTool,
14
14
  createWorkflowTagListTool,
15
15
  createWorkflowValidateTool
16
- } from "./roy-agent-core-4m5spt7m.js";
16
+ } from "./roy-agent-core-fr296a53.js";
17
17
  import {
18
18
  WorkflowService
19
- } from "./roy-agent-core-ygfjgk9b.js";
19
+ } from "./roy-agent-core-6wxww10t.js";
20
20
  import {
21
21
  WorkflowEngine,
22
22
  exports_engine,
23
23
  init_engine
24
- } from "./roy-agent-core-nd5171pv.js";
24
+ } from "./roy-agent-core-bpvz1dqr.js";
25
25
  import {
26
26
  BaseComponent
27
- } from "./roy-agent-core-9s3payp1.js";
27
+ } from "./roy-agent-core-gtdtzbs7.js";
28
28
  import {
29
29
  createLogger,
30
30
  init_logger
31
- } from "./roy-agent-core-y0k9kaxz.js";
31
+ } from "./roy-agent-core-6awgfh3x.js";
32
32
  import {
33
33
  __require,
34
34
  __toCommonJS
@@ -104,7 +104,7 @@ class WorkflowComponent extends BaseComponent {
104
104
  return;
105
105
  try {
106
106
  const { NodeRegistry } = await import("../../env/workflow/engine/index.js");
107
- const { registerDecoratorNodeType: registerDecoratorNodeType2 } = await import("./roy-agent-core-5knpegzr.js");
107
+ const { registerDecoratorNodeType: registerDecoratorNodeType2 } = await import("./roy-agent-core-mbwaxqs0.js");
108
108
  this.nodeRegistry = new NodeRegistry;
109
109
  registerDecoratorNodeType2(this.nodeRegistry);
110
110
  this.decoratorsRegistered = true;
@@ -134,14 +134,14 @@ class WorkflowComponent extends BaseComponent {
134
134
  }
135
135
  async runWorkflow(definition, input, options) {
136
136
  const { NodeRegistry } = await import("../../env/workflow/engine/index.js");
137
- const { registerDecoratorNodeType: registerDecoratorNodeType2 } = await import("./roy-agent-core-5knpegzr.js");
137
+ const { registerDecoratorNodeType: registerDecoratorNodeType2 } = await import("./roy-agent-core-mbwaxqs0.js");
138
138
  const toolComponent = this.toolComponent || this._workflowEnv?.getComponent("tool");
139
139
  const skillComponent = this._workflowEnv?.getComponent("skill");
140
140
  let agentRunner = this.agentRunner;
141
141
  if (!agentRunner && this._workflowEnv) {
142
142
  const agentComponent = this._workflowEnv.getComponent("agent");
143
143
  if (agentComponent) {
144
- const { AgentComponentAdapter } = await import("./roy-agent-core-bc3v8pw4.js");
144
+ const { AgentComponentAdapter } = await import("./roy-agent-core-ja4sr63d.js");
145
145
  agentRunner = new AgentComponentAdapter(agentComponent, {}, this.sessionComponent);
146
146
  }
147
147
  }
@@ -163,7 +163,7 @@ class WorkflowComponent extends BaseComponent {
163
163
  if (this.workflowService) {
164
164
  this.workflowService = null;
165
165
  try {
166
- const { closeDatabase } = await import("./roy-agent-core-mhppywse.js");
166
+ const { closeDatabase } = await import("./roy-agent-core-hczj1ryh.js");
167
167
  closeDatabase();
168
168
  componentLogger.info("[WorkflowComponent] SQLite database closed");
169
169
  } catch (error) {
@@ -241,9 +241,9 @@ class WorkflowComponent extends BaseComponent {
241
241
  }
242
242
  async initSqliteService() {
243
243
  try {
244
- const { getDatabase, initializeTables } = await import("./roy-agent-core-mhppywse.js");
245
- const { WorkflowRepository } = await import("./roy-agent-core-tn96n4wz.js");
246
- const { TagRepository } = await import("./roy-agent-core-22r4zmkw.js");
244
+ const { getDatabase, initializeTables } = await import("./roy-agent-core-hczj1ryh.js");
245
+ const { WorkflowRepository } = await import("./roy-agent-core-mkpsz128.js");
246
+ const { TagRepository } = await import("./roy-agent-core-a6cz4d23.js");
247
247
  const db = getDatabase();
248
248
  initializeTables();
249
249
  const workflowRepository = new WorkflowRepository(db);
@@ -309,7 +309,7 @@ class WorkflowComponent extends BaseComponent {
309
309
  this.workflowService = null;
310
310
  this.nodeRegistry = null;
311
311
  try {
312
- const { closeDatabase } = await import("./roy-agent-core-mhppywse.js");
312
+ const { closeDatabase } = await import("./roy-agent-core-hczj1ryh.js");
313
313
  closeDatabase();
314
314
  } catch {}
315
315
  this._status = "stopped";
@@ -5,11 +5,11 @@ import {
5
5
  initDatabase,
6
6
  initializeTables,
7
7
  resetDatabase
8
- } from "./roy-agent-core-qpqqx1wd.js";
9
- import"./roy-agent-core-3p59ap0x.js";
8
+ } from "./roy-agent-core-vwzan9v0.js";
9
+ import"./roy-agent-core-gc6wcd7z.js";
10
10
  import"./roy-agent-core-rvxg1wps.js";
11
- import"./roy-agent-core-2qkrpc7m.js";
12
- import"./roy-agent-core-y0k9kaxz.js";
11
+ import"./roy-agent-core-386wa4wy.js";
12
+ import"./roy-agent-core-6awgfh3x.js";
13
13
  import"./roy-agent-core-jnszp0jq.js";
14
14
  import"./roy-agent-core-fs0mn2jk.js";
15
15
  export {
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  init_decorator,
3
3
  wrapFunction
4
- } from "./roy-agent-core-2qkrpc7m.js";
4
+ } from "./roy-agent-core-386wa4wy.js";
5
5
  import {
6
6
  createLogger,
7
7
  init_logger
8
- } from "./roy-agent-core-y0k9kaxz.js";
8
+ } from "./roy-agent-core-6awgfh3x.js";
9
9
  import {
10
10
  __esm
11
11
  } 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-2qkrpc7m.js";
4
+ } from "./roy-agent-core-386wa4wy.js";
5
5
  import {
6
6
  __esm,
7
7
  __legacyDecorateClassTS
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  AgentComponentAdapter,
3
3
  init_agent_component_adapter
4
- } from "./roy-agent-core-j0x9yf96.js";
4
+ } from "./roy-agent-core-sj4y3wdm.js";
5
5
  import"./roy-agent-core-1db4vpc6.js";
6
6
  import"./roy-agent-core-ze068vc9.js";
7
7
  import"./roy-agent-core-e25xkv53.js";
8
- import"./roy-agent-core-ajmgyawx.js";
9
- import"./roy-agent-core-bdzdw1g3.js";
10
- import"./roy-agent-core-qrjs2500.js";
11
- import"./roy-agent-core-2qkrpc7m.js";
12
- import"./roy-agent-core-y0k9kaxz.js";
8
+ import"./roy-agent-core-v7mwj8eq.js";
9
+ import"./roy-agent-core-33hn1beg.js";
10
+ import"./roy-agent-core-hfyxv2kx.js";
11
+ import"./roy-agent-core-386wa4wy.js";
12
+ import"./roy-agent-core-6awgfh3x.js";
13
13
  import"./roy-agent-core-jnszp0jq.js";
14
14
  import"./roy-agent-core-fs0mn2jk.js";
15
15
  init_agent_component_adapter();
@@ -0,0 +1,16 @@
1
+ // src/env/agent/summary-agent.ts
2
+ class SummaryAgent {
3
+ llmComponent;
4
+ config;
5
+ constructor(_promptComponent, llmComponent, config) {
6
+ this.llmComponent = llmComponent;
7
+ this.config = {
8
+ type: "summary",
9
+ promptName: "session/compact",
10
+ maxIterations: 1,
11
+ model: undefined,
12
+ ...config
13
+ };
14
+ }
15
+ }
16
+ export { SummaryAgent };
@@ -0,0 +1,99 @@
1
+ // src/env/task/delegate/stop-tool.ts
2
+ import { z } from "zod";
3
+ var StopTaskToolParameters = z.object({
4
+ task_id: z.string().describe("The ID of the background task to stop")
5
+ });
6
+ var STOP_TASK_DESCRIPTION = `Stop a running background task.
7
+
8
+ Use this tool to stop a background task that is currently running. This is useful when:
9
+ - The user wants to cancel a long-running task
10
+ - The task is taking too long and needs to be stopped
11
+ - The user wants to change direction and doesn't need the task result anymore
12
+
13
+ When stopped, the task will be terminated immediately and you will receive a confirmation.
14
+
15
+ Parameters:
16
+ - task_id: The ID of the background task to stop (obtained from the delegate_task response)`;
17
+ function formatDuration(ms) {
18
+ const seconds = Math.floor(ms / 1000);
19
+ const minutes = Math.floor(seconds / 60);
20
+ const hours = Math.floor(minutes / 60);
21
+ if (hours > 0) {
22
+ return `${hours}h ${minutes % 60}m ${seconds % 60}s`;
23
+ } else if (minutes > 0) {
24
+ return `${minutes}m ${seconds % 60}s`;
25
+ } else {
26
+ return `${seconds}s`;
27
+ }
28
+ }
29
+ function createStopTool(taskManager) {
30
+ return {
31
+ name: "stop_task",
32
+ description: STOP_TASK_DESCRIPTION,
33
+ parameters: StopTaskToolParameters,
34
+ execute: async (args, ctx) => {
35
+ const startTime = Date.now();
36
+ const params = StopTaskToolParameters.parse(args);
37
+ const { task_id } = params;
38
+ const result = await taskManager.stopTask(task_id);
39
+ if (result.success) {
40
+ const task = result.task;
41
+ const elapsedMs = task.startedAt ? Date.now() - task.startedAt : Date.now() - task.createdAt;
42
+ const output = [
43
+ `✅ Task stopped successfully`,
44
+ "",
45
+ `\uD83D\uDCCB Task ID: ${task_id}`,
46
+ `\uD83D\uDCDD Description: ${task.description}`,
47
+ `\uD83D\uDD04 Status: ${task.status} → stopped`,
48
+ `⏱️ Elapsed Time: ${formatDuration(elapsedMs)}`,
49
+ "",
50
+ result.message
51
+ ].join(`
52
+ `);
53
+ return {
54
+ success: true,
55
+ output,
56
+ metadata: {
57
+ execution_time_ms: Date.now() - startTime,
58
+ task_id,
59
+ previous_status: task.status
60
+ }
61
+ };
62
+ } else {
63
+ const task = result.task;
64
+ let output;
65
+ if (task) {
66
+ output = [
67
+ `⚠️ Cannot stop task`,
68
+ "",
69
+ `\uD83D\uDCCB Task ID: ${task_id}`,
70
+ `\uD83D\uDCDD Description: ${task.description}`,
71
+ `\uD83D\uDD04 Current Status: ${task.status}`,
72
+ "",
73
+ result.message
74
+ ].join(`
75
+ `);
76
+ } else {
77
+ output = [
78
+ `❌ Task not found`,
79
+ "",
80
+ `\uD83D\uDCCB Task ID: ${task_id}`,
81
+ "",
82
+ result.message
83
+ ].join(`
84
+ `);
85
+ }
86
+ return {
87
+ success: false,
88
+ output,
89
+ error: result.message,
90
+ metadata: {
91
+ execution_time_ms: Date.now() - startTime,
92
+ task_id
93
+ }
94
+ };
95
+ }
96
+ }
97
+ };
98
+ }
99
+ export { createStopTool };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createLogger,
3
3
  init_logger
4
- } from "./roy-agent-core-y0k9kaxz.js";
4
+ } from "./roy-agent-core-6awgfh3x.js";
5
5
  import {
6
6
  __require
7
7
  } from "./roy-agent-core-fs0mn2jk.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DAGManager,
3
3
  init_dag_manager
4
- } from "./roy-agent-core-60p2380d.js";
4
+ } from "./roy-agent-core-p6a4v4fq.js";
5
5
 
6
6
  // src/env/workflow/utils/node-output-contracts.ts
7
7
  var VIRTUAL_OUTPUT_FIELD = "output";
@@ -6,11 +6,11 @@ import {
6
6
  } from "./roy-agent-core-7hh0brvs.js";
7
7
  import {
8
8
  BaseComponent
9
- } from "./roy-agent-core-9s3payp1.js";
9
+ } from "./roy-agent-core-gtdtzbs7.js";
10
10
  import {
11
11
  createLogger,
12
12
  init_logger
13
- } from "./roy-agent-core-y0k9kaxz.js";
13
+ } from "./roy-agent-core-6awgfh3x.js";
14
14
 
15
15
  // src/env/skill/skill-component.ts
16
16
  init_logger();
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  TracedAs,
3
3
  init_decorator
4
- } from "./roy-agent-core-2qkrpc7m.js";
4
+ } from "./roy-agent-core-386wa4wy.js";
5
5
  import {
6
6
  createLogger,
7
7
  init_logger
8
- } from "./roy-agent-core-y0k9kaxz.js";
8
+ } from "./roy-agent-core-6awgfh3x.js";
9
9
  import {
10
10
  __legacyDecorateClassTS
11
11
  } from "./roy-agent-core-fs0mn2jk.js";
@@ -20,5 +20,11 @@ function escapeXmlAttr(value) {
20
20
  function escapeXmlText(value) {
21
21
  return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
22
22
  }
23
+ function countLarkMentions(content) {
24
+ if (!content)
25
+ return 0;
26
+ const matches = content.match(/<at\s+user_id\s*=\s*(?:"[^"]+"|'[^']+'|[^\s>]+)/g);
27
+ return matches ? matches.length : 0;
28
+ }
23
29
 
24
- export { normalizeLarkAtMentions };
30
+ export { normalizeLarkAtMentions, countLarkMentions };
@@ -3,11 +3,11 @@ import {
3
3
  hasDecoratorNodes,
4
4
  init_node_registry_helper,
5
5
  registerDecoratorNodeType
6
- } from "./roy-agent-core-g44nbgtt.js";
6
+ } from "./roy-agent-core-dfqhc9ey.js";
7
7
  import"./roy-agent-core-1ce3fqrk.js";
8
8
  import"./roy-agent-core-ddwa0n6h.js";
9
- import"./roy-agent-core-2qkrpc7m.js";
10
- import"./roy-agent-core-y0k9kaxz.js";
9
+ import"./roy-agent-core-386wa4wy.js";
10
+ import"./roy-agent-core-6awgfh3x.js";
11
11
  import"./roy-agent-core-jnszp0jq.js";
12
12
  import"./roy-agent-core-fs0mn2jk.js";
13
13
  init_node_registry_helper();
@@ -2,11 +2,11 @@ import {
2
2
  WorkflowRepository,
3
3
  migrateEmptyTagsToDefault,
4
4
  rowToWorkflow
5
- } from "./roy-agent-core-qpqqx1wd.js";
6
- import"./roy-agent-core-3p59ap0x.js";
5
+ } from "./roy-agent-core-vwzan9v0.js";
6
+ import"./roy-agent-core-gc6wcd7z.js";
7
7
  import"./roy-agent-core-rvxg1wps.js";
8
- import"./roy-agent-core-2qkrpc7m.js";
9
- import"./roy-agent-core-y0k9kaxz.js";
8
+ import"./roy-agent-core-386wa4wy.js";
9
+ import"./roy-agent-core-6awgfh3x.js";
10
10
  import"./roy-agent-core-jnszp0jq.js";
11
11
  import"./roy-agent-core-fs0mn2jk.js";
12
12
  export {
@@ -8,7 +8,7 @@ import {
8
8
  } from "./roy-agent-core-qxnbvgwe.js";
9
9
  import {
10
10
  BaseComponent
11
- } from "./roy-agent-core-9s3payp1.js";
11
+ } from "./roy-agent-core-gtdtzbs7.js";
12
12
  import {
13
13
  __require
14
14
  } from "./roy-agent-core-fs0mn2jk.js";