@ai-setting/roy-agent-core 1.7.46 → 1.7.48

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 (59) hide show
  1. package/dist/config/index.js +4 -4
  2. package/dist/env/agent/index.js +7 -7
  3. package/dist/env/commands/index.js +4 -4
  4. package/dist/env/debug/index.js +4 -4
  5. package/dist/env/event-source/index.js +8 -7
  6. package/dist/env/hook/index.js +2 -2
  7. package/dist/env/index.js +24 -23
  8. package/dist/env/llm/index.js +5 -5
  9. package/dist/env/log-trace/index.js +4 -4
  10. package/dist/env/mcp/index.js +4 -4
  11. package/dist/env/memory/index.js +4 -4
  12. package/dist/env/plugin/index.js +8 -6
  13. package/dist/env/prompt/index.js +4 -4
  14. package/dist/env/session/index.js +7 -7
  15. package/dist/env/session/storage/index.js +3 -3
  16. package/dist/env/skill/index.js +4 -4
  17. package/dist/env/task/delegate/index.js +2 -2
  18. package/dist/env/task/index.js +6 -6
  19. package/dist/env/task/plugins/index.js +2 -2
  20. package/dist/env/task/storage/index.js +1 -1
  21. package/dist/env/tool/index.js +4 -4
  22. package/dist/env/workflow/engine/index.js +3 -3
  23. package/dist/env/workflow/index.js +11 -11
  24. package/dist/env/workflow/tools/index.js +8 -8
  25. package/dist/index.js +31 -30
  26. package/dist/shared/@ai-setting/{roy-agent-core-cysnmvcy.js → roy-agent-core-0r90298w.js} +1 -1
  27. package/dist/shared/@ai-setting/{roy-agent-core-qfktfbrr.js → roy-agent-core-1rm32m5t.js} +3 -3
  28. package/dist/shared/@ai-setting/{roy-agent-core-2f2nqx7g.js → roy-agent-core-3b2ceffs.js} +153 -60
  29. package/dist/shared/@ai-setting/{roy-agent-core-a236mps6.js → roy-agent-core-3j4by8rj.js} +35 -2
  30. package/dist/shared/@ai-setting/{roy-agent-core-wybj8emq.js → roy-agent-core-4m02hnqf.js} +1 -1
  31. package/dist/shared/@ai-setting/{roy-agent-core-jawzpf5k.js → roy-agent-core-4nnv0dze.js} +1 -1
  32. package/dist/shared/@ai-setting/{roy-agent-core-cw89yj9d.js → roy-agent-core-54wzmvnb.js} +1 -1
  33. package/dist/shared/@ai-setting/{roy-agent-core-jjw7xcxv.js → roy-agent-core-55hkeft7.js} +2 -2
  34. package/dist/shared/@ai-setting/{roy-agent-core-rmn29nrh.js → roy-agent-core-64f22h1g.js} +1 -11
  35. package/dist/shared/@ai-setting/{roy-agent-core-12d4qzmw.js → roy-agent-core-7p5zf8ay.js} +4 -4
  36. package/dist/shared/@ai-setting/{roy-agent-core-qhw8jp6j.js → roy-agent-core-83mk8wrn.js} +2 -2
  37. package/dist/shared/@ai-setting/roy-agent-core-ajtsk20z.js +2396 -0
  38. package/dist/shared/@ai-setting/{roy-agent-core-pc8x07p0.js → roy-agent-core-amp8qckb.js} +1 -1
  39. package/dist/shared/@ai-setting/roy-agent-core-az13yzmc.js +11 -0
  40. package/dist/shared/@ai-setting/{roy-agent-core-4w5vdzg8.js → roy-agent-core-bjrtwfta.js} +41 -6
  41. package/dist/shared/@ai-setting/{roy-agent-core-ts56bz5e.js → roy-agent-core-d94ddn0r.js} +3 -3
  42. package/dist/shared/@ai-setting/{roy-agent-core-rczz7e81.js → roy-agent-core-dabnevwe.js} +1 -1
  43. package/dist/shared/@ai-setting/{roy-agent-core-9t675te0.js → roy-agent-core-ead21w5c.js} +2 -2
  44. package/dist/shared/@ai-setting/{roy-agent-core-xv7k1p2j.js → roy-agent-core-gy1zfe0d.js} +2 -2
  45. package/dist/shared/@ai-setting/{roy-agent-core-4eke3pd4.js → roy-agent-core-h93v6p6y.js} +2 -2
  46. package/dist/shared/@ai-setting/{roy-agent-core-f18jk3cw.js → roy-agent-core-hxazjj4p.js} +1 -1
  47. package/dist/shared/@ai-setting/{roy-agent-core-3h7ajma5.js → roy-agent-core-jfptxs4f.js} +1 -1
  48. package/dist/shared/@ai-setting/{roy-agent-core-4m0t4y9w.js → roy-agent-core-nvcqp6p9.js} +1 -1
  49. package/dist/shared/@ai-setting/{roy-agent-core-jadrj0bz.js → roy-agent-core-p1p9mr8f.js} +13 -0
  50. package/dist/shared/@ai-setting/{roy-agent-core-ykrcrktp.js → roy-agent-core-pk1b3kvf.js} +1 -1
  51. package/dist/shared/@ai-setting/{roy-agent-core-n1ceexfz.js → roy-agent-core-qvaqmj3f.js} +1 -1
  52. package/dist/shared/@ai-setting/{roy-agent-core-6mnwqcqf.js → roy-agent-core-v5vs1jby.js} +1 -1
  53. package/dist/shared/@ai-setting/{roy-agent-core-9jmzyc8t.js → roy-agent-core-y1fp2mgf.js} +6 -31
  54. package/dist/shared/@ai-setting/{roy-agent-core-asxe1nt4.js → roy-agent-core-ygnva439.js} +2 -2
  55. package/dist/shared/@ai-setting/{roy-agent-core-8xgk89y4.js → roy-agent-core-yjqj3taz.js} +4 -4
  56. package/dist/shared/@ai-setting/{roy-agent-core-2ccy0zd2.js → roy-agent-core-zrgaemma.js} +1 -1
  57. package/dist/shared/@ai-setting/{roy-agent-core-r4z6h3ch.js → roy-agent-core-zy3hqfwg.js} +197 -19
  58. package/package.json +1 -1
  59. package/dist/shared/@ai-setting/roy-agent-core-0zgcfcnq.js +0 -1720
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  WorkflowComponent
3
- } from "../../shared/@ai-setting/roy-agent-core-12d4qzmw.js";
3
+ } from "../../shared/@ai-setting/roy-agent-core-7p5zf8ay.js";
4
4
  import"../../shared/@ai-setting/roy-agent-core-hkj5v9xq.js";
