@foresthubai/workflow-core 0.3.0
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/LICENSE +202 -0
- package/NOTICE +14 -0
- package/README.md +63 -0
- package/dist/api/index.d.ts +7 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +2 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/workflow.d.ts +607 -0
- package/dist/api/workflow.d.ts.map +1 -0
- package/dist/api/workflow.js +6 -0
- package/dist/api/workflow.js.map +1 -0
- package/dist/channel/Channel.d.ts +10 -0
- package/dist/channel/Channel.d.ts.map +1 -0
- package/dist/channel/Channel.js +2 -0
- package/dist/channel/Channel.js.map +1 -0
- package/dist/channel/ChannelDefinition.d.ts +27 -0
- package/dist/channel/ChannelDefinition.d.ts.map +1 -0
- package/dist/channel/ChannelDefinition.js +50 -0
- package/dist/channel/ChannelDefinition.js.map +1 -0
- package/dist/channel/index.d.ts +7 -0
- package/dist/channel/index.d.ts.map +1 -0
- package/dist/channel/index.js +4 -0
- package/dist/channel/index.js.map +1 -0
- package/dist/channel/serialization.d.ts +17 -0
- package/dist/channel/serialization.d.ts.map +1 -0
- package/dist/channel/serialization.js +63 -0
- package/dist/channel/serialization.js.map +1 -0
- package/dist/deploy/index.d.ts +2 -0
- package/dist/deploy/index.d.ts.map +1 -0
- package/dist/deploy/index.js +2 -0
- package/dist/deploy/index.js.map +1 -0
- package/dist/deploy/requirements.d.ts +17 -0
- package/dist/deploy/requirements.d.ts.map +1 -0
- package/dist/deploy/requirements.js +41 -0
- package/dist/deploy/requirements.js.map +1 -0
- package/dist/diagnostics/__fixtures__/diagnosticFixtures.d.ts +28 -0
- package/dist/diagnostics/__fixtures__/diagnosticFixtures.d.ts.map +1 -0
- package/dist/diagnostics/__fixtures__/diagnosticFixtures.js +125 -0
- package/dist/diagnostics/__fixtures__/diagnosticFixtures.js.map +1 -0
- package/dist/diagnostics/diagnostics.d.ts +128 -0
- package/dist/diagnostics/diagnostics.d.ts.map +1 -0
- package/dist/diagnostics/diagnostics.js +783 -0
- package/dist/diagnostics/diagnostics.js.map +1 -0
- package/dist/diagnostics/index.d.ts +3 -0
- package/dist/diagnostics/index.d.ts.map +1 -0
- package/dist/diagnostics/index.js +2 -0
- package/dist/diagnostics/index.js.map +1 -0
- package/dist/edge/Edge.d.ts +22 -0
- package/dist/edge/Edge.d.ts.map +1 -0
- package/dist/edge/Edge.js +2 -0
- package/dist/edge/Edge.js.map +1 -0
- package/dist/edge/EdgeDefinition.d.ts +10 -0
- package/dist/edge/EdgeDefinition.d.ts.map +1 -0
- package/dist/edge/EdgeDefinition.js +36 -0
- package/dist/edge/EdgeDefinition.js.map +1 -0
- package/dist/edge/EdgeType.d.ts +6 -0
- package/dist/edge/EdgeType.d.ts.map +1 -0
- package/dist/edge/EdgeType.js +7 -0
- package/dist/edge/EdgeType.js.map +1 -0
- package/dist/edge/index.d.ts +6 -0
- package/dist/edge/index.d.ts.map +1 -0
- package/dist/edge/index.js +6 -0
- package/dist/edge/index.js.map +1 -0
- package/dist/edge/serialization.d.ts +18 -0
- package/dist/edge/serialization.d.ts.map +1 -0
- package/dist/edge/serialization.js +76 -0
- package/dist/edge/serialization.js.map +1 -0
- package/dist/expression/index.d.ts +5 -0
- package/dist/expression/index.d.ts.map +1 -0
- package/dist/expression/index.js +3 -0
- package/dist/expression/index.js.map +1 -0
- package/dist/expression/parser.d.ts +14 -0
- package/dist/expression/parser.d.ts.map +1 -0
- package/dist/expression/parser.js +309 -0
- package/dist/expression/parser.js.map +1 -0
- package/dist/expression/types.d.ts +11 -0
- package/dist/expression/types.d.ts.map +1 -0
- package/dist/expression/types.js +20 -0
- package/dist/expression/types.js.map +1 -0
- package/dist/function/FunctionDeclaration.d.ts +43 -0
- package/dist/function/FunctionDeclaration.d.ts.map +1 -0
- package/dist/function/FunctionDeclaration.js +17 -0
- package/dist/function/FunctionDeclaration.js.map +1 -0
- package/dist/function/index.d.ts +4 -0
- package/dist/function/index.d.ts.map +1 -0
- package/dist/function/index.js +3 -0
- package/dist/function/index.js.map +1 -0
- package/dist/function/serialization.d.ts +20 -0
- package/dist/function/serialization.d.ts.map +1 -0
- package/dist/function/serialization.js +26 -0
- package/dist/function/serialization.js.map +1 -0
- package/dist/id/index.d.ts +7 -0
- package/dist/id/index.d.ts.map +1 -0
- package/dist/id/index.js +9 -0
- package/dist/id/index.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/memory/Memory.d.ts +12 -0
- package/dist/memory/Memory.d.ts.map +1 -0
- package/dist/memory/Memory.js +2 -0
- package/dist/memory/Memory.js.map +1 -0
- package/dist/memory/MemoryDefinition.d.ts +16 -0
- package/dist/memory/MemoryDefinition.d.ts.map +1 -0
- package/dist/memory/MemoryDefinition.js +2 -0
- package/dist/memory/MemoryDefinition.js.map +1 -0
- package/dist/memory/MemoryFileDefinition.d.ts +8 -0
- package/dist/memory/MemoryFileDefinition.d.ts.map +1 -0
- package/dist/memory/MemoryFileDefinition.js +36 -0
- package/dist/memory/MemoryFileDefinition.js.map +1 -0
- package/dist/memory/MemoryRegistry.d.ts +17 -0
- package/dist/memory/MemoryRegistry.d.ts.map +1 -0
- package/dist/memory/MemoryRegistry.js +29 -0
- package/dist/memory/MemoryRegistry.js.map +1 -0
- package/dist/memory/VectorDatabaseDefinition.d.ts +7 -0
- package/dist/memory/VectorDatabaseDefinition.d.ts.map +1 -0
- package/dist/memory/VectorDatabaseDefinition.js +20 -0
- package/dist/memory/VectorDatabaseDefinition.js.map +1 -0
- package/dist/memory/index.d.ts +9 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/index.js +6 -0
- package/dist/memory/index.js.map +1 -0
- package/dist/memory/serialization.d.ts +11 -0
- package/dist/memory/serialization.d.ts.map +1 -0
- package/dist/memory/serialization.js +44 -0
- package/dist/memory/serialization.js.map +1 -0
- package/dist/migration/index.d.ts +5 -0
- package/dist/migration/index.d.ts.map +1 -0
- package/dist/migration/index.js +4 -0
- package/dist/migration/index.js.map +1 -0
- package/dist/migration/migrate.d.ts +11 -0
- package/dist/migration/migrate.d.ts.map +1 -0
- package/dist/migration/migrate.js +52 -0
- package/dist/migration/migrate.js.map +1 -0
- package/dist/migration/migrations.d.ts +22 -0
- package/dist/migration/migrations.d.ts.map +1 -0
- package/dist/migration/migrations.js +10 -0
- package/dist/migration/migrations.js.map +1 -0
- package/dist/migration/version.d.ts +9 -0
- package/dist/migration/version.d.ts.map +1 -0
- package/dist/migration/version.js +9 -0
- package/dist/migration/version.js.map +1 -0
- package/dist/model/LLMModelDefinition.d.ts +7 -0
- package/dist/model/LLMModelDefinition.d.ts.map +1 -0
- package/dist/model/LLMModelDefinition.js +11 -0
- package/dist/model/LLMModelDefinition.js.map +1 -0
- package/dist/model/Model.d.ts +21 -0
- package/dist/model/Model.d.ts.map +1 -0
- package/dist/model/Model.js +15 -0
- package/dist/model/Model.js.map +1 -0
- package/dist/model/ModelDefinition.d.ts +15 -0
- package/dist/model/ModelDefinition.d.ts.map +1 -0
- package/dist/model/ModelDefinition.js +2 -0
- package/dist/model/ModelDefinition.js.map +1 -0
- package/dist/model/ModelRegistry.d.ts +17 -0
- package/dist/model/ModelRegistry.d.ts.map +1 -0
- package/dist/model/ModelRegistry.js +27 -0
- package/dist/model/ModelRegistry.js.map +1 -0
- package/dist/model/index.d.ts +8 -0
- package/dist/model/index.d.ts.map +1 -0
- package/dist/model/index.js +5 -0
- package/dist/model/index.js.map +1 -0
- package/dist/model/serialization.d.ts +8 -0
- package/dist/model/serialization.d.ts.map +1 -0
- package/dist/model/serialization.js +25 -0
- package/dist/model/serialization.js.map +1 -0
- package/dist/node/AgentNode.d.ts +21 -0
- package/dist/node/AgentNode.d.ts.map +1 -0
- package/dist/node/AgentNode.js +60 -0
- package/dist/node/AgentNode.js.map +1 -0
- package/dist/node/DataNode.d.ts +14 -0
- package/dist/node/DataNode.d.ts.map +1 -0
- package/dist/node/DataNode.js +26 -0
- package/dist/node/DataNode.js.map +1 -0
- package/dist/node/FunctionNode.d.ts +24 -0
- package/dist/node/FunctionNode.d.ts.map +1 -0
- package/dist/node/FunctionNode.js +44 -0
- package/dist/node/FunctionNode.js.map +1 -0
- package/dist/node/InputNode.d.ts +46 -0
- package/dist/node/InputNode.d.ts.map +1 -0
- package/dist/node/InputNode.js +133 -0
- package/dist/node/InputNode.js.map +1 -0
- package/dist/node/LogicNode.d.ts +13 -0
- package/dist/node/LogicNode.d.ts.map +1 -0
- package/dist/node/LogicNode.js +19 -0
- package/dist/node/LogicNode.js.map +1 -0
- package/dist/node/MqttNode.d.ts +27 -0
- package/dist/node/MqttNode.d.ts.map +1 -0
- package/dist/node/MqttNode.js +96 -0
- package/dist/node/MqttNode.js.map +1 -0
- package/dist/node/Node.d.ts +49 -0
- package/dist/node/Node.d.ts.map +1 -0
- package/dist/node/Node.js +9 -0
- package/dist/node/Node.js.map +1 -0
- package/dist/node/NodeDefinition.d.ts +30 -0
- package/dist/node/NodeDefinition.d.ts.map +1 -0
- package/dist/node/NodeDefinition.js +2 -0
- package/dist/node/NodeDefinition.js.map +1 -0
- package/dist/node/NodeRegistry.d.ts +19 -0
- package/dist/node/NodeRegistry.d.ts.map +1 -0
- package/dist/node/NodeRegistry.js +65 -0
- package/dist/node/NodeRegistry.js.map +1 -0
- package/dist/node/OutputNode.d.ts +23 -0
- package/dist/node/OutputNode.d.ts.map +1 -0
- package/dist/node/OutputNode.js +62 -0
- package/dist/node/OutputNode.js.map +1 -0
- package/dist/node/ToolNode.d.ts +12 -0
- package/dist/node/ToolNode.d.ts.map +1 -0
- package/dist/node/ToolNode.js +18 -0
- package/dist/node/ToolNode.js.map +1 -0
- package/dist/node/TriggerNode.d.ts +67 -0
- package/dist/node/TriggerNode.d.ts.map +1 -0
- package/dist/node/TriggerNode.js +172 -0
- package/dist/node/TriggerNode.js.map +1 -0
- package/dist/node/constants.d.ts +16 -0
- package/dist/node/constants.d.ts.map +1 -0
- package/dist/node/constants.js +18 -0
- package/dist/node/constants.js.map +1 -0
- package/dist/node/index.d.ts +12 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +9 -0
- package/dist/node/index.js.map +1 -0
- package/dist/node/methods.d.ts +73 -0
- package/dist/node/methods.d.ts.map +1 -0
- package/dist/node/methods.js +261 -0
- package/dist/node/methods.js.map +1 -0
- package/dist/node/serialization.d.ts +25 -0
- package/dist/node/serialization.d.ts.map +1 -0
- package/dist/node/serialization.js +525 -0
- package/dist/node/serialization.js.map +1 -0
- package/dist/parameter/OutputParameter.d.ts +69 -0
- package/dist/parameter/OutputParameter.d.ts.map +1 -0
- package/dist/parameter/OutputParameter.js +6 -0
- package/dist/parameter/OutputParameter.js.map +1 -0
- package/dist/parameter/Parameter.d.ts +152 -0
- package/dist/parameter/Parameter.d.ts.map +1 -0
- package/dist/parameter/Parameter.js +86 -0
- package/dist/parameter/Parameter.js.map +1 -0
- package/dist/parameter/index.d.ts +5 -0
- package/dist/parameter/index.d.ts.map +1 -0
- package/dist/parameter/index.js +3 -0
- package/dist/parameter/index.js.map +1 -0
- package/dist/variable/Variable.d.ts +25 -0
- package/dist/variable/Variable.d.ts.map +1 -0
- package/dist/variable/Variable.js +2 -0
- package/dist/variable/Variable.js.map +1 -0
- package/dist/variable/index.d.ts +3 -0
- package/dist/variable/index.d.ts.map +1 -0
- package/dist/variable/index.js +5 -0
- package/dist/variable/index.js.map +1 -0
- package/dist/variable/operations.d.ts +37 -0
- package/dist/variable/operations.d.ts.map +1 -0
- package/dist/variable/operations.js +88 -0
- package/dist/variable/operations.js.map +1 -0
- package/dist/workflow/Workflow.d.ts +38 -0
- package/dist/workflow/Workflow.d.ts.map +1 -0
- package/dist/workflow/Workflow.js +8 -0
- package/dist/workflow/Workflow.js.map +1 -0
- package/dist/workflow/index.d.ts +4 -0
- package/dist/workflow/index.d.ts.map +1 -0
- package/dist/workflow/index.js +3 -0
- package/dist/workflow/index.js.map +1 -0
- package/dist/workflow/serialization.d.ts +43 -0
- package/dist/workflow/serialization.d.ts.map +1 -0
- package/dist/workflow/serialization.js +215 -0
- package/dist/workflow/serialization.js.map +1 -0
- package/package.json +105 -0
- package/src/api/index.ts +11 -0
- package/src/api/workflow.ts +607 -0
- package/src/channel/Channel.ts +11 -0
- package/src/channel/ChannelDefinition.ts +76 -0
- package/src/channel/index.ts +6 -0
- package/src/channel/serialization.ts +68 -0
- package/src/deploy/index.ts +1 -0
- package/src/deploy/requirements.test.ts +61 -0
- package/src/deploy/requirements.ts +41 -0
- package/src/diagnostics/__fixtures__/diagnosticFixtures.ts +158 -0
- package/src/diagnostics/diagnostics.test.ts +878 -0
- package/src/diagnostics/diagnostics.ts +936 -0
- package/src/diagnostics/index.ts +11 -0
- package/src/edge/Edge.ts +23 -0
- package/src/edge/EdgeDefinition.ts +45 -0
- package/src/edge/EdgeType.ts +19 -0
- package/src/edge/index.ts +8 -0
- package/src/edge/serialization.ts +83 -0
- package/src/expression/index.ts +4 -0
- package/src/expression/parser.ts +362 -0
- package/src/expression/types.ts +30 -0
- package/src/function/FunctionDeclaration.ts +54 -0
- package/src/function/index.ts +3 -0
- package/src/function/serialization.ts +40 -0
- package/src/globals.d.ts +9 -0
- package/src/id/index.ts +8 -0
- package/src/index.ts +22 -0
- package/src/memory/Memory.ts +15 -0
- package/src/memory/MemoryDefinition.ts +16 -0
- package/src/memory/MemoryFileDefinition.ts +37 -0
- package/src/memory/MemoryRegistry.ts +35 -0
- package/src/memory/VectorDatabaseDefinition.ts +21 -0
- package/src/memory/index.ts +8 -0
- package/src/memory/serialization.ts +47 -0
- package/src/migration/index.ts +4 -0
- package/src/migration/migrate.test.ts +44 -0
- package/src/migration/migrate.ts +58 -0
- package/src/migration/migrations.ts +24 -0
- package/src/migration/version.ts +9 -0
- package/src/model/LLMModelDefinition.ts +12 -0
- package/src/model/Model.ts +39 -0
- package/src/model/ModelDefinition.ts +15 -0
- package/src/model/ModelRegistry.ts +33 -0
- package/src/model/index.ts +7 -0
- package/src/model/serialization.ts +30 -0
- package/src/node/AgentNode.ts +82 -0
- package/src/node/DataNode.ts +41 -0
- package/src/node/FunctionNode.ts +76 -0
- package/src/node/InputNode.ts +185 -0
- package/src/node/LogicNode.ts +33 -0
- package/src/node/MqttNode.ts +127 -0
- package/src/node/Node.ts +61 -0
- package/src/node/NodeDefinition.ts +37 -0
- package/src/node/NodeRegistry.ts +85 -0
- package/src/node/OutputNode.ts +87 -0
- package/src/node/ToolNode.ts +32 -0
- package/src/node/TriggerNode.ts +272 -0
- package/src/node/constants.ts +16 -0
- package/src/node/index.ts +26 -0
- package/src/node/methods.ts +278 -0
- package/src/node/serialization.ts +544 -0
- package/src/parameter/OutputParameter.ts +68 -0
- package/src/parameter/Parameter.ts +243 -0
- package/src/parameter/index.ts +33 -0
- package/src/variable/Variable.ts +10 -0
- package/src/variable/index.ts +16 -0
- package/src/variable/operations.ts +106 -0
- package/src/workflow/Workflow.ts +41 -0
- package/src/workflow/index.ts +3 -0
- package/src/workflow/serialization.test.ts +240 -0
- package/src/workflow/serialization.ts +242 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** Serialize a domain Model to the API discriminated-union shape. */
|
|
2
|
+
export function serialize(model) {
|
|
3
|
+
const { id, label, type, arguments: args } = model;
|
|
4
|
+
switch (type) {
|
|
5
|
+
case "LLMModel":
|
|
6
|
+
return {
|
|
7
|
+
type,
|
|
8
|
+
id,
|
|
9
|
+
label,
|
|
10
|
+
capabilities: args.capabilities ?? ["chat"],
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/** Convert an API Model into a domain Model. */
|
|
15
|
+
export function deserialize(api) {
|
|
16
|
+
const { id, label, type } = api;
|
|
17
|
+
const args = {};
|
|
18
|
+
switch (type) {
|
|
19
|
+
case "LLMModel":
|
|
20
|
+
args.capabilities = api.capabilities;
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
return { id, label, type, arguments: args };
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=serialization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialization.js","sourceRoot":"","sources":["../../src/model/serialization.ts"],"names":[],"mappings":"AAKA,qEAAqE;AACrE,MAAM,UAAU,SAAS,CAAC,KAAY;IACpC,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IACnD,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,UAAU;YACb,OAAO;gBACL,IAAI;gBACJ,EAAE;gBACF,KAAK;gBACL,YAAY,EAAG,IAAI,CAAC,YAAkC,IAAI,CAAC,MAAM,CAAC;aACnE,CAAC;IACN,CAAC;AACH,CAAC;AAED,gDAAgD;AAChD,MAAM,UAAU,WAAW,CAAC,GAAa;IACvC,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC;IAChC,MAAM,IAAI,GAA4B,EAAE,CAAC;IACzC,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,UAAU;YACb,IAAI,CAAC,YAAY,GAAG,GAAG,CAAC,YAAY,CAAC;YACrC,MAAM;IACV,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { NodeBase } from "./Node";
|
|
2
|
+
import { OutputBinding, OutputDeclaration } from "../parameter";
|
|
3
|
+
import type { Schemas } from "../api";
|
|
4
|
+
import { NodeDefinition } from "./NodeDefinition";
|
|
5
|
+
export type MemoryRef = Schemas["MemoryRef"];
|
|
6
|
+
export interface AgentNode extends NodeBase {
|
|
7
|
+
type: "Agent";
|
|
8
|
+
arguments: {
|
|
9
|
+
name: string;
|
|
10
|
+
model: string;
|
|
11
|
+
instructions: string;
|
|
12
|
+
maxTurns: number | undefined;
|
|
13
|
+
outputDeclarations: OutputDeclaration[];
|
|
14
|
+
memoryRefs: MemoryRef[];
|
|
15
|
+
answer: OutputBinding;
|
|
16
|
+
toolDescription?: string;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export type AgentNodeType = "Agent";
|
|
20
|
+
export declare const AgentNodeDefinition: NodeDefinition;
|
|
21
|
+
//# sourceMappingURL=AgentNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentNode.d.ts","sourceRoot":"","sources":["../../src/node/AgentNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAE7C,MAAM,WAAW,SAAU,SAAQ,QAAQ;IACzC,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE;QACT,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,YAAY,EAAE,MAAM,CAAC;QACrB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;QAC7B,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;QACxC,UAAU,EAAE,SAAS,EAAE,CAAC;QACxB,MAAM,EAAE,aAAa,CAAC;QACtB,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC;CACH;AAED,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC;AAEpC,eAAO,MAAM,mBAAmB,EAAE,cAyDjC,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { NodeCategory } from "./constants";
|
|
2
|
+
export const AgentNodeDefinition = {
|
|
3
|
+
type: "Agent",
|
|
4
|
+
label: "LLM Agent",
|
|
5
|
+
category: NodeCategory.AI,
|
|
6
|
+
description: "AI-powered agent for intelligent processing",
|
|
7
|
+
canBranch: true, // Control output may fan out to multiple branches (tool output is always multi-target).
|
|
8
|
+
outputs: [
|
|
9
|
+
{ id: "answer", label: "Answer", type: "static", dataType: "string" },
|
|
10
|
+
{ id: "outputDeclarations", label: "Structured Output", type: "list" },
|
|
11
|
+
],
|
|
12
|
+
parameters: [
|
|
13
|
+
{
|
|
14
|
+
id: "name",
|
|
15
|
+
label: "Name",
|
|
16
|
+
description: "Name of the agent",
|
|
17
|
+
optional: true,
|
|
18
|
+
type: "string",
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
id: "model",
|
|
22
|
+
label: "Model",
|
|
23
|
+
description: "AI model to use for the agent",
|
|
24
|
+
type: "modelSelect",
|
|
25
|
+
modelType: ["LLMModel"],
|
|
26
|
+
capabilities: ["chat"],
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: "instructions",
|
|
30
|
+
label: "Instructions",
|
|
31
|
+
description: "Instructions for the cloud agent that act as system prompt",
|
|
32
|
+
type: "string",
|
|
33
|
+
multiline: true,
|
|
34
|
+
optional: true,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: "maxTurns",
|
|
38
|
+
label: "Max Turns",
|
|
39
|
+
description: "Maximum number of agent runner turns",
|
|
40
|
+
type: "int",
|
|
41
|
+
optional: true,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: "memoryRefs",
|
|
45
|
+
label: "Memory Files",
|
|
46
|
+
description: "Project memory files this agent can access, with per-file read or read+write mode",
|
|
47
|
+
type: "memory-refs",
|
|
48
|
+
default: [],
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: "toolDescription",
|
|
52
|
+
label: "Tool Description",
|
|
53
|
+
description: "Description shown to the calling agent when this agent is wired as a tool",
|
|
54
|
+
type: "string",
|
|
55
|
+
multiline: true,
|
|
56
|
+
activationRules: [{ type: "isToolInput" }],
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=AgentNode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentNode.js","sourceRoot":"","sources":["../../src/node/AgentNode.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAqB3C,MAAM,CAAC,MAAM,mBAAmB,GAAmB;IACjD,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,WAAW;IAClB,QAAQ,EAAE,YAAY,CAAC,EAAE;IACzB,WAAW,EAAE,6CAA6C;IAC1D,SAAS,EAAE,IAAI,EAAE,wFAAwF;IACzG,OAAO,EAAE;QACP,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE;QACrE,EAAE,EAAE,EAAE,oBAAoB,EAAE,KAAK,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,EAAE;KACvE;IACD,UAAU,EAAE;QACV;YACE,EAAE,EAAE,MAAM;YACV,KAAK,EAAE,MAAM;YACb,WAAW,EAAE,mBAAmB;YAChC,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,QAAQ;SACf;QACD;YACE,EAAE,EAAE,OAAO;YACX,KAAK,EAAE,OAAO;YACd,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE,aAAa;YACnB,SAAS,EAAE,CAAC,UAAU,CAAC;YACvB,YAAY,EAAE,CAAC,MAAM,CAAC;SACvB;QACD;YACE,EAAE,EAAE,cAAc;YAClB,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,4DAA4D;YACzE,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,IAAI;YACf,QAAQ,EAAE,IAAI;SACf;QACD;YACE,EAAE,EAAE,UAAU;YACd,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,sCAAsC;YACnD,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;SACf;QACD;YACE,EAAE,EAAE,YAAY;YAChB,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,mFAAmF;YAChG,IAAI,EAAE,aAAa;YACnB,OAAO,EAAE,EAAE;SACZ;QACD;YACE,EAAE,EAAE,iBAAiB;YACrB,KAAK,EAAE,kBAAkB;YACzB,WAAW,EAAE,2EAA2E;YACxF,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,IAAI;YACf,eAAe,EAAE,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;SAC3C;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NodeBase } from "./Node";
|
|
2
|
+
import type { Expression, Reference } from "../api";
|
|
3
|
+
import { NodeDefinition } from "./NodeDefinition";
|
|
4
|
+
export interface SetVariableNode extends NodeBase {
|
|
5
|
+
type: "SetVariable";
|
|
6
|
+
arguments: {
|
|
7
|
+
variable: Reference | undefined;
|
|
8
|
+
value: Expression;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export type DataNodeType = "SetVariable";
|
|
12
|
+
export type DataNode = SetVariableNode;
|
|
13
|
+
export declare const SetVariableNodeDefinition: NodeDefinition;
|
|
14
|
+
//# sourceMappingURL=DataNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataNode.d.ts","sourceRoot":"","sources":["../../src/node/DataNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,WAAW,eAAgB,SAAQ,QAAQ;IAC/C,IAAI,EAAE,aAAa,CAAC;IACpB,SAAS,EAAE;QACT,QAAQ,EAAE,SAAS,GAAG,SAAS,CAAC;QAChC,KAAK,EAAE,UAAU,CAAC;KACnB,CAAC;CACH;AAED,MAAM,MAAM,YAAY,GAAG,aAAa,CAAC;AACzC,MAAM,MAAM,QAAQ,GAAG,eAAe,CAAC;AAIvC,eAAO,MAAM,yBAAyB,EAAE,cAsBvC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { NodeCategory } from "./constants";
|
|
2
|
+
// Node Definitions
|
|
3
|
+
export const SetVariableNodeDefinition = {
|
|
4
|
+
type: "SetVariable",
|
|
5
|
+
label: "Set Variable",
|
|
6
|
+
category: NodeCategory.Data,
|
|
7
|
+
description: "Assign a new value to an existing variable",
|
|
8
|
+
parameters: [
|
|
9
|
+
{
|
|
10
|
+
id: "variable",
|
|
11
|
+
label: "Variable",
|
|
12
|
+
description: "The variable to update",
|
|
13
|
+
type: "variableSelect",
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
id: "value",
|
|
17
|
+
label: "Value",
|
|
18
|
+
description: "Expression to assign",
|
|
19
|
+
type: "expression",
|
|
20
|
+
expressionType: "int", // fallback; actual type is derived from the target variable (see fromReference)
|
|
21
|
+
fromReference: "variable",
|
|
22
|
+
default: { expression: "", references: [], dataType: "int" },
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=DataNode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataNode.js","sourceRoot":"","sources":["../../src/node/DataNode.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAc3C,mBAAmB;AAEnB,MAAM,CAAC,MAAM,yBAAyB,GAAmB;IACvD,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,cAAc;IACrB,QAAQ,EAAE,YAAY,CAAC,IAAI;IAC3B,WAAW,EAAE,4CAA4C;IACzD,UAAU,EAAE;QACV;YACE,EAAE,EAAE,UAAU;YACd,KAAK,EAAE,UAAU;YACjB,WAAW,EAAE,wBAAwB;YACrC,IAAI,EAAE,gBAAgB;SACvB;QACD;YACE,EAAE,EAAE,OAAO;YACX,KAAK,EAAE,OAAO;YACd,WAAW,EAAE,sBAAsB;YACnC,IAAI,EAAE,YAAY;YAClB,cAAc,EAAE,KAAK,EAAE,gFAAgF;YACvG,aAAa,EAAE,UAAU;YACzB,OAAO,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE;SAC7D;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { NodeBase } from "./Node";
|
|
2
|
+
import type { Expression } from "../api";
|
|
3
|
+
import type { FunctionInfo } from "../function";
|
|
4
|
+
import { OutputBinding } from "../parameter";
|
|
5
|
+
import { NodeDefinition } from "./NodeDefinition";
|
|
6
|
+
export interface FunctionCallNode extends NodeBase {
|
|
7
|
+
type: "FunctionCall";
|
|
8
|
+
functionInfo: FunctionInfo;
|
|
9
|
+
arguments: Record<string, Expression | OutputBinding | string>;
|
|
10
|
+
}
|
|
11
|
+
export type FunctionCallNodeType = "FunctionCall";
|
|
12
|
+
export interface FunctionNodeDefinition extends NodeDefinition {
|
|
13
|
+
type: "FunctionCall";
|
|
14
|
+
functionInfo: FunctionInfo;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Build a FunctionCall NodeDefinition from FunctionInfo. Pure — takes an
|
|
18
|
+
* optional translator function so the headless validator can call it without
|
|
19
|
+
* an i18n runtime; workflow-builder passes `i18n.t.bind(i18n)` to get
|
|
20
|
+
* translated descriptions. Defaults to identity (returns the key) when no
|
|
21
|
+
* translator is supplied; validation logic ignores description strings.
|
|
22
|
+
*/
|
|
23
|
+
export declare function buildFunctionNodeDef(fn: FunctionInfo, t?: (key: string, params?: Record<string, unknown>) => string): FunctionNodeDefinition;
|
|
24
|
+
//# sourceMappingURL=FunctionNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FunctionNode.d.ts","sourceRoot":"","sources":["../../src/node/FunctionNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAUlD,MAAM,WAAW,gBAAiB,SAAQ,QAAQ;IAChD,IAAI,EAAE,cAAc,CAAC;IACrB,YAAY,EAAE,YAAY,CAAC;IAG3B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,aAAa,GAAG,MAAM,CAAC,CAAC;CAChE;AAED,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC;AAIlD,MAAM,WAAW,sBAAuB,SAAQ,cAAc;IAC5D,IAAI,EAAE,cAAc,CAAC;IACrB,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,EAAE,EAAE,YAAY,EAChB,CAAC,GAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAqB,GAC1E,sBAAsB,CAiCxB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { NodeCategory } from "./constants";
|
|
2
|
+
import { paramKey } from "../variable";
|
|
3
|
+
/**
|
|
4
|
+
* Build a FunctionCall NodeDefinition from FunctionInfo. Pure — takes an
|
|
5
|
+
* optional translator function so the headless validator can call it without
|
|
6
|
+
* an i18n runtime; workflow-builder passes `i18n.t.bind(i18n)` to get
|
|
7
|
+
* translated descriptions. Defaults to identity (returns the key) when no
|
|
8
|
+
* translator is supplied; validation logic ignores description strings.
|
|
9
|
+
*/
|
|
10
|
+
export function buildFunctionNodeDef(fn, t = (key) => key) {
|
|
11
|
+
return {
|
|
12
|
+
type: "FunctionCall",
|
|
13
|
+
functionInfo: fn,
|
|
14
|
+
label: fn.name,
|
|
15
|
+
category: NodeCategory.Function,
|
|
16
|
+
description: t("builder.functionCallDesc", { name: fn.name }),
|
|
17
|
+
parameters: [
|
|
18
|
+
...fn.arguments.map((param) => ({
|
|
19
|
+
id: paramKey(param),
|
|
20
|
+
label: param.name,
|
|
21
|
+
description: t("builder.functionParamDesc", { name: param.name }),
|
|
22
|
+
type: "expression",
|
|
23
|
+
expressionType: param.dataType,
|
|
24
|
+
default: { expression: "", references: [], dataType: param.dataType },
|
|
25
|
+
activationRules: [{ type: "isControlFlow" }],
|
|
26
|
+
})),
|
|
27
|
+
{
|
|
28
|
+
id: "toolDescription",
|
|
29
|
+
label: "Tool Description",
|
|
30
|
+
description: "Description shown to the agent when this function is wired as a tool",
|
|
31
|
+
type: "string",
|
|
32
|
+
multiline: true,
|
|
33
|
+
activationRules: [{ type: "isToolInput" }],
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
outputs: fn.returns.map((ret) => ({
|
|
37
|
+
id: paramKey(ret),
|
|
38
|
+
label: ret.name,
|
|
39
|
+
type: "static",
|
|
40
|
+
dataType: ret.dataType,
|
|
41
|
+
})),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=FunctionNode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FunctionNode.js","sourceRoot":"","sources":["../../src/node/FunctionNode.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAyBvC;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAClC,EAAgB,EAChB,IAA+D,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG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,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { NodeBase } from "./Node";
|
|
2
|
+
import type { Expression } from "../api";
|
|
3
|
+
import { OutputBinding } from "../parameter";
|
|
4
|
+
import { NodeDefinition } from "./NodeDefinition";
|
|
5
|
+
export interface ReadPinNode extends NodeBase {
|
|
6
|
+
type: "ReadPin";
|
|
7
|
+
arguments: {
|
|
8
|
+
pinReference: string | undefined;
|
|
9
|
+
signalType: "digital" | "analog";
|
|
10
|
+
output: OutputBinding;
|
|
11
|
+
toolDescription?: string;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface SerialReadNode extends NodeBase {
|
|
15
|
+
type: "SerialRead";
|
|
16
|
+
arguments: {
|
|
17
|
+
portReference: string | undefined;
|
|
18
|
+
prompt?: string;
|
|
19
|
+
output: OutputBinding;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export interface RetrieverNode extends NodeBase {
|
|
23
|
+
type: "Retriever";
|
|
24
|
+
arguments: {
|
|
25
|
+
memoryReference: string;
|
|
26
|
+
topK: number | undefined;
|
|
27
|
+
query: Expression;
|
|
28
|
+
output: OutputBinding;
|
|
29
|
+
toolDescription?: string;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export interface WebFetchNode extends NodeBase {
|
|
33
|
+
type: "WebFetch";
|
|
34
|
+
arguments: {
|
|
35
|
+
url: Expression;
|
|
36
|
+
maxChars: number | undefined;
|
|
37
|
+
output: OutputBinding;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export type InputNodeType = "ReadPin" | "SerialRead" | "Retriever" | "WebFetch";
|
|
41
|
+
export type InputNode = ReadPinNode | SerialReadNode | RetrieverNode | WebFetchNode;
|
|
42
|
+
export declare const ReadPinNodeDefinition: NodeDefinition;
|
|
43
|
+
export declare const RetrieverNodeDefinition: NodeDefinition;
|
|
44
|
+
export declare const WebFetchNodeDefinition: NodeDefinition;
|
|
45
|
+
export declare const SerialReadNodeDefinition: NodeDefinition;
|
|
46
|
+
//# sourceMappingURL=InputNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputNode.d.ts","sourceRoot":"","sources":["../../src/node/InputNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,WAAW,WAAY,SAAQ,QAAQ;IAC3C,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,EAAE;QACT,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;QACjC,UAAU,EAAE,SAAS,GAAG,QAAQ,CAAC;QACjC,MAAM,EAAE,aAAa,CAAC;QACtB,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC;CACH;AAED,MAAM,WAAW,cAAe,SAAQ,QAAQ;IAC9C,IAAI,EAAE,YAAY,CAAC;IACnB,SAAS,EAAE;QACT,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;QAClC,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,aAAa,CAAC;KACvB,CAAC;CACH;AAGD,MAAM,WAAW,aAAc,SAAQ,QAAQ;IAC7C,IAAI,EAAE,WAAW,CAAC;IAClB,SAAS,EAAE;QACT,eAAe,EAAE,MAAM,CAAC;QACxB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;QACzB,KAAK,EAAE,UAAU,CAAC;QAClB,MAAM,EAAE,aAAa,CAAC;QACtB,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC;CACH;AAGD,MAAM,WAAW,YAAa,SAAQ,QAAQ;IAC5C,IAAI,EAAE,UAAU,CAAC;IACjB,SAAS,EAAE;QACT,GAAG,EAAE,UAAU,CAAC;QAChB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;QAC7B,MAAM,EAAE,aAAa,CAAC;KACvB,CAAC;CACH;AAED,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,YAAY,GAAG,WAAW,GAAG,UAAU,CAAC;AAChF,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG,cAAc,GAAG,aAAa,GAAG,YAAY,CAAC;AAIpF,eAAO,MAAM,qBAAqB,EAAE,cA0CnC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,cAsCrC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,cAuBpC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,cAuBtC,CAAC"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { NodeCategory, NodeTag } from "./constants";
|
|
2
|
+
// Node Definitions
|
|
3
|
+
export const ReadPinNodeDefinition = {
|
|
4
|
+
type: "ReadPin",
|
|
5
|
+
label: "Read Pin",
|
|
6
|
+
category: NodeCategory.Input,
|
|
7
|
+
tags: [NodeTag.Pin],
|
|
8
|
+
description: "Read data from a pin",
|
|
9
|
+
outputs: [
|
|
10
|
+
{
|
|
11
|
+
id: "output",
|
|
12
|
+
label: "Pin Value",
|
|
13
|
+
type: "static",
|
|
14
|
+
dataType: (args) => (args.signalType === "digital" ? "bool" : "int"),
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
parameters: [
|
|
18
|
+
{
|
|
19
|
+
id: "pinReference",
|
|
20
|
+
label: "Pin",
|
|
21
|
+
description: "IO pin to read from",
|
|
22
|
+
type: "channelSelect",
|
|
23
|
+
channelType: (args) => (args.signalType === "digital" ? ["GPIOIN"] : ["ADC"]),
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: "signalType",
|
|
27
|
+
label: "Signal Type",
|
|
28
|
+
description: "Type of signal",
|
|
29
|
+
type: "selection",
|
|
30
|
+
default: "digital",
|
|
31
|
+
options: [
|
|
32
|
+
{ value: "digital", label: "Digital" },
|
|
33
|
+
{ value: "analog", label: "Analog" },
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: "toolDescription",
|
|
38
|
+
label: "Tool Description",
|
|
39
|
+
description: "Description shown to the agent when this node is wired as a tool",
|
|
40
|
+
type: "string",
|
|
41
|
+
multiline: true,
|
|
42
|
+
activationRules: [{ type: "isToolInput" }],
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
};
|
|
46
|
+
export const RetrieverNodeDefinition = {
|
|
47
|
+
type: "Retriever",
|
|
48
|
+
label: "Retriever",
|
|
49
|
+
category: NodeCategory.Input,
|
|
50
|
+
description: "Retrieves relevant documents from a knowledge base",
|
|
51
|
+
outputs: [{ id: "output", label: "Retrieved Documents", type: "static", dataType: "string" }],
|
|
52
|
+
parameters: [
|
|
53
|
+
{
|
|
54
|
+
id: "memoryReference",
|
|
55
|
+
label: "Vector Database",
|
|
56
|
+
description: "The vector database to search",
|
|
57
|
+
type: "memorySelect",
|
|
58
|
+
memoryType: ["VectorDatabase"],
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: "topK",
|
|
62
|
+
label: "Top K",
|
|
63
|
+
description: "Number of results to retrieve",
|
|
64
|
+
type: "int",
|
|
65
|
+
default: 5,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: "query",
|
|
69
|
+
label: "Query",
|
|
70
|
+
description: "Search query expression",
|
|
71
|
+
type: "expression",
|
|
72
|
+
expressionType: "string",
|
|
73
|
+
default: { expression: "", references: [], dataType: "string" },
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: "toolDescription",
|
|
77
|
+
label: "Tool Description",
|
|
78
|
+
description: "Description shown to the agent when this node is wired as a tool",
|
|
79
|
+
type: "string",
|
|
80
|
+
multiline: true,
|
|
81
|
+
activationRules: [{ type: "isToolInput" }],
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
};
|
|
85
|
+
export const WebFetchNodeDefinition = {
|
|
86
|
+
type: "WebFetch",
|
|
87
|
+
label: "Web Fetch",
|
|
88
|
+
category: NodeCategory.Input,
|
|
89
|
+
description: "Fetches a URL and returns extracted text",
|
|
90
|
+
outputs: [{ id: "output", label: "Fetched Text", type: "static", dataType: "string" }],
|
|
91
|
+
parameters: [
|
|
92
|
+
{
|
|
93
|
+
id: "url",
|
|
94
|
+
label: "URL",
|
|
95
|
+
description: "URL to fetch (http or https)",
|
|
96
|
+
type: "expression",
|
|
97
|
+
expressionType: "string",
|
|
98
|
+
default: { expression: "", references: [], dataType: "string" },
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
id: "maxChars",
|
|
102
|
+
label: "Max Characters",
|
|
103
|
+
description: "Maximum characters of extracted text to return",
|
|
104
|
+
type: "int",
|
|
105
|
+
optional: true,
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
};
|
|
109
|
+
export const SerialReadNodeDefinition = {
|
|
110
|
+
type: "SerialRead",
|
|
111
|
+
label: "Serial Read",
|
|
112
|
+
category: NodeCategory.Input,
|
|
113
|
+
tags: [NodeTag.Serial],
|
|
114
|
+
description: "Read string from serial port",
|
|
115
|
+
outputs: [{ id: "output", label: "Serial Data", type: "static", dataType: "string" }],
|
|
116
|
+
parameters: [
|
|
117
|
+
{
|
|
118
|
+
id: "portReference",
|
|
119
|
+
label: "Port",
|
|
120
|
+
description: "Serial port to read from",
|
|
121
|
+
type: "channelSelect",
|
|
122
|
+
channelType: ["UART"],
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
id: "prompt",
|
|
126
|
+
label: "Input prompt",
|
|
127
|
+
description: "Prompt for the serial read operation",
|
|
128
|
+
type: "string",
|
|
129
|
+
optional: true,
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
};
|
|
133
|
+
//# sourceMappingURL=InputNode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputNode.js","sourceRoot":"","sources":["../../src/node/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KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { NodeBase } from "./Node";
|
|
2
|
+
import type { Expression } from "../api";
|
|
3
|
+
import { NodeDefinition } from "./NodeDefinition";
|
|
4
|
+
export interface IfNode extends NodeBase {
|
|
5
|
+
type: "If";
|
|
6
|
+
arguments: {
|
|
7
|
+
condition: Expression;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export type LogicNodeType = "If";
|
|
11
|
+
export type LogicNode = IfNode;
|
|
12
|
+
export declare const IfNodeDefinition: NodeDefinition;
|
|
13
|
+
//# sourceMappingURL=LogicNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogicNode.d.ts","sourceRoot":"","sources":["../../src/node/LogicNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEzC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,WAAW,MAAO,SAAQ,QAAQ;IACtC,IAAI,EAAE,IAAI,CAAC;IACX,SAAS,EAAE;QACT,SAAS,EAAE,UAAU,CAAC;KACvB,CAAC;CACH;AAED,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC;AACjC,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAI/B,eAAO,MAAM,gBAAgB,EAAE,cAe9B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { NodeCategory } from "./constants";
|
|
2
|
+
// Node Definitions
|
|
3
|
+
export const IfNodeDefinition = {
|
|
4
|
+
type: "If",
|
|
5
|
+
label: "If Condition Node",
|
|
6
|
+
category: NodeCategory.Logic,
|
|
7
|
+
description: "Conditional branching based on boolean expression",
|
|
8
|
+
parameters: [
|
|
9
|
+
{
|
|
10
|
+
id: "condition",
|
|
11
|
+
label: "Condition",
|
|
12
|
+
description: "Boolean expression (e.g., ${Input_1.value} > 50)",
|
|
13
|
+
type: "expression",
|
|
14
|
+
expressionType: "bool",
|
|
15
|
+
default: { expression: "", references: [], dataType: "bool" },
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=LogicNode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogicNode.js","sourceRoot":"","sources":["../../src/node/LogicNode.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAa3C,mBAAmB;AAEnB,MAAM,CAAC,MAAM,gBAAgB,GAAmB;IAC9C,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,mBAAmB;IAC1B,QAAQ,EAAE,YAAY,CAAC,KAAK;IAC5B,WAAW,EAAE,mDAAmD;IAChE,UAAU,EAAE;QACV;YACE,EAAE,EAAE,WAAW;YACf,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,kDAAkD;YAC/D,IAAI,EAAE,YAAY;YAClB,cAAc,EAAE,MAAM;YACtB,OAAO,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE;SAC9D;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { NodeBase } from "./Node";
|
|
2
|
+
import type { Expression } from "../api";
|
|
3
|
+
import { OutputBinding } from "../parameter";
|
|
4
|
+
import { NodeDefinition } from "./NodeDefinition";
|
|
5
|
+
export interface MqttPublishNode extends NodeBase {
|
|
6
|
+
type: "MqttPublish";
|
|
7
|
+
arguments: {
|
|
8
|
+
channelReference: string;
|
|
9
|
+
dataType: "int" | "float" | "bool" | "string";
|
|
10
|
+
value: Expression;
|
|
11
|
+
qos: "0" | "1" | "2";
|
|
12
|
+
retain: boolean;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export interface OnMqttMessageNode extends NodeBase {
|
|
16
|
+
type: "OnMqttMessage";
|
|
17
|
+
arguments: {
|
|
18
|
+
channelReference: string;
|
|
19
|
+
dataType: "int" | "float" | "bool" | "string";
|
|
20
|
+
output: OutputBinding;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export type MqttNodeType = "MqttPublish" | "OnMqttMessage";
|
|
24
|
+
export type MqttNode = MqttPublishNode | OnMqttMessageNode;
|
|
25
|
+
export declare const MqttPublishNodeDefinition: NodeDefinition;
|
|
26
|
+
export declare const OnMqttMessageNodeDefinition: NodeDefinition;
|
|
27
|
+
//# sourceMappingURL=MqttNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MqttNode.d.ts","sourceRoot":"","sources":["../../src/node/MqttNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD,MAAM,WAAW,eAAgB,SAAQ,QAAQ;IAC/C,IAAI,EAAE,aAAa,CAAC;IACpB,SAAS,EAAE;QACT,gBAAgB,EAAE,MAAM,CAAC;QACzB,QAAQ,EAAE,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;QAC9C,KAAK,EAAE,UAAU,CAAC;QAClB,GAAG,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;QACrB,MAAM,EAAE,OAAO,CAAC;KACjB,CAAC;CACH;AAGD,MAAM,WAAW,iBAAkB,SAAQ,QAAQ;IACjD,IAAI,EAAE,eAAe,CAAC;IACtB,SAAS,EAAE;QACT,gBAAgB,EAAE,MAAM,CAAC;QACzB,QAAQ,EAAE,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;QAC9C,MAAM,EAAE,aAAa,CAAC;KACvB,CAAC;CACH;AAED,MAAM,MAAM,YAAY,GAAG,aAAa,GAAG,eAAe,CAAC;AAC3D,MAAM,MAAM,QAAQ,GAAG,eAAe,GAAG,iBAAiB,CAAC;AAI3D,eAAO,MAAM,yBAAyB,EAAE,cAuDvC,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,cAoCzC,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { NodeCategory, NodeTag } from "./constants";
|
|
2
|
+
// Node Definitions
|
|
3
|
+
export const MqttPublishNodeDefinition = {
|
|
4
|
+
type: "MqttPublish",
|
|
5
|
+
label: "MQTT Publish",
|
|
6
|
+
category: NodeCategory.Output,
|
|
7
|
+
tags: [NodeTag.Network],
|
|
8
|
+
description: "Publish a value to an MQTT topic",
|
|
9
|
+
parameters: [
|
|
10
|
+
{
|
|
11
|
+
id: "channelReference",
|
|
12
|
+
label: "Channel",
|
|
13
|
+
description: "MQTT channel to publish through",
|
|
14
|
+
type: "channelSelect",
|
|
15
|
+
channelType: ["MQTT"],
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
id: "dataType",
|
|
19
|
+
label: "Data Type",
|
|
20
|
+
description: "Data type of the value to publish",
|
|
21
|
+
type: "selection",
|
|
22
|
+
options: [
|
|
23
|
+
{ value: "int", label: "Integer" },
|
|
24
|
+
{ value: "float", label: "Float" },
|
|
25
|
+
{ value: "bool", label: "Boolean" },
|
|
26
|
+
{ value: "string", label: "String" },
|
|
27
|
+
],
|
|
28
|
+
default: "string",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: "value",
|
|
32
|
+
label: "Value",
|
|
33
|
+
description: "Value to publish",
|
|
34
|
+
type: "expression",
|
|
35
|
+
expressionType: (args) => args.dataType,
|
|
36
|
+
default: { expression: "", references: [], dataType: "string" },
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: "qos",
|
|
40
|
+
label: "QoS",
|
|
41
|
+
description: "Quality of Service level",
|
|
42
|
+
type: "selection",
|
|
43
|
+
options: [
|
|
44
|
+
{ value: "0", label: "0 - At most once" },
|
|
45
|
+
{ value: "1", label: "1 - At least once" },
|
|
46
|
+
{ value: "2", label: "2 - Exactly once" },
|
|
47
|
+
],
|
|
48
|
+
default: "0",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: "retain",
|
|
52
|
+
label: "Retain",
|
|
53
|
+
description: "Whether the broker should retain the message",
|
|
54
|
+
type: "bool",
|
|
55
|
+
default: false,
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
};
|
|
59
|
+
export const OnMqttMessageNodeDefinition = {
|
|
60
|
+
type: "OnMqttMessage",
|
|
61
|
+
label: "On MQTT Message",
|
|
62
|
+
category: NodeCategory.Trigger,
|
|
63
|
+
tags: [NodeTag.Network],
|
|
64
|
+
description: "Fires when a message is received on a subscribed MQTT topic",
|
|
65
|
+
outputs: [
|
|
66
|
+
{
|
|
67
|
+
id: "output",
|
|
68
|
+
label: "Message Value",
|
|
69
|
+
type: "static",
|
|
70
|
+
dataType: (args) => args.dataType,
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
parameters: [
|
|
74
|
+
{
|
|
75
|
+
id: "channelReference",
|
|
76
|
+
label: "Channel",
|
|
77
|
+
description: "MQTT channel to subscribe through",
|
|
78
|
+
type: "channelSelect",
|
|
79
|
+
channelType: ["MQTT"],
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
id: "dataType",
|
|
83
|
+
label: "Data Type",
|
|
84
|
+
description: "Expected data type of the received message value",
|
|
85
|
+
type: "selection",
|
|
86
|
+
options: [
|
|
87
|
+
{ value: "int", label: "Integer" },
|
|
88
|
+
{ value: "float", label: "Float" },
|
|
89
|
+
{ value: "bool", label: "Boolean" },
|
|
90
|
+
{ value: "string", label: "String" },
|
|
91
|
+
],
|
|
92
|
+
default: "string",
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
};
|
|
96
|
+
//# sourceM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