@antelopejs/dms-automation 0.7.0 → 0.9.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 (275) hide show
  1. package/README.md +33 -22
  2. package/dist/cluster/bus.js +8 -6
  3. package/dist/cluster/bus.js.map +1 -1
  4. package/dist/cluster/leader.js.map +1 -1
  5. package/dist/data/procedures-query.d.ts +19 -0
  6. package/dist/data/procedures-query.js +105 -0
  7. package/dist/data/procedures-query.js.map +1 -0
  8. package/dist/data/procedures-table.d.ts +5 -20
  9. package/dist/data/procedures-table.js +10 -106
  10. package/dist/data/procedures-table.js.map +1 -1
  11. package/dist/data/runs-table.d.ts +3 -3
  12. package/dist/data/runs-table.js.map +1 -1
  13. package/dist/db/models/automation_template.model.d.ts +13 -13
  14. package/dist/db/models/automation_template.model.js +13 -14
  15. package/dist/db/models/automation_template.model.js.map +1 -1
  16. package/dist/db/models/procedure.model.d.ts +7 -5
  17. package/dist/db/models/procedure_run.model.d.ts +9 -6
  18. package/dist/db/models/procedure_run.model.js +8 -8
  19. package/dist/db/models/procedure_run.model.js.map +1 -1
  20. package/dist/db/models/stats.model.js.map +1 -1
  21. package/dist/db/models/type_switch.model.d.ts +7 -5
  22. package/dist/db/tables/procedure_run.table.d.ts +2 -1
  23. package/dist/db/tables/procedure_run.table.js.map +1 -1
  24. package/dist/implementations/dms-automation/index.d.ts +2 -2
  25. package/dist/implementations/dms-automation/index.js.map +1 -1
  26. package/dist/index.js.map +1 -1
  27. package/dist/pages/category.js.map +1 -1
  28. package/dist/pages/index.js.map +1 -1
  29. package/dist/pages/overview.js.map +1 -1
  30. package/dist/pages/procedures.js.map +1 -1
  31. package/dist/pages/runs.js.map +1 -1
  32. package/dist/pages/shared.js +1 -1
  33. package/dist/pages/shared.js.map +1 -1
  34. package/dist/realtime.d.ts +2 -1
  35. package/dist/realtime.js.map +1 -1
  36. package/dist/routes/action-types.d.ts +3 -2
  37. package/dist/routes/action-types.js.map +1 -1
  38. package/dist/routes/data-node-types.d.ts +1 -1
  39. package/dist/routes/deleteConfirm.js +4 -3
  40. package/dist/routes/deleteConfirm.js.map +1 -1
  41. package/dist/routes/graphSchema.d.ts +2 -1
  42. package/dist/routes/graphSchema.js +13 -10
  43. package/dist/routes/graphSchema.js.map +1 -1
  44. package/dist/routes/library.d.ts +12 -1
  45. package/dist/routes/library.js +38 -34
  46. package/dist/routes/library.js.map +1 -1
  47. package/dist/routes/procedureChecks.js +5 -5
  48. package/dist/routes/procedureChecks.js.map +1 -1
  49. package/dist/routes/procedureRuns.d.ts +3 -3
  50. package/dist/routes/procedureRuns.js +1 -1
  51. package/dist/routes/procedureRuns.js.map +1 -1
  52. package/dist/routes/procedureSchemas.d.ts +7 -6
  53. package/dist/routes/procedureSchemas.js +4 -2
  54. package/dist/routes/procedureSchemas.js.map +1 -1
  55. package/dist/routes/procedures.d.ts +15 -14
  56. package/dist/routes/procedures.js +2 -1
  57. package/dist/routes/procedures.js.map +1 -1
  58. package/dist/routes/requests.d.ts +12 -6
  59. package/dist/routes/requests.js +2 -1
  60. package/dist/routes/requests.js.map +1 -1
  61. package/dist/routes/runs.d.ts +9 -8
  62. package/dist/routes/runs.js +5 -3
  63. package/dist/routes/runs.js.map +1 -1
  64. package/dist/routes/stats.js.map +1 -1
  65. package/dist/routes/templates.d.ts +5 -4
  66. package/dist/routes/templates.js +2 -1
  67. package/dist/routes/templates.js.map +1 -1
  68. package/dist/routes/trigger-types.d.ts +3 -2
  69. package/dist/routes/trigger-types.js.map +1 -1
  70. package/dist/routes/typeConfigShared.d.ts +2 -1
  71. package/dist/routes/typeConfigShared.js.map +1 -1
  72. package/dist/routes/zodJson.d.ts +3 -0
  73. package/dist/routes/zodJson.js +21 -0
  74. package/dist/routes/zodJson.js.map +1 -0
  75. package/dist/runtime/armErrors.d.ts +0 -1
  76. package/dist/runtime/armErrors.js +5 -12
  77. package/dist/runtime/armErrors.js.map +1 -1
  78. package/dist/runtime/boundRunLog.d.ts +7 -5
  79. package/dist/runtime/boundRunLog.js +24 -20
  80. package/dist/runtime/boundRunLog.js.map +1 -1
  81. package/dist/runtime/builtins/actions/http.d.ts +7 -3
  82. package/dist/runtime/builtins/actions/http.js +33 -22
  83. package/dist/runtime/builtins/actions/http.js.map +1 -1
  84. package/dist/runtime/builtins/actions/log.d.ts +5 -4
  85. package/dist/runtime/builtins/actions/log.js.map +1 -1
  86. package/dist/runtime/builtins/data/boolean.d.ts +2 -1
  87. package/dist/runtime/builtins/data/boolean.js +4 -5
  88. package/dist/runtime/builtins/data/boolean.js.map +1 -1
  89. package/dist/runtime/builtins/data/compare.js +8 -10
  90. package/dist/runtime/builtins/data/compare.js.map +1 -1
  91. package/dist/runtime/builtins/data/constant.js +1 -1
  92. package/dist/runtime/builtins/data/constant.js.map +1 -1
  93. package/dist/runtime/builtins/data/json.js +4 -5
  94. package/dist/runtime/builtins/data/json.js.map +1 -1
  95. package/dist/runtime/builtins/data/math.js +4 -4
  96. package/dist/runtime/builtins/data/math.js.map +1 -1
  97. package/dist/runtime/builtins/data/object.js +27 -27
  98. package/dist/runtime/builtins/data/object.js.map +1 -1
  99. package/dist/runtime/builtins/data/string.js +13 -18
  100. package/dist/runtime/builtins/data/string.js.map +1 -1
  101. package/dist/runtime/builtins/nodes/action.js +16 -5
  102. package/dist/runtime/builtins/nodes/action.js.map +1 -1
  103. package/dist/runtime/builtins/nodes/data.js +2 -2
  104. package/dist/runtime/builtins/nodes/data.js.map +1 -1
  105. package/dist/runtime/builtins/nodes/delay.js +2 -2
  106. package/dist/runtime/builtins/nodes/delay.js.map +1 -1
  107. package/dist/runtime/builtins/nodes/forRange.js +2 -2
  108. package/dist/runtime/builtins/nodes/forRange.js.map +1 -1
  109. package/dist/runtime/builtins/nodes/foreach.js +2 -2
  110. package/dist/runtime/builtins/nodes/foreach.js.map +1 -1
  111. package/dist/runtime/builtins/nodes/groupInput.js +2 -2
  112. package/dist/runtime/builtins/nodes/groupInput.js.map +1 -1
  113. package/dist/runtime/builtins/nodes/groupOutput.js +2 -2
  114. package/dist/runtime/builtins/nodes/groupOutput.js.map +1 -1
  115. package/dist/runtime/builtins/nodes/if.js +2 -2
  116. package/dist/runtime/builtins/nodes/if.js.map +1 -1
  117. package/dist/runtime/builtins/nodes/parallel.js +2 -2
  118. package/dist/runtime/builtins/nodes/parallel.js.map +1 -1
  119. package/dist/runtime/builtins/nodes/retry.js +13 -5
  120. package/dist/runtime/builtins/nodes/retry.js.map +1 -1
  121. package/dist/runtime/builtins/nodes/setVariable.js +2 -2
  122. package/dist/runtime/builtins/nodes/setVariable.js.map +1 -1
  123. package/dist/runtime/builtins/nodes/switch.js +8 -3
  124. package/dist/runtime/builtins/nodes/switch.js.map +1 -1
  125. package/dist/runtime/builtins/nodes/trigger.js +2 -2
  126. package/dist/runtime/builtins/nodes/trigger.js.map +1 -1
  127. package/dist/runtime/builtins/nodes/tryCatch.js +2 -2
  128. package/dist/runtime/builtins/nodes/tryCatch.js.map +1 -1
  129. package/dist/runtime/builtins/triggers/cron.d.ts +4 -3
  130. package/dist/runtime/builtins/triggers/cron.js +5 -7
  131. package/dist/runtime/builtins/triggers/cron.js.map +1 -1
  132. package/dist/runtime/builtins/triggers/webhook.d.ts +11 -7
  133. package/dist/runtime/builtins/triggers/webhook.js +15 -12
  134. package/dist/runtime/builtins/triggers/webhook.js.map +1 -1
  135. package/dist/runtime/declaredProcedures.d.ts +2 -2
  136. package/dist/runtime/declaredProcedures.js +3 -2
  137. package/dist/runtime/declaredProcedures.js.map +1 -1
  138. package/dist/runtime/describe.d.ts +3 -1
  139. package/dist/runtime/describe.js +14 -13
  140. package/dist/runtime/describe.js.map +1 -1
  141. package/dist/runtime/executor.d.ts +2 -1
  142. package/dist/runtime/executor.js +18 -13
  143. package/dist/runtime/executor.js.map +1 -1
  144. package/dist/runtime/flatten.d.ts +1 -1
  145. package/dist/runtime/flatten.js +1 -1
  146. package/dist/runtime/flatten.js.map +1 -1
  147. package/dist/runtime/graphIssues.d.ts +2 -2
  148. package/dist/runtime/graphIssues.js +39 -32
  149. package/dist/runtime/graphIssues.js.map +1 -1
  150. package/dist/runtime/graphVersion.d.ts +1 -1
  151. package/dist/runtime/graphVersion.js +4 -3
  152. package/dist/runtime/graphVersion.js.map +1 -1
  153. package/dist/runtime/nodeKinds.d.ts +6 -5
  154. package/dist/runtime/nodeKinds.js.map +1 -1
  155. package/dist/runtime/reconcile.d.ts +3 -0
  156. package/dist/runtime/reconcile.js +178 -0
  157. package/dist/runtime/reconcile.js.map +1 -0
  158. package/dist/runtime/registry.d.ts +3 -3
  159. package/dist/runtime/resolveInputs.d.ts +13 -8
  160. package/dist/runtime/resolveInputs.js +18 -18
  161. package/dist/runtime/resolveInputs.js.map +1 -1
  162. package/dist/runtime/resolveSubgraph.js +4 -5
  163. package/dist/runtime/resolveSubgraph.js.map +1 -1
  164. package/dist/runtime/retention.js.map +1 -1
  165. package/dist/runtime/runProcedure.d.ts +3 -2
  166. package/dist/runtime/runProcedure.js +2 -1
  167. package/dist/runtime/runProcedure.js.map +1 -1
  168. package/dist/runtime/schedule.js +3 -0
  169. package/dist/runtime/schedule.js.map +1 -1
  170. package/dist/runtime/schemaProperties.d.ts +3 -0
  171. package/dist/runtime/schemaProperties.js +7 -0
  172. package/dist/runtime/schemaProperties.js.map +1 -0
  173. package/dist/runtime/serialQueue.d.ts +1 -1
  174. package/dist/runtime/serialQueue.js +4 -4
  175. package/dist/runtime/serialQueue.js.map +1 -1
  176. package/dist/runtime/sideEffects.d.ts +2 -2
  177. package/dist/runtime/subscriptions.d.ts +6 -4
  178. package/dist/runtime/subscriptions.js +21 -180
  179. package/dist/runtime/subscriptions.js.map +1 -1
  180. package/dist/runtime/subwalk.js.map +1 -1
  181. package/dist/runtime/templateCacheState.d.ts +6 -0
  182. package/dist/runtime/templateCacheState.js +10 -0
  183. package/dist/runtime/templateCacheState.js.map +1 -0
  184. package/dist/runtime/templateUsages.js +4 -5
  185. package/dist/runtime/templateUsages.js.map +1 -1
  186. package/dist/runtime/topo.js +2 -4
  187. package/dist/runtime/topo.js.map +1 -1
  188. package/dist/runtime/trace.d.ts +5 -2
  189. package/dist/runtime/trace.js +27 -17
  190. package/dist/runtime/trace.js.map +1 -1
  191. package/dist/runtime/triggerHandles.d.ts +4 -3
  192. package/dist/runtime/triggerHandles.js +9 -1
  193. package/dist/runtime/triggerHandles.js.map +1 -1
  194. package/dist/runtime/typeOrigin.js +12 -1
  195. package/dist/runtime/typeOrigin.js.map +1 -1
  196. package/dist/runtime/validate.js.map +1 -1
  197. package/dist/runtime/validateTemplate.js.map +1 -1
  198. package/dist/runtime/withTimeout.js.map +1 -1
  199. package/dist/runtime/wording.js +12 -8
  200. package/dist/runtime/wording.js.map +1 -1
  201. package/dist/stats/health-banner.js.map +1 -1
  202. package/dist/stats/health.js.map +1 -1
  203. package/dist/stats/kpi.js +1 -1
  204. package/dist/stats/kpi.js.map +1 -1
  205. package/dist/stats/overview.js +2 -1
  206. package/dist/stats/overview.js.map +1 -1
  207. package/dist/types/dataValue.d.ts +7 -0
  208. package/dist/types/dataValue.js +56 -0
  209. package/dist/types/dataValue.js.map +1 -0
  210. package/dist/types/graph.d.ts +19 -13
  211. package/dist/types/graph.js +8 -0
  212. package/dist/types/graph.js.map +1 -1
  213. package/dist/types/guards.d.ts +8 -0
  214. package/dist/types/guards.js +35 -0
  215. package/dist/types/guards.js.map +1 -0
  216. package/dist/types/runLog.d.ts +8 -7
  217. package/dist/types/runLog.js.map +1 -1
  218. package/frontend-vue/app/build/components/editor/EditorBanners.vue +120 -0
  219. package/frontend-vue/app/build/components/editor/EditorChoiceModal.vue +44 -0
  220. package/frontend-vue/app/build/components/editor/EditorForkModal.vue +51 -0
  221. package/frontend-vue/app/build/components/editor/EditorHeader.vue +146 -0
  222. package/frontend-vue/app/build/components/editor/EditorSaveTemplateModal.vue +105 -0
  223. package/frontend-vue/app/build/components/editor/NodeInspectorDocs.vue +28 -0
  224. package/frontend-vue/app/build/components/editor/NodeInspectorRun.vue +48 -0
  225. package/frontend-vue/app/build/composables/editor/useBuilderMount.ts +129 -0
  226. package/frontend-vue/app/build/composables/editor/useBuilderSave.ts +256 -0
  227. package/frontend-vue/app/build/composables/editor/useBuilderShortcuts.ts +270 -0
  228. package/frontend-vue/app/build/composables/editor/useDraftProblems.ts +288 -0
  229. package/frontend-vue/app/build/composables/editor/useEditorContext.ts +388 -0
  230. package/frontend-vue/app/build/composables/editor/useEditorLoad.ts +158 -0
  231. package/frontend-vue/app/build/composables/editor/useForkToLocal.ts +193 -0
  232. package/frontend-vue/app/build/composables/editor/useGraphHistory.ts +113 -0
  233. package/frontend-vue/app/build/composables/editor/useGroupEditing.ts +445 -0
  234. package/frontend-vue/app/build/composables/editor/usePalette.ts +41 -0
  235. package/frontend-vue/app/build/composables/editor/useProcedureActions.ts +96 -0
  236. package/frontend-vue/app/build/composables/editor/useRunOverlay.ts +466 -0
  237. package/frontend-vue/app/build/composables/editor/useSaveAsTemplate.ts +172 -0
  238. package/frontend-vue/app/build/composables/editor/useSavedTriggers.ts +100 -0
  239. package/frontend-vue/app/build/composables/editor/useSubgraphNavigation.ts +270 -0
  240. package/frontend-vue/app/build/composables/editor/useUnsavedGuards.ts +233 -0
  241. package/frontend-vue/app/build/composables/graphCanvas/connect.ts +273 -0
  242. package/frontend-vue/app/build/composables/graphCanvas/edgeEvents.ts +172 -0
  243. package/frontend-vue/app/build/composables/graphCanvas/edges.ts +55 -0
  244. package/frontend-vue/app/build/composables/graphCanvas/handles.ts +181 -0
  245. package/frontend-vue/app/build/composables/graphCanvas/linkMenu.ts +123 -0
  246. package/frontend-vue/app/build/composables/graphCanvas/nodeData.ts +222 -0
  247. package/frontend-vue/app/build/composables/graphCanvas/placement.ts +248 -0
  248. package/frontend-vue/app/build/composables/graphCanvas/selection.ts +150 -0
  249. package/frontend-vue/app/build/composables/graphCanvas/types.ts +188 -0
  250. package/frontend-vue/app/build/composables/graphCanvas/view.ts +230 -0
  251. package/frontend-vue/app/build/types/editor.ts +94 -0
  252. package/frontend-vue/app/build/utils/editor/apiErrors.ts +74 -0
  253. package/frontend-vue/app/build/utils/editor/graphShape.ts +68 -0
  254. package/frontend-vue/app/build/utils/editor/groupPlan.ts +322 -0
  255. package/frontend-vue/app/build/utils/editor/groupPorts.ts +210 -0
  256. package/frontend-vue/app/build/utils/editor/keyboard.ts +22 -0
  257. package/frontend-vue/app/build/utils/inspectorFields.ts +117 -0
  258. package/frontend-vue/app/build/utils/templates.ts +88 -0
  259. package/frontend-vue/app/components/AttentionList.vue +2 -6
  260. package/frontend-vue/app/components/Catalog.vue +2 -1
  261. package/frontend-vue/app/components/Editor/GraphCanvas.vue +78 -1337
  262. package/frontend-vue/app/components/Editor/NodeInspector.vue +31 -123
  263. package/frontend-vue/app/components/Editor.vue +134 -3484
  264. package/frontend-vue/app/components/Templates.vue +14 -84
  265. package/frontend-vue/build/backend-boundary.ts +122 -0
  266. package/frontend-vue/dms.frontend.build.ts +2 -0
  267. package/frontend-vue/eslint-rules/index.mjs +103 -0
  268. package/frontend-vue/eslint.config.mjs +15 -0
  269. package/frontend-vue/package.json +8 -5
  270. package/frontend-vue/pnpm-lock.yaml +168 -139
  271. package/frontend-vue/tests/api-error-presentation.test.cjs +254 -0
  272. package/frontend-vue/tests/helpers/setup.cjs +44 -0
  273. package/package.json +18 -15
  274. package/skills/dms-automation/SKILL.md +2 -2
  275. package/skills/dms-automation/cases.json +58 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guards.js","sourceRoot":"","sources":["../../src/types/guards.ts"],"names":[],"mappings":";;AAAA,4BAEC;AAED,4BAEC;AAED,8BAEC;AAED,4BAEC;AAGD,4BAEC;AAGD,wCAEC;AAGD,sCAIC;AAGD,sCAYC;AA9CD,SAAgB,QAAQ,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;AACnC,CAAC;AAED,SAAgB,QAAQ,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;AACnC,CAAC;AAED,SAAgB,SAAS,CAAC,KAAc;IACtC,OAAO,OAAO,KAAK,KAAK,SAAS,CAAC;AACpC,CAAC;AAED,SAAgB,QAAQ,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;AACnC,CAAC;AAGD,SAAgB,QAAQ,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AACrD,CAAC;AAGD,SAAgB,cAAc,CAAC,KAAc;IAC3C,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;AACnC,CAAC;AAGD,SAAgB,aAAa,CAC3B,KAAc;IAEd,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AACrD,CAAC;AAGD,SAAgB,aAAa,CAC3B,KAAc;IAUd,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC1B,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import type { LogLevel } from "@antelopejs/interface-dms-automation";
