@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.js
CHANGED
|
@@ -849,10 +849,11 @@ var LlmRunner = class extends NodeRunnerBase {
|
|
|
849
849
|
streamData.extra.historyList = historyList;
|
|
850
850
|
this.emitter.send(streamData);
|
|
851
851
|
return async (id) => {
|
|
852
|
-
if (id === RUNNER_ORIGIN_OUTPUT[0].id) {
|
|
852
|
+
if (id === void 0 || id === RUNNER_ORIGIN_OUTPUT[0].id) {
|
|
853
853
|
return streamData.value;
|
|
854
|
-
}
|
|
855
|
-
|
|
854
|
+
} else if (id === "historyList") {
|
|
855
|
+
return historyList;
|
|
856
|
+
} else if (id === "format") {
|
|
856
857
|
let value;
|
|
857
858
|
switch (config.parseBy) {
|
|
858
859
|
case "markdown":
|
|
@@ -1317,15 +1318,13 @@ var IterationMainConfig = {
|
|
|
1317
1318
|
|
|
1318
1319
|
// packages/workflow/inline/node/input-params/common.ts
|
|
1319
1320
|
var NODE_COMMON4 = {
|
|
1320
|
-
priority: -
|
|
1321
|
+
priority: -999,
|
|
1321
1322
|
type: "input-params",
|
|
1322
|
-
label:
|
|
1323
|
-
icon: { fontIcon: "
|
|
1324
|
-
disableHead:
|
|
1325
|
-
disableConnect:
|
|
1326
|
-
color: "
|
|
1327
|
-
help: [`- 入口`].join("\n"),
|
|
1328
|
-
outputs: [RUNNER_ORIGIN_OUTPUT]
|
|
1323
|
+
label: `外界输入`,
|
|
1324
|
+
icon: { fontIcon: "input" },
|
|
1325
|
+
disableHead: true,
|
|
1326
|
+
disableConnect: true,
|
|
1327
|
+
color: "primary"
|
|
1329
1328
|
};
|
|
1330
1329
|
|
|
1331
1330
|
// packages/workflow/inline/node/input-params/node.define.ts
|
|
@@ -1351,6 +1350,18 @@ var InputParams_NODE_DEFINE = v10.pipe(
|
|
|
1351
1350
|
});
|
|
1352
1351
|
}),
|
|
1353
1352
|
v10.title("输入类型")
|
|
1353
|
+
),
|
|
1354
|
+
editorInput: v10.pipe(
|
|
1355
|
+
v10.optional(v10.boolean()),
|
|
1356
|
+
v10.title("编辑器输入"),
|
|
1357
|
+
(0, import_view_angular_core8.valueChange)((fn) => {
|
|
1358
|
+
fn().subscribe(({ list: [value], field }) => {
|
|
1359
|
+
if (value === void 0) {
|
|
1360
|
+
return;
|
|
1361
|
+
}
|
|
1362
|
+
field.context["editorInputChange"](value);
|
|
1363
|
+
});
|
|
1364
|
+
})
|
|
1354
1365
|
)
|
|
1355
1366
|
}),
|
|
1356
1367
|
import_view_angular_core8.actions.wrappers.patch(["div"]),
|
|
@@ -1662,11 +1673,6 @@ var ContextBuildService = class {
|
|
|
1662
1673
|
template = (0, import_static_injector12.inject)(TemplateFormatService);
|
|
1663
1674
|
parser = (0, import_static_injector12.inject)(WorkflowParserService);
|
|
1664
1675
|
createWorkflow(input) {
|
|
1665
|
-
const result = this.template.parse(
|
|
1666
|
-
input.template.flatMap(
|
|
1667
|
-
(item) => item.content.map((item2) => item2.type === "text" ? item2.text : "")
|
|
1668
|
-
).join("\n")
|
|
1669
|
-
).list.map((item) => item.value);
|
|
1670
1676
|
const chatNode = {
|
|
1671
1677
|
id: "2",
|
|
1672
1678
|
data: {
|
|
@@ -1682,13 +1688,13 @@ var ContextBuildService = class {
|
|
|
1682
1688
|
]
|
|
1683
1689
|
]
|
|
1684
1690
|
},
|
|
1685
|
-
value: input.template
|
|
1686
|
-
config: {}
|
|
1691
|
+
config: { value: { value: input.template } }
|
|
1687
1692
|
},
|
|
1688
1693
|
type: "chat"
|
|
1689
1694
|
};
|
|
1690
1695
|
return {
|
|
1691
|
-
nodes: [chatNode]
|
|
1696
|
+
nodes: [chatNode],
|
|
1697
|
+
edges: []
|
|
1692
1698
|
};
|
|
1693
1699
|
}
|
|
1694
1700
|
};
|
|
@@ -1700,18 +1706,10 @@ var WorkflowExecService = class {
|
|
|
1700
1706
|
parse(data) {
|
|
1701
1707
|
return this.#parser.parse(data);
|
|
1702
1708
|
}
|
|
1703
|
-
async runParse(
|
|
1704
|
-
return this.#runner.run(
|
|
1705
|
-
define,
|
|
1706
|
-
{
|
|
1707
|
-
inputs: input.input ?? {},
|
|
1708
|
-
environmentParameters: input.environmentParameters
|
|
1709
|
-
},
|
|
1710
|
-
ob,
|
|
1711
|
-
abortSignal
|
|
1712
|
-
);
|
|
1709
|
+
async runParse(...args) {
|
|
1710
|
+
return this.#runner.run(...args);
|
|
1713
1711
|
}
|
|
1714
|
-
async exec(data, input, options, ob, abortSignal) {
|
|
1712
|
+
async exec(data, input, options, ob, abortSignal, providers) {
|
|
1715
1713
|
let define;
|
|
1716
1714
|
if (data.define) {
|
|
1717
1715
|
define = data.define;
|
|
@@ -1723,7 +1721,7 @@ var WorkflowExecService = class {
|
|
|
1723
1721
|
define = res.data;
|
|
1724
1722
|
}
|
|
1725
1723
|
try {
|
|
1726
|
-
return await this.runParse(define, input, ob, abortSignal);
|
|
1724
|
+
return await this.runParse(define, input, ob, abortSignal, providers);
|
|
1727
1725
|
} catch (error) {
|
|
1728
1726
|
if (options.showError) {
|
|
1729
1727
|
}
|
|
@@ -1731,7 +1729,7 @@ var WorkflowExecService = class {
|
|
|
1731
1729
|
}
|
|
1732
1730
|
}
|
|
1733
1731
|
#contextBuild = (0, import_static_injector13.inject)(ContextBuildService);
|
|
1734
|
-
async agentChat(input, fn, abort) {
|
|
1732
|
+
async agentChat(input, fn, abort, providers) {
|
|
1735
1733
|
const workflow = this.#contextBuild.createWorkflow(input);
|
|
1736
1734
|
const subject = new import_rxjs3.Subject();
|
|
1737
1735
|
subject.subscribe({
|
|
@@ -1742,12 +1740,13 @@ var WorkflowExecService = class {
|
|
|
1742
1740
|
const result2 = await this.exec(
|
|
1743
1741
|
{ flow: workflow },
|
|
1744
1742
|
{
|
|
1745
|
-
|
|
1743
|
+
// inputs: input.inputs,
|
|
1746
1744
|
environmentParameters: input.environmentParameters
|
|
1747
1745
|
},
|
|
1748
1746
|
{ showError: true },
|
|
1749
1747
|
subject,
|
|
1750
|
-
abort
|
|
1748
|
+
abort,
|
|
1749
|
+
providers
|
|
1751
1750
|
);
|
|
1752
1751
|
return result2;
|
|
1753
1752
|
}
|