5
5
  import {
6
6
  Edge,
@@ -14,14 +14,14 @@ import {
14
14
  DecoratorNode,
15
15
  init_decorator_node
16
16
  } from "../../shared/@ai-setting/roy-agent-core-1ce3fqrk.js";
17
- import"../../shared/@ai-setting/roy-agent-core-2ccy0zd2.js";
18
- import"../../shared/@ai-setting/roy-agent-core-xv7k1p2j.js";
19
- import"../../shared/@ai-setting/roy-agent-core-4eke3pd4.js";
17
+ import"../../shared/@ai-setting/roy-agent-core-zrgaemma.js";
18
+ import"../../shared/@ai-setting/roy-agent-core-gy1zfe0d.js";
19
+ import"../../shared/@ai-setting/roy-agent-core-h93v6p6y.js";
20
20
  import"../../shared/@ai-setting/roy-agent-core-hhrg314p.js";
21
21
  import"../../shared/@ai-setting/roy-agent-core-8nv07zgr.js";
22
- import"../../shared/@ai-setting/roy-agent-core-rczz7e81.js";
22
+ import"../../shared/@ai-setting/roy-agent-core-dabnevwe.js";
23
23
  import"../../shared/@ai-setting/roy-agent-core-6atd905e.js";
24
- import"../../shared/@ai-setting/roy-agent-core-3h7ajma5.js";
24
+ import"../../shared/@ai-setting/roy-agent-core-jfptxs4f.js";
25
25
  import"../../shared/@ai-setting/roy-agent-core-yjjqm4ww.js";
26
26
  import"../../shared/@ai-setting/roy-agent-core-1db4vpc6.js";
27
27
  import"../../shared/@ai-setting/roy-agent-core-7exqwax1.js";
@@ -82,8 +82,8 @@ import {
82
82
  unresolvedVariable
83
83
  } from "../../shared/@ai-setting/roy-agent-core-jrj30vq3.js";
84
84
  import"../../shared/@ai-setting/roy-agent-core-rvxg1wps.js";
85
- import"../../shared/@ai-setting/roy-agent-core-ykrcrktp.js";
86
- import"../../shared/@ai-setting/roy-agent-core-r4z6h3ch.js";
85
+ import"../../shared/@ai-setting/roy-agent-core-pk1b3kvf.js";
86
+ import"../../shared/@ai-setting/roy-agent-core-zy3hqfwg.js";
87
87
  import"../../shared/@ai-setting/roy-agent-core-c1v263jn.js";
88
88
  import {
89
89
  AskUserError,
@@ -91,9 +91,9 @@ import {
91
91
  createWorkflowAskUserEvent
92
92
  } from "../../shared/@ai-setting/roy-agent-core-e25xkv53.js";
93
93
  import"../../shared/@ai-setting/roy-agent-core-7hh0brvs.js";
94
- import"../../shared/@ai-setting/roy-agent-core-9t675te0.js";
95
- import"../../shared/@ai-setting/roy-agent-core-cw89yj9d.js";
96
- import"../../shared/@ai-setting/roy-agent-core-a236mps6.js";
94
+ import"../../shared/@ai-setting/roy-agent-core-ead21w5c.js";
95
+ import"../../shared/@ai-setting/roy-agent-core-54wzmvnb.js";
96
+ import"../../shared/@ai-setting/roy-agent-core-3j4by8rj.js";
97
97
  import"../../shared/@ai-setting/roy-agent-core-wn59p0zw.js";
98
98
  import"../../shared/@ai-setting/roy-agent-core-zbb3sk72.js";
99
99
  import"../../shared/@ai-setting/roy-agent-core-a9pbda78.js";
@@ -24,9 +24,9 @@ import {
24
24
  getRunWorkflowTool,
25
25
  initRunWorkflowTool,
26
26
  resetRunWorkflowTool
27
- } from "../../../shared/@ai-setting/roy-agent-core-2ccy0zd2.js";
28
- import"../../../shared/@ai-setting/roy-agent-core-xv7k1p2j.js";
29
- import"../../../shared/@ai-setting/roy-agent-core-4eke3pd4.js";
27
+ } from "../../../shared/@ai-setting/roy-agent-core-zrgaemma.js";
28
+ import"../../../shared/@ai-setting/roy-agent-core-gy1zfe0d.js";
29
+ import"../../../shared/@ai-setting/roy-agent-core-h93v6p6y.js";
30
30
  import"../../../shared/@ai-setting/roy-agent-core-8nv07zgr.js";
31
31
  import {
32
32
  WORKFLOW_SUBMIT_OUTPUT_TOOL_NAME,
@@ -40,14 +40,14 @@ import"../../../shared/@ai-setting/roy-agent-core-6vbgswjw.js";
40
40
  import"../../../shared/@ai-setting/roy-agent-core-tm57tmds.js";
41
41
  import"../../../shared/@ai-setting/roy-agent-core-jrj30vq3.js";
42
42
  import"../../../shared/@ai-setting/roy-agent-core-rvxg1wps.js";
43
- import"../../../shared/@ai-setting/roy-agent-core-ykrcrktp.js";
44
- import"../../../shared/@ai-setting/roy-agent-core-r4z6h3ch.js";
43
+ import"../../../shared/@ai-setting/roy-agent-core-pk1b3kvf.js";
44
+ import"../../../shared/@ai-setting/roy-agent-core-zy3hqfwg.js";
45
45
  import"../../../shared/@ai-setting/roy-agent-core-c1v263jn.js";
46
46
  import"../../../shared/@ai-setting/roy-agent-core-e25xkv53.js";
47
47
  import"../../../shared/@ai-setting/roy-agent-core-7hh0brvs.js";
48
- import"../../../shared/@ai-setting/roy-agent-core-9t675te0.js";
49
- import"../../../shared/@ai-setting/roy-agent-core-cw89yj9d.js";
50
- import"../../../shared/@ai-setting/roy-agent-core-a236mps6.js";
48
+ import"../../../shared/@ai-setting/roy-agent-core-ead21w5c.js";
49
+ import"../../../shared/@ai-setting/roy-agent-core-54wzmvnb.js";
50
+ import"../../../shared/@ai-setting/roy-agent-core-3j4by8rj.js";
51
51
  import"../../../shared/@ai-setting/roy-agent-core-wn59p0zw.js";
52
52
  import"../../../shared/@ai-setting/roy-agent-core-zbb3sk72.js";
53
53
  import"../../../shared/@ai-setting/roy-agent-core-a9pbda78.js";
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  ConfigComponent
3
- } from "./shared/@ai-setting/roy-agent-core-f18jk3cw.js";
3
+ } from "./shared/@ai-setting/roy-agent-core-hxazjj4p.js";
4
4
  import {
5
5
  PromptComponent,
6
6
  PromptStore
7
- } from "./shared/@ai-setting/roy-agent-core-ts56bz5e.js";
7
+ } from "./shared/@ai-setting/roy-agent-core-d94ddn0r.js";
8
8
  import {
9
9
  LLMComponent,
10
10
  LLMConfigSchema,
@@ -12,7 +12,7 @@ import {
12
12
  ModelLimitsSchema,
13
13
  ProviderCapabilitiesSchema,
14
14
  ProviderConfigSchema
15
- } from "./shared/@ai-setting/roy-agent-core-9jmzyc8t.js";
15
+ } from "./shared/@ai-setting/roy-agent-core-y1fp2mgf.js";
16
16
  import"./shared/@ai-setting/roy-agent-core-adg9ghbt.js";