2
- export interface FireNode {
2
+ import type { DataValue } from "./dataValue";
3
+ export type FireNode = {
3
4
  id: string;
4
5
  parentFireId: string | null;
5
6
  sourceNodeId: string;
@@ -8,8 +9,8 @@ export interface FireNode {
8
9
  seq: number;
9
10
  iteration?: number;
10
11
  closedAt?: number;
11
- }
12
- export interface LogEntry {
12
+ };
13
+ export type LogEntry = {
13
14
  fireId: string;
14
15
  ts: number;
15
16
  seq: number;
@@ -18,12 +19,12 @@ export interface LogEntry {
18
19
  nodeId?: string;
19
20
  nodeKind?: string;
20
21
  message: string;
21
- value?: unknown;
22
- }
23
- export interface RunLog {
22
+ value?: DataValue;
23
+ };
24
+ export type RunLog = {
24
25
  fires: FireNode[];
25
26
  entries: LogEntry[];
26
27
  truncated?: number;
27
- }
28
+ };
28
29
  export type RunKind = "run" | "rerun" | "test";
29
30
  export declare function isProductionRun(kind: RunKind): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"runLog.js","sourceRoot":"","sources":["../../src/types/runLog.ts"],"names":[],"mappings":";;AA2EA,0CAEC;AAFD,SAAgB,eAAe,CAAC,IAAa;IAC3C,OAAO,IAAI,KAAK,MAAM,CAAC;AACzB,CAAC"}
1
+ {"version":3,"file":"runLog.js","sourceRoot":"","sources":["../../src/types/runLog.ts"],"names":[],"mappings":";;AA4EA,0CAEC;AAFD,SAAgB,eAAe,CAAC,IAAa;IAC3C,OAAO,IAAI,KAAK,MAAM,CAAC;AACzB,CAAC"}
@@ -0,0 +1,120 @@
1
+ <script setup lang="ts">
2
+ import type { RunDetail } from '../../../composables/useAutomationRuns'
3
+ import type { GraphIssue } from '../../types/editor'
4
+
5
+ defineProps<{
6
+ loadError: string | null
7
+ templateNotFound: boolean
8
+ editorMode: 'procedure' | 'template'
9
+ libraryBackUrl: string
10
+ saveBlocked: boolean
11
+ blockingIssues: GraphIssue[]
12
+ pausedBanner: { title: string; description: string } | null
13
+ saving: boolean
14
+ testing: boolean
15
+ overlayRun: RunDetail | null
16
+ overlayIsTest: boolean
17
+ overlayLook: { readonly tone: 'error' | 'success'; readonly icon: string }
18
+ overlaySummary: string
19
+ overlayDescription: string
20
+ isDirty: boolean
21
+ isCurrentGraphReadOnly: boolean
22
+ canForkToLocal: boolean
23
+ }>()
24
+
25
+ const emit = defineEmits<{
26
+ 'go-to-first-problem': []
27
+ 'save-as-draft': []
28
+ 'enable-now': []
29
+ rerun: []
30
+ 'test-run': []
31
+ 'open-trace': [runId: string]
32
+ 'exit-debug': []
33
+ 'open-fork': []
34
+ }>()
35
+ </script>
36
+
37
+ <template>
38
+ <div class="flex flex-col gap-2 empty:hidden" :class="loadError || saveBlocked || pausedBanner || overlayRun || testing || isCurrentGraphReadOnly ? 'border-b border-default p-2' : ''">
39
+ <DmsBanner
40
+ v-if="loadError"
41
+ size="sm"
42
+ tone="error"
43
+ icon="i-ph-warning"
44
+ :title="editorMode === 'template' ? $t('dms_automation.editor.loadTemplateError') : $t('dms_automation.editor.loadProceduresError')"
45
+ :description="loadError"
46
+ >
47
+ <template v-if="templateNotFound" #actions>
48
+ <UButton size="xs" color="error" variant="soft" icon="i-ph-arrow-left" :to="libraryBackUrl">{{ $t('dms_automation.editor.backToTemplates') }}</UButton>
49
+ </template>
50
+ </DmsBanner>
51
+ <DmsBanner
52
+ v-if="saveBlocked && blockingIssues.length"
53
+ size="sm"
54
+ tone="error"
55
+ icon="i-ph-warning-octagon"
56
+ :title="$t('dms_automation.editor.problems.title', { count: blockingIssues.length })"
57
+ :description="$t('dms_automation.editor.problems.description')"
58
+ >
59
+ <template #actions>
60
+ <UButton size="xs" color="error" variant="soft" @click="emit('go-to-first-problem')">{{ $t('dms_automation.editor.problems.first') }}</UButton>
61
+ <UButton size="xs" color="neutral" variant="outline" :loading="saving" @click="emit('save-as-draft')">{{ $t('dms_automation.editor.problems.saveDraft') }}</UButton>
62
+ </template>
63
+ </DmsBanner>
64
+ <DmsBanner v-if="pausedBanner && !saveBlocked" size="sm" tone="warning" icon="i-ph-pause-circle" :title="pausedBanner.title" :description="pausedBanner.description">
65
+ <template #actions>
66
+ <UButton size="xs" color="warning" variant="soft" :loading="saving" :disabled="blockingIssues.length > 0" @click="emit('enable-now')">
67
+ {{ $t('dms_automation.editor.paused.enable') }}
68
+ </UButton>
69
+ </template>
70
+ </DmsBanner>
71
+ <DmsBanner
72
+ v-if="testing"
73
+ size="sm"
74
+ tone="info"
75
+ icon="i-ph-flask"
76
+ :title="$t('dms_automation.editor.debug.testing')"
77
+ :description="$t('dms_automation.editor.debug.testingHint')"
78
+ />
79
+ <DmsBanner
80
+ v-if="overlayRun && !testing"
81
+ size="sm"
82
+ :tone="overlayLook.tone"
83
+ :icon="overlayLook.icon"
84
+ :title="overlaySummary"
85
+ :description="overlayDescription"
86
+ >
87
+ <template #actions>
88
+ <UTooltip v-if="!overlayIsTest" :text="isDirty ? $t('dms_automation.editor.debug.rerunSaveFirst') : $t('dms_automation.editor.debug.rerunHint')">
89
+ <UButton size="xs" variant="soft" color="neutral" icon="i-ph-arrow-clockwise" :disabled="isDirty" @click="emit('rerun')">
90
+ {{ $t('dms_automation.runs.rerunWithPayload') }}
91
+ </UButton>
92
+ </UTooltip>
93
+ <UButton v-if="overlayIsTest" size="xs" variant="soft" color="neutral" icon="i-ph-arrow-clockwise" :loading="testing" @click="emit('test-run')">
94
+ {{ $t('dms_automation.editor.debug.again') }}
95
+ </UButton>
96
+ <UButton size="xs" variant="ghost" color="neutral" icon="i-ph-path" @click="emit('open-trace', overlayRun._id)">
97
+ {{ $t('dms_automation.runs.trace') }}
98
+ </UButton>
99
+ <UButton size="xs" variant="ghost" color="neutral" @click="emit('exit-debug')">
100
+ {{ $t('dms_automation.editor.debug.exit') }}
101
+ <UKbd value="Esc" size="sm" class="ml-1" />
102
+ </UButton>
103
+ </template>
104
+ </DmsBanner>
105
+ <DmsBanner
106
+ v-if="isCurrentGraphReadOnly"
107
+ size="sm"
108
+ tone="info"
109
+ icon="i-ph-link"
110
+ :title="$t('dms_automation.editor.linkedTitle')"
111
+ :description="$t('dms_automation.editor.linkedDescription')"
112
+ >
113
+ <template v-if="canForkToLocal" #actions>
114
+ <UButton size="xs" color="info" variant="soft" icon="i-ph-git-fork" @click="emit('open-fork')">
115
+ {{ $t('dms_automation.editor.forkToEdit') }}
116
+ </UButton>
117
+ </template>
118
+ </DmsBanner>
119
+ </div>
120
+ </template>
@@ -0,0 +1,44 @@
1
+ <script setup lang="ts">
2
+ import { nextTick } from 'vue'
3
+ import type { ChoiceQuestion } from '../../types/editor'
4
+
5
+ defineProps<{ dialog: ChoiceQuestion<string> & { open: boolean } }>()
6
+
7
+ const emit = defineEmits<{
8
+ 'update:open': [open: boolean]
9
+ answer: [choice: string]
10
+ }>()
11
+
12
+ /** The dialog opens on its safe answer: Enter keeps the draft, runs nothing. */
13
+ function focusSafeChoice(event: Event) {
14
+ event.preventDefault()
15
+ void nextTick(() => document.querySelector<HTMLElement>('[data-safe-choice]')?.focus())
16
+ }
17
+ </script>
18
+
19
+ <template>
20
+ <UModal
21
+ :open="dialog.open"
22
+ :title="dialog.title"
23
+ :content="{ onOpenAutoFocus: focusSafeChoice }"
24
+ @update:open="emit('update:open', $event)"
25
+ >
26
+ <template #body>
27
+ <p class="text-sm text-toned">{{ dialog.description }}</p>
28
+ </template>
29
+ <template #footer>
30
+ <div class="flex w-full justify-end gap-2">
31
+ <UButton
32
+ v-for="choice in dialog.choices"
33
+ :key="choice.value"
34
+ :color="choice.color ?? 'neutral'"
35
+ :variant="choice.variant ?? 'solid'"
36
+ :data-safe-choice="choice.value === dialog.dismiss || undefined"
37
+ @click="emit('answer', choice.value)"
38
+ >
39
+ {{ choice.label }}
40
+ </UButton>
41
+ </div>
42
+ </template>
43
+ </UModal>
44
+ </template>
@@ -0,0 +1,51 @@
1
+ <script setup lang="ts">
2
+ import type { ApiErrorNotice } from '#dms-core/app/composables/useApiErrorPresenter'
3
+
4
+ defineProps<{
5
+ submitting: boolean
6
+ error: ApiErrorNotice | null
7
+ }>()
8
+
9
+ const emit = defineEmits<{ submit: [] }>()
10
+
11
+ const open = defineModel<boolean>('open', { required: true })
12
+ </script>
13
+
14
+ <template>
15
+ <UModal
16
+ v-model:open="open"
17
+ :title="$t('dms_automation.editor.forkModal.title')"
18
+ >
19
+ <template #body>
20
+ <div class="flex flex-col gap-3">
21
+ <p class="text-sm text-toned">
22
+ {{ $t('dms_automation.editor.forkModal.body') }}
23
+ </p>
24
+ <DmsBanner
25
+ v-if="error"
26
+ size="sm"
27
+ :tone="error.severity"
28
+ :title="error.message"
29
+ />
30
+ </div>
31
+ </template>
32
+ <template #footer>
33
+ <div class="flex w-full justify-end gap-2">
34
+ <UButton
35
+ :label="$t('dms_automation.editor.forkModal.cancel')"
36
+ variant="outline"
37
+ color="neutral"
38
+ :disabled="submitting"
39
+ @click="open = false"
40
+ />
41
+ <UButton
42
+ :label="$t('dms_automation.editor.forkModal.submit')"
43
+ color="primary"
44
+ icon="i-ph-git-fork"
45
+ :loading="submitting"
46
+ @click="emit('submit')"
47
+ />
48
+ </div>
49
+ </template>
50
+ </UModal>
51
+ </template>
@@ -0,0 +1,146 @@
1
+ <script setup lang="ts">
2
+ import type { ProcedureSummaryRow } from '../../../components/Editor/ProcedureSwitcher.vue'
3
+ import type { ProcedureGraph } from '../../../composables/useGraphConnect'
4
+ import type { ProcedureRecord } from '../../types/editor'
5
+
6
+ defineProps<{
7
+ editorMode: 'procedure' | 'template'
8
+ libraryBackUrl: string
9
+ selected: ProcedureRecord | null
10
+ selectedId: string | null
11
+ currentGraph: ProcedureGraph | null
12
+ isCurrentGraphReadOnly: boolean
13
+ paletteHidden: boolean
14
+ nameInputId: string
15
+ nameMissing: boolean
16
+ currentSummary: ProcedureSummaryRow | null
17
+ changeCount: number
18
+ saveState: string
19
+ isDirty: boolean
20
+ saving: boolean
21
+ testing: boolean
22
+ runsUrl: string
23
+ formatShortcut: ReturnType<typeof useKeyboardPlatform>['formatShortcut']
24
+ }>()
25
+
26
+ const emit = defineEmits<{
27
+ 'open-switcher': []
28
+ 'toggle-palette': []
29
+ discard: []
30
+ 'run-now': []
31
+ 'test-run': []
32
+ save: []
33
+ create: []
34
+ export: []
35
+ delete: []
36
+ }>()
37
+
38
+ const procedureName = defineModel<string>('name', { required: true })
39
+ const procedureEnabled = defineModel<boolean>('enabled', { required: true })
40
+
41
+ const STATE_TONES = {
42
+ failing: 'error',
43
+ degraded: 'warning',
44
+ healthy: 'success',
45
+ paused: 'neutral',
46
+ draft: 'info',
47
+ } as const
48
+
49
+ </script>
50
+
51
+ <template>
52
+ <header class="flex min-h-13 flex-wrap items-center gap-2 border-b border-default px-3 py-2">
53
+ <template v-if="editorMode === 'procedure'">
54
+ <UTooltip :text="$t('dms_automation.editor.switcher.title')" :kbds="['meta', 'p']">
55
+ <UButton
56
+ icon="i-ph-flow-arrow"
57
+ variant="ghost"
58
+ color="neutral"
59
+ :aria-label="$t('dms_automation.editor.switcher.title')"
60
+ @click="emit('open-switcher')"
61
+ />
62
+ </UTooltip>
63
+ </template>
64
+ <template v-else>
65
+ <UButton icon="i-ph-arrow-left" variant="ghost" color="neutral" :to="libraryBackUrl">
66
+ {{ $t('dms_automation.library.title') }}
67
+ </UButton>
68
+ <UBadge color="info" variant="subtle">{{ $t('dms_automation.editor.templateBadge') }}</UBadge>
69
+ </template>
70
+ <UTooltip v-if="selected && currentGraph && !isCurrentGraphReadOnly" :text="paletteHidden ? $t('dms_automation.editor.showBlocks') : $t('dms_automation.editor.hideBlocks')">
71
+ <UButton
72
+ :icon="paletteHidden ? 'i-ph-sidebar-simple' : 'i-ph-sidebar-simple-fill'"
73
+ variant="ghost"
74
+ color="neutral"
75
+ :aria-label="paletteHidden ? $t('dms_automation.editor.showBlocks') : $t('dms_automation.editor.hideBlocks')"
76
+ :aria-pressed="!paletteHidden"
77
+ @click="emit('toggle-palette')"
78
+ />
79
+ </UTooltip>
80
+ <UInput
81
+ v-if="selected"
82
+ :id="nameInputId"
83
+ v-model="procedureName"
84
+ variant="ghost"
85
+ :color="nameMissing ? 'error' : undefined"
86
+ :highlight="nameMissing"
87
+ :placeholder="editorMode === 'template' ? $t('dms_automation.editor.templateName') : $t('dms_automation.editor.procedureName')"
88
+ :aria-label="editorMode === 'template' ? $t('dms_automation.editor.templateName') : $t('dms_automation.editor.procedureName')"
89
+ :aria-invalid="nameMissing || undefined"
90
+ :aria-describedby="nameMissing ? `${nameInputId}-error` : undefined"
91
+ class="min-w-[12rem] max-w-sm flex-1 font-medium"
92
+ />
93
+ <DmsFieldError v-if="nameMissing" :id="`${nameInputId}-error`" :message="$t('dms_automation.editor.nameRequired')" />
94
+ <DmsStatusPill
95
+ v-if="currentSummary && editorMode === 'procedure'"
96
+ :tone="STATE_TONES[currentSummary.status]"
97
+ :label="$t(`dms_automation.procedures.status.${currentSummary.status}`)"
98
+ size="sm"
99
+ />
100
+ <label v-if="selected && editorMode === 'procedure'" class="flex items-center gap-2 text-sm text-muted">
101
+ <USwitch v-model="procedureEnabled" size="sm" />
102
+ {{ procedureEnabled ? $t('dms_automation.editor.enabled') : $t('dms_automation.editor.disabled') }}
103
+ </label>
104
+ <span v-if="selected" class="ml-1 inline-flex items-center gap-1 whitespace-nowrap text-xs" :class="changeCount > 0 ? 'text-warning' : 'text-dimmed'">
105
+ <UIcon :name="changeCount > 0 ? 'i-ph-circle-fill' : 'i-ph-check'" class="size-2.5 shrink-0" />
106
+ {{ saveState }}
107
+ </span>
108
+ <div class="ml-auto flex flex-wrap items-center gap-2">
109
+ <UButton
110
+ v-if="selected"
111
+ variant="ghost"
112
+ color="neutral"
113
+ :disabled="!isDirty || saving"
114
+ @click="emit('discard')"
115
+ >
116
+ {{ $t('dms_automation.editor.discard') }}
117
+ </UButton>
118
+ <template v-if="selected && editorMode === 'procedure'">
119
+ <UButton variant="outline" color="neutral" icon="i-ph-play" @click="emit('run-now')">
120
+ {{ $t('dms_automation.editor.runNowButton') }}
121
+ </UButton>
122
+ <UButton variant="outline" color="neutral" icon="i-ph-flask" :loading="testing" @click="emit('test-run')">
123
+ {{ $t('dms_automation.editor.testRun') }}
124
+ <UKbd :value="formatShortcut(['meta', '↵'])" size="sm" class="ml-1" />
125
+ </UButton>
126
+ </template>
127
+ <UButton v-if="selected" color="primary" icon="i-ph-floppy-disk" :disabled="!isDirty || nameMissing" :loading="saving" @click="emit('save')">
128
+ {{ $t('dms_automation.common.save') }}
129
+ <UKbd :value="formatShortcut(['meta', 's'])" size="sm" class="ml-1" />
130
+ </UButton>
131
+ <UDropdownMenu
132
+ v-if="selected && editorMode === 'procedure'"
133
+ :items="[
134
+ [
135
+ { label: $t('dms_automation.newProcedure.title'), icon: 'i-ph-plus', onSelect: () => emit('create') },
136
+ { label: $t('dms_automation.editor.exportJson'), icon: 'i-ph-download-simple', onSelect: () => emit('export') },
137
+ { label: $t('dms_automation.editor.viewRuns'), icon: 'i-ph-list-bullets', to: `${runsUrl}?procedure=${selectedId}` },
138
+ ],
139
+ [{ label: $t('dms_automation.editor.delete'), icon: 'i-ph-trash', color: 'error', onSelect: () => emit('delete') }],
140
+ ]"
141
+ >
142
+ <UButton icon="i-ph-dots-three" variant="ghost" color="neutral" :aria-label="$t('dms_automation.editor.more')" />
143
+ </UDropdownMenu>
144
+ </div>
145
+ </header>
146
+ </template>
@@ -0,0 +1,105 @@
1
+ <script setup lang="ts">
2
+ import type { GraphNode } from '../../../composables/useGraphConnect'
3
+ import { TEMPLATE_NAME_ID, TEMPLATE_ROW } from '../../composables/editor/useSaveAsTemplate'
4
+
5
+ defineProps<{
6
+ group: GraphNode | null
7
+ submitting: boolean
8
+ error: string | null
9
+ fieldErrors: ReturnType<typeof useFieldErrors<'name'>>
10
+ }>()
11
+
12
+ const emit = defineEmits<{ submit: [] }>()
13
+
14
+ const open = defineModel<boolean>('open', { required: true })
15
+ const name = defineModel<string>('name', { required: true })
16
+ const description = defineModel<string>('description', { required: true })
17
+ const icon = defineModel<string>('icon', { required: true })
18
+ </script>
19
+
20
+ <template>
21
+ <UModal
22
+ v-model:open="open"
23
+ :title="$t('dms_automation.editor.saveTemplateModal.title')"
24
+ >
25
+ <template #body>
26
+ <div class="flex flex-col gap-3">
27
+ <DmsFieldRow
28
+ v-bind="TEMPLATE_ROW"
29
+ :label="$t('dms_automation.editor.saveTemplateModal.name')"
30
+ :label-for="TEMPLATE_NAME_ID"
31
+ required
32
+ >
33
+ <div class="grid gap-1.5">
34
+ <DmsInputText
35
+ :id="TEMPLATE_NAME_ID"
36
+ v-model="name"
37
+ :placeholder="$t('dms_automation.editor.saveTemplateModal.namePlaceholder')"
38
+ class="w-full"
39
+ :disabled="submitting"
40
+ v-bind="fieldErrors.aria('name')"
41
+ />
42
+ <DmsFieldError :id="fieldErrors.errorId('name')" :message="fieldErrors.errors.name" />
43
+ </div>
44
+ </DmsFieldRow>
45
+ <DmsFieldRow
46
+ v-bind="TEMPLATE_ROW"
47
+ :label="$t('dms_automation.editor.saveTemplateModal.description')"
48
+ label-for="save-template-description"
49
+ >
50
+ <DmsTextarea
51
+ id="save-template-description"
52
+ v-model="description"
53
+ :placeholder="$t('dms_automation.editor.saveTemplateModal.descriptionPlaceholder')"
54
+ class="w-full"
55
+ :rows="3"
56
+ :disabled="submitting"
57
+ />
58
+ </DmsFieldRow>
59
+ <DmsFieldRow v-bind="TEMPLATE_ROW" :label="$t('dms_automation.editor.saveTemplateModal.icon')">
60
+ <DmsAutomationIconPicker v-model="icon" />
61
+ </DmsFieldRow>
62
+ <div v-if="group?.ports?.length" class="flex flex-col gap-1">
63
+ <span class="text-xs font-medium text-highlighted">{{ $t('dms_automation.editor.saveTemplateModal.ports') }}</span>
64
+ <div class="overflow-hidden rounded-md border border-default">
65
+ <div
66
+ v-for="port in group.ports"
67
+ :key="`${port.direction}-${port.kind}-${port.name}`"
68
+ class="flex items-center gap-2 border-b border-default px-2 py-1 font-mono text-xs last:border-0"
69
+ >
70
+ <UBadge size="sm" variant="subtle" :color="port.kind === 'trigger' ? 'info' : 'success'">{{ $t(`dms_automation.templates.ports.kind.${port.kind}`) }}</UBadge>
71
+ <span class="text-muted">{{ $t(`dms_automation.templates.ports.direction.${port.direction}`) }}</span>
72
+ <span class="text-highlighted">{{ port.name }}</span>
73
+ <span v-if="port.schema?.type" class="ml-auto text-dimmed">{{ port.schema.type }}</span>
74
+ </div>
75
+ </div>
76
+ </div>
77
+ <DmsBanner
78
+ v-if="error"
79
+ size="sm"
80
+ tone="error"
81
+ :title="$t('dms_automation.editor.saveTemplateModal.error')"
82
+ :description="error"
83
+ />
84
+ <DmsFormRequiredLegend />
85
+ </div>
86
+ </template>
87
+ <template #footer>
88
+ <div class="flex w-full justify-end gap-2">
89
+ <UButton
90
+ :label="$t('dms_automation.editor.saveTemplateModal.cancel')"
91
+ variant="outline"
92
+ color="neutral"
93
+ :disabled="submitting"
94
+ @click="open = false"
95
+ />
96
+ <UButton
97
+ :label="$t('dms_automation.editor.saveTemplateModal.submit')"
98
+ color="primary"
99
+ :loading="submitting"
100
+ @click="emit('submit')"
101
+ />
102
+ </div>
103
+ </template>
104
+ </UModal>
105
+ </template>
@@ -0,0 +1,28 @@
1
+ <script setup lang="ts">
2
+ import type { JsonSchema } from '../../../composables/useGraphConnect'
3
+
4
+ defineProps<{
5
+ description: string
6
+ inputSchema: JsonSchema | null
7
+ branches: string[]
8
+ outputSchema: JsonSchema | null
9
+ }>()
10
+ </script>
11
+
12
+ <template>
13
+ <div class="flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto p-4">
14
+ <p class="text-sm text-toned">{{ description || $t('dms_automation.editor.inspector.noDocs') }}</p>
15
+ <div class="flex flex-col gap-1">
16
+ <span class="font-mono text-[10.5px] text-dimmed uppercase">{{ $t('dms_automation.library.inputs') }}</span>
17
+ <DmsAutomationSchemaTable :schema="inputSchema" />
18
+ </div>
19
+ <div v-if="branches.length" class="flex flex-col gap-1">
20
+ <span class="font-mono text-[10.5px] text-dimmed uppercase">{{ $t('dms_automation.editor.inspector.branches') }}</span>
21
+ <p class="font-mono text-xs text-toned">{{ branches.join(' · ') }}</p>
22
+ </div>
23
+ <div class="flex flex-col gap-1">
24
+ <span class="font-mono text-[10.5px] text-dimmed uppercase">{{ $t('dms_automation.library.outputs') }}</span>
25
+ <DmsAutomationSchemaTable :schema="outputSchema" />
26
+ </div>
27
+ </div>
28
+ </template>
@@ -0,0 +1,48 @@
1
+ <script setup lang="ts">
2
+ import type { TraceStep } from '../../../composables/useAutomationRuns'
3
+ import { describeDuration, prettyJson } from '../../../utils/describe'
4
+
5
+ defineProps<{
6
+ runStep: TraceStep
7
+ /** Says which run that is ("Test run · just now", "Run 8f3a2c · 14:28"). */
8
+ runLabel?: string
9
+ /** Opens the trace of that run. */
10
+ runTraceUrl?: string
11
+ }>()
12
+
13
+ function unwrap(described: unknown): unknown {
14
+ if (!described || typeof described !== 'object') return described
15
+ if ('value' in described && 'type' in described) return (described as { value: unknown }).value
16
+ return Object.fromEntries(Object.entries(described as Record<string, unknown>).map(([k, v]) => [k, unwrap(v)]))
17
+ }
18
+ </script>
19
+
20
+ <template>
21
+ <div class="flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto p-4">
22
+ <div class="flex items-center justify-between gap-2">
23
+ <DmsStatusPill
24
+ :tone="runStep.status === 'failed' ? 'error' : 'success'"
25
+ :label="runStep.status === 'failed' ? $t('dms_automation.runs.status.failed') : $t('dms_automation.runs.status.ok')"
26
+ size="sm"
27
+ />
28
+ <span class="font-mono text-xs text-muted">{{ describeDuration(runStep.durationMs) }}</span>
29
+ </div>
30
+ <p v-if="runLabel" class="text-xs text-muted">{{ runLabel }}</p>
31
+ <div class="flex flex-col gap-1">
32
+ <span class="font-mono text-[10.5px] text-dimmed uppercase">{{ $t('dms_automation.trace.input') }}</span>
33
+ <pre class="max-h-56 overflow-auto rounded-md bg-elevated p-2 font-mono text-xs break-all whitespace-pre-wrap text-toned">{{ prettyJson(unwrap(runStep.inputs)) || '—' }}</pre>
34
+ </div>
35
+ <div class="flex flex-col gap-1">
36
+ <span class="font-mono text-[10.5px] text-dimmed uppercase">
37
+ {{ runStep.status === 'failed' ? $t('dms_automation.trace.error') : $t('dms_automation.trace.output') }}
38
+ </span>
39
+ <pre
40
+ class="max-h-56 overflow-auto rounded-md bg-elevated p-2 font-mono text-xs break-all whitespace-pre-wrap"
41
+ :class="runStep.status === 'failed' ? 'text-error' : 'text-toned'"
42
+ >{{ runStep.status === 'failed' ? runStep.error : prettyJson(unwrap(runStep.output)) || '—' }}</pre>
43
+ </div>
44
+ <UButton v-if="runTraceUrl" size="xs" variant="ghost" color="neutral" trailing-icon="i-ph-arrow-up-right" :to="runTraceUrl" class="self-start">
45
+ {{ $t('dms_automation.trace.openFull') }}
46
+ </UButton>
47
+ </div>
48
+ </template>