@antelopejs/dms-automation 0.2.7 → 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 (312) hide show
  1. package/README.md +46 -2
  2. package/dist/data/procedures-table.d.ts +38 -4
  3. package/dist/data/procedures-table.js +264 -82
  4. package/dist/data/procedures-table.js.map +1 -1
  5. package/dist/data/runs-table.d.ts +19 -3
  6. package/dist/data/runs-table.js +254 -19
  7. package/dist/data/runs-table.js.map +1 -1
  8. package/dist/db/index.d.ts +1 -2
  9. package/dist/db/index.js +1 -2
  10. package/dist/db/index.js.map +1 -1
  11. package/dist/db/models/automation_template.model.d.ts +16 -1
  12. package/dist/db/models/automation_template.model.js +31 -11
  13. package/dist/db/models/automation_template.model.js.map +1 -1
  14. package/dist/db/models/index.d.ts +1 -1
  15. package/dist/db/models/index.js +1 -1
  16. package/dist/db/models/procedure.model.d.ts +1 -0
  17. package/dist/db/models/procedure.model.js +7 -0
  18. package/dist/db/models/procedure.model.js.map +1 -1
  19. package/dist/db/models/procedure_run.model.d.ts +16 -9
  20. package/dist/db/models/procedure_run.model.js +96 -17
  21. package/dist/db/models/procedure_run.model.js.map +1 -1
  22. package/dist/db/models/stats.model.d.ts +60 -61
  23. package/dist/db/models/stats.model.js +189 -236
  24. package/dist/db/models/stats.model.js.map +1 -1
  25. package/dist/db/models/type_switch.model.d.ts +25 -0
  26. package/dist/db/models/type_switch.model.js +25 -0
  27. package/dist/db/models/type_switch.model.js.map +1 -0
  28. package/dist/db/tables/index.d.ts +1 -2
  29. package/dist/db/tables/index.js +1 -2
  30. package/dist/db/tables/index.js.map +1 -1
  31. package/dist/db/tables/procedure.table.d.ts +6 -0
  32. package/dist/db/tables/procedure.table.js +24 -0
  33. package/dist/db/tables/procedure.table.js.map +1 -1
  34. package/dist/db/tables/procedure_run.table.d.ts +15 -1
  35. package/dist/db/tables/procedure_run.table.js +54 -0
  36. package/dist/db/tables/procedure_run.table.js.map +1 -1
  37. package/dist/db/tables/type_switch.table.d.ts +8 -0
  38. package/dist/db/tables/{trigger_type_config.table.js → type_switch.table.js} +16 -15
  39. package/dist/db/tables/type_switch.table.js.map +1 -0
  40. package/dist/displays/index.d.ts +14 -0
  41. package/dist/displays/index.js +23 -0
  42. package/dist/displays/index.js.map +1 -0
  43. package/dist/index.d.ts +7 -0
  44. package/dist/index.js +8 -0
  45. package/dist/index.js.map +1 -1
  46. package/dist/pages/builder.d.ts +1 -1
  47. package/dist/pages/builder.js +10 -3
  48. package/dist/pages/builder.js.map +1 -1
  49. package/dist/pages/index.d.ts +2 -1
  50. package/dist/pages/index.js +2 -1
  51. package/dist/pages/index.js.map +1 -1
  52. package/dist/pages/library.d.ts +2 -1
  53. package/dist/pages/library.js +54 -4
  54. package/dist/pages/library.js.map +1 -1
  55. package/dist/pages/overview.d.ts +6 -1
  56. package/dist/pages/overview.js +121 -2
  57. package/dist/pages/overview.js.map +1 -1
  58. package/dist/pages/procedures.js +106 -16
  59. package/dist/pages/procedures.js.map +1 -1
  60. package/dist/pages/runs.d.ts +4 -1
  61. package/dist/pages/runs.js +109 -13
  62. package/dist/pages/runs.js.map +1 -1
  63. package/dist/pages/shared.d.ts +18 -0
  64. package/dist/pages/shared.js +238 -0
  65. package/dist/pages/shared.js.map +1 -0
  66. package/dist/pages/trace.d.ts +10 -0
  67. package/dist/pages/trace.js +41 -0
  68. package/dist/pages/trace.js.map +1 -0
  69. package/dist/realtime.d.ts +3 -0
  70. package/dist/realtime.js +14 -0
  71. package/dist/realtime.js.map +1 -0
  72. package/dist/routes/action-types.d.ts +2 -14
  73. package/dist/routes/action-types.js +2 -32
  74. package/dist/routes/action-types.js.map +1 -1
  75. package/dist/routes/deleteConfirm.d.ts +3 -0
  76. package/dist/routes/deleteConfirm.js +64 -0
  77. package/dist/routes/deleteConfirm.js.map +1 -0
  78. package/dist/routes/graphSchema.d.ts +3 -90
  79. package/dist/routes/graphSchema.js +36 -9
  80. package/dist/routes/graphSchema.js.map +1 -1
  81. package/dist/routes/index.d.ts +1 -0
  82. package/dist/routes/index.js +1 -0
  83. package/dist/routes/index.js.map +1 -1
  84. package/dist/routes/library.d.ts +40 -0
  85. package/dist/routes/library.js +147 -0
  86. package/dist/routes/library.js.map +1 -0
  87. package/dist/routes/procedureChecks.d.ts +16 -0
  88. package/dist/routes/procedureChecks.js +72 -0
  89. package/dist/routes/procedureChecks.js.map +1 -0
  90. package/dist/routes/procedureRuns.d.ts +21 -0
  91. package/dist/routes/procedureRuns.js +45 -0
  92. package/dist/routes/procedureRuns.js.map +1 -0
  93. package/dist/routes/procedureSchemas.d.ts +107 -0
  94. package/dist/routes/procedureSchemas.js +61 -0
  95. package/dist/routes/procedureSchemas.js.map +1 -0
  96. package/dist/routes/procedures.d.ts +125 -7
  97. package/dist/routes/procedures.js +363 -67
  98. package/dist/routes/procedures.js.map +1 -1
  99. package/dist/routes/requests.d.ts +15 -0
  100. package/dist/routes/requests.js +35 -0
  101. package/dist/routes/requests.js.map +1 -0
  102. package/dist/routes/runs.d.ts +107 -2
  103. package/dist/routes/runs.js +340 -37
  104. package/dist/routes/runs.js.map +1 -1
  105. package/dist/routes/stats.d.ts +19 -1
  106. package/dist/routes/stats.js +160 -4
  107. package/dist/routes/stats.js.map +1 -1
  108. package/dist/routes/templates.d.ts +6 -2
  109. package/dist/routes/templates.js +106 -36
  110. package/dist/routes/templates.js.map +1 -1
  111. package/dist/routes/trigger-types.d.ts +2 -15
  112. package/dist/routes/trigger-types.js +2 -32
  113. package/dist/routes/trigger-types.js.map +1 -1
  114. package/dist/routes/typeConfigShared.d.ts +7 -11
  115. package/dist/routes/typeConfigShared.js +25 -15
  116. package/dist/routes/typeConfigShared.js.map +1 -1
  117. package/dist/runtime/armErrors.d.ts +16 -0
  118. package/dist/runtime/armErrors.js +69 -0
  119. package/dist/runtime/armErrors.js.map +1 -0
  120. package/dist/runtime/boundRunLog.d.ts +24 -0
  121. package/dist/runtime/boundRunLog.js +202 -10
  122. package/dist/runtime/boundRunLog.js.map +1 -1
  123. package/dist/runtime/builtins/actions/http.d.ts +10 -1
  124. package/dist/runtime/builtins/actions/http.js +306 -19
  125. package/dist/runtime/builtins/actions/http.js.map +1 -1
  126. package/dist/runtime/builtins/actions/log.js +2 -2
  127. package/dist/runtime/builtins/actions/log.js.map +1 -1
  128. package/dist/runtime/builtins/data/boolean.d.ts +1 -0
  129. package/dist/runtime/builtins/data/boolean.js +18 -10
  130. package/dist/runtime/builtins/data/boolean.js.map +1 -1
  131. package/dist/runtime/builtins/data/compare.js +60 -11
  132. package/dist/runtime/builtins/data/compare.js.map +1 -1
  133. package/dist/runtime/builtins/data/constant.js +9 -12
  134. package/dist/runtime/builtins/data/constant.js.map +1 -1
  135. package/dist/runtime/builtins/data/json.js +4 -4
  136. package/dist/runtime/builtins/data/json.js.map +1 -1
  137. package/dist/runtime/builtins/data/math.js +44 -24
  138. package/dist/runtime/builtins/data/math.js.map +1 -1
  139. package/dist/runtime/builtins/data/object.js +10 -10
  140. package/dist/runtime/builtins/data/object.js.map +1 -1
  141. package/dist/runtime/builtins/data/string.js +31 -20
  142. package/dist/runtime/builtins/data/string.js.map +1 -1
  143. package/dist/runtime/builtins/nodes/action.js +4 -0
  144. package/dist/runtime/builtins/nodes/action.js.map +1 -1
  145. package/dist/runtime/builtins/nodes/delay.js +1 -1
  146. package/dist/runtime/builtins/nodes/delay.js.map +1 -1
  147. package/dist/runtime/builtins/nodes/forRange.d.ts +1 -1
  148. package/dist/runtime/builtins/nodes/forRange.js +10 -4
  149. package/dist/runtime/builtins/nodes/forRange.js.map +1 -1
  150. package/dist/runtime/builtins/nodes/if.js +2 -1
  151. package/dist/runtime/builtins/nodes/if.js.map +1 -1
  152. package/dist/runtime/builtins/nodes/parallel.js +9 -2
  153. package/dist/runtime/builtins/nodes/parallel.js.map +1 -1
  154. package/dist/runtime/builtins/nodes/retry.js +1 -1
  155. package/dist/runtime/builtins/nodes/retry.js.map +1 -1
  156. package/dist/runtime/builtins/nodes/setVariable.js +1 -3
  157. package/dist/runtime/builtins/nodes/setVariable.js.map +1 -1
  158. package/dist/runtime/builtins/triggers/cron.d.ts +3 -0
  159. package/dist/runtime/builtins/triggers/cron.js +21 -7
  160. package/dist/runtime/builtins/triggers/cron.js.map +1 -1
  161. package/dist/runtime/builtins/triggers/manual.js +2 -2
  162. package/dist/runtime/builtins/triggers/manual.js.map +1 -1
  163. package/dist/runtime/builtins/triggers/webhook.d.ts +14 -1
  164. package/dist/runtime/builtins/triggers/webhook.js +116 -30
  165. package/dist/runtime/builtins/triggers/webhook.js.map +1 -1
  166. package/dist/runtime/describe.d.ts +23 -0
  167. package/dist/runtime/describe.js +114 -0
  168. package/dist/runtime/describe.js.map +1 -0
  169. package/dist/runtime/executionResult.d.ts +1 -0
  170. package/dist/runtime/executor.js +82 -5
  171. package/dist/runtime/executor.js.map +1 -1
  172. package/dist/runtime/graphIssues.d.ts +20 -0
  173. package/dist/runtime/graphIssues.js +290 -0
  174. package/dist/runtime/graphIssues.js.map +1 -0
  175. package/dist/runtime/graphVersion.d.ts +2 -0
  176. package/dist/runtime/graphVersion.js +43 -0
  177. package/dist/runtime/graphVersion.js.map +1 -0
  178. package/dist/runtime/nodeKinds.d.ts +4 -4
  179. package/dist/runtime/nodeKinds.js +1 -2
  180. package/dist/runtime/nodeKinds.js.map +1 -1
  181. package/dist/runtime/registry.d.ts +2 -1
  182. package/dist/runtime/registry.js +1 -2
  183. package/dist/runtime/registry.js.map +1 -1
  184. package/dist/runtime/resolveInputs.d.ts +3 -1
  185. package/dist/runtime/resolveInputs.js +12 -2
  186. package/dist/runtime/resolveInputs.js.map +1 -1
  187. package/dist/runtime/resolveSubgraph.d.ts +12 -1
  188. package/dist/runtime/resolveSubgraph.js +36 -0
  189. package/dist/runtime/resolveSubgraph.js.map +1 -1
  190. package/dist/runtime/retention.d.ts +6 -0
  191. package/dist/runtime/retention.js +54 -0
  192. package/dist/runtime/retention.js.map +1 -0
  193. package/dist/runtime/runProcedure.d.ts +12 -0
  194. package/dist/runtime/runProcedure.js +130 -0
  195. package/dist/runtime/runProcedure.js.map +1 -0
  196. package/dist/runtime/schedule.d.ts +2 -0
  197. package/dist/runtime/schedule.js +139 -0
  198. package/dist/runtime/schedule.js.map +1 -0
  199. package/dist/runtime/subscriptions.d.ts +11 -1
  200. package/dist/runtime/subscriptions.js +91 -125
  201. package/dist/runtime/subscriptions.js.map +1 -1
  202. package/dist/runtime/subwalk.js +2 -3
  203. package/dist/runtime/subwalk.js.map +1 -1
  204. package/dist/runtime/templateUsages.d.ts +4 -0
  205. package/dist/runtime/templateUsages.js +102 -0
  206. package/dist/runtime/templateUsages.js.map +1 -0
  207. package/dist/runtime/topo.d.ts +1 -0
  208. package/dist/runtime/topo.js +23 -0
  209. package/dist/runtime/topo.js.map +1 -1
  210. package/dist/runtime/trace.d.ts +44 -0
  211. package/dist/runtime/trace.js +240 -0
  212. package/dist/runtime/trace.js.map +1 -0
  213. package/dist/runtime/typeSwitches.d.ts +3 -0
  214. package/dist/runtime/typeSwitches.js +27 -0
  215. package/dist/runtime/typeSwitches.js.map +1 -0
  216. package/dist/runtime/validate.d.ts +11 -0
  217. package/dist/runtime/validate.js +118 -61
  218. package/dist/runtime/validate.js.map +1 -1
  219. package/dist/runtime/webhookRoutes.d.ts +4 -0
  220. package/dist/runtime/webhookRoutes.js +68 -0
  221. package/dist/runtime/webhookRoutes.js.map +1 -0
  222. package/dist/runtime/withTimeout.d.ts +1 -0
  223. package/dist/runtime/withTimeout.js +17 -0
  224. package/dist/runtime/withTimeout.js.map +1 -0
  225. package/dist/runtime/wording.d.ts +10 -0
  226. package/dist/runtime/wording.js +118 -0
  227. package/dist/runtime/wording.js.map +1 -0
  228. package/dist/stats/health-banner.d.ts +13 -0
  229. package/dist/stats/health-banner.js +149 -0
  230. package/dist/stats/health-banner.js.map +1 -0
  231. package/dist/stats/health.d.ts +49 -0
  232. package/dist/stats/health.js +130 -0
  233. package/dist/stats/health.js.map +1 -0
  234. package/dist/stats/kpi.d.ts +21 -0
  235. package/dist/stats/kpi.js +101 -0
  236. package/dist/stats/kpi.js.map +1 -0
  237. package/dist/stats/overview.d.ts +94 -0
  238. package/dist/stats/overview.js +244 -0
  239. package/dist/stats/overview.js.map +1 -0
  240. package/dist/types/constants.d.ts +0 -1
  241. package/dist/types/constants.js +1 -2
  242. package/dist/types/constants.js.map +1 -1
  243. package/dist/types/runLog.d.ts +2 -0
  244. package/dist/types/runLog.js +4 -0
  245. package/dist/types/runLog.js.map +1 -1
  246. package/frontend-vue/app/components/AttentionList.vue +276 -0
  247. package/frontend-vue/app/components/Catalog/SchemaTable.vue +127 -0
  248. package/frontend-vue/app/components/Catalog.vue +457 -0
  249. package/frontend-vue/app/components/Editor/BottomDock.vue +188 -0
  250. package/frontend-vue/app/components/Editor/BuilderPalette.vue +101 -45
  251. package/frontend-vue/app/components/Editor/GraphCanvas.vue +818 -206
  252. package/frontend-vue/app/components/Editor/GroupPortEditor.vue +29 -18
  253. package/frontend-vue/app/components/Editor/JsonField.vue +3 -3
  254. package/frontend-vue/app/components/Editor/NewProcedureDialog.vue +108 -0
  255. package/frontend-vue/app/components/Editor/NodeInspector.vue +373 -101
  256. package/frontend-vue/app/components/Editor/ProcedureSwitcher.vue +147 -0
  257. package/frontend-vue/app/components/Editor/RunNowDialog.vue +145 -0
  258. package/frontend-vue/app/components/Editor/WiredField.vue +3 -3
  259. package/frontend-vue/app/components/Editor/nodes/GenericNode.vue +97 -91
  260. package/frontend-vue/app/components/Editor/nodes/GroupNode.vue +5 -6
  261. package/frontend-vue/app/components/Editor/nodes/GroupSentinel.vue +3 -2
  262. package/frontend-vue/app/components/Editor/nodes/styles.ts +14 -18
  263. package/frontend-vue/app/components/Editor.vue +1894 -705
  264. package/frontend-vue/app/components/IconPicker.vue +122 -0
  265. package/frontend-vue/app/components/LiveTopics.vue +20 -0
  266. package/frontend-vue/app/components/Run/RunCompare.vue +115 -0
  267. package/frontend-vue/app/components/Run/RunFailure.vue +54 -0
  268. package/frontend-vue/app/components/Run/RunLogList.vue +167 -0
  269. package/frontend-vue/app/components/Run/RunPathTaken.vue +139 -0
  270. package/frontend-vue/app/components/Run/RunPayload.vue +85 -0
  271. package/frontend-vue/app/components/Run/RunWaterfall.vue +374 -0
  272. package/frontend-vue/app/components/RunPeek.vue +132 -0
  273. package/frontend-vue/app/components/RunTrace.vue +462 -0
  274. package/frontend-vue/app/components/Templates.vue +382 -537
  275. package/frontend-vue/app/components/WebhookEndpoint.vue +81 -0
  276. package/frontend-vue/app/composables/useAutomationNodeKinds.ts +23 -6
  277. package/frontend-vue/app/composables/useAutomationRuns.ts +160 -25
  278. package/frontend-vue/app/composables/useGraphConnect.ts +103 -51
  279. package/frontend-vue/app/composables/useRunActions.ts +60 -0
  280. package/frontend-vue/app/plugins/cell-displays.ts +169 -0
  281. package/frontend-vue/app/utils/automation.ts +4 -36
  282. package/frontend-vue/app/utils/describe.ts +252 -0
  283. package/frontend-vue/app/utils/redactedHeaders.ts +31 -0
  284. package/frontend-vue/dms.frontend.build.ts +7 -0
  285. package/frontend-vue/dms.frontend.ts +7 -4
  286. package/frontend-vue/i18n/locales/dms-automation-en-GB.json +1149 -309
  287. package/frontend-vue/i18n/locales/dms-automation-fr-FR.json +1154 -314
  288. package/frontend-vue/package.json +1 -1
  289. package/package.json +7 -5
  290. package/dist/db/models/type_config.model.d.ts +0 -47
  291. package/dist/db/models/type_config.model.js +0 -51
  292. package/dist/db/models/type_config.model.js.map +0 -1
  293. package/dist/db/tables/action_type_config.table.d.ts +0 -7
  294. package/dist/db/tables/action_type_config.table.js +0 -35
  295. package/dist/db/tables/action_type_config.table.js.map +0 -1
  296. package/dist/db/tables/trigger_type_config.table.d.ts +0 -7
  297. package/dist/db/tables/trigger_type_config.table.js.map +0 -1
  298. package/frontend-vue/app/components/Actions.vue +0 -151
  299. package/frontend-vue/app/components/Catalog/TypeConfigForm.vue +0 -170
  300. package/frontend-vue/app/components/Catalog/TypeList.vue +0 -203
  301. package/frontend-vue/app/components/DataNodes.vue +0 -275
  302. package/frontend-vue/app/components/Editor/ProcedureList.vue +0 -156
  303. package/frontend-vue/app/components/Editor/RunsDrawer.vue +0 -312
  304. package/frontend-vue/app/components/Library.vue +0 -69
  305. package/frontend-vue/app/components/Overview.vue +0 -503
  306. package/frontend-vue/app/components/RunDetailDrawer.vue +0 -165
  307. package/frontend-vue/app/components/RunFireTree.vue +0 -170
  308. package/frontend-vue/app/components/RunTraceDrawer.vue +0 -59
  309. package/frontend-vue/app/components/RunsStats.vue +0 -126
  310. package/frontend-vue/app/components/RunsTimelineDisplay.vue +0 -287
  311. package/frontend-vue/app/components/Triggers.vue +0 -147
  312. package/frontend-vue/app/plugins/runs-timeline-display.client.ts +0 -16
