@meetopenbot/claude-code 0.1.13 → 0.1.14

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 +13 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -42,6 +42,7 @@ async function resolveModelConfigField() {
42
42
  // runtime.ts
43
43
  import { execSync } from "node:child_process";
44
44
  import { existsSync as existsSync2, readlinkSync as readlinkSync2, statSync as statSync2 } from "node:fs";
45
+ import { join as join2 } from "node:path";
45
46
 
46
47
  // ../../node_modules/.pnpm/@anthropic-ai+claude-agent-sdk@0.2.141_@cfworker+json-schema@4.1.1_zod@4.4.3/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs
47
48
  import { createRequire as $S } from "node:module";
@@ -19755,11 +19756,19 @@ var isIntegrationsProviderError = (message) => {
19755
19756
  var CREDITS_NOT_CONFIGURED_MESSAGE = "OpenBot Credits is not configured on this runtime. The cloud host must set OPENBOT_INTEGRATIONS_BASE_URL and OPENBOT_INTEGRATIONS_TOKEN (try redeploying the workspace).";
19756
19757
  var CREDITS_PROVIDER_UNAVAILABLE_MESSAGE = "OpenBot Credits could not reach Anthropic \u2014 the platform provider API key is not configured yet. Try again later or switch this agent to BYOK mode.";
19757
19758
  var CREDITS_AUTH_FAILED_MESSAGE = "Claude could not authenticate via OpenBot Credits. Check your workspace credit balance in settings, or switch this agent to BYOK mode.";
19759
+ var resolveClaudeConfigDir = () => {
19760
+ const baseDir = process.env.OPENBOT_BASE_DIR?.trim();
19761
+ return baseDir ? join2(baseDir, "claude") : void 0;
19762
+ };
19758
19763
  var buildSdkEnv = (authMode) => {
19759
- if (authMode !== "credits") return void 0;
19760
- const creditsEnv = buildCreditsAnthropicEnv();
19761
- if (!creditsEnv) return void 0;
19762
- return { ...process.env, ...creditsEnv };
19764
+ const creditsEnv = authMode === "credits" ? buildCreditsAnthropicEnv() : void 0;
19765
+ const claudeConfigDir = resolveClaudeConfigDir();
19766
+ if (!creditsEnv && !claudeConfigDir) return void 0;
19767
+ return {
19768
+ ...process.env,
19769
+ ...creditsEnv ?? {},
19770
+ ...claudeConfigDir ? { CLAUDE_CONFIG_DIR: claudeConfigDir } : {}
19771
+ };
19763
19772
  };
19764
19773
  var creditsErrorMessage = (message) => {
19765
19774
  if (isIntegrationsProviderError(message)) return CREDITS_PROVIDER_UNAVAILABLE_MESSAGE;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meetopenbot/claude-code",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "type": "module",
5
5
  "description": "Claude Code plugin for OpenBot",
6
6
  "main": "./dist/index.js",