@doingdev/opencode-claude-manager-plugin 0.1.21 → 0.1.22

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.
@@ -1,14 +1,2 @@
1
1
  import type { Plugin } from '@opencode-ai/plugin';
2
- /**
3
- * Thin OpenCode orchestrator plugin with Claude Code specialist subagents.
4
- *
5
- * - Registers `claude-code` provider via ai-sdk-provider-claude-code.
6
- * - Creates one orchestrator agent (uses the user's default OpenCode model).
7
- * - Creates 4 Claude Code subagents: planning + build × opus + sonnet.
8
- * - Enforces bash safety via the permission.ask hook.
9
- *
10
- * NOTE: Claude Code `effort` is not configurable through OpenCode provider/model
11
- * options at this time. The subagent prompts compensate by setting high-quality
12
- * expectations directly.
13
- */
14
2
  export declare const OrchestratorPlugin: Plugin;
@@ -3,7 +3,7 @@ import { evaluateBashCommand, extractBashCommand, } from '../safety/bash-safety.
3
3
  /**
4
4
  * Thin OpenCode orchestrator plugin with Claude Code specialist subagents.
5
5
  *
6
- * - Registers `claude-code` provider via ai-sdk-provider-claude-code.
6
+ * - Registers `claude-code` provider via a local shim over ai-sdk-provider-claude-code.
7
7
  * - Creates one orchestrator agent (uses the user's default OpenCode model).
8
8
  * - Creates 4 Claude Code subagents: planning + build × opus + sonnet.
9
9
  * - Enforces bash safety via the permission.ask hook.
@@ -12,14 +12,20 @@ import { evaluateBashCommand, extractBashCommand, } from '../safety/bash-safety.
12
12
  * options at this time. The subagent prompts compensate by setting high-quality
13
13
  * expectations directly.
14
14
  */
15
+ // Resolve the shim path at module load time so it is stable for the lifetime
16
+ // of the process. The compiled output for this file sits at dist/plugin/ and
17
+ // the shim at dist/providers/, so we walk up one level.
18
+ const claudeCodeShimUrl = new URL('../providers/claude-code-wrapper.js', import.meta.url).href;
15
19
  export const OrchestratorPlugin = async () => {
16
20
  return {
17
21
  config: async (config) => {
18
22
  config.provider ??= {};
19
23
  config.agent ??= {};
20
24
  // ── Provider ──────────────────────────────────────────────────────
25
+ // Uses a file:// shim so OpenCode's factory-finder heuristic sees only
26
+ // createClaudeCode and not createAPICallError from the upstream package.
21
27
  config.provider['claude-code'] ??= {
22
- npm: 'ai-sdk-provider-claude-code',
28
+ npm: claudeCodeShimUrl,
23
29
  models: {
24
30
  opus: {
25
31
  id: 'opus',
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Thin re-export shim for ai-sdk-provider-claude-code.
3
+ *
4
+ * OpenCode's provider loader finds the provider factory by scanning
5
+ * `Object.keys(module).find(key => key.startsWith("create"))`. The upstream
6
+ * package exports `createAPICallError` before `createClaudeCode`, so OpenCode
7
+ * picks the wrong function and `.languageModel` ends up undefined.
8
+ *
9
+ * This shim re-exports only `createClaudeCode`, making it the sole "create*"
10
+ * export. The plugin references this file via a `file://` URL so the upstream
11
+ * package is still the actual implementation.
12
+ */
13
+ export { createClaudeCode } from 'ai-sdk-provider-claude-code';
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Thin re-export shim for ai-sdk-provider-claude-code.
3
+ *
4
+ * OpenCode's provider loader finds the provider factory by scanning
5
+ * `Object.keys(module).find(key => key.startsWith("create"))`. The upstream
6
+ * package exports `createAPICallError` before `createClaudeCode`, so OpenCode
7
+ * picks the wrong function and `.languageModel` ends up undefined.
8
+ *
9
+ * This shim re-exports only `createClaudeCode`, making it the sole "create*"
10
+ * export. The plugin references this file via a `file://` URL so the upstream
11
+ * package is still the actual implementation.
12
+ */
13
+ export { createClaudeCode } from 'ai-sdk-provider-claude-code';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doingdev/opencode-claude-manager-plugin",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "description": "Thin OpenCode orchestrator plugin with Claude Code specialist subagents.",
5
5
  "keywords": [
6
6
  "opencode",
@@ -29,7 +29,8 @@
29
29
  "node": ">=22.0.0"
30
30
  },
31
31
  "dependencies": {
32
- "@opencode-ai/plugin": "^1.2.27"
32
+ "@opencode-ai/plugin": "^1.2.27",
33
+ "ai-sdk-provider-claude-code": "^3.4.4"
33
34
  },
34
35
  "devDependencies": {
35
36
  "@eslint/js": "^9.22.0",