@foresthubai/workflow-cli 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.
@@ -0,0 +1,909 @@
1
+ openapi: 3.0.3
2
+ info:
3
+ title: ForestHub Workflow Contract
4
+ version: 1.0.0
5
+ description: OpenAPI schema definition for the ForestHub workflow format.
6
+
7
+ components:
8
+ schemas:
9
+ DataType:
10
+ type: string
11
+ enum: [int, float, bool, string]
12
+
13
+ SignalType:
14
+ type: string
15
+ enum: [digital, analog]
16
+
17
+ EdgeType:
18
+ type: string
19
+ enum: [control, tool, agentTask, agentChoice, agentDelegate]
20
+
21
+ NodePosition:
22
+ type: object
23
+ required: [x, y]
24
+ properties:
25
+ x:
26
+ type: number
27
+ y:
28
+ type: number
29
+
30
+ Workflow:
31
+ type: object
32
+ description: Workflow represents the deployment format of a project, passed to agents.
33
+ required:
34
+ [
35
+ schemaVersion,
36
+ nodes,
37
+ edges,
38
+ functions,
39
+ declaredVariables,
40
+ channels,
41
+ memory,
42
+ models,
43
+ ]
44
+ properties:
45
+ schemaVersion:
46
+ type: integer
47
+ format: int32
48
+ minimum: 1
49
+ description: Monotonic version of the persisted workflow format, bumped when the serialized shape changes.
50
+ nodes:
51
+ type: array
52
+ items:
53
+ $ref: "#/components/schemas/Node"
54
+ edges:
55
+ type: array
56
+ items:
57
+ $ref: "#/components/schemas/Edge"
58
+ functions:
59
+ type: array
60
+ items:
61
+ $ref: "#/components/schemas/Function"
62
+ declaredVariables:
63
+ type: array
64
+ items:
65
+ $ref: "#/components/schemas/Variable"
66
+ channels:
67
+ type: array
68
+ items:
69
+ $ref: "#/components/schemas/Channel"
70
+ memory:
71
+ type: array
72
+ items:
73
+ $ref: "#/components/schemas/Memory"
74
+ models:
75
+ type: array
76
+ description: Declared custom/self-hosted models; referenced from nodes by id. Static catalog models need no declaration.
77
+ items:
78
+ $ref: "#/components/schemas/Model"
79
+
80
+ Edge:
81
+ type: object
82
+ required: [id, type, from, to]
83
+ properties:
84
+ id:
85
+ type: string
86
+ type:
87
+ $ref: "#/components/schemas/EdgeType"
88
+ from:
89
+ $ref: "#/components/schemas/Vertex"
90
+ to:
91
+ $ref: "#/components/schemas/Vertex"
92
+ prompt:
93
+ $ref: "#/components/schemas/Expression"
94
+ description: >
95
+ Prompt expression sent to the agent. Present on `agentTask` (required)
96
+ and `agentDelegate` (optional).
97
+ description:
98
+ type: string
99
+ description: LLM-readable explanation of when the edge should fire. Present on `agentChoice` and `agentDelegate`.
100
+
101
+ Vertex:
102
+ type: object
103
+ required:
104
+ - nodeId
105
+ - port
106
+ properties:
107
+ nodeId:
108
+ type: string
109
+ port:
110
+ type: string
111
+
112
+ Function:
113
+ type: object
114
+ required:
115
+ [functionInfo, outputAssignments, nodes, edges, declaredVariables]
116
+ properties:
117
+ functionInfo:
118
+ $ref: "#/components/schemas/FunctionInfo"
119
+ outputAssignments:
120
+ type: object
121
+ description: Maps return variable uid to its Expression
122
+ additionalProperties:
123
+ $ref: "#/components/schemas/Expression"
124
+ nodes:
125
+ type: array
126
+ items:
127
+ $ref: "#/components/schemas/Node"
128
+ edges:
129
+ type: array
130
+ items:
131
+ $ref: "#/components/schemas/Edge"
132
+ declaredVariables:
133
+ type: array
134
+ items:
135
+ $ref: "#/components/schemas/Variable"
136
+
137
+ FunctionInfo:
138
+ type: object
139
+ required: [id, version, name, arguments, returns]
140
+ properties:
141
+ id:
142
+ type: string
143
+ version:
144
+ type: integer
145
+ format: int32
146
+ minimum: 0
147
+ name:
148
+ type: string
149
+ arguments:
150
+ type: array
151
+ items:
152
+ $ref: "#/components/schemas/Variable"
153
+ returns:
154
+ type: array
155
+ items:
156
+ $ref: "#/components/schemas/Variable"
157
+
158
+ Variable:
159
+ description: A named, typed variable with a stable uid that can be referenced throughout the workflow.
160
+ required: [uid, name, dataType]
161
+ properties:
162
+ uid:
163
+ type: string
164
+ description: Stable identifier that survives renames
165
+ name:
166
+ type: string
167
+ dataType:
168
+ $ref: "#/components/schemas/DataType"
169
+ initialValue:
170
+ description: Initial value matching the dataType (number, boolean, or string). Only used by declared variables.
171
+
172
+ Expression:
173
+ type: object
174
+ required: [expression, references, dataType]
175
+ properties:
176
+ expression:
177
+ type: string
178
+ references:
179
+ description: A list of referenced variable IDs used in the expression
180
+ type: array
181
+ items:
182
+ $ref: "#/components/schemas/Reference"
183
+ dataType:
184
+ $ref: "#/components/schemas/DataType"
185
+
186
+ Reference:
187
+ type: object
188
+ required: [srcId, varId]
189
+ properties:
190
+ srcId:
191
+ type: string
192
+ varId:
193
+ type: string
194
+
195
+ OutputBinding:
196
+ type: object
197
+ required: [active, mode]
198
+ properties:
199
+ active:
200
+ type: boolean
201
+ description: Discard the output if false; route it according to `mode` if true
202
+ mode:
203
+ type: string
204
+ enum: [emit, assign]
205
+ # mode=emit
206
+ name:
207
+ type: string
208
+ description: Variable name (when mode=emit)
209
+ # mode=assign
210
+ target:
211
+ $ref: "#/components/schemas/Reference"
212
+ description: Existing variable to route to (when mode=assign)
213
+
214
+ OutputDeclaration:
215
+ type: object
216
+ required: [mode, name, dataType]
217
+ properties:
218
+ mode:
219
+ type: string
220
+ enum: [emit, assign]
221
+ name:
222
+ type: string
223
+ description: JSON property name of the declared output
224
+ dataType:
225
+ $ref: "#/components/schemas/DataType"
226
+ # mode=emit
227
+ uid:
228
+ type: string
229
+ description: New variable uid (when mode=emit)
230
+ # mode=assign
231
+ target:
232
+ $ref: "#/components/schemas/Reference"
233
+ description: Existing variable to route to (when mode=assign)
234
+
235
+ # ====== Memory ======
236
+
237
+ Memory:
238
+ oneOf:
239
+ - $ref: "#/components/schemas/MemoryFile"
240
+ - $ref: "#/components/schemas/VectorDatabase"
241
+ discriminator:
242
+ propertyName: type
243
+ mapping:
244
+ MemoryFile: "#/components/schemas/MemoryFile"
245
+ VectorDatabase: "#/components/schemas/VectorDatabase"
246
+
247
+ MemoryFile:
248
+ type: object
249
+ description: One .md file that agent nodes can read and write to.
250
+ required: [type, id, label, description, content]
251
+ properties:
252
+ type: { type: string, enum: [MemoryFile] }
253
+ id:
254
+ type: string
255
+ description: Stable identifier that survives renames; referenced from MemoryRef.
256
+ label:
257
+ type: string
258
+ description: Display name. Unique per agent (LLM tool enums use it).
259
+ description:
260
+ type: string
261
+ content:
262
+ type: string
263
+ maxSizeBytes:
264
+ type: integer
265
+ nullable: true
266
+ description: Byte cap; null means unlimited.
267
+
268
+ VectorDatabase:
269
+ type: object
270
+ description: A vector database for retrieval-augmented generation (RAG).
271
+ required: [type, id, label]
272
+ properties:
273
+ type: { type: string, enum: [VectorDatabase] }
274
+ id:
275
+ type: string
276
+ description: Stable identifier; referenced from Retriever nodes.
277
+ label:
278
+ type: string
279
+ description: Display name.
280
+ description:
281
+ type: string
282
+
283
+ MemoryRef:
284
+ type: object
285
+ description: Reference from an LLM agent node to a declared MemoryFile with an access mode.
286
+ required: [id, mode]
287
+ properties:
288
+ id:
289
+ type: string
290
+ description: id of the referenced MemoryFile.
291
+ mode:
292
+ type: string
293
+ enum: [r, rw]
294
+ description: r = read-only; rw = read + write.
295
+
296
+ # ====== Models ======
297
+
298
+ ModelCapability:
299
+ type: string
300
+ enum:
301
+ [
302
+ chat,
303
+ embedding,
304
+ function_call,
305
+ vision,
306
+ fine_tuning,
307
+ reasoning,
308
+ classification,
309
+ code,
310
+ ]
311
+
312
+ Model:
313
+ oneOf:
314
+ - $ref: "#/components/schemas/LLMModel"
315
+ discriminator:
316
+ propertyName: type
317
+ mapping:
318
+ LLMModel: "#/components/schemas/LLMModel"
319
+
320
+ LLMModel:
321
+ type: object
322
+ description: A custom or self-hosted language model that agent nodes can reference.
323
+ required: [type, id, label, capabilities]
324
+ properties:
325
+ type: { type: string, enum: [LLMModel] }
326
+ id:
327
+ type: string
328
+ description: Stable identifier; this is the ModelID nodes reference.
329
+ label:
330
+ type: string
331
+ description: Display name.
332
+ capabilities:
333
+ type: array
334
+ description: Capabilities this model supports (used to filter model pickers).
335
+ items:
336
+ $ref: "#/components/schemas/ModelCapability"
337
+
338
+ # ====== Nodes ======
339
+
340
+ Node:
341
+ oneOf:
342
+ - $ref: "#/components/schemas/ReadPinNode"
343
+ - $ref: "#/components/schemas/WritePinNode"
344
+ - $ref: "#/components/schemas/AgentNode"
345
+ - $ref: "#/components/schemas/IfNode"
346
+ - $ref: "#/components/schemas/SerialReadNode"
347
+ - $ref: "#/components/schemas/SerialWriteNode"
348
+ - $ref: "#/components/schemas/RetrieverNode"
349
+ - $ref: "#/components/schemas/WebFetchNode"
350
+ - $ref: "#/components/schemas/FunctionCallNode"
351
+ - $ref: "#/components/schemas/OnFunctionCallNode"
352
+ - $ref: "#/components/schemas/DelayNode"
353
+ - $ref: "#/components/schemas/TickerNode"
354
+ - $ref: "#/components/schemas/AlarmNode"
355
+ - $ref: "#/components/schemas/WebSearchToolNode"
356
+ - $ref: "#/components/schemas/OnStartupNode"
357
+ - $ref: "#/components/schemas/OnPinEdgeNode"
358
+ - $ref: "#/components/schemas/OnSerialReceiveNode"
359
+ - $ref: "#/components/schemas/OnThresholdNode"
360
+ - $ref: "#/components/schemas/SetVariableNode"
361
+ - $ref: "#/components/schemas/MqttPublishNode"
362
+ - $ref: "#/components/schemas/OnMqttMessageNode"
363
+ discriminator:
364
+ propertyName: type
365
+ mapping:
366
+ ReadPin: "#/components/schemas/ReadPinNode"
367
+ WritePin: "#/components/schemas/WritePinNode"
368
+ Agent: "#/components/schemas/AgentNode"
369
+ If: "#/components/schemas/IfNode"
370
+ SerialRead: "#/components/schemas/SerialReadNode"
371
+ SerialWrite: "#/components/schemas/SerialWriteNode"
372
+ Retriever: "#/components/schemas/RetrieverNode"
373
+ WebFetch: "#/components/schemas/WebFetchNode"
374
+ FunctionCall: "#/components/schemas/FunctionCallNode"
375
+ OnFunctionCall: "#/components/schemas/OnFunctionCallNode"
376
+ Delay: "#/components/schemas/DelayNode"
377
+ Ticker: "#/components/schemas/TickerNode"
378
+ Alarm: "#/components/schemas/AlarmNode"
379
+ WebSearchTool: "#/components/schemas/WebSearchToolNode"
380
+ OnStartup: "#/components/schemas/OnStartupNode"
381
+ OnPinEdge: "#/components/schemas/OnPinEdgeNode"
382
+ OnSerialReceive: "#/components/schemas/OnSerialReceiveNode"
383
+ OnThreshold: "#/components/schemas/OnThresholdNode"
384
+ SetVariable: "#/components/schemas/SetVariableNode"
385
+ MqttPublish: "#/components/schemas/MqttPublishNode"
386
+ OnMqttMessage: "#/components/schemas/OnMqttMessageNode"
387
+
388
+ WebSearchToolNode:
389
+ type: object
390
+ required: [id, type, arguments, position]
391
+ properties:
392
+ id: { type: string }
393
+ type: { type: string, enum: [WebSearchTool] }
394
+ label: { type: string }
395
+ position: { $ref: "#/components/schemas/NodePosition" }
396
+ arguments:
397
+ type: object
398
+ properties:
399
+ maxResults:
400
+ type: integer
401
+ description: Maximum number of search results to return per call. Defaults to 5 when omitted or non-positive. Capped at 20.
402
+ minimum: 1
403
+
404
+ DelayNode:
405
+ type: object
406
+ required: [id, type, arguments, position]
407
+ properties:
408
+ id: { type: string }
409
+ type: { type: string, enum: [Delay] }
410
+ label: { type: string }
411
+ position: { $ref: "#/components/schemas/NodePosition" }
412
+ arguments:
413
+ type: object
414
+ properties:
415
+ delayMs:
416
+ type: integer
417
+ description: Time in milliseconds to pause execution
418
+
419
+ TickerNode:
420
+ type: object
421
+ required: [id, type, arguments, position]
422
+ properties:
423
+ id: { type: string }
424
+ type: { type: string, enum: [Ticker] }
425
+ label: { type: string }
426
+ position: { $ref: "#/components/schemas/NodePosition" }
427
+ arguments:
428
+ type: object
429
+ required: [intervalUnit]
430
+ properties:
431
+ intervalValue:
432
+ type: integer
433
+ description: How many units between ticks
434
+ intervalUnit:
435
+ type: string
436
+ enum: [milliseconds, seconds, minutes, hours]
437
+ description: Time unit for the interval
438
+
439
+ AlarmNode:
440
+ type: object
441
+ required: [id, type, arguments, position]
442
+ properties:
443
+ id: { type: string }
444
+ type: { type: string, enum: [Alarm] }
445
+ label: { type: string }
446
+ position: { $ref: "#/components/schemas/NodePosition" }
447
+ arguments:
448
+ type: object
449
+ required: [days]
450
+ properties:
451
+ time:
452
+ type: string
453
+ description: "Time of day to fire (HH:MM, 24h format)"
454
+ days:
455
+ type: array
456
+ items:
457
+ type: string
458
+ description: "Days of the week to fire on (empty = every day)"
459
+
460
+ FunctionCallNode:
461
+ type: object
462
+ required: [id, type, arguments, position, functionId]
463
+ properties:
464
+ id: { type: string }
465
+ type: { type: string, enum: [FunctionCall] }
466
+ label: { type: string }
467
+ position: { $ref: "#/components/schemas/NodePosition" }
468
+ functionId:
469
+ type: string
470
+ description: Id of the function this node calls. The signature is resolved from the workflow's functions table.
471
+ arguments:
472
+ type: object
473
+ properties:
474
+ inputBindings:
475
+ type: object
476
+ additionalProperties:
477
+ $ref: "#/components/schemas/Expression"
478
+ outputBindings:
479
+ type: object
480
+ additionalProperties:
481
+ $ref: "#/components/schemas/OutputBinding"
482
+ toolDescription:
483
+ type: string
484
+ description: >
485
+ Description exposed to the LLM when this function is wired as
486
+ a tool. Ignored in exec mode.
487
+
488
+ OnFunctionCallNode:
489
+ type: object
490
+ required: [id, type, position]
491
+ properties:
492
+ id: { type: string }
493
+ type: { type: string, enum: [OnFunctionCall] }
494
+ label: { type: string }
495
+ position: { $ref: "#/components/schemas/NodePosition" }
496
+
497
+ OnStartupNode:
498
+ type: object
499
+ required: [id, type, position]
500
+ properties:
501
+ id: { type: string }
502
+ type: { type: string, enum: [OnStartup] }
503
+ label: { type: string }
504
+ position: { $ref: "#/components/schemas/NodePosition" }
505
+
506
+ OnPinEdgeNode:
507
+ type: object
508
+ required: [id, type, arguments, position]
509
+ properties:
510
+ id: { type: string }
511
+ type: { type: string, enum: [OnPinEdge] }
512
+ label: { type: string }
513
+ position: { $ref: "#/components/schemas/NodePosition" }
514
+ arguments:
515
+ type: object
516
+ required: [edge]
517
+ properties:
518
+ pinReference:
519
+ type: string
520
+ description: IO variable ID of the digital pin to watch
521
+ edge:
522
+ type: string
523
+ enum: [rising, falling, both]
524
+ description: Edge transition that fires the trigger
525
+
526
+ OnSerialReceiveNode:
527
+ type: object
528
+ required: [id, type, arguments, position]
529
+ properties:
530
+ id: { type: string }
531
+ type: { type: string, enum: [OnSerialReceive] }
532
+ label: { type: string }
533
+ position: { $ref: "#/components/schemas/NodePosition" }
534
+ arguments:
535
+ type: object
536
+ required: [output]
537
+ properties:
538
+ portReference:
539
+ type: string
540
+ description: Reference to an IO variable ID (the serial port to listen on)
541
+ output:
542
+ $ref: "#/components/schemas/OutputBinding"
543
+
544
+ OnThresholdNode:
545
+ type: object
546
+ required: [id, type, arguments, position]
547
+ properties:
548
+ id: { type: string }
549
+ type: { type: string, enum: [OnThreshold] }
550
+ label: { type: string }
551
+ position: { $ref: "#/components/schemas/NodePosition" }
552
+ arguments:
553
+ type: object
554
+ required: [direction, output]
555
+ properties:
556
+ variable:
557
+ $ref: "#/components/schemas/Reference"
558
+ description: Numeric variable to watch for threshold crossings
559
+ threshold:
560
+ type: number
561
+ description: Value the variable crosses to fire the trigger
562
+ direction:
563
+ type: string
564
+ enum: [rising, falling, both]
565
+ description: Crossing direction to fire on (default both)
566
+ deadband:
567
+ type: number
568
+ description: Hysteresis band width around threshold; 0 disables (default 0)
569
+ output:
570
+ $ref: "#/components/schemas/OutputBinding"
571
+ description: Optional binding for the triggering value
572
+
573
+ RetrieverNode:
574
+ type: object
575
+ required: [id, type, arguments, position]
576
+ properties:
577
+ id: { type: string }
578
+ type: { type: string, enum: [Retriever] }
579
+ label: { type: string }
580
+ position: { $ref: "#/components/schemas/NodePosition" }
581
+ arguments:
582
+ type: object
583
+ required: [query, output]
584
+ properties:
585
+ memoryReference:
586
+ type: string
587
+ description: Reference to a declared VectorDatabase memory id
588
+ topK:
589
+ type: integer
590
+ description: Number of results to return
591
+ query:
592
+ $ref: "#/components/schemas/Expression"
593
+ description: Search query expression
594
+ output:
595
+ $ref: "#/components/schemas/OutputBinding"
596
+ toolDescription:
597
+ type: string
598
+ description: Description exposed to the LLM when this node is wired as a tool. Ignored in exec mode.
599
+
600
+ WebFetchNode:
601
+ type: object
602
+ required: [id, type, arguments, position]
603
+ properties:
604
+ id: { type: string }
605
+ type: { type: string, enum: [WebFetch] }
606
+ label: { type: string }
607
+ position: { $ref: "#/components/schemas/NodePosition" }
608
+ arguments:
609
+ type: object
610
+ required: [url, output]
611
+ properties:
612
+ url:
613
+ $ref: "#/components/schemas/Expression"
614
+ description: URL expression to fetch (http or https)
615
+ maxChars:
616
+ type: integer
617
+ description: Maximum characters of extracted text to return. Defaults to 50000 when omitted or non-positive.
618
+ minimum: 1
619
+ output:
620
+ $ref: "#/components/schemas/OutputBinding"
621
+
622
+ ReadPinNode:
623
+ type: object
624
+ required: [id, type, arguments, position]
625
+ properties:
626
+ id: { type: string }
627
+ type: { type: string, enum: [ReadPin] }
628
+ label: { type: string }
629
+ position: { $ref: "#/components/schemas/NodePosition" }
630
+ arguments:
631
+ type: object
632
+ required: [signalType, output]
633
+ properties:
634
+ pinReference:
635
+ type: string
636
+ description: Reference to an IO variable ID
637
+ signalType:
638
+ $ref: "#/components/schemas/SignalType"
639
+ output:
640
+ $ref: "#/components/schemas/OutputBinding"
641
+ toolDescription:
642
+ type: string
643
+ description: Description exposed to the LLM when this node is wired as a tool. Ignored in exec mode.
644
+
645
+ WritePinNode:
646
+ type: object
647
+ required: [id, type, arguments, position]
648
+ properties:
649
+ id: { type: string }
650
+ type: { type: string, enum: [WritePin] }
651
+ label: { type: string }
652
+ position: { $ref: "#/components/schemas/NodePosition" }
653
+ arguments:
654
+ type: object
655
+ required: [signalType, value]
656
+ properties:
657
+ pinReference:
658
+ type: string
659
+ description: Reference to an IO variable ID
660
+ signalType:
661
+ $ref: "#/components/schemas/SignalType"
662
+ value:
663
+ $ref: "#/components/schemas/Expression"
664
+
665
+ AgentNode:
666
+ type: object
667
+ required: [id, type, arguments, position]
668
+ properties:
669
+ id: { type: string }
670
+ type: { type: string, enum: [Agent] }
671
+ label: { type: string }
672
+ position: { $ref: "#/components/schemas/NodePosition" }
673
+ arguments:
674
+ type: object
675
+ required: [answer, outputDeclarations, memoryRefs]
676
+ properties:
677
+ name:
678
+ type: string
679
+ description: Name of the agent
680
+ model:
681
+ type: string
682
+ instructions:
683
+ type: string
684
+ maxTurns:
685
+ type: integer
686
+ description: Maximum number of agent runner turns
687
+ answer:
688
+ $ref: "#/components/schemas/OutputBinding"
689
+ outputDeclarations:
690
+ type: array
691
+ description: Ordered list of structured-output declarations. Names must be unique within this list
692
+ items:
693
+ $ref: "#/components/schemas/OutputDeclaration"
694
+ memoryRefs:
695
+ type: array
696
+ description: Memory files this agent can access, each with an access mode.
697
+ items:
698
+ $ref: "#/components/schemas/MemoryRef"
699
+ toolDescription:
700
+ type: string
701
+ description: Description exposed to the LLM when this node is wired as a tool. Ignored in exec mode.
702
+
703
+ IfNode:
704
+ type: object
705
+ required: [id, type, arguments, position]
706
+ properties:
707
+ id: { type: string }
708
+ type: { type: string, enum: [If] }
709
+ label: { type: string }
710
+ position: { $ref: "#/components/schemas/NodePosition" }
711
+ arguments:
712
+ type: object
713
+ required: [condition]
714
+ properties:
715
+ condition:
716
+ $ref: "#/components/schemas/Expression"
717
+
718
+ SerialReadNode:
719
+ type: object
720
+ required: [id, type, arguments, position]
721
+ properties:
722
+ id: { type: string }
723
+ type: { type: string, enum: [SerialRead] }
724
+ label: { type: string }
725
+ position: { $ref: "#/components/schemas/NodePosition" }
726
+ arguments:
727
+ type: object
728
+ required: [output]
729
+ properties:
730
+ portReference:
731
+ type: string
732
+ description: Reference to an UART ID (the serial port to read from)
733
+ prompt:
734
+ type: string
735
+ output:
736
+ $ref: "#/components/schemas/OutputBinding"
737
+
738
+ SerialWriteNode:
739
+ type: object
740
+ required: [id, type, arguments, position]
741
+ properties:
742
+ id: { type: string }
743
+ type: { type: string, enum: [SerialWrite] }
744
+ label: { type: string }
745
+ position: { $ref: "#/components/schemas/NodePosition" }
746
+ arguments:
747
+ type: object
748
+ required: [value]
749
+ properties:
750
+ portReference:
751
+ type: string
752
+ description: Reference to a UART channel ID (the serial port to write to)
753
+ value:
754
+ $ref: "#/components/schemas/Expression"
755
+
756
+ SetVariableNode:
757
+ type: object
758
+ required: [id, type, arguments, position]
759
+ properties:
760
+ id: { type: string }
761
+ type: { type: string, enum: [SetVariable] }
762
+ label: { type: string }
763
+ position: { $ref: "#/components/schemas/NodePosition" }
764
+ arguments:
765
+ type: object
766
+ required: [value]
767
+ properties:
768
+ variable:
769
+ $ref: "#/components/schemas/Reference"
770
+ value:
771
+ $ref: "#/components/schemas/Expression"
772
+
773
+ MqttPublishNode:
774
+ type: object
775
+ required: [id, type, arguments, position]
776
+ properties:
777
+ id: { type: string }
778
+ type: { type: string, enum: [MqttPublish] }
779
+ label: { type: string }
780
+ position: { $ref: "#/components/schemas/NodePosition" }
781
+ arguments:
782
+ type: object
783
+ required: [dataType, value, qos, retain]
784
+ properties:
785
+ channelReference:
786
+ type: string
787
+ description: Reference to an MQTT channel ID (the channel carries the topic; resolved to a broker at deploy time)
788
+ dataType:
789
+ $ref: "#/components/schemas/DataType"
790
+ value:
791
+ $ref: "#/components/schemas/Expression"
792
+ qos:
793
+ type: integer
794
+ enum: [0, 1, 2]
795
+ description: MQTT Quality of Service level
796
+ retain:
797
+ type: boolean
798
+ description: Whether the broker should retain the message
799
+
800
+ OnMqttMessageNode:
801
+ type: object
802
+ required: [id, type, arguments, position]
803
+ properties:
804
+ id: { type: string }
805
+ type: { type: string, enum: [OnMqttMessage] }
806
+ label: { type: string }
807
+ position: { $ref: "#/components/schemas/NodePosition" }
808
+ arguments:
809
+ type: object
810
+ required: [dataType, output]
811
+ properties:
812
+ channelReference:
813
+ type: string
814
+ description: Reference to an MQTT channel ID (the channel carries the topic filter; resolved to a broker at deploy time)
815
+ dataType:
816
+ $ref: "#/components/schemas/DataType"
817
+ output:
818
+ $ref: "#/components/schemas/OutputBinding"
819
+
820
+ # ====== Channels ======
821
+
822
+ Channel:
823
+ oneOf:
824
+ - $ref: "#/components/schemas/GPIOINChannel"
825
+ - $ref: "#/components/schemas/GPIOOUTChannel"
826
+ - $ref: "#/components/schemas/ADCChannel"
827
+ - $ref: "#/components/schemas/PWMChannel"
828
+ - $ref: "#/components/schemas/DACChannel"
829
+ - $ref: "#/components/schemas/UARTChannel"
830
+ - $ref: "#/components/schemas/MQTTChannel"
831
+ discriminator:
832
+ propertyName: type
833
+ mapping:
834
+ GPIOIN: "#/components/schemas/GPIOINChannel"
835
+ GPIOOUT: "#/components/schemas/GPIOOUTChannel"
836
+ ADC: "#/components/schemas/ADCChannel"
837
+ PWM: "#/components/schemas/PWMChannel"
838
+ DAC: "#/components/schemas/DACChannel"
839
+ UART: "#/components/schemas/UARTChannel"
840
+ MQTT: "#/components/schemas/MQTTChannel"
841
+
842
+ GPIOINChannel:
843
+ type: object
844
+ required: [type, id, label, bias, debounceMs]
845
+ properties:
846
+ type: { type: string, enum: [GPIOIN] }
847
+ id: { type: string }
848
+ label: { type: string }
849
+ bias:
850
+ type: string
851
+ enum: [none, pullup, pulldown]
852
+ description: Pin bias configuration
853
+ debounceMs:
854
+ type: integer
855
+ description: Debounce window in milliseconds
856
+
857
+ GPIOOUTChannel:
858
+ type: object
859
+ required: [type, id, label]
860
+ properties:
861
+ type: { type: string, enum: [GPIOOUT] }
862
+ id: { type: string }
863
+ label: { type: string }
864
+
865
+ ADCChannel:
866
+ type: object
867
+ required: [type, id, label]
868
+ properties:
869
+ type: { type: string, enum: [ADC] }
870
+ id: { type: string }
871
+ label: { type: string }
872
+
873
+ PWMChannel:
874
+ type: object
875
+ required: [type, id, label, frequency]
876
+ properties:
877
+ type: { type: string, enum: [PWM] }
878
+ id: { type: string }
879
+ label: { type: string }
880
+ frequency:
881
+ type: integer
882
+ description: PWM frequency in Hz
883
+
884
+ DACChannel:
885
+ type: object
886
+ required: [type, id, label]
887
+ properties:
888
+ type: { type: string, enum: [DAC] }
889
+ id: { type: string }
890
+ label: { type: string }
891
+
892
+ UARTChannel:
893
+ type: object
894
+ required: [type, id, label]
895
+ properties:
896
+ type: { type: string, enum: [UART] }
897
+ id: { type: string }
898
+ label: { type: string }
899
+
900
+ MQTTChannel:
901
+ type: object
902
+ required: [type, id, label, topic]
903
+ properties:
904
+ type: { type: string, enum: [MQTT] }
905
+ id: { type: string }
906
+ label: { type: string }
907
+ topic:
908
+ type: string
909
+ description: Topic this channel publishes to / subscribes on. The engine wraps it with the bound broker's prefix at runtime.