@enactprotocol/cli 2.1.10 → 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/index.d.ts +1 -0
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +2 -0
- package/dist/commands/index.js.map +1 -1
- 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/commands/publish/index.d.ts +2 -0
- package/dist/commands/publish/index.d.ts.map +1 -1
- package/dist/commands/publish/index.js +18 -1
- package/dist/commands/publish/index.js.map +1 -1
- package/dist/commands/visibility/index.d.ts +11 -0
- package/dist/commands/visibility/index.d.ts.map +1 -0
- package/dist/commands/visibility/index.js +117 -0
- package/dist/commands/visibility/index.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/commands/index.ts +3 -0
- 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/commands/publish/index.ts +23 -1
- package/src/commands/visibility/index.ts +154 -0
- package/src/index.ts +5 -1
- package/tests/commands/publish.test.ts +50 -0
- package/tests/commands/visibility.test.ts +156 -0
- 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,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"}
|
|
@@ -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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/publish/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAcH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/publish/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAcH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuBzC,6BAA6B;AAC7B,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;AAoU/D;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA2B9D"}
|
|
@@ -139,10 +139,17 @@ async function publishHandler(pathArg, options, ctx) {
|
|
|
139
139
|
const version = manifest.version ?? "0.0.0";
|
|
140
140
|
header(`Publishing ${toolName}@${version}`);
|
|
141
141
|
newline();
|
|
142
|
+
// Determine visibility (private by default for security)
|
|
143
|
+
const visibility = options.public
|
|
144
|
+
? "public"
|
|
145
|
+
: options.unlisted
|
|
146
|
+
? "unlisted"
|
|
147
|
+
: "private";
|
|
142
148
|
// Show what we're publishing
|
|
143
149
|
keyValue("Name", toolName);
|
|
144
150
|
keyValue("Version", version);
|
|
145
151
|
keyValue("Description", manifest.description);
|
|
152
|
+
keyValue("Visibility", visibility);
|
|
146
153
|
if (manifest.tags && manifest.tags.length > 0) {
|
|
147
154
|
keyValue("Tags", manifest.tags.join(", "));
|
|
148
155
|
}
|
|
@@ -216,6 +223,7 @@ async function publishHandler(pathArg, options, ctx) {
|
|
|
216
223
|
info("Would publish to registry:");
|
|
217
224
|
keyValue("Tool", toolName);
|
|
218
225
|
keyValue("Version", version);
|
|
226
|
+
keyValue("Visibility", visibility);
|
|
219
227
|
keyValue("Source", toolDir);
|
|
220
228
|
// Show files that would be bundled
|
|
221
229
|
const files = collectFiles(toolDir, toolDir);
|
|
@@ -247,6 +255,7 @@ async function publishHandler(pathArg, options, ctx) {
|
|
|
247
255
|
manifest: manifest,
|
|
248
256
|
bundle,
|
|
249
257
|
rawManifest: rawManifestContent,
|
|
258
|
+
visibility,
|
|
250
259
|
});
|
|
251
260
|
});
|
|
252
261
|
// JSON output
|
|
@@ -256,10 +265,16 @@ async function publishHandler(pathArg, options, ctx) {
|
|
|
256
265
|
}
|
|
257
266
|
// Success output
|
|
258
267
|
newline();
|
|
259
|
-
success(`Published ${result.name}@${result.version}`);
|
|
268
|
+
success(`Published ${result.name}@${result.version} (${visibility})`);
|
|
260
269
|
keyValue("Bundle Hash", result.bundleHash);
|
|
261
270
|
keyValue("Published At", result.publishedAt.toISOString());
|
|
262
271
|
newline();
|
|
272
|
+
if (visibility === "private") {
|
|
273
|
+
dim("This tool is private - only you can access it.");
|
|
274
|
+
}
|
|
275
|
+
else if (visibility === "unlisted") {
|
|
276
|
+
dim("This tool is unlisted - accessible via direct link, not searchable.");
|
|
277
|
+
}
|
|
263
278
|
dim(`Install with: enact install ${toolName}`);
|
|
264
279
|
}
|
|
265
280
|
/**
|
|
@@ -274,6 +289,8 @@ export function configurePublishCommand(program) {
|
|
|
274
289
|
.option("-v, --verbose", "Show detailed output")
|
|
275
290
|
.option("--skip-auth", "Skip authentication (for local development)")
|
|
276
291
|
.option("--json", "Output as JSON")
|
|
292
|
+
.option("--public", "Publish as public (searchable by everyone)")
|
|
293
|
+
.option("--unlisted", "Publish as unlisted (accessible via direct link, not searchable)")
|
|
277
294
|
.action(async (pathArg, options) => {
|
|
278
295
|
const resolvedPath = pathArg ?? ".";
|
|
279
296
|
const ctx = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/publish/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAA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|
+
/**
|
|
2
|
+
* enact visibility command
|
|
3
|
+
*
|
|
4
|
+
* Change the visibility of a published tool.
|
|
5
|
+
*/
|
|
6
|
+
import type { Command } from "commander";
|
|
7
|
+
/**
|
|
8
|
+
* Configure the visibility command
|
|
9
|
+
*/
|
|
10
|
+
export declare function configureVisibilityCommand(program: Command): void;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/visibility/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAyHzC;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAqBjE"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* enact visibility command
|
|
3
|
+
*
|
|
4
|
+
* Change the visibility of a published tool.
|
|
5
|
+
*/
|
|
6
|
+
import { getSecret } from "@enactprotocol/secrets";
|
|
7
|
+
import { loadConfig } from "@enactprotocol/shared";
|
|
8
|
+
import { dim, error, extractNamespace, formatError, getCurrentUsername, header, info, json, newline, success, } from "../../utils";
|
|
9
|
+
/** Auth namespace for token storage */
|
|
10
|
+
const AUTH_NAMESPACE = "enact:auth";
|
|
11
|
+
const ACCESS_TOKEN_KEY = "access_token";
|
|
12
|
+
/** Valid visibility levels */
|
|
13
|
+
const VALID_VISIBILITIES = ["public", "private", "unlisted"];
|
|
14
|
+
/**
|
|
15
|
+
* Visibility command handler
|
|
16
|
+
*/
|
|
17
|
+
async function visibilityHandler(tool, visibility, options, _ctx) {
|
|
18
|
+
// Validate visibility value
|
|
19
|
+
if (!VALID_VISIBILITIES.includes(visibility)) {
|
|
20
|
+
error(`Invalid visibility: ${visibility}`);
|
|
21
|
+
newline();
|
|
22
|
+
dim(`Valid values: ${VALID_VISIBILITIES.join(", ")}`);
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
header(`Changing visibility for ${tool}`);
|
|
26
|
+
newline();
|
|
27
|
+
// Pre-flight namespace check
|
|
28
|
+
const currentUsername = await getCurrentUsername();
|
|
29
|
+
if (currentUsername) {
|
|
30
|
+
const toolNamespace = extractNamespace(tool);
|
|
31
|
+
if (toolNamespace !== currentUsername) {
|
|
32
|
+
error(`Namespace mismatch: Tool namespace "${toolNamespace}" does not match your username "${currentUsername}".`);
|
|
33
|
+
newline();
|
|
34
|
+
dim("You can only change visibility for your own tools.");
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
// Get registry URL from config or environment
|
|
39
|
+
const config = loadConfig();
|
|
40
|
+
const registryUrl = process.env.ENACT_REGISTRY_URL ??
|
|
41
|
+
config.registry?.url ??
|
|
42
|
+
"https://siikwkfgsmouioodghho.supabase.co/functions/v1";
|
|
43
|
+
// Get auth token
|
|
44
|
+
let authToken = await getSecret(AUTH_NAMESPACE, ACCESS_TOKEN_KEY);
|
|
45
|
+
if (!authToken) {
|
|
46
|
+
authToken = config.registry?.authToken ?? process.env.ENACT_AUTH_TOKEN ?? null;
|
|
47
|
+
}
|
|
48
|
+
if (!authToken) {
|
|
49
|
+
error("Not authenticated. Please run: enact auth login");
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
// Make the API request to change visibility
|
|
53
|
+
const response = await fetch(`${registryUrl}/tools/${tool}/visibility`, {
|
|
54
|
+
method: "PATCH",
|
|
55
|
+
headers: {
|
|
56
|
+
Authorization: `Bearer ${authToken}`,
|
|
57
|
+
"Content-Type": "application/json",
|
|
58
|
+
},
|
|
59
|
+
body: JSON.stringify({ visibility }),
|
|
60
|
+
});
|
|
61
|
+
if (!response.ok) {
|
|
62
|
+
const errorText = await response.text();
|
|
63
|
+
try {
|
|
64
|
+
const errorJson = JSON.parse(errorText);
|
|
65
|
+
error(`Failed to change visibility: ${errorJson.error?.message ?? errorText}`);
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
error(`Failed to change visibility: ${errorText}`);
|
|
69
|
+
}
|
|
70
|
+
process.exit(1);
|
|
71
|
+
}
|
|
72
|
+
// Parse response (we don't use it but need to consume the body)
|
|
73
|
+
await response.json();
|
|
74
|
+
// JSON output
|
|
75
|
+
if (options.json) {
|
|
76
|
+
json({ tool, visibility, success: true });
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
// Success output
|
|
80
|
+
success(`${tool} is now ${visibility}`);
|
|
81
|
+
newline();
|
|
82
|
+
if (visibility === "private") {
|
|
83
|
+
info("This tool is now private - only you can access it.");
|
|
84
|
+
}
|
|
85
|
+
else if (visibility === "unlisted") {
|
|
86
|
+
info("This tool is now unlisted - accessible via direct link, but not searchable.");
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
info("This tool is now public - anyone can find and install it.");
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Configure the visibility command
|
|
94
|
+
*/
|
|
95
|
+
export function configureVisibilityCommand(program) {
|
|
96
|
+
program
|
|
97
|
+
.command("visibility <tool> <visibility>")
|
|
98
|
+
.description("Change tool visibility (public, private, or unlisted)")
|
|
99
|
+
.option("--json", "Output as JSON")
|
|
100
|
+
.option("-v, --verbose", "Show detailed output")
|
|
101
|
+
.action(async (tool, visibility, options) => {
|
|
102
|
+
const ctx = {
|
|
103
|
+
cwd: process.cwd(),
|
|
104
|
+
options,
|
|
105
|
+
isCI: Boolean(process.env.CI),
|
|
106
|
+
isInteractive: process.stdout.isTTY ?? false,
|
|
107
|
+
};
|
|
108
|
+
try {
|
|
109
|
+
await visibilityHandler(tool, visibility, options, ctx);
|
|
110
|
+
}
|
|
111
|
+
catch (err) {
|
|
112
|
+
error(formatError(err));
|
|
113
|
+
process.exit(1);
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=index.js.map
|
|
@@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AC7B,aAAa,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,KAAK;SAC7C,CAAC;QAEF,IAAI,CAAC;YACH,MAAM,iBAAiB,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QAC1D,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"}
|
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.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;GAKG;AA6BH,eAAO,MAAM,OAAO,WAAW,CAAC;AAGhC,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { ensureGlobalSetup } from "@enactprotocol/shared";
|
|
9
9
|
import { Command } from "commander";
|
|
10
|
-
import { configureAuthCommand, configureCacheCommand, configureConfigCommand, configureEnvCommand, configureExecCommand, configureInfoCommand, configureInitCommand, configureInspectCommand, configureInstallCommand, configureLearnCommand, configureListCommand, configurePublishCommand, configureReportCommand, configureRunCommand, configureSearchCommand, configureSetupCommand, configureSignCommand, configureTrustCommand, configureUnyankCommand, configureYankCommand, } from "./commands";
|
|
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
|
|
@@ -43,6 +43,8 @@ async function main() {
|
|
|
43
43
|
// API v2 migration commands
|
|
44
44
|
configureYankCommand(program);
|
|
45
45
|
configureUnyankCommand(program);
|
|
46
|
+
// Private tools - visibility management
|
|
47
|
+
configureVisibilityCommand(program);
|
|
46
48
|
// Global error handler - handle Commander's help/version exits gracefully
|
|
47
49
|
program.exitOverride((err) => {
|
|
48
50
|
// Commander throws errors for help, version, and other "exit" scenarios
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;GAKG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,oB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