snow-ai 0.6.55 → 0.6.56
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 +400 -28
- package/bundle/package.json +1 -1
- package/package.json +1 -1
package/bundle/cli.mjs
CHANGED
|
@@ -558747,6 +558747,12 @@ var init_textBuffer = __esm({
|
|
|
558747
558747
|
writable: true,
|
|
558748
558748
|
value: ""
|
|
558749
558749
|
});
|
|
558750
|
+
Object.defineProperty(this, "_expandedSegments", {
|
|
558751
|
+
enumerable: true,
|
|
558752
|
+
configurable: true,
|
|
558753
|
+
writable: true,
|
|
558754
|
+
value: null
|
|
558755
|
+
});
|
|
558750
558756
|
Object.defineProperty(this, "visualLines", {
|
|
558751
558757
|
enumerable: true,
|
|
558752
558758
|
configurable: true,
|
|
@@ -558781,6 +558787,7 @@ var init_textBuffer = __esm({
|
|
|
558781
558787
|
destroy() {
|
|
558782
558788
|
this.isDestroyed = true;
|
|
558783
558789
|
this._expandedView = false;
|
|
558790
|
+
this._expandedSegments = null;
|
|
558784
558791
|
this.placeholderStorage.clear();
|
|
558785
558792
|
this.onUpdateCallback = void 0;
|
|
558786
558793
|
}
|
|
@@ -558832,6 +558839,8 @@ var init_textBuffer = __esm({
|
|
|
558832
558839
|
this.placeholderStorage.clear();
|
|
558833
558840
|
this.textPlaceholderCounter = 0;
|
|
558834
558841
|
this.imagePlaceholderCounter = 0;
|
|
558842
|
+
this._expandedView = false;
|
|
558843
|
+
this._expandedSegments = null;
|
|
558835
558844
|
}
|
|
558836
558845
|
this.recalculateVisualState();
|
|
558837
558846
|
this.scheduleUpdate();
|
|
@@ -558854,6 +558863,13 @@ var init_textBuffer = __esm({
|
|
|
558854
558863
|
}
|
|
558855
558864
|
this.tempPastingPlaceholder = null;
|
|
558856
558865
|
}
|
|
558866
|
+
if (this._expandedView) {
|
|
558867
|
+
this.lastTextPlaceholderId = null;
|
|
558868
|
+
this.lastTextPlaceholderAt = 0;
|
|
558869
|
+
this.insertPlainText(sanitized);
|
|
558870
|
+
this.scheduleUpdate();
|
|
558871
|
+
return;
|
|
558872
|
+
}
|
|
558857
558873
|
const now = Date.now();
|
|
558858
558874
|
const shouldMerge = this.lastTextPlaceholderId !== null && now - this.lastTextPlaceholderAt < 1200;
|
|
558859
558875
|
if (shouldMerge && this.lastTextPlaceholderId) {
|
|
@@ -558987,6 +559003,17 @@ var init_textBuffer = __esm({
|
|
|
558987
559003
|
if (this.cursorIndex === 0) {
|
|
558988
559004
|
return;
|
|
558989
559005
|
}
|
|
559006
|
+
if (this._expandedView) {
|
|
559007
|
+
const phPositions = this.getTextPlaceholderCpPositions();
|
|
559008
|
+
for (const ph of phPositions) {
|
|
559009
|
+
if (this.cursorIndex > ph.cpStart && this.cursorIndex <= ph.cpStart + ph.phCpLen) {
|
|
559010
|
+
this.cursorIndex = ph.cpStart;
|
|
559011
|
+
this.recalculateVisualState();
|
|
559012
|
+
this.scheduleUpdate();
|
|
559013
|
+
return;
|
|
559014
|
+
}
|
|
559015
|
+
}
|
|
559016
|
+
}
|
|
558990
559017
|
this.cursorIndex -= 1;
|
|
558991
559018
|
this.recalculateVisualState();
|
|
558992
559019
|
this.scheduleUpdate();
|
|
@@ -558995,6 +559022,17 @@ var init_textBuffer = __esm({
|
|
|
558995
559022
|
if (this.cursorIndex >= cpLen(this.content)) {
|
|
558996
559023
|
return;
|
|
558997
559024
|
}
|
|
559025
|
+
if (this._expandedView) {
|
|
559026
|
+
const phPositions = this.getTextPlaceholderCpPositions();
|
|
559027
|
+
for (const ph of phPositions) {
|
|
559028
|
+
if (this.cursorIndex >= ph.cpStart && this.cursorIndex < ph.cpStart + ph.phCpLen) {
|
|
559029
|
+
this.cursorIndex = ph.cpStart + ph.phCpLen;
|
|
559030
|
+
this.recalculateVisualState();
|
|
559031
|
+
this.scheduleUpdate();
|
|
559032
|
+
return;
|
|
559033
|
+
}
|
|
559034
|
+
}
|
|
559035
|
+
}
|
|
558998
559036
|
this.cursorIndex += 1;
|
|
558999
559037
|
this.recalculateVisualState();
|
|
559000
559038
|
this.scheduleUpdate();
|
|
@@ -559048,9 +559086,39 @@ var init_textBuffer = __esm({
|
|
|
559048
559086
|
}
|
|
559049
559087
|
/**
|
|
559050
559088
|
* 切换展开/折叠显示模式(仅文本占位符,图片不受影响)
|
|
559089
|
+
* 展开时将 content 替换为完整文本,允许直接编辑;
|
|
559090
|
+
* 折叠时通过 gap 文本匹配重建占位符。
|
|
559051
559091
|
*/
|
|
559052
559092
|
toggleExpandedView() {
|
|
559053
|
-
|
|
559093
|
+
if (!this._expandedView) {
|
|
559094
|
+
if (!this.hasTextPlaceholders()) {
|
|
559095
|
+
this._expandedView = true;
|
|
559096
|
+
this.recalculateVisualState();
|
|
559097
|
+
this.scheduleUpdate();
|
|
559098
|
+
return;
|
|
559099
|
+
}
|
|
559100
|
+
this._expandedSegments = this.buildExpandedSegments();
|
|
559101
|
+
const expandedText = this.getFullText();
|
|
559102
|
+
const expandedCursor = this.mapCursorToExpandedIndex(this.cursorIndex);
|
|
559103
|
+
for (const [id, ph] of this.placeholderStorage.entries()) {
|
|
559104
|
+
if (ph.type === "text") {
|
|
559105
|
+
this.placeholderStorage.delete(id);
|
|
559106
|
+
}
|
|
559107
|
+
}
|
|
559108
|
+
this.textPlaceholderCounter = 0;
|
|
559109
|
+
this.lastTextPlaceholderId = null;
|
|
559110
|
+
this.lastTextPlaceholderAt = 0;
|
|
559111
|
+
this.content = expandedText;
|
|
559112
|
+
this.cursorIndex = expandedCursor;
|
|
559113
|
+
this._expandedView = true;
|
|
559114
|
+
} else {
|
|
559115
|
+
if (this._expandedSegments) {
|
|
559116
|
+
this.refoldContent();
|
|
559117
|
+
}
|
|
559118
|
+
this._expandedSegments = null;
|
|
559119
|
+
this._expandedView = false;
|
|
559120
|
+
}
|
|
559121
|
+
this.clampCursorIndex();
|
|
559054
559122
|
this.recalculateVisualState();
|
|
559055
559123
|
this.scheduleUpdate();
|
|
559056
559124
|
}
|
|
@@ -559064,6 +559132,248 @@ var init_textBuffer = __esm({
|
|
|
559064
559132
|
}
|
|
559065
559133
|
return false;
|
|
559066
559134
|
}
|
|
559135
|
+
/**
|
|
559136
|
+
* 构建展开前的段落列表,交替记录 gap(用户手动输入的文本)
|
|
559137
|
+
* 和 placeholder(粘贴/Skill 占位符的实际内容)。
|
|
559138
|
+
*/
|
|
559139
|
+
buildExpandedSegments() {
|
|
559140
|
+
const segments = [];
|
|
559141
|
+
const phEntries = [];
|
|
559142
|
+
for (const ph of this.placeholderStorage.values()) {
|
|
559143
|
+
if (ph.type !== "text")
|
|
559144
|
+
continue;
|
|
559145
|
+
const idx2 = this.content.indexOf(ph.placeholder);
|
|
559146
|
+
if (idx2 !== -1) {
|
|
559147
|
+
phEntries.push({ ph, idx: idx2 });
|
|
559148
|
+
}
|
|
559149
|
+
}
|
|
559150
|
+
phEntries.sort((a, b) => a.idx - b.idx);
|
|
559151
|
+
if (phEntries.length === 0) {
|
|
559152
|
+
segments.push({ type: "gap", text: this.content });
|
|
559153
|
+
return segments;
|
|
559154
|
+
}
|
|
559155
|
+
let pos = 0;
|
|
559156
|
+
for (const entry of phEntries) {
|
|
559157
|
+
if (entry.idx > pos) {
|
|
559158
|
+
segments.push({
|
|
559159
|
+
type: "gap",
|
|
559160
|
+
text: this.content.substring(pos, entry.idx)
|
|
559161
|
+
});
|
|
559162
|
+
}
|
|
559163
|
+
segments.push({
|
|
559164
|
+
type: "placeholder",
|
|
559165
|
+
text: entry.ph.content,
|
|
559166
|
+
originalPlaceholder: entry.ph.placeholder
|
|
559167
|
+
});
|
|
559168
|
+
pos = entry.idx + entry.ph.placeholder.length;
|
|
559169
|
+
}
|
|
559170
|
+
if (pos < this.content.length) {
|
|
559171
|
+
segments.push({
|
|
559172
|
+
type: "gap",
|
|
559173
|
+
text: this.content.substring(pos)
|
|
559174
|
+
});
|
|
559175
|
+
}
|
|
559176
|
+
return segments;
|
|
559177
|
+
}
|
|
559178
|
+
/**
|
|
559179
|
+
* 折叠内容:将展开编辑后的文本重新包装为粘贴占位符。
|
|
559180
|
+
* 优先通过 gap 文本匹配定位原始占位符区域的边界;
|
|
559181
|
+
* 未修改时精确还原,修改后尽力重建。
|
|
559182
|
+
*/
|
|
559183
|
+
refoldContent() {
|
|
559184
|
+
const segments = this._expandedSegments;
|
|
559185
|
+
if (!segments)
|
|
559186
|
+
return;
|
|
559187
|
+
const currentText = this.content;
|
|
559188
|
+
const oldCursor = this.cursorIndex;
|
|
559189
|
+
const originalExpanded = segments.map((s) => s.text).join("");
|
|
559190
|
+
if (currentText === originalExpanded) {
|
|
559191
|
+
this.restoreExactFromSegments(segments, oldCursor);
|
|
559192
|
+
return;
|
|
559193
|
+
}
|
|
559194
|
+
const gapSegments = [];
|
|
559195
|
+
for (let i = 0; i < segments.length; i++) {
|
|
559196
|
+
if (segments[i].type === "gap") {
|
|
559197
|
+
gapSegments.push({ segIdx: i, text: segments[i].text });
|
|
559198
|
+
}
|
|
559199
|
+
}
|
|
559200
|
+
if (gapSegments.length === 0) {
|
|
559201
|
+
this.refoldEntireContent(currentText);
|
|
559202
|
+
return;
|
|
559203
|
+
}
|
|
559204
|
+
const gapPositions = [];
|
|
559205
|
+
let searchFrom = 0;
|
|
559206
|
+
let allFound = true;
|
|
559207
|
+
for (const gap of gapSegments) {
|
|
559208
|
+
if (gap.text === "") {
|
|
559209
|
+
gapPositions.push({
|
|
559210
|
+
start: searchFrom,
|
|
559211
|
+
end: searchFrom,
|
|
559212
|
+
found: true
|
|
559213
|
+
});
|
|
559214
|
+
continue;
|
|
559215
|
+
}
|
|
559216
|
+
const pos = currentText.indexOf(gap.text, searchFrom);
|
|
559217
|
+
if (pos >= searchFrom) {
|
|
559218
|
+
gapPositions.push({
|
|
559219
|
+
start: pos,
|
|
559220
|
+
end: pos + gap.text.length,
|
|
559221
|
+
found: true
|
|
559222
|
+
});
|
|
559223
|
+
searchFrom = pos + gap.text.length;
|
|
559224
|
+
} else {
|
|
559225
|
+
allFound = false;
|
|
559226
|
+
break;
|
|
559227
|
+
}
|
|
559228
|
+
}
|
|
559229
|
+
if (!allFound) {
|
|
559230
|
+
this.refoldEntireContent(currentText);
|
|
559231
|
+
return;
|
|
559232
|
+
}
|
|
559233
|
+
const regions = [];
|
|
559234
|
+
let currentPos = 0;
|
|
559235
|
+
for (const gp of gapPositions) {
|
|
559236
|
+
if (gp.start > currentPos) {
|
|
559237
|
+
regions.push({
|
|
559238
|
+
type: "placeholder",
|
|
559239
|
+
start: currentPos,
|
|
559240
|
+
end: gp.start
|
|
559241
|
+
});
|
|
559242
|
+
}
|
|
559243
|
+
if (gp.end > gp.start) {
|
|
559244
|
+
regions.push({ type: "gap", start: gp.start, end: gp.end });
|
|
559245
|
+
}
|
|
559246
|
+
currentPos = gp.end;
|
|
559247
|
+
}
|
|
559248
|
+
if (currentPos < currentText.length) {
|
|
559249
|
+
regions.push({
|
|
559250
|
+
type: "placeholder",
|
|
559251
|
+
start: currentPos,
|
|
559252
|
+
end: currentText.length
|
|
559253
|
+
});
|
|
559254
|
+
}
|
|
559255
|
+
let newContent = "";
|
|
559256
|
+
let newCursor = 0;
|
|
559257
|
+
let cursorMapped = false;
|
|
559258
|
+
for (const region of regions) {
|
|
559259
|
+
const regionText = currentText.substring(region.start, region.end);
|
|
559260
|
+
if (region.type === "gap") {
|
|
559261
|
+
if (!cursorMapped && oldCursor >= region.start && oldCursor <= region.end) {
|
|
559262
|
+
newCursor = cpLen(newContent) + (oldCursor - region.start);
|
|
559263
|
+
cursorMapped = true;
|
|
559264
|
+
}
|
|
559265
|
+
newContent += regionText;
|
|
559266
|
+
} else if (regionText.length > 0) {
|
|
559267
|
+
const lineCount = (regionText.match(/\n/g) || []).length + 1;
|
|
559268
|
+
const shouldFold = regionText.length >= 400 || lineCount >= 12;
|
|
559269
|
+
if (shouldFold) {
|
|
559270
|
+
this.textPlaceholderCounter++;
|
|
559271
|
+
const pasteId = `paste_refold_${Date.now()}_${this.textPlaceholderCounter}`;
|
|
559272
|
+
const placeholderText = `[Paste ${lineCount} lines #${this.textPlaceholderCounter}] `;
|
|
559273
|
+
this.placeholderStorage.set(pasteId, {
|
|
559274
|
+
id: pasteId,
|
|
559275
|
+
type: "text",
|
|
559276
|
+
content: regionText,
|
|
559277
|
+
charCount: regionText.length,
|
|
559278
|
+
index: this.textPlaceholderCounter,
|
|
559279
|
+
placeholder: placeholderText
|
|
559280
|
+
});
|
|
559281
|
+
if (!cursorMapped && oldCursor >= region.start && oldCursor <= region.end) {
|
|
559282
|
+
newCursor = cpLen(newContent) + cpLen(placeholderText);
|
|
559283
|
+
cursorMapped = true;
|
|
559284
|
+
}
|
|
559285
|
+
newContent += placeholderText;
|
|
559286
|
+
} else {
|
|
559287
|
+
if (!cursorMapped && oldCursor >= region.start && oldCursor <= region.end) {
|
|
559288
|
+
newCursor = cpLen(newContent) + (oldCursor - region.start);
|
|
559289
|
+
cursorMapped = true;
|
|
559290
|
+
}
|
|
559291
|
+
newContent += regionText;
|
|
559292
|
+
}
|
|
559293
|
+
}
|
|
559294
|
+
}
|
|
559295
|
+
if (!cursorMapped) {
|
|
559296
|
+
newCursor = cpLen(newContent);
|
|
559297
|
+
}
|
|
559298
|
+
this.content = newContent;
|
|
559299
|
+
this.cursorIndex = newCursor;
|
|
559300
|
+
}
|
|
559301
|
+
/**
|
|
559302
|
+
* 内容未修改时精确还原所有占位符(保留原始格式如 [Skill:id])。
|
|
559303
|
+
*/
|
|
559304
|
+
restoreExactFromSegments(segments, oldCursor) {
|
|
559305
|
+
let newContent = "";
|
|
559306
|
+
let newCursor = 0;
|
|
559307
|
+
let expandedPos = 0;
|
|
559308
|
+
let cursorMapped = false;
|
|
559309
|
+
for (const seg of segments) {
|
|
559310
|
+
if (seg.type === "gap") {
|
|
559311
|
+
if (!cursorMapped && oldCursor >= expandedPos && oldCursor <= expandedPos + seg.text.length) {
|
|
559312
|
+
newCursor = cpLen(newContent) + (oldCursor - expandedPos);
|
|
559313
|
+
cursorMapped = true;
|
|
559314
|
+
}
|
|
559315
|
+
newContent += seg.text;
|
|
559316
|
+
expandedPos += seg.text.length;
|
|
559317
|
+
} else {
|
|
559318
|
+
const lineCount = (seg.text.match(/\n/g) || []).length + 1;
|
|
559319
|
+
const shouldFold = seg.text.length >= 400 || lineCount >= 12;
|
|
559320
|
+
if (shouldFold) {
|
|
559321
|
+
this.textPlaceholderCounter++;
|
|
559322
|
+
const pasteId = `paste_restore_${Date.now()}_${this.textPlaceholderCounter}`;
|
|
559323
|
+
const placeholderText = seg.originalPlaceholder || `[Paste ${lineCount} lines #${this.textPlaceholderCounter}] `;
|
|
559324
|
+
this.placeholderStorage.set(pasteId, {
|
|
559325
|
+
id: pasteId,
|
|
559326
|
+
type: "text",
|
|
559327
|
+
content: seg.text,
|
|
559328
|
+
charCount: seg.text.length,
|
|
559329
|
+
index: this.textPlaceholderCounter,
|
|
559330
|
+
placeholder: placeholderText
|
|
559331
|
+
});
|
|
559332
|
+
if (!cursorMapped && oldCursor >= expandedPos && oldCursor <= expandedPos + seg.text.length) {
|
|
559333
|
+
newCursor = cpLen(newContent) + cpLen(placeholderText);
|
|
559334
|
+
cursorMapped = true;
|
|
559335
|
+
}
|
|
559336
|
+
newContent += placeholderText;
|
|
559337
|
+
} else {
|
|
559338
|
+
if (!cursorMapped && oldCursor >= expandedPos && oldCursor <= expandedPos + seg.text.length) {
|
|
559339
|
+
newCursor = cpLen(newContent) + (oldCursor - expandedPos);
|
|
559340
|
+
cursorMapped = true;
|
|
559341
|
+
}
|
|
559342
|
+
newContent += seg.text;
|
|
559343
|
+
}
|
|
559344
|
+
expandedPos += seg.text.length;
|
|
559345
|
+
}
|
|
559346
|
+
}
|
|
559347
|
+
if (!cursorMapped) {
|
|
559348
|
+
newCursor = cpLen(newContent);
|
|
559349
|
+
}
|
|
559350
|
+
this.content = newContent;
|
|
559351
|
+
this.cursorIndex = newCursor;
|
|
559352
|
+
}
|
|
559353
|
+
/**
|
|
559354
|
+
* 回退方案:当 gap 匹配失败时,将整个文本包装为一个占位符。
|
|
559355
|
+
*/
|
|
559356
|
+
refoldEntireContent(text3) {
|
|
559357
|
+
if (text3.length === 0)
|
|
559358
|
+
return;
|
|
559359
|
+
const lineCount = (text3.match(/\n/g) || []).length + 1;
|
|
559360
|
+
const shouldFold = text3.length >= 400 || lineCount >= 12;
|
|
559361
|
+
if (!shouldFold)
|
|
559362
|
+
return;
|
|
559363
|
+
this.textPlaceholderCounter++;
|
|
559364
|
+
const pasteId = `paste_refold_${Date.now()}_${this.textPlaceholderCounter}`;
|
|
559365
|
+
const placeholderText = `[Paste ${lineCount} lines #${this.textPlaceholderCounter}] `;
|
|
559366
|
+
this.placeholderStorage.set(pasteId, {
|
|
559367
|
+
id: pasteId,
|
|
559368
|
+
type: "text",
|
|
559369
|
+
content: text3,
|
|
559370
|
+
charCount: text3.length,
|
|
559371
|
+
index: this.textPlaceholderCounter,
|
|
559372
|
+
placeholder: placeholderText
|
|
559373
|
+
});
|
|
559374
|
+
this.content = placeholderText;
|
|
559375
|
+
this.cursorIndex = cpLen(placeholderText);
|
|
559376
|
+
}
|
|
559067
559377
|
/**
|
|
559068
559378
|
* Get the character and its visual info at cursor position for proper rendering.
|
|
559069
559379
|
*/
|
|
@@ -560477,12 +560787,23 @@ function useClipboard(buffer, updateCommandPanelState, updateFilePickerState, tr
|
|
|
560477
560787
|
if (process.platform === "win32" || isWslEnv) {
|
|
560478
560788
|
try {
|
|
560479
560789
|
const psScript = "Add-Type -AssemblyName System.Windows.Forms; Add-Type -AssemblyName System.Drawing; $clipboard = [System.Windows.Forms.Clipboard]::GetImage(); if ($clipboard -ne $null) { $ms = New-Object System.IO.MemoryStream; $width = $clipboard.Width; $height = $clipboard.Height; $maxSize = 2048; if ($width -gt $maxSize -or $height -gt $maxSize) { $ratio = [Math]::Min($maxSize / $width, $maxSize / $height); $newWidth = [int]($width * $ratio); $newHeight = [int]($height * $ratio); $resized = New-Object System.Drawing.Bitmap($newWidth, $newHeight); $graphics = [System.Drawing.Graphics]::FromImage($resized); $graphics.CompositingQuality = [System.Drawing.Drawing2D.CompositingQuality]::HighQuality; $graphics.InterpolationMode = [System.Drawing.Drawing2D.InterpolationMode]::HighQualityBicubic; $graphics.SmoothingMode = [System.Drawing.Drawing2D.SmoothingMode]::HighQuality; $graphics.DrawImage($clipboard, 0, 0, $newWidth, $newHeight); $resized.Save($ms, [System.Drawing.Imaging.ImageFormat]::Png); $graphics.Dispose(); $resized.Dispose(); } else { $clipboard.Save($ms, [System.Drawing.Imaging.ImageFormat]::Png); }; $bytes = $ms.ToArray(); $ms.Close(); [Convert]::ToBase64String($bytes); }";
|
|
560480
|
-
|
|
560481
|
-
|
|
560482
|
-
|
|
560483
|
-
|
|
560484
|
-
|
|
560485
|
-
|
|
560790
|
+
let base64Raw;
|
|
560791
|
+
if (isWslEnv) {
|
|
560792
|
+
const encoded = Buffer.from(psScript, "utf16le").toString("base64");
|
|
560793
|
+
base64Raw = execSync5(`${psCmd} -NoProfile -EncodedCommand ${encoded}`, {
|
|
560794
|
+
encoding: "utf-8",
|
|
560795
|
+
timeout: 1e4,
|
|
560796
|
+
maxBuffer: 50 * 1024 * 1024,
|
|
560797
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
560798
|
+
});
|
|
560799
|
+
} else {
|
|
560800
|
+
base64Raw = execSync5(`${psCmd} -NoProfile -Command "${psScript}"`, {
|
|
560801
|
+
encoding: "utf-8",
|
|
560802
|
+
timeout: 1e4,
|
|
560803
|
+
maxBuffer: 50 * 1024 * 1024,
|
|
560804
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
560805
|
+
});
|
|
560806
|
+
}
|
|
560486
560807
|
const base643 = base64Raw.replace(/\s/g, "");
|
|
560487
560808
|
if (base643 && base643.length > 100) {
|
|
560488
560809
|
buffer.insertImage(base643, "image/png");
|
|
@@ -560562,7 +560883,8 @@ end try'`;
|
|
|
560562
560883
|
if (process.platform === "win32" || isWslEnv) {
|
|
560563
560884
|
clipboardText = execSync5(`${psCmd} -NoProfile -Command "Get-Clipboard"`, {
|
|
560564
560885
|
encoding: "utf-8",
|
|
560565
|
-
timeout: 2e3
|
|
560886
|
+
timeout: 2e3,
|
|
560887
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
560566
560888
|
}).trim();
|
|
560567
560889
|
} else if (process.platform === "darwin") {
|
|
560568
560890
|
clipboardText = execSync5("pbpaste", {
|
|
@@ -561655,6 +561977,11 @@ function useAgentPicker(buffer, triggerUpdate) {
|
|
|
561655
561977
|
position = -1;
|
|
561656
561978
|
break;
|
|
561657
561979
|
}
|
|
561980
|
+
const textBeforeHash = displayText.slice(0, i);
|
|
561981
|
+
if (/\[(?:Paste \d+ lines |image )$/.test(textBeforeHash)) {
|
|
561982
|
+
position = -1;
|
|
561983
|
+
break;
|
|
561984
|
+
}
|
|
561658
561985
|
position = i;
|
|
561659
561986
|
const afterHash = beforeCursor.slice(i + 1);
|
|
561660
561987
|
if (!afterHash.includes(" ") && !afterHash.includes("\n")) {
|
|
@@ -569706,6 +570033,7 @@ var init_ModelsPanel = __esm({
|
|
|
569706
570033
|
const [geminiThinkingBudget, setGeminiThinkingBudget] = (0, import_react127.useState)(1024);
|
|
569707
570034
|
const [responsesReasoningEnabled, setResponsesReasoningEnabled] = (0, import_react127.useState)(false);
|
|
569708
570035
|
const [responsesReasoningEffort, setResponsesReasoningEffort] = (0, import_react127.useState)("high");
|
|
570036
|
+
const [responsesFastMode, setResponsesFastMode] = (0, import_react127.useState)(false);
|
|
569709
570037
|
const [thinkingFocusIndex, setThinkingFocusIndex] = (0, import_react127.useState)(0);
|
|
569710
570038
|
const [thinkingInputMode, setThinkingInputMode] = (0, import_react127.useState)(null);
|
|
569711
570039
|
const [thinkingInputValue, setThinkingInputValue] = (0, import_react127.useState)("");
|
|
@@ -569742,6 +570070,7 @@ var init_ModelsPanel = __esm({
|
|
|
569742
570070
|
setGeminiThinkingBudget(((_g = cfg.geminiThinking) == null ? void 0 : _g.budget) || 1024);
|
|
569743
570071
|
setResponsesReasoningEnabled(((_h = cfg.responsesReasoning) == null ? void 0 : _h.enabled) || false);
|
|
569744
570072
|
setResponsesReasoningEffort(((_i = cfg.responsesReasoning) == null ? void 0 : _i.effort) || "high");
|
|
570073
|
+
setResponsesFastMode(cfg.responsesFastMode || false);
|
|
569745
570074
|
}, [visible, advancedModel, basicModel]);
|
|
569746
570075
|
(0, import_react127.useEffect)(() => {
|
|
569747
570076
|
if (errorMessage) {
|
|
@@ -569980,6 +570309,27 @@ var init_ModelsPanel = __esm({
|
|
|
569980
570309
|
setErrorMessage(message);
|
|
569981
570310
|
}
|
|
569982
570311
|
}, [responsesReasoningEnabled]);
|
|
570312
|
+
const applyResponsesFastMode = (0, import_react127.useCallback)(async (next) => {
|
|
570313
|
+
setErrorMessage("");
|
|
570314
|
+
try {
|
|
570315
|
+
setResponsesFastMode(next);
|
|
570316
|
+
await updateOpenAiConfig({
|
|
570317
|
+
responsesFastMode: next
|
|
570318
|
+
});
|
|
570319
|
+
} catch (err) {
|
|
570320
|
+
const message = err instanceof Error ? err.message : t.modelsPanel.saveFailed;
|
|
570321
|
+
setErrorMessage(message);
|
|
570322
|
+
}
|
|
570323
|
+
}, []);
|
|
570324
|
+
const maxThinkingIndex = (0, import_react127.useMemo)(() => {
|
|
570325
|
+
if (requestMethod === "anthropic")
|
|
570326
|
+
return 3;
|
|
570327
|
+
if (requestMethod === "responses")
|
|
570328
|
+
return 3;
|
|
570329
|
+
if (requestMethod === "gemini")
|
|
570330
|
+
return 2;
|
|
570331
|
+
return 1;
|
|
570332
|
+
}, [requestMethod]);
|
|
569983
570333
|
const selectedIndex = Math.max(0, currentOptions.findIndex((option) => option.value === currentModel));
|
|
569984
570334
|
const tabActiveBackground = theme14.colors.menuSelected.startsWith("#") && theme14.colors.menuSelected.length === 9 ? theme14.colors.menuSelected.slice(0, 7) : theme14.colors.menuSelected;
|
|
569985
570335
|
use_input_default((input2, key) => {
|
|
@@ -570078,13 +570428,11 @@ var init_ModelsPanel = __esm({
|
|
|
570078
570428
|
}
|
|
570079
570429
|
if (activeTab === "thinking") {
|
|
570080
570430
|
if (key.upArrow) {
|
|
570081
|
-
|
|
570082
|
-
setThinkingFocusIndex((prev) => prev === 0 ? maxIndex : prev - 1);
|
|
570431
|
+
setThinkingFocusIndex((prev) => prev === 0 ? maxThinkingIndex : prev - 1);
|
|
570083
570432
|
return;
|
|
570084
570433
|
}
|
|
570085
570434
|
if (key.downArrow) {
|
|
570086
|
-
|
|
570087
|
-
setThinkingFocusIndex((prev) => prev === maxIndex ? 0 : prev + 1);
|
|
570435
|
+
setThinkingFocusIndex((prev) => prev === maxThinkingIndex ? 0 : prev + 1);
|
|
570088
570436
|
return;
|
|
570089
570437
|
}
|
|
570090
570438
|
if (key.return) {
|
|
@@ -570092,9 +570440,16 @@ var init_ModelsPanel = __esm({
|
|
|
570092
570440
|
void applyShowThinking(!showThinking);
|
|
570093
570441
|
} else if (thinkingFocusIndex === 1) {
|
|
570094
570442
|
void applyThinkingEnabled(!thinkingEnabledValue);
|
|
570095
|
-
} else if (thinkingFocusIndex === 2
|
|
570096
|
-
|
|
570097
|
-
|
|
570443
|
+
} else if (thinkingFocusIndex === 2) {
|
|
570444
|
+
if (requestMethod === "anthropic") {
|
|
570445
|
+
setIsThinkingModeSelecting(true);
|
|
570446
|
+
} else if (requestMethod === "gemini") {
|
|
570447
|
+
setThinkingInputMode("geminiThinkingBudget");
|
|
570448
|
+
setThinkingInputValue(geminiThinkingBudget.toString());
|
|
570449
|
+
} else if (requestMethod === "responses") {
|
|
570450
|
+
setIsThinkingEffortSelecting(true);
|
|
570451
|
+
}
|
|
570452
|
+
} else if (thinkingFocusIndex === 3) {
|
|
570098
570453
|
if (requestMethod === "anthropic") {
|
|
570099
570454
|
if (thinkingMode === "tokens") {
|
|
570100
570455
|
setThinkingInputMode("anthropicBudgetTokens");
|
|
@@ -570102,13 +570457,8 @@ var init_ModelsPanel = __esm({
|
|
|
570102
570457
|
} else {
|
|
570103
570458
|
setIsThinkingEffortSelecting(true);
|
|
570104
570459
|
}
|
|
570105
|
-
} else if (requestMethod === "gemini") {
|
|
570106
|
-
setThinkingInputMode("geminiThinkingBudget");
|
|
570107
|
-
setThinkingInputValue(geminiThinkingBudget.toString());
|
|
570108
570460
|
} else if (requestMethod === "responses") {
|
|
570109
|
-
|
|
570110
|
-
} else {
|
|
570111
|
-
setErrorMessage(t.modelsPanel.requestMethodNotSupportedForThinkingStrength.replace("{requestMethod}", requestMethod));
|
|
570461
|
+
void applyResponsesFastMode(!responsesFastMode);
|
|
570112
570462
|
}
|
|
570113
570463
|
}
|
|
570114
570464
|
return;
|
|
@@ -570198,7 +570548,7 @@ var init_ModelsPanel = __esm({
|
|
|
570198
570548
|
showThinking ? "[\u2713]" : "[ ]"
|
|
570199
570549
|
)
|
|
570200
570550
|
),
|
|
570201
|
-
import_react127.default.createElement(
|
|
570551
|
+
(requestMethod === "anthropic" || requestMethod === "gemini" || requestMethod === "responses") && import_react127.default.createElement(
|
|
570202
570552
|
Box_default,
|
|
570203
570553
|
null,
|
|
570204
570554
|
import_react127.default.createElement(
|
|
@@ -570230,13 +570580,13 @@ var init_ModelsPanel = __esm({
|
|
|
570230
570580
|
thinkingMode === "tokens" ? t.configScreen.thinkingModeTokens : t.configScreen.thinkingModeAdaptive
|
|
570231
570581
|
)
|
|
570232
570582
|
),
|
|
570233
|
-
import_react127.default.createElement(
|
|
570583
|
+
(requestMethod === "anthropic" || requestMethod === "gemini" || requestMethod === "responses") && import_react127.default.createElement(
|
|
570234
570584
|
Box_default,
|
|
570235
570585
|
null,
|
|
570236
570586
|
import_react127.default.createElement(
|
|
570237
570587
|
Text,
|
|
570238
|
-
{ color: thinkingFocusIndex === 3 ? theme14.colors.menuSelected : theme14.colors.menuNormal },
|
|
570239
|
-
thinkingFocusIndex === 3 ? "\u276F " : " ",
|
|
570588
|
+
{ color: thinkingFocusIndex === (requestMethod === "anthropic" ? 3 : 2) ? theme14.colors.menuSelected : theme14.colors.menuNormal },
|
|
570589
|
+
thinkingFocusIndex === (requestMethod === "anthropic" ? 3 : 2) ? "\u276F " : " ",
|
|
570240
570590
|
t.modelsPanel.thinkingStrength
|
|
570241
570591
|
),
|
|
570242
570592
|
import_react127.default.createElement(
|
|
@@ -570246,6 +570596,22 @@ var init_ModelsPanel = __esm({
|
|
|
570246
570596
|
thinkingStrengthValue
|
|
570247
570597
|
)
|
|
570248
570598
|
),
|
|
570599
|
+
requestMethod === "responses" && import_react127.default.createElement(
|
|
570600
|
+
Box_default,
|
|
570601
|
+
null,
|
|
570602
|
+
import_react127.default.createElement(
|
|
570603
|
+
Text,
|
|
570604
|
+
{ color: thinkingFocusIndex === 3 ? theme14.colors.menuSelected : theme14.colors.menuNormal },
|
|
570605
|
+
thinkingFocusIndex === 3 ? "\u276F " : " ",
|
|
570606
|
+
t.configScreen.responsesFastMode
|
|
570607
|
+
),
|
|
570608
|
+
import_react127.default.createElement(
|
|
570609
|
+
Text,
|
|
570610
|
+
{ color: theme14.colors.menuSelected },
|
|
570611
|
+
" ",
|
|
570612
|
+
responsesFastMode ? "[\u2713]" : "[ ]"
|
|
570613
|
+
)
|
|
570614
|
+
),
|
|
570249
570615
|
thinkingInputMode && import_react127.default.createElement(
|
|
570250
570616
|
Box_default,
|
|
570251
570617
|
{ flexDirection: "column", marginTop: 1 },
|
|
@@ -601087,7 +601453,7 @@ var require_package3 = __commonJS({
|
|
|
601087
601453
|
"package.json"(exports2, module2) {
|
|
601088
601454
|
module2.exports = {
|
|
601089
601455
|
name: "snow-ai",
|
|
601090
|
-
version: "0.6.
|
|
601456
|
+
version: "0.6.56",
|
|
601091
601457
|
description: "Agentic coding in your terminal",
|
|
601092
601458
|
license: "MIT",
|
|
601093
601459
|
bin: {
|
|
@@ -602824,6 +603190,7 @@ import { spawn as spawn14 } from "child_process";
|
|
|
602824
603190
|
import { readFileSync as readFileSync26 } from "fs";
|
|
602825
603191
|
import { join as join38 } from "path";
|
|
602826
603192
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
603193
|
+
delete process.env["NO_COLOR"];
|
|
602827
603194
|
process.env["FORCE_COLOR"] = "3";
|
|
602828
603195
|
var MIN_NODE_VERSION = 16;
|
|
602829
603196
|
var currentVersion = process.version;
|
|
@@ -602881,9 +603248,14 @@ sanitizeNodeOptions();
|
|
|
602881
603248
|
if (process.env["SNOW_IGNORE_NODE_OPTIONS"] === "1") {
|
|
602882
603249
|
delete process.env["NODE_OPTIONS"];
|
|
602883
603250
|
}
|
|
603251
|
+
var suppressedDepCodes = /* @__PURE__ */ new Set(["DEP0040", "DEP0169"]);
|
|
602884
603252
|
var originalEmitWarning = process.emitWarning;
|
|
602885
603253
|
process.emitWarning = function(warning, ...args2) {
|
|
602886
|
-
if (args2[1] === "
|
|
603254
|
+
if (typeof args2[1] === "string" && suppressedDepCodes.has(args2[1]))
|
|
603255
|
+
return;
|
|
603256
|
+
if (args2[0] && typeof args2[0] === "object" && suppressedDepCodes.has(args2[0].code))
|
|
603257
|
+
return;
|
|
603258
|
+
if (typeof warning === "string" && warning.includes("'NO_COLOR'") && warning.includes("'FORCE_COLOR'"))
|
|
602887
603259
|
return;
|
|
602888
603260
|
return originalEmitWarning.apply(process, [warning, ...args2]);
|
|
602889
603261
|
};
|
|
@@ -603057,7 +603429,7 @@ Options
|
|
|
603057
603429
|
if (cli.flags.update) {
|
|
603058
603430
|
console.log("Updating snow-ai to latest version...");
|
|
603059
603431
|
try {
|
|
603060
|
-
const child = spawn14("npm
|
|
603432
|
+
const child = spawn14("npm i -g snow-ai", {
|
|
603061
603433
|
stdio: "inherit",
|
|
603062
603434
|
shell: true
|
|
603063
603435
|
});
|
package/bundle/package.json
CHANGED