@meetopenbot/claude-code 0.1.3 → 0.1.4

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 (2) hide show
  1. package/dist/index.js +17 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  // runtime.ts
2
+ import { execSync } from "node:child_process";
2
3
  import { existsSync as existsSync2, readlinkSync as readlinkSync2, statSync as statSync2 } from "node:fs";
3
4
 
4
5
  // node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs
@@ -19618,16 +19619,28 @@ var parseToolResultBlock = (block) => {
19618
19619
  }
19619
19620
  return null;
19620
19621
  };
19622
+ var findClaudeExecutable = () => {
19623
+ try {
19624
+ const command = process.platform === "win32" ? "where claude" : "which claude";
19625
+ const path = execSync(command, { encoding: "utf8", stdio: ["ignore", "pipe", "ignore"] }).trim();
19626
+ if (path && existsSync2(path)) {
19627
+ return path;
19628
+ }
19629
+ } catch {
19630
+ }
19631
+ return void 0;
19632
+ };
19621
19633
  var claudeCodeRuntime = (options = {}) => (builder) => {
19622
19634
  const {
19623
19635
  model = "sonnet",
19624
19636
  system,
19625
19637
  permissionMode = "default",
19626
19638
  cwd,
19627
- executablePath,
19639
+ executablePath: executablePathOverride,
19628
19640
  allowedTools,
19629
19641
  storage
19630
19642
  } = options;
19643
+ const executablePath = executablePathOverride || findClaudeExecutable();
19631
19644
  builder.on("agent:invoke", async function* (event, context) {
19632
19645
  if (!shouldHandleInvoke(event, context.state.agentId)) {
19633
19646
  return;
@@ -19861,18 +19874,18 @@ var claudeCodePlugin = {
19861
19874
  permissionMode: {
19862
19875
  type: "string",
19863
19876
  description: "How the SDK handles tool permission prompts: default | acceptEdits | bypassPermissions | plan | dontAsk | auto.",
19864
- default: "default",
19877
+ default: "bypassPermissions",
19865
19878
  enum: ["default", "acceptEdits", "bypassPermissions", "plan", "dontAsk", "auto"]
19866
19879
  },
19867
19880
  executablePath: {
19868
19881
  type: "string",
19869
- description: "Path to the Claude Code CLI executable. When unset, the SDK uses its bundled binary."
19882
+ description: "Path to the Claude Code CLI executable. When unset, the plugin attempts to find it in your PATH, falling back to the SDK bundled binary."
19870
19883
  }
19871
19884
  }
19872
19885
  },
19873
19886
  factory: ({ agentDetails, config, storage }) => {
19874
19887
  const model = typeof config.model === "string" && config.model ? config.model : "sonnet";
19875
- const permissionMode = typeof config.permissionMode === "string" && config.permissionMode ? config.permissionMode : "default";
19888
+ const permissionMode = typeof config.permissionMode === "string" && config.permissionMode ? config.permissionMode : "bypassPermissions";
19876
19889
  const executablePath = typeof config.executablePath === "string" && config.executablePath ? config.executablePath : void 0;
19877
19890
  return claudeCodeRuntime({
19878
19891
  model,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meetopenbot/claude-code",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "type": "module",
5
5
  "description": "Claude Code plugin for OpenBot",
6
6
  "main": "./dist/index.js",