@ai-setting/roy-agent-core 1.5.85 → 1.5.87

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/dist/env/event-source/index.js +8 -4
  2. package/dist/env/index.js +9 -9
  3. package/dist/env/task/delegate/index.js +1 -1
  4. package/dist/env/task/index.js +3 -3
  5. package/dist/env/task/tools/index.js +1 -1
  6. package/dist/env/tool/built-in/index.js +3 -1
  7. package/dist/env/tool/index.js +2 -2
  8. package/dist/env/workflow/engine/index.js +2 -2
  9. package/dist/env/workflow/index.js +4 -4
  10. package/dist/env/workflow/nodes/index.js +1 -1
  11. package/dist/env/workflow/tools/index.js +1 -1
  12. package/dist/index.js +17 -13
  13. package/dist/shared/@ai-setting/{roy-agent-core-r5axf0ad.js → roy-agent-core-0y64qaac.js} +47 -36
  14. package/dist/shared/@ai-setting/{roy-agent-core-ya1ayt1k.js → roy-agent-core-6mk0m4t3.js} +218 -4
  15. package/dist/shared/@ai-setting/{roy-agent-core-dp73ghtz.js → roy-agent-core-6n7xwv4v.js} +2 -2
  16. package/dist/shared/@ai-setting/{roy-agent-core-7nh5h9fn.js → roy-agent-core-9vwyj29a.js} +7 -3
  17. package/dist/shared/@ai-setting/{roy-agent-core-gttz2jpm.js → roy-agent-core-9y09xfav.js} +10 -2
  18. package/dist/shared/@ai-setting/{roy-agent-core-0kt57b72.js → roy-agent-core-bgw4dq11.js} +1 -1
  19. package/dist/shared/@ai-setting/{roy-agent-core-j754zgb4.js → roy-agent-core-hc20420t.js} +1 -1
  20. package/dist/shared/@ai-setting/{roy-agent-core-xb4hvk1m.js → roy-agent-core-qhhxx2x2.js} +2 -1
  21. package/dist/shared/@ai-setting/{roy-agent-core-8pk6a00t.js → roy-agent-core-qhjb153z.js} +7 -2
  22. package/dist/shared/@ai-setting/{roy-agent-core-dv12wpdv.js → roy-agent-core-r1adqgaa.js} +2 -2
  23. package/dist/shared/@ai-setting/{roy-agent-core-9mj7vzsm.js → roy-agent-core-vneyghpg.js} +1 -1
  24. package/package.json +1 -1
  25. /package/dist/shared/@ai-setting/{roy-agent-core-pwzkgtgr.js → roy-agent-core-3arrpf7n.js} +0 -0
  26. /package/dist/shared/@ai-setting/{roy-agent-core-2grcjaad.js → roy-agent-core-4f3976cd.js} +0 -0
@@ -1,10 +1,12 @@
1
- import"../../shared/@ai-setting/roy-agent-core-2grcjaad.js";
1
+ import"../../shared/@ai-setting/roy-agent-core-4f3976cd.js";
2
2
  import {
3
3
  EventSourceComponent,
4
+ TimerInstance,
4
5
  builtInHandlers,
5
6
  getBuiltInHandler,
6
- larkCliHandler
7
- } from "../../shared/@ai-setting/roy-agent-core-ya1ayt1k.js";
7
+ larkCliHandler,
8
+ timerHandler
9
+ } from "../../shared/@ai-setting/roy-agent-core-6mk0m4t3.js";
8
10
  import {
9
11
  BUILT_IN_EVENT_SOURCE_TYPES,
10
12
  BUILT_IN_EVENT_SOURCE_TYPE_LIST,
@@ -13,7 +15,7 @@ import {
13
15
  isBuiltInEventSourceType,
14
16
  isValidEventSourceType,
15
17
  validateEventSourceConfig
16
- } from "../../shared/@ai-setting/roy-agent-core-xb4hvk1m.js";
18
+ } from "../../shared/@ai-setting/roy-agent-core-qhhxx2x2.js";
17
19
  import"../../shared/@ai-setting/roy-agent-core-v8xa6vs8.js";
18
20
  import"../../shared/@ai-setting/roy-agent-core-7fdzfsm6.js";
19
21
  import"../../shared/@ai-setting/roy-agent-core-az13yzmc.js";
@@ -31,12 +33,14 @@ import"../../shared/@ai-setting/roy-agent-core-c6592r3c.js";
31
33
  import"../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
32
34
  export {
33
35
  validateEventSourceConfig,
36
+ timerHandler,
34
37
  larkCliHandler,
35
38
  isValidEventSourceType,
36
39
  isBuiltInEventSourceType,
37
40
  getDefaultConfigForType,
38
41
  getBuiltInHandler,
39
42
  builtInHandlers,
43
+ TimerInstance,
40
44
  EventSourceInitHooks,
41
45
  EventSourceComponent,
42
46
  BUILT_IN_EVENT_SOURCE_TYPE_LIST,
package/dist/env/index.js CHANGED
@@ -5,14 +5,14 @@ import {
5
5
  EventSourceComponent,
6
6
  builtInHandlers,
7
7
  larkCliHandler
8
- } from "../shared/@ai-setting/roy-agent-core-ya1ayt1k.js";
8
+ } from "../shared/@ai-setting/roy-agent-core-6mk0m4t3.js";
9
9
  import {
10
10
  EventSourceInitHooks,
11
11
  getDefaultConfigForType,
12
12
  isBuiltInEventSourceType,
13
13
  isValidEventSourceType,
14
14
  validateEventSourceConfig
15
- } from "../shared/@ai-setting/roy-agent-core-xb4hvk1m.js";
15
+ } from "../shared/@ai-setting/roy-agent-core-qhhxx2x2.js";
16
16
  import"../shared/@ai-setting/roy-agent-core-v8xa6vs8.js";
17
17
  import {
18
18
  PluginComponent
@@ -21,17 +21,17 @@ import"../shared/@ai-setting/roy-agent-core-7fdzfsm6.js";
21
21
  import"../shared/@ai-setting/roy-agent-core-az13yzmc.js";
22
22
  import {
23
23
  WorkflowComponent
24
- } from "../shared/@ai-setting/roy-agent-core-dp73ghtz.js";
24
+ } from "../shared/@ai-setting/roy-agent-core-6n7xwv4v.js";
25
25
  import"../shared/@ai-setting/roy-agent-core-fjexv5nm.js";
