snow-ai 0.6.3 → 0.6.5

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 CHANGED
@@ -43215,8 +43215,8 @@ async function executeCommand(commandName, args2) {
43215
43215
  const handler = commandHandlers[commandName];
43216
43216
  if (!handler) {
43217
43217
  return {
43218
- success: false,
43219
- message: `Unknown command: ${commandName}`
43218
+ success: true,
43219
+ action: "sendAsMessage"
43220
43220
  };
43221
43221
  }
43222
43222
  try {
@@ -81046,7 +81046,7 @@ var init_en = __esm({
81046
81046
  toolRejected: "\u2717 Rejected",
81047
81047
  // Parallel execution
81048
81048
  parallelStart: "\u250C\u2500 Parallel execution",
81049
- parallelEnd: "\u2514\u2500 End parallel execution",
81049
+ parallelEnd: "\u2514\u2500 Execution completed",
81050
81050
  // Messages
81051
81051
  userMessage: "You",
81052
81052
  assistantMessage: "Assistant",
@@ -82132,7 +82132,7 @@ var init_zh = __esm({
82132
82132
  toolRejected: "\u2717 \u5DF2\u62D2\u7EDD",
82133
82133
  // Parallel execution
82134
82134
  parallelStart: "\u250C\u2500 \u5E76\u884C\u6267\u884C",
82135
- parallelEnd: "\u2514\u2500 \u7ED3\u675F\u5E76\u884C\u6267\u884C",
82135
+ parallelEnd: "\u2514\u2500 \u6267\u884C\u5B8C\u6210",
82136
82136
  // Messages
82137
82137
  userMessage: "\u4F60",
82138
82138
  assistantMessage: "\u52A9\u624B",
@@ -83218,7 +83218,7 @@ var init_zh_TW = __esm({
83218
83218
  toolRejected: "\u2717 \u5DF2\u62D2\u7D55",
83219
83219
  // Parallel execution
83220
83220
  parallelStart: "\u250C\u2500 \u4E26\u884C\u57F7\u884C",
83221
- parallelEnd: "\u2514\u2500 \u7D50\u675F\u4E26\u884C\u57F7\u884C",
83221
+ parallelEnd: "\u2514\u2500 \u57F7\u884C\u5B8C\u6210",
83222
83222
  // Messages
83223
83223
  userMessage: "\u4F60",
83224
83224
  assistantMessage: "\u52A9\u624B",
@@ -536474,8 +536474,8 @@ function MessageRenderer({ message, index, isLastMessage, filteredMessages, term
536474
536474
  const isFirstInGroup = shouldShowParallelIndicator && (index === 0 || ((_a21 = filteredMessages[index - 1]) == null ? void 0 : _a21.parallelGroup) !== message.parallelGroup || // Previous message is time-consuming tool, so this is the first non-time-consuming one
536475
536475
  ((_b14 = filteredMessages[index - 1]) == null ? void 0 : _b14.toolPending) || ((_c6 = filteredMessages[index - 1]) == null ? void 0 : _c6.messageStatus) === "pending");
536476
536476
  const nextMessage = filteredMessages[index + 1];
536477
- const nextHasDifferentGroup = nextMessage && nextMessage.parallelGroup !== void 0 && nextMessage.parallelGroup !== null && nextMessage.parallelGroup !== message.parallelGroup;
536478
- const isLastInGroup = shouldShowParallelIndicator && (!nextMessage || nextHasDifferentGroup);
536477
+ const nextInSameGroup = nextMessage && nextMessage.parallelGroup !== void 0 && nextMessage.parallelGroup !== null && nextMessage.parallelGroup === message.parallelGroup;
536478
+ const isLastInGroup = shouldShowParallelIndicator && !nextInSameGroup;
536479
536479
  if (message.role === "assistant" || message.role === "subagent") {
536480
536480
  if (message.messageStatus === "pending") {
536481
536481
  toolStatusColor = "yellowBright";
@@ -536493,7 +536493,7 @@ function MessageRenderer({ message, index, isLastMessage, filteredMessages, term
536493
536493
  isFirstInGroup && import_react77.default.createElement(
536494
536494
  Box_default,
536495
536495
  { marginBottom: 0 },
536496
- import_react77.default.createElement(Text, { color: theme14.colors.menuInfo, dimColor: true }, "\u250C\u2500 Parallel execution")
536496
+ import_react77.default.createElement(Text, { color: theme14.colors.menuInfo, dimColor: true }, t.chatScreen.parallelStart)
536497
536497
  ),
536498
536498
  import_react77.default.createElement(
536499
536499
  Box_default,
@@ -536624,7 +536624,7 @@ function MessageRenderer({ message, index, isLastMessage, filteredMessages, term
536624
536624
  !message.plainOutput && isLastInGroup && import_react77.default.createElement(
536625
536625
  Box_default,
536626
536626
  { marginTop: 0 },
536627
- import_react77.default.createElement(Text, { color: theme14.colors.menuInfo, dimColor: true }, "\u2514\u2500 End parallel execution")
536627
+ import_react77.default.createElement(Text, { color: theme14.colors.menuInfo, dimColor: true }, t.chatScreen.parallelEnd)
536628
536628
  )
536629
536629
  ));
536630
536630
  }
@@ -540336,6 +540336,17 @@ function useKeyboardInput(options3) {
540336
540336
  const commandName = commandMatch[1];
540337
540337
  const commandArgs = commandMatch[2];
540338
540338
  executeCommand(commandName, commandArgs).then((result2) => {
540339
+ if (result2.action === "sendAsMessage") {
540340
+ const currentText2 = buffer.text;
540341
+ const allImages2 = buffer.getImages();
540342
+ const validImages2 = allImages2.filter((img) => currentText2.includes(img.placeholder)).map((img) => ({
540343
+ data: img.data,
540344
+ mimeType: img.mimeType
540345
+ }));
540346
+ saveToHistory(message);
540347
+ onSubmit(message, validImages2.length > 0 ? validImages2 : void 0);
540348
+ return;
540349
+ }
540339
540350
  commandUsageManager.recordUsage(commandName);
540340
540351
  if (onCommand) {
540341
540352
  Promise.resolve(onCommand(commandName, result2)).catch((error) => {
@@ -542983,10 +542994,20 @@ function TodoTree({ todos }) {
542983
542994
  }
542984
542995
  const completedCount = todos.filter((t) => t.status === "completed").length;
542985
542996
  const totalCount = todos.length;
542986
- const rootTodos = todos.filter((t) => !t.parentId);
542997
+ const MAX_VISIBLE_COMPLETED = 5;
542998
+ const pendingTodos = todos.filter((t) => t.status === "pending");
542999
+ const completedTodos = todos.filter((t) => t.status === "completed");
543000
+ const visibleCompletedTodos = completedTodos.slice(-MAX_VISIBLE_COMPLETED);
543001
+ const hiddenCompletedCount = completedTodos.length - visibleCompletedTodos.length;
543002
+ const visibleTodoIds = /* @__PURE__ */ new Set([
543003
+ ...pendingTodos.map((t) => t.id),
543004
+ ...visibleCompletedTodos.map((t) => t.id)
543005
+ ]);
543006
+ const visibleTodos = [...pendingTodos, ...visibleCompletedTodos];
543007
+ const rootTodos = visibleTodos.filter((t) => !t.parentId || !visibleTodoIds.has(t.parentId));
542987
543008
  const childTodosMap = /* @__PURE__ */ new Map();
542988
- todos.forEach((todo) => {
542989
- if (todo.parentId) {
543009
+ visibleTodos.forEach((todo) => {
543010
+ if (todo.parentId && visibleTodoIds.has(todo.parentId)) {
542990
543011
  const children = childTodosMap.get(todo.parentId) || [];
542991
543012
  children.push(todo);
542992
543013
  childTodosMap.set(todo.parentId, children);
@@ -543011,20 +543032,19 @@ function TodoTree({ todos }) {
543011
543032
  if (depth > 0) {
543012
543033
  childPrefixes.push(isLast ? " " : "\u2502 ");
543013
543034
  }
543035
+ const applyColor = (text3) => {
543036
+ var _a21, _b14;
543037
+ return statusColor.startsWith("#") ? source_default.hex(statusColor)(text3) : ((_b14 = (_a21 = source_default)[statusColor]) == null ? void 0 : _b14.call(_a21, text3)) ?? text3;
543038
+ };
543014
543039
  return import_react101.default.createElement(
543015
543040
  Box_default,
543016
543041
  { key: todo.id, flexDirection: "column" },
543017
543042
  import_react101.default.createElement(
543018
543043
  Text,
543019
543044
  null,
543020
- import_react101.default.createElement(Text, { dimColor: true }, prefix),
543021
- import_react101.default.createElement(Text, { color: statusColor }, statusIcon),
543022
- import_react101.default.createElement(
543023
- Text,
543024
- { color: statusColor, dimColor: todo.status === "completed" },
543025
- " ",
543026
- todo.content
543027
- )
543045
+ applyColor(prefix),
543046
+ applyColor(statusIcon),
543047
+ applyColor(" " + todo.content)
543028
543048
  ),
543029
543049
  children.map((child, index) => renderTodo(child, depth + 1, index === children.length - 1, childPrefixes))
543030
543050
  );
@@ -543044,6 +543064,13 @@ function TodoTree({ todos }) {
543044
543064
  "/",
543045
543065
  totalCount,
543046
543066
  ")"
543067
+ ),
543068
+ hiddenCompletedCount > 0 && import_react101.default.createElement(
543069
+ Text,
543070
+ { dimColor: true },
543071
+ " +",
543072
+ hiddenCompletedCount,
543073
+ " completed hidden"
543047
543074
  )
543048
543075
  ),
543049
543076
  rootTodos.map((todo, index) => renderTodo(todo, 0, index === rootTodos.length - 1, []))
@@ -543055,6 +543082,7 @@ var init_TodoTree = __esm({
543055
543082
  "use strict";
543056
543083
  import_react101 = __toESM(require_react(), 1);
543057
543084
  await init_build2();
543085
+ init_source();
543058
543086
  init_ThemeContext();
543059
543087
  }
543060
543088
  });
@@ -544101,9 +544129,10 @@ function BashCommandExecutionStatus({ command, timeout: timeout2 = 3e4, terminal
544101
544129
  const timeoutSeconds = Math.round(timeout2 / 1e3);
544102
544130
  const maxCommandWidth = Math.max(40, terminalWidth - 10);
544103
544131
  const displayCommand = truncateCommand2(command, maxCommandWidth);
544132
+ const processedOutput = output2.flatMap((line) => line.split(/\r?\n/)).slice(-5);
544104
544133
  return import_react108.default.createElement(
544105
544134
  Box_default,
544106
- { flexDirection: "column", borderStyle: "round", borderColor: theme14.colors.menuInfo, paddingX: 2, paddingY: 0, width: terminalWidth - 2 },
544135
+ { flexDirection: "column", paddingX: 1 },
544107
544136
  import_react108.default.createElement(
544108
544137
  Box_default,
544109
544138
  null,
@@ -544120,7 +544149,7 @@ function BashCommandExecutionStatus({ command, timeout: timeout2 = 3e4, terminal
544120
544149
  { paddingLeft: 2 },
544121
544150
  import_react108.default.createElement(Text, { dimColor: true }, displayCommand)
544122
544151
  ),
544123
- output2.length > 0 && import_react108.default.createElement(Box_default, { flexDirection: "column", paddingLeft: 2, marginTop: 1 }, output2.slice(-10).map((line, index) => import_react108.default.createElement(Text, { key: index, wrap: "truncate", dimColor: true }, truncateText(line, maxCommandWidth)))),
544152
+ import_react108.default.createElement(Box_default, { flexDirection: "column", paddingLeft: 2, marginTop: 1, height: 5 }, processedOutput.map((line, index) => import_react108.default.createElement(Text, { key: index, wrap: "truncate", dimColor: true }, truncateText(line, maxCommandWidth)))),
544124
544153
  import_react108.default.createElement(
544125
544154
  Box_default,
544126
544155
  { flexDirection: "column", gap: 0 },
@@ -544199,7 +544228,7 @@ function CustomCommandExecutionDisplay({ commandName, isRunning, output: output2
544199
544228
  )
544200
544229
  )
544201
544230
  ),
544202
- output2.length > 0 && import_react109.default.createElement(Box_default, { flexDirection: "column", paddingLeft: 2 }, output2.slice(-10).map((line, index) => import_react109.default.createElement(Text, { key: index, wrap: "truncate", dimColor: true }, truncateText2(line, 100)))),
544231
+ import_react109.default.createElement(Box_default, { flexDirection: "column", paddingLeft: 2, height: 5 }, output2.flatMap((line) => line.split(/\r?\n/)).slice(-5).map((line, index) => import_react109.default.createElement(Text, { key: index, wrap: "truncate", dimColor: true }, truncateText2(line, 100)))),
544203
544232
  error && import_react109.default.createElement(
544204
544233
  Box_default,
544205
544234
  { paddingLeft: 2 },
@@ -549186,6 +549215,14 @@ Output: ${combinedOutput}`;
549186
549215
  commandName
549187
549216
  };
549188
549217
  options3.setMessages((prev) => [...prev, commandMessage]);
549218
+ } else if (result2.success && result2.action === "showMcpPanel") {
549219
+ options3.setShowMcpPanel(true);
549220
+ const commandMessage = {
549221
+ role: "command",
549222
+ content: "",
549223
+ commandName
549224
+ };
549225
+ options3.setMessages((prev) => [...prev, commandMessage]);
549189
549226
  } else if (result2.success && result2.action === "showUsagePanel") {
549190
549227
  options3.setShowUsagePanel(true);
549191
549228
  const commandMessage = {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snow-ai",
3
- "version": "0.6.3",
3
+ "version": "0.6.5",
4
4
  "description": "Intelligent Command Line Assistant powered by AI",
5
5
  "license": "MIT",
6
6
  "bin": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snow-ai",
3
- "version": "0.6.3",
3
+ "version": "0.6.5",
4
4
  "description": "Intelligent Command Line Assistant powered by AI",
5
5
  "license": "MIT",
6
6
  "bin": {