@alcyone-labs/arg-parser 1.1.0 → 2.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.
Files changed (105) hide show
  1. package/README.md +460 -1179
  2. package/dist/assets/.dxtignore.template +38 -0
  3. package/dist/assets/logo_1_small.jpg +0 -0
  4. package/dist/assets/tsdown.dxt.config.ts +37 -0
  5. package/dist/index.cjs +23702 -2315
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.min.mjs +16360 -1725
  8. package/dist/index.min.mjs.map +1 -1
  9. package/dist/index.mjs +23694 -2315
  10. package/dist/index.mjs.map +1 -1
  11. package/dist/src/config/ConfigurationManager.d.ts +74 -0
  12. package/dist/src/config/ConfigurationManager.d.ts.map +1 -0
  13. package/dist/src/config/plugins/ConfigPlugin.d.ts +60 -0
  14. package/dist/src/config/plugins/ConfigPlugin.d.ts.map +1 -0
  15. package/dist/src/config/plugins/ConfigPluginRegistry.d.ts +72 -0
  16. package/dist/src/config/plugins/ConfigPluginRegistry.d.ts.map +1 -0
  17. package/dist/src/config/plugins/TomlConfigPlugin.d.ts +30 -0
  18. package/dist/src/config/plugins/TomlConfigPlugin.d.ts.map +1 -0
  19. package/dist/src/config/plugins/YamlConfigPlugin.d.ts +29 -0
  20. package/dist/src/config/plugins/YamlConfigPlugin.d.ts.map +1 -0
  21. package/dist/src/config/plugins/index.d.ts +5 -0
  22. package/dist/src/config/plugins/index.d.ts.map +1 -0
  23. package/dist/src/core/ArgParser.d.ts +332 -0
  24. package/dist/src/core/ArgParser.d.ts.map +1 -0
  25. package/dist/src/{ArgParserBase.d.ts → core/ArgParserBase.d.ts} +84 -3
  26. package/dist/src/core/ArgParserBase.d.ts.map +1 -0
  27. package/dist/src/core/FlagManager.d.ts.map +1 -0
  28. package/dist/src/{types.d.ts → core/types.d.ts} +40 -0
  29. package/dist/src/core/types.d.ts.map +1 -0
  30. package/dist/src/dxt/DxtGenerator.d.ts +115 -0
  31. package/dist/src/dxt/DxtGenerator.d.ts.map +1 -0
  32. package/dist/src/index.d.ts +10 -6
  33. package/dist/src/index.d.ts.map +1 -1
  34. package/dist/src/mcp/ArgParserMcp.d.ts +21 -0
  35. package/dist/src/mcp/ArgParserMcp.d.ts.map +1 -0
  36. package/dist/src/mcp/mcp-integration.d.ts +83 -0
  37. package/dist/src/mcp/mcp-integration.d.ts.map +1 -0
  38. package/dist/src/mcp/mcp-notifications.d.ts +138 -0
  39. package/dist/src/mcp/mcp-notifications.d.ts.map +1 -0
  40. package/dist/src/mcp/mcp-prompts.d.ts +132 -0
  41. package/dist/src/mcp/mcp-prompts.d.ts.map +1 -0
  42. package/dist/src/mcp/mcp-resources.d.ts +133 -0
  43. package/dist/src/mcp/mcp-resources.d.ts.map +1 -0
  44. package/dist/src/testing/fuzzy-test-cli.d.ts +5 -0
  45. package/dist/src/testing/fuzzy-test-cli.d.ts.map +1 -0
  46. package/dist/src/{fuzzy-tester.d.ts → testing/fuzzy-tester.d.ts} +1 -1
  47. package/dist/src/testing/fuzzy-tester.d.ts.map +1 -0
  48. package/package.json +51 -17
  49. package/dist/examples/fuzzy-demo.d.ts +0 -8
  50. package/dist/examples/fuzzy-demo.d.ts.map +0 -1
  51. package/dist/examples/fuzzy-test-example.d.ts +0 -8
  52. package/dist/examples/fuzzy-test-example.d.ts.map +0 -1
  53. package/dist/examples/fzf-search-cli.d.ts +0 -8
  54. package/dist/examples/fzf-search-cli.d.ts.map +0 -1
  55. package/dist/examples/getting-started.d.ts +0 -27
  56. package/dist/examples/getting-started.d.ts.map +0 -1
  57. package/dist/examples/mcp-preset-transports.d.ts +0 -19
  58. package/dist/examples/mcp-preset-transports.d.ts.map +0 -1
  59. package/dist/examples/simple-cli.d.ts +0 -26
  60. package/dist/examples/simple-cli.d.ts.map +0 -1
  61. package/dist/examples/v1.1.0-showcase.d.ts +0 -16
  62. package/dist/examples/v1.1.0-showcase.d.ts.map +0 -1
  63. package/dist/examples/with-env-example.d.ts +0 -3
  64. package/dist/examples/with-env-example.d.ts.map +0 -1
  65. package/dist/index-6G9StDO_.js +0 -6445
  66. package/dist/index-6G9StDO_.js.map +0 -1
  67. package/dist/index-CqU7Fj3C.cjs +0 -6444
  68. package/dist/index-CqU7Fj3C.cjs.map +0 -1
  69. package/dist/index-Dx_q1msW.js +0 -4682
  70. package/dist/index-Dx_q1msW.js.map +0 -1
  71. package/dist/src/ArgParser.d.ts +0 -156
  72. package/dist/src/ArgParser.d.ts.map +0 -1
  73. package/dist/src/ArgParserBase.d.ts.map +0 -1
  74. package/dist/src/FlagManager.d.ts.map +0 -1
  75. package/dist/src/fuzzy-test-cli.d.ts +0 -5
  76. package/dist/src/fuzzy-test-cli.d.ts.map +0 -1
  77. package/dist/src/fuzzy-tester.d.ts.map +0 -1
  78. package/dist/src/mcp-integration.d.ts +0 -31
  79. package/dist/src/mcp-integration.d.ts.map +0 -1
  80. package/dist/src/types.d.ts.map +0 -1
  81. package/dist/sse-B5Jf_YpG.cjs +0 -121
  82. package/dist/sse-B5Jf_YpG.cjs.map +0 -1
  83. package/dist/sse-BDL3h2Ll.js +0 -121
  84. package/dist/sse-BDL3h2Ll.js.map +0 -1
  85. package/dist/sse-DSjLfGFo.js +0 -107
  86. package/dist/sse-DSjLfGFo.js.map +0 -1
  87. package/dist/stdio-Cf19UQO7.js +0 -70
  88. package/dist/stdio-Cf19UQO7.js.map +0 -1
  89. package/dist/stdio-DESvSONI.cjs +0 -94
  90. package/dist/stdio-DESvSONI.cjs.map +0 -1
  91. package/dist/stdio-DLOResWr.js +0 -94
  92. package/dist/stdio-DLOResWr.js.map +0 -1
  93. package/dist/streamableHttp-DXIdDSbF.js +0 -342
  94. package/dist/streamableHttp-DXIdDSbF.js.map +0 -1
  95. package/dist/streamableHttp-DsXlAnqJ.cjs +0 -456
  96. package/dist/streamableHttp-DsXlAnqJ.cjs.map +0 -1
  97. package/dist/streamableHttp-Vd4Qsgko.js +0 -456
  98. package/dist/streamableHttp-Vd4Qsgko.js.map +0 -1
  99. package/dist/types-DSxPEImy.cjs +0 -943
  100. package/dist/types-DSxPEImy.cjs.map +0 -1
  101. package/dist/types-DdsPVLQ5.js +0 -846
  102. package/dist/types-DdsPVLQ5.js.map +0 -1
  103. package/dist/types-DpK81FWv.js +0 -944
  104. package/dist/types-DpK81FWv.js.map +0 -1
  105. /package/dist/src/{FlagManager.d.ts → core/FlagManager.d.ts} +0 -0
