@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.
Files changed (339) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +14 -0
  3. package/README.md +63 -0
  4. package/dist/api/index.d.ts +7 -0
  5. package/dist/api/index.d.ts.map +1 -0
  6. package/dist/api/index.js +2 -0
  7. package/dist/api/index.js.map +1 -0
  8. package/dist/api/workflow.d.ts +607 -0
  9. package/dist/api/workflow.d.ts.map +1 -0
  10. package/dist/api/workflow.js +6 -0
  11. package/dist/api/workflow.js.map +1 -0
  12. package/dist/channel/Channel.d.ts +10 -0
  13. package/dist/channel/Channel.d.ts.map +1 -0
  14. package/dist/channel/Channel.js +2 -0
  15. package/dist/channel/Channel.js.map +1 -0
  16. package/dist/channel/ChannelDefinition.d.ts +27 -0
  17. package/dist/channel/ChannelDefinition.d.ts.map +1 -0
  18. package/dist/channel/ChannelDefinition.js +50 -0
  19. package/dist/channel/ChannelDefinition.js.map +1 -0
  20. package/dist/channel/index.d.ts +7 -0
  21. package/dist/channel/index.d.ts.map +1 -0
  22. package/dist/channel/index.js +4 -0
  23. package/dist/channel/index.js.map +1 -0
  24. package/dist/channel/serialization.d.ts +17 -0
  25. package/dist/channel/serialization.d.ts.map +1 -0
  26. package/dist/channel/serialization.js +63 -0
  27. package/dist/channel/serialization.js.map +1 -0
  28. package/dist/deploy/index.d.ts +2 -0
  29. package/dist/deploy/index.d.ts.map +1 -0
  30. package/dist/deploy/index.js +2 -0
  31. package/dist/deploy/index.js.map +1 -0
  32. package/dist/deploy/requirements.d.ts +17 -0
  33. package/dist/deploy/requirements.d.ts.map +1 -0
  34. package/dist/deploy/requirements.js +41 -0
  35. package/dist/deploy/requirements.js.map +1 -0
  36. package/dist/diagnostics/__fixtures__/diagnosticFixtures.d.ts +28 -0
  37. package/dist/diagnostics/__fixtures__/diagnosticFixtures.d.ts.map +1 -0
  38. package/dist/diagnostics/__fixtures__/diagnosticFixtures.js +125 -0
  39. package/dist/diagnostics/__fixtures__/diagnosticFixtures.js.map +1 -0
  40. package/dist/diagnostics/diagnostics.d.ts +128 -0
  41. package/dist/diagnostics/diagnostics.d.ts.map +1 -0
  42. package/dist/diagnostics/diagnostics.js +783 -0
  43. package/dist/diagnostics/diagnostics.js.map +1 -0
  44. package/dist/diagnostics/index.d.ts +3 -0
  45. package/dist/diagnostics/index.d.ts.map +1 -0
  46. package/dist/diagnostics/index.js +2 -0
  47. package/dist/diagnostics/index.js.map +1 -0
  48. package/dist/edge/Edge.d.ts +22 -0
  49. package/dist/edge/Edge.d.ts.map +1 -0
  50. package/dist/edge/Edge.js +2 -0
  51. package/dist/edge/Edge.js.map +1 -0
  52. package/dist/edge/EdgeDefinition.d.ts +10 -0
  53. package/dist/edge/EdgeDefinition.d.ts.map +1 -0
  54. package/dist/edge/EdgeDefinition.js +36 -0
  55. package/dist/edge/EdgeDefinition.js.map +1 -0
  56. package/dist/edge/EdgeType.d.ts +6 -0
  57. package/dist/edge/EdgeType.d.ts.map +1 -0
  58. package/dist/edge/EdgeType.js +7 -0
  59. package/dist/edge/EdgeType.js.map +1 -0
  60. package/dist/edge/index.d.ts +6 -0
  61. package/dist/edge/index.d.ts.map +1 -0
  62. package/dist/edge/index.js +6 -0
  63. package/dist/edge/index.js.map +1 -0
  64. package/dist/edge/serialization.d.ts +18 -0
  65. package/dist/edge/serialization.d.ts.map +1 -0
  66. package/dist/edge/serialization.js +76 -0
  67. package/dist/edge/serialization.js.map +1 -0
  68. package/dist/expression/index.d.ts +5 -0
  69. package/dist/expression/index.d.ts.map +1 -0
  70. package/dist/expression/index.js +3 -0
  71. package/dist/expression/index.js.map +1 -0
  72. package/dist/expression/parser.d.ts +14 -0
  73. package/dist/expression/parser.d.ts.map +1 -0
  74. package/dist/expression/parser.js +309 -0
  75. package/dist/expression/parser.js.map +1 -0
  76. package/dist/expression/types.d.ts +11 -0
  77. package/dist/expression/types.d.ts.map +1 -0
  78. package/dist/expression/types.js +20 -0
  79. package/dist/expression/types.js.map +1 -0
  80. package/dist/function/FunctionDeclaration.d.ts +43 -0
  81. package/dist/function/FunctionDeclaration.d.ts.map +1 -0
  82. package/dist/function/FunctionDeclaration.js +17 -0
  83. package/dist/function/FunctionDeclaration.js.map +1 -0
  84. package/dist/function/index.d.ts +4 -0
  85. package/dist/function/index.d.ts.map +1 -0
  86. package/dist/function/index.js +3 -0
  87. package/dist/function/index.js.map +1 -0
  88. package/dist/function/serialization.d.ts +20 -0
  89. package/dist/function/serialization.d.ts.map +1 -0
  90. package/dist/function/serialization.js +26 -0
  91. package/dist/function/serialization.js.map +1 -0
  92. package/dist/id/index.d.ts +7 -0
  93. package/dist/id/index.d.ts.map +1 -0
  94. package/dist/id/index.js +9 -0
  95. package/dist/id/index.js.map +1 -0
  96. package/dist/index.d.ts +11 -0
  97. package/dist/index.d.ts.map +1 -0
  98. package/dist/index.js +14 -0
  99. package/dist/index.js.map +1 -0
  100. package/dist/memory/Memory.d.ts +12 -0
  101. package/dist/memory/Memory.d.ts.map +1 -0
  102. package/dist/memory/Memory.js +2 -0
  103. package/dist/memory/Memory.js.map +1 -0
  104. package/dist/memory/MemoryDefinition.d.ts +16 -0
  105. package/dist/memory/MemoryDefinition.d.ts.map +1 -0
  106. package/dist/memory/MemoryDefinition.js +2 -0
  107. package/dist/memory/MemoryDefinition.js.map +1 -0
  108. package/dist/memory/MemoryFileDefinition.d.ts +8 -0
  109. package/dist/memory/MemoryFileDefinition.d.ts.map +1 -0
  110. package/dist/memory/MemoryFileDefinition.js +36 -0
  111. package/dist/memory/MemoryFileDefinition.js.map +1 -0
  112. package/dist/memory/MemoryRegistry.d.ts +17 -0
  113. package/dist/memory/MemoryRegistry.d.ts.map +1 -0
  114. package/dist/memory/MemoryRegistry.js +29 -0
  115. package/dist/memory/MemoryRegistry.js.map +1 -0
  116. package/dist/memory/VectorDatabaseDefinition.d.ts +7 -0
  117. package/dist/memory/VectorDatabaseDefinition.d.ts.map +1 -0
  118. package/dist/memory/VectorDatabaseDefinition.js +20 -0
  119. package/dist/memory/VectorDatabaseDefinition.js.map +1 -0
  120. package/dist/memory/index.d.ts +9 -0
  121. package/dist/memory/index.d.ts.map +1 -0
  122. package/dist/memory/index.js +6 -0
  123. package/dist/memory/index.js.map +1 -0
  124. package/dist/memory/serialization.d.ts +11 -0
  125. package/dist/memory/serialization.d.ts.map +1 -0
  126. package/dist/memory/serialization.js +44 -0
  127. package/dist/memory/serialization.js.map +1 -0
  128. package/dist/migration/index.d.ts +5 -0
  129. package/dist/migration/index.d.ts.map +1 -0
  130. package/dist/migration/index.js +4 -0
  131. package/dist/migration/index.js.map +1 -0
  132. package/dist/migration/migrate.d.ts +11 -0
  133. package/dist/migration/migrate.d.ts.map +1 -0
  134. package/dist/migration/migrate.js +52 -0
  135. package/dist/migration/migrate.js.map +1 -0
  136. package/dist/migration/migrations.d.ts +22 -0
  137. package/dist/migration/migrations.d.ts.map +1 -0
  138. package/dist/migration/migrations.js +10 -0
  139. package/dist/migration/migrations.js.map +1 -0
  140. package/dist/migration/version.d.ts +9 -0
  141. package/dist/migration/version.d.ts.map +1 -0
  142. package/dist/migration/version.js +9 -0
  143. package/dist/migration/version.js.map +1 -0
  144. package/dist/model/LLMModelDefinition.d.ts +7 -0
  145. package/dist/model/LLMModelDefinition.d.ts.map +1 -0
  146. package/dist/model/LLMModelDefinition.js +11 -0
  147. package/dist/model/LLMModelDefinition.js.map +1 -0
  148. package/dist/model/Model.d.ts +21 -0
  149. package/dist/model/Model.d.ts.map +1 -0
  150. package/dist/model/Model.js +15 -0
  151. package/dist/model/Model.js.map +1 -0
  152. package/dist/model/ModelDefinition.d.ts +15 -0
  153. package/dist/model/ModelDefinition.d.ts.map +1 -0
  154. package/dist/model/ModelDefinition.js +2 -0
  155. package/dist/model/ModelDefinition.js.map +1 -0
  156. package/dist/model/ModelRegistry.d.ts +17 -0
  157. package/dist/model/ModelRegistry.d.ts.map +1 -0
  158. package/dist/model/ModelRegistry.js +27 -0
  159. package/dist/model/ModelRegistry.js.map +1 -0
  160. package/dist/model/index.d.ts +8 -0
  161. package/dist/model/index.d.ts.map +1 -0
  162. package/dist/model/index.js +5 -0
  163. package/dist/model/index.js.map +1 -0
  164. package/dist/model/serialization.d.ts +8 -0
  165. package/dist/model/serialization.d.ts.map +1 -0
  166. package/dist/model/serialization.js +25 -0
  167. package/dist/model/serialization.js.map +1 -0
  168. package/dist/node/AgentNode.d.ts +21 -0
  169. package/dist/node/AgentNode.d.ts.map +1 -0
  170. package/dist/node/AgentNode.js +60 -0
  171. package/dist/node/AgentNode.js.map +1 -0
  172. package/dist/node/DataNode.d.ts +14 -0
  173. package/dist/node/DataNode.d.ts.map +1 -0
  174. package/dist/node/DataNode.js +26 -0
  175. package/dist/node/DataNode.js.map +1 -0
  176. package/dist/node/FunctionNode.d.ts +24 -0
  177. package/dist/node/FunctionNode.d.ts.map +1 -0
  178. package/dist/node/FunctionNode.js +44 -0
  179. package/dist/node/FunctionNode.js.map +1 -0
  180. package/dist/node/InputNode.d.ts +46 -0
  181. package/dist/node/InputNode.d.ts.map +1 -0
  182. package/dist/node/InputNode.js +133 -0
  183. package/dist/node/InputNode.js.map +1 -0
  184. package/dist/node/LogicNode.d.ts +13 -0
  185. package/dist/node/LogicNode.d.ts.map +1 -0
  186. package/dist/node/LogicNode.js +19 -0
  187. package/dist/node/LogicNode.js.map +1 -0
  188. package/dist/node/MqttNode.d.ts +27 -0
  189. package/dist/node/MqttNode.d.ts.map +1 -0
  190. package/dist/node/MqttNode.js +96 -0
  191. package/dist/node/MqttNode.js.map +1 -0
  192. package/dist/node/Node.d.ts +49 -0
  193. package/dist/node/Node.d.ts.map +1 -0
  194. package/dist/node/Node.js +9 -0
  195. package/dist/node/Node.js.map +1 -0
  196. package/dist/node/NodeDefinition.d.ts +30 -0
  197. package/dist/node/NodeDefinition.d.ts.map +1 -0
  198. package/dist/node/NodeDefinition.js +2 -0
  199. package/dist/node/NodeDefinition.js.map +1 -0
  200. package/dist/node/NodeRegistry.d.ts +19 -0
  201. package/dist/node/NodeRegistry.d.ts.map +1 -0
  202. package/dist/node/NodeRegistry.js +65 -0
  203. package/dist/node/NodeRegistry.js.map +1 -0
  204. package/dist/node/OutputNode.d.ts +23 -0
  205. package/dist/node/OutputNode.d.ts.map +1 -0
  206. package/dist/node/OutputNode.js +62 -0
  207. package/dist/node/OutputNode.js.map +1 -0
  208. package/dist/node/ToolNode.d.ts +12 -0
  209. package/dist/node/ToolNode.d.ts.map +1 -0
  210. package/dist/node/ToolNode.js +18 -0
  211. package/dist/node/ToolNode.js.map +1 -0
  212. package/dist/node/TriggerNode.d.ts +67 -0
  213. package/dist/node/TriggerNode.d.ts.map +1 -0
  214. package/dist/node/TriggerNode.js +172 -0
  215. package/dist/node/TriggerNode.js.map +1 -0
  216. package/dist/node/constants.d.ts +16 -0
  217. package/dist/node/constants.d.ts.map +1 -0
  218. package/dist/node/constants.js +18 -0
  219. package/dist/node/constants.js.map +1 -0
  220. package/dist/node/index.d.ts +12 -0
  221. package/dist/node/index.d.ts.map +1 -0
  222. package/dist/node/index.js +9 -0
  223. package/dist/node/index.js.map +1 -0
  224. package/dist/node/methods.d.ts +73 -0
  225. package/dist/node/methods.d.ts.map +1 -0
  226. package/dist/node/methods.js +261 -0
  227. package/dist/node/methods.js.map +1 -0
  228. package/dist/node/serialization.d.ts +25 -0
  229. package/dist/node/serialization.d.ts.map +1 -0
  230. package/dist/node/serialization.js +525 -0
  231. package/dist/node/serialization.js.map +1 -0
  232. package/dist/parameter/OutputParameter.d.ts +69 -0
  233. package/dist/parameter/OutputParameter.d.ts.map +1 -0
  234. package/dist/parameter/OutputParameter.js +6 -0
  235. package/dist/parameter/OutputParameter.js.map +1 -0
  236. package/dist/parameter/Parameter.d.ts +152 -0
  237. package/dist/parameter/Parameter.d.ts.map +1 -0
  238. package/dist/parameter/Parameter.js +86 -0
  239. package/dist/parameter/Parameter.js.map +1 -0
  240. package/dist/parameter/index.d.ts +5 -0
  241. package/dist/parameter/index.d.ts.map +1 -0
  242. package/dist/parameter/index.js +3 -0
  243. package/dist/parameter/index.js.map +1 -0
  244. package/dist/variable/Variable.d.ts +25 -0
  245. package/dist/variable/Variable.d.ts.map +1 -0
  246. package/dist/variable/Variable.js +2 -0
  247. package/dist/variable/Variable.js.map +1 -0
  248. package/dist/variable/index.d.ts +3 -0
  249. package/dist/variable/index.d.ts.map +1 -0
  250. package/dist/variable/index.js +5 -0
  251. package/dist/variable/index.js.map +1 -0
  252. package/dist/variable/operations.d.ts +37 -0
  253. package/dist/variable/operations.d.ts.map +1 -0
  254. package/dist/variable/operations.js +88 -0
  255. package/dist/variable/operations.js.map +1 -0
  256. package/dist/workflow/Workflow.d.ts +38 -0
  257. package/dist/workflow/Workflow.d.ts.map +1 -0
  258. package/dist/workflow/Workflow.js +8 -0
  259. package/dist/workflow/Workflow.js.map +1 -0
  260. package/dist/workflow/index.d.ts +4 -0
  261. package/dist/workflow/index.d.ts.map +1 -0
  262. package/dist/workflow/index.js +3 -0
  263. package/dist/workflow/index.js.map +1 -0
  264. package/dist/workflow/serialization.d.ts +43 -0
  265. package/dist/workflow/serialization.d.ts.map +1 -0
  266. package/dist/workflow/serialization.js +215 -0
  267. package/dist/workflow/serialization.js.map +1 -0
  268. package/package.json +105 -0
  269. package/src/api/index.ts +11 -0
  270. package/src/api/workflow.ts +607 -0
  271. package/src/channel/Channel.ts +11 -0
  272. package/src/channel/ChannelDefinition.ts +76 -0
  273. package/src/channel/index.ts +6 -0
  274. package/src/channel/serialization.ts +68 -0
  275. package/src/deploy/index.ts +1 -0
  276. package/src/deploy/requirements.test.ts +61 -0
  277. package/src/deploy/requirements.ts +41 -0
  278. package/src/diagnostics/__fixtures__/diagnosticFixtures.ts +158 -0
  279. package/src/diagnostics/diagnostics.test.ts +878 -0
  280. package/src/diagnostics/diagnostics.ts +936 -0
  281. package/src/diagnostics/index.ts +11 -0
  282. package/src/edge/Edge.ts +23 -0
  283. package/src/edge/EdgeDefinition.ts +45 -0
  284. package/src/edge/EdgeType.ts +19 -0
  285. package/src/edge/index.ts +8 -0
  286. package/src/edge/serialization.ts +83 -0
  287. package/src/expression/index.ts +4 -0
  288. package/src/expression/parser.ts +362 -0
  289. package/src/expression/types.ts +30 -0
  290. package/src/function/FunctionDeclaration.ts +54 -0
  291. package/src/function/index.ts +3 -0
  292. package/src/function/serialization.ts +40 -0
  293. package/src/globals.d.ts +9 -0
  294. package/src/id/index.ts +8 -0
  295. package/src/index.ts +22 -0
  296. package/src/memory/Memory.ts +15 -0
  297. package/src/memory/MemoryDefinition.ts +16 -0
  298. package/src/memory/MemoryFileDefinition.ts +37 -0
  299. package/src/memory/MemoryRegistry.ts +35 -0
  300. package/src/memory/VectorDatabaseDefinition.ts +21 -0
  301. package/src/memory/index.ts +8 -0
  302. package/src/memory/serialization.ts +47 -0
  303. package/src/migration/index.ts +4 -0
  304. package/src/migration/migrate.test.ts +44 -0
  305. package/src/migration/migrate.ts +58 -0
  306. package/src/migration/migrations.ts +24 -0
  307. package/src/migration/version.ts +9 -0
  308. package/src/model/LLMModelDefinition.ts +12 -0
  309. package/src/model/Model.ts +39 -0
  310. package/src/model/ModelDefinition.ts +15 -0
  311. package/src/model/ModelRegistry.ts +33 -0
  312. package/src/model/index.ts +7 -0
  313. package/src/model/serialization.ts +30 -0
  314. package/src/node/AgentNode.ts +82 -0
  315. package/src/node/DataNode.ts +41 -0
  316. package/src/node/FunctionNode.ts +76 -0
  317. package/src/node/InputNode.ts +185 -0
  318. package/src/node/LogicNode.ts +33 -0
  319. package/src/node/MqttNode.ts +127 -0
  320. package/src/node/Node.ts +61 -0
  321. package/src/node/NodeDefinition.ts +37 -0
  322. package/src/node/NodeRegistry.ts +85 -0
  323. package/src/node/OutputNode.ts +87 -0
  324. package/src/node/ToolNode.ts +32 -0
  325. package/src/node/TriggerNode.ts +272 -0
  326. package/src/node/constants.ts +16 -0
  327. package/src/node/index.ts +26 -0
  328. package/src/node/methods.ts +278 -0
  329. package/src/node/serialization.ts +544 -0
  330. package/src/parameter/OutputParameter.ts +68 -0
  331. package/src/parameter/Parameter.ts +243 -0
  332. package/src/parameter/index.ts +33 -0
  333. package/src/variable/Variable.ts +10 -0
  334. package/src/variable/index.ts +16 -0
  335. package/src/variable/operations.ts +106 -0
  336. package/src/workflow/Workflow.ts +41 -0
  337. package/src/workflow/index.ts +3 -0
  338. package/src/workflow/serialization.test.ts +240 -0
  339. package/src/workflow/serialization.ts +242 -0
