aieo 0.1.23 → 0.1.24
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 +39 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +38 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -35,13 +35,15 @@ __export(index_exports, {
|
|
|
35
35
|
OUTRO: () => OUTRO,
|
|
36
36
|
PROVIDERS: () => PROVIDERS,
|
|
37
37
|
SYSTEM: () => SYSTEM,
|
|
38
|
+
callGenerateObject: () => callGenerateObject,
|
|
38
39
|
callModel: () => callModel,
|
|
40
|
+
getApiKeyForProvider: () => getApiKeyForProvider,
|
|
39
41
|
getModel: () => getModel,
|
|
40
42
|
getProviderOptions: () => getProviderOptions
|
|
41
43
|
});
|
|
42
44
|
module.exports = __toCommonJS(index_exports);
|
|
43
45
|
|
|
44
|
-
//
|
|
46
|
+
// ../../node_modules/uuid/dist/esm/stringify.js
|
|
45
47
|
var byteToHex = [];
|
|
46
48
|
for (let i = 0; i < 256; ++i) {
|
|
47
49
|
byteToHex.push((i + 256).toString(16).slice(1));
|
|
@@ -50,7 +52,7 @@ function unsafeStringify(arr, offset = 0) {
|
|
|
50
52
|
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
51
53
|
}
|
|
52
54
|
|
|
53
|
-
//
|
|
55
|
+
// ../../node_modules/uuid/dist/esm/rng.js
|
|
54
56
|
var import_crypto = require("crypto");
|
|
55
57
|
var rnds8Pool = new Uint8Array(256);
|
|
56
58
|
var poolPtr = rnds8Pool.length;
|
|
@@ -62,11 +64,11 @@ function rng() {
|
|
|
62
64
|
return rnds8Pool.slice(poolPtr, poolPtr += 16);
|
|
63
65
|
}
|
|
64
66
|
|
|
65
|
-
//
|
|
67
|
+
// ../../node_modules/uuid/dist/esm/native.js
|
|
66
68
|
var import_crypto2 = require("crypto");
|
|
67
69
|
var native_default = { randomUUID: import_crypto2.randomUUID };
|
|
68
70
|
|
|
69
|
-
//
|
|
71
|
+
// ../../node_modules/uuid/dist/esm/v4.js
|
|
70
72
|
function v4(options, buf, offset) {
|
|
71
73
|
if (native_default.randomUUID && !buf && !options) {
|
|
72
74
|
return native_default.randomUUID();
|
|
@@ -8192,9 +8194,30 @@ var PROVIDERS = [
|
|
|
8192
8194
|
var SOTA = {
|
|
8193
8195
|
anthropic: "claude-4-sonnet-20250514",
|
|
8194
8196
|
google: "gemini-2.5-pro-preview-05-06",
|
|
8195
|
-
openai: "gpt-
|
|
8197
|
+
openai: "gpt-5",
|
|
8196
8198
|
claude_code: "sonnet"
|
|
8197
8199
|
};
|
|
8200
|
+
function getApiKeyForProvider(provider) {
|
|
8201
|
+
let apiKey;
|
|
8202
|
+
switch (provider) {
|
|
8203
|
+
case "anthropic":
|
|
8204
|
+
apiKey = process.env.ANTHROPIC_API_KEY;
|
|
8205
|
+
break;
|
|
8206
|
+
case "google":
|
|
8207
|
+
apiKey = process.env.GOOGLE_API_KEY;
|
|
8208
|
+
break;
|
|
8209
|
+
case "openai":
|
|
8210
|
+
apiKey = process.env.OPENAI_API_KEY;
|
|
8211
|
+
break;
|
|
8212
|
+
case "claude_code":
|
|
8213
|
+
apiKey = process.env.CLAUDE_CODE_API_KEY;
|
|
8214
|
+
break;
|
|
8215
|
+
}
|
|
8216
|
+
if (!apiKey) {
|
|
8217
|
+
throw new Error(`API key not found for provider: ${provider}`);
|
|
8218
|
+
}
|
|
8219
|
+
return apiKey;
|
|
8220
|
+
}
|
|
8198
8221
|
async function getModel(provider, apiKey, cwd, executablePath) {
|
|
8199
8222
|
switch (provider) {
|
|
8200
8223
|
case "anthropic":
|
|
@@ -8303,6 +8326,15 @@ async function callModel(opts) {
|
|
|
8303
8326
|
}
|
|
8304
8327
|
return fullResponse;
|
|
8305
8328
|
}
|
|
8329
|
+
async function callGenerateObject(args) {
|
|
8330
|
+
const model = await getModel(args.provider, args.apiKey);
|
|
8331
|
+
const { object } = await (0, import_ai.generateObject)({
|
|
8332
|
+
model,
|
|
8333
|
+
schema: args.schema,
|
|
8334
|
+
prompt: args.prompt
|
|
8335
|
+
});
|
|
8336
|
+
return object;
|
|
8337
|
+
}
|
|
8306
8338
|
|
|
8307
8339
|
// src/prompt.ts
|
|
8308
8340
|
var SYSTEM = `You are an expert dev. You are given a codebase and a task. You need to write the code for the task. You can also suggest changes to the codebase if needed.
|
|
@@ -8329,7 +8361,9 @@ Please write all the necessary code to fully implement the feature end-to-end. D
|
|
|
8329
8361
|
OUTRO,
|
|
8330
8362
|
PROVIDERS,
|
|
8331
8363
|
SYSTEM,
|
|
8364
|
+
callGenerateObject,
|
|
8332
8365
|
callModel,
|
|
8366
|
+
getApiKeyForProvider,
|
|
8333
8367
|
getModel,
|
|
8334
8368
|
getProviderOptions
|
|
8335
8369
|
});
|