@ai-setting/roy-agent-core 1.4.13 → 1.4.15

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 (102) hide show
  1. package/dist/config/index.js +32 -0
  2. package/dist/env/agent/index.js +24 -0
  3. package/dist/env/commands/index.js +14 -0
  4. package/dist/env/debug/formatters/index.js +11 -0
  5. package/dist/env/debug/index.js +26 -0
  6. package/dist/env/hook/index.js +29 -0
  7. package/dist/env/index.js +81 -0
  8. package/dist/env/llm/index.js +40 -0
  9. package/dist/env/log-trace/index.js +83 -0
  10. package/dist/env/mcp/index.js +39 -0
  11. package/dist/env/mcp/tool/index.js +14 -0
  12. package/dist/env/memory/built-in/index.js +11 -0
  13. package/dist/env/memory/index.js +56 -0
  14. package/dist/env/memory/plugin/index.js +36 -0
  15. package/dist/env/prompt/index.js +20 -0
  16. package/dist/env/session/index.js +25 -0
  17. package/dist/env/session/storage/index.js +18 -0
  18. package/dist/env/skill/index.js +34 -0
  19. package/dist/env/skill/tool/index.js +9 -0
  20. package/dist/env/task/delegate/index.js +18 -0
  21. package/dist/env/task/hooks/index.js +7 -0
  22. package/dist/env/task/index.js +30 -0
  23. package/dist/env/task/plugins/index.js +23 -0
  24. package/dist/env/task/storage/index.js +14 -0
  25. package/dist/env/task/tools/index.js +17 -0
  26. package/dist/env/task/tools/operation/index.js +15 -0
  27. package/dist/{shared/chunk-1d4rwms4.js → env/tool/built-in/index.js} +4 -4
  28. package/dist/env/tool/index.js +39 -0
  29. package/dist/env/workflow/decorators/index.js +27 -0
  30. package/dist/env/workflow/engine/index.js +28 -0
  31. package/dist/env/workflow/index.js +132 -0
  32. package/dist/env/workflow/nodes/index.js +19 -0
  33. package/dist/env/workflow/service/index.js +13 -0
  34. package/dist/env/workflow/storage/index.js +27 -0
  35. package/dist/env/workflow/tools/index.js +159 -0
  36. package/dist/env/workflow/types/index.js +94 -0
  37. package/dist/env/workflow/utils/index.js +637 -0
  38. package/dist/index.js +233 -16386
  39. package/dist/shared/{chunk-2b5kbhx3.js → @ai-setting/roy-agent-core-0rtxwr28.js} +6 -114
  40. package/dist/shared/@ai-setting/roy-agent-core-0vbdz0x7.js +36 -0
  41. package/dist/shared/@ai-setting/roy-agent-core-12zkpda2.js +393 -0
  42. package/dist/shared/@ai-setting/roy-agent-core-1ce3fqrk.js +117 -0
  43. package/dist/shared/@ai-setting/roy-agent-core-2dhd60aw.js +11 -0
  44. package/dist/shared/@ai-setting/roy-agent-core-2kg2wma8.js +620 -0
  45. package/dist/shared/@ai-setting/roy-agent-core-2x0m2p66.js +851 -0
  46. package/dist/shared/@ai-setting/roy-agent-core-35x0wrtt.js +172 -0
  47. package/dist/shared/{chunk-1pf5mfgd.js → @ai-setting/roy-agent-core-37e4tep3.js} +2 -2
  48. package/dist/shared/@ai-setting/roy-agent-core-3agad0d9.js +603 -0
  49. package/dist/shared/@ai-setting/roy-agent-core-4arba14a.js +419 -0
  50. package/dist/shared/@ai-setting/roy-agent-core-4rqmfr7t.js +266 -0
  51. package/dist/shared/@ai-setting/roy-agent-core-4t40mkpv.js +206 -0
  52. package/dist/shared/@ai-setting/roy-agent-core-561b1c4p.js +377 -0
  53. package/dist/shared/@ai-setting/roy-agent-core-5xf65pz6.js +1305 -0
  54. package/dist/shared/@ai-setting/roy-agent-core-6a72jfdy.js +303 -0
  55. package/dist/shared/{chunk-1aakcfp1.js → @ai-setting/roy-agent-core-7f303ffd.js} +3 -3
  56. package/dist/shared/@ai-setting/roy-agent-core-7fgf85wc.js +284 -0
  57. package/dist/shared/{chunk-t1rh6jtm.js → @ai-setting/roy-agent-core-7n436rb4.js} +7 -12
  58. package/dist/shared/@ai-setting/roy-agent-core-7r85t0qn.js +492 -0
  59. package/dist/shared/@ai-setting/roy-agent-core-7rewcey6.js +862 -0
  60. package/dist/shared/@ai-setting/roy-agent-core-92z6t4he.js +14 -0
  61. package/dist/shared/@ai-setting/roy-agent-core-9qwp5qkz.js +1387 -0
  62. package/dist/shared/{chunk-mf5xqbdh.js → @ai-setting/roy-agent-core-9yxb3ty9.js} +3 -2
  63. package/dist/shared/@ai-setting/roy-agent-core-anwsxdds.js +1205 -0
  64. package/dist/shared/{chunk-1qwabsm0.js → @ai-setting/roy-agent-core-bncgx3gb.js} +1 -1
  65. package/dist/shared/@ai-setting/roy-agent-core-cd00w5mb.js +762 -0
  66. package/dist/shared/@ai-setting/roy-agent-core-cgs0j60t.js +442 -0
  67. package/dist/shared/@ai-setting/roy-agent-core-ctdhjv68.js +93 -0
  68. package/dist/shared/@ai-setting/roy-agent-core-dbsk841j.js +286 -0
  69. package/dist/shared/@ai-setting/roy-agent-core-e25xkv53.js +64 -0
  70. package/dist/shared/{chunk-yqmx37vm.js → @ai-setting/roy-agent-core-e5jcp24a.js} +2 -2
  71. package/dist/shared/@ai-setting/roy-agent-core-e62e2a5a.js +204 -0
  72. package/dist/shared/{chunk-g6j5n3gv.js → @ai-setting/roy-agent-core-ewrj1c4k.js} +2 -2
  73. package/dist/shared/{chunk-rncy3rtd.js → @ai-setting/roy-agent-core-fdb6m4e4.js} +119 -1113
  74. package/dist/shared/{chunk-q9j99fsm.js → @ai-setting/roy-agent-core-fv32jaa8.js} +3 -3
  75. package/dist/shared/@ai-setting/roy-agent-core-g1s2h0e5.js +171 -0
  76. package/dist/shared/@ai-setting/roy-agent-core-gmnkza34.js +202 -0
  77. package/dist/shared/@ai-setting/roy-agent-core-hz7rr4yx.js +513 -0
  78. package/dist/shared/@ai-setting/roy-agent-core-j3bbr2n0.js +378 -0
  79. package/dist/shared/{chunk-a9qmy3sc.js → @ai-setting/roy-agent-core-j3wc4465.js} +6 -3
  80. package/dist/shared/@ai-setting/roy-agent-core-jj79gszx.js +1130 -0
  81. package/dist/shared/@ai-setting/roy-agent-core-mwwk6req.js +913 -0
  82. package/dist/shared/{chunk-0q6s9wm6.js → @ai-setting/roy-agent-core-pc9g3962.js} +6 -50
  83. package/dist/shared/@ai-setting/roy-agent-core-psvxt4c9.js +60 -0
  84. package/dist/shared/@ai-setting/roy-agent-core-pzsg9pvf.js +393 -0
  85. package/dist/shared/{chunk-91bas8w5.js → @ai-setting/roy-agent-core-q779wnwm.js} +5 -5
  86. package/dist/shared/{chunk-25x2pdtp.js → @ai-setting/roy-agent-core-qw0ebh1d.js} +1 -1
  87. package/dist/shared/@ai-setting/roy-agent-core-qxhq8ven.js +57 -0
  88. package/dist/shared/@ai-setting/roy-agent-core-qxnbvgwe.js +66 -0
  89. package/dist/shared/@ai-setting/roy-agent-core-qya7seh6.js +408 -0
  90. package/dist/shared/@ai-setting/roy-agent-core-rbetrphj.js +97 -0
  91. package/dist/shared/@ai-setting/roy-agent-core-re1wjfw7.js +587 -0
  92. package/dist/shared/@ai-setting/roy-agent-core-rft3fmp0.js +14 -0
  93. package/dist/shared/@ai-setting/roy-agent-core-rvv6ydff.js +584 -0
  94. package/dist/shared/{chunk-ze20rksg.js → @ai-setting/roy-agent-core-rvxg1wps.js} +1 -1
  95. package/dist/shared/@ai-setting/roy-agent-core-rzp9kxne.js +341 -0
  96. package/dist/shared/@ai-setting/roy-agent-core-t94ktchq.js +213 -0
  97. package/dist/shared/@ai-setting/roy-agent-core-w78syn7w.js +788 -0
  98. package/dist/shared/{chunk-9qzt1v1p.js → @ai-setting/roy-agent-core-z2t8hse8.js} +3 -2
  99. package/package.json +8 -7
  100. package/dist/index.d.ts +0 -7825
  101. package/dist/shared/chunk-hs7tbmje.js +0 -24
  102. /package/dist/shared/{chunk-wbkh7wat.js → @ai-setting/roy-agent-core-fs0mn2jk.js} +0 -0