@@ -0,0 +1,147 @@
1
+ <script setup lang="ts">
2
+ import { computed, nextTick, ref, watch } from 'vue'
3
+
4
+ // ⌘P: jump to another procedure, by name, with its state; or create one.
5
+
6
+ export interface ProcedureSummaryRow {
7
+ procedureId: string
8
+ name: string
9
+ description: string
10
+ status: 'failing' | 'degraded' | 'healthy' | 'paused' | 'draft'
11
+ }
12
+
13
+ const props = defineProps<{
14
+ procedures: ProcedureSummaryRow[]
15
+ currentId: string | null
16
+ proceduresUrl: string
17
+ }>()
18
+
19
+ const open = defineModel<boolean>('open', { default: false })
20
+
21
+ const emit = defineEmits<{
22
+ (e: 'pick', id: string): void
23
+ (e: 'create'): void
24
+ }>()
25
+
26
+ const STATE_TONES = {
27
+ failing: 'error',
28
+ degraded: 'warning',
29
+ healthy: 'success',
30
+ paused: 'neutral',
31
+ draft: 'info',
32
+ } as const
33
+
34
+ const query = ref('')
35
+ const active = ref(0)
36
+
37
+ // By name, so a procedure is found where it was the last time.
38
+ const visible = computed(() => {
39
+ const q = query.value.trim().toLowerCase()
40
+ return props.procedures
41
+ .filter((p) => !q || p.name.toLowerCase().includes(q) || p.description.toLowerCase().includes(q))
42
+ .sort((a, b) => a.name.localeCompare(b.name, undefined, { numeric: true, sensitivity: 'base' }))
43
+ })
44
+
45
+ // The search field drives the list (a combobox): the active row is announced
46
+ // through aria-activedescendant and kept in view while arrows move it.
47
+ const LIST_ID = 'procedure-switcher-list'
48
+ function optionId(index: number): string {
49
+ return `${LIST_ID}-${index}`
50
+ }
51
+ watch(active, (index) => {
52
+ void nextTick(() => document.getElementById(optionId(index))?.scrollIntoView({ block: 'nearest' }))
53
+ })
54
+
55
+ watch(open, (isOpen) => {
56
+ if (isOpen) {
57
+ query.value = ''
58
+ active.value = 0
59
+ }
60
+ })
61
+ watch(query, () => (active.value = 0))
62
+
63
+ // The pick is announced once the switcher has closed: the builder may open
64
+ // its "Save changes?" dialog in answer, which a closing modal would dismiss.
65
+ let pending: (() => void) | null = null
66
+
67
+ function pick(id: string) {
68
+ if (id !== props.currentId) pending = () => emit('pick', id)
69
+ open.value = false
70
+ }
71
+
72
+ function create() {
73
+ pending = () => emit('create')
74
+ open.value = false
75
+ }
76
+
77
+ function afterLeave() {
78
+ const action = pending
79
+ pending = null
80
+ action?.()
81
+ }
82
+
83
+ function onKey(ev: KeyboardEvent) {
84
+ if (ev.key === 'ArrowDown') {
85
+ ev.preventDefault()
86
+ active.value = Math.min(active.value + 1, visible.value.length - 1)
87
+ } else if (ev.key === 'ArrowUp') {
88
+ ev.preventDefault()
89
+ active.value = Math.max(active.value - 1, 0)
90
+ } else if (ev.key === 'Enter') {
91
+ const row = visible.value[active.value]
92
+ if (row) pick(row.procedureId)
93
+ }
94
+ }
95
+ </script>
96
+
97
+ <template>
98
+ <UModal v-model:open="open" :title="$t('dms_automation.editor.switcher.title')" :ui="{ content: 'max-w-lg' }" @after:leave="afterLeave">
99
+ <template #body>
100
+ <div class="flex flex-col gap-2" @keydown="onKey">
101
+ <DmsSearchInput
102
+ v-model="query"
103
+ autofocus
104
+ :placeholder="$t('dms_automation.editor.switcher.search')"
105
+ class="w-full"
106
+ role="combobox"
107
+ aria-autocomplete="list"
108
+ :aria-expanded="visible.length > 0"
109
+ :aria-controls="LIST_ID"
110
+ :aria-activedescendant="visible[active] ? optionId(active) : undefined"
111
+ />
112
+ <ul :id="LIST_ID" class="flex max-h-80 flex-col overflow-y-auto" role="listbox" :aria-label="$t('dms_automation.editor.switcher.title')">
113
+ <li v-for="(row, index) in visible" :key="row.procedureId" role="presentation">
114
+ <button
115
+ :id="optionId(index)"
116
+ type="button"
117
+ role="option"
118
+ tabindex="-1"
119
+ :aria-selected="index === active"
120
+ class="flex w-full items-center gap-3 rounded-md px-3 py-2 text-left"
121
+ :class="index === active ? 'bg-elevated' : 'hover:bg-elevated/60'"
122
+ @mouseenter="active = index"
123
+ @click="pick(row.procedureId)"
124
+ >
125
+ <DmsStatusPill :tone="STATE_TONES[row.status]" :label="$t(`dms_automation.procedures.status.${row.status}`)" size="sm" />
126
+ <span class="min-w-0 flex-1 truncate text-sm text-highlighted">{{ row.name }}</span>
127
+ <UBadge v-if="row.procedureId === currentId" size="sm" variant="subtle" color="neutral">
128
+ {{ $t('dms_automation.editor.switcher.current') }}
129
+ </UBadge>
130
+ </button>
131
+ </li>
132
+ </ul>
133
+ <p v-if="visible.length === 0" class="py-4 text-center text-xs text-dimmed">{{ $t('dms_automation.editor.switcher.none') }}</p>
134
+ </div>
135
+ </template>
136
+ <template #footer>
137
+ <div class="flex w-full items-center justify-between gap-2">
138
+ <UButton variant="ghost" color="neutral" size="sm" :to="proceduresUrl" @click="open = false">
139
+ {{ $t('dms_automation.editor.switcher.all', { count: procedures.length }) }}
140
+ </UButton>
141
+ <UButton color="primary" size="sm" icon="i-ph-plus" @click="create">
142
+ {{ $t('dms_automation.newProcedure.title') }}
143
+ </UButton>
144
+ </div>
145
+ </template>
146
+ </UModal>
147
+ </template>
@@ -0,0 +1,145 @@
1
+ <script setup lang="ts">
2
+ import { computed, ref, watch } from 'vue'
3
+ import type { WordedTrigger } from '../../utils/describe'
4
+ import { redactedHeadersOf } from '../../utils/redactedHeaders'
5
+
6
+ // "Run now": the saved procedure, run for real with a payload the user can
7
+ // edit, prefilled with the last real one (AU-01, AU-05).
8
+
9
+ const props = defineProps<{
10
+ apiUrl: string
11
+ procedureId: string
12
+ procedureName: string
13
+ triggers: WordedTrigger[]
14
+ }>()
15
+
16
+ const open = defineModel<boolean>('open', { default: false })
17
+ const emit = defineEmits<{ (e: 'started', runId: string): void }>()
18
+
19
+ const { $authFetch } = useAuthFetch()
20
+ const { processText } = useComposedText()
21
+ const { t } = useI18n()
22
+
23
+ const triggerNodeId = ref<string | undefined>(undefined)
24
+ const payload = ref('{}')
25
+ const source = ref<string | null>(null)
26
+ const loadingPayload = ref(false)
27
+ const submitting = ref(false)
28
+ const PAYLOAD_ID = 'run-now-payload'
29
+ const ROW = { layout: 'stack', spacing: 'list', inset: false } as const
30
+ // A payload that is not JSON shows under it; a refused run is a toast.
31
+ const fieldErrors = useFieldErrors({ fields: { payload: PAYLOAD_ID } })
32
+
33
+ // A payload prefilled from a stored run says which secret headers it lacks.
34
+ const redactedHeaders = computed(() => redactedHeadersOf(payload.value))
35
+
36
+ const triggerItems = computed(() =>
37
+ props.triggers.map((trigger) => ({ label: processText(trigger.text), value: trigger.nodeId ?? '' })),
38
+ )
39
+
40
+ async function loadPayload() {
41
+ loadingPayload.value = true
42
+ try {
43
+ const query = triggerNodeId.value ? `?triggerNodeId=${encodeURIComponent(triggerNodeId.value)}` : ''
44
+ const res = await $authFetch<{ last: { runId: string; payload: unknown } | null }>(
45
+ `${props.apiUrl}/procedures/${props.procedureId}/last-payload${query}`,
46
+ )
47
+ payload.value = JSON.stringify(res.last?.payload ?? {}, null, 2)
48
+ source.value = res.last?.runId ?? null
49
+ } catch {
50
+ payload.value = '{}'
51
+ source.value = null
52
+ } finally {
53
+ loadingPayload.value = false
54
+ }
55
+ }
56
+
57
+ watch(open, (isOpen) => {
58
+ if (!isOpen) return
59
+ fieldErrors.clear()
60
+ triggerNodeId.value = props.triggers.find((tr) => tr.typeId === 'manual')?.nodeId ?? props.triggers[0]?.nodeId
61
+ void loadPayload()
62
+ })
63
+ watch(payload, () => fieldErrors.clear('payload'))
64
+ watch(triggerNodeId, () => {
65
+ if (open.value) void loadPayload()
66
+ })
67
+
68
+ async function submit() {
69
+ let body: unknown
70
+ try {
71
+ body = JSON.parse(payload.value || 'null')
72
+ } catch (e) {
73
+ await fieldErrors.setError('payload', t('dms_automation.editor.runNow.invalidJson', { error: (e as Error).message }))
74
+ return
75
+ }
76
+ submitting.value = true
77
+ try {
78
+ const res = await $authFetch<{ runId: string }>(`${props.apiUrl}/procedures/${props.procedureId}/run-now`, {
79
+ method: 'POST',
80
+ body: { payload: body, triggerNodeId: triggerNodeId.value },
81
+ })
82
+ open.value = false
83
+ emit('started', res.runId)
84
+ } catch (e) {
85
+ fieldErrors.toastError(e, { toastTitle: 'dms_automation.common.actionFailed' })
86
+ } finally {
87
+ submitting.value = false
88
+ }
89
+ }
90
+ </script>
91
+
92
+ <template>
93
+ <UModal
94
+ v-model:open="open"
95
+ :title="$t('dms_automation.editor.runNow.title', { name: procedureName })"
96
+ :description="$t('dms_automation.editor.runNow.description')"
97
+ :ui="{ content: 'max-w-xl' }"
98
+ >
99
+ <template #body>
100
+ <div class="flex flex-col gap-4">
101
+ <DmsFieldRow
102
+ v-if="triggers.length > 1"
103
+ v-bind="ROW"
104
+ :label="$t('dms_automation.editor.runNow.trigger')"
105
+ label-for="run-now-trigger"
106
+ >
107
+ <DmsSelect id="run-now-trigger" v-model="triggerNodeId" :items="triggerItems" class="w-full" />
108
+ </DmsFieldRow>
109
+ <DmsFieldRow
110
+ v-bind="ROW"
111
+ :label="$t('dms_automation.editor.runNow.payload')"
112
+ :description="source ? $t('dms_automation.editor.dock.payloadFrom', { run: source.slice(-6) }) : $t('dms_automation.editor.runNow.noPastPayload')"
113
+ :label-for="PAYLOAD_ID"
114
+ >
115
+ <div class="grid gap-1.5">
116
+ <DmsInputCode
117
+ :id="PAYLOAD_ID"
118
+ v-model="payload"
119
+ language="json"
120
+ :min-lines="8"
121
+ :max-lines="16"
122
+ :disabled="loadingPayload"
123
+ v-bind="fieldErrors.aria('payload')"
124
+ />
125
+ <DmsFieldError :id="fieldErrors.errorId('payload')" :message="fieldErrors.errors.payload" />
126
+ </div>
127
+ </DmsFieldRow>
128
+ <DmsBanner
129
+ v-if="redactedHeaders.length"
130
+ size="sm"
131
+ tone="warning"
132
+ icon="i-ph-key"
133
+ :title="$t('dms_automation.editor.runNow.redactedHeaders', { headers: redactedHeaders.join(', ') })"
134
+ />
135
+ <DmsBanner size="sm" tone="warning" icon="i-ph-warning" :title="$t('dms_automation.editor.runNow.sideEffects')" />
136
+ </div>
137
+ </template>
138
+ <template #footer>
139
+ <div class="flex w-full justify-end gap-2">
140
+ <UButton variant="outline" color="neutral" @click="open = false">{{ $t('dms_automation.common.cancel') }}</UButton>
141
+ <UButton color="primary" icon="i-ph-play" :loading="submitting" @click="submit">{{ $t('dms_automation.editor.runNow.submit') }}</UButton>
142
+ </div>
143
+ </template>
144
+ </UModal>
145
+ </template>
@@ -5,7 +5,6 @@ interface Source {
5
5
  }
