agentic-toolbox 0.5.3 → 0.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/AGENTS.md +26 -14
- package/CHANGELOG.md +211 -0
- package/README.md +90 -35
- package/dist/cli/args/flags.d.ts.map +1 -1
- package/dist/cli/args/flags.js +5 -0
- package/dist/cli/args/flags.js.map +1 -1
- package/dist/cli/args/parser.d.ts.map +1 -1
- package/dist/cli/args/parser.js +4 -2
- package/dist/cli/args/parser.js.map +1 -1
- package/dist/cli/args/strategies.d.ts.map +1 -1
- package/dist/cli/args/strategies.js +5 -3
- package/dist/cli/args/strategies.js.map +1 -1
- package/dist/cli/args/subcommands.d.ts +1 -2
- package/dist/cli/args/subcommands.d.ts.map +1 -1
- package/dist/cli/args/subcommands.js +10 -5
- package/dist/cli/args/subcommands.js.map +1 -1
- package/dist/cli/commands/diff.d.ts.map +1 -1
- package/dist/cli/commands/diff.js +3 -3
- package/dist/cli/commands/diff.js.map +1 -1
- package/dist/cli/commands/doctor.d.ts +8 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -0
- package/dist/cli/commands/doctor.js +104 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/index.d.ts +1 -0
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +1 -0
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.js +2 -2
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/sync.d.ts.map +1 -1
- package/dist/cli/commands/sync.js +6 -0
- package/dist/cli/commands/sync.js.map +1 -1
- package/dist/cli/commands/validate.d.ts.map +1 -1
- package/dist/cli/commands/validate.js +3 -2
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/help/print-help.d.ts.map +1 -1
- package/dist/cli/help/print-help.js +3 -2
- package/dist/cli/help/print-help.js.map +1 -1
- package/dist/cli/help/templates.d.ts.map +1 -1
- package/dist/cli/help/templates.js +9 -9
- package/dist/cli/help/templates.js.map +1 -1
- package/dist/cli/run-cli.d.ts.map +1 -1
- package/dist/cli/run-cli.js +28 -21
- package/dist/cli/run-cli.js.map +1 -1
- package/dist/core/config/discovery.js +1 -1
- package/dist/core/config/discovery.js.map +1 -1
- package/dist/core/config/loader.d.ts.map +1 -1
- package/dist/core/config/loader.js +16 -0
- package/dist/core/config/loader.js.map +1 -1
- package/dist/core/config/schema.d.ts +2 -2
- package/dist/core/config/schema.d.ts.map +1 -1
- package/dist/core/config/schema.js.map +1 -1
- package/dist/core/sync/engine-internal.d.ts.map +1 -1
- package/dist/core/sync/engine-internal.js +175 -49
- package/dist/core/sync/engine-internal.js.map +1 -1
- package/dist/core/sync/manifest.d.ts +1 -12
- package/dist/core/sync/manifest.d.ts.map +1 -1
- package/dist/core/sync/manifest.js.map +1 -1
- package/dist/core/sync/merger.d.ts.map +1 -1
- package/dist/core/sync/merger.js +4 -2
- package/dist/core/sync/merger.js.map +1 -1
- package/dist/core/transform/index.d.ts +2 -0
- package/dist/core/transform/index.d.ts.map +1 -1
- package/dist/core/transform/index.js +1 -0
- package/dist/core/transform/index.js.map +1 -1
- package/dist/core/transform/parser.d.ts +8 -0
- package/dist/core/transform/parser.d.ts.map +1 -1
- package/dist/core/transform/parser.js +98 -3
- package/dist/core/transform/parser.js.map +1 -1
- package/dist/core/transform/pipeline.d.ts +3 -0
- package/dist/core/transform/pipeline.d.ts.map +1 -0
- package/dist/core/transform/pipeline.js +10 -0
- package/dist/core/transform/pipeline.js.map +1 -0
- package/dist/core/transform/transform-agent.d.ts +2 -2
- package/dist/core/transform/transform-agent.d.ts.map +1 -1
- package/dist/core/transform/transform-agent.js +28 -9
- package/dist/core/transform/transform-agent.js.map +1 -1
- package/dist/types/cli.d.ts +1 -0
- package/dist/types/cli.d.ts.map +1 -1
- package/dist/types/config.d.ts +1 -1
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/constants.d.ts +2 -0
- package/dist/types/constants.d.ts.map +1 -0
- package/dist/types/constants.js +3 -0
- package/dist/types/constants.js.map +1 -0
- package/dist/types/errors.d.ts +28 -2
- package/dist/types/errors.d.ts.map +1 -1
- package/dist/types/errors.js +35 -1
- package/dist/types/errors.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/transform.d.ts +5 -0
- package/dist/types/transform.d.ts.map +1 -1
- package/dist/utils/errors/classes.d.ts +45 -38
- package/dist/utils/errors/classes.d.ts.map +1 -1
- package/dist/utils/errors/classes.js +41 -46
- package/dist/utils/errors/classes.js.map +1 -1
- package/dist/utils/errors/codes.d.ts +1 -27
- package/dist/utils/errors/codes.d.ts.map +1 -1
- package/dist/utils/errors/codes.js +2 -34
- package/dist/utils/errors/codes.js.map +1 -1
- package/dist/utils/errors/index.d.ts +1 -0
- package/dist/utils/errors/index.d.ts.map +1 -1
- package/dist/utils/errors/index.js +1 -0
- package/dist/utils/errors/index.js.map +1 -1
- package/dist/utils/errors/messages.d.ts +11 -0
- package/dist/utils/errors/messages.d.ts.map +1 -0
- package/dist/utils/errors/messages.js +13 -0
- package/dist/utils/errors/messages.js.map +1 -0
- package/dist/utils/logging/console.d.ts +7 -0
- package/dist/utils/logging/console.d.ts.map +1 -1
- package/dist/utils/logging/console.js +32 -11
- package/dist/utils/logging/console.js.map +1 -1
- package/dist/utils/logging/levels.d.ts +4 -0
- package/dist/utils/logging/levels.d.ts.map +1 -1
- package/package.json +15 -7
- package/dist/shared/targets.d.ts +0 -19
- package/dist/shared/targets.d.ts.map +0 -1
- package/dist/shared/targets.js +0 -69
- package/dist/shared/targets.js.map +0 -1
package/AGENTS.md
CHANGED
|
@@ -23,10 +23,10 @@ This package is consumed via npm (npm registry). The binary name is `agentic-too
|
|
|
23
23
|
| -------- | ------- |
|
|
24
24
|
| `README.md` | Project overview, features, setup |
|
|
25
25
|
| `docs/index.md` | Master documentation index & status tracker |
|
|
26
|
-
| `docs/
|
|
27
|
-
| `docs/
|
|
26
|
+
| `docs/ARCHITECTURE.md` | System design |
|
|
27
|
+
| `docs/ROADMAP.md` | Task tracking, completed work |
|
|
28
28
|
| `CHANGELOG.md` | Recent changes and release history |
|
|
29
|
-
| `docs/
|
|
29
|
+
| `docs/TRACKER.md` | Sprint-level task management |
|
|
30
30
|
|
|
31
31
|
---
|
|
32
32
|
|
|
@@ -37,12 +37,11 @@ This package is consumed via npm (npm registry). The binary name is `agentic-too
|
|
|
37
37
|
| File | Purpose | When to Read |
|
|
38
38
|
|------|---------|--------------|
|
|
39
39
|
| `docs/index.md` | **Master documentation index** — complete map of all docs, status, and navigation | **First** — gives you the full map of all documentation |
|
|
40
|
-
| `docs/
|
|
41
|
-
| `docs/
|
|
42
|
-
| `docs/
|
|
40
|
+
| `docs/ARCHITECTURE.md` | System design: sync engine, transform logic, CLI, project-level merge, data flow, distribution models | When working on sync engine, transform logic, or data flow |
|
|
41
|
+
| `docs/ROADMAP.md` | Development phases, prioritized task lists (Up Next, Backlog, Deferred, Completed) | Before starting any task — check current goal and priorities |
|
|
42
|
+
| `docs/TRACKER.md` | Sprint-level task management: current epic, tasks in progress, finished, pending | During active development — track current sprint state |
|
|
43
43
|
| `CHANGELOG.md` | Curated chronological log of notable changes per release (Keep a Changelog format) | When reviewing history or preparing releases |
|
|
44
|
-
| `docs/
|
|
45
|
-
| `docs/roadmap.md` | Development phases, prioritized task lists (Up Next, Backlog, Deferred, Completed) | When planning or prioritizing work |
|
|
44
|
+
| `docs/PROJECT.md` | Product vision, target users, core use cases, domain concepts, success criteria | When needing product context or domain understanding |
|
|
46
45
|
| `README.md` | Project overview, features, tech stack, quick start, installation, usage | For quick project overview and setup instructions |
|
|
47
46
|
| `CONTRIBUTING.md` | Human contributor guide: PR workflow, branch naming, commit conventions, dev setup | Before making contributions or PRs |
|
|
48
47
|
| `CONTRIBUTING.md` (dev section) | Local development setup: prerequisites, npm install, build, dev commands, project structure | When setting up local dev environment |
|
|
@@ -189,32 +188,45 @@ Ensure the skill file:
|
|
|
189
188
|
|
|
190
189
|
## Syncing Changes
|
|
191
190
|
|
|
192
|
-
After modifying any files in this repository,
|
|
191
|
+
After modifying any files in this repository, build and run a sync to verify:
|
|
193
192
|
|
|
194
193
|
```bash
|
|
195
|
-
npm run
|
|
194
|
+
npm run build
|
|
195
|
+
node dist/index.js sync --verbose
|
|
196
196
|
```
|
|
197
197
|
|
|
198
|
-
This syncs the toolkit contents to the
|
|
198
|
+
This syncs the toolkit contents to the target directories configured in `agentic-toolbox.json`.
|
|
199
199
|
|
|
200
200
|
Users run:
|
|
201
201
|
```bash
|
|
202
|
+
npx agentic-toolbox
|
|
203
|
+
# or, if installed as a devDependency, via the binary:
|
|
202
204
|
agentic-toolbox
|
|
203
|
-
# or via npm script
|
|
204
|
-
npm run agent:sync
|
|
205
205
|
```
|
|
206
206
|
|
|
207
207
|
---
|
|
208
208
|
|
|
209
209
|
## Engine Reference
|
|
210
210
|
|
|
211
|
-
The `dist/index.js` engine (published as `agentic-toolbox` binary) supports these
|
|
211
|
+
The `dist/index.js` engine (published as `agentic-toolbox` binary) supports these subcommands:
|
|
212
|
+
|
|
213
|
+
| Subcommand | Description |
|
|
214
|
+
|------------|-------------|
|
|
215
|
+
| `sync` | Sync agents and skills to target directories |
|
|
216
|
+
| `init` | Create a new `agentic-toolbox.json` config file (supports `--force` to overwrite an existing config) |
|
|
217
|
+
| `validate` | Validate the config file and agent/skill definitions |
|
|
218
|
+
| `diff` | Show a unified diff of what would change |
|
|
219
|
+
|
|
220
|
+
It also supports these CLI flags:
|
|
212
221
|
|
|
213
222
|
| Flag | Description |
|
|
214
223
|
|------|-------------|
|
|
215
224
|
| `--config <path>` | Use a custom config file (default: `agentic-toolbox.json`) |
|
|
216
225
|
| `--dry-run` | Preview what would be synced without making changes |
|
|
217
226
|
| `--verbose` | Enable verbose output |
|
|
227
|
+
| `--quiet` | Suppress non-error output |
|
|
228
|
+
| `--targets <list>` | Comma-separated list of targets to sync |
|
|
229
|
+
| `--version` | Show version |
|
|
218
230
|
| `--help` | Show help message |
|
|
219
231
|
|
|
220
232
|
### Configuration File (`agentic-toolbox.json`)
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
6
|
+
|
|
7
|
+
## [0.6.0] - 2026-11-28
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- **Test Infrastructure**: Added Vitest with 71 tests covering args parsing, config, transform, sync (unit + integration), logging, and a smoke test
|
|
11
|
+
- **Backup on Sync**: New `sync.backup` option creates a timestamped `.bak-<timestamp>` copy of the target directory before syncing
|
|
12
|
+
- **Comment Preservation**: New `transform.preserveComments` option retains comments when reassembling frontmatter
|
|
13
|
+
- **Conflict Warnings**: Sync now emits `WARN` messages when a project agent or skill overrides a toolkit template
|
|
14
|
+
- **Raw Logger Output**: Added `logger.raw()` for machine-readable output without level prefixes (used by help and version output)
|
|
15
|
+
- **Incremental Sync**: `--incremental` (or `sync.incremental`) skips the destructive wipe and only rewrites changed files, tracked via a manifest
|
|
16
|
+
- **Doctor Command**: `agentic-toolbox doctor` reports target-directory contents vs tool-managed files (read-only pre-flight)
|
|
17
|
+
- **JSON Output**: `--json` emits JSONL events (`ts`/`level`/`runId`/`message`) for tooling; includes a per-run correlation id
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
- **Type Deduplication**: Consolidated shared types into single definitions — `ErrorCode`, `ValidationErrorDetail`, and `SyncManifest`
|
|
21
|
+
- **Real Dry-Run Preview**: `--dry-run` now performs an actual preview of changes (files that would be written) without applying them
|
|
22
|
+
- **Lazy Prompt Import**: `@inquirer/prompts` is now imported dynamically only when `init` needs interactive input, reducing startup cost
|
|
23
|
+
- **Package Entry Points**: Declared `main`, `module`, and `types` fields (plus `exports`) so the package resolves correctly for both ESM and type consumers
|
|
24
|
+
- **ESM-only Package**: Dropped the broken CommonJS `require` export condition (TypeScript 7 has no CJS-compatible `moduleResolution`); the package is ESM-only
|
|
25
|
+
- **Node Requirement**: `engines.node` bumped to `>=20`
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
- **Documentation**: Corrected inaccuracies across project docs
|
|
29
|
+
|
|
30
|
+
### Security
|
|
31
|
+
- **Path Traversal Sanitization**: Config and file paths are now validated to reject `..` segments and absolute paths, preventing writes outside the intended directory
|
|
32
|
+
|
|
33
|
+
## [0.5.3] - 2026-10-30
|
|
34
|
+
|
|
35
|
+
### Fixed
|
|
36
|
+
- **Toolkit Directory Resolution**: Corrected `getToolkitDir()` so the toolkit resolves its bundled `agents/` and `skills/` correctly when installed as a dependency (not only when run from source)
|
|
37
|
+
|
|
38
|
+
## [0.5.2] - 2026-10-30
|
|
39
|
+
|
|
40
|
+
### Added
|
|
41
|
+
- **Detailed Sync Logging**: Per-agent and per-skill sync output now includes the target platform, making multi-target syncs easier to follow
|
|
42
|
+
|
|
43
|
+
## [0.5.1] - 2026-10-29
|
|
44
|
+
|
|
45
|
+
### Added
|
|
46
|
+
- **Postbuild Hook for Asset Copying**: Added `postbuild` lifecycle script that automatically copies `agents/` and `skills/` directories to `dist/` after build
|
|
47
|
+
- **Assets in Dist for Distribution**: Agents and skills directories are now copied to `dist/` during build, ensuring they're available when the package is consumed as a dependency
|
|
48
|
+
|
|
49
|
+
### Changed
|
|
50
|
+
- **Build Pipeline**: Refactored build pipeline to use `postbuild` lifecycle hook (`postbuild` → `copy-assets`) for automatic asset copying
|
|
51
|
+
- **Package Contents**: Removed root-level `agents/` and `skills/` from published package; now only `dist/` (with `agents/` and `skills/` inside) is published
|
|
52
|
+
- **Build Pipeline**: Refactored build pipeline to use `postbuild` lifecycle hook (`postbuild` → `copy-assets`) for automatic asset copying
|
|
53
|
+
|
|
54
|
+
### Fixed
|
|
55
|
+
- **Toolkit Directory Resolution**: Fixed `getToolkitDir()` to correctly resolve to `dist/` when installed as a dependency (goes up 3 levels from `dist/utils/fs`)
|
|
56
|
+
|
|
57
|
+
## [0.5.0] - 2026-10-29
|
|
58
|
+
|
|
59
|
+
### Added
|
|
60
|
+
- **Command-Specific Argument Types**: Defined dedicated interfaces (`SyncArgs`, `InitArgs`, `ValidateArgs`, `DiffArgs`) extending `BaseCommandArgs`
|
|
61
|
+
- **Target Definitions Consolidation**: Consolidated target definitions, target options, and strip fields into `src/types/targets.ts` as the single source of truth
|
|
62
|
+
|
|
63
|
+
### Changed
|
|
64
|
+
- **Type Safety Hardening**: Removed catch-all index signature `[key: string]: unknown` from CLI argument interfaces
|
|
65
|
+
- **Directory Consolidation**: Merged `src/shared` into `src/types` and eliminated `src/shared` directory
|
|
66
|
+
- **One-Directional Import Hierarchy**: Strictly enforced `types` → `utils` → `core` → `cli` dependency structure
|
|
67
|
+
- **Feature Locality Architecture**: Removed monolithic constants in favor of domain-scoped constants
|
|
68
|
+
- **Version**: Bumped to 0.5.0 (minor) for CLI type safety and target consolidation milestone
|
|
69
|
+
|
|
70
|
+
### Removed
|
|
71
|
+
- **Color Flags**: Removed non-core `--color` and `--no-color` flags from CLI options
|
|
72
|
+
|
|
73
|
+
## [0.4.0] - 2026-10-25
|
|
74
|
+
|
|
75
|
+
### Added
|
|
76
|
+
- **Interactive Init Command**: `agentic-toolbox init` now prompts for target platforms via interactive checkbox
|
|
77
|
+
- **Force Flag for Init**: `init --force` overwrites existing config with interactive target selection
|
|
78
|
+
- **Targets Flag**: `init --targets opencode,claude` skips prompt and uses specified targets
|
|
79
|
+
- **Shared Targets Module**: New `src/shared/targets.ts` as single source of truth for target definitions
|
|
80
|
+
- **Structured Error Display**: `validate` command now shows field-level errors with received values
|
|
81
|
+
|
|
82
|
+
### Changed
|
|
83
|
+
- **Init Command**: Always prompts for targets unless `--targets` flag provided; `--force` enables overwrite with prompt
|
|
84
|
+
- **Config Validation**: Enhanced error messages show field, message, and received value
|
|
85
|
+
- **Sync Reliability**: Verified across all targets (opencode, claude, agents) with field transformation
|
|
86
|
+
- **Version**: Bumped to 0.4.0 (minor) for MVP consolidation milestone
|
|
87
|
+
|
|
88
|
+
### Fixed
|
|
89
|
+
- **Init Command**: Now properly handles existing config with --force flag
|
|
90
|
+
- **Validation Errors**: Now display field name, error message, and received value for clarity
|
|
91
|
+
|
|
92
|
+
## [0.3.0] - 2026-10-25
|
|
93
|
+
|
|
94
|
+
### Added
|
|
95
|
+
- **Modular CLI Architecture**: Subcommands (`sync`, `validate`, `diff`, `init`) with dedicated implementations
|
|
96
|
+
- **Config Schema Validation**: Zod-like validation for `agentic-toolbox.json` with unknown field detection
|
|
97
|
+
- **YAML Frontmatter Parser**: Replaced regex-based parsing with `yaml` package for robust frontmatter handling
|
|
98
|
+
- **Structured Error Classes**: `SyncError`, `ConfigError`, `TransformError`, `ParseError`, `FsError`, `CliError`, `ValidationError` with error codes
|
|
99
|
+
- **Colored Console Logger**: Leveled logging (debug/info/warn/error/success) with ANSI colors
|
|
100
|
+
- **TypeScript Path Aliases**: `@/`, `@types/`, `@core/`, `@utils/`, `@cli/` for clean imports
|
|
101
|
+
- **tsc-alias Integration**: Runtime path alias resolution for compiled output
|
|
102
|
+
|
|
103
|
+
### Changed
|
|
104
|
+
- **Complete Architecture Restructure**: `src/` reorganized into `core/`, `utils/`, `cli/`, `types/` with clear separation of concerns
|
|
105
|
+
- **Barrel Export Pattern**: All `index.ts` files are now pure re-exports (no implementation)
|
|
106
|
+
- **CLI Refactor**: Argument parsing supports kebab-case flags, subcommand-specific flags, and proper flag merging
|
|
107
|
+
- **Sync Engine**: Modularized into `engine`, `targets`, `merger`, `manifest` with incremental sync foundation
|
|
108
|
+
- **Transform Pipeline**: Separated `parser`, `stripper`, `reassembler` for testability
|
|
109
|
+
- **Config System**: Split into `loader`, `schema`, `discovery` with full validation
|
|
110
|
+
- **Dev Script**: `npm run dev` now builds and runs CLI for rapid iteration
|
|
111
|
+
- **Version**: Bumped to 0.3.0 (minor) for architecture milestone
|
|
112
|
+
|
|
113
|
+
### Fixed
|
|
114
|
+
- **Binary Execution**: Added shebang to `src/index.ts` for proper npm bin wrapper
|
|
115
|
+
- **Path Resolution**: Robust toolkit directory detection for both source and installed contexts
|
|
116
|
+
|
|
117
|
+
## [0.2.0] - 2026-10-25
|
|
118
|
+
|
|
119
|
+
### Added
|
|
120
|
+
- **Bootstrapping**: Package now depends on itself (`agentic-toolbox@0.1.8` as devDependency) — the toolkit uses its own published version for development
|
|
121
|
+
- **Self-Hosting**: Published npm package can be used to develop the toolkit itself, creating a recursive improvement loop via bootstrapping
|
|
122
|
+
|
|
123
|
+
### Changed
|
|
124
|
+
- **Package Rename**: `agentic-toolkit` → `agentic-toolbox` across entire codebase
|
|
125
|
+
- Binary name: `agentic-toolkit` → `agentic-toolbox`
|
|
126
|
+
- Config file: `agentic-toolkit.json` → `agentic-toolbox.json`
|
|
127
|
+
- All documentation, source code, and references updated
|
|
128
|
+
- **Manual Release Flow**: Simplified from semantic-release to manual version bump + PR validation + merge + npm stage + manual promote
|
|
129
|
+
- **Version**: Bumped to 0.2.0 (minor) for bootstrapping milestone
|
|
130
|
+
|
|
131
|
+
### Fixed
|
|
132
|
+
- **Repository URLs**: Updated to `ritesh-jain/agentic-toolbox` consistently
|
|
133
|
+
|
|
134
|
+
## [0.1.8] - 2026-10-24
|
|
135
|
+
|
|
136
|
+
### Added
|
|
137
|
+
- **CI/CD Pipeline**: GitHub Actions workflows for validation and npm staging
|
|
138
|
+
- `validate.yml`: Runs on PR — build, test, package.json validation
|
|
139
|
+
- `publish.yml`: Runs on merge to main — stages to npm via OIDC
|
|
140
|
+
- **npm OIDC Trusted Publisher**: Configured for automated staging with provenance
|
|
141
|
+
- **Manual Release Flow**: Version bump via `npm version`, PR validation, merge, stage, manual promote
|
|
142
|
+
|
|
143
|
+
### Changed
|
|
144
|
+
- **Release Process**: Reverted from semantic-release to simple manual flow
|
|
145
|
+
- **Workflows**: Removed semantic-release automation; kept `validate.yml` and `publish.yml`
|
|
146
|
+
|
|
147
|
+
## [0.1.5] - 2026-10-18
|
|
148
|
+
|
|
149
|
+
### Added
|
|
150
|
+
- **npm Publishing**: Package published to npm registry as `agentic-toolbox`
|
|
151
|
+
- **GitHub Actions CI**: Automated validation on PR (build, test, package.json check)
|
|
152
|
+
- **npm Staging**: Automated `npm stage publish` on merge with OIDC provenance
|
|
153
|
+
- **Manual Promote**: `npm promote` for controlled public release
|
|
154
|
+
|
|
155
|
+
### Changed
|
|
156
|
+
- **Distribution**: npm-only (removed git submodule support)
|
|
157
|
+
- **Package Name**: `@riteshjain/agentic-toolkit` → `agentic-toolbox` (bare name)
|
|
158
|
+
|
|
159
|
+
## [0.1.0] - 2026-09-27
|
|
160
|
+
|
|
161
|
+
### Added
|
|
162
|
+
- **Modular TypeScript Architecture**: Split `start.js` into 7 modules (`index`, `cli`, `config`, `constants`, `transform`, `sync`, `types`) with strict TypeScript
|
|
163
|
+
- **Project-Level Merge**: Sync now merges `./agents/` and `./skills/` from consuming project, overriding package templates
|
|
164
|
+
- **CLI Flags**: `--config`, `--dry-run`, `--verbose`, `--help`
|
|
165
|
+
- **Auto-Discovery**: Falls back to `opencode.json` → `.opencode/`, `claude.json`/`.clauderc` → `.claude/`, default → `.agents/`
|
|
166
|
+
- **Agent Templates**: Complete cross-platform `agents/Agent.md.sample` with all Claude and OpenCode fields
|
|
167
|
+
- **Skill Templates**: Complete cross-platform `skills/SKILL.md.sample` with all fields
|
|
168
|
+
- **Creation Pipeline Skills**: `agent-creator`, `skill-creator`, `agentic-resource-gatherer` with references and examples
|
|
169
|
+
- **Build System**: `tsc` with declaration maps, source maps
|
|
170
|
+
- **npm Dependency**: Supports npm package consumption from GitHub (package name: `agentic-toolbox`)
|
|
171
|
+
|
|
172
|
+
### Changed
|
|
173
|
+
- **Sync Engine**: Rewritten in TypeScript with modular architecture
|
|
174
|
+
- **Field Stripping**: Moved to `constants.ts` with `STRIP_FIELDS` map
|
|
175
|
+
- **Config Loading**: Extracted to `config.ts` with auto-discovery
|
|
176
|
+
- **CLI**: Argument parsing, help, and orchestration in `cli.ts`
|
|
177
|
+
- **Package renamed**: `@riteshjain/agentic-toolkit` → `agentic-toolbox` (bare name)
|
|
178
|
+
- **Distribution**: npm-only (removed git submodule support)
|
|
179
|
+
|
|
180
|
+
### Removed
|
|
181
|
+
- **Reverse sync**: `--save` flag and `saveFromTarget()` functionality
|
|
182
|
+
- **Legacy entry point**: `start.js` removed (replaced by `src/index.ts` → `dist/index.js`)
|
|
183
|
+
- **Git submodule support**: Documentation and code paths removed
|
|
184
|
+
|
|
185
|
+
### Fixed
|
|
186
|
+
- **Project Merge Order**: Package agents/skills copied first, then project files override
|
|
187
|
+
- **Path Resolution**: Uses `process.cwd()` for parent, `import.meta.url` for toolkit dir
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## Release Notes Template
|
|
192
|
+
|
|
193
|
+
### [X.Y.Z] - YYYY-MM-DD
|
|
194
|
+
|
|
195
|
+
#### Added
|
|
196
|
+
- Feature descriptions
|
|
197
|
+
|
|
198
|
+
#### Changed
|
|
199
|
+
- Changes to existing functionality
|
|
200
|
+
|
|
201
|
+
#### Deprecated
|
|
202
|
+
- Soon-to-removed features
|
|
203
|
+
|
|
204
|
+
#### Removed
|
|
205
|
+
- Removed features
|
|
206
|
+
|
|
207
|
+
#### Fixed
|
|
208
|
+
- Bug fixes
|
|
209
|
+
|
|
210
|
+
#### Security
|
|
211
|
+
- Vulnerability fixes
|
package/README.md
CHANGED
|
@@ -20,14 +20,16 @@ This package acts as a **single source of truth** that syncs your agents and ski
|
|
|
20
20
|
|
|
21
21
|
## Installation
|
|
22
22
|
|
|
23
|
-
**Published on npm** as `agentic-toolbox`. Requires Node.js `>=
|
|
23
|
+
**Published on npm** as `agentic-toolbox`. Requires Node.js `>=20`.
|
|
24
|
+
|
|
25
|
+
There are **two ways** to use it:
|
|
26
|
+
|
|
27
|
+
### Option A — Install as a dev dependency (recommended)
|
|
24
28
|
|
|
25
29
|
```bash
|
|
26
|
-
# Install from npm registry (recommended)
|
|
27
30
|
npm install --save-dev agentic-toolbox
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
npm install --save-dev agentic-toolbox@0.5.0
|
|
31
|
+
# or pin a specific version
|
|
32
|
+
npm install --save-dev agentic-toolbox@0.6.0
|
|
31
33
|
```
|
|
32
34
|
|
|
33
35
|
This adds to your `package.json`:
|
|
@@ -35,24 +37,37 @@ This adds to your `package.json`:
|
|
|
35
37
|
```json
|
|
36
38
|
{
|
|
37
39
|
"devDependencies": {
|
|
38
|
-
"agentic-toolbox": "^0.
|
|
40
|
+
"agentic-toolbox": "^0.6.0"
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
43
|
```
|
|
42
44
|
|
|
43
|
-
|
|
45
|
+
Installing locally adds the `agentic-toolbox` **binary** to your path
|
|
46
|
+
(`node_modules/.bin`, and runnable via npm scripts). Every command below can
|
|
47
|
+
then call `agentic-toolbox` **directly** — no `npx` needed.
|
|
48
|
+
|
|
49
|
+
You can optionally add a convenience script:
|
|
44
50
|
|
|
45
51
|
```json
|
|
46
52
|
{
|
|
47
53
|
"scripts": {
|
|
48
|
-
"
|
|
54
|
+
"toolbox": "agentic-toolbox"
|
|
49
55
|
}
|
|
50
56
|
}
|
|
51
57
|
```
|
|
52
58
|
|
|
53
|
-
|
|
59
|
+
### Option B — Run directly with `npx` (no install)
|
|
54
60
|
|
|
55
|
-
|
|
61
|
+
If you'd rather not add a dependency, invoke it straight from the registry:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npx agentic-toolbox --help
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The examples below assume **Option A** (bare `agentic-toolbox`). If you're using
|
|
68
|
+
**Option B**, prefix the same command with `npx` (e.g. `npx agentic-toolbox init`).
|
|
69
|
+
|
|
70
|
+
### Create Config File
|
|
56
71
|
|
|
57
72
|
Create `agentic-toolbox.json` in your project root:
|
|
58
73
|
|
|
@@ -62,15 +77,25 @@ Create `agentic-toolbox.json` in your project root:
|
|
|
62
77
|
}
|
|
63
78
|
```
|
|
64
79
|
|
|
65
|
-
|
|
80
|
+
Or let the library generate one for you — `init` writes a default config
|
|
81
|
+
(interactively prompting for targets, or `--targets` to skip the prompt):
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
agentic-toolbox init # Option B: npx agentic-toolbox init
|
|
85
|
+
agentic-toolbox init --force # overwrite an existing config
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Run Sync
|
|
66
89
|
|
|
67
90
|
```bash
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
npx agentic-toolbox --config ./agentic-toolbox.json
|
|
91
|
+
agentic-toolbox sync # Option B: npx agentic-toolbox sync
|
|
92
|
+
agentic-toolbox sync --config ./agentic-toolbox.json
|
|
93
|
+
agentic-toolbox sync --dry-run # preview without writing
|
|
72
94
|
```
|
|
73
95
|
|
|
96
|
+
> Running `agentic-toolbox` with **no command** prints help and exits non-zero —
|
|
97
|
+
> it does not implicitly sync.
|
|
98
|
+
|
|
74
99
|
### Updating
|
|
75
100
|
|
|
76
101
|
```bash
|
|
@@ -85,18 +110,29 @@ npm install --save-dev agentic-toolbox@latest
|
|
|
85
110
|
|
|
86
111
|
| Command | Description |
|
|
87
112
|
|---------|-------------|
|
|
88
|
-
| `agentic-toolbox` | Sync agents/skills from toolkit to target dirs |
|
|
89
|
-
| `agentic-toolbox
|
|
113
|
+
| `agentic-toolbox sync` | Sync agents/skills from toolkit to target dirs |
|
|
114
|
+
| `agentic-toolbox` | No command: print help + available commands (non-zero exit) |
|
|
115
|
+
| `agentic-toolbox init` | Create a default `agentic-toolbox.json` (`--force` to overwrite) |
|
|
116
|
+
| `agentic-toolbox validate` | Validate the config and agent/skill definitions |
|
|
117
|
+
| `agentic-toolbox diff` | Show what would change without applying |
|
|
118
|
+
| `agentic-toolbox doctor` | Report target-dir contents vs tool-managed files (read-only) |
|
|
90
119
|
| `agentic-toolbox --dry-run` | Preview what would be synced without making changes |
|
|
91
|
-
| `agentic-toolbox --
|
|
92
|
-
| `agentic-toolbox --
|
|
120
|
+
| `agentic-toolbox --json` | Emit machine-readable JSON (JSONL) output |
|
|
121
|
+
| `agentic-toolbox --config <path>` | Use a non-default config file |
|
|
122
|
+
| `agentic-toolbox --targets <list>` | Comma-separated targets to sync |
|
|
123
|
+
| `agentic-toolbox --verbose` / `--quiet` | Increase / suppress output |
|
|
124
|
+
| `agentic-toolbox --version` / `--help` | Show version / help |
|
|
93
125
|
|
|
94
|
-
Via npm
|
|
126
|
+
Via an optional npm script:
|
|
95
127
|
|
|
96
128
|
```bash
|
|
97
|
-
npm run
|
|
129
|
+
npm run toolbox # → agentic-toolbox (if you added the script above)
|
|
98
130
|
```
|
|
99
131
|
|
|
132
|
+
> These commands assume **Option A** (local dev dependency), so `agentic-toolbox`
|
|
133
|
+
> is on your path. Using **Option B** (no install)? Prefix with `npx`, e.g.
|
|
134
|
+
> `npx agentic-toolbox sync`.
|
|
135
|
+
|
|
100
136
|
---
|
|
101
137
|
|
|
102
138
|
## Configuration
|
|
@@ -141,6 +177,23 @@ agentic-toolbox --config ./my-custom-config.json
|
|
|
141
177
|
|
|
142
178
|
---
|
|
143
179
|
|
|
180
|
+
## Configuration reference
|
|
181
|
+
|
|
182
|
+
All fields in `agentic-toolbox.json` are optional. The table below lists every
|
|
183
|
+
supported field, its type, default value, whether it is currently wired into the
|
|
184
|
+
sync engine, and what it does.
|
|
185
|
+
|
|
186
|
+
| Field | Type | Default | Status | Description |
|
|
187
|
+
|-------|------|---------|--------|-------------|
|
|
188
|
+
| `targets` | `string[]` | `["agents"]` | Wired | Array of target platforms to sync to: `opencode`, `claude`, or `agents`. |
|
|
189
|
+
| `sync.incremental` | `boolean` | `false` | Partial | Manifest-based; skips unchanged files on transform targets (opt-in). |
|
|
190
|
+
| `sync.backup` | `boolean` | `true` | Wired | Copies the target directory to `<dir>.bak-<timestamp>` before syncing. |
|
|
191
|
+
| `transform.preserveComments` | `boolean` | `false` | Wired | Preserves YAML comments when transforming files (via `parseDocument`). |
|
|
192
|
+
| `paths.agents` | `string` | `"agents"` | Wired | Directory (relative to the project root) holding master agent definitions. |
|
|
193
|
+
| `paths.skills` | `string` | `"skills"` | Wired | Directory (relative to the project root) holding master skill definitions. |
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
144
197
|
## Repository Structure
|
|
145
198
|
|
|
146
199
|
### When installed via npm
|
|
@@ -151,16 +204,18 @@ parent-project/
|
|
|
151
204
|
├── agentic-toolbox.json
|
|
152
205
|
├── node_modules/agentic-toolbox/
|
|
153
206
|
│ ├── package.json # CLI binary: agentic-toolbox → dist/index.js
|
|
154
|
-
│ ├── dist/ # Compiled output (generated)
|
|
155
|
-
│ │
|
|
207
|
+
│ ├── dist/ # Compiled output + copied assets (generated)
|
|
208
|
+
│ │ ├── index.js # Sync engine entrypoint
|
|
209
|
+
│ │ ├── cli/ # CLI command handlers
|
|
210
|
+
│ │ ├── core/ # Core sync logic
|
|
211
|
+
│ │ ├── agents/ # Agent definitions (copied at build)
|
|
212
|
+
│ │ │ ├── Agent.md.sample
|
|
213
|
+
│ │ │ └── *.md
|
|
214
|
+
│ │ └── skills/ # Skill definitions (copied at build)
|
|
215
|
+
│ │ ├── SKILL.md.sample
|
|
216
|
+
│ │ └── */ # Skill dirs with SKILL.md
|
|
156
217
|
│ ├── AGENTS.md # Instructions for AI models
|
|
157
|
-
│
|
|
158
|
-
│ ├── agents/ # Agent definitions
|
|
159
|
-
│ │ ├── Agent.md.sample
|
|
160
|
-
│ │ └── *.md
|
|
161
|
-
│ └── skills/ # Skill definitions
|
|
162
|
-
│ ├── SKILL.md.sample
|
|
163
|
-
│ └── */ # Skill dirs with SKILL.md
|
|
218
|
+
│ └── README.md # This file
|
|
164
219
|
├── .opencode/ # Generated (gitignored)
|
|
165
220
|
├── .claude/ # Generated (gitignored)
|
|
166
221
|
└── .agents/ # Generated (gitignored)
|
|
@@ -185,7 +240,7 @@ Invoke via your AI assistant (Claude/OpenCode) with the agentic-tools-creator ag
|
|
|
185
240
|
1. Copy the template:
|
|
186
241
|
|
|
187
242
|
```bash
|
|
188
|
-
cp node_modules/agentic-toolbox/agents/Agent.md.sample agents/MyAgent.md
|
|
243
|
+
cp node_modules/agentic-toolbox/dist/agents/Agent.md.sample agents/MyAgent.md
|
|
189
244
|
```
|
|
190
245
|
|
|
191
246
|
2. Edit the new file with your agent's configuration
|
|
@@ -193,7 +248,7 @@ Invoke via your AI assistant (Claude/OpenCode) with the agentic-tools-creator ag
|
|
|
193
248
|
3. Run sync:
|
|
194
249
|
|
|
195
250
|
```bash
|
|
196
|
-
|
|
251
|
+
agentic-toolbox # Option B: npx agentic-toolbox
|
|
197
252
|
```
|
|
198
253
|
|
|
199
254
|
### Agent Description Format
|
|
@@ -222,7 +277,7 @@ Same as agents — use the `agentic-tools-creator` agent with type="skill".
|
|
|
222
277
|
2. Copy the template:
|
|
223
278
|
|
|
224
279
|
```bash
|
|
225
|
-
cp node_modules/agentic-toolbox/skills/SKILL.md.sample skills/my-skill/SKILL.md
|
|
280
|
+
cp node_modules/agentic-toolbox/dist/skills/SKILL.md.sample skills/my-skill/SKILL.md
|
|
226
281
|
```
|
|
227
282
|
|
|
228
283
|
3. Edit the new file with your skill's configuration
|
|
@@ -230,7 +285,7 @@ Same as agents — use the `agentic-tools-creator` agent with type="skill".
|
|
|
230
285
|
4. Run sync:
|
|
231
286
|
|
|
232
287
|
```bash
|
|
233
|
-
|
|
288
|
+
agentic-toolbox # Option B: npx agentic-toolbox
|
|
234
289
|
```
|
|
235
290
|
|
|
236
291
|
### Skill File Structure
|
|
@@ -292,7 +347,7 @@ For detailed field documentation, see `agents/Agent.md.sample`.
|
|
|
292
347
|
|
|
293
348
|
The sync engine (`dist/index.js`, published as `agentic-toolbox` binary) reads your master agent/skill files (which contain a **superset** of all platform fields), then **transforms** them per target:
|
|
294
349
|
|
|
295
|
-
- **For OpenCode**: Strips Claude-only fields (`tools`, `permissionMode`, `maxTurns`, `skills`, `mcpServers`, `hooks`, `memory`, `background`, `effort`, `isolation`, `initialPrompt`)
|
|
350
|
+
- **For OpenCode**: Strips Claude-only fields (`tools`, `disallowedTools`, `permissionMode`, `maxTurns`, `skills`, `mcpServers`, `hooks`, `memory`, `background`, `effort`, `isolation`, `initialPrompt`)
|
|
296
351
|
- **For Claude**: Strips OpenCode-only fields (`permission`, `mode`, `temperature`, `steps`, `disable`, `prompt`, `hidden`, `top_p`, `reasoningEffort`, `textVerbosity`)
|
|
297
352
|
- **For Standard**: No transformation (keeps all fields)
|
|
298
353
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flags.d.ts","sourceRoot":"","sources":["../../../src/cli/args/flags.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,eAAO,MAAM,KAAK,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"flags.d.ts","sourceRoot":"","sources":["../../../src/cli/args/flags.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,eAAO,MAAM,KAAK,EAAE,cAAc,EAgDjC,CAAC"}
|
package/dist/cli/args/flags.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flags.js","sourceRoot":"","sources":["../../../src/cli/args/flags.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,KAAK,GAAqB;IACrC;QACE,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,0BAA0B;QACvC,IAAI,EAAE,QAAQ;KACf;IACD;QACE,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,qDAAqD;QAClE,IAAI,EAAE,SAAS;KAChB;IACD;QACE,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,uBAAuB;QACpC,IAAI,EAAE,SAAS;KAChB;IACD;QACE,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,mBAAmB;QAChC,IAAI,EAAE,SAAS;KAChB;IACD;QACE,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,cAAc;QAC3B,IAAI,EAAE,SAAS;KAChB;IACD;QACE,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,yCAAyC;QACtD,IAAI,EAAE,UAAU;KACjB;IACD;QACE,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,2BAA2B;QACxC,IAAI,EAAE,SAAS;KAChB;CACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"flags.js","sourceRoot":"","sources":["../../../src/cli/args/flags.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,KAAK,GAAqB;IACrC;QACE,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,0BAA0B;QACvC,IAAI,EAAE,QAAQ;KACf;IACD;QACE,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,qDAAqD;QAClE,IAAI,EAAE,SAAS;KAChB;IACD;QACE,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,uBAAuB;QACpC,IAAI,EAAE,SAAS;KAChB;IACD;QACE,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,mBAAmB;QAChC,IAAI,EAAE,SAAS;KAChB;IACD;QACE,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,cAAc;QAC3B,IAAI,EAAE,SAAS;KAChB;IACD;QACE,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,yCAAyC;QACtD,IAAI,EAAE,UAAU;KACjB;IACD;QACE,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,2BAA2B;QACxC,IAAI,EAAE,SAAS;KAChB;IACD;QACE,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,2CAA2C;QACxD,IAAI,EAAE,SAAS;KAChB;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../src/cli/args/parser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../src/cli/args/parser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AA+DjF,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAmCjD;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAE1E;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS,CAEtF"}
|
package/dist/cli/args/parser.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { flags } from './flags.js';
|
|
2
2
|
import { subcommands } from './subcommands.js';
|
|
3
3
|
import { getFlagStrategy } from './strategies.js';
|
|
4
|
+
import { CliError, CliErrorCode } from '../../utils/errors/classes.js';
|
|
5
|
+
import { MESSAGES } from '../../utils/errors/messages.js';
|
|
4
6
|
function kebabToCamel(str) {
|
|
5
7
|
return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
6
8
|
}
|
|
@@ -17,7 +19,7 @@ function parseFlags(argv, startIndex, allFlags) {
|
|
|
17
19
|
const flagName = arg.slice(2);
|
|
18
20
|
const flagDef = findFlagDef(allFlags, flagName);
|
|
19
21
|
if (!flagDef) {
|
|
20
|
-
throw new
|
|
22
|
+
throw new CliError({ code: CliErrorCode.CLI_INVALID_ARGS, message: MESSAGES.unknownFlag(`--${flagName}`) });
|
|
21
23
|
}
|
|
22
24
|
const targetName = flagDef.name === 'config' ? 'configPath' : flagDef.name;
|
|
23
25
|
const strategy = getFlagStrategy(flagDef.type);
|
|
@@ -30,7 +32,7 @@ function parseFlags(argv, startIndex, allFlags) {
|
|
|
30
32
|
const shortFlag = arg[1];
|
|
31
33
|
const flagDef = allFlags.find(f => f.alias === shortFlag);
|
|
32
34
|
if (!flagDef) {
|
|
33
|
-
throw new
|
|
35
|
+
throw new CliError({ code: CliErrorCode.CLI_INVALID_ARGS, message: MESSAGES.unknownFlag(`-${shortFlag}`) });
|
|
34
36
|
}
|
|
35
37
|
const targetName = flagDef.name === 'config' ? 'configPath' : flagDef.name;
|
|
36
38
|
const strategy = getFlagStrategy(flagDef.type);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../src/cli/args/parser.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../src/cli/args/parser.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,SAAS,YAAY,CAAC,GAAW;IAC/B,O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iBAAiB,EAAE,QAAQ,CAAC,CAAC;IAE1E,gBAAgB;IAChB,MAAM,UAAU,GAAY;QAC1B,GAAG,UAAU;QACb,GAAG,SAAS;QACZ,OAAO,EAAE,UAAU,CAAC,OAAO,IAAI,SAAS,CAAC,OAAO,IAAI,OAAO;KAC5D,CAAC;IAEF,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC;AAC9D,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,IAAY;IAClD,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strategies.d.ts","sourceRoot":"","sources":["../../../src/cli/args/strategies.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAmB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"strategies.d.ts","sourceRoot":"","sources":["../../../src/cli/args/strategies.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAmB,MAAM,kBAAkB,CAAC;AAIjF,eAAO,MAAM,eAAe,EAAE,YAY7B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,YAgB5B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,YAmBjC,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,YAAY,CAIxE,CAAC;AAEF,wBAAgB,eAAe,CAAC,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,YAAY,CAM1E"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { CliError, CliErrorCode } from '../../utils/errors/classes.js';
|
|
2
|
+
import { MESSAGES } from '../../utils/errors/messages.js';
|
|
1
3
|
export const booleanStrategy = {
|
|
2
4
|
parse(_flagDef, _rawFlag, _argv, currentIndex) {
|
|
3
5
|
return {
|
|
@@ -10,7 +12,7 @@ export const stringStrategy = {
|
|
|
10
12
|
parse(_flagDef, rawFlag, argv, currentIndex) {
|
|
11
13
|
const nextIndex = currentIndex + 1;
|
|
12
14
|
if (nextIndex >= argv.length) {
|
|
13
|
-
throw new
|
|
15
|
+
throw new CliError({ code: CliErrorCode.CLI_INVALID_ARGS, message: MESSAGES.flagRequiresValue(rawFlag) });
|
|
14
16
|
}
|
|
15
17
|
return {
|
|
16
18
|
value: argv[nextIndex],
|
|
@@ -22,7 +24,7 @@ export const stringArrayStrategy = {
|
|
|
22
24
|
parse(_flagDef, rawFlag, argv, currentIndex, currentValue) {
|
|
23
25
|
const nextIndex = currentIndex + 1;
|
|
24
26
|
if (nextIndex >= argv.length) {
|
|
25
|
-
throw new
|
|
27
|
+
throw new CliError({ code: CliErrorCode.CLI_INVALID_ARGS, message: MESSAGES.flagRequiresValue(rawFlag) });
|
|
26
28
|
}
|
|
27
29
|
const values = argv[nextIndex].split(',').map(v => v.trim());
|
|
28
30
|
const existing = Array.isArray(currentValue) ? currentValue : [];
|
|
@@ -40,7 +42,7 @@ export const FLAG_STRATEGIES = {
|
|
|
40
42
|
export function getFlagStrategy(type) {
|
|
41
43
|
const strategy = FLAG_STRATEGIES[type];
|
|
42
44
|
if (!strategy) {
|
|
43
|
-
throw new
|
|
45
|
+
throw new CliError({ code: CliErrorCode.CLI_INVALID_ARGS, message: MESSAGES.unsupportedFlagType(type) });
|
|
44
46
|
}
|
|
45
47
|
return strategy;
|
|
46
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strategies.js","sourceRoot":"","sources":["../../../src/cli/args/strategies.ts"],"names":[],"mappings":"
|
|
1
|
+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