@shenghuabi/workflow 1.1.8 → 1.1.9
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/index.js +33 -34
- package/index.js.map +3 -3
- package/index.mjs +33 -34
- package/index.mjs.map +3 -3
- package/inline/node/input-params/main/index.d.ts +3 -0
- package/inline/node/input-params/node.define.d.ts +3 -0
- package/package.json +2 -2
- package/preset/context-build.service.d.ts +31 -28
- package/share/handle-node.d.ts +4 -0
- package/share/index.js.map +1 -1
- package/share/index.mjs.map +1 -1
- package/share/type2.d.ts +1 -1
- package/webview/index.js +18 -8
- package/webview/index.js.map +2 -2
- package/webview/index.mjs +18 -8
- package/webview/index.mjs.map +2 -2
- package/workflow-exec.service.d.ts +8 -19
package/index.mjs
CHANGED
|
@@ -794,10 +794,11 @@ var LlmRunner = class extends NodeRunnerBase {
|
|
|
794
794
|
streamData.extra.historyList = historyList;
|
|
795
795
|
this.emitter.send(streamData);
|
|
796
796
|
return async (id) => {
|
|
797
|
-
if (id === RUNNER_ORIGIN_OUTPUT[0].id) {
|
|
797
|
+
if (id === void 0 || id === RUNNER_ORIGIN_OUTPUT[0].id) {
|
|
798
798
|
return streamData.value;
|
|
799
|
-
}
|
|
800
|
-
|
|
799
|
+
} else if (id === "historyList") {
|
|
800
|
+
return historyList;
|
|
801
|
+
} else if (id === "format") {
|
|
801
802
|
let value;
|
|
802
803
|
switch (config.parseBy) {
|
|
803
804
|
case "markdown":
|
|
@@ -1262,15 +1263,13 @@ var IterationMainConfig = {
|
|
|
1262
1263
|
|
|
1263
1264
|
// packages/workflow/inline/node/input-params/common.ts
|
|
1264
1265
|
var NODE_COMMON4 = {
|
|
1265
|
-
priority: -
|
|
1266
|
+
priority: -999,
|
|
1266
1267
|
type: "input-params",
|
|
1267
|
-
label:
|
|
1268
|
-
icon: { fontIcon: "
|
|
1269
|
-
disableHead:
|
|
1270
|
-
disableConnect:
|
|
1271
|
-
color: "
|
|
1272
|
-
help: [`- 入口`].join("\n"),
|
|
1273
|
-
outputs: [RUNNER_ORIGIN_OUTPUT]
|
|
1268
|
+
label: `外界输入`,
|
|
1269
|
+
icon: { fontIcon: "input" },
|
|
1270
|
+
disableHead: true,
|
|
1271
|
+
disableConnect: true,
|
|
1272
|
+
color: "primary"
|
|
1274
1273
|
};
|
|
1275
1274
|
|
|
1276
1275
|
// packages/workflow/inline/node/input-params/node.define.ts
|
|
@@ -1296,6 +1295,18 @@ var InputParams_NODE_DEFINE = v10.pipe(
|
|
|
1296
1295
|
});
|
|
1297
1296
|
}),
|
|
1298
1297
|
v10.title("输入类型")
|
|
1298
|
+
),
|
|
1299
|
+
editorInput: v10.pipe(
|
|
1300
|
+
v10.optional(v10.boolean()),
|
|
1301
|
+
v10.title("编辑器输入"),
|
|
1302
|
+
valueChange2((fn) => {
|
|
1303
|
+
fn().subscribe(({ list: [value], field }) => {
|
|
1304
|
+
if (value === void 0) {
|
|
1305
|
+
return;
|
|
1306
|
+
}
|
|
1307
|
+
field.context["editorInputChange"](value);
|
|
1308
|
+
});
|
|
1309
|
+
})
|
|
1299
1310
|
)
|
|
1300
1311
|
}),
|
|
1301
1312
|
actions8.wrappers.patch(["div"]),
|
|
@@ -1607,11 +1618,6 @@ var ContextBuildService = class {
|
|
|
1607
1618
|
template = inject9(TemplateFormatService);
|
|
1608
1619
|
parser = inject9(WorkflowParserService);
|
|
1609
1620
|
createWorkflow(input) {
|
|
1610
|
-
const result = this.template.parse(
|
|
1611
|
-
input.template.flatMap(
|
|
1612
|
-
(item) => item.content.map((item2) => item2.type === "text" ? item2.text : "")
|
|
1613
|
-
).join("\n")
|
|
1614
|
-
).list.map((item) => item.value);
|
|
1615
1621
|
const chatNode = {
|
|
1616
1622
|
id: "2",
|
|
1617
1623
|
data: {
|
|
@@ -1627,13 +1633,13 @@ var ContextBuildService = class {
|
|
|
1627
1633
|
]
|
|
1628
1634
|
]
|
|
1629
1635
|
},
|
|
1630
|
-
value: input.template
|
|
1631
|
-
config: {}
|
|
1636
|
+
config: { value: { value: input.template } }
|
|
1632
1637
|
},
|
|
1633
1638
|
type: "chat"
|
|
1634
1639
|
};
|
|
1635
1640
|
return {
|
|
1636
|
-
nodes: [chatNode]
|
|
1641
|
+
nodes: [chatNode],
|
|
1642
|
+
edges: []
|
|
1637
1643
|
};
|
|
1638
1644
|
}
|
|
1639
1645
|
};
|
|
@@ -1645,18 +1651,10 @@ var WorkflowExecService = class {
|
|
|
1645
1651
|
parse(data) {
|
|
1646
1652
|
return this.#parser.parse(data);
|
|
1647
1653
|
}
|
|
1648
|
-
async runParse(
|
|
1649
|
-
return this.#runner.run(
|
|
1650
|
-
define,
|
|
1651
|
-
{
|
|
1652
|
-
inputs: input.input ?? {},
|
|
1653
|
-
environmentParameters: input.environmentParameters
|
|
1654
|
-
},
|
|
1655
|
-
ob,
|
|
1656
|
-
abortSignal
|
|
1657
|
-
);
|
|
1654
|
+
async runParse(...args) {
|
|
1655
|
+
return this.#runner.run(...args);
|
|
1658
1656
|
}
|
|
1659
|
-
async exec(data, input, options, ob, abortSignal) {
|
|
1657
|
+
async exec(data, input, options, ob, abortSignal, providers) {
|
|
1660
1658
|
let define;
|
|
1661
1659
|
if (data.define) {
|
|
1662
1660
|
define = data.define;
|
|
@@ -1668,7 +1666,7 @@ var WorkflowExecService = class {
|
|
|
1668
1666
|
define = res.data;
|
|
1669
1667
|
}
|
|
1670
1668
|
try {
|
|
1671
|
-
return await this.runParse(define, input, ob, abortSignal);
|
|
1669
|
+
return await this.runParse(define, input, ob, abortSignal, providers);
|
|
1672
1670
|
} catch (error) {
|
|
1673
1671
|
if (options.showError) {
|
|
1674
1672
|
}
|
|
@@ -1676,7 +1674,7 @@ var WorkflowExecService = class {
|
|
|
1676
1674
|
}
|
|
1677
1675
|
}
|
|
1678
1676
|
#contextBuild = inject10(ContextBuildService);
|
|
1679
|
-
async agentChat(input, fn, abort) {
|
|
1677
|
+
async agentChat(input, fn, abort, providers) {
|
|
1680
1678
|
const workflow = this.#contextBuild.createWorkflow(input);
|
|
1681
1679
|
const subject = new Subject();
|
|
1682
1680
|
subject.subscribe({
|
|
@@ -1687,12 +1685,13 @@ var WorkflowExecService = class {
|
|
|
1687
1685
|
const result2 = await this.exec(
|
|
1688
1686
|
{ flow: workflow },
|
|
1689
1687
|
{
|
|
1690
|
-
|
|
1688
|
+
// inputs: input.inputs,
|
|
1691
1689
|
environmentParameters: input.environmentParameters
|
|
1692
1690
|
},
|
|
1693
1691
|
{ showError: true },
|
|
1694
1692
|
subject,
|
|
1695
|
-
abort
|
|
1693
|
+
abort,
|
|
1694
|
+
providers
|
|
1696
1695
|
);
|
|
1697
1696
|
return result2;
|
|
1698
1697
|
}
|