@@ -0,0 +1,132 @@
1
+ /**
2
+ * MCP Prompts Management
3
+ *
4
+ * This module provides functionality for managing MCP prompts - server-side prompt templates
5
+ * that clients can discover and execute with custom parameters for dynamic text generation.
6
+ */
7
+ import { ZodTypeAny } from "zod";
8
+ /**
9
+ * Prompt message content types
10
+ */
11
+ export interface McpPromptTextContent {
12
+ type: "text";
13
+ text: string;
14
+ }
15
+ export interface McpPromptImageContent {
16
+ type: "image";
17
+ data: string;
18
+ mimeType: string;
19
+ }
20
+ export type McpPromptContent = McpPromptTextContent | McpPromptImageContent;
21
+ /**
22
+ * Prompt message structure
23
+ */
24
+ export interface McpPromptMessage {
25
+ role: "user" | "assistant" | "system";
26
+ content: McpPromptContent;
27
+ }
28
+ /**
29
+ * Prompt response structure
30
+ */
31
+ export interface McpPromptResponse {
32
+ description?: string;
33
+ messages: McpPromptMessage[];
34
+ }
35
+ /**
36
+ * Prompt handler function type
37
+ */
38
+ export type McpPromptHandler = (args: any) => McpPromptResponse | Promise<McpPromptResponse>;
39
+ /**
40
+ * Prompt configuration for registration
41
+ */
42
+ export interface McpPromptConfig {
43
+ name: string;
44
+ title?: string;
45
+ description?: string;
46
+ argsSchema: ZodTypeAny;
47
+ handler: McpPromptHandler;
48
+ }
49
+ /**
50
+ * Internal prompt storage structure
51
+ */
52
+ export interface McpPromptEntry {
53
+ config: McpPromptConfig;
54
+ registeredAt: Date;
55
+ }
56
+ /**
57
+ * MCP Prompts Manager
58
+ *
59
+ * Manages registration, storage, and execution of MCP prompts
60
+ */
61
+ export declare class McpPromptsManager {
62
+ private prompts;
63
+ private changeListeners;
64
+ /**
65
+ * Register a new prompt
66
+ */
67
+ addPrompt(config: McpPromptConfig): void;
68
+ /**
69
+ * Remove a prompt by name
70
+ */
71
+ removePrompt(name: string): boolean;
72
+ /**
73
+ * Get all registered prompts
74
+ */
75
+ getPrompts(): McpPromptConfig[];
76
+ /**
77
+ * Get a specific prompt by name
78
+ */
79
+ getPrompt(name: string): McpPromptConfig | undefined;
80
+ /**
81
+ * Check if a prompt exists
82
+ */
83
+ hasPrompt(name: string): boolean;
84
+ /**
85
+ * Execute a prompt with given arguments
86
+ */
87
+ executePrompt(name: string, args: any): Promise<McpPromptResponse>;
88
+ /**
89
+ * Add change listener
90
+ */
91
+ onPromptsChange(listener: () => void): void;
92
+ /**
93
+ * Remove change listener
94
+ */
95
+ offPromptsChange(listener: () => void): void;
96
+ /**
97
+ * Clear all prompts
98
+ */
99
+ clear(): void;
100
+ /**
101
+ * Get prompt count
102
+ */
103
+ count(): number;
104
+ /**
105
+ * Validate prompt configuration
106
+ */
107
+ private validatePromptConfig;
108
+ /**
109
+ * Notify all listeners of changes
110
+ */
111
+ private notifyChange;
112
+ }
113
+ /**
114
+ * Helper function to create common prompt configurations
115
+ */
116
+ /**
117
+ * Create a code review prompt
118
+ */
119
+ export declare const createCodeReviewPrompt: () => McpPromptConfig;
120
+ /**
121
+ * Create a text summarization prompt
122
+ */
123
+ export declare const createSummarizationPrompt: () => McpPromptConfig;
124
+ /**
125
+ * Create a translation prompt
126
+ */
127
+ export declare const createTranslationPrompt: () => McpPromptConfig;
128
+ /**
129
+ * Create a documentation prompt
130
+ */
131
+ export declare const createDocumentationPrompt: () => McpPromptConfig;
132
+ //# sourceMappingURL=mcp-prompts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-prompts.d.ts","sourceRoot":"","sources":["../../../src/mcp/mcp-prompts.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAK,UAAU,EAAE,MAAM,KAAK,CAAC;AAEpC;;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B;;OAEG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAIpD;;OAEG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIhC;;OAEG;IACG,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAkBxE;;OAEG;IACH,eAAe,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IAI3C;;OAEG;IACH,gBAAgB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IAI5C;;OAEG;IACH,KAAK,IAAI,IAAI;IAQb;;OAEG;IACH,KAAK,IAAI,MAAM;IAIf;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAkB5B;;OAEG;IACH,OAAO,CAAC,YAAY;CASrB;AAED;;GAEG;AAEH;;GAEG;AACH,eAAO,MAAM,sBAAsB,QAAO,eAmBxC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,yBAAyB,QAAO,eA6B3C,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,uBAAuB,QAAO,eAyBzC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,yBAAyB,QAAO,eAyB3C,CAAC"}
@@ -0,0 +1,133 @@
1
+ /**
2
+ * MCP Resources Management
3
+ *
4
+ * This module provides functionality for managing MCP resources - server-side data sources
5
+ * that clients can access using URI templates. Resources are similar to GET endpoints
6
+ * in a REST API and should provide data without significant computation or side effects.
7
+ */
8
+ /**
9
+ * Resource response content item
10
+ */
11
+ export interface McpResourceContent {
12
+ uri: string;
13
+ text?: string;
14
+ blob?: Uint8Array;
15
+ mimeType?: string;
16
+ }
17
+ /**
18
+ * Resource response structure
19
+ */
20
+ export interface McpResourceResponse {
21
+ contents: McpResourceContent[];
22
+ }
23
+ /**
24
+ * Resource handler function type
25
+ */
26
+ export type McpResourceHandler = (uri: URL, params: Record<string, string>) => Promise<McpResourceResponse>;
27
+ /**
28
+ * Resource configuration for registration
29
+ */
30
+ export interface McpResourceConfig {
31
+ name: string;
32
+ uriTemplate: string;
33
+ title?: string;
34
+ description?: string;
35
+ mimeType?: string;
36
+ handler: McpResourceHandler;
37
+ }
38
+ /**
39
+ * Internal resource storage structure
40
+ */
41
+ export interface McpResourceEntry {
42
+ config: McpResourceConfig;
43
+ registeredAt: Date;
44
+ }
45
+ /**
46
+ * Resource template parser for URI patterns like "users://{userId}/profile"
47
+ */
48
+ export declare class ResourceTemplateParser {
49
+ private pattern;
50
+ private paramNames;
51
+ constructor(template: string);
52
+ /**
53
+ * Parse a URI against this template and extract parameters
54
+ */
55
+ parse(uri: string): Record<string, string> | null;
56
+ /**
57
+ * Check if a URI matches this template
58
+ */
59
+ matches(uri: string): boolean;
60
+ /**
61
+ * Get the parameter names for this template
62
+ */
63
+ getParameterNames(): string[];
64
+ }
65
+ /**
66
+ * MCP Resources Manager
67
+ *
68
+ * Manages registration, storage, and retrieval of MCP resources
69
+ */
70
+ export declare class McpResourcesManager {
71
+ private resources;
72
+ private changeListeners;
73
+ /**
74
+ * Register a new resource
75
+ */
76
+ addResource(config: McpResourceConfig): void;
77
+ /**
78
+ * Remove a resource by name
79
+ */
80
+ removeResource(name: string): boolean;
81
+ /**
82
+ * Get all registered resources
83
+ */
84
+ getResources(): McpResourceConfig[];
85
+ /**
86
+ * Get a specific resource by name
87
+ */
88
+ getResource(name: string): McpResourceConfig | undefined;
89
+ /**
90
+ * Check if a resource exists
91
+ */
92
+ hasResource(name: string): boolean;
93
+ /**
94
+ * Find resource that matches a URI
95
+ */
96
+ findResourceForUri(uri: string): {
97
+ config: McpResourceConfig;
98
+ params: Record<string, string>;
99
+ } | null;
100
+ /**
101
+ * Add change listener
102
+ */
103
+ onResourcesChange(listener: () => void): void;
104
+ /**
105
+ * Remove change listener
106
+ */
107
+ offResourcesChange(listener: () => void): void;
108
+ /**
109
+ * Clear all resources
110
+ */
111
+ clear(): void;
112
+ /**
113
+ * Get resource count
114
+ */
115
+ count(): number;
116
+ /**
117
+ * Validate resource configuration
118
+ */
119
+ private validateResourceConfig;
120
+ /**
121
+ * Notify all listeners of changes
122
+ */
123
+ private notifyChange;
124
+ }
125
+ /**
126
+ * Helper function to create common resource configurations
127
+ */
128
+ export declare const createFileResource: (basePath?: string) => McpResourceConfig;
129
+ /**
130
+ * Helper function to create JSON data resource
131
+ */
132
+ export declare const createJsonResource: (name: string, data: any) => McpResourceConfig;
133
+ //# sourceMappingURL=mcp-resources.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-resources.d.ts","sourceRoot":"","sources":["../../../src/mcp/mcp-resources.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,kBAAkB,EAAE,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAC/B,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAC3B,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAElC;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,kBAAkB,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,YAAY,EAAE,IAAI,CAAC;CACpB;AAED;;GAEG;AACH,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AAI,WAAU,MAAW,KAAG,iBAuBzD,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,EAAE,MAAM,GAAG,KAAG,iBAa3D,CAAC"}
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ import { ArgParser } from "../core/ArgParser";
3
+ declare const fuzzyTestCli: ArgParser<void>;
4
+ export { fuzzyTestCli };
5
+ //# sourceMappingURL=fuzzy-test-cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fuzzy-test-cli.d.ts","sourceRoot":"","sources":["../../../src/testing/fuzzy-test-cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAgB9C,QAAA,MAAM,YAAY,iBAmEhB,CAAC;AAkPH,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { ArgParserBase } from "./ArgParserBase";
1
+ import type { ArgParserBase } from "../core/ArgParserBase";
2
2
  export interface FuzzyTestOptions {
3
3
  /** Maximum depth for command path exploration */
4
4
  maxDepth?: number;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fuzzy-tester.d.ts","sourceRoot":"","sources":["../../../src/testing/fuzzy-tester.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAG3D,MAAM,WAAW,gBAAgB;IAC/B,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+DAA+D;IAC/D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,4CAA4C;IAC5C,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,yDAAyD;IACzD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mCAAmC;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,IAAI,EAAE,MAAM,EA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W,WAAW;IA0CzB;;OAEG;IACH,OAAO,CAAC,cAAc;CAuCvB"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@alcyone-labs/arg-parser",
3
- "version": "1.1.0",
4
- "description": "A robust, type-safe command line argument parser with automatic type inference, validation, help generation and complex sub-command support, now with built-in MCP and fuzzy testing support.",
3
+ "version": "2.0.0",
4
+ "description": "A robust, type-safe command line argument parser with plugin architecture, dependency injection, Claude Desktop compliant MCP integration, autonomous DXT builds, and zero-dependency core functionality.",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
7
7
  "module": "dist/index.mjs",
@@ -18,7 +18,15 @@
18
18
  "./package.json": "./package.json"
19
19
  },
