@fnndsc/brasa 0.9.1 → 0.10.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.
- package/dist/buildinfo.json +1 -0
- package/dist/builtins/argumentTokens.d.ts +18 -0
- package/dist/builtins/argumentTokens.js +58 -0
- package/dist/builtins/argumentTokens.js.map +1 -0
- package/dist/builtins/executable.d.ts +3 -7
- package/dist/builtins/executable.js +32 -29
- package/dist/builtins/executable.js.map +1 -1
- package/dist/builtins/feedCreation.d.ts +23 -0
- package/dist/builtins/feedCreation.js +45 -0
- package/dist/builtins/feedCreation.js.map +1 -0
- package/dist/builtins/fs/cat.args.d.ts +36 -0
- package/dist/builtins/fs/cat.args.js +63 -0
- package/dist/builtins/fs/cat.args.js.map +1 -0
- package/dist/builtins/fs/cat.d.ts +2 -2
- package/dist/builtins/fs/cat.js +222 -101
- package/dist/builtins/fs/cat.js.map +1 -1
- package/dist/builtins/fs/cd.js +42 -6
- package/dist/builtins/fs/cd.js.map +1 -1
- package/dist/builtins/fs/cp.js +3 -2
- package/dist/builtins/fs/cp.js.map +1 -1
- package/dist/builtins/fs/download.d.ts +1 -1
- package/dist/builtins/fs/download.js +52 -13
- package/dist/builtins/fs/download.js.map +1 -1
- package/dist/builtins/fs/du.js +15 -1
- package/dist/builtins/fs/du.js.map +1 -1
- package/dist/builtins/fs/ls.js +10 -1
- package/dist/builtins/fs/ls.js.map +1 -1
- package/dist/builtins/fs/mv.js +7 -3
- package/dist/builtins/fs/mv.js.map +1 -1
- package/dist/builtins/fs/pull.args.d.ts +14 -1
- package/dist/builtins/fs/pull.args.js +72 -9
- package/dist/builtins/fs/pull.args.js.map +1 -1
- package/dist/builtins/fs/pull.d.ts +1 -0
- package/dist/builtins/fs/pull.js +191 -259
- package/dist/builtins/fs/pull.js.map +1 -1
- package/dist/builtins/fs/rm.js +4 -0
- package/dist/builtins/fs/rm.js.map +1 -1
- package/dist/builtins/fs/tree.js +7 -3
- package/dist/builtins/fs/tree.js.map +1 -1
- package/dist/builtins/fs/upload.js +29 -2
- package/dist/builtins/fs/upload.js.map +1 -1
- package/dist/builtins/help.d.ts +7 -0
- package/dist/builtins/help.js +148 -38
- package/dist/builtins/help.js.map +1 -1
- package/dist/builtins/index.d.ts +1 -0
- package/dist/builtins/index.js +1 -0
- package/dist/builtins/index.js.map +1 -1
- package/dist/builtins/net/pacs.d.ts +1 -0
- package/dist/builtins/net/pacs.js +5 -1
- package/dist/builtins/net/pacs.js.map +1 -1
- package/dist/builtins/net/pacsUtils.d.ts +5 -4
- package/dist/builtins/net/pacsUtils.js +12 -32
- package/dist/builtins/net/pacsUtils.js.map +1 -1
- package/dist/builtins/net/query.js +4 -1
- package/dist/builtins/net/query.js.map +1 -1
- package/dist/builtins/net/status.d.ts +14 -0
- package/dist/builtins/net/status.js +210 -0
- package/dist/builtins/net/status.js.map +1 -0
- package/dist/builtins/pluginExecute.d.ts +3 -2
- package/dist/builtins/pluginExecute.js +41 -69
- package/dist/builtins/pluginExecute.js.map +1 -1
- package/dist/builtins/pluginSelector.d.ts +15 -0
- package/dist/builtins/pluginSelector.js +21 -0
- package/dist/builtins/pluginSelector.js.map +1 -0
- package/dist/builtins/proc.js +193 -10
- package/dist/builtins/proc.js.map +1 -1
- package/dist/builtins/res/compute.js +8 -3
- package/dist/builtins/res/compute.js.map +1 -1
- package/dist/builtins/res/group.d.ts +1 -1
- package/dist/builtins/res/group.js +122 -5
- package/dist/builtins/res/group.js.map +1 -1
- package/dist/builtins/res/pipeline.args.d.ts +4 -0
- package/dist/builtins/res/pipeline.args.js +63 -12
- package/dist/builtins/res/pipeline.args.js.map +1 -1
- package/dist/builtins/res/pipeline.d.ts +3 -1
- package/dist/builtins/res/pipeline.js +155 -60
- package/dist/builtins/res/pipeline.js.map +1 -1
- package/dist/builtins/res/pipeline.manifest.d.ts +15 -0
- package/dist/builtins/res/pipeline.manifest.js +93 -0
- package/dist/builtins/res/pipeline.manifest.js.map +1 -0
- package/dist/builtins/res/plugin.js +14 -7
- package/dist/builtins/res/plugin.js.map +1 -1
- package/dist/builtins/res/user.d.ts +8 -0
- package/dist/builtins/res/user.js +87 -0
- package/dist/builtins/res/user.js.map +1 -0
- package/dist/builtins/store.js +24 -3
- package/dist/builtins/store.js.map +1 -1
- package/dist/builtins/sys/fortune.d.ts +9 -0
- package/dist/builtins/sys/fortune.js +16 -1
- package/dist/builtins/sys/fortune.js.map +1 -1
- package/dist/builtins/sys/whoami.d.ts +13 -1
- package/dist/builtins/sys/whoami.js +47 -2
- package/dist/builtins/sys/whoami.js.map +1 -1
- package/dist/builtins/utils.d.ts +14 -1
- package/dist/builtins/utils.js +13 -3
- package/dist/builtins/utils.js.map +1 -1
- package/dist/builtins/wildcard.d.ts +31 -0
- package/dist/builtins/wildcard.js +112 -50
- package/dist/builtins/wildcard.js.map +1 -1
- package/dist/command-keys.js +2 -1
- package/dist/command-keys.js.map +1 -1
- package/dist/core/cancellation.d.ts +28 -0
- package/dist/core/cancellation.js +70 -0
- package/dist/core/cancellation.js.map +1 -0
- package/dist/core/dispatch.d.ts +1 -8
- package/dist/core/dispatch.js +82 -82
- package/dist/core/dispatch.js.map +1 -1
- package/dist/core/elevation.d.ts +35 -0
- package/dist/core/elevation.js +77 -0
- package/dist/core/elevation.js.map +1 -0
- package/dist/core/engine.d.ts +12 -0
- package/dist/core/engine.js +35 -8
- package/dist/core/engine.js.map +1 -1
- package/dist/core/preprocess.d.ts +11 -4
- package/dist/core/preprocess.js +43 -10
- package/dist/core/preprocess.js.map +1 -1
- package/dist/core/progress.d.ts +15 -5
- package/dist/core/progress.js +14 -0
- package/dist/core/progress.js.map +1 -1
- package/dist/core/promptContext.d.ts +3 -4
- package/dist/core/promptContext.js +9 -2
- package/dist/core/promptContext.js.map +1 -1
- package/dist/core/sink.d.ts +9 -0
- package/dist/core/sink.js +23 -3
- package/dist/core/sink.js.map +1 -1
- package/dist/core/surface.d.ts +14 -0
- package/dist/core/surface.js +5 -0
- package/dist/core/surface.js.map +1 -1
- package/dist/core/version.d.ts +34 -0
- package/dist/core/version.js +51 -0
- package/dist/core/version.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/completer/index.js +39 -1
- package/dist/lib/completer/index.js.map +1 -1
- package/dist/lib/parser.d.ts +75 -2
- package/dist/lib/parser.js +158 -15
- package/dist/lib/parser.js.map +1 -1
- package/dist/lib/vfs/providers/binEntry.d.ts +20 -0
- package/dist/lib/vfs/providers/binEntry.js +47 -0
- package/dist/lib/vfs/providers/binEntry.js.map +1 -0
- package/dist/lib/vfs/providers/static.js +1 -0
- package/dist/lib/vfs/providers/static.js.map +1 -1
- package/dist/lib/vfs/providers/static_content.js +5 -36
- package/dist/lib/vfs/providers/static_content.js.map +1 -1
- package/dist/lib/vfs/vfs.d.ts +7 -0
- package/dist/lib/vfs/vfs.js +25 -0
- package/dist/lib/vfs/vfs.js.map +1 -1
- package/dist/session/index.d.ts +18 -0
- package/dist/session/index.js +29 -1
- package/dist/session/index.js.map +1 -1
- package/package.json +10 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"hash":"858de5"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Shared token-preserving parsing for executable options.
|
|
3
|
+
*
|
|
4
|
+
* Plugin execution, PACS attachment, and pipeline bindings use this module so
|
|
5
|
+
* quoted values and scalar coercion remain identical across command surfaces.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
/** Parsed executable option names and their scalar values. */
|
|
10
|
+
export type ExecutableArguments = Record<string, string | boolean | number>;
|
|
11
|
+
/**
|
|
12
|
+
* Parse already-tokenized options and context assignments.
|
|
13
|
+
*
|
|
14
|
+
* @param tokens - `--name value`, `--name=value`, or bare `name=value` tokens.
|
|
15
|
+
* @returns Dictionary containing scalar-coerced option values.
|
|
16
|
+
* @throws {Error} When a token is not an option or assignment.
|
|
17
|
+
*/
|
|
18
|
+
export declare function executableArguments_parse(tokens: readonly string[]): ExecutableArguments;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Shared token-preserving parsing for executable options.
|
|
3
|
+
*
|
|
4
|
+
* Plugin execution, PACS attachment, and pipeline bindings use this module so
|
|
5
|
+
* quoted values and scalar coercion remain identical across command surfaces.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
function argumentValue_parse(value) {
|
|
10
|
+
if (value === 'true')
|
|
11
|
+
return true;
|
|
12
|
+
if (value === 'false')
|
|
13
|
+
return false;
|
|
14
|
+
if (value.trim() !== '') {
|
|
15
|
+
const numeric = Number(value);
|
|
16
|
+
if (!Number.isNaN(numeric))
|
|
17
|
+
return numeric;
|
|
18
|
+
}
|
|
19
|
+
return value;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Parse already-tokenized options and context assignments.
|
|
23
|
+
*
|
|
24
|
+
* @param tokens - `--name value`, `--name=value`, or bare `name=value` tokens.
|
|
25
|
+
* @returns Dictionary containing scalar-coerced option values.
|
|
26
|
+
* @throws {Error} When a token is not an option or assignment.
|
|
27
|
+
*/
|
|
28
|
+
export function executableArguments_parse(tokens) {
|
|
29
|
+
const result = {};
|
|
30
|
+
for (let index = 0; index < tokens.length; index++) {
|
|
31
|
+
const token = tokens[index];
|
|
32
|
+
const prefixed = token.startsWith('-') && token !== '-';
|
|
33
|
+
const bareAssignment = !prefixed && token.indexOf('=') > 0;
|
|
34
|
+
if (!prefixed && !bareAssignment)
|
|
35
|
+
throw new Error(`Unexpected value without an option: ${token}`);
|
|
36
|
+
const option = prefixed ? token.replace(/^-+/, '') : token;
|
|
37
|
+
const equalsIndex = option.indexOf('=');
|
|
38
|
+
if (equalsIndex >= 0) {
|
|
39
|
+
const name = option.slice(0, equalsIndex);
|
|
40
|
+
if (!name)
|
|
41
|
+
throw new Error(`Invalid option: ${token}`);
|
|
42
|
+
result[name] = argumentValue_parse(option.slice(equalsIndex + 1));
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
if (!option)
|
|
46
|
+
throw new Error(`Invalid option: ${token}`);
|
|
47
|
+
const next = tokens[index + 1];
|
|
48
|
+
if (next !== undefined && (!next.startsWith('-') || /^-\d/.test(next))) {
|
|
49
|
+
result[option] = argumentValue_parse(next);
|
|
50
|
+
index++;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
result[option] = true;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return result;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=argumentTokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"argumentTokens.js","sourceRoot":"","sources":["../../src/builtins/argumentTokens.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,SAAS,mBAAmB,CAAC,KAAa;IACxC,IAAI,KAAK,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC;IAClC,IAAI,KAAK,KAAK,OAAO;QAAE,OAAO,KAAK,CAAC;IACpC,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QACxB,MAAM,OAAO,GAAW,MAAM,CAAC,KAAK,CAAC,CAAC;QACtC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC;YAAE,OAAO,OAAO,CAAC;IAC7C,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,yBAAyB,CAAC,MAAyB;IACjE,MAAM,MAAM,GAAwB,EAAE,CAAC;IACvC,KAAK,IAAI,KAAK,GAAW,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;QAC3D,MAAM,KAAK,GAAW,MAAM,CAAC,KAAK,CAAC,CAAC;QACpC,MAAM,QAAQ,GAAY,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,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AC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
type
|
|
7
|
-
piped?: boolean;
|
|
8
|
-
};
|
|
6
|
+
import { type CommandEnvelope } from '@fnndsc/cumin';
|
|
9
7
|
/**
|
|
10
8
|
* Handles simulated execution of plugins (e.g., "pl-simpledsapp-v1.2.3 --parameters").
|
|
11
9
|
*
|
|
@@ -15,8 +13,6 @@ type PluginExecutableOptions = {
|
|
|
15
13
|
*
|
|
16
14
|
* @param command - The command string (potentially a plugin name).
|
|
17
15
|
* @param args - The arguments passed to the command.
|
|
18
|
-
* @
|
|
19
|
-
* @returns A Promise resolving to true if the command was handled as a plugin execution, false otherwise.
|
|
16
|
+
* @returns An envelope when the command was handled, or null otherwise.
|
|
20
17
|
*/
|
|
21
|
-
export declare function pluginExecutable_handle(command: string, args: string[]
|
|
22
|
-
export {};
|
|
18
|
+
export declare function pluginExecutable_handle(command: string, args: string[]): Promise<CommandEnvelope | null>;
|
|
@@ -8,6 +8,8 @@ import { spinner } from '../lib/spinner.js';
|
|
|
8
8
|
import { builtin_parametersofplugin } from './parametersofplugin.js';
|
|
9
9
|
import { plugins_list, plugins_listAll } from '@fnndsc/salsa';
|
|
10
10
|
import { pluginReadme_fetch, pluginReadme_render } from '@fnndsc/chili/commands/plugin/readme.js';
|
|
11
|
+
import { errorStack, envelope_ok } from '@fnndsc/cumin';
|
|
12
|
+
import { pluginExecutableHelp_render } from './help.js';
|
|
11
13
|
/**
|
|
12
14
|
* Handles simulated execution of plugins (e.g., "pl-simpledsapp-v1.2.3 --parameters").
|
|
13
15
|
*
|
|
@@ -17,28 +19,22 @@ import { pluginReadme_fetch, pluginReadme_render } from '@fnndsc/chili/commands/
|
|
|
17
19
|
*
|
|
18
20
|
* @param command - The command string (potentially a plugin name).
|
|
19
21
|
* @param args - The arguments passed to the command.
|
|
20
|
-
* @
|
|
21
|
-
* @returns A Promise resolving to true if the command was handled as a plugin execution, false otherwise.
|
|
22
|
+
* @returns An envelope when the command was handled, or null otherwise.
|
|
22
23
|
*/
|
|
23
|
-
export async function pluginExecutable_handle(command, args
|
|
24
|
+
export async function pluginExecutable_handle(command, args) {
|
|
24
25
|
// Expected format: name-vVersion (e.g., "pl-simpledsapp-v2.1.3")
|
|
25
26
|
const versionSeparatorIndex = command.lastIndexOf('-v');
|
|
26
27
|
if (versionSeparatorIndex === -1) {
|
|
27
|
-
return
|
|
28
|
+
return null;
|
|
28
29
|
}
|
|
29
30
|
const name = command.substring(0, versionSeparatorIndex);
|
|
30
31
|
const version = command.substring(versionSeparatorIndex + 2);
|
|
31
32
|
if (!name || !version) {
|
|
32
|
-
return
|
|
33
|
+
return null;
|
|
33
34
|
}
|
|
34
35
|
const showHelp = args.includes('--help') || args.includes('-h');
|
|
35
|
-
const isPipedOutput = !!options?.piped || !process.stdout.isTTY;
|
|
36
36
|
if (showHelp) {
|
|
37
|
-
|
|
38
|
-
console.log(' --parameters Show parameter definitions for this plugin version');
|
|
39
|
-
console.log(' --readme Show README (rendered) from plugin metadata repository URL');
|
|
40
|
-
console.log(' --readme --raw Output raw markdown, suitable for piping to glow or bat');
|
|
41
|
-
return true;
|
|
37
|
+
return envelope_ok(pluginExecutableHelp_render(command));
|
|
42
38
|
}
|
|
43
39
|
const plugin_resolveExact = async () => {
|
|
44
40
|
try {
|
|
@@ -66,50 +62,57 @@ export async function pluginExecutable_handle(command, args, options) {
|
|
|
66
62
|
return { id: candidate.id, name: candidate.name, version: candidate.version };
|
|
67
63
|
}
|
|
68
64
|
catch (error) {
|
|
69
|
-
|
|
65
|
+
errorStack.stack_push('error', `Error resolving plugin: ${error instanceof Error ? error.message : String(error)}`);
|
|
70
66
|
return null;
|
|
71
67
|
}
|
|
72
68
|
};
|
|
73
69
|
if (args.includes('--readme')) {
|
|
74
70
|
const rawMode = args.includes('--raw');
|
|
75
|
-
|
|
71
|
+
let rendered = rawMode
|
|
72
|
+
? ''
|
|
73
|
+
: `${chalk.cyan(`Resolving plugin ${name} v${version} for README...`)}\n`;
|
|
76
74
|
const resolved = await plugin_resolveExact();
|
|
77
75
|
if (!resolved) {
|
|
78
|
-
|
|
79
|
-
return
|
|
76
|
+
rendered += `${chalk.red(`Plugin ${name} v${version} not found.`)}\n`;
|
|
77
|
+
return envelope_ok(rendered);
|
|
80
78
|
}
|
|
81
79
|
spinner.start(`Fetching README for ${resolved.name} v${resolved.version}...`);
|
|
82
80
|
try {
|
|
83
|
-
const
|
|
81
|
+
const document = await pluginReadme_fetch(String(resolved.id));
|
|
84
82
|
spinner.stop();
|
|
85
|
-
if (
|
|
86
|
-
|
|
83
|
+
if (document) {
|
|
84
|
+
if (rawMode)
|
|
85
|
+
return envelope_ok(document.content);
|
|
86
|
+
const readme = pluginReadme_render(document);
|
|
87
|
+
rendered += readme.endsWith('\n') ? readme : `${readme}\n`;
|
|
87
88
|
}
|
|
88
89
|
else {
|
|
89
|
-
|
|
90
|
+
rendered += `${chalk.yellow(`No README found for ${resolved.name} v${resolved.version}.`)}\n`;
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
93
|
catch (error) {
|
|
93
94
|
spinner.stop();
|
|
94
95
|
const message = error instanceof Error ? error.message : String(error);
|
|
95
|
-
|
|
96
|
+
rendered += `${chalk.red(`Failed to fetch README: ${message}`)}\n`;
|
|
96
97
|
}
|
|
97
|
-
return
|
|
98
|
+
return envelope_ok(rendered);
|
|
98
99
|
}
|
|
99
100
|
if (args.includes('--parameters')) {
|
|
100
|
-
|
|
101
|
+
let rendered = `${chalk.cyan(`Fetching parameters for plugin ${name} v${version}...`)}\n`;
|
|
101
102
|
const resolved = await plugin_resolveExact();
|
|
102
103
|
if (!resolved) {
|
|
103
|
-
|
|
104
|
-
return
|
|
104
|
+
rendered += `${chalk.red(`Plugin ${name} v${version} not found.`)}\n`;
|
|
105
|
+
return envelope_ok(rendered);
|
|
105
106
|
}
|
|
106
|
-
|
|
107
|
+
rendered += `${chalk.cyan(`Resolved Plugin: ${resolved.name} v${resolved.version} (ID: ${resolved.id})`)}\n`;
|
|
107
108
|
// Delegate to parametersofplugin builtin with the resolved context
|
|
108
|
-
await builtin_parametersofplugin([
|
|
109
|
-
|
|
109
|
+
const parametersEnvelope = await builtin_parametersofplugin([
|
|
110
|
+
'list', '--plugin-id', String(resolved.id),
|
|
111
|
+
]);
|
|
112
|
+
return { ...parametersEnvelope, rendered: rendered + parametersEnvelope.rendered };
|
|
110
113
|
}
|
|
111
114
|
// If command matches plugin format but no handled flags are present,
|
|
112
|
-
// return
|
|
113
|
-
return
|
|
115
|
+
// return null to let the main loop handle it (or show unknown command).
|
|
116
|
+
return null;
|
|
114
117
|
}
|
|
115
118
|
//# sourceMappingURL=executable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executable.js","sourceRoot":"","sources":["../../src/builtins/executable.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"executable.js","sourceRoot":"","sources":["../../src/builtins/executable.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,eAAe,EAA6B,MAAM,eAAe,CAAC;AACzF,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAClG,OAAO,EAAE,UAAU,EAAwB,WAAW,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,E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C,CAAC;IAED,IAAI,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;QAChC,IAAI,QAAQ,GAAW,GAAG,KAAK,CAAC,IAAI,CAAC,kCAAkC,IAAI,KAAK,OAAO,KAAK,CAAC,IAAI,CAAC;QAClG,MAAM,QAAQ,GAA0B,MAAM,mBAAmB,EAAE,CAAC;QACpE,IAAI,CAAC,QAAQ,EAAE,CAAC;YACZ,QAAQ,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,UAAU,IAAI,KAAK,OAAO,aAAa,CAAC,IAAI,CAAC;YACtE,OAAO,WAAW,CAAC,QAAQ,CAAC,CAAC;QACjC,CAAC;QAED,QAAQ,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,oBAAoB,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC,OAAO,SAAS,QAAQ,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC;QAE7G,mEAAmE;QACnE,MAAM,kBAAkB,GAAoB,MAAM,0BAA0B,CAAC;YACzE,MAAM,EAAE,aAAa,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;SAC7C,CAAC,CAAC;QACH,OAAO,EAAE,GAAG,kBAAkB,EAAE,QAAQ,EAAE,QAAQ,GAAG,kBAAkB,CAAC,QAAQ,EAAE,CAAC;IACvF,CAAC;IAED,qEAAqE;IACrE,wEAAwE;IACxE,OAAO,IAAI,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Shared bookkeeping for newly created feeds.
|
|
3
|
+
* @module
|
|
4
|
+
*/
|
|
5
|
+
/** Optional child scheduled immediately below the pl-dircopy root. */
|
|
6
|
+
export interface NewFeedChild {
|
|
7
|
+
id: number;
|
|
8
|
+
pluginName: string;
|
|
9
|
+
}
|
|
10
|
+
/** Data needed to expose a newly created feed through `/proc` immediately. */
|
|
11
|
+
export interface NewFeedCacheEntry {
|
|
12
|
+
feedID: number;
|
|
13
|
+
title: string;
|
|
14
|
+
ownerUsername: string;
|
|
15
|
+
rootInstanceID: number;
|
|
16
|
+
child?: NewFeedChild;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Adds a new feed, its pl-dircopy root, and an optional child to ProcCache.
|
|
20
|
+
*
|
|
21
|
+
* @param entry - Stable feed/root identities plus optional scheduled child.
|
|
22
|
+
*/
|
|
23
|
+
export declare function newFeed_cacheAdd(entry: NewFeedCacheEntry): void;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Shared bookkeeping for newly created feeds.
|
|
3
|
+
* @module
|
|
4
|
+
*/
|
|
5
|
+
import { procCache_get } from '@fnndsc/cumin';
|
|
6
|
+
/**
|
|
7
|
+
* Adds a new feed, its pl-dircopy root, and an optional child to ProcCache.
|
|
8
|
+
*
|
|
9
|
+
* @param entry - Stable feed/root identities plus optional scheduled child.
|
|
10
|
+
*/
|
|
11
|
+
export function newFeed_cacheAdd(entry) {
|
|
12
|
+
const scheduledJobs = entry.child ? 2 : 1;
|
|
13
|
+
procCache_get().feed_add({
|
|
14
|
+
id: entry.feedID,
|
|
15
|
+
title: entry.title,
|
|
16
|
+
ownerUsername: entry.ownerUsername,
|
|
17
|
+
public: false,
|
|
18
|
+
creationDate: new Date().toISOString(),
|
|
19
|
+
finishedJobs: 0,
|
|
20
|
+
erroredJobs: 0,
|
|
21
|
+
startedJobs: 0,
|
|
22
|
+
scheduledJobs,
|
|
23
|
+
cancelledJobs: 0,
|
|
24
|
+
createdJobs: 0,
|
|
25
|
+
});
|
|
26
|
+
procCache_get().instance_add({
|
|
27
|
+
id: entry.rootInstanceID,
|
|
28
|
+
feedID: entry.feedID,
|
|
29
|
+
parentID: null,
|
|
30
|
+
pluginName: 'pl-dircopy',
|
|
31
|
+
params: null,
|
|
32
|
+
status: 'scheduled',
|
|
33
|
+
});
|
|
34
|
+
if (entry.child) {
|
|
35
|
+
procCache_get().instance_add({
|
|
36
|
+
id: entry.child.id,
|
|
37
|
+
feedID: entry.feedID,
|
|
38
|
+
parentID: entry.rootInstanceID,
|
|
39
|
+
pluginName: entry.child.pluginName,
|
|
40
|
+
params: null,
|
|
41
|
+
status: 'scheduled',
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=feedCreation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedCreation.js","sourceRoot":"","sources":["../../src/builtins/feedCreation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAiB9C;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAwB;IACvD,MAAM,aAAa,GAAW,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAClD,aAAa,EAAE,CAAC,QAAQ,CAAC;QACvB,EAAE,EAAE,KAAK,CAAC,MAAM;QAChB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,MAAM,EAAE,KAAK;QACb,YAAY,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACtC,YAAY,EAAE,CAAC;QACf,WAAW,EAAE,CAAC;QACd,WAAW,EAAE,CAAC;QACd,aAAa;QACb,aAAa,EAAE,CAAC;QAChB,WAAW,EAAE,CAAC;KACf,CAAC,CAAC;IACH,aAAa,EAAE,CAAC,YAAY,CAAC;QAC3B,EAAE,EAAE,KAAK,CAAC,cAAc;QACxB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,QAAQ,EAAE,IAAI;QACd,UAAU,EAAE,YAAY;QACxB,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,WAAW;KACpB,CAAC,CAAC;IACH,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;QAChB,aAAa,EAAE,CAAC,YAAY,CAAC;YAC3B,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE;YAClB,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,QAAQ,EAAE,KAAK,CAAC,cAAc;YAC9B,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,UAAU;YAClC,MAAM,EAAE,IAAI;YACZ,MAAM,EAAE,WAAW;SACpB,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Shared `cat` command-line grammar.
|
|
3
|
+
*
|
|
4
|
+
* Defines the typed result used by the builtin, the usage text shown in help
|
|
5
|
+
* and errors, and the option predicate used by redirect filename inference.
|
|
6
|
+
* This module is intentionally dependency-free so preprocessing can consume
|
|
7
|
+
* the grammar without loading the file reader or syntax highlighter.
|
|
8
|
+
*
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
/** Whether syntax highlighting follows TTY detection, is forced, or is disabled. */
|
|
12
|
+
export type CatHighlightMode = 'auto' | 'always' | 'never';
|
|
13
|
+
/** Parsed `cat` command-line arguments. */
|
|
14
|
+
export interface CatArguments {
|
|
15
|
+
binaryMode: boolean;
|
|
16
|
+
highlightMode: CatHighlightMode;
|
|
17
|
+
highlightLanguage?: string;
|
|
18
|
+
filePaths: string[];
|
|
19
|
+
}
|
|
20
|
+
/** Canonical usage shared by builtin errors and interactive help. */
|
|
21
|
+
export declare const CAT_USAGE: string;
|
|
22
|
+
/**
|
|
23
|
+
* Returns whether an argument belongs to the `cat` option grammar.
|
|
24
|
+
*
|
|
25
|
+
* @param argument - One token from the command line.
|
|
26
|
+
* @returns True for a recognized binary or highlight option.
|
|
27
|
+
*/
|
|
28
|
+
export declare function catArgument_isOption(argument: string): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Parses file paths and presentation options for the `cat` builtin.
|
|
31
|
+
* Later highlight flags take precedence over earlier highlight flags.
|
|
32
|
+
*
|
|
33
|
+
* @param args - Tokens following the `cat` command name.
|
|
34
|
+
* @returns Typed binary, highlighting, language, and file-path selections.
|
|
35
|
+
*/
|
|
36
|
+
export declare function catArguments_parse(args: string[]): CatArguments;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Shared `cat` command-line grammar.
|
|
3
|
+
*
|
|
4
|
+
* Defines the typed result used by the builtin, the usage text shown in help
|
|
5
|
+
* and errors, and the option predicate used by redirect filename inference.
|
|
6
|
+
* This module is intentionally dependency-free so preprocessing can consume
|
|
7
|
+
* the grammar without loading the file reader or syntax highlighter.
|
|
8
|
+
*
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
/** Canonical usage shared by builtin errors and interactive help. */
|
|
12
|
+
export const CAT_USAGE = 'cat [--binary] [--highlight[=language] | --no-highlight] <file> [file...]';
|
|
13
|
+
const BINARY_OPTION = '--binary';
|
|
14
|
+
const HIGHLIGHT_OPTION = '--highlight';
|
|
15
|
+
const HIGHLIGHT_LANGUAGE_PREFIX = '--highlight=';
|
|
16
|
+
const NO_HIGHLIGHT_OPTION = '--no-highlight';
|
|
17
|
+
/**
|
|
18
|
+
* Returns whether an argument belongs to the `cat` option grammar.
|
|
19
|
+
*
|
|
20
|
+
* @param argument - One token from the command line.
|
|
21
|
+
* @returns True for a recognized binary or highlight option.
|
|
22
|
+
*/
|
|
23
|
+
export function catArgument_isOption(argument) {
|
|
24
|
+
return argument === BINARY_OPTION
|
|
25
|
+
|| argument === HIGHLIGHT_OPTION
|
|
26
|
+
|| argument === NO_HIGHLIGHT_OPTION
|
|
27
|
+
|| argument.startsWith(HIGHLIGHT_LANGUAGE_PREFIX);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Parses file paths and presentation options for the `cat` builtin.
|
|
31
|
+
* Later highlight flags take precedence over earlier highlight flags.
|
|
32
|
+
*
|
|
33
|
+
* @param args - Tokens following the `cat` command name.
|
|
34
|
+
* @returns Typed binary, highlighting, language, and file-path selections.
|
|
35
|
+
*/
|
|
36
|
+
export function catArguments_parse(args) {
|
|
37
|
+
let binaryMode = false;
|
|
38
|
+
let highlightMode = 'auto';
|
|
39
|
+
let highlightLanguage;
|
|
40
|
+
const filePaths = [];
|
|
41
|
+
for (const argument of args) {
|
|
42
|
+
if (argument === BINARY_OPTION) {
|
|
43
|
+
binaryMode = true;
|
|
44
|
+
}
|
|
45
|
+
else if (argument === HIGHLIGHT_OPTION) {
|
|
46
|
+
highlightMode = 'always';
|
|
47
|
+
highlightLanguage = undefined;
|
|
48
|
+
}
|
|
49
|
+
else if (argument.startsWith(HIGHLIGHT_LANGUAGE_PREFIX)) {
|
|
50
|
+
highlightMode = 'always';
|
|
51
|
+
highlightLanguage = argument.slice(HIGHLIGHT_LANGUAGE_PREFIX.length);
|
|
52
|
+
}
|
|
53
|
+
else if (argument === NO_HIGHLIGHT_OPTION) {
|
|
54
|
+
highlightMode = 'never';
|
|
55
|
+
highlightLanguage = undefined;
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
filePaths.push(argument);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return { binaryMode, highlightMode, highlightLanguage, filePaths };
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=cat.args.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cat.args.js","sourceRoot":"","sources":["../../../src/builtins/fs/cat.args.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAaH,qEAAqE;AACrE,MAAM,CAAC,MAAM,SAAS,GACpB,2EAA2E,CAAC;AAE9E,MAAM,aAAa,GAAW,UAAU,CAAC;AACzC,MAAM,gBAAgB,GAAW,aAAa,CAAC;AAC/C,MAAM,yBAAyB,GAAW,cAAc,CAAC;AACzD,MAAM,mBAAmB,GAAW,gBAAgB,CAAC;AAErD;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,QAAgB;IACnD,OAAO,QAAQ,KAAK,aAAa;WAC5B,QAAQ,KAAK,gBAAgB;WAC7B,QAAQ,KAAK,mBAAmB;WAChC,QAAQ,CAAC,UAAU,CAAC,yBAAyB,CAAC,CAAC;AACtD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAc;IAC/C,IAAI,UAAU,GAAY,KAAK,CAAC;IAChC,IAAI,aAAa,GAAqB,MAAM,CAAC;IAC7C,IAAI,iBAAqC,CAAC;IAC1C,MAAM,SAAS,GAAa,EAAE,CAAC;IAE/B,KAAK,MAAM,QAAQ,IAAI,IAAI,EAAE,CAAC;QAC5B,IAAI,QAAQ,KAAK,aAAa,EAAE,CAAC;YAC/B,UAAU,GAAG,IAAI,CAAC;QACpB,CAAC;aAAM,IAAI,QAAQ,KAAK,gBAAgB,EAAE,CAAC;YACzC,aAAa,GAAG,QAAQ,CAAC;YACzB,iBAAiB,GAAG,SAAS,CAAC;QAChC,CAAC;aAAM,IAAI,QAAQ,CAAC,UAAU,CAAC,yBAAyB,CAAC,EAAE,CAAC;YAC1D,aAAa,GAAG,QAAQ,CAAC;YACzB,iBAAiB,GAAG,QAAQ,CAAC,KAAK,CAAC,yBAAyB,CAAC,MAAM,CAAC,CAAC;QACvE,CAAC;aAAM,IAAI,QAAQ,KAAK,mBAAmB,EAAE,CAAC;YAC5C,aAAa,GAAG,OAAO,CAAC;YACxB,iBAAiB,GAAG,SAAS,CAAC;QAChC,CAAC;aAAM,CAAC;YACN,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;IAED,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,iBAAiB,EAAE,SAAS,EAAE,CAAC;AACrE,CAAC"}
|
|
@@ -3,13 +3,13 @@ import type { CommandEnvelope } from '@fnndsc/cumin';
|
|
|
3
3
|
* Displays the content of one or more files.
|
|
4
4
|
*
|
|
5
5
|
* Supports multiple files and concatenates their output. Binary mode is applied
|
|
6
|
-
* consistently to all files
|
|
6
|
+
* per recognized file, or consistently to all files when `--binary` is specified.
|
|
7
7
|
* Text content and errors are buffered into the envelope; binary content streams
|
|
8
8
|
* to the terminal directly with backpressure (raw bytes are not envelope text),
|
|
9
9
|
* and the binary auto-detection notice is emitted live on the err channel so it
|
|
10
10
|
* precedes the bytes it describes.
|
|
11
11
|
*
|
|
12
|
-
* @param args -
|
|
12
|
+
* @param args - File paths plus optional binary/highlight flags.
|
|
13
13
|
* @returns An envelope whose rendered text carries the (highlighted) file
|
|
14
14
|
* contents and whose model lists per-file outcomes.
|
|
15
15
|
*/
|