6
6
 
7
7
  defineProps<{
8
- field: string
9
8
  source: Source
10
9
  sourceLabel?: string
11
10
  }>()
@@ -25,8 +24,9 @@ function onUnwire() {
25
24
  >
26
25
  <UIcon name="i-ph-plugs-connected" class="size-4 text-success" />
27
26
  <span class="min-w-0 flex-1 truncate text-xs text-toned">
28
- {{ $t('dms_automation.editor.wiredField.wiredFrom') }}
29
- <span class="font-mono font-medium text-highlighted">{{ sourceLabel ?? source.node }}.{{ source.port }}</span>
27
+ {{ $t('dms_automation.editor.wiredField.from') }}
28
+ <span class="font-medium text-highlighted">{{ sourceLabel ?? source.node }}</span>
29
+ <span class="font-mono text-muted"> · {{ source.port }}</span>
30
30
  </span>
31
31
  <UButton
32
32
  size="xs"
@@ -1,30 +1,37 @@
1
1
  <script setup lang="ts">
2
2
  import { computed } from 'vue'
3
3
  import { Handle, Position } from '@vue-flow/core'
4
+ import { dataStyle, triggerStyle } from './styles'
5
+ import { describeDuration, type NodeRole } from '../../../utils/describe'
6
+ import type { PortRef } from '../../../composables/useAutomationNodeKinds'
7
+
8
+ // One node of the procedure graph. Its header names it (the label the builder
9
+ // gave it, else its type) under a type eyebrow coloured by its role, then one
10
+ // line saying what it does (AU-10). After a run the header carries the step's
11
+ // outcome; a node with a problem carries it in a strip at the bottom.
4
12
 
5
- interface PortRef {
6
- name: string
7
- type?: string
13
+ /** The last run's outcome of the node, drawn over the canvas. */
14
+ export interface NodeRunState {
15
+ status: 'ok' | 'failed' | 'skipped'
16
+ durationMs?: number | null
8
17
  }
9
18
 
10
19
  interface NodeData {
11
20
  label?: string
21
+ typeName?: string
12
22
  icon?: string
23
+ role?: NodeRole
24
+ /** Module that registered the node's type, when not this one. */
25
+ module?: string
26
+ summary?: string
27
+ run?: NodeRunState | null
28
+ issue?: { severity: 'error' | 'warning'; message: string } | null
13
29
  /** Small uppercase badge in the top-right of the header (data nodes). */
14
30
  category?: string
15
- /** Render the trigger-in handle on the header's left. Default true. */
16
31
  hasTriggerIn?: boolean
17
- /** Render the trigger-out `main` handle on the header's right. Default true. */
18
32
  hasMainTriggerOut?: boolean
19
- /**
20
- * Non-main trigger-out ports. Rendered as body rows top-to-bottom,
21
- * paired with `dataIns` left-to-right (per the asserted port
22
- * convention: trigger ports first, no gap from data-ins on same row).
23
- */
24
33
  triggerOuts?: string[]
25
- /** Data inputs. Left-aligned. Paired with trigger-outs / data-outs. */
26
34
  dataIns?: PortRef[]
27
- /** Data outputs. Right-aligned. Render below all trigger-outs. */
28
35
  dataOuts?: PortRef[]
29
36
  }
30
37
 
@@ -40,7 +47,45 @@ const triggerOuts = computed<string[]>(() => props.data?.triggerOuts ?? [])
40
47
  const dataIns = computed<PortRef[]>(() => props.data?.dataIns ?? [])
41
48
  const dataOuts = computed<PortRef[]>(() => props.data?.dataOuts ?? [])
42
49
 
43
- import { dataStyle, triggerStyle } from './styles'
50
+ const ROLE_TEXT: Record<NodeRole, string> = {
51
+ trigger: 'text-info',
52
+ flow: 'text-warning',
53
+ data: 'text-success',
54
+ action: 'text-primary',
55
+ helper: 'text-secondary',
56
+ group: 'text-muted',
57
+ }
58
+
59
+ const roleClass = computed(() => ROLE_TEXT[props.data?.role ?? 'flow'])
60
+
61
+ const borderClass = computed(() => {
62
+ if (props.selected) return 'border-primary ring-1 ring-primary'
63
+ if (props.data?.run?.status === 'failed' || props.data?.issue?.severity === 'error') return 'border-error'
64
+ if (props.data?.issue?.severity === 'warning') return 'border-warning/70'
65
+ if (props.data?.run?.status === 'ok') return 'border-success/60'
66
+ return 'border-default'
67
+ })
68
+
69
+ const dimmed = computed(() => props.data?.run?.status === 'skipped')
70
+
71
+ const { processI18n } = useTranslation()
72
+ const { t, te } = useI18n()
73
+
74
+ // A data node's category, in words ("Logic" for `boolean`).
75
+ const categoryLabel = computed(() => {
76
+ const category = props.data?.category
77
+ if (!category) return undefined
78
+ const key = `dms_automation.types.dataCategories.${category}`
79
+ return te(key) ? t(key) : category
80
+ })
81
+
82
+ // The eyebrow names the type when the node has a label of its own, and the
83
+ // node's role otherwise, so a bare node does not read its type twice.
84
+ const eyebrow = computed(() => {
85
+ const d = props.data
86
+ if (d?.label && d.label !== d.typeName) return d.typeName
87
+ return processI18n(`$dms_automation.nodes.role.${d?.role ?? 'flow'}`)
88
+ })
44
89
 
45
90
  interface BodyRow {
46
91
  leftDataIn?: PortRef
@@ -48,114 +93,75 @@ interface BodyRow {
48
93
  rightDataOut?: PortRef
49
94
  }
50
95
 
51
- // Body layout (per the convention):
52
- // Phase 1: each trigger-out, top-to-bottom, paired with the next available
53
- // data-in on the same row (left-aligned). No gap.
54
- // Phase 2: data-outs (and any leftover data-ins) row-by-row, action-style
55
- // (input[i] left, output[i] right), filling remaining space.
96
+ // Body layout: each trigger-out paired with the next data-in on its row, then
97
+ // the remaining data-ins next to the data-outs.
56
98
  const rows = computed<BodyRow[]>(() => {
57
99
  const r: BodyRow[] = []
58
100
  const ti = [...triggerOuts.value]
59
101
  const di = [...dataIns.value]
60
102
  const dout = [...dataOuts.value]
61
-
62
- // Phase 1
63
- while (ti.length > 0) {
64
- r.push({
65
- leftDataIn: di.shift(),
66
- rightTriggerOut: ti.shift(),
67
- })
68
- }
69
-
70
- // Phase 2 — pair any leftover data-ins with data-outs.
103
+ while (ti.length > 0) r.push({ leftDataIn: di.shift(), rightTriggerOut: ti.shift() })
71
104
  const remaining = Math.max(di.length, dout.length)
72
- for (let i = 0; i < remaining; i++) {
73
- r.push({ leftDataIn: di[i], rightDataOut: dout[i] })
74
- }
75
-
105
+ for (let i = 0; i < remaining; i++) r.push({ leftDataIn: di[i], rightDataOut: dout[i] })
76
106
  return r
77
107
  })
78
108
  </script>
79
109
 
80
110
  <template>
81
111
  <div
82
- class="dms-automation-node generic-node relative min-w-[180px] rounded-lg border bg-default shadow-sm"
83
- :class="
84
- selected
85
- ? 'border-primary ring-1 ring-primary'
86
- : 'border-default'
87
- "
112
+ class="dms-automation-node generic-node relative w-[230px] rounded-lg border bg-default shadow-sm transition-opacity"
113
+ :class="[borderClass, dimmed ? 'opacity-50' : '']"
88
114
  >
89
- <div
90
- class="relative flex items-center gap-2 rounded-t-lg border-b border-default bg-elevated px-3 py-2"
91
- >
92
- <Handle
93
- v-if="hasTriggerIn"
94
- id="trigger-in"
95
- type="target"
96
- :position="Position.Left"
97
- :style="triggerStyle"
98
- />
99
- <UIcon
100
- :name="data.icon || 'i-ph-circle'"
101
- class="size-4 text-primary"
102
- />
103
- <div class="truncate text-sm font-medium text-highlighted">
104
- {{ data.label || 'Node' }}
115
+ <div class="relative flex items-start gap-2 rounded-t-lg border-b border-default bg-elevated px-3 py-2">
116
+ <Handle v-if="hasTriggerIn" id="trigger-in" type="target" :position="Position.Left" :style="triggerStyle" />
117
+ <UIcon :name="data.icon || 'i-ph-circle'" class="mt-3 size-4 shrink-0" :class="roleClass" />
118
+ <div class="flex min-w-0 flex-1 flex-col">
119
+ <span class="truncate font-mono text-[9.5px] tracking-wider uppercase" :class="roleClass">
120
+ {{ eyebrow }}<template v-if="data.module"> · {{ data.module }}</template>
121
+ </span>
122
+ <span class="truncate text-sm font-medium text-highlighted">{{ data.label || data.typeName || 'Node' }}</span>
123
+ <span v-if="data.summary" class="truncate font-mono text-[10.5px] text-muted">{{ data.summary }}</span>
105
124
  </div>
106
- <div
107
- v-if="data.category"
108
- class="ml-auto text-[10px] uppercase text-dimmed"
125
+ <span
126
+ v-if="data.run && data.run.status !== 'skipped'"
127
+ class="mt-0.5 inline-flex shrink-0 items-center gap-1 rounded px-1 font-mono text-[10px]"
128
+ :class="data.run.status === 'failed' ? 'bg-error/15 text-error' : 'bg-success/15 text-success'"
109
129
  >
110
- {{ data.category }}
111
- </div>
112
- <Handle
113
- v-if="hasMainTriggerOut"
114
- id="trigger-out-main"
115
- type="source"
116
- :position="Position.Right"
117
- :style="triggerStyle"
118
- />
130
+ <UIcon :name="data.run.status === 'failed' ? 'i-ph-x' : 'i-ph-check'" class="size-3" />
131
+ {{ describeDuration(data.run.durationMs) }}
132
+ </span>
133
+ <span v-else-if="categoryLabel" class="ml-auto shrink-0 text-[10px] text-dimmed uppercase">{{ categoryLabel }}</span>
134
+ <Handle v-if="hasMainTriggerOut" id="trigger-out-main" type="source" :position="Position.Right" :style="triggerStyle" />
119
135
  </div>
120
136
 
121
137
  <div v-if="rows.length > 0" class="py-2 text-xs text-dimmed">
122
- <div
123
- v-for="(row, i) in rows"
124
- :key="i"
125
- class="relative flex items-stretch py-1"
126
- >
127
- <div class="flex-1 flex items-center gap-1 pl-3">
138
+ <div v-for="(row, i) in rows" :key="i" class="relative flex items-stretch py-1">
139
+ <div class="flex flex-1 items-center gap-1 pl-3">
128
140
  <template v-if="row.leftDataIn">
129
- <Handle
130
- :id="`data-in-${row.leftDataIn.name}`"
131
- type="target"
132
- :position="Position.Left"
133
- :style="dataStyle"
134
- />
141
+ <Handle :id="`data-in-${row.leftDataIn.name}`" type="target" :position="Position.Left" :style="dataStyle" />
135
142
  <span>{{ row.leftDataIn.name }}</span>
136
143
  </template>
137
144
  </div>
138
- <div class="flex-1 flex items-center justify-end gap-1 pr-3">
145
+ <div class="flex flex-1 items-center justify-end gap-1 pr-3">
139
146
  <template v-if="row.rightTriggerOut">
140
147
  <span>{{ row.rightTriggerOut }}</span>
141
- <Handle
142
- :id="`trigger-out-${row.rightTriggerOut}`"
143
- type="source"
144
- :position="Position.Right"
145
- :style="triggerStyle"
146
- />
148
+ <Handle :id="`trigger-out-${row.rightTriggerOut}`" type="source" :position="Position.Right" :style="triggerStyle" />
147
149
  </template>
148
150
  <template v-else-if="row.rightDataOut">
149
151
  <span>{{ row.rightDataOut.name }}</span>
150
- <Handle
151
- :id="`data-out-${row.rightDataOut.name}`"
152
- type="source"
153
- :position="Position.Right"
154
- :style="dataStyle"
155
- />
152
+ <Handle :id="`data-out-${row.rightDataOut.name}`" type="source" :position="Position.Right" :style="dataStyle" />
156
153
  </template>
157
154
  </div>
158
155
  </div>
159
156
  </div>
157
+
158
+ <div
159
+ v-if="data.issue"
160
+ class="flex items-start gap-1.5 rounded-b-lg border-t px-3 py-1.5 text-[11px]"
161
+ :class="data.issue.severity === 'error' ? 'border-error/40 bg-error/10 text-error' : 'border-warning/40 bg-warning/10 text-warning'"
162
+ >
163
+ <UIcon name="i-ph-warning" class="mt-0.5 size-3 shrink-0" />
164
+ <span class="line-clamp-2">{{ data.issue.message }}</span>
165
+ </div>
160
166
  </div>
161
167
  </template>
@@ -39,9 +39,8 @@ const dataOutPorts = computed(() =>
39
39
 
40
40
  const isTemplateInstance = computed(() => Boolean(props.data?.templateId))
41
41
 
42
- const title = computed(
43
- () => props.data?.config?.name ?? props.data?.label ?? 'Group',
44
- )
42
+ // GraphCanvas resolves the name: the step name, else the group's own name.
43
+ const title = computed(() => props.data?.label ?? props.data?.config?.name)
45
44
 
46
45
  const headerIcon = computed(() =>
47
46
  isTemplateInstance.value ? 'i-ph-link' : 'i-ph-package',
@@ -128,10 +127,10 @@ const hasAnyPorts = computed(
128
127
  <span
129
128
  v-if="isTemplateInstance"
130
129
  class="ml-auto inline-flex items-center gap-1 rounded-sm bg-primary/10 px-1.5 py-0.5 text-[10px] uppercase tracking-wide text-primary"
131
- :title="`Linked to template ${data.templateId}`"
130
+ :title="$t('dms_automation.nodes.linkedHint')"
132
131
  >
133
132
  <UIcon name="i-ph-link" class="w-3 h-3" />
134
- linked
133
+ {{ $t('dms_automation.nodes.linked') }}
135
134
  </span>
136
135
  <Handle
137
136
  v-if="mainTriggerOut"
@@ -194,7 +193,7 @@ const hasAnyPorts = computed(
194
193
  v-else-if="!hasAnyPorts"
195
194
  class="py-2 px-3 text-xs text-dimmed italic"
196
195
  >
197
- no ports
196
+ {{ $t('dms_automation.nodes.noPorts') }}
198
197
  </div>
199
198
  </div>
200
199
  </template>
@@ -36,11 +36,12 @@ const handlePosition = computed(() =>
36
36
  const handlePrefix = computed(() => (isInput.value ? 'groupInput' : 'groupOutput'))
37
37
  const handleVerb = computed(() => (isInput.value ? 'out' : 'in'))
38
38
  const headerIcon = computed(() => (isInput.value ? 'i-ph-sign-in' : 'i-ph-sign-out'))
39
+ const { t } = useI18n()
39
40
  const headerLabel = computed(() =>
40
- isInput.value ? 'Group Input' : 'Group Output',
41
+ t(isInput.value ? 'dms_automation.nodes.groupInput' : 'dms_automation.nodes.groupOutput'),
41
42
  )
42
43
  const emptyText = computed(() =>
43
- isInput.value ? 'no input ports' : 'no output ports',
44
+ t(isInput.value ? 'dms_automation.nodes.noInputPorts' : 'dms_automation.nodes.noOutputPorts'),
44
45
  )
45
46
  const rowKeyPrefix = computed(() => (isInput.value ? 'gi-row' : 'go-row'))
46
47
 
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Shared handle styling for the editor's node Vue components. Trigger and
3
- * data handles use a fixed color and size; data handles can additionally
4
- * pick a per-JSON-schema-type color via `dataHandleStyle(port)` (keyed off
5
- * `port.schema`) for the group/sentinel node variants.
2
+ * Shared handle styling for the editor's node Vue components, from the theme's
3
+ * tokens only (AU-15): trigger handles take the info role (the flow of
4
+ * control), data handles the success role. Data handles of a group or a
5
+ * sentinel can pick a colour per JSON schema type via `dataHandleStyle(port)`.
6
6
  */
7
7
 
8
8
  import type {
@@ -10,30 +10,26 @@ import type {
10
10
  JsonSchema,
11
11
  } from "../../../composables/useGraphConnect";
12
12
 
13
- // Trigger (control-flow) handles use the DMS accent cyan so the procedure's
14
- // main flow reads as the brand colour; data handles stay emerald (success).
15
13
  export const triggerStyle = {
16
- background: "#2dc1cf",
14
+ background: "var(--ui-info)",
17
15
  width: "10px",
18
16
  height: "10px",
19
17
  };
20
18
 
21
19
  export const dataStyle = {
22
- background: "#10b981",
20
+ background: "var(--ui-success)",
23
21
  width: "8px",
24
22
  height: "8px",
25
23
  };
26
24
 
27
- // Per-JSON-schema-type color for data handles. Falls back to the
28
- // emerald baseline (the data-port default) for unknown / missing types.
29
25
  const TYPE_COLORS: Record<string, string> = {
30
- string: "#10b981", // emerald — matches DataNode default
31
- number: "#f59e0b", // amber
32
- integer: "#f59e0b", // amber
33
- boolean: "#ef4444", // red
34
- object: "#8b5cf6", // violet
35
- array: "#06b6d4", // cyan
36
- null: "#6b7280", // gray
26
+ string: "var(--ui-success)",
27
+ number: "var(--ui-warning)",
28
+ integer: "var(--ui-warning)",
29
+ boolean: "var(--ui-error)",
30
+ object: "var(--ui-secondary)",
31
+ array: "var(--ui-info)",
32
+ null: "var(--ui-text-dimmed)",
37
33
  };
38
34
 
39
35
  function schemaType(schema: JsonSchema | undefined): string {
@@ -48,6 +44,6 @@ export function dataHandleStyle(port: Pick<GroupPort, "schema">): {
48
44
  width: string;
49
45
  height: string;
50
46
  } {
51
- const color = TYPE_COLORS[schemaType(port.schema)] ?? "#10b981";
47
+ const color = TYPE_COLORS[schemaType(port.schema)] ?? "var(--ui-success)";
52
48
  return { background: color, width: "8px", height: "8px" };
53
49
  }