20
20
  "files": [
21
- "dist",
21
+ "dist/index.cjs",
22
+ "dist/index.cjs.map",
23
+ "dist/index.mjs",
24
+ "dist/index.mjs.map",
25
+ "dist/index.min.mjs",
26
+ "dist/index.min.mjs.map",
27
+ "dist/src/**/*.d.ts",
28
+ "dist/src/**/*.d.ts.map",
29
+ "dist/assets/**/*",
22
30
  "README.md",
23
31
  "LICENSE"
24
32
  ],
@@ -30,30 +38,39 @@
30
38
  "CLI",
31
39
  "Arg Parser",
32
40
  "CLI Commands",
33
- "Sub-commands"
41
+ "Sub-commands",
42
+ "MCP",
43
+ "LLM Tool Calls",
44
+ "DXT"
34
45
  ],
35
46
  "author": "Nicolas Embleton <nicolas.embleton@gmail.com>",
36
47
  "license": "MIT",
48
+ "engines": {
49
+ "node": ">=18.0.0"
50
+ },
37
51
  "dependencies": {
38
- "@iarna/toml": "^2.2.5",
39
- "chalk": "^5.4.1",
40
- "dotenv": "^16.5.0",
41
- "js-yaml": "^4.1.0",
52
+ "@alcyone-labs/simple-chalk": "^1.0.1",
53
+ "@alcyone-labs/simple-mcp-logger": "^1.0.1",
42
54
  "magic-regexp": "^0.10.0",
43
- "zod": "^3.25.67"
55
+ "zod": "^3.25.76"
44
56
  },
