aieo 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.
package/dist/index.cjs CHANGED
@@ -8213,18 +8213,23 @@ async function getModel(provider, apiKey, cwd) {
8213
8213
  });
8214
8214
  return openai2(SOTA[provider]);
8215
8215
  case "claude_code":
8216
- const customProvider = (0, import_ai_sdk_provider_claude_code.createClaudeCode)({
8217
- defaultSettings: {
8218
- // Skip permission prompts for all operations
8219
- permissionMode: "bypassPermissions",
8220
- // Set working directory for file operations
8221
- cwd
8216
+ try {
8217
+ const customProvider = (0, import_ai_sdk_provider_claude_code.createClaudeCode)({
8218
+ defaultSettings: {
8219
+ // Skip permission prompts for all operations
8220
+ permissionMode: "bypassPermissions",
8221
+ // Set working directory for file operations
8222
+ cwd
8223
+ }
8224
+ });
8225
+ if (cwd) {
8226
+ console.log("creating claude code model at", cwd);
8222
8227
  }
8223
- });
8224
- if (cwd) {
8225
- console.log("creating claude code model at", cwd);
8228
+ return customProvider(SOTA[provider]);
8229
+ } catch (error) {
8230
+ console.error("Failed to create Claude Code provider:", error);
8231
+ throw new Error("Claude Code CLI not available or not properly installed. Make sure Claude Code is installed and accessible in the environment where this code runs.");
8226
8232
  }
8227
- return customProvider(SOTA[provider]);
8228
8233
  default:
8229
8234
  throw new Error(`Unsupported provider: ${provider}`);
8230
8235
  }