ultravisor 1.0.3 → 1.0.8

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 (248) hide show
  1. package/.claude/launch.json +11 -0
  2. package/.claude/ultravisor-dev-config.json +3 -0
  3. package/card-audit.json +1545 -0
  4. package/docs/_sidebar.md +17 -0
  5. package/docs/css/docuserve.css +73 -0
  6. package/docs/features/beacon-authentication.md +209 -0
  7. package/docs/features/beacon-providers.md +1299 -0
  8. package/docs/features/beacons.md +530 -0
  9. package/docs/features/capabilities.md +193 -0
  10. package/docs/features/llm-model-setup.md +505 -0
  11. package/docs/features/llm.md +262 -0
  12. package/docs/features/tasks-content-system.md +110 -0
  13. package/docs/features/tasks-data-transform.md +233 -0
  14. package/docs/features/tasks-extension.md +36 -0
  15. package/docs/features/tasks-file-system.md +203 -0
  16. package/docs/features/tasks-flow-control.md +125 -0
  17. package/docs/features/tasks-http-client.md +119 -0
  18. package/docs/features/tasks-llm.md +118 -0
  19. package/docs/features/tasks-meadow-api.md +163 -0
  20. package/docs/features/tasks-user-interaction.md +49 -0
  21. package/docs/features/tasks.md +14 -0
  22. package/docs/index.html +1 -1
  23. package/docs/retold-catalog.json +1 -1
  24. package/docs/retold-keyword-index.json +17374 -5
  25. package/operation-library/api-data-pipeline.json +143 -0
  26. package/operation-library/beacon-remote-command.json +72 -0
  27. package/operation-library/conditional-file-backup.json +143 -0
  28. package/operation-library/config-processor.json +136 -0
  29. package/operation-library/csv-data-analysis.json +228 -0
  30. package/operation-library/csv-to-json.json +160 -0
  31. package/operation-library/directory-inventory.json +128 -0
  32. package/operation-library/expression-calculator.json +114 -0
  33. package/operation-library/file-search-replace.json +175 -0
  34. package/operation-library/git-status-report.json +368 -0
  35. package/operation-library/health-check-ping.json +329 -0
  36. package/operation-library/json-config-merge.json +313 -0
  37. package/operation-library/llm-embedding-tool-use.json +314 -0
  38. package/operation-library/llm-multi-turn-analysis.json +322 -0
  39. package/operation-library/llm-summarize.json +264 -0
  40. package/operation-library/log-line-counter.json +185 -0
  41. package/operation-library/meadow-crud-lifecycle.json +264 -0
  42. package/operation-library/npm-project-validator.json +193 -0
  43. package/operation-library/rest-api-orchestrator.json +218 -0
  44. package/operation-library/shell-system-info.json +137 -0
  45. package/operation-library/simple-echo.json +95 -0
  46. package/operation-library/template-processor.json +299 -0
  47. package/operation-library/text-sanitizer.json +176 -0
  48. package/package.json +12 -8
  49. package/source/Ultravisor.cjs +30 -3
  50. package/source/beacon/Ultravisor-Beacon-CLI.cjs +143 -0
  51. package/source/beacon/Ultravisor-Beacon-CapabilityProvider.cjs +129 -0
  52. package/source/beacon/Ultravisor-Beacon-Client.cjs +568 -0
  53. package/source/beacon/Ultravisor-Beacon-Executor.cjs +500 -0
  54. package/source/beacon/Ultravisor-Beacon-ProviderRegistry.cjs +330 -0
  55. package/source/beacon/providers/Ultravisor-Beacon-Provider-FileSystem.cjs +331 -0
  56. package/source/beacon/providers/Ultravisor-Beacon-Provider-LLM.cjs +966 -0
  57. package/source/beacon/providers/Ultravisor-Beacon-Provider-Shell.cjs +95 -0
  58. package/source/cli/Ultravisor-CLIProgram.cjs +44 -22
  59. package/source/cli/commands/Ultravisor-Command-SingleOperation.cjs +29 -18
  60. package/source/cli/commands/Ultravisor-Command-SingleTask.cjs +62 -19
  61. package/source/cli/commands/Ultravisor-Command-UpdateTask.cjs +27 -15
  62. package/source/config/Ultravisor-Default-Command-Configuration.cjs +12 -3
  63. package/source/services/Ultravisor-Beacon-Coordinator.cjs +966 -0
  64. package/source/services/Ultravisor-ExecutionEngine.cjs +1093 -0
  65. package/source/services/Ultravisor-ExecutionManifest.cjs +629 -0
  66. package/source/services/Ultravisor-Hypervisor-State.cjs +270 -97
  67. package/source/services/Ultravisor-Hypervisor.cjs +185 -75
  68. package/source/services/Ultravisor-Schedule-Persistence-Base.cjs +45 -0
  69. package/source/services/Ultravisor-StateManager.cjs +253 -0
  70. package/source/services/Ultravisor-TaskTypeRegistry.cjs +213 -0
  71. package/source/services/persistence/Ultravisor-Schedule-Persistence-JSONFile.cjs +140 -0
  72. package/source/services/tasks/Ultravisor-BuiltIn-TaskConfigs.cjs +19 -0
  73. package/source/services/tasks/Ultravisor-TaskHelper-BeaconDispatch.cjs +107 -0
  74. package/source/services/tasks/Ultravisor-TaskType-Base.cjs +125 -0
  75. package/source/services/tasks/content-system/Ultravisor-TaskConfigs-ContentSystem.cjs +90 -0
  76. package/source/services/tasks/content-system/definitions/content-create-folder.json +24 -0
  77. package/source/services/tasks/content-system/definitions/content-list-files.json +27 -0
  78. package/source/services/tasks/content-system/definitions/content-read-file.json +26 -0
  79. package/source/services/tasks/content-system/definitions/content-save-file.json +26 -0
  80. package/source/services/tasks/data-transform/Ultravisor-TaskConfigs-DataTransform.cjs +577 -0
  81. package/source/services/tasks/data-transform/Ultravisor-TaskType-ReplaceString.cjs +80 -0
  82. package/source/services/tasks/data-transform/Ultravisor-TaskType-SetValues.cjs +74 -0
  83. package/source/services/tasks/data-transform/Ultravisor-TaskType-StringAppender.cjs +90 -0
  84. package/source/services/tasks/data-transform/definitions/comprehension-intersect.json +24 -0
  85. package/source/services/tasks/data-transform/definitions/csv-transform.json +24 -0
  86. package/source/services/tasks/data-transform/definitions/expression-solver.json +20 -0
  87. package/source/services/tasks/data-transform/definitions/histogram.json +23 -0
  88. package/source/services/tasks/data-transform/definitions/parse-csv.json +27 -0
  89. package/source/services/tasks/data-transform/definitions/replace-string.json +27 -0
  90. package/source/services/tasks/data-transform/definitions/set-values.json +17 -0
  91. package/source/services/tasks/data-transform/definitions/string-appender.json +22 -0
  92. package/source/services/tasks/data-transform/definitions/template-string.json +20 -0
  93. package/source/services/tasks/extension/Ultravisor-TaskConfigs-Extension.cjs +87 -0
  94. package/source/services/tasks/extension/definitions/beacon-dispatch.json +32 -0
  95. package/source/services/tasks/file-system/Ultravisor-TaskConfigs-FileSystem.cjs +509 -0
  96. package/source/services/tasks/file-system/Ultravisor-TaskType-ReadFile.cjs +96 -0
  97. package/source/services/tasks/file-system/Ultravisor-TaskType-ReadFileBuffered.cjs +123 -0
  98. package/source/services/tasks/file-system/Ultravisor-TaskType-WriteFile.cjs +106 -0
  99. package/source/services/tasks/file-system/definitions/copy-file.json +27 -0
  100. package/source/services/tasks/file-system/definitions/list-files.json +27 -0
  101. package/source/services/tasks/file-system/definitions/read-file-buffered.json +31 -0
  102. package/source/services/tasks/file-system/definitions/read-file.json +26 -0
  103. package/source/services/tasks/file-system/definitions/read-json.json +23 -0
  104. package/source/services/tasks/file-system/definitions/write-file.json +29 -0
  105. package/source/services/tasks/file-system/definitions/write-json.json +30 -0
  106. package/source/services/tasks/flow-control/Ultravisor-TaskConfigs-FlowControl.cjs +353 -0
  107. package/source/services/tasks/flow-control/Ultravisor-TaskType-IfConditional.cjs +125 -0
  108. package/source/services/tasks/flow-control/Ultravisor-TaskType-LaunchOperation.cjs +186 -0
  109. package/source/services/tasks/flow-control/Ultravisor-TaskType-SplitExecute.cjs +164 -0
  110. package/source/services/tasks/flow-control/definitions/if-conditional.json +25 -0
  111. package/source/services/tasks/flow-control/definitions/launch-operation.json +27 -0
  112. package/source/services/tasks/flow-control/definitions/split-execute.json +32 -0
  113. package/source/services/tasks/http-client/Ultravisor-TaskConfigs-HttpClient.cjs +281 -0
  114. package/source/services/tasks/http-client/definitions/get-json.json +26 -0
  115. package/source/services/tasks/http-client/definitions/get-text.json +26 -0
  116. package/source/services/tasks/http-client/definitions/rest-request.json +32 -0
  117. package/source/services/tasks/http-client/definitions/send-json.json +28 -0
  118. package/source/services/tasks/llm/Ultravisor-TaskConfigs-LLM.cjs +605 -0
  119. package/source/services/tasks/llm/definitions/llm-chat-completion.json +46 -0
  120. package/source/services/tasks/llm/definitions/llm-embedding.json +31 -0
  121. package/source/services/tasks/llm/definitions/llm-tool-use.json +42 -0
  122. package/source/services/tasks/meadow-api/Ultravisor-TaskConfigs-MeadowApi.cjs +341 -0
  123. package/source/services/tasks/meadow-api/definitions/meadow-count.json +26 -0
  124. package/source/services/tasks/meadow-api/definitions/meadow-create.json +26 -0
  125. package/source/services/tasks/meadow-api/definitions/meadow-delete.json +23 -0
  126. package/source/services/tasks/meadow-api/definitions/meadow-read.json +26 -0
  127. package/source/services/tasks/meadow-api/definitions/meadow-reads.json +29 -0
  128. package/source/services/tasks/meadow-api/definitions/meadow-update.json +26 -0
  129. package/source/services/tasks/shell/Ultravisor-TaskConfigs-Shell.cjs +63 -0
  130. package/source/services/tasks/shell/definitions/command.json +29 -0
  131. package/source/services/tasks/user-interaction/Ultravisor-TaskConfigs-UserInteraction.cjs +64 -0
  132. package/source/services/tasks/user-interaction/Ultravisor-TaskType-ErrorMessage.cjs +55 -0
  133. package/source/services/tasks/user-interaction/Ultravisor-TaskType-ValueInput.cjs +47 -0
  134. package/source/services/tasks/user-interaction/definitions/error-message.json +18 -0
  135. package/source/services/tasks/user-interaction/definitions/value-input.json +23 -0
  136. package/source/web_server/Ultravisor-API-Server.cjs +849 -124
  137. package/test/Ultravisor_browser_tests.js +2226 -0
  138. package/test/Ultravisor_operation_library_tests.js +894 -0
  139. package/test/Ultravisor_tests.js +4946 -5044
  140. package/test/workflows/test-content-concatenate-all.json +339 -0
  141. package/test/workflows/test-content-full-pipeline.json +159 -0
  142. package/test/workflows/test-content-list-files.json +76 -0
  143. package/test/workflows/test-content-save-and-read.json +106 -0
  144. package/webinterface/css/ultravisor-themes.css +668 -0
  145. package/webinterface/css/ultravisor.css +37 -14
  146. package/webinterface/docs/card-help/beacon-dispatch.md +30 -0
  147. package/webinterface/docs/card-help/command.md +27 -0
  148. package/webinterface/docs/card-help/comprehension-intersect.md +24 -0
  149. package/webinterface/docs/card-help/content-create-folder.md +22 -0
  150. package/webinterface/docs/card-help/content-list-files.md +25 -0
  151. package/webinterface/docs/card-help/content-read-file.md +24 -0
  152. package/webinterface/docs/card-help/content-save-file.md +24 -0
  153. package/webinterface/docs/card-help/copy-file.md +25 -0
  154. package/webinterface/docs/card-help/csv-transform.md +24 -0
  155. package/webinterface/docs/card-help/end.md +11 -0
  156. package/webinterface/docs/card-help/error-message.md +16 -0
  157. package/webinterface/docs/card-help/expression-solver.md +21 -0
  158. package/webinterface/docs/card-help/get-json.md +24 -0
  159. package/webinterface/docs/card-help/get-text.md +24 -0
  160. package/webinterface/docs/card-help/histogram.md +23 -0
  161. package/webinterface/docs/card-help/if-conditional.md +23 -0
  162. package/webinterface/docs/card-help/launch-operation.md +25 -0
  163. package/webinterface/docs/card-help/list-files.md +25 -0
  164. package/webinterface/docs/card-help/llm-chat-completion.md +43 -0
  165. package/webinterface/docs/card-help/llm-embedding.md +24 -0
  166. package/webinterface/docs/card-help/llm-tool-use.md +39 -0
  167. package/webinterface/docs/card-help/meadow-count.md +24 -0
  168. package/webinterface/docs/card-help/meadow-create.md +24 -0
  169. package/webinterface/docs/card-help/meadow-delete.md +19 -0
  170. package/webinterface/docs/card-help/meadow-read.md +24 -0
  171. package/webinterface/docs/card-help/meadow-reads.md +27 -0
  172. package/webinterface/docs/card-help/meadow-update.md +24 -0
  173. package/webinterface/docs/card-help/parse-csv.md +27 -0
  174. package/webinterface/docs/card-help/read-file-buffered.md +29 -0
  175. package/webinterface/docs/card-help/read-file.md +24 -0
  176. package/webinterface/docs/card-help/read-json.md +21 -0
  177. package/webinterface/docs/card-help/replace-string.md +25 -0
  178. package/webinterface/docs/card-help/rest-request.md +30 -0
  179. package/webinterface/docs/card-help/send-json.md +26 -0
  180. package/webinterface/docs/card-help/set-values.md +16 -0
  181. package/webinterface/docs/card-help/split-execute.md +35 -0
  182. package/webinterface/docs/card-help/start.md +11 -0
  183. package/webinterface/docs/card-help/string-appender.md +22 -0
  184. package/webinterface/docs/card-help/template-string.md +21 -0
  185. package/webinterface/docs/card-help/value-input.md +24 -0
  186. package/webinterface/docs/card-help/write-file.md +27 -0
  187. package/webinterface/docs/card-help/write-json.md +28 -0
  188. package/webinterface/html/index.html +5 -0
  189. package/webinterface/package.json +13 -4
  190. package/webinterface/source/Pict-Application-Ultravisor.js +564 -70
  191. package/webinterface/source/Ultravisor-TimingUtils.js +99 -0
  192. package/webinterface/source/card-help-content.js +46 -0
  193. package/webinterface/source/cards/Ultravisor-BuiltIn-CardConfigs.js +174 -0
  194. package/webinterface/source/cards/Ultravisor-CardConfigGenerator.js +431 -0
  195. package/webinterface/source/data/ExampleFlow-CSVPipeline.js +231 -0
  196. package/webinterface/source/data/ExampleFlow-FileProcessor.js +315 -0
  197. package/webinterface/source/data/ExampleFlow-MeadowPipeline.js +328 -0
  198. package/webinterface/source/panels/Ultravisor-CardSettingsPanel.js +902 -0
  199. package/webinterface/source/providers/PictRouter-Ultravisor-Configuration.json +20 -8
  200. package/webinterface/source/views/PictView-Ultravisor-BeaconList.js +817 -0
  201. package/webinterface/source/views/PictView-Ultravisor-BottomBar.js +5 -5
  202. package/webinterface/source/views/PictView-Ultravisor-Dashboard.js +25 -25
  203. package/webinterface/source/views/PictView-Ultravisor-Documentation.js +856 -0
  204. package/webinterface/source/views/PictView-Ultravisor-FlowEditor.js +777 -0
  205. package/webinterface/source/views/PictView-Ultravisor-ManifestList.js +321 -58
  206. package/webinterface/source/views/PictView-Ultravisor-OperationEdit.js +36 -91
  207. package/webinterface/source/views/PictView-Ultravisor-OperationList.js +388 -16
  208. package/webinterface/source/views/PictView-Ultravisor-PendingInput.js +314 -0
  209. package/webinterface/source/views/PictView-Ultravisor-Schedule.js +521 -65
  210. package/webinterface/source/views/PictView-Ultravisor-TimingView.js +333 -71
  211. package/webinterface/source/views/PictView-Ultravisor-TopBar.js +257 -21
  212. package/webinterface/theme-sampler.html +645 -0
  213. package/debug/Harness.js +0 -6
  214. package/source/services/Ultravisor-Operation-Manifest.cjs +0 -160
  215. package/source/services/Ultravisor-Operation.cjs +0 -200
  216. package/source/services/Ultravisor-Task.cjs +0 -349
  217. package/source/services/events/Ultravisor-Hypervisor-Event-Solver.cjs +0 -11
  218. package/source/services/tasks/Ultravisor-Task-Base.cjs +0 -264
  219. package/source/services/tasks/Ultravisor-Task-CollectValues.cjs +0 -188
  220. package/source/services/tasks/Ultravisor-Task-Command.cjs +0 -65
  221. package/source/services/tasks/Ultravisor-Task-CommandEach.cjs +0 -190
  222. package/source/services/tasks/Ultravisor-Task-Conditional.cjs +0 -104
  223. package/source/services/tasks/Ultravisor-Task-DateWindow.cjs +0 -72
  224. package/source/services/tasks/Ultravisor-Task-GeneratePagedOperation.cjs +0 -336
  225. package/source/services/tasks/Ultravisor-Task-LaunchOperation.cjs +0 -143
  226. package/source/services/tasks/Ultravisor-Task-LaunchTask.cjs +0 -146
  227. package/source/services/tasks/Ultravisor-Task-LineMatch.cjs +0 -158
  228. package/source/services/tasks/Ultravisor-Task-Request.cjs +0 -56
  229. package/source/services/tasks/Ultravisor-Task-Solver.cjs +0 -89
  230. package/source/services/tasks/Ultravisor-Task-TemplateString.cjs +0 -93
  231. package/source/services/tasks/rest/Ultravisor-Task-GetBinary.cjs +0 -127
  232. package/source/services/tasks/rest/Ultravisor-Task-GetJSON.cjs +0 -119
  233. package/source/services/tasks/rest/Ultravisor-Task-GetText.cjs +0 -109
  234. package/source/services/tasks/rest/Ultravisor-Task-GetXML.cjs +0 -112
  235. package/source/services/tasks/rest/Ultravisor-Task-RestRequest.cjs +0 -499
  236. package/source/services/tasks/rest/Ultravisor-Task-SendJSON.cjs +0 -150
  237. package/source/services/tasks/stagingfiles/Ultravisor-Task-CopyFile.cjs +0 -110
  238. package/source/services/tasks/stagingfiles/Ultravisor-Task-ListFiles.cjs +0 -89
  239. package/source/services/tasks/stagingfiles/Ultravisor-Task-ReadBinary.cjs +0 -87
  240. package/source/services/tasks/stagingfiles/Ultravisor-Task-ReadJSON.cjs +0 -67
  241. package/source/services/tasks/stagingfiles/Ultravisor-Task-ReadText.cjs +0 -66
  242. package/source/services/tasks/stagingfiles/Ultravisor-Task-ReadXML.cjs +0 -69
  243. package/source/services/tasks/stagingfiles/Ultravisor-Task-WriteBinary.cjs +0 -95
  244. package/source/services/tasks/stagingfiles/Ultravisor-Task-WriteJSON.cjs +0 -96
  245. package/source/services/tasks/stagingfiles/Ultravisor-Task-WriteText.cjs +0 -99
  246. package/source/services/tasks/stagingfiles/Ultravisor-Task-WriteXML.cjs +0 -102
  247. package/webinterface/source/views/PictView-Ultravisor-TaskEdit.js +0 -220
  248. package/webinterface/source/views/PictView-Ultravisor-TaskList.js +0 -248