45
57
  "optionalDependencies": {
46
- "@modelcontextprotocol/sdk": "^1.13.1",
47
- "express": "^5.1.0"
58
+ "@modelcontextprotocol/sdk": "^1.15.1",
59
+ "express": "^5.1.0",
60
+ "smol-toml": "^1.4.1",
61
+ "dotenv": "^16.6.1",
62
+ "js-yaml": "^4.1.0",
63
+ "tsdown": "^0.12.9"
48
64
  },
49
65
  "devDependencies": {
50
- "@ianvs/prettier-plugin-sort-imports": "^4.4.2",
66
+ "@ianvs/prettier-plugin-sort-imports": "^4.5.1",
67
+ "@types/adm-zip": "^0.5.7",
51
68
  "@types/express": "^5.0.3",
52
69
  "@types/js-yaml": "^4.0.9",
53
- "@types/node": "^22.15.33",
70
+ "@types/node": "^22.16.3",
54
71
  "cross-env": "^7.0.3",
55
72
  "madge": "^8.0.0",
56
- "prettier": "^3.6.1",
73
+ "prettier": "^3.6.2",
57
74
  "ts-node": "^10.9.2",
58
75
  "typescript": "^5.8.3",
59
76
  "vite": "^6.3.5",
@@ -61,20 +78,37 @@
61
78
  "vitest": "^3.2.4"
62
79
  },