@@ -0,0 +1,30 @@
1
+ import {
2
+ ActionTypeEnum,
3
+ TaskComponent,
4
+ TaskConfigSchema,
5
+ TaskPriorityEnum,
6
+ TaskStatusEnum
7
+ } from "../../shared/@ai-setting/roy-agent-core-hz7rr4yx.js";
8
+ import {
9
+ SQLiteTaskStore
10
+ } from "../../shared/@ai-setting/roy-agent-core-2kg2wma8.js";
11
+ import"../../shared/@ai-setting/roy-agent-core-dbsk841j.js";
12
+ import"../../shared/@ai-setting/roy-agent-core-t94ktchq.js";
13
+ import"../../shared/@ai-setting/roy-agent-core-w78syn7w.js";
14
+ import"../../shared/@ai-setting/roy-agent-core-92z6t4he.js";
15
+ import"../../shared/@ai-setting/roy-agent-core-qxhq8ven.js";
16
+ import"../../shared/@ai-setting/roy-agent-core-rbetrphj.js";
17
+ import"../../shared/@ai-setting/roy-agent-core-2dhd60aw.js";
18
+ import"../../shared/@ai-setting/roy-agent-core-gmnkza34.js";
19
+ import"../../shared/@ai-setting/roy-agent-core-j3wc4465.js";
20
+ import"../../shared/@ai-setting/roy-agent-core-fv32jaa8.js";
21
+ import"../../shared/@ai-setting/roy-agent-core-bncgx3gb.js";
22
+ import"../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
23
+ export {
24
+ TaskStatusEnum,
25
+ TaskPriorityEnum,
26
+ TaskConfigSchema,
27
+ TaskComponent,
28
+ SQLiteTaskStore,
29
+ ActionTypeEnum
30
+ };
@@ -0,0 +1,23 @@
1
+ import {
2
+ TaskPlugin,
3
+ TaskTagPlugin,
4
+ WORKFLOW_EXTRACTOR_PROMPT,
5
+ createWorkflowExtractorAgent,
6
+ formatExtractorInput,
7
+ formatExtractorInputFromDescription,
8
+ parseExtractorOutput
9
+ } from "../../../shared/@ai-setting/roy-agent-core-12zkpda2.js";
10
+ import"../../../shared/@ai-setting/roy-agent-core-92z6t4he.js";
11
+ import"../../../shared/@ai-setting/roy-agent-core-j3wc4465.js";
12
+ import"../../../shared/@ai-setting/roy-agent-core-fv32jaa8.js";
13
+ import"../../../shared/@ai-setting/roy-agent-core-bncgx3gb.js";
14
+ import"../../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
15
+ export {
16
+ parseExtractorOutput,
17
+ formatExtractorInputFromDescription,
18
+ formatExtractorInput,
19
+ createWorkflowExtractorAgent,
20
+ WORKFLOW_EXTRACTOR_PROMPT,
21
+ TaskTagPlugin,
22
+ TaskPlugin
23
+ };
@@ -0,0 +1,14 @@
1
+ import {
2
+ SQLiteTaskStore,
3
+ getDefaultDataDir,
4
+ getDefaultTaskDbPath
5
+ } from "../../../shared/@ai-setting/roy-agent-core-2kg2wma8.js";
6
+ import"../../../shared/@ai-setting/roy-agent-core-j3wc4465.js";
7
+ import"../../../shared/@ai-setting/roy-agent-core-fv32jaa8.js";
8
+ import"../../../shared/@ai-setting/roy-agent-core-bncgx3gb.js";
9
+ import"../../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
10
+ export {
11
+ getDefaultTaskDbPath,
12
+ getDefaultDataDir,
13
+ SQLiteTaskStore
14
+ };
@@ -0,0 +1,17 @@
1
+ import {
2
+ completeTaskTool,
3
+ createTaskTool,
4
+ deleteTaskTool,
5
+ getTaskTool,
6
+ listTasksTool,
7
+ updateTaskTool
8
+ } from "../../../shared/@ai-setting/roy-agent-core-dbsk841j.js";
9
+ import"../../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
10
+ export {
11
+ updateTaskTool,
12
+ listTasksTool,
13
+ getTaskTool,
14
+ deleteTaskTool,
15
+ createTaskTool,
16
+ completeTaskTool
17
+ };
@@ -0,0 +1,15 @@
1
+ import {
2
+ createOperationTool,
3
+ deleteOperationTool,
4
+ getOperationTool,
5
+ listOperationsTool,
6
+ updateOperationTool
7
+ } from "../../../../shared/@ai-setting/roy-agent-core-t94ktchq.js";
8
+ import"../../../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
9
+ export {
10
+ updateOperationTool,
11
+ listOperationsTool,
12
+ getOperationTool,
13
+ deleteOperationTool,
14
+ createOperationTool
15
+ };
@@ -8,10 +8,10 @@ import {
8
8
  grepTool,
9
9
  readFileTool,
10
10
  writeFileTool
11
- } from "./chunk-g6j5n3gv.js";
12
- import"./chunk-q9j99fsm.js";
13
- import"./chunk-1qwabsm0.js";
14
- import"./chunk-wbkh7wat.js";
11
+ } from "../../../shared/@ai-setting/roy-agent-core-ewrj1c4k.js";
12
+ import"../../../shared/@ai-setting/roy-agent-core-fv32jaa8.js";
13
+ import"../../../shared/@ai-setting/roy-agent-core-bncgx3gb.js";
14
+ import"../../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
15
15
  export {
16
16
  writeFileTool,
17
17
  readFileTool,
@@ -0,0 +1,39 @@
1
+ import {
2
+ ToolComponent,
3
+ ToolRegistry,
4
+ ToolValidator
5
+ } from "../../shared/@ai-setting/roy-agent-core-cgs0j60t.js";
6
+ import {
7
+ bashTool,
8
+ echoTool,
9
+ editFileTool,
10
+ getAllBuiltInTools,
11
+ getBuiltInTool,
12
+ globTool,
13
+ grepTool,
14
+ readFileTool,
15
+ writeFileTool
16
+ } from "../../shared/@ai-setting/roy-agent-core-ewrj1c4k.js";
17
+ import"../../shared/@ai-setting/roy-agent-core-e25xkv53.js";
18
+ import"../../shared/@ai-setting/roy-agent-core-qxhq8ven.js";
19
+ import"../../shared/@ai-setting/roy-agent-core-rbetrphj.js";
20
+ import"../../shared/@ai-setting/roy-agent-core-2dhd60aw.js";
21
+ import"../../shared/@ai-setting/roy-agent-core-gmnkza34.js";
22
+ import"../../shared/@ai-setting/roy-agent-core-j3wc4465.js";
23
+ import"../../shared/@ai-setting/roy-agent-core-fv32jaa8.js";
24
+ import"../../shared/@ai-setting/roy-agent-core-bncgx3gb.js";
25
+ import"../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
26
+ export {
27
+ writeFileTool,
28
+ readFileTool,
29
+ grepTool,
30
+ globTool,
31
+ getBuiltInTool,
32
+ getAllBuiltInTools,
33
+ editFileTool,
34
+ echoTool,
35
+ bashTool,
36
+ ToolValidator,
37
+ ToolRegistry,
38
+ ToolComponent
39
+ };
@@ -0,0 +1,27 @@
1
+ import {
2
+ Edge,
3
+ NodeAs,
4
+ Workflow,
5
+ WorkflowConverter,
6
+ WorkflowEdges,
7
+ createWorkflowFromClass,
8
+ getEdgeMetadatas,
9
+ getNodeMetadatas,
10
+ getWorkflowMetadata
11
+ } from "../../../shared/@ai-setting/roy-agent-core-7fgf85wc.js";
12
+ import {
13
+ DecoratorNode
14
+ } from "../../../shared/@ai-setting/roy-agent-core-1ce3fqrk.js";
15
+ import"../../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
16
+ export {
17
+ getWorkflowMetadata,
18
+ getNodeMetadatas,
19
+ getEdgeMetadatas,
20
+ createWorkflowFromClass,
21
+ WorkflowEdges,
22
+ WorkflowConverter,
23
+ Workflow,
24
+ NodeAs,
25
+ Edge,
26
+ DecoratorNode
27
+ };
@@ -0,0 +1,28 @@
1
+ import {
2
+ DAGManager,
3
+ EventBus,
4
+ Executor,
5
+ NodeRegistry,
6
+ Scheduler,
7
+ WorkflowEngine,
8
+ init_engine
9
+ } from "../../../shared/@ai-setting/roy-agent-core-fdb6m4e4.js";
10
+ import"../../../shared/@ai-setting/roy-agent-core-pc9g3962.js";
11
+ import"../../../shared/@ai-setting/roy-agent-core-3agad0d9.js";
12
+ import"../../../shared/@ai-setting/roy-agent-core-rzp9kxne.js";
13
+ import"../../../shared/@ai-setting/roy-agent-core-e25xkv53.js";
14
+ import"../../../shared/@ai-setting/roy-agent-core-35x0wrtt.js";
15
+ import"../../../shared/@ai-setting/roy-agent-core-j3wc4465.js";
16
+ import"../../../shared/@ai-setting/roy-agent-core-fv32jaa8.js";
17
+ import"../../../shared/@ai-setting/roy-agent-core-bncgx3gb.js";
18
+ import"../../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
19
+ init_engine();
20
+
21
+ export {
22
+ WorkflowEngine,
23
+ Scheduler,
24
+ NodeRegistry,
25
+ Executor,
26
+ EventBus,
27
+ DAGManager
28
+ };
@@ -0,0 +1,132 @@
1
+ import {
2
+ WorkflowComponent
3
+ } from "../../shared/@ai-setting/roy-agent-core-4rqmfr7t.js";
4
+ import"../../shared/@ai-setting/roy-agent-core-0rtxwr28.js";
5
+ import"../../shared/@ai-setting/roy-agent-core-4t40mkpv.js";
6
+ import"../../shared/@ai-setting/roy-agent-core-0vbdz0x7.js";
7
+ import {
8
+ Edge,
9
+ NodeAs,
10
+ Workflow,
11
+ WorkflowConverter,
12
+ WorkflowEdges,
13
+ createWorkflowFromClass
14
+ } from "../../shared/@ai-setting/roy-agent-core-7fgf85wc.js";
15
+ import {
16
+ DecoratorNode,
17
+ init_decorator_node
18
+ } from "../../shared/@ai-setting/roy-agent-core-1ce3fqrk.js";
19
+ import"../../shared/@ai-setting/roy-agent-core-fdb6m4e4.js";
20
+ import"../../shared/@ai-setting/roy-agent-core-pc9g3962.js";
21
+ import"../../shared/@ai-setting/roy-agent-core-3agad0d9.js";
22
+ import {
23
+ BaseEventSchema,
24
+ ControlPauseEventSchema,
25
+ ControlResumeEventSchema,
26
+ ControlStopEventSchema,
27
+ DependsOnSchema,
28
+ NodeAddedEventSchema,
29
+ NodeCompletedEventSchema,
30
+ NodeDataEventSchema,
31
+ NodeDefinitionSchema,
32
+ NodeFailedEventSchema,
33
+ NodeInterruptEventSchema,
34
+ NodeProgressEventSchema,
35
+ NodeRemovedEventSchema,
36
+ NodeScheduledEventSchema,
37
+ NodeSkippedEventSchema,
38
+ NodeStartedEventSchema,
39
+ NodeStatusSchema,
40
+ OutputDefinitionSchema,
41
+ RetryConfigSchema,
42
+ RunStatusSchema,
43
+ WorkflowAskUserEventSchema,
44
+ WorkflowCompletedEventSchema,
45
+ WorkflowConfigSchema,
46
+ WorkflowDefinitionSchema,
47
+ WorkflowEventSchema,
48
+ WorkflowFailedEventSchema,
49
+ WorkflowMessageRoleSchema,
50
+ WorkflowMetadataSchema,
51
+ WorkflowOutputEventSchema,
52
+ WorkflowPausedEventSchema,
53
+ WorkflowResumedEventSchema,
54
+ WorkflowStartedEventSchema,
55
+ WorkflowStoppedEventSchema,
56
+ createNodeExecutionContext,
57
+ createWorkflowEvent,
58
+ getWorkflowSessionStatus,
59
+ init_types,
60
+ isWorkflowSessionMetadata,
61
+ parseWorkflowFile,
62
+ parseWorkflowFileSync
63
+ } from "../../shared/@ai-setting/roy-agent-core-rzp9kxne.js";
64
+ import {
65
+ AskUserError,
66
+ createNodeInterruptEvent,
67
+ createWorkflowAskUserEvent
68
+ } from "../../shared/@ai-setting/roy-agent-core-e25xkv53.js";
69
+ import"../../shared/@ai-setting/roy-agent-core-rbetrphj.js";
70
+ import"../../shared/@ai-setting/roy-agent-core-2dhd60aw.js";
71
+ import"../../shared/@ai-setting/roy-agent-core-gmnkza34.js";
72
+ import"../../shared/@ai-setting/roy-agent-core-35x0wrtt.js";
73
+ import"../../shared/@ai-setting/roy-agent-core-j3wc4465.js";
74
+ import"../../shared/@ai-setting/roy-agent-core-fv32jaa8.js";
75
+ import"../../shared/@ai-setting/roy-agent-core-bncgx3gb.js";
76
+ import"../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
77
+
78
+ // src/env/workflow/index.ts
79
+ init_decorator_node();
80
+ init_types();
81
+ export {
82
+ parseWorkflowFileSync,
83
+ parseWorkflowFile,
84
+ isWorkflowSessionMetadata,
85
+ getWorkflowSessionStatus,
86
+ createWorkflowFromClass,
87
+ createWorkflowEvent,
88
+ createWorkflowAskUserEvent,
89
+ createNodeInterruptEvent,
90
+ createNodeExecutionContext,
91
+ WorkflowStoppedEventSchema,
92
+ WorkflowStartedEventSchema,
93
+ WorkflowResumedEventSchema,
94
+ WorkflowPausedEventSchema,
95
+ WorkflowOutputEventSchema,
96
+ WorkflowMetadataSchema,
97
+ WorkflowMessageRoleSchema,
98
+ WorkflowFailedEventSchema,
99
+ WorkflowEventSchema,
100
+ WorkflowEdges,
101
+ WorkflowDefinitionSchema,
102
+ WorkflowConverter,
103
+ WorkflowConfigSchema,
104
+ WorkflowComponent,
105
+ WorkflowCompletedEventSchema,
106
+ WorkflowAskUserEventSchema,
107
+ Workflow,
108
+ RunStatusSchema,
109
+ RetryConfigSchema,
110
+ OutputDefinitionSchema,
111
+ NodeStatusSchema,
112
+ NodeStartedEventSchema,
113
+ NodeSkippedEventSchema,
114
+ NodeScheduledEventSchema,
115
+ NodeRemovedEventSchema,
116
+ NodeProgressEventSchema,
117
+ NodeInterruptEventSchema,
118
+ NodeFailedEventSchema,
119
+ NodeDefinitionSchema,
120
+ NodeDataEventSchema,
121
+ NodeCompletedEventSchema,
122
+ NodeAs,
123
+ NodeAddedEventSchema,
124
+ Edge,
125
+ DependsOnSchema,
126
+ DecoratorNode,
127
+ ControlStopEventSchema,
128
+ ControlResumeEventSchema,
129
+ ControlPauseEventSchema,
130
+ BaseEventSchema,
131
+ AskUserError
132
+ };
@@ -0,0 +1,19 @@
1
+ import {
2
+ SkillNode,
3
+ ToolNode,
4
+ WorkflowNode,
5
+ init_skill_node,
6
+ init_tool_node,
7
+ init_workflow_node
8
+ } from "../../../shared/@ai-setting/roy-agent-core-3agad0d9.js";
9
+ import"../../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
10
+
11
+ // src/env/workflow/nodes/index.ts
12
+ init_tool_node();
13
+ init_skill_node();
14
+ init_workflow_node();
15
+ export {
16
+ WorkflowNode,
17
+ ToolNode,
18
+ SkillNode
19
+ };
@@ -0,0 +1,13 @@
1
+ import {
2
+ WorkflowService,
3
+ WorkflowServiceRegistry,
4
+ getWorkflowService,
5
+ registerWorkflowService
6
+ } from "../../../shared/@ai-setting/roy-agent-core-4t40mkpv.js";
7
+ import"../../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
8
+ export {
9
+ registerWorkflowService,
10
+ getWorkflowService,
11
+ WorkflowServiceRegistry,
12
+ WorkflowService
13
+ };
@@ -0,0 +1,27 @@
1
+ import {
2
+ WorkflowRepository,
3
+ rowToWorkflow
4
+ } from "../../../shared/@ai-setting/roy-agent-core-7n436rb4.js";
5
+ import {
6
+ closeDatabase,
7
+ getDatabase,
8
+ getDatabasePath,
9
+ initDatabase,
10
+ initializeTables,
11
+ resetDatabase
12
+ } from "../../../shared/@ai-setting/roy-agent-core-37e4tep3.js";
13
+ import"../../../shared/@ai-setting/roy-agent-core-rvxg1wps.js";
14
+ import"../../../shared/@ai-setting/roy-agent-core-j3wc4465.js";
15
+ import"../../../shared/@ai-setting/roy-agent-core-fv32jaa8.js";
16
+ import"../../../shared/@ai-setting/roy-agent-core-bncgx3gb.js";
17
+ import"../../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
18
+ export {
19
+ rowToWorkflow,
20
+ resetDatabase,
21
+ initializeTables,
22
+ initDatabase,
23
+ getDatabasePath,
24
+ getDatabase,
25
+ closeDatabase,
26
+ WorkflowRepository
27
+ };
@@ -0,0 +1,159 @@
1
+ import {
2
+ AskUserInputSchema,
3
+ askUserTool,
4
+ askUserToolInstance
5
+ } from "../../../shared/@ai-setting/roy-agent-core-0vbdz0x7.js";
6
+ import"../../../shared/@ai-setting/roy-agent-core-e25xkv53.js";
7
+ import {
8
+ createLogger,
9
+ init_logger
10
+ } from "../../../shared/@ai-setting/roy-agent-core-j3wc4465.js";
11
+ import"../../../shared/@ai-setting/roy-agent-core-fv32jaa8.js";
12
+ import"../../../shared/@ai-setting/roy-agent-core-bncgx3gb.js";
13
+ import"../../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
14
+
15
+ // src/env/workflow/tools/run-workflow.ts
16
+ init_logger();
17
+ import { z } from "zod";
18
+ var logger = createLogger("run-workflow-tool");
19
+ var RunWorkflowInputSchema = z.object({
20
+ workflow_name: z.string().describe("Name of the workflow to run"),
21
+ input: z.record(z.any()).optional().describe("Input to pass to the workflow"),
22
+ sync: z.boolean().default(true).describe("Wait for completion (default: true)"),
23
+ timeout: z.number().positive().optional().describe("Timeout in milliseconds")
24
+ });
25
+ function createRunWorkflowTool(workflowService) {
26
+ return {
27
+ name: "run-workflow",
28
+ description: "Run a workflow by name with optional input. Returns run_id, status, output, error, and duration_ms.",
29
+ parameters: RunWorkflowInputSchema,
30
+ sandbox: {
31
+ enabled: false
32
+ },
33
+ permission: {
34
+ level: "safe"
35
+ },
36
+ metadata: {
37
+ category: "workflow",
38
+ tags: ["workflow", "execute", "run"],
39
+ version: "1.0.0",
40
+ experimental: false
41
+ },
42
+ execute: async (args, ctx) => {
43
+ const startTime = Date.now();
44
+ const { workflow_name, input, sync = true, timeout } = args;
45
+ logger.info(`Running workflow: ${workflow_name}`, { input, sync, timeout });
46
+ let timeoutHandle;
47
+ let durationMs;
48
+ try {
49
+ let result;
50
+ if (timeout) {
51
+ result = await Promise.race([
52
+ workflowService.runWorkflow(workflow_name, input, { sync }),
53
+ new Promise((_, reject) => {
54
+ timeoutHandle = setTimeout(() => {
55
+ reject(new Error("Workflow execution timed out"));
56
+ }, timeout);
57
+ })
58
+ ]);
59
+ } else {
60
+ result = await workflowService.runWorkflow(workflow_name, input, { sync });
61
+ }
62
+ if (timeoutHandle) {
63
+ clearTimeout(timeoutHandle);
64
+ }
65
+ durationMs = Date.now() - startTime;
66
+ if (sync) {
67
+ return {
68
+ success: result.status === "completed",
69
+ output: {
70
+ run_id: result.runId,
71
+ status: result.status,
72
+ output: result.output,
73
+ error: result.error,
74
+ duration_ms: result.durationMs || durationMs
75
+ },
76
+ metadata: {
77
+ execution_time_ms: durationMs
78
+ }
79
+ };
80
+ } else {
81
+ return {
82
+ success: true,
83
+ output: {
84
+ run_id: result.runId,
85
+ status: result.status,
86
+ duration_ms: durationMs
87
+ },
88
+ metadata: {
89
+ execution_time_ms: durationMs
90
+ }
91
+ };
92
+ }
93
+ } catch (error) {
94
+ if (timeoutHandle) {
95
+ clearTimeout(timeoutHandle);
96
+ }
97
+ durationMs = Date.now() - startTime;
98
+ const errorMessage = error instanceof Error ? error.message : String(error);
99
+ if (errorMessage.includes("Workflow not found")) {
100
+ return {
101
+ success: false,
102
+ output: "",
103
+ error: `Workflow not found: ${workflow_name}`,
104
+ metadata: {
105
+ execution_time_ms: durationMs
106
+ }
107
+ };
108
+ }
109
+ if (errorMessage.includes("abort") || errorMessage.includes("timed out")) {
110
+ return {
111
+ success: false,
112
+ output: "",
113
+ error: `Workflow execution timed out or was aborted: ${workflow_name}`,
114
+ metadata: {
115
+ execution_time_ms: durationMs
116
+ }
117
+ };
118
+ }
119
+ if (logger?.error) {
120
+ logger.error(`Failed to run workflow: ${workflow_name}`, { error: errorMessage });
121
+ }
122
+ return {
123
+ success: false,
124
+ output: "",
125
+ error: `Failed to run workflow ${workflow_name}: ${errorMessage}`,
126
+ metadata: {
127
+ execution_time_ms: durationMs
128
+ }
129
+ };
130
+ }
131
+ }
132
+ };
133
+ }
134
+ var _runWorkflowTool = null;
135
+ var _workflowService = null;
136
+ function initRunWorkflowTool(workflowService) {
137
+ _workflowService = workflowService;
138
+ _runWorkflowTool = createRunWorkflowTool(workflowService);
139
+ }
140
+ function getRunWorkflowTool() {
141
+ if (!_runWorkflowTool || !_workflowService) {
142
+ throw new Error("run-workflow tool not initialized. Call initRunWorkflowTool(workflowService) first.");
143
+ }
144
+ return _runWorkflowTool;
145
+ }
146
+ function resetRunWorkflowTool() {
147
+ _runWorkflowTool = null;
148
+ _workflowService = null;
149
+ }
150
+ export {
151
+ resetRunWorkflowTool,
152
+ initRunWorkflowTool,
153
+ getRunWorkflowTool,
154
+ createRunWorkflowTool,
155
+ askUserToolInstance,
156
+ askUserTool,
157
+ RunWorkflowInputSchema,
158
+ AskUserInputSchema
159
+ };
@@ -0,0 +1,94 @@
1
+ import {
2
+ BaseEventSchema,
3
+ ControlPauseEventSchema,
4
+ ControlResumeEventSchema,
5
+ ControlStopEventSchema,
6
+ DependsOnSchema,
7
+ NodeAddedEventSchema,
8
+ NodeCompletedEventSchema,
9
+ NodeDataEventSchema,
10
+ NodeDefinitionSchema,
11
+ NodeFailedEventSchema,
12
+ NodeInterruptEventSchema,
13
+ NodeProgressEventSchema,
14
+ NodeRemovedEventSchema,
15
+ NodeScheduledEventSchema,
16
+ NodeSkippedEventSchema,
17
+ NodeStartedEventSchema,
18
+ NodeStatusSchema,
19
+ OutputDefinitionSchema,
20
+ RetryConfigSchema,
21
+ RunStatusSchema,
22
+ WorkflowAskUserEventSchema,
23
+ WorkflowCompletedEventSchema,
24
+ WorkflowConfigSchema,
25
+ WorkflowDefinitionSchema,
26
+ WorkflowEventSchema,
27
+ WorkflowFailedEventSchema,
28
+ WorkflowMessageRoleSchema,
29
+ WorkflowMetadataSchema,
30
+ WorkflowOutputEventSchema,
31
+ WorkflowPausedEventSchema,
32
+ WorkflowResumedEventSchema,
33
+ WorkflowStartedEventSchema,
34
+ WorkflowStoppedEventSchema,
35
+ createNodeExecutionContext,
36
+ createWorkflowEvent,
37
+ getWorkflowSessionStatus,
38
+ init_types,
39
+ isWorkflowSessionMetadata,
40
+ parseWorkflowFile,
41
+ parseWorkflowFileSync
42
+ } from "../../../shared/@ai-setting/roy-agent-core-rzp9kxne.js";
43
+ import {
44
+ AskUserError,
45
+ createNodeInterruptEvent,
46
+ createWorkflowAskUserEvent
47
+ } from "../../../shared/@ai-setting/roy-agent-core-e25xkv53.js";
48
+ import"../../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
49
+ init_types();
50
+
51
+ export {
52
+ parseWorkflowFileSync,
53
+ parseWorkflowFile,
54
+ isWorkflowSessionMetadata,
55
+ getWorkflowSessionStatus,
56
+ createWorkflowEvent,
57
+ createWorkflowAskUserEvent,
58
+ createNodeInterruptEvent,
59
+ createNodeExecutionContext,
60
+ WorkflowStoppedEventSchema,
61
+ WorkflowStartedEventSchema,
62
+ WorkflowResumedEventSchema,
63
+ WorkflowPausedEventSchema,
64
+ WorkflowOutputEventSchema,
65
+ WorkflowMetadataSchema,
66
+ WorkflowMessageRoleSchema,
67
+ WorkflowFailedEventSchema,
68
+ WorkflowEventSchema,
69
+ WorkflowDefinitionSchema,
70
+ WorkflowConfigSchema,
71
+ WorkflowCompletedEventSchema,
72
+ WorkflowAskUserEventSchema,
73
+ RunStatusSchema,
74
+ RetryConfigSchema,
75
+ OutputDefinitionSchema,
76
+ NodeStatusSchema,
77
+ NodeStartedEventSchema,
78
+ NodeSkippedEventSchema,
79
+ NodeScheduledEventSchema,
80
+ NodeRemovedEventSchema,
81
+ NodeProgressEventSchema,
82
+ NodeInterruptEventSchema,
83
+ NodeFailedEventSchema,
84
+ NodeDefinitionSchema,
85
+ NodeDataEventSchema,
86
+ NodeCompletedEventSchema,
87
+ NodeAddedEventSchema,
88
+ DependsOnSchema,
89
+ ControlStopEventSchema,
90
+ ControlResumeEventSchema,
91
+ ControlPauseEventSchema,
92
+ BaseEventSchema,
93
+ AskUserError
94
+ };