@ai-setting/roy-agent-core 1.5.42 → 1.5.44

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 (31) hide show
  1. package/dist/env/agent/index.js +2 -2
  2. package/dist/env/index.js +11 -10
  3. package/dist/env/task/delegate/index.js +3 -2
  4. package/dist/env/task/index.js +3 -3
  5. package/dist/env/tool/built-in/index.js +1 -1
  6. package/dist/env/tool/index.js +2 -2
  7. package/dist/env/workflow/decorators/index.js +1 -1
  8. package/dist/env/workflow/engine/index.js +4 -3
  9. package/dist/env/workflow/index.js +34 -19
  10. package/dist/env/workflow/nodes/index.js +5 -1
  11. package/dist/env/workflow/types/index.js +16 -2
  12. package/dist/env/workflow/utils/index.js +15 -196
  13. package/dist/index.js +13 -12
  14. package/dist/shared/@ai-setting/{roy-agent-core-9q6sa7m3.js → roy-agent-core-1zq3p19q.js} +1 -1
  15. package/dist/shared/@ai-setting/{roy-agent-core-ffb9fq4v.js → roy-agent-core-23gw9c4s.js} +2 -2
  16. package/dist/shared/@ai-setting/{roy-agent-core-bmr6bdfb.js → roy-agent-core-2ms7296b.js} +4 -4
  17. package/dist/shared/@ai-setting/{roy-agent-core-2jnzv9at.js → roy-agent-core-38dkek2y.js} +319 -189
  18. package/dist/shared/@ai-setting/roy-agent-core-6vxg2gmr.js +321 -0
  19. package/dist/shared/@ai-setting/{roy-agent-core-0rtxwr28.js → roy-agent-core-9bmtxmp6.js} +77 -120
  20. package/dist/shared/@ai-setting/{roy-agent-core-xz22rmak.js → roy-agent-core-9p43ap7h.js} +21 -7
  21. package/dist/shared/@ai-setting/{roy-agent-core-7t05apnp.js → roy-agent-core-fg3j215p.js} +26 -0
  22. package/dist/shared/@ai-setting/{roy-agent-core-7fgf85wc.js → roy-agent-core-h0x19xgn.js} +6 -7
  23. package/dist/shared/@ai-setting/roy-agent-core-qnrf2aw6.js +441 -0
  24. package/dist/shared/@ai-setting/{roy-agent-core-ek6gk3wk.js → roy-agent-core-r6rwsr54.js} +42 -3
  25. package/dist/shared/@ai-setting/roy-agent-core-v002ynpa.js +435 -0
  26. package/dist/shared/@ai-setting/{roy-agent-core-rsybkb38.js → roy-agent-core-ysvh8er9.js} +36 -39
  27. package/dist/shared/@ai-setting/{roy-agent-core-9yxb3ty9.js → roy-agent-core-z5sxe4p7.js} +5 -1
  28. package/package.json +1 -1
  29. package/dist/shared/@ai-setting/roy-agent-core-5x94xmt6.js +0 -350
  30. package/dist/shared/@ai-setting/roy-agent-core-jvatggbb.js +0 -603
  31. /package/dist/shared/@ai-setting/{roy-agent-core-e130w7mv.js → roy-agent-core-ryw3ckfy.js} +0 -0
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  AgentComponent,
3
3
  AgentComponentConfigSchema
4
- } from "../../shared/@ai-setting/roy-agent-core-ek6gk3wk.js";
4
+ } from "../../shared/@ai-setting/roy-agent-core-r6rwsr54.js";
5
5
  import"../../shared/@ai-setting/roy-agent-core-e25xkv53.js";
6
- import"../../shared/@ai-setting/roy-agent-core-7t05apnp.js";
6
+ import"../../shared/@ai-setting/roy-agent-core-fg3j215p.js";
7
7
  import"../../shared/@ai-setting/roy-agent-core-qxnbvgwe.js";
8
8
  import"../../shared/@ai-setting/roy-agent-core-ctdhjv68.js";
9
9
  import {
package/dist/env/index.js CHANGED
@@ -21,27 +21,28 @@ import"../shared/@ai-setting/roy-agent-core-e9fdm13a.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-bmr6bdfb.js";
25
- import"../shared/@ai-setting/roy-agent-core-0rtxwr28.js";
26
- import"../shared/@ai-setting/roy-agent-core-2jnzv9at.js";
24
+ } from "../shared/@ai-setting/roy-agent-core-2ms7296b.js";
25
+ import"../shared/@ai-setting/roy-agent-core-9bmtxmp6.js";
26
+ import"../shared/@ai-setting/roy-agent-core-38dkek2y.js";
27
27
  import"../shared/@ai-setting/roy-agent-core-69jskqjg.js";
