snow-ai 0.7.33 → 0.7.34
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 +118 -65
- package/bundle/package.json +1 -1
- package/package.json +1 -1
package/bundle/cli.mjs
CHANGED
|
@@ -471820,6 +471820,14 @@ var init_useGlobalNavigation = __esm({
|
|
|
471820
471820
|
});
|
|
471821
471821
|
|
|
471822
471822
|
// dist/utils/execution/terminal.js
|
|
471823
|
+
function getTerminalColumns(stream = process.stdout) {
|
|
471824
|
+
const columns = stream.columns;
|
|
471825
|
+
return typeof columns === "number" && Number.isFinite(columns) && columns > 0 ? Math.floor(columns) : DEFAULT_TERMINAL_COLUMNS;
|
|
471826
|
+
}
|
|
471827
|
+
function getAvailableTerminalColumns(reservedColumns = 0, stream = process.stdout) {
|
|
471828
|
+
const safeReservedColumns = Number.isFinite(reservedColumns) && reservedColumns > 0 ? Math.floor(reservedColumns) : 0;
|
|
471829
|
+
return Math.max(1, getTerminalColumns(stream) - safeReservedColumns);
|
|
471830
|
+
}
|
|
471823
471831
|
function resetTerminal(stream) {
|
|
471824
471832
|
const target = stream ?? process.stdout;
|
|
471825
471833
|
if (!target || typeof target.write !== "function") {
|
|
@@ -471835,9 +471843,11 @@ function resetTerminal(stream) {
|
|
|
471835
471843
|
}).catch(() => {
|
|
471836
471844
|
});
|
|
471837
471845
|
}
|
|
471846
|
+
var DEFAULT_TERMINAL_COLUMNS;
|
|
471838
471847
|
var init_terminal = __esm({
|
|
471839
471848
|
"dist/utils/execution/terminal.js"() {
|
|
471840
471849
|
"use strict";
|
|
471850
|
+
DEFAULT_TERMINAL_COLUMNS = 80;
|
|
471841
471851
|
}
|
|
471842
471852
|
});
|
|
471843
471853
|
|
|
@@ -552245,6 +552255,66 @@ var init_marked_terminal = __esm({
|
|
|
552245
552255
|
}
|
|
552246
552256
|
});
|
|
552247
552257
|
|
|
552258
|
+
// dist/utils/core/textUtils.js
|
|
552259
|
+
function toCodePoints(str2) {
|
|
552260
|
+
return Array.from(str2);
|
|
552261
|
+
}
|
|
552262
|
+
function cpLen(str2) {
|
|
552263
|
+
return toCodePoints(str2).length;
|
|
552264
|
+
}
|
|
552265
|
+
function cpSlice(str2, start, end) {
|
|
552266
|
+
const codePoints = toCodePoints(str2);
|
|
552267
|
+
return codePoints.slice(start, end).join("");
|
|
552268
|
+
}
|
|
552269
|
+
function visualWidth(str2) {
|
|
552270
|
+
return stringWidth4(str2);
|
|
552271
|
+
}
|
|
552272
|
+
function codePointToVisualPos(str2, codePointIndex) {
|
|
552273
|
+
const codePoints = toCodePoints(str2);
|
|
552274
|
+
let visualPos = 0;
|
|
552275
|
+
for (let i = 0; i < Math.min(codePointIndex, codePoints.length); i++) {
|
|
552276
|
+
const char = codePoints[i] || "";
|
|
552277
|
+
visualPos += visualWidth(char);
|
|
552278
|
+
}
|
|
552279
|
+
return visualPos;
|
|
552280
|
+
}
|
|
552281
|
+
function visualPosToCodePoint(str2, visualPos) {
|
|
552282
|
+
const codePoints = toCodePoints(str2);
|
|
552283
|
+
let currentVisualPos = 0;
|
|
552284
|
+
for (let i = 0; i < codePoints.length; i++) {
|
|
552285
|
+
const char = codePoints[i] || "";
|
|
552286
|
+
const charWidth = visualWidth(char);
|
|
552287
|
+
if (currentVisualPos + charWidth > visualPos) {
|
|
552288
|
+
return i;
|
|
552289
|
+
}
|
|
552290
|
+
currentVisualPos += charWidth;
|
|
552291
|
+
if (currentVisualPos >= visualPos) {
|
|
552292
|
+
return i + 1;
|
|
552293
|
+
}
|
|
552294
|
+
}
|
|
552295
|
+
return codePoints.length;
|
|
552296
|
+
}
|
|
552297
|
+
function formatElapsedTime(seconds) {
|
|
552298
|
+
if (seconds < 60) {
|
|
552299
|
+
return `${seconds}s`;
|
|
552300
|
+
} else if (seconds < 3600) {
|
|
552301
|
+
const minutes = Math.floor(seconds / 60);
|
|
552302
|
+
const remainingSeconds = seconds % 60;
|
|
552303
|
+
return `${minutes}m ${remainingSeconds}s`;
|
|
552304
|
+
} else {
|
|
552305
|
+
const hours = Math.floor(seconds / 3600);
|
|
552306
|
+
const remainingMinutes = Math.floor(seconds % 3600 / 60);
|
|
552307
|
+
const remainingSeconds = seconds % 60;
|
|
552308
|
+
return `${hours}h ${remainingMinutes}m ${remainingSeconds}s`;
|
|
552309
|
+
}
|
|
552310
|
+
}
|
|
552311
|
+
var init_textUtils = __esm({
|
|
552312
|
+
"dist/utils/core/textUtils.js"() {
|
|
552313
|
+
"use strict";
|
|
552314
|
+
init_string_width4();
|
|
552315
|
+
}
|
|
552316
|
+
});
|
|
552317
|
+
|
|
552248
552318
|
// node_modules/katex/dist/katex.mjs
|
|
552249
552319
|
function escape4(text2) {
|
|
552250
552320
|
return String(text2).replace(ESCAPE_REGEX, (match) => ESCAPE_LOOKUP[match]);
|
|
@@ -566901,6 +566971,39 @@ var init_unicodeMath = __esm({
|
|
|
566901
566971
|
});
|
|
566902
566972
|
|
|
566903
566973
|
// dist/ui/components/common/MarkdownRenderer.js
|
|
566974
|
+
function renderInlineTokens(parser3, cell) {
|
|
566975
|
+
return cell.tokens ? parser3.parseInline(cell.tokens) : cell.text;
|
|
566976
|
+
}
|
|
566977
|
+
function calculateHorizontalTableWidth(headers, rows) {
|
|
566978
|
+
const widths = headers.map((header) => visualWidth(header));
|
|
566979
|
+
for (const row of rows) {
|
|
566980
|
+
row.forEach((cell, index) => {
|
|
566981
|
+
widths[index] = Math.max(widths[index] ?? 0, visualWidth(cell));
|
|
566982
|
+
});
|
|
566983
|
+
}
|
|
566984
|
+
return widths.reduce((total, width) => total + width + 2, 0) + widths.length + 1;
|
|
566985
|
+
}
|
|
566986
|
+
function formatVerticalTableSeparator(width) {
|
|
566987
|
+
return VERTICAL_TABLE_SEPARATOR_CHAR.repeat(Math.max(1, width));
|
|
566988
|
+
}
|
|
566989
|
+
function renderVerticalTable(token, parser3) {
|
|
566990
|
+
const headers = token.header.map((cell) => renderInlineTokens(parser3, cell));
|
|
566991
|
+
const rows = token.rows.map((row) => row.map((cell) => renderInlineTokens(parser3, cell)));
|
|
566992
|
+
const terminalWidth = getAvailableTerminalColumns(VERTICAL_TABLE_RESERVED_COLUMNS);
|
|
566993
|
+
const horizontalTableWidth = calculateHorizontalTableWidth(headers, rows);
|
|
566994
|
+
if (horizontalTableWidth <= terminalWidth) {
|
|
566995
|
+
return false;
|
|
566996
|
+
}
|
|
566997
|
+
const separator = formatVerticalTableSeparator(terminalWidth);
|
|
566998
|
+
const blocks = rows.map((row) => {
|
|
566999
|
+
return headers.map((header, index) => `${header}: ${row[index] ?? ""}`).join("\n");
|
|
567000
|
+
});
|
|
567001
|
+
return `
|
|
567002
|
+
${blocks.join(`
|
|
567003
|
+
${separator}
|
|
567004
|
+
`)}
|
|
567005
|
+
`;
|
|
567006
|
+
}
|
|
566904
567007
|
function sanitizeMarkdownContent(content) {
|
|
566905
567008
|
return content.replace(/<ol\s+start=["']?(0|-\d+)["']?>/gi, '<ol start="1">');
|
|
566906
567009
|
}
|
|
@@ -566973,7 +567076,7 @@ function MarkdownRenderer({ content }) {
|
|
|
566973
567076
|
return renderFallback(content);
|
|
566974
567077
|
}
|
|
566975
567078
|
}
|
|
566976
|
-
var import_react85, import_cli_highlight3, ANSI_PATTERN;
|
|
567079
|
+
var import_react85, import_cli_highlight3, VERTICAL_TABLE_SEPARATOR_CHAR, VERTICAL_TABLE_RESERVED_COLUMNS, ANSI_PATTERN;
|
|
566977
567080
|
var init_MarkdownRenderer = __esm({
|
|
566978
567081
|
async "dist/ui/components/common/MarkdownRenderer.js"() {
|
|
566979
567082
|
"use strict";
|
|
@@ -566983,9 +567086,11 @@ var init_MarkdownRenderer = __esm({
|
|
|
566983
567086
|
init_marked_terminal();
|
|
566984
567087
|
import_cli_highlight3 = __toESM(require_dist14(), 1);
|
|
566985
567088
|
init_logger();
|
|
567089
|
+
init_textUtils();
|
|
567090
|
+
init_terminal();
|
|
566986
567091
|
init_unicodeMath();
|
|
566987
567092
|
marked.use(markedTerminal({
|
|
566988
|
-
width:
|
|
567093
|
+
width: getTerminalColumns(),
|
|
566989
567094
|
reflowText: true,
|
|
566990
567095
|
unescape: true,
|
|
566991
567096
|
showSectionPrefix: false,
|
|
@@ -567004,6 +567109,15 @@ var init_MarkdownRenderer = __esm({
|
|
|
567004
567109
|
}
|
|
567005
567110
|
}
|
|
567006
567111
|
});
|
|
567112
|
+
VERTICAL_TABLE_SEPARATOR_CHAR = "\u2500";
|
|
567113
|
+
VERTICAL_TABLE_RESERVED_COLUMNS = 2;
|
|
567114
|
+
marked.use({
|
|
567115
|
+
renderer: {
|
|
567116
|
+
table(token) {
|
|
567117
|
+
return renderVerticalTable(token, this.parser);
|
|
567118
|
+
}
|
|
567119
|
+
}
|
|
567120
|
+
});
|
|
567007
567121
|
marked.use({
|
|
567008
567122
|
extensions: [
|
|
567009
567123
|
{
|
|
@@ -567730,66 +567844,6 @@ var init_skillMask = __esm({
|
|
|
567730
567844
|
}
|
|
567731
567845
|
});
|
|
567732
567846
|
|
|
567733
|
-
// dist/utils/core/textUtils.js
|
|
567734
|
-
function toCodePoints(str2) {
|
|
567735
|
-
return Array.from(str2);
|
|
567736
|
-
}
|
|
567737
|
-
function cpLen(str2) {
|
|
567738
|
-
return toCodePoints(str2).length;
|
|
567739
|
-
}
|
|
567740
|
-
function cpSlice(str2, start, end) {
|
|
567741
|
-
const codePoints = toCodePoints(str2);
|
|
567742
|
-
return codePoints.slice(start, end).join("");
|
|
567743
|
-
}
|
|
567744
|
-
function visualWidth(str2) {
|
|
567745
|
-
return stringWidth4(str2);
|
|
567746
|
-
}
|
|
567747
|
-
function codePointToVisualPos(str2, codePointIndex) {
|
|
567748
|
-
const codePoints = toCodePoints(str2);
|
|
567749
|
-
let visualPos = 0;
|
|
567750
|
-
for (let i = 0; i < Math.min(codePointIndex, codePoints.length); i++) {
|
|
567751
|
-
const char = codePoints[i] || "";
|
|
567752
|
-
visualPos += visualWidth(char);
|
|
567753
|
-
}
|
|
567754
|
-
return visualPos;
|
|
567755
|
-
}
|
|
567756
|
-
function visualPosToCodePoint(str2, visualPos) {
|
|
567757
|
-
const codePoints = toCodePoints(str2);
|
|
567758
|
-
let currentVisualPos = 0;
|
|
567759
|
-
for (let i = 0; i < codePoints.length; i++) {
|
|
567760
|
-
const char = codePoints[i] || "";
|
|
567761
|
-
const charWidth = visualWidth(char);
|
|
567762
|
-
if (currentVisualPos + charWidth > visualPos) {
|
|
567763
|
-
return i;
|
|
567764
|
-
}
|
|
567765
|
-
currentVisualPos += charWidth;
|
|
567766
|
-
if (currentVisualPos >= visualPos) {
|
|
567767
|
-
return i + 1;
|
|
567768
|
-
}
|
|
567769
|
-
}
|
|
567770
|
-
return codePoints.length;
|
|
567771
|
-
}
|
|
567772
|
-
function formatElapsedTime(seconds) {
|
|
567773
|
-
if (seconds < 60) {
|
|
567774
|
-
return `${seconds}s`;
|
|
567775
|
-
} else if (seconds < 3600) {
|
|
567776
|
-
const minutes = Math.floor(seconds / 60);
|
|
567777
|
-
const remainingSeconds = seconds % 60;
|
|
567778
|
-
return `${minutes}m ${remainingSeconds}s`;
|
|
567779
|
-
} else {
|
|
567780
|
-
const hours = Math.floor(seconds / 3600);
|
|
567781
|
-
const remainingMinutes = Math.floor(seconds % 3600 / 60);
|
|
567782
|
-
const remainingSeconds = seconds % 60;
|
|
567783
|
-
return `${hours}h ${remainingMinutes}m ${remainingSeconds}s`;
|
|
567784
|
-
}
|
|
567785
|
-
}
|
|
567786
|
-
var init_textUtils = __esm({
|
|
567787
|
-
"dist/utils/core/textUtils.js"() {
|
|
567788
|
-
"use strict";
|
|
567789
|
-
init_string_width4();
|
|
567790
|
-
}
|
|
567791
|
-
});
|
|
567792
|
-
|
|
567793
567847
|
// dist/ui/components/chat/MessageRenderer.js
|
|
567794
567848
|
function cleanThinkingContent5(content) {
|
|
567795
567849
|
return content.replace(/\s*<\/?think(?:ing)?>\s*/gi, "").trim();
|
|
@@ -573439,8 +573493,7 @@ function clipboardHandler(ctx) {
|
|
|
573439
573493
|
const { input: input2, key, options: options3, refs } = ctx;
|
|
573440
573494
|
const { pasteFromClipboard } = options3;
|
|
573441
573495
|
const isLegacyImagePasteShortcut = process.platform === "darwin" ? key.ctrl && input2 === "v" : key.meta && input2 === "v";
|
|
573442
|
-
|
|
573443
|
-
if (isLegacyImagePasteShortcut || isForwardedSystemPasteShortcut) {
|
|
573496
|
+
if (isLegacyImagePasteShortcut) {
|
|
573444
573497
|
refs.lastPasteShortcutAt.current = Date.now();
|
|
573445
573498
|
pasteFromClipboard();
|
|
573446
573499
|
return true;
|
|
@@ -611934,7 +611987,7 @@ var require_package3 = __commonJS({
|
|
|
611934
611987
|
"package.json"(exports2, module2) {
|
|
611935
611988
|
module2.exports = {
|
|
611936
611989
|
name: "snow-ai",
|
|
611937
|
-
version: "0.7.
|
|
611990
|
+
version: "0.7.34",
|
|
611938
611991
|
description: "Agentic coding in your terminal",
|
|
611939
611992
|
license: "MIT",
|
|
611940
611993
|
bin: {
|
package/bundle/package.json
CHANGED