@ai-setting/roy-agent-core 1.5.43 → 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.
- package/dist/env/index.js +7 -6
- package/dist/env/tool/built-in/index.js +1 -1
- package/dist/env/tool/index.js +2 -2
- package/dist/env/workflow/decorators/index.js +1 -1
- package/dist/env/workflow/engine/index.js +4 -3
- package/dist/env/workflow/index.js +34 -19
- package/dist/env/workflow/nodes/index.js +5 -1
- package/dist/env/workflow/types/index.js +16 -2
- package/dist/env/workflow/utils/index.js +15 -196
- package/dist/index.js +9 -8
- package/dist/shared/@ai-setting/{roy-agent-core-ffb9fq4v.js → roy-agent-core-23gw9c4s.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-bmr6bdfb.js → roy-agent-core-2ms7296b.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-2jnzv9at.js → roy-agent-core-38dkek2y.js} +319 -189
- package/dist/shared/@ai-setting/roy-agent-core-6vxg2gmr.js +321 -0
- package/dist/shared/@ai-setting/{roy-agent-core-0rtxwr28.js → roy-agent-core-9bmtxmp6.js} +77 -120
- package/dist/shared/@ai-setting/{roy-agent-core-7fgf85wc.js → roy-agent-core-h0x19xgn.js} +6 -7
- package/dist/shared/@ai-setting/roy-agent-core-qnrf2aw6.js +441 -0
- package/dist/shared/@ai-setting/roy-agent-core-v002ynpa.js +435 -0
- package/dist/shared/@ai-setting/{roy-agent-core-rsybkb38.js → roy-agent-core-ysvh8er9.js} +36 -39
- package/dist/shared/@ai-setting/{roy-agent-core-9yxb3ty9.js → roy-agent-core-z5sxe4p7.js} +5 -1
- package/package.json +1 -1
- package/dist/shared/@ai-setting/roy-agent-core-5x94xmt6.js +0 -350
- package/dist/shared/@ai-setting/roy-agent-core-jvatggbb.js +0 -603
- /package/dist/shared/@ai-setting/{roy-agent-core-e130w7mv.js → roy-agent-core-ryw3ckfy.js} +0 -0
package/dist/env/index.js
CHANGED
|
@@ -21,16 +21,17 @@ 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-
|
|
25
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
26
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
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-
|
|
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-
|
|
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
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
grepTool,
|
|
9
9
|
readFileTool,
|
|
10
10
|
writeFileTool
|
|
11
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
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";
|
package/dist/env/tool/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
ToolValidator,
|
|
5
5
|
getMaxOutputSize,
|
|
6
6
|
setToolConfigComponent
|
|
7
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
12
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
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-
|
|
4
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
5
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
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-
|
|
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
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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-
|
|
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
|
-
|
|
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/
|
|
13
|
-
|
|
14
|
-
|
|
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
|
|
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
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
100
|
-
import"./shared/@ai-setting/roy-agent-core-
|
|
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-
|
|
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,8 +108,10 @@ import {
|
|
|
109
108
|
Workflow,
|
|
110
109
|
WorkflowEdges,
|
|
111
110
|
createWorkflowFromClass
|
|
112
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
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
|
|
@@ -122,12 +122,12 @@ function extractResumeInfo(messages) {
|
|
|
122
122
|
let lastInterruptQuery;
|
|
123
123
|
for (const msg of messages) {
|
|
124
124
|
const metadata = msg.metadata;
|
|
125
|
-
if (metadata?.type === "workflow.node.start") {
|
|
125
|
+
if (metadata?.type === "workflow.node.start" || metadata?.type === "workflow.node.call") {
|
|
126
126
|
pendingNodeId = metadata.workflowNodeId;
|
|
127
127
|
if (metadata?.agentSessionId && !agentSessionId) {
|
|
128
128
|
agentSessionId = metadata.agentSessionId;
|
|
129
129
|
}
|
|
130
|
-
} else if (metadata?.type === "workflow.node.end") {
|
|
130
|
+
} else if (metadata?.type === "workflow.node.end" || metadata?.type === "workflow.node.result") {
|
|
131
131
|
pendingNodeId = undefined;
|
|
132
132
|
agentSessionId = undefined;
|
|
133
133
|
} else if (metadata?.type === "workflow.node.interrupt") {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
exports_node_registry_helper,
|
|
3
3
|
init_node_registry_helper
|
|
4
|
-
} from "./roy-agent-core-
|
|
4
|
+
} from "./roy-agent-core-9bmtxmp6.js";
|
|
5
5
|
import {
|
|
6
6
|
WorkflowEngine,
|
|
7
7
|
exports_engine,
|
|
8
8
|
init_engine
|
|
9
|
-
} from "./roy-agent-core-
|
|
9
|
+
} from "./roy-agent-core-38dkek2y.js";
|
|
10
10
|
import {
|
|
11
11
|
WorkflowService
|
|
12
12
|
} from "./roy-agent-core-4t40mkpv.js";
|
|
@@ -97,7 +97,7 @@ class WorkflowComponent extends BaseComponent {
|
|
|
97
97
|
return;
|
|
98
98
|
try {
|
|
99
99
|
const { NodeRegistry } = await import("../../env/workflow/engine/index.js");
|
|
100
|
-
const { registerDecoratorNodeType: registerDecoratorNodeType2 } = await import("./roy-agent-core-
|
|
100
|
+
const { registerDecoratorNodeType: registerDecoratorNodeType2 } = await import("./roy-agent-core-z5sxe4p7.js");
|
|
101
101
|
this.nodeRegistry = new NodeRegistry;
|
|
102
102
|
registerDecoratorNodeType2(this.nodeRegistry);
|
|
103
103
|
this.decoratorsRegistered = true;
|
|
@@ -127,7 +127,7 @@ class WorkflowComponent extends BaseComponent {
|
|
|
127
127
|
}
|
|
128
128
|
async runWorkflow(definition, input, options) {
|
|
129
129
|
const { NodeRegistry } = await import("../../env/workflow/engine/index.js");
|
|
130
|
-
const { registerDecoratorNodeType: registerDecoratorNodeType2 } = await import("./roy-agent-core-
|
|
130
|
+
const { registerDecoratorNodeType: registerDecoratorNodeType2 } = await import("./roy-agent-core-z5sxe4p7.js");
|
|
131
131
|
const toolComponent = this.toolComponent || this._workflowEnv?.getComponent("tool");
|
|
132
132
|
const skillComponent = this._workflowEnv?.getComponent("skill");
|
|
133
133
|
let agentRunner = this.agentRunner;
|