28
28
  import"../shared/@ai-setting/roy-agent-core-4t40mkpv.js";
29
- import"../shared/@ai-setting/roy-agent-core-jvatggbb.js";
30
- import"../shared/@ai-setting/roy-agent-core-5x94xmt6.js";
29
+ import"../shared/@ai-setting/roy-agent-core-6vxg2gmr.js";
31
30
  import"../shared/@ai-setting/roy-agent-core-0vbdz0x7.js";
32
- import"../shared/@ai-setting/roy-agent-core-7fgf85wc.js";
31
+ import"../shared/@ai-setting/roy-agent-core-h0x19xgn.js";
33
32
  import"../shared/@ai-setting/roy-agent-core-1ce3fqrk.js";
33
+ import"../shared/@ai-setting/roy-agent-core-v002ynpa.js";
34
+ import"../shared/@ai-setting/roy-agent-core-qnrf2aw6.js";
34
35
  import {
35
36
  AgentComponent,
36
37
  AgentComponentConfigSchema
37
- } from "../shared/@ai-setting/roy-agent-core-ek6gk3wk.js";
38
+ } from "../shared/@ai-setting/roy-agent-core-r6rwsr54.js";
38
39
  import"../shared/@ai-setting/roy-agent-core-e25xkv53.js";
39
40
  import {
40
41
  TaskComponent
41
- } from "../shared/@ai-setting/roy-agent-core-9q6sa7m3.js";
42
- import"../shared/@ai-setting/roy-agent-core-xz22rmak.js";
42
+ } from "../shared/@ai-setting/roy-agent-core-1zq3p19q.js";
43
+ import"../shared/@ai-setting/roy-agent-core-9p43ap7h.js";
43
44
  import"../shared/@ai-setting/roy-agent-core-hsxn8m1j.js";
44
- import"../shared/@ai-setting/roy-agent-core-7t05apnp.js";
45
+ import"../shared/@ai-setting/roy-agent-core-fg3j215p.js";
45
46
  import {
46
47
  XDG_PATHS,
47
48
  getXDGPath,
@@ -3,10 +3,11 @@ import {
3
3
  BackgroundTaskManager,
4
4
  createDelegateTool,
5
5
  createStopTool
6
- } from "../../../shared/@ai-setting/roy-agent-core-xz22rmak.js";
7
- import"../../../shared/@ai-setting/roy-agent-core-7t05apnp.js";
6
+ } from "../../../shared/@ai-setting/roy-agent-core-9p43ap7h.js";
7
+ import"../../../shared/@ai-setting/roy-agent-core-fg3j215p.js";
8
8
  import"../../../shared/@ai-setting/roy-agent-core-qxnbvgwe.js";
9
9
  import"../../../shared/@ai-setting/roy-agent-core-92z6t4he.js";
10
+ import"../../../shared/@ai-setting/roy-agent-core-q5qj0fes.js";
10
11
  import"../../../shared/@ai-setting/roy-agent-core-jqy2mdyq.js";
11
12
  import"../../../shared/@ai-setting/roy-agent-core-z33en0cz.js";
12
13
  import"../../../shared/@ai-setting/roy-agent-core-10n2jh7p.js";
@@ -4,12 +4,12 @@ import {
4
4
  TaskConfigSchema,
5
5
  TaskPriorityEnum,
6
6
  TaskStatusEnum
7
- } from "../../shared/@ai-setting/roy-agent-core-9q6sa7m3.js";
8
- import"../../shared/@ai-setting/roy-agent-core-xz22rmak.js";
7
+ } from "../../shared/@ai-setting/roy-agent-core-1zq3p19q.js";
8
+ import"../../shared/@ai-setting/roy-agent-core-9p43ap7h.js";
9
9
  import {
10
10
  SQLiteTaskStore
11
11
  } from "../../shared/@ai-setting/roy-agent-core-hsxn8m1j.js";
12
- import"../../shared/@ai-setting/roy-agent-core-7t05apnp.js";
12
+ import"../../shared/@ai-setting/roy-agent-core-fg3j215p.js";
13
13
  import"../../shared/@ai-setting/roy-agent-core-qxnbvgwe.js";
