@aigne/afs-cli 1.11.0-beta.6 → 1.11.0-beta.7
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/cli.cjs +27 -353
- package/dist/cli.d.cts +2 -1
- package/dist/cli.d.mts +2 -1
- package/dist/cli.mjs +28 -353
- package/dist/cli.mjs.map +1 -1
- package/dist/config/afs-loader.cjs +123 -0
- package/dist/config/afs-loader.d.cts +14 -0
- package/dist/config/afs-loader.d.cts.map +1 -0
- package/dist/config/afs-loader.d.mts +14 -0
- package/dist/config/afs-loader.d.mts.map +1 -0
- package/dist/config/afs-loader.mjs +122 -0
- package/dist/config/afs-loader.mjs.map +1 -0
- package/dist/config/loader.cjs +2 -2
- package/dist/config/loader.mjs +2 -2
- package/dist/{commands/mount.cjs → config/mount-commands.cjs} +13 -49
- package/dist/config/mount-commands.d.cts +20 -0
- package/dist/config/mount-commands.d.cts.map +1 -0
- package/dist/config/mount-commands.d.mts +20 -0
- package/dist/config/mount-commands.d.mts.map +1 -0
- package/dist/{commands/mount.mjs → config/mount-commands.mjs} +14 -49
- package/dist/config/mount-commands.mjs.map +1 -0
- package/dist/config/schema.cjs +9 -1
- package/dist/config/schema.mjs +9 -1
- package/dist/config/schema.mjs.map +1 -1
- package/dist/core/commands/delete.cjs +41 -0
- package/dist/core/commands/delete.d.cts +18 -0
- package/dist/core/commands/delete.d.cts.map +1 -0
- package/dist/core/commands/delete.d.mts +18 -0
- package/dist/core/commands/delete.d.mts.map +1 -0
- package/dist/core/commands/delete.mjs +42 -0
- package/dist/core/commands/delete.mjs.map +1 -0
- package/dist/core/commands/exec.cjs +95 -0
- package/dist/core/commands/exec.d.cts +26 -0
- package/dist/core/commands/exec.d.cts.map +1 -0
- package/dist/core/commands/exec.d.mts +26 -0
- package/dist/core/commands/exec.d.mts.map +1 -0
- package/dist/core/commands/exec.mjs +96 -0
- package/dist/core/commands/exec.mjs.map +1 -0
- package/dist/core/commands/explain.cjs +254 -0
- package/dist/core/commands/explain.d.cts +25 -0
- package/dist/core/commands/explain.d.cts.map +1 -0
- package/dist/core/commands/explain.d.mts +25 -0
- package/dist/core/commands/explain.d.mts.map +1 -0
- package/dist/core/commands/explain.mjs +255 -0
- package/dist/core/commands/explain.mjs.map +1 -0
- package/dist/core/commands/explore.cjs +30 -0
- package/dist/core/commands/explore.d.mts +2 -0
- package/dist/core/commands/explore.mjs +31 -0
- package/dist/core/commands/explore.mjs.map +1 -0
- package/dist/core/commands/index.cjs +36 -0
- package/dist/core/commands/index.d.cts +21 -0
- package/dist/core/commands/index.d.cts.map +1 -0
- package/dist/core/commands/index.d.mts +24 -0
- package/dist/core/commands/index.d.mts.map +1 -0
- package/dist/core/commands/index.mjs +37 -0
- package/dist/core/commands/index.mjs.map +1 -0
- package/dist/core/commands/ls.cjs +57 -0
- package/dist/core/commands/ls.d.cts +21 -0
- package/dist/core/commands/ls.d.cts.map +1 -0
- package/dist/core/commands/ls.d.mts +21 -0
- package/dist/core/commands/ls.d.mts.map +1 -0
- package/dist/core/commands/ls.mjs +58 -0
- package/dist/core/commands/ls.mjs.map +1 -0
- package/dist/core/commands/mount.cjs +139 -0
- package/dist/core/commands/mount.d.cts +33 -0
- package/dist/core/commands/mount.d.cts.map +1 -0
- package/dist/core/commands/mount.d.mts +33 -0
- package/dist/core/commands/mount.d.mts.map +1 -0
- package/dist/core/commands/mount.mjs +140 -0
- package/dist/core/commands/mount.mjs.map +1 -0
- package/dist/core/commands/read.cjs +48 -0
- package/dist/core/commands/read.d.cts +17 -0
- package/dist/core/commands/read.d.cts.map +1 -0
- package/dist/core/commands/read.d.mts +17 -0
- package/dist/core/commands/read.d.mts.map +1 -0
- package/dist/core/commands/read.mjs +49 -0
- package/dist/core/commands/read.mjs.map +1 -0
- package/dist/core/commands/search.cjs +40 -0
- package/dist/core/commands/search.d.mts +2 -0
- package/dist/core/commands/search.mjs +41 -0
- package/dist/core/commands/search.mjs.map +1 -0
- package/dist/core/commands/serve.cjs +242 -0
- package/dist/core/commands/serve.d.mts +2 -0
- package/dist/core/commands/serve.mjs +242 -0
- package/dist/core/commands/serve.mjs.map +1 -0
- package/dist/core/commands/stat.cjs +53 -0
- package/dist/core/commands/stat.d.cts +17 -0
- package/dist/core/commands/stat.d.cts.map +1 -0
- package/dist/core/commands/stat.d.mts +17 -0
- package/dist/core/commands/stat.d.mts.map +1 -0
- package/dist/core/commands/stat.mjs +54 -0
- package/dist/core/commands/stat.mjs.map +1 -0
- package/dist/core/commands/types.cjs +13 -0
- package/dist/core/commands/types.d.cts +54 -0
- package/dist/core/commands/types.d.cts.map +1 -0
- package/dist/core/commands/types.d.mts +54 -0
- package/dist/core/commands/types.d.mts.map +1 -0
- package/dist/core/commands/types.mjs +14 -0
- package/dist/core/commands/types.mjs.map +1 -0
- package/dist/core/commands/write.cjs +70 -0
- package/dist/core/commands/write.d.cts +20 -0
- package/dist/core/commands/write.d.cts.map +1 -0
- package/dist/core/commands/write.d.mts +20 -0
- package/dist/core/commands/write.d.mts.map +1 -0
- package/dist/core/commands/write.mjs +71 -0
- package/dist/core/commands/write.mjs.map +1 -0
- package/dist/core/executor/index.cjs +196 -0
- package/dist/core/executor/index.d.cts +77 -0
- package/dist/core/executor/index.d.cts.map +1 -0
- package/dist/core/executor/index.d.mts +77 -0
- package/dist/core/executor/index.d.mts.map +1 -0
- package/dist/core/executor/index.mjs +195 -0
- package/dist/core/executor/index.mjs.map +1 -0
- package/dist/core/formatters/delete.cjs +37 -0
- package/dist/core/formatters/delete.d.cts +18 -0
- package/dist/core/formatters/delete.d.cts.map +1 -0
- package/dist/core/formatters/delete.d.mts +18 -0
- package/dist/core/formatters/delete.d.mts.map +1 -0
- package/dist/core/formatters/delete.mjs +37 -0
- package/dist/core/formatters/delete.mjs.map +1 -0
- package/dist/core/formatters/exec.cjs +60 -0
- package/dist/core/formatters/exec.d.cts +18 -0
- package/dist/core/formatters/exec.d.cts.map +1 -0
- package/dist/core/formatters/exec.d.mts +18 -0
- package/dist/core/formatters/exec.d.mts.map +1 -0
- package/dist/core/formatters/exec.mjs +60 -0
- package/dist/core/formatters/exec.mjs.map +1 -0
- package/dist/core/formatters/explain.cjs +97 -0
- package/dist/core/formatters/explain.d.cts +11 -0
- package/dist/core/formatters/explain.d.cts.map +1 -0
- package/dist/core/formatters/explain.d.mts +11 -0
- package/dist/core/formatters/explain.d.mts.map +1 -0
- package/dist/core/formatters/explain.mjs +96 -0
- package/dist/core/formatters/explain.mjs.map +1 -0
- package/dist/core/formatters/index.d.mts +9 -0
- package/dist/core/formatters/ls.cjs +179 -0
- package/dist/core/formatters/ls.d.cts +20 -0
- package/dist/core/formatters/ls.d.cts.map +1 -0
- package/dist/core/formatters/ls.d.mts +20 -0
- package/dist/core/formatters/ls.d.mts.map +1 -0
- package/dist/core/formatters/ls.mjs +179 -0
- package/dist/core/formatters/ls.mjs.map +1 -0
- package/dist/core/formatters/mount.cjs +55 -0
- package/dist/core/formatters/mount.d.cts +15 -0
- package/dist/core/formatters/mount.d.cts.map +1 -0
- package/dist/core/formatters/mount.d.mts +15 -0
- package/dist/core/formatters/mount.d.mts.map +1 -0
- package/dist/core/formatters/mount.mjs +55 -0
- package/dist/core/formatters/mount.mjs.map +1 -0
- package/dist/core/formatters/read.cjs +100 -0
- package/dist/core/formatters/read.d.cts +22 -0
- package/dist/core/formatters/read.d.cts.map +1 -0
- package/dist/core/formatters/read.d.mts +22 -0
- package/dist/core/formatters/read.d.mts.map +1 -0
- package/dist/core/formatters/read.mjs +100 -0
- package/dist/core/formatters/read.mjs.map +1 -0
- package/dist/core/formatters/search.cjs +44 -0
- package/dist/core/formatters/search.d.mts +1 -0
- package/dist/core/formatters/search.mjs +44 -0
- package/dist/core/formatters/search.mjs.map +1 -0
- package/dist/core/formatters/stat.cjs +155 -0
- package/dist/core/formatters/stat.d.cts +15 -0
- package/dist/core/formatters/stat.d.cts.map +1 -0
- package/dist/core/formatters/stat.d.mts +15 -0
- package/dist/core/formatters/stat.d.mts.map +1 -0
- package/dist/core/formatters/stat.mjs +155 -0
- package/dist/core/formatters/stat.mjs.map +1 -0
- package/dist/core/formatters/write.cjs +51 -0
- package/dist/core/formatters/write.d.cts +22 -0
- package/dist/core/formatters/write.d.cts.map +1 -0
- package/dist/core/formatters/write.d.mts +22 -0
- package/dist/core/formatters/write.d.mts.map +1 -0
- package/dist/core/formatters/write.mjs +51 -0
- package/dist/core/formatters/write.mjs.map +1 -0
- package/dist/core/helpers/exec-args.cjs +142 -0
- package/dist/core/helpers/exec-args.d.cts +46 -0
- package/dist/core/helpers/exec-args.d.cts.map +1 -0
- package/dist/core/helpers/exec-args.d.mts +46 -0
- package/dist/core/helpers/exec-args.d.mts.map +1 -0
- package/dist/core/helpers/exec-args.mjs +139 -0
- package/dist/core/helpers/exec-args.mjs.map +1 -0
- package/dist/core/helpers/stdin.cjs +41 -0
- package/dist/core/helpers/stdin.d.cts +15 -0
- package/dist/core/helpers/stdin.d.cts.map +1 -0
- package/dist/core/helpers/stdin.d.mts +15 -0
- package/dist/core/helpers/stdin.d.mts.map +1 -0
- package/dist/core/helpers/stdin.mjs +41 -0
- package/dist/core/helpers/stdin.mjs.map +1 -0
- package/dist/core/index.cjs +49 -0
- package/dist/core/index.d.cts +24 -0
- package/dist/core/index.d.mts +25 -0
- package/dist/core/index.mjs +24 -0
- package/dist/core/path-utils.cjs +1 -0
- package/dist/core/path-utils.mjs +3 -0
- package/dist/core/types.d.cts +24 -0
- package/dist/core/types.d.cts.map +1 -0
- package/dist/core/types.d.mts +24 -0
- package/dist/core/types.d.mts.map +1 -0
- package/dist/errors.cjs +0 -11
- package/dist/errors.mjs +1 -11
- package/dist/errors.mjs.map +1 -1
- package/dist/explorer/actions.cjs +67 -32
- package/dist/explorer/actions.mjs +66 -32
- package/dist/explorer/actions.mjs.map +1 -1
- package/dist/explorer/components/dialog.cjs +170 -46
- package/dist/explorer/components/dialog.mjs +170 -46
- package/dist/explorer/components/dialog.mjs.map +1 -1
- package/dist/explorer/components/metadata-panel.cjs +86 -3
- package/dist/explorer/components/metadata-panel.mjs +86 -3
- package/dist/explorer/components/metadata-panel.mjs.map +1 -1
- package/dist/explorer/screen.cjs +63 -27
- package/dist/explorer/screen.d.cts +23 -0
- package/dist/explorer/screen.d.cts.map +1 -0
- package/dist/explorer/screen.d.mts +23 -0
- package/dist/explorer/screen.d.mts.map +1 -0
- package/dist/explorer/screen.mjs +63 -27
- package/dist/explorer/screen.mjs.map +1 -1
- package/dist/explorer/theme.cjs +1 -1
- package/dist/explorer/theme.mjs +1 -1
- package/dist/explorer/theme.mjs.map +1 -1
- package/dist/index.cjs +7 -1
- package/dist/index.d.cts +4 -1
- package/dist/index.d.mts +4 -1
- package/dist/index.mjs +4 -1
- package/dist/mcp/http-transport.cjs +68 -0
- package/dist/mcp/http-transport.mjs +68 -0
- package/dist/mcp/http-transport.mjs.map +1 -0
- package/dist/mcp/prompts.cjs +48 -0
- package/dist/mcp/prompts.mjs +48 -0
- package/dist/mcp/prompts.mjs.map +1 -0
- package/dist/mcp/resources.cjs +25 -0
- package/dist/mcp/resources.mjs +25 -0
- package/dist/mcp/resources.mjs.map +1 -0
- package/dist/mcp/server.cjs +30 -0
- package/dist/mcp/server.mjs +30 -0
- package/dist/mcp/server.mjs.map +1 -0
- package/dist/mcp/tools.cjs +196 -0
- package/dist/mcp/tools.mjs +196 -0
- package/dist/mcp/tools.mjs.map +1 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/index.d.cts +10 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/index.d.cts.map +1 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/index.d.mts +10 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/index.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/types.d.cts +46 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/types.d.cts.map +1 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/types.d.mts +46 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/types.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/urlpattern.cjs +902 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/urlpattern.mjs +902 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/urlpattern.mjs.map +1 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/index.cjs +6 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/index.mjs +8 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/index.mjs.map +1 -0
- package/dist/path-utils.d.cts +50 -0
- package/dist/path-utils.d.cts.map +1 -0
- package/dist/path-utils.d.mts +50 -0
- package/dist/path-utils.d.mts.map +1 -0
- package/dist/repl.cjs +485 -0
- package/dist/repl.d.cts +15 -0
- package/dist/repl.d.cts.map +1 -0
- package/dist/repl.d.mts +16 -0
- package/dist/repl.d.mts.map +1 -0
- package/dist/repl.mjs +485 -0
- package/dist/repl.mjs.map +1 -0
- package/dist/serve.cjs +146 -0
- package/dist/serve.d.cts +41 -0
- package/dist/serve.d.cts.map +1 -0
- package/dist/serve.d.mts +41 -0
- package/dist/serve.d.mts.map +1 -0
- package/dist/serve.mjs +146 -0
- package/dist/serve.mjs.map +1 -0
- package/dist/ui/header.cjs +1 -40
- package/dist/ui/header.mjs +1 -39
- package/dist/ui/header.mjs.map +1 -1
- package/dist/ui/index.cjs +2 -9
- package/dist/ui/index.mjs +2 -7
- package/dist/ui/index.mjs.map +1 -1
- package/dist/ui/terminal.cjs +1 -10
- package/dist/ui/terminal.mjs +1 -8
- package/dist/ui/terminal.mjs.map +1 -1
- package/package.json +29 -16
- package/dist/commands/exec.cjs +0 -164
- package/dist/commands/exec.mjs +0 -160
- package/dist/commands/exec.mjs.map +0 -1
- package/dist/commands/explain.cjs +0 -244
- package/dist/commands/explain.mjs +0 -242
- package/dist/commands/explain.mjs.map +0 -1
- package/dist/commands/index.cjs +0 -8
- package/dist/commands/index.mjs +0 -10
- package/dist/commands/ls.cjs +0 -242
- package/dist/commands/ls.mjs +0 -242
- package/dist/commands/ls.mjs.map +0 -1
- package/dist/commands/mount.mjs.map +0 -1
- package/dist/commands/read.cjs +0 -264
- package/dist/commands/read.mjs +0 -263
- package/dist/commands/read.mjs.map +0 -1
- package/dist/commands/serve.cjs +0 -144
- package/dist/commands/serve.mjs +0 -143
- package/dist/commands/serve.mjs.map +0 -1
- package/dist/commands/stat.cjs +0 -195
- package/dist/commands/stat.mjs +0 -195
- package/dist/commands/stat.mjs.map +0 -1
- package/dist/commands/write.cjs +0 -85
- package/dist/commands/write.mjs +0 -85
- package/dist/commands/write.mjs.map +0 -1
- package/dist/config/provider-factory.cjs +0 -400
- package/dist/config/provider-factory.mjs +0 -401
- package/dist/config/provider-factory.mjs.map +0 -1
- package/dist/config/uri-parser.cjs +0 -285
- package/dist/config/uri-parser.mjs +0 -285
- package/dist/config/uri-parser.mjs.map +0 -1
- package/dist/runtime.cjs +0 -120
- package/dist/runtime.mjs +0 -120
- package/dist/runtime.mjs.map +0 -1
- package/dist/utils/meta.cjs +0 -51
- package/dist/utils/meta.mjs +0 -49
- package/dist/utils/meta.mjs.map +0 -1
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
const require_stdin = require('./stdin.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/core/helpers/exec-args.ts
|
|
4
|
+
/**
|
|
5
|
+
* Reserved CLI option names that should not be passed as exec arguments
|
|
6
|
+
*/
|
|
7
|
+
const RESERVED_OPTIONS = new Set([
|
|
8
|
+
"json",
|
|
9
|
+
"yaml",
|
|
10
|
+
"view",
|
|
11
|
+
"help",
|
|
12
|
+
"h",
|
|
13
|
+
"version",
|
|
14
|
+
"V",
|
|
15
|
+
"_",
|
|
16
|
+
"$0",
|
|
17
|
+
"executable_path",
|
|
18
|
+
"executablePath",
|
|
19
|
+
"args"
|
|
20
|
+
]);
|
|
21
|
+
/**
|
|
22
|
+
* Parse exec arguments from CLI options, with optional schema-aware type coercion
|
|
23
|
+
*
|
|
24
|
+
* Priority: CLI flags > stdin > --args
|
|
25
|
+
*
|
|
26
|
+
* @param options - CLI options object
|
|
27
|
+
* @param inputSchema - Optional JSON Schema for type coercion
|
|
28
|
+
* @returns Parsed arguments for exec
|
|
29
|
+
*/
|
|
30
|
+
function parseExecArgs(options, inputSchema) {
|
|
31
|
+
let result = {};
|
|
32
|
+
if (options.args && typeof options.args === "string") try {
|
|
33
|
+
const parsed = JSON.parse(options.args);
|
|
34
|
+
if (typeof parsed === "object" && parsed !== null) result = { ...parsed };
|
|
35
|
+
} catch (e) {
|
|
36
|
+
throw new Error(`Invalid JSON in --args: ${e.message}`);
|
|
37
|
+
}
|
|
38
|
+
const properties = inputSchema?.properties;
|
|
39
|
+
for (const [key, value] of Object.entries(options)) {
|
|
40
|
+
const isSchemaProperty = inputSchema?.properties?.[key] !== void 0;
|
|
41
|
+
if (RESERVED_OPTIONS.has(key) && !isSchemaProperty || value === void 0 || value === null) continue;
|
|
42
|
+
const propSchema = properties?.[key];
|
|
43
|
+
result[key] = parseValueBySchema(value, propSchema, key);
|
|
44
|
+
}
|
|
45
|
+
return result;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Parse exec arguments with stdin support (async version)
|
|
49
|
+
*
|
|
50
|
+
* Priority: CLI flags > stdin > --args
|
|
51
|
+
*
|
|
52
|
+
* @param options - CLI options object from yargs
|
|
53
|
+
* @param inputSchema - Optional JSON Schema for type-aware coercion
|
|
54
|
+
* @returns Parsed arguments for exec
|
|
55
|
+
*/
|
|
56
|
+
async function parseExecArgsWithStdin(options, inputSchema) {
|
|
57
|
+
let result = {};
|
|
58
|
+
if (options.args && typeof options.args === "string") try {
|
|
59
|
+
const parsed = JSON.parse(options.args);
|
|
60
|
+
if (typeof parsed === "object" && parsed !== null) result = { ...parsed };
|
|
61
|
+
} catch (e) {
|
|
62
|
+
throw new Error(`Invalid JSON in --args: ${e.message}`);
|
|
63
|
+
}
|
|
64
|
+
const stdinContent = await require_stdin.readStdin();
|
|
65
|
+
if (stdinContent) try {
|
|
66
|
+
const parsed = JSON.parse(stdinContent);
|
|
67
|
+
if (typeof parsed === "object" && parsed !== null) result = {
|
|
68
|
+
...result,
|
|
69
|
+
...parsed
|
|
70
|
+
};
|
|
71
|
+
} catch (e) {
|
|
72
|
+
throw new Error(`Invalid JSON in stdin: ${e.message}`);
|
|
73
|
+
}
|
|
74
|
+
const properties = inputSchema?.properties;
|
|
75
|
+
for (const [key, value] of Object.entries(options)) {
|
|
76
|
+
const isSchemaProperty = inputSchema?.properties?.[key] !== void 0;
|
|
77
|
+
if (RESERVED_OPTIONS.has(key) && !isSchemaProperty || value === void 0 || value === null) continue;
|
|
78
|
+
const propSchema = properties?.[key];
|
|
79
|
+
result[key] = parseValueBySchema(value, propSchema, key);
|
|
80
|
+
}
|
|
81
|
+
return result;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Parse a value according to its JSON Schema type
|
|
85
|
+
*
|
|
86
|
+
* @param value - The value to parse (typically a string from CLI)
|
|
87
|
+
* @param schema - The JSON Schema for this property
|
|
88
|
+
* @param paramName - Parameter name for error messages
|
|
89
|
+
* @returns Parsed value with appropriate type
|
|
90
|
+
*/
|
|
91
|
+
function parseValueBySchema(value, schema, paramName) {
|
|
92
|
+
if (typeof value !== "string") return value;
|
|
93
|
+
if (!schema) return value;
|
|
94
|
+
const schemaType = schema.type;
|
|
95
|
+
switch (schemaType) {
|
|
96
|
+
case "integer": {
|
|
97
|
+
const num = Number(value);
|
|
98
|
+
if (Number.isNaN(num)) throw new Error(`Invalid integer for '${paramName}': ${value}\nExpected: integer`);
|
|
99
|
+
return Math.floor(num);
|
|
100
|
+
}
|
|
101
|
+
case "number": {
|
|
102
|
+
const num = Number(value);
|
|
103
|
+
if (Number.isNaN(num)) throw new Error(`Invalid number for '${paramName}': ${value}\nExpected: number`);
|
|
104
|
+
return num;
|
|
105
|
+
}
|
|
106
|
+
case "boolean":
|
|
107
|
+
if (value === "true") return true;
|
|
108
|
+
if (value === "false") return false;
|
|
109
|
+
throw new Error(`Invalid boolean for '${paramName}': ${value}\nExpected: "true" or "false"`);
|
|
110
|
+
case "array":
|
|
111
|
+
case "object": try {
|
|
112
|
+
return JSON.parse(value);
|
|
113
|
+
} catch (e) {
|
|
114
|
+
const errorMsg = e instanceof Error ? e.message : String(e);
|
|
115
|
+
throw new Error(`Invalid JSON for '${paramName}': ${errorMsg}\nValue: ${value}\nHint: For ${schemaType}s, use valid JSON syntax. ` + (schemaType === "array" ? "Arrays use [...], e.g., '[\"a\",\"b\"]'" : "Objects use {...}, e.g., '{\"key\":\"value\"}'"));
|
|
116
|
+
}
|
|
117
|
+
default: return value;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Convert JSON Schema type to yargs type
|
|
122
|
+
*
|
|
123
|
+
* @param schemaType - JSON Schema type
|
|
124
|
+
* @returns yargs type string
|
|
125
|
+
*/
|
|
126
|
+
function schemaTypeToYargs(schemaType) {
|
|
127
|
+
switch (schemaType) {
|
|
128
|
+
case "integer":
|
|
129
|
+
case "number": return "number";
|
|
130
|
+
case "boolean": return "boolean";
|
|
131
|
+
case "array":
|
|
132
|
+
case "object": return "string";
|
|
133
|
+
default: return "string";
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
//#endregion
|
|
138
|
+
exports.RESERVED_OPTIONS = RESERVED_OPTIONS;
|
|
139
|
+
exports.parseExecArgs = parseExecArgs;
|
|
140
|
+
exports.parseExecArgsWithStdin = parseExecArgsWithStdin;
|
|
141
|
+
exports.parseValueBySchema = parseValueBySchema;
|
|
142
|
+
exports.schemaTypeToYargs = schemaTypeToYargs;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { JSONSchema } from "../types.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/core/helpers/exec-args.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Reserved CLI option names that should not be passed as exec arguments
|
|
6
|
+
*/
|
|
7
|
+
declare const RESERVED_OPTIONS: Set<string>;
|
|
8
|
+
/**
|
|
9
|
+
* Parse exec arguments from CLI options, with optional schema-aware type coercion
|
|
10
|
+
*
|
|
11
|
+
* Priority: CLI flags > stdin > --args
|
|
12
|
+
*
|
|
13
|
+
* @param options - CLI options object
|
|
14
|
+
* @param inputSchema - Optional JSON Schema for type coercion
|
|
15
|
+
* @returns Parsed arguments for exec
|
|
16
|
+
*/
|
|
17
|
+
declare function parseExecArgs(options: Record<string, unknown>, inputSchema?: JSONSchema): Record<string, unknown>;
|
|
18
|
+
/**
|
|
19
|
+
* Parse exec arguments with stdin support (async version)
|
|
20
|
+
*
|
|
21
|
+
* Priority: CLI flags > stdin > --args
|
|
22
|
+
*
|
|
23
|
+
* @param options - CLI options object from yargs
|
|
24
|
+
* @param inputSchema - Optional JSON Schema for type-aware coercion
|
|
25
|
+
* @returns Parsed arguments for exec
|
|
26
|
+
*/
|
|
27
|
+
declare function parseExecArgsWithStdin(options: Record<string, unknown>, inputSchema?: JSONSchema): Promise<Record<string, unknown>>;
|
|
28
|
+
/**
|
|
29
|
+
* Parse a value according to its JSON Schema type
|
|
30
|
+
*
|
|
31
|
+
* @param value - The value to parse (typically a string from CLI)
|
|
32
|
+
* @param schema - The JSON Schema for this property
|
|
33
|
+
* @param paramName - Parameter name for error messages
|
|
34
|
+
* @returns Parsed value with appropriate type
|
|
35
|
+
*/
|
|
36
|
+
declare function parseValueBySchema(value: unknown, schema: JSONSchema | undefined, paramName: string): unknown;
|
|
37
|
+
/**
|
|
38
|
+
* Convert JSON Schema type to yargs type
|
|
39
|
+
*
|
|
40
|
+
* @param schemaType - JSON Schema type
|
|
41
|
+
* @returns yargs type string
|
|
42
|
+
*/
|
|
43
|
+
declare function schemaTypeToYargs(schemaType: JSONSchema["type"]): "string" | "number" | "boolean" | "array";
|
|
44
|
+
//#endregion
|
|
45
|
+
export { RESERVED_OPTIONS, parseExecArgs, parseExecArgsWithStdin, parseValueBySchema, schemaTypeToYargs };
|
|
46
|
+
//# sourceMappingURL=exec-args.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exec-args.d.cts","names":[],"sources":["../../../src/core/helpers/exec-args.ts"],"mappings":";;;;;AAoCA;cAxBa,gBAAA,EAAgB,GAAA;;;;;;;;;;iBAwBb,aAAA,CACd,OAAA,EAAS,MAAA,mBACT,WAAA,GAAc,UAAA,GACb,MAAA;;;;AA0CH;;;;;;iBAAsB,sBAAA,CACpB,OAAA,EAAS,MAAA,mBACT,WAAA,GAAc,UAAA,GACb,OAAA,CAAQ,MAAA;;;;;;;;;iBAsDK,kBAAA,CACd,KAAA,WACA,MAAA,EAAQ,UAAA,cACR,SAAA;;AAHF;;;;;iBAqEgB,iBAAA,CACd,UAAA,EAAY,UAAA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { JSONSchema } from "../types.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/core/helpers/exec-args.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Reserved CLI option names that should not be passed as exec arguments
|
|
6
|
+
*/
|
|
7
|
+
declare const RESERVED_OPTIONS: Set<string>;
|
|
8
|
+
/**
|
|
9
|
+
* Parse exec arguments from CLI options, with optional schema-aware type coercion
|
|
10
|
+
*
|
|
11
|
+
* Priority: CLI flags > stdin > --args
|
|
12
|
+
*
|
|
13
|
+
* @param options - CLI options object
|
|
14
|
+
* @param inputSchema - Optional JSON Schema for type coercion
|
|
15
|
+
* @returns Parsed arguments for exec
|
|
16
|
+
*/
|
|
17
|
+
declare function parseExecArgs(options: Record<string, unknown>, inputSchema?: JSONSchema): Record<string, unknown>;
|
|
18
|
+
/**
|
|
19
|
+
* Parse exec arguments with stdin support (async version)
|
|
20
|
+
*
|
|
21
|
+
* Priority: CLI flags > stdin > --args
|
|
22
|
+
*
|
|
23
|
+
* @param options - CLI options object from yargs
|
|
24
|
+
* @param inputSchema - Optional JSON Schema for type-aware coercion
|
|
25
|
+
* @returns Parsed arguments for exec
|
|
26
|
+
*/
|
|
27
|
+
declare function parseExecArgsWithStdin(options: Record<string, unknown>, inputSchema?: JSONSchema): Promise<Record<string, unknown>>;
|
|
28
|
+
/**
|
|
29
|
+
* Parse a value according to its JSON Schema type
|
|
30
|
+
*
|
|
31
|
+
* @param value - The value to parse (typically a string from CLI)
|
|
32
|
+
* @param schema - The JSON Schema for this property
|
|
33
|
+
* @param paramName - Parameter name for error messages
|
|
34
|
+
* @returns Parsed value with appropriate type
|
|
35
|
+
*/
|
|
36
|
+
declare function parseValueBySchema(value: unknown, schema: JSONSchema | undefined, paramName: string): unknown;
|
|
37
|
+
/**
|
|
38
|
+
* Convert JSON Schema type to yargs type
|
|
39
|
+
*
|
|
40
|
+
* @param schemaType - JSON Schema type
|
|
41
|
+
* @returns yargs type string
|
|
42
|
+
*/
|
|
43
|
+
declare function schemaTypeToYargs(schemaType: JSONSchema["type"]): "string" | "number" | "boolean" | "array";
|
|
44
|
+
//#endregion
|
|
45
|
+
export { RESERVED_OPTIONS, parseExecArgs, parseExecArgsWithStdin, parseValueBySchema, schemaTypeToYargs };
|
|
46
|
+
//# sourceMappingURL=exec-args.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exec-args.d.mts","names":[],"sources":["../../../src/core/helpers/exec-args.ts"],"mappings":";;;;;AAoCA;cAxBa,gBAAA,EAAgB,GAAA;;;;;;;;;;iBAwBb,aAAA,CACd,OAAA,EAAS,MAAA,mBACT,WAAA,GAAc,UAAA,GACb,MAAA;;;;AA0CH;;;;;;iBAAsB,sBAAA,CACpB,OAAA,EAAS,MAAA,mBACT,WAAA,GAAc,UAAA,GACb,OAAA,CAAQ,MAAA;;;;;;;;;iBAsDK,kBAAA,CACd,KAAA,WACA,MAAA,EAAQ,UAAA,cACR,SAAA;;AAHF;;;;;iBAqEgB,iBAAA,CACd,UAAA,EAAY,UAAA"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { readStdin } from "./stdin.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/core/helpers/exec-args.ts
|
|
4
|
+
/**
|
|
5
|
+
* Reserved CLI option names that should not be passed as exec arguments
|
|
6
|
+
*/
|
|
7
|
+
const RESERVED_OPTIONS = new Set([
|
|
8
|
+
"json",
|
|
9
|
+
"yaml",
|
|
10
|
+
"view",
|
|
11
|
+
"help",
|
|
12
|
+
"h",
|
|
13
|
+
"version",
|
|
14
|
+
"V",
|
|
15
|
+
"_",
|
|
16
|
+
"$0",
|
|
17
|
+
"executable_path",
|
|
18
|
+
"executablePath",
|
|
19
|
+
"args"
|
|
20
|
+
]);
|
|
21
|
+
/**
|
|
22
|
+
* Parse exec arguments from CLI options, with optional schema-aware type coercion
|
|
23
|
+
*
|
|
24
|
+
* Priority: CLI flags > stdin > --args
|
|
25
|
+
*
|
|
26
|
+
* @param options - CLI options object
|
|
27
|
+
* @param inputSchema - Optional JSON Schema for type coercion
|
|
28
|
+
* @returns Parsed arguments for exec
|
|
29
|
+
*/
|
|
30
|
+
function parseExecArgs(options, inputSchema) {
|
|
31
|
+
let result = {};
|
|
32
|
+
if (options.args && typeof options.args === "string") try {
|
|
33
|
+
const parsed = JSON.parse(options.args);
|
|
34
|
+
if (typeof parsed === "object" && parsed !== null) result = { ...parsed };
|
|
35
|
+
} catch (e) {
|
|
36
|
+
throw new Error(`Invalid JSON in --args: ${e.message}`);
|
|
37
|
+
}
|
|
38
|
+
const properties = inputSchema?.properties;
|
|
39
|
+
for (const [key, value] of Object.entries(options)) {
|
|
40
|
+
const isSchemaProperty = inputSchema?.properties?.[key] !== void 0;
|
|
41
|
+
if (RESERVED_OPTIONS.has(key) && !isSchemaProperty || value === void 0 || value === null) continue;
|
|
42
|
+
const propSchema = properties?.[key];
|
|
43
|
+
result[key] = parseValueBySchema(value, propSchema, key);
|
|
44
|
+
}
|
|
45
|
+
return result;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Parse exec arguments with stdin support (async version)
|
|
49
|
+
*
|
|
50
|
+
* Priority: CLI flags > stdin > --args
|
|
51
|
+
*
|
|
52
|
+
* @param options - CLI options object from yargs
|
|
53
|
+
* @param inputSchema - Optional JSON Schema for type-aware coercion
|
|
54
|
+
* @returns Parsed arguments for exec
|
|
55
|
+
*/
|
|
56
|
+
async function parseExecArgsWithStdin(options, inputSchema) {
|
|
57
|
+
let result = {};
|
|
58
|
+
if (options.args && typeof options.args === "string") try {
|
|
59
|
+
const parsed = JSON.parse(options.args);
|
|
60
|
+
if (typeof parsed === "object" && parsed !== null) result = { ...parsed };
|
|
61
|
+
} catch (e) {
|
|
62
|
+
throw new Error(`Invalid JSON in --args: ${e.message}`);
|
|
63
|
+
}
|
|
64
|
+
const stdinContent = await readStdin();
|
|
65
|
+
if (stdinContent) try {
|
|
66
|
+
const parsed = JSON.parse(stdinContent);
|
|
67
|
+
if (typeof parsed === "object" && parsed !== null) result = {
|
|
68
|
+
...result,
|
|
69
|
+
...parsed
|
|
70
|
+
};
|
|
71
|
+
} catch (e) {
|
|
72
|
+
throw new Error(`Invalid JSON in stdin: ${e.message}`);
|
|
73
|
+
}
|
|
74
|
+
const properties = inputSchema?.properties;
|
|
75
|
+
for (const [key, value] of Object.entries(options)) {
|
|
76
|
+
const isSchemaProperty = inputSchema?.properties?.[key] !== void 0;
|
|
77
|
+
if (RESERVED_OPTIONS.has(key) && !isSchemaProperty || value === void 0 || value === null) continue;
|
|
78
|
+
const propSchema = properties?.[key];
|
|
79
|
+
result[key] = parseValueBySchema(value, propSchema, key);
|
|
80
|
+
}
|
|
81
|
+
return result;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Parse a value according to its JSON Schema type
|
|
85
|
+
*
|
|
86
|
+
* @param value - The value to parse (typically a string from CLI)
|
|
87
|
+
* @param schema - The JSON Schema for this property
|
|
88
|
+
* @param paramName - Parameter name for error messages
|
|
89
|
+
* @returns Parsed value with appropriate type
|
|
90
|
+
*/
|
|
91
|
+
function parseValueBySchema(value, schema, paramName) {
|
|
92
|
+
if (typeof value !== "string") return value;
|
|
93
|
+
if (!schema) return value;
|
|
94
|
+
const schemaType = schema.type;
|
|
95
|
+
switch (schemaType) {
|
|
96
|
+
case "integer": {
|
|
97
|
+
const num = Number(value);
|
|
98
|
+
if (Number.isNaN(num)) throw new Error(`Invalid integer for '${paramName}': ${value}\nExpected: integer`);
|
|
99
|
+
return Math.floor(num);
|
|
100
|
+
}
|
|
101
|
+
case "number": {
|
|
102
|
+
const num = Number(value);
|
|
103
|
+
if (Number.isNaN(num)) throw new Error(`Invalid number for '${paramName}': ${value}\nExpected: number`);
|
|
104
|
+
return num;
|
|
105
|
+
}
|
|
106
|
+
case "boolean":
|
|
107
|
+
if (value === "true") return true;
|
|
108
|
+
if (value === "false") return false;
|
|
109
|
+
throw new Error(`Invalid boolean for '${paramName}': ${value}\nExpected: "true" or "false"`);
|
|
110
|
+
case "array":
|
|
111
|
+
case "object": try {
|
|
112
|
+
return JSON.parse(value);
|
|
113
|
+
} catch (e) {
|
|
114
|
+
const errorMsg = e instanceof Error ? e.message : String(e);
|
|
115
|
+
throw new Error(`Invalid JSON for '${paramName}': ${errorMsg}\nValue: ${value}\nHint: For ${schemaType}s, use valid JSON syntax. ` + (schemaType === "array" ? "Arrays use [...], e.g., '[\"a\",\"b\"]'" : "Objects use {...}, e.g., '{\"key\":\"value\"}'"));
|
|
116
|
+
}
|
|
117
|
+
default: return value;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Convert JSON Schema type to yargs type
|
|
122
|
+
*
|
|
123
|
+
* @param schemaType - JSON Schema type
|
|
124
|
+
* @returns yargs type string
|
|
125
|
+
*/
|
|
126
|
+
function schemaTypeToYargs(schemaType) {
|
|
127
|
+
switch (schemaType) {
|
|
128
|
+
case "integer":
|
|
129
|
+
case "number": return "number";
|
|
130
|
+
case "boolean": return "boolean";
|
|
131
|
+
case "array":
|
|
132
|
+
case "object": return "string";
|
|
133
|
+
default: return "string";
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
//#endregion
|
|
138
|
+
export { RESERVED_OPTIONS, parseExecArgs, parseExecArgsWithStdin, parseValueBySchema, schemaTypeToYargs };
|
|
139
|
+
//# sourceMappingURL=exec-args.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exec-args.mjs","names":[],"sources":["../../../src/core/helpers/exec-args.ts"],"sourcesContent":["/**\n * exec-args Helpers - Core Implementation\n *\n * Functions for parsing exec command arguments with schema-aware type coercion.\n */\n\nimport type { JSONSchema } from \"../types.js\";\nimport { readStdin } from \"./stdin.js\";\n\n/**\n * Reserved CLI option names that should not be passed as exec arguments\n */\nexport const RESERVED_OPTIONS = new Set([\n \"json\",\n \"yaml\",\n \"view\",\n \"help\",\n \"h\",\n \"version\",\n \"V\",\n \"_\", // yargs positional args array\n \"$0\", // yargs script name\n \"executable_path\", // positional exec target path (intentionally compound to avoid schema collision)\n \"executablePath\", // yargs camelCase alias\n \"args\", // our --args option (processed separately)\n]);\n\n/**\n * Parse exec arguments from CLI options, with optional schema-aware type coercion\n *\n * Priority: CLI flags > stdin > --args\n *\n * @param options - CLI options object\n * @param inputSchema - Optional JSON Schema for type coercion\n * @returns Parsed arguments for exec\n */\nexport function parseExecArgs(\n options: Record<string, unknown>,\n inputSchema?: JSONSchema,\n): Record<string, unknown> {\n let result: Record<string, unknown> = {};\n\n // Parse --args JSON if provided (lowest priority)\n if (options.args && typeof options.args === \"string\") {\n try {\n const parsed = JSON.parse(options.args);\n if (typeof parsed === \"object\" && parsed !== null) {\n result = { ...parsed };\n }\n } catch (e) {\n throw new Error(`Invalid JSON in --args: ${(e as Error).message}`);\n }\n }\n\n // Get properties schema for type coercion\n const properties = inputSchema?.properties as Record<string, JSONSchema> | undefined;\n\n // Add named parameters (overwrite JSON args if same key) - highest priority\n for (const [key, value] of Object.entries(options)) {\n // Skip reserved options (unless defined in action schema) and undefined/null values\n const isSchemaProperty = inputSchema?.properties?.[key] !== undefined;\n if ((RESERVED_OPTIONS.has(key) && !isSchemaProperty) || value === undefined || value === null) {\n continue;\n }\n // Apply schema-aware parsing if schema is available\n const propSchema = properties?.[key];\n result[key] = parseValueBySchema(value, propSchema, key);\n }\n\n return result;\n}\n\n/**\n * Parse exec arguments with stdin support (async version)\n *\n * Priority: CLI flags > stdin > --args\n *\n * @param options - CLI options object from yargs\n * @param inputSchema - Optional JSON Schema for type-aware coercion\n * @returns Parsed arguments for exec\n */\nexport async function parseExecArgsWithStdin(\n options: Record<string, unknown>,\n inputSchema?: JSONSchema,\n): Promise<Record<string, unknown>> {\n let result: Record<string, unknown> = {};\n\n // 1. Parse --args JSON if provided (lowest priority)\n if (options.args && typeof options.args === \"string\") {\n try {\n const parsed = JSON.parse(options.args);\n if (typeof parsed === \"object\" && parsed !== null) {\n result = { ...parsed };\n }\n } catch (e) {\n throw new Error(`Invalid JSON in --args: ${(e as Error).message}`);\n }\n }\n\n // 2. Read from stdin if available (medium priority)\n const stdinContent = await readStdin();\n if (stdinContent) {\n try {\n const parsed = JSON.parse(stdinContent);\n if (typeof parsed === \"object\" && parsed !== null) {\n result = { ...result, ...parsed };\n }\n } catch (e) {\n throw new Error(`Invalid JSON in stdin: ${(e as Error).message}`);\n }\n }\n\n // Get properties schema for type coercion\n const properties = inputSchema?.properties as Record<string, JSONSchema> | undefined;\n\n // 3. Add named CLI parameters (highest priority) with schema-aware parsing\n for (const [key, value] of Object.entries(options)) {\n // Skip reserved options (unless defined in action schema) and undefined/null values\n const isSchemaProperty = inputSchema?.properties?.[key] !== undefined;\n if ((RESERVED_OPTIONS.has(key) && !isSchemaProperty) || value === undefined || value === null) {\n continue;\n }\n // Apply schema-aware parsing if schema is available\n const propSchema = properties?.[key];\n result[key] = parseValueBySchema(value, propSchema, key);\n }\n\n return result;\n}\n\n/**\n * Parse a value according to its JSON Schema type\n *\n * @param value - The value to parse (typically a string from CLI)\n * @param schema - The JSON Schema for this property\n * @param paramName - Parameter name for error messages\n * @returns Parsed value with appropriate type\n */\nexport function parseValueBySchema(\n value: unknown,\n schema: JSONSchema | undefined,\n paramName: string,\n): unknown {\n // If value is not a string, return as-is (already parsed by yargs or --args)\n if (typeof value !== \"string\") {\n return value;\n }\n\n // If no schema, return string as-is\n if (!schema) {\n return value;\n }\n\n const schemaType = schema.type;\n\n switch (schemaType) {\n case \"integer\": {\n const num = Number(value);\n if (Number.isNaN(num)) {\n throw new Error(`Invalid integer for '${paramName}': ${value}\\nExpected: integer`);\n }\n return Math.floor(num);\n }\n\n case \"number\": {\n const num = Number(value);\n if (Number.isNaN(num)) {\n throw new Error(`Invalid number for '${paramName}': ${value}\\nExpected: number`);\n }\n return num;\n }\n\n case \"boolean\": {\n if (value === \"true\") return true;\n if (value === \"false\") return false;\n throw new Error(`Invalid boolean for '${paramName}': ${value}\\nExpected: \"true\" or \"false\"`);\n }\n\n case \"array\":\n case \"object\": {\n try {\n return JSON.parse(value);\n } catch (e) {\n const errorMsg = e instanceof Error ? e.message : String(e);\n throw new Error(\n `Invalid JSON for '${paramName}': ${errorMsg}\\n` +\n `Value: ${value}\\n` +\n `Hint: For ${schemaType}s, use valid JSON syntax. ` +\n (schemaType === \"array\"\n ? 'Arrays use [...], e.g., \\'[\"a\",\"b\"]\\''\n : 'Objects use {...}, e.g., \\'{\"key\":\"value\"}\\''),\n );\n }\n }\n\n default:\n // string or unknown type: return as-is\n return value;\n }\n}\n\n/**\n * Convert JSON Schema type to yargs type\n *\n * @param schemaType - JSON Schema type\n * @returns yargs type string\n */\nexport function schemaTypeToYargs(\n schemaType: JSONSchema[\"type\"],\n): \"string\" | \"number\" | \"boolean\" | \"array\" {\n switch (schemaType) {\n case \"integer\":\n case \"number\":\n return \"number\";\n case \"boolean\":\n return \"boolean\";\n case \"array\":\n case \"object\":\n // Use \"string\" so yargs passes raw JSON string to parseValueBySchema for parsing\n return \"string\";\n default:\n return \"string\";\n }\n}\n"],"mappings":";;;;;;AAYA,MAAa,mBAAmB,IAAI,IAAI;CACtC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;;;;;;;;;;AAWF,SAAgB,cACd,SACA,aACyB;CACzB,IAAI,SAAkC,EAAE;AAGxC,KAAI,QAAQ,QAAQ,OAAO,QAAQ,SAAS,SAC1C,KAAI;EACF,MAAM,SAAS,KAAK,MAAM,QAAQ,KAAK;AACvC,MAAI,OAAO,WAAW,YAAY,WAAW,KAC3C,UAAS,EAAE,GAAG,QAAQ;UAEjB,GAAG;AACV,QAAM,IAAI,MAAM,2BAA4B,EAAY,UAAU;;CAKtE,MAAM,aAAa,aAAa;AAGhC,MAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,QAAQ,EAAE;EAElD,MAAM,mBAAmB,aAAa,aAAa,SAAS;AAC5D,MAAK,iBAAiB,IAAI,IAAI,IAAI,CAAC,oBAAqB,UAAU,UAAa,UAAU,KACvF;EAGF,MAAM,aAAa,aAAa;AAChC,SAAO,OAAO,mBAAmB,OAAO,YAAY,IAAI;;AAG1D,QAAO;;;;;;;;;;;AAYT,eAAsB,uBACpB,SACA,aACkC;CAClC,IAAI,SAAkC,EAAE;AAGxC,KAAI,QAAQ,QAAQ,OAAO,QAAQ,SAAS,SAC1C,KAAI;EACF,MAAM,SAAS,KAAK,MAAM,QAAQ,KAAK;AACvC,MAAI,OAAO,WAAW,YAAY,WAAW,KAC3C,UAAS,EAAE,GAAG,QAAQ;UAEjB,GAAG;AACV,QAAM,IAAI,MAAM,2BAA4B,EAAY,UAAU;;CAKtE,MAAM,eAAe,MAAM,WAAW;AACtC,KAAI,aACF,KAAI;EACF,MAAM,SAAS,KAAK,MAAM,aAAa;AACvC,MAAI,OAAO,WAAW,YAAY,WAAW,KAC3C,UAAS;GAAE,GAAG;GAAQ,GAAG;GAAQ;UAE5B,GAAG;AACV,QAAM,IAAI,MAAM,0BAA2B,EAAY,UAAU;;CAKrE,MAAM,aAAa,aAAa;AAGhC,MAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,QAAQ,EAAE;EAElD,MAAM,mBAAmB,aAAa,aAAa,SAAS;AAC5D,MAAK,iBAAiB,IAAI,IAAI,IAAI,CAAC,oBAAqB,UAAU,UAAa,UAAU,KACvF;EAGF,MAAM,aAAa,aAAa;AAChC,SAAO,OAAO,mBAAmB,OAAO,YAAY,IAAI;;AAG1D,QAAO;;;;;;;;;;AAWT,SAAgB,mBACd,OACA,QACA,WACS;AAET,KAAI,OAAO,UAAU,SACnB,QAAO;AAIT,KAAI,CAAC,OACH,QAAO;CAGT,MAAM,aAAa,OAAO;AAE1B,SAAQ,YAAR;EACE,KAAK,WAAW;GACd,MAAM,MAAM,OAAO,MAAM;AACzB,OAAI,OAAO,MAAM,IAAI,CACnB,OAAM,IAAI,MAAM,wBAAwB,UAAU,KAAK,MAAM,qBAAqB;AAEpF,UAAO,KAAK,MAAM,IAAI;;EAGxB,KAAK,UAAU;GACb,MAAM,MAAM,OAAO,MAAM;AACzB,OAAI,OAAO,MAAM,IAAI,CACnB,OAAM,IAAI,MAAM,uBAAuB,UAAU,KAAK,MAAM,oBAAoB;AAElF,UAAO;;EAGT,KAAK;AACH,OAAI,UAAU,OAAQ,QAAO;AAC7B,OAAI,UAAU,QAAS,QAAO;AAC9B,SAAM,IAAI,MAAM,wBAAwB,UAAU,KAAK,MAAM,+BAA+B;EAG9F,KAAK;EACL,KAAK,SACH,KAAI;AACF,UAAO,KAAK,MAAM,MAAM;WACjB,GAAG;GACV,MAAM,WAAW,aAAa,QAAQ,EAAE,UAAU,OAAO,EAAE;AAC3D,SAAM,IAAI,MACR,qBAAqB,UAAU,KAAK,SAAS,WACjC,MAAM,cACH,WAAW,+BACvB,eAAe,UACZ,4CACA,kDACP;;EAIL,QAEE,QAAO;;;;;;;;;AAUb,SAAgB,kBACd,YAC2C;AAC3C,SAAQ,YAAR;EACE,KAAK;EACL,KAAK,SACH,QAAO;EACT,KAAK,UACH,QAAO;EACT,KAAK;EACL,KAAK,SAEH,QAAO;EACT,QACE,QAAO"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/core/helpers/stdin.ts
|
|
3
|
+
/**
|
|
4
|
+
* stdin Helpers - Core Implementation
|
|
5
|
+
*
|
|
6
|
+
* Functions for reading from stdin in a non-blocking way.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Read content from stdin (non-blocking if TTY or no data available)
|
|
10
|
+
*
|
|
11
|
+
* @returns The stdin content, or null if no data available
|
|
12
|
+
*/
|
|
13
|
+
async function readStdin() {
|
|
14
|
+
if (process.stdin.isTTY) return null;
|
|
15
|
+
if (!await new Promise((resolve) => {
|
|
16
|
+
const timeout = setTimeout(() => {
|
|
17
|
+
process.stdin.removeAllListeners("readable");
|
|
18
|
+
resolve(false);
|
|
19
|
+
}, 100);
|
|
20
|
+
process.stdin.once("readable", () => {
|
|
21
|
+
clearTimeout(timeout);
|
|
22
|
+
resolve(true);
|
|
23
|
+
});
|
|
24
|
+
process.stdin.once("end", () => {
|
|
25
|
+
clearTimeout(timeout);
|
|
26
|
+
resolve(false);
|
|
27
|
+
});
|
|
28
|
+
if (process.stdin.readableLength > 0) {
|
|
29
|
+
clearTimeout(timeout);
|
|
30
|
+
process.stdin.removeAllListeners("readable");
|
|
31
|
+
process.stdin.removeAllListeners("end");
|
|
32
|
+
resolve(true);
|
|
33
|
+
}
|
|
34
|
+
})) return null;
|
|
35
|
+
const chunks = [];
|
|
36
|
+
for await (const chunk of process.stdin) chunks.push(chunk);
|
|
37
|
+
return Buffer.concat(chunks).toString("utf-8").trim() || null;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
//#endregion
|
|
41
|
+
exports.readStdin = readStdin;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/core/helpers/stdin.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* stdin Helpers - Core Implementation
|
|
4
|
+
*
|
|
5
|
+
* Functions for reading from stdin in a non-blocking way.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Read content from stdin (non-blocking if TTY or no data available)
|
|
9
|
+
*
|
|
10
|
+
* @returns The stdin content, or null if no data available
|
|
11
|
+
*/
|
|
12
|
+
declare function readStdin(): Promise<string | null>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { readStdin };
|
|
15
|
+
//# sourceMappingURL=stdin.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdin.d.cts","names":[],"sources":["../../../src/core/helpers/stdin.ts"],"mappings":";;AAWA;;;;;;;;;iBAAsB,SAAA,CAAA,GAAa,OAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/core/helpers/stdin.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* stdin Helpers - Core Implementation
|
|
4
|
+
*
|
|
5
|
+
* Functions for reading from stdin in a non-blocking way.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Read content from stdin (non-blocking if TTY or no data available)
|
|
9
|
+
*
|
|
10
|
+
* @returns The stdin content, or null if no data available
|
|
11
|
+
*/
|
|
12
|
+
declare function readStdin(): Promise<string | null>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { readStdin };
|
|
15
|
+
//# sourceMappingURL=stdin.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdin.d.mts","names":[],"sources":["../../../src/core/helpers/stdin.ts"],"mappings":";;AAWA;;;;;;;;;iBAAsB,SAAA,CAAA,GAAa,OAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
//#region src/core/helpers/stdin.ts
|
|
2
|
+
/**
|
|
3
|
+
* stdin Helpers - Core Implementation
|
|
4
|
+
*
|
|
5
|
+
* Functions for reading from stdin in a non-blocking way.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Read content from stdin (non-blocking if TTY or no data available)
|
|
9
|
+
*
|
|
10
|
+
* @returns The stdin content, or null if no data available
|
|
11
|
+
*/
|
|
12
|
+
async function readStdin() {
|
|
13
|
+
if (process.stdin.isTTY) return null;
|
|
14
|
+
if (!await new Promise((resolve) => {
|
|
15
|
+
const timeout = setTimeout(() => {
|
|
16
|
+
process.stdin.removeAllListeners("readable");
|
|
17
|
+
resolve(false);
|
|
18
|
+
}, 100);
|
|
19
|
+
process.stdin.once("readable", () => {
|
|
20
|
+
clearTimeout(timeout);
|
|
21
|
+
resolve(true);
|
|
22
|
+
});
|
|
23
|
+
process.stdin.once("end", () => {
|
|
24
|
+
clearTimeout(timeout);
|
|
25
|
+
resolve(false);
|
|
26
|
+
});
|
|
27
|
+
if (process.stdin.readableLength > 0) {
|
|
28
|
+
clearTimeout(timeout);
|
|
29
|
+
process.stdin.removeAllListeners("readable");
|
|
30
|
+
process.stdin.removeAllListeners("end");
|
|
31
|
+
resolve(true);
|
|
32
|
+
}
|
|
33
|
+
})) return null;
|
|
34
|
+
const chunks = [];
|
|
35
|
+
for await (const chunk of process.stdin) chunks.push(chunk);
|
|
36
|
+
return Buffer.concat(chunks).toString("utf-8").trim() || null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
//#endregion
|
|
40
|
+
export { readStdin };
|
|
41
|
+
//# sourceMappingURL=stdin.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdin.mjs","names":[],"sources":["../../../src/core/helpers/stdin.ts"],"sourcesContent":["/**\n * stdin Helpers - Core Implementation\n *\n * Functions for reading from stdin in a non-blocking way.\n */\n\n/**\n * Read content from stdin (non-blocking if TTY or no data available)\n *\n * @returns The stdin content, or null if no data available\n */\nexport async function readStdin(): Promise<string | null> {\n // Only read from stdin if it's not a TTY (i.e., there's pipe input)\n if (process.stdin.isTTY) {\n return null;\n }\n\n // Check if stdin has data available using a short timeout\n // This prevents hanging when stdin is connected but empty (e.g., through timeout command)\n const hasData = await new Promise<boolean>((resolve) => {\n // Use setImmediate to check if stdin has data on the next event loop tick\n const timeout = setTimeout(() => {\n process.stdin.removeAllListeners(\"readable\");\n resolve(false);\n }, 100); // 100ms timeout to check for data\n\n process.stdin.once(\"readable\", () => {\n clearTimeout(timeout);\n resolve(true);\n });\n\n // Also check if stdin is already ended\n process.stdin.once(\"end\", () => {\n clearTimeout(timeout);\n resolve(false);\n });\n\n // Check if there's already data in the buffer\n if (process.stdin.readableLength > 0) {\n clearTimeout(timeout);\n process.stdin.removeAllListeners(\"readable\");\n process.stdin.removeAllListeners(\"end\");\n resolve(true);\n }\n });\n\n if (!hasData) {\n return null;\n }\n\n const chunks: Buffer[] = [];\n for await (const chunk of process.stdin) {\n chunks.push(chunk as Buffer);\n }\n const content = Buffer.concat(chunks).toString(\"utf-8\").trim();\n return content || null;\n}\n"],"mappings":";;;;;;;;;;;AAWA,eAAsB,YAAoC;AAExD,KAAI,QAAQ,MAAM,MAChB,QAAO;AAgCT,KAAI,CA3BY,MAAM,IAAI,SAAkB,YAAY;EAEtD,MAAM,UAAU,iBAAiB;AAC/B,WAAQ,MAAM,mBAAmB,WAAW;AAC5C,WAAQ,MAAM;KACb,IAAI;AAEP,UAAQ,MAAM,KAAK,kBAAkB;AACnC,gBAAa,QAAQ;AACrB,WAAQ,KAAK;IACb;AAGF,UAAQ,MAAM,KAAK,aAAa;AAC9B,gBAAa,QAAQ;AACrB,WAAQ,MAAM;IACd;AAGF,MAAI,QAAQ,MAAM,iBAAiB,GAAG;AACpC,gBAAa,QAAQ;AACrB,WAAQ,MAAM,mBAAmB,WAAW;AAC5C,WAAQ,MAAM,mBAAmB,MAAM;AACvC,WAAQ,KAAK;;GAEf,CAGA,QAAO;CAGT,MAAM,SAAmB,EAAE;AAC3B,YAAW,MAAM,SAAS,QAAQ,MAChC,QAAO,KAAK,MAAgB;AAG9B,QADgB,OAAO,OAAO,OAAO,CAAC,SAAS,QAAQ,CAAC,MAAM,IAC5C"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const require_delete = require('./formatters/delete.cjs');
|
|
2
|
+
const require_exec = require('./formatters/exec.cjs');
|
|
3
|
+
const require_explain = require('./formatters/explain.cjs');
|
|
4
|
+
const require_ls = require('./formatters/ls.cjs');
|
|
5
|
+
const require_mount = require('./formatters/mount.cjs');
|
|
6
|
+
const require_read = require('./formatters/read.cjs');
|
|
7
|
+
const require_stat = require('./formatters/stat.cjs');
|
|
8
|
+
const require_write = require('./formatters/write.cjs');
|
|
9
|
+
const require_path_utils = require('../path-utils.cjs');
|
|
10
|
+
require('./path-utils.cjs');
|
|
11
|
+
const require_delete$1 = require('./commands/delete.cjs');
|
|
12
|
+
const require_stdin = require('./helpers/stdin.cjs');
|
|
13
|
+
const require_exec_args = require('./helpers/exec-args.cjs');
|
|
14
|
+
const require_exec$1 = require('./commands/exec.cjs');
|
|
15
|
+
const require_explain$1 = require('./commands/explain.cjs');
|
|
16
|
+
const require_ls$1 = require('./commands/ls.cjs');
|
|
17
|
+
const require_mount$1 = require('./commands/mount.cjs');
|
|
18
|
+
const require_read$1 = require('./commands/read.cjs');
|
|
19
|
+
const require_stat$1 = require('./commands/stat.cjs');
|
|
20
|
+
const require_write$1 = require('./commands/write.cjs');
|
|
21
|
+
const require_index = require('./commands/index.cjs');
|
|
22
|
+
const require_index$1 = require('./executor/index.cjs');
|
|
23
|
+
|
|
24
|
+
exports.AFSCommandExecutor = require_index$1.AFSCommandExecutor;
|
|
25
|
+
exports.RESERVED_OPTIONS = require_exec_args.RESERVED_OPTIONS;
|
|
26
|
+
exports.cliPathToCanonical = require_path_utils.cliPathToCanonical;
|
|
27
|
+
exports.commandFactories = require_index.commandFactories;
|
|
28
|
+
exports.createDeleteCommand = require_delete$1.createDeleteCommand;
|
|
29
|
+
exports.createExecCommand = require_exec$1.createExecCommand;
|
|
30
|
+
exports.createExplainCommand = require_explain$1.createExplainCommand;
|
|
31
|
+
exports.createLsCommand = require_ls$1.createLsCommand;
|
|
32
|
+
exports.createMountCommand = require_mount$1.createMountCommand;
|
|
33
|
+
exports.createReadCommand = require_read$1.createReadCommand;
|
|
34
|
+
exports.createStatCommand = require_stat$1.createStatCommand;
|
|
35
|
+
exports.createWriteCommand = require_write$1.createWriteCommand;
|
|
36
|
+
exports.formatDeleteOutput = require_delete.formatDeleteOutput;
|
|
37
|
+
exports.formatExecOutput = require_exec.formatExecOutput;
|
|
38
|
+
exports.formatExplainOutput = require_explain.formatExplainOutput;
|
|
39
|
+
exports.formatLsOutput = require_ls.formatLsOutput;
|
|
40
|
+
exports.formatMountListOutput = require_mount.formatMountListOutput;
|
|
41
|
+
exports.formatReadOutput = require_read.formatReadOutput;
|
|
42
|
+
exports.formatStatOutput = require_stat.formatStatOutput;
|
|
43
|
+
exports.formatWriteOutput = require_write.formatWriteOutput;
|
|
44
|
+
exports.parseCliPath = require_path_utils.parseCliPath;
|
|
45
|
+
exports.parseExecArgs = require_exec_args.parseExecArgs;
|
|
46
|
+
exports.parseExecArgsWithStdin = require_exec_args.parseExecArgsWithStdin;
|
|
47
|
+
exports.parseValueBySchema = require_exec_args.parseValueBySchema;
|
|
48
|
+
exports.readStdin = require_stdin.readStdin;
|
|
49
|
+
exports.schemaTypeToYargs = require_exec_args.schemaTypeToYargs;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { JSONSchema, ViewType } from "./types.cjs";
|
|
2
|
+
import { CommandFactory, CommandFactoryOptions, CommandOutput, FormatFunction } from "./commands/types.cjs";
|
|
3
|
+
import { DeleteArgs, createDeleteCommand } from "./commands/delete.cjs";
|
|
4
|
+
import { RESERVED_OPTIONS, parseExecArgs, parseExecArgsWithStdin, parseValueBySchema, schemaTypeToYargs } from "./helpers/exec-args.cjs";
|
|
5
|
+
import { ExecArgs, createExecCommand } from "./commands/exec.cjs";
|
|
6
|
+
import { ExplainArgs, createExplainCommand } from "./commands/explain.cjs";
|
|
7
|
+
import { LsArgs, createLsCommand } from "./commands/ls.cjs";
|
|
8
|
+
import { MountAddArgs, MountListArgs, MountRemoveArgs, createMountCommand } from "./commands/mount.cjs";
|
|
9
|
+
import { ReadArgs, createReadCommand } from "./commands/read.cjs";
|
|
10
|
+
import { StatArgs, createStatCommand } from "./commands/stat.cjs";
|
|
11
|
+
import { WriteArgs, createWriteCommand } from "./commands/write.cjs";
|
|
12
|
+
import { commandFactories } from "./commands/index.cjs";
|
|
13
|
+
import { AFSCommandExecutor, ExecuteResult, ExecutorOptions } from "./executor/index.cjs";
|
|
14
|
+
import { formatDeleteOutput } from "./formatters/delete.cjs";
|
|
15
|
+
import { formatExecOutput } from "./formatters/exec.cjs";
|
|
16
|
+
import { formatExplainOutput } from "./formatters/explain.cjs";
|
|
17
|
+
import { FormatLsOptions, formatLsOutput } from "./formatters/ls.cjs";
|
|
18
|
+
import { formatMountListOutput } from "./formatters/mount.cjs";
|
|
19
|
+
import { formatReadOutput } from "./formatters/read.cjs";
|
|
20
|
+
import { formatStatOutput } from "./formatters/stat.cjs";
|
|
21
|
+
import { formatWriteOutput } from "./formatters/write.cjs";
|
|
22
|
+
import { readStdin } from "./helpers/stdin.cjs";
|
|
23
|
+
import { ParsedCliPath, cliPathToCanonical, parseCliPath } from "../path-utils.cjs";
|
|
24
|
+
export { AFSCommandExecutor, type CommandFactory, type CommandFactoryOptions, type CommandOutput, type DeleteArgs, type ExecArgs, type ExecuteResult, type ExecutorOptions, type ExplainArgs, type FormatFunction, type FormatLsOptions, type JSONSchema, type LsArgs, type MountAddArgs, type MountListArgs, type MountRemoveArgs, type ParsedCliPath, RESERVED_OPTIONS, type ReadArgs, type StatArgs, type ViewType, type WriteArgs, cliPathToCanonical, commandFactories, createDeleteCommand, createExecCommand, createExplainCommand, createLsCommand, createMountCommand, createReadCommand, createStatCommand, createWriteCommand, formatDeleteOutput, formatExecOutput, formatExplainOutput, formatLsOutput, formatMountListOutput, formatReadOutput, formatStatOutput, formatWriteOutput, parseCliPath, parseExecArgs, parseExecArgsWithStdin, parseValueBySchema, readStdin, schemaTypeToYargs };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { JSONSchema, ViewType } from "./types.mjs";
|
|
2
|
+
import { CommandFactory, CommandFactoryOptions, CommandOutput, FormatFunction } from "./commands/types.mjs";
|
|
3
|
+
import { DeleteArgs, createDeleteCommand } from "./commands/delete.mjs";
|
|
4
|
+
import { RESERVED_OPTIONS, parseExecArgs, parseExecArgsWithStdin, parseValueBySchema, schemaTypeToYargs } from "./helpers/exec-args.mjs";
|
|
5
|
+
import { ExecArgs, createExecCommand } from "./commands/exec.mjs";
|
|
6
|
+
import { ExplainArgs, createExplainCommand } from "./commands/explain.mjs";
|
|
7
|
+
import { LsArgs, createLsCommand } from "./commands/ls.mjs";
|
|
8
|
+
import { MountAddArgs, MountListArgs, MountRemoveArgs, createMountCommand } from "./commands/mount.mjs";
|
|
9
|
+
import { ReadArgs, createReadCommand } from "./commands/read.mjs";
|
|
10
|
+
import { StatArgs, createStatCommand } from "./commands/stat.mjs";
|
|
11
|
+
import { WriteArgs, createWriteCommand } from "./commands/write.mjs";
|
|
12
|
+
import { commandFactories } from "./commands/index.mjs";
|
|
13
|
+
import { AFSCommandExecutor, ExecuteResult, ExecutorOptions } from "./executor/index.mjs";
|
|
14
|
+
import { formatDeleteOutput } from "./formatters/delete.mjs";
|
|
15
|
+
import { formatExecOutput } from "./formatters/exec.mjs";
|
|
16
|
+
import { formatExplainOutput } from "./formatters/explain.mjs";
|
|
17
|
+
import { FormatLsOptions, formatLsOutput } from "./formatters/ls.mjs";
|
|
18
|
+
import { formatMountListOutput } from "./formatters/mount.mjs";
|
|
19
|
+
import { formatReadOutput } from "./formatters/read.mjs";
|
|
20
|
+
import { formatStatOutput } from "./formatters/stat.mjs";
|
|
21
|
+
import { formatWriteOutput } from "./formatters/write.mjs";
|
|
22
|
+
import "./formatters/index.mjs";
|
|
23
|
+
import { readStdin } from "./helpers/stdin.mjs";
|
|
24
|
+
import { ParsedCliPath, cliPathToCanonical, parseCliPath } from "../path-utils.mjs";
|
|
25
|
+
export { AFSCommandExecutor, type CommandFactory, type CommandFactoryOptions, type CommandOutput, type DeleteArgs, type ExecArgs, type ExecuteResult, type ExecutorOptions, type ExplainArgs, type FormatFunction, type FormatLsOptions, type JSONSchema, type LsArgs, type MountAddArgs, type MountListArgs, type MountRemoveArgs, type ParsedCliPath, RESERVED_OPTIONS, type ReadArgs, type StatArgs, type ViewType, type WriteArgs, cliPathToCanonical, commandFactories, createDeleteCommand, createExecCommand, createExplainCommand, createLsCommand, createMountCommand, createReadCommand, createStatCommand, createWriteCommand, formatDeleteOutput, formatExecOutput, formatExplainOutput, formatLsOutput, formatMountListOutput, formatReadOutput, formatStatOutput, formatWriteOutput, parseCliPath, parseExecArgs, parseExecArgsWithStdin, parseValueBySchema, readStdin, schemaTypeToYargs };
|