@alcyone-labs/arg-parser 2.14.2 → 3.0.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 +20 -127
- package/dist/config/plugins/index.d.ts +36 -4
- package/dist/config/plugins/index.d.ts.map +1 -1
- package/dist/core/ArgParser.d.ts +124 -464
- package/dist/core/ArgParser.d.ts.map +1 -1
- package/dist/core/FlagManager.d.ts +36 -136
- package/dist/core/FlagManager.d.ts.map +1 -1
- package/dist/core/PromptManager.d.ts +42 -91
- package/dist/core/PromptManager.d.ts.map +1 -1
- package/dist/core/log-path-utils.d.ts +28 -36
- package/dist/core/log-path-utils.d.ts.map +1 -1
- package/dist/core/types.d.ts +83 -592
- package/dist/core/types.d.ts.map +1 -1
- package/dist/index.cjs +599 -9658
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +26 -15
- package/dist/index.d.ts.map +1 -1
- package/dist/index.min.mjs +615 -8224
- package/dist/index.min.mjs.map +1 -1
- package/dist/index.mjs +581 -8881
- package/dist/index.mjs.map +1 -1
- package/dist/plugin/types.d.ts +121 -0
- package/dist/plugin/types.d.ts.map +1 -0
- package/dist/utils/debug-utils.d.ts +4 -26
- package/dist/utils/debug-utils.d.ts.map +1 -1
- package/package.json +12 -73
- package/dist/assets/.dxtignore.template +0 -37
- package/dist/assets/logo_1_small.jpg +0 -0
- package/dist/config/ConfigurationManager.d.ts +0 -82
- package/dist/config/ConfigurationManager.d.ts.map +0 -1
- package/dist/config/plugins/ConfigPlugin.d.ts +0 -60
- package/dist/config/plugins/ConfigPlugin.d.ts.map +0 -1
- package/dist/config/plugins/ConfigPluginRegistry.d.ts +0 -72
- package/dist/config/plugins/ConfigPluginRegistry.d.ts.map +0 -1
- package/dist/config/plugins/TomlConfigPlugin.d.ts +0 -30
- package/dist/config/plugins/TomlConfigPlugin.d.ts.map +0 -1
- package/dist/config/plugins/YamlConfigPlugin.d.ts +0 -29
- package/dist/config/plugins/YamlConfigPlugin.d.ts.map +0 -1
- package/dist/core/ArgParserBase.d.ts +0 -319
- package/dist/core/ArgParserBase.d.ts.map +0 -1
- package/dist/core/dxt-path-resolver.d.ts +0 -100
- package/dist/core/dxt-path-resolver.d.ts.map +0 -1
- package/dist/dxt/DxtGenerator-testUtils.d.ts +0 -22
- package/dist/dxt/DxtGenerator-testUtils.d.ts.map +0 -1
- package/dist/dxt/DxtGenerator.d.ts +0 -120
- package/dist/dxt/DxtGenerator.d.ts.map +0 -1
- package/dist/mcp/ArgParserMcp.d.ts +0 -21
- package/dist/mcp/ArgParserMcp.d.ts.map +0 -1
- package/dist/mcp/mcp-integration.d.ts +0 -86
- package/dist/mcp/mcp-integration.d.ts.map +0 -1
- package/dist/mcp/mcp-lifecycle.d.ts +0 -163
- package/dist/mcp/mcp-lifecycle.d.ts.map +0 -1
- package/dist/mcp/mcp-notifications.d.ts +0 -132
- package/dist/mcp/mcp-notifications.d.ts.map +0 -1
- package/dist/mcp/mcp-prompts.d.ts +0 -132
- package/dist/mcp/mcp-prompts.d.ts.map +0 -1
- package/dist/mcp/mcp-protocol-versions.d.ts +0 -150
- package/dist/mcp/mcp-protocol-versions.d.ts.map +0 -1
- package/dist/mcp/mcp-resources.d.ts +0 -133
- package/dist/mcp/mcp-resources.d.ts.map +0 -1
- package/dist/mcp/mcp-utils.d.ts +0 -20
- package/dist/mcp/mcp-utils.d.ts.map +0 -1
- package/dist/mcp/zod-compatibility.d.ts +0 -74
- package/dist/mcp/zod-compatibility.d.ts.map +0 -1
- package/dist/testing/fuzzy-test-cli.d.ts +0 -5
- package/dist/testing/fuzzy-test-cli.d.ts.map +0 -1
- package/dist/testing/fuzzy-tester.d.ts +0 -101
- package/dist/testing/fuzzy-tester.d.ts.map +0 -1
- package/dist/tui/index.d.ts +0 -281
- package/dist/tui/types.d.ts +0 -60
- package/dist/tui/types.d.ts.map +0 -1
- package/dist/tui.cjs +0 -1060
- package/dist/tui.cjs.map +0 -1
- package/dist/tui.mjs +0 -967
- package/dist/tui.mjs.map +0 -1
|
@@ -1,319 +0,0 @@
|
|
|
1
|
-
import { type Logger } from "@alcyone-labs/simple-mcp-logger";
|
|
2
|
-
import { McpNotificationsManager, type McpChangeType } from "../mcp/mcp-notifications.js";
|
|
3
|
-
import { McpPromptsManager, type McpPromptConfig } from "../mcp/mcp-prompts.js";
|
|
4
|
-
import { McpResourcesManager, type McpResourceConfig } from "../mcp/mcp-resources.js";
|
|
5
|
-
import type { IArgParser, IFlag, IHandlerContext, IPromptableFlag, ISubCommand, ParseResult, ProcessedFlag, PromptWhen, TParsedArgs, TFlagInheritance } from "./types";
|
|
6
|
-
export declare class ArgParserError extends Error {
|
|
7
|
-
cmdChain: string[];
|
|
8
|
-
commandChain: string[];
|
|
9
|
-
constructor(message: string, cmdChain?: string[]);
|
|
10
|
-
}
|
|
11
|
-
export interface IArgParserParams<THandlerReturn = any> {
|
|
12
|
-
/**
|
|
13
|
-
* This is the display name of the app, used in help text
|
|
14
|
-
*/
|
|
15
|
-
appName?: string;
|
|
16
|
-
subCommands?: ISubCommand[];
|
|
17
|
-
handler?: (ctx: IHandlerContext<any, any>) => THandlerReturn | Promise<THandlerReturn>;
|
|
18
|
-
/**
|
|
19
|
-
* Add an extra new line between each flag group,
|
|
20
|
-
* makes the text more readable but uses more space
|
|
21
|
-
*
|
|
22
|
-
* Default: true
|
|
23
|
-
*/
|
|
24
|
-
extraNewLine?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Wraps the line at width, if shorter, wrapping will be more
|
|
27
|
-
* aggressive. Wrapping is based on words.
|
|
28
|
-
*
|
|
29
|
-
* Default: 50
|
|
30
|
-
* Minimum: 30
|
|
31
|
-
*/
|
|
32
|
-
wrapAtWidth?: number;
|
|
33
|
-
/**
|
|
34
|
-
* Controls the placing of right text on the screen.
|
|
35
|
-
* The higher the value, the more to the right the text will be.
|
|
36
|
-
*
|
|
37
|
-
* Default: 30
|
|
38
|
-
* Minimum: 20
|
|
39
|
-
*/
|
|
40
|
-
blankSpaceWidth?: number;
|
|
41
|
-
/**
|
|
42
|
-
* Character to display next to the flag to express mandatory fields.
|
|
43
|
-
*
|
|
44
|
-
* Default: *
|
|
45
|
-
*/
|
|
46
|
-
mandatoryCharacter?: string;
|
|
47
|
-
/**
|
|
48
|
-
* Throw an error if a flag is added more than once
|
|
49
|
-
* @default false
|
|
50
|
-
*/
|
|
51
|
-
throwForDuplicateFlags?: boolean;
|
|
52
|
-
description?: string;
|
|
53
|
-
/**
|
|
54
|
-
* Automatically handle ArgParserErrors by printing a formatted message
|
|
55
|
-
* and exiting. Set to false to catch ArgParserError manually.
|
|
56
|
-
* @default true
|
|
57
|
-
*/
|
|
58
|
-
handleErrors?: boolean;
|
|
59
|
-
/**
|
|
60
|
-
* Whether to automatically call process.exit() based on ParseResult.
|
|
61
|
-
* When true (default), maintains backward compatibility with CLI behavior.
|
|
62
|
-
* When false, returns ParseResult objects for programmatic use.
|
|
63
|
-
* @default true
|
|
64
|
-
*/
|
|
65
|
-
autoExit?: boolean;
|
|
66
|
-
/**
|
|
67
|
-
* The command name to display in help suggestions (e.g., 'dabl').
|
|
68
|
-
* If not provided, it falls back to guessing from the script path.
|
|
69
|
-
*/
|
|
70
|
-
appCommandName?: string;
|
|
71
|
-
/**
|
|
72
|
-
* If true, when this parser is added as a sub-command, it will inherit
|
|
73
|
-
* flags from its direct parent *unless* a flag with the same name
|
|
74
|
-
* already exists in this parser. Child flags take precedence.
|
|
75
|
-
* @default false
|
|
76
|
-
*/
|
|
77
|
-
inheritParentFlags?: TFlagInheritance;
|
|
78
|
-
/**
|
|
79
|
-
* If true, when no handler is provided for a command (root or sub-command),
|
|
80
|
-
* the help message will be automatically displayed.
|
|
81
|
-
* @default false
|
|
82
|
-
*/
|
|
83
|
-
triggerAutoHelpIfNoHandler?: boolean;
|
|
84
|
-
/**
|
|
85
|
-
* Optional logger instance to use.
|
|
86
|
-
* If not provided, a default one will be created.
|
|
87
|
-
*/
|
|
88
|
-
logger?: Logger;
|
|
89
|
-
/**
|
|
90
|
-
* When to trigger interactive prompts for this command.
|
|
91
|
-
* - `"interactive-flag"` (default): Prompts shown only when `--interactive` or `-i` flag is present
|
|
92
|
-
* - `"missing"`: Prompts shown when any promptable flag is missing a value
|
|
93
|
-
* - `"always"`: Always show prompts (overrides CLI args for promptable flags)
|
|
94
|
-
*
|
|
95
|
-
* @default "interactive-flag"
|
|
96
|
-
*
|
|
97
|
-
* @example
|
|
98
|
-
* ```typescript
|
|
99
|
-
* const cli = new ArgParser({
|
|
100
|
-
* appName: "my-cli",
|
|
101
|
-
* promptWhen: "interactive-flag",
|
|
102
|
-
* handler: async (ctx) => {
|
|
103
|
-
* if (ctx.isInteractive) {
|
|
104
|
-
* console.log("Interactive mode:", ctx.promptAnswers);
|
|
105
|
-
* }
|
|
106
|
-
* }
|
|
107
|
-
* });
|
|
108
|
-
* ```
|
|
109
|
-
*/
|
|
110
|
-
promptWhen?: import("./types").PromptWhen;
|
|
111
|
-
/**
|
|
112
|
-
* Called when user cancels (Ctrl+C) during interactive prompts.
|
|
113
|
-
* If not provided, exits gracefully with code 0.
|
|
114
|
-
*/
|
|
115
|
-
onCancel?: (ctx: import("./types").IHandlerContext) => void | Promise<void>;
|
|
116
|
-
}
|
|
117
|
-
export interface IParseOptions {
|
|
118
|
-
/**
|
|
119
|
-
* When true, skips help flag processing (doesn't exit or show help)
|
|
120
|
-
* @default false
|
|
121
|
-
*/
|
|
122
|
-
skipHelpHandling?: boolean;
|
|
123
|
-
/**
|
|
124
|
-
* When true, skips the execution of any command handlers.
|
|
125
|
-
* @default false
|
|
126
|
-
*/
|
|
127
|
-
skipHandlers?: boolean;
|
|
128
|
-
/**
|
|
129
|
-
* When true (default), automatically awaits async handlers before returning.
|
|
130
|
-
* When false, returns immediately with _asyncHandlerPromise for manual handling.
|
|
131
|
-
* @default true
|
|
132
|
-
*/
|
|
133
|
-
deep?: boolean;
|
|
134
|
-
/**
|
|
135
|
-
* When true, indicates this is being called from MCP mode
|
|
136
|
-
* @default false
|
|
137
|
-
* @internal
|
|
138
|
-
*/
|
|
139
|
-
isMcp?: boolean;
|
|
140
|
-
/**
|
|
141
|
-
* Internal: when true, this parse call is only for dynamic flag preloading for help
|
|
142
|
-
* Suppresses side effects and handler execution
|
|
143
|
-
* @internal
|
|
144
|
-
*/
|
|
145
|
-
dynamicHelpPreload?: boolean;
|
|
146
|
-
/**
|
|
147
|
-
* When true, automatically executes the CLI if the script is being run directly (not imported).
|
|
148
|
-
* When false, disables auto-execution detection even if importMetaUrl is provided.
|
|
149
|
-
* Uses robust detection that works across different environments and sandboxes.
|
|
150
|
-
* Only takes effect when importMetaUrl is also provided.
|
|
151
|
-
* @default true (when importMetaUrl is provided)
|
|
152
|
-
*/
|
|
153
|
-
autoExecute?: boolean;
|
|
154
|
-
/**
|
|
155
|
-
* The import.meta.url from the calling script, required for reliable auto-execution detection.
|
|
156
|
-
* Only used when autoExecute is true.
|
|
157
|
-
*/
|
|
158
|
-
importMetaUrl?: string;
|
|
159
|
-
}
|
|
160
|
-
type TParsedArgsWithRouting<T = any> = T & {
|
|
161
|
-
$commandChain?: string[];
|
|
162
|
-
handlerToExecute?: {
|
|
163
|
-
handler: Function;
|
|
164
|
-
context: IHandlerContext;
|
|
165
|
-
};
|
|
166
|
-
};
|
|
167
|
-
export declare class ArgParserBase<THandlerReturn = any> implements IArgParser<THandlerReturn> {
|
|
168
|
-
#private;
|
|
169
|
-
constructor(options?: IArgParserParams<THandlerReturn>, initialFlags?: readonly IFlag[]);
|
|
170
|
-
get flags(): ProcessedFlag[];
|
|
171
|
-
get flagNames(): string[];
|
|
172
|
-
getAppName(): string | undefined;
|
|
173
|
-
getAppCommandName(): string | undefined;
|
|
174
|
-
/**
|
|
175
|
-
* Access to the logger
|
|
176
|
-
*/
|
|
177
|
-
get logger(): Logger;
|
|
178
|
-
getSubCommandName(): string;
|
|
179
|
-
getDescription(): string | undefined;
|
|
180
|
-
getAutoExit(): boolean;
|
|
181
|
-
/**
|
|
182
|
-
* Helper method to handle exit logic based on autoExit setting
|
|
183
|
-
* Returns a ParseResult instead of calling process.exit() when autoExit is false
|
|
184
|
-
*/
|
|
185
|
-
private _handleExit;
|
|
186
|
-
getHandler(): ((ctx: IHandlerContext) => void) | undefined;
|
|
187
|
-
getSubCommands(): Map<string, ISubCommand>;
|
|
188
|
-
/**
|
|
189
|
-
* Sets the promptWhen setting for this parser.
|
|
190
|
-
* Used internally to propagate promptWhen from parent to sub-parser.
|
|
191
|
-
* @param promptWhen - The promptWhen value
|
|
192
|
-
*/
|
|
193
|
-
setPromptWhen(promptWhen: PromptWhen): this;
|
|
194
|
-
/**
|
|
195
|
-
* Sets the onCancel callback for this parser.
|
|
196
|
-
* Used internally to propagate onCancel from parent to sub-parser.
|
|
197
|
-
* @param onCancel - The onCancel callback
|
|
198
|
-
*/
|
|
199
|
-
setOnCancel(onCancel: (ctx: IHandlerContext) => void | Promise<void>): this;
|
|
200
|
-
private _addToOutput;
|
|
201
|
-
addFlags(flags: readonly IFlag[]): this;
|
|
202
|
-
addFlag(flag: IFlag): this;
|
|
203
|
-
/**
|
|
204
|
-
* Collects all flags that have interactive prompt configuration.
|
|
205
|
-
* These flags can participate in interactive mode.
|
|
206
|
-
*
|
|
207
|
-
* @returns Array of promptable flags with their names
|
|
208
|
-
*/
|
|
209
|
-
getPromptableFlags(): Array<{
|
|
210
|
-
flag: IPromptableFlag;
|
|
211
|
-
name: string;
|
|
212
|
-
}>;
|
|
213
|
-
/**
|
|
214
|
-
* Gets the promptWhen setting for this parser.
|
|
215
|
-
* @returns The promptWhen value
|
|
216
|
-
*/
|
|
217
|
-
getPromptWhen(): PromptWhen;
|
|
218
|
-
addSubCommand(subCommandConfig: ISubCommand): this;
|
|
219
|
-
/**
|
|
220
|
-
* Sets the handler function for this specific parser instance.
|
|
221
|
-
* This handler will be executed if this parser is the final one
|
|
222
|
-
* in the command chain and `executeHandlers` is enabled on the root parser.
|
|
223
|
-
*
|
|
224
|
-
* @param handler - The function to execute.
|
|
225
|
-
* @returns The ArgParser instance for chaining.
|
|
226
|
-
*/
|
|
227
|
-
setHandler(handler: (ctx: IHandlerContext<any, any>) => THandlerReturn | Promise<THandlerReturn>): this;
|
|
228
|
-
printAll(filePath?: string): void;
|
|
229
|
-
/**
|
|
230
|
-
* Detects if the current script is being executed directly (not imported)
|
|
231
|
-
* Uses a robust method that works across different environments and sandboxes
|
|
232
|
-
* @param importMetaUrl The import.meta.url from the calling script (optional)
|
|
233
|
-
* @returns true if the script is being executed directly, false if imported
|
|
234
|
-
*/
|
|
235
|
-
private static isExecutedDirectly;
|
|
236
|
-
parse(processArgs?: string[], options?: IParseOptions): Promise<TParsedArgsWithRouting<any> | ParseResult>;
|
|
237
|
-
/**
|
|
238
|
-
* Alias for parse() method for backward compatibility
|
|
239
|
-
* Since parse() is already async, this just calls parse()
|
|
240
|
-
*
|
|
241
|
-
* @deprecated Use parse() instead. This method will be removed in a future version.
|
|
242
|
-
*/
|
|
243
|
-
parseAsync(processArgs?: string[], options?: IParseOptions): Promise<TParsedArgsWithRouting<any> | ParseResult>;
|
|
244
|
-
/**
|
|
245
|
-
* Recursive helper for parsing arguments and handling sub-commands.
|
|
246
|
-
* This method assumes the global help check has already been performed in `parse`.
|
|
247
|
-
*/
|
|
248
|
-
private _parseRecursive;
|
|
249
|
-
helpText(): string;
|
|
250
|
-
getSubCommand(name: string): ISubCommand | undefined;
|
|
251
|
-
hasFlag(name: string): boolean;
|
|
252
|
-
/**
|
|
253
|
-
* Get flag definition by name
|
|
254
|
-
* @param name Flag name
|
|
255
|
-
* @returns Flag definition or undefined if not found
|
|
256
|
-
*/
|
|
257
|
-
getFlagDefinition(name: string): ProcessedFlag | undefined;
|
|
258
|
-
getCommandChain(): string[];
|
|
259
|
-
getLastParseResult(): TParsedArgs<ProcessedFlag[]>;
|
|
260
|
-
/**
|
|
261
|
-
* Add an MCP resource to this parser
|
|
262
|
-
*/
|
|
263
|
-
addMcpResource(config: McpResourceConfig): this;
|
|
264
|
-
/**
|
|
265
|
-
* Remove an MCP resource by name
|
|
266
|
-
*/
|
|
267
|
-
removeMcpResource(name: string): this;
|
|
268
|
-
/**
|
|
269
|
-
* Get all registered MCP resources
|
|
270
|
-
*/
|
|
271
|
-
getMcpResources(): McpResourceConfig[];
|
|
272
|
-
/**
|
|
273
|
-
* Add an MCP prompt to this parser
|
|
274
|
-
*/
|
|
275
|
-
addMcpPrompt(config: McpPromptConfig): this;
|
|
276
|
-
/**
|
|
277
|
-
* Remove an MCP prompt by name
|
|
278
|
-
*/
|
|
279
|
-
removeMcpPrompt(name: string): this;
|
|
280
|
-
/**
|
|
281
|
-
* Get all registered MCP prompts
|
|
282
|
-
*/
|
|
283
|
-
getMcpPrompts(): McpPromptConfig[];
|
|
284
|
-
/**
|
|
285
|
-
* Add a change listener for MCP entities
|
|
286
|
-
*/
|
|
287
|
-
onMcpChange(listener: (event: {
|
|
288
|
-
type: McpChangeType;
|
|
289
|
-
action: string;
|
|
290
|
-
entityName?: string;
|
|
291
|
-
}) => void): this;
|
|
292
|
-
/**
|
|
293
|
-
* Remove a change listener for MCP entities
|
|
294
|
-
*/
|
|
295
|
-
offMcpChange(listener: (event: {
|
|
296
|
-
type: McpChangeType;
|
|
297
|
-
action: string;
|
|
298
|
-
entityName?: string;
|
|
299
|
-
}) => void): this;
|
|
300
|
-
/**
|
|
301
|
-
* Get the MCP notifications manager (for advanced usage)
|
|
302
|
-
*/
|
|
303
|
-
getMcpNotificationsManager(): McpNotificationsManager;
|
|
304
|
-
/**
|
|
305
|
-
* Get the MCP resources manager (for advanced usage)
|
|
306
|
-
*/
|
|
307
|
-
getMcpResourcesManager(): McpResourcesManager;
|
|
308
|
-
/**
|
|
309
|
-
* Get the MCP prompts manager (for advanced usage)
|
|
310
|
-
*/
|
|
311
|
-
getMcpPromptsManager(): McpPromptsManager;
|
|
312
|
-
}
|
|
313
|
-
/**
|
|
314
|
-
* A reusable handler that simply displays help.
|
|
315
|
-
* Can be used as a default handler for subcommands that act as containers.
|
|
316
|
-
*/
|
|
317
|
-
export declare const autoHelpHandler: (ctx: IHandlerContext) => Promise<void>;
|
|
318
|
-
export {};
|
|
319
|
-
//# sourceMappingURL=ArgParserBase.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ArgParserBase.d.ts","sourceRoot":"","sources":["../../src/core/ArgParserBase.ts"],"names":[],"mappings":"AAMA,OAAO,EAAmB,KAAK,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAG/E,OAAO,EAAE,uBAAuB,EAAE,KAAK,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC1F,OAAO,EAAE,iBAAiB,EAAE,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,KAAK,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAOtF,OAAO,KAAK,EACV,UAAU,EACV,KAAK,EACL,eAAe,EAEf,eAAe,EACf,WAAW,EACX,WAAW,EACX,aAAa,EACb,UAAU,EACV,WAAW,EACX,gBAAgB,EACjB,MAAM,SAAS,CAAC;AA+JjB,qBAAa,cAAe,SAAQ,KAAK;IAI9B,QAAQ,EAAE,MAAM,EAAE;IAHpB,YAAY,EAAE,MAAM,EAAE,CAAC;gBAE5B,OAAO,EAAE,MAAM,EACR,QAAQ,GAAE,MAAM,EAAO;CAMjC;AAED,MAAM,WAAW,gBAAgB,CAAC,cAAc,GAAG,GAAG;IACpD;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,WAAW,EAAE,CAAC;IAC5B,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAEvF;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;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C;;OAEG;IACH,aAAa,IAAI,eAAe,EAAE;IAIlC;;OAEG;IACH,WAAW,CACT,QAAQ,EAAE,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,aAAa,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,GACtF,IAAI;IAKP;;OAEG;IACH,YAAY,CACV,QAAQ,EAAE,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,aAAa,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,GACtF,IAAI;IAKP;;OAEG;IACH,0BAA0B,IAAI,uBAAuB;IAIrD;;OAEG;IACH,sBAAsB,IAAI,mBAAmB;IAI7C;;OAEG;IACH,oBAAoB,IAAI,iBAAiB;CA+d1C;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAU,KAAK,eAAe,kBAEzD,CAAC"}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Context information for path resolution
|
|
3
|
-
*/
|
|
4
|
-
export interface IPathContext {
|
|
5
|
-
/** Whether the code is running in a DXT environment */
|
|
6
|
-
isDxt: boolean;
|
|
7
|
-
/** DXT extension directory (when running in DXT) */
|
|
8
|
-
extensionDir?: string;
|
|
9
|
-
/** User's home directory */
|
|
10
|
-
userHome?: string;
|
|
11
|
-
/** Current working directory */
|
|
12
|
-
cwd?: string;
|
|
13
|
-
/** Entry point directory */
|
|
14
|
-
entryDir?: string;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Configuration for DXT variable substitution
|
|
18
|
-
*/
|
|
19
|
-
export interface IDxtVariableConfig {
|
|
20
|
-
/** Custom variable values to override defaults */
|
|
21
|
-
customVariables?: Record<string, string>;
|
|
22
|
-
/** Whether to allow undefined variables (default: false) */
|
|
23
|
-
allowUndefined?: boolean;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* DXT-aware path resolver with context detection and variable substitution
|
|
27
|
-
*/
|
|
28
|
-
export declare class DxtPathResolver {
|
|
29
|
-
private static _cachedContext;
|
|
30
|
-
/**
|
|
31
|
-
* Detects the current execution context
|
|
32
|
-
* @param forceRefresh - Force refresh of cached context
|
|
33
|
-
* @returns Path context information
|
|
34
|
-
*/
|
|
35
|
-
static detectContext(forceRefresh?: boolean): IPathContext;
|
|
36
|
-
/**
|
|
37
|
-
* Checks if the current environment is a DXT environment
|
|
38
|
-
* @returns True if running in DXT, false otherwise
|
|
39
|
-
*/
|
|
40
|
-
static isDxtEnvironment(): boolean;
|
|
41
|
-
/**
|
|
42
|
-
* Detects the DXT extension directory
|
|
43
|
-
* @returns DXT extension directory path or undefined
|
|
44
|
-
*/
|
|
45
|
-
private static detectDxtExtensionDir;
|
|
46
|
-
/**
|
|
47
|
-
* Resolves a path with DXT variable substitution
|
|
48
|
-
* @param inputPath - Path that may contain DXT variables
|
|
49
|
-
* @param context - Optional context (will be detected if not provided)
|
|
50
|
-
* @param config - Optional configuration for variable substitution
|
|
51
|
-
* @returns Resolved absolute path
|
|
52
|
-
*/
|
|
53
|
-
static resolvePath(inputPath: string, context?: IPathContext, config?: IDxtVariableConfig): string;
|
|
54
|
-
/**
|
|
55
|
-
* Substitutes DXT variables in a path string
|
|
56
|
-
* @param inputPath - Path containing variables like ${HOME}, ${__dirname}, etc.
|
|
57
|
-
* @param context - Path context
|
|
58
|
-
* @param config - Variable substitution configuration
|
|
59
|
-
* @returns Path with variables substituted
|
|
60
|
-
*/
|
|
61
|
-
static substituteVariables(inputPath: string, context: IPathContext, config?: IDxtVariableConfig): string;
|
|
62
|
-
/**
|
|
63
|
-
* Creates a path for user data storage
|
|
64
|
-
* @param filename - Name of the file or subdirectory
|
|
65
|
-
* @param context - Optional context (will be detected if not provided)
|
|
66
|
-
* @returns Absolute path for user data
|
|
67
|
-
*/
|
|
68
|
-
static createUserDataPath(filename: string, context?: IPathContext): string;
|
|
69
|
-
/**
|
|
70
|
-
* Creates a path for temporary files
|
|
71
|
-
* @param filename - Name of the temporary file
|
|
72
|
-
* @param context - Optional context (will be detected if not provided)
|
|
73
|
-
* @returns Absolute path for temporary file
|
|
74
|
-
*/
|
|
75
|
-
static createTempPath(filename: string, context?: IPathContext): string;
|
|
76
|
-
/**
|
|
77
|
-
* Creates a path for configuration files
|
|
78
|
-
* @param filename - Name of the configuration file
|
|
79
|
-
* @param context - Optional context (will be detected if not provided)
|
|
80
|
-
* @returns Absolute path for configuration file
|
|
81
|
-
*/
|
|
82
|
-
static createConfigPath(filename: string, context?: IPathContext): string;
|
|
83
|
-
/**
|
|
84
|
-
* Gets the application name for directory creation
|
|
85
|
-
* @param context - Path context
|
|
86
|
-
* @returns Application name or default
|
|
87
|
-
*/
|
|
88
|
-
private static getAppName;
|
|
89
|
-
/**
|
|
90
|
-
* Ensures a directory exists, creating it if necessary
|
|
91
|
-
* @param dirPath - Directory path to ensure
|
|
92
|
-
* @returns True if directory exists or was created successfully
|
|
93
|
-
*/
|
|
94
|
-
static ensureDirectory(dirPath: string): boolean;
|
|
95
|
-
/**
|
|
96
|
-
* Clears the cached context (useful for testing)
|
|
97
|
-
*/
|
|
98
|
-
static clearCache(): void;
|
|
99
|
-
}
|
|
100
|
-
//# sourceMappingURL=dxt-path-resolver.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dxt-path-resolver.d.ts","sourceRoot":"","sources":["../../src/core/dxt-path-resolver.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,uDAAuD;IACvD,KAAK,EAAE,OAAO,CAAC;IACf,oDAAoD;IACpD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gCAAgC;IAChC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,MAAM,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DxtGenerator
|
|
4
|
-
* Contains methods that are only used during testing
|
|
5
|
-
*/
|
|
6
|
-
export declare class DxtGeneratorTestUtils {
|
|
7
|
-
private argParserInstance;
|
|
8
|
-
private extractMcpServerInfo;
|
|
9
|
-
private handleExit;
|
|
10
|
-
constructor(argParserInstance: any, extractMcpServerInfo: () => any, handleExit: (exitCode: number, message?: string, type?: ParseResult["type"], data?: any) => ParseResult | never);
|
|
11
|
-
/**
|
|
12
|
-
* Handles DXT generation in test mode by creating mock DXT package structure
|
|
13
|
-
* This method creates simplified mock files for testing purposes
|
|
14
|
-
*/
|
|
15
|
-
handleTestModeDxtGeneration(processArgs: string[], buildDxtIndex: number): Promise<ParseResult>;
|
|
16
|
-
/**
|
|
17
|
-
* Checks if the current environment is in test mode
|
|
18
|
-
* Used to determine whether to use test utilities or production code
|
|
19
|
-
*/
|
|
20
|
-
static isTestMode(): boolean;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=DxtGenerator-testUtils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DxtGenerator-testUtils.d.ts","sourceRoot":"","sources":["../../src/dxt/DxtGenerator-testUtils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD;;;GAGG;AACH,qBAAa,qBAAqB;IAChC,OAAO,CAAC,iBAAiB,CAAM;IAC/B,OAAO,CAAC,oBAAoB,CAAY;IACxC,OAAO,CAAC,UAAU,CAKO;gBAGvB,iBAAiB,EAAE,GAAG,EACtB,oBAAoB,EAAE,MAAM,GAAG,EAC/B,UAAU,EAAE,CACV,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,EAC1B,IAAI,CAAC,EAAE,GAAG,KACP,WAAW,GAAG,KAAK;IAO1B;;;OAGG;IACU,2BAA2B,CACtC,WAAW,EAAE,MAAM,EAAE,EACrB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,WAAW,CAAC;IA+EvB;;;OAGG;WACW,UAAU,IAAI,OAAO;CAQpC"}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import type { ParseResult } from "../core/types";
|
|
2
|
-
/**
|
|
3
|
-
* DxtGenerator handles the generation of DXT (Desktop Extension) packages
|
|
4
|
-
* for MCP servers created from ArgParser instances.
|
|
5
|
-
*/
|
|
6
|
-
export declare class DxtGenerator {
|
|
7
|
-
private argParserInstance;
|
|
8
|
-
constructor(argParserInstance: any);
|
|
9
|
-
/**
|
|
10
|
-
* Helper method to handle exit logic based on autoExit setting
|
|
11
|
-
*/
|
|
12
|
-
private _handleExit;
|
|
13
|
-
/**
|
|
14
|
-
* Handles the --s-build-dxt system flag to generate DXT packages for MCP servers
|
|
15
|
-
*/
|
|
16
|
-
handleBuildDxtFlag(processArgs: string[], buildDxtIndex: number): Promise<boolean | ParseResult>;
|
|
17
|
-
/**
|
|
18
|
-
* Extracts server information from MCP configuration
|
|
19
|
-
* Now supports both withMcp() configuration and legacy addMcpSubCommand()
|
|
20
|
-
*/
|
|
21
|
-
private extractMcpServerInfo;
|
|
22
|
-
private generateMcpToolsForDxt;
|
|
23
|
-
/**
|
|
24
|
-
* Maps ArgParser flag types to DXT user config types
|
|
25
|
-
*/
|
|
26
|
-
/**
|
|
27
|
-
* Adds the logo to the build folder if available
|
|
28
|
-
* @returns The filename of the logo that was added, or undefined if no logo was added
|
|
29
|
-
*/
|
|
30
|
-
private addLogoToFolder;
|
|
31
|
-
/**
|
|
32
|
-
* Builds a complete DXT package using TSDown CLI for autonomous execution
|
|
33
|
-
*/
|
|
34
|
-
private buildDxtWithTsdown;
|
|
35
|
-
/**
|
|
36
|
-
* Checks if a module ID is a Node.js built-in
|
|
37
|
-
*/
|
|
38
|
-
isNodeBuiltin(id: string): boolean;
|
|
39
|
-
/**
|
|
40
|
-
* Determines if a module should be treated as external based on bundling configuration.
|
|
41
|
-
* This logic is shared between external and noExternal configurations.
|
|
42
|
-
*
|
|
43
|
-
* @param id - The module identifier (e.g., 'lodash', '@types/node', './utils')
|
|
44
|
-
* @param importer - The file path that is importing this module (undefined for entry points)
|
|
45
|
-
* @param withNodeModules - Whether to include node_modules in the bundle
|
|
46
|
-
* @returns true if the module should be external (not bundled), false if it should be bundled
|
|
47
|
-
*
|
|
48
|
-
* Logic flow:
|
|
49
|
-
* 1. Node built-ins (fs, path, etc.) are always external
|
|
50
|
-
* 2. If no importer (entry point), always bundle
|
|
51
|
-
* 3. If withNodeModules is false, bundle everything except Node built-ins
|
|
52
|
-
* 4. If withNodeModules is true:
|
|
53
|
-
* - If importer is from node_modules, make external
|
|
54
|
-
* - If module resolves to a project file (via TS paths or regular paths), bundle it
|
|
55
|
-
* - Otherwise, make external (likely npm package)
|
|
56
|
-
*
|
|
57
|
-
* @example
|
|
58
|
-
* // Node built-in - always external
|
|
59
|
-
* shouldModuleBeExternal('fs', './src/main.ts', true) // returns true
|
|
60
|
-
*
|
|
61
|
-
* // Project file via TS paths or regular paths - bundle it
|
|
62
|
-
* shouldModuleBeExternal('@/utils', './src/main.ts', true) // returns false
|
|
63
|
-
*
|
|
64
|
-
* // NPM package - external when withNodeModules=true
|
|
65
|
-
* shouldModuleBeExternal('lodash', './src/main.ts', true) // returns true
|
|
66
|
-
*/
|
|
67
|
-
private shouldModuleBeExternal;
|
|
68
|
-
/**
|
|
69
|
-
* Checks if a package ID exists in the local node_modules folder.
|
|
70
|
-
* Only checks the folder or parent folder that contains the nearest package.json file.
|
|
71
|
-
* Returns false if no package.json file is found after 3 parent directory traversals.
|
|
72
|
-
*
|
|
73
|
-
* Alternative approach using require.resolve():
|
|
74
|
-
* ```ts
|
|
75
|
-
* public isNodeModulesPackageWithResolve(packageId: string): boolean {
|
|
76
|
-
* try {
|
|
77
|
-
* require.resolve(packageId);
|
|
78
|
-
* return true;
|
|
79
|
-
* } catch {
|
|
80
|
-
* return false;
|
|
81
|
-
* }
|
|
82
|
-
* }
|
|
83
|
-
* ```
|
|
84
|
-
*
|
|
85
|
-
* Filesystem approach is preferred for bundler context because:
|
|
86
|
-
* - Faster (no module resolution overhead)
|
|
87
|
-
* - No side effects during build
|
|
88
|
-
* - Predictable behavior in build vs runtime contexts
|
|
89
|
-
*/
|
|
90
|
-
isNodeModulesPackage(packageId: string): boolean;
|
|
91
|
-
/**
|
|
92
|
-
* Get the path to the .dxtignore template file
|
|
93
|
-
*/
|
|
94
|
-
private getDxtIgnoreTemplatePath;
|
|
95
|
-
/**
|
|
96
|
-
* Sets up DXT package files (manifest.json) in the output directory
|
|
97
|
-
*/
|
|
98
|
-
private setupDxtPackageFiles;
|
|
99
|
-
/**
|
|
100
|
-
* Detects the actual output filename generated by TSDown
|
|
101
|
-
*/
|
|
102
|
-
private detectTsdownOutputFile;
|
|
103
|
-
private findProjectRoot;
|
|
104
|
-
/**
|
|
105
|
-
* Validate dxtOptions for common mistakes and security issues
|
|
106
|
-
* @param flag The flag with dxtOptions to validate
|
|
107
|
-
* @param envVar The environment variable name for context
|
|
108
|
-
*/
|
|
109
|
-
private validateDxtOptions;
|
|
110
|
-
/**
|
|
111
|
-
* Generate environment variables and user configuration from ArgParser flags
|
|
112
|
-
* @returns Object containing envVars and userConfig
|
|
113
|
-
*/
|
|
114
|
-
generateEnvAndUserConfig(): {
|
|
115
|
-
envVars: Record<string, string>;
|
|
116
|
-
userConfig: Record<string, any>;
|
|
117
|
-
};
|
|
118
|
-
private resolveModulePath;
|
|
119
|
-
}
|
|
120
|
-
//# sourceMappingURL=DxtGenerator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DxtGenerator.d.ts","sourceRoot":"","sources":["../../src/dxt/DxtGenerator.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAOjD;;;GAGG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,iBAAiB,CAAM;gBAEnB,iBAAiB,EAAE,GAAG;IAIlC;;OAEG;IACH,OAAO,CAAC,WAAW;IA0BnB;;OAEG;IACU,kBAAkB,CAC7B,WAAW,EAAE,MAAM,EAAE,EACrB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,OAAO,GAAG,WAAW,CAAC;IAsHjC;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAgC5B,OAAO,CAAC,sBAAsB;IAkF9B;;OAEG;IACH;;;OAGG;YACW,eAAe;IAoI7B;;OAEG;YACW,kBAAkB;IAyQhC;;OAEG;IACI,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IA4CzC;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,OAAO,CAAC,sBAAsB;IAkC9B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACI,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAsCvD;;OAEG;IACH,OAAO,CAAC,wBAAwB;IA+ChC;;OAEG;YACW,oBAAoB;IAkJlC;;OAEG;IACH,OAAO,CAAC,sBAAsB;IA2H9B,OAAO,CAAC,eAAe;IAyBvB;;;;OAIG;IACH,OAAO,CAAC,kBAAkB;IAuD1B;;;OAGG;IACI,wBAAwB,IAAI;QACjC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAChC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KACjC;IAqLD,OAAO,CAAC,iBAAiB;CA0L1B"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ArgParser } from "../core/ArgParser";
|
|
2
|
-
import type { IArgParserParams } from "../core/ArgParserBase";
|
|
3
|
-
import type { IFlag } from "../core/types";
|
|
4
|
-
/**
|
|
5
|
-
* MCP-optimized ArgParser that excludes config file functionality
|
|
6
|
-
* This version doesn't load any config plugins, making it suitable for
|
|
7
|
-
* autonomous builds where TOML/YAML dependencies cause bundling issues.
|
|
8
|
-
*/
|
|
9
|
-
export declare class ArgParserMcp<THandlerReturn = any> extends ArgParser<THandlerReturn> {
|
|
10
|
-
constructor(params?: IArgParserParams<THandlerReturn>, initialFlags?: IFlag[]);
|
|
11
|
-
/**
|
|
12
|
-
* Override parse to skip config file processing
|
|
13
|
-
*/
|
|
14
|
-
parse(processArgs: string[], options?: any): any;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Convenience function to create MCP-optimized ArgParser
|
|
18
|
-
* This is the recommended way to create ArgParser instances for MCP servers
|
|
19
|
-
*/
|
|
20
|
-
export declare function createMcpArgParser<THandlerReturn = any>(params?: IArgParserParams<THandlerReturn>, initialFlags?: IFlag[]): ArgParserMcp<THandlerReturn>;
|
|
21
|
-
//# sourceMappingURL=ArgParserMcp.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ArgParserMcp.d.ts","sourceRoot":"","sources":["../../src/mcp/ArgParserMcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE3C;;;;GAIG;AACH,qBAAa,YAAY,CAAC,cAAc,GAAG,GAAG,CAAE,SAAQ,SAAS,CAAC,cAAc,CAAC;gBACnE,MAAM,CAAC,EAAE,gBAAgB,CAAC,cAAc,CAAC,EAAE,YAAY,CAAC,EAAE,KAAK,EAAE;IAS7E;;OAEG;IACI,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,GAAG;CAWxD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,cAAc,GAAG,GAAG,EACrD,MAAM,CAAC,EAAE,gBAAgB,CAAC,cAAc,CAAC,EACzC,YAAY,CAAC,EAAE,KAAK,EAAE,GACrB,YAAY,CAAC,cAAc,CAAC,CAE9B"}
|