@runa-cmd/core 0.2.0-beta.5 → 0.2.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/CHANGELOG.md +162 -0
- package/README.md +100 -9
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +102 -14
- package/dist/cli.js.map +1 -1
- package/dist/command.d.ts +1 -1
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +3 -3
- package/dist/command.js.map +1 -1
- package/dist/config/loader.d.ts +2 -2
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +8 -5
- package/dist/config/loader.js.map +1 -1
- package/dist/config/scope.js +2 -2
- package/dist/config/scope.js.map +1 -1
- package/dist/errors.d.ts +83 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +114 -11
- package/dist/errors.js.map +1 -1
- package/dist/help.d.ts.map +1 -1
- package/dist/help.js +29 -8
- package/dist/help.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +1 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +1 -0
- package/dist/internal.js.map +1 -1
- package/dist/parse/resolve.d.ts +7 -0
- package/dist/parse/resolve.d.ts.map +1 -1
- package/dist/parse/resolve.js +140 -25
- package/dist/parse/resolve.js.map +1 -1
- package/dist/parse/schema-adapter.d.ts +2 -0
- package/dist/parse/schema-adapter.d.ts.map +1 -1
- package/dist/parse/schema-adapter.js.map +1 -1
- package/dist/parse/variadic.js +3 -3
- package/dist/parse/variadic.js.map +1 -1
- package/dist/plugin.d.ts +14 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +111 -20
- package/dist/plugin.js.map +1 -1
- package/dist/stop.d.ts +2 -0
- package/dist/stop.d.ts.map +1 -1
- package/dist/stop.js +19 -2
- package/dist/stop.js.map +1 -1
- package/dist/testing.d.ts +7 -0
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +13 -0
- package/dist/testing.js.map +1 -1
- package/dist/tool-channel.d.ts +5 -1
- package/dist/tool-channel.d.ts.map +1 -1
- package/dist/tool-channel.js.map +1 -1
- package/dist/trace.d.ts +24 -0
- package/dist/trace.d.ts.map +1 -1
- package/dist/trace.js.map +1 -1
- package/dist/types.d.ts +164 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +14 -0
- package/dist/types.js.map +1 -1
- package/package.json +2 -2
package/dist/trace.d.ts
CHANGED
|
@@ -5,28 +5,52 @@
|
|
|
5
5
|
* RUNA_DEBUG=1 prints it while it happens.
|
|
6
6
|
*/
|
|
7
7
|
import type { HookName } from './types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Where a value came from: the terminal, env, the config file, its default, or
|
|
10
|
+
* the input of a tool call through MCP.
|
|
11
|
+
*/
|
|
8
12
|
export type ValueSource = 'cli' | 'env' | 'config' | 'default' | 'input';
|
|
13
|
+
/**
|
|
14
|
+
* One thing a run did: the config file it read, where an option came from, a
|
|
15
|
+
* hook and how long it took, the command, or something written. Its shape isn't
|
|
16
|
+
* part of the versioning contract.
|
|
17
|
+
*/
|
|
9
18
|
export type TraceEvent = {
|
|
19
|
+
/** The config file was looked for */
|
|
10
20
|
step: 'config';
|
|
21
|
+
/** The file it read, if it found one */
|
|
11
22
|
file?: string;
|
|
12
23
|
} | {
|
|
24
|
+
/** An option got its value */
|
|
13
25
|
step: 'option';
|
|
26
|
+
/** Its key */
|
|
14
27
|
name: string;
|
|
28
|
+
/** Whether it's a global option or the command's own */
|
|
15
29
|
scope: 'global' | 'command';
|
|
30
|
+
/** Where the value came from */
|
|
16
31
|
source: ValueSource;
|
|
17
32
|
/** Left out when it comes from env: it can be a secret */
|
|
18
33
|
value?: unknown;
|
|
19
34
|
} | {
|
|
35
|
+
/** A hook ran, if it had handlers */
|
|
20
36
|
step: 'hook';
|
|
37
|
+
/** Which one */
|
|
21
38
|
name: HookName;
|
|
39
|
+
/** How long its handlers took */
|
|
22
40
|
ms: number;
|
|
23
41
|
} | {
|
|
42
|
+
/** The command ran */
|
|
24
43
|
step: 'run';
|
|
44
|
+
/** Its whole path */
|
|
25
45
|
command: string[];
|
|
46
|
+
/** How long it took, with its middleware */
|
|
26
47
|
ms: number;
|
|
27
48
|
} | {
|
|
49
|
+
/** Something was written */
|
|
28
50
|
step: 'output';
|
|
51
|
+
/** Where */
|
|
29
52
|
stream: 'stdout' | 'stderr';
|
|
53
|
+
/** What */
|
|
30
54
|
text: string;
|
|
31
55
|
};
|
|
32
56
|
/** One line per event. Never a value: this output ends up in CI logs. */
|
package/dist/trace.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../src/trace.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;AAEzE,MAAM,MAAM,UAAU,GACnB;
|
|
1
|
+
{"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../src/trace.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;AAEzE;;;;GAIG;AACH,MAAM,MAAM,UAAU,GACnB;IACA,qCAAqC;IACrC,IAAI,EAAE,QAAQ,CAAC;IACf,wCAAwC;IACxC,IAAI,CAAC,EAAE,MAAM,CAAC;CACb,GACD;IACA,8BAA8B;IAC9B,IAAI,EAAE,QAAQ,CAAC;IACf,cAAc;IACd,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,KAAK,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC5B,gCAAgC;IAChC,MAAM,EAAE,WAAW,CAAC;IACpB,0DAA0D;IAC1D,KAAK,CAAC,EAAE,OAAO,CAAC;CACf,GACD;IACA,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB;IAChB,IAAI,EAAE,QAAQ,CAAC;IACf,iCAAiC;IACjC,EAAE,EAAE,MAAM,CAAC;CACV,GACD;IACA,sBAAsB;IACtB,IAAI,EAAE,KAAK,CAAC;IACZ,qBAAqB;IACrB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,4CAA4C;IAC5C,EAAE,EAAE,MAAM,CAAC;CACV,GACD;IACA,4BAA4B;IAC5B,IAAI,EAAE,QAAQ,CAAC;IACf,YAAY;IACZ,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC5B,WAAW;IACX,IAAI,EAAE,MAAM,CAAC;CACZ,CAAC;AAEL,yEAAyE;AACzE,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,CAa/D;AAED,0EAA0E;AAC1E,wBAAgB,YAAY,CAC3B,KAAK,EAAE,QAAQ,GAAG,SAAS,EAC3B,KAAK,EAAE,MAAM,EAAE,EACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GAClC,UAAU,EAAE,CAMd"}
|
package/dist/trace.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trace.js","sourceRoot":"","sources":["../src/trace.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"trace.js","sourceRoot":"","sources":["../src/trace.ts"],"names":[],"mappings":"AA+DA,yEAAyE;AACzE,MAAM,UAAU,SAAS,CAAC,KAAiB;IAC1C,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,QAAQ;YACZ,OAAO,gBAAgB,KAAK,CAAC,IAAI,IAAI,WAAW,EAAE,CAAC;QACpD,KAAK,QAAQ;YACZ,OAAO,gBAAgB,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC;QACvD,KAAK,MAAM;YACV,OAAO,cAAc,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,EAAE,IAAI,CAAC;QACjD,KAAK,KAAK;YACT,OAAO,aAAa,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,EAAE,IAAI,CAAC;QAC7D;YACC,OAAO,SAAS,CAAC;IACnB,CAAC;AACF,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,YAAY,CAC3B,KAA2B,EAC3B,KAAe,EACf,MAA+B,EAC/B,OAAoC;IAEpC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACzB,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,SAAS,CAAC;QAC1C,MAAM,KAAK,GAAG,EAAE,IAAI,EAAE,QAAiB,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;QAC/D,OAAO,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;IACrE,CAAC,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
* This is a type-only module — no runtime code.
|
|
6
6
|
*/
|
|
7
7
|
import type { ZodType, z } from 'zod';
|
|
8
|
+
/**
|
|
9
|
+
* What an option needs besides its schema: aliases, env, help and config.
|
|
10
|
+
* It goes in `meta.options`, by the option's key, so the Zod schema stays pure.
|
|
11
|
+
*/
|
|
8
12
|
export interface OptionMeta {
|
|
9
13
|
/** CLI aliases, e.g. ['-e', '--environment'] */
|
|
10
14
|
alias?: string[];
|
|
@@ -26,26 +30,38 @@ export interface OptionMeta {
|
|
|
26
30
|
}
|
|
27
31
|
/** A command as it reaches run() and hooks: by then, it always has its name. */
|
|
28
32
|
export type NamedCommandMeta<TOptions extends Record<string, ZodType> = Record<string, ZodType>> = CommandMeta<TOptions> & {
|
|
33
|
+
/** The command's own name: the last part of its path */
|
|
29
34
|
name: string;
|
|
30
35
|
/** The whole path, e.g. ['tag', 'add']: `name` alone can't tell it from `add` */
|
|
31
36
|
path: string[];
|
|
32
37
|
};
|
|
38
|
+
/** What a command says about itself: its name, description and option metadata. */
|
|
33
39
|
export interface CommandMeta<TOptions extends Record<string, ZodType> = Record<string, ZodType>> {
|
|
34
40
|
/**
|
|
35
41
|
* The name of a CLI of one command, which runCLI requires. In defineCLI, the
|
|
36
42
|
* key names the command: this is optional there, and has to match it.
|
|
37
43
|
*/
|
|
38
44
|
name?: string;
|
|
45
|
+
/** One line, shown in help and read by a model as the tool's description */
|
|
39
46
|
description: string;
|
|
47
|
+
/**
|
|
48
|
+
* Printed by `--version` when the command is the CLI, as with runCLI(). In a
|
|
49
|
+
* command of defineCLI it would do nothing, so it stops the CLI at startup:
|
|
50
|
+
* the version goes in defineCLI's meta.
|
|
51
|
+
*/
|
|
40
52
|
version?: string;
|
|
41
53
|
/** Option metadata — keys MUST be a subset of TOptions keys */
|
|
42
54
|
options?: {
|
|
43
55
|
[K in keyof TOptions]?: OptionMeta;
|
|
44
56
|
};
|
|
45
57
|
}
|
|
58
|
+
/** What a CLI says about itself. */
|
|
46
59
|
export interface CLIMeta {
|
|
60
|
+
/** The program name, as people type it. It names the CLI in help and in its config file */
|
|
47
61
|
name: string;
|
|
62
|
+
/** Printed by `--version` */
|
|
48
63
|
version?: string;
|
|
64
|
+
/** One line, shown at the top of the help */
|
|
49
65
|
description?: string;
|
|
50
66
|
}
|
|
51
67
|
/** Infer args types from a record of Zod schemas */
|
|
@@ -58,10 +74,15 @@ export type InferOptions<T extends Record<string, ZodType>> = {
|
|
|
58
74
|
};
|
|
59
75
|
/** What the run() handler receives */
|
|
60
76
|
export interface RunContext<TArgs extends Record<string, ZodType> = Record<string, ZodType>, TOptions extends Record<string, ZodType> = Record<string, ZodType>> {
|
|
77
|
+
/** The positional arguments, validated and typed by their schemas */
|
|
61
78
|
args: InferArgs<TArgs>;
|
|
79
|
+
/** The options, from the terminal, env, the config file or their defaults, validated and typed */
|
|
62
80
|
options: InferOptions<TOptions>;
|
|
81
|
+
/** The CLI's global options, untyped: the command doesn't declare them */
|
|
63
82
|
globalOptions: Record<string, unknown>;
|
|
83
|
+
/** The command that runs, with its whole path */
|
|
64
84
|
command: NamedCommandMeta<TOptions>;
|
|
85
|
+
/** The arguments of the process, as given, global options and what follows `--` included */
|
|
65
86
|
rawArgs: string[];
|
|
66
87
|
/** What's left after `--`, verbatim and unvalidated, if the command declares `rest: true`. Else `[]` */
|
|
67
88
|
rest: string[];
|
|
@@ -77,13 +98,19 @@ export type RunReturn<TOutput, TResult = void> = TOutput extends ZodType ? z.inf
|
|
|
77
98
|
export type FormatContext<TArgs extends Record<string, ZodType> = Record<string, ZodType>, TOptions extends Record<string, ZodType> = Record<string, ZodType>> = Pick<RunContext<TArgs, TOptions>, 'args' | 'options'>;
|
|
78
99
|
/** What format() receives: the data, once it's no longer a promise. */
|
|
79
100
|
export type RunResult<TOutput, TResult> = TOutput extends ZodType ? z.infer<TOutput> : TResult;
|
|
101
|
+
/** What defineCommand() takes. */
|
|
80
102
|
export interface CommandConfig<TArgs extends Record<string, ZodType> = Record<string, ZodType>, TOptions extends Record<string, ZodType> = Record<string, ZodType>, TOutput extends ZodType | undefined = undefined, TResult = void> {
|
|
103
|
+
/** Its name, description and option metadata */
|
|
81
104
|
meta: CommandMeta<TOptions>;
|
|
105
|
+
/** Positional arguments, in the order of their keys. Only the last one can be a z.array() */
|
|
82
106
|
args?: TArgs;
|
|
107
|
+
/** Named options. A key in camelCase is a flag in kebab-case: `darkColor` is `--dark-color` */
|
|
83
108
|
options?: TOptions;
|
|
109
|
+
/** The schema of what run() returns. It's checked, and an MCP tool gets it as structured data */
|
|
84
110
|
output?: TOutput;
|
|
85
111
|
/** Take what's left after `--` in `ctx.rest`. Without it, that's a usage error */
|
|
86
112
|
rest?: boolean;
|
|
113
|
+
/** What the command does. Return the data, and Runa shows it */
|
|
87
114
|
run: (ctx: RunContext<TArgs, TOptions>) => RunReturn<TOutput, TResult>;
|
|
88
115
|
/**
|
|
89
116
|
* What a person reads at the terminal, from what run() returned. A tool gets
|
|
@@ -94,20 +121,35 @@ export interface CommandConfig<TArgs extends Record<string, ZodType> = Record<st
|
|
|
94
121
|
/** False if this is only for people at a terminal: an MCP server won't offer it */
|
|
95
122
|
tool?: boolean;
|
|
96
123
|
}
|
|
124
|
+
/** A command, as defineCommand() returns it. Its fields are those of CommandConfig. */
|
|
97
125
|
export interface Command {
|
|
126
|
+
/** Marks the object as a command */
|
|
98
127
|
readonly _type: 'runa:command';
|
|
128
|
+
/** See CommandConfig.meta */
|
|
99
129
|
readonly meta: CommandMeta;
|
|
130
|
+
/** See CommandConfig.args */
|
|
100
131
|
readonly args?: Record<string, ZodType>;
|
|
132
|
+
/** See CommandConfig.options */
|
|
101
133
|
readonly options?: Record<string, ZodType>;
|
|
134
|
+
/** See CommandConfig.output */
|
|
102
135
|
readonly output?: ZodType;
|
|
136
|
+
/** See CommandConfig.rest */
|
|
103
137
|
readonly rest?: boolean;
|
|
138
|
+
/** See CommandConfig.run */
|
|
104
139
|
readonly run: (ctx: RunContext) => unknown;
|
|
140
|
+
/** See CommandConfig.format */
|
|
105
141
|
readonly format?: (result: unknown, context: FormatContext) => string;
|
|
142
|
+
/** See CommandConfig.tool */
|
|
106
143
|
readonly tool?: boolean;
|
|
107
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* The commands of a CLI, by name. A nested object is a group:
|
|
147
|
+
* `{ config: { get, set } }` gives `tool config get` and `tool config set`.
|
|
148
|
+
*/
|
|
108
149
|
export interface CommandTree {
|
|
109
150
|
[key: string]: Command | CommandTree;
|
|
110
151
|
}
|
|
152
|
+
/** Where and how a CLI finds its config file. */
|
|
111
153
|
export interface CLIConfigOptions {
|
|
112
154
|
/** Config file base name, e.g. 'mycli' → looks for mycli.config.* */
|
|
113
155
|
name: string;
|
|
@@ -116,16 +158,26 @@ export interface CLIConfigOptions {
|
|
|
116
158
|
/** Directories to search for config files. Default: ['.', '~'] */
|
|
117
159
|
searchPaths?: string[];
|
|
118
160
|
}
|
|
161
|
+
/** What defineCLI() takes. */
|
|
119
162
|
export interface CLIConfig {
|
|
163
|
+
/** Its name, version and description */
|
|
120
164
|
meta: CLIMeta;
|
|
165
|
+
/** The commands, by the name people type */
|
|
121
166
|
commands: CommandTree;
|
|
167
|
+
/** Plugins, or functions that import one, which load when the CLI starts */
|
|
122
168
|
plugins?: Array<PluginConfig | (() => Promise<{
|
|
169
|
+
/** The plugin, as the module's default export */
|
|
123
170
|
default: PluginConfig;
|
|
124
171
|
}>)>;
|
|
172
|
+
/** Middleware around every command. The first one is the outermost */
|
|
125
173
|
middleware?: Middleware[];
|
|
174
|
+
/** Read a config file. Without it, the CLI reads none */
|
|
126
175
|
config?: CLIConfigOptions;
|
|
176
|
+
/** Options every command takes, read in `ctx.globalOptions` */
|
|
127
177
|
globalOptions?: Record<string, ZodType>;
|
|
178
|
+
/** Metadata of the global options, by key, as `meta.options` for a command */
|
|
128
179
|
globalMeta?: {
|
|
180
|
+
/** Aliases, env, help and config of each global option, by its key */
|
|
129
181
|
options?: Record<string, OptionMeta>;
|
|
130
182
|
};
|
|
131
183
|
/**
|
|
@@ -140,37 +192,72 @@ export interface RunCLIOptions extends Omit<CLIConfig, 'meta' | 'commands'> {
|
|
|
140
192
|
/** Arguments to parse. Default: process.argv.slice(2) */
|
|
141
193
|
argv?: string[];
|
|
142
194
|
}
|
|
195
|
+
/** A CLI, as defineCLI() returns it. */
|
|
143
196
|
export interface CLI {
|
|
197
|
+
/** Marks the object as a CLI */
|
|
144
198
|
readonly _type: 'runa:cli';
|
|
199
|
+
/** What it was defined with */
|
|
145
200
|
readonly config: CLIConfig;
|
|
201
|
+
/**
|
|
202
|
+
* Run it, and end the process with its exit code. It's the entry point of a
|
|
203
|
+
* process: call it once, from main.ts. To run it in a test, use testCLI().
|
|
204
|
+
*
|
|
205
|
+
* @param argv - Default: process.argv.slice(2)
|
|
206
|
+
*/
|
|
146
207
|
run(argv?: string[]): Promise<void>;
|
|
147
208
|
}
|
|
209
|
+
/** What a plugin says about itself. */
|
|
148
210
|
export interface PluginMeta {
|
|
211
|
+
/** Unique among the plugins of a CLI, and what errors and `dependencies` name it by */
|
|
149
212
|
name: string;
|
|
150
213
|
/** Informative only: Runa does not read it. Compatibility belongs in peerDependencies */
|
|
151
214
|
version?: string;
|
|
215
|
+
/** One line about what it does */
|
|
152
216
|
description?: string;
|
|
153
217
|
/** Names of other plugins this depends on */
|
|
154
218
|
dependencies?: string[];
|
|
155
219
|
}
|
|
220
|
+
/**
|
|
221
|
+
* What a plugin adds to the CLI, declared up front. Using a method without its
|
|
222
|
+
* capability stops the CLI at startup, naming the plugin.
|
|
223
|
+
*/
|
|
156
224
|
export interface PluginCapabilities {
|
|
225
|
+
/** Allows `api.addCommand()` */
|
|
157
226
|
addCommands?: boolean;
|
|
227
|
+
/** Allows `api.addGlobalOption()` */
|
|
158
228
|
addGlobalOptions?: boolean;
|
|
229
|
+
/** Allows `api.addMiddleware()` */
|
|
159
230
|
addMiddleware?: boolean;
|
|
231
|
+
/** Allows `api.replaceHelp()` */
|
|
160
232
|
replaceHelp?: boolean;
|
|
161
233
|
}
|
|
234
|
+
/** A plugin, as definePlugin() takes it. */
|
|
162
235
|
export interface PluginConfig {
|
|
236
|
+
/** Its name and what it depends on */
|
|
163
237
|
meta: PluginMeta;
|
|
238
|
+
/** What it adds to the CLI */
|
|
164
239
|
capabilities?: PluginCapabilities;
|
|
240
|
+
/** Extends the CLI when it starts: add options and commands, and register hooks */
|
|
165
241
|
setup: (api: PluginAPI) => void | Promise<void>;
|
|
242
|
+
/**
|
|
243
|
+
* Releases what setup() opened. It runs after the `cleanup` hook, and also
|
|
244
|
+
* when the CLI fails to start
|
|
245
|
+
*/
|
|
166
246
|
cleanup?: () => void | Promise<void>;
|
|
167
247
|
}
|
|
248
|
+
/** What a plugin's setup() receives to extend the CLI. */
|
|
168
249
|
export interface PluginAPI {
|
|
250
|
+
/** Add a command at the root. Needs the `addCommands` capability */
|
|
169
251
|
addCommand(name: string, command: Command): void;
|
|
252
|
+
/** Add an option every command takes. Needs the `addGlobalOptions` capability */
|
|
170
253
|
addGlobalOption(name: string, schema: ZodType, meta?: OptionMeta): void;
|
|
254
|
+
/** Add a middleware around every command. Needs the `addMiddleware` capability */
|
|
171
255
|
addMiddleware(middleware: Middleware): void;
|
|
256
|
+
/** Run a handler at a step of every run */
|
|
172
257
|
hook(name: HookName, handler: HookHandler): void;
|
|
258
|
+
/** The CLI as help and MCP describe it: commands, args and options */
|
|
173
259
|
getSchema(): CLISchema;
|
|
260
|
+
/** The command tree, as it is now: what other plugins added included */
|
|
174
261
|
getCommands(): CommandTree;
|
|
175
262
|
/** The config file of the CLI, if it has one. With a path, only that command's values */
|
|
176
263
|
getConfigValues(commandPath?: string[]): Promise<Record<string, unknown> | undefined>;
|
|
@@ -184,114 +271,191 @@ export type HelpTarget = CLISchema | CommandSchema;
|
|
|
184
271
|
* stdout if the person asked for it, stderr if there was nothing to run.
|
|
185
272
|
*/
|
|
186
273
|
export type HelpHandler = (target: HelpTarget, output: NodeJS.WritableStream) => void | Promise<void>;
|
|
274
|
+
/** The steps of a run a plugin can hook into, in the order they happen. */
|
|
187
275
|
export declare const HOOK_NAMES: {
|
|
276
|
+
/** First of all, before anything is parsed: a handler may rewrite `ctx.rawArgs` */
|
|
188
277
|
readonly BEFORE_PARSE: 'beforeParse';
|
|
278
|
+
/** The global options are read. Help and `--mcp` stop the run here */
|
|
189
279
|
readonly ON_GLOBAL_FLAGS: 'onGlobalFlags';
|
|
280
|
+
/** The command and its values are known */
|
|
190
281
|
readonly AFTER_PARSE: 'afterParse';
|
|
282
|
+
/** Right before the middleware and the command */
|
|
191
283
|
readonly BEFORE_RUN: 'beforeRun';
|
|
284
|
+
/** The command ended well. It doesn't run after a failure */
|
|
192
285
|
readonly AFTER_RUN: 'afterRun';
|
|
286
|
+
/** Something failed: `ctx.error` says what. Set `ctx.handled` to print nothing */
|
|
193
287
|
readonly ON_ERROR: 'onError';
|
|
288
|
+
/** Last, always: after an error and after Ctrl+C too */
|
|
194
289
|
readonly CLEANUP: 'cleanup';
|
|
195
290
|
};
|
|
291
|
+
/** The name of a hook: one of the values of HOOK_NAMES. */
|
|
196
292
|
export type HookName = (typeof HOOK_NAMES)[keyof typeof HOOK_NAMES];
|
|
197
293
|
/** Where a run comes from: a person or script at the CLI, or a tool call. */
|
|
198
294
|
export type Invocation = {
|
|
295
|
+
/** A person or a script ran the CLI */
|
|
199
296
|
surface: 'cli';
|
|
200
297
|
} | {
|
|
298
|
+
/** A model called it as a tool through MCP: what it writes reaches the model */
|
|
201
299
|
surface: 'tool';
|
|
300
|
+
/** The name of the tool that was called */
|
|
202
301
|
tool: string;
|
|
203
302
|
};
|
|
303
|
+
/** What a hook handler receives. What it has grows as the run goes on. */
|
|
204
304
|
export interface HookContext {
|
|
305
|
+
/** The CLI's name, version and description */
|
|
205
306
|
cli: CLIMeta;
|
|
307
|
+
/** A person or script at the CLI, or a tool call through MCP */
|
|
206
308
|
invocation: Invocation;
|
|
309
|
+
/**
|
|
310
|
+
* In beforeParse, the whole argv, which a handler may rewrite before it's
|
|
311
|
+
* parsed. From onGlobalFlags on, only the command's part: without the global
|
|
312
|
+
* options, and without what follows `--`. run() gets the original as it was.
|
|
313
|
+
*/
|
|
207
314
|
rawArgs: string[];
|
|
208
315
|
/** Aborted when the run must stop */
|
|
209
316
|
signal: AbortSignal;
|
|
317
|
+
/** The global options, from onGlobalFlags on */
|
|
210
318
|
globalOptions?: Record<string, unknown>;
|
|
319
|
+
/** The command that runs, from afterParse on */
|
|
211
320
|
command?: NamedCommandMeta;
|
|
321
|
+
/** Its positional arguments, from afterParse on */
|
|
212
322
|
args?: Record<string, unknown>;
|
|
323
|
+
/** Its options, from afterParse on */
|
|
213
324
|
options?: Record<string, unknown>;
|
|
325
|
+
/** What failed, in onError and in cleanup after a failure */
|
|
214
326
|
error?: Error;
|
|
215
327
|
/** Call this in onGlobalFlags to short-circuit the lifecycle */
|
|
216
328
|
shortCircuit?: () => void;
|
|
217
329
|
/** Set this in onError to prevent default error output */
|
|
218
330
|
handled?: boolean;
|
|
219
331
|
}
|
|
332
|
+
/** A hook handler. It can be async, and the run waits for it. */
|
|
220
333
|
export type HookHandler = (ctx: HookContext) => void | Promise<void>;
|
|
334
|
+
/** What a middleware receives. */
|
|
221
335
|
export interface MiddlewareContext {
|
|
336
|
+
/** Run the command, and the middleware after this one. Always `await` it, or throw to stop */
|
|
222
337
|
next: () => Promise<void>;
|
|
338
|
+
/** The CLI's global options. A middleware doesn't see the command's own */
|
|
223
339
|
globalOptions: Record<string, unknown>;
|
|
224
340
|
/** The command that runs, with its whole path */
|
|
225
341
|
command: NamedCommandMeta;
|
|
226
342
|
}
|
|
343
|
+
/** The function a middleware runs. */
|
|
227
344
|
export type MiddlewareFn = (ctx: MiddlewareContext) => Promise<void>;
|
|
345
|
+
/** A middleware, as defineMiddleware() returns it. */
|
|
228
346
|
export interface Middleware {
|
|
347
|
+
/** Marks the object as a middleware */
|
|
229
348
|
readonly _type: 'runa:middleware';
|
|
349
|
+
/** What it runs around a command */
|
|
230
350
|
readonly handler: MiddlewareFn;
|
|
231
351
|
}
|
|
352
|
+
/** Reads config files of another format than JSON, which Runa reads by itself. */
|
|
232
353
|
export interface ConfigLoader {
|
|
233
354
|
/** File extensions this loader handles, e.g. ['.json'] */
|
|
234
355
|
extensions: string[];
|
|
235
356
|
/** Read and parse the config file at the given path */
|
|
236
357
|
load(filePath: string): Promise<unknown>;
|
|
237
358
|
}
|
|
359
|
+
/** A CLI described as data, as help and MCP read it. */
|
|
238
360
|
export interface CLISchema {
|
|
361
|
+
/** The CLI's name, version and description */
|
|
239
362
|
meta: CLIMeta;
|
|
363
|
+
/** Its commands, groups included */
|
|
240
364
|
commands: CommandSchema[];
|
|
365
|
+
/** The options every command takes */
|
|
241
366
|
globalOptions: OptionSchema[];
|
|
242
367
|
/** Name of the command that runs without a subcommand: set by runCLI() */
|
|
243
368
|
root?: string;
|
|
244
369
|
}
|
|
370
|
+
/** A command, or a group of commands, described as data. */
|
|
245
371
|
export interface CommandSchema {
|
|
372
|
+
/** Its own name */
|
|
246
373
|
name: string;
|
|
374
|
+
/** One line about what it does */
|
|
247
375
|
description: string;
|
|
248
376
|
/** Full command path, e.g. ['config', 'set'] for nested commands */
|
|
249
377
|
fullPath: string[];
|
|
250
378
|
/** What a person types to run it, with the CLI, e.g. ['tool', 'config', 'set']. Set for help */
|
|
251
379
|
commandLine?: string[];
|
|
380
|
+
/** Its positional arguments, in order */
|
|
252
381
|
args: ArgSchema[];
|
|
382
|
+
/** Its options */
|
|
253
383
|
options: OptionSchema[];
|
|
384
|
+
/** Whether it declares an `output` schema */
|
|
254
385
|
hasOutput: boolean;
|
|
386
|
+
/** The commands of a group */
|
|
255
387
|
subcommands?: CommandSchema[];
|
|
256
388
|
}
|
|
389
|
+
/** A positional argument, described as data. */
|
|
257
390
|
export interface ArgSchema {
|
|
391
|
+
/** Its key in `args` */
|
|
258
392
|
name: string;
|
|
393
|
+
/** From its `.describe()` */
|
|
259
394
|
description?: string;
|
|
395
|
+
/** Its base type */
|
|
260
396
|
type: ParamType;
|
|
397
|
+
/** False if it has `.optional()` or `.default()` */
|
|
261
398
|
required: boolean;
|
|
399
|
+
/** From its `.default()` */
|
|
262
400
|
defaultValue?: unknown;
|
|
401
|
+
/** Whether it takes the rest of the values, as a z.array() does */
|
|
263
402
|
isVariadic: boolean;
|
|
403
|
+
/** The values a z.enum() allows */
|
|
264
404
|
enumValues?: string[];
|
|
265
405
|
}
|
|
406
|
+
/** An option, described as data. */
|
|
266
407
|
export interface OptionSchema {
|
|
267
408
|
/** The key in code, in config files and in MCP tools */
|
|
268
409
|
name: string;
|
|
269
410
|
/** The long flag, without dashes: what a person types */
|
|
270
411
|
flag: string;
|
|
412
|
+
/** From its `.describe()` */
|
|
271
413
|
description?: string;
|
|
272
414
|
/** `array` means the option repeats, with `itemType` values */
|
|
273
415
|
type: ParamType;
|
|
416
|
+
/** The type of each value of an option that repeats */
|
|
274
417
|
itemType?: ParamType;
|
|
275
418
|
/** What help calls the value, if the author named it */
|
|
276
419
|
valueName?: string;
|
|
420
|
+
/** False if it has `.optional()` or `.default()` */
|
|
277
421
|
required: boolean;
|
|
422
|
+
/** From its `.default()` */
|
|
278
423
|
defaultValue?: unknown;
|
|
279
424
|
/** What help shows instead of `defaultValue`, if the author wrote it */
|
|
280
425
|
defaultDescription?: string;
|
|
426
|
+
/** See OptionMeta.alias */
|
|
281
427
|
alias?: string[];
|
|
428
|
+
/** See OptionMeta.env */
|
|
282
429
|
env?: string;
|
|
430
|
+
/** See OptionMeta.group */
|
|
283
431
|
group?: string;
|
|
432
|
+
/** See OptionMeta.deprecated */
|
|
284
433
|
deprecated?: string;
|
|
434
|
+
/** The values a z.enum() allows */
|
|
285
435
|
enumValues?: string[];
|
|
436
|
+
/**
|
|
437
|
+
* A global option, in the help of a command: it works there, but isn't the
|
|
438
|
+
* command's own, so help lists it under GLOBAL OPTIONS. Not set when the
|
|
439
|
+
* command is the CLI, as with runCLI()
|
|
440
|
+
*/
|
|
441
|
+
inherited?: boolean;
|
|
286
442
|
}
|
|
443
|
+
/** The base types Runa reads from a Zod schema. */
|
|
287
444
|
export declare const PARAM_TYPES: {
|
|
445
|
+
/** z.string(), and any type Runa doesn't read otherwise */
|
|
288
446
|
readonly STRING: 'string';
|
|
447
|
+
/** z.number(), z.int() included */
|
|
289
448
|
readonly NUMBER: 'number';
|
|
449
|
+
/** z.boolean(): a flag, with its `--no-` */
|
|
290
450
|
readonly BOOLEAN: 'boolean';
|
|
451
|
+
/** z.enum(): one of a fixed set of values */
|
|
291
452
|
readonly ENUM: 'enum';
|
|
453
|
+
/** z.array(): an option that repeats, or the last positional */
|
|
292
454
|
readonly ARRAY: 'array';
|
|
293
455
|
};
|
|
456
|
+
/** A base type: one of the values of PARAM_TYPES. */
|
|
294
457
|
export type ParamType = (typeof PARAM_TYPES)[keyof typeof PARAM_TYPES];
|
|
458
|
+
/** What Runa reads from the schema of one arg or option. */
|
|
295
459
|
export interface ParamMetadata {
|
|
296
460
|
/** Key name from the schema record */
|
|
297
461
|
name: string;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAItC,MAAM,WAAW,UAAU;IAC1B,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,mDAAmD;IACnD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mGAAmG;IACnG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mFAAmF;IACnF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,8EAA8E;IAC9E,YAAY,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,gFAAgF;AAChF,MAAM,MAAM,gBAAgB,CAAC,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAC9F,WAAW,CAAC,QAAQ,CAAC,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,iFAAiF;IACjF,IAAI,EAAE,MAAM,EAAE,CAAC;CACf,CAAC;AAIH,MAAM,WA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Q;IAChB,mCAAmC;aACnC,MAAM,EAAE,QAAQ;IAChB,4CAA4C;aAC5C,OAAO,EAAE,SAAS;IAClB,6CAA6C;aAC7C,IAAI,EAAE,MAAM;IACZ,gEAAgE;aAChE,KAAK,EAAE,OAAO;CACL,CAAC;AAEX,qDAAqD;AACrD,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAEvE,4DAA4D;AAC5D,MAAM,WAAW,aAAa;IAC7B,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,yBAAyB;IACzB,OAAO,EAAE,SAAS,CAAC;IACnB,oEAAoE;IACpE,UAAU,EAAE,OAAO,CAAC;IACpB,4DAA4D;IAC5D,YAAY,EAAE,OAAO,CAAC;IACtB,4EAA4E;IAC5E,OAAO,EAAE,OAAO,CAAC;IACjB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,8EAA8E;IAC9E,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
package/dist/types.js
CHANGED
|
@@ -1,19 +1,33 @@
|
|
|
1
1
|
// ─── Lifecycle Hooks ────────────────────────────────────────
|
|
2
|
+
/** The steps of a run a plugin can hook into, in the order they happen. */
|
|
2
3
|
export const HOOK_NAMES = {
|
|
4
|
+
/** First of all, before anything is parsed: a handler may rewrite `ctx.rawArgs` */
|
|
3
5
|
BEFORE_PARSE: 'beforeParse',
|
|
6
|
+
/** The global options are read. Help and `--mcp` stop the run here */
|
|
4
7
|
ON_GLOBAL_FLAGS: 'onGlobalFlags',
|
|
8
|
+
/** The command and its values are known */
|
|
5
9
|
AFTER_PARSE: 'afterParse',
|
|
10
|
+
/** Right before the middleware and the command */
|
|
6
11
|
BEFORE_RUN: 'beforeRun',
|
|
12
|
+
/** The command ended well. It doesn't run after a failure */
|
|
7
13
|
AFTER_RUN: 'afterRun',
|
|
14
|
+
/** Something failed: `ctx.error` says what. Set `ctx.handled` to print nothing */
|
|
8
15
|
ON_ERROR: 'onError',
|
|
16
|
+
/** Last, always: after an error and after Ctrl+C too */
|
|
9
17
|
CLEANUP: 'cleanup',
|
|
10
18
|
};
|
|
11
19
|
// ─── Schema Walker Output ───────────────────────────────────
|
|
20
|
+
/** The base types Runa reads from a Zod schema. */
|
|
12
21
|
export const PARAM_TYPES = {
|
|
22
|
+
/** z.string(), and any type Runa doesn't read otherwise */
|
|
13
23
|
STRING: 'string',
|
|
24
|
+
/** z.number(), z.int() included */
|
|
14
25
|
NUMBER: 'number',
|
|
26
|
+
/** z.boolean(): a flag, with its `--no-` */
|
|
15
27
|
BOOLEAN: 'boolean',
|
|
28
|
+
/** z.enum(): one of a fixed set of values */
|
|
16
29
|
ENUM: 'enum',
|
|
30
|
+
/** z.array(): an option that repeats, or the last positional */
|
|
17
31
|
ARRAY: 'array',
|
|
18
32
|
};
|
|
19
33
|
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAmVA,+DAA+D;AAE/D,2EAA2E;AAC3E,MAAM,CAAC,MAAM,UAAU,GAAG;IACzB,mFAAmF;IACnF,YAAY,EAAE,aAAa;IAC3B,sEAAsE;IACtE,eAAe,EAAE,eAAe;IAChC,2CAA2C;IAC3C,WAAW,EAAE,YAAY;IACzB,kDAAkD;IAClD,UAAU,EAAE,WAAW;IACvB,6DAA6D;IAC7D,SAAS,EAAE,UAAU;IACrB,kFAAkF;IAClF,QAAQ,EAAE,SAAS;IACnB,wDAAwD;IACxD,OAAO,EAAE,SAAS;CACT,CAAC;AA8KX,+DAA+D;AAE/D,mDAAmD;AACnD,MAAM,CAAC,MAAM,WAAW,GAAG;IAC1B,2DAA2D;IAC3D,MAAM,EAAE,QAAQ;IAChB,mCAAmC;IACnC,MAAM,EAAE,QAAQ;IAChB,4CAA4C;IAC5C,OAAO,EAAE,SAAS;IAClB,6CAA6C;IAC7C,IAAI,EAAE,MAAM;IACZ,gEAAgE;IAChE,KAAK,EAAE,OAAO;CACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runa-cmd/core",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.7",
|
|
4
4
|
"description": "Schema-driven, TypeScript-first CLI engine — commands, parsing, plugins, middleware. Zero runtime deps.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"scripts": {
|
|
66
66
|
"build": "tsc",
|
|
67
67
|
"dev": "tsc --watch --preserveWatchOutput",
|
|
68
|
-
"typecheck": "tsc --noEmit",
|
|
68
|
+
"typecheck": "tsc --noEmit && tsc -p tsconfig.test.json",
|
|
69
69
|
"test": "vitest run",
|
|
70
70
|
"test:watch": "vitest",
|
|
71
71
|
"lint": "biome check .",
|