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