26
- import"../shared/@ai-setting/roy-agent-core-gttz2jpm.js";
26
+ import"../shared/@ai-setting/roy-agent-core-9y09xfav.js";
27
27
  import"../shared/@ai-setting/roy-agent-core-5kdw0p98.js";
28
28
  import"../shared/@ai-setting/roy-agent-core-6atd905e.js";
29
29
  import"../shared/@ai-setting/roy-agent-core-gb9gbkc3.js";
30
30
  import"../shared/@ai-setting/roy-agent-core-ddwa0n6h.js";
31
31
  import"../shared/@ai-setting/roy-agent-core-hhrg314p.js";
32
- import"../shared/@ai-setting/roy-agent-core-j754zgb4.js";
32
+ import"../shared/@ai-setting/roy-agent-core-hc20420t.js";
33
33
  import"../shared/@ai-setting/roy-agent-core-qnrf2aw6.js";
34
- import"../shared/@ai-setting/roy-agent-core-r5axf0ad.js";
34
+ import"../shared/@ai-setting/roy-agent-core-0y64qaac.js";
35
35
  import"../shared/@ai-setting/roy-agent-core-1db4vpc6.js";
36
36
  import"../shared/@ai-setting/roy-agent-core-tq9528d3.js";
37
37
  import"../shared/@ai-setting/roy-agent-core-h0x19xgn.js";
@@ -44,9 +44,9 @@ import"../shared/@ai-setting/roy-agent-core-r0m0at3x.js";
44
44
  import"../shared/@ai-setting/roy-agent-core-e25xkv53.js";
45
45
  import {
46
46
  TaskComponent
47
- } from "../shared/@ai-setting/roy-agent-core-dv12wpdv.js";
47
+ } from "../shared/@ai-setting/roy-agent-core-r1adqgaa.js";
48
48
  import"../shared/@ai-setting/roy-agent-core-8gxth0eh.js";
49
- import"../shared/@ai-setting/roy-agent-core-0kt57b72.js";
49
+ import"../shared/@ai-setting/roy-agent-core-bgw4dq11.js";
50
50
  import"../shared/@ai-setting/roy-agent-core-pcdzfwdv.js";
51
51
  import"../shared/@ai-setting/roy-agent-core-7z4xtrmw.js";
52
52
  import {
@@ -54,7 +54,7 @@ import {
54
54
  getXDGPath,
55
55
  getXDGPaths
56
56
  } from "../shared/@ai-setting/roy-agent-core-qxnbvgwe.js";
57
- import"../shared/@ai-setting/roy-agent-core-7nh5h9fn.js";
57
+ import"../shared/@ai-setting/roy-agent-core-9vwyj29a.js";
58
58
  import"../shared/@ai-setting/roy-agent-core-t94ktchq.js";
59
59
  import"../shared/@ai-setting/roy-agent-core-92z6t4he.js";
60
60
  import {
@@ -3,7 +3,7 @@ import {
3
3
  BackgroundTaskManager,
4
4
  createDelegateTool,
5
5
  createStopTool
6
- } from "../../../shared/@ai-setting/roy-agent-core-0kt57b72.js";
6
+ } from "../../../shared/@ai-setting/roy-agent-core-bgw4dq11.js";
7
7
  import"../../../shared/@ai-setting/roy-agent-core-7z4xtrmw.js";
8
8
  import"../../../shared/@ai-setting/roy-agent-core-qxnbvgwe.js";
9
9
  import"../../../shared/@ai-setting/roy-agent-core-92z6t4he.js";
@@ -5,18 +5,18 @@ import {
5
5
  TaskPriorityEnum,
6
6
  TaskStatusEnum,
7
7
  TaskTypeEnum
8
- } from "../../shared/@ai-setting/roy-agent-core-dv12wpdv.js";
8
+ } from "../../shared/@ai-setting/roy-agent-core-r1adqgaa.js";
9
9
  import {
10
10
  TaskEntityEventTypes
11
11
  } from "../../shared/@ai-setting/roy-agent-core-8gxth0eh.js";
12
- import"../../shared/@ai-setting/roy-agent-core-0kt57b72.js";
12
+ import"../../shared/@ai-setting/roy-agent-core-bgw4dq11.js";
13
13
  import {
14
14
  SQLiteTaskStore,
15
15
  getDefaultTaskDbPath
16
16
  } from "../../shared/@ai-setting/roy-agent-core-pcdzfwdv.js";
17
17
  import"../../shared/@ai-setting/roy-agent-core-7z4xtrmw.js";
18
18
  import"../../shared/@ai-setting/roy-agent-core-qxnbvgwe.js";
19
- import"../../shared/@ai-setting/roy-agent-core-7nh5h9fn.js";
19
+ import"../../shared/@ai-setting/roy-agent-core-9vwyj29a.js";
20
20
  import"../../shared/@ai-setting/roy-agent-core-t94ktchq.js";
21
21
  import"../../shared/@ai-setting/roy-agent-core-92z6t4he.js";
22
22
  import"../../shared/@ai-setting/roy-agent-core-qxhq8ven.js";
@@ -8,7 +8,7 @@ import {
8
8
  listTasksTool,
9
9
  searchTasksTool,
10
10
  updateTaskTool
11
- } from "../../../shared/@ai-setting/roy-agent-core-7nh5h9fn.js";
11
+ } from "../../../shared/@ai-setting/roy-agent-core-9vwyj29a.js";
12
12
  import"../../../shared/@ai-setting/roy-agent-core-y5d04fm3.js";
13
13
  import"../../../shared/@ai-setting/roy-agent-core-k05v31rc.js";
14
14
  import"../../../shared/@ai-setting/roy-agent-core-shme7set.js";
