@enactprotocol/cli 2.1.24 → 2.1.29
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/dist/commands/index.d.ts +2 -0
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +4 -0
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/init/templates/claude.d.ts +1 -1
- package/dist/commands/init/templates/claude.d.ts.map +1 -1
- package/dist/commands/init/templates/claude.js +268 -28
- package/dist/commands/init/templates/claude.js.map +1 -1
- package/dist/commands/init/templates/tool-agents.d.ts +1 -1
- package/dist/commands/init/templates/tool-agents.d.ts.map +1 -1
- package/dist/commands/init/templates/tool-agents.js +90 -15
- package/dist/commands/init/templates/tool-agents.js.map +1 -1
- package/dist/commands/install/index.d.ts.map +1 -1
- package/dist/commands/install/index.js +9 -1
- package/dist/commands/install/index.js.map +1 -1
- package/dist/commands/learn/index.d.ts.map +1 -1
- package/dist/commands/learn/index.js +4 -11
- package/dist/commands/learn/index.js.map +1 -1
- package/dist/commands/mcp/index.d.ts.map +1 -1
- package/dist/commands/mcp/index.js +204 -53
- package/dist/commands/mcp/index.js.map +1 -1
- package/dist/commands/run/index.d.ts.map +1 -1
- package/dist/commands/run/index.js +380 -39
- package/dist/commands/run/index.js.map +1 -1
- package/dist/commands/validate/index.d.ts +11 -0
- package/dist/commands/validate/index.d.ts.map +1 -0
- package/dist/commands/validate/index.js +299 -0
- package/dist/commands/validate/index.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/errors.d.ts +8 -1
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/errors.js +13 -2
- package/dist/utils/errors.js.map +1 -1
- package/package.json +5 -5
- package/src/commands/index.ts +5 -0
- package/src/commands/init/templates/claude.ts +268 -28
- package/src/commands/init/templates/tool-agents.ts +90 -15
- package/src/commands/install/index.ts +11 -0
- package/src/commands/learn/index.ts +6 -11
- package/src/commands/mcp/index.ts +768 -0
- package/src/commands/run/README.md +68 -1
- package/src/commands/run/index.ts +475 -35
- package/src/commands/validate/index.ts +344 -0
- package/src/index.ts +8 -1
- package/src/types.ts +2 -0
- package/src/utils/errors.ts +26 -6
- package/tests/commands/init.test.ts +2 -2
- package/tests/commands/run.test.ts +260 -0
- package/tests/commands/validate.test.ts +81 -0
- package/tests/utils/errors.test.ts +36 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -28,11 +28,14 @@ The `run` command executes a tool using the command defined in its manifest (`en
|
|
|
28
28
|
| Option | Description |
|
|
29
29
|
|--------|-------------|
|
|
30
30
|
| `-a, --args <json>` | Input arguments as a JSON object |
|
|
31
|
-
| `-i, --input <
|
|
31
|
+
| `-i, --input <value>` | Input: `key=value` for params, `./path` for files/directories, `name=./path` for named inputs |
|
|
32
|
+
| `-o, --output <path>` | Export `/output` directory to this path after execution |
|
|
33
|
+
| `--apply` | Apply output back to input directory atomically (for in-place transformations) |
|
|
32
34
|
| `-t, --timeout <duration>` | Execution timeout (e.g., `30s`, `5m`, `1h`) |
|
|
33
35
|
| `--no-cache` | Disable container caching |
|
|
34
36
|
| `--local` | Only resolve from local sources |
|
|
35
37
|
| `--dry-run` | Show what would be executed without running |
|
|
38
|
+
| `--debug` | Show detailed parameter and environment resolution |
|
|
36
39
|
| `-v, --verbose` | Show detailed output including stderr and timing |
|
|
37
40
|
| `--json` | Output result as JSON |
|
|
38
41
|
|
|
@@ -65,6 +68,9 @@ enact run alice/utils/greeter --args '{"name":"World"}' --json
|
|
|
65
68
|
|
|
66
69
|
# Verbose mode for debugging
|
|
67
70
|
enact run alice/utils/greeter --args '{"name":"World"}' --verbose
|
|
71
|
+
|
|
72
|
+
# Debug parameter resolution
|
|
73
|
+
enact run alice/utils/greeter --args '{"name":"World"}' --debug
|
|
68
74
|
```
|
|
69
75
|
|
|
70
76
|
### Multiple inputs
|
|
@@ -77,6 +83,54 @@ enact run my-tool --args '{"config":{"debug":true}}' --input file=input.txt
|
|
|
77
83
|
enact run my-tool --input name=test --input count=5 --input enabled=true
|
|
78
84
|
```
|
|
79
85
|
|
|
86
|
+
### Input Files and Directories
|
|
87
|
+
|
|
88
|
+
Mount files or directories into the container for file-based tools:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# Single file input (mounted to /input/<filename>)
|
|
92
|
+
enact run my-tool --input ./document.pdf
|
|
93
|
+
|
|
94
|
+
# Single directory input (mounted to /input)
|
|
95
|
+
enact run my-tool --input ./data
|
|
96
|
+
|
|
97
|
+
# Named inputs (mounted to /inputs/<name>)
|
|
98
|
+
enact run my-tool --input left=./old --input right=./new
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Output Export
|
|
102
|
+
|
|
103
|
+
Export the container's `/output` directory to the host:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# Export output to a local directory
|
|
107
|
+
enact run my-tool --input ./src --output ./dist
|
|
108
|
+
|
|
109
|
+
# The tool writes to /output inside the container
|
|
110
|
+
# After execution, /output is copied to ./dist
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### In-Place Transformations with --apply
|
|
114
|
+
|
|
115
|
+
For tools that transform data in-place (formatters, linters with --fix, etc.):
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
# Apply changes atomically back to the input directory
|
|
119
|
+
enact run formatter --input ./src --output ./src --apply
|
|
120
|
+
|
|
121
|
+
# What happens:
|
|
122
|
+
# 1. ./src is mounted read-only to /input
|
|
123
|
+
# 2. Tool processes files and writes to /output
|
|
124
|
+
# 3. On success, ./src is atomically replaced with /output contents
|
|
125
|
+
# 4. On failure, ./src remains unchanged
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
**Notes:**
|
|
129
|
+
- `--apply` requires exactly one unnamed directory input
|
|
130
|
+
- `--apply` requires `--output` to be specified
|
|
131
|
+
- Changes are atomic: either all succeed or original is preserved
|
|
132
|
+
- Tool source files are mounted to `/workspace` by default
|
|
133
|
+
|
|
80
134
|
## Input Resolution
|
|
81
135
|
|
|
82
136
|
Inputs are resolved in the following priority order:
|
|
@@ -108,6 +162,19 @@ When using `--dry-run`, the command shows:
|
|
|
108
162
|
- Environment variables (secrets masked as `***`)
|
|
109
163
|
- The interpolated command
|
|
110
164
|
|
|
165
|
+
## Debug Output
|
|
166
|
+
|
|
167
|
+
When using `--debug`, the command shows detailed parameter resolution:
|
|
168
|
+
|
|
169
|
+
- Schema properties with types and required/optional status
|
|
170
|
+
- Raw inputs (exactly what was provided)
|
|
171
|
+
- Inputs after defaults were applied
|
|
172
|
+
- Final inputs after validation and type coercion
|
|
173
|
+
- Environment variables (sensitive values masked)
|
|
174
|
+
- The final interpolated command
|
|
175
|
+
|
|
176
|
+
This is useful for troubleshooting parameter issues and understanding how optional parameters are handled.
|
|
177
|
+
|
|
111
178
|
## Exit Codes
|
|
112
179
|
|
|
113
180
|
| Code | Description |
|