@fnndsc/chell 4.4.0 → 5.0.1
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.
- package/dist/builtins/sys/prompt.js +2 -2
- package/dist/builtins/sys/prompt.js.map +1 -1
- package/dist/chell.d.ts +2 -2
- package/dist/chell.js +2 -2
- package/dist/chell.js.map +1 -1
- package/dist/config/settings.d.ts +4 -2
- package/dist/config/settings.js +7 -2
- package/dist/config/settings.js.map +1 -1
- package/dist/core/boot.js +49 -60
- package/dist/core/boot.js.map +1 -1
- package/dist/core/cliSurface.d.ts +1 -1
- package/dist/core/cliSurface.js +1 -1
- package/dist/core/cliSurface.js.map +1 -1
- package/dist/core/progressRenderer.d.ts +2 -2
- package/dist/core/prompt/session.d.ts +26 -1
- package/dist/core/prompt/session.js +25 -20
- package/dist/core/prompt/session.js.map +1 -1
- package/dist/core/repl.d.ts +2 -2
- package/dist/core/repl.js +6 -4
- package/dist/core/repl.js.map +1 -1
- package/dist/core/surfaceDispatch.d.ts +21 -0
- package/dist/core/surfaceDispatch.js +33 -0
- package/dist/core/surfaceDispatch.js.map +1 -0
- package/dist/remote/client.js +2 -2
- package/dist/remote/client.js.map +1 -1
- package/dist/remote/remoteEngine.d.ts +3 -3
- package/dist/remote/remoteEngine.js +7 -4
- package/dist/remote/remoteEngine.js.map +1 -1
- package/package.json +6 -6
- package/dist/builtins/debug.d.ts +0 -8
- package/dist/builtins/debug.js +0 -39
- package/dist/builtins/debug.js.map +0 -1
- package/dist/builtins/executable.d.ts +0 -22
- package/dist/builtins/executable.js +0 -115
- package/dist/builtins/executable.js.map +0 -1
- package/dist/builtins/fs/cat.d.ts +0 -16
- package/dist/builtins/fs/cat.js +0 -266
- package/dist/builtins/fs/cat.js.map +0 -1
- package/dist/builtins/fs/cd.d.ts +0 -42
- package/dist/builtins/fs/cd.js +0 -193
- package/dist/builtins/fs/cd.js.map +0 -1
- package/dist/builtins/fs/cp.d.ts +0 -10
- package/dist/builtins/fs/cp.js +0 -86
- package/dist/builtins/fs/cp.js.map +0 -1
- package/dist/builtins/fs/download.d.ts +0 -6
- package/dist/builtins/fs/download.js +0 -45
- package/dist/builtins/fs/download.js.map +0 -1
- package/dist/builtins/fs/du.d.ts +0 -58
- package/dist/builtins/fs/du.js +0 -210
- package/dist/builtins/fs/du.js.map +0 -1
- package/dist/builtins/fs/edit.d.ts +0 -7
- package/dist/builtins/fs/edit.js +0 -104
- package/dist/builtins/fs/edit.js.map +0 -1
- package/dist/builtins/fs/ls.d.ts +0 -8
- package/dist/builtins/fs/ls.js +0 -68
- package/dist/builtins/fs/ls.js.map +0 -1
- package/dist/builtins/fs/mkdir.d.ts +0 -9
- package/dist/builtins/fs/mkdir.js +0 -52
- package/dist/builtins/fs/mkdir.js.map +0 -1
- package/dist/builtins/fs/mv.d.ts +0 -10
- package/dist/builtins/fs/mv.js +0 -88
- package/dist/builtins/fs/mv.js.map +0 -1
- package/dist/builtins/fs/pull.args.d.ts +0 -22
- package/dist/builtins/fs/pull.args.js +0 -30
- package/dist/builtins/fs/pull.args.js.map +0 -1
- package/dist/builtins/fs/pull.d.ts +0 -26
- package/dist/builtins/fs/pull.js +0 -445
- package/dist/builtins/fs/pull.js.map +0 -1
- package/dist/builtins/fs/pwd.d.ts +0 -10
- package/dist/builtins/fs/pwd.js +0 -73
- package/dist/builtins/fs/pwd.js.map +0 -1
- package/dist/builtins/fs/rm.d.ts +0 -37
- package/dist/builtins/fs/rm.js +0 -197
- package/dist/builtins/fs/rm.js.map +0 -1
- package/dist/builtins/fs/touch.d.ts +0 -9
- package/dist/builtins/fs/touch.js +0 -76
- package/dist/builtins/fs/touch.js.map +0 -1
- package/dist/builtins/fs/tree.d.ts +0 -15
- package/dist/builtins/fs/tree.js +0 -84
- package/dist/builtins/fs/tree.js.map +0 -1
- package/dist/builtins/fs/upload.d.ts +0 -6
- package/dist/builtins/fs/upload.js +0 -48
- package/dist/builtins/fs/upload.js.map +0 -1
- package/dist/builtins/help.d.ts +0 -74
- package/dist/builtins/help.js +0 -1217
- package/dist/builtins/help.js.map +0 -1
- package/dist/builtins/index.d.ts +0 -46
- package/dist/builtins/index.js +0 -46
- package/dist/builtins/index.js.map +0 -1
- package/dist/builtins/net/connect.d.ts +0 -7
- package/dist/builtins/net/connect.js +0 -42
- package/dist/builtins/net/connect.js.map +0 -1
- package/dist/builtins/net/cubepath.d.ts +0 -18
- package/dist/builtins/net/cubepath.js +0 -102
- package/dist/builtins/net/cubepath.js.map +0 -1
- package/dist/builtins/net/logout.d.ts +0 -6
- package/dist/builtins/net/logout.js +0 -24
- package/dist/builtins/net/logout.js.map +0 -1
- package/dist/builtins/net/pacs.d.ts +0 -24
- package/dist/builtins/net/pacs.js +0 -121
- package/dist/builtins/net/pacs.js.map +0 -1
- package/dist/builtins/net/pacsUtils.d.ts +0 -85
- package/dist/builtins/net/pacsUtils.js +0 -184
- package/dist/builtins/net/pacsUtils.js.map +0 -1
- package/dist/builtins/net/query.d.ts +0 -60
- package/dist/builtins/net/query.js +0 -324
- package/dist/builtins/net/query.js.map +0 -1
- package/dist/builtins/parametersofplugin.d.ts +0 -13
- package/dist/builtins/parametersofplugin.js +0 -43
- package/dist/builtins/parametersofplugin.js.map +0 -1
- package/dist/builtins/pluginExecute.d.ts +0 -27
- package/dist/builtins/pluginExecute.js +0 -165
- package/dist/builtins/pluginExecute.js.map +0 -1
- package/dist/builtins/proc.d.ts +0 -6
- package/dist/builtins/proc.helpers.d.ts +0 -68
- package/dist/builtins/proc.helpers.js +0 -102
- package/dist/builtins/proc.helpers.js.map +0 -1
- package/dist/builtins/proc.js +0 -289
- package/dist/builtins/proc.js.map +0 -1
- package/dist/builtins/res/compute.d.ts +0 -6
- package/dist/builtins/res/compute.js +0 -55
- package/dist/builtins/res/compute.js.map +0 -1
- package/dist/builtins/res/feed.d.ts +0 -6
- package/dist/builtins/res/feed.js +0 -244
- package/dist/builtins/res/feed.js.map +0 -1
- package/dist/builtins/res/feed.notes.d.ts +0 -28
- package/dist/builtins/res/feed.notes.js +0 -24
- package/dist/builtins/res/feed.notes.js.map +0 -1
- package/dist/builtins/res/files.d.ts +0 -18
- package/dist/builtins/res/files.js +0 -85
- package/dist/builtins/res/files.js.map +0 -1
- package/dist/builtins/res/group.d.ts +0 -6
- package/dist/builtins/res/group.js +0 -54
- package/dist/builtins/res/group.js.map +0 -1
- package/dist/builtins/res/pipeline.args.d.ts +0 -22
- package/dist/builtins/res/pipeline.args.js +0 -28
- package/dist/builtins/res/pipeline.args.js.map +0 -1
- package/dist/builtins/res/pipeline.d.ts +0 -20
- package/dist/builtins/res/pipeline.js +0 -252
- package/dist/builtins/res/pipeline.js.map +0 -1
- package/dist/builtins/res/plugin.d.ts +0 -13
- package/dist/builtins/res/plugin.js +0 -140
- package/dist/builtins/res/plugin.js.map +0 -1
- package/dist/builtins/res/plugininstance.d.ts +0 -6
- package/dist/builtins/res/plugininstance.js +0 -53
- package/dist/builtins/res/plugininstance.js.map +0 -1
- package/dist/builtins/res/pluginmeta.d.ts +0 -6
- package/dist/builtins/res/pluginmeta.js +0 -53
- package/dist/builtins/res/pluginmeta.js.map +0 -1
- package/dist/builtins/res/tag.d.ts +0 -6
- package/dist/builtins/res/tag.js +0 -53
- package/dist/builtins/res/tag.js.map +0 -1
- package/dist/builtins/res/workflow.d.ts +0 -6
- package/dist/builtins/res/workflow.js +0 -53
- package/dist/builtins/res/workflow.js.map +0 -1
- package/dist/builtins/store.d.ts +0 -6
- package/dist/builtins/store.js +0 -108
- package/dist/builtins/store.js.map +0 -1
- package/dist/builtins/sys/context.d.ts +0 -6
- package/dist/builtins/sys/context.js +0 -50
- package/dist/builtins/sys/context.js.map +0 -1
- package/dist/builtins/sys/physicalmode.d.ts +0 -8
- package/dist/builtins/sys/physicalmode.js +0 -34
- package/dist/builtins/sys/physicalmode.js.map +0 -1
- package/dist/builtins/sys/timing.d.ts +0 -8
- package/dist/builtins/sys/timing.js +0 -34
- package/dist/builtins/sys/timing.js.map +0 -1
- package/dist/builtins/sys/version.d.ts +0 -15
- package/dist/builtins/sys/version.js +0 -23
- package/dist/builtins/sys/version.js.map +0 -1
- package/dist/builtins/sys/whoami.d.ts +0 -17
- package/dist/builtins/sys/whoami.js +0 -44
- package/dist/builtins/sys/whoami.js.map +0 -1
- package/dist/builtins/utils.d.ts +0 -55
- package/dist/builtins/utils.js +0 -145
- package/dist/builtins/utils.js.map +0 -1
- package/dist/builtins/wildcard.d.ts +0 -26
- package/dist/builtins/wildcard.js +0 -120
- package/dist/builtins/wildcard.js.map +0 -1
- package/dist/calypso.d.ts +0 -13
- package/dist/calypso.js +0 -44
- package/dist/calypso.js.map +0 -1
- package/dist/command-keys.d.ts +0 -8
- package/dist/command-keys.js +0 -32
- package/dist/command-keys.js.map +0 -1
- package/dist/core/dispatch.d.ts +0 -101
- package/dist/core/dispatch.js +0 -636
- package/dist/core/dispatch.js.map +0 -1
- package/dist/core/engine.d.ts +0 -91
- package/dist/core/engine.js +0 -222
- package/dist/core/engine.js.map +0 -1
- package/dist/core/preprocess.d.ts +0 -46
- package/dist/core/preprocess.js +0 -146
- package/dist/core/preprocess.js.map +0 -1
- package/dist/core/progress.d.ts +0 -25
- package/dist/core/progress.js +0 -10
- package/dist/core/progress.js.map +0 -1
- package/dist/core/question.d.ts +0 -27
- package/dist/core/question.js +0 -33
- package/dist/core/question.js.map +0 -1
- package/dist/core/sink.d.ts +0 -201
- package/dist/core/sink.js +0 -300
- package/dist/core/sink.js.map +0 -1
- package/dist/core/surface.d.ts +0 -172
- package/dist/core/surface.js +0 -105
- package/dist/core/surface.js.map +0 -1
- package/dist/core/version.d.ts +0 -20
- package/dist/core/version.js +0 -82
- package/dist/core/version.js.map +0 -1
- package/dist/daemon/launch.d.ts +0 -9
- package/dist/daemon/launch.js +0 -82
- package/dist/daemon/launch.js.map +0 -1
- package/dist/lib/completer/index.d.ts +0 -15
- package/dist/lib/completer/index.js +0 -212
- package/dist/lib/completer/index.js.map +0 -1
- package/dist/lib/completer/pathComplete.helpers.d.ts +0 -22
- package/dist/lib/completer/pathComplete.helpers.js +0 -49
- package/dist/lib/completer/pathComplete.helpers.js.map +0 -1
- package/dist/lib/parser.d.ts +0 -13
- package/dist/lib/parser.js +0 -52
- package/dist/lib/parser.js.map +0 -1
- package/dist/lib/pipe.d.ts +0 -11
- package/dist/lib/pipe.js +0 -90
- package/dist/lib/pipe.js.map +0 -1
- package/dist/lib/prefetch.d.ts +0 -25
- package/dist/lib/prefetch.js +0 -64
- package/dist/lib/prefetch.js.map +0 -1
- package/dist/lib/semicolonParser.d.ts +0 -22
- package/dist/lib/semicolonParser.js +0 -53
- package/dist/lib/semicolonParser.js.map +0 -1
- package/dist/lib/spinner.d.ts +0 -23
- package/dist/lib/spinner.js +0 -71
- package/dist/lib/spinner.js.map +0 -1
- package/dist/lib/vfs/providers/static.d.ts +0 -65
- package/dist/lib/vfs/providers/static.js +0 -164
- package/dist/lib/vfs/providers/static.js.map +0 -1
- package/dist/lib/vfs/providers/static_content.d.ts +0 -27
- package/dist/lib/vfs/providers/static_content.js +0 -180
- package/dist/lib/vfs/providers/static_content.js.map +0 -1
- package/dist/lib/vfs/vfs.d.ts +0 -59
- package/dist/lib/vfs/vfs.js +0 -202
- package/dist/lib/vfs/vfs.js.map +0 -1
- package/dist/remote/discovery.d.ts +0 -23
- package/dist/remote/discovery.js +0 -55
- package/dist/remote/discovery.js.map +0 -1
- package/dist/session/index.d.ts +0 -76
- package/dist/session/index.js +0 -120
- package/dist/session/index.js.map +0 -1
package/dist/lib/parser.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Command line argument tokenizer.
|
|
3
|
-
*
|
|
4
|
-
* Splits a command line into tokens while respecting single/double quotes
|
|
5
|
-
* and backslash escapes. Quotes are stripped from the resulting tokens.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Tokenizes a command line preserving quoted segments with spaces.
|
|
9
|
-
*
|
|
10
|
-
* @param line - Raw command line input.
|
|
11
|
-
* @returns Array of tokens with quotes removed.
|
|
12
|
-
*/
|
|
13
|
-
export function args_tokenize(line) {
|
|
14
|
-
const tokens = [];
|
|
15
|
-
let current = '';
|
|
16
|
-
let inSingle = false;
|
|
17
|
-
let inDouble = false;
|
|
18
|
-
let escapeNext = false;
|
|
19
|
-
for (let i = 0; i < line.length; i++) {
|
|
20
|
-
const char = line[i];
|
|
21
|
-
if (escapeNext) {
|
|
22
|
-
current += char;
|
|
23
|
-
escapeNext = false;
|
|
24
|
-
continue;
|
|
25
|
-
}
|
|
26
|
-
if (char === '\\') {
|
|
27
|
-
escapeNext = true;
|
|
28
|
-
continue;
|
|
29
|
-
}
|
|
30
|
-
if (char === "'" && !inDouble) {
|
|
31
|
-
inSingle = !inSingle;
|
|
32
|
-
continue;
|
|
33
|
-
}
|
|
34
|
-
if (char === '"' && !inSingle) {
|
|
35
|
-
inDouble = !inDouble;
|
|
36
|
-
continue;
|
|
37
|
-
}
|
|
38
|
-
if (!inSingle && !inDouble && /\s/.test(char)) {
|
|
39
|
-
if (current.length > 0) {
|
|
40
|
-
tokens.push(current);
|
|
41
|
-
current = '';
|
|
42
|
-
}
|
|
43
|
-
continue;
|
|
44
|
-
}
|
|
45
|
-
current += char;
|
|
46
|
-
}
|
|
47
|
-
if (current.length > 0) {
|
|
48
|
-
tokens.push(current);
|
|
49
|
-
}
|
|
50
|
-
return tokens;
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=parser.js.map
|
package/dist/lib/parser.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/lib/parser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,OAAO,GAAW,EAAE,CAAC;IACzB,IAAI,QAAQ,GAAY,KAAK,CAAC;IAC9B,IAA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ell command and captures its stdout.
|
|
3
|
-
*
|
|
4
|
-
* Writes the input to the child's stdin with drain-aware backpressure handling,
|
|
5
|
-
* tolerates early-close EPIPE, and rejects on non-zero exit or spawn error.
|
|
6
|
-
*
|
|
7
|
-
* @param segment - The shell command to run (executed with `shell: true`).
|
|
8
|
-
* @param input - The data to write to the command's stdin.
|
|
9
|
-
* @returns The command's captured stdout.
|
|
10
|
-
*/
|
|
11
|
-
export declare function segment_pipeThrough(segment: string, input: Buffer): Promise<Buffer>;
|
package/dist/lib/pipe.js
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Process piping helper for shell command chains.
|
|
3
|
-
*
|
|
4
|
-
* Spawns a single shell segment, feeds it an input buffer (with backpressure
|
|
5
|
-
* handling), and resolves with its captured stdout.
|
|
6
|
-
*
|
|
7
|
-
* @module
|
|
8
|
-
*/
|
|
9
|
-
import { spawn } from 'child_process';
|
|
10
|
-
/**
|
|
11
|
-
* Pipes an input buffer through a spawned shell command and captures its stdout.
|
|
12
|
-
*
|
|
13
|
-
* Writes the input to the child's stdin with drain-aware backpressure handling,
|
|
14
|
-
* tolerates early-close EPIPE, and rejects on non-zero exit or spawn error.
|
|
15
|
-
*
|
|
16
|
-
* @param segment - The shell command to run (executed with `shell: true`).
|
|
17
|
-
* @param input - The data to write to the command's stdin.
|
|
18
|
-
* @returns The command's captured stdout.
|
|
19
|
-
*/
|
|
20
|
-
export function segment_pipeThrough(segment, input) {
|
|
21
|
-
return new Promise((resolve, reject) => {
|
|
22
|
-
const chunks = [];
|
|
23
|
-
// When using shell: true, pass the entire command as a single string
|
|
24
|
-
const child = spawn(segment, {
|
|
25
|
-
stdio: ['pipe', 'pipe', 'inherit'],
|
|
26
|
-
shell: true,
|
|
27
|
-
});
|
|
28
|
-
child.stdout.on('data', (chunk) => {
|
|
29
|
-
chunks.push(chunk);
|
|
30
|
-
});
|
|
31
|
-
child.on('close', (code) => {
|
|
32
|
-
if (code !== 0 && code !== null) {
|
|
33
|
-
reject(new Error(`Command '${segment}' exited with code ${code}`));
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
resolve(Buffer.concat(chunks));
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
child.on('error', (err) => {
|
|
40
|
-
reject(err);
|
|
41
|
-
});
|
|
42
|
-
// Handle EPIPE errors when child closes stdin early
|
|
43
|
-
child.stdin.on('error', (err) => {
|
|
44
|
-
if (err.code === 'EPIPE') {
|
|
45
|
-
// Child closed stdin, this is normal if it exits early — handled by 'close'.
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
reject(err);
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
/**
|
|
52
|
-
* Writes all buffered data to child stdin with backpressure handling.
|
|
53
|
-
* Splits large buffers into chunks and waits for drain events when needed.
|
|
54
|
-
*/
|
|
55
|
-
const data_writeAll = async () => {
|
|
56
|
-
if (input.length === 0) {
|
|
57
|
-
child.stdin.end();
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
return new Promise((resolveWrite, rejectWrite) => {
|
|
61
|
-
let offset = 0;
|
|
62
|
-
const chunkSize = 64 * 1024; // 64KB chunks
|
|
63
|
-
const chunk_writeNext = () => {
|
|
64
|
-
try {
|
|
65
|
-
while (offset < input.length) {
|
|
66
|
-
const end = Math.min(offset + chunkSize, input.length);
|
|
67
|
-
const chunk = input.subarray(offset, end);
|
|
68
|
-
offset = end;
|
|
69
|
-
const canContinue = child.stdin.write(chunk);
|
|
70
|
-
if (!canContinue) {
|
|
71
|
-
child.stdin.once('drain', chunk_writeNext);
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
child.stdin.end();
|
|
76
|
-
resolveWrite();
|
|
77
|
-
}
|
|
78
|
-
catch (err) {
|
|
79
|
-
rejectWrite(err);
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
chunk_writeNext();
|
|
83
|
-
});
|
|
84
|
-
};
|
|
85
|
-
// Start writing in parallel with reading output; ignore write errors if the
|
|
86
|
-
// child already closed (EPIPE is handled by the stdin error handler).
|
|
87
|
-
data_writeAll().catch(() => { });
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
//# sourceMappingURL=pipe.js.map
|
package/dist/lib/pipe.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pipe.js","sourceRoot":"","sources":["../../src/lib/pipe.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,KAAK,EAAqB,MAAM,eAAe,CAAC;AAEzD;;;;;;;;;GASG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAe,EAAE,KAAa;IAChE,OAAO,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC7C,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,qEAAqE;QACrE,MAAM,KAAK,GAAiB,KAAK,CAAC,OAAO,EAAE;YACzC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC;YAClC,KAAK,EAAE,IAAI;SACZ,CAAC,CAAC;QAEH,KAAK,CAAC,MAAO,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAa,EAAE,EAAE;YACzC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC,CAAC,CAAC;QAEH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAmB,EAAE,EAAE;YACxC,IAAI,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;gBAChC,MAAM,CAAC,IAAI,KAAK,CAAC,YAAY,OAAO,sBAAsB,IAAI,EAAE,CAAC,CAAC,CAAC;YACrE,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;YACjC,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,KAAK,CAAC,EAAE,C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gCAC5C,OAAO;4BACT,CAAC;wBACH,CAAC;wBACD,KAAK,CAAC,KAAM,CAAC,GAAG,EAAE,CAAC;wBACnB,YAAY,EAAE,CAAC;oBACjB,CAAC;oBAAC,OAAO,GAAY,EAAE,CAAC;wBACtB,WAAW,CAAC,GAAY,CAAC,CAAC;oBAC5B,CAAC;gBACH,CAAC,CAAC;gBAEF,eAAe,EAAE,CAAC;YACpB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;QAEF,4EAA4E;QAC5E,sEAAsE;QACtE,aAAa,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/lib/prefetch.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Outcome of a prefetch operation (counts and status).
|
|
3
|
-
*/
|
|
4
|
-
export interface PrefetchResult {
|
|
5
|
-
ok: boolean;
|
|
6
|
-
count?: number;
|
|
7
|
-
pipelineCount?: number;
|
|
8
|
-
message?: string;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Prefetch a VFS path into the list cache.
|
|
12
|
-
*
|
|
13
|
-
* @param target - Absolute VFS path to prefetch.
|
|
14
|
-
* @returns Count of items cached on success, error message on failure.
|
|
15
|
-
*/
|
|
16
|
-
export declare function prefetch_path(target: string): Promise<PrefetchResult>;
|
|
17
|
-
/**
|
|
18
|
-
* Run a prefetch action behind a spinner (interactive) or plain log (non-interactive).
|
|
19
|
-
*
|
|
20
|
-
* @param label - Short label shown in the spinner column (padded to 12 chars).
|
|
21
|
-
* @param message - Descriptive message shown next to the label.
|
|
22
|
-
* @param isInteractive - Whether the session is interactive (controls spinner vs plain log).
|
|
23
|
-
* @param action - Async work to run; returns a PrefetchResult.
|
|
24
|
-
*/
|
|
25
|
-
export declare function prefetch_withSpinner(label: string, message: string, isInteractive: boolean, action: () => Promise<PrefetchResult>): Promise<PrefetchResult>;
|
package/dist/lib/prefetch.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Boot-time prefetch helpers for warming the VFS cache.
|
|
3
|
-
*
|
|
4
|
-
* Extracted from chell_start() to keep that fn focused on orchestration.
|
|
5
|
-
* All functions are pure top-level — no closure over session state.
|
|
6
|
-
*
|
|
7
|
-
* @module
|
|
8
|
-
*/
|
|
9
|
-
import { errorStack } from '@fnndsc/cumin';
|
|
10
|
-
import { vfs } from './vfs/vfs.js';
|
|
11
|
-
import { spinner } from './spinner.js';
|
|
12
|
-
import { error_stripDebugPrefix } from '../builtins/index.js';
|
|
13
|
-
/**
|
|
14
|
-
* Prefetch a VFS path into the list cache.
|
|
15
|
-
*
|
|
16
|
-
* @param target - Absolute VFS path to prefetch.
|
|
17
|
-
* @returns Count of items cached on success, error message on failure.
|
|
18
|
-
*/
|
|
19
|
-
export async function prefetch_path(target) {
|
|
20
|
-
try {
|
|
21
|
-
const result = await vfs.data_get(target);
|
|
22
|
-
if (result.ok) {
|
|
23
|
-
return { ok: true, count: result.value.length };
|
|
24
|
-
}
|
|
25
|
-
const err = errorStack.stack_pop();
|
|
26
|
-
return { ok: false, message: err ? error_stripDebugPrefix(err.message) : `Prefetch failed for ${target}` };
|
|
27
|
-
}
|
|
28
|
-
catch (e) {
|
|
29
|
-
const msg = e instanceof Error ? e.message : String(e);
|
|
30
|
-
return { ok: false, message: msg };
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Run a prefetch action behind a spinner (interactive) or plain log (non-interactive).
|
|
35
|
-
*
|
|
36
|
-
* @param label - Short label shown in the spinner column (padded to 12 chars).
|
|
37
|
-
* @param message - Descriptive message shown next to the label.
|
|
38
|
-
* @param isInteractive - Whether the session is interactive (controls spinner vs plain log).
|
|
39
|
-
* @param action - Async work to run; returns a PrefetchResult.
|
|
40
|
-
*/
|
|
41
|
-
export async function prefetch_withSpinner(label, message, isInteractive, action) {
|
|
42
|
-
const paddedLabel = label.padEnd(12);
|
|
43
|
-
// Spinner adds its own glyph and a following space. Pad so the label column
|
|
44
|
-
// aligns with the fixed-width status logs (e.g., "[ OK ] " = 7 chars).
|
|
45
|
-
const spinnerPrefix = ' '.repeat(5); // 1 glyph + 1 space + 5 = 7
|
|
46
|
-
const spinnerMessage = `${spinnerPrefix}${paddedLabel} ${message}`;
|
|
47
|
-
const showSpinner = isInteractive && process.stdout.isTTY;
|
|
48
|
-
if (showSpinner) {
|
|
49
|
-
spinner.start(spinnerMessage, true);
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
console.log(spinnerMessage);
|
|
53
|
-
}
|
|
54
|
-
try {
|
|
55
|
-
return await action();
|
|
56
|
-
}
|
|
57
|
-
finally {
|
|
58
|
-
if (showSpinner) {
|
|
59
|
-
spinner.stop();
|
|
60
|
-
process.stdout.write('\r\x1b[K');
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
//# sourceMappingURL=prefetch.js.map
|
package/dist/lib/prefetch.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prefetch.js","sourceRoot":"","sources":["../../src/lib/prefetch.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAY9D;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,MAAc;IAChD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC1C,IAAI,MAAM,CAAC,EAAE,EAAE,CAAC;YACd,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,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AW,EAAE,CAAC;YAChB,OAAO,CAAC,IAAI,EAAE,CAAC;YACf,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Semicolon command parser
|
|
3
|
-
*
|
|
4
|
-
* Parses semicolon-separated commands while respecting quotes.
|
|
5
|
-
*
|
|
6
|
-
* @module
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Parses a command line for semicolon separators and returns individual commands.
|
|
10
|
-
* Respects quoted strings - semicolons inside quotes are not treated as separators.
|
|
11
|
-
*
|
|
12
|
-
* @param line - The full command line.
|
|
13
|
-
* @returns An array of individual commands.
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```typescript
|
|
17
|
-
* semicolons_parse("ls; pwd") // Returns: ["ls", "pwd"]
|
|
18
|
-
* semicolons_parse("echo 'a;b'; pwd") // Returns: ["echo 'a;b'", "pwd"]
|
|
19
|
-
* semicolons_parse("cd /tmp; ls; cat file.txt") // Returns: ["cd /tmp", "ls", "cat file.txt"]
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
export declare function semicolons_parse(line: string): string[];
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Semicolon command parser
|
|
3
|
-
*
|
|
4
|
-
* Parses semicolon-separated commands while respecting quotes.
|
|
5
|
-
*
|
|
6
|
-
* @module
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Parses a command line for semicolon separators and returns individual commands.
|
|
10
|
-
* Respects quoted strings - semicolons inside quotes are not treated as separators.
|
|
11
|
-
*
|
|
12
|
-
* @param line - The full command line.
|
|
13
|
-
* @returns An array of individual commands.
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```typescript
|
|
17
|
-
* semicolons_parse("ls; pwd") // Returns: ["ls", "pwd"]
|
|
18
|
-
* semicolons_parse("echo 'a;b'; pwd") // Returns: ["echo 'a;b'", "pwd"]
|
|
19
|
-
* semicolons_parse("cd /tmp; ls; cat file.txt") // Returns: ["cd /tmp", "ls", "cat file.txt"]
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
export function semicolons_parse(line) {
|
|
23
|
-
const commands = [];
|
|
24
|
-
let currentCommand = '';
|
|
25
|
-
let inSingleQuote = false;
|
|
26
|
-
let inDoubleQuote = false;
|
|
27
|
-
for (let i = 0; i < line.length; i++) {
|
|
28
|
-
const char = line[i];
|
|
29
|
-
if (char === "'" && !inDoubleQuote) {
|
|
30
|
-
inSingleQuote = !inSingleQuote;
|
|
31
|
-
currentCommand += char;
|
|
32
|
-
}
|
|
33
|
-
else if (char === '"' && !inSingleQuote) {
|
|
34
|
-
inDoubleQuote = !inDoubleQuote;
|
|
35
|
-
currentCommand += char;
|
|
36
|
-
}
|
|
37
|
-
else if (char === ';' && !inSingleQuote && !inDoubleQuote) {
|
|
38
|
-
const trimmed = currentCommand.trim();
|
|
39
|
-
if (trimmed)
|
|
40
|
-
commands.push(trimmed);
|
|
41
|
-
currentCommand = '';
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
currentCommand += char;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
// Add final command
|
|
48
|
-
const trimmed = currentCommand.trim();
|
|
49
|
-
if (trimmed)
|
|
50
|
-
commands.push(trimmed);
|
|
51
|
-
return commands;
|
|
52
|
-
}
|
|
53
|
-
//# sourceMappingURL=semicolonParser.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"semicolonParser.js","sourceRoot":"","sources":["../../src/lib/semicolonParser.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,IAAI,cAAc,GAAW,EAAE,CAAC;IAChC,IAAI,aAAa,GAAY,KAAK,CAAC;IACnC,IAAI,aAAa,GAAY,KAAK,CAAC;IAEnC,KAAK,IAAI,CAAC,GAAW,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC7C,MAAM,IAAI,GAAW,IAAI,CAAC,CAAC,CAAC,CAAC;QAE7B,IAAI,IAAI,KAAK,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;YACnC,aAAa,GAAG,CAAC,aAAa,CAAC;YAC/B,cAAc,IAAI,IAAI,CAAC;QACzB,CAAC;aAAM,IAAI,IAAI,KAAK,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;YAC1C,aAAa,GAAG,CAAC,aAAa,CAAC;YAC/B,cAAc,IAAI,IAAI,CAAC;QACzB,CAAC;aAAM,IAAI,IAAI,KAAK,GAAG,IAAI,CAAC,aAAa,IAAI,CAAC,aAAa,EAAE,CAAC;YAC5D,MAAM,OAAO,GAAW,cAAc,CAAC,IAAI,EAAE,CAAC;YAC9C,IAAI,OAAO;gBAAE,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACpC,cAAc,GAAG,EAAE,CAAC;QACtB,CAAC;aAAM,CAAC;YACN,cAAc,IAAI,IAAI,CAAC;QACzB,CAAC;IACH,CAAC;IAED,oBAAoB;IACpB,MAAM,OAAO,GAAW,cAAc,CAAC,IAAI,EAAE,CAAC;IAC9C,IAAI,OAAO;QAAE,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAEpC,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/lib/spinner.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Terminal spinner utility for long-running operations.
|
|
3
|
-
*
|
|
4
|
-
* @module
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Terminal spinner indicating progress of async work.
|
|
8
|
-
*/
|
|
9
|
-
export declare class Spinner {
|
|
10
|
-
private interval;
|
|
11
|
-
private message;
|
|
12
|
-
private frames;
|
|
13
|
-
private frameIndex;
|
|
14
|
-
private spinnerActive;
|
|
15
|
-
private startTime;
|
|
16
|
-
private showTiming;
|
|
17
|
-
constructor(initialMessage?: string);
|
|
18
|
-
start(message?: string, showTiming?: boolean): void;
|
|
19
|
-
stop(clearLine?: boolean): void;
|
|
20
|
-
updateMessage(newMessage: string): void;
|
|
21
|
-
}
|
|
22
|
-
declare const globalSpinner: Spinner;
|
|
23
|
-
export { globalSpinner as spinner };
|
package/dist/lib/spinner.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Terminal spinner utility for long-running operations.
|
|
3
|
-
*
|
|
4
|
-
* @module
|
|
5
|
-
*/
|
|
6
|
-
import chalk from 'chalk';
|
|
7
|
-
import { sink_get } from '../core/sink.js';
|
|
8
|
-
/**
|
|
9
|
-
* Terminal spinner indicating progress of async work.
|
|
10
|
-
*/
|
|
11
|
-
export class Spinner {
|
|
12
|
-
interval = null;
|
|
13
|
-
message = '';
|
|
14
|
-
frames = ["⣾", "⣽", "⣻", "⢿", "⡿", "⣟", "⣯", "⣷"];
|
|
15
|
-
frameIndex = 0;
|
|
16
|
-
spinnerActive = false;
|
|
17
|
-
startTime = 0;
|
|
18
|
-
showTiming = false;
|
|
19
|
-
constructor(initialMessage = 'Loading...') {
|
|
20
|
-
this.message = initialMessage;
|
|
21
|
-
}
|
|
22
|
-
start(message, showTiming = false) {
|
|
23
|
-
// Do not start spinner if not in a TTY (e.g. piped output)
|
|
24
|
-
if (!process.stdout.isTTY) {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
if (this.spinnerActive) {
|
|
28
|
-
this.stop(); // Stop any existing spinner
|
|
29
|
-
}
|
|
30
|
-
this.message = message || this.message;
|
|
31
|
-
this.spinnerActive = true;
|
|
32
|
-
this.frameIndex = 0;
|
|
33
|
-
this.showTiming = showTiming;
|
|
34
|
-
this.startTime = Date.now();
|
|
35
|
-
// Hide cursor
|
|
36
|
-
sink_get().status_write('\x1B[?25l');
|
|
37
|
-
this.interval = setInterval(() => {
|
|
38
|
-
const frame = this.frames[this.frameIndex = (this.frameIndex + 1) % this.frames.length];
|
|
39
|
-
let displayMessage = this.message;
|
|
40
|
-
// Add timing if enabled
|
|
41
|
-
if (this.showTiming) {
|
|
42
|
-
const elapsedSeconds = ((Date.now() - this.startTime) / 1000).toFixed(1);
|
|
43
|
-
displayMessage = `${this.message} (${elapsedSeconds}s)`;
|
|
44
|
-
}
|
|
45
|
-
// Note: We use chalk.gray for the message to match the existing "Fetching..." style.
|
|
46
|
-
// \x1b[K erases to end-of-line so a shorter message never leaves the
|
|
47
|
-
// tail of a longer previous one behind.
|
|
48
|
-
sink_get().status_write(`\r\x1b[K${chalk.bgBlack.cyanBright.bold(frame)} ${chalk.gray(displayMessage)}`);
|
|
49
|
-
}, 80);
|
|
50
|
-
}
|
|
51
|
-
stop(clearLine = true) {
|
|
52
|
-
if (this.interval) {
|
|
53
|
-
clearInterval(this.interval);
|
|
54
|
-
this.interval = null;
|
|
55
|
-
}
|
|
56
|
-
if (this.spinnerActive) {
|
|
57
|
-
if (clearLine) {
|
|
58
|
-
sink_get().status_write('\r\x1b[K'); // Clear line
|
|
59
|
-
}
|
|
60
|
-
// Show cursor
|
|
61
|
-
sink_get().status_write('\x1B[?25h');
|
|
62
|
-
this.spinnerActive = false;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
updateMessage(newMessage) {
|
|
66
|
-
this.message = newMessage;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
const globalSpinner = new Spinner();
|
|
70
|
-
export { globalSpinner as spinner };
|
|
71
|
-
//# sourceMappingURL=spinner.js.map
|
package/dist/lib/spinner.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spinner.js","sourceRoot":"","sources":["../../src/lib/spinner.ts"],"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;CACF;AAED,MAAM,aAAa,GAAY,IAAI,OAAO,EAAE,CAAC;AAC7C,OAAO,EAAE,aAAa,IAAI,OAAO,EAAE,CAAC"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Static Virtual File System Provider.
|
|
3
|
-
*
|
|
4
|
-
* Implements virtual directories for `/bin`, `/usr`, and `/usr/bin` under the VFSDispatcher.
|
|
5
|
-
*
|
|
6
|
-
* @module
|
|
7
|
-
*/
|
|
8
|
-
import { Result } from '@fnndsc/cumin';
|
|
9
|
-
import { VFSProvider, VFSItem, CpOptions } from '@fnndsc/salsa';
|
|
10
|
-
/**
|
|
11
|
-
* Static virtual filesystem provider for command and builtin paths.
|
|
12
|
-
*/
|
|
13
|
-
export declare class StaticVfsProvider implements VFSProvider {
|
|
14
|
-
/** The prefix path this provider handles. */
|
|
15
|
-
prefix: string;
|
|
16
|
-
/**
|
|
17
|
-
* Initializes the static provider with its target prefix path.
|
|
18
|
-
*
|
|
19
|
-
* @param prefix - The absolute virtual directory prefix.
|
|
20
|
-
*/
|
|
21
|
-
constructor(prefix: string);
|
|
22
|
-
/**
|
|
23
|
-
* Lists the contents of the matched static prefix path.
|
|
24
|
-
*
|
|
25
|
-
* @param pathStr - The absolute path.
|
|
26
|
-
* @param options - Sort controls.
|
|
27
|
-
* @returns Promise resolving to Result of VFSItems.
|
|
28
|
-
*/
|
|
29
|
-
list(pathStr: string, options?: {
|
|
30
|
-
sort?: "name" | "size" | "date" | "owner";
|
|
31
|
-
reverse?: boolean;
|
|
32
|
-
}): Promise<Result<VFSItem[]>>;
|
|
33
|
-
/**
|
|
34
|
-
* Block copy operations for static paths.
|
|
35
|
-
*
|
|
36
|
-
* @param src - Source path.
|
|
37
|
-
* @param dest - Destination path.
|
|
38
|
-
* @param options - Copy options.
|
|
39
|
-
* @returns Promise resolving to false always to block copying.
|
|
40
|
-
*/
|
|
41
|
-
cp(src: string, dest: string, options: CpOptions): Promise<boolean>;
|
|
42
|
-
/**
|
|
43
|
-
* Standard sort helper for virtual items.
|
|
44
|
-
*
|
|
45
|
-
* @param items - The VFSItem array to sort.
|
|
46
|
-
* @param sortField - Field to sort by.
|
|
47
|
-
* @param reverse - True to reverse output sorting.
|
|
48
|
-
* @returns Sorted VFSItem array.
|
|
49
|
-
*/
|
|
50
|
-
private staticVfsItems_sort;
|
|
51
|
-
/**
|
|
52
|
-
* Reads virtual file content under command and builtin static paths.
|
|
53
|
-
*
|
|
54
|
-
* @param pathStr - The absolute virtual path of the file to read.
|
|
55
|
-
* @returns Promise resolving to a Result containing the file contents.
|
|
56
|
-
*/
|
|
57
|
-
read(pathStr: string): Promise<Result<string>>;
|
|
58
|
-
/**
|
|
59
|
-
* Reads virtual file binary content under command and builtin static paths.
|
|
60
|
-
*
|
|
61
|
-
* @param pathStr - The absolute virtual path of the file to read.
|
|
62
|
-
* @returns Promise resolving to a Result containing the file contents as a Buffer.
|
|
63
|
-
*/
|
|
64
|
-
readBinary(pathStr: string): Promise<Result<Buffer>>;
|
|
65
|
-
}
|