@@ -0,0 +1,12 @@
1
+ export type { NodeOutput, NodeType, NodeData, Node, NodeBase, } from "./Node";
2
+ export { NodeCategory, NodeTag } from "./constants";
3
+ export { NodeRegistry } from "./NodeRegistry";
4
+ export type { NodeDefinition, Port, PortDefinitions } from "./NodeDefinition";
5
+ export type { OutputParameter, StaticOutput, OutputList, OutputBinding, OutputDeclaration } from "../parameter";
6
+ export { getPorts, getArguments, getNodeOutput, getNodeAvailableOutput, getOutputBinding, getInput, isNodeUsedAsTool } from "./methods";
7
+ export type { ExternalInput } from "./methods";
8
+ export type { FunctionCallNode, FunctionCallNodeType, FunctionNodeDefinition } from "./FunctionNode";
9
+ export { buildFunctionNodeDef } from "./FunctionNode";
10
+ export { serialize, deserialize } from "./serialization";
11
+ export type { ApiNode } from "./serialization";
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,QAAQ,GACT,MAAM,QAAQ,CAAC;AAGhB,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,cAAc,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC9E,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGhH,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AACxI,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG/C,YAAY,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACrG,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAGtD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACzD,YAAY,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,9 @@
1
+ // Constants & registry
2
+ export { NodeCategory, NodeTag } from "./constants";
3
+ export { NodeRegistry } from "./NodeRegistry";
4
+ // NodeMethods — read helpers over a NodeData
5
+ export { getPorts, getArguments, getNodeOutput, getNodeAvailableOutput, getOutputBinding, getInput, isNodeUsedAsTool } from "./methods";
6
+ export { buildFunctionNodeDef } from "./FunctionNode";
7
+ // Serialization — domain Node <-> api
8
+ export { serialize, deserialize } from "./serialization";
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AASA,uBAAuB;AACvB,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAI9C,6CAA6C;AAC7C,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAKxI,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD,sCAAsC;AACtC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,73 @@
1
+ import { NodeData, NodeOutput } from "./Node";
2
+ import type { OutputBinding } from "../parameter";
3
+ import { PortDefinitions } from "./NodeDefinition";
4
+ import { Edge } from "../edge";
5
+ /**
6
+ * Read-only helper: look up the current binding for a given output key on any node.
7
+ * All static-style bindings (including FunctionCall returns) live at `arguments[outputId]`.
8
+ * List output entries are OutputDeclarations, projected to an OutputBinding shape — only
9
+ * emit-mode entries are addressable by uid here; callers that need to inspect assign-mode
10
+ * entries should walk the declaration list directly via `arguments[out.id]`.
11
+ */
12
+ export declare function getOutputBinding(node: NodeData, outputId: string): OutputBinding | undefined;
13
+ /** Describes a hardware input a node needs before it can execute in debug mode. */
14
+ export type ExternalInput = {
15
+ kind: "gpio";
16
+ pinReference: string | undefined;
17
+ dataType: "bool" | "int";
18
+ } | {
19
+ kind: "serial";
20
+ };
21
+ /**
22
+ * Get ports for a node instance.
23
+ */
24
+ export declare function getPorts(node: NodeData): PortDefinitions;
25
+ /**
26
+ * Get a flat arguments record for any node instance. Used to feed parameter
27
+ * resolution (FromArgs<T> lambdas, activation rules). Output bindings live in
28
+ * the same record under their own (non-colliding) output ids — lambdas address
29
+ * parameters by parameter id and never hit them accidentally.
30
+ */
31
+ export declare function getArguments(node: NodeData): Record<string, unknown>;
32
+ /**
33
+ * Compute the outputs the node currently can produce (before binding decisions).
34
+ * For FunctionCall: derived from the per-instance functionInfo snapshot (decoupled from live function defs).
35
+ * For all others: derived from the registered NodeDefinition's outputs[] + the node's current arguments.
36
+ *
37
+ * List outputs: only emit-mode entries are surfaced. Assign-mode entries route to
38
+ * existing variables and don't create new output slots in scope — they're validated
39
+ * as bindings, not reported as available outputs.
40
+ */
41
+ export declare function getNodeAvailableOutput(node: NodeData): Record<string, NodeOutput>;
42
+ /**
43
+ * Compute the effective outputs the node emits to variable scope: available outputs
44
+ * filtered to active emit bindings only (inactive bindings and active assign bindings
45
+ * contribute nothing — assign routes to an existing variable, inactive is discarded).
46
+ * Emit bindings carry a user-chosen name that overrides the output's default name (the id).
47
+ *
48
+ * Binding lookup:
49
+ * - Static outputs (incl. FunctionCall returns): `node.arguments[out.id]`
50
+ * - List outputs: each entry is already a declaration; emit entries contribute
51
+ * directly (no separate binding), assign entries contribute nothing
52
+ */
53
+ export declare function getNodeOutput(node: NodeData): Record<string, NodeOutput>;
54
+ /**
55
+ * Compute external input requirements for a node instance (debug mode).
56
+ * Returns the hardware I/O values the node will read during execution.
57
+ */
58
+ export declare function getInput(node: NodeData): ExternalInput[];
59
+ /**
60
+ * Determine whether a node is currently used as a tool input
61
+ * (i.e. its tool-input port has an incoming edge).
62
+ *
63
+ * Reads only the connectivity fields off each edge (`target`, `targetHandle`),
64
+ * so it takes the structural {@link Edge} rather than React Flow's `Edge` —
65
+ * keeping this (and its callers in serialization/diagnostics) headless. The
66
+ * editor's React Flow `Edge[]` is structurally assignable without an adapter.
67
+ *
68
+ * Editor-only connection rules (canPortAcceptEdge, getCompatibleNodeDefs,
69
+ * isValidConnection) live in workflow-builder's connectionRules — they operate
70
+ * on React Flow `Node`/`Edge` and have no place in the headless core.
71
+ */
72
+ export declare function isNodeUsedAsTool(nodeId: string, nodeData: NodeData, edges: readonly Edge[]): boolean;
73
+ //# sourceMappingURL=methods.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"methods.d.ts","sourceRoot":"","sources":["../../src/node/methods.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAqB,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGnD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAO/B;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAoB5F;AAMD,mFAAmF;AACnF,MAAM,MAAM,aAAa,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,QAAQ,EAAE,MAAM,GAAG,KAAK,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC;AAE9H;;GAEG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,eAAe,CAmFxD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEpE;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CA8BjF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAsCxE;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,aAAa,EAAE,CAexD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,IAAI,EAAE,GAAG,OAAO,CAKpG"}
@@ -0,0 +1,261 @@
1
+ import { resolveStaticOutputDataType } from "../parameter";
2
+ import { NodeRegistry } from "./NodeRegistry";
3
+ /** Read a static output's binding from a node's arguments bag, keyed by the output id. */
4
+ function getStaticBinding(args, outputId) {
5
+ return args[outputId];
6
+ }
7
+ /**
8
+ * Read-only helper: look up the current binding for a given output key on any node.
9
+ * All static-style bindings (including FunctionCall returns) live at `arguments[outputId]`.
10
+ * List output entries are OutputDeclarations, projected to an OutputBinding shape — only
11
+ * emit-mode entries are addressable by uid here; callers that need to inspect assign-mode
12
+ * entries should walk the declaration list directly via `arguments[out.id]`.
13
+ */
14
+ export function getOutputBinding(node, outputId) {
15
+ const args = node.arguments;
16
+ if (node.type === "FunctionCall") {
17
+ return getStaticBinding(args, outputId);
18
+ }
19
+ const def = NodeRegistry.getByType(node.type);
20
+ if (!def?.outputs)
21
+ return undefined;
22
+ for (const out of def.outputs) {
23
+ if (out.type === "static") {
24
+ if (out.id === outputId)
25
+ return getStaticBinding(args, out.id);
26
+ }
27
+ else {
28
+ const entries = args[out.id];
29
+ const entry = entries?.find((e) => e.mode === "emit" && e.uid === outputId);
30
+ if (entry && entry.mode === "emit")
31
+ return { active: true, mode: "emit", name: entry.name };
32
+ }
33
+ }
34
+ return undefined;
35
+ }
36
+ /**
37
+ * Get ports for a node instance.
38
+ */
39
+ export function getPorts(node) {
40
+ switch (node.type) {
41
+ case "ReadPin":
42
+ return {
43
+ input: [
44
+ { id: "ctrl", type: "control" },
45
+ { id: "tool", type: "tool", label: "As Tool" },
46
+ ],
47
+ output: [{ id: "ctrl", type: "control" }],
48
+ };
49
+ case "SerialRead":
50
+ case "WritePin":
51
+ case "SerialWrite":
52
+ case "MqttPublish":
53
+ return {
54
+ input: [{ id: "ctrl", type: "control" }],
55
+ output: [{ id: "ctrl", type: "control" }],
56
+ };
57
+ case "FunctionCall":
58
+ return {
59
+ input: [
60
+ { id: "ctrl", type: "control" },
61
+ { id: "tool", type: "tool", label: "As Tool" },
62
+ ],
63
+ output: [{ id: "ctrl", type: "control" }],
64
+ };
65
+ case "Agent":
66
+ return {
67
+ input: [
68
+ { id: "ctrl", type: "control" },
69
+ { id: "tool", type: "tool", label: "As Tool" },
70
+ ],
71
+ output: [
72
+ { id: "ctrl", type: "control" },
73
+ { id: "tools", type: "tool" },
74
+ ],
75
+ };
76
+ case "SetVariable":
77
+ return {
78
+ input: [{ id: "ctrl", type: "control" }],
79
+ output: [{ id: "ctrl", type: "control" }],
80
+ };
81
+ case "If":
82
+ return {
83
+ input: [{ id: "ctrl", type: "control" }],
84
+ output: [
85
+ { id: "true", type: "control", label: "True" },
86
+ { id: "false", type: "control", label: "False" },
87
+ ],
88
+ };
89
+ case "Delay":
90
+ return {
91
+ input: [{ id: "ctrl", type: "control" }],
92
+ output: [{ id: "ctrl", type: "control" }],
93
+ };
94
+ case "OnFunctionCall":
95
+ case "Ticker":
96
+ case "Alarm":
97
+ case "OnStartup":
98
+ case "OnPinEdge":
99
+ case "OnSerialReceive":
100
+ case "OnThreshold":
101
+ case "OnMqttMessage":
102
+ return {
103
+ input: [],
104
+ output: [{ id: "ctrl", type: "control" }],
105
+ };
106
+ case "Retriever":
107
+ return {
108
+ input: [
109
+ { id: "ctrl", type: "control" },
110
+ { id: "tool", type: "tool", label: "As Tool" },
111
+ ],
112
+ output: [{ id: "ctrl", type: "control" }],
113
+ };
114
+ case "WebFetch":
115
+ return {
116
+ input: [{ id: "ctrl", type: "control" }],
117
+ output: [{ id: "ctrl", type: "control" }],
118
+ };
119
+ case "WebSearchTool":
120
+ return { input: [{ id: "tool", type: "tool", label: "As Tool" }], output: [] };
121
+ }
122
+ }
123
+ /**
124
+ * Get a flat arguments record for any node instance. Used to feed parameter
125
+ * resolution (FromArgs<T> lambdas, activation rules). Output bindings live in
126
+ * the same record under their own (non-colliding) output ids — lambdas address
127
+ * parameters by parameter id and never hit them accidentally.
128
+ */
129
+ export function getArguments(node) {
130
+ return node.arguments;
131
+ }
132
+ /**
133
+ * Compute the outputs the node currently can produce (before binding decisions).
134
+ * For FunctionCall: derived from the per-instance functionInfo snapshot (decoupled from live function defs).
135
+ * For all others: derived from the registered NodeDefinition's outputs[] + the node's current arguments.
136
+ *
137
+ * List outputs: only emit-mode entries are surfaced. Assign-mode entries route to
138
+ * existing variables and don't create new output slots in scope — they're validated
139
+ * as bindings, not reported as available outputs.
140
+ */
141
+ export function getNodeAvailableOutput(node) {
142
+ const result = {};
143
+ if (node.type === "FunctionCall") {
144
+ for (const ret of node.functionInfo.returns) {
145
+ result[ret.uid] = { name: ret.name, dataType: ret.dataType };
146
+ }
147
+ return result;
148
+ }
149
+ const def = NodeRegistry.getByType(node.type);
150
+ if (!def?.outputs)
151
+ return result;
152
+ const args = node.arguments;
153
+ for (const out of def.outputs) {
154
+ if (out.type === "static") {
155
+ result[out.id] = {
156
+ name: out.id,
157
+ dataType: resolveStaticOutputDataType(out, node.arguments),
158
+ };
159
+ }
160
+ else {
161
+ const entries = args[out.id] ?? [];
162
+ for (const entry of entries) {
163
+ if (entry.mode === "emit") {
164
+ result[entry.uid] = { name: entry.name, dataType: entry.dataType };
165
+ }
166
+ }
167
+ }
168
+ }
169
+ return result;
170
+ }
171
+ /**
172
+ * Compute the effective outputs the node emits to variable scope: available outputs
173
+ * filtered to active emit bindings only (inactive bindings and active assign bindings
174
+ * contribute nothing — assign routes to an existing variable, inactive is discarded).
175
+ * Emit bindings carry a user-chosen name that overrides the output's default name (the id).
176
+ *
177
+ * Binding lookup:
178
+ * - Static outputs (incl. FunctionCall returns): `node.arguments[out.id]`
179
+ * - List outputs: each entry is already a declaration; emit entries contribute
180
+ * directly (no separate binding), assign entries contribute nothing
181
+ */
182
+ export function getNodeOutput(node) {
183
+ const result = {};
184
+ const args = node.arguments;
185
+ const applyStaticBinding = (key, defaultName, dataType, binding) => {
186
+ // No binding = treat as default emit (the seeded shape). Otherwise honor active+mode.
187
+ if (!binding) {
188
+ result[key] = { name: defaultName, dataType };
189
+ return;
190
+ }
191
+ if (!binding.active)
192
+ return;
193
+ if (binding.mode !== "emit")
194
+ return;
195
+ result[key] = { name: binding.name, dataType };
196
+ };
197
+ if (node.type === "FunctionCall") {
198
+ for (const ret of node.functionInfo.returns) {
199
+ applyStaticBinding(ret.uid, ret.name, ret.dataType, getStaticBinding(args, ret.uid));
200
+ }
201
+ return result;
202
+ }
203
+ const def = NodeRegistry.getByType(node.type);
204
+ if (!def?.outputs)
205
+ return result;
206
+ for (const out of def.outputs) {
207
+ if (out.type === "static") {
208
+ applyStaticBinding(out.id, out.id, resolveStaticOutputDataType(out, node.arguments), getStaticBinding(args, out.id));
209
+ }
210
+ else {
211
+ const entries = args[out.id] ?? [];
212
+ for (const entry of entries) {
213
+ if (entry.mode === "emit") {
214
+ result[entry.uid] = { name: entry.name, dataType: entry.dataType };
215
+ }
216
+ }
217
+ }
218
+ }
219
+ return result;
220
+ }
221
+ /**
222
+ * Compute external input requirements for a node instance (debug mode).
223
+ * Returns the hardware I/O values the node will read during execution.
224
+ */
225
+ export function getInput(node) {
226
+ switch (node.type) {
227
+ case "ReadPin":
228
+ return [
229
+ { kind: "gpio", pinReference: node.arguments.pinReference, dataType: node.arguments.signalType === "digital" ? "bool" : "int" },
230
+ ];
231
+ case "SerialRead":
232
+ return [{ kind: "serial" }];
233
+ case "OnPinEdge":
234
+ return [{ kind: "gpio", pinReference: node.arguments.pinReference, dataType: "bool" }];
235
+ case "OnSerialReceive":
236
+ return [{ kind: "serial" }];
237
+ default:
238
+ return [];
239
+ }
240
+ }
241
+ /**
242
+ * Determine whether a node is currently used as a tool input
243
+ * (i.e. its tool-input port has an incoming edge).
244
+ *
245
+ * Reads only the connectivity fields off each edge (`target`, `targetHandle`),
246
+ * so it takes the structural {@link Edge} rather than React Flow's `Edge` —
247
+ * keeping this (and its callers in serialization/diagnostics) headless. The
248
+ * editor's React Flow `Edge[]` is structurally assignable without an adapter.
249
+ *
250
+ * Editor-only connection rules (canPortAcceptEdge, getCompatibleNodeDefs,
251
+ * isValidConnection) live in workflow-builder's connectionRules — they operate
252
+ * on React Flow `Node`/`Edge` and have no place in the headless core.
253
+ */
254
+ export function isNodeUsedAsTool(nodeId, nodeData, edges) {
255
+ const ports = getPorts(nodeData);
256
+ const toolInputs = ports.input.filter((p) => p.type === "tool");
257
+ if (toolInputs.length === 0)
258
+ return false;
259
+ return edges.some((e) => e.target === nodeId && toolInputs.some((p) => p.id === e.targetHandle));
260
+ }
261
+ //# sourceMappingURL=methods.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"methods.js","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CAAC,IAAI,KAAK,MAAM,CAAC,CAAC;IAChE,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAC1C,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;AACnG,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { Schemas } from "../api";
2
+ import type { Node } from "./Node";
3
+ import type { FunctionInfo } from "../function";
4
+ export type ApiNode = Schemas["Node"];
5
+ /**
6
+ * Resolve a function's signature snapshot by id. A `FunctionCall` on the wire stores
7
+ * only `functionId`; deserialize rebuilds the in-memory `functionInfo` snapshot
8
+ * (which core's variable helpers + staleness read) from the workflow's function
9
+ * table via this. Unknown id (e.g. a call to a since-deleted function) → a minimal
10
+ * stub so the node still round-trips and surfaces as deleted.
11
+ */
12
+ export type ResolveFunctionInfo = (functionId: string) => FunctionInfo | undefined;
13
+ /**
14
+ * Serialize a domain Node to the strict API format (Schemas["Node"]).
15
+ * Strips hidden parameters (those whose activationRules are not met). The
16
+ * `isToolInput` flag is threaded into activation evaluation so rules like
17
+ * `isControlFlow` / `isToolInput` resolve correctly per-instance.
18
+ */
19
+ export declare function serialize(node: Node, isToolInput: boolean): ApiNode;
20
+ /**
21
+ * Convert a strict API Node to a domain Node (NodeData + position). `resolveFunctionInfo`
22
+ * is required only for `FunctionCall` nodes — see {@link ResolveFunctionInfo}.
23
+ */
24
+ export declare function deserialize(apiNode: ApiNode, resolveFunctionInfo?: ResolveFunctionInfo): Node;
25
+ //# sourceMappingURL=serialization.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serialization.d.ts","sourceRoot":"","sources":["../../src/node/serialization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAY,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAKhD,MAAM,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAEtC;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,UAAU,EAAE,MAAM,KAAK,YAAY,GAAG,SAAS,CAAC;AAEnF;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,GAAG,OAAO,CAmBnE;AA8PD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,mBAAmB,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAE7F"}