17
17
  import"./shared/@ai-setting/roy-agent-core-wjmwwc4a.js";
18
18
  import {
@@ -39,7 +39,7 @@ import {
39
39
  } from "./shared/@ai-setting/roy-agent-core-zjdzk1gg.js";
40
40
  import {
41
41
  DebugComponent
42
- } from "./shared/@ai-setting/roy-agent-core-cysnmvcy.js";
42
+ } from "./shared/@ai-setting/roy-agent-core-0r90298w.js";
43
43
  import {
44
44
  ReplFormatter,
45
45
  TraceFormatter,
@@ -47,7 +47,7 @@ import {
47
47
  } from "./shared/@ai-setting/roy-agent-core-rvv6ydff.js";
48
48
  import {
49
49
  MemoryComponent
50
- } from "./shared/@ai-setting/roy-agent-core-wybj8emq.js";
50
+ } from "./shared/@ai-setting/roy-agent-core-4m02hnqf.js";
51
51
  import {
52
52
  MemoryPlugin,
53
53
  createMemoryPlugin
@@ -55,7 +55,7 @@ import {
55
55
  import"./shared/@ai-setting/roy-agent-core-g1s2h0e5.js";
56
56
  import {
57
57
  SkillComponent
58
- } from "./shared/@ai-setting/roy-agent-core-6mnwqcqf.js";
58
+ } from "./shared/@ai-setting/roy-agent-core-v5vs1jby.js";
59
59
  import"./shared/@ai-setting/roy-agent-core-psvxt4c9.js";
60
60
  import"./shared/@ai-setting/roy-agent-core-3ztzc83c.js";
61
61
  import {
@@ -66,20 +66,20 @@ import {
66
66
  BaseEnvironment,
67
67
  generateDescendingId,
68
68
  generateId
69
- } from "./shared/@ai-setting/roy-agent-core-qhw8jp6j.js";
69
+ } from "./shared/@ai-setting/roy-agent-core-83mk8wrn.js";
70
70
  import {
71
71
  TaskComponent
72
- } from "./shared/@ai-setting/roy-agent-core-8xgk89y4.js";
72
+ } from "./shared/@ai-setting/roy-agent-core-yjqj3taz.js";
73
73
  import"./shared/@ai-setting/roy-agent-core-vsrfzaze.js";
74
74
  import"./shared/@ai-setting/roy-agent-core-rn57psp0.js";
75
75
  import"./shared/@ai-setting/roy-agent-core-amkqnyzy.js";
76
76
  import"./shared/@ai-setting/roy-agent-core-8gxth0eh.js";
