@decaf-ts/ui-decorators 0.20.3 → 0.20.6

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 (200) hide show
  1. package/dist/ui-decorators.cjs +1 -1
  2. package/lib/cjs/graph/GraphExecutionStateMapper.cjs +97 -0
  3. package/lib/cjs/graph/GraphExecutionStateMapper.cjs.map +1 -0
  4. package/lib/cjs/graph/GraphResolution.cjs +17 -0
  5. package/lib/cjs/graph/GraphResolution.cjs.map +1 -0
  6. package/lib/cjs/graph/constants.cjs +157 -1
  7. package/lib/cjs/graph/constants.cjs.map +1 -1
  8. package/lib/cjs/graph/index.cjs +3 -0
  9. package/lib/cjs/graph/index.cjs.map +1 -1
  10. package/lib/cjs/graph/nodes/agents/agent.cjs +110 -0
  11. package/lib/cjs/graph/nodes/agents/agent.cjs.map +1 -0
  12. package/lib/cjs/graph/nodes/base.cjs +36 -0
  13. package/lib/cjs/graph/nodes/base.cjs.map +1 -0
  14. package/lib/cjs/graph/nodes/boundary/input-value.cjs +57 -0
  15. package/lib/cjs/graph/nodes/boundary/input-value.cjs.map +1 -0
  16. package/lib/cjs/graph/nodes/category-styles.cjs +38 -0
  17. package/lib/cjs/graph/nodes/category-styles.cjs.map +1 -0
  18. package/lib/cjs/graph/nodes/flow-control/break.cjs +63 -0
  19. package/lib/cjs/graph/nodes/flow-control/break.cjs.map +1 -0
  20. package/lib/cjs/graph/nodes/flow-control/error-boundary.cjs +67 -0
  21. package/lib/cjs/graph/nodes/flow-control/error-boundary.cjs.map +1 -0
  22. package/lib/cjs/graph/nodes/flow-control/human-approval.cjs +69 -0
  23. package/lib/cjs/graph/nodes/flow-control/human-approval.cjs.map +1 -0
  24. package/lib/cjs/graph/nodes/flow-control/if.cjs +71 -0
  25. package/lib/cjs/graph/nodes/flow-control/if.cjs.map +1 -0
  26. package/lib/cjs/graph/nodes/flow-control/parallel.cjs +61 -0
  27. package/lib/cjs/graph/nodes/flow-control/parallel.cjs.map +1 -0
  28. package/lib/cjs/graph/nodes/flow-control/switch.cjs +121 -0
  29. package/lib/cjs/graph/nodes/flow-control/switch.cjs.map +1 -0
  30. package/lib/cjs/graph/nodes/index.cjs +123 -0
  31. package/lib/cjs/graph/nodes/index.cjs.map +1 -0
  32. package/lib/cjs/graph/nodes/loops/foreach.cjs +86 -0
  33. package/lib/cjs/graph/nodes/loops/foreach.cjs.map +1 -0
  34. package/lib/cjs/graph/nodes/loops/until.cjs +74 -0
  35. package/lib/cjs/graph/nodes/loops/until.cjs.map +1 -0
  36. package/lib/cjs/graph/nodes/loops/while.cjs +74 -0
  37. package/lib/cjs/graph/nodes/loops/while.cjs.map +1 -0
  38. package/lib/cjs/graph/nodes/manifests.cjs +338 -0
  39. package/lib/cjs/graph/nodes/manifests.cjs.map +1 -0
  40. package/lib/cjs/graph/nodes/triggers/chat.cjs +70 -0
  41. package/lib/cjs/graph/nodes/triggers/chat.cjs.map +1 -0
  42. package/lib/cjs/graph/nodes/triggers/event.cjs +58 -0
  43. package/lib/cjs/graph/nodes/triggers/event.cjs.map +1 -0
  44. package/lib/cjs/graph/nodes/triggers/form.cjs +59 -0
  45. package/lib/cjs/graph/nodes/triggers/form.cjs.map +1 -0
  46. package/lib/cjs/graph/nodes/triggers/manual.cjs +60 -0
  47. package/lib/cjs/graph/nodes/triggers/manual.cjs.map +1 -0
  48. package/lib/cjs/graph/nodes/triggers/schedule.cjs +60 -0
  49. package/lib/cjs/graph/nodes/triggers/schedule.cjs.map +1 -0
  50. package/lib/cjs/graph/nodes/triggers/webhook.cjs +62 -0
  51. package/lib/cjs/graph/nodes/triggers/webhook.cjs.map +1 -0
  52. package/lib/cjs/graph/nodes/utility/code.cjs +99 -0
  53. package/lib/cjs/graph/nodes/utility/code.cjs.map +1 -0
  54. package/lib/cjs/graph/nodes/utility/delay.cjs +61 -0
  55. package/lib/cjs/graph/nodes/utility/delay.cjs.map +1 -0
  56. package/lib/cjs/graph/nodes/utility/log.cjs +62 -0
  57. package/lib/cjs/graph/nodes/utility/log.cjs.map +1 -0
  58. package/lib/cjs/graph/nodes/utility/map.cjs +61 -0
  59. package/lib/cjs/graph/nodes/utility/map.cjs.map +1 -0
  60. package/lib/cjs/graph/nodes/utility/merge.cjs +62 -0
  61. package/lib/cjs/graph/nodes/utility/merge.cjs.map +1 -0
  62. package/lib/cjs/graph/nodes/utility/return.cjs +61 -0
  63. package/lib/cjs/graph/nodes/utility/return.cjs.map +1 -0
  64. package/lib/cjs/graph/nodes/utility/utility-log.cjs +66 -0
  65. package/lib/cjs/graph/nodes/utility/utility-log.cjs.map +1 -0
  66. package/lib/cjs/index.cjs +3 -3
  67. package/lib/esm/graph/GraphExecutionStateMapper.js +91 -0
  68. package/lib/esm/graph/GraphExecutionStateMapper.js.map +1 -0
  69. package/lib/esm/graph/GraphResolution.js +13 -0
  70. package/lib/esm/graph/GraphResolution.js.map +1 -0
  71. package/lib/esm/graph/constants.js +179 -0
  72. package/lib/esm/graph/constants.js.map +1 -1
  73. package/lib/esm/graph/index.js +3 -0
  74. package/lib/esm/graph/index.js.map +1 -1
  75. package/lib/esm/graph/nodes/agents/agent.js +101 -0
  76. package/lib/esm/graph/nodes/agents/agent.js.map +1 -0
  77. package/lib/esm/graph/nodes/base.js +31 -0
  78. package/lib/esm/graph/nodes/base.js.map +1 -0
  79. package/lib/esm/graph/nodes/boundary/input-value.js +48 -0
  80. package/lib/esm/graph/nodes/boundary/input-value.js.map +1 -0
  81. package/lib/esm/graph/nodes/category-styles.js +34 -0
  82. package/lib/esm/graph/nodes/category-styles.js.map +1 -0
  83. package/lib/esm/graph/nodes/flow-control/break.js +54 -0
  84. package/lib/esm/graph/nodes/flow-control/break.js.map +1 -0
  85. package/lib/esm/graph/nodes/flow-control/error-boundary.js +58 -0
  86. package/lib/esm/graph/nodes/flow-control/error-boundary.js.map +1 -0
  87. package/lib/esm/graph/nodes/flow-control/human-approval.js +60 -0
  88. package/lib/esm/graph/nodes/flow-control/human-approval.js.map +1 -0
  89. package/lib/esm/graph/nodes/flow-control/if.js +62 -0
  90. package/lib/esm/graph/nodes/flow-control/if.js.map +1 -0
  91. package/lib/esm/graph/nodes/flow-control/parallel.js +52 -0
  92. package/lib/esm/graph/nodes/flow-control/parallel.js.map +1 -0
  93. package/lib/esm/graph/nodes/flow-control/switch.js +112 -0
  94. package/lib/esm/graph/nodes/flow-control/switch.js.map +1 -0
  95. package/lib/esm/graph/nodes/index.js +105 -0
  96. package/lib/esm/graph/nodes/index.js.map +1 -0
  97. package/lib/esm/graph/nodes/loops/foreach.js +77 -0
  98. package/lib/esm/graph/nodes/loops/foreach.js.map +1 -0
  99. package/lib/esm/graph/nodes/loops/until.js +65 -0
  100. package/lib/esm/graph/nodes/loops/until.js.map +1 -0
  101. package/lib/esm/graph/nodes/loops/while.js +65 -0
  102. package/lib/esm/graph/nodes/loops/while.js.map +1 -0
  103. package/lib/esm/graph/nodes/manifests.js +334 -0
  104. package/lib/esm/graph/nodes/manifests.js.map +1 -0
  105. package/lib/esm/graph/nodes/triggers/chat.js +61 -0
  106. package/lib/esm/graph/nodes/triggers/chat.js.map +1 -0
  107. package/lib/esm/graph/nodes/triggers/event.js +49 -0
  108. package/lib/esm/graph/nodes/triggers/event.js.map +1 -0
  109. package/lib/esm/graph/nodes/triggers/form.js +50 -0
  110. package/lib/esm/graph/nodes/triggers/form.js.map +1 -0
  111. package/lib/esm/graph/nodes/triggers/manual.js +51 -0
  112. package/lib/esm/graph/nodes/triggers/manual.js.map +1 -0
  113. package/lib/esm/graph/nodes/triggers/schedule.js +51 -0
  114. package/lib/esm/graph/nodes/triggers/schedule.js.map +1 -0
  115. package/lib/esm/graph/nodes/triggers/webhook.js +53 -0
  116. package/lib/esm/graph/nodes/triggers/webhook.js.map +1 -0
  117. package/lib/esm/graph/nodes/utility/code.js +90 -0
  118. package/lib/esm/graph/nodes/utility/code.js.map +1 -0
  119. package/lib/esm/graph/nodes/utility/delay.js +52 -0
  120. package/lib/esm/graph/nodes/utility/delay.js.map +1 -0
  121. package/lib/esm/graph/nodes/utility/log.js +53 -0
  122. package/lib/esm/graph/nodes/utility/log.js.map +1 -0
  123. package/lib/esm/graph/nodes/utility/map.js +52 -0
  124. package/lib/esm/graph/nodes/utility/map.js.map +1 -0
  125. package/lib/esm/graph/nodes/utility/merge.js +53 -0
  126. package/lib/esm/graph/nodes/utility/merge.js.map +1 -0
  127. package/lib/esm/graph/nodes/utility/return.js +52 -0
  128. package/lib/esm/graph/nodes/utility/return.js.map +1 -0
  129. package/lib/esm/graph/nodes/utility/utility-log.js +57 -0
  130. package/lib/esm/graph/nodes/utility/utility-log.js.map +1 -0
  131. package/lib/esm/index.js +3 -3
  132. package/lib/types/graph/GraphExecutionStateMapper.d.cts +66 -0
  133. package/lib/types/graph/GraphExecutionStateMapper.d.mts +66 -0
  134. package/lib/types/graph/GraphResolution.d.cts +53 -0
  135. package/lib/types/graph/GraphResolution.d.mts +53 -0
  136. package/lib/types/graph/constants.d.cts +165 -0
  137. package/lib/types/graph/constants.d.mts +165 -0
  138. package/lib/types/graph/index.d.cts +3 -0
  139. package/lib/types/graph/index.d.mts +3 -0
  140. package/lib/types/graph/nodes/agents/agent.d.cts +44 -0
  141. package/lib/types/graph/nodes/agents/agent.d.mts +44 -0
  142. package/lib/types/graph/nodes/base.d.cts +28 -0
  143. package/lib/types/graph/nodes/base.d.mts +28 -0
  144. package/lib/types/graph/nodes/boundary/input-value.d.cts +13 -0
  145. package/lib/types/graph/nodes/boundary/input-value.d.mts +13 -0
  146. package/lib/types/graph/nodes/category-styles.d.cts +8 -0
  147. package/lib/types/graph/nodes/category-styles.d.mts +8 -0
  148. package/lib/types/graph/nodes/flow-control/break.d.cts +15 -0
  149. package/lib/types/graph/nodes/flow-control/break.d.mts +15 -0
  150. package/lib/types/graph/nodes/flow-control/error-boundary.d.cts +12 -0
  151. package/lib/types/graph/nodes/flow-control/error-boundary.d.mts +12 -0
  152. package/lib/types/graph/nodes/flow-control/human-approval.d.cts +13 -0
  153. package/lib/types/graph/nodes/flow-control/human-approval.d.mts +13 -0
  154. package/lib/types/graph/nodes/flow-control/if.d.cts +16 -0
  155. package/lib/types/graph/nodes/flow-control/if.d.mts +16 -0
  156. package/lib/types/graph/nodes/flow-control/parallel.d.cts +11 -0
  157. package/lib/types/graph/nodes/flow-control/parallel.d.mts +11 -0
  158. package/lib/types/graph/nodes/flow-control/switch.d.cts +21 -0
  159. package/lib/types/graph/nodes/flow-control/switch.d.mts +21 -0
  160. package/lib/types/graph/nodes/index.d.cts +79 -0
  161. package/lib/types/graph/nodes/index.d.mts +79 -0
  162. package/lib/types/graph/nodes/loops/foreach.d.cts +19 -0
  163. package/lib/types/graph/nodes/loops/foreach.d.mts +19 -0
  164. package/lib/types/graph/nodes/loops/until.d.cts +16 -0
  165. package/lib/types/graph/nodes/loops/until.d.mts +16 -0
  166. package/lib/types/graph/nodes/loops/while.d.cts +16 -0
  167. package/lib/types/graph/nodes/loops/while.d.mts +16 -0
  168. package/lib/types/graph/nodes/manifests.d.cts +62 -0
  169. package/lib/types/graph/nodes/manifests.d.mts +62 -0
  170. package/lib/types/graph/nodes/triggers/chat.d.cts +13 -0
  171. package/lib/types/graph/nodes/triggers/chat.d.mts +13 -0
  172. package/lib/types/graph/nodes/triggers/event.d.cts +10 -0
  173. package/lib/types/graph/nodes/triggers/event.d.mts +10 -0
  174. package/lib/types/graph/nodes/triggers/form.d.cts +11 -0
  175. package/lib/types/graph/nodes/triggers/form.d.mts +11 -0
  176. package/lib/types/graph/nodes/triggers/manual.d.cts +12 -0
  177. package/lib/types/graph/nodes/triggers/manual.d.mts +12 -0
  178. package/lib/types/graph/nodes/triggers/schedule.d.cts +11 -0
  179. package/lib/types/graph/nodes/triggers/schedule.d.mts +11 -0
  180. package/lib/types/graph/nodes/triggers/webhook.d.cts +11 -0
  181. package/lib/types/graph/nodes/triggers/webhook.d.mts +11 -0
  182. package/lib/types/graph/nodes/utility/code.d.cts +31 -0
  183. package/lib/types/graph/nodes/utility/code.d.mts +31 -0
  184. package/lib/types/graph/nodes/utility/delay.d.cts +11 -0
  185. package/lib/types/graph/nodes/utility/delay.d.mts +11 -0
  186. package/lib/types/graph/nodes/utility/log.d.cts +13 -0
  187. package/lib/types/graph/nodes/utility/log.d.mts +13 -0
  188. package/lib/types/graph/nodes/utility/map.d.cts +11 -0
  189. package/lib/types/graph/nodes/utility/map.d.mts +11 -0
  190. package/lib/types/graph/nodes/utility/merge.d.cts +12 -0
  191. package/lib/types/graph/nodes/utility/merge.d.mts +12 -0
  192. package/lib/types/graph/nodes/utility/return.d.cts +11 -0
  193. package/lib/types/graph/nodes/utility/return.d.mts +11 -0
  194. package/lib/types/graph/nodes/utility/utility-log.d.cts +15 -0
  195. package/lib/types/graph/nodes/utility/utility-log.d.mts +15 -0
  196. package/lib/types/graph/types.d.cts +286 -0
  197. package/lib/types/graph/types.d.mts +286 -0
  198. package/lib/types/index.d.cts +3 -3
  199. package/lib/types/index.d.mts +3 -3
  200. package/package.json +1 -1
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @module ui-decorators/graph/nodes/category-styles
3
+ * @summary Built-in node/connection category style registrations.
4
+ * @description Registers default colors and icons for the built-in node and
5
+ * connection categories (DECAF-32 §21.2). The `color` / `icon` on a node's
6
+ * `@node()` metadata are optional overrides — when omitted, the effective
7
+ * style is resolved from the category registry.
8
+ */
9
+ import { registerGraphCategoryStyle } from "./../constants.js";
10
+ /**
11
+ * Registers all built-in category styles. Called once at module init.
12
+ *
13
+ * Categories define the default visual style for nodes and connection ports.
14
+ * A node's explicit `color` / `icon` (on `@node()`) overrides the category
15
+ * style; when omitted, the category style is used.
16
+ */
17
+ export function registerBuiltinCategoryStyles() {
18
+ // Node categories
19
+ registerGraphCategoryStyle("Trigger", { color: "#3b82f6", icon: "ti-bolt" });
20
+ registerGraphCategoryStyle("Flow Control", { color: "#f59e0b", icon: "ti-arrows-split-2" });
21
+ registerGraphCategoryStyle("Utility", { color: "#0d9488", icon: "ti-tool" });
22
+ registerGraphCategoryStyle("Loop", { color: "#eab308", icon: "ti-repeat" });
23
+ registerGraphCategoryStyle("Workflow", { color: "#f97316", icon: "ti-sitemap" });
24
+ registerGraphCategoryStyle("Pipeline", { color: "#0ea5e9", icon: "ti-git-merge" });
25
+ registerGraphCategoryStyle("Node", { color: "#8b5cf6", icon: "ti-point-filled" });
26
+ registerGraphCategoryStyle("Agent", { color: "#7c3aed", icon: "ti-robot" });
27
+ // Connection categories (for @connection() ports)
28
+ registerGraphCategoryStyle("model", { color: "#3b82f6", icon: "ti-cpu" });
29
+ registerGraphCategoryStyle("memory", { color: "#10b981", icon: "ti-database" });
30
+ registerGraphCategoryStyle("workspace", { color: "#f59e0b", icon: "ti-folder" });
31
+ }
32
+ // Register at module load so the styles are available immediately.
33
+ registerBuiltinCategoryStyles();
34
+ //# sourceMappingURL=category-styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"category-styles.js","sourceRoot":"","sources":["../../../../src/graph/nodes/category-styles.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,0BAA0B,EAAE,0BAAqB;AAE1D;;;;;;GAMG;AACH,MAAM,UAAU,6BAA6B;IAC3C,kBAAkB;IAClB,0BAA0B,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;IAC7E,0BAA0B,CAAC,cAAc,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,mBAAmB,EAAE,CAAC,CAAC;IAC5F,0BAA0B,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;IAC7E,0BAA0B,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;IAC5E,0BAA0B,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;IACjF,0BAA0B,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;IACnF,0BAA0B,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC,CAAC;IAClF,0BAA0B,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;IAE5E,kDAAkD;IAClD,0BAA0B,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC1E,0BAA0B,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,CAAC;IAChF,0BAA0B,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;AACnF,CAAC;AAED,mEAAmE;AACnE,6BAA6B,EAAE,CAAC"}
@@ -0,0 +1,54 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ /**
11
+ * @module ui-decorators/graph/nodes/flow-control/break
12
+ * @summary Break flow-control node declaration (DECAF-32 §22.2.2).
13
+ * @description Break — breaks out of the enclosing loop (foreach/while/until).
14
+ * When executed inside a loop body, the loop terminates early and the loop's
15
+ * `completed`/`state` output carries the results collected so far. The Break
16
+ * node executor throws a `GraphBreakSignal` that the enclosing loop executor
17
+ * catches.
18
+ */
19
+ import { Model, model, required } from "@decaf-ts/decorator-validation";
20
+ import { uielement } from "./../../../ui/decorators.js";
21
+ import { input, node, output } from "./../../decorators.js";
22
+ // Ensure category styles are registered (idempotent).
23
+ import "./../category-styles.js";
24
+ let BreakFlowNode = class BreakFlowNode extends Model {
25
+ };
26
+ __decorate([
27
+ required(),
28
+ uielement("textarea", { label: "Value", placeholder: "Value to forward (collected as the last partial result)" }),
29
+ input({ handle: "value" }),
30
+ __metadata("design:type", Object)
31
+ ], BreakFlowNode.prototype, "value", void 0);
32
+ __decorate([
33
+ required(),
34
+ output({ handle: "broken" }),
35
+ __metadata("design:type", Object)
36
+ ], BreakFlowNode.prototype, "broken", void 0);
37
+ BreakFlowNode = __decorate([
38
+ node("core.flow.break", {
39
+ kind: "core.flow.break",
40
+ category: "Flow Control",
41
+ color: "#ef4444",
42
+ icon: "ti-square-arrow-right",
43
+ width: 96,
44
+ height: 96,
45
+ labels: ["flow", "break", "loop", "control"],
46
+ metadata: {
47
+ title: "Break",
48
+ description: "Breaks out of the enclosing loop. The loop terminates early and returns the results collected so far.",
49
+ },
50
+ }),
51
+ model()
52
+ ], BreakFlowNode);
53
+ export { BreakFlowNode };
54
+ //# sourceMappingURL=break.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"break.js","sourceRoot":"","sources":["../../../../../src/graph/nodes/flow-control/break.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,oCAA+B;AACnD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,8BAAyB;AAEvD,sDAAsD;AACtD,iCAA4B;AAgBrB,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,KAAK;CASvC,CAAA;AALC;IAHC,QAAQ,EAAE;IACV,SAAS,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,yDAAyD,EAAE,CAAC;IACjH,KAAK,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;;4CACX;AAIhB;IAFC,QAAQ,EAAE;IACV,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;;6CACZ;AARN,aAAa;IAdzB,IAAI,CAAC,iBAAiB,EAAE;QACvB,IAAI,EAAE,iBAAiB;QACvB,QAAQ,EAAE,cAAc;QACxB,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,uBAAuB;QAC7B,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,MAAM,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC;QAC5C,QAAQ,EAAE;YACR,KAAK,EAAE,OAAO;YACd,WAAW,EAAE,uGAAuG;SACrH;KACF,CAAC;IACD,KAAK,EAAE;GACK,aAAa,CASzB"}
@@ -0,0 +1,58 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ /**
11
+ * @module ui-decorators/graph/nodes/flow-control/error-boundary
12
+ * @summary Error-boundary flow-control node declaration (DECAF-32 §22.2.2).
13
+ * @description Error boundary — try/catch/finally workflow behaviour.
14
+ */
15
+ import { Model, model, required } from "@decaf-ts/decorator-validation";
16
+ import { uielement } from "./../../../ui/decorators.js";
17
+ import { input, node, output } from "./../../decorators.js";
18
+ // Ensure category styles are registered (idempotent).
19
+ import "./../category-styles.js";
20
+ let ErrorBoundaryFlowNode = class ErrorBoundaryFlowNode extends Model {
21
+ };
22
+ __decorate([
23
+ required(),
24
+ uielement("textarea", { label: "Input value", placeholder: "Value to guard" }),
25
+ input({ handle: "value" }),
26
+ __metadata("design:type", Object)
27
+ ], ErrorBoundaryFlowNode.prototype, "value", void 0);
28
+ __decorate([
29
+ required(),
30
+ uielement("input", { label: "Result", placeholder: "Output on success" }),
31
+ output({ handle: "result" }),
32
+ __metadata("design:type", Object)
33
+ ], ErrorBoundaryFlowNode.prototype, "result", void 0);
34
+ __decorate([
35
+ required(),
36
+ uielement("input", { label: "Error", placeholder: "Output on failure" }),
37
+ output({ handle: "error" }),
38
+ __metadata("design:type", Object)
39
+ ], ErrorBoundaryFlowNode.prototype, "error", void 0);
40
+ ErrorBoundaryFlowNode = __decorate([
41
+ node("core.flow.errorBoundary", {
42
+ kind: "core.flow.errorBoundary",
43
+ category: "Flow Control",
44
+ color: "#ef4444",
45
+ icon: "ti-shield-check",
46
+ width: 96,
47
+ height: 96,
48
+ labels: ["flow", "error", "try-catch"],
49
+ metadata: {
50
+ title: "Error boundary",
51
+ description: "Wraps the input in a try/catch/finally. Emits the result on success, or the error on failure.",
52
+ finally: false,
53
+ },
54
+ }),
55
+ model()
56
+ ], ErrorBoundaryFlowNode);
57
+ export { ErrorBoundaryFlowNode };
58
+ //# sourceMappingURL=error-boundary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-boundary.js","sourceRoot":"","sources":["../../../../../src/graph/nodes/flow-control/error-boundary.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;;GAIG;AACH,OAAO,EAAE,KAAK,EAAE,KAA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.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ /**
11
+ * @module ui-decorators/graph/nodes/flow-control/human-approval
12
+ * @summary Human-approval flow-control node declaration (DECAF-32 §22.2.2).
13
+ * @description Human approval — suspends execution until a human approves
14
+ * or rejects.
15
+ */
16
+ import { Model, model, required } from "@decaf-ts/decorator-validation";
17
+ import { uielement } from "./../../../ui/decorators.js";
18
+ import { input, node, output } from "./../../decorators.js";
19
+ // Ensure category styles are registered (idempotent).
20
+ import "./../category-styles.js";
21
+ let HumanApprovalFlowNode = class HumanApprovalFlowNode extends Model {
22
+ };
23
+ __decorate([
24
+ required(),
25
+ uielement("textarea", { label: "Input value", placeholder: "Value pending approval" }),
26
+ input({ handle: "value" }),
27
+ __metadata("design:type", Object)
28
+ ], HumanApprovalFlowNode.prototype, "value", void 0);
29
+ __decorate([
30
+ required(),
31
+ uielement("input", { label: "Approved", placeholder: "Output when approved" }),
32
+ output({ handle: "approved" }),
33
+ __metadata("design:type", Object)
34
+ ], HumanApprovalFlowNode.prototype, "approved", void 0);
35
+ __decorate([
36
+ required(),
37
+ uielement("input", { label: "Rejected", placeholder: "Output when rejected" }),
38
+ output({ handle: "rejected" }),
39
+ __metadata("design:type", Object)
40
+ ], HumanApprovalFlowNode.prototype, "rejected", void 0);
41
+ HumanApprovalFlowNode = __decorate([
42
+ node("core.flow.humanApproval", {
43
+ kind: "core.flow.humanApproval",
44
+ category: "Flow Control",
45
+ color: "#d946ef",
46
+ icon: "ti-user-check",
47
+ width: 96,
48
+ height: 96,
49
+ labels: ["flow", "approval", "suspend"],
50
+ metadata: {
51
+ title: "Human approval",
52
+ description: "Suspends execution until a human approves or rejects. Emits the approved value or a rejection.",
53
+ approvers: [],
54
+ timeoutMs: 86400000,
55
+ },
56
+ }),
57
+ model()
58
+ ], HumanApprovalFlowNode);
59
+ export { HumanApprovalFlowNode };
60
+ //# sourceMappingURL=human-approval.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"human-approval.js","sourceRoot":"","sources":["../../../../../src/graph/nodes/flow-control/human-approval.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;GAKG;AACH,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,oCAA+B;AACnD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,8BAAyB;AAEvD,sDAAsD;AACtD,iCAA4B;AAkBrB,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,KAAK;CAe/C,CAAA;AAXC;IAHC,QAAQ,EAAE;IACV,SAAS,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC;IACtF,KAAK,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;;oDACX;AAKhB;IAHC,QAAQ,EAAE;IACV,SAAS,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;IAC9E,MAAM,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;;uDACZ;AAKnB;IAHC,QAAQ,EAAE;IACV,SAAS,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;IAC9E,MAAM,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;;uDACZ;AAdR,qBAAqB;IAhBjC,IAAI,CAAC,yBAAyB,EAAE;QAC/B,IAAI,EAAE,yBAAyB;QAC/B,QAAQ,EAAE,cAAc;QACxB,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,eAAe;QACrB,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,MAAM,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC;QACvC,QAAQ,EAAE;YACR,KAAK,EAAE,gBAAgB;YACvB,WAAW,EAAE,gGAAgG;YAC7G,SAAS,EAAE,EAAE;YACb,SAAS,EAAE,QAAQ;SACpB;KACF,CAAC;IACD,KAAK,EAAE;GACK,qBAAqB,CAejC"}
@@ -0,0 +1,62 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ /**
11
+ * @module ui-decorators/graph/nodes/flow-control/if
12
+ * @summary If flow-control node declaration (DECAF-32 §22.2.2).
13
+ * @description If — conditional branch. Evaluates a `ConditionExpression`
14
+ * (§22.3) and routes the input to the `then` or `else` output. A graph-level
15
+ * macro: the engine's planner recognises it as an ordinary executable node
16
+ * (§5.7) but it has no built-in executor — downstream projects register
17
+ * custom executors or compile it into composition APIs (§22.2.2).
18
+ */
19
+ import { Model, model, required } from "@decaf-ts/decorator-validation";
20
+ import { uielement } from "./../../../ui/decorators.js";
21
+ import { input, node, output } from "./../../decorators.js";
22
+ // Ensure category styles are registered (idempotent).
23
+ import "./../category-styles.js";
24
+ let IfFlowNode = class IfFlowNode extends Model {
25
+ };
26
+ __decorate([
27
+ required(),
28
+ uielement("textarea", { label: "Input value", placeholder: "Value to evaluate" }),
29
+ input({ handle: "value" }),
30
+ __metadata("design:type", Object)
31
+ ], IfFlowNode.prototype, "value", void 0);
32
+ __decorate([
33
+ required(),
34
+ uielement("input", { label: "Then", placeholder: "Output when condition is true" }),
35
+ output({ handle: "then" }),
36
+ __metadata("design:type", Object)
37
+ ], IfFlowNode.prototype, "then", void 0);
38
+ __decorate([
39
+ required(),
40
+ uielement("input", { label: "Else", placeholder: "Output when condition is false" }),
41
+ output({ handle: "else" }),
42
+ __metadata("design:type", Object)
43
+ ], IfFlowNode.prototype, "else", void 0);
44
+ IfFlowNode = __decorate([
45
+ node("core.flow.if", {
46
+ kind: "core.flow.if",
47
+ category: "Flow Control",
48
+ color: "#f59e0b",
49
+ icon: "ti-arrows-split-2",
50
+ width: 96,
51
+ height: 96,
52
+ labels: ["flow", "conditional", "branch"],
53
+ metadata: {
54
+ title: "If",
55
+ description: "Conditional branch. Evaluates the configured condition and routes the input to the matching output.",
56
+ condition: { op: "eq", left: { const: true }, right: { const: true } },
57
+ },
58
+ }),
59
+ model()
60
+ ], IfFlowNode);
61
+ export { IfFlowNode };
62
+ //# sourceMappingURL=if.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"if.js","sourceRoot":"","sources":["../../../../../src/graph/nodes/flow-control/if.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,oCAA+B;AACnD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,8BAAyB;AAEvD,sDAAsD;AACtD,iCAA4B;AAiBrB,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,KAAK;CAepC,CAAA;AAXC;IAHC,QAAQ,EAAE;IACV,SAAS,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAC;IACjF,KAAK,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;;yCACX;AAKhB;IAHC,QAAQ,EAAE;IACV,SAAS,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;IACnF,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;;wCACZ;AAKf;IAHC,QAAQ,EAAE;IACV,SAAS,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;IACpF,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;;wCACZ;AAdJ,UAAU;IAftB,IAAI,CAAC,cAAc,EAAE;QACpB,IAAI,EAAE,cAAc;QACpB,QAAQ,EAAE,cAAc;QACxB,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,mBAAmB;QACzB,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,MAAM,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,QAAQ,CAAC;QACzC,QAAQ,EAAE;YACR,KAAK,EAAE,IAAI;YACX,WAAW,EAAE,qGAAqG;YAClH,SAAS,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;SACvE;KACF,CAAC;IACD,KAAK,EAAE;GACK,UAAU,CAetB"}
@@ -0,0 +1,52 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ /**
11
+ * @module ui-decorators/graph/nodes/flow-control/parallel
12
+ * @summary Parallel flow-control node declaration (DECAF-32 §22.2.2).
13
+ * @description Parallel — splits execution into concurrent branches.
14
+ */
15
+ import { Model, model, required } from "@decaf-ts/decorator-validation";
16
+ import { uielement } from "./../../../ui/decorators.js";
17
+ import { input, node, output } from "./../../decorators.js";
18
+ // Ensure category styles are registered (idempotent).
19
+ import "./../category-styles.js";
20
+ let ParallelFlowNode = class ParallelFlowNode extends Model {
21
+ };
22
+ __decorate([
23
+ required(),
24
+ uielement("textarea", { label: "Input value", placeholder: "Value to fan out" }),
25
+ input({ handle: "value" }),
26
+ __metadata("design:type", Object)
27
+ ], ParallelFlowNode.prototype, "value", void 0);
28
+ __decorate([
29
+ required(),
30
+ uielement("input", { label: "Branches", placeholder: "Collected branch outputs" }),
31
+ output({ handle: "branches" }),
32
+ __metadata("design:type", Array)
33
+ ], ParallelFlowNode.prototype, "branches", void 0);
34
+ ParallelFlowNode = __decorate([
35
+ node("core.flow.parallel", {
36
+ kind: "core.flow.parallel",
37
+ category: "Flow Control",
38
+ color: "#06b6d4",
39
+ icon: "ti-arrows-vertical",
40
+ width: 96,
41
+ height: 96,
42
+ labels: ["flow", "parallel", "concurrent"],
43
+ metadata: {
44
+ title: "Parallel",
45
+ description: "Splits execution into concurrent branches. All branches run in parallel and outputs are collected.",
46
+ branchCount: 2,
47
+ },
48
+ }),
49
+ model()
50
+ ], ParallelFlowNode);
51
+ export { ParallelFlowNode };
52
+ //# sourceMappingURL=parallel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parallel.js","sourceRoot":"","sources":["../../../../../src/graph/nodes/flow-control/parallel.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;;GAIG;AACH,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,oCAA+B;AACnD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,8BAAyB;AAEvD,sDAAsD;AACtD,iCAA4B;AAiBrB,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,KAAK;CAU1C,CAAA;AANC;IAHC,QAAQ,EAAE;IACV,SAAS,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;IAChF,KAAK,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;;+CACX;AAKhB;IAHC,QAAQ,EAAE;IACV,SAAS,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,0BAA0B,EAAE,CAAC;IAClF,MAAM,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;;kDACV;AATV,gBAAgB;IAf5B,IAAI,CAAC,oBAAoB,EAAE;QAC1B,IAAI,EAAE,oBAAoB;QAC1B,QAAQ,EAAE,cAAc;QACxB,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,oBAAoB;QAC1B,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,MAAM,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,YAAY,CAAC;QAC1C,QAAQ,EAAE;YACR,KAAK,EAAE,UAAU;YACjB,WAAW,EAAE,oGAAoG;YACjH,WAAW,EAAE,CAAC;SACf;KACF,CAAC;IACD,KAAK,EAAE;GACK,gBAAgB,CAU5B"}
@@ -0,0 +1,112 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ /**
11
+ * @module ui-decorators/graph/nodes/flow-control/switch
12
+ * @summary Switch flow-control node declaration (DECAF-32 §22.2.2).
13
+ * @description Switch — multi-branch. Routes the input to one of the case
14
+ * output ports or `default` based on matching conditions. Each case defines
15
+ * a `SwitchCaseCondition` (graphical or code mode) and a dedicated output
16
+ * port. Cases are stored in `metadata.switch.cases` and the renderer creates
17
+ * dynamic output ports from them (DECAF-32 §22.2.2).
18
+ *
19
+ * The node grows in height as cases are added. Each case gets its own
20
+ * output port on the right side, labeled with the case label.
21
+ */
22
+ import { model, required } from "@decaf-ts/decorator-validation";
23
+ import { uielement } from "./../../../ui/decorators.js";
24
+ import { input, node, output, } from "./../../decorators.js";
25
+ import { PortDirection, } from "./../../constants.js";
26
+ import { graphDefinitionOf } from "./../../reader.js";
27
+ import { GraphNode } from "./../base.js";
28
+ // Ensure category styles are registered (idempotent).
29
+ import "./../category-styles.js";
30
+ let SwitchFlowNode = class SwitchFlowNode extends GraphNode {
31
+ /**
32
+ * Computes the node's ports, size, and data patch from the given switch
33
+ * metadata. Each case gets its own output port on the right side; the
34
+ * `default` port always renders **last** (DECAF-32 §21 port-ordering rule,
35
+ * DECAF-34 §6.2). When `hasDefault` is `false`, the `default` output port
36
+ * is omitted entirely. The node grows in height as cases are added.
37
+ *
38
+ * @param meta - The switch metadata patch (`metadata.switch`), carrying
39
+ * the cases and the optional default-port configuration.
40
+ * @returns The computed {@link NodeMetadataChange}: reordered ports
41
+ * (case outputs inserted before the optional default), the grown size,
42
+ * and the `switchMetadata` data patch.
43
+ */
44
+ static applyMetadata(meta) {
45
+ const definition = graphDefinitionOf(this);
46
+ const defaultPortName = meta.defaultPort ?? "default";
47
+ const hasDefault = meta.hasDefault === true;
48
+ // Base ports excluding any port that collides with a case output port.
49
+ const basePorts = definition.ports.filter((p) => !meta.cases.some((c) => c.outputPort === p.property));
50
+ // Separate the default output port so it can be placed last (or omitted).
51
+ const nonDefaultPorts = basePorts.filter((p) => p.property !== defaultPortName);
52
+ const defaultPort = basePorts.find((p) => p.property === defaultPortName);
53
+ const casePorts = meta.cases.map((c) => ({
54
+ property: c.outputPort,
55
+ name: c.label,
56
+ direction: PortDirection.OUTPUT,
57
+ label: c.label,
58
+ required: false,
59
+ hidden: false,
60
+ path: c.outputPort,
61
+ }));
62
+ // Port order: inputs/non-default outputs first, case outputs next, default last.
63
+ const ports = [...nonDefaultPorts, ...casePorts];
64
+ if (hasDefault && defaultPort) {
65
+ ports.push(defaultPort);
66
+ }
67
+ const caseCount = meta.cases.length;
68
+ return {
69
+ ports,
70
+ size: {
71
+ width: definition.width ?? 120,
72
+ height: caseCount > 0 ? 140 + caseCount * 24 : definition.height ?? 140,
73
+ },
74
+ dataPatch: { switchMetadata: meta },
75
+ };
76
+ }
77
+ };
78
+ __decorate([
79
+ required(),
80
+ uielement("textarea", { label: "Input value", placeholder: "Value to switch on" }),
81
+ input({ handle: "value" }),
82
+ __metadata("design:type", Object)
83
+ ], SwitchFlowNode.prototype, "value", void 0);
84
+ __decorate([
85
+ required(),
86
+ uielement("input", { label: "Default", placeholder: "Default output when no case matches" }),
87
+ output({ handle: "default" }),
88
+ __metadata("design:type", Object)
89
+ ], SwitchFlowNode.prototype, "default", void 0);
90
+ SwitchFlowNode = __decorate([
91
+ node("core.flow.switch", {
92
+ kind: "core.flow.switch",
93
+ category: "Flow Control",
94
+ color: "#f97316",
95
+ icon: "ti-arrows-shuffle",
96
+ width: 120,
97
+ height: 140,
98
+ labels: ["flow", "switch", "multi-branch"],
99
+ metadata: {
100
+ title: "Switch",
101
+ description: "Multi-branch switch. Routes the input to the first matching case output, or the default output.",
102
+ switch: {
103
+ cases: [],
104
+ defaultPort: "default",
105
+ hasDefault: false,
106
+ },
107
+ },
108
+ }),
109
+ model()
110
+ ], SwitchFlowNode);
111
+ export { SwitchFlowNode };
112
+ //# sourceMappingURL=switch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switch.js","sourceRoot":"","sources":["../../../../../src/graph/nodes/flow-control/switch.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,oCAA+B;AACnD,OAAO,EACL,KAAK,EACL,IAAI,EACJ,MAAM,GACP,8BAAyB;AAC1B,OAAO,EACL,aAAa,GAEd,6BAAwB;AACzB,OAAO,EAAE,iBAAiB,EAAE,0BAAqB;AAEjD,OAAO,EAAE,SAAS,EAAE,qBAAgB;AAEpC,sDAAsD;AACtD,iCAA4B;AAqBrB,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,SAAS;IAW3C;;;;;;;;;;;;OAYG;IACH,MAAM,CAAU,aAAa,CAAC,IAAwB;QACpD,MAAM,UAAU,GAAG,iBAAiB,CAAC,IAAa,CAAC,CAAC;QACpD,MAAM,eAAe,GAAG,IAAI,CAAC,WAAW,IAAI,SAAS,CAAC;QACtD,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC;QAE5C,uEAAuE;QACvE,MAAM,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC,MAAM,CACvC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC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AI,EAAE;SACpC,CAAC;IACJ,CAAC;CACF,CAAA;AA7DC;IAHC,QAAQ,EAAE;IACV,SAAS,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAC;IAClF,KAAK,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;;6CACX;AAKhB;IAHC,QAAQ,EAAE;IACV,SAAS,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,qCAAqC,EAAE,CAAC;IAC5F,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;;+CACZ;AATP,cAAc;IAnB1B,IAAI,CAAC,kBAAkB,EAAE;QACxB,IAAI,EAAE,kBAAkB;QACxB,QAAQ,EAAE,cAAc;QACxB,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,mBAAmB;QACzB,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,MAAM,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,cAAc,CAAC;QAC1C,QAAQ,EAAE;YACR,KAAK,EAAE,QAAQ;YACf,WAAW,EAAE,iGAAiG;YAC9G,MAAM,EAAE;gBACN,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,SAAS;gBACtB,UAAU,EAAE,KAAK;aAClB;SACF;KACF,CAAC;IACD,KAAK,EAAE;GACK,cAAc,CAiE1B"}
@@ -0,0 +1,105 @@
1
+ /**
2
+ * @module ui-decorators/graph/nodes
3
+ * @summary Shared node kind declarations (DECAF-32 §22.2, DECAF-50 Phase A).
4
+ * @description Canonical `@node`-decorated classes for the ALFRED-5 node kind
5
+ * taxonomy, laid out one node per file under `nodes/<category>/<node>.ts`:
6
+ * triggers (§22.2.1), flow-control and utility nodes (§22.2.2–22.2.3), the
7
+ * Agent node (§21.3), the three loop kinds (`core.loop.foreach/while/until`,
8
+ * §5.9), and the workflow input-value boundary node. Shared non-node support
9
+ * (base class, category styles, manifests) lives in sibling files under the
10
+ * same tree. Consumers (for-angular, ALFRED, etc.) import these declarations
11
+ * to populate node palettes, registries, and reference snapshots.
12
+ */
13
+ export * from "./base.js";
14
+ export * from "./category-styles.js";
15
+ export * from "./flow-control/break.js";
16
+ export * from "./flow-control/error-boundary.js";
17
+ export * from "./flow-control/human-approval.js";
18
+ export * from "./flow-control/if.js";
19
+ export * from "./flow-control/parallel.js";
20
+ export * from "./flow-control/switch.js";
21
+ export * from "./utility/code.js";
22
+ export * from "./utility/delay.js";
23
+ export * from "./utility/log.js";
24
+ export * from "./utility/map.js";
25
+ export * from "./utility/merge.js";
26
+ export * from "./utility/return.js";
27
+ export * from "./utility/utility-log.js";
28
+ export * from "./triggers/chat.js";
29
+ export * from "./triggers/event.js";
30
+ export * from "./triggers/form.js";
31
+ export * from "./triggers/manual.js";
32
+ export * from "./triggers/schedule.js";
33
+ export * from "./triggers/webhook.js";
34
+ export * from "./agents/agent.js";
35
+ export * from "./loops/foreach.js";
36
+ export * from "./loops/until.js";
37
+ export * from "./loops/while.js";
38
+ export * from "./boundary/input-value.js";
39
+ export * from "./manifests.js";
40
+ import { BreakFlowNode } from "./flow-control/break.js";
41
+ import { ErrorBoundaryFlowNode } from "./flow-control/error-boundary.js";
42
+ import { HumanApprovalFlowNode } from "./flow-control/human-approval.js";
43
+ import { IfFlowNode } from "./flow-control/if.js";
44
+ import { ParallelFlowNode } from "./flow-control/parallel.js";
45
+ import { SwitchFlowNode } from "./flow-control/switch.js";
46
+ import { CodeFlowNode } from "./utility/code.js";
47
+ import { DelayFlowNode } from "./utility/delay.js";
48
+ import { LogFlowNode } from "./utility/log.js";
49
+ import { MapFlowNode } from "./utility/map.js";
50
+ import { MergeFlowNode } from "./utility/merge.js";
51
+ import { ReturnFlowNode } from "./utility/return.js";
52
+ import { UtilityLogNode } from "./utility/utility-log.js";
53
+ import { ChatTriggerNode } from "./triggers/chat.js";
54
+ import { EventTriggerNode } from "./triggers/event.js";
55
+ import { FormTriggerNode } from "./triggers/form.js";
56
+ import { ManualTriggerNode } from "./triggers/manual.js";
57
+ import { ScheduleTriggerNode } from "./triggers/schedule.js";
58
+ import { WebhookTriggerNode } from "./triggers/webhook.js";
59
+ import { GraphForeachLoopNode } from "./loops/foreach.js";
60
+ import { GraphUntilLoopNode } from "./loops/until.js";
61
+ import { GraphWhileLoopNode } from "./loops/while.js";
62
+ import { GraphInputValueNode } from "./boundary/input-value.js";
63
+ /**
64
+ * All built-in trigger node constructors.
65
+ */
66
+ export const GRAPH_TRIGGER_NODES = [
67
+ ManualTriggerNode,
68
+ WebhookTriggerNode,
69
+ ScheduleTriggerNode,
70
+ EventTriggerNode,
71
+ FormTriggerNode,
72
+ ChatTriggerNode,
73
+ ];
74
+ /**
75
+ * All built-in flow-control node constructors.
76
+ */
77
+ export const GRAPH_FLOW_CONTROL_NODES = [
78
+ IfFlowNode,
79
+ SwitchFlowNode,
80
+ ParallelFlowNode,
81
+ MergeFlowNode,
82
+ MapFlowNode,
83
+ DelayFlowNode,
84
+ ErrorBoundaryFlowNode,
85
+ HumanApprovalFlowNode,
86
+ ReturnFlowNode,
87
+ CodeFlowNode,
88
+ LogFlowNode,
89
+ UtilityLogNode,
90
+ BreakFlowNode,
91
+ ];
92
+ /**
93
+ * All built-in loop node constructors (shared declarations of the
94
+ * `core.loop.*` system kinds).
95
+ */
96
+ export const GRAPH_LOOP_NODES = [
97
+ GraphForeachLoopNode,
98
+ GraphWhileLoopNode,
99
+ GraphUntilLoopNode,
100
+ ];
101
+ /**
102
+ * All built-in boundary node constructors.
103
+ */
104
+ export const GRAPH_BOUNDARY_NODES = [GraphInputValueNode];
105
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/graph/nodes/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,0BAAuB;AACvB,qCAAkC;AAClC,wCAAqC;AACrC,iDAA8C;AAC9C,iDAA8C;AAC9C,qCAAk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