14
14
  import"../../shared/@ai-setting/roy-agent-core-wa1kzqky.js";
15
15
  import"../../shared/@ai-setting/roy-agent-core-t94ktchq.js";
@@ -8,7 +8,7 @@ import {
8
8
  grepTool,
9
9
  readFileTool,
10
10
  writeFileTool
11
- } from "../../../shared/@ai-setting/roy-agent-core-rsybkb38.js";
11
+ } from "../../../shared/@ai-setting/roy-agent-core-ysvh8er9.js";
12
12
  import"../../../shared/@ai-setting/roy-agent-core-58k274fg.js";
13
13
  import"../../../shared/@ai-setting/roy-agent-core-c6592r3c.js";
14
14
  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-e130w7mv.js";
7
+ } from "../../shared/@ai-setting/roy-agent-core-ryw3ckfy.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-rsybkb38.js";
18
+ } from "../../shared/@ai-setting/roy-agent-core-ysvh8er9.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-4jqq077c.js";
@@ -8,7 +8,7 @@ import {
8
8
  getEdgeMetadatas,
9
9
  getNodeMetadatas,
10
10
  getWorkflowMetadata
11
- } from "../../../shared/@ai-setting/roy-agent-core-7fgf85wc.js";
11
+ } from "../../../shared/@ai-setting/roy-agent-core-h0x19xgn.js";
12
12
  import {
13
13
  DecoratorNode
14
14
  } from "../../../shared/@ai-setting/roy-agent-core-1ce3fqrk.js";
@@ -6,10 +6,11 @@ import {
6
6
  Scheduler,
7
7
  WorkflowEngine,
8
8
  init_engine
9
- } from "../../../shared/@ai-setting/roy-agent-core-2jnzv9at.js";
9
+ } from "../../../shared/@ai-setting/roy-agent-core-38dkek2y.js";
10
10
  import"../../../shared/@ai-setting/roy-agent-core-69jskqjg.js";
11
- import"../../../shared/@ai-setting/roy-agent-core-jvatggbb.js";
12
- import"../../../shared/@ai-setting/roy-agent-core-5x94xmt6.js";
11
+ import"../../../shared/@ai-setting/roy-agent-core-6vxg2gmr.js";
12
+ import"../../../shared/@ai-setting/roy-agent-core-v002ynpa.js";
13
+ import"../../../shared/@ai-setting/roy-agent-core-qnrf2aw6.js";
13
14
  import"../../../shared/@ai-setting/roy-agent-core-e25xkv53.js";
14
15
  import"../../../shared/@ai-setting/roy-agent-core-q5qj0fes.js";
15
16
  import"../../../shared/@ai-setting/roy-agent-core-10n2jh7p.js";
@@ -1,17 +1,32 @@
1
1
  import {
2
2
  WorkflowComponent
3
- } from "../../shared/@ai-setting/roy-agent-core-bmr6bdfb.js";
4
- import"../../shared/@ai-setting/roy-agent-core-0rtxwr28.js";
5
- import"../../shared/@ai-setting/roy-agent-core-2jnzv9at.js";
3
+ } from "../../shared/@ai-setting/roy-agent-core-2ms7296b.js";
4
+ import"../../shared/@ai-setting/roy-agent-core-9bmtxmp6.js";
5
+ import"../../shared/@ai-setting/roy-agent-core-38dkek2y.js";
6
6
  import"../../shared/@ai-setting/roy-agent-core-69jskqjg.js";
7
7
  import"../../shared/@ai-setting/roy-agent-core-4t40mkpv.js";