77
- import"./shared/@ai-setting/roy-agent-core-4m0t4y9w.js";
77
+ import"./shared/@ai-setting/roy-agent-core-nvcqp6p9.js";
78
78
  import"./shared/@ai-setting/roy-agent-core-tbrn9wdm.js";
79
79
  import {
80
80
  SQLiteTaskStore,
81
81
  getDefaultTaskDbPath
82
- } from "./shared/@ai-setting/roy-agent-core-jadrj0bz.js";
82
+ } from "./shared/@ai-setting/roy-agent-core-p1p9mr8f.js";
83
83
  import {
84
84
  BountyIMInstance,
85
85
  EventSourceComponent,
@@ -92,11 +92,11 @@ import {
92
92
  larkCliHandler,
93
93
  resolveBountyIMSystemPrompt,
94
94
  timerHandler
95
- } from "./shared/@ai-setting/roy-agent-core-2f2nqx7g.js";
95
+ } from "./shared/@ai-setting/roy-agent-core-3b2ceffs.js";
96
96
  import {
97
97
  LogTraceComponent,
98
98
  LogTraceConfigSchema
99
- } from "./shared/@ai-setting/roy-agent-core-jawzpf5k.js";
99
+ } from "./shared/@ai-setting/roy-agent-core-4nnv0dze.js";
100
100
  import {
101
101
  BUILT_IN_EVENT_SOURCE_TYPES,
102
102
  BUILT_IN_EVENT_SOURCE_TYPE_LIST,
@@ -109,7 +109,7 @@ import {
109
109
  import {
110
110
  TaskTagPlugin,
111
111
  createAutoTaskPlugin
112
- } from "./shared/@ai-setting/roy-agent-core-0zgcfcnq.js";
112
+ } from "./shared/@ai-setting/roy-agent-core-ajtsk20z.js";
113
113
  import {
114
114
  EventStoreImpl,
115
115
  getSharedEventStore,
@@ -125,7 +125,7 @@ import {
125
125
  } from "./shared/@ai-setting/roy-agent-core-223v204d.js";
126
126
  import {
127
127
  WorkflowComponent
128
- } from "./shared/@ai-setting/roy-agent-core-12d4qzmw.js";
128
+ } from "./shared/@ai-setting/roy-agent-core-7p5zf8ay.js";
129
129
  import {
130
130
  init_node_registry_helper,
131
131
  registerDecoratorNodeType
@@ -138,18 +138,18 @@ import {
138
138
  createWorkflowFromClass
139
139
  } from "./shared/@ai-setting/roy-agent-core-h0x19xgn.js";
140
140
  import"./shared/@ai-setting/roy-agent-core-1ce3fqrk.js";
141
- import"./shared/@ai-setting/roy-agent-core-2ccy0zd2.js";
141
+ import"./shared/@ai-setting/roy-agent-core-zrgaemma.js";
142
142
  import {
143
143
  SessionComponent
144
- } from "./shared/@ai-setting/roy-agent-core-xv7k1p2j.js";
144
+ } from "./shared/@ai-setting/roy-agent-core-gy1zfe0d.js";
145
145
  import {
146
146
  MemorySessionStore
147
- } from "./shared/@ai-setting/roy-agent-core-4eke3pd4.js";
147
+ } from "./shared/@ai-setting/roy-agent-core-h93v6p6y.js";
148
148
  import"./shared/@ai-setting/roy-agent-core-hhrg314p.js";
149
149
  import"./shared/@ai-setting/roy-agent-core-8nv07zgr.js";
150
- import"./shared/@ai-setting/roy-agent-core-rczz7e81.js";
150
+ import"./shared/@ai-setting/roy-agent-core-dabnevwe.js";
151
151
  import"./shared/@ai-setting/roy-agent-core-6atd905e.js";
152
- import"./shared/@ai-setting/roy-agent-core-3h7ajma5.js";
152
+ import"./shared/@ai-setting/roy-agent-core-jfptxs4f.js";
153
153
  import"./shared/@ai-setting/roy-agent-core-yjjqm4ww.js";
154
154
  import"./shared/@ai-setting/roy-agent-core-1db4vpc6.js";
155
155
  import"./shared/@ai-setting/roy-agent-core-7exqwax1.js";
@@ -161,16 +161,16 @@ import"./shared/@ai-setting/roy-agent-core-jrj30vq3.js";
161
161
  import"./shared/@ai-setting/roy-agent-core-rvxg1wps.js";
162
162
  import {
163
163
  CommandsComponent
164
- } from "./shared/@ai-setting/roy-agent-core-n1ceexfz.js";
164
+ } from "./shared/@ai-setting/roy-agent-core-qvaqmj3f.js";
165
165
  import {
166
166
  AgentComponent,
167
167
  AgentComponentConfigSchema
168
- } from "./shared/@ai-setting/roy-agent-core-4w5vdzg8.js";
168
+ } from "./shared/@ai-setting/roy-agent-core-bjrtwfta.js";
169
169
  import {
170
170
  ToolComponent,
171
171
  ToolRegistry,
172
172
  ToolValidator
173
- } from "./shared/@ai-setting/roy-agent-core-jjw7xcxv.js";
173
+ } from "./shared/@ai-setting/roy-agent-core-55hkeft7.js";
174
174
  import"./shared/@ai-setting/roy-agent-core-kzg1jwt8.js";