63
80
  "scripts": {
64
- "clean": "rm -rf dist",
81
+ "clean": "rm -rf dist dist-examples",
65
82
  "build:types": "tsc --project tsconfig.json --emitDeclarationOnly",
66
83
  "build:cjs": "cross-env VITE_BUILD_FORMAT=cjs vite build",
67
84
  "build:esm": "cross-env VITE_BUILD_FORMAT=es VITE_MINIFY_BUILD=false vite build",
68
85
  "build:min": "cross-env VITE_BUILD_FORMAT=es VITE_MINIFY_BUILD=true vite build",
69
- "build": "pnpm clean && pnpm run build:types && pnpm run build:cjs && pnpm run build:esm && pnpm run build:min",
86
+ "build": "pnpm clean && pnpm run build:types && pnpm run build:cjs && pnpm run build:esm && pnpm run build:min && pnpm run build:assets",
87
+ "build:assets": "mkdir -p dist/assets && cp docs/MCP/icons/logo_1_small.jpg dist/assets/ && cp tsdown.dxt.config.ts dist/assets/ && cp .dxtignore.template dist/assets/",
70
88
  "build:watch": "tsc --watch",
89
+ "build:examples": "tsc --project tsconfig.examples.json",
71
90
  "test:watch": "vitest",
72
91
  "test:run": "vitest run",
73
92
  "test:ui": "vitest --ui",
93
+ "test:mcp": "bun tests/mcp/integration/run-integration-tests.ts",
94
+ "test:mcp:verbose": "bun tests/mcp/integration/run-integration-tests.ts --verbose",
95
+ "test:mcp:e2e": "bun tests/mcp/integration/run-integration-tests.ts --suite end-to-end",
96
+ "test:mcp:protocol": "bun tests/mcp/integration/run-integration-tests.ts --suite protocol-compliance",
97
+ "test:mcp:performance": "bun tests/mcp/integration/run-integration-tests.ts --suite performance",
98
+ "test:mcp:canny": "bun tests/mcp/integration/run-integration-tests.ts --suite canny-cli",
99
+ "test:mcp:compliance": "vitest run tests/mcp/compliance/",
100
+ "test:mcp:dxt": "vitest run tests/mcp/compliance/dxt-compliance.test.ts",
74
101
  "format": "prettier . --write",
75
102
  "check:cir-dep": "madge ./ -c --ts-config tsconfig.dev.json",
76
103
  "check:types": "tsc --project ./tsconfig.dev.json --noEmit",
77
104
  "build:checks": "pnpm check:cir-dep && pnpm check:types",
78
- "test:built": "node test-built-library.mjs"
105
+ "test:built": "node test-built-library.mjs",
106
+ "tsdown:dxt": "tsdown -c tsdown.dxt.config.ts",
107
+ "dxt:validate": "npx @anthropic-ai/dxt validate",
108
+ "dxt:info": "npx @anthropic-ai/dxt info",
109
+ "dxt:sign": "npx @anthropic-ai/dxt sign --self-signed",
110
+ "dxt:pack": "npx @anthropic-ai/dxt pack",
111
+ "dxt:unpack": "npx @anthropic-ai/dxt unpack",
112
+ "dxt:verify": "npx @anthropic-ai/dxt verify"
79
113
  }