8
- import"../../shared/@ai-setting/roy-agent-core-jvatggbb.js";
8
+ import"../../shared/@ai-setting/roy-agent-core-6vxg2gmr.js";
9
+ import"../../shared/@ai-setting/roy-agent-core-0vbdz0x7.js";
10
+ import {
11
+ Edge,
12
+ NodeAs,
13
+ Workflow,
14
+ WorkflowConverter,
15
+ WorkflowEdges,
16
+ createWorkflowFromClass
17
+ } from "../../shared/@ai-setting/roy-agent-core-h0x19xgn.js";
18
+ import {
19
+ DecoratorNode,
20
+ init_decorator_node
21
+ } from "../../shared/@ai-setting/roy-agent-core-1ce3fqrk.js";
22
+ import"../../shared/@ai-setting/roy-agent-core-v002ynpa.js";
9
23
  import {
10
24
  BaseEventSchema,
11
25
  ControlPauseEventSchema,
12
26
  ControlResumeEventSchema,
13
27
  ControlStopEventSchema,
14
28
  DependsOnSchema,
29
+ EdgeDefinitionSchema,
15
30
  InputParameterSchema,
16
31
  NodeAddedEventSchema,
17
32
  NodeCompletedEventSchema,
@@ -28,10 +43,12 @@ import {
28
43
  OutputDefinitionSchema,
29
44
  RetryConfigSchema,
30
45
  RunStatusSchema,
46
+ TemplateUnresolvedError,
31
47
  WorkflowAskUserEventSchema,
32
48
  WorkflowCompletedEventSchema,
33
49
  WorkflowConfigSchema,
34
50
  WorkflowDefinitionSchema,
51
+ WorkflowError,
35
52
  WorkflowEventSchema,
36
53
  WorkflowFailedEventSchema,
37
54
  WorkflowInputsSchema,
@@ -42,27 +59,18 @@ import {
42
59
  WorkflowResumedEventSchema,
43
60
  WorkflowStartedEventSchema,
44
61
  WorkflowStoppedEventSchema,
62
+ WorkflowValidationError,
45
63
  createNodeExecutionContext,
46
64
  createWorkflowEvent,
47
65
  getWorkflowSessionStatus,
48
66
  init_types,
49
67
  isWorkflowSessionMetadata,
68
+ nodeNotFound,
50
69
  parseWorkflowFile,
51
- parseWorkflowFileSync
52
- } from "../../shared/@ai-setting/roy-agent-core-5x94xmt6.js";
53
- import"../../shared/@ai-setting/roy-agent-core-0vbdz0x7.js";
54
- import {
55
- Edge,
56
- NodeAs,
57
- Workflow,
58
- WorkflowConverter,
59
- WorkflowEdges,
60
- createWorkflowFromClass
61
- } from "../../shared/@ai-setting/roy-agent-core-7fgf85wc.js";
62
- import {
63
- DecoratorNode,
64
- init_decorator_node
65
- } from "../../shared/@ai-setting/roy-agent-core-1ce3fqrk.js";
70
+ parseWorkflowFileSync,
71
+ pathNotFound,
72
+ unresolvedVariable
73
+ } from "../../shared/@ai-setting/roy-agent-core-qnrf2aw6.js";
66
74
  import {
67
75
  AskUserError,
68
76
  createNodeInterruptEvent,
@@ -82,8 +90,11 @@ import"../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
82
90
  init_decorator_node();
83
91
  init_types();
84
92
  export {
93
+ unresolvedVariable,
94
+ pathNotFound,
85
95
  parseWorkflowFileSync,
86
96
  parseWorkflowFile,
97
+ nodeNotFound,
87
98
  isWorkflowSessionMetadata,
88
99
  getWorkflowSessionStatus,
89
100
  createWorkflowFromClass,
@@ -91,6 +102,7 @@ export {
91
102
  createWorkflowAskUserEvent,
92
103
  createNodeInterruptEvent,
93
104
  createNodeExecutionContext,
105
+ WorkflowValidationError,
94
106
  WorkflowStoppedEventSchema,
95
107
  WorkflowStartedEventSchema,
96
108
  WorkflowResumedEventSchema,
@@ -101,6 +113,7 @@ export {
101
113
  WorkflowInputsSchema,
102
114
  WorkflowFailedEventSchema,
103
115
  WorkflowEventSchema,
116
+ WorkflowError,
104
117
  WorkflowEdges,
105
118
  WorkflowDefinitionSchema,
106
119
  WorkflowConverter,
@@ -109,6 +122,7 @@ export {
109
122
  WorkflowCompletedEventSchema,
110
123
  WorkflowAskUserEventSchema,
111
124
  Workflow,
125
+ TemplateUnresolvedError,
112
126
  RunStatusSchema,
113
127
  RetryConfigSchema,
114
128
  OutputDefinitionSchema,
@@ -126,6 +140,7 @@ export {
126
140
  NodeAs,
127
141
  NodeAddedEventSchema,
128
142
  InputParameterSchema,
143
+ EdgeDefinitionSchema,
129
144
  Edge,
130
145
  DependsOnSchema,
131
146
  DecoratorNode,
@@ -5,7 +5,11 @@ import {
5
5
  init_skill_node,
6
6
  init_tool_node,
7
7
  init_workflow_node
8
- } from "../../../shared/@ai-setting/roy-agent-core-jvatggbb.js";
8
+ } from "../../../shared/@ai-setting/roy-agent-core-6vxg2gmr.js";
9
+ import"../../../shared/@ai-setting/roy-agent-core-q5qj0fes.js";
10
+ import"../../../shared/@ai-setting/roy-agent-core-10n2jh7p.js";
11
+ import"../../../shared/@ai-setting/roy-agent-core-58k274fg.js";
12
+ import"../../../shared/@ai-setting/roy-agent-core-c6592r3c.js";
9
13
  import"../../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
10
14
 
11
15
  // src/env/workflow/nodes/index.ts
@@ -4,6 +4,7 @@ import {
4
4
  ControlResumeEventSchema,
5
5
  ControlStopEventSchema,
6
6
  DependsOnSchema,
7
+ EdgeDefinitionSchema,
7
8
  InputParameterSchema,
8
9
  NodeAddedEventSchema,
9
10
  NodeCompletedEventSchema,
@@ -20,10 +21,12 @@ import {
20
21
  OutputDefinitionSchema,
21
22
  RetryConfigSchema,
22
23
  RunStatusSchema,
24
+ TemplateUnresolvedError,
23
25
  WorkflowAskUserEventSchema,
24
26
  WorkflowCompletedEventSchema,
25
27
  WorkflowConfigSchema,
26
28
  WorkflowDefinitionSchema,
29
+ WorkflowError,
27
30
  WorkflowEventSchema,
28
31
  WorkflowFailedEventSchema,
29
32
  WorkflowInputsSchema,
@@ -34,14 +37,18 @@ import {
34
37
  WorkflowResumedEventSchema,
35
38
  WorkflowStartedEventSchema,
36
39
  WorkflowStoppedEventSchema,
40
+ WorkflowValidationError,
37
41
  createNodeExecutionContext,
38
42
  createWorkflowEvent,
39
43
  getWorkflowSessionStatus,
40
44
  init_types,
41
45
  isWorkflowSessionMetadata,
46
+ nodeNotFound,
42
47
  parseWorkflowFile,
43
- parseWorkflowFileSync
44
- } from "../../../shared/@ai-setting/roy-agent-core-5x94xmt6.js";
48
+ parseWorkflowFileSync,
49
+ pathNotFound,
50
+ unresolvedVariable
51
+ } from "../../../shared/@ai-setting/roy-agent-core-qnrf2aw6.js";
45
52
  import {
46
53
  AskUserError,
47
54
  createNodeInterruptEvent,
@@ -51,14 +58,18 @@ import"../../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
51
58
  init_types();
52
59
 
53
60
  export {
61
+ unresolvedVariable,
62
+ pathNotFound,
54
63
  parseWorkflowFileSync,
55
64
  parseWorkflowFile,
65
+ nodeNotFound,
56
66
  isWorkflowSessionMetadata,
57
67
  getWorkflowSessionStatus,
58
68
  createWorkflowEvent,
59
69
  createWorkflowAskUserEvent,
60
70
  createNodeInterruptEvent,
61
71
  createNodeExecutionContext,
72
+ WorkflowValidationError,
62
73
  WorkflowStoppedEventSchema,
63
74
  WorkflowStartedEventSchema,
64
75
  WorkflowResumedEventSchema,
@@ -69,10 +80,12 @@ export {
69
80
  WorkflowInputsSchema,
70
81
  WorkflowFailedEventSchema,
71
82
  WorkflowEventSchema,
83
+ WorkflowError,
72
84
  WorkflowDefinitionSchema,
73
85
  WorkflowConfigSchema,
74
86
  WorkflowCompletedEventSchema,
75
87
  WorkflowAskUserEventSchema,
88
+ TemplateUnresolvedError,
76
89
  RunStatusSchema,
77
90
  RetryConfigSchema,
78
91
  OutputDefinitionSchema,
@@ -89,6 +102,7 @@ export {
89
102
  NodeCompletedEventSchema,
90
103
  NodeAddedEventSchema,
91
104
  InputParameterSchema,
105
+ EdgeDefinitionSchema,
92
106
  DependsOnSchema,
93
107
  ControlStopEventSchema,
94
108
  ControlResumeEventSchema,
@@ -1,3 +1,11 @@
1
+ import {
2
+ TemplateResolver,
3
+ init_template_resolver,
4
+ resolveTemplateString,
5
+ resolveTemplates
6
+ } from "../../../shared/@ai-setting/roy-agent-core-v002ynpa.js";
7
+ import"../../../shared/@ai-setting/roy-agent-core-qnrf2aw6.js";
8
+ import"../../../shared/@ai-setting/roy-agent-core-e25xkv53.js";
1
9
  import {
2
10
  TracedAs,
3
11
  init_decorator
@@ -9,199 +17,9 @@ import {
9
17
  __legacyDecorateClassTS
10
18
  } from "../../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
11
19
 
12
- // src/env/workflow/utils/template-resolver.ts
13
- class TemplateResolver {
14
- input;
15
- previousOutputs;
16
- constructor(options = {}) {
17
- this.input = options.input ?? {};
18
- this.previousOutputs = options.previousOutputs ?? new Map;
19
- }
20
- static fromContext(context) {
21
- return new TemplateResolver({
22
- input: context.input,
23
- previousOutputs: context.previousOutputs
24
- });
25
- }
26
- resolveValue(input) {
27
- if (input === null || input === undefined) {
28
- return input;
29
- }
30
- if (typeof input === "string") {
31
- const pureTemplate = this.extractPureTemplate(input);
32
- if (pureTemplate) {
33
- return this.resolvePureTemplate(pureTemplate);
34
- }
35
- return this.resolveString(input);
36
- }
37
- if (Array.isArray(input)) {
38
- return input.map((item) => this.resolveValue(item));
39
- }
40
- if (typeof input === "object") {
41
- const resolved = {};
42
- for (const [key, value] of Object.entries(input)) {
43
- resolved[key] = this.resolveValue(value);
44
- }
45
- return resolved;
46
- }
47
- return input;
48
- }
49
- extractPureTemplate(str) {
50
- const trimmed = str.trim();
51
- if (trimmed.startsWith("{{") && trimmed.endsWith("}}") && trimmed.length > 4) {
52
- const content = trimmed.slice(2, -2).trim();
53
- if (!content.includes("{{") && !content.includes("}}")) {
54
- return content;
55
- }
56
- }
57
- return null;
58
- }
59
- resolvePureTemplate(templateContent) {
60
- const value = this.resolveTemplateContent(templateContent);
61
- return value;
62
- }
63
- resolveTemplateContent(templateContent) {
64
- const trimmed = templateContent.trim();
65
- if (trimmed.startsWith("input.")) {
66
- return this.getNestedValue(this.input, trimmed.slice(6));
67
- }
68
- if (trimmed.startsWith("nodes.")) {
69
- return this.resolveNodePath(trimmed.slice(6));
70
- }
71
- if (trimmed !== "input" && trimmed !== "nodes") {
72
- const segments = trimmed.split(".");
73
- const nodeId = segments[0];
74
- const restPath = segments.slice(1).join(".") || undefined;
75
- return this.resolveNodePath(`${nodeId}${restPath ? "." + restPath : ""}`);
76
- }
77
- return;
78
- }
79
- resolveString(template) {
80
- if (!template || typeof template !== "string") {
81
- return template;
82
- }
83
- let resolved = template;
84
- resolved = resolved.replace(/\{\{input\.([^}]+)\}\}/g, (match, path) => {
85
- const value = this.getNestedValue(this.input, path);
86
- return this.stringify(value, match);
87
- });
88
- resolved = resolved.replace(/\{\{nodes\.([^}]+)\}\}/g, (match, path) => {
89
- const value = this.resolveNodePath(path);
90
- return this.stringify(value, match);
91
- });
92
- resolved = resolved.replace(/\{\{([a-zA-Z_][a-zA-Z0-9_-]*)(?:\.([^}]+))?\}\}/g, (match, nodeId, path) => {
93
- if (nodeId === "input") {
94
- return match;
95
- }
96
- if (nodeId === "nodes") {
97
- return match;
98
- }
99
- const value = this.resolveNodePath(`${nodeId}${path ? "." + path : ""}`);
100
- return this.stringify(value, match);
101
- });
102
- return resolved;
103
- }
104
- resolveNodePath(path) {
105
- const segments = path.split(".");
106
- const nodeId = segments[0];
107
- if (!nodeId) {
108
- return;
109
- }
110
- let value = this.previousOutputs.get(nodeId);
111
- if (value === undefined) {
112
- const normalizedUnderscore = nodeId.replace(/-/g, "_");
113
- const normalizedHyphen = nodeId.replace(/_/g, "-");
114
- if (normalizedUnderscore !== nodeId) {
115
- value = this.previousOutputs.get(normalizedUnderscore);
116
- }
117
- if (value === undefined && normalizedHyphen !== nodeId) {
118
- value = this.previousOutputs.get(normalizedHyphen);
119
- }
120
- }
121
- if (value === undefined) {
122
- return;
123
- }
124
- if (segments.length === 1) {
125
- if (value && typeof value === "object" && "result" in value && !("nodes" in value)) {
126
- value = value.result;
127
- }
128
- return value;
129
- }
130
- const secondSegment = segments[1];
131
- if (secondSegment === "result" || secondSegment === "output") {
132
- if (value && typeof value === "object" && "result" in value) {
133
- value = value.result;
134
- if (segments.length === 2) {
135
- return value;
136
- }
137
- for (let i = 2;i < segments.length; i++) {
138
- if (value === null || value === undefined) {
139
- return;
140
- }
141
- value = value[segments[i]];
142
- }
143
- return value;
144
- }
145
- }
146
- for (let i = 1;i < segments.length; i++) {
147
- if (value === null || value === undefined) {
148
- return;
149
- }
150
- value = value[segments[i]];
151
- }
152
- return value;
153
- }
154
- getNestedValue(obj, path) {
155
- if (!obj || !path) {
156
- return;
157
- }
158
- const segments = path.split(".");
159
- let current = obj;
160
- for (const segment of segments) {
161
- if (current === null || current === undefined) {
162
- return;
163
- }
164
- if (typeof current !== "object") {
165
- return;
166
- }
167
- current = current[segment];
168
- }
169
- return current;
170
- }
171
- stringify(value, originalTemplate) {
172
- if (value === undefined) {
173
- return originalTemplate;
174
- }
175
- if (typeof value === "string") {
176
- return value;
177
- }
178
- if (value === null) {
179
- return "null";
180
- }
181
- return JSON.stringify(value);
182
- }
183
- containsTemplates(str) {
184
- if (typeof str !== "string") {
185
- return false;
186
- }
187
- return /\{\{[^}]+\}\}/.test(str);
188
- }
189
- extractTemplates(str) {
190
- if (typeof str !== "string") {
191
- return [];
192
- }
193
- const matches = str.match(/\{\{[^}]+\}\}/g);
194
- return matches ?? [];
195
- }
196
- }
197
- function resolveTemplates(input, context) {
198
- const resolver = TemplateResolver.fromContext(context);
199
- return resolver.resolveValue(input);
200
- }
201
- function resolveTemplateString(template, context) {
202
- const resolver = TemplateResolver.fromContext(context);
203
- return resolver.resolveString(template);
204
- }
20
+ // src/env/workflow/utils/index.ts
21
+ init_template_resolver();
22
+
205
23
  // src/env/workflow/utils/recovery-validator.ts
206
24
  init_decorator();
207
25
 
@@ -461,9 +279,10 @@ class RecoveryValidator {
461
279
  validateConditionBranches(state, definition) {
462
280
  const errors = [];
463
281
  const edges = definition.edges || definition.connections || [];
464
- const conditionalEdges = edges.filter((e) => e.condition);
282
+ const conditionalEdges = edges.filter((e) => e.when || e.condition);
465
283
  for (const edge of conditionalEdges) {
466
- const conditionVars = this.extractVariableRefs(edge.condition);
284
+ const condition = edge.when || edge.condition;
285
+ const conditionVars = this.extractVariableRefs(condition);
467
286
  for (const varRef of conditionVars) {
468
287
  if (!state.nodeOutputs.has(varRef) && !state.variables.has(varRef)) {
469
288
  errors.push({
@@ -471,7 +290,7 @@ class RecoveryValidator {
471
290
  nodeId: edge.target || edge.to,
472
291
  description: `条件分支无法确定:变量 ${varRef} 不存在`,
473
292
  suggestedAction: "CONFIRM" /* CONFIRM */,
474
- context: { variable: varRef, condition: edge.condition }
293
+ context: { variable: varRef, condition }
475
294
  });
476
295
  }
477
296
  }
package/dist/index.js CHANGED
@@ -20,7 +20,7 @@ import {
20
20
  ToolComponent,
21
21
  ToolRegistry,
22
22
  ToolValidator
23
- } from "./shared/@ai-setting/roy-agent-core-e130w7mv.js";
23
+ } from "./shared/@ai-setting/roy-agent-core-ryw3ckfy.js";
24
24
  import {
25
25
  bashTool,
26
26
  editFileTool,
@@ -30,7 +30,7 @@ import {
30
30
  grepTool,
31
31
  readFileTool,
32
32
  writeFileTool
33
- } from "./shared/@ai-setting/roy-agent-core-rsybkb38.js";
33
+ } from "./shared/@ai-setting/roy-agent-core-ysvh8er9.js";
34
34
  import {
35
35
  PromptComponent,
36
36
  PromptStore,
@@ -92,16 +92,15 @@ import {
92
92
  } from "./shared/@ai-setting/roy-agent-core-az13yzmc.js";
93
93
  import {
94
94
  WorkflowComponent
95
- } from "./shared/@ai-setting/roy-agent-core-bmr6bdfb.js";
95
+ } from "./shared/@ai-setting/roy-agent-core-2ms7296b.js";
96
96
  import {
97
97
  init_node_registry_helper,
98
98
  registerDecoratorNodeType
99
- } from "./shared/@ai-setting/roy-agent-core-0rtxwr28.js";
100
- import"./shared/@ai-setting/roy-agent-core-2jnzv9at.js";
99
+ } from "./shared/@ai-setting/roy-agent-core-9bmtxmp6.js";
100
+ import"./shared/@ai-setting/roy-agent-core-38dkek2y.js";
101
101
  import"./shared/@ai-setting/roy-agent-core-69jskqjg.js";
102
102
  import"./shared/@ai-setting/roy-agent-core-4t40mkpv.js";
103
- import"./shared/@ai-setting/roy-agent-core-jvatggbb.js";
104
- import"./shared/@ai-setting/roy-agent-core-5x94xmt6.js";
103
+ import"./shared/@ai-setting/roy-agent-core-6vxg2gmr.js";
105
104
  import"./shared/@ai-setting/roy-agent-core-0vbdz0x7.js";
106
105
  import {
107
106
  Edge,
@@ -109,24 +108,26 @@ import {
109
108
  Workflow,
110
109
  WorkflowEdges,
111
110
  createWorkflowFromClass
112
- } from "./shared/@ai-setting/roy-agent-core-7fgf85wc.js";
111
+ } from "./shared/@ai-setting/roy-agent-core-h0x19xgn.js";
113
112
  import"./shared/@ai-setting/roy-agent-core-1ce3fqrk.js";
113
+ import"./shared/@ai-setting/roy-agent-core-v002ynpa.js";
114
+ import"./shared/@ai-setting/roy-agent-core-qnrf2aw6.js";
114
115
  import {
115
116
  AgentComponent,
116
117
  AgentComponentConfigSchema
117
- } from "./shared/@ai-setting/roy-agent-core-ek6gk3wk.js";
118
+ } from "./shared/@ai-setting/roy-agent-core-r6rwsr54.js";
118
119
  import {
119
120
  AskUserError,
120
121
  init_workflow_hil
121
122
  } from "./shared/@ai-setting/roy-agent-core-e25xkv53.js";
122
123
  import {
123
124
  TaskComponent
124
- } from "./shared/@ai-setting/roy-agent-core-9q6sa7m3.js";
125
- import"./shared/@ai-setting/roy-agent-core-xz22rmak.js";
125
+ } from "./shared/@ai-setting/roy-agent-core-1zq3p19q.js";
126
+ import"./shared/@ai-setting/roy-agent-core-9p43ap7h.js";
126
127
  import"./shared/@ai-setting/roy-agent-core-hsxn8m1j.js";
127
128
  import {
128
129
  AgentRegistry
129
- } from "./shared/@ai-setting/roy-agent-core-7t05apnp.js";
130
+ } from "./shared/@ai-setting/roy-agent-core-fg3j215p.js";
130
131
  import {
131
132
  XDG_PATHS,
132
133
  getXDGPath,
@@ -2,7 +2,7 @@ import {
2
2
  BackgroundTaskManager,
3
3
  createDelegateTool,
4
4
  createStopTool
5
- } from "./roy-agent-core-xz22rmak.js";
5
+ } from "./roy-agent-core-9p43ap7h.js";
6
6
  import {
7
7
  SQLiteTaskStore,
8
8
  getDefaultTaskDbPath