175
175
  import {
176
176
  AgentRegistry
@@ -181,7 +181,7 @@ import {
181
181
  getXDGPaths
182
182
  } from "./shared/@ai-setting/roy-agent-core-qxnbvgwe.js";
183
183
  import"./shared/@ai-setting/roy-agent-core-4cj6hram.js";
184
- import"./shared/@ai-setting/roy-agent-core-ykrcrktp.js";
184
+ import"./shared/@ai-setting/roy-agent-core-pk1b3kvf.js";
185
185
  import {
186
186
  buildOpencodeHeaders,
187
187
  createInvokeConfig,
@@ -190,7 +190,7 @@ import {
190
190
  isOpencodeEndpoint,
191
191
  isOpencodeProvider,
192
192
  parseModelString
193
- } from "./shared/@ai-setting/roy-agent-core-r4z6h3ch.js";
193
+ } from "./shared/@ai-setting/roy-agent-core-zy3hqfwg.js";
194
194
  import"./shared/@ai-setting/roy-agent-core-c1v263jn.js";
195
195
  import {
196
196
  AskUserError,
@@ -198,13 +198,14 @@ import {
198
198
  } from "./shared/@ai-setting/roy-agent-core-e25xkv53.js";
199
199
  import {
200
200
  PluginComponent
201
- } from "./shared/@ai-setting/roy-agent-core-qfktfbrr.js";
201
+ } from "./shared/@ai-setting/roy-agent-core-1rm32m5t.js";
202
+ import"./shared/@ai-setting/roy-agent-core-64f22h1g.js";
202
203
  import {
203
204
  BasePlugin
204
- } from "./shared/@ai-setting/roy-agent-core-rmn29nrh.js";
205
+ } from "./shared/@ai-setting/roy-agent-core-az13yzmc.js";
205
206
  import {
206
207
  McpComponent
207
- } from "./shared/@ai-setting/roy-agent-core-pc8x07p0.js";
208
+ } from "./shared/@ai-setting/roy-agent-core-amp8qckb.js";
208
209
  import"./shared/@ai-setting/roy-agent-core-8t7wny6v.js";
209
210
  import {
210
211
  AgentError,
@@ -220,15 +221,15 @@ import {
220
221
  import"./shared/@ai-setting/roy-agent-core-7hh0brvs.js";
221
222
  import {
222
223
  BaseComponent
223
- } from "./shared/@ai-setting/roy-agent-core-9t675te0.js";
224
+ } from "./shared/@ai-setting/roy-agent-core-ead21w5c.js";
224
225
  import {
225
226
  createHook,
226
227
  createPriorityHook
227
- } from "./shared/@ai-setting/roy-agent-core-cw89yj9d.js";
228
+ } from "./shared/@ai-setting/roy-agent-core-54wzmvnb.js";
228
229
  import {
229
230
  HookManager,
230
231
  globalHookManager
231
- } from "./shared/@ai-setting/roy-agent-core-a236mps6.js";
232
+ } from "./shared/@ai-setting/roy-agent-core-3j4by8rj.js";
232
233
  import"./shared/@ai-setting/roy-agent-core-wn59p0zw.js";
233
234
  import"./shared/@ai-setting/roy-agent-core-zbb3sk72.js";
234
235
  import {
@@ -4,7 +4,7 @@ import {
4
4
  } from "./roy-agent-core-rvv6ydff.js";
5
5
  import {
6
6
  BaseComponent
7
- } from "./roy-agent-core-9t675te0.js";
7
+ } from "./roy-agent-core-ead21w5c.js";
8
8
  import {
9
9
  __require
10
10
  } from "./roy-agent-core-fs0mn2jk.js";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  BasePlugin
3
- } from "./roy-agent-core-rmn29nrh.js";
3
+ } from "./roy-agent-core-az13yzmc.js";
4
4
  import {
5
5
  BaseComponent
6
- } from "./roy-agent-core-9t675te0.js";
6
+ } from "./roy-agent-core-ead21w5c.js";
7
7
  import {
8
8
  globalHookManager,
9
9
  init_global_hook_manager
10
- } from "./roy-agent-core-a236mps6.js";
10
+ } from "./roy-agent-core-3j4by8rj.js";
11
11
  import {
12
12
  init_context
13
13
  } from "./roy-agent-core-wn59p0zw.js";
@@ -4,24 +4,25 @@ import {
4
4
  import {
5
5
  TaskTagPlugin,
6
6
  createLarkCliTaskNotifyHook,
7
- createPerTaskGroupChatPlugin
8
- } from "./roy-agent-core-0zgcfcnq.js";
7
+ createPerTaskGroupChatPlugin,
8
+ mergeChatOwnership
9
+ } from "./roy-agent-core-ajtsk20z.js";
9
10
  import {
10
11
  getSharedEventStore
11
12
  } from "./roy-agent-core-xyys5m1a.js";
12
13
  import {
13
14
  normalizeLarkAtMentions
14
- } from "./roy-agent-core-rmn29nrh.js";
15
+ } from "./roy-agent-core-64f22h1g.js";
15
16
  import {
16
17
  envKeyToConfigKey
17
18
  } from "./roy-agent-core-7hh0brvs.js";
18
19
  import {
19
20
  BaseComponent
20
- } from "./roy-agent-core-9t675te0.js";
21
+ } from "./roy-agent-core-ead21w5c.js";
21
22
  import {
22
23
  globalHookManager,
23
24
  init_global_hook_manager
24
- } from "./roy-agent-core-a236mps6.js";
25
+ } from "./roy-agent-core-3j4by8rj.js";
25
26
  import {
26
27
  init_context
27
28
  } from "./roy-agent-core-wn59p0zw.js";
