@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.
Files changed (75) hide show
  1. package/README.md +20 -127
  2. package/dist/config/plugins/index.d.ts +36 -4
  3. package/dist/config/plugins/index.d.ts.map +1 -1
  4. package/dist/core/ArgParser.d.ts +124 -464
  5. package/dist/core/ArgParser.d.ts.map +1 -1
  6. package/dist/core/FlagManager.d.ts +36 -136
  7. package/dist/core/FlagManager.d.ts.map +1 -1
  8. package/dist/core/PromptManager.d.ts +42 -91
  9. package/dist/core/PromptManager.d.ts.map +1 -1
  10. package/dist/core/log-path-utils.d.ts +28 -36
  11. package/dist/core/log-path-utils.d.ts.map +1 -1
  12. package/dist/core/types.d.ts +83 -592
  13. package/dist/core/types.d.ts.map +1 -1
  14. package/dist/index.cjs +599 -9658
  15. package/dist/index.cjs.map +1 -1
  16. package/dist/index.d.ts +26 -15
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.min.mjs +615 -8224
  19. package/dist/index.min.mjs.map +1 -1
  20. package/dist/index.mjs +581 -8881
  21. package/dist/index.mjs.map +1 -1
  22. package/dist/plugin/types.d.ts +121 -0
  23. package/dist/plugin/types.d.ts.map +1 -0
  24. package/dist/utils/debug-utils.d.ts +4 -26
  25. package/dist/utils/debug-utils.d.ts.map +1 -1
  26. package/package.json +12 -73
  27. package/dist/assets/.dxtignore.template +0 -37
  28. package/dist/assets/logo_1_small.jpg +0 -0
  29. package/dist/config/ConfigurationManager.d.ts +0 -82
  30. package/dist/config/ConfigurationManager.d.ts.map +0 -1
  31. package/dist/config/plugins/ConfigPlugin.d.ts +0 -60
  32. package/dist/config/plugins/ConfigPlugin.d.ts.map +0 -1
  33. package/dist/config/plugins/ConfigPluginRegistry.d.ts +0 -72
  34. package/dist/config/plugins/ConfigPluginRegistry.d.ts.map +0 -1
  35. package/dist/config/plugins/TomlConfigPlugin.d.ts +0 -30
  36. package/dist/config/plugins/TomlConfigPlugin.d.ts.map +0 -1
  37. package/dist/config/plugins/YamlConfigPlugin.d.ts +0 -29
  38. package/dist/config/plugins/YamlConfigPlugin.d.ts.map +0 -1
  39. package/dist/core/ArgParserBase.d.ts +0 -319
  40. package/dist/core/ArgParserBase.d.ts.map +0 -1
  41. package/dist/core/dxt-path-resolver.d.ts +0 -100
  42. package/dist/core/dxt-path-resolver.d.ts.map +0 -1
  43. package/dist/dxt/DxtGenerator-testUtils.d.ts +0 -22
  44. package/dist/dxt/DxtGenerator-testUtils.d.ts.map +0 -1
  45. package/dist/dxt/DxtGenerator.d.ts +0 -120
  46. package/dist/dxt/DxtGenerator.d.ts.map +0 -1
  47. package/dist/mcp/ArgParserMcp.d.ts +0 -21
  48. package/dist/mcp/ArgParserMcp.d.ts.map +0 -1
  49. package/dist/mcp/mcp-integration.d.ts +0 -86
  50. package/dist/mcp/mcp-integration.d.ts.map +0 -1
  51. package/dist/mcp/mcp-lifecycle.d.ts +0 -163
  52. package/dist/mcp/mcp-lifecycle.d.ts.map +0 -1
  53. package/dist/mcp/mcp-notifications.d.ts +0 -132
  54. package/dist/mcp/mcp-notifications.d.ts.map +0 -1
  55. package/dist/mcp/mcp-prompts.d.ts +0 -132
  56. package/dist/mcp/mcp-prompts.d.ts.map +0 -1
  57. package/dist/mcp/mcp-protocol-versions.d.ts +0 -150
  58. package/dist/mcp/mcp-protocol-versions.d.ts.map +0 -1
  59. package/dist/mcp/mcp-resources.d.ts +0 -133
  60. package/dist/mcp/mcp-resources.d.ts.map +0 -1
  61. package/dist/mcp/mcp-utils.d.ts +0 -20
  62. package/dist/mcp/mcp-utils.d.ts.map +0 -1
  63. package/dist/mcp/zod-compatibility.d.ts +0 -74
  64. package/dist/mcp/zod-compatibility.d.ts.map +0 -1
  65. package/dist/testing/fuzzy-test-cli.d.ts +0 -5
  66. package/dist/testing/fuzzy-test-cli.d.ts.map +0 -1
  67. package/dist/testing/fuzzy-tester.d.ts +0 -101
  68. package/dist/testing/fuzzy-tester.d.ts.map +0 -1
  69. package/dist/tui/index.d.ts +0 -281
  70. package/dist/tui/types.d.ts +0 -60
  71. package/dist/tui/types.d.ts.map +0 -1
  72. package/dist/tui.cjs +0 -1060
  73. package/dist/tui.cjs.map +0 -1
  74. package/dist/tui.mjs +0 -967
  75. package/dist/tui.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"mcp-protocol-versions.d.ts","sourceRoot":"","sources":["../../src/mcp/mcp-protocol-versions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,qDAIxB,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,kBAAkB,oBAErB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,gBAAgB,8DAA6D,CAAC;AAE3F;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAExE;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,4BAA4B,EAAE,kBAAiC,CAAC;AAE7E;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,EAAE,kBAAiC,CAAC;AAE7E;;GAEG;AACH,eAAO,MAAM,2BAA2B,EAAE,kBACe,CAAC;AAE1D;;GAEG;AACH,eAAO,MAAM,4BAA4B,EAAE,kBAA6C,CAAC;AAEzF;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEhE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,IAAI,kBAAkB,CAEnF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,IAAI,eAAe,CAE7E;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,IAAI,aAAa,CAEzE;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAIpE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAG1D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,wBAAwB,CAAC,gBAAgB,EAAE,MAAM,GAAG,aAAa,CAmBhF;AAED;;GAEG;AACH,wBAAgB,2BAA2B;;;;;;;;;;;;;;EAuB1C;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAG9D;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CAMnE;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;CA4CpB,CAAC"}
