@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,27 @@
|
|
|
1
|
+
import type { Parameter } from "../parameter";
|
|
2
|
+
/**
|
|
3
|
+
* Single union definition for all Channel variants — deliberately NOT the
|
|
4
|
+
* per-type registry pattern used by Node/Memory/Model (`*Definition` +
|
|
5
|
+
* `*Registry`, one definition object per type).
|
|
6
|
+
*
|
|
7
|
+
* The reason is in-place `type` switching that preserves shared parameter state.
|
|
8
|
+
* Because `type` is a parameter and all variants share one `arguments` bag,
|
|
9
|
+
* changing a channel's type keeps the same instance (id, label) and retains any
|
|
10
|
+
* entered values that are still valid for the new type: the parameter +
|
|
11
|
+
* `activationRules` machinery just re-gates which fields show, and `serialize`
|
|
12
|
+
* (via `pruneArguments`) drops the now-inactive ones. A per-type registry
|
|
13
|
+
* would make each variant its own definition, so switching type would mean
|
|
14
|
+
* delete-and-recreate — losing id/label and every shared value the user entered.
|
|
15
|
+
* (It also lets channels add from one "Add Channel" button with type as a field,
|
|
16
|
+
* rather than an add-button per type. Node/Memory/Model instead treat `type` as
|
|
17
|
+
* an immutable registry key chosen at creation.)
|
|
18
|
+
*
|
|
19
|
+
* The same could be achieved with a UI-layer "type selector" over a
|
|
20
|
+
* ChannelRegistry; this union trades cross-family consistency for that
|
|
21
|
+
* shared-state-preserving switch.
|
|
22
|
+
*/
|
|
23
|
+
export interface ChannelDefinition {
|
|
24
|
+
parameters: Parameter[];
|
|
25
|
+
}
|
|
26
|
+
export declare const CHANNEL_DEFINITION: ChannelDefinition;
|
|
27
|
+
//# sourceMappingURL=ChannelDefinition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChannelDefinition.d.ts","sourceRoot":"","sources":["../../src/channel/ChannelDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG9C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,SAAS,EAAE,CAAC;CACzB;AAED,eAAO,MAAM,kBAAkB,EAAE,iBA+ChC,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ALL_CHANNEL_TYPES } from "./Channel";
|
|
2
|
+
export const CHANNEL_DEFINITION = {
|
|
3
|
+
parameters: [
|
|
4
|
+
{
|
|
5
|
+
id: "type",
|
|
6
|
+
label: "Type",
|
|
7
|
+
description: "Channel type",
|
|
8
|
+
type: "selection",
|
|
9
|
+
default: "GPIOIN",
|
|
10
|
+
options: ALL_CHANNEL_TYPES.map((t) => ({ value: t, label: t })),
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
id: "bias",
|
|
14
|
+
label: "Bias",
|
|
15
|
+
description: "Pin bias configuration",
|
|
16
|
+
type: "selection",
|
|
17
|
+
default: "none",
|
|
18
|
+
options: [
|
|
19
|
+
{ value: "none", label: "None" },
|
|
20
|
+
{ value: "pullup", label: "Pull-up" },
|
|
21
|
+
{ value: "pulldown", label: "Pull-down" },
|
|
22
|
+
],
|
|
23
|
+
activationRules: [{ type: "parameterIn", parameterId: "type", values: ["GPIOIN"] }],
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: "debounceMs",
|
|
27
|
+
label: "Debounce (ms)",
|
|
28
|
+
description: "Debounce window in milliseconds",
|
|
29
|
+
type: "int",
|
|
30
|
+
default: 50,
|
|
31
|
+
activationRules: [{ type: "parameterIn", parameterId: "type", values: ["GPIOIN"] }],
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: "frequency",
|
|
35
|
+
label: "Frequency (Hz)",
|
|
36
|
+
description: "PWM frequency in Hz",
|
|
37
|
+
type: "int",
|
|
38
|
+
default: 1000,
|
|
39
|
+
activationRules: [{ type: "parameterIn", parameterId: "type", values: ["PWM"] }],
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: "topic",
|
|
43
|
+
label: "Topic",
|
|
44
|
+
description: "MQTT topic this channel publishes to / subscribes on (e.g. sensors/temperature)",
|
|
45
|
+
type: "string",
|
|
46
|
+
activationRules: [{ type: "parameterIn", parameterId: "type", values: ["MQTT"] }],
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=ChannelDefinition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChannelDefinition.js","sourceRoot":"","sources":["../../src/channel/ChannelDefinition.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AA2B9C,MAAM,CAAC,MAAM,kBAAkB,GAAsB;IACnD,UAAU,EAAE;QACV;YACE,EAAE,EAAE,MAAM;YACV,KAAK,EAAE,MAAM;YACb,WAAW,EAAE,cAAc;YAC3B,IAAI,EAAE,WAAW;YACjB,OAAO,EAAE,QAAQ;YACjB,OAAO,EAAE,iBAAi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E,aAAa,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC;SAClF;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type { ChannelType, Channel } from "./Channel";
|
|
2
|
+
export { ALL_CHANNEL_TYPES } from "./Channel";
|
|
3
|
+
export type { ChannelDefinition } from "./ChannelDefinition";
|
|
4
|
+
export { CHANNEL_DEFINITION } from "./ChannelDefinition";
|
|
5
|
+
export { serialize, deserialize } from "./serialization";
|
|
6
|
+
export type { ApiChannel } from "./serialization";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/channel/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACzD,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/channel/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Schemas } from "../api";
|
|
2
|
+
import type { Channel } from "./Channel";
|
|
3
|
+
export type ApiChannel = Schemas["Channel"];
|
|
4
|
+
/**
|
|
5
|
+
* Serialize a domain Channel to the API discriminated-union shape.
|
|
6
|
+
*
|
|
7
|
+
* The domain store retains inactive parameters (non-destructive type switching),
|
|
8
|
+
* so this is the boundary that drops them. The `type` discriminator must be in
|
|
9
|
+
* the args record so `parameterIn` rules can evaluate — otherwise every gated
|
|
10
|
+
* field (bias/debounceMs/frequency) is stripped as "inactive". Physical
|
|
11
|
+
* addressing (GPIO line, ADC/PWM/DAC channel) is not here — it's a deploy
|
|
12
|
+
* binding, not workflow state.
|
|
13
|
+
*/
|
|
14
|
+
export declare function serialize(ch: Channel): ApiChannel;
|
|
15
|
+
/** Convert an API Channel into a domain Channel. */
|
|
16
|
+
export declare function deserialize(api: ApiChannel): Channel;
|
|
17
|
+
//# sourceMappingURL=serialization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialization.d.ts","sourceRoot":"","sources":["../../src/channel/serialization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGtC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AAE5C;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,EAAE,EAAE,OAAO,GAAG,UAAU,CA0BjD;AAED,oDAAoD;AACpD,wBAAgB,WAAW,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAqBpD"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { pruneArguments } from "../parameter";
|
|
2
|
+
import { CHANNEL_DEFINITION } from "./ChannelDefinition";
|
|
3
|
+
/**
|
|
4
|
+
* Serialize a domain Channel to the API discriminated-union shape.
|
|
5
|
+
*
|
|
6
|
+
* The domain store retains inactive parameters (non-destructive type switching),
|
|
7
|
+
* so this is the boundary that drops them. The `type` discriminator must be in
|
|
8
|
+
* the args record so `parameterIn` rules can evaluate — otherwise every gated
|
|
9
|
+
* field (bias/debounceMs/frequency) is stripped as "inactive". Physical
|
|
10
|
+
* addressing (GPIO line, ADC/PWM/DAC channel) is not here — it's a deploy
|
|
11
|
+
* binding, not workflow state.
|
|
12
|
+
*/
|
|
13
|
+
export function serialize(ch) {
|
|
14
|
+
const { id, label, type } = ch;
|
|
15
|
+
const args = { ...ch.arguments, type };
|
|
16
|
+
pruneArguments(args, CHANNEL_DEFINITION.parameters);
|
|
17
|
+
switch (type) {
|
|
18
|
+
case "GPIOIN":
|
|
19
|
+
return {
|
|
20
|
+
type,
|
|
21
|
+
id,
|
|
22
|
+
label,
|
|
23
|
+
bias: args.bias,
|
|
24
|
+
debounceMs: args.debounceMs,
|
|
25
|
+
};
|
|
26
|
+
case "GPIOOUT":
|
|
27
|
+
return { type, id, label };
|
|
28
|
+
case "ADC":
|
|
29
|
+
return { type, id, label };
|
|
30
|
+
case "PWM":
|
|
31
|
+
return { type, id, label, frequency: args.frequency };
|
|
32
|
+
case "DAC":
|
|
33
|
+
return { type, id, label };
|
|
34
|
+
case "UART":
|
|
35
|
+
return { type, id, label };
|
|
36
|
+
case "MQTT":
|
|
37
|
+
return { type, id, label, topic: args.topic };
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/** Convert an API Channel into a domain Channel. */
|
|
41
|
+
export function deserialize(api) {
|
|
42
|
+
const { id, label, type } = api;
|
|
43
|
+
const args = {};
|
|
44
|
+
switch (type) {
|
|
45
|
+
case "GPIOIN":
|
|
46
|
+
args.bias = api.bias;
|
|
47
|
+
args.debounceMs = api.debounceMs;
|
|
48
|
+
break;
|
|
49
|
+
case "PWM":
|
|
50
|
+
args.frequency = api.frequency;
|
|
51
|
+
break;
|
|
52
|
+
case "MQTT":
|
|
53
|
+
args.topic = api.topic;
|
|
54
|
+
break;
|
|
55
|
+
case "GPIOOUT":
|
|
56
|
+
case "ADC":
|
|
57
|
+
case "DAC":
|
|
58
|
+
case "UART":
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
return { id, label, type, arguments: args };
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=serialization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialization.js","sourceRoot":"","sources":["../../src/channel/serialization.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAKzD;;;;;;;;;GASG;AACH,MAAM,UAAU,SAAS,CAAC,EAAW;IACnC,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;IAC/B,MAAM,IAAI,GAA4B,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC;IAChE,cAAc,CAAC,IAAI,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC;IACpD,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,QAAQ;YACX,OAAO;gBACL,IAAI;gBACJ,EAAE;gBACF,KAAK;gBACL,IAAI,EAAE,IAAI,CAAC,IAAwC;gBACnD,UAAU,EAAE,IAAI,CAAC,UAAoB;aACtC,CAAC;QACJ,KAAK,SAAS;YACZ,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC;QAC7B,KAAK,KAAK;YACR,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC;QAC7B,KAAK,KAAK;YACR,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,SAAmB,EAAE,CAAC;QAClE,KAAK,KAAK;YACR,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC;QAC7B,KAAK,MAAM;YACT,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC;QAC7B,KAAK,MAAM;YACT,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,KAAe,EAAE,CAAC;IAC5D,CAAC;AACH,CAAC;AAED,oDAAoD;AACpD,MAAM,UAAU,WAAW,CAAC,GAAe;IACzC,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC;IAChC,MAAM,IAAI,GAA4B,EAAE,CAAC;IACzC,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,QAAQ;YACX,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;YACrB,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC,UAAU,CAAC;YACjC,MAAM;QACR,KAAK,KAAK;YACR,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC;YAC/B,MAAM;QACR,KAAK,MAAM;YACT,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;YACvB,MAAM;QACR,KAAK,SAAS,CAAC;QACf,KAAK,KAAK,CAAC;QACX,KAAK,KAAK,CAAC;QACX,KAAK,MAAM;YACT,MAAM;IACV,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/deploy/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/deploy/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Workflow } from "../workflow";
|
|
2
|
+
/**
|
|
3
|
+
* Model ids that nodes reference but the workflow does not declare in `models`.
|
|
4
|
+
* A `modelSelect` accepts exactly two sources — declared custom models and the
|
|
5
|
+
* static catalog — so any referenced id that isn't a declared model is a catalog
|
|
6
|
+
* model: it carries no declared config, yet still needs a provider/credential
|
|
7
|
+
* supplied at deploy.
|
|
8
|
+
*
|
|
9
|
+
* This is the one deploy demand the workflow's resource arrays can't express:
|
|
10
|
+
* channels/memory/declared-models are enumerable directly from
|
|
11
|
+
* `workflow.{channels,memory,models}`, but catalog model ids live only on the
|
|
12
|
+
* nodes that pick them — hence the walk. Spans every canvas (main + function
|
|
13
|
+
* bodies) and honors parameter activation, so a model behind an inactive
|
|
14
|
+
* `modelSelect` (pruned on serialize, never deployed) is not counted.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getReferencedCatalogModelIds(workflow: Workflow): string[];
|
|
17
|
+
//# sourceMappingURL=requirements.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requirements.d.ts","sourceRoot":"","sources":["../../src/deploy/requirements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAI5C;;;;;;;;;;;;;GAaG;AACH,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,EAAE,CAsBzE"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { NodeRegistry, isNodeUsedAsTool } from "../node";
|
|
2
|
+
import { isParameterActive } from "../parameter";
|
|
3
|
+
/**
|
|
4
|
+
* Model ids that nodes reference but the workflow does not declare in `models`.
|
|
5
|
+
* A `modelSelect` accepts exactly two sources — declared custom models and the
|
|
6
|
+
* static catalog — so any referenced id that isn't a declared model is a catalog
|
|
7
|
+
* model: it carries no declared config, yet still needs a provider/credential
|
|
8
|
+
* supplied at deploy.
|
|
9
|
+
*
|
|
10
|
+
* This is the one deploy demand the workflow's resource arrays can't express:
|
|
11
|
+
* channels/memory/declared-models are enumerable directly from
|
|
12
|
+
* `workflow.{channels,memory,models}`, but catalog model ids live only on the
|
|
13
|
+
* nodes that pick them — hence the walk. Spans every canvas (main + function
|
|
14
|
+
* bodies) and honors parameter activation, so a model behind an inactive
|
|
15
|
+
* `modelSelect` (pruned on serialize, never deployed) is not counted.
|
|
16
|
+
*/
|
|
17
|
+
export function getReferencedCatalogModelIds(workflow) {
|
|
18
|
+
const declaredModel = new Set(Object.keys(workflow.models));
|
|
19
|
+
const catalogIds = new Set();
|
|
20
|
+
for (const canvas of Object.values(workflow.canvases)) {
|
|
21
|
+
for (const node of canvas.nodes) {
|
|
22
|
+
const def = NodeRegistry.getByType(node.type);
|
|
23
|
+
if (!def)
|
|
24
|
+
continue;
|
|
25
|
+
const args = node.arguments;
|
|
26
|
+
const isToolInput = isNodeUsedAsTool(node.id, node, canvas.edges);
|
|
27
|
+
for (const param of def.parameters) {
|
|
28
|
+
if (param.type !== "modelSelect")
|
|
29
|
+
continue;
|
|
30
|
+
if (!isParameterActive(param, args, isToolInput))
|
|
31
|
+
continue;
|
|
32
|
+
const id = args[param.id];
|
|
33
|
+
if (typeof id === "string" && id !== "" && !declaredModel.has(id)) {
|
|
34
|
+
catalogIds.add(id);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return [...catalogIds];
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=requirements.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requirements.js","sourceRoot":"","sources":["../../src/deploy/requirements.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,4BAA4B,CAAC,QAAkB;IAC7D,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5D,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAC;IAErC,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QACtD,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;YAChC,MAAM,GAAG,GAAG,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC9C,IAAI,CAAC,GAAG;gBAAE,SAAS;YACnB,MAAM,IAAI,GAAG,IAAI,CAAC,SAAoC,CAAC;YACvD,MAAM,WAAW,GAAG,gBAAgB,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;YAClE,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,UAAU,EAAE,CAAC;gBACnC,IAAI,KAAK,CAAC,IAAI,KAAK,aAAa;oBAAE,SAAS;gBAC3C,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,IAAI,EAAE,WAAW,CAAC;oBAAE,SAAS;gBAC3D,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;gBAC1B,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;oBAClE,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;gBACrB,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,UAAU,CAAC,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Edge } from "../../edge";
|
|
2
|
+
import type { NodeDefinition, NodeData } from "../../node";
|
|
3
|
+
import type { DataType, Expression, Reference } from "../../api";
|
|
4
|
+
import type { Channel } from "../../channel";
|
|
5
|
+
import type { Memory } from "../../memory";
|
|
6
|
+
import type { Variable, DeclaredVariable, NodeOutputVariable } from "../../variable";
|
|
7
|
+
import type { Diagnostic, DiagnosticCategory } from "../diagnostics";
|
|
8
|
+
export declare function makeDeclaredVar(overrides?: Partial<DeclaredVariable>): Variable;
|
|
9
|
+
export declare function makeNodeOutputVar(overrides?: Partial<NodeOutputVariable>): Variable;
|
|
10
|
+
/** Build an `availableVariables` map from a list of `AvailableVariable` entries. */
|
|
11
|
+
export declare function makeAvailableVars(vars: Variable[]): Record<string, Variable>;
|
|
12
|
+
export declare function makeExpression(expression: string, dataType?: DataType, references?: Reference[]): Expression;
|
|
13
|
+
export declare function makeDeclaredRef(uid: string): Reference;
|
|
14
|
+
export declare function makeEdge(id: string, source: string, sourceHandle: string, target: string, targetHandle: string, overrides?: Partial<Edge>): Edge;
|
|
15
|
+
export declare function makeChannel(overrides?: Partial<Channel>): Channel;
|
|
16
|
+
export declare function makeChannels(channels: Channel[]): Record<string, Channel>;
|
|
17
|
+
export declare function makeMemory(overrides?: Partial<Memory>): Memory;
|
|
18
|
+
export declare function makeMemories(memories: Memory[]): Record<string, Memory>;
|
|
19
|
+
/**
|
|
20
|
+
* Build a minimal NodeData. Tests assert against the shape `computeNodeDiagnostics`
|
|
21
|
+
* sees (arguments record + type discriminator), not against the strict per-type shapes,
|
|
22
|
+
* so we widen to `NodeData` via unknown at the boundary.
|
|
23
|
+
*/
|
|
24
|
+
export declare function makeNode(type: string, args: Record<string, unknown>, overrides?: Record<string, unknown>): NodeData;
|
|
25
|
+
export declare function makeNodeDef(overrides?: Partial<NodeDefinition>): NodeDefinition;
|
|
26
|
+
export declare function diagsOfCategory(diags: Diagnostic[], category: DiagnosticCategory): Diagnostic[];
|
|
27
|
+
export declare function hasDiag(diags: Diagnostic[], predicate: (d: Diagnostic) => boolean): boolean;
|
|
28
|
+
//# sourceMappingURL=diagnosticFixtures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnosticFixtures.d.ts","sourceRoot":"","sources":["../../../src/diagnostics/__fixtures__/diagnostic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AG,OAAO,CAQrE;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAIzE;AAMD,wBAAgB,UAAU,CAAC,SAAS,GAAE,OAAO,CAAC,MAAM,CAAM,GAAG,MAAM,CAQlE;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAIvE;AAMD;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GAAG,QAAQ,CAEvH;AAMD,wBAAgB,WAAW,CAAC,SAAS,GAAE,OAAO,CAAC,cAAc,CAAM,GAAG,cAAc,CASnF;AAMD,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE,QAAQ,EAAE,kBAAkB,GAAG,UAAU,EAAE,CAE/F;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,OAAO,GAAG,OAAO,CAE3F"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { NodeCategory } from "../../node";
|
|
2
|
+
// ============================================================================
|
|
3
|
+
// Variable builders
|
|
4
|
+
// ============================================================================
|
|
5
|
+
export function makeDeclaredVar(overrides = {}) {
|
|
6
|
+
return {
|
|
7
|
+
kind: "declared",
|
|
8
|
+
uid: "v1",
|
|
9
|
+
name: "count",
|
|
10
|
+
dataType: "int",
|
|
11
|
+
...overrides,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export function makeNodeOutputVar(overrides = {}) {
|
|
15
|
+
return {
|
|
16
|
+
kind: "node",
|
|
17
|
+
nodeId: "n1",
|
|
18
|
+
outputId: "output",
|
|
19
|
+
name: "result",
|
|
20
|
+
dataType: "int",
|
|
21
|
+
...overrides,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/** Build an `availableVariables` map from a list of `AvailableVariable` entries. */
|
|
25
|
+
export function makeAvailableVars(vars) {
|
|
26
|
+
const map = {};
|
|
27
|
+
for (const v of vars) {
|
|
28
|
+
const key = v.kind === "declared" ? `declared:${v.uid}` : v.kind === "fnarg" ? `fnarg:${v.uid}` : `${v.nodeId}:${v.outputId}`;
|
|
29
|
+
map[key] = v;
|
|
30
|
+
}
|
|
31
|
+
return map;
|
|
32
|
+
}
|
|
33
|
+
// ============================================================================
|
|
34
|
+
// Expression / Reference builders
|
|
35
|
+
// ============================================================================
|
|
36
|
+
export function makeExpression(expression, dataType = "int", references = []) {
|
|
37
|
+
return { expression, references, dataType };
|
|
38
|
+
}
|
|
39
|
+
export function makeDeclaredRef(uid) {
|
|
40
|
+
return { srcId: "declared", varId: uid };
|
|
41
|
+
}
|
|
42
|
+
// ============================================================================
|
|
43
|
+
// Edge builder
|
|
44
|
+
// ============================================================================
|
|
45
|
+
export function makeEdge(id, source, sourceHandle, target, targetHandle, overrides = {}) {
|
|
46
|
+
return {
|
|
47
|
+
id,
|
|
48
|
+
source,
|
|
49
|
+
sourceHandle,
|
|
50
|
+
target,
|
|
51
|
+
targetHandle,
|
|
52
|
+
type: "control",
|
|
53
|
+
...overrides,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
// ============================================================================
|
|
57
|
+
// Channel builders
|
|
58
|
+
// ============================================================================
|
|
59
|
+
export function makeChannel(overrides = {}) {
|
|
60
|
+
return {
|
|
61
|
+
id: "ch1",
|
|
62
|
+
label: "GPIO 4",
|
|
63
|
+
type: "GPIOIN",
|
|
64
|
+
arguments: {},
|
|
65
|
+
...overrides,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
export function makeChannels(channels) {
|
|
69
|
+
const map = {};
|
|
70
|
+
for (const v of channels)
|
|
71
|
+
map[v.id] = v;
|
|
72
|
+
return map;
|
|
73
|
+
}
|
|
74
|
+
// ============================================================================
|
|
75
|
+
// Memory builders
|
|
76
|
+
// ============================================================================
|
|
77
|
+
export function makeMemory(overrides = {}) {
|
|
78
|
+
return {
|
|
79
|
+
id: "mem1",
|
|
80
|
+
label: "memory1",
|
|
81
|
+
type: "MemoryFile",
|
|
82
|
+
arguments: {},
|
|
83
|
+
...overrides,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
export function makeMemories(memories) {
|
|
87
|
+
const map = {};
|
|
88
|
+
for (const m of memories)
|
|
89
|
+
map[m.id] = m;
|
|
90
|
+
return map;
|
|
91
|
+
}
|
|
92
|
+
// ============================================================================
|
|
93
|
+
// Node instance builder — untyped escape hatch
|
|
94
|
+
// ============================================================================
|
|
95
|
+
/**
|
|
96
|
+
* Build a minimal NodeData. Tests assert against the shape `computeNodeDiagnostics`
|
|
97
|
+
* sees (arguments record + type discriminator), not against the strict per-type shapes,
|
|
98
|
+
* so we widen to `NodeData` via unknown at the boundary.
|
|
99
|
+
*/
|
|
100
|
+
export function makeNode(type, args, overrides = {}) {
|
|
101
|
+
return { id: "n1", type, arguments: args, ...overrides };
|
|
102
|
+
}
|
|
103
|
+
// ============================================================================
|
|
104
|
+
// Synthetic NodeDefinition builder
|
|
105
|
+
// ============================================================================
|
|
106
|
+
export function makeNodeDef(overrides = {}) {
|
|
107
|
+
return {
|
|
108
|
+
type: "Synthetic",
|
|
109
|
+
label: "Synthetic Node",
|
|
110
|
+
category: NodeCategory.Input,
|
|
111
|
+
description: "Synthetic node used only in tests",
|
|
112
|
+
parameters: [],
|
|
113
|
+
...overrides,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
// ============================================================================
|
|
117
|
+
// Diagnostic assertion helpers
|
|
118
|
+
// ============================================================================
|
|
119
|
+
export function diagsOfCategory(diags, category) {
|
|
120
|
+
return diags.filter((d) => d.category === category);
|
|
121
|
+
}
|
|
122
|
+
export function hasDiag(diags, predicate) {
|
|
123
|
+
return diags.some(predicate);
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=diagnosticFixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnosticFixtures.js","sourceRoot":"","sources":["../../../src/diagnostics/__fixtures__/diagnosticFixtures.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAI1C,+EAA+E;AAC/E,oBAAoB;AACpB,+EAA+E;AAE/E,MAAM,UAAU,eAAe,CAAC,YAAuC,EAAE;IACvE,OAAO;QACL,IAAI,EAAE,UAAU;QAChB,GAAG,EAAE,IAAI;QACT,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,KAAiB;QAC3B,GAAG,SAAS;KACb,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,YAAyC,EAAE;IAC3E,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,IAAI;QACZ,QAAQ,EAAE,QAAQ;QAClB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,KAAiB;QAC3B,GAAG,SAAS;KACb,CAAC;AACJ,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,iBAAiB,CAAC,IAAgB;IAChD,MAAM,GAAG,GAA6B,EAAE,CAAC;IACzC,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;QACrB,MAAM,GAAG,GAAG,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;QAC9H,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;IACD,OAAO,GAAG,CAAC;AACb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type { Edge } from "../edge";
|
|
4
|
+
import type { Variable } from "../variable";
|
|
5
|
+
import type { Channel } from "../channel";
|
|
6
|
+
import type { Memory } from "../memory";
|
|
7
|
+
import type { Model } from "../model";
|
|
8
|
+
import type { FunctionDeclaration, OutputAssignment } from "../function";
|
|
9
|
+
import { type Workflow } from "../workflow/Workflow";
|
|
10
|
+
export type DiagnosticSeverity = "error" | "warning";
|
|
11
|
+
export type DiagnosticCategory = "missing-required-param" | "invalid-expression" | "invalid-reference" | "function-deleted" | "function-stale" | "unconnected-input" | "unconnected-output" | "tool-not-connected" | "missing-output-assignment" | "assign-type-mismatch" | "duplicate-output-name";
|
|
12
|
+
export interface Diagnostic {
|
|
13
|
+
severity: DiagnosticSeverity;
|
|
14
|
+
category: DiagnosticCategory;
|
|
15
|
+
message: string;
|
|
16
|
+
/** Canvas this diagnostic belongs to. Omitted for project-scoped sources (e.g. channels). */
|
|
17
|
+
canvasId?: string;
|
|
18
|
+
nodeId?: string;
|
|
19
|
+
edgeId?: string;
|
|
20
|
+
/** Set when the diagnostic targets a project-scoped channel. */
|
|
21
|
+
channelId?: string;
|
|
22
|
+
/** Set when the diagnostic targets a project-scoped memory primitive. */
|
|
23
|
+
memoryId?: string;
|
|
24
|
+
/** Set when the diagnostic targets a project-scoped declared model. */
|
|
25
|
+
modelId?: string;
|
|
26
|
+
/** Set when the diagnostic targets a project-scoped function declaration. */
|
|
27
|
+
functionId?: string;
|
|
28
|
+
paramId?: string;
|
|
29
|
+
outputId?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Compute diagnostics for a single node.
|
|
33
|
+
*/
|
|
34
|
+
export declare function computeNodeDiagnostics(opts: {
|
|
35
|
+
canvasId: string;
|
|
36
|
+
nodeId: string;
|
|
37
|
+
nodeData: NodeData;
|
|
38
|
+
nodeDefinition: NodeDefinition | undefined;
|
|
39
|
+
availableVariables: Record<string, Variable>;
|
|
40
|
+
channels: Record<string, Channel>;
|
|
41
|
+
memory?: Record<string, Memory>;
|
|
42
|
+
/** Declared custom models (project-scoped). */
|
|
43
|
+
models?: Record<string, Model>;
|
|
44
|
+
/** Ids in the static model catalog (props-supplied). Undefined headlessly — catalog ids then aren't flagged. */
|
|
45
|
+
availableModelIds?: Set<string>;
|
|
46
|
+
edges: readonly Edge[];
|
|
47
|
+
isStale?: boolean;
|
|
48
|
+
isDeleted?: boolean;
|
|
49
|
+
}): Diagnostic[];
|
|
50
|
+
/**
|
|
51
|
+
* Compute diagnostics for a single edge. Extracted from CustomEdge's useMemo.
|
|
52
|
+
*/
|
|
53
|
+
export declare function computeEdgeDiagnostics(opts: {
|
|
54
|
+
canvasId: string;
|
|
55
|
+
edgeId: string;
|
|
56
|
+
edgeType: EdgeType;
|
|
57
|
+
edgeData: EdgeData | undefined;
|
|
58
|
+
availableVariables: Record<string, Variable>;
|
|
59
|
+
sourceControlEdgeCount: number;
|
|
60
|
+
}): Diagnostic[];
|
|
61
|
+
/**
|
|
62
|
+
* Compute diagnostics for a single channel. Mirrors the parameter loop
|
|
63
|
+
* from computeNodeDiagnostics: filter to active params (per the type
|
|
64
|
+
* discriminator), then required-check each. Empty label is also flagged so
|
|
65
|
+
* the user has a non-blank name in `channelSelect` dropdowns.
|
|
66
|
+
*/
|
|
67
|
+
export declare function validateChannel(channel: Channel): Diagnostic[];
|
|
68
|
+
/**
|
|
69
|
+
* Compute diagnostics for a single memory primitive. Mirrors validateChannel:
|
|
70
|
+
* an empty label is flagged (so memorySelect/memory-refs dropdowns have a
|
|
71
|
+
* non-blank name), then each required parameter for the memory's type is checked.
|
|
72
|
+
*/
|
|
73
|
+
export declare function validateMemory(mem: Memory): Diagnostic[];
|
|
74
|
+
/**
|
|
75
|
+
* Compute diagnostics for a single declared (custom) model. Mirrors
|
|
76
|
+
* validateMemory: an empty label is flagged, then each required parameter for
|
|
77
|
+
* the model's type is checked (LLMModel has none today, so this is label-only).
|
|
78
|
+
*/
|
|
79
|
+
export declare function validateModel(model: Model): Diagnostic[];
|
|
80
|
+
/**
|
|
81
|
+
* Validate a function's bundled output assignments, keyed by `outputId` so a caller
|
|
82
|
+
* can ring the specific row. The single home for this logic — shared by the live
|
|
83
|
+
* config panel, the project-scoped {@link validateFunction}, and the full
|
|
84
|
+
* {@link validateWorkflowState}.
|
|
85
|
+
*
|
|
86
|
+
* Without `availableVariables` (no body scope) it can only flag a *missing*
|
|
87
|
+
* expression (the engine-invariant check). Given the body's variables it also
|
|
88
|
+
* resolves + parses each expression, catching invalid references and type mismatches
|
|
89
|
+
* — the same `resolveExpression`/`parseExpression` path node expression params use.
|
|
90
|
+
*/
|
|
91
|
+
export declare function validateFunctionOutputs(outputs: readonly OutputAssignment[], availableVariables?: Record<string, Variable>): Diagnostic[];
|
|
92
|
+
/**
|
|
93
|
+
* Compute diagnostics for a single function declaration (the project-scoped
|
|
94
|
+
* signature + bundled output assignments, independent of the body canvas). Flags an
|
|
95
|
+
* empty name and any output without an assigned expression. Expression *validity*
|
|
96
|
+
* (which needs the body's variable scope) is left to the scoped callers — the config
|
|
97
|
+
* panel and validateWorkflowState (keyed by the function's canvas).
|
|
98
|
+
*/
|
|
99
|
+
export declare function validateFunction(fn: FunctionDeclaration, availableVariables?: Record<string, Variable>): Diagnostic[];
|
|
100
|
+
export interface CanvasValidationResult {
|
|
101
|
+
canvasId: string;
|
|
102
|
+
canvasLabel: string;
|
|
103
|
+
diagnostics: Diagnostic[];
|
|
104
|
+
errorCount: number;
|
|
105
|
+
warningCount: number;
|
|
106
|
+
}
|
|
107
|
+
export interface ValidationResult {
|
|
108
|
+
canvases: CanvasValidationResult[];
|
|
109
|
+
/** Project-scoped channel diagnostics (no canvasId). */
|
|
110
|
+
channelDiagnostics: Diagnostic[];
|
|
111
|
+
/** Project-scoped memory diagnostics (no canvasId). */
|
|
112
|
+
memoryDiagnostics: Diagnostic[];
|
|
113
|
+
/** Project-scoped declared-model diagnostics (no canvasId). */
|
|
114
|
+
modelDiagnostics: Diagnostic[];
|
|
115
|
+
totalErrors: number;
|
|
116
|
+
totalWarnings: number;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Headless full-project validation. Pure: depends only on the passed
|
|
120
|
+
* {@link Workflow} (the in-memory domain shape) — no Zustand stores, no
|
|
121
|
+
* React, no DOM. Runnable in Node, a CLI, or a Claude Code skill.
|
|
122
|
+
*
|
|
123
|
+
* Two producers feed this: the editor reads its live stores into a
|
|
124
|
+
* `Workflow` literal; the CLI calls `deserialize(apiWorkflow)` from
|
|
125
|
+
* `../workflow/serialization` to convert the api JSON into this shape.
|
|
126
|
+
*/
|
|
127
|
+
export declare function validateWorkflowState(state: Workflow): ValidationResult;
|
|
128
|
+
//# sourceMappingURL=diagnostics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../src/diagnostics/diagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGxD,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGlD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAM5C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAKtC,OAAO,KAAK,EAAE,mBAAmB,EAAgB,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEvF,OAAO,EAAkB,KAAK,QAAQ,EAAe,MAAM,sBAAsB,CAAC;AAMlF,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,SAAS,CAAC;AAErD,MAAM,MAAM,kBAAkB,GAC1B,wBAAwB,GACxB,oBAAoB,GACpB,mBAAmB,G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