@@ -881,6 +882,23 @@ function buildLarkRecommendedAction(opts) {
881
882
  `处理飞书 ${scopeWord}消息并以机器人身份回复${profileWarn}。`,
882
883
  `scope: ${scopeHint}。`,
883
884
  ``,
885
+ `## ⭐ 关键 0:单条结构化 post(一次 send / 单条 ≤4096 字符 / 禁分段)`,
886
+ `**整次回复只能发一条**结构化 post 消息——把全部内容写进单个 md 节点的 text 里`,
887
+ `(飞书单条 post 文本上限 4096 字符,指**单条消息**而非分段总和)。`,
888
+ `**禁止分段**——不要把回复拆成多条消息循环 send(不要分 2 条 / 3 条 / 5 条 / 若干条、`,
889
+ `不要 for 循环多次 send、不要每次只发一部分"待续")。`,
890
+ `**禁止拆成多次 send**——单条回复就**只调一次**\`lark-cli ... +messages-send\` / `,
891
+ `\`+messages-reply\`,发完即结束。`,
892
+ ``,
893
+ `- 整次响应**只调一次** lark-cli 命令(单次调用 / 只 send 一次 / 只发一条)`,
894
+ `- "只 send 一次" 指"只 send 一条回复内容"——失败时用同一 idempotency-key 重发同一内容`,
895
+ ` 仍算"只 send 一次"(飞书层面幂等去重),不是分段、不是拆段`,
896
+ `- 单条 post 内容上限 4096 字符(指单条消息),内容超长就压缩正文、不要拆段`,
897
+ `- 不需要"先把单条回复切成若干段 ≤4096 字符分别 send"——这条路径是**禁用模式**`,
898
+ ` - 拆段发送会导致:① webhook 重复通知(#4137)② msg 进 thread 折叠丢失(#4171)`,
899
+ ` ③ review 暴露多个 sub-agent 自行拼接 flag 的偏移指令语义(#4241)`,
900
+ ` - 触发根因:sub-agent 自行循环 send + 各自拼 flag,与主会话不一致`,
901
+ ``,
884
902
  `## ⭐ 关键 1: 飞书回复必须用结构化 post content(--msg-type post --content)`,
885
903
  `lark-cli 默认把消息当 plain text;而 @mention 只有在**结构化 at 节点**里才会被`,
886
904
  `飞书识别为真实 @。所以回复统一走 post 的 --content JSON:`,
@@ -918,6 +936,11 @@ function buildLarkRecommendedAction(opts) {
918
936
  `- 禁止把多行 Markdown 直接拼进 --content 参数(必须走上面的 jq --rawfile)`,
919
937
  `- 禁止字面反斜杠+n(即 \\n 两个字符,不是 0x0A 控制字符)`,
920
938
  `- 禁止 bash ANSI-C 引号语法(dollar 符号紧跟单引号)`,
939
+ `- 禁止分段发送:禁止把单条回复拆成多条 ≤4096 字符的子段循环 send,`,
940
+ ` 禁止用 for / while 循环多次调 lark-cli 拼多 send,`,
941
+ ` 禁止每次只发一部分"待续"。整次响应只调一次 lark-cli 命令(只 send 一次 / 只发一条 / 单次调用)。`,
942
+ `- 禁止 --reply-in-thread(消息会路由进 thread,主聊天流折叠预览看不到后续消息,`,
943
+ ` 实测导致 msg-5/6/7 丢失,详见 #4171)`,
921
944
  ``,
922
945
  `## ⭐ 关键 3:出站必须显式 --as bot,禁止走 api POST`,
923
946
  `所有出站命令**照抄下面模板**(--as bot 已写死在命令里,不要自己重写、不要省 flag):`,
@@ -942,6 +965,51 @@ function buildLarkRecommendedAction(opts) {
942
965
  ` - 假失败 → 重发 → 形成 3 份相同消息`,
943
966
  `- 重试建议:固定 idempotency-key(飞书层面去重),不要靠内容 hash 自检`,
944
967
  ``,
968
+ `## ⭐ 关键 4:禁止分段响应——单条结构化消息足够`,
969
+ `飞书单条消息支持最长 **4096 字符**,足够放下任何调研/修复/长报告。`,
970
+ `把全部内容写进一条 post 里一次性发完;不要再用多条 send/reply 拼成分段响应。`,
971
+ ``,
972
+ `**绝对禁止(sub-agent 自己拼 bash 做 send 循环的 4 类陷阱)**:`,
973
+ `- **禁止用多个 \`im +messages-send\` / \`im +messages-reply\` 拼接成 5-10 条分段响应**`,
974
+ ` - 群里如果出现 7-13 条由同一 sub-agent 发出的"陆续更新",就是这条违规`,
975
+ `- **禁止把一份长报告拆成 N 条"陆续发"**(哪怕每条都未超限)`,
976
+ ` - 用户体验混乱:消息流被淹没,跟读成本指数级上升`,
977
+ ` - 部分消息还会被折叠/丢失(thread、超长截断、幂等 hash)`,
978
+ `- **禁止在子任务结束后再发第 2 条 "更新"**(一条就够了,不要"补一句")`,
979
+ `- **禁止在写到一半时先发一条占位回复,再发完整版**(直接发完整版)`,
980
+ ``,
981
+ `**正确做法——一次性写进一条结构化 post JSON**:`,
982
+ ` body_file="$(mktemp /tmp/lark-reply.XXXXXX.md)"`,
983
+ ` trap 'rm -f "$body_file"' EXIT`,
984
+ ` cat > "$body_file" <<'LARK_REPLY_EOF'`,
985
+ `# 任务报告标题`,
986
+ ``,
987
+ `## 关键发现`,
988
+ `- 要点 1(含图表、表格、代码块、引用都可放)`,
989
+ `- 要点 2`,
990
+ ``,
991
+ `## 操作步骤`,
992
+ `1. 步骤一`,
993
+ `2. 步骤二`,
994
+ ``,
995
+ `<!-- 极长内容用 Markdown 折叠让用户自己展开 --> `,
996
+ `<details>`,
997
+ `<summary>展开完整日志/trace/参考链接</summary>`,
998
+ ``,
999
+ `很长的内容放这里(单条最多接近 4096 字符),用户需要时点 summary 展开`,
1000
+ ``,
1001
+ `</details>`,
1002
+ `LARK_REPLY_EOF`,
1003
+ ` content="$(jq -nc --rawfile md "$body_file" '{zh_cn:{content:[[{tag:"md",text:$md}]]}}')"`,
1004
+ ` lark-cli ${profileFlag}im +messages-send --chat-id <取自 replyTo.chatId> --as bot --msg-type post --content "$content"`,
1005
+ ``,
1006
+ `要点:`,
1007
+ `- **一条 post 消息** = 一个 mktemp + 一个 jq 组装 + **一个** lark-cli send 调用`,
1008
+ `- 长内容用 Markdown \`<details>/<summary>\` 折叠(飞书 md 节点支持)`,
1009
+ `- 表格/列表/代码块/标题在单条 md 节点里全部可用,不需要分条`,
1010
+ `- **绝不能加 \`--reply-in-thread\`**(会把消息路由进 thread,主聊天流看不到——见 #4171 教训)`,
1011
+ `- 如果你觉得自己想发第 2 条 "更新",停下来:第 1 条已经够了,再发就是违规`,
1012
+ ``,
945
1013
  `## 必须使用 replyTo 里给定的值`,
946
1014
  `profile / chatId / messageId / --as bot 必须原样取自 recommendedAction.replyTo;不要凭印象自己拼接。`
947
1015
  ].join(`
@@ -1028,6 +1096,9 @@ class LarkCliInstance {
1028
1096
  child;
1029
1097
  buffer = "";
1030
1098
  eventHandler;
1099
+ cardRoutingPorts;
1100
+ chatNameCache = new Map;
1101
+ pluginInstances = new Map;
1031
1102
  static SHARED_SEEN = new Map;
1032
1103
  static SHARED_MSG_TTL_MS = 10 * 60 * 1000;
1033
1104
  static SHARED_MSG_MAX = 1000;
@@ -1138,6 +1209,7 @@ class LarkCliInstance {
1138
1209
  for (const pluginName of plugins) {
1139
1210
  const plugin = await this.importPlugin(pluginName);
1140
1211
  if (plugin) {
1212
+ this.pluginInstances.set(pluginName, plugin);
1141
1213
  const hookPoints = this.getPluginHookPoints(plugin);
1142
1214
  this.registerPluginHooks(plugin);
1143
1215
  this.loadedPlugins.push({
@@ -1149,6 +1221,20 @@ class LarkCliInstance {
1149
1221
  console.error(`[LarkCliInstance] Failed to import plugin "${pluginName}". ` + `plugin name=${pluginName} 不在 BUILT_IN_PLUGIN_FACTORIES 注册表里`);
1150
1222
  }
1151
1223
  }
1224
+ this.wireCardRoutingGroupProvider();
1225
+ }
1226
+ wireCardRoutingGroupProvider() {
1227
+ const notifyHook = this.pluginInstances.get("LarkCliTaskNotifyPlugin");
1228
+ const perTaskGroup = this.pluginInstances.get("PerTaskGroupChatPlugin");
1229
+ if (!notifyHook || typeof notifyHook.setCardRoutingPorts !== "function")
1230
+ return;
1231
+ if (!perTaskGroup || typeof perTaskGroup.ensureGroupChat !== "function")
1232
+ return;
1233
+ notifyHook.setCardRoutingPorts({
1234
+ ...this.cardRoutingPorts ?? {},
1235
+ ensureTaskGroupChat: (task) => perTaskGroup.ensureGroupChat(task)
1236
+ });
1237
+ console.debug("[LarkCliInstance] Card routing cross-wired: " + "LarkCliTaskNotifyPlugin.ensureTaskGroupChat ← PerTaskGroupChatPlugin");
1152
1238
  }
1153
1239
  getPluginHookPoints(plugin) {
1154
1240
  if (Array.isArray(plugin.hooks)) {
@@ -1190,6 +1276,7 @@ class LarkCliInstance {
1190
1276
  this.injectTaskUpdater(plugin);
1191
1277
  this.injectTaskGetter(plugin);
1192
1278
  this.injectSessionComponent(plugin);
1279
+ this.injectCardRoutingPorts(plugin);
1193
1280
  if (typeof plugin.init === "function") {
1194
1281
  const pluginEnv = {
1195
1282
  getComponent: () => null,
@@ -1294,6 +1381,67 @@ class LarkCliInstance {
1294
1381
  }
1295
1382
  plugin.setTaskGetter((id) => taskComponent.getTask(id));
1296
1383
  }
1384
+ injectCardRoutingPorts(plugin) {
1385
+ if (typeof plugin.setCardRoutingPorts !== "function")
1386
+ return;
1387
+ const taskComponent = this.environment?.getComponent?.("task");
1388
+ const sessionComponent = this.environment?.getComponent?.("session");
1389
+ const lookupChatOwnership = async (chatId) => {
1390
+ if (!chatId)
1391
+ return;
1392
+ try {
1393
+ let boundTaskId;
1394
+ if (sessionComponent?.getChatTaskBinding) {
1395
+ try {
1396
+ const binding = await sessionComponent.getChatTaskBinding(chatId);
1397
+ if (binding && typeof binding.taskId === "number") {
1398
+ boundTaskId = binding.taskId;
1399
+ }
1400
+ } catch {}
1401
+ }
1402
+ let candidates = [];
1403
+ if (taskComponent?.findTasksByContextValue) {
1404
+ const tasks = await taskComponent.findTasksByContextValue(chatId, 50);
1405
+ candidates = (tasks ?? []).map((t) => ({
1406
+ id: t.id,
1407
+ context: t.context
1408
+ }));
1409
+ }
1410
+ const chatName = await this.lookupChatName(chatId);
1411
+ return mergeChatOwnership(chatId, candidates, { boundTaskId, chatName });
1412
+ } catch (error) {
1413
+ if (isPluginDebugEnabled()) {
1414
+ console.debug(`[LarkCliInstance] lookupChatOwnership failed for ${chatId}: ${error}`);
1415
+ }
1416
+ return;
1417
+ }
1418
+ };
1419
+ this.cardRoutingPorts = {
1420
+ lookupChatOwnership,
1421
+ getTask: taskComponent?.getTask ? (id) => taskComponent.getTask(id) : undefined
1422
+ };
1423
+ plugin.setCardRoutingPorts({ ...this.cardRoutingPorts });
1424
+ }
1425
+ async lookupChatName(chatId) {
1426
+ const cached = this.chatNameCache.get(chatId);
1427
+ if (cached !== undefined)
1428
+ return cached || undefined;
1429
+ try {
1430
+ const runner = getLarkCliRunner();
1431
+ const result = await runner.run(`lark-cli ${this.config.profile ? `--profile ${this.config.profile} ` : ""}im chats get --chat-id ${chatId}`);
1432
+ if (result.code !== 0) {
1433
+ this.chatNameCache.set(chatId, "");
1434
+ return;
1435
+ }
1436
+ const parsed = JSON.parse(result.stdout || "{}");
1437
+ const name = parsed?.data?.name ?? parsed?.data?.chat?.name ?? parsed?.name;
1438
+ this.chatNameCache.set(chatId, typeof name === "string" ? name : "");
1439
+ return typeof name === "string" ? name : undefined;
1440
+ } catch {
1441
+ this.chatNameCache.set(chatId, "");
1442
+ return;
1443
+ }
1444
+ }
1297
1445
  injectSessionComponent(plugin) {
1298
1446
  if (typeof plugin.setSessionComponent !== "function") {
1299
1447
  return;
@@ -1797,28 +1945,6 @@ ${headline}
1797
1945
  },
1798
1946
  setRunner(runner) {
1799
1947
  setLarkCliRunner(runner);
1800
- },
1801
- async postProcessNotifyEvent(input) {
1802
- try {
1803
- const chats = dedupeChatIds(input.resolvedChatIds ?? []);
1804
- if (chats.length === 0) {
1805
- logger.info(`[larkCliHandler] postProcessNotifyEvent: no resolved target chat for ` + `taskId=${input.notifyEvent.taskId}; skip mirror.`);
1806
- return;
1807
- }
1808
- for (const chatId of chats) {
1809
- try {
1810
- await sendMarkdownToChat(chatId, input.formattedPrompt, input.profile);
1811
- } catch (err) {
1812
- const errMsg = err instanceof Error ? err.message : String(err);
1813
- logger.error(`[larkCliHandler] postProcessNotifyEvent: send failed for chatId=${chatId}`, { error: errMsg });
1814
- }
1815
- }
1816
- } catch (err) {
1817
- const errMsg = err instanceof Error ? err.message : String(err);
1818
- logger.error(`[larkCliHandler] postProcessNotifyEvent failed`, {
1819
- error: errMsg
1820
- });
1821
- }
1822
1948
  }
1823
1949
  };
1824
1950
  if (larkCliHandler.extractReplyContext) {
@@ -1827,39 +1953,6 @@ if (larkCliHandler.extractReplyContext) {
1827
1953
  if (larkCliHandler.buildNotifyHandlePrompt) {
1828
1954
  larkCliHandler.buildNotifyHandlePrompt = wrapFunction(larkCliHandler.buildNotifyHandlePrompt, "buildNotifyHandlePrompt", { recordParams: true, recordResult: false, recordError: true });
1829
1955
  }
1830
- if (larkCliHandler.postProcessNotifyEvent) {
1831
- larkCliHandler.postProcessNotifyEvent = wrapFunction(larkCliHandler.postProcessNotifyEvent, "postProcessNotifyEvent", {
1832
- recordParams: true,
1833
- recordResult: false,
1834
- recordError: true,
1835
- paramFilter: (args) => ({
1836
- taskId: args[0]?.notifyEvent?.taskId,
1837
- resolvedChatIds: args[0]?.resolvedChatIds
1838
- }),
1839
- flattenParamFilter: true
1840
- });
1841
- }
1842
- function dedupeChatIds(ids) {
1843
- const out = [];
1844
- const seen = new Set;
1845
- for (const id of ids) {
1846
- if (typeof id === "string" && id.length > 0 && !seen.has(id)) {
1847
- seen.add(id);
1848
- out.push(id);
1849
- }
1850
- }
1851
- return out;
1852
- }
1853
- async function sendMarkdownToChat(chatId, markdown, profile) {
1854
- const profileFlag = profile ? `--profile ${profile} ` : "";
1855
- const runner = getLarkCliRunner();
1856
- const safeMd = markdown.replace(/'/g, `'\\''`);
1857
- const command = `lark-cli ${profileFlag}im +messages-send ` + `--chat-id "${chatId}" --as bot --markdown '${safeMd}'`;
1858
- const result = await runner.run(command);
1859
- if (result.code !== 0) {
1860
- throw new Error(`messages-send exit ${result.code}: ${result.stderr || "(no stderr)"}`);
1861
- }
1862
- }
1863
1956
  var _larkCliRunner = defaultLarkCliRunner;
1864
1957
  function getLarkCliRunner() {
1865
1958
  return _larkCliRunner;