@enactprotocol/cli 2.1.14 → 2.1.15
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/init/index.d.ts.map +1 -1
- package/dist/commands/init/index.js +6 -377
- package/dist/commands/init/index.js.map +1 -1
- package/dist/commands/init/templates/agent-agents.d.ts +5 -0
- package/dist/commands/init/templates/agent-agents.d.ts.map +1 -0
- package/dist/commands/init/templates/agent-agents.js +53 -0
- package/dist/commands/init/templates/agent-agents.js.map +1 -0
- package/dist/commands/init/templates/claude.d.ts +5 -0
- package/dist/commands/init/templates/claude.d.ts.map +1 -0
- package/dist/commands/init/templates/claude.js +71 -0
- package/dist/commands/init/templates/claude.js.map +1 -0
- package/dist/commands/init/templates/index.d.ts +8 -0
- package/dist/commands/init/templates/index.d.ts.map +1 -0
- package/dist/commands/init/templates/index.js +8 -0
- package/dist/commands/init/templates/index.js.map +1 -0
- package/dist/commands/init/templates/tool-agents.d.ts +5 -0
- package/dist/commands/init/templates/tool-agents.d.ts.map +1 -0
- package/dist/commands/init/templates/tool-agents.js +219 -0
- package/dist/commands/init/templates/tool-agents.js.map +1 -0
- package/dist/commands/init/templates/tool-skill.d.ts +5 -0
- package/dist/commands/init/templates/tool-skill.d.ts.map +1 -0
- package/dist/commands/init/templates/tool-skill.js +76 -0
- package/dist/commands/init/templates/tool-skill.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +5 -5
- package/src/commands/init/index.ts +11 -380
- package/src/commands/init/templates/{agent-agents.md → agent-agents.ts} +20 -15
- package/src/commands/init/templates/{claude.md → claude.ts} +24 -19
- package/src/commands/init/templates/index.ts +7 -0
- package/src/commands/init/templates/tool-agents.ts +218 -0
- package/src/commands/init/templates/tool-skill.ts +75 -0
- package/src/index.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/src/commands/init/templates/tool-agents.md +0 -56
- package/src/commands/init/templates/tool-enact.md +0 -44
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AGENTS.md template for tool development
|
|
3
|
+
*/
|
|
4
|
+
export const toolAgentsTemplate = `# Enact Tool Development Guide
|
|
5
|
+
|
|
6
|
+
Enact tools are containerized, cryptographically-signed executables. Each tool is defined by a \`SKILL.md\` file (YAML frontmatter + Markdown docs).
|
|
7
|
+
|
|
8
|
+
## Quick Reference
|
|
9
|
+
|
|
10
|
+
| Task | Command |
|
|
11
|
+
|------|---------|
|
|
12
|
+
| Run with JSON | \`enact run ./ --args '{"key": "value"}'\` |
|
|
13
|
+
| Run from file | \`enact run ./ --input-file inputs.json\` |
|
|
14
|
+
| Dry run | \`enact run ./ --args '{}' --dry-run\` |
|
|
15
|
+
| Sign & publish | \`enact sign ./ && enact publish ./\` |
|
|
16
|
+
|
|
17
|
+
## SKILL.md Structure
|
|
18
|
+
|
|
19
|
+
\`\`\`yaml
|
|
20
|
+
---
|
|
21
|
+
name: {{TOOL_NAME}}
|
|
22
|
+
description: What the tool does
|
|
23
|
+
version: 1.0.0
|
|
24
|
+
enact: "2.0.0"
|
|
25
|
+
|
|
26
|
+
from: python:3.12-slim # Docker image (pin versions, not :latest)
|
|
27
|
+
build: pip install requests # Build steps (cached by Dagger)
|
|
28
|
+
command: python /work/main.py \${input}
|
|
29
|
+
timeout: 30s
|
|
30
|
+
|
|
31
|
+
inputSchema:
|
|
32
|
+
type: object
|
|
33
|
+
properties:
|
|
34
|
+
input:
|
|
35
|
+
type: string
|
|
36
|
+
description: "Input to process"
|
|
37
|
+
required: [input]
|
|
38
|
+
|
|
39
|
+
outputSchema:
|
|
40
|
+
type: object
|
|
41
|
+
properties:
|
|
42
|
+
result:
|
|
43
|
+
type: string
|
|
44
|
+
|
|
45
|
+
env:
|
|
46
|
+
API_KEY:
|
|
47
|
+
description: "External API key"
|
|
48
|
+
secret: true # Set via: enact env set API_KEY --secret
|
|
49
|
+
---
|
|
50
|
+
# Tool Name
|
|
51
|
+
Documentation here.
|
|
52
|
+
\`\`\`
|
|
53
|
+
|
|
54
|
+
## Field Reference
|
|
55
|
+
|
|
56
|
+
| Field | Description |
|
|
57
|
+
|-------|-------------|
|
|
58
|
+
| \`name\` | Hierarchical ID: \`org/category/tool\` |
|
|
59
|
+
| \`description\` | What the tool does |
|
|
60
|
+
| \`version\` | Semver version |
|
|
61
|
+
| \`from\` | Docker image |
|
|
62
|
+
| \`build\` | Build commands (string or array, cached) |
|
|
63
|
+
| \`command\` | Shell command with \`\${param}\` substitution |
|
|
64
|
+
| \`timeout\` | Max execution time (e.g., "30s", "5m") |
|
|
65
|
+
| \`inputSchema\` | JSON Schema for inputs |
|
|
66
|
+
| \`outputSchema\` | JSON Schema for outputs |
|
|
67
|
+
| \`env\` | Environment variables and secrets |
|
|
68
|
+
|
|
69
|
+
## Parameter Substitution
|
|
70
|
+
|
|
71
|
+
Enact auto-quotes parameters. **Never manually quote:**
|
|
72
|
+
|
|
73
|
+
\`\`\`yaml
|
|
74
|
+
# WRONG - causes double-quoting
|
|
75
|
+
command: python /work/main.py "\${input}"
|
|
76
|
+
|
|
77
|
+
# RIGHT - Enact handles quoting
|
|
78
|
+
command: python /work/main.py \${input}
|
|
79
|
+
\`\`\`
|
|
80
|
+
|
|
81
|
+
**Optional params:** Missing optional params become empty strings. Always provide defaults:
|
|
82
|
+
\`\`\`yaml
|
|
83
|
+
inputSchema:
|
|
84
|
+
properties:
|
|
85
|
+
greeting:
|
|
86
|
+
type: string
|
|
87
|
+
default: "Hello" # Recommended for optional params
|
|
88
|
+
\`\`\`
|
|
89
|
+
|
|
90
|
+
Or handle empty in shell:
|
|
91
|
+
\`\`\`yaml
|
|
92
|
+
command: "echo \${greeting:-Hello} \${name}"
|
|
93
|
+
\`\`\`
|
|
94
|
+
|
|
95
|
+
Modifiers:
|
|
96
|
+
- \`\${param}\` — auto-quoted (handles spaces, JSON, special chars)
|
|
97
|
+
- \`\${param:raw}\` — raw, no quoting (use carefully)
|
|
98
|
+
|
|
99
|
+
## Output
|
|
100
|
+
|
|
101
|
+
Output valid JSON to stdout when \`outputSchema\` is defined:
|
|
102
|
+
|
|
103
|
+
\`\`\`python
|
|
104
|
+
import json, sys
|
|
105
|
+
|
|
106
|
+
try:
|
|
107
|
+
result = do_work()
|
|
108
|
+
print(json.dumps({"status": "success", "result": result}))
|
|
109
|
+
except Exception as e:
|
|
110
|
+
print(json.dumps({"status": "error", "message": str(e)}))
|
|
111
|
+
sys.exit(1) # non-zero = error
|
|
112
|
+
\`\`\`
|
|
113
|
+
|
|
114
|
+
## Build Steps by Language
|
|
115
|
+
|
|
116
|
+
**Python:**
|
|
117
|
+
\`\`\`yaml
|
|
118
|
+
from: python:3.12-slim
|
|
119
|
+
build: pip install requests pandas
|
|
120
|
+
\`\`\`
|
|
121
|
+
|
|
122
|
+
**Node.js:**
|
|
123
|
+
\`\`\`yaml
|
|
124
|
+
from: node:20-alpine
|
|
125
|
+
build:
|
|
126
|
+
- npm install
|
|
127
|
+
- npm run build
|
|
128
|
+
\`\`\`
|
|
129
|
+
|
|
130
|
+
**Rust:**
|
|
131
|
+
\`\`\`yaml
|
|
132
|
+
from: rust:1.83-slim
|
|
133
|
+
build: rustc /work/main.rs -o /work/tool
|
|
134
|
+
command: /work/tool \${input}
|
|
135
|
+
\`\`\`
|
|
136
|
+
|
|
137
|
+
**Go:**
|
|
138
|
+
\`\`\`yaml
|
|
139
|
+
from: golang:1.22-alpine
|
|
140
|
+
build: cd /work && go build -o tool main.go
|
|
141
|
+
command: /work/tool \${input}
|
|
142
|
+
\`\`\`
|
|
143
|
+
|
|
144
|
+
**System packages:**
|
|
145
|
+
\`\`\`yaml
|
|
146
|
+
build: apt-get update && apt-get install -y libfoo-dev
|
|
147
|
+
\`\`\`
|
|
148
|
+
|
|
149
|
+
Build steps are cached — first run slow, subsequent runs instant.
|
|
150
|
+
|
|
151
|
+
## File Access
|
|
152
|
+
|
|
153
|
+
Tools run in a container with \`/work\` as the working directory. All source files are copied there.
|
|
154
|
+
|
|
155
|
+
## Secrets
|
|
156
|
+
|
|
157
|
+
Declare in \`SKILL.md\`:
|
|
158
|
+
\`\`\`yaml
|
|
159
|
+
env:
|
|
160
|
+
API_KEY:
|
|
161
|
+
description: "API key for service"
|
|
162
|
+
secret: true
|
|
163
|
+
\`\`\`
|
|
164
|
+
|
|
165
|
+
Set before running:
|
|
166
|
+
\`\`\`bash
|
|
167
|
+
enact env set API_KEY --secret --namespace {{TOOL_NAME}}
|
|
168
|
+
\`\`\`
|
|
169
|
+
|
|
170
|
+
Access in code:
|
|
171
|
+
\`\`\`python
|
|
172
|
+
import os
|
|
173
|
+
api_key = os.environ.get('API_KEY')
|
|
174
|
+
\`\`\`
|
|
175
|
+
|
|
176
|
+
## LLM Instruction Tools
|
|
177
|
+
|
|
178
|
+
Tools without a \`command\` field are interpreted by LLMs:
|
|
179
|
+
|
|
180
|
+
\`\`\`yaml
|
|
181
|
+
---
|
|
182
|
+
name: myorg/ai/reviewer
|
|
183
|
+
description: AI-powered code review
|
|
184
|
+
inputSchema:
|
|
185
|
+
type: object
|
|
186
|
+
properties:
|
|
187
|
+
code: { type: string }
|
|
188
|
+
required: [code]
|
|
189
|
+
outputSchema:
|
|
190
|
+
type: object
|
|
191
|
+
properties:
|
|
192
|
+
issues: { type: array }
|
|
193
|
+
score: { type: number }
|
|
194
|
+
---
|
|
195
|
+
# Code Reviewer
|
|
196
|
+
|
|
197
|
+
You are a senior engineer. Review the code for bugs, style, and security.
|
|
198
|
+
Return JSON: {"issues": [...], "score": 75}
|
|
199
|
+
\`\`\`
|
|
200
|
+
|
|
201
|
+
## Publishing Checklist
|
|
202
|
+
|
|
203
|
+
- [ ] \`name\` follows \`namespace/category/tool\` pattern
|
|
204
|
+
- [ ] \`version\` set (semver)
|
|
205
|
+
- [ ] \`description\` is clear and searchable
|
|
206
|
+
- [ ] \`inputSchema\` / \`outputSchema\` defined
|
|
207
|
+
- [ ] \`from\` uses pinned image version
|
|
208
|
+
- [ ] \`timeout\` set appropriately
|
|
209
|
+
- [ ] Tool tested locally with \`enact run ./\`
|
|
210
|
+
|
|
211
|
+
## Troubleshooting
|
|
212
|
+
|
|
213
|
+
\`\`\`bash
|
|
214
|
+
enact run ./ --args '{"x": "y"}' --verbose # Verbose output
|
|
215
|
+
enact run ./ --args '{}' --dry-run # Preview command
|
|
216
|
+
enact list # List installed tools
|
|
217
|
+
\`\`\`
|
|
218
|
+
`;
|
|
219
|
+
//# sourceMappingURL=tool-agents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-agents.js","sourceRoot":"","sources":["../../../../src/commands/init/templates/tool-agents.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsNjC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SKILL.md template for new tool creation
|
|
3
|
+
*/
|
|
4
|
+
export declare const toolSkillTemplate = "---\nname: {{TOOL_NAME}}\ndescription: A simple tool that echoes a greeting\nversion: 0.1.0\nenact: \"2.0\"\n\nfrom: python:3.12-slim\n\n# Install dependencies (cached by Dagger)\nbuild: |\n pip install requests\n\n# Environment variables (optional)\n# env:\n# API_KEY:\n# secret: true\n# description: \"Your API key\"\n\ninputSchema:\n type: object\n properties:\n name:\n type: string\n description: Name to greet\n default: World\n required: []\n\ncommand: |\n echo \"Hello, ${name}!\"\n---\n\n# {{TOOL_NAME}}\n\nA simple greeting tool created with `enact init`.\n\n## Usage\n\n```bash\nenact run ./ --args '{\"name\": \"Alice\"}'\n```\n\n## Customization\n\nEdit this file to create your own tool:\n\n1. Update the `name` and `description` in the frontmatter\n2. Change the `from` image to match your runtime (python, node, rust, etc.)\n3. Add dependencies in the `build` section (pip install, npm install, etc.)\n4. Uncomment and configure `env` for secrets/API keys\n5. Modify the `inputSchema` to define your tool's inputs\n6. Change the `command` to run your script or shell commands\n7. Update this documentation section\n\n## Environment Variables\n\nTo use secrets, uncomment the `env` section above, then set the value:\n\n```bash\nenact env set API_KEY --secret --namespace {{TOOL_NAME}}\n```\n\nAccess in your code:\n```python\nimport os\napi_key = os.environ.get('API_KEY')\n```\n\n## Learn More\n\n- [Enact Documentation](https://enact.dev/docs)\n- [Tool Manifest Reference](https://enact.dev/docs/manifest)\n";
|
|
5
|
+
//# sourceMappingURL=tool-skill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-skill.d.ts","sourceRoot":"","sources":["../../../../src/commands/init/templates/tool-skill.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,iBAAiB,2hDAuE7B,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SKILL.md template for new tool creation
|
|
3
|
+
*/
|
|
4
|
+
export const toolSkillTemplate = `---
|
|
5
|
+
name: {{TOOL_NAME}}
|
|
6
|
+
description: A simple tool that echoes a greeting
|
|
7
|
+
version: 0.1.0
|
|
8
|
+
enact: "2.0"
|
|
9
|
+
|
|
10
|
+
from: python:3.12-slim
|
|
11
|
+
|
|
12
|
+
# Install dependencies (cached by Dagger)
|
|
13
|
+
build: |
|
|
14
|
+
pip install requests
|
|
15
|
+
|
|
16
|
+
# Environment variables (optional)
|
|
17
|
+
# env:
|
|
18
|
+
# API_KEY:
|
|
19
|
+
# secret: true
|
|
20
|
+
# description: "Your API key"
|
|
21
|
+
|
|
22
|
+
inputSchema:
|
|
23
|
+
type: object
|
|
24
|
+
properties:
|
|
25
|
+
name:
|
|
26
|
+
type: string
|
|
27
|
+
description: Name to greet
|
|
28
|
+
default: World
|
|
29
|
+
required: []
|
|
30
|
+
|
|
31
|
+
command: |
|
|
32
|
+
echo "Hello, \${name}!"
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
# {{TOOL_NAME}}
|
|
36
|
+
|
|
37
|
+
A simple greeting tool created with \`enact init\`.
|
|
38
|
+
|
|
39
|
+
## Usage
|
|
40
|
+
|
|
41
|
+
\`\`\`bash
|
|
42
|
+
enact run ./ --args '{"name": "Alice"}'
|
|
43
|
+
\`\`\`
|
|
44
|
+
|
|
45
|
+
## Customization
|
|
46
|
+
|
|
47
|
+
Edit this file to create your own tool:
|
|
48
|
+
|
|
49
|
+
1. Update the \`name\` and \`description\` in the frontmatter
|
|
50
|
+
2. Change the \`from\` image to match your runtime (python, node, rust, etc.)
|
|
51
|
+
3. Add dependencies in the \`build\` section (pip install, npm install, etc.)
|
|
52
|
+
4. Uncomment and configure \`env\` for secrets/API keys
|
|
53
|
+
5. Modify the \`inputSchema\` to define your tool's inputs
|
|
54
|
+
6. Change the \`command\` to run your script or shell commands
|
|
55
|
+
7. Update this documentation section
|
|
56
|
+
|
|
57
|
+
## Environment Variables
|
|
58
|
+
|
|
59
|
+
To use secrets, uncomment the \`env\` section above, then set the value:
|
|
60
|
+
|
|
61
|
+
\`\`\`bash
|
|
62
|
+
enact env set API_KEY --secret --namespace {{TOOL_NAME}}
|
|
63
|
+
\`\`\`
|
|
64
|
+
|
|
65
|
+
Access in your code:
|
|
66
|
+
\`\`\`python
|
|
67
|
+
import os
|
|
68
|
+
api_key = os.environ.get('API_KEY')
|
|
69
|
+
\`\`\`
|
|
70
|
+
|
|
71
|
+
## Learn More
|
|
72
|
+
|
|
73
|
+
- [Enact Documentation](https://enact.dev/docs)
|
|
74
|
+
- [Tool Manifest Reference](https://enact.dev/docs/manifest)
|
|
75
|
+
`;
|
|
76
|
+
//# sourceMappingURL=tool-skill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-skill.js","sourceRoot":"","sources":["../../../../src/commands/init/templates/tool-skill.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuEhC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
* Command-line interface for Enact.
|
|
6
6
|
* User-facing commands for tool execution, discovery, and management.
|
|
7
7
|
*/
|
|
8
|
-
export declare const version = "2.1.
|
|
8
|
+
export declare const version = "2.1.15";
|
|
9
9
|
export type { GlobalOptions, CommandContext } from "./types";
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { ensureGlobalSetup } from "@enactprotocol/shared";
|
|
|
9
9
|
import { Command } from "commander";
|
|
10
10
|
import { configureAuthCommand, configureCacheCommand, configureConfigCommand, configureEnvCommand, configureExecCommand, configureInfoCommand, configureInitCommand, configureInspectCommand, configureInstallCommand, configureLearnCommand, configureListCommand, configurePublishCommand, configureReportCommand, configureRunCommand, configureSearchCommand, configureSetupCommand, configureSignCommand, configureTrustCommand, configureUnyankCommand, configureVisibilityCommand, configureYankCommand, } from "./commands";
|
|
11
11
|
import { error, formatError } from "./utils";
|
|
12
|
-
export const version = "2.1.
|
|
12
|
+
export const version = "2.1.15";
|
|
13
13
|
// Main CLI entry point
|
|
14
14
|
async function main() {
|
|
15
15
|
// Ensure global setup is complete on first run
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enactprotocol/cli",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.15",
|
|
4
4
|
"description": "Command-line interface for Enact - the npm for AI tools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@clack/prompts": "^0.11.0",
|
|
37
|
-
"@enactprotocol/api": "2.1.
|
|
38
|
-
"@enactprotocol/execution": "2.1.
|
|
39
|
-
"@enactprotocol/secrets": "2.1.
|
|
40
|
-
"@enactprotocol/shared": "2.1.
|
|
37
|
+
"@enactprotocol/api": "2.1.15",
|
|
38
|
+
"@enactprotocol/execution": "2.1.15",
|
|
39
|
+
"@enactprotocol/secrets": "2.1.15",
|
|
40
|
+
"@enactprotocol/shared": "2.1.15",
|
|
41
41
|
"commander": "^12.1.0",
|
|
42
42
|
"picocolors": "^1.1.1"
|
|
43
43
|
},
|