@danielsimonjr/mathts-workbook 0.1.8 → 0.2.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/README.md +222 -117
- package/dist/chunk-TS2WDJ7W.js +1239 -0
- package/dist/cli.d.ts +39 -0
- package/dist/cli.js +1650 -79
- package/dist/index.d.ts +255 -9
- package/dist/index.js +29 -1
- package/package.json +64 -62
- package/dist/chunk-L7UWFWMV.js +0 -269
package/dist/cli.d.ts
CHANGED
|
@@ -1 +1,40 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* MathTS Workbook CLI
|
|
4
|
+
*
|
|
5
|
+
* Command handlers are pure functions returning `{ stdout, stderr, exitCode }`
|
|
6
|
+
* (no direct console / process.exit) so they can be unit-tested. The thin
|
|
7
|
+
* `main()` at the bottom wires them to the real streams, and only runs when
|
|
8
|
+
* this file is the process entry point.
|
|
9
|
+
*/
|
|
10
|
+
interface CommandResult {
|
|
11
|
+
stdout: string;
|
|
12
|
+
stderr: string;
|
|
13
|
+
exitCode: number;
|
|
14
|
+
}
|
|
15
|
+
declare function runCommand(args: string[]): Promise<CommandResult>;
|
|
16
|
+
declare function validateCommand(args: string[]): CommandResult;
|
|
17
|
+
declare function describeCommand(args: string[]): CommandResult;
|
|
18
|
+
declare function capabilitiesCommand(args: string[]): CommandResult;
|
|
19
|
+
declare function templatesCommand(args: string[]): CommandResult;
|
|
20
|
+
declare function functionsCommand(args: string[]): CommandResult;
|
|
21
|
+
declare function metaCommand(args: string[]): CommandResult;
|
|
22
|
+
declare function exportCommand(args: string[]): Promise<CommandResult>;
|
|
23
|
+
/**
|
|
24
|
+
* Run the JSON-RPC-over-stdio server loop until `shutdown`, stdin EOF, or a
|
|
25
|
+
* termination signal. NDJSON via readline (chunked-input / CRLF safe). Events
|
|
26
|
+
* for a run are flushed before that run's response (not mid-run in v1).
|
|
27
|
+
*/
|
|
28
|
+
declare function runServer(input?: NodeJS.ReadableStream, output?: NodeJS.WritableStream): Promise<void>;
|
|
29
|
+
declare function serveCommand(): Promise<CommandResult>;
|
|
30
|
+
declare function graphCommand(args: string[]): CommandResult;
|
|
31
|
+
declare function stripCommand(args: string[]): CommandResult;
|
|
32
|
+
declare function newCommand(args: string[]): CommandResult;
|
|
33
|
+
declare function importCommand(args: string[]): CommandResult;
|
|
34
|
+
declare function cellCommand(args: string[]): CommandResult;
|
|
35
|
+
/**
|
|
36
|
+
* Route argv to a command handler. Pure — returns a CommandResult.
|
|
37
|
+
*/
|
|
38
|
+
declare function dispatch(argv: string[]): Promise<CommandResult>;
|
|
39
|
+
|
|
40
|
+
export { type CommandResult, capabilitiesCommand, cellCommand, describeCommand, dispatch, exportCommand, functionsCommand, graphCommand, importCommand, metaCommand, newCommand, runCommand, runServer, serveCommand, stripCommand, templatesCommand, validateCommand };
|