caplets 0.16.0 → 0.17.0
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/README.md +87 -0
- package/dist/index.js +1938 -702
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -30,6 +30,10 @@ Instead of exposing a flat wall of tools, Caplets shows one top-level tool per c
|
|
|
30
30
|
The agent chooses a domain first, then uses scoped operations like `search_tools`,
|
|
31
31
|
`get_tool`, and `call_tool` only when it needs more detail.
|
|
32
32
|
|
|
33
|
+
For MCP-backed Caplets, the scoped operation set also includes resource discovery/reading,
|
|
34
|
+
prompt listing/rendering, resource-template discovery, and completion for prompt or template
|
|
35
|
+
arguments. Non-MCP backends continue to expose only tool/action operations.
|
|
36
|
+
|
|
33
37
|
## Quick Start
|
|
34
38
|
|
|
35
39
|
Caplets requires Node.js 22 or newer.
|
|
@@ -76,10 +80,47 @@ caplets list-tools context7
|
|
|
76
80
|
caplets get-tool context7.resolve-library-id
|
|
77
81
|
caplets call-tool context7.resolve-library-id --args '{"libraryName":"react"}'
|
|
78
82
|
caplets call-tool context7.resolve-library-id --args '{"libraryName":"react"}' --field result.id --format json
|
|
83
|
+
caplets list-resources docs
|
|
84
|
+
caplets read-resource docs file:///repo/README.md
|
|
85
|
+
caplets list-prompts linear
|
|
86
|
+
caplets get-prompt linear.review_issue --args '{"issueId":"CAP-123"}'
|
|
87
|
+
caplets complete docs --resource-template 'file:///repo/{path}' --argument path --value src/
|
|
79
88
|
```
|
|
80
89
|
|
|
81
90
|
Direct CLI operation commands print Markdown summaries by default. Add `--format plain` for plain text or `--format json` for machine-readable JSON (`md` is accepted as an alias for `markdown`). If a downstream tool returns `isError: true`, Caplets still exits with status code 1.
|
|
82
91
|
|
|
92
|
+
### Shell completions
|
|
93
|
+
|
|
94
|
+
The npm package ships shell completion generators for Bash, Zsh, Fish, PowerShell, and cmd. Installation is explicit: `npm install -g caplets` does not modify shell startup files or system completion directories.
|
|
95
|
+
|
|
96
|
+
```sh
|
|
97
|
+
# Bash
|
|
98
|
+
mkdir -p ~/.local/share/bash-completion/completions
|
|
99
|
+
caplets completion bash > ~/.local/share/bash-completion/completions/caplets
|
|
100
|
+
|
|
101
|
+
# Zsh
|
|
102
|
+
mkdir -p ~/.zsh/completions
|
|
103
|
+
caplets completion zsh > ~/.zsh/completions/_caplets
|
|
104
|
+
# Ensure ~/.zsh/completions is on fpath before compinit, then reload your shell:
|
|
105
|
+
# echo 'fpath=(~/.zsh/completions $fpath)' >> ~/.zshrc
|
|
106
|
+
# echo 'autoload -Uz compinit && compinit' >> ~/.zshrc
|
|
107
|
+
|
|
108
|
+
# Fish
|
|
109
|
+
mkdir -p ~/.config/fish/completions
|
|
110
|
+
caplets completion fish > ~/.config/fish/completions/caplets.fish
|
|
111
|
+
|
|
112
|
+
# PowerShell
|
|
113
|
+
caplets completion powershell | Out-String | Invoke-Expression
|
|
114
|
+
|
|
115
|
+
# cmd.exe
|
|
116
|
+
caplets completion cmd > %USERPROFILE%\caplets-completion.cmd
|
|
117
|
+
%USERPROFILE%\caplets-completion.cmd
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Completions include command names, options, common enum values, configured Caplet IDs, and cache-backed downstream names for qualified targets such as `caplets call-tool repo.<TAB>`. Downstream discovery is bounded by the `completion` config timeouts and a platform-native cache directory. Generated shell scripts suppress completion stderr; run the underlying CLI command directly when debugging completion behavior.
|
|
121
|
+
|
|
122
|
+
Backends that require OAuth or token auth may need `caplets auth login <server>` before live downstream completions can return richer results. Completion never starts interactive login flows.
|
|
123
|
+
|
|
83
124
|
## Agent Plugins
|
|
84
125
|
|
|
85
126
|
Use Caplets as a normal MCP server everywhere, or install a native agent integration when
|
|
@@ -124,6 +165,46 @@ With `CAPLETS_SERVER_URL=http://127.0.0.1:5387/caplets`, the derived endpoints a
|
|
|
124
165
|
|
|
125
166
|
`caplets serve --transport http` serves plain HTTP. For non-loopback or network access, expose it only through HTTPS/TLS (for example, a reverse proxy or secure tunnel) and enable Basic Auth; Basic Auth over plain HTTP exposes credentials. Keep credentials out of plugin manifests.
|
|
126
167
|
|
|
168
|
+
#### Docker Compose self-hosting
|
|
169
|
+
|
|
170
|
+
This repository includes a source-build Docker image and Compose service for running the HTTP service from the checked-out source tree:
|
|
171
|
+
|
|
172
|
+
```sh
|
|
173
|
+
CAPLETS_SERVER_PASSWORD=change-me docker compose up --build
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
By default, Compose publishes the service on loopback only:
|
|
177
|
+
|
|
178
|
+
- Base URL: `http://127.0.0.1:5387`
|
|
179
|
+
- MCP endpoint: `http://127.0.0.1:5387/mcp`
|
|
180
|
+
- Control endpoint: `http://127.0.0.1:5387/control`
|
|
181
|
+
- Health endpoint: `http://127.0.0.1:5387/healthz`
|
|
182
|
+
|
|
183
|
+
The service stores Caplets config and auth state in a Docker named volume mounted at `/data`. To use a host-visible bind mount instead, replace this Compose volume entry:
|
|
184
|
+
|
|
185
|
+
```yaml
|
|
186
|
+
volumes:
|
|
187
|
+
- caplets-data:/data
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
with:
|
|
191
|
+
|
|
192
|
+
```yaml
|
|
193
|
+
volumes:
|
|
194
|
+
- ./data:/data
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
To expose the service to a LAN interface or reverse proxy, set an explicit bind address and public base URL:
|
|
198
|
+
|
|
199
|
+
```sh
|
|
200
|
+
CAPLETS_BIND_ADDRESS=0.0.0.0 \
|
|
201
|
+
CAPLETS_SERVER_URL=https://caplets.example.com \
|
|
202
|
+
CAPLETS_SERVER_PASSWORD=change-me \
|
|
203
|
+
docker compose up --build
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Only expose Caplets beyond loopback through HTTPS/TLS and Basic Auth. `CAPLETS_SERVER_PASSWORD` protects both the MCP and control endpoints; downstream provider tokens and auth files remain server-owned inside the mounted `/data` location.
|
|
207
|
+
|
|
127
208
|
Native integrations and remote-capable CLI commands read remote client settings from environment variables:
|
|
128
209
|
|
|
129
210
|
```sh
|
|
@@ -248,6 +329,12 @@ you want Caplets to expose:
|
|
|
248
329
|
"version": 1,
|
|
249
330
|
"defaultSearchLimit": 20,
|
|
250
331
|
"maxSearchLimit": 50,
|
|
332
|
+
"completion": {
|
|
333
|
+
"discoveryTimeoutMs": 750,
|
|
334
|
+
"overallTimeoutMs": 1500,
|
|
335
|
+
"cacheTtlMs": 300000,
|
|
336
|
+
"negativeCacheTtlMs": 30000
|
|
337
|
+
},
|
|
251
338
|
"mcpServers": {
|
|
252
339
|
"filesystem": {
|
|
253
340
|
"name": "Project Files",
|