snow-ai 0.8.6 → 0.8.7
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/bundle/cli.mjs +25 -9
- package/bundle/package.json +1 -1
- package/package.json +1 -1
package/bundle/cli.mjs
CHANGED
|
@@ -157130,6 +157130,7 @@ function convertToResponseInput(messages, includeBuiltinSystemPrompt = true, cus
|
|
|
157130
157130
|
}
|
|
157131
157131
|
}
|
|
157132
157132
|
let systemInstructions;
|
|
157133
|
+
const builtinPrompt = includeBuiltinSystemPrompt ? getSystemPromptForMode(planMode, vulnerabilityHuntingMode, toolSearchDisabled, teamMode) : "";
|
|
157133
157134
|
if (explicitSystemPrompts.length > 0) {
|
|
157134
157135
|
systemInstructions = explicitSystemPrompts.join("\n\n");
|
|
157135
157136
|
if (customSystemPrompts && customSystemPrompts.length > 0) {
|
|
@@ -157137,34 +157138,34 @@ function convertToResponseInput(messages, includeBuiltinSystemPrompt = true, cus
|
|
|
157137
157138
|
|
|
157138
157139
|
${systemInstructions}`;
|
|
157139
157140
|
}
|
|
157140
|
-
if (
|
|
157141
|
+
if (builtinPrompt && !systemInstructions.includes(builtinPrompt)) {
|
|
157141
157142
|
result2.unshift({
|
|
157142
157143
|
type: "message",
|
|
157143
157144
|
role: "user",
|
|
157144
157145
|
content: [
|
|
157145
157146
|
{
|
|
157146
157147
|
type: "input_text",
|
|
157147
|
-
text:
|
|
157148
|
+
text: `<environment_context>${builtinPrompt}</environment_context>`
|
|
157148
157149
|
}
|
|
157149
157150
|
]
|
|
157150
157151
|
});
|
|
157151
157152
|
}
|
|
157152
157153
|
} else if (customSystemPrompts && customSystemPrompts.length > 0) {
|
|
157153
157154
|
systemInstructions = customSystemPrompts.join("\n\n");
|
|
157154
|
-
if (
|
|
157155
|
+
if (builtinPrompt && !systemInstructions.includes(builtinPrompt)) {
|
|
157155
157156
|
result2.unshift({
|
|
157156
157157
|
type: "message",
|
|
157157
157158
|
role: "user",
|
|
157158
157159
|
content: [
|
|
157159
157160
|
{
|
|
157160
157161
|
type: "input_text",
|
|
157161
|
-
text:
|
|
157162
|
+
text: `<environment_context>${builtinPrompt}</environment_context>`
|
|
157162
157163
|
}
|
|
157163
157164
|
]
|
|
157164
157165
|
});
|
|
157165
157166
|
}
|
|
157166
157167
|
} else if (includeBuiltinSystemPrompt) {
|
|
157167
|
-
systemInstructions =
|
|
157168
|
+
systemInstructions = builtinPrompt;
|
|
157168
157169
|
} else {
|
|
157169
157170
|
systemInstructions = "You are a helpful assistant.";
|
|
157170
157171
|
}
|
|
@@ -558376,13 +558377,21 @@ async function fetchAvailableModels(overrideConfig) {
|
|
|
558376
558377
|
const defaultOpenAiBaseUrl = "https://api.openai.com/v1";
|
|
558377
558378
|
const trimmedBaseUrl = config3.baseUrl.replace(/\/$/, "");
|
|
558378
558379
|
const isDefaultBaseUrl = !trimmedBaseUrl || trimmedBaseUrl === defaultOpenAiBaseUrl;
|
|
558380
|
+
const fetchOpenAICompat = async () => fetchOpenAIModels(resolveApiEndpoint(config3.baseUrl, "models", config3.baseUrlMode), config3.apiKey, customHeaders);
|
|
558379
558381
|
switch (config3.requestMethod) {
|
|
558380
558382
|
case "gemini": {
|
|
558381
558383
|
if (!config3.apiKey) {
|
|
558382
558384
|
throw new Error("API key is required for Gemini API");
|
|
558383
558385
|
}
|
|
558384
558386
|
const geminiBaseUrl = isDefaultBaseUrl ? "https://generativelanguage.googleapis.com/v1beta" : trimmedBaseUrl;
|
|
558385
|
-
|
|
558387
|
+
try {
|
|
558388
|
+
models = await fetchGeminiModels(geminiBaseUrl, config3.apiKey);
|
|
558389
|
+
} catch {
|
|
558390
|
+
models = [];
|
|
558391
|
+
}
|
|
558392
|
+
if (models.length === 0) {
|
|
558393
|
+
models = await fetchOpenAICompat();
|
|
558394
|
+
}
|
|
558386
558395
|
break;
|
|
558387
558396
|
}
|
|
558388
558397
|
case "anthropic": {
|
|
@@ -558390,13 +558399,20 @@ async function fetchAvailableModels(overrideConfig) {
|
|
|
558390
558399
|
throw new Error("API key is required for Anthropic API");
|
|
558391
558400
|
}
|
|
558392
558401
|
const anthropicBaseUrl = isDefaultBaseUrl ? "https://api.anthropic.com/v1" : trimmedBaseUrl;
|
|
558393
|
-
|
|
558402
|
+
try {
|
|
558403
|
+
models = await fetchAnthropicModels(anthropicBaseUrl, config3.apiKey, customHeaders);
|
|
558404
|
+
} catch {
|
|
558405
|
+
models = [];
|
|
558406
|
+
}
|
|
558407
|
+
if (models.length === 0) {
|
|
558408
|
+
models = await fetchOpenAICompat();
|
|
558409
|
+
}
|
|
558394
558410
|
break;
|
|
558395
558411
|
}
|
|
558396
558412
|
case "chat":
|
|
558397
558413
|
case "responses":
|
|
558398
558414
|
default:
|
|
558399
|
-
models = await
|
|
558415
|
+
models = await fetchOpenAICompat();
|
|
558400
558416
|
break;
|
|
558401
558417
|
}
|
|
558402
558418
|
return models.sort((a, b) => a.id.localeCompare(b.id));
|
|
@@ -691527,7 +691543,7 @@ var require_package4 = __commonJS({
|
|
|
691527
691543
|
"package.json"(exports2, module2) {
|
|
691528
691544
|
module2.exports = {
|
|
691529
691545
|
name: "snow-ai",
|
|
691530
|
-
version: "0.8.
|
|
691546
|
+
version: "0.8.7",
|
|
691531
691547
|
description: "Agentic coding in your terminal",
|
|
691532
691548
|
license: "MIT",
|
|
691533
691549
|
bin: {
|
package/bundle/package.json
CHANGED