@fnndsc/brasa 0.1.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 (226) hide show
  1. package/dist/builtins/debug.d.ts +8 -0
  2. package/dist/builtins/debug.js +39 -0
  3. package/dist/builtins/debug.js.map +1 -0
  4. package/dist/builtins/executable.d.ts +22 -0
  5. package/dist/builtins/executable.js +115 -0
  6. package/dist/builtins/executable.js.map +1 -0
  7. package/dist/builtins/fs/cat.d.ts +16 -0
  8. package/dist/builtins/fs/cat.js +266 -0
  9. package/dist/builtins/fs/cat.js.map +1 -0
  10. package/dist/builtins/fs/cd.d.ts +42 -0
  11. package/dist/builtins/fs/cd.js +193 -0
  12. package/dist/builtins/fs/cd.js.map +1 -0
  13. package/dist/builtins/fs/cp.d.ts +10 -0
  14. package/dist/builtins/fs/cp.js +86 -0
  15. package/dist/builtins/fs/cp.js.map +1 -0
  16. package/dist/builtins/fs/download.d.ts +6 -0
  17. package/dist/builtins/fs/download.js +45 -0
  18. package/dist/builtins/fs/download.js.map +1 -0
  19. package/dist/builtins/fs/du.d.ts +58 -0
  20. package/dist/builtins/fs/du.js +210 -0
  21. package/dist/builtins/fs/du.js.map +1 -0
  22. package/dist/builtins/fs/edit.d.ts +7 -0
  23. package/dist/builtins/fs/edit.js +104 -0
  24. package/dist/builtins/fs/edit.js.map +1 -0
  25. package/dist/builtins/fs/ls.d.ts +8 -0
  26. package/dist/builtins/fs/ls.js +68 -0
  27. package/dist/builtins/fs/ls.js.map +1 -0
  28. package/dist/builtins/fs/mkdir.d.ts +9 -0
  29. package/dist/builtins/fs/mkdir.js +52 -0
  30. package/dist/builtins/fs/mkdir.js.map +1 -0
  31. package/dist/builtins/fs/mv.d.ts +10 -0
  32. package/dist/builtins/fs/mv.js +88 -0
  33. package/dist/builtins/fs/mv.js.map +1 -0
  34. package/dist/builtins/fs/pull.args.d.ts +22 -0
  35. package/dist/builtins/fs/pull.args.js +30 -0
  36. package/dist/builtins/fs/pull.args.js.map +1 -0
  37. package/dist/builtins/fs/pull.d.ts +26 -0
  38. package/dist/builtins/fs/pull.js +445 -0
  39. package/dist/builtins/fs/pull.js.map +1 -0
  40. package/dist/builtins/fs/pwd.d.ts +10 -0
  41. package/dist/builtins/fs/pwd.js +73 -0
  42. package/dist/builtins/fs/pwd.js.map +1 -0
  43. package/dist/builtins/fs/rm.d.ts +37 -0
  44. package/dist/builtins/fs/rm.js +197 -0
  45. package/dist/builtins/fs/rm.js.map +1 -0
  46. package/dist/builtins/fs/touch.d.ts +9 -0
  47. package/dist/builtins/fs/touch.js +76 -0
  48. package/dist/builtins/fs/touch.js.map +1 -0
  49. package/dist/builtins/fs/tree.d.ts +15 -0
  50. package/dist/builtins/fs/tree.js +84 -0
  51. package/dist/builtins/fs/tree.js.map +1 -0
  52. package/dist/builtins/fs/upload.d.ts +6 -0
  53. package/dist/builtins/fs/upload.js +48 -0
  54. package/dist/builtins/fs/upload.js.map +1 -0
  55. package/dist/builtins/help.d.ts +74 -0
  56. package/dist/builtins/help.js +1217 -0
  57. package/dist/builtins/help.js.map +1 -0
  58. package/dist/builtins/index.d.ts +45 -0
  59. package/dist/builtins/index.js +45 -0
  60. package/dist/builtins/index.js.map +1 -0
  61. package/dist/builtins/net/connect.d.ts +7 -0
  62. package/dist/builtins/net/connect.js +42 -0
  63. package/dist/builtins/net/connect.js.map +1 -0
  64. package/dist/builtins/net/cubepath.d.ts +18 -0
  65. package/dist/builtins/net/cubepath.js +102 -0
  66. package/dist/builtins/net/cubepath.js.map +1 -0
  67. package/dist/builtins/net/logout.d.ts +6 -0
  68. package/dist/builtins/net/logout.js +24 -0
  69. package/dist/builtins/net/logout.js.map +1 -0
  70. package/dist/builtins/net/pacs.d.ts +24 -0
  71. package/dist/builtins/net/pacs.js +121 -0
  72. package/dist/builtins/net/pacs.js.map +1 -0
  73. package/dist/builtins/net/pacsUtils.d.ts +85 -0
  74. package/dist/builtins/net/pacsUtils.js +184 -0
  75. package/dist/builtins/net/pacsUtils.js.map +1 -0
  76. package/dist/builtins/net/query.d.ts +60 -0
  77. package/dist/builtins/net/query.js +324 -0
  78. package/dist/builtins/net/query.js.map +1 -0
  79. package/dist/builtins/parametersofplugin.d.ts +13 -0
  80. package/dist/builtins/parametersofplugin.js +43 -0
  81. package/dist/builtins/parametersofplugin.js.map +1 -0
  82. package/dist/builtins/pluginExecute.d.ts +27 -0
  83. package/dist/builtins/pluginExecute.js +165 -0
  84. package/dist/builtins/pluginExecute.js.map +1 -0
  85. package/dist/builtins/proc.d.ts +6 -0
  86. package/dist/builtins/proc.helpers.d.ts +68 -0
  87. package/dist/builtins/proc.helpers.js +102 -0
  88. package/dist/builtins/proc.helpers.js.map +1 -0
  89. package/dist/builtins/proc.js +289 -0
  90. package/dist/builtins/proc.js.map +1 -0
  91. package/dist/builtins/res/compute.d.ts +6 -0
  92. package/dist/builtins/res/compute.js +55 -0
  93. package/dist/builtins/res/compute.js.map +1 -0
  94. package/dist/builtins/res/feed.d.ts +6 -0
  95. package/dist/builtins/res/feed.js +244 -0
  96. package/dist/builtins/res/feed.js.map +1 -0
  97. package/dist/builtins/res/feed.notes.d.ts +28 -0
  98. package/dist/builtins/res/feed.notes.js +24 -0
  99. package/dist/builtins/res/feed.notes.js.map +1 -0
  100. package/dist/builtins/res/files.d.ts +18 -0
  101. package/dist/builtins/res/files.js +85 -0
  102. package/dist/builtins/res/files.js.map +1 -0
  103. package/dist/builtins/res/group.d.ts +6 -0
  104. package/dist/builtins/res/group.js +54 -0
  105. package/dist/builtins/res/group.js.map +1 -0
  106. package/dist/builtins/res/pipeline.args.d.ts +22 -0
  107. package/dist/builtins/res/pipeline.args.js +28 -0
  108. package/dist/builtins/res/pipeline.args.js.map +1 -0
  109. package/dist/builtins/res/pipeline.d.ts +20 -0
  110. package/dist/builtins/res/pipeline.js +252 -0
  111. package/dist/builtins/res/pipeline.js.map +1 -0
  112. package/dist/builtins/res/plugin.d.ts +13 -0
  113. package/dist/builtins/res/plugin.js +140 -0
  114. package/dist/builtins/res/plugin.js.map +1 -0
  115. package/dist/builtins/res/plugininstance.d.ts +6 -0
  116. package/dist/builtins/res/plugininstance.js +53 -0
  117. package/dist/builtins/res/plugininstance.js.map +1 -0
  118. package/dist/builtins/res/pluginmeta.d.ts +6 -0
  119. package/dist/builtins/res/pluginmeta.js +53 -0
  120. package/dist/builtins/res/pluginmeta.js.map +1 -0
  121. package/dist/builtins/res/tag.d.ts +6 -0
  122. package/dist/builtins/res/tag.js +53 -0
  123. package/dist/builtins/res/tag.js.map +1 -0
  124. package/dist/builtins/res/workflow.d.ts +6 -0
  125. package/dist/builtins/res/workflow.js +53 -0
  126. package/dist/builtins/res/workflow.js.map +1 -0
  127. package/dist/builtins/store.d.ts +6 -0
  128. package/dist/builtins/store.js +107 -0
  129. package/dist/builtins/store.js.map +1 -0
  130. package/dist/builtins/sys/context.d.ts +6 -0
  131. package/dist/builtins/sys/context.js +50 -0
  132. package/dist/builtins/sys/context.js.map +1 -0
  133. package/dist/builtins/sys/physicalmode.d.ts +8 -0
  134. package/dist/builtins/sys/physicalmode.js +34 -0
  135. package/dist/builtins/sys/physicalmode.js.map +1 -0
  136. package/dist/builtins/sys/timing.d.ts +8 -0
  137. package/dist/builtins/sys/timing.js +34 -0
  138. package/dist/builtins/sys/timing.js.map +1 -0
  139. package/dist/builtins/sys/version.d.ts +15 -0
  140. package/dist/builtins/sys/version.js +23 -0
  141. package/dist/builtins/sys/version.js.map +1 -0
  142. package/dist/builtins/sys/whoami.d.ts +17 -0
  143. package/dist/builtins/sys/whoami.js +44 -0
  144. package/dist/builtins/sys/whoami.js.map +1 -0
  145. package/dist/builtins/utils.d.ts +55 -0
  146. package/dist/builtins/utils.js +145 -0
  147. package/dist/builtins/utils.js.map +1 -0
  148. package/dist/builtins/wildcard.d.ts +26 -0
  149. package/dist/builtins/wildcard.js +120 -0
  150. package/dist/builtins/wildcard.js.map +1 -0
  151. package/dist/command-keys.d.ts +8 -0
  152. package/dist/command-keys.js +32 -0
  153. package/dist/command-keys.js.map +1 -0
  154. package/dist/config/storeConfig.d.ts +57 -0
  155. package/dist/config/storeConfig.js +78 -0
  156. package/dist/config/storeConfig.js.map +1 -0
  157. package/dist/core/chiliDelegate.d.ts +21 -0
  158. package/dist/core/chiliDelegate.js +32 -0
  159. package/dist/core/chiliDelegate.js.map +1 -0
  160. package/dist/core/connect.d.ts +38 -0
  161. package/dist/core/connect.js +46 -0
  162. package/dist/core/connect.js.map +1 -0
  163. package/dist/core/dispatch.d.ts +95 -0
  164. package/dist/core/dispatch.js +618 -0
  165. package/dist/core/dispatch.js.map +1 -0
  166. package/dist/core/engine.d.ts +91 -0
  167. package/dist/core/engine.js +222 -0
  168. package/dist/core/engine.js.map +1 -0
  169. package/dist/core/preprocess.d.ts +46 -0
  170. package/dist/core/preprocess.js +146 -0
  171. package/dist/core/preprocess.js.map +1 -0
  172. package/dist/core/progress.d.ts +50 -0
  173. package/dist/core/progress.js +21 -0
  174. package/dist/core/progress.js.map +1 -0
  175. package/dist/core/promptContext.d.ts +49 -0
  176. package/dist/core/promptContext.js +39 -0
  177. package/dist/core/promptContext.js.map +1 -0
  178. package/dist/core/question.d.ts +27 -0
  179. package/dist/core/question.js +33 -0
  180. package/dist/core/question.js.map +1 -0
  181. package/dist/core/sink.d.ts +207 -0
  182. package/dist/core/sink.js +329 -0
  183. package/dist/core/sink.js.map +1 -0
  184. package/dist/core/surface.d.ts +172 -0
  185. package/dist/core/surface.js +105 -0
  186. package/dist/core/surface.js.map +1 -0
  187. package/dist/core/version.d.ts +20 -0
  188. package/dist/core/version.js +82 -0
  189. package/dist/core/version.js.map +1 -0
  190. package/dist/index.d.ts +31 -0
  191. package/dist/index.js +32 -0
  192. package/dist/index.js.map +1 -0
  193. package/dist/lib/completer/index.d.ts +15 -0
  194. package/dist/lib/completer/index.js +212 -0
  195. package/dist/lib/completer/index.js.map +1 -0
  196. package/dist/lib/completer/pathComplete.helpers.d.ts +22 -0
  197. package/dist/lib/completer/pathComplete.helpers.js +49 -0
  198. package/dist/lib/completer/pathComplete.helpers.js.map +1 -0
  199. package/dist/lib/parser.d.ts +13 -0
  200. package/dist/lib/parser.js +52 -0
  201. package/dist/lib/parser.js.map +1 -0
  202. package/dist/lib/pipe.d.ts +11 -0
  203. package/dist/lib/pipe.js +90 -0
  204. package/dist/lib/pipe.js.map +1 -0
  205. package/dist/lib/prefetch.d.ts +25 -0
  206. package/dist/lib/prefetch.js +64 -0
  207. package/dist/lib/prefetch.js.map +1 -0
  208. package/dist/lib/semicolonParser.d.ts +22 -0
  209. package/dist/lib/semicolonParser.js +53 -0
  210. package/dist/lib/semicolonParser.js.map +1 -0
  211. package/dist/lib/spinner.d.ts +23 -0
  212. package/dist/lib/spinner.js +71 -0
  213. package/dist/lib/spinner.js.map +1 -0
  214. package/dist/lib/vfs/providers/static.d.ts +65 -0
  215. package/dist/lib/vfs/providers/static.js +164 -0
  216. package/dist/lib/vfs/providers/static.js.map +1 -0
  217. package/dist/lib/vfs/providers/static_content.d.ts +27 -0
  218. package/dist/lib/vfs/providers/static_content.js +180 -0
  219. package/dist/lib/vfs/providers/static_content.js.map +1 -0
  220. package/dist/lib/vfs/vfs.d.ts +59 -0
  221. package/dist/lib/vfs/vfs.js +202 -0
  222. package/dist/lib/vfs/vfs.js.map +1 -0
  223. package/dist/session/index.d.ts +76 -0
  224. package/dist/session/index.js +120 -0
  225. package/dist/session/index.js.map +1 -0
  226. package/package.json +58 -0
