ultravisor 1.0.2 → 1.0.4

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 (121) hide show
  1. package/.claude/launch.json +11 -0
  2. package/.claude/ultravisor-dev-config.json +3 -0
  3. package/.ultravisor.json +426 -0
  4. package/docs/README.md +63 -0
  5. package/package.json +12 -8
  6. package/source/Ultravisor.cjs +22 -3
  7. package/source/cli/Ultravisor-CLIProgram.cjs +35 -23
  8. package/source/cli/commands/Ultravisor-Command-SingleOperation.cjs +29 -18
  9. package/source/cli/commands/Ultravisor-Command-SingleTask.cjs +62 -19
  10. package/source/cli/commands/Ultravisor-Command-UpdateTask.cjs +27 -15
  11. package/source/config/Ultravisor-Default-Command-Configuration.cjs +5 -3
  12. package/source/services/Ultravisor-ExecutionEngine.cjs +1039 -0
  13. package/source/services/Ultravisor-ExecutionManifest.cjs +399 -0
  14. package/source/services/Ultravisor-Hypervisor-State.cjs +270 -97
  15. package/source/services/Ultravisor-Hypervisor.cjs +38 -83
  16. package/source/services/Ultravisor-StateManager.cjs +241 -0
  17. package/source/services/Ultravisor-TaskTypeRegistry.cjs +143 -0
  18. package/source/services/tasks/Ultravisor-TaskType-Base.cjs +105 -0
  19. package/source/services/tasks/control/Ultravisor-TaskType-IfConditional.cjs +148 -0
  20. package/source/services/tasks/control/Ultravisor-TaskType-LaunchOperation.cjs +187 -0
  21. package/source/services/tasks/control/Ultravisor-TaskType-SplitExecute.cjs +184 -0
  22. package/source/services/tasks/data/Ultravisor-TaskType-ReplaceString.cjs +82 -0
  23. package/source/services/tasks/data/Ultravisor-TaskType-SetValues.cjs +81 -0
  24. package/source/services/tasks/data/Ultravisor-TaskType-StringAppender.cjs +101 -0
  25. package/source/services/tasks/file-io/Ultravisor-TaskType-ReadFile.cjs +103 -0
  26. package/source/services/tasks/file-io/Ultravisor-TaskType-WriteFile.cjs +117 -0
  27. package/source/services/tasks/interaction/Ultravisor-TaskType-ErrorMessage.cjs +54 -0
  28. package/source/services/tasks/interaction/Ultravisor-TaskType-ValueInput.cjs +62 -0
  29. package/source/web_server/Ultravisor-API-Server.cjs +237 -124
  30. package/test/Ultravisor_browser_tests.js +2226 -0
  31. package/test/Ultravisor_tests.js +1143 -5830
  32. package/webinterface/css/ultravisor.css +23 -0
  33. package/webinterface/package.json +6 -3
  34. package/webinterface/source/Pict-Application-Ultravisor.js +93 -73
  35. package/webinterface/source/cards/FlowCard-CSVTransform.js +43 -0
  36. package/webinterface/source/cards/FlowCard-Command.js +86 -0
  37. package/webinterface/source/cards/FlowCard-ComprehensionIntersect.js +40 -0
  38. package/webinterface/source/cards/FlowCard-Conditional.js +87 -0
  39. package/webinterface/source/cards/FlowCard-CopyFile.js +55 -0
  40. package/webinterface/source/cards/FlowCard-End.js +29 -0
  41. package/webinterface/source/cards/FlowCard-GetJSON.js +55 -0
  42. package/webinterface/source/cards/FlowCard-GetText.js +54 -0
  43. package/webinterface/source/cards/FlowCard-Histogram.js +176 -0
  44. package/webinterface/source/cards/FlowCard-LaunchOperation.js +82 -0
  45. package/webinterface/source/cards/FlowCard-ListFiles.js +55 -0
  46. package/webinterface/source/cards/FlowCard-MeadowCount.js +44 -0
  47. package/webinterface/source/cards/FlowCard-MeadowCreate.js +44 -0
  48. package/webinterface/source/cards/FlowCard-MeadowDelete.js +45 -0
  49. package/webinterface/source/cards/FlowCard-MeadowRead.js +46 -0
  50. package/webinterface/source/cards/FlowCard-MeadowReads.js +46 -0
  51. package/webinterface/source/cards/FlowCard-MeadowUpdate.js +44 -0
  52. package/webinterface/source/cards/FlowCard-ParseCSV.js +85 -0
  53. package/webinterface/source/cards/FlowCard-ReadJSON.js +54 -0
  54. package/webinterface/source/cards/FlowCard-ReadText.js +54 -0
  55. package/webinterface/source/cards/FlowCard-RestRequest.js +59 -0
  56. package/webinterface/source/cards/FlowCard-SendJSON.js +57 -0
  57. package/webinterface/source/cards/FlowCard-Solver.js +77 -0
  58. package/webinterface/source/cards/FlowCard-Start.js +29 -0
  59. package/webinterface/source/cards/FlowCard-TemplateString.js +77 -0
  60. package/webinterface/source/cards/FlowCard-WriteJSON.js +54 -0
  61. package/webinterface/source/cards/FlowCard-WriteText.js +54 -0
  62. package/webinterface/source/data/ExampleFlow-CSVPipeline.js +231 -0
  63. package/webinterface/source/data/ExampleFlow-FileProcessor.js +315 -0
  64. package/webinterface/source/data/ExampleFlow-MeadowPipeline.js +328 -0
  65. package/webinterface/source/providers/PictRouter-Ultravisor-Configuration.json +8 -8
  66. package/webinterface/source/views/PictView-Ultravisor-Dashboard.js +6 -6
  67. package/webinterface/source/views/PictView-Ultravisor-FlowEditor.js +436 -0
  68. package/webinterface/source/views/PictView-Ultravisor-ManifestList.js +45 -43
  69. package/webinterface/source/views/PictView-Ultravisor-OperationEdit.js +34 -89
  70. package/webinterface/source/views/PictView-Ultravisor-OperationList.js +128 -13
  71. package/webinterface/source/views/PictView-Ultravisor-PendingInput.js +314 -0
  72. package/webinterface/source/views/PictView-Ultravisor-Schedule.js +18 -53
  73. package/webinterface/source/views/PictView-Ultravisor-TimingView.js +27 -14
  74. package/webinterface/source/views/PictView-Ultravisor-TopBar.js +2 -1
  75. package/.babelrc +0 -6
  76. package/.browserslistrc +0 -1
  77. package/.browserslistrc-BACKUP +0 -1
  78. package/.gulpfile-quackage-config.json +0 -7
  79. package/.gulpfile-quackage.js +0 -2
  80. package/debug/Harness.js +0 -5
  81. package/source/services/Ultravisor-Operation-Manifest.cjs +0 -160
  82. package/source/services/Ultravisor-Operation.cjs +0 -200
  83. package/source/services/Ultravisor-Task.cjs +0 -349
  84. package/source/services/events/Ultravisor-Hypervisor-Event-Solver.cjs +0 -11
  85. package/source/services/tasks/Ultravisor-Task-Base.cjs +0 -264
  86. package/source/services/tasks/Ultravisor-Task-CollectValues.cjs +0 -188
  87. package/source/services/tasks/Ultravisor-Task-Command.cjs +0 -65
  88. package/source/services/tasks/Ultravisor-Task-CommandEach.cjs +0 -190
  89. package/source/services/tasks/Ultravisor-Task-Conditional.cjs +0 -104
  90. package/source/services/tasks/Ultravisor-Task-DateWindow.cjs +0 -72
  91. package/source/services/tasks/Ultravisor-Task-GeneratePagedOperation.cjs +0 -336
  92. package/source/services/tasks/Ultravisor-Task-LaunchOperation.cjs +0 -143
  93. package/source/services/tasks/Ultravisor-Task-LaunchTask.cjs +0 -146
  94. package/source/services/tasks/Ultravisor-Task-LineMatch.cjs +0 -158
  95. package/source/services/tasks/Ultravisor-Task-Request.cjs +0 -56
  96. package/source/services/tasks/Ultravisor-Task-Solver.cjs +0 -89
  97. package/source/services/tasks/Ultravisor-Task-TemplateString.cjs +0 -93
  98. package/source/services/tasks/rest/Ultravisor-Task-GetBinary.cjs +0 -127
  99. package/source/services/tasks/rest/Ultravisor-Task-GetJSON.cjs +0 -119
  100. package/source/services/tasks/rest/Ultravisor-Task-GetText.cjs +0 -109
  101. package/source/services/tasks/rest/Ultravisor-Task-GetXML.cjs +0 -112
  102. package/source/services/tasks/rest/Ultravisor-Task-RestRequest.cjs +0 -499
  103. package/source/services/tasks/rest/Ultravisor-Task-SendJSON.cjs +0 -150
  104. package/source/services/tasks/stagingfiles/Ultravisor-Task-CopyFile.cjs +0 -110
  105. package/source/services/tasks/stagingfiles/Ultravisor-Task-ListFiles.cjs +0 -89
  106. package/source/services/tasks/stagingfiles/Ultravisor-Task-ReadBinary.cjs +0 -87
  107. package/source/services/tasks/stagingfiles/Ultravisor-Task-ReadJSON.cjs +0 -67
  108. package/source/services/tasks/stagingfiles/Ultravisor-Task-ReadText.cjs +0 -66
  109. package/source/services/tasks/stagingfiles/Ultravisor-Task-ReadXML.cjs +0 -69
  110. package/source/services/tasks/stagingfiles/Ultravisor-Task-WriteBinary.cjs +0 -95
  111. package/source/services/tasks/stagingfiles/Ultravisor-Task-WriteJSON.cjs +0 -96
  112. package/source/services/tasks/stagingfiles/Ultravisor-Task-WriteText.cjs +0 -99
  113. package/source/services/tasks/stagingfiles/Ultravisor-Task-WriteXML.cjs +0 -102
  114. package/webinterface/.babelrc +0 -6
  115. package/webinterface/.browserslistrc +0 -1
  116. package/webinterface/.browserslistrc-BACKUP +0 -1
  117. package/webinterface/.gulpfile-quackage-config.json +0 -7
  118. package/webinterface/.gulpfile-quackage.js +0 -2
  119. package/webinterface/source/views/PictView-Ultravisor-TaskEdit.js +0 -220
  120. package/webinterface/source/views/PictView-Ultravisor-TaskList.js +0 -248
  121. /package/docs/{cover.md → _cover.md} +0 -0
