aieo 0.1.22 → 0.1.23
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 +16 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +16 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -8195,7 +8195,7 @@ var SOTA = {
|
|
|
8195
8195
|
openai: "gpt-4.1",
|
|
8196
8196
|
claude_code: "sonnet"
|
|
8197
8197
|
};
|
|
8198
|
-
async function getModel(provider, apiKey, cwd) {
|
|
8198
|
+
async function getModel(provider, apiKey, cwd, executablePath) {
|
|
8199
8199
|
switch (provider) {
|
|
8200
8200
|
case "anthropic":
|
|
8201
8201
|
const anthropic2 = createAnthropic({
|
|
@@ -8216,6 +8216,7 @@ async function getModel(provider, apiKey, cwd) {
|
|
|
8216
8216
|
try {
|
|
8217
8217
|
const customProvider = (0, import_ai_sdk_provider_claude_code.createClaudeCode)({
|
|
8218
8218
|
defaultSettings: {
|
|
8219
|
+
pathToClaudeCodeExecutable: executablePath,
|
|
8219
8220
|
// Skip permission prompts for all operations
|
|
8220
8221
|
permissionMode: "bypassPermissions",
|
|
8221
8222
|
// Set working directory for file operations
|
|
@@ -8228,7 +8229,9 @@ async function getModel(provider, apiKey, cwd) {
|
|
|
8228
8229
|
return customProvider(SOTA[provider]);
|
|
8229
8230
|
} catch (error) {
|
|
8230
8231
|
console.error("Failed to create Claude Code provider:", error);
|
|
8231
|
-
throw new Error(
|
|
8232
|
+
throw new Error(
|
|
8233
|
+
"Claude Code CLI not available or not properly installed. Make sure Claude Code is installed and accessible in the environment where this code runs."
|
|
8234
|
+
);
|
|
8232
8235
|
}
|
|
8233
8236
|
default:
|
|
8234
8237
|
throw new Error(`Unsupported provider: ${provider}`);
|
|
@@ -8265,8 +8268,17 @@ function getProviderOptions(provider, thinkingSpeed) {
|
|
|
8265
8268
|
// src/stream.ts
|
|
8266
8269
|
var import_ai = require("ai");
|
|
8267
8270
|
async function callModel(opts) {
|
|
8268
|
-
const {
|
|
8269
|
-
|
|
8271
|
+
const {
|
|
8272
|
+
provider,
|
|
8273
|
+
apiKey,
|
|
8274
|
+
messages,
|
|
8275
|
+
tools,
|
|
8276
|
+
parser,
|
|
8277
|
+
thinkingSpeed,
|
|
8278
|
+
cwd,
|
|
8279
|
+
executablePath
|
|
8280
|
+
} = opts;
|
|
8281
|
+
const model = await getModel(provider, apiKey, cwd, executablePath);
|
|
8270
8282
|
const providerOptions = getProviderOptions(provider, thinkingSpeed);
|
|
8271
8283
|
console.log(`Calling ${provider} with options:`, providerOptions);
|
|
8272
8284
|
const result = (0, import_ai.streamText)({
|