@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/init/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/init/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA2QzC;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAyB3D"}
|
|
@@ -7,6 +7,7 @@ import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
|
7
7
|
import { join } from "node:path";
|
|
8
8
|
import { getSecret } from "@enactprotocol/secrets";
|
|
9
9
|
import { error, formatError, info, success, warning } from "../../utils";
|
|
10
|
+
import { agentAgentsTemplate, claudeTemplate, toolAgentsTemplate, toolSkillTemplate, } from "./templates";
|
|
10
11
|
/** Namespace for stored auth tokens */
|
|
11
12
|
const AUTH_NAMESPACE = "enact:auth";
|
|
12
13
|
const ACCESS_TOKEN_KEY = "access_token";
|
|
@@ -16,385 +17,13 @@ const SUPABASE_URL = process.env.SUPABASE_URL || "https://siikwkfgsmouioodghho.s
|
|
|
16
17
|
const SUPABASE_ANON_KEY = process.env.SUPABASE_ANON_KEY ??
|
|
17
18
|
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InNpaWt3a2Znc21vdWlvb2RnaGhvIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjQ2MTkzMzksImV4cCI6MjA4MDE5NTMzOX0.kxnx6-IPFhmGx6rzNx36vbyhFMFZKP_jFqaDbKnJ_E0";
|
|
18
19
|
/**
|
|
19
|
-
*
|
|
20
|
+
* Template mapping for loadTemplate function
|
|
20
21
|
*/
|
|
21
22
|
const TEMPLATES = {
|
|
22
|
-
"tool-skill.md":
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
enact: "2.0"
|
|
27
|
-
|
|
28
|
-
from: alpine:latest
|
|
29
|
-
|
|
30
|
-
inputSchema:
|
|
31
|
-
type: object
|
|
32
|
-
properties:
|
|
33
|
-
name:
|
|
34
|
-
type: string
|
|
35
|
-
description: Name to greet
|
|
36
|
-
default: World
|
|
37
|
-
required: []
|
|
38
|
-
|
|
39
|
-
command: |
|
|
40
|
-
echo "Hello, \${name}!"
|
|
41
|
-
---
|
|
42
|
-
|
|
43
|
-
# {{TOOL_NAME}}
|
|
44
|
-
|
|
45
|
-
A simple greeting tool created with \`enact init\`.
|
|
46
|
-
|
|
47
|
-
## Usage
|
|
48
|
-
|
|
49
|
-
\`\`\`bash
|
|
50
|
-
enact run ./ --args '{"name": "Alice"}'
|
|
51
|
-
\`\`\`
|
|
52
|
-
|
|
53
|
-
## Customization
|
|
54
|
-
|
|
55
|
-
Edit this file to create your own tool:
|
|
56
|
-
|
|
57
|
-
1. Update the \`name\` and \`description\` in the frontmatter
|
|
58
|
-
2. Modify the \`inputSchema\` to define your tool's inputs
|
|
59
|
-
3. Change the \`command\` to run your desired shell commands
|
|
60
|
-
4. Update this documentation section
|
|
61
|
-
|
|
62
|
-
## Learn More
|
|
63
|
-
|
|
64
|
-
- [Enact Documentation](https://enact.dev/docs)
|
|
65
|
-
- [Tool Manifest Reference](https://enact.dev/docs/manifest)
|
|
66
|
-
`,
|
|
67
|
-
"tool-agents.md": `# Enact Tool Development Guide
|
|
68
|
-
|
|
69
|
-
Enact tools are containerized, cryptographically-signed executables. Each tool is defined by a \`SKILL.md\` file (YAML frontmatter + Markdown docs).
|
|
70
|
-
|
|
71
|
-
## Quick Reference
|
|
72
|
-
|
|
73
|
-
| Task | Command |
|
|
74
|
-
|------|---------|
|
|
75
|
-
| Run with JSON | \`enact run ./ --args '{"key": "value"}'\` |
|
|
76
|
-
| Run from file | \`enact run ./ --input-file inputs.json\` |
|
|
77
|
-
| Dry run | \`enact run ./ --args '{}' --dry-run\` |
|
|
78
|
-
| Sign & publish | \`enact sign ./ && enact publish ./\` |
|
|
79
|
-
|
|
80
|
-
## SKILL.md Structure
|
|
81
|
-
|
|
82
|
-
\`\`\`yaml
|
|
83
|
-
---
|
|
84
|
-
name: {{TOOL_NAME}}
|
|
85
|
-
description: What the tool does
|
|
86
|
-
version: 1.0.0
|
|
87
|
-
enact: "2.0.0"
|
|
88
|
-
|
|
89
|
-
from: python:3.12-slim # Docker image (pin versions, not :latest)
|
|
90
|
-
build: pip install requests # Build steps (cached by Dagger)
|
|
91
|
-
command: python /work/main.py \${input}
|
|
92
|
-
timeout: 30s
|
|
93
|
-
|
|
94
|
-
inputSchema:
|
|
95
|
-
type: object
|
|
96
|
-
properties:
|
|
97
|
-
input:
|
|
98
|
-
type: string
|
|
99
|
-
description: "Input to process"
|
|
100
|
-
required: [input]
|
|
101
|
-
|
|
102
|
-
outputSchema:
|
|
103
|
-
type: object
|
|
104
|
-
properties:
|
|
105
|
-
result:
|
|
106
|
-
type: string
|
|
107
|
-
|
|
108
|
-
env:
|
|
109
|
-
API_KEY:
|
|
110
|
-
description: "External API key"
|
|
111
|
-
secret: true # Set via: enact env set API_KEY --secret
|
|
112
|
-
---
|
|
113
|
-
# Tool Name
|
|
114
|
-
Documentation here.
|
|
115
|
-
\`\`\`
|
|
116
|
-
|
|
117
|
-
## Field Reference
|
|
118
|
-
|
|
119
|
-
| Field | Description |
|
|
120
|
-
|-------|-------------|
|
|
121
|
-
| \`name\` | Hierarchical ID: \`org/category/tool\` |
|
|
122
|
-
| \`description\` | What the tool does |
|
|
123
|
-
| \`version\` | Semver version |
|
|
124
|
-
| \`from\` | Docker image |
|
|
125
|
-
| \`build\` | Build commands (string or array, cached) |
|
|
126
|
-
| \`command\` | Shell command with \`\${param}\` substitution |
|
|
127
|
-
| \`timeout\` | Max execution time (e.g., "30s", "5m") |
|
|
128
|
-
| \`inputSchema\` | JSON Schema for inputs |
|
|
129
|
-
| \`outputSchema\` | JSON Schema for outputs |
|
|
130
|
-
| \`env\` | Environment variables and secrets |
|
|
131
|
-
|
|
132
|
-
## Parameter Substitution
|
|
133
|
-
|
|
134
|
-
Enact auto-quotes parameters. **Never manually quote:**
|
|
135
|
-
|
|
136
|
-
\`\`\`yaml
|
|
137
|
-
# WRONG - causes double-quoting
|
|
138
|
-
command: python /work/main.py "\${input}"
|
|
139
|
-
|
|
140
|
-
# RIGHT - Enact handles quoting
|
|
141
|
-
command: python /work/main.py \${input}
|
|
142
|
-
\`\`\`
|
|
143
|
-
|
|
144
|
-
**Optional params:** Missing optional params become empty strings. Always provide defaults:
|
|
145
|
-
\`\`\`yaml
|
|
146
|
-
inputSchema:
|
|
147
|
-
properties:
|
|
148
|
-
greeting:
|
|
149
|
-
type: string
|
|
150
|
-
default: "Hello" # Recommended for optional params
|
|
151
|
-
\`\`\`
|
|
152
|
-
|
|
153
|
-
Or handle empty in shell:
|
|
154
|
-
\`\`\`yaml
|
|
155
|
-
command: "echo \${greeting:-Hello} \${name}"
|
|
156
|
-
\`\`\`
|
|
157
|
-
|
|
158
|
-
Modifiers:
|
|
159
|
-
- \`\${param}\` — auto-quoted (handles spaces, JSON, special chars)
|
|
160
|
-
- \`\${param:raw}\` — raw, no quoting (use carefully)
|
|
161
|
-
|
|
162
|
-
## Output
|
|
163
|
-
|
|
164
|
-
Output valid JSON to stdout when \`outputSchema\` is defined:
|
|
165
|
-
|
|
166
|
-
\`\`\`python
|
|
167
|
-
import json, sys
|
|
168
|
-
|
|
169
|
-
try:
|
|
170
|
-
result = do_work()
|
|
171
|
-
print(json.dumps({"status": "success", "result": result}))
|
|
172
|
-
except Exception as e:
|
|
173
|
-
print(json.dumps({"status": "error", "message": str(e)}))
|
|
174
|
-
sys.exit(1) # non-zero = error
|
|
175
|
-
\`\`\`
|
|
176
|
-
|
|
177
|
-
## Build Steps by Language
|
|
178
|
-
|
|
179
|
-
**Python:**
|
|
180
|
-
\`\`\`yaml
|
|
181
|
-
from: python:3.12-slim
|
|
182
|
-
build: pip install requests pandas
|
|
183
|
-
\`\`\`
|
|
184
|
-
|
|
185
|
-
**Node.js:**
|
|
186
|
-
\`\`\`yaml
|
|
187
|
-
from: node:20-alpine
|
|
188
|
-
build:
|
|
189
|
-
- npm install
|
|
190
|
-
- npm run build
|
|
191
|
-
\`\`\`
|
|
192
|
-
|
|
193
|
-
**Rust:**
|
|
194
|
-
\`\`\`yaml
|
|
195
|
-
from: rust:1.83-slim
|
|
196
|
-
build: rustc /work/main.rs -o /work/tool
|
|
197
|
-
command: /work/tool \${input}
|
|
198
|
-
\`\`\`
|
|
199
|
-
|
|
200
|
-
**Go:**
|
|
201
|
-
\`\`\`yaml
|
|
202
|
-
from: golang:1.22-alpine
|
|
203
|
-
build: cd /work && go build -o tool main.go
|
|
204
|
-
command: /work/tool \${input}
|
|
205
|
-
\`\`\`
|
|
206
|
-
|
|
207
|
-
**System packages:**
|
|
208
|
-
\`\`\`yaml
|
|
209
|
-
build: apt-get update && apt-get install -y libfoo-dev
|
|
210
|
-
\`\`\`
|
|
211
|
-
|
|
212
|
-
Build steps are cached — first run slow, subsequent runs instant.
|
|
213
|
-
|
|
214
|
-
## File Access
|
|
215
|
-
|
|
216
|
-
Tools run in a container with \`/work\` as the working directory. All source files are copied there.
|
|
217
|
-
|
|
218
|
-
## Secrets
|
|
219
|
-
|
|
220
|
-
Declare in \`SKILL.md\`:
|
|
221
|
-
\`\`\`yaml
|
|
222
|
-
env:
|
|
223
|
-
API_KEY:
|
|
224
|
-
description: "API key for service"
|
|
225
|
-
secret: true
|
|
226
|
-
\`\`\`
|
|
227
|
-
|
|
228
|
-
Set before running:
|
|
229
|
-
\`\`\`bash
|
|
230
|
-
enact env set API_KEY --secret --namespace {{TOOL_NAME}}
|
|
231
|
-
\`\`\`
|
|
232
|
-
|
|
233
|
-
Access in code:
|
|
234
|
-
\`\`\`python
|
|
235
|
-
import os
|
|
236
|
-
api_key = os.environ.get('API_KEY')
|
|
237
|
-
\`\`\`
|
|
238
|
-
|
|
239
|
-
## LLM Instruction Tools
|
|
240
|
-
|
|
241
|
-
Tools without a \`command\` field are interpreted by LLMs:
|
|
242
|
-
|
|
243
|
-
\`\`\`yaml
|
|
244
|
-
---
|
|
245
|
-
name: myorg/ai/reviewer
|
|
246
|
-
description: AI-powered code review
|
|
247
|
-
inputSchema:
|
|
248
|
-
type: object
|
|
249
|
-
properties:
|
|
250
|
-
code: { type: string }
|
|
251
|
-
required: [code]
|
|
252
|
-
outputSchema:
|
|
253
|
-
type: object
|
|
254
|
-
properties:
|
|
255
|
-
issues: { type: array }
|
|
256
|
-
score: { type: number }
|
|
257
|
-
---
|
|
258
|
-
# Code Reviewer
|
|
259
|
-
|
|
260
|
-
You are a senior engineer. Review the code for bugs, style, and security.
|
|
261
|
-
Return JSON: {"issues": [...], "score": 75}
|
|
262
|
-
\`\`\`
|
|
263
|
-
|
|
264
|
-
## Publishing Checklist
|
|
265
|
-
|
|
266
|
-
- [ ] \`name\` follows \`namespace/category/tool\` pattern
|
|
267
|
-
- [ ] \`version\` set (semver)
|
|
268
|
-
- [ ] \`description\` is clear and searchable
|
|
269
|
-
- [ ] \`inputSchema\` / \`outputSchema\` defined
|
|
270
|
-
- [ ] \`from\` uses pinned image version
|
|
271
|
-
- [ ] \`timeout\` set appropriately
|
|
272
|
-
- [ ] Tool tested locally with \`enact run ./\`
|
|
273
|
-
|
|
274
|
-
## Troubleshooting
|
|
275
|
-
|
|
276
|
-
\`\`\`bash
|
|
277
|
-
enact run ./ --args '{"x": "y"}' --verbose # Verbose output
|
|
278
|
-
enact run ./ --args '{}' --dry-run # Preview command
|
|
279
|
-
enact list # List installed tools
|
|
280
|
-
\`\`\`
|
|
281
|
-
`,
|
|
282
|
-
"agent-agents.md": `# AGENTS.md
|
|
283
|
-
|
|
284
|
-
This project uses Enact tools — containerized, cryptographically-signed executables.
|
|
285
|
-
|
|
286
|
-
## Running Tools
|
|
287
|
-
\`\`\`bash
|
|
288
|
-
enact run <tool-name> --args '{"key": "value"}' # Run installed tool
|
|
289
|
-
enact run ./path/to/tool --args '{}' # Run local tool
|
|
290
|
-
\`\`\`
|
|
291
|
-
|
|
292
|
-
## Finding & Installing Tools
|
|
293
|
-
\`\`\`bash
|
|
294
|
-
enact search "pdf extraction" # Search registry
|
|
295
|
-
enact get author/category/tool # View tool info
|
|
296
|
-
enact learn author/category/tool # View tool documentation
|
|
297
|
-
enact install author/category/tool # Add to project (.enact/tools.json)
|
|
298
|
-
enact install author/category/tool --global # Add globally
|
|
299
|
-
enact list # List project tools
|
|
300
|
-
\`\`\`
|
|
301
|
-
|
|
302
|
-
## Tool Output
|
|
303
|
-
Tools output JSON to stdout. Parse with jq or your language's JSON parser:
|
|
304
|
-
\`\`\`bash
|
|
305
|
-
enact run tool --args '{}' | jq '.result'
|
|
306
|
-
\`\`\`
|
|
307
|
-
|
|
308
|
-
## Creating Local Tools
|
|
309
|
-
Create \`tools/<name>/SKILL.md\` with:
|
|
310
|
-
\`\`\`yaml
|
|
311
|
-
---
|
|
312
|
-
name: my-tool
|
|
313
|
-
description: What it does
|
|
314
|
-
command: echo "Hello \${name}"
|
|
315
|
-
inputSchema:
|
|
316
|
-
type: object
|
|
317
|
-
properties:
|
|
318
|
-
name: { type: string }
|
|
319
|
-
---
|
|
320
|
-
# My Tool
|
|
321
|
-
Documentation here.
|
|
322
|
-
\`\`\`
|
|
323
|
-
Run with: \`enact run ./tools/<name> --args '{"name": "World"}'\`
|
|
324
|
-
|
|
325
|
-
## Environment & Secrets
|
|
326
|
-
\`\`\`bash
|
|
327
|
-
enact env set API_KEY --secret --namespace author/tool # Set secret
|
|
328
|
-
enact env list # List env vars
|
|
329
|
-
\`\`\`
|
|
330
|
-
`,
|
|
331
|
-
"claude.md": `# CLAUDE.md
|
|
332
|
-
|
|
333
|
-
This project uses Enact tools — containerized, signed executables you can run via CLI.
|
|
334
|
-
|
|
335
|
-
## Quick Reference
|
|
336
|
-
\`\`\`bash
|
|
337
|
-
enact run <tool> --args '{"key": "value"}' # Run a tool
|
|
338
|
-
enact search "keyword" # Find tools
|
|
339
|
-
enact learn author/tool # View tool documentation
|
|
340
|
-
enact install author/tool # Install tool
|
|
341
|
-
enact list # List installed tools
|
|
342
|
-
\`\`\`
|
|
343
|
-
|
|
344
|
-
## Running Tools
|
|
345
|
-
Tools take JSON input and return JSON output:
|
|
346
|
-
\`\`\`bash
|
|
347
|
-
# Run and capture output
|
|
348
|
-
result=$(enact run author/utils/formatter --args '{"code": "const x=1"}')
|
|
349
|
-
|
|
350
|
-
# Parse with jq
|
|
351
|
-
enact run tool --args '{}' | jq '.data'
|
|
352
|
-
\`\`\`
|
|
353
|
-
|
|
354
|
-
## Creating Tools
|
|
355
|
-
Create \`SKILL.md\` in a directory:
|
|
356
|
-
\`\`\`yaml
|
|
357
|
-
---
|
|
358
|
-
name: namespace/category/tool
|
|
359
|
-
description: Clear description for search
|
|
360
|
-
version: 1.0.0
|
|
361
|
-
from: python:3.12-slim # Docker image
|
|
362
|
-
build: pip install requests # Install dependencies (cached)
|
|
363
|
-
command: python /work/main.py \${input}
|
|
364
|
-
inputSchema:
|
|
365
|
-
type: object
|
|
366
|
-
properties:
|
|
367
|
-
input: { type: string, description: "The input to process" }
|
|
368
|
-
required: [input]
|
|
369
|
-
---
|
|
370
|
-
# Tool Name
|
|
371
|
-
Usage documentation here.
|
|
372
|
-
\`\`\`
|
|
373
|
-
|
|
374
|
-
Key points:
|
|
375
|
-
- \`\${param}\` is auto-quoted — never add manual quotes
|
|
376
|
-
- \`from:\` pin image versions (not \`:latest\`)
|
|
377
|
-
- \`build:\` steps are cached by Dagger
|
|
378
|
-
- Output JSON to stdout, errors to stderr
|
|
379
|
-
- Non-zero exit = failure
|
|
380
|
-
|
|
381
|
-
## Tool Development Workflow
|
|
382
|
-
\`\`\`bash
|
|
383
|
-
enact run ./ --args '{"input": "test"}' # Test locally
|
|
384
|
-
enact run ./ --args '{}' --dry-run # Preview command
|
|
385
|
-
enact sign ./ && enact publish ./ # Publish
|
|
386
|
-
\`\`\`
|
|
387
|
-
|
|
388
|
-
## Secrets
|
|
389
|
-
Declare in SKILL.md, set via CLI:
|
|
390
|
-
\`\`\`yaml
|
|
391
|
-
env:
|
|
392
|
-
API_KEY: # Declared but not set
|
|
393
|
-
\`\`\`
|
|
394
|
-
\`\`\`bash
|
|
395
|
-
enact env set API_KEY --secret --namespace author/tool
|
|
396
|
-
\`\`\`
|
|
397
|
-
`,
|
|
23
|
+
"tool-skill.md": toolSkillTemplate,
|
|
24
|
+
"tool-agents.md": toolAgentsTemplate,
|
|
25
|
+
"agent-agents.md": agentAgentsTemplate,
|
|
26
|
+
"claude.md": claudeTemplate,
|
|
398
27
|
};
|
|
399
28
|
/**
|
|
400
29
|
* Load a template and replace placeholders
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/init/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/init/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,E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EAAE,sCAAsC,CAAC;SAC1D,MAAM,CAAC,eAAe,EAAE,sBAAsB,CAAC;SAC/C,MAAM,CAAC,KAAK,EAAE,OAAoB,EAAE,EAAE;QACrC,MAAM,GAAG,GAAmB;YAC1B,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;YAClB,OAAO;YACP,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;YAC7B,aAAa,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,KAAK;SAC7C,CAAC;QAEF,IAAI,CAAC;YACH,MAAM,WAAW,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAClC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;YACxB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AGENTS.md template for projects that use Enact tools
|
|
3
|
+
*/
|
|
4
|
+
export declare const agentAgentsTemplate = "# AGENTS.md\n\nThis project uses Enact tools \u2014 containerized, cryptographically-signed executables.\n\n## Running Tools\n```bash\nenact run <tool-name> --args '{\"key\": \"value\"}' # Run installed tool\nenact run ./path/to/tool --args '{}' # Run local tool\n```\n\n## Finding & Installing Tools\n```bash\nenact search \"pdf extraction\" # Search registry\nenact info author/category/tool # View tool info\nenact learn author/category/tool # View tool documentation\nenact install author/category/tool # Add to project (.enact/tools.json)\nenact install author/category/tool --global # Add globally\nenact list # List project tools\n```\n\n## Tool Output\nTools output JSON to stdout. Parse with jq or your language's JSON parser:\n```bash\nenact run tool --args '{}' | jq '.result'\n```\n\n## Creating Local Tools\nCreate `tools/<name>/SKILL.md` with:\n```yaml\n---\nname: my-tool\ndescription: What it does\ncommand: echo \"Hello ${name}\"\ninputSchema:\n type: object\n properties:\n name: { type: string }\n---\n# My Tool\nDocumentation here.\n```\nRun with: `enact run ./tools/<name> --args '{\"name\": \"World\"}'`\n\n## Environment & Secrets\n```bash\nenact env set API_KEY --secret --namespace author/tool # Set secret\nenact env list # List env vars\n```\n";
|
|
5
|
+
//# sourceMappingURL=agent-agents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-agents.d.ts","sourceRoot":"","sources":["../../../../src/commands/init/templates/agent-agents.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,mBAAmB,46CAgD/B,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AGENTS.md template for projects that use Enact tools
|
|
3
|
+
*/
|
|
4
|
+
export const agentAgentsTemplate = `# AGENTS.md
|
|
5
|
+
|
|
6
|
+
This project uses Enact tools — containerized, cryptographically-signed executables.
|
|
7
|
+
|
|
8
|
+
## Running Tools
|
|
9
|
+
\`\`\`bash
|
|
10
|
+
enact run <tool-name> --args '{"key": "value"}' # Run installed tool
|
|
11
|
+
enact run ./path/to/tool --args '{}' # Run local tool
|
|
12
|
+
\`\`\`
|
|
13
|
+
|
|
14
|
+
## Finding & Installing Tools
|
|
15
|
+
\`\`\`bash
|
|
16
|
+
enact search "pdf extraction" # Search registry
|
|
17
|
+
enact info author/category/tool # View tool info
|
|
18
|
+
enact learn author/category/tool # View tool documentation
|
|
19
|
+
enact install author/category/tool # Add to project (.enact/tools.json)
|
|
20
|
+
enact install author/category/tool --global # Add globally
|
|
21
|
+
enact list # List project tools
|
|
22
|
+
\`\`\`
|
|
23
|
+
|
|
24
|
+
## Tool Output
|
|
25
|
+
Tools output JSON to stdout. Parse with jq or your language's JSON parser:
|
|
26
|
+
\`\`\`bash
|
|
27
|
+
enact run tool --args '{}' | jq '.result'
|
|
28
|
+
\`\`\`
|
|
29
|
+
|
|
30
|
+
## Creating Local Tools
|
|
31
|
+
Create \`tools/<name>/SKILL.md\` with:
|
|
32
|
+
\`\`\`yaml
|
|
33
|
+
---
|
|
34
|
+
name: my-tool
|
|
35
|
+
description: What it does
|
|
36
|
+
command: echo "Hello \${name}"
|
|
37
|
+
inputSchema:
|
|
38
|
+
type: object
|
|
39
|
+
properties:
|
|
40
|
+
name: { type: string }
|
|
41
|
+
---
|
|
42
|
+
# My Tool
|
|
43
|
+
Documentation here.
|
|
44
|
+
\`\`\`
|
|
45
|
+
Run with: \`enact run ./tools/<name> --args '{"name": "World"}'\`
|
|
46
|
+
|
|
47
|
+
## Environment & Secrets
|
|
48
|
+
\`\`\`bash
|
|
49
|
+
enact env set API_KEY --secret --namespace author/tool # Set secret
|
|
50
|
+
enact env list # List env vars
|
|
51
|
+
\`\`\`
|
|
52
|
+
`;
|
|
53
|
+
//# sourceMappingURL=agent-agents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-agents.js","sourceRoot":"","sources":["../../../../src/commands/init/templates/agent-agents.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDlC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLAUDE.md template for Claude integration
|
|
3
|
+
*/
|
|
4
|
+
export declare const claudeTemplate = "# CLAUDE.md\n\nThis project uses Enact tools \u2014 containerized, signed executables you can run via CLI.\n\n## Quick Reference\n```bash\nenact run <tool> --args '{\"key\": \"value\"}' # Run a tool\nenact search \"keyword\" # Find tools\nenact learn author/tool # View tool documentation\nenact install author/tool # Install tool\nenact list # List installed tools\n```\n\n## Running Tools\nTools take JSON input and return JSON output:\n```bash\n# Run and capture output\nresult=$(enact run author/utils/formatter --args '{\"code\": \"const x=1\"}')\n\n# Parse with jq\nenact run tool --args '{}' | jq '.data'\n```\n\n## Creating Tools\nCreate `SKILL.md` in a directory:\n```yaml\n---\nname: namespace/category/tool\ndescription: Clear description for search\nversion: 1.0.0\nfrom: python:3.12-slim # Docker image\nbuild: pip install requests # Install dependencies (cached)\ncommand: python /work/main.py ${input}\ninputSchema:\n type: object\n properties:\n input: { type: string, description: \"The input to process\" }\n required: [input]\n---\n# Tool Name\nUsage documentation here.\n```\n\nKey points:\n- `${param}` is auto-quoted \u2014 never add manual quotes\n- `from:` pin image versions (not `:latest`)\n- `build:` steps are cached by Dagger\n- Output JSON to stdout, errors to stderr\n- Non-zero exit = failure\n\n## Tool Development Workflow\n```bash\nenact run ./ --args '{\"input\": \"test\"}' # Test locally\nenact run ./ --args '{}' --dry-run # Preview command\nenact sign ./ && enact publish ./ # Publish\n```\n\n## Secrets\nDeclare in SKILL.md, set via CLI:\n```yaml\nenv:\n API_KEY: # Declared but not set\n```\n```bash\nenact env set API_KEY --secret --namespace author/tool\n```\n";
|
|
5
|
+
//# sourceMappingURL=claude.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude.d.ts","sourceRoot":"","sources":["../../../../src/commands/init/templates/claude.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,cAAc,20DAkE1B,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLAUDE.md template for Claude integration
|
|
3
|
+
*/
|
|
4
|
+
export const claudeTemplate = `# CLAUDE.md
|
|
5
|
+
|
|
6
|
+
This project uses Enact tools — containerized, signed executables you can run via CLI.
|
|
7
|
+
|
|
8
|
+
## Quick Reference
|
|
9
|
+
\`\`\`bash
|
|
10
|
+
enact run <tool> --args '{"key": "value"}' # Run a tool
|
|
11
|
+
enact search "keyword" # Find tools
|
|
12
|
+
enact learn author/tool # View tool documentation
|
|
13
|
+
enact install author/tool # Install tool
|
|
14
|
+
enact list # List installed tools
|
|
15
|
+
\`\`\`
|
|
16
|
+
|
|
17
|
+
## Running Tools
|
|
18
|
+
Tools take JSON input and return JSON output:
|
|
19
|
+
\`\`\`bash
|
|
20
|
+
# Run and capture output
|
|
21
|
+
result=$(enact run author/utils/formatter --args '{"code": "const x=1"}')
|
|
22
|
+
|
|
23
|
+
# Parse with jq
|
|
24
|
+
enact run tool --args '{}' | jq '.data'
|
|
25
|
+
\`\`\`
|
|
26
|
+
|
|
27
|
+
## Creating Tools
|
|
28
|
+
Create \`SKILL.md\` in a directory:
|
|
29
|
+
\`\`\`yaml
|
|
30
|
+
---
|
|
31
|
+
name: namespace/category/tool
|
|
32
|
+
description: Clear description for search
|
|
33
|
+
version: 1.0.0
|
|
34
|
+
from: python:3.12-slim # Docker image
|
|
35
|
+
build: pip install requests # Install dependencies (cached)
|
|
36
|
+
command: python /work/main.py \${input}
|
|
37
|
+
inputSchema:
|
|
38
|
+
type: object
|
|
39
|
+
properties:
|
|
40
|
+
input: { type: string, description: "The input to process" }
|
|
41
|
+
required: [input]
|
|
42
|
+
---
|
|
43
|
+
# Tool Name
|
|
44
|
+
Usage documentation here.
|
|
45
|
+
\`\`\`
|
|
46
|
+
|
|
47
|
+
Key points:
|
|
48
|
+
- \`\${param}\` is auto-quoted — never add manual quotes
|
|
49
|
+
- \`from:\` pin image versions (not \`:latest\`)
|
|
50
|
+
- \`build:\` steps are cached by Dagger
|
|
51
|
+
- Output JSON to stdout, errors to stderr
|
|
52
|
+
- Non-zero exit = failure
|
|
53
|
+
|
|
54
|
+
## Tool Development Workflow
|
|
55
|
+
\`\`\`bash
|
|
56
|
+
enact run ./ --args '{"input": "test"}' # Test locally
|
|
57
|
+
enact run ./ --args '{}' --dry-run # Preview command
|
|
58
|
+
enact sign ./ && enact publish ./ # Publish
|
|
59
|
+
\`\`\`
|
|
60
|
+
|
|
61
|
+
## Secrets
|
|
62
|
+
Declare in SKILL.md, set via CLI:
|
|
63
|
+
\`\`\`yaml
|
|
64
|
+
env:
|
|
65
|
+
API_KEY: # Declared but not set
|
|
66
|
+
\`\`\`
|
|
67
|
+
\`\`\`bash
|
|
68
|
+
enact env set API_KEY --secret --namespace author/tool
|
|
69
|
+
\`\`\`
|
|
70
|
+
`;
|
|
71
|
+
//# sourceMappingURL=claude.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude.js","sourceRoot":"","sources":["../../../../src/commands/init/templates/claude.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkE7B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Template exports for enact init command
|
|
3
|
+
*/
|
|
4
|
+
export { toolSkillTemplate } from "./tool-skill";
|
|
5
|
+
export { toolAgentsTemplate } from "./tool-agents";
|
|
6
|
+
export { agentAgentsTemplate } from "./agent-agents";
|
|
7
|
+
export { claudeTemplate } from "./claude";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/init/templates/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Template exports for enact init command
|
|
3
|
+
*/
|
|
4
|
+
export { toolSkillTemplate } from "./tool-skill";
|
|
5
|
+
export { toolAgentsTemplate } from "./tool-agents";
|
|
6
|
+
export { agentAgentsTemplate } from "./agent-agents";
|
|
7
|
+
export { claudeTemplate } from "./claude";
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/init/templates/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AGENTS.md template for tool development
|
|
3
|
+
*/
|
|
4
|
+
export declare const toolAgentsTemplate = "# Enact Tool Development Guide\n\nEnact tools are containerized, cryptographically-signed executables. Each tool is defined by a `SKILL.md` file (YAML frontmatter + Markdown docs).\n\n## Quick Reference\n\n| Task | Command |\n|------|---------|\n| Run with JSON | `enact run ./ --args '{\"key\": \"value\"}'` |\n| Run from file | `enact run ./ --input-file inputs.json` |\n| Dry run | `enact run ./ --args '{}' --dry-run` |\n| Sign & publish | `enact sign ./ && enact publish ./` |\n\n## SKILL.md Structure\n\n```yaml\n---\nname: {{TOOL_NAME}}\ndescription: What the tool does\nversion: 1.0.0\nenact: \"2.0.0\"\n\nfrom: python:3.12-slim # Docker image (pin versions, not :latest)\nbuild: pip install requests # Build steps (cached by Dagger)\ncommand: python /work/main.py ${input}\ntimeout: 30s\n\ninputSchema:\n type: object\n properties:\n input:\n type: string\n description: \"Input to process\"\n required: [input]\n\noutputSchema:\n type: object\n properties:\n result:\n type: string\n\nenv:\n API_KEY:\n description: \"External API key\"\n secret: true # Set via: enact env set API_KEY --secret\n---\n# Tool Name\nDocumentation here.\n```\n\n## Field Reference\n\n| Field | Description |\n|-------|-------------|\n| `name` | Hierarchical ID: `org/category/tool` |\n| `description` | What the tool does |\n| `version` | Semver version |\n| `from` | Docker image |\n| `build` | Build commands (string or array, cached) |\n| `command` | Shell command with `${param}` substitution |\n| `timeout` | Max execution time (e.g., \"30s\", \"5m\") |\n| `inputSchema` | JSON Schema for inputs |\n| `outputSchema` | JSON Schema for outputs |\n| `env` | Environment variables and secrets |\n\n## Parameter Substitution\n\nEnact auto-quotes parameters. **Never manually quote:**\n\n```yaml\n# WRONG - causes double-quoting\ncommand: python /work/main.py \"${input}\"\n\n# RIGHT - Enact handles quoting\ncommand: python /work/main.py ${input}\n```\n\n**Optional params:** Missing optional params become empty strings. Always provide defaults:\n```yaml\ninputSchema:\n properties:\n greeting: \n type: string\n default: \"Hello\" # Recommended for optional params\n```\n\nOr handle empty in shell:\n```yaml\ncommand: \"echo ${greeting:-Hello} ${name}\"\n```\n\nModifiers:\n- `${param}` \u2014 auto-quoted (handles spaces, JSON, special chars)\n- `${param:raw}` \u2014 raw, no quoting (use carefully)\n\n## Output\n\nOutput valid JSON to stdout when `outputSchema` is defined:\n\n```python\nimport json, sys\n\ntry:\n result = do_work()\n print(json.dumps({\"status\": \"success\", \"result\": result}))\nexcept Exception as e:\n print(json.dumps({\"status\": \"error\", \"message\": str(e)}))\n sys.exit(1) # non-zero = error\n```\n\n## Build Steps by Language\n\n**Python:**\n```yaml\nfrom: python:3.12-slim\nbuild: pip install requests pandas\n```\n\n**Node.js:**\n```yaml\nfrom: node:20-alpine\nbuild:\n - npm install\n - npm run build\n```\n\n**Rust:**\n```yaml\nfrom: rust:1.83-slim\nbuild: rustc /work/main.rs -o /work/tool\ncommand: /work/tool ${input}\n```\n\n**Go:**\n```yaml\nfrom: golang:1.22-alpine\nbuild: cd /work && go build -o tool main.go\ncommand: /work/tool ${input}\n```\n\n**System packages:**\n```yaml\nbuild: apt-get update && apt-get install -y libfoo-dev\n```\n\nBuild steps are cached \u2014 first run slow, subsequent runs instant.\n\n## File Access\n\nTools run in a container with `/work` as the working directory. All source files are copied there.\n\n## Secrets\n\nDeclare in `SKILL.md`:\n```yaml\nenv:\n API_KEY:\n description: \"API key for service\"\n secret: true\n```\n\nSet before running:\n```bash\nenact env set API_KEY --secret --namespace {{TOOL_NAME}}\n```\n\nAccess in code:\n```python\nimport os\napi_key = os.environ.get('API_KEY')\n```\n\n## LLM Instruction Tools\n\nTools without a `command` field are interpreted by LLMs:\n\n```yaml\n---\nname: myorg/ai/reviewer\ndescription: AI-powered code review\ninputSchema:\n type: object\n properties:\n code: { type: string }\n required: [code]\noutputSchema:\n type: object\n properties:\n issues: { type: array }\n score: { type: number }\n---\n# Code Reviewer\n\nYou are a senior engineer. Review the code for bugs, style, and security.\nReturn JSON: {\"issues\": [...], \"score\": 75}\n```\n\n## Publishing Checklist\n\n- [ ] `name` follows `namespace/category/tool` pattern\n- [ ] `version` set (semver)\n- [ ] `description` is clear and searchable\n- [ ] `inputSchema` / `outputSchema` defined\n- [ ] `from` uses pinned image version\n- [ ] `timeout` set appropriately\n- [ ] Tool tested locally with `enact run ./`\n\n## Troubleshooting\n\n```bash\nenact run ./ --args '{\"x\": \"y\"}' --verbose # Verbose output\nenact run ./ --args '{}' --dry-run # Preview command\nenact list # List installed tools\n```\n";
|
|
5
|
+
//# sourceMappingURL=tool-agents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-agents.d.ts","sourceRoot":"","sources":["../../../../src/commands/init/templates/tool-agents.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,kBAAkB,22JAsN9B,CAAC"}
|