@@ -0,0 +1,103 @@
1
+ const libUltravisorTaskType = require('../Ultravisor-TaskType-Base.cjs');
2
+ const libFS = require('fs');
3
+
4
+ /**
5
+ * Read File task type.
6
+ *
7
+ * Reads a file from disk into state. The file path can be absolute or
8
+ * relative to the operation's staging folder.
9
+ */
10
+ class UltravisorTaskTypeReadFile extends libUltravisorTaskType
11
+ {
12
+ constructor(pFable, pOptions, pServiceHash)
13
+ {
14
+ super(pFable, pOptions, pServiceHash);
15
+ }
16
+
17
+ get definition()
18
+ {
19
+ return {
20
+ Hash: 'read-file',
21
+ Name: 'Read File',
22
+ Description: 'Reads a file from disk into state.',
23
+ Category: 'file-io',
24
+
25
+ EventInputs:
26
+ [
27
+ { Name: 'BeginRead', Description: 'Triggers the file read' }
28
+ ],
29
+ EventOutputs:
30
+ [
31
+ { Name: 'ReadComplete', Description: 'Fires when file is read successfully' },
32
+ { Name: 'Error', Description: 'Fires on read failure', IsError: true }
33
+ ],
34
+ SettingsInputs:
35
+ [
36
+ { Name: 'FilePath', DataType: 'String', Required: true, Description: 'Path to the file to read' },
37
+ { Name: 'Encoding', DataType: 'String', Required: false, Default: 'utf8', Description: 'File encoding' }
38
+ ],
39
+ StateOutputs:
40
+ [
41
+ { Name: 'FileContent', DataType: 'String', Description: 'Contents of the file' },
42
+ { Name: 'BytesRead', DataType: 'Number', Description: 'Number of bytes read' }
43
+ ],
44
+
45
+ DefaultSettings:
46
+ {
47
+ FilePath: '',
48
+ Encoding: 'utf8'
49
+ }
50
+ };
51
+ }
52
+
53
+ execute(pResolvedSettings, pExecutionContext, fCallback, fFireIntermediateEvent)
54
+ {
55
+ let tmpFilePath = pResolvedSettings.FilePath || '';
56
+ let tmpEncoding = pResolvedSettings.Encoding || 'utf8';
57
+
58
+ if (!tmpFilePath)
59
+ {
60
+ return fCallback(null, {
61
+ EventToFire: 'Error',
62
+ Outputs: {},
63
+ Log: ['ReadFile: no FilePath specified.']
64
+ });
65
+ }
66
+
67
+ // Resolve relative paths against the staging folder
68
+ tmpFilePath = this.resolveFilePath(tmpFilePath, pExecutionContext.StagingPath);
69
+
70
+ try
71
+ {
72
+ let tmpContent = libFS.readFileSync(tmpFilePath, tmpEncoding);
73
+
74
+ // Write output to the configured address if specified
75
+ let tmpStateWrites = {};
76
+ if (pResolvedSettings.OutputAddress)
77
+ {
78
+ tmpStateWrites[pResolvedSettings.OutputAddress] = tmpContent;
79
+ }
80
+
81
+ return fCallback(null, {
82
+ EventToFire: 'ReadComplete',
83
+ Outputs:
84
+ {
85
+ FileContent: tmpContent,
86
+ BytesRead: Buffer.byteLength(tmpContent, tmpEncoding)
87
+ },
88
+ StateWrites: tmpStateWrites,
89
+ Log: [`ReadFile: read ${Buffer.byteLength(tmpContent, tmpEncoding)} bytes from ${tmpFilePath}`]
90
+ });
91
+ }
92
+ catch (pError)
93
+ {
94
+ return fCallback(null, {
95
+ EventToFire: 'Error',
96
+ Outputs: {},
97
+ Log: [`ReadFile: failed to read ${tmpFilePath}: ${pError.message}`]
98
+ });
99
+ }
100
+ }
101
+ }
102
+
103
+ module.exports = UltravisorTaskTypeReadFile;
@@ -0,0 +1,117 @@
1
+ const libUltravisorTaskType = require('../Ultravisor-TaskType-Base.cjs');
2
+ const libFS = require('fs');
3
+ const libPath = require('path');
4
+
5
+ /**
6
+ * Write File task type.
7
+ *
8
+ * Writes content from state to a file on disk. The file path can be
9
+ * absolute or relative to the operation's staging folder.
10
+ */
11
+ class UltravisorTaskTypeWriteFile extends libUltravisorTaskType
12
+ {
13
+ constructor(pFable, pOptions, pServiceHash)
14
+ {
15
+ super(pFable, pOptions, pServiceHash);
16
+ }
17
+
18
+ get definition()
19
+ {
20
+ return {
21
+ Hash: 'write-file',
22
+ Name: 'Write File',
23
+ Description: 'Writes content to a file on disk.',
24
+ Category: 'file-io',
25
+
26
+ EventInputs:
27
+ [
28
+ { Name: 'BeginWrite', Description: 'Triggers the file write' }
29
+ ],
30
+ EventOutputs:
31
+ [
32
+ { Name: 'WriteComplete', Description: 'Fires when file is written successfully' },
33
+ { Name: 'Error', Description: 'Fires on write failure', IsError: true }
34
+ ],
35
+ SettingsInputs:
36
+ [
37
+ { Name: 'FilePath', DataType: 'String', Required: true, Description: 'Path to the output file' },
38
+ { Name: 'Content', DataType: 'String', Required: true, Description: 'Content to write' },
39
+ { Name: 'Encoding', DataType: 'String', Required: false, Default: 'utf8', Description: 'File encoding' }
40
+ ],
41
+ StateOutputs:
42
+ [
43
+ { Name: 'BytesWritten', DataType: 'Number', Description: 'Number of bytes written' }
44
+ ],
45
+
46
+ DefaultSettings:
47
+ {
48
+ FilePath: '',
49
+ Content: '',
50
+ Encoding: 'utf8'
51
+ }
52
+ };
53
+ }
54
+
55
+ execute(pResolvedSettings, pExecutionContext, fCallback, fFireIntermediateEvent)
56
+ {
57
+ let tmpFilePath = pResolvedSettings.FilePath || '';
58
+ let tmpContent = pResolvedSettings.Content;
59
+ let tmpEncoding = pResolvedSettings.Encoding || 'utf8';
60
+
61
+ if (!tmpFilePath)
62
+ {
63
+ return fCallback(null, {
64
+ EventToFire: 'Error',
65
+ Outputs: {},
66
+ Log: ['WriteFile: no FilePath specified.']
67
+ });
68
+ }
69
+
70
+ if (tmpContent === undefined || tmpContent === null)
71
+ {
72
+ tmpContent = '';
73
+ }
74
+
75
+ // Ensure content is a string
76
+ if (typeof(tmpContent) !== 'string')
77
+ {
78
+ tmpContent = JSON.stringify(tmpContent, null, '\t');
79
+ }
80
+
81
+ // Resolve relative paths against the staging folder
82
+ tmpFilePath = this.resolveFilePath(tmpFilePath, pExecutionContext.StagingPath);
83
+
84
+ try
85
+ {
86
+ // Ensure the directory exists
87
+ let tmpDir = libPath.dirname(tmpFilePath);
88
+ if (!libFS.existsSync(tmpDir))
89
+ {
90
+ libFS.mkdirSync(tmpDir, { recursive: true });
91
+ }
92
+
93
+ libFS.writeFileSync(tmpFilePath, tmpContent, tmpEncoding);
94
+
95
+ let tmpBytesWritten = Buffer.byteLength(tmpContent, tmpEncoding);
96
+
97
+ return fCallback(null, {
98
+ EventToFire: 'WriteComplete',
99
+ Outputs:
100
+ {
101
+ BytesWritten: tmpBytesWritten
102
+ },
103
+ Log: [`WriteFile: wrote ${tmpBytesWritten} bytes to ${tmpFilePath}`]
104
+ });
105
+ }
106
+ catch (pError)
107
+ {
108
+ return fCallback(null, {
109
+ EventToFire: 'Error',
110
+ Outputs: {},
111
+ Log: [`WriteFile: failed to write ${tmpFilePath}: ${pError.message}`]
112
+ });
113
+ }
114
+ }
115
+ }
116
+
117
+ module.exports = UltravisorTaskTypeWriteFile;
@@ -0,0 +1,54 @@
1
+ const libTaskTypeBase = require('../Ultravisor-TaskType-Base.cjs');
2
+
3
+ /**
4
+ * ErrorMessage Task Type
5
+ *
6
+ * Logs an error/warning message to the execution context.
7
+ * Useful for dead-end branches or error handling paths.
8
+ * The MessageTemplate can contain {~D:Address~} patterns
9
+ * that are resolved against the execution context.
10
+ */
11
+ class UltravisorTaskTypeErrorMessage extends libTaskTypeBase
12
+ {
13
+ constructor(pFable, pOptions, pServiceHash)
14
+ {
15
+ super(pFable, pOptions, pServiceHash);
16
+
17
+ this.serviceType = 'UltravisorTaskTypeErrorMessage';
18
+ }
19
+
20
+ get definition()
21
+ {
22
+ return {
23
+ Hash: 'error-message',
24
+ Type: 'error-message',
25
+ Name: 'Error Message',
26
+ Description: 'Logs an error or warning message to the execution log.',
27
+ Category: 'interaction',
28
+
29
+ EventInputs: [{ Name: 'Trigger' }],
30
+ EventOutputs: [{ Name: 'Complete' }],
31
+ SettingsInputs: [
32
+ { Name: 'MessageTemplate', DataType: 'String', Required: true }
33
+ ],
34
+ StateOutputs: [],
35
+
36
+ DefaultSettings: { MessageTemplate: 'An error occurred.' }
37
+ };
38
+ }
39
+
40
+ execute(pResolvedSettings, pExecutionContext, fCallback, fFireIntermediateEvent)
41
+ {
42
+ let tmpMessage = pResolvedSettings.MessageTemplate || 'An error occurred.';
43
+
44
+ this.log.error(`ErrorMessage task [${pExecutionContext.NodeHash}]: ${tmpMessage}`);
45
+
46
+ return fCallback(null, {
47
+ EventToFire: 'Complete',
48
+ Outputs: {},
49
+ Log: [`ERROR: ${tmpMessage}`]
50
+ });
51
+ }
52
+ }
53
+
54
+ module.exports = UltravisorTaskTypeErrorMessage;
@@ -0,0 +1,62 @@
1
+ const libTaskTypeBase = require('../Ultravisor-TaskType-Base.cjs');
2
+
3
+ /**
4
+ * ValueInput Task Type
5
+ *
6
+ * Pauses operation execution and waits for user input.
7
+ * When triggered, sets the run to WaitingForInput status.
8
+ * The ExecutionEngine resumes when input is provided via
9
+ * POST /Run/:RunHash/Input/:NodeHash.
10
+ *
11
+ * The provided value is written to the specified OutputAddress.
12
+ */
13
+ class UltravisorTaskTypeValueInput extends libTaskTypeBase
14
+ {
15
+ constructor(pFable, pOptions, pServiceHash)
16
+ {
17
+ super(pFable, pOptions, pServiceHash);
18
+
19
+ this.serviceType = 'UltravisorTaskTypeValueInput';
20
+ }
21
+
22
+ get definition()
23
+ {
24
+ return {
25
+ Hash: 'value-input',
26
+ Type: 'value-input',
27
+ Name: 'Value Input',
28
+ Description: 'Pauses execution and waits for user-provided input.',
29
+ Category: 'interaction',
30
+
31
+ EventInputs: [{ Name: 'RequestInput' }],
32
+ EventOutputs: [{ Name: 'ValueInputComplete' }],
33
+ SettingsInputs: [
34
+ { Name: 'PromptMessage', DataType: 'String', Required: false },
35
+ { Name: 'OutputAddress', DataType: 'String', Required: true }
36
+ ],
37
+ StateOutputs: [
38
+ { Name: 'InputValue', DataType: 'String' }
39
+ ],
40
+
41
+ DefaultSettings: { PromptMessage: 'Please provide a value:', OutputAddress: '' }
42
+ };
43
+ }
44
+
45
+ execute(pResolvedSettings, pExecutionContext, fCallback, fFireIntermediateEvent)
46
+ {
47
+ let tmpPromptMessage = pResolvedSettings.PromptMessage || 'Please provide a value:';
48
+ let tmpOutputAddress = pResolvedSettings.OutputAddress || '';
49
+
50
+ // Signal that this task is waiting for input
51
+ // The ExecutionEngine will set the run to WaitingForInput status
52
+ return fCallback(null, {
53
+ WaitingForInput: true,
54
+ PromptMessage: tmpPromptMessage,
55
+ OutputAddress: tmpOutputAddress,
56
+ Outputs: {},
57
+ Log: [`Waiting for input: "${tmpPromptMessage}" (-> ${tmpOutputAddress})`]
58
+ });
59
+ }
60
+ }
61
+
62
+ module.exports = UltravisorTaskTypeValueInput;