@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.
Files changed (57) hide show
  1. package/dist/commands/index.d.ts +2 -0
  2. package/dist/commands/index.d.ts.map +1 -1
  3. package/dist/commands/index.js +4 -0
  4. package/dist/commands/index.js.map +1 -1
  5. package/dist/commands/init/templates/claude.d.ts +1 -1
  6. package/dist/commands/init/templates/claude.d.ts.map +1 -1
  7. package/dist/commands/init/templates/claude.js +268 -28
  8. package/dist/commands/init/templates/claude.js.map +1 -1
  9. package/dist/commands/init/templates/tool-agents.d.ts +1 -1
  10. package/dist/commands/init/templates/tool-agents.d.ts.map +1 -1
  11. package/dist/commands/init/templates/tool-agents.js +90 -15
  12. package/dist/commands/init/templates/tool-agents.js.map +1 -1
  13. package/dist/commands/install/index.d.ts.map +1 -1
  14. package/dist/commands/install/index.js +9 -1
  15. package/dist/commands/install/index.js.map +1 -1
  16. package/dist/commands/learn/index.d.ts.map +1 -1
  17. package/dist/commands/learn/index.js +4 -11
  18. package/dist/commands/learn/index.js.map +1 -1
  19. package/dist/commands/mcp/index.d.ts.map +1 -1
  20. package/dist/commands/mcp/index.js +204 -53
  21. package/dist/commands/mcp/index.js.map +1 -1
  22. package/dist/commands/run/index.d.ts.map +1 -1
  23. package/dist/commands/run/index.js +380 -39
  24. package/dist/commands/run/index.js.map +1 -1
  25. package/dist/commands/validate/index.d.ts +11 -0
  26. package/dist/commands/validate/index.d.ts.map +1 -0
  27. package/dist/commands/validate/index.js +299 -0
  28. package/dist/commands/validate/index.js.map +1 -0
  29. package/dist/index.d.ts +1 -1
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +6 -2
  32. package/dist/index.js.map +1 -1
  33. package/dist/types.d.ts +2 -0
  34. package/dist/types.d.ts.map +1 -1
  35. package/dist/types.js.map +1 -1
  36. package/dist/utils/errors.d.ts +8 -1
  37. package/dist/utils/errors.d.ts.map +1 -1
  38. package/dist/utils/errors.js +13 -2
  39. package/dist/utils/errors.js.map +1 -1
  40. package/package.json +5 -5
  41. package/src/commands/index.ts +5 -0
  42. package/src/commands/init/templates/claude.ts +268 -28
  43. package/src/commands/init/templates/tool-agents.ts +90 -15
  44. package/src/commands/install/index.ts +11 -0
  45. package/src/commands/learn/index.ts +6 -11
  46. package/src/commands/mcp/index.ts +768 -0
  47. package/src/commands/run/README.md +68 -1
  48. package/src/commands/run/index.ts +475 -35
  49. package/src/commands/validate/index.ts +344 -0
  50. package/src/index.ts +8 -1
  51. package/src/types.ts +2 -0
  52. package/src/utils/errors.ts +26 -6
  53. package/tests/commands/init.test.ts +2 -2
  54. package/tests/commands/run.test.ts +260 -0
  55. package/tests/commands/validate.test.ts +81 -0
  56. package/tests/utils/errors.test.ts +36 -0
  57. 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 <key=value>` | Input arguments as key=value pairs (can be repeated) |
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 |