@@ -8,7 +8,9 @@ import {
8
8
  grepTool,
9
9
  readFileTool,
10
10
  writeFileTool
11
- } from "../../../shared/@ai-setting/roy-agent-core-8pk6a00t.js";
11
+ } from "../../../shared/@ai-setting/roy-agent-core-qhjb153z.js";
12
+ import"../../../shared/@ai-setting/roy-agent-core-k05v31rc.js";
13
+ import"../../../shared/@ai-setting/roy-agent-core-shme7set.js";
12
14
  import"../../../shared/@ai-setting/roy-agent-core-7z9b1fm8.js";
13
15
  import"../../../shared/@ai-setting/roy-agent-core-c6592r3c.js";
14
16
  import"../../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
@@ -4,7 +4,7 @@ import {
4
4
  ToolValidator,
5
5
  getMaxOutputSize,
6
6
  setToolConfigComponent
7
- } from "../../shared/@ai-setting/roy-agent-core-pwzkgtgr.js";
7
+ } from "../../shared/@ai-setting/roy-agent-core-3arrpf7n.js";
8
8
  import {
9
9
  bashTool,
10
10
  echoTool,
@@ -15,7 +15,7 @@ import {
15
15
  grepTool,
16
16
  readFileTool,
17
17
  writeFileTool
18
- } from "../../shared/@ai-setting/roy-agent-core-8pk6a00t.js";
18
+ } from "../../shared/@ai-setting/roy-agent-core-qhjb153z.js";
19
19
  import"../../shared/@ai-setting/roy-agent-core-e25xkv53.js";
20
20
  import"../../shared/@ai-setting/roy-agent-core-qxhq8ven.js";
21
21
  import"../../shared/@ai-setting/roy-agent-core-rgckng3p.js";
@@ -6,12 +6,12 @@ import {
6
6
  Scheduler,
7
7
  WorkflowEngine,
8
8
  init_engine
9
- } from "../../../shared/@ai-setting/roy-agent-core-gttz2jpm.js";
9
+ } from "../../../shared/@ai-setting/roy-agent-core-9y09xfav.js";
10
10
  import"../../../shared/@ai-setting/roy-agent-core-5kdw0p98.js";
11
11
  import"../../../shared/@ai-setting/roy-agent-core-6atd905e.js";
12
12
  import"../../../shared/@ai-setting/roy-agent-core-gb9gbkc3.js";
13
13
  import"../../../shared/@ai-setting/roy-agent-core-ddwa0n6h.js";
14
- import"../../../shared/@ai-setting/roy-agent-core-j754zgb4.js";
14
+ import"../../../shared/@ai-setting/roy-agent-core-hc20420t.js";
15
15
  import"../../../shared/@ai-setting/roy-agent-core-qnrf2aw6.js";
16
16
  import"../../../shared/@ai-setting/roy-agent-core-1db4vpc6.js";
17
17
  import"../../../shared/@ai-setting/roy-agent-core-e25xkv53.js";
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  WorkflowComponent
3
- } from "../../shared/@ai-setting/roy-agent-core-dp73ghtz.js";
3
+ } from "../../shared/@ai-setting/roy-agent-core-6n7xwv4v.js";
4
4
  import"../../shared/@ai-setting/roy-agent-core-fjexv5nm.js";
5
- import"../../shared/@ai-setting/roy-agent-core-gttz2jpm.js";
5
+ import"../../shared/@ai-setting/roy-agent-core-9y09xfav.js";
6
6
  import"../../shared/@ai-setting/roy-agent-core-5kdw0p98.js";
7
7
  import"../../shared/@ai-setting/roy-agent-core-6atd905e.js";
8
8
  import"../../shared/@ai-setting/roy-agent-core-gb9gbkc3.js";
9
9
  import"../../shared/@ai-setting/roy-agent-core-ddwa0n6h.js";
10
10
  import"../../shared/@ai-setting/roy-agent-core-hhrg314p.js";
11
- import"../../shared/@ai-setting/roy-agent-core-j754zgb4.js";
11
+ import"../../shared/@ai-setting/roy-agent-core-hc20420t.js";
12
12
  import {
13
13
  BaseEventSchema,
14
14
  ControlPauseEventSchema,
@@ -60,7 +60,7 @@ import {
60
60
  pathNotFound,
61
61
  unresolvedVariable
62
62
  } from "../../shared/@ai-setting/roy-agent-core-qnrf2aw6.js";
63
- import"../../shared/@ai-setting/roy-agent-core-r5axf0ad.js";
63
+ import"../../shared/@ai-setting/roy-agent-core-0y64qaac.js";
64
64
  import"../../shared/@ai-setting/roy-agent-core-1db4vpc6.js";
65
65
  import"../../shared/@ai-setting/roy-agent-core-tq9528d3.js";
66
66
  import {
@@ -5,7 +5,7 @@ import {
5
5
  init_skill_node,
6
6
  init_tool_node,
7
7
  init_workflow_node
8
- } from "../../../shared/@ai-setting/roy-agent-core-j754zgb4.js";
8
+ } from "../../../shared/@ai-setting/roy-agent-core-hc20420t.js";
9
9
  import"../../../shared/@ai-setting/roy-agent-core-k05v31rc.js";
10
10
  import"../../../shared/@ai-setting/roy-agent-core-shme7set.js";
11
11
  import"../../../shared/@ai-setting/roy-agent-core-7z9b1fm8.js";
@@ -22,7 +22,7 @@ import {
22
22
  getRunWorkflowTool,
23
23
  initRunWorkflowTool,
24
24
  resetRunWorkflowTool
25
- } from "../../../shared/@ai-setting/roy-agent-core-r5axf0ad.js";
25
+ } from "../../../shared/@ai-setting/roy-agent-core-0y64qaac.js";
26
26
  import {
27
27
  WORKFLOW_SUBMIT_OUTPUT_TOOL_NAME,
28
28
  WorkflowJsonOutputMarker,
package/dist/index.js CHANGED
@@ -22,7 +22,7 @@ import {
22
22
  ToolComponent,
23
23
  ToolRegistry,
24
24
  ToolValidator
25
- } from "./shared/@ai-setting/roy-agent-core-pwzkgtgr.js";
25
+ } from "./shared/@ai-setting/roy-agent-core-3arrpf7n.js";
26
26
  import {
27
27
  bashTool,
28
28
  editFileTool,
@@ -32,12 +32,12 @@ import {
32
32
  grepTool,
33
33
  readFileTool,
34
34
  writeFileTool
35
- } from "./shared/@ai-setting/roy-agent-core-8pk6a00t.js";
35
+ } from "./shared/@ai-setting/roy-agent-core-qhjb153z.js";
36
36
  import {
37
37
  closeDatabase
38
38
  } from "./shared/@ai-setting/roy-agent-core-h4h55x4h.js";
