@caplets/opencode 0.1.7 → 0.2.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.
Files changed (3) hide show
  1. package/README.md +38 -0
  2. package/dist/index.js +13 -55670
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -15,3 +15,41 @@ existing native tools execute against the latest valid backend config and prompt
15
15
  rebuilt from current Caplets state for the tools registered when the plugin loaded. OpenCode's
16
16
  current plugin API snapshots `Hooks.tool` at plugin load, so adding, removing, or renaming native
17
17
  tools still requires restarting OpenCode; newly added tools are not advertised until restart.
18
+
19
+ ## Remote Caplets service
20
+
21
+ By default the plugin reads local Caplets config. To use a remote `caplets serve --transport http` service, set environment variables:
22
+
23
+ ```sh
24
+ CAPLETS_REMOTE_URL=http://127.0.0.1:5387/mcp opencode
25
+ ```
26
+
27
+ For authenticated remote services, keep the password in the environment:
28
+
29
+ ```sh
30
+ CAPLETS_REMOTE_URL=https://caplets.example.com/mcp \
31
+ CAPLETS_REMOTE_USER=caplets \
32
+ CAPLETS_REMOTE_PASSWORD=... \
33
+ opencode
34
+ ```
35
+
36
+ OpenCode plugin config can also pass non-secret settings as the plugin factory's second argument:
37
+
38
+ ```ts
39
+ export default {
40
+ plugin: [
41
+ [
42
+ "@caplets/opencode",
43
+ {
44
+ mode: "remote",
45
+ remote: {
46
+ url: "https://caplets.example.com/mcp",
47
+ user: "caplets",
48
+ },
49
+ },
50
+ ],
51
+ ],
52
+ };
53
+ ```
54
+
55
+ Plugin config overrides environment variables. Prefer `CAPLETS_REMOTE_PASSWORD` for the Basic Auth password unless your OpenCode setup provides secure secret storage.