snow-ai 0.7.2 → 0.7.3
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 +26 -59
- package/bundle/package.json +1 -1
- package/package.json +1 -1
package/bundle/cli.mjs
CHANGED
|
@@ -90050,7 +90050,7 @@ __export(chat_exports, {
|
|
|
90050
90050
|
resetOpenAIClient: () => resetOpenAIClient,
|
|
90051
90051
|
validateChatOptions: () => validateChatOptions
|
|
90052
90052
|
});
|
|
90053
|
-
function convertToOpenAIMessages(messages, includeBuiltinSystemPrompt = true, customSystemPromptOverride, planMode = false, vulnerabilityHuntingMode = false, toolSearchDisabled = false) {
|
|
90053
|
+
function convertToOpenAIMessages(messages, includeBuiltinSystemPrompt = true, customSystemPromptOverride, planMode = false, vulnerabilityHuntingMode = false, toolSearchDisabled = false, teamMode = false) {
|
|
90054
90054
|
var _a20;
|
|
90055
90055
|
const customSystemPrompts = customSystemPromptOverride;
|
|
90056
90056
|
let result2 = messages.map((msg) => {
|
|
@@ -90143,7 +90143,7 @@ function convertToOpenAIMessages(messages, includeBuiltinSystemPrompt = true, cu
|
|
|
90143
90143
|
},
|
|
90144
90144
|
{
|
|
90145
90145
|
role: "user",
|
|
90146
|
-
content: getSystemPromptForMode(planMode, vulnerabilityHuntingMode, toolSearchDisabled)
|
|
90146
|
+
content: getSystemPromptForMode(planMode, vulnerabilityHuntingMode, toolSearchDisabled, teamMode)
|
|
90147
90147
|
},
|
|
90148
90148
|
...result2
|
|
90149
90149
|
];
|
|
@@ -90163,7 +90163,7 @@ function convertToOpenAIMessages(messages, includeBuiltinSystemPrompt = true, cu
|
|
|
90163
90163
|
result2 = [
|
|
90164
90164
|
{
|
|
90165
90165
|
role: "system",
|
|
90166
|
-
content: getSystemPromptForMode(planMode, vulnerabilityHuntingMode, toolSearchDisabled)
|
|
90166
|
+
content: getSystemPromptForMode(planMode, vulnerabilityHuntingMode, toolSearchDisabled, teamMode)
|
|
90167
90167
|
},
|
|
90168
90168
|
...result2
|
|
90169
90169
|
];
|
|
@@ -90306,10 +90306,9 @@ async function* createStreamingChatCompletion(options3, abortSignal, onRetry) {
|
|
|
90306
90306
|
// 默认为 true
|
|
90307
90307
|
customSystemPromptContent,
|
|
90308
90308
|
options3.planMode || false,
|
|
90309
|
-
// Pass planMode to use correct system prompt
|
|
90310
90309
|
options3.vulnerabilityHuntingMode || false,
|
|
90311
|
-
|
|
90312
|
-
options3.
|
|
90310
|
+
options3.toolSearchDisabled || false,
|
|
90311
|
+
options3.teamMode || false
|
|
90313
90312
|
),
|
|
90314
90313
|
stream: true,
|
|
90315
90314
|
stream_options: { include_usage: true },
|
|
@@ -90568,7 +90567,7 @@ function toResponseImageUrl(image2) {
|
|
|
90568
90567
|
const mimeType = ((_b14 = image2.mimeType) == null ? void 0 : _b14.trim()) || "image/png";
|
|
90569
90568
|
return `data:${mimeType};base64,${data}`;
|
|
90570
90569
|
}
|
|
90571
|
-
function convertToResponseInput(messages, includeBuiltinSystemPrompt = true, customSystemPromptOverride, planMode = false, vulnerabilityHuntingMode = false, toolSearchDisabled = false) {
|
|
90570
|
+
function convertToResponseInput(messages, includeBuiltinSystemPrompt = true, customSystemPromptOverride, planMode = false, vulnerabilityHuntingMode = false, toolSearchDisabled = false, teamMode = false) {
|
|
90572
90571
|
const customSystemPrompts = customSystemPromptOverride;
|
|
90573
90572
|
const result2 = [];
|
|
90574
90573
|
for (const msg of messages) {
|
|
@@ -90676,13 +90675,13 @@ function convertToResponseInput(messages, includeBuiltinSystemPrompt = true, cus
|
|
|
90676
90675
|
content: [
|
|
90677
90676
|
{
|
|
90678
90677
|
type: "input_text",
|
|
90679
|
-
text: "<environment_context>" + getSystemPromptForMode(planMode, vulnerabilityHuntingMode, toolSearchDisabled) + "</environment_context>"
|
|
90678
|
+
text: "<environment_context>" + getSystemPromptForMode(planMode, vulnerabilityHuntingMode, toolSearchDisabled, teamMode) + "</environment_context>"
|
|
90680
90679
|
}
|
|
90681
90680
|
]
|
|
90682
90681
|
});
|
|
90683
90682
|
}
|
|
90684
90683
|
} else if (includeBuiltinSystemPrompt) {
|
|
90685
|
-
systemInstructions = getSystemPromptForMode(planMode, vulnerabilityHuntingMode, toolSearchDisabled);
|
|
90684
|
+
systemInstructions = getSystemPromptForMode(planMode, vulnerabilityHuntingMode, toolSearchDisabled, teamMode);
|
|
90686
90685
|
} else {
|
|
90687
90686
|
systemInstructions = "You are a helpful assistant.";
|
|
90688
90687
|
}
|
|
@@ -90794,16 +90793,7 @@ async function* createStreamingResponse(options3, abortSignal, onRetry) {
|
|
|
90794
90793
|
}
|
|
90795
90794
|
}
|
|
90796
90795
|
customSystemPromptContent || (customSystemPromptContent = getCustomSystemPromptForConfig(config3));
|
|
90797
|
-
const { input: requestInput, systemInstructions } = convertToResponseInput(
|
|
90798
|
-
options3.messages,
|
|
90799
|
-
options3.includeBuiltinSystemPrompt !== false,
|
|
90800
|
-
// 默认为 true
|
|
90801
|
-
customSystemPromptContent,
|
|
90802
|
-
options3.planMode || false,
|
|
90803
|
-
// Pass planMode to use correct system prompt
|
|
90804
|
-
options3.vulnerabilityHuntingMode || false,
|
|
90805
|
-
options3.toolSearchDisabled || false
|
|
90806
|
-
);
|
|
90796
|
+
const { input: requestInput, systemInstructions } = convertToResponseInput(options3.messages, options3.includeBuiltinSystemPrompt !== false, customSystemPromptContent, options3.planMode || false, options3.vulnerabilityHuntingMode || false, options3.toolSearchDisabled || false, options3.teamMode || false);
|
|
90807
90797
|
const configuredReasoning = getResponsesReasoningConfig();
|
|
90808
90798
|
const configuredVerbosity = getResponsesVerbosityConfig();
|
|
90809
90799
|
yield* withRetryGenerator(async function* () {
|
|
@@ -91078,7 +91068,7 @@ function convertToolsToGemini(tools) {
|
|
|
91078
91068
|
});
|
|
91079
91069
|
return [{ functionDeclarations }];
|
|
91080
91070
|
}
|
|
91081
|
-
function convertToGeminiMessages(messages, includeBuiltinSystemPrompt = true, customSystemPromptOverride, planMode = false, vulnerabilityHuntingMode = false, toolSearchDisabled = false) {
|
|
91071
|
+
function convertToGeminiMessages(messages, includeBuiltinSystemPrompt = true, customSystemPromptOverride, planMode = false, vulnerabilityHuntingMode = false, toolSearchDisabled = false, teamMode = false) {
|
|
91082
91072
|
var _a20;
|
|
91083
91073
|
const customSystemPrompts = customSystemPromptOverride;
|
|
91084
91074
|
let systemInstruction;
|
|
@@ -91219,14 +91209,14 @@ function convertToGeminiMessages(messages, includeBuiltinSystemPrompt = true, cu
|
|
|
91219
91209
|
role: "user",
|
|
91220
91210
|
parts: [
|
|
91221
91211
|
{
|
|
91222
|
-
text: getSystemPromptForMode(planMode, vulnerabilityHuntingMode, toolSearchDisabled)
|
|
91212
|
+
text: getSystemPromptForMode(planMode, vulnerabilityHuntingMode, toolSearchDisabled, teamMode)
|
|
91223
91213
|
}
|
|
91224
91214
|
]
|
|
91225
91215
|
});
|
|
91226
91216
|
}
|
|
91227
91217
|
} else if (!systemInstruction && includeBuiltinSystemPrompt) {
|
|
91228
91218
|
systemInstruction = [
|
|
91229
|
-
getSystemPromptForMode(planMode, vulnerabilityHuntingMode, toolSearchDisabled)
|
|
91219
|
+
getSystemPromptForMode(planMode, vulnerabilityHuntingMode, toolSearchDisabled, teamMode)
|
|
91230
91220
|
];
|
|
91231
91221
|
}
|
|
91232
91222
|
return { systemInstruction, contents };
|
|
@@ -91264,17 +91254,7 @@ async function* createStreamingGeminiCompletion(options3, abortSignal, onRetry)
|
|
|
91264
91254
|
customSystemPromptContent || (customSystemPromptContent = getCustomSystemPromptForConfig(config3));
|
|
91265
91255
|
yield* withRetryGenerator(async function* () {
|
|
91266
91256
|
var _a20, _b14;
|
|
91267
|
-
const { systemInstruction, contents } = convertToGeminiMessages(
|
|
91268
|
-
options3.messages,
|
|
91269
|
-
options3.includeBuiltinSystemPrompt !== false,
|
|
91270
|
-
// 默认为 true
|
|
91271
|
-
customSystemPromptContent,
|
|
91272
|
-
// 传递自定义系统提示词
|
|
91273
|
-
options3.planMode || false,
|
|
91274
|
-
// Pass planMode to use correct system prompt
|
|
91275
|
-
options3.vulnerabilityHuntingMode || false,
|
|
91276
|
-
options3.toolSearchDisabled || false
|
|
91277
|
-
);
|
|
91257
|
+
const { systemInstruction, contents } = convertToGeminiMessages(options3.messages, options3.includeBuiltinSystemPrompt !== false, customSystemPromptContent, options3.planMode || false, options3.vulnerabilityHuntingMode || false, options3.toolSearchDisabled || false, options3.teamMode || false);
|
|
91278
91258
|
const requestBody = {
|
|
91279
91259
|
contents,
|
|
91280
91260
|
systemInstruction: systemInstruction ? { parts: systemInstruction.map((text2) => ({ text: text2 })) } : void 0
|
|
@@ -91626,7 +91606,7 @@ function convertToolsToAnthropic(tools) {
|
|
|
91626
91606
|
});
|
|
91627
91607
|
return convertedTools;
|
|
91628
91608
|
}
|
|
91629
|
-
function convertToAnthropicMessages(messages, includeBuiltinSystemPrompt = true, customSystemPromptOverride, cacheTTL = "5m", disableThinking = false, planMode = false, vulnerabilityHuntingMode = false, toolSearchDisabled = false) {
|
|
91609
|
+
function convertToAnthropicMessages(messages, includeBuiltinSystemPrompt = true, customSystemPromptOverride, cacheTTL = "5m", disableThinking = false, planMode = false, vulnerabilityHuntingMode = false, toolSearchDisabled = false, teamMode = false) {
|
|
91630
91610
|
var _a20;
|
|
91631
91611
|
const customSystemPrompts = customSystemPromptOverride;
|
|
91632
91612
|
let systemContents;
|
|
@@ -91785,7 +91765,7 @@ function convertToAnthropicMessages(messages, includeBuiltinSystemPrompt = true,
|
|
|
91785
91765
|
content: [
|
|
91786
91766
|
{
|
|
91787
91767
|
type: "text",
|
|
91788
|
-
text: getSystemPromptForMode(planMode, vulnerabilityHuntingMode, toolSearchDisabled),
|
|
91768
|
+
text: getSystemPromptForMode(planMode, vulnerabilityHuntingMode, toolSearchDisabled, teamMode),
|
|
91789
91769
|
cache_control: { type: "ephemeral", ttl: cacheTTL }
|
|
91790
91770
|
}
|
|
91791
91771
|
]
|
|
@@ -91793,7 +91773,7 @@ function convertToAnthropicMessages(messages, includeBuiltinSystemPrompt = true,
|
|
|
91793
91773
|
}
|
|
91794
91774
|
} else if (!systemContents && includeBuiltinSystemPrompt) {
|
|
91795
91775
|
systemContents = [
|
|
91796
|
-
getSystemPromptForMode(planMode, vulnerabilityHuntingMode, toolSearchDisabled)
|
|
91776
|
+
getSystemPromptForMode(planMode, vulnerabilityHuntingMode, toolSearchDisabled, teamMode)
|
|
91797
91777
|
];
|
|
91798
91778
|
}
|
|
91799
91779
|
let lastUserMessageIndex = -1;
|
|
@@ -91954,22 +91934,7 @@ async function* createStreamingAnthropicCompletion(options3, abortSignal, onRetr
|
|
|
91954
91934
|
}
|
|
91955
91935
|
}
|
|
91956
91936
|
customSystemPromptContent || (customSystemPromptContent = getCustomSystemPromptForConfig(config3));
|
|
91957
|
-
const { system, messages } = convertToAnthropicMessages(
|
|
91958
|
-
options3.messages,
|
|
91959
|
-
options3.includeBuiltinSystemPrompt !== false,
|
|
91960
|
-
// 默认为 true
|
|
91961
|
-
customSystemPromptContent,
|
|
91962
|
-
// 传递自定义系统提示词
|
|
91963
|
-
config3.anthropicCacheTTL || "5m",
|
|
91964
|
-
// 使用配置的 TTL,默认 5m
|
|
91965
|
-
options3.disableThinking || false,
|
|
91966
|
-
// Strip thinking blocks when thinking is disabled
|
|
91967
|
-
options3.planMode || false,
|
|
91968
|
-
// Use Plan mode system prompt if enabled
|
|
91969
|
-
options3.vulnerabilityHuntingMode || false,
|
|
91970
|
-
// Use Vulnerability Hunting mode system prompt if enabled
|
|
91971
|
-
options3.toolSearchDisabled || false
|
|
91972
|
-
);
|
|
91937
|
+
const { system, messages } = convertToAnthropicMessages(options3.messages, options3.includeBuiltinSystemPrompt !== false, customSystemPromptContent, config3.anthropicCacheTTL || "5m", options3.disableThinking || false, options3.planMode || false, options3.vulnerabilityHuntingMode || false, options3.toolSearchDisabled || false, options3.teamMode || false);
|
|
91973
91938
|
const userId = getPersistentUserId();
|
|
91974
91939
|
const requestBody = {
|
|
91975
91940
|
model: options3.model || config3.advancedModel,
|
|
@@ -450080,18 +450045,15 @@ async function generateConfigHash() {
|
|
|
450080
450045
|
const skillTools = await getMCPTools2(projectRoot);
|
|
450081
450046
|
const { loadCodebaseConfig: loadCodebaseConfig2 } = await Promise.resolve().then(() => (init_codebaseConfig(), codebaseConfig_exports));
|
|
450082
450047
|
const codebaseConfig = loadCodebaseConfig2();
|
|
450048
|
+
const { getTeamMode: getTeamMode2 } = await Promise.resolve().then(() => (init_projectSettings(), projectSettings_exports));
|
|
450083
450049
|
return JSON.stringify({
|
|
450084
450050
|
mcpServers: mcpConfig.mcpServers,
|
|
450085
450051
|
subAgents: subAgents.map((t) => t.name),
|
|
450086
|
-
// Only track agent names for hash
|
|
450087
450052
|
skills: skillTools.map((t) => t.name),
|
|
450088
|
-
// Include skill names in hash
|
|
450089
450053
|
codebaseEnabled: codebaseConfig.enabled,
|
|
450090
|
-
// 🔥 Must include to invalidate cache on enable/disable
|
|
450091
450054
|
disabledBuiltInServices: getDisabledBuiltInServices(),
|
|
450092
|
-
|
|
450093
|
-
|
|
450094
|
-
// Include disabled skills in hash
|
|
450055
|
+
disabledSkills: getDisabledSkills(),
|
|
450056
|
+
teamMode: getTeamMode2()
|
|
450095
450057
|
});
|
|
450096
450058
|
} catch {
|
|
450097
450059
|
return "";
|
|
@@ -459153,6 +459115,7 @@ function createStreamGenerator(options3) {
|
|
|
459153
459115
|
disableThinking: options3.useBasicModel,
|
|
459154
459116
|
planMode: options3.planMode,
|
|
459155
459117
|
vulnerabilityHuntingMode: options3.vulnerabilityHuntingMode,
|
|
459118
|
+
teamMode: options3.teamMode,
|
|
459156
459119
|
toolSearchDisabled: options3.toolSearchDisabled
|
|
459157
459120
|
}, signal, onRetry);
|
|
459158
459121
|
}
|
|
@@ -459164,6 +459127,7 @@ function createStreamGenerator(options3) {
|
|
|
459164
459127
|
tools,
|
|
459165
459128
|
planMode: options3.planMode,
|
|
459166
459129
|
vulnerabilityHuntingMode: options3.vulnerabilityHuntingMode,
|
|
459130
|
+
teamMode: options3.teamMode,
|
|
459167
459131
|
toolSearchDisabled: options3.toolSearchDisabled
|
|
459168
459132
|
}, signal, onRetry);
|
|
459169
459133
|
}
|
|
@@ -459178,6 +459142,7 @@ function createStreamGenerator(options3) {
|
|
|
459178
459142
|
reasoning: options3.useBasicModel ? null : void 0,
|
|
459179
459143
|
planMode: options3.planMode,
|
|
459180
459144
|
vulnerabilityHuntingMode: options3.vulnerabilityHuntingMode,
|
|
459145
|
+
teamMode: options3.teamMode,
|
|
459181
459146
|
toolSearchDisabled: options3.toolSearchDisabled
|
|
459182
459147
|
}, signal, onRetry);
|
|
459183
459148
|
}
|
|
@@ -459188,6 +459153,7 @@ function createStreamGenerator(options3) {
|
|
|
459188
459153
|
tools,
|
|
459189
459154
|
planMode: options3.planMode,
|
|
459190
459155
|
vulnerabilityHuntingMode: options3.vulnerabilityHuntingMode,
|
|
459156
|
+
teamMode: options3.teamMode,
|
|
459191
459157
|
toolSearchDisabled: options3.toolSearchDisabled
|
|
459192
459158
|
}, signal, onRetry);
|
|
459193
459159
|
}
|
|
@@ -459363,6 +459329,7 @@ async function processStreamRound(ctx) {
|
|
|
459363
459329
|
useBasicModel: options3.useBasicModel,
|
|
459364
459330
|
planMode: options3.planMode,
|
|
459365
459331
|
vulnerabilityHuntingMode: options3.vulnerabilityHuntingMode,
|
|
459332
|
+
teamMode: options3.teamMode,
|
|
459366
459333
|
toolSearchDisabled: options3.toolSearchDisabled,
|
|
459367
459334
|
signal: controller.signal,
|
|
459368
459335
|
onRetry
|
|
@@ -596923,7 +596890,7 @@ var require_package3 = __commonJS({
|
|
|
596923
596890
|
"package.json"(exports2, module2) {
|
|
596924
596891
|
module2.exports = {
|
|
596925
596892
|
name: "snow-ai",
|
|
596926
|
-
version: "0.7.
|
|
596893
|
+
version: "0.7.3",
|
|
596927
596894
|
description: "Agentic coding in your terminal",
|
|
596928
596895
|
license: "MIT",
|
|
596929
596896
|
bin: {
|
package/bundle/package.json
CHANGED