39
39
  import"./shared/@ai-setting/roy-agent-core-3sv590cv.js";
40
- import"./shared/@ai-setting/roy-agent-core-2grcjaad.js";
40
+ import"./shared/@ai-setting/roy-agent-core-4f3976cd.js";
41
41
  import {
42
42
  MemoryComponent
43
43
  } from "./shared/@ai-setting/roy-agent-core-2h38rvyj.js";
@@ -61,10 +61,12 @@ import {
61
61
  } from "./shared/@ai-setting/roy-agent-core-29fh9mxg.js";
62
62
  import {
63
63
  EventSourceComponent,
64
+ TimerInstance,
64
65
  builtInHandlers,
65
66
  getBuiltInHandler,
66
- larkCliHandler
67
- } from "./shared/@ai-setting/roy-agent-core-ya1ayt1k.js";
67
+ larkCliHandler,
68
+ timerHandler
69
+ } from "./shared/@ai-setting/roy-agent-core-6mk0m4t3.js";
68
70
  import {
69
71
  BUILT_IN_EVENT_SOURCE_TYPES,
70
72
  BUILT_IN_EVENT_SOURCE_TYPE_LIST,
@@ -73,7 +75,7 @@ import {
73
75
  isBuiltInEventSourceType,
74
76
  isValidEventSourceType,
75
77
  validateEventSourceConfig
76
- } from "./shared/@ai-setting/roy-agent-core-xb4hvk1m.js";
78
+ } from "./shared/@ai-setting/roy-agent-core-qhhxx2x2.js";
77
79
  import {
78
80
  LogTraceComponent,
79
81
  LogTraceConfigSchema
@@ -90,20 +92,20 @@ import {
90
92
  } from "./shared/@ai-setting/roy-agent-core-az13yzmc.js";
91
93
  import {
92
94
  WorkflowComponent
93
- } from "./shared/@ai-setting/roy-agent-core-dp73ghtz.js";
95
+ } from "./shared/@ai-setting/roy-agent-core-6n7xwv4v.js";
94
96
  import {
95
97
  init_node_registry_helper,
96
98
  registerDecoratorNodeType
97
99
  } from "./shared/@ai-setting/roy-agent-core-fjexv5nm.js";
98
- import"./shared/@ai-setting/roy-agent-core-gttz2jpm.js";
100
+ import"./shared/@ai-setting/roy-agent-core-9y09xfav.js";
99
101
  import"./shared/@ai-setting/roy-agent-core-5kdw0p98.js";
100
102
  import"./shared/@ai-setting/roy-agent-core-6atd905e.js";
101
103
  import"./shared/@ai-setting/roy-agent-core-gb9gbkc3.js";
102
104
  import"./shared/@ai-setting/roy-agent-core-ddwa0n6h.js";
103
105
  import"./shared/@ai-setting/roy-agent-core-hhrg314p.js";
104
- import"./shared/@ai-setting/roy-agent-core-j754zgb4.js";
106
+ import"./shared/@ai-setting/roy-agent-core-hc20420t.js";
105
107
  import"./shared/@ai-setting/roy-agent-core-qnrf2aw6.js";
106
- import"./shared/@ai-setting/roy-agent-core-r5axf0ad.js";
108
+ import"./shared/@ai-setting/roy-agent-core-0y64qaac.js";
107
109
  import"./shared/@ai-setting/roy-agent-core-1db4vpc6.js";
108
110
  import"./shared/@ai-setting/roy-agent-core-tq9528d3.js";
109
111
  import {
@@ -130,9 +132,9 @@ import {
130
132
  } from "./shared/@ai-setting/roy-agent-core-e25xkv53.js";
131
133
  import {
132
134
  TaskComponent
133
- } from "./shared/@ai-setting/roy-agent-core-dv12wpdv.js";
135
+ } from "./shared/@ai-setting/roy-agent-core-r1adqgaa.js";
134
136
  import"./shared/@ai-setting/roy-agent-core-8gxth0eh.js";
