@caplets/opencode 0.1.7 → 0.3.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 +42 -0
  2. package/dist/index.js +14 -55670
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -15,3 +15,45 @@ 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_MODE=remote CAPLETS_SERVER_URL=http://127.0.0.1:5387/caplets opencode
25
+ ```
26
+
27
+ For authenticated remote services, keep the password in the environment:
28
+
29
+ ```sh
30
+ CAPLETS_MODE=remote \
31
+ CAPLETS_SERVER_URL=https://caplets.example.com/caplets \
32
+ CAPLETS_SERVER_USER=caplets \
33
+ CAPLETS_SERVER_PASSWORD=... \
34
+ opencode
35
+ ```
36
+
37
+ OpenCode plugin config can also pass non-secret settings as the plugin factory's second argument:
38
+
39
+ ```ts
40
+ export default {
41
+ plugin: [
42
+ [
43
+ "@caplets/opencode",
44
+ {
45
+ mode: "remote",
46
+ server: {
47
+ url: "https://caplets.example.com/caplets",
48
+ user: "caplets",
49
+ },
50
+ remote: {
51
+ pollIntervalMs: 5_000,
52
+ },
53
+ },
54
+ ],
55
+ ],
56
+ };
57
+ ```
58
+
59
+ Plugin config overrides environment variables. The explicit config shape is `{ mode, server: { url, user }, remote: { pollIntervalMs } }`. Prefer `CAPLETS_SERVER_PASSWORD` for the Basic Auth password unless your OpenCode setup provides secure secret storage.