80
114
  }
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bun
2
- import { ArgParser } from '../src/ArgParser';
3
- declare const demoParser: ArgParser<{
4
- action: string;
5
- processed: boolean;
6
- }>;
7
- export default demoParser;
8
- //# sourceMappingURL=fuzzy-demo.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fuzzy-demo.d.ts","sourceRoot":"","sources":["../../examples/fuzzy-demo.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,QAAA,MAAM,UAAU;;;EA8Cd,CAAC;AAwCH,eAAe,UAAU,CAAC"}
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bun
2
- import { ArgParser } from "../src/ArgParser";
3
- declare const exampleParser: ArgParser<{
4
- action: string;
5
- args: any;
6
- }>;
7
- export default exampleParser;
8
- //# sourceMappingURL=fuzzy-test-example.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fuzzy-test-example.d.ts","sourceRoot":"","sources":["../../examples/fuzzy-test-example.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAI7C,QAAA,MAAM,aAAa;;;EAsLjB,CAAC;AA+DH,eAAe,aAAa,CAAC"}
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bun
2
- export interface IFzfSearchResult {
3
- files: string[];
4
- error?: string;
5
- commandExecuted?: string;
6
- stderrOutput?: string;
7
- }
8
- //# sourceMappingURL=fzf-search-cli.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fzf-search-cli.d.ts","sourceRoot":"","sources":["../../examples/fzf-search-cli.ts"],"names":[],"mappings":";AAUA,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB"}
@@ -1,27 +0,0 @@
1
- #!/usr/bin/env bun
2
- /**
3
- * Getting Started with ArgParser
4
- *
5
- * This is a complete, executable CLI that demonstrates the most common ArgParser patterns.
6
- * It's a file processing tool that showcases:
7
- * - Basic flags (string, number, boolean, array)
8
- * - Sub-commands with their own flags
9
- * - MCP server integration
10
- * - Modern best practices
11
- *
12
- * Usage:
13
- * bun examples/getting-started.ts --input file.txt --output result.txt
14
- * bun examples/getting-started.ts convert --input file.txt --format json
15
- * bun examples/getting-started.ts serve # Start MCP server
16
- * bun examples/getting-started.ts --help
17
- */
18
- import { ArgParser } from "../src";
19
- declare const cli: ArgParser<{
20
- success: boolean;
21
- processed: any;
22
- output: any;
23
- format: any;
24
- tags: any;
25
- }>;
26
- export default cli;
27
- //# sourceMappingURL=getting-started.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getting-started.d.ts","sourceRoot":"","sources":["../../examples/getting-started.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAGnC,QAAA,MAAM,GAAG;;;;;;EAoKP,CAAC;AAGH,eAAe,GAAG,CAAC"}
@@ -1,19 +0,0 @@
1
- #!/usr/bin/env bun
2
- /**
3
- * Example: MCP Preset Transport Configuration
4
- *
5
- * This example demonstrates how to configure preset MCP transports
6
- * that will be used when no CLI transport flags are provided.
7
- *
8
- * Usage:
9
- * bun examples/mcp-preset-transports.ts --input "Hello World"
10
- * bun examples/mcp-preset-transports.ts serve # Uses preset transports
11
- * bun examples/mcp-preset-transports.ts serve --transport sse --port 4000 # Overrides presets
12
- */
13
- import { ArgParser } from "../src";
14
- import type { McpTransportConfig } from "../src";
15
- declare const defaultTransports: McpTransportConfig[];
16
- declare const cli: ArgParser<any>;
17
- declare const cliWithSinglePreset: ArgParser<any>;
18
- export { cli, cliWithSinglePreset, defaultTransports };
19
- //# sourceMappingURL=mcp-preset-transports.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mcp-preset-transports.d.ts","sourceRoot":"","sources":["../../examples/mcp-preset-transports.ts"],"names":[],"mappings":";AACA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAGjD,QAAA,MAAM,iBAAiB,EAAE,kBAAkB,EAI1C,CAAC;AAGF,QAAA,MAAM,GAAG,gBA2EP,CAAC;AAGH,QAAA,MAAM,mBAAmB,gBAyBvB,CAAC;AAsBH,OAAO,EAAE,GAAG,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,CAAC"}
@@ -1,26 +0,0 @@
1
- #!/usr/bin/env bun
2
- /**
3
- * Simple CLI Example - demonstrates basic ArgParser usage
4
- *
5
- * This example shows how to create a simple CLI tool with:
6
- * - Basic flags with different types
7
- * - Mandatory and optional flags
8
- * - Default values
9
- * - Enum validation
10
- * - Help generation
11
- *
12
- * Usage:
13
- * bun examples/simple-cli.ts --env production --port 8080 --verbose
14
- * bun examples/simple-cli.ts --help
15
- */
16
- import { ArgParser } from "../src";
17
- declare const parser: ArgParser<{
18
- success: boolean;
19
- environment: any;
20
- port: any;
21
- verbose: any;
22
- files: any;
23
- output: any;
24
- }>;
25
- export default parser;
26
- //# sourceMappingURL=simple-cli.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"simple-cli.d.ts","sourceRoot":"","sources":["../../examples/simple-cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAGnC,QAAA,MAAM,MAAM;;;;;;;EA6EV,CAAC;AAGH,eAAe,MAAM,CAAC"}
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env bun
2
- /**
3
- * ArgParser v1.1.0 Feature Showcase - File Search & Processing Tool
4
- *
5
- * This example demonstrates all the new features in version 1.1.0 with REAL functionality:
6
- * 1. System flags (--s-*): --s-debug, --s-debug-print, --s-with-env, --s-save-to-env
7
- * 2. Environment variable loading from multiple file formats (.env, .yaml, .json, .toml)
8
- * 3. Configuration export to multiple file formats
9
- * 4. MCP server integration with multiple transport types
10
- * 5. Enhanced error handling and validation
11
- * 6. Real file search using fzf and file processing capabilities
12
- */
13
- import { ArgParser } from "../src";
14
- declare const cli: ArgParser<any>;
15
- export default cli;
16
- //# sourceMappingURL=v1.1.0-showcase.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"v1.1.0-showcase.d.ts","sourceRoot":"","sources":["../../examples/v1.1.0-showcase.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AA0HnC,QAAA,MAAM,GAAG,gBAoQP,CAAA;AAIF,eAAe,GAAG,CAAC"}
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env bun
2
- export {};
3
- //# sourceMappingURL=with-env-example.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"with-env-example.d.ts","sourceRoot":"","sources":["../../examples/with-env-example.ts"],"names":[],"mappings":""}