@caplets/opencode 0.1.2 → 0.1.3

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 CHANGED
@@ -10,4 +10,8 @@ This package exposes configured Caplets as native OpenCode tools named `caplets_
10
10
  }
11
11
  ```
12
12
 
13
- New or removed Caplets are snapshotted at plugin load. Restart OpenCode to refresh the native tool list.
13
+ The plugin hot reloads Caplets config and Caplet file edits for already-registered tools, so
14
+ existing native tools execute against the latest valid backend config and prompt guidance is
15
+ rebuilt from current Caplets state for the tools registered when the plugin loaded. OpenCode's
16
+ current plugin API snapshots `Hooks.tool` at plugin load, so adding, removing, or renaming native
17
+ tools still requires restarting OpenCode; newly added tools are not advertised until restart.
package/dist/index.js CHANGED
@@ -21,7 +21,7 @@ const plugin = async (_ctx) => {
21
21
  };
22
22
  async function createCapletsOpenCodeHooks(service) {
23
23
  const capletTools = service.listTools();
24
- const toolNames = capletTools.map((caplet) => caplet.toolName);
24
+ const registeredToolNames = new Set(capletTools.map((caplet) => caplet.toolName));
25
25
  return {
26
26
  tool: Object.fromEntries(capletTools.map((caplet) => [caplet.toolName, tool({
27
27
  description: caplet.description,
@@ -37,7 +37,7 @@ async function createCapletsOpenCodeHooks(service) {
37
37
  }
38
38
  })])),
39
39
  "experimental.chat.system.transform": async (_input, output) => {
40
- output.system.push(nativeCapletsSystemGuidance(toolNames));
40
+ output.system.push(nativeCapletsSystemGuidance(service.listTools().map((caplet) => caplet.toolName).filter((toolName) => registeredToolNames.has(toolName))));
41
41
  }
42
42
  };
43
43
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caplets/opencode",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Native OpenCode plugin for Caplets.",
5
5
  "homepage": "https://github.com/spiritledsoftware/caplets#readme",
6
6
  "bugs": {
@@ -26,7 +26,7 @@
26
26
  "access": "public"
27
27
  },
28
28
  "dependencies": {
29
- "@caplets/core": "0.12.0"
29
+ "@caplets/core": "0.12.1"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@opencode-ai/plugin": "^1.14.48",