@@ -0,0 +1,315 @@
1
+ /**
2
+ * Example Flow: File Processor (Search & Replace)
3
+ *
4
+ * Demonstrates a complete file processing pipeline with user input, looping,
5
+ * and error handling:
6
+ *
7
+ * Start
8
+ * -> Value Input (ask user for file path, stores to Operation.InputFilePath)
9
+ * -> Read File (loads the file at the user-provided path)
10
+ * -> [Error] -> Error Message -> End
11
+ * -> Split Execute (split file into lines)
12
+ * -> [per line] Replace String ("John" -> "Jane")
13
+ * -> String Appender (accumulate into Operation.OutputFileContents)
14
+ * -> [loop back: Append Completed -> Split StepComplete]
15
+ * -> [all lines done] Write File (save to original path + ".ultracopy")
16
+ * -> End
17
+ *
18
+ * This example showcases:
19
+ * - Value input pausing execution for user interaction
20
+ * - State connections (data flow between task settings/outputs)
21
+ * - The split-execute looping pattern with StepComplete feedback
22
+ * - Error branching
23
+ * - Pict template expressions for dynamic file paths
24
+ */
25
+ module.exports =
26
+ {
27
+ Nodes:
28
+ [
29
+ // ── Start ────────────────────────────────────────────────
30
+ {
31
+ Hash: 'fp-start',
32
+ Type: 'start',
33
+ X: 50,
34
+ Y: 200,
35
+ Width: 140,
36
+ Height: 80,
37
+ Title: 'Start',
38
+ Ports:
39
+ [
40
+ { Hash: 'fp-start-out', Direction: 'output', Side: 'right', Label: 'Out' }
41
+ ],
42
+ Data: {}
43
+ },
44
+ // ── Ask user for file path ───────────────────────────────
45
+ {
46
+ Hash: 'fp-input',
47
+ Type: 'value-input',
48
+ X: 280,
49
+ Y: 180,
50
+ Width: 220,
51
+ Height: 100,
52
+ Title: 'Enter File Path',
53
+ Ports:
54
+ [
55
+ { Hash: 'fp-input-req', Direction: 'input', Side: 'left-bottom', Label: 'RequestInput' },
56
+ { Hash: 'fp-input-done', Direction: 'output', Side: 'right', Label: 'ValueInputComplete' },
57
+ { Hash: 'fp-input-filepath', Direction: 'output', Side: 'right-top', Label: 'InputFilePath' }
58
+ ],
59
+ Data: { PromptMessage: 'Enter a file path and name', OutputAddress: 'Operation.InputFilePath' }
60
+ },
61
+ // ── Load the file ────────────────────────────────────────
62
+ {
63
+ Hash: 'fp-read',
64
+ Type: 'read-file',
65
+ X: 590,
66
+ Y: 180,
67
+ Width: 200,
68
+ Height: 100,
69
+ Title: 'Load File',
70
+ Ports:
71
+ [
72
+ { Hash: 'fp-read-begin', Direction: 'input', Side: 'left-bottom', Label: 'BeginRead' },
73
+ { Hash: 'fp-read-filepath', Direction: 'input', Side: 'left-top', Label: 'FilePath' },
74
+ { Hash: 'fp-read-done', Direction: 'output', Side: 'right', Label: 'ReadComplete' },
75
+ { Hash: 'fp-read-content', Direction: 'output', Side: 'right-top', Label: 'FileContent' },
76
+ { Hash: 'fp-read-err', Direction: 'output', Side: 'bottom', Label: 'Error' }
77
+ ],
78
+ Data: { FilePath: '{~D:Record.Operation.InputFilePath~}', Encoding: 'utf8' }
79
+ },
80
+ // ── Error handler for file read ──────────────────────────
81
+ {
82
+ Hash: 'fp-error',
83
+ Type: 'error-message',
84
+ X: 590,
85
+ Y: 420,
86
+ Width: 220,
87
+ Height: 80,
88
+ Title: 'Read Error',
89
+ Ports:
90
+ [
91
+ { Hash: 'fp-error-in', Direction: 'input', Side: 'left-bottom', Label: 'Trigger' },
92
+ { Hash: 'fp-error-done', Direction: 'output', Side: 'right', Label: 'Complete' }
93
+ ],
94
+ Data: { MessageTemplate: 'Failed to read file: {~D:Record.Operation.InputFilePath~}' }
95
+ },
96
+ // ── Split file into lines ────────────────────────────────
97
+ {
98
+ Hash: 'fp-split',
99
+ Type: 'split-execute',
100
+ X: 890,
101
+ Y: 160,
102
+ Width: 240,
103
+ Height: 120,
104
+ Title: 'Split Lines',
105
+ Ports:
106
+ [
107
+ { Hash: 'fp-split-begin', Direction: 'input', Side: 'left-bottom', Label: 'PerformSplit' },
108
+ { Hash: 'fp-split-step', Direction: 'input', Side: 'left-bottom', Label: 'StepComplete' },
109
+ { Hash: 'fp-split-inputstr', Direction: 'input', Side: 'left-top', Label: 'InputString' },
110
+ { Hash: 'fp-split-token', Direction: 'output', Side: 'right', Label: 'TokenDataSent' },
111
+ { Hash: 'fp-split-alldone', Direction: 'output', Side: 'right-bottom', Label: 'CompletedAllSubtasks' }
112
+ ],
113
+ Data: { InputString: '{~D:Record.TaskOutput.fp-read.FileContent~}', SplitDelimiter: '\n' }
114
+ },
115
+ // ── Replace "John" with "Jane" in each line ──────────────
116
+ {
117
+ Hash: 'fp-replace',
118
+ Type: 'replace-string',
119
+ X: 1230,
120
+ Y: 160,
121
+ Width: 220,
122
+ Height: 100,
123
+ Title: 'Replace John with Jane',
124
+ Ports:
125
+ [
126
+ { Hash: 'fp-replace-in', Direction: 'input', Side: 'left-bottom', Label: 'Replace' },
127
+ { Hash: 'fp-replace-done', Direction: 'output', Side: 'right', Label: 'ReplaceComplete' },
128
+ { Hash: 'fp-replace-result', Direction: 'output', Side: 'right-top', Label: 'ReplacedString' }
129
+ ],
130
+ Data: { InputString: '{~D:Record.TaskOutput.fp-split.CurrentToken~}', SearchString: 'John', ReplaceString: 'Jane' }
131
+ },
132
+ // ── Append each processed line to output ─────────────────
133
+ {
134
+ Hash: 'fp-append',
135
+ Type: 'string-appender',
136
+ X: 1540,
137
+ Y: 160,
138
+ Width: 220,
139
+ Height: 100,
140
+ Title: 'Append Line',
141
+ Ports:
142
+ [
143
+ { Hash: 'fp-append-in', Direction: 'input', Side: 'left-bottom', Label: 'Append' },
144
+ { Hash: 'fp-append-inputstr', Direction: 'input', Side: 'left-top', Label: 'InputString' },
145
+ { Hash: 'fp-append-done', Direction: 'output', Side: 'right', Label: 'Completed' }
146
+ ],
147
+ Data: { InputString: '{~D:Record.TaskOutput.fp-replace.ReplacedString~}', OutputAddress: 'Operation.OutputFileContents', AppendNewline: true }
148
+ },
149
+ // ── Write the processed file ─────────────────────────────
150
+ {
151
+ Hash: 'fp-write',
152
+ Type: 'write-file',
153
+ X: 1230,
154
+ Y: 420,
155
+ Width: 220,
156
+ Height: 80,
157
+ Title: 'Save File',
158
+ Ports:
159
+ [
160
+ { Hash: 'fp-write-begin', Direction: 'input', Side: 'left-bottom', Label: 'BeginWrite' },
161
+ { Hash: 'fp-write-done', Direction: 'output', Side: 'right', Label: 'WriteComplete' },
162
+ { Hash: 'fp-write-err', Direction: 'output', Side: 'bottom', Label: 'Error' }
163
+ ],
164
+ Data: { FilePath: '{~D:Record.Operation.InputFilePath~}.ultracopy', Content: '{~D:Record.Operation.OutputFileContents~}', Encoding: 'utf8' }
165
+ },
166
+ // ── End ──────────────────────────────────────────────────
167
+ {
168
+ Hash: 'fp-end',
169
+ Type: 'end',
170
+ X: 1540,
171
+ Y: 420,
172
+ Width: 140,
173
+ Height: 80,
174
+ Title: 'End',
175
+ Ports:
176
+ [
177
+ { Hash: 'fp-end-in', Direction: 'input', Side: 'left-bottom', Label: 'In' }
178
+ ],
179
+ Data: {}
180
+ }
181
+ ],
182
+ Connections:
183
+ [
184
+ // ── Event connections (execution flow) ───────────────────
185
+
186
+ // Start -> Enter File Path (step 22)
187
+ {
188
+ Hash: 'fp-ev1',
189
+ SourceNodeHash: 'fp-start',
190
+ SourcePortHash: 'fp-start-out',
191
+ TargetNodeHash: 'fp-input',
192
+ TargetPortHash: 'fp-input-req',
193
+ Data: {}
194
+ },
195
+ // Enter File Path -> Load File (step 23)
196
+ {
197
+ Hash: 'fp-ev2',
198
+ SourceNodeHash: 'fp-input',
199
+ SourcePortHash: 'fp-input-done',
200
+ TargetNodeHash: 'fp-read',
201
+ TargetPortHash: 'fp-read-begin',
202
+ Data: {}
203
+ },
204
+ // Load File ReadComplete -> Split Lines PerformSplit (step 24)
205
+ {
206
+ Hash: 'fp-ev3',
207
+ SourceNodeHash: 'fp-read',
208
+ SourcePortHash: 'fp-read-done',
209
+ TargetNodeHash: 'fp-split',
210
+ TargetPortHash: 'fp-split-begin',
211
+ Data: {}
212
+ },
213
+ // Load File Error -> Read Error (step 10)
214
+ {
215
+ Hash: 'fp-ev4',
216
+ SourceNodeHash: 'fp-read',
217
+ SourcePortHash: 'fp-read-err',
218
+ TargetNodeHash: 'fp-error',
219
+ TargetPortHash: 'fp-error-in',
220
+ Data: {}
221
+ },
222
+ // Read Error -> End
223
+ {
224
+ Hash: 'fp-ev5',
225
+ SourceNodeHash: 'fp-error',
226
+ SourcePortHash: 'fp-error-done',
227
+ TargetNodeHash: 'fp-end',
228
+ TargetPortHash: 'fp-end-in',
229
+ Data: {}
230
+ },
231
+ // Split Lines TokenDataSent -> Replace (step 25)
232
+ {
233
+ Hash: 'fp-ev6',
234
+ SourceNodeHash: 'fp-split',
235
+ SourcePortHash: 'fp-split-token',
236
+ TargetNodeHash: 'fp-replace',
237
+ TargetPortHash: 'fp-replace-in',
238
+ Data: {}
239
+ },
240
+ // Replace ReplaceComplete -> Append (step 26)
241
+ {
242
+ Hash: 'fp-ev7',
243
+ SourceNodeHash: 'fp-replace',
244
+ SourcePortHash: 'fp-replace-done',
245
+ TargetNodeHash: 'fp-append',
246
+ TargetPortHash: 'fp-append-in',
247
+ Data: {}
248
+ },
249
+ // Append Completed -> Split StepComplete (loop back for next token)
250
+ {
251
+ Hash: 'fp-ev8',
252
+ SourceNodeHash: 'fp-append',
253
+ SourcePortHash: 'fp-append-done',
254
+ TargetNodeHash: 'fp-split',
255
+ TargetPortHash: 'fp-split-step',
256
+ Data: {}
257
+ },
258
+ // Split Lines CompletedAllSubtasks -> Save File
259
+ {
260
+ Hash: 'fp-ev9',
261
+ SourceNodeHash: 'fp-split',
262
+ SourcePortHash: 'fp-split-alldone',
263
+ TargetNodeHash: 'fp-write',
264
+ TargetPortHash: 'fp-write-begin',
265
+ Data: {}
266
+ },
267
+ // Save File WriteComplete -> End (step 21)
268
+ {
269
+ Hash: 'fp-ev10',
270
+ SourceNodeHash: 'fp-write',
271
+ SourcePortHash: 'fp-write-done',
272
+ TargetNodeHash: 'fp-end',
273
+ TargetPortHash: 'fp-end-in',
274
+ Data: {}
275
+ },
276
+
277
+ // ── State connections (data flow) ────────────────────────
278
+
279
+ // Enter File Path OutputAddress -> Load File FilePath (step 8)
280
+ {
281
+ Hash: 'fp-st1',
282
+ SourceNodeHash: 'fp-input',
283
+ SourcePortHash: 'fp-input-filepath',
284
+ TargetNodeHash: 'fp-read',
285
+ TargetPortHash: 'fp-read-filepath',
286
+ Data: {}
287
+ },
288
+ // Load File FileContent -> Split Lines InputString (step 13)
289
+ {
290
+ Hash: 'fp-st2',
291
+ SourceNodeHash: 'fp-read',
292
+ SourcePortHash: 'fp-read-content',
293
+ TargetNodeHash: 'fp-split',
294
+ TargetPortHash: 'fp-split-inputstr',
295
+ Data: {}
296
+ },
297
+ // Replace ReplacedString -> Append InputString (step 15)
298
+ {
299
+ Hash: 'fp-st3',
300
+ SourceNodeHash: 'fp-replace',
301
+ SourcePortHash: 'fp-replace-result',
302
+ TargetNodeHash: 'fp-append',
303
+ TargetPortHash: 'fp-append-inputstr',
304
+ Data: {}
305
+ }
306
+ ],
307
+ ViewState:
308
+ {
309
+ PanX: 0,
310
+ PanY: 0,
311
+ Zoom: 1,
312
+ SelectedNodeHash: null,
313
+ SelectedConnectionHash: null
314
+ }
315
+ };
@@ -0,0 +1,328 @@
1
+ /**
2
+ * Example Flow: Template Processor
3
+ *
4
+ * Demonstrates a multi-step text processing pipeline using the new engine task types:
5
+ * Start -> Set Values (initialize project metadata)
6
+ * -> Read File (template)
7
+ * -> Replace String (project name)
8
+ * -> Replace String (version)
9
+ * -> If Conditional (check for remaining placeholders)
10
+ * -> True: Error Message (warn about unresolved placeholders) -> End
11
+ * -> False: String Appender (add header comment) -> Write File (output) -> End
12
+ *
13
+ * Shows chained string operations, state management, and conditional validation.
14
+ */
15
+ module.exports =
16
+ {
17
+ Nodes:
18
+ [
19
+ // ── Entry ────────────────────────────────────────────────
20
+ {
21
+ Hash: 'tpl-start',
22
+ Type: 'start',
23
+ X: 50,
24
+ Y: 220,
25
+ Width: 140,
26
+ Height: 80,
27
+ Title: 'Start',
28
+ Ports:
29
+ [
30
+ { Hash: 'tpl-start-out', Direction: 'output', Side: 'right', Label: 'Out' }
31
+ ],
32
+ Data: {}
33
+ },
34
+ // ── Initialize project metadata ─────────────────────────
35
+ {
36
+ Hash: 'tpl-setvals',
37
+ Type: 'set-values',
38
+ X: 270,
39
+ Y: 200,
40
+ Width: 200,
41
+ Height: 80,
42
+ Title: 'Set Project Info',
43
+ Ports:
44
+ [
45
+ { Hash: 'tpl-sv-in', Direction: 'input', Side: 'left', Label: 'Execute' },
46
+ { Hash: 'tpl-sv-out', Direction: 'output', Side: 'right', Label: 'Complete' }
47
+ ],
48
+ Data:
49
+ {
50
+ Mappings:
51
+ [
52
+ { Address: 'Operation.ProjectName', Value: 'Retold' },
53
+ { Address: 'Operation.Version', Value: '3.0.0' },
54
+ { Address: 'Operation.Author', Value: 'Steven Velozo' }
55
+ ]
56
+ }
57
+ },
58
+ // ── Read the template file ──────────────────────────────
59
+ {
60
+ Hash: 'tpl-read',
61
+ Type: 'read-file',
62
+ X: 550,
63
+ Y: 200,
64
+ Width: 200,
65
+ Height: 80,
66
+ Title: 'Read Template',
67
+ Ports:
68
+ [
69
+ { Hash: 'tpl-read-in', Direction: 'input', Side: 'left', Label: 'BeginRead' },
70
+ { Hash: 'tpl-read-done', Direction: 'output', Side: 'right', Label: 'ReadComplete' },
71
+ { Hash: 'tpl-read-err', Direction: 'output', Side: 'bottom', Label: 'Error' }
72
+ ],
73
+ Data: { FilePath: 'readme.template.md', Encoding: 'utf8' }
74
+ },
75
+ // ── Replace project name placeholder ────────────────────
76
+ {
77
+ Hash: 'tpl-replace-name',
78
+ Type: 'replace-string',
79
+ X: 830,
80
+ Y: 180,
81
+ Width: 220,
82
+ Height: 80,
83
+ Title: 'Set Project Name',
84
+ Ports:
85
+ [
86
+ { Hash: 'tpl-rn-in', Direction: 'input', Side: 'left', Label: 'Replace' },
87
+ { Hash: 'tpl-rn-done', Direction: 'output', Side: 'right', Label: 'ReplaceComplete' },
88
+ { Hash: 'tpl-rn-err', Direction: 'output', Side: 'bottom', Label: 'Error' }
89
+ ],
90
+ Data: { InputString: '{~D:Record.TaskOutput.tpl-read.FileContent~}', SearchString: '${PROJECT_NAME}', ReplaceString: '{~D:Record.Operation.ProjectName~}' }
91
+ },
92
+ // ── Replace version placeholder ─────────────────────────
93
+ {
94
+ Hash: 'tpl-replace-ver',
95
+ Type: 'replace-string',
96
+ X: 1130,
97
+ Y: 180,
98
+ Width: 220,
99
+ Height: 80,
100
+ Title: 'Set Version',
101
+ Ports:
102
+ [
103
+ { Hash: 'tpl-rv-in', Direction: 'input', Side: 'left', Label: 'Replace' },
104
+ { Hash: 'tpl-rv-done', Direction: 'output', Side: 'right', Label: 'ReplaceComplete' },
105
+ { Hash: 'tpl-rv-err', Direction: 'output', Side: 'bottom', Label: 'Error' }
106
+ ],
107
+ Data: { InputString: '{~D:Record.TaskOutput.tpl-replace-name.ReplacedString~}', SearchString: '${VERSION}', ReplaceString: '{~D:Record.Operation.Version~}' }
108
+ },
109
+ // ── Check for remaining unresolved placeholders ─────────
110
+ {
111
+ Hash: 'tpl-validate',
112
+ Type: 'if-conditional',
113
+ X: 1430,
114
+ Y: 160,
115
+ Width: 240,
116
+ Height: 100,
117
+ Title: 'Unresolved Placeholders?',
118
+ Ports:
119
+ [
120
+ { Hash: 'tpl-val-in', Direction: 'input', Side: 'left', Label: 'Evaluate' },
121
+ { Hash: 'tpl-val-true', Direction: 'output', Side: 'bottom', Label: 'True' },
122
+ { Hash: 'tpl-val-false', Direction: 'output', Side: 'right', Label: 'False' }
123
+ ],
124
+ Data: { DataAddress: 'TaskOutput.tpl-replace-ver.ReplacedString', CompareValue: '${', Operator: 'contains' }
125
+ },
126
+ // ── Error: unresolved placeholders remain ────────────────
127
+ {
128
+ Hash: 'tpl-warn',
129
+ Type: 'error-message',
130
+ X: 1430,
131
+ Y: 380,
132
+ Width: 240,
133
+ Height: 80,
134
+ Title: 'Warn: Unresolved',
135
+ Ports:
136
+ [
137
+ { Hash: 'tpl-warn-in', Direction: 'input', Side: 'left', Label: 'Trigger' },
138
+ { Hash: 'tpl-warn-done', Direction: 'output', Side: 'right', Label: 'Complete' }
139
+ ],
140
+ Data: { MessageTemplate: 'Warning: Template still contains unresolved ${...} placeholders after processing' }
141
+ },
142
+ // ── Prepend a generated-by header comment ───────────────
143
+ {
144
+ Hash: 'tpl-header',
145
+ Type: 'string-appender',
146
+ X: 1750,
147
+ Y: 160,
148
+ Width: 220,
149
+ Height: 80,
150
+ Title: 'Add Header',
151
+ Ports:
152
+ [
153
+ { Hash: 'tpl-hdr-in', Direction: 'input', Side: 'left', Label: 'Append' },
154
+ { Hash: 'tpl-hdr-done', Direction: 'output', Side: 'right', Label: 'Completed' }
155
+ ],
156
+ Data: { InputString: '{~D:Record.TaskOutput.tpl-replace-ver.ReplacedString~}', OutputAddress: 'Operation.FinalContent' }
157
+ },
158
+ // ── Write the processed output ──────────────────────────
159
+ {
160
+ Hash: 'tpl-write',
161
+ Type: 'write-file',
162
+ X: 2050,
163
+ Y: 160,
164
+ Width: 200,
165
+ Height: 80,
166
+ Title: 'Write Output',
167
+ Ports:
168
+ [
169
+ { Hash: 'tpl-write-in', Direction: 'input', Side: 'left', Label: 'BeginWrite' },
170
+ { Hash: 'tpl-write-done', Direction: 'output', Side: 'right', Label: 'WriteComplete' },
171
+ { Hash: 'tpl-write-err', Direction: 'output', Side: 'bottom', Label: 'Error' }
172
+ ],
173
+ Data: { FilePath: 'README.md', Content: '{~D:Record.Operation.FinalContent~}', Encoding: 'utf8' }
174
+ },
175
+ // ── Exit ─────────────────────────────────────────────────
176
+ {
177
+ Hash: 'tpl-end',
178
+ Type: 'end',
179
+ X: 2330,
180
+ Y: 260,
181
+ Width: 140,
182
+ Height: 80,
183
+ Title: 'End',
184
+ Ports:
185
+ [
186
+ { Hash: 'tpl-end-in', Direction: 'input', Side: 'left', Label: 'In' }
187
+ ],
188
+ Data: {}
189
+ }
190
+ ],
191
+ Connections:
192
+ [
193
+ // Start -> Set Project Info
194
+ {
195
+ Hash: 'tpl-c1',
196
+ SourceNodeHash: 'tpl-start',
197
+ SourcePortHash: 'tpl-start-out',
198
+ TargetNodeHash: 'tpl-setvals',
199
+ TargetPortHash: 'tpl-sv-in',
200
+ Data: {}
201
+ },
202
+ // Set Project Info -> Read Template
203
+ {
204
+ Hash: 'tpl-c2',
205
+ SourceNodeHash: 'tpl-setvals',
206
+ SourcePortHash: 'tpl-sv-out',
207
+ TargetNodeHash: 'tpl-read',
208
+ TargetPortHash: 'tpl-read-in',
209
+ Data: {}
210
+ },
211
+ // Read Template -> Set Project Name
212
+ {
213
+ Hash: 'tpl-c3',
214
+ SourceNodeHash: 'tpl-read',
215
+ SourcePortHash: 'tpl-read-done',
216
+ TargetNodeHash: 'tpl-replace-name',
217
+ TargetPortHash: 'tpl-rn-in',
218
+ Data: {}
219
+ },
220
+ // Set Project Name -> Set Version
221
+ {
222
+ Hash: 'tpl-c4',
223
+ SourceNodeHash: 'tpl-replace-name',
224
+ SourcePortHash: 'tpl-rn-done',
225
+ TargetNodeHash: 'tpl-replace-ver',
226
+ TargetPortHash: 'tpl-rv-in',
227
+ Data: {}
228
+ },
229
+ // Set Version -> Unresolved Placeholders?
230
+ {
231
+ Hash: 'tpl-c5',
232
+ SourceNodeHash: 'tpl-replace-ver',
233
+ SourcePortHash: 'tpl-rv-done',
234
+ TargetNodeHash: 'tpl-validate',
235
+ TargetPortHash: 'tpl-val-in',
236
+ Data: {}
237
+ },
238
+ // Unresolved Placeholders? (True) -> Warn
239
+ {
240
+ Hash: 'tpl-c6',
241
+ SourceNodeHash: 'tpl-validate',
242
+ SourcePortHash: 'tpl-val-true',
243
+ TargetNodeHash: 'tpl-warn',
244
+ TargetPortHash: 'tpl-warn-in',
245
+ Data: {}
246
+ },
247
+ // Warn -> End
248
+ {
249
+ Hash: 'tpl-c7',
250
+ SourceNodeHash: 'tpl-warn',
251
+ SourcePortHash: 'tpl-warn-done',
252
+ TargetNodeHash: 'tpl-end',
253
+ TargetPortHash: 'tpl-end-in',
254
+ Data: {}
255
+ },
256
+ // Unresolved Placeholders? (False) -> Add Header
257
+ {
258
+ Hash: 'tpl-c8',
259
+ SourceNodeHash: 'tpl-validate',
260
+ SourcePortHash: 'tpl-val-false',
261
+ TargetNodeHash: 'tpl-header',
262
+ TargetPortHash: 'tpl-hdr-in',
263
+ Data: {}
264
+ },
265
+ // Add Header -> Write Output
266
+ {
267
+ Hash: 'tpl-c9',
268
+ SourceNodeHash: 'tpl-header',
269
+ SourcePortHash: 'tpl-hdr-done',
270
+ TargetNodeHash: 'tpl-write',
271
+ TargetPortHash: 'tpl-write-in',
272
+ Data: {}
273
+ },
274
+ // Write Output -> End
275
+ {
276
+ Hash: 'tpl-c10',
277
+ SourceNodeHash: 'tpl-write',
278
+ SourcePortHash: 'tpl-write-done',
279
+ TargetNodeHash: 'tpl-end',
280
+ TargetPortHash: 'tpl-end-in',
281
+ Data: {}
282
+ },
283
+ // Read Template error -> End
284
+ {
285
+ Hash: 'tpl-c11',
286
+ SourceNodeHash: 'tpl-read',
287
+ SourcePortHash: 'tpl-read-err',
288
+ TargetNodeHash: 'tpl-end',
289
+ TargetPortHash: 'tpl-end-in',
290
+ Data: {}
291
+ },
292
+ // Set Project Name error -> End
293
+ {
294
+ Hash: 'tpl-c12',
295
+ SourceNodeHash: 'tpl-replace-name',
296
+ SourcePortHash: 'tpl-rn-err',
297
+ TargetNodeHash: 'tpl-end',
298
+ TargetPortHash: 'tpl-end-in',
299
+ Data: {}
300
+ },
301
+ // Set Version error -> End
302
+ {
303
+ Hash: 'tpl-c13',
304
+ SourceNodeHash: 'tpl-replace-ver',
305
+ SourcePortHash: 'tpl-rv-err',
306
+ TargetNodeHash: 'tpl-end',
307
+ TargetPortHash: 'tpl-end-in',
308
+ Data: {}
309
+ },
310
+ // Write Output error -> End
311
+ {
312
+ Hash: 'tpl-c14',
313
+ SourceNodeHash: 'tpl-write',
314
+ SourcePortHash: 'tpl-write-err',
315
+ TargetNodeHash: 'tpl-end',
316
+ TargetPortHash: 'tpl-end-in',
317
+ Data: {}
318
+ }
319
+ ],
320
+ ViewState:
321
+ {
322
+ PanX: 0,
323
+ PanY: 0,
324
+ Zoom: 1,
325
+ SelectedNodeHash: null,
326
+ SelectedConnectionHash: null
327
+ }
328
+ };