@@ -1,133 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"mcp-resources.d.ts","sourceRoot":"","sources":["../../src/mcp/mcp-resources.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH;;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,qBAAa,sBAAsB;IACjC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,UAAU,CAAW;gBAEjB,QAAQ,EAAE,MAAM;IAU5B;;OAEG;IACH,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;IAWjD;;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itizes a tool name to comply with MCP naming requirements.
6
- * MCP tool names must match the pattern: ^[a-zA-Z0-9_-]{1,64}$
7
- *
8
- * @param name The original tool name
9
- * @returns A sanitized tool name that complies with MCP requirements
10
- */
11
- export declare function sanitizeMcpToolName(name: string): string;
12
- /**
13
- * Validates if a tool name complies with MCP naming requirements.
14
- * MCP tool names must match the pattern: ^[a-zA-Z0-9_-]{1,64}$
15
- *
16
- * @param name The tool name to validate
17
- * @returns True if the name is valid, false otherwise
18
- */
19
- export declare function isValidMcpToolName(name: string): boolean;
20
- //# sourceMappingURL=mcp-utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mcp-utils.d.ts","sourceRoot":"","sources":["../../src/mcp/mcp-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAmBxD;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAOxD"}
@@ -1,74 +0,0 @@
1
- /**
2
- * Zod v3/v4 compatibility layer for MCP SDK integration
3
- *
4
- * The MCP SDK currently expects Zod v3 "raw shape" types for input schemas,
5
- * but this project uses Zod v4. This module provides compatibility functions
6
- * to convert Zod v4 schemas to formats that the MCP SDK can understand.
7
- */
8
- import { type ZodObject, type ZodRawShape, type ZodTypeAny } from "zod";
9
- /**
10
- * Type representing a Zod v3 compatible raw shape
11
- */
12
- type ZodV3CompatibleShape = Record<string, ZodTypeAny>;
13
- /**
14
- * Type representing what the MCP SDK expects for tool registration
15
- */
16
- interface McpSdkCompatibleSchema {
17
- shape?: ZodV3CompatibleShape;
18
- _def?: any;
19
- _zod?: any;
20
- parse?: (input: any) => any;
21
- safeParse?: (input: any) => any;
22
- }
23
- /**
24
- * Converts a Zod v4 schema to a format compatible with the MCP SDK's expectations
25
- * for Zod v3 raw shape types.
26
- *
27
- * @param zodSchema - The Zod v4 schema to convert
28
- * @returns A schema format compatible with MCP SDK
29
- */
30
- export declare function convertToMcpCompatibleSchema(zodSchema: ZodTypeAny): McpSdkCompatibleSchema;
31
- /**
32
- * Creates an empty schema compatible with MCP SDK for tools with no parameters
33
- */
34
- export declare function createEmptyMcpSchema(): McpSdkCompatibleSchema;
35
- /**
36
- * Extracts the raw shape from a Zod v4 object schema in a way that's
37
- * compatible with what MCP SDK expects from Zod v3.
38
- *
39
- * @param zodObjectSchema - A Zod object schema
40
- * @returns The raw shape or empty object if extraction fails
41
- */
42
- export declare function extractRawShape(zodObjectSchema: ZodObject<ZodRawShape>): ZodV3CompatibleShape;
43
- /**
44
- * Checks if a schema is a Zod object schema
45
- */
46
- export declare function isZodObjectSchema(schema: any): schema is ZodObject<ZodRawShape>;
47
- /**
48
- * Converts Zod v4 schemas to the specific format expected by MCP SDK tool registration.
49
- * This function handles the conversion for the server.registerTool() call.
50
- *
51
- * @param zodSchema - The Zod v4 schema to convert
52
- * @returns A schema format that MCP SDK can work with
53
- */
54
- export declare function prepareMcpToolSchema(zodSchema: ZodTypeAny): any;
55
- /**
56
- * Simple approach: Create a clean copy of Zod schema without v4-specific properties
57
- * This is a non-recursive version to avoid infinite loops
58
- */
59
- export declare function createCleanZodSchema(zodSchema: ZodTypeAny): any;
60
- /**
61
- * Convert a Zod schema to a JSON Schema object that the MCP SDK expects
62
- * This is the correct approach - the MCP SDK expects JSON Schema, not Zod schemas
63
- */
64
- export declare function zodToJsonSchema(zodSchema: ZodTypeAny): any;
65
- /**
66
- * Debug function to log schema structure for troubleshooting
67
- */
68
- export declare function debugSchemaStructure(schema: any, label?: string): void;
69
- /**
70
- * Validates that a schema is compatible with MCP SDK expectations
71
- */
72
- export declare function validateMcpSchemaCompatibility(schema: any): boolean;
73
- export {};
74
- //# sourceMappingURL=zod-compatibility.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"zod-compatibility.d.ts","sourceRoot":"","sources":["../../src/mcp/zod-compatibility.ts"],"names":[],"mappings":"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AO,CA2BnE"}
@@ -1,5 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"fuzzy-test-cli.d.ts","sourceRoot":"","sources":["../../src/testing/fuzzy-test-cli.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAc9C,QAAA,MAAM,YAAY,iBAkEhB,CAAC;AAyPH,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -1,101 +0,0 @@
1
- import type { IArgParser } from "../core/types";
2
- export interface FuzzyTestOptions {
3
- /** Maximum depth for command path exploration */
4
- maxDepth?: number;
5
- /** Number of random test cases to generate per command path */
6
- randomTestCases?: number;
7
- /** Include performance timing in results */
8
- includePerformance?: boolean;
9
- /** Test invalid combinations to verify error handling */
10
- testErrorCases?: boolean;
11
- /** Verbose output for debugging */
12
- verbose?: boolean;
13
- }
14
- export interface TestResult {
15
- commandPath: string[];
16
- args: string[];
17
- success: boolean;
18
- error?: string;
19
- executionTime?: number;
20
- parsedResult?: any;
21
- }
22
- export interface FuzzyTestReport {
23
- totalTests: number;
24
- successfulTests: number;
25
- failedTests: number;
26
- commandPaths: string[][];
27
- results: TestResult[];
28
- summary: {
29
- coverageByPath: Record<string, {
30
- total: number;
31
- passed: number;
32
- }>;
33
- errorTypes: Record<string, number>;
34
- };
35
- }
36
- export declare class ArgParserFuzzyTester {
37
- private parser;
38
- private options;
39
- constructor(parser: IArgParser, options?: FuzzyTestOptions);
40
- /**
41
- * Run comprehensive fuzzy testing on the ArgParser instance
42
- */
43
- runFuzzyTest(): Promise<FuzzyTestReport>;
44
- /**
45
- * Discover all possible command paths in the parser
46
- */
47
- private discoverCommandPaths;
48
- /**
49
- * Recursively discover subcommand paths
50
- */
51
- private discoverSubCommandPaths;
52
- /**
53
- * Get subcommands from a parser instance
54
- */
55
- private getSubCommands;
56
- /**
57
- * Get flags from a parser instance
58
- */
59
- private getFlags;
60
- /**
61
- * Test a specific command path with various flag combinations
62
- */
63
- private testCommandPath;
64
- /**
65
- * Get the parser instance for a specific command path
66
- */
67
- private getParserForPath;
68
- /**
69
- * Generate valid flag combinations for testing
70
- */
71
- private generateValidFlagCombinations;
72
- /**
73
- * Generate random flag combination
74
- */
75
- private generateRandomFlagCombination;
76
- /**
77
- * Generate error test cases
78
- */
79
- private generateErrorCases;
80
- /**
81
- * Generate arguments for a specific flag
82
- */
83
- private generateFlagArgs;
84
- /**
85
- * Generate values for a flag based on its type and constraints
86
- */
87
- private generateFlagValues;
88
- /**
89
- * Generate a single value for a flag
90
- */
91
- private generateSingleFlagValue;
92
- /**
93
- * Execute a single test case
94
- */
95
- private executeTest;
96
- /**
97
- * Generate comprehensive test report
98
- */
99
- private generateReport;
100
- }
101
- //# sourceMappingURL=fuzzy-tester.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fuzzy-tester.d.ts","sourceRoot":"","sources":["../../src/testing/fuzzy-tester.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAA8B,MAAM,eAAe,CAAC;AAE5E,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,EAAE,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,a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- /**
2
- * OpenTUI v2 - SolidJS-based Terminal User Interface Framework
3
- *
4
- * Type declarations for @alcyone-labs/arg-parser/tui
5
- */
6
-
7
- // Re-export core OpenTUI primitives from @opentui/solid
8
- export {
9
- render,
10
- createComponent,
11
- effect,
12
- memo,
13
- insert,
14
- spread,
15
- mergeProps,
16
- useKeyboard,
17
- useRenderer,
18
- } from "@opentui/solid";
19
-
20
- // Re-export JSX types for TypeScript support
21
- export type { JSX } from "@opentui/solid";
22
-
23
- // Re-export Accessor from solid-js for component props
24
- import type { Accessor as SolidAccessor } from "solid-js";
25
- export type Accessor<T> = SolidAccessor<T>;
26
-
27
- // =============================================================================
28
- // App Configuration
29
- // =============================================================================
30
-
31
- export interface TuiAppConfig {
32
- theme?: string | TuiTheme;
33
- shortcuts?: ShortcutBinding[];
34
- onDestroy?: () => void;
35
- }
36
-
37
- export declare function createTuiApp(App: () => JSX.Element, config?: TuiAppConfig): Promise<void>;
38
-
39
- // =============================================================================
40
- // TUI Provider
41
- // =============================================================================
42
-
43
- export interface TuiContextValue {
44
- viewportHeight: Accessor<number>;
45
- viewportWidth: Accessor<number>;
46
- exit: (code?: number) => void;
47
- }
48
-
49
- export interface TuiProviderProps {
50
- theme?: string | TuiTheme;
51
- shortcuts?: ShortcutBinding[];
52
- onScroll?: (delta: number) => void;
53
- scrollSpeed?: number;
54
- reservedRows?: number;
55
- children: JSX.Element;
56
- }
57
-
58
- export declare function TuiProvider(props: TuiProviderProps): JSX.Element;
59
- export declare function useTui(): TuiContextValue;
60
-
61
- // =============================================================================
62
- // Theme System
63
- // =============================================================================
64
-
65
- export interface TuiTheme {
66
- name: string;
67
- colors: {
68
- text: string;
69
- muted: string;
70
- background: string;
71
- accent: string;
72
- success: string;
73
- warning: string;
74
- error: string;
75
- border: string;
76
- selection: string;
77
- };
78
- }
79
-
80
- export interface ThemeContextValue {
81
- current: Accessor<TuiTheme>;
82
- setTheme: (name: string) => void;
83
- cycle: () => void;
84
- names: string[];
85
- }
86
-
87
- export declare const THEMES: Record<string, TuiTheme>;
88
- export declare const TuiThemes: typeof THEMES;
89
-
90
- export declare const Theme: {
91
- from(base: TuiTheme): {
92
- extend(overrides: Partial<TuiTheme>): TuiTheme;
93
- };
94
- create(theme: TuiTheme): TuiTheme;
95
- };
96
-
97
- export declare function ThemeProvider(props: {
98
- initial?: string;
99
- children: JSX.Element;
100
- }): JSX.Element;
101
-
102
- export declare function useTheme(): ThemeContextValue;
103
-
104
- // =============================================================================
105
- // Shortcuts
106
- // =============================================================================
107
-
108
- export interface ShortcutBinding {
109
- key: string;
110
- action: () => void;
111
- description?: string;
112
- }
113
-
114
- export interface ShortcutContextValue {
115
- register: (binding: ShortcutBinding) => void;
116
- unregister: (key: string) => void;
117
- }
118
-
119
- export declare function ShortcutProvider(props: {
120
- bindings?: ShortcutBinding[];
121
- children: JSX.Element;
122
- }): JSX.Element;
123
-
124
- export declare function useShortcuts(): ShortcutContextValue;
125
-
126
- // =============================================================================
127
- // Toast
128
- // =============================================================================
129
-
130
- export type ToastType = "info" | "success" | "warning" | "error";
131
-
132
- export interface ToastContextValue {
133
- show: (message: string, type?: ToastType) => void;
134
- success: (message: string) => void;
135
- error: (message: string) => void;
136
- warning: (message: string) => void;
137
- info: (message: string) => void;
138
- }
139
-
140
- export declare function ToastProvider(props: { children: JSX.Element }): JSX.Element;
141
-
142
- export declare function useToast(): ToastContextValue;
143
-
144
- // =============================================================================
145
- // Components
146
- // =============================================================================
147
-
148
- export interface BreadcrumbProps {
149
- segments: string[];
150
- separator?: string;
151
- }
152
-
153
- export declare function Breadcrumb(props: BreadcrumbProps): JSX.Element;
154
-
155
- export interface VirtualListProps<T = unknown> {
156
- items: T[] | Accessor<T[]>;
157
- selectedIndex: number | Accessor<number>;
158
- viewportHeight: number | Accessor<number>;
159
- title?: string;
160
- onSelect?: (idx: number) => void;
161
- getLabel?: (item: T) => string;
162
- showIndicator?: boolean;
163
- renderItem?: (item: T, idx: number, selected: boolean) => JSX.Element;
164
- }
165
-
166
- export interface VirtualListResult {
167
- scrollOffset: Accessor<number>;
168
- selectNext: () => void;
169
- selectPrevious: () => void;
170
- scrollTo: (idx: number) => void;
171
- }
172
-
173
- export declare function VirtualList<T = unknown>(props: VirtualListProps<T>): JSX.Element;
174
-
175
- export declare function createVirtualListController<T = unknown>(
176
- items: Accessor<T[]>,
177
- selectedIndex: Accessor<number>,
178
- setSelectedIndex: (idx: number) => void,
179
- viewportHeight: Accessor<number>,
180
- ): VirtualListResult;
181
-
182
- export interface MasterDetailProps {
183
- header?: string | JSX.Element;
184
- headerIcon?: string;
185
- breadcrumb?: string[];
186
- footer?: string;
187
- masterWidth?: string;
188
- master: JSX.Element;
189
- detail: JSX.Element;
190
- }
191
-
192
- export declare function MasterDetail(props: MasterDetailProps): JSX.Element;
193
-
194
- export interface CardProps {
195
- title?: string;
196
- padding?: number;
197
- borderStyle?: string;
198
- children: JSX.Element;
199
- }
200
-
201
- export declare function Card(props: CardProps): JSX.Element;
202
-
203
- export interface StatCardProps {
204
- label: string;
205
- value: number | string;
206
- format?: "percent" | "number";
207
- trend?: "up" | "down" | "none";
208
- }
209
-
210
- export declare function StatCard(props: StatCardProps): JSX.Element;
211
-
212
- export interface ButtonProps {
213
- label: string;
214
- onClick?: () => void;
215
- variant?: "primary" | "danger" | "muted";
216
- disabled?: boolean;
217
- }
218
-
219
- export declare function Button(props: ButtonProps): JSX.Element;
220
-
221
- export interface MarkdownBlockProps {
222
- content: string;
223
- }
224
-
225
- export declare function MarkdownBlock(props: MarkdownBlockProps): JSX.Element;
226
-
227
- export interface DrillDownNavigatorProps {
228
- children: (nav: {
229
- push: (component: () => JSX.Element) => void;
230
- pop: () => void;
231
- replace: (component: () => JSX.Element) => void;
232
- }) => JSX.Element;
233
- }
234
-
235
- export declare function DrillDownNavigator(props: DrillDownNavigatorProps): JSX.Element;
236
-
237
- export interface MasterDetailLayoutProps {
238
- masterWidth?: string;
239
- master: JSX.Element;
240
- detail: JSX.Element;
241
- }
242
-
243
- export declare function MasterDetailLayout(props: MasterDetailLayoutProps): JSX.Element;
244
-
245
- // =============================================================================
246
- // Hooks
247
- // =============================================================================
248
-
249
- export interface VirtualScrollResult {
250
- scrollOffset: Accessor<number>;
251
- setScrollOffset: (offset: number) => void;
252
- scrollBy: (delta: number) => void;
253
- }
254
-
255
- export declare function useVirtualScroll(
256
- itemCount: Accessor<number>,
257
- viewportHeight: Accessor<number>,
258
- ): VirtualScrollResult;
259
-
260
- export declare function getViewportHeight(reservedRows?: number): number;
261
-
262
- export interface UseMouseOptions {
263
- onWheel?: (delta: number) => void;
264
- }
265
-
266
- export declare function useMouse(options?: UseMouseOptions): void;
267
-
268
- // =============================================================================
269
- // TTY Utilities
270
- // =============================================================================
271
-
272
- export declare function cleanupTerminal(): void;
273
- export declare function enableMouseReporting(): void;
274
- export declare function disableMouseReporting(): void;
275
- export declare function clearScreen(): void;
276
- export declare function resetAttributes(): void;
277
- export declare function restoreStdin(): void;
278
- export declare function parseMouseScroll(data: Buffer): {
279
- direction: "up" | "down" | null;
280
- delta: number;
281
- } | null;