@alcyone-labs/arg-parser 2.5.0 → 2.6.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 +188 -70
- package/dist/core/FlagManager.d.ts.map +1 -1
- package/dist/core/dxt-path-resolver.d.ts +100 -0
- package/dist/core/dxt-path-resolver.d.ts.map +1 -0
- package/dist/core/log-path-utils.d.ts.map +1 -1
- package/dist/core/types.d.ts +69 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/dxt/DxtGenerator.d.ts +6 -0
- package/dist/dxt/DxtGenerator.d.ts.map +1 -1
- package/dist/index.cjs +630 -187
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.min.mjs +5399 -5070
- package/dist/index.min.mjs.map +1 -1
- package/dist/index.mjs +630 -187
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -27,6 +27,7 @@ A modern, type-safe command line argument parser with built-in MCP (Model Contex
|
|
|
27
27
|
- [Async Custom Parser Support](#async-custom-parser-support)
|
|
28
28
|
- [Zod Schema Flags (Structured JSON Validation)](#zod-schema-flags-structured-json-validation)
|
|
29
29
|
- [Type Conversion Examples](#type-conversion-examples)
|
|
30
|
+
- [DXT Package User Configuration & Path Handling](#dxt-package-user-configuration--path-handling)
|
|
30
31
|
- [Hierarchical CLIs (Sub-Commands)](#hierarchical-clis-sub-commands)
|
|
31
32
|
- [MCP Exposure Control](#mcp-exposure-control)
|
|
32
33
|
- [Flag Inheritance (`inheritParentFlags`)](#flag-inheritance-inheritparentflags)
|
|
@@ -70,6 +71,7 @@ A modern, type-safe command line argument parser with built-in MCP (Model Contex
|
|
|
70
71
|
- [Typical Errors](#typical-errors)
|
|
71
72
|
- [System Flags & Configuration](#system-flags--configuration)
|
|
72
73
|
- [Changelog](#changelog)
|
|
74
|
+
- [v2.6.0](#v260)
|
|
73
75
|
- [v2.5.0](#v250)
|
|
74
76
|
- [v2.4.2](#v242)
|
|
75
77
|
- [v2.4.1](#v241)
|
|
@@ -86,70 +88,6 @@ A modern, type-safe command line argument parser with built-in MCP (Model Contex
|
|
|
86
88
|
- [Backlog](#backlog)
|
|
87
89
|
- [(known) Bugs / DX improvement points](#known-bugs--dx-improvement-points)
|
|
88
90
|
|
|
89
|
-
- [Features Overview](#features-overview)
|
|
90
|
-
- [Installation](#installation)
|
|
91
|
-
- [Quick Start: The Unified `addTool` API](#quick-start-the-unified-addtool-api)
|
|
92
|
-
- [How to Run It](#how-to-run-it)
|
|
93
|
-
- [Setting Up System-Wide CLI Access](#setting-up-system-wide-cli-access)
|
|
94
|
-
- [Parsing Command-Line Arguments](#parsing-command-line-arguments)
|
|
95
|
-
- [Automatic Argument Detection](#automatic-argument-detection)
|
|
96
|
-
- [Cannonical Usage Pattern](#cannonical-usage-pattern)
|
|
97
|
-
- [Top-level await](#top-level-await)
|
|
98
|
-
- [Promise-based parsing](#promise-based-parsing)
|
|
99
|
-
- [Migrating from v1.x to the v2.0 `addTool` API](#migrating-from-v1x-to-the-v20-addtool-api)
|
|
100
|
-
- [Before v2.0: Separate Definitions](#before-v20-separate-definitions)
|
|
101
|
-
- [After v2.0: The Unified `addTool()` Method](#after-v20-the-unified-addtool-method)
|
|
102
|
-
- [Core Concepts](#core-concepts)
|
|
103
|
-
- [Defining Flags](#defining-flags)
|
|
104
|
-
- [Type Handling and Validation](#type-handling-and-validation)
|
|
105
|
-
- [Supported Type Formats](#supported-type-formats)
|
|
106
|
-
- [Runtime Type Validation](#runtime-type-validation)
|
|
107
|
-
- [Automatic Type Processing](#automatic-type-processing)
|
|
108
|
-
- [Async Custom Parser Support](#async-custom-parser-support)
|
|
109
|
-
- [Zod Schema Flags (Structured JSON Validation)](#zod-schema-flags-structured-json-validation)
|
|
110
|
-
- [Type Conversion Examples](#type-conversion-examples)
|
|
111
|
-
- [Hierarchical CLIs (Sub-Commands)](#hierarchical-clis-sub-commands)
|
|
112
|
-
- [MCP Exposure Control](#mcp-exposure-control)
|
|
113
|
-
- [Flag Inheritance (`inheritParentFlags`)](#flag-inheritance-inheritparentflags)
|
|
114
|
-
- [MCP & Claude Desktop Integration](#mcp--claude-desktop-integration)
|
|
115
|
-
- [Output Schema Support](#output-schema-support)
|
|
116
|
-
- [Basic Usage](#basic-usage)
|
|
117
|
-
- [Predefined Schema Patterns](#predefined-schema-patterns)
|
|
118
|
-
- [Custom Zod Schemas](#custom-zod-schemas)
|
|
119
|
-
- [MCP Version Compatibility](#mcp-version-compatibility)
|
|
120
|
-
- [Automatic Error Handling](#automatic-error-handling)
|
|
121
|
-
- [Writing Effective MCP Tool Descriptions](#writing-effective-mcp-tool-descriptions)
|
|
122
|
-
- [Best Practices for Tool Descriptions](#best-practices-for-tool-descriptions)
|
|
123
|
-
- [Complete Example: Well-Documented Tool](#complete-example-well-documented-tool)
|
|
124
|
-
- [Parameter Description Guidelines](#parameter-description-guidelines)
|
|
125
|
-
- [Common Pitfalls to Avoid](#common-pitfalls-to-avoid)
|
|
126
|
-
- [Automatic MCP Server Mode (`--s-mcp-serve`)](#automatic-mcp-server-mode---s-mcp-serve)
|
|
127
|
-
- [MCP Transports](#mcp-transports)
|
|
128
|
-
- [MCP Log Path Configuration](#mcp-log-path-configuration)
|
|
129
|
-
- [MCP Resources - Real-Time Data Feeds](#mcp-resources---real-time-data-feeds) ⭐
|
|
130
|
-
- [Automatic Console Safety](#automatic-console-safety)
|
|
131
|
-
- [Generating DXT Packages (`--s-build-dxt`)](#generating-dxt-packages---s-build-dxt)
|
|
132
|
-
- [Logo Configuration](#logo-configuration)
|
|
133
|
-
- [Supported Logo Sources](#supported-logo-sources)
|
|
134
|
-
- [How DXT Generation Works](#how-dxt-generation-works)
|
|
135
|
-
- [DXT Bundling Strategies](#dxt-bundling-strategies)
|
|
136
|
-
- [Standard Approach (Recommended for Most Projects)](#standard-approach-recommended-for-most-projects)
|
|
137
|
-
- [Native Dependencies Approach](#native-dependencies-approach)
|
|
138
|
-
- [Typical Errors](#typical-errors)
|
|
139
|
-
- [System Flags & Configuration](#system-flags--configuration)
|
|
140
|
-
- [Changelog](#changelog)
|
|
141
|
-
- [v2.3.0](#v230)
|
|
142
|
-
- [v2.2.1](#v221)
|
|
143
|
-
- [v2.2.0](#v220)
|
|
144
|
-
- [v2.1.1](#v211)
|
|
145
|
-
- [v2.1.0](#v210)
|
|
146
|
-
- [v2.0.0](#v200)
|
|
147
|
-
- [v1.3.0](#v130)
|
|
148
|
-
- [v1.2.0](#v120)
|
|
149
|
-
- [v1.1.0](#v110)
|
|
150
|
-
- [Backlog](#backlog)
|
|
151
|
-
- [(known) Bugs / DX improvement points](#known-bugs--dx-improvement-points)
|
|
152
|
-
|
|
153
91
|
## Features Overview
|
|
154
92
|
|
|
155
93
|
- **Unified Tool Architecture**: Define tools once with `addTool()` and they automatically function as both CLI subcommands and MCP tools.
|
|
@@ -609,7 +547,14 @@ Flags are defined using the `IFlag` interface within the `flags` array of a tool
|
|
|
609
547
|
interface IFlag {
|
|
610
548
|
name: string; // Internal name (e.g., 'verbose')
|
|
611
549
|
options: string[]; // Command-line options (e.g., ['--verbose', '-v'])
|
|
612
|
-
type:
|
|
550
|
+
type:
|
|
551
|
+
| "string"
|
|
552
|
+
| "number"
|
|
553
|
+
| "boolean"
|
|
554
|
+
| "array"
|
|
555
|
+
| "object"
|
|
556
|
+
| Function
|
|
557
|
+
| ZodSchema;
|
|
613
558
|
description?: string; // Help text
|
|
614
559
|
mandatory?: boolean | ((args: any) => boolean); // Whether the flag is required
|
|
615
560
|
defaultValue?: any; // Default value if not provided
|
|
@@ -618,9 +563,153 @@ interface IFlag {
|
|
|
618
563
|
validate?: (value: any, parsedArgs?: any) => boolean | string | void; // Custom validation function
|
|
619
564
|
allowMultiple?: boolean; // Allow the flag to be provided multiple times
|
|
620
565
|
env?: string; // Links the flag to an environment variable for DXT packages, will automatically generate user_config entries in the DXT manifest and fill the flag value to the ENV value if found (process.env)
|
|
566
|
+
dxtOptions?: DxtOptions; // Customizes how this flag appears in DXT package user_config
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
interface DxtOptions {
|
|
570
|
+
type?: "string" | "directory" | "file" | "boolean" | "number"; // UI input type in Claude Desktop
|
|
571
|
+
title?: string; // Display name in Claude Desktop (defaults to formatted flag name)
|
|
572
|
+
sensitive?: boolean; // Whether to hide the value in UI (defaults to true for security)
|
|
573
|
+
default?: any; // Default value for the user_config entry
|
|
574
|
+
min?: number; // Minimum value (for number types)
|
|
575
|
+
max?: number; // Maximum value (for number types)
|
|
621
576
|
}
|
|
622
577
|
```
|
|
623
578
|
|
|
579
|
+
### DXT Package User Configuration & Path Handling
|
|
580
|
+
|
|
581
|
+
ArgParser v2.5.0 introduces comprehensive DXT (Desktop Extension Toolkit) support with rich user interfaces, automatic path resolution, and context-aware development tools.
|
|
582
|
+
|
|
583
|
+
#### Enhanced dxtOptions
|
|
584
|
+
|
|
585
|
+
When generating DXT packages with `--s-build-dxt`, you can create rich user configuration interfaces using `dxtOptions`:
|
|
586
|
+
|
|
587
|
+
```typescript
|
|
588
|
+
import { ArgParser, DxtPathResolver } from "@alcyone-labs/arg-parser";
|
|
589
|
+
|
|
590
|
+
const parser = new ArgParser()
|
|
591
|
+
.withMcp({
|
|
592
|
+
name: "file-processor",
|
|
593
|
+
version: "1.0.0",
|
|
594
|
+
logPath: "${HOME}/logs/file-processor.log", // DXT variables supported!
|
|
595
|
+
})
|
|
596
|
+
.addFlag({
|
|
597
|
+
name: "input-file",
|
|
598
|
+
description: "File to process",
|
|
599
|
+
type: "string",
|
|
600
|
+
mandatory: true,
|
|
601
|
+
dxtOptions: {
|
|
602
|
+
type: "file",
|
|
603
|
+
title: "Select Input File",
|
|
604
|
+
},
|
|
605
|
+
})
|
|
606
|
+
.addFlag({
|
|
607
|
+
name: "output-dir",
|
|
608
|
+
description: "Output directory for processed files",
|
|
609
|
+
type: "string",
|
|
610
|
+
dxtOptions: {
|
|
611
|
+
type: "directory",
|
|
612
|
+
localDefault: "${DOCUMENTS}/processed-files", // Smart defaults with DXT variables
|
|
613
|
+
title: "Output Directory",
|
|
614
|
+
},
|
|
615
|
+
})
|
|
616
|
+
.addFlag({
|
|
617
|
+
name: "api-key",
|
|
618
|
+
description: "API authentication key",
|
|
619
|
+
type: "string",
|
|
620
|
+
env: "API_KEY",
|
|
621
|
+
dxtOptions: {
|
|
622
|
+
type: "string",
|
|
623
|
+
sensitive: true, // Excluded from DXT manifest for security
|
|
624
|
+
title: "API Key",
|
|
625
|
+
},
|
|
626
|
+
})
|
|
627
|
+
.addFlag({
|
|
628
|
+
name: "quality",
|
|
629
|
+
description: "Processing quality (1-100)",
|
|
630
|
+
type: "number",
|
|
631
|
+
dxtOptions: {
|
|
632
|
+
type: "number",
|
|
633
|
+
min: 1,
|
|
634
|
+
max: 100,
|
|
635
|
+
localDefault: 85,
|
|
636
|
+
title: "Quality (%)",
|
|
637
|
+
},
|
|
638
|
+
})
|
|
639
|
+
.addFlag({
|
|
640
|
+
name: "parallel",
|
|
641
|
+
description: "Enable parallel processing",
|
|
642
|
+
type: "boolean",
|
|
643
|
+
dxtOptions: {
|
|
644
|
+
type: "boolean",
|
|
645
|
+
localDefault: true,
|
|
646
|
+
title: "Parallel Processing",
|
|
647
|
+
},
|
|
648
|
+
});
|
|
649
|
+
```
|
|
650
|
+
|
|
651
|
+
#### DXT Variables & Path Resolution
|
|
652
|
+
|
|
653
|
+
ArgParser automatically resolves paths based on your runtime environment:
|
|
654
|
+
|
|
655
|
+
```typescript
|
|
656
|
+
// DXT variables work everywhere - in flags, MCP config, and code
|
|
657
|
+
const logPath = "${HOME}/logs/app.log";
|
|
658
|
+
const configPath = "${DOCUMENTS}/myapp/config.json";
|
|
659
|
+
const resourcePath = "${__dirname}/templates/default.hbs";
|
|
660
|
+
|
|
661
|
+
// Helper functions for common patterns
|
|
662
|
+
const userDataPath = DxtPathResolver.createUserDataPath("cache.db");
|
|
663
|
+
const tempPath = DxtPathResolver.createTempPath("processing.tmp");
|
|
664
|
+
const configPath = DxtPathResolver.createConfigPath("settings.json");
|
|
665
|
+
|
|
666
|
+
// Context detection
|
|
667
|
+
const context = DxtPathResolver.detectContext();
|
|
668
|
+
if (context.isDxt) {
|
|
669
|
+
console.log("Running in DXT environment");
|
|
670
|
+
} else {
|
|
671
|
+
console.log("Running in development");
|
|
672
|
+
}
|
|
673
|
+
```
|
|
674
|
+
|
|
675
|
+
**Supported DXT Variables:**
|
|
676
|
+
|
|
677
|
+
- `${HOME}` - User's home directory
|
|
678
|
+
- `${DOCUMENTS}` - Documents folder
|
|
679
|
+
- `${DOWNLOADS}` - Downloads folder
|
|
680
|
+
- `${DESKTOP}` - Desktop folder
|
|
681
|
+
- `${__dirname}` - Entry point directory (DXT package root in DXT)
|
|
682
|
+
- `${pathSeparator}` - Platform-specific path separator
|
|
683
|
+
- `${DXT_DIR}` - DXT package directory (DXT only)
|
|
684
|
+
- `${EXTENSION_DIR}` - Extension root directory (DXT only)
|
|
685
|
+
|
|
686
|
+
#### dxtOptions Properties
|
|
687
|
+
|
|
688
|
+
| Property | Type | Description |
|
|
689
|
+
| -------------- | ------------------------------------------------------------ | ------------------------------------------------ |
|
|
690
|
+
| `type` | `'string' \| 'file' \| 'directory' \| 'boolean' \| 'number'` | UI component type |
|
|
691
|
+
| `sensitive` | `boolean` | Mark as sensitive (excluded from manifest) |
|
|
692
|
+
| `localDefault` | `string \| number \| boolean` | Default for development (supports DXT variables) |
|
|
693
|
+
| `multiple` | `boolean` | Allow multiple values |
|
|
694
|
+
| `min` / `max` | `number` | Validation constraints |
|
|
695
|
+
| `title` | `string` | Custom display name |
|
|
696
|
+
|
|
697
|
+
#### Security & Best Practices
|
|
698
|
+
|
|
699
|
+
- **Sensitive Data**: Use `sensitive: true` for passwords, API keys, tokens
|
|
700
|
+
- **Smart Defaults**: Use DXT variables in `localDefault` for portable paths
|
|
701
|
+
- **Type Safety**: Match `dxtOptions.type` with flag `type` for validation
|
|
702
|
+
- **Cross-Platform**: Use `${pathSeparator}` for platform-independent paths
|
|
703
|
+
|
|
704
|
+
#### Comprehensive Documentation
|
|
705
|
+
|
|
706
|
+
For detailed guides and examples:
|
|
707
|
+
|
|
708
|
+
- **[DXT Path Handling Guide](./docs/DXT_PATH_HANDLING.md)** - Complete path resolution guide
|
|
709
|
+
- **[dxtOptions API Documentation](./docs/DXT_OPTIONS_API.md)** - Full API reference with examples
|
|
710
|
+
- **[DXT Migration Guide](./docs/DXT_MIGRATION.md)** - Migrate existing applications
|
|
711
|
+
- **[DXT Practical Examples](./docs/DXT_EXAMPLES.md)** - Real-world usage patterns
|
|
712
|
+
|
|
624
713
|
### Type Handling and Validation
|
|
625
714
|
|
|
626
715
|
ArgParser provides **strong typing** for flag definitions with comprehensive validation at both compile-time and runtime. The `type` property accepts multiple formats and ensures type safety throughout your application.
|
|
@@ -1407,9 +1496,9 @@ const cli = ArgParser.withMcp({
|
|
|
1407
1496
|
ctx.logger.mcpError(`Shutting down: ${ctx.reason}`);
|
|
1408
1497
|
await cleanupResources();
|
|
1409
1498
|
await closeDatabase();
|
|
1410
|
-
}
|
|
1411
|
-
}
|
|
1412
|
-
}
|
|
1499
|
+
},
|
|
1500
|
+
},
|
|
1501
|
+
},
|
|
1413
1502
|
});
|
|
1414
1503
|
```
|
|
1415
1504
|
|
|
@@ -1422,6 +1511,7 @@ const cli = ArgParser.withMcp({
|
|
|
1422
1511
|
**Context Properties:**
|
|
1423
1512
|
|
|
1424
1513
|
Each lifecycle event receives a context object with:
|
|
1514
|
+
|
|
1425
1515
|
- `getFlag(name)`: Access parsed CLI flags and environment variables
|
|
1426
1516
|
- `logger`: MCP-compliant logger instance for the current context
|
|
1427
1517
|
- `serverInfo`: Server information (name, version, description)
|
|
@@ -1824,6 +1914,34 @@ ArgParser includes built-in `--s-*` flags for development, debugging, and config
|
|
|
1824
1914
|
|
|
1825
1915
|
## Changelog
|
|
1826
1916
|
|
|
1917
|
+
### v2.6.0
|
|
1918
|
+
|
|
1919
|
+
**Feat**
|
|
1920
|
+
|
|
1921
|
+
**DXT**:
|
|
1922
|
+
|
|
1923
|
+
- Improve how paths and dynamic variables are handled when bundling into a DXT, to improve compatibility and reduce paths that will fail in a sandbox when the CLI / MCP expects path available on the system. Dynamic path resolution with `${VARIABLE}` syntax supporting `${HOME}`, `${DOCUMENTS}`, `${__dirname}`, `${DXT_DIR}`, and more. Context-aware path resolution with `DxtPathResolver.createUserDataPath()`, `createTempPath()`, `createConfigPath()`.
|
|
1924
|
+
- Add new IFlag.dxtOption set of options for each flag to allow finer control on how the flags are perceived on the DXT manifest / Claude Desktop.
|
|
1925
|
+
|
|
1926
|
+
Read more her: [DXT Package User Configuration & Path Handling](#dxt-package-user-configuration--path-handling)
|
|
1927
|
+
|
|
1928
|
+
**Fixes and Changes**
|
|
1929
|
+
|
|
1930
|
+
**DXT**:
|
|
1931
|
+
|
|
1932
|
+
- Improve handling of sensitive env variable, they were previously always showing as sensitive.
|
|
1933
|
+
|
|
1934
|
+
**Known Limitations**
|
|
1935
|
+
|
|
1936
|
+
**DXT**:
|
|
1937
|
+
|
|
1938
|
+
The DXT bundling / packing / unpacking / launching process is notoriously early and brittle. There are many reasons something is not working, but **MOST** importantly it will not work if:
|
|
1939
|
+
|
|
1940
|
+
1. You are bundling a package in a mono-repo (you will need to temporarily create a pnpm-workspace.yaml file for example to break the hierarchy)
|
|
1941
|
+
2. You do _not_ hard-install your node_modules as detailed in the documentation (it will only work if the node_modules are hard installed)
|
|
1942
|
+
3. In some cases if your CLI entrypoint does not run a main loop (see documentation for working examples)
|
|
1943
|
+
4. If you use PATH-dependent variables (for example relying on ~/.config/path/to/some.json). This has been addressed in v2.6.0, but you have to make sure you use the correct patterns (see documentation)
|
|
1944
|
+
|
|
1827
1945
|
### v2.5.0
|
|
1828
1946
|
|
|
1829
1947
|
**Feat**
|
|
@@ -1852,7 +1970,7 @@ ArgParser includes built-in `--s-*` flags for development, debugging, and config
|
|
|
1852
1970
|
- MCP client now sanitizes the method names to ensure spec-compliants MCP behavior, names that collision will be logged
|
|
1853
1971
|
- There were some use-cases where the DXT bundling failed, this new release addresses all of them, namely:
|
|
1854
1972
|
1. Output structure will match that of the input so relative files (for example DB migrations) will work
|
|
1855
|
-
2.
|
|
1973
|
+
2. Deeper folder structure was previously not working
|
|
1856
1974
|
- DXT bundling now supports including resources via options: `{dxt: {include: ['TSDown blob-like paths']}`
|
|
1857
1975
|
- Logger was improved to support log level via `options:{ log: {} }` so you can set it to level: 'debug' and the MCP log will contain 100% of the console output, logPath setting was not impacted
|
|
1858
1976
|
|
|
@@ -1946,8 +2064,8 @@ Make sure to clearly identify if you need to include the node_modules or not. In
|
|
|
1946
2064
|
- [x] Upgrade to Zod/V4 (V4 does not support functions well, this will take more time, not a priority)
|
|
1947
2065
|
- [ ] Add System flags to args.systemArgs
|
|
1948
2066
|
- [ ] Improve flag options collision prevention
|
|
1949
|
-
- [ ] Add support for locales / translations
|
|
1950
2067
|
- [ ] (potentially) add support for fully typed parsed output, this has proven very challenging
|
|
2068
|
+
- [ ] Add support for locales / translations
|
|
1951
2069
|
|
|
1952
2070
|
### (known) Bugs / DX improvement points
|
|
1953
2071
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlagManager.d.ts","sourceRoot":"","sources":["../../src/core/FlagManager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAEpD,qBAAa,WAAW;;gBAKpB,OAAO,GAAE;QAAE,sBAAsB,CAAC,EAAE,OAAO,CAAA;KAAO,EAClD,YAAY,GAAE,SAAS,KAAK,EAAO;IAMrC,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,GAAG,aAAa;
|
|
1
|
+
{"version":3,"file":"FlagManager.d.ts","sourceRoot":"","sources":["../../src/core/FlagManager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAEpD,qBAAa,WAAW;;gBAKpB,OAAO,GAAE;QAAE,sBAAsB,CAAC,EAAE,OAAO,CAAA;KAAO,EAClD,YAAY,GAAE,SAAS,KAAK,EAAO;IAMrC,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,GAAG,aAAa;IA0C5C,OAAO,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI;IAoB1B,+BAA+B,CAAC,aAAa,EAAE,aAAa,GAAG,IAAI;IAQnE,QAAQ,CAAC,KAAK,EAAE,SAAS,KAAK,EAAE,GAAG,IAAI;IAOvC,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI9B,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS;IAIhD,IAAI,KAAK,IAAI,aAAa,EAAE,CAE3B;IAED,IAAI,SAAS,IAAI,MAAM,EAAE,CAExB;CACF"}
|
|
@@ -0,0 +1,100 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,kDAAkD;IAClD,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,4DAA4D;IAC5D,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;GAEG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAC,cAAc,CAA6B;IAE1D;;;;OAIG;WACW,aAAa,CAAC,YAAY,UAAQ,GAAG,YAAY;IA0B/D;;;OAGG;WACW,gBAAgB,IAAI,OAAO;IAwCzC;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,qBAAqB;IA6BpC;;;;;;OAMG;WACW,WAAW,CACvB,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,YAAY,EACtB,MAAM,CAAC,EAAE,kBAAkB,GAC1B,MAAM;IAmBT;;;;;;OAMG;WACW,mBAAmB,CAC/B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,YAAY,EACrB,MAAM,CAAC,EAAE,kBAAkB,GAC1B,MAAM;IAuDT;;;;;OAKG;WACW,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,MAAM;IAgBlF;;;;;OAKG;WACW,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,MAAM;IAc9E;;;;;OAKG;WACW,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,MAAM;IAgBhF;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,UAAU;IAezB;;;;OAIG;WACW,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAYvD;;OAEG;WACW,UAAU,IAAI,IAAI;CAGjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-path-utils.d.ts","sourceRoot":"","sources":["../../src/core/log-path-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"log-path-utils.d.ts","sourceRoot":"","sources":["../../src/core/log-path-utils.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,wBAAwB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,UAAU,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,UAAU,CAAC;IAC1C,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,aAAa,CAAC;AAE7C;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,IAAI,CA0BhD;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAMzE;AAYD;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,OAAO,EAChB,kBAAkB,CAAC,EAAE,MAAM,GAC1B,MAAM,CAiFR;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAKzD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAKvD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,aAAa,CAM3E;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD"}
|
package/dist/core/types.d.ts
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
import { z, type ZodTypeAny } from "zod";
|
|
2
2
|
export type ArgParserInstance = any;
|
|
3
|
+
/**
|
|
4
|
+
* Zod schema for validating DXT-specific options
|
|
5
|
+
*/
|
|
6
|
+
export declare const zodDxtOptionsSchema: z.ZodObject<{
|
|
7
|
+
sensitive: z.ZodOptional<z.ZodBoolean>;
|
|
8
|
+
localDefault: z.ZodOptional<z.ZodString>;
|
|
9
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
10
|
+
string: "string";
|
|
11
|
+
number: "number";
|
|
12
|
+
boolean: "boolean";
|
|
13
|
+
directory: "directory";
|
|
14
|
+
file: "file";
|
|
15
|
+
}>>;
|
|
16
|
+
multiple: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
default: z.ZodOptional<z.ZodAny>;
|
|
20
|
+
title: z.ZodOptional<z.ZodString>;
|
|
21
|
+
}, z.core.$strict>;
|
|
3
22
|
export declare const zodFlagSchema: z.ZodPipe<z.ZodObject<{
|
|
4
23
|
name: z.ZodString;
|
|
5
24
|
allowLigature: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -13,6 +32,22 @@ export declare const zodFlagSchema: z.ZodPipe<z.ZodObject<{
|
|
|
13
32
|
validate: z.ZodOptional<z.ZodCustom<(value?: any, parsedArgs?: any) => boolean | string | void | Promise<boolean | string | void>, (value?: any, parsedArgs?: any) => boolean | string | void | Promise<boolean | string | void>>>;
|
|
14
33
|
enum: z.ZodOptional<z.ZodArray<z.ZodAny>>;
|
|
15
34
|
env: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
35
|
+
dxtOptions: z.ZodOptional<z.ZodObject<{
|
|
36
|
+
sensitive: z.ZodOptional<z.ZodBoolean>;
|
|
37
|
+
localDefault: z.ZodOptional<z.ZodString>;
|
|
38
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
39
|
+
string: "string";
|
|
40
|
+
number: "number";
|
|
41
|
+
boolean: "boolean";
|
|
42
|
+
directory: "directory";
|
|
43
|
+
file: "file";
|
|
44
|
+
}>>;
|
|
45
|
+
multiple: z.ZodOptional<z.ZodBoolean>;
|
|
46
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
47
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
48
|
+
default: z.ZodOptional<z.ZodAny>;
|
|
49
|
+
title: z.ZodOptional<z.ZodString>;
|
|
50
|
+
}, z.core.$strict>>;
|
|
16
51
|
}, z.core.$strip>, z.ZodTransform<{
|
|
17
52
|
[key: string]: any;
|
|
18
53
|
}, {
|
|
@@ -28,6 +63,16 @@ export declare const zodFlagSchema: z.ZodPipe<z.ZodObject<{
|
|
|
28
63
|
validate?: ((value?: any, parsedArgs?: any) => boolean | string | void | Promise<boolean | string | void>) | undefined;
|
|
29
64
|
enum?: any[] | undefined;
|
|
30
65
|
env?: string | string[] | undefined;
|
|
66
|
+
dxtOptions?: {
|
|
67
|
+
sensitive?: boolean | undefined;
|
|
68
|
+
localDefault?: string | undefined;
|
|
69
|
+
type?: "string" | "number" | "boolean" | "directory" | "file" | undefined;
|
|
70
|
+
multiple?: boolean | undefined;
|
|
71
|
+
min?: number | undefined;
|
|
72
|
+
max?: number | undefined;
|
|
73
|
+
default?: any;
|
|
74
|
+
title?: string | undefined;
|
|
75
|
+
} | undefined;
|
|
31
76
|
}>>;
|
|
32
77
|
/**
|
|
33
78
|
* The raw input type for defining a flag, before Zod processing (aliases, defaults).
|
|
@@ -46,6 +91,28 @@ export type TParsedArgsTypeFromFlagDef = StringConstructor | NumberConstructor |
|
|
|
46
91
|
export type ProcessedFlagCore = Omit<z.output<typeof zodFlagSchema>, "type"> & {
|
|
47
92
|
type: TParsedArgsTypeFromFlagDef;
|
|
48
93
|
};
|
|
94
|
+
/**
|
|
95
|
+
* DXT-specific configuration options for flags that will be included in DXT manifests.
|
|
96
|
+
* These options control how the flag appears in DXT user_config and how it behaves in DXT environments.
|
|
97
|
+
*/
|
|
98
|
+
export interface IDxtOptions {
|
|
99
|
+
/** Whether this field should be marked as sensitive in DXT user_config (default: true for ENV-linked flags) */
|
|
100
|
+
sensitive?: boolean;
|
|
101
|
+
/** Default value specific to DXT sandbox environment (different from regular default) */
|
|
102
|
+
localDefault?: string;
|
|
103
|
+
/** DXT input type - determines UI component in DXT clients (default: inferred from IFlag.type) */
|
|
104
|
+
type?: "string" | "directory" | "file" | "boolean" | "number";
|
|
105
|
+
/** Allow multiple values (for arrays) */
|
|
106
|
+
multiple?: boolean;
|
|
107
|
+
/** Minimum value (for number type) */
|
|
108
|
+
min?: number;
|
|
109
|
+
/** Maximum value (for number type) */
|
|
110
|
+
max?: number;
|
|
111
|
+
/** DXT-specific default value (overrides localDefault if provided) */
|
|
112
|
+
default?: any;
|
|
113
|
+
/** Custom title for the user_config field (overrides auto-generated title) */
|
|
114
|
+
title?: string;
|
|
115
|
+
}
|
|
49
116
|
/**
|
|
50
117
|
* The user-facing type for defining a flag. It includes aliases like `default` and `required`.
|
|
51
118
|
* The `handler` property is removed as handlers are typically associated with commands/subcommands, not individual flags.
|
|
@@ -57,6 +124,8 @@ export type IFlag = IFlagCore & {
|
|
|
57
124
|
required?: boolean | ((parsedArgs: TParsedArgs<any>) => boolean);
|
|
58
125
|
/** Environment variables that should be set from this flag's value in DXT packages */
|
|
59
126
|
env?: string | string[];
|
|
127
|
+
/** DXT-specific configuration options for enhanced DXT manifest generation */
|
|
128
|
+
dxtOptions?: IDxtOptions;
|
|
60
129
|
};
|
|
61
130
|
/**
|
|
62
131
|
* A more refined type for a flag after it has been fully processed by ArgParser,
|
package/dist/core/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,KAAK,UAAU,EAAE,MAAM,KAAK,CAAC;AAKzC,MAAM,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAEpC,eAAO,MAAM,aAAa;;;;;;;kHAmDD,MAAM,KAAK,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,UAA7B,MAAM,KAAK,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;qFA2B5B,GAAG,eAAe,GAAG,KAAK,OAAO,WAAjC,GAAG,eAAe,GAAG,K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C,YAAY,CAAC,EACzB,WAAW,CAAC,kBAAkB,CAAC,CAChC,KACE,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC"}
|
|
@@ -101,6 +101,12 @@ export declare class DxtGenerator {
|
|
|
101
101
|
*/
|
|
102
102
|
private detectTsdownOutputFile;
|
|
103
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;
|
|
104
110
|
/**
|
|
105
111
|
* Generate environment variables and user configuration from ArgParser flags
|
|
106
112
|
* @returns Object containing envVars and userConfig
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DxtGenerator.d.ts","sourceRoot":"","sources":["../../src/dxt/DxtGenerator.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"DxtGenerator.d.ts","sourceRoot":"","sources":["../../src/dxt/DxtGenerator.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAKjD;;;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;IAgJjC;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAmC5B,OAAO,CAAC,sBAAsB;IA4F9B;;OAEG;IACH;;;OAGG;YACW,eAAe;IA6J7B;;OAEG;YACW,kBAAkB;IA8ShC;;OAEG;IACI,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OA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