135
- import"./shared/@ai-setting/roy-agent-core-0kt57b72.js";
137
+ import"./shared/@ai-setting/roy-agent-core-bgw4dq11.js";
136
138
  import {
137
139
  SQLiteTaskStore,
138
140
  getDefaultTaskDbPath
@@ -145,7 +147,7 @@ import {
145
147
  getXDGPath,
146
148
  getXDGPaths
147
149
  } from "./shared/@ai-setting/roy-agent-core-qxnbvgwe.js";
148
- import"./shared/@ai-setting/roy-agent-core-7nh5h9fn.js";
150
+ import"./shared/@ai-setting/roy-agent-core-9vwyj29a.js";
149
151
  import"./shared/@ai-setting/roy-agent-core-t94ktchq.js";
150
152
  import {
151
153
  TaskHookPoints
@@ -346,6 +348,7 @@ export {
346
348
  writeFileTool,
347
349
  wrapFunction,
348
350
  validateEventSourceConfig,
351
+ timerHandler,
349
352
  setQuietMode,
350
353
  setConfigComponent as setLoggerConfigComponent,
351
354
  setLogDirOverride,
@@ -405,6 +408,7 @@ export {
405
408
  ToolRegistry,
406
409
  ToolError,
407
410
  ToolComponent,
411
+ TimerInstance,
408
412
  TaskTagPlugin,
409
413
  TaskHookPoints,
410
414
  TaskComponent,
@@ -147,16 +147,40 @@ var WorkflowListInputSchema = z3.object({
147
147
  tags: z3.array(z3.string()).optional().describe("Filter by multiple tags (AND)"),
148
148
  search: z3.string().optional().describe("Search workflows by keyword"),
149
149
  limit: z3.number().positive().optional().describe("Maximum number of results to return"),
150
- offset: z3.number().min(0).optional().describe("Offset for pagination")
150
+ offset: z3.number().min(0).optional().describe("Offset for pagination"),
151
+ page: z3.number().int().min(1).optional().describe("1-based page number (optional; defaults to 1)")
151
152
  });
153
+ function projectWorkflow(w) {
154
+ return {
155
+ name: w.name,
156
+ version: w.version,
157
+ description: w.description,
158
+ tags: w.tags,
159
+ created_at: w.createdAt
160
+ };
161
+ }
162
+ function buildListToolOutput(result, params) {
163
+ return {
164
+ total: result.total,
165
+ count: result.workflows.length,
166
+ truncated: result.total > result.workflows.length,
167
+ limit: params.limit,
168
+ offset: params.offset,
169
+ page: params.page ?? 1,
170
+ available_tags: result.available_tags,
171
+ workflows: result.workflows.map(projectWorkflow)
172
+ };
173
+ }
152
174
  function createWorkflowListTool(workflowService) {
153
175
  return {
154
176
  name: "workflow_list",
155
- description: "List all registered workflows with optional filtering. " + "Returns `workflows`, `total` (filtered count regardless of pagination), `count` (returned count), " + "`limit`, `offset`, and `available_tags` (sorted by usage_count DESC). " + "Multi-tag filter uses AND logic. " + "\uD83D\uDCA1 TIP: The `available_tags` field tells you what tags already exist. " + "Before calling `workflow_add` with new tags, call `workflow_tag_list` to discover " + "existing tags and prefer reusing them for semantic consistency " + "(e.g. reuse 'ci-cd' rather than creating 'continuous-integration'). " + "Avoid tag proliferation is a design goal — limit the number of distinct tags in the pool.",
177
+ description: "List all registered workflows with optional filtering. " + "Returns canonical JSON shape (Code Review #1479 follow-up): " + "`total` (filtered count BEFORE pagination), `count` (returned count), `truncated` (true when total > count), " + "`limit`, `offset`, `page` (1-based page number; defaults to 1), `available_tags` (sorted by usage_count DESC), " + "and `workflows` (the array, always LAST so downstream tail-truncation strips it rather than the metadata). " + "Multi-tag filter uses AND logic. " + "\uD83D\uDCA1 TIP: The `available_tags` field tells you what tags already exist. " + "Before calling `workflow_add` with new tags, call `workflow_tag_list` to discover " + "existing tags and prefer reusing them for semantic consistency " + "(e.g. reuse 'ci-cd' rather than creating 'continuous-integration'). " + "Avoid tag proliferation is a design goal — limit the number of distinct tags in the pool.",
156
178
  parameters: WorkflowListInputSchema,
157
179
  execute: async (args, ctx) => {
158
180
  const params = WorkflowListInputSchema.parse(args);
159
181
  try {
182
+ const effectivePage = params.page ?? 1;
183
+ const effectiveOffset = params.offset !== undefined ? params.offset : (effectivePage - 1) * (params.limit ?? 20);
160
184
  const options = {};
161
185
  if (params.tag !== undefined)
162
186
  options.tag = params.tag;
@@ -164,54 +188,41 @@ function createWorkflowListTool(workflowService) {
164
188
  options.search = params.search;
165
189
  if (params.limit !== undefined)
166
190
  options.limit = params.limit;
167
- if (params.offset !== undefined)
168
- options.offset = params.offset;
191
+ if (effectiveOffset !== 0)
192
+ options.offset = effectiveOffset;
169
193
  if (params.tags && params.tags.length > 0) {
170
- const result2 = await workflowService.searchWorkflowsWithTags ? await workflowService.searchWorkflowsWithTags({
194
+ const result2 = workflowService.searchWorkflowsWithTags ? await workflowService.searchWorkflowsWithTags({
171
195
  tags: params.tags,
172
196
  limit: params.limit,
173
- offset: params.offset
174
- }) : { workflows: workflowService.searchWorkflows({ tags: params.tags, limit: params.limit, offset: params.offset }), available_tags: [], total: 0 };
197
+ offset: effectiveOffset
198
+ }) : {
199
+ workflows: workflowService.searchWorkflows({
200
+ tags: params.tags,
201
+ limit: params.limit,
202
+ offset: effectiveOffset
203
+ }),
204
+ available_tags: [],
205
+ total: workflowService.searchWorkflows({
206
+ tags: params.tags
207
+ }).length
208
+ };
175
209
  return {
176
210
  success: true,
177
- output: JSON.stringify({
178
- workflows: result2.workflows.map((w) => ({
179
- name: w.name,
180
- version: w.version,
181
- description: w.description,
182
- tags: w.tags,
183
- created_at: w.createdAt
184
- })),
185
- available_tags: result2.available_tags,
186
- total: result2.total,
187
- count: result2.workflows.length,
188
- limit: params.limit,
189
- offset: params.offset
190
- }, null, 2),
211
+ output: JSON.stringify(buildListToolOutput(result2, params), null, 2),
191
212
  metadata: { execution_time_ms: 0 }
192
213
  };
193
214
  }
194
215
  const result = workflowService.listWorkflowsWithTags ? await workflowService.listWorkflowsWithTags(options) : {
195
216
  workflows: workflowService.listWorkflows(options),
196
217
  available_tags: [],
197
- total: 0
218
+ total: workflowService.listWorkflows({
219
+ tag: options.tag,
220
+ search: options.search
221
+ }).length
198
222
  };
199
223
  return {
200
224
  success: true,
201
- output: JSON.stringify({
202
- workflows: result.workflows.map((w) => ({
203
- name: w.name,
204
- version: w.version,
205
- description: w.description,
206
- tags: w.tags,
207
- created_at: w.createdAt
208
- })),
209
- available_tags: result.available_tags,
210
- total: result.total,
211
- count: result.workflows.length,
212
- limit: params.limit,
213
- offset: params.offset
214
- }, null, 2),
225
+ output: JSON.stringify(buildListToolOutput(result, params), null, 2),
215
226
  metadata: { execution_time_ms: 0 }
216
227
  };
217
228
  } catch (error) {
@@ -20,7 +20,8 @@ import {
20
20
  runWithEnvContext
21
21
  } from "./roy-agent-core-y5d04fm3.js";
22
22
  import {
23
- TracedAs
23
+ TracedAs,
24
+ init_decorator
24
25
  } from "./roy-agent-core-k05v31rc.js";
25
26
  import {
26
27
  createLogger,
@@ -34,6 +35,163 @@ import {
34
35
  __require
35
36
  } from "./roy-agent-core-fs0mn2jk.js";
36
37
 
38
+ // src/env/event-source/timer-handler.ts
39
+ init_decorator();
40
+ var DEFAULT_TIMER_INTERVAL_MS = 10 * 60 * 1000;
41
+ var SELF_REMINDER_MESSAGE = `[Timer Self-Reminder]
42
+ 请读取最近 1 周处理的 task 信息,分析用户当前的工作目标和重点任务。
43
+ 基于分析结果,自主构建有价值的任务来推进用户目标。
44
+
45
+ 分析维度:
46
+ 1. 最近完成的 task 类型和主题
47
+ 2. 进行中的 task 状态和阻塞点
48
+ 3. 用户的工作模式和偏好
49
+ 4. 可以主动优化的领域
50
+
51
+ 请根据分析结果,创建 1-3 个有价值的任务并执行。`;
52
+ var TIMER_OPTIONS_KEY_GET_MANAGER = "getBackgroundTaskManager";
53
+
54
+ class TimerInstance {
55
+ config;
56
+ interval;
57
+ sessionId;
58
+ getRunningTasks;
59
+ customPrompt;
60
+ status = "created";
61
+ timerId;
62
+ eventHandler;
63
+ constructor(config, getRunningTasks) {
64
+ this.config = config;
65
+ this.interval = typeof config.interval === "number" && config.interval > 0 ? config.interval : DEFAULT_TIMER_INTERVAL_MS;
66
+ this.sessionId = `timer-${config.id}-${process.pid}`;
67
+ const optionsPrompt = config.options?.prompt;
68
+ if (typeof optionsPrompt === "string" && optionsPrompt.trim().length > 0) {
69
+ this.customPrompt = optionsPrompt;
70
+ }
71
+ if (getRunningTasks) {
72
+ this.getRunningTasks = getRunningTasks;
73
+ } else {
74
+ const factory = config.options?.[TIMER_OPTIONS_KEY_GET_MANAGER];
75
+ if (typeof factory === "function") {
76
+ const manager = factory();
77
+ this.getRunningTasks = () => manager.listTasks();
78
+ } else {
79
+ this.getRunningTasks = () => [];
80
+ }
81
+ }
82
+ }
83
+ async start() {
84
+ if (this.status === "running")
85
+ return;
86
+ this.timerId = setInterval(() => {
87
+ this.tick();
88
+ }, this.interval);
89
+ this.status = "running";
90
+ }
91
+ async stop() {
92
+ if (this.timerId !== undefined) {
93
+ clearInterval(this.timerId);
94
+ this.timerId = undefined;
95
+ }
96
+ this.status = "stopped";
97
+ }
98
+ getStatus() {
99
+ return this.status;
100
+ }
101
+ onEvent(handler) {
102
+ this.eventHandler = handler;
103
+ }
104
+ offEvent() {
105
+ this.eventHandler = undefined;
106
+ }
107
+ tick() {
108
+ let allTasks;
109
+ try {
110
+ allTasks = this.getRunningTasks();
111
+ } catch (error) {
112
+ console.warn(`[TimerInstance] Failed to get running tasks, skipping tick: ${error}`);
113
+ return;
114
+ }
115
+ const hasRunning = Array.isArray(allTasks) && allTasks.some((t) => t.status === "running");
116
+ if (hasRunning) {
117
+ return;
118
+ }
119
+ const event = this.buildSelfReminderEvent();
120
+ this.eventHandler?.(event);
121
+ }
122
+ buildSelfReminderEvent() {
123
+ const timestamp = Date.now();
124
+ const message = this.customPrompt ?? SELF_REMINDER_MESSAGE;
125
+ return {
126
+ id: `es-${this.config.id}-${timestamp}-${Math.random().toString(36).slice(2, 8)}`,
127
+ type: "event-source.event.timer",
128
+ timestamp,
129
+ metadata: {
130
+ source: "event-source",
131
+ sourceId: this.config.id,
132
+ sourceMessageType: "timer.selfReminder",
133
+ sessionId: this.sessionId
134
+ },
135
+ payload: {
136
+ sourceId: this.config.id,
137
+ sourceType: "timer",
138
+ rawEvent: {
139
+ type: "timer.selfReminder",
140
+ triggeredAt: timestamp
141
+ },
142
+ message,
143
+ metadata: {
144
+ eventType: "timer.selfReminder",
145
+ sourceId: this.config.id,
146
+ sourceType: "timer",
147
+ timestamp
148
+ },
149
+ timestamp
150
+ }
151
+ };
152
+ }
153
+ }
154
+ __legacyDecorateClassTS([
155
+ TracedAs("timer.tick", { recordParams: false, log: false })
156
+ ], TimerInstance.prototype, "tick", null);
157
+ __legacyDecorateClassTS([
158
+ TracedAs("timer.buildSelfReminderEvent", { recordParams: false, log: false })
159
+ ], TimerInstance.prototype, "buildSelfReminderEvent", null);
160
+ var timerHandler = {
161
+ type: "timer",
162
+ validateConfig(config) {
163
+ const errors = [];
164
+ const { interval } = config;
165
+ if (interval !== undefined && interval !== null) {
166
+ if (typeof interval !== "number" || !Number.isFinite(interval)) {
167
+ errors.push("Timer interval must be a finite number");
168
+ } else if (interval <= 0) {
169
+ errors.push("Timer interval must be a positive number (milliseconds)");
170
+ }
171
+ }
172
+ return errors;
173
+ },
174
+ createInstance(config) {
175
+ return new TimerInstance(config);
176
+ },
177
+ getOptions() {
178
+ return [
179
+ {
180
+ name: "interval",
181
+ description: `Timer interval in milliseconds (default: ${DEFAULT_TIMER_INTERVAL_MS} = 10 minutes)`,
182
+ required: false,
183
+ type: "number"
184
+ },
185
+ {
186
+ name: "prompt",
187
+ description: "Custom prompt message for SelfReminder events (replaces default message)",
188
+ required: false,
189
+ type: "string"
190
+ }
191
+ ];
192
+ }
193
+ };
194
+
37
195
  // src/env/event-source/event-source-handlers.ts
38
196
  init_global_hook_manager();
39
197
  import { spawn } from "child_process";
@@ -543,7 +701,8 @@ var larkCliHandler = {
543
701
  }
544
702
  };
545
703
  var builtInHandlers = [
546
- larkCliHandler
704
+ larkCliHandler,
705
+ timerHandler
547
706
  ];
548
707
  function getBuiltInHandler(type) {
549
708
  return builtInHandlers.find((h) => h.type === type);
@@ -553,6 +712,7 @@ function getBuiltInHandler(type) {
553
712
  import { join } from "path";
554
713
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
555
714
  init_logger();
715
+ init_decorator();
556
716
 
557
717
  // src/env/event-source/event-source-config-registration.ts
558
718
  var EVENT_SOURCE_DEFAULTS = {
@@ -644,7 +804,7 @@ class EventSourceComponent extends BaseComponent {
644
804
  }
645
805
  }
646
806
  async executeInitHooks() {
647
- const { EventSourceInitHooks } = await import("./roy-agent-core-9mj7vzsm.js");
807
+ const { EventSourceInitHooks } = await import("./roy-agent-core-vneyghpg.js");
648
808
  await EventSourceInitHooks.execute(this);
649
809
  }
650
810
  registerHandler(handler) {
@@ -790,6 +950,57 @@ class EventSourceComponent extends BaseComponent {
790
950
  }
791
951
  return existed;
792
952
  }
953
+ async update(id, partial) {
954
+ if (!partial || Object.keys(partial).length === 0) {
955
+ throw new Error("update() partial must not be empty");
956
+ }
957
+ const existing = this.sources.get(id);
958
+ if (!existing) {
959
+ throw new Error(`EventSource not found: ${id}`);
960
+ }
961
+ if (Object.prototype.hasOwnProperty.call(partial, "type")) {
962
+ if (partial.type !== existing.type) {
963
+ throw new Error(`Cannot update event source type: ${existing.type} -> ${partial.type} (use unregister + register instead)`);
964
+ }
965
+ }
966
+ const wasRunning = this.statuses.get(id) === "running";
967
+ let stopped = false;
968
+ if (wasRunning) {
969
+ await this.stopSource(id);
970
+ stopped = true;
971
+ }
972
+ const updated = {
973
+ ...existing,
974
+ ...partial,
975
+ id: existing.id,
976
+ type: existing.type
977
+ };
978
+ const handler = this.handlers.get(existing.type);
979
+ if (handler) {
980
+ const errors = handler.validateConfig(updated);
981
+ if (errors.length > 0) {
982
+ throw new Error(`Invalid config after update: ${errors.join(", ")}`);
983
+ }
984
+ }
985
+ this.sources.set(id, updated);
986
+ logger.info(`EventSource updated: ${id}`, {
987
+ fields: Object.keys(partial)
988
+ });
989
+ try {
990
+ await this.saveConfig();
991
+ } catch (err) {
992
+ logger.error(`Failed to save config after updating ${id}:`, err);
993
+ throw err;
994
+ }
995
+ return {
996
+ id,
997
+ updated,
998
+ wasRunning,
999
+ stopped,
1000
+ restarted: false,
1001
+ fields: Object.keys(partial)
1002
+ };
1003
+ }
793
1004
  get(id) {
794
1005
  return this.sources.get(id);
795
1006
  }
@@ -931,5 +1142,8 @@ class EventSourceComponent extends BaseComponent {
931
1142
  }
932
1143
  }
933
1144
  }
1145
+ __legacyDecorateClassTS([
1146
+ TracedAs("event-source.update", { recordParams: false, log: false })
1147
+ ], EventSourceComponent.prototype, "update", null);
934
1148
 
935
- export { larkCliHandler, builtInHandlers, getBuiltInHandler, EventSourceComponent };
1149
+ export { TimerInstance, timerHandler, larkCliHandler, builtInHandlers, getBuiltInHandler, EventSourceComponent };
@@ -6,7 +6,7 @@ import {
6
6
  WorkflowEngine,
7
7
  exports_engine,
8
8
  init_engine
9
- } from "./roy-agent-core-gttz2jpm.js";
9
+ } from "./roy-agent-core-9y09xfav.js";
10
10
  import {
11
11
  askUserTool,
12
12
  createRunWorkflowTool,
@@ -17,7 +17,7 @@ import {
17
17
  createWorkflowRunStopTool,
18
18
  createWorkflowSearchTool,
19
19
  createWorkflowTagListTool
20
- } from "./roy-agent-core-r5axf0ad.js";
20
+ } from "./roy-agent-core-0y64qaac.js";
21
21
  import {
22
22
  WorkflowService
23
23
  } from "./roy-agent-core-tq9528d3.js";
@@ -248,7 +248,10 @@ function listTasksTool(taskComponent) {
248
248
  return {
249
249
  name: "task_list",
250
250
  description: "List tasks with optional filters for status, priority, type, parent_task_id, " + "and depth (hierarchy level). " + `depth: 0=只根任务(无父任务),1=根+一层子任务,2=根+二层子任务,-1 或忽略=全部。
251
- ` + "Returns { tasks, total, limit, offset } where total is the count of all " + "matching tasks BEFORE pagination.",
251
+ ` + `Returns { total, count, truncated, limit, offset, depth, tasks } where:
252
+ ` + ` - total: count of all matching tasks BEFORE pagination
253
+ ` + " - count: count of tasks in the returned `tasks` array (after pagination)\n" + ` - truncated: true when total > count (data was truncated by pagination)
254
+ ` + "Note: `total` is the FIRST field in the response so it survives tail-truncation " + "by ToolComponent.truncateOutput.",
252
255
  parameters: ListTasksToolSchema,
253
256
  execute: async (args, ctx) => {
254
257
  const params = ListTasksToolSchema.parse(args);
@@ -265,12 +268,13 @@ function listTasksTool(taskComponent) {
265
268
  return {
266
269
  success: true,
267
270
  output: JSON.stringify({
268
- tasks: result.tasks,
269
271
  total: result.total,
270
272
  count: result.tasks.length,
273
+ truncated: result.total > result.tasks.length,
271
274
  limit: params.limit,
272
275
  offset: params.offset,
273
- depth: params.depth
276
+ depth: params.depth,
277
+ tasks: result.tasks
274
278
  }),
275
279
  metadata: { execution_time_ms: 0 }
276
280
  };
@@ -19,7 +19,7 @@ import {
19
19
  init_skill_node,
20
20
  init_tool_node,
21
21
  init_workflow_node
22
- } from "./roy-agent-core-j754zgb4.js";
22
+ } from "./roy-agent-core-hc20420t.js";
23
23
  import {
24
24
  WorkflowError,
25
25
  createWorkflowEvent,
@@ -1856,7 +1856,15 @@ var init_engine = __esm(() => {
1856
1856
  }
1857
1857
  const { stripEphemeralResumeInput } = await import("./roy-agent-core-2vhsccvz.js");
1858
1858
  const { workflowInput: runtimeInput } = stripEphemeralResumeInput(rawRuntimeInput);
1859
- const mergedWorkflowInput = { ...persistedInput, ...runtimeInput };
1859
+ const defaultsFromSchema = {};
1860
+ if (definition.inputs) {
1861
+ for (const [key, param] of Object.entries(definition.inputs)) {
1862
+ if (param.default !== undefined) {
1863
+ defaultsFromSchema[key] = param.default;
1864
+ }
1865
+ }
1866
+ }
1867
+ const mergedWorkflowInput = { ...defaultsFromSchema, ...persistedInput, ...runtimeInput };
1860
1868
  const workflowInput = Object.keys(mergedWorkflowInput).length > 0 ? mergedWorkflowInput : undefined;
1861
1869
  const config = {
1862
1870
  parallelLimit,
@@ -238,7 +238,7 @@ ${originalPrompt}
238
238
  `;
239
239
  }
240
240
  var DEFAULT_TIMEOUT = 1800000;
241
- var PROGRESS_INTERVAL = 120000;
241
+ var PROGRESS_INTERVAL = 600000;
242
242
 
243
243
  class BackgroundTaskManager {
244
244
  env;
@@ -66,7 +66,7 @@ var init_tool_node = __esm(() => {
66
66
  }
67
67
  if (toolName === "bash" && typeof input.command === "string") {
68
68
  const trimmed = input.command.replace(/\n+$/, "");
69
- const echoMatch = trimmed.match(/^echo\s+"([\s\S]*)"\s*$/);
69
+ const echoMatch = trimmed.match(/^echo\s+"([^\n\r]*)"\s*$/);
70
70
  if (echoMatch) {
71
71
  let inner = echoMatch[1];
72
72
  inner = inner.replace(/\\/g, "\\\\");
@@ -1,6 +1,7 @@
1
1
  // src/env/event-source/types.ts
2
2
  var BUILT_IN_EVENT_SOURCE_TYPES = {
3
- LARK_CLI: "lark-cli"
3
+ LARK_CLI: "lark-cli",
4
+ TIMER: "timer"
4
5
  };
5
6
  var BUILT_IN_EVENT_SOURCE_TYPE_LIST = Object.values(BUILT_IN_EVENT_SOURCE_TYPES);
6
7
 
@@ -1,3 +1,7 @@
1
+ import {
2
+ init_decorator,
3
+ wrapFunction
4
+ } from "./roy-agent-core-k05v31rc.js";
1
5
  import {
2
6
  exports_tracer_provider,
3
7
  init_propagation,
@@ -10,6 +14,7 @@ import {
10
14
 
11
15
  // src/env/tool/built-in/bash.ts
12
16
  init_propagation();
17
+ init_decorator();
13
18
  import { z } from "zod";
14
19
  import { Effect as Effect2 } from "effect";
15
20
 
@@ -188,7 +193,7 @@ var bashTool = {
188
193
  tags: ["shell", "command", "terminal", "exec"],
189
194
  version: "2.0.0"
190
195
  },
191
- execute: async (args, ctx) => {
196
+ execute: wrapFunction(async (args, ctx) => {
192
197
  const startTime = Date.now();
193
198
  const { command, workdir, timeout = 60000, env } = args;
194
199
  const currentSpanCtx = getCurrentSpanContext();
@@ -293,7 +298,7 @@ var bashTool = {
293
298
  }
294
299
  };
295
300
  }
296
- }
301
+ }, "tool.bash.execute", { recordParams: true, recordResult: true })
297
302
  };
298
303
 
299
304
  // src/env/tool/built-in/echo.ts
@@ -5,7 +5,7 @@ import {
5
5
  BackgroundTaskManager,
6
6
  createDelegateTool,
7
7
  createStopTool
8
- } from "./roy-agent-core-0kt57b72.js";
8
+ } from "./roy-agent-core-bgw4dq11.js";
9
9
  import {
10
10
  SQLiteTaskStore,
11
11
  getDefaultTaskDbPath
@@ -20,7 +20,7 @@ import {
20
20
  listTasksTool,
21
21
  searchTasksTool,
22
22
  updateTaskTool
23
- } from "./roy-agent-core-7nh5h9fn.js";
23
+ } from "./roy-agent-core-9vwyj29a.js";
24
24
  import {
25
25
  createOperationTool,
26
26
  deleteOperationTool,
@@ -6,7 +6,7 @@ import {
6
6
  isBuiltInEventSourceType,
7
7
  isValidEventSourceType,
8
8
  validateEventSourceConfig
9
- } from "./roy-agent-core-xb4hvk1m.js";
9
+ } from "./roy-agent-core-qhhxx2x2.js";
10
10
  import"./roy-agent-core-fs0mn2jk.js";
11
11
  export {
12
12
  validateEventSourceConfig,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-setting/roy-agent-core",
3
- "version": "1.5.85",
3
+ "version": "1.5.87",
4
4
  "type": "module",
5
5
  "description": "Core SDK for roy-agent - Environment, Components, Tools, Sessions, Tasks",
6
6
  "main": "./dist/index.js",