snow-ai 0.7.23 → 0.7.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/bundle/cli.mjs +176 -48
- package/bundle/package.json +1 -1
- package/package.json +1 -1
package/bundle/cli.mjs
CHANGED
|
@@ -180789,7 +180789,7 @@ var init_en = __esm({
|
|
|
180789
180789
|
connecting: "Connecting...",
|
|
180790
180790
|
connectSuccess: "Connected to {label}",
|
|
180791
180791
|
connectError: "Failed to connect: {error}",
|
|
180792
|
-
unmatchedIDEs: "The
|
|
180792
|
+
unmatchedIDEs: "The above {count} IDE(s) have workspaces that do not match the current directory. Selecting one will switch the working directory.",
|
|
180793
180793
|
unmatchedHeader: "\u2014 Switch working directory \u2014",
|
|
180794
180794
|
switchWorkdirMark: " (switch cwd)",
|
|
180795
180795
|
switchWorkdirError: "Failed to switch working directory: {error}"
|
|
@@ -181083,6 +181083,7 @@ var init_en = __esm({
|
|
|
181083
181083
|
assistantMessage: "Assistant",
|
|
181084
181084
|
commandMessage: "Command",
|
|
181085
181085
|
discontinuedMessage: "\u2514\u2500 user discontinue",
|
|
181086
|
+
aiCompletionTimeMessage: "\u2514\u2500 AI finished at {time}",
|
|
181086
181087
|
// File operations
|
|
181087
181088
|
fileCreated: "Created",
|
|
181088
181089
|
fileModified: "Modified",
|
|
@@ -182505,7 +182506,7 @@ var init_zh = __esm({
|
|
|
182505
182506
|
connecting: "\u6B63\u5728\u8FDE\u63A5...",
|
|
182506
182507
|
connectSuccess: "\u5DF2\u8FDE\u63A5\u5230 {label}",
|
|
182507
182508
|
connectError: "\u8FDE\u63A5\u5931\u8D25\uFF1A{error}",
|
|
182508
|
-
unmatchedIDEs: "\
|
|
182509
|
+
unmatchedIDEs: "\u4E0A\u8FF0 {count} \u4E2A IDE \u7684\u5DE5\u4F5C\u533A\u4E0E\u5F53\u524D\u76EE\u5F55\u4E0D\u5339\u914D\uFF0C\u9009\u62E9\u540E\u5C06\u81EA\u52A8\u5207\u6362\u5DE5\u4F5C\u76EE\u5F55\u3002",
|
|
182509
182510
|
unmatchedHeader: "\u2014 \u5207\u6362\u5DE5\u4F5C\u76EE\u5F55 \u2014",
|
|
182510
182511
|
switchWorkdirMark: " (\u5207\u6362\u5DE5\u4F5C\u76EE\u5F55)",
|
|
182511
182512
|
switchWorkdirError: "\u5207\u6362\u5DE5\u4F5C\u76EE\u5F55\u5931\u8D25\uFF1A{error}"
|
|
@@ -182799,6 +182800,7 @@ var init_zh = __esm({
|
|
|
182799
182800
|
assistantMessage: "\u52A9\u624B",
|
|
182800
182801
|
commandMessage: "\u547D\u4EE4",
|
|
182801
182802
|
discontinuedMessage: "\u2514\u2500 \u7528\u6237\u4E2D\u65AD",
|
|
182803
|
+
aiCompletionTimeMessage: "\u2514\u2500 AI \u7ED3\u675F\u65F6\u95F4\uFF1A{time}",
|
|
182802
182804
|
// File operations
|
|
182803
182805
|
fileCreated: "\u5DF2\u521B\u5EFA",
|
|
182804
182806
|
fileModified: "\u5DF2\u4FEE\u6539",
|
|
@@ -184220,7 +184222,7 @@ var init_zh_TW = __esm({
|
|
|
184220
184222
|
connecting: "\u6B63\u5728\u9023\u7DDA...",
|
|
184221
184223
|
connectSuccess: "\u5DF2\u9023\u7DDA\u81F3 {label}",
|
|
184222
184224
|
connectError: "\u9023\u7DDA\u5931\u6557\uFF1A{error}",
|
|
184223
|
-
unmatchedIDEs: "\
|
|
184225
|
+
unmatchedIDEs: "\u4E0A\u8FF0 {count} \u500B IDE \u7684\u5DE5\u4F5C\u5340\u8207\u76EE\u524D\u76EE\u9304\u4E0D\u76F8\u7B26\uFF0C\u9078\u64C7\u5F8C\u5C07\u81EA\u52D5\u5207\u63DB\u5DE5\u4F5C\u76EE\u9304\u3002",
|
|
184224
184226
|
unmatchedHeader: "\u2014 \u5207\u63DB\u5DE5\u4F5C\u76EE\u9304 \u2014",
|
|
184225
184227
|
switchWorkdirMark: " (\u5207\u63DB\u5DE5\u4F5C\u76EE\u9304)",
|
|
184226
184228
|
switchWorkdirError: "\u5207\u63DB\u5DE5\u4F5C\u76EE\u9304\u5931\u6557\uFF1A{error}"
|
|
@@ -184514,6 +184516,7 @@ var init_zh_TW = __esm({
|
|
|
184514
184516
|
assistantMessage: "\u52A9\u624B",
|
|
184515
184517
|
commandMessage: "\u547D\u4EE4",
|
|
184516
184518
|
discontinuedMessage: "\u2514\u2500 \u4F7F\u7528\u8005\u4E2D\u65B7",
|
|
184519
|
+
aiCompletionTimeMessage: "\u2514\u2500 AI \u7D50\u675F\u6642\u9593\uFF1A{time}",
|
|
184517
184520
|
// File operations
|
|
184518
184521
|
fileCreated: "\u5DF2\u5EFA\u7ACB",
|
|
184519
184522
|
fileModified: "\u5DF2\u4FEE\u6539",
|
|
@@ -448739,6 +448742,7 @@ var init_subAgentToolApproval = __esm({
|
|
|
448739
448742
|
// dist/utils/execution/subAgentExecutor.js
|
|
448740
448743
|
async function executeSubAgent(agentId, prompt, onMessage, abortSignal, requestToolConfirmation, isToolAutoApproved, yoloMode, addToAlwaysApproved, requestUserQuestion, instanceId, spawnDepth = 0) {
|
|
448741
448744
|
var _a20;
|
|
448745
|
+
let ctx;
|
|
448742
448746
|
try {
|
|
448743
448747
|
const { agent, error: resolveError } = await resolveAgent(agentId);
|
|
448744
448748
|
if (!agent) {
|
|
@@ -448755,7 +448759,7 @@ async function executeSubAgent(agentId, prompt, onMessage, abortSignal, requestT
|
|
|
448755
448759
|
}
|
|
448756
448760
|
injectBuiltinTools(allowedTools, spawnDepth);
|
|
448757
448761
|
const messages = await buildInitialMessages(agent, prompt, instanceId, spawnDepth);
|
|
448758
|
-
|
|
448762
|
+
ctx = {
|
|
448759
448763
|
agent,
|
|
448760
448764
|
instanceId,
|
|
448761
448765
|
messages,
|
|
@@ -448844,6 +448848,13 @@ async function executeSubAgent(agentId, prompt, onMessage, abortSignal, requestT
|
|
|
448844
448848
|
result: "",
|
|
448845
448849
|
error: error40 instanceof Error ? error40.message : "Unknown error"
|
|
448846
448850
|
};
|
|
448851
|
+
} finally {
|
|
448852
|
+
if (ctx) {
|
|
448853
|
+
try {
|
|
448854
|
+
emitSubAgentMessage(ctx, { type: "done" });
|
|
448855
|
+
} catch {
|
|
448856
|
+
}
|
|
448857
|
+
}
|
|
448847
448858
|
}
|
|
448848
448859
|
}
|
|
448849
448860
|
function injectPendingMessages(ctx) {
|
|
@@ -450486,9 +450497,7 @@ ${role ? `Your role: ${role}` : ""}
|
|
|
450486
450497
|
**IMPORTANT**: You are in plan-approval mode. You must submit your plan via \`request_plan_approval\` and wait for approval before making any file changes.`;
|
|
450487
450498
|
}
|
|
450488
450499
|
const finalPrompt = `${prompt}${teamContext}`;
|
|
450489
|
-
const messages = [
|
|
450490
|
-
{ role: "user", content: finalPrompt }
|
|
450491
|
-
];
|
|
450500
|
+
const messages = [{ role: "user", content: finalPrompt }];
|
|
450492
450501
|
let finalResponse = "";
|
|
450493
450502
|
let totalUsage;
|
|
450494
450503
|
let latestTotalTokens = 0;
|
|
@@ -450541,7 +450550,20 @@ ${msg.content}`
|
|
|
450541
450550
|
const config3 = getSnowConfig2();
|
|
450542
450551
|
const model = config3.advancedModel || "gpt-5";
|
|
450543
450552
|
const currentSession = sessionManager2.getCurrentSession();
|
|
450544
|
-
const stream = config3.requestMethod === "anthropic" ? createStreamingAnthropicCompletion2({
|
|
450553
|
+
const stream = config3.requestMethod === "anthropic" ? createStreamingAnthropicCompletion2({
|
|
450554
|
+
model,
|
|
450555
|
+
messages,
|
|
450556
|
+
temperature: 0,
|
|
450557
|
+
max_tokens: config3.maxTokens || 4096,
|
|
450558
|
+
tools: allowedTools,
|
|
450559
|
+
sessionId: currentSession == null ? void 0 : currentSession.id
|
|
450560
|
+
}, abortSignal) : config3.requestMethod === "gemini" ? createStreamingGeminiCompletion2({ model, messages, temperature: 0, tools: allowedTools }, abortSignal) : config3.requestMethod === "responses" ? createStreamingResponse2({
|
|
450561
|
+
model,
|
|
450562
|
+
messages,
|
|
450563
|
+
temperature: 0,
|
|
450564
|
+
tools: allowedTools,
|
|
450565
|
+
prompt_cache_key: currentSession == null ? void 0 : currentSession.id
|
|
450566
|
+
}, abortSignal) : createStreamingChatCompletion2({ model, messages, temperature: 0, tools: allowedTools }, abortSignal);
|
|
450545
450567
|
let currentContent = "";
|
|
450546
450568
|
let toolCalls = [];
|
|
450547
450569
|
let currentThinking;
|
|
@@ -450655,7 +450677,11 @@ ${msg.content}`
|
|
|
450655
450677
|
let compressionResult;
|
|
450656
450678
|
for (let retryAttempt = 0; retryAttempt <= COMPRESS_MAX_RETRIES; retryAttempt++) {
|
|
450657
450679
|
try {
|
|
450658
|
-
compressionResult = await compressSubAgentContext2(messages, latestTotalTokens, config3.maxContextTokens, {
|
|
450680
|
+
compressionResult = await compressSubAgentContext2(messages, latestTotalTokens, config3.maxContextTokens, {
|
|
450681
|
+
model,
|
|
450682
|
+
requestMethod: config3.requestMethod,
|
|
450683
|
+
maxTokens: config3.maxTokens
|
|
450684
|
+
});
|
|
450659
450685
|
break;
|
|
450660
450686
|
} catch (retryError) {
|
|
450661
450687
|
if (retryAttempt < COMPRESS_MAX_RETRIES) {
|
|
@@ -450919,7 +450945,11 @@ ${msgSummary}`;
|
|
|
450919
450945
|
const aHook = await unifiedHooksExecutor.executeHooks("afterToolCall", {
|
|
450920
450946
|
toolName: tc.function.name,
|
|
450921
450947
|
args: toolArgs,
|
|
450922
|
-
result: {
|
|
450948
|
+
result: {
|
|
450949
|
+
tool_call_id: tc.id,
|
|
450950
|
+
role: "tool",
|
|
450951
|
+
content: resultContent
|
|
450952
|
+
},
|
|
450923
450953
|
error: null
|
|
450924
450954
|
});
|
|
450925
450955
|
const aInterp = interpretHookResult("afterToolCall", aHook);
|
|
@@ -450946,7 +450976,11 @@ ${msgSummary}`;
|
|
|
450946
450976
|
await unifiedHooksExecutor.executeHooks("afterToolCall", {
|
|
450947
450977
|
toolName: tc.function.name,
|
|
450948
450978
|
args: {},
|
|
450949
|
-
result: {
|
|
450979
|
+
result: {
|
|
450980
|
+
tool_call_id: tc.id,
|
|
450981
|
+
role: "tool",
|
|
450982
|
+
content: errorContent
|
|
450983
|
+
},
|
|
450950
450984
|
error: e
|
|
450951
450985
|
});
|
|
450952
450986
|
} catch {
|
|
@@ -451020,7 +451054,11 @@ ${msgSummary}`;
|
|
|
451020
451054
|
const aHook = await unifiedHooksExecutor.executeHooks("afterToolCall", {
|
|
451021
451055
|
toolName,
|
|
451022
451056
|
args: toolArgs,
|
|
451023
|
-
result: {
|
|
451057
|
+
result: {
|
|
451058
|
+
tool_call_id: tc.id,
|
|
451059
|
+
role: "tool",
|
|
451060
|
+
content: resultContent
|
|
451061
|
+
},
|
|
451024
451062
|
error: null
|
|
451025
451063
|
});
|
|
451026
451064
|
const aInterp = interpretHookResult("afterToolCall", aHook);
|
|
@@ -451047,7 +451085,11 @@ ${msgSummary}`;
|
|
|
451047
451085
|
await unifiedHooksExecutor.executeHooks("afterToolCall", {
|
|
451048
451086
|
toolName,
|
|
451049
451087
|
args: toolArgs,
|
|
451050
|
-
result: {
|
|
451088
|
+
result: {
|
|
451089
|
+
tool_call_id: tc.id,
|
|
451090
|
+
role: "tool",
|
|
451091
|
+
content: errorContent
|
|
451092
|
+
},
|
|
451051
451093
|
error: e
|
|
451052
451094
|
});
|
|
451053
451095
|
} catch {
|
|
@@ -451069,14 +451111,6 @@ ${msgSummary}`;
|
|
|
451069
451111
|
result: finalResponse,
|
|
451070
451112
|
completedAt: /* @__PURE__ */ new Date()
|
|
451071
451113
|
});
|
|
451072
|
-
if (onMessage) {
|
|
451073
|
-
onMessage({
|
|
451074
|
-
type: "sub_agent_message",
|
|
451075
|
-
agentId: `teammate-${memberId}`,
|
|
451076
|
-
agentName: memberName,
|
|
451077
|
-
message: { type: "done" }
|
|
451078
|
-
});
|
|
451079
|
-
}
|
|
451080
451114
|
return {
|
|
451081
451115
|
success: true,
|
|
451082
451116
|
result: finalResponse,
|
|
@@ -451098,12 +451132,26 @@ ${msgSummary}`;
|
|
|
451098
451132
|
error: error40.message
|
|
451099
451133
|
};
|
|
451100
451134
|
} finally {
|
|
451135
|
+
if (onMessage) {
|
|
451136
|
+
try {
|
|
451137
|
+
onMessage({
|
|
451138
|
+
type: "sub_agent_message",
|
|
451139
|
+
agentId: `teammate-${memberId}`,
|
|
451140
|
+
agentName: memberName,
|
|
451141
|
+
message: { type: "done" }
|
|
451142
|
+
});
|
|
451143
|
+
} catch {
|
|
451144
|
+
}
|
|
451145
|
+
}
|
|
451101
451146
|
try {
|
|
451102
451147
|
const { autoCommitWorktreeChanges: autoCommitWorktreeChanges2 } = await Promise.resolve().then(() => (init_teamWorktree(), teamWorktree_exports));
|
|
451103
451148
|
autoCommitWorktreeChanges2(worktreePath, memberName);
|
|
451104
451149
|
} catch {
|
|
451105
451150
|
}
|
|
451106
|
-
updateMember2(teamName, memberId, {
|
|
451151
|
+
updateMember2(teamName, memberId, {
|
|
451152
|
+
status: "shutdown",
|
|
451153
|
+
shutdownAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
451154
|
+
});
|
|
451107
451155
|
teamTracker.unregister(instanceId);
|
|
451108
451156
|
}
|
|
451109
451157
|
}
|
|
@@ -466855,6 +466903,20 @@ __export(sessionConverter_exports, {
|
|
|
466855
466903
|
function cleanThinkingContent3(content) {
|
|
466856
466904
|
return content.replace(/\s*<\/?think(?:ing)?>\s*/gi, "").trim();
|
|
466857
466905
|
}
|
|
466906
|
+
function isValidTimestamp(timestamp) {
|
|
466907
|
+
return typeof timestamp === "number" && Number.isFinite(timestamp);
|
|
466908
|
+
}
|
|
466909
|
+
function appendAiCompletionTimeMessage(uiMessages, timestamp) {
|
|
466910
|
+
if (!isValidTimestamp(timestamp)) {
|
|
466911
|
+
return;
|
|
466912
|
+
}
|
|
466913
|
+
uiMessages.push({
|
|
466914
|
+
role: "assistant",
|
|
466915
|
+
content: "",
|
|
466916
|
+
streaming: false,
|
|
466917
|
+
aiCompletionTime: new Date(timestamp)
|
|
466918
|
+
});
|
|
466919
|
+
}
|
|
466858
466920
|
function convertSessionMessagesToUI(sessionMessages) {
|
|
466859
466921
|
var _a20, _b14;
|
|
466860
466922
|
const uiMessages = [];
|
|
@@ -467227,6 +467289,9 @@ function convertSessionMessagesToUI(sessionMessages) {
|
|
|
467227
467289
|
thinking: extractThinkingFromMessage(msg),
|
|
467228
467290
|
editorContext: msg.role === "user" ? msg.editorContext : void 0
|
|
467229
467291
|
});
|
|
467292
|
+
if (msg.role === "assistant") {
|
|
467293
|
+
appendAiCompletionTimeMessage(uiMessages, msg.timestamp);
|
|
467294
|
+
}
|
|
467230
467295
|
continue;
|
|
467231
467296
|
}
|
|
467232
467297
|
}
|
|
@@ -530999,14 +531064,32 @@ function formatSideBySide(hunk, hunkHeader, columns, hl, addedStyle, removedStyl
|
|
|
530999
531064
|
return sliceAnsi2(str2, 0, width);
|
|
531000
531065
|
return str2 + " ".repeat(width - w);
|
|
531001
531066
|
};
|
|
531067
|
+
const wrapToWidth = (str2, width) => {
|
|
531068
|
+
if (width <= 0)
|
|
531069
|
+
return [""];
|
|
531070
|
+
const total = stringWidth4(str2);
|
|
531071
|
+
if (total === 0)
|
|
531072
|
+
return [" ".repeat(width)];
|
|
531073
|
+
const rows = [];
|
|
531074
|
+
let offset = 0;
|
|
531075
|
+
while (offset < total) {
|
|
531076
|
+
const piece = sliceAnsi2(str2, offset, offset + width);
|
|
531077
|
+
const pieceWidth = stringWidth4(piece);
|
|
531078
|
+
rows.push(pieceWidth >= width ? piece : piece + " ".repeat(width - pieceWidth));
|
|
531079
|
+
if (pieceWidth <= 0)
|
|
531080
|
+
break;
|
|
531081
|
+
offset += pieceWidth;
|
|
531082
|
+
}
|
|
531083
|
+
return rows.length > 0 ? rows : [" ".repeat(width)];
|
|
531084
|
+
};
|
|
531002
531085
|
const headerDash = "-".repeat(Math.max(Math.floor((panelWidth - 5) / 2), 1));
|
|
531003
531086
|
const leftHeader = fitToWidth(source_default.dim(headerDash) + source_default.red.bold(" OLD ") + source_default.dim(headerDash), panelWidth);
|
|
531004
531087
|
const rightHeader = fitToWidth(source_default.dim(headerDash) + source_default.green.bold(" NEW ") + source_default.dim(headerDash), panelWidth);
|
|
531005
|
-
const lines = [
|
|
531006
|
-
hunkHeader,
|
|
531007
|
-
leftHeader + separator + rightHeader
|
|
531008
|
-
];
|
|
531088
|
+
const lines = [hunkHeader, leftHeader + separator + rightHeader];
|
|
531009
531089
|
const emptyPanel = " ".repeat(panelWidth);
|
|
531090
|
+
const prefixWidth = lineNumWidth + 3;
|
|
531091
|
+
const contentWidth = Math.max(panelWidth - prefixWidth, 1);
|
|
531092
|
+
const blankPrefix = " ".repeat(prefixWidth);
|
|
531010
531093
|
for (const pair of pairedLines) {
|
|
531011
531094
|
const leftLineNum = pair.left.lineNum ? String(pair.left.lineNum).padStart(lineNumWidth, " ") : "".padStart(lineNumWidth, " ");
|
|
531012
531095
|
const rightLineNum = pair.right.lineNum ? String(pair.right.lineNum).padStart(lineNumWidth, " ") : "".padStart(lineNumWidth, " ");
|
|
@@ -531014,23 +531097,32 @@ function formatSideBySide(hunk, hunkHeader, columns, hl, addedStyle, removedStyl
|
|
|
531014
531097
|
const rightSign = pair.right.type === "added" ? "+" : pair.right.type === "unchanged" ? " " : " ";
|
|
531015
531098
|
const leftContent = hl(cleanContent(pair.left.content));
|
|
531016
531099
|
const rightContent = hl(cleanContent(pair.right.content));
|
|
531017
|
-
|
|
531018
|
-
|
|
531019
|
-
|
|
531020
|
-
|
|
531021
|
-
|
|
531022
|
-
|
|
531023
|
-
|
|
531024
|
-
|
|
531025
|
-
|
|
531026
|
-
|
|
531027
|
-
|
|
531028
|
-
|
|
531029
|
-
|
|
531030
|
-
|
|
531031
|
-
|
|
531100
|
+
const leftRows = pair.left.type === "empty" ? [""] : wrapToWidth(leftContent, contentWidth);
|
|
531101
|
+
const rightRows = pair.right.type === "empty" ? [""] : wrapToWidth(rightContent, contentWidth);
|
|
531102
|
+
const rowCount = Math.max(leftRows.length, rightRows.length);
|
|
531103
|
+
for (let rowIdx = 0; rowIdx < rowCount; rowIdx++) {
|
|
531104
|
+
const leftPrefix = rowIdx === 0 ? `${leftLineNum} ${leftSign} ` : blankPrefix;
|
|
531105
|
+
const rightPrefix = rowIdx === 0 ? `${rightLineNum} ${rightSign} ` : blankPrefix;
|
|
531106
|
+
const leftRow = leftRows[rowIdx] ?? " ".repeat(contentWidth);
|
|
531107
|
+
const rightRow = rightRows[rowIdx] ?? " ".repeat(contentWidth);
|
|
531108
|
+
let leftStr;
|
|
531109
|
+
if (pair.left.type === "empty") {
|
|
531110
|
+
leftStr = emptyPanel;
|
|
531111
|
+
} else if (pair.left.type === "removed") {
|
|
531112
|
+
leftStr = fitToWidth(removedStyle(leftPrefix + leftRow), panelWidth);
|
|
531113
|
+
} else {
|
|
531114
|
+
leftStr = fitToWidth(dimStyle(leftPrefix + leftRow), panelWidth);
|
|
531115
|
+
}
|
|
531116
|
+
let rightStr;
|
|
531117
|
+
if (pair.right.type === "empty") {
|
|
531118
|
+
rightStr = emptyPanel;
|
|
531119
|
+
} else if (pair.right.type === "added") {
|
|
531120
|
+
rightStr = fitToWidth(addedStyle(rightPrefix + rightRow), panelWidth);
|
|
531121
|
+
} else {
|
|
531122
|
+
rightStr = fitToWidth(dimStyle(rightPrefix + rightRow), panelWidth);
|
|
531123
|
+
}
|
|
531124
|
+
lines.push(leftStr + separator + rightStr);
|
|
531032
531125
|
}
|
|
531033
|
-
lines.push(leftStr + separator + rightStr);
|
|
531034
531126
|
}
|
|
531035
531127
|
return lines.join("\n");
|
|
531036
531128
|
}
|
|
@@ -562901,6 +562993,25 @@ function MessageRenderer({ message, index, filteredMessages, terminalWidth, show
|
|
|
562901
562993
|
const formatCommandResultLines = (content) => {
|
|
562902
562994
|
return getDisplayContent(content).split("\n").map((line, index2) => `${index2 === 0 ? "\u2514\u2500 " : " "}${line || " "}`);
|
|
562903
562995
|
};
|
|
562996
|
+
const formatAiCompletionTime = (value) => {
|
|
562997
|
+
const date5 = value instanceof Date ? value : new Date(value);
|
|
562998
|
+
if (Number.isNaN(date5.getTime())) {
|
|
562999
|
+
return String(value);
|
|
563000
|
+
}
|
|
563001
|
+
return date5.toLocaleTimeString(void 0, {
|
|
563002
|
+
hour: "2-digit",
|
|
563003
|
+
minute: "2-digit",
|
|
563004
|
+
second: "2-digit"
|
|
563005
|
+
});
|
|
563006
|
+
};
|
|
563007
|
+
if (message.aiCompletionTime) {
|
|
563008
|
+
const completionTime = formatAiCompletionTime(message.aiCompletionTime);
|
|
563009
|
+
return import_react87.default.createElement(
|
|
563010
|
+
Box_default,
|
|
563011
|
+
{ paddingX: 1, width: terminalWidth, marginBottom: 1 },
|
|
563012
|
+
import_react87.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.chatScreen.aiCompletionTimeMessage.replace("{time}", completionTime))
|
|
563013
|
+
);
|
|
563014
|
+
}
|
|
562904
563015
|
let toolStatusColor = "cyan";
|
|
562905
563016
|
const isInParallelGroup = message.parallelGroup !== void 0 && message.parallelGroup !== null;
|
|
562906
563017
|
const isTimeConsumingTool = message.toolPending || message.messageStatus === "pending";
|
|
@@ -575695,6 +575806,17 @@ function useMessageProcessing(props) {
|
|
|
575695
575806
|
(0, import_react134.useEffect)(() => {
|
|
575696
575807
|
yoloModeRef.current = yoloMode;
|
|
575697
575808
|
}, [yoloMode]);
|
|
575809
|
+
const appendAiCompletionTimeMessage2 = () => {
|
|
575810
|
+
setMessages((prev) => [
|
|
575811
|
+
...prev,
|
|
575812
|
+
{
|
|
575813
|
+
role: "assistant",
|
|
575814
|
+
content: "",
|
|
575815
|
+
streaming: false,
|
|
575816
|
+
aiCompletionTime: /* @__PURE__ */ new Date()
|
|
575817
|
+
}
|
|
575818
|
+
]);
|
|
575819
|
+
};
|
|
575698
575820
|
const processMessage = async (message, images, useBasicModel, hideUserMessage) => {
|
|
575699
575821
|
const autoCompressConfig = getSnowConfig();
|
|
575700
575822
|
if (autoCompressConfig.enableAutoCompress !== false && shouldAutoCompress(currentContextPercentageRef.current, autoCompressConfig.autoCompressThreshold ?? DEFAULT_AUTO_COMPRESS_THRESHOLD)) {
|
|
@@ -575892,6 +576014,7 @@ function useMessageProcessing(props) {
|
|
|
575892
576014
|
userInterruptedRef.current = false;
|
|
575893
576015
|
streamingState.setIsStopping(false);
|
|
575894
576016
|
}
|
|
576017
|
+
appendAiCompletionTimeMessage2();
|
|
575895
576018
|
streamingState.setIsStreaming(false);
|
|
575896
576019
|
streamingState.setAbortController(null);
|
|
575897
576020
|
streamingState.setStreamTokenCount(0);
|
|
@@ -576055,7 +576178,11 @@ ${messageWithoutTargets}`);
|
|
|
576055
576178
|
const { unifiedHooksExecutor: unifiedHooksExecutor2 } = await Promise.resolve().then(() => (init_unifiedHooksExecutor(), unifiedHooksExecutor_exports));
|
|
576056
576179
|
const { interpretHookResult: interpretHookResult2 } = await Promise.resolve().then(() => (init_hookResultInterpreter(), hookResultInterpreter_exports));
|
|
576057
576180
|
const allImages2 = messagesToProcess.flatMap((m) => m.images || []);
|
|
576058
|
-
const hookResult = await unifiedHooksExecutor2.executeHooks("onUserMessage", {
|
|
576181
|
+
const hookResult = await unifiedHooksExecutor2.executeHooks("onUserMessage", {
|
|
576182
|
+
message: combinedMessage,
|
|
576183
|
+
imageCount: allImages2.length,
|
|
576184
|
+
source: "pending"
|
|
576185
|
+
});
|
|
576059
576186
|
const interpreted = interpretHookResult2("onUserMessage", hookResult, combinedMessage);
|
|
576060
576187
|
if (interpreted.action === "block" && interpreted.errorDetails) {
|
|
576061
576188
|
setMessages((prev) => [
|
|
@@ -576195,6 +576322,7 @@ ${messageWithoutTargets}`);
|
|
|
576195
576322
|
userInterruptedRef.current = false;
|
|
576196
576323
|
streamingState.setIsStopping(false);
|
|
576197
576324
|
}
|
|
576325
|
+
appendAiCompletionTimeMessage2();
|
|
576198
576326
|
streamingState.setIsStreaming(false);
|
|
576199
576327
|
streamingState.setAbortController(null);
|
|
576200
576328
|
streamingState.setStreamTokenCount(0);
|
|
@@ -590816,7 +590944,7 @@ function AppContent({ version: version4, skipWelcome, autoResume, resumeSessionI
|
|
|
590816
590944
|
const [currentView, setCurrentView] = (0, import_react190.useState)(skipWelcome ? "chat" : "welcome");
|
|
590817
590945
|
const [chatScreenKey, setChatScreenKey] = (0, import_react190.useState)(0);
|
|
590818
590946
|
const [welcomeMenuIndex, setWelcomeMenuIndex] = (0, import_react190.useState)(0);
|
|
590819
|
-
const [
|
|
590947
|
+
const [welcomeChatAutoResume, setWelcomeChatAutoResume] = (0, import_react190.useState)(null);
|
|
590820
590948
|
const [exitNotification, setExitNotification] = (0, import_react190.useState)({
|
|
590821
590949
|
show: false,
|
|
590822
590950
|
message: ""
|
|
@@ -590829,7 +590957,7 @@ function AppContent({ version: version4, skipWelcome, autoResume, resumeSessionI
|
|
|
590829
590957
|
setChatScreenKey((prev) => prev + 1);
|
|
590830
590958
|
}
|
|
590831
590959
|
if (event.destination !== "chat" && currentView === "chat") {
|
|
590832
|
-
|
|
590960
|
+
setWelcomeChatAutoResume(null);
|
|
590833
590961
|
}
|
|
590834
590962
|
if (event.destination !== "pixel") {
|
|
590835
590963
|
setCurrentView(event.destination);
|
|
@@ -590843,7 +590971,7 @@ function AppContent({ version: version4, skipWelcome, autoResume, resumeSessionI
|
|
|
590843
590971
|
setChatScreenKey((prev) => prev + 1);
|
|
590844
590972
|
loadConfig();
|
|
590845
590973
|
}
|
|
590846
|
-
|
|
590974
|
+
setWelcomeChatAutoResume(value === "resume-last");
|
|
590847
590975
|
setCurrentView(value === "resume-last" ? "chat" : value);
|
|
590848
590976
|
} else if (value === "exit") {
|
|
590849
590977
|
setCurrentView("exit");
|
|
@@ -590862,7 +590990,7 @@ function AppContent({ version: version4, skipWelcome, autoResume, resumeSessionI
|
|
|
590862
590990
|
return import_react190.default.createElement(
|
|
590863
590991
|
import_react190.Suspense,
|
|
590864
590992
|
{ fallback: loadingFallback },
|
|
590865
|
-
import_react190.default.createElement(ChatScreen2, { key: chatScreenKey, autoResume:
|
|
590993
|
+
import_react190.default.createElement(ChatScreen2, { key: chatScreenKey, autoResume: welcomeChatAutoResume ?? autoResume, resumeSessionId: resumeSessionId2, enableYolo, enablePlan })
|
|
590866
590994
|
);
|
|
590867
590995
|
case "settings":
|
|
590868
590996
|
return import_react190.default.createElement(
|
|
@@ -605899,7 +606027,7 @@ var require_package3 = __commonJS({
|
|
|
605899
606027
|
"package.json"(exports2, module2) {
|
|
605900
606028
|
module2.exports = {
|
|
605901
606029
|
name: "snow-ai",
|
|
605902
|
-
version: "0.7.
|
|
606030
|
+
version: "0.7.24",
|
|
605903
606031
|
description: "Agentic coding in your terminal",
|
|
605904
606032
|
license: "MIT",
|
|
605905
606033
|
bin: {
|
package/bundle/package.json
CHANGED