@@ -0,0 +1,618 @@
1
+ /**
2
+ * @file Command dispatch for the ChELL shell.
3
+ *
4
+ * Turns one parsed command into an executed command with an envelope result:
5
+ * - the built-in command table and dispatch to built-ins, simulated plugin exec, or `chili`
6
+ * - output capture for the redirect/pipe paths
7
+ * - envelope-producing execution used by the engine facade
8
+ *
9
+ * Line-level orchestration (shell escape, semicolon batching, redirect and
10
+ * pipe detection) lives in `./engine.js`; the startup/connection/REPL glue
11
+ * lives in `./boot.js`.
12
+ *
13
+ * @module
14
+ */
15
+ import { writeFileSync, appendFileSync } from 'fs';
16
+ import chalk from 'chalk';
17
+ import { spawn } from 'child_process';
18
+ import { builtin_cd, builtin_ls, builtin_pwd, builtin_connect, builtin_logout, builtin_cat, builtin_cp, builtin_mv, builtin_upload, builtin_pacs, builtin_pipeline, builtin_pull, builtin_query, builtin_cubepath, builtin_rm, builtin_touch, builtin_mkdir, builtin_plugin, builtin_feed, builtin_compute, builtin_tag, builtin_group, builtin_pluginmeta, builtin_plugininstance, builtin_workflow, builtin_download, builtin_edit, builtin_files, builtin_links, builtin_dirs, builtin_context, builtin_parametersofplugin, builtin_physicalmode, builtin_timing, builtin_whoami, builtin_whereami, builtin_version, builtin_debug, builtin_help, builtin_tree, builtin_du, builtin_store, error_stripDebugPrefix } from '../builtins/index.js';
19
+ import { builtin_executePlugin } from '../builtins/pluginExecute.js';
20
+ import { builtin_proc } from '../builtins/proc.js';
21
+ import { wildcards_expandAll } from '../builtins/wildcard.js';
22
+ import { help_show, args_checkHasHelpFlag } from '../builtins/help.js';
23
+ import { pluginExecutable_handle } from '../builtins/executable.js';
24
+ import { errorStack, Ok, Err } from '@fnndsc/cumin';
25
+ import { envelopeHandler_wrap, printingHandler_wrap, ansi_strip, envelope_deliver, sink_get } from './sink.js';
26
+ import { vfs } from '../lib/vfs/vfs.js';
27
+ import { args_tokenize } from '../lib/parser.js';
28
+ import { surface_get, capability_require } from './surface.js';
29
+ import { redirectTarget_resolve, wildcards_expandCheck, } from './preprocess.js';
30
+ import { chiliCommand_run } from './chiliDelegate.js';
31
+ export { chiliCommand_run };
32
+ /**
33
+ * Executes a shell command on the host system (shell escape with ! prefix).
34
+ *
35
+ * @param shellCommand - The command to execute on the host shell.
36
+ * @returns A Promise resolving to the command's exit code (1 on spawn failure).
37
+ */
38
+ export async function shellCommand_execute(shellCommand) {
39
+ return new Promise((resolve) => {
40
+ const child = spawn(shellCommand, {
41
+ shell: true,
42
+ stdio: 'inherit',
43
+ env: process.env
44
+ });
45
+ child.on('close', (code) => {
46
+ if (code !== null && code !== 0) {
47
+ console.error(chalk.red(`Shell command exited with code ${code}`));
48
+ }
49
+ resolve(code ?? 0);
50
+ });
51
+ child.on('error', (err) => {
52
+ console.error(chalk.red(`Failed to execute shell command: ${err.message}`));
53
+ resolve(1);
54
+ });
55
+ });
56
+ }
57
+ /**
58
+ * Captures console output during command execution.
59
+ *
60
+ * @param fn - The function to execute while capturing output.
61
+ * @returns The captured output as a string and buffer.
62
+ */
63
+ async function output_capture(fn) {
64
+ const chunks = [];
65
+ const originalLog = console.log;
66
+ const originalStdoutWrite = process.stdout.write.bind(process.stdout);
67
+ // Override console.log and console.error
68
+ console.log = (...args) => {
69
+ const text = args.map(arg => typeof arg === 'string' ? arg : JSON.stringify(arg)).join(' ') + '\n';
70
+ chunks.push(Buffer.from(text, 'utf-8'));
71
+ };
72
+ // Override process.stdout.write to capture binary data
73
+ process.stdout.write = ((chunk) => {
74
+ if (typeof chunk === 'string') {
75
+ chunks.push(Buffer.from(chunk, 'utf-8'));
76
+ }
77
+ else if (Buffer.isBuffer(chunk)) {
78
+ chunks.push(chunk);
79
+ }
80
+ else if (chunk instanceof Uint8Array) {
81
+ chunks.push(Buffer.from(chunk));
82
+ }
83
+ return true;
84
+ });
85
+ try {
86
+ await fn();
87
+ }
88
+ finally {
89
+ // Restore original console methods and stdout.write
90
+ console.log = originalLog;
91
+ process.stdout.write = originalStdoutWrite;
92
+ }
93
+ const buffer = Buffer.concat(chunks);
94
+ const text = buffer.toString('utf-8');
95
+ return { text, buffer };
96
+ }
97
+ /**
98
+ * Builtins that have been converted to return envelopes, keyed by command
99
+ * name. Entries here are also present in COMMAND_HANDLERS in wrapped form;
100
+ * this registry exists so envelope-aware hosts can bypass the wrapper and
101
+ * receive the structured result.
102
+ */
103
+ /**
104
+ * Composes the capture bridge with envelope delivery, so a legacy printing
105
+ * handler participates in the dispatch table with envelope semantics and
106
+ * unchanged observable output.
107
+ *
108
+ * @param handler - A legacy printing command handler.
109
+ * @returns A wrapped handler for the dispatch table.
110
+ */
111
+ function printingBridge_wrap(handler) {
112
+ return envelopeHandler_wrap(printingHandler_wrap(handler));
113
+ }
114
+ export const ENVELOPE_HANDLERS = {
115
+ cat: builtin_cat,
116
+ cd: builtin_cd,
117
+ cp: builtin_cp,
118
+ mv: builtin_mv,
119
+ rm: builtin_rm,
120
+ mkdir: builtin_mkdir,
121
+ touch: builtin_touch,
122
+ pwd: builtin_pwd,
123
+ whoami: builtin_whoami,
124
+ whereami: builtin_whereami,
125
+ timing: builtin_timing,
126
+ physicalmode: builtin_physicalmode,
127
+ debug: builtin_debug,
128
+ version: builtin_version,
129
+ // Bridged (captured) handlers: envelope semantics without typed models.
130
+ // plugin is deliberately absent: its add flow prompts for admin
131
+ // credentials through readline, which capture would make invisible.
132
+ ls: printingHandler_wrap(builtin_ls),
133
+ tree: printingHandler_wrap(builtin_tree),
134
+ du: printingHandler_wrap(builtin_du),
135
+ help: printingHandler_wrap(builtin_help),
136
+ proc: printingHandler_wrap(builtin_proc),
137
+ logout: printingHandler_wrap(builtin_logout),
138
+ cubepath: printingHandler_wrap(builtin_cubepath),
139
+ query: printingHandler_wrap(builtin_query),
140
+ feed: printingHandler_wrap(builtin_feed),
141
+ feeds: printingHandler_wrap(builtin_feed),
142
+ compute: printingHandler_wrap(builtin_compute),
143
+ computes: printingHandler_wrap(builtin_compute),
144
+ tag: printingHandler_wrap(builtin_tag),
145
+ tags: printingHandler_wrap(builtin_tag),
146
+ group: printingHandler_wrap(builtin_group),
147
+ groups: printingHandler_wrap(builtin_group),
148
+ pluginmeta: printingHandler_wrap(builtin_pluginmeta),
149
+ pluginmetas: printingHandler_wrap(builtin_pluginmeta),
150
+ meta: printingHandler_wrap(builtin_pluginmeta),
151
+ metas: printingHandler_wrap(builtin_pluginmeta),
152
+ plugininstance: printingHandler_wrap(builtin_plugininstance),
153
+ plugininstances: printingHandler_wrap(builtin_plugininstance),
154
+ instance: printingHandler_wrap(builtin_plugininstance),
155
+ instances: printingHandler_wrap(builtin_plugininstance),
156
+ job: printingHandler_wrap(builtin_plugininstance),
157
+ jobs: printingHandler_wrap(builtin_plugininstance),
158
+ workflow: printingHandler_wrap(builtin_workflow),
159
+ workflows: printingHandler_wrap(builtin_workflow),
160
+ files: printingHandler_wrap(builtin_files),
161
+ links: printingHandler_wrap(builtin_links),
162
+ dirs: printingHandler_wrap(builtin_dirs),
163
+ context: printingHandler_wrap(builtin_context),
164
+ parametersofplugin: printingHandler_wrap(builtin_parametersofplugin),
165
+ };
166
+ export const COMMAND_HANDLERS = {
167
+ connect: builtin_connect,
168
+ logout: printingBridge_wrap(builtin_logout),
169
+ cd: envelopeHandler_wrap(builtin_cd),
170
+ ls: printingBridge_wrap(builtin_ls),
171
+ pwd: envelopeHandler_wrap(builtin_pwd),
172
+ cat: envelopeHandler_wrap(builtin_cat),
173
+ rm: envelopeHandler_wrap(builtin_rm),
174
+ cp: envelopeHandler_wrap(builtin_cp),
175
+ mv: envelopeHandler_wrap(builtin_mv),
176
+ touch: envelopeHandler_wrap(builtin_touch),
177
+ mkdir: envelopeHandler_wrap(builtin_mkdir),
178
+ upload: builtin_upload,
179
+ pacs: builtin_pacs,
180
+ pipeline: builtin_pipeline,
181
+ pipelines: builtin_pipeline,
182
+ pull: builtin_pull,
183
+ query: printingBridge_wrap(builtin_query),
184
+ cubepath: printingBridge_wrap(builtin_cubepath),
185
+ download: builtin_download,
186
+ edit: builtin_edit,
187
+ context: printingBridge_wrap(builtin_context),
188
+ parametersofplugin: printingBridge_wrap(builtin_parametersofplugin),
189
+ physicalmode: envelopeHandler_wrap(builtin_physicalmode),
190
+ timing: envelopeHandler_wrap(builtin_timing),
191
+ whoami: envelopeHandler_wrap(builtin_whoami),
192
+ whereami: envelopeHandler_wrap(builtin_whereami),
193
+ debug: envelopeHandler_wrap(builtin_debug),
194
+ help: printingBridge_wrap(builtin_help),
195
+ proc: printingBridge_wrap(builtin_proc),
196
+ tree: printingBridge_wrap(builtin_tree),
197
+ du: printingBridge_wrap(builtin_du),
198
+ store: builtin_store,
199
+ plugin: builtin_plugin,
200
+ plugins: builtin_plugin,
201
+ feed: printingBridge_wrap(builtin_feed),
202
+ feeds: printingBridge_wrap(builtin_feed),
203
+ compute: printingBridge_wrap(builtin_compute),
204
+ computes: printingBridge_wrap(builtin_compute),
205
+ tag: printingBridge_wrap(builtin_tag),
206
+ tags: printingBridge_wrap(builtin_tag),
207
+ group: printingBridge_wrap(builtin_group),
208
+ groups: printingBridge_wrap(builtin_group),
209
+ pluginmeta: printingBridge_wrap(builtin_pluginmeta),
210
+ pluginmetas: printingBridge_wrap(builtin_pluginmeta),
211
+ meta: printingBridge_wrap(builtin_pluginmeta),
212
+ metas: printingBridge_wrap(builtin_pluginmeta),
213
+ plugininstance: printingBridge_wrap(builtin_plugininstance),
214
+ plugininstances: printingBridge_wrap(builtin_plugininstance),
215
+ instance: printingBridge_wrap(builtin_plugininstance),
216
+ instances: printingBridge_wrap(builtin_plugininstance),
217
+ job: printingBridge_wrap(builtin_plugininstance),
218
+ jobs: printingBridge_wrap(builtin_plugininstance),
219
+ workflow: printingBridge_wrap(builtin_workflow),
220
+ workflows: printingBridge_wrap(builtin_workflow),
221
+ files: printingBridge_wrap(builtin_files),
222
+ links: printingBridge_wrap(builtin_links),
223
+ dirs: printingBridge_wrap(builtin_dirs),
224
+ pacsservers: async (args) => {
225
+ await chiliCommand_run('pacsservers', ['-s', ...args]);
226
+ },
227
+ pacsqueries: async (args) => {
228
+ await chiliCommand_run('pacsqueries', ['-s', ...args]);
229
+ },
230
+ pacsretrieve: async (args) => {
231
+ await chiliCommand_run('pacsretrieve', ['-s', ...args]);
232
+ }
233
+ };
234
+ export { COMMAND_HANDLERS_KEYS } from '../command-keys.js';
235
+ /**
236
+ * Prints elapsed time since startTime if timing is enabled.
237
+ *
238
+ * @param startTime - Timestamp from `performance.now()` at command start.
239
+ * @param enabled - Whether timing display is active.
240
+ */
241
+ export function command_timingMaybePrint(startTime, enabled) {
242
+ if (!enabled)
243
+ return;
244
+ const elapsed = performance.now() - startTime;
245
+ console.log(chalk.gray(`[${elapsed.toFixed(2)}ms]`));
246
+ }
247
+ /**
248
+ * Handles a pipeline name invoked directly as an executable from /bin.
249
+ * Routes flag combinations to the appropriate pipeline subcommand:
250
+ * --nodes / --parameters → pipeline info
251
+ * --source / --readme → pipeline source
252
+ * (bare or --compute) → pipeline run
253
+ *
254
+ * @param name - The pipeline name as typed.
255
+ * @param args - Arguments following the pipeline name.
256
+ */
257
+ async function pipelineExecutable_handle(name, args) {
258
+ if (args.includes('--nodes') || args.includes('--parameters')) {
259
+ await builtin_pipeline(['info', name]);
260
+ }
261
+ else if (args.includes('--source') || args.includes('--readme')) {
262
+ await builtin_pipeline(['source', name]);
263
+ }
264
+ else {
265
+ await builtin_pipeline(['run', name, ...args]);
266
+ }
267
+ }
268
+ /**
269
+ * Expands `$NAME` and `${NAME}` environment references in one token.
270
+ *
271
+ * Applied per token after parsing, so an expanded value can never inject
272
+ * command separators, pipes or redirects (the structural characters were
273
+ * already consumed). References to unset variables are left verbatim —
274
+ * kinder than the shell's silent empty string when a script forgets an
275
+ * export. Shell-escape lines (`!...`) never reach this point; bash does
276
+ * its own expansion there.
277
+ *
278
+ * @param token - A single parsed command token.
279
+ * @returns The token with set environment references substituted.
280
+ */
281
+ export function envRefs_expand(token) {
282
+ return token.replace(/\$(?:\{([A-Za-z_][A-Za-z0-9_]*)\}|([A-Za-z_][A-Za-z0-9_]*))/g, (match, braced, bare) => {
283
+ const value = process.env[braced ?? bare ?? ''];
284
+ return value !== undefined ? value : match;
285
+ });
286
+ }
287
+ /**
288
+ * Reads the current process exit code as a number.
289
+ *
290
+ * @returns The exit code, treating an unset code as zero.
291
+ */
292
+ function exitCode_read() {
293
+ return typeof process.exitCode === 'number' ? process.exitCode : 0;
294
+ }
295
+ /**
296
+ * Runs a legacy printing handler uncaptured and derives an envelope from the
297
+ * exit-code delta.
298
+ *
299
+ * This is the passthrough for commands that cannot be captured yet: the
300
+ * interactive holdouts (their prompts must reach the terminal) and the
301
+ * progress writers (their live updates must stay live). The handler prints
302
+ * exactly as it always has; the placeholder envelope records only the
303
+ * outcome, with no rendered text, so envelope consumers never re-print what
304
+ * the terminal already showed.
305
+ *
306
+ * @param handler - A legacy printing command handler.
307
+ * @param args - Parsed arguments.
308
+ * @returns A placeholder envelope carrying the command's outcome.
309
+ */
310
+ async function handler_runDirect(handler, args) {
311
+ const exitCodeBefore = exitCode_read();
312
+ await handler(args);
313
+ const exitCodeAfter = exitCode_read();
314
+ const failed = exitCodeAfter !== 0 && exitCodeAfter !== exitCodeBefore;
315
+ return { status: failed ? 'error' : 'ok', rendered: '' };
316
+ }
317
+ /**
318
+ * Drains the errorStack from a checkpoint into an envelope's structured
319
+ * `errors` field, and escalates status to `error` when an error-type message
320
+ * was drained.
321
+ *
322
+ * This is the per-command error boundary: it captures exactly the messages a
323
+ * command left on the stack, so a remote surface receives full error detail
324
+ * with each result and stale errors cannot bleed into the next command.
325
+ * Escalating status from a drained error is a reliable per-command failure
326
+ * signal, independent of whether the command happened to change
327
+ * `process.exitCode`.
328
+ *
329
+ * @param checkpoint - A checkpoint from `errorStack.checkpoint_mark()`.
330
+ * @param envelope - The envelope to attach drained errors to.
331
+ * @returns The same envelope, with errors and possibly status updated.
332
+ */
333
+ function envelope_drainErrorsInto(checkpoint, envelope) {
334
+ const drained = errorStack.checkpoint_drain(checkpoint);
335
+ if (drained.length > 0) {
336
+ envelope.errors = drained;
337
+ if (envelope.status === 'ok' && drained.some((message) => message.type === 'error')) {
338
+ envelope.status = 'error';
339
+ }
340
+ }
341
+ return envelope;
342
+ }
343
+ /**
344
+ * Dispatches a parsed command to its handler and returns its envelope, with
345
+ * any errors the command left on the stack drained into the envelope.
346
+ *
347
+ * @param command - The command name.
348
+ * @param args - Parsed arguments.
349
+ * @returns The envelope of the executed command.
350
+ */
351
+ export async function command_dispatchEnvelope(command, args) {
352
+ const checkpoint = errorStack.checkpoint_mark();
353
+ const envelope = await commandDispatchEnvelope_run(command, args);
354
+ return envelope_drainErrorsInto(checkpoint, envelope);
355
+ }
356
+ /**
357
+ * Runs the dispatch itself (without the error drain). Expands environment
358
+ * references in the arguments, then checks ENVELOPE_HANDLERS, then
359
+ * unconverted COMMAND_HANDLERS, then /bin plugin/pipeline names, then falls
360
+ * back to chili through the capture bridge.
361
+ *
362
+ * Envelope-speaking handlers are delivered through the active sink here, so
363
+ * direct execution prints exactly as it always has; unconverted handlers
364
+ * print for themselves and yield a placeholder envelope.
365
+ *
366
+ * @param command - The command name.
367
+ * @param args - Parsed arguments.
368
+ * @returns The envelope of the executed command.
369
+ */
370
+ async function commandDispatchEnvelope_run(command, args) {
371
+ if (command === 'exit') {
372
+ process.exit(0);
373
+ }
374
+ args = args.map(envRefs_expand);
375
+ const envelopeHandler = ENVELOPE_HANDLERS[command];
376
+ if (envelopeHandler) {
377
+ // A handler that resolves without an envelope (as stubbed handlers in
378
+ // tests do) is treated as having produced no output.
379
+ const envelope = await envelopeHandler(args);
380
+ if (!envelope) {
381
+ return { status: 'ok', rendered: '' };
382
+ }
383
+ envelope_deliver(envelope);
384
+ return envelope;
385
+ }
386
+ const handler = COMMAND_HANDLERS[command];
387
+ if (handler) {
388
+ return handler_runDirect(handler, args);
389
+ }
390
+ const binResult = await vfs.data_get('/bin');
391
+ if (binResult.ok) {
392
+ const pluginItem = binResult.value.find(item => item.name === command && item.type === 'plugin');
393
+ const pipelineItem = binResult.value.find(item => item.name === command && item.type === 'pipeline');
394
+ if (pluginItem) {
395
+ return handler_runDirect((pluginArgs) => builtin_executePlugin(command, pluginArgs), args);
396
+ }
397
+ if (pipelineItem) {
398
+ return handler_runDirect((pipelineArgs) => pipelineExecutable_handle(command, pipelineArgs), args);
399
+ }
400
+ }
401
+ const fallback = printingHandler_wrap(async (fallbackArgs) => {
402
+ console.log(chalk.yellow(`Unknown chell command '${command}' -- delegating to chili`));
403
+ await chiliCommand_run(command, ['-s', ...fallbackArgs]);
404
+ });
405
+ const envelope = await fallback(args);
406
+ envelope_deliver(envelope);
407
+ return envelope;
408
+ }
409
+ /**
410
+ * Dispatches a parsed command to its handler.
411
+ *
412
+ * Compatibility shape over {@link command_dispatchEnvelope} for callers that
413
+ * do not consume envelopes.
414
+ *
415
+ * @param command - The command name.
416
+ * @param args - Parsed arguments.
417
+ * @returns A Promise that resolves once the command has been dispatched.
418
+ */
419
+ export async function command_dispatch(command, args) {
420
+ await command_dispatchEnvelope(command, args);
421
+ }
422
+ /**
423
+ * Executes a redirected command (`>` / `>>`): captures the command's output
424
+ * and writes it to the target file.
425
+ *
426
+ * @param redirectInfo - The parsed redirection (command, operator, target).
427
+ * @returns An envelope recording the outcome; rendered text stays empty
428
+ * because the output went to the file, not the terminal.
429
+ */
430
+ export async function redirect_execute(redirectInfo) {
431
+ const { buffer } = await chellCommand_executeAndCapture(redirectInfo.command);
432
+ const targetResult = redirectTarget_resolve(redirectInfo.filePath, redirectInfo.command);
433
+ if (!targetResult.ok) {
434
+ const lastError = errorStack.stack_pop();
435
+ console.error(chalk.red(lastError ? lastError.message : 'Redirect error'));
436
+ return { status: 'error', rendered: '' };
437
+ }
438
+ if (redirectInfo.operator === '>') {
439
+ writeFileSync(targetResult.value, buffer);
440
+ }
441
+ else {
442
+ appendFileSync(targetResult.value, buffer);
443
+ }
444
+ return { status: 'ok', rendered: '' };
445
+ }
446
+ /**
447
+ * Shows help for a command if `--help` or `-h` is present in args.
448
+ * Returns Ok(true) if help was displayed, Ok(false) otherwise.
449
+ *
450
+ * @param command - The command name (used to look up help text).
451
+ * @param args - Parsed argument list.
452
+ */
453
+ function help_showMaybe(command, args) {
454
+ if (args_checkHasHelpFlag(args, command)) {
455
+ help_show(command);
456
+ return Ok(true);
457
+ }
458
+ return Ok(false);
459
+ }
460
+ /**
461
+ * Expands wildcard patterns in args for commands that support it.
462
+ * Returns Ok(expanded args) or Err if expansion fails.
463
+ *
464
+ * @param command - The command name (determines whether expansion applies).
465
+ * @param args - Raw argument list potentially containing glob patterns.
466
+ */
467
+ async function wildcards_expand(command, args) {
468
+ if (!wildcards_expandCheck(command)) {
469
+ return Ok(args);
470
+ }
471
+ const expandResult = await wildcards_expandAll(args);
472
+ if (!expandResult.ok) {
473
+ const lastError = errorStack.stack_pop();
474
+ if (lastError) {
475
+ console.error(chalk.red(error_stripDebugPrefix(lastError.message)));
476
+ }
477
+ return Err();
478
+ }
479
+ return Ok(expandResult.value);
480
+ }
481
+ /**
482
+ * Executes a chell command and captures its output.
483
+ * Consults COMMAND_HANDLERS — the single source of truth — so the pipe path
484
+ * is always consistent with the direct-execution path.
485
+ *
486
+ * @param commandLine - The command line to execute.
487
+ * @returns The captured output as text and raw buffer.
488
+ */
489
+ async function chellCommand_executeAndCapture(commandLine) {
490
+ const trimmedLine = commandLine.trim();
491
+ if (!trimmedLine)
492
+ return { text: '', buffer: Buffer.alloc(0) };
493
+ const tokens = args_tokenize(trimmedLine);
494
+ if (tokens.length === 0) {
495
+ return { text: '', buffer: Buffer.alloc(0) };
496
+ }
497
+ let [command, ...args] = tokens;
498
+ if (wildcards_expandCheck(command)) {
499
+ const expandResult = await wildcards_expandAll(args);
500
+ if (!expandResult.ok) {
501
+ const lastError = errorStack.stack_pop();
502
+ const errorMsg = lastError ? error_stripDebugPrefix(lastError.message) : 'Unknown error';
503
+ return { text: chalk.red(`${errorMsg}\n`), buffer: Buffer.from('') };
504
+ }
505
+ args = expandResult.value;
506
+ }
507
+ if (command === 'exit') {
508
+ process.exit(0);
509
+ }
510
+ // Envelope-speaking commands feed pipes and redirects from their envelope:
511
+ // rendered text with ANSI stripped (plain pipes, the documented deviation),
512
+ // error-stream text passed live to stderr exactly as the inherit behavior
513
+ // always did. Direct stdout writers (binary cat) are still captured; their
514
+ // bytes precede the envelope's rendered text if a command mixes both.
515
+ const envelopeHandler = ENVELOPE_HANDLERS[command];
516
+ if (envelopeHandler) {
517
+ let envelope;
518
+ const { buffer: directBuffer } = await output_capture(async () => {
519
+ envelope = await envelopeHandler(args);
520
+ });
521
+ if (!envelope) {
522
+ return { text: '', buffer: Buffer.alloc(0) };
523
+ }
524
+ if (envelope.renderedErr !== undefined && envelope.renderedErr.length > 0) {
525
+ process.stderr.write(envelope.renderedErr);
526
+ }
527
+ const plain = ansi_strip(envelope.rendered);
528
+ const buffer = Buffer.concat([directBuffer, Buffer.from(plain, 'utf-8')]);
529
+ return { text: buffer.toString('utf-8'), buffer };
530
+ }
531
+ return output_capture(async () => {
532
+ if (await pluginExecutable_handle(command, args, { piped: true })) {
533
+ return;
534
+ }
535
+ const handler = COMMAND_HANDLERS[command];
536
+ if (handler) {
537
+ await handler(args);
538
+ return;
539
+ }
540
+ console.log(chalk.yellow(`Unknown chell command '${command}' -- delegating to chili`));
541
+ await chiliCommand_run(command, ['-s', ...args]);
542
+ });
543
+ }
544
+ /**
545
+ * Executes a pipe chain by running the first command in chell and piping
546
+ * through local tools, delivering the final output on the data channel.
547
+ *
548
+ * @param segments - Array of command segments separated by pipes.
549
+ * @returns An envelope whose rendered text is the chain's final output.
550
+ */
551
+ export async function pipe_execute(segments) {
552
+ if (segments.length === 0) {
553
+ return { status: 'ok', rendered: '' };
554
+ }
555
+ // The first segment is a chell command run in-engine; the rest run through
556
+ // the surface, so nothing spawns on a daemon host — a surface without the
557
+ // capability (a browser) fails the pipeline with a clear message.
558
+ if (segments.length > 1) {
559
+ capability_require('pipeSegments', 'this surface cannot run pipeline segments');
560
+ }
561
+ // Execute first segment in chell and capture output
562
+ const firstCommand = segments[0];
563
+ const { buffer } = await chellCommand_executeAndCapture(firstCommand);
564
+ // Chain remaining segments through the surface's own tools.
565
+ let currentInput = buffer;
566
+ for (let i = 1; i < segments.length; i++) {
567
+ currentInput = await surface_get().pipeSegment(segments[i], currentInput);
568
+ }
569
+ // Output final result
570
+ sink_get().data_write(currentInput);
571
+ return { status: 'ok', rendered: currentInput.toString('utf-8') };
572
+ }
573
+ /**
574
+ * Executes one plain command line (no shell escape, batch, redirect or pipe)
575
+ * and returns its envelope.
576
+ *
577
+ * Mirrors the historical direct-execution order exactly: help flag
578
+ * short-circuit, wildcard expansion, simulated plugin execution, then table
579
+ * dispatch. Timing is printed at the same points the shell always printed
580
+ * it (after plugin execution or dispatch; never after help or a wildcard
581
+ * failure).
582
+ *
583
+ * @param trimmedLine - The trimmed command line.
584
+ * @param startTime - Timing reference from `performance.now()`.
585
+ * @param timingEnabled - Whether to print elapsed time after execution.
586
+ * @returns The command's envelope, or null when the line held no tokens.
587
+ */
588
+ export async function command_executeToEnvelope(trimmedLine, startTime, timingEnabled) {
589
+ const tokens = args_tokenize(trimmedLine);
590
+ if (tokens.length === 0)
591
+ return null;
592
+ let [command, ...args] = tokens;
593
+ // Check for --help flag before any processing
594
+ const helpResult = help_showMaybe(command, args);
595
+ if (helpResult.ok && helpResult.value) {
596
+ return { status: 'ok', rendered: '' };
597
+ }
598
+ // Expand wildcards for commands that support it
599
+ const expandResult = await wildcards_expand(command, args);
600
+ if (!expandResult.ok) {
601
+ return { status: 'error', rendered: '' };
602
+ }
603
+ args = expandResult.value;
604
+ // Attempt to handle as a simulated plugin execution. This path bypasses
605
+ // command_dispatchEnvelope, so it drains the errorStack itself.
606
+ const checkpoint = errorStack.checkpoint_mark();
607
+ const exitCodeBefore = exitCode_read();
608
+ if (await pluginExecutable_handle(command, args)) {
609
+ command_timingMaybePrint(startTime, timingEnabled);
610
+ const exitCodeAfter = exitCode_read();
611
+ const failed = exitCodeAfter !== 0 && exitCodeAfter !== exitCodeBefore;
612
+ return envelope_drainErrorsInto(checkpoint, { status: failed ? 'error' : 'ok', rendered: '' });
613
+ }
614
+ const envelope = await command_dispatchEnvelope(command, args);
615
+ command_timingMaybePrint(startTime, timingEnabled);
616
+ return envelope;
617
+ }
618
+ //# sourceMappingURL=dispatch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dispatch.js","sourceRoot":"","sources":["../../src/core/dispatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,aAAa,EAAE,cAAc,EA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