@simon_he/vue-tui 1.1.1 → 1.1.2
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/README.md +68 -28
- package/dist/{TMermaidText-CXm_L969.js → TMermaidText-frVr8Ysb.js} +1 -1
- package/dist/{TSelect-CiyMvwl-.js → TSelect-tJ87rKPM.js} +6 -168
- package/dist/{TTree-DKGiuIcM.js → TTree-CGdE-CYu.js} +12 -13
- package/dist/agent.cjs +9 -5
- package/dist/agent.js +15 -1197
- package/dist/{block-source-5CQp4tF8.js → block-source-CrlmaBM5.js} +7 -601
- package/dist/cli/input.d.ts +8 -0
- package/dist/cli/video/ffmpeg-frame-source.d.ts +10 -0
- package/dist/cli/video/png-frame-parser.d.ts +4 -0
- package/dist/cli/video/raw-frame-parser.d.ts +1 -0
- package/dist/cli/video/yt-dlp-frame-source.d.ts +11 -0
- package/dist/cli.cjs +142 -33
- package/dist/cli.d.cts +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +167 -37
- package/dist/core.js +5 -6
- package/dist/create-terminal-app.d.ts +24 -1
- package/dist/{debug-logger-ChY_PXVk.js → debug-logger-CmsGI4of.js} +1 -1
- package/dist/{dom-renderer-DNzmg2As.js → dom-renderer-DXx8fWzD.js} +2 -3
- package/dist/experimental/3d/bun/contributor-avatar-atlas.d.ts +12 -0
- package/dist/experimental/3d/bun/png.d.ts +1 -0
- package/dist/experimental/3d/bun/terminal-badge-scene.d.ts +11 -0
- package/dist/experimental/3d/bun/terminal-badge.wgsl.d.ts +1 -0
- package/dist/experimental/3d/bun/webgpu-renderer.d.ts +26 -0
- package/dist/experimental/3d/bun.cjs +7271 -0
- package/dist/experimental/3d/bun.d.cts +4 -0
- package/dist/experimental/3d/bun.d.ts +4 -0
- package/dist/experimental/3d/bun.js +7390 -0
- package/dist/experimental/video/node.cjs +497 -0
- package/dist/experimental/video/node.d.cts +4 -0
- package/dist/experimental/video/node.d.ts +4 -0
- package/dist/experimental/video/node.js +610 -0
- package/dist/experimental.cjs +3064 -567
- package/dist/experimental.d.cts +5 -0
- package/dist/experimental.d.ts +5 -0
- package/dist/experimental.js +1524 -9
- package/dist/{create-terminal-DXuZ2fci.js → hyperlink-_1FAj7Wq.js} +403 -2
- package/dist/index.js +15 -16
- package/dist/{linkify-CuuquMQT.js → linkify-D68T7rdW.js} +164 -3
- package/dist/markdown.js +8 -8
- package/dist/{mermaid-CWto52Wk.js → mermaid-BNhM1jAZ.js} +1 -1
- package/dist/mermaid.js +3 -3
- package/dist/observability.js +2 -2
- package/dist/{path-suggest-fPzRsgPv.js → path-suggest-Dndu4dTi.js} +1 -1
- package/dist/renderer/terminal-graphics.d.ts +1 -0
- package/dist/renderer-dom.js +3 -4
- package/dist/runtime.js +2 -2
- package/dist/terminal-graphics-Bbe83wSr.js +597 -0
- package/dist/{tlog-theme-CopRt9SC.js → tlog-theme-Bul2Na3u.js} +1206 -12
- package/dist/{trace-CYHDKM1m.js → trace-Bh8WnoMo.js} +1 -1
- package/dist/vue/components/T3DViewport.d.ts +473 -0
- package/dist/vue/components/TAgentTerminalGraphic.d.ts +13 -0
- package/dist/vue/components/TVideo.d.ts +291 -0
- package/dist/vue/video/types.d.ts +39 -0
- package/dist/vue.js +17 -18
- package/package.json +38 -1
- package/dist/hyperlink-B35-O-cW.js +0 -403
- /package/dist/{ansi-palette-CNXqFciC.js → ansi-palette-CH6jc2Z7.js} +0 -0
- /package/dist/{env-DNCzvX8b.js → env-Cl8qmNFN.js} +0 -0
- /package/dist/{frame-perf-BBhE-iuS.js → frame-perf-CHpWhbC4.js} +0 -0
- /package/dist/{path-BI9W15Zt.js → path-mnSgEpCm.js} +0 -0
- /package/dist/{rect-Ng-3eKzF.js → rect-DUpeDfBg.js} +0 -0
- /package/dist/{runtime-D77C03RM.js → runtime-Byf8XXOT.js} +0 -0
- /package/dist/{terminal-selection-CQYr--26.js → terminal-selection-4W1SJj4c.js} +0 -0
- /package/dist/{wheel-scroll-CQ22Hcyj.js → wheel-scroll-DASkEZr-.js} +0 -0
package/dist/cli.js
CHANGED
|
@@ -2382,10 +2382,8 @@ function createStdinDriver(options) {
|
|
|
2382
2382
|
if (stdout.isTTY) {
|
|
2383
2383
|
let restore = "\x1B[?2004l\x1B[?1004l";
|
|
2384
2384
|
if (keyboardProtocolSequences) restore += keyboardProtocolSequences.disable;
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
restore += enableMouseMotion ? "\x1B[?1000l\x1B[?1003l\x1B[?1006l" : "\x1B[?1000l\x1B[?1002l\x1B[?1006l";
|
|
2388
|
-
}
|
|
2385
|
+
restore += "\x1B[?1007l";
|
|
2386
|
+
restore += enableMouseMotion ? "\x1B[?1000l\x1B[?1003l\x1B[?1006l" : "\x1B[?1000l\x1B[?1002l\x1B[?1006l";
|
|
2389
2387
|
writeTTYSyncOrStream(stdout, restore);
|
|
2390
2388
|
}
|
|
2391
2389
|
};
|
|
@@ -2397,7 +2395,21 @@ function createStdinDriver(options) {
|
|
|
2397
2395
|
signalPolicy: typeof autoCleanup === "object" ? cleanupOptions.signalPolicy ?? "reraise" : "reraise"
|
|
2398
2396
|
});
|
|
2399
2397
|
}
|
|
2400
|
-
|
|
2398
|
+
const setMouseCapture = (enabled) => {
|
|
2399
|
+
if (disposed || !stdout.isTTY) return;
|
|
2400
|
+
if (enabled) {
|
|
2401
|
+
stdout.write("\x1B[?1007h");
|
|
2402
|
+
if (enableMouseMotion) stdout.write("\x1B[?1000h\x1B[?1003h\x1B[?1006h");
|
|
2403
|
+
else stdout.write("\x1B[?1000h\x1B[?1002h\x1B[?1006h");
|
|
2404
|
+
} else {
|
|
2405
|
+
stdout.write("\x1B[?1007l");
|
|
2406
|
+
stdout.write(enableMouseMotion ? "\x1B[?1000l\x1B[?1003l\x1B[?1006l" : "\x1B[?1000l\x1B[?1002l\x1B[?1006l");
|
|
2407
|
+
}
|
|
2408
|
+
};
|
|
2409
|
+
return {
|
|
2410
|
+
dispose,
|
|
2411
|
+
setMouseCapture
|
|
2412
|
+
};
|
|
2401
2413
|
}
|
|
2402
2414
|
|
|
2403
2415
|
//#endregion
|
|
@@ -8181,6 +8193,7 @@ function createTerminalApp(options) {
|
|
|
8181
8193
|
});
|
|
8182
8194
|
const selectionTextProviders = new Map();
|
|
8183
8195
|
const selectionCopyHandlers = new Set();
|
|
8196
|
+
const selectionConfig = shallowRef(options.selection ?? false);
|
|
8184
8197
|
const selectionContext = {
|
|
8185
8198
|
registerTextProvider(provider) {
|
|
8186
8199
|
selectionTextProviders.set(provider.id, provider);
|
|
@@ -8199,6 +8212,10 @@ function createTerminalApp(options) {
|
|
|
8199
8212
|
},
|
|
8200
8213
|
clear() {
|
|
8201
8214
|
selection.clear();
|
|
8215
|
+
},
|
|
8216
|
+
setConfig(config) {
|
|
8217
|
+
selectionConfig.value = config;
|
|
8218
|
+
selection.refresh();
|
|
8202
8219
|
}
|
|
8203
8220
|
};
|
|
8204
8221
|
const selectionOverlay = getPlaneTerminal(terminal, "overlay");
|
|
@@ -8216,7 +8233,7 @@ function createTerminalApp(options) {
|
|
|
8216
8233
|
getRow: (y) => readTerminalRowForPlanes(terminal, y, selectionReadPlanes),
|
|
8217
8234
|
getTextProviders: () => Array.from(selectionTextProviders.values()),
|
|
8218
8235
|
getOptions: () => {
|
|
8219
|
-
const config = resolveSelectionConfig(
|
|
8236
|
+
const config = resolveSelectionConfig(selectionConfig.value);
|
|
8220
8237
|
return {
|
|
8221
8238
|
autoCopy: config.autoCopy,
|
|
8222
8239
|
copyOnMouseUp: config.copyOnMouseUp,
|
|
@@ -8461,6 +8478,8 @@ function createTerminalApp(options) {
|
|
|
8461
8478
|
events,
|
|
8462
8479
|
scheduler: ctx.scheduler,
|
|
8463
8480
|
defaultStyle: ctx.defaultStyle,
|
|
8481
|
+
clipboard,
|
|
8482
|
+
selection: selectionContext,
|
|
8464
8483
|
getImeAnchor() {
|
|
8465
8484
|
return imeAnchor.value;
|
|
8466
8485
|
},
|
|
@@ -10049,6 +10068,7 @@ function createStdoutRenderer(terminal, options) {
|
|
|
10049
10068
|
const pendingGraphicSignatures = new Map();
|
|
10050
10069
|
const activeGraphicSignatures = new Map();
|
|
10051
10070
|
const retainedGraphics = new Map();
|
|
10071
|
+
const knownKittyImageIds = new Set();
|
|
10052
10072
|
const terminalResizeDirtyGraphics = new Set();
|
|
10053
10073
|
let nextGraphicsOrder = 0;
|
|
10054
10074
|
let terminalGraphicsFlushTimer = null;
|
|
@@ -10082,7 +10102,8 @@ function createStdoutRenderer(terminal, options) {
|
|
|
10082
10102
|
payload.h ?? "",
|
|
10083
10103
|
hashTerminalGraphicsString(payload.sequence),
|
|
10084
10104
|
hashTerminalGraphicsString(payload.resizeSequence ?? ""),
|
|
10085
|
-
hashTerminalGraphicsString(payload.clearSequence ?? "")
|
|
10105
|
+
hashTerminalGraphicsString(payload.clearSequence ?? ""),
|
|
10106
|
+
payload.allowTextOverlay ? "1" : "0"
|
|
10086
10107
|
].join(":");
|
|
10087
10108
|
}
|
|
10088
10109
|
function kittyClearSequenceKeepsImageData(sequence) {
|
|
@@ -10131,6 +10152,21 @@ function createStdoutRenderer(terminal, options) {
|
|
|
10131
10152
|
if (imageId === "0" || placementId === "0") return null;
|
|
10132
10153
|
return `${imageId}:${placementId}`;
|
|
10133
10154
|
}
|
|
10155
|
+
function kittyImageId(sequence) {
|
|
10156
|
+
if (!sequence) return null;
|
|
10157
|
+
const start = sequence.indexOf("\x1B_G");
|
|
10158
|
+
if (start < 0) return null;
|
|
10159
|
+
const end = sequence.indexOf("\x1B\\", start + 3);
|
|
10160
|
+
if (end < 0) return null;
|
|
10161
|
+
const body = sequence.slice(start + 3, end);
|
|
10162
|
+
const controlsRaw = body.slice(0, body.indexOf(";") < 0 ? body.length : body.indexOf(";"));
|
|
10163
|
+
for (const part of controlsRaw.split(",")) {
|
|
10164
|
+
if (!part.startsWith("i=")) continue;
|
|
10165
|
+
const imageId = Number(part.slice(2));
|
|
10166
|
+
return Number.isInteger(imageId) && imageId > 0 ? imageId : null;
|
|
10167
|
+
}
|
|
10168
|
+
return null;
|
|
10169
|
+
}
|
|
10134
10170
|
function canReplaceKittyPlacementWithoutClear(previous, payload) {
|
|
10135
10171
|
if (payload.terminalResizeRedraw) return false;
|
|
10136
10172
|
if (!payload.resizeRedraw || previous.protocol !== "kitty" || payload.protocol !== "kitty") return false;
|
|
@@ -10143,14 +10179,14 @@ function createStdoutRenderer(terminal, options) {
|
|
|
10143
10179
|
h: payload.h ?? previous.h
|
|
10144
10180
|
}));
|
|
10145
10181
|
}
|
|
10146
|
-
function queueTerminalGraphicClear(id) {
|
|
10182
|
+
function queueTerminalGraphicClear(id, options$1 = {}) {
|
|
10147
10183
|
if (disposed) return false;
|
|
10148
10184
|
const removedPendingDraw = pendingGraphics.delete(`${id}:draw`);
|
|
10149
10185
|
pendingGraphicSignatures.delete(id);
|
|
10150
10186
|
terminalResizeDirtyGraphics.delete(id);
|
|
10151
10187
|
const active = activeGraphics.get(id);
|
|
10152
10188
|
if (!active) {
|
|
10153
|
-
retainedGraphics.delete(id);
|
|
10189
|
+
if (!options$1.retainOnClear) retainedGraphics.delete(id);
|
|
10154
10190
|
return removedPendingDraw;
|
|
10155
10191
|
}
|
|
10156
10192
|
if (active.clearSequence) {
|
|
@@ -10162,6 +10198,7 @@ function createStdoutRenderer(terminal, options) {
|
|
|
10162
10198
|
h: active.h,
|
|
10163
10199
|
protocol: active.protocol,
|
|
10164
10200
|
sequence: active.clearSequence,
|
|
10201
|
+
retainOnClear: options$1.retainOnClear,
|
|
10165
10202
|
op: "clear",
|
|
10166
10203
|
order: nextGraphicsOrder++
|
|
10167
10204
|
};
|
|
@@ -10184,6 +10221,69 @@ function createStdoutRenderer(terminal, options) {
|
|
|
10184
10221
|
requestTerminalGraphicsFlush();
|
|
10185
10222
|
return true;
|
|
10186
10223
|
}
|
|
10224
|
+
function clearAllTerminalGraphics() {
|
|
10225
|
+
if (disposed || graphicsCapabilities.preferredProtocol !== "kitty") return false;
|
|
10226
|
+
const imageIds = new Set(knownKittyImageIds);
|
|
10227
|
+
let needsVisibleFallback = false;
|
|
10228
|
+
const rememberImageId = (...sequences) => {
|
|
10229
|
+
for (const sequence of sequences) {
|
|
10230
|
+
const imageId = kittyImageId(sequence);
|
|
10231
|
+
if (imageId != null) {
|
|
10232
|
+
imageIds.add(imageId);
|
|
10233
|
+
return;
|
|
10234
|
+
}
|
|
10235
|
+
}
|
|
10236
|
+
needsVisibleFallback = true;
|
|
10237
|
+
};
|
|
10238
|
+
for (const active of activeGraphics.values()) rememberImageId(active.sequence, active.resizeSequence, active.clearSequence);
|
|
10239
|
+
for (const retained of retainedGraphics.values()) rememberImageId(retained.active.sequence, retained.active.resizeSequence, retained.active.clearSequence);
|
|
10240
|
+
for (const payload of pendingGraphics.values()) rememberImageId(payload.sequence, payload.resizeSequence, payload.clearSequence);
|
|
10241
|
+
pendingGraphics.clear();
|
|
10242
|
+
pendingGraphicClears.clear();
|
|
10243
|
+
activeGraphics.clear();
|
|
10244
|
+
pendingGraphicSignatures.clear();
|
|
10245
|
+
activeGraphicSignatures.clear();
|
|
10246
|
+
retainedGraphics.clear();
|
|
10247
|
+
knownKittyImageIds.clear();
|
|
10248
|
+
terminalResizeDirtyGraphics.clear();
|
|
10249
|
+
for (const imageId of imageIds) {
|
|
10250
|
+
const payload = {
|
|
10251
|
+
id: `__terminal_graphics_clear_image_${imageId}__`,
|
|
10252
|
+
x: 0,
|
|
10253
|
+
y: 0,
|
|
10254
|
+
w: 1,
|
|
10255
|
+
h: 1,
|
|
10256
|
+
protocol: "kitty",
|
|
10257
|
+
sequence: createKittyDeleteGraphicsSequence({
|
|
10258
|
+
imageId,
|
|
10259
|
+
freeImageData: true
|
|
10260
|
+
}),
|
|
10261
|
+
op: "clear",
|
|
10262
|
+
order: nextGraphicsOrder++
|
|
10263
|
+
};
|
|
10264
|
+
if (validateTerminalGraphicsPayload(payload, graphicsCapabilities)) pendingGraphics.set(`${payload.id}:clear`, payload);
|
|
10265
|
+
}
|
|
10266
|
+
if (needsVisibleFallback) {
|
|
10267
|
+
const payload = {
|
|
10268
|
+
id: "__terminal_graphics_clear_visible__",
|
|
10269
|
+
x: 0,
|
|
10270
|
+
y: 0,
|
|
10271
|
+
w: 1,
|
|
10272
|
+
h: 1,
|
|
10273
|
+
protocol: "kitty",
|
|
10274
|
+
sequence: createKittyDeleteGraphicsSequence({
|
|
10275
|
+
allVisible: true,
|
|
10276
|
+
freeImageData: true
|
|
10277
|
+
}),
|
|
10278
|
+
op: "clear",
|
|
10279
|
+
order: nextGraphicsOrder++
|
|
10280
|
+
};
|
|
10281
|
+
if (validateTerminalGraphicsPayload(payload, graphicsCapabilities)) pendingGraphics.set(`${payload.id}:clear`, payload);
|
|
10282
|
+
}
|
|
10283
|
+
if (pendingGraphics.size === 0) return false;
|
|
10284
|
+
requestTerminalGraphicsFlush();
|
|
10285
|
+
return true;
|
|
10286
|
+
}
|
|
10187
10287
|
function queueTerminalGraphicsForResizeRedraw(size) {
|
|
10188
10288
|
if (isDebugEnabled()) getDebugLog().render(`graphics resize redraw queue: size=${size.cols}x${size.rows}, activeGraphics=${activeGraphics.size}, pendingGraphics=${pendingGraphics.size}, pendingClears=${pendingGraphicClears.size}`);
|
|
10189
10289
|
for (const [id, active] of activeGraphics) {
|
|
@@ -10195,7 +10295,7 @@ function createStdoutRenderer(terminal, options) {
|
|
|
10195
10295
|
continue;
|
|
10196
10296
|
}
|
|
10197
10297
|
const signature = activeGraphicSignatures.get(id);
|
|
10198
|
-
const sequence = active.
|
|
10298
|
+
const sequence = active.sequence;
|
|
10199
10299
|
pendingGraphics.set(`${id}:draw`, {
|
|
10200
10300
|
id,
|
|
10201
10301
|
x: active.x,
|
|
@@ -10206,6 +10306,7 @@ function createStdoutRenderer(terminal, options) {
|
|
|
10206
10306
|
sequence,
|
|
10207
10307
|
resizeSequence: active.resizeSequence,
|
|
10208
10308
|
clearSequence: active.clearSequence,
|
|
10309
|
+
allowTextOverlay: active.allowTextOverlay,
|
|
10209
10310
|
op: "draw",
|
|
10210
10311
|
order: nextGraphicsOrder++,
|
|
10211
10312
|
resizeRedraw: true,
|
|
@@ -10230,9 +10331,10 @@ function createStdoutRenderer(terminal, options) {
|
|
|
10230
10331
|
w: active.w,
|
|
10231
10332
|
h: active.h,
|
|
10232
10333
|
protocol: active.protocol,
|
|
10233
|
-
sequence: active.
|
|
10334
|
+
sequence: active.sequence,
|
|
10234
10335
|
resizeSequence: active.resizeSequence,
|
|
10235
10336
|
clearSequence: active.clearSequence,
|
|
10337
|
+
allowTextOverlay: active.allowTextOverlay,
|
|
10236
10338
|
op: "draw",
|
|
10237
10339
|
order: nextGraphicsOrder++,
|
|
10238
10340
|
resizeRedraw: true,
|
|
@@ -10275,6 +10377,8 @@ function createStdoutRenderer(terminal, options) {
|
|
|
10275
10377
|
height: normalized.h ?? 1
|
|
10276
10378
|
});
|
|
10277
10379
|
if (!frame) return false;
|
|
10380
|
+
const imageId = kittyImageId(frame.sequence) ?? kittyImageId(normalized.resizeSequence);
|
|
10381
|
+
if (imageId != null) knownKittyImageIds.add(imageId);
|
|
10278
10382
|
if (isDebugEnabled()) {
|
|
10279
10383
|
const size = terminal.size();
|
|
10280
10384
|
getDebugLog().render(`terminal graphic queue draw request: id=${frame.id}, x=${normalized.x}, y=${normalized.y}, w=${frame.width}, h=${frame.height}, viewport=${size.cols}x${size.rows}`);
|
|
@@ -10289,7 +10393,7 @@ function createStdoutRenderer(terminal, options) {
|
|
|
10289
10393
|
const size = terminal.size();
|
|
10290
10394
|
getDebugLog().render(`terminal graphic queue draw rejected offscreen: id=${frame.id}, x=${normalized.x}, y=${normalized.y}, w=${frame.width}, h=${frame.height}, viewport=${size.cols}x${size.rows}`);
|
|
10291
10395
|
}
|
|
10292
|
-
queueTerminalGraphicClear(frame.id);
|
|
10396
|
+
queueTerminalGraphicClear(frame.id, { retainOnClear: normalized.retainOnClear });
|
|
10293
10397
|
return false;
|
|
10294
10398
|
}
|
|
10295
10399
|
const clearSequence = normalized.clearSequence && isSafeTerminalGraphicsSequence(normalized.clearSequence, normalized.protocol, "clear") ? normalized.clearSequence : void 0;
|
|
@@ -10325,8 +10429,44 @@ function createStdoutRenderer(terminal, options) {
|
|
|
10325
10429
|
if (isDebugEnabled()) getDebugLog().render(`terminal graphic queue draw canceled clear: id=${frame.id}, x=${normalized.x}, y=${normalized.y}, w=${frame.width}, h=${frame.height}`);
|
|
10326
10430
|
return true;
|
|
10327
10431
|
}
|
|
10432
|
+
const active = activeGraphics.get(frame.id);
|
|
10433
|
+
const activeCanReplacePlacement = active && active.sequence === frame.sequence && resizeSequence && canReplaceKittyPlacementWithoutClear(active, {
|
|
10434
|
+
...normalized,
|
|
10435
|
+
id: frame.id,
|
|
10436
|
+
w: frame.width,
|
|
10437
|
+
h: frame.height,
|
|
10438
|
+
sequence: resizeSequence,
|
|
10439
|
+
resizeSequence,
|
|
10440
|
+
clearSequence,
|
|
10441
|
+
fallbackText: frame.fallbackText,
|
|
10442
|
+
resizeRedraw: true,
|
|
10443
|
+
placementMoveWithoutClear: true
|
|
10444
|
+
});
|
|
10445
|
+
if (!forceTerminalResizeRedraw && !normalized.forceDraw && !normalized.resizeRedraw && activeCanReplacePlacement && resizeSequence) {
|
|
10446
|
+
pendingGraphics.set(`${frame.id}:draw`, {
|
|
10447
|
+
...normalized,
|
|
10448
|
+
id: frame.id,
|
|
10449
|
+
w: frame.width,
|
|
10450
|
+
h: frame.height,
|
|
10451
|
+
sequence: resizeSequence,
|
|
10452
|
+
resizeSequence,
|
|
10453
|
+
clearSequence,
|
|
10454
|
+
fallbackText: frame.fallbackText,
|
|
10455
|
+
resizeRedraw: true,
|
|
10456
|
+
placementMoveWithoutClear: false
|
|
10457
|
+
});
|
|
10458
|
+
pendingGraphicSignatures.set(frame.id, signature);
|
|
10459
|
+
recordTerminalGraphicTrace({
|
|
10460
|
+
type: "queue",
|
|
10461
|
+
id: frame.id,
|
|
10462
|
+
protocol: normalized.protocol,
|
|
10463
|
+
bytes: resizeSequence.length
|
|
10464
|
+
});
|
|
10465
|
+
requestTerminalGraphicsFlush(Boolean(normalized.deferFlush));
|
|
10466
|
+
return true;
|
|
10467
|
+
}
|
|
10328
10468
|
const retained = retainedGraphics.get(frame.id);
|
|
10329
|
-
const retainedCanReplacePlacement = retained && resizeSequence && canReplaceKittyPlacementWithoutClear(retained.active, {
|
|
10469
|
+
const retainedCanReplacePlacement = retained && retained.active.sequence === frame.sequence && resizeSequence && canReplaceKittyPlacementWithoutClear(retained.active, {
|
|
10330
10470
|
...normalized,
|
|
10331
10471
|
id: frame.id,
|
|
10332
10472
|
w: frame.width,
|
|
@@ -10347,12 +10487,12 @@ function createStdoutRenderer(terminal, options) {
|
|
|
10347
10487
|
id: frame.id,
|
|
10348
10488
|
w: frame.width,
|
|
10349
10489
|
h: frame.height,
|
|
10350
|
-
sequence: resizeSequence,
|
|
10490
|
+
sequence: forceTerminalResizeRedraw ? frame.sequence : resizeSequence,
|
|
10351
10491
|
resizeSequence,
|
|
10352
10492
|
clearSequence,
|
|
10353
10493
|
fallbackText: frame.fallbackText,
|
|
10354
10494
|
resizeRedraw: true,
|
|
10355
|
-
placementMoveWithoutClear:
|
|
10495
|
+
placementMoveWithoutClear: false,
|
|
10356
10496
|
terminalResizeRedraw: forceTerminalResizeRedraw
|
|
10357
10497
|
});
|
|
10358
10498
|
pendingGraphicSignatures.set(frame.id, signature);
|
|
@@ -10409,6 +10549,9 @@ function createStdoutRenderer(terminal, options) {
|
|
|
10409
10549
|
},
|
|
10410
10550
|
clear(id) {
|
|
10411
10551
|
return queueTerminalGraphicClear(id);
|
|
10552
|
+
},
|
|
10553
|
+
clearAll() {
|
|
10554
|
+
return clearAllTerminalGraphics();
|
|
10412
10555
|
}
|
|
10413
10556
|
};
|
|
10414
10557
|
const unregisterGraphicsOutput = registerTerminalGraphicsOutput(terminal, graphicsOutput);
|
|
@@ -11508,6 +11651,7 @@ function createStdoutRenderer(terminal, options) {
|
|
|
11508
11651
|
sequence: active.sequence,
|
|
11509
11652
|
resizeSequence: active.resizeSequence,
|
|
11510
11653
|
clearSequence: active.clearSequence,
|
|
11654
|
+
allowTextOverlay: active.allowTextOverlay,
|
|
11511
11655
|
op: "draw",
|
|
11512
11656
|
order: nextGraphicsOrder++
|
|
11513
11657
|
});
|
|
@@ -11518,7 +11662,7 @@ function createStdoutRenderer(terminal, options) {
|
|
|
11518
11662
|
if (explicitGraphicClears.has(id)) continue;
|
|
11519
11663
|
if (pendingGraphicIds.has(id)) continue;
|
|
11520
11664
|
if (intersectsScrollOperations(active)) continue;
|
|
11521
|
-
addTerminalGraphicTextPreserveSpans(active);
|
|
11665
|
+
if (!active.allowTextOverlay) addTerminalGraphicTextPreserveSpans(active);
|
|
11522
11666
|
}
|
|
11523
11667
|
if ((normalizedScrollOperations === null || normalizedScrollOperations === void 0 ? void 0 : normalizedScrollOperations.length) && activeGraphics.size > 0) for (const active of activeGraphics.values()) {
|
|
11524
11668
|
if (!intersectsScrollOperations(active)) continue;
|
|
@@ -12224,22 +12368,6 @@ function createStdoutRenderer(terminal, options) {
|
|
|
12224
12368
|
}
|
|
12225
12369
|
return out$1;
|
|
12226
12370
|
};
|
|
12227
|
-
const clearGraphicRowBackgroundForRowsNotPainted = (rect) => {
|
|
12228
|
-
if (scrollHandled) return "";
|
|
12229
|
-
const clearStyle = bgSeq;
|
|
12230
|
-
let out$1 = "";
|
|
12231
|
-
const leftW = Math.max(0, Math.min(size.cols, rect.x));
|
|
12232
|
-
const rightX = Math.max(0, Math.min(size.cols, rect.x + rect.w));
|
|
12233
|
-
const rightW = Math.max(0, size.cols - rightX);
|
|
12234
|
-
if (leftW <= 0 && rightW <= 0) return "";
|
|
12235
|
-
for (let row = 0; row < rect.h; row++) {
|
|
12236
|
-
const y = rect.y + row;
|
|
12237
|
-
if (!rowsToRender || rowWasPaintedByTextRenderer(y)) continue;
|
|
12238
|
-
if (leftW > 0) out$1 += `\u001B[${y + 1};1H${clearStyle}\u001B[${leftW}X${SGR_RESET}`;
|
|
12239
|
-
if (rightW > 0) out$1 += `\u001B[${y + 1};${rightX + 1}H${clearStyle}\u001B[${rightW}X${SGR_RESET}`;
|
|
12240
|
-
}
|
|
12241
|
-
return out$1;
|
|
12242
|
-
};
|
|
12243
12371
|
let commitTerminalGraphicsState = null;
|
|
12244
12372
|
let restoreTerminalGraphicsAfterWriteFailure = null;
|
|
12245
12373
|
let terminalGraphicsMetrics = null;
|
|
@@ -12388,6 +12516,7 @@ function createStdoutRenderer(terminal, options) {
|
|
|
12388
12516
|
const previousSignature = previous ? nextActiveGraphicSignatures.get(payload.id) : void 0;
|
|
12389
12517
|
const nextSignature = nextPendingGraphicSignatures.get(payload.id) ?? terminalGraphicsPayloadSignature(payload);
|
|
12390
12518
|
const canReplacePlacement = previous != null && payload.resizeRedraw && canReplaceKittyPlacementWithoutClear(previous, payload);
|
|
12519
|
+
const terminalResizePlacementOnly = previous != null && payload.terminalResizeRedraw && payload.resizeSequence != null && previous.sequence === payload.sequence;
|
|
12391
12520
|
const resizeRedrawNeedsClear = previous && (payload.resizeRedraw || payload.terminalResizeRedraw) && Boolean(previous.clearSequence) && !canReplacePlacement;
|
|
12392
12521
|
if (previous && (!canReplacePlacement && (previousSignature !== nextSignature || !sameGraphicRect(previous, rect)) || resizeRedrawNeedsClear)) {
|
|
12393
12522
|
const visiblePrevious = clipGraphicRectToViewport(previous, size);
|
|
@@ -12405,18 +12534,18 @@ function createStdoutRenderer(terminal, options) {
|
|
|
12405
12534
|
const visibleRect = clipGraphicRectToViewport(rect, size);
|
|
12406
12535
|
if (isDebugEnabled()) getDebugLog().render(`terminal graphic render draw: id=${payload.id}, x=${rect.x}, y=${rect.y}, w=${rect.w}, h=${rect.h}, visible=${visibleRect ? `${visibleRect.x},${visibleRect.y},${visibleRect.w},${visibleRect.h}` : "none"}, resizeRedraw=${payload.resizeRedraw || payload.terminalResizeRedraw ? "true" : "false"}, previous=${previous ? `${previous.x},${previous.y},${previous.w},${previous.h}` : "none"}`);
|
|
12407
12536
|
const clearRect$1 = visibleRect ? clearGraphicRectForRowsNotPainted(visibleRect) : "";
|
|
12408
|
-
const clearRowBackground = visibleRect ? clearGraphicRowBackgroundForRowsNotPainted(visibleRect) : "";
|
|
12409
12537
|
const cursor = `\u001B[${rect.y + 1};${rect.x + 1}H`;
|
|
12410
|
-
const sequencePayload = (canReplacePlacement ||
|
|
12538
|
+
const sequencePayload = (canReplacePlacement || terminalResizePlacementOnly) && payload.resizeSequence ? payload.resizeSequence : payload.sequence;
|
|
12411
12539
|
const sequence = maybeWrapTerminalGraphic(sequencePayload);
|
|
12412
|
-
frameParts.push(countGraphicsBytes(cursor), countGraphicsBytes(sequence), countGraphicsBytes(SGR_RESET),
|
|
12540
|
+
frameParts.push(countGraphicsBytes(cursor), countGraphicsBytes(sequence), countGraphicsBytes(SGR_RESET), clearRect$1 ? countGraphicsBytes(clearRect$1) : "");
|
|
12413
12541
|
terminalGraphicsDraws++;
|
|
12414
12542
|
nextActiveGraphics.set(payload.id, {
|
|
12415
12543
|
...rect,
|
|
12416
12544
|
protocol: payload.protocol,
|
|
12417
|
-
sequence: payload.sequence,
|
|
12545
|
+
sequence: previous && (canReplacePlacement || terminalResizePlacementOnly) ? previous.sequence : payload.sequence,
|
|
12418
12546
|
resizeSequence: payload.resizeSequence ?? (previous === null || previous === void 0 ? void 0 : previous.resizeSequence),
|
|
12419
|
-
clearSequence: payload.clearSequence
|
|
12547
|
+
clearSequence: payload.clearSequence,
|
|
12548
|
+
allowTextOverlay: payload.allowTextOverlay ?? (previous === null || previous === void 0 ? void 0 : previous.allowTextOverlay)
|
|
12420
12549
|
});
|
|
12421
12550
|
nextActiveGraphicSignatures.set(payload.id, nextSignature);
|
|
12422
12551
|
nextPendingGraphicSignatures.delete(payload.id);
|
|
@@ -13024,6 +13153,7 @@ function createStdoutRenderer(terminal, options) {
|
|
|
13024
13153
|
pendingGraphicClears.clear();
|
|
13025
13154
|
pendingGraphicSignatures.clear();
|
|
13026
13155
|
retainedGraphics.clear();
|
|
13156
|
+
knownKittyImageIds.clear();
|
|
13027
13157
|
terminalResizeDirtyGraphics.clear();
|
|
13028
13158
|
try {
|
|
13029
13159
|
if (activeGraphics.size > 0) {
|
package/dist/core.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { TERMINAL_RENDER_PLANES, createTerminal } from "./
|
|
1
|
+
import { TERMINAL_RENDER_PLANES, createTerminal, isSafeRelativeHref, parseAnsiSgr, sanitizeDomHref, sanitizeTerminalHref } from "./hyperlink-_1FAj7Wq.js";
|
|
2
2
|
import { charCellWidth } from "./width-GqllnV8C.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { parsePathQuery, resolveUserPath, suggestParentHint, suggestPaths } from "./path-suggest-fPzRsgPv.js";
|
|
3
|
+
import { ansiColorRgb } from "./ansi-palette-CH6jc2Z7.js";
|
|
4
|
+
import { firstNonEmptyEnv } from "./env-Cl8qmNFN.js";
|
|
5
|
+
import { normalizeNewlines } from "./path-mnSgEpCm.js";
|
|
6
|
+
import { parsePathQuery, resolveUserPath, suggestParentHint, suggestPaths } from "./path-suggest-Dndu4dTi.js";
|
|
8
7
|
|
|
9
8
|
//#region src/core/ansi/colors.ts
|
|
10
9
|
const ANSI8_COLOR_NAMES = Object.freeze([
|
|
@@ -5,15 +5,38 @@ import type { Style, Terminal } from "./core/types.js";
|
|
|
5
5
|
import type { CliEventManager } from "./events/index.js";
|
|
6
6
|
import type { ClipboardApi } from "./runtime/index.js";
|
|
7
7
|
import type { TerminalLinkOpenerLike } from "./vue/components/link/host.js";
|
|
8
|
-
import type { TerminalSelectionConfig, TerminalSelectionCopyPayload } from "./selection/terminal-selection.js";
|
|
8
|
+
import type { SelectionTextProvider, TerminalSelectionConfig, TerminalSelectionCopyPayload, TerminalSelectionRefreshOptions } from "./selection/terminal-selection.js";
|
|
9
9
|
import type { TInputPlugin } from "./vue/components/input/plugins/types.js";
|
|
10
10
|
import type { ImeAnchor, TerminalScheduler } from "./vue/context.js";
|
|
11
|
+
export type TerminalSelectionContext = Readonly<{
|
|
12
|
+
registerTextProvider(provider: SelectionTextProvider): () => void;
|
|
13
|
+
onCopy(handler: (payload: TerminalSelectionCopyPayload) => void): () => void;
|
|
14
|
+
refresh(options?: TerminalSelectionRefreshOptions): void;
|
|
15
|
+
clear(): void;
|
|
16
|
+
/**
|
|
17
|
+
* Update the selection copy strategy at runtime. Only `autoCopy`,
|
|
18
|
+
* `copyOnMouseUp`, and `style` take effect dynamically — `enabled` is
|
|
19
|
+
* resolved at app creation time (it gates overlay node registration and
|
|
20
|
+
* the pointer-event selection path) and cannot be toggled afterwards.
|
|
21
|
+
* Triggers a refresh so the new options apply immediately.
|
|
22
|
+
*
|
|
23
|
+
* This does NOT toggle mouse capture — that is owned by the stdin driver
|
|
24
|
+
* layer. To let the terminal perform native selection, disable mouse
|
|
25
|
+
* capture at stdin-driver startup time, or rely on the terminal's
|
|
26
|
+
* Shift+drag escape hatch.
|
|
27
|
+
*/
|
|
28
|
+
setConfig(config: TerminalSelectionConfig): void;
|
|
29
|
+
}>;
|
|
11
30
|
export type TerminalApp = Readonly<{
|
|
12
31
|
app: App;
|
|
13
32
|
terminal: Terminal;
|
|
14
33
|
events: CliEventManager;
|
|
15
34
|
scheduler: TerminalScheduler;
|
|
16
35
|
defaultStyle: Ref<Style>;
|
|
36
|
+
/** The active clipboard instance used by selection copy and exposed for upper-layer copy actions. */
|
|
37
|
+
clipboard: ClipboardApi;
|
|
38
|
+
/** Selection controller surface: register text providers, observe copy events, refresh/clear. */
|
|
39
|
+
selection: TerminalSelectionContext;
|
|
17
40
|
/** Returns the current IME anchor position (cursor position in cell coordinates), or null if no input is focused */
|
|
18
41
|
getImeAnchor: () => ImeAnchor | null;
|
|
19
42
|
mount: () => void;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { TERMINAL_RENDER_PLANES, getPlaneTerminal } from "./
|
|
2
|
-
import {
|
|
3
|
-
import { ansiColorHex, ansiCssVar, installAnsiPaletteCssVars, isAnsiColorName } from "./ansi-palette-CNXqFciC.js";
|
|
1
|
+
import { TERMINAL_RENDER_PLANES, getPlaneTerminal, sanitizeDomHref } from "./hyperlink-_1FAj7Wq.js";
|
|
2
|
+
import { ansiColorHex, ansiCssVar, installAnsiPaletteCssVars, isAnsiColorName } from "./ansi-palette-CH6jc2Z7.js";
|
|
4
3
|
|
|
5
4
|
//#region src/renderer/capabilities.ts
|
|
6
5
|
const DOM_RENDERER_CAPABILITIES = Object.freeze({
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fixed, offline 32px avatar atlas for the top 100 human Vue core contributors.
|
|
3
|
+
* Ordered by the GitHub contributors API response after filtering bot accounts.
|
|
4
|
+
* Source: https://github.com/vuejs/core/graphs/contributors
|
|
5
|
+
* Avatars: https://avatars.githubusercontent.com (retrieved 2026-07-24).
|
|
6
|
+
*/
|
|
7
|
+
export declare const contributorAvatarLogins: readonly ["yyx990803", "edison1105", "sxzz", "HcySunYang", "pikax", "underfin", "Alfred-Skyblue", "jh-leong", "cexbrayat", "LinusBorg", "skirtles-code", "baiwusanyu-c", "dsseng", "haoqunjiang", "KazariEX", "linzhe141", "posva", "yangmingshan", "btea", "yangxiuxiu1115", "Akryum", "webfansplz", "zhangenming", "zhangzhonghe", "johnsoncodehk", "antfu", "a631807682", "jiangying000", "liulinboyi", "Doctor-wu", "ygj6", "unbyte", "himself65", "shengxinjing", "fisker", "danielroe", "CyberAP", "loiacon", "HerringtonDarkholme", "znck", "caozhong1996", "OnlyWick", "Picknight", "hareku", "zh-lx", "CodinCat", "godxiaoji", "lidlanca", "meteorlxy", "rudyxu1102", "wsypower", "basvanmeurs", "liuseen-l", "alex-snezhko", "fnlctrl", "CodeDaraW", "rzzf", "ztplz", "zqran", "Bigfish8", "Mini-ghost", "zzzzzhowie", "Amour1688", "zhiyuanzmj", "ysj16", "TerenceZ", "shadowings-zy", "inottn", "Rudeus3Greyrat", "KaelWD", "theniceangel", "JayFate", "xanf", "Justineo", "zhmushan", "susiwen8", "jods4", "ifer47", "chenfan0", "Zardddddd60", "jo0ger", "dsonet", "69hunter", "DV8FromTheWorld", "AjaiKN", "nandi95", "PengBoUESTC", "Notryag", "wonderful-panda", "wxsms", "yyyanghj", "javastation", "dlxqlig", "leaon4", "LongTengDao", "iiio2", "serkodev", "cuixiaorui", "sudongyuer", "hyfdev"];
|
|
8
|
+
export declare const contributorAvatarAtlas: {
|
|
9
|
+
readonly width: 512;
|
|
10
|
+
readonly height: 224;
|
|
11
|
+
readonly rgba: Uint8Array<ArrayBufferLike>;
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function encodeRgbaPng(rgba: Uint8Array, width: number, height: number): Uint8Array;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { T3DHitResult, T3DHitTestContext } from "../../../vue/components/T3DViewport.js";
|
|
2
|
+
export declare const TERMINAL_BADGE_CONTRIBUTOR_COUNT = 100;
|
|
3
|
+
export declare const terminalBadgeContributorRadiusScales: readonly number[];
|
|
4
|
+
export type TerminalBadgeContributorSphere = Readonly<{
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
z: number;
|
|
8
|
+
radius: number;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const terminalBadgeContributorSpheres: readonly TerminalBadgeContributorSphere[];
|
|
11
|
+
export declare function pickTerminalBadgeContributor(context: T3DHitTestContext): T3DHitResult | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const terminalBadge3DWgsl: string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { T3DRenderer } from "../../../vue/components/T3DViewport.js";
|
|
2
|
+
export type BunWebGPUTextureData = Readonly<{
|
|
3
|
+
/** Texture width in pixels. */
|
|
4
|
+
width: number;
|
|
5
|
+
/** Texture height in pixels. */
|
|
6
|
+
height: number;
|
|
7
|
+
/** Tightly packed RGBA8 pixels, ordered from top-left to bottom-right. */
|
|
8
|
+
rgba: Uint8Array;
|
|
9
|
+
}>;
|
|
10
|
+
export type BunWebGPU3DRendererOptions = Readonly<{
|
|
11
|
+
/** Compute shader with the T3D uniform block at binding 0 and RGBA8 storage output at binding 1. */
|
|
12
|
+
shader: string;
|
|
13
|
+
/** Optional RGBA8 sampled texture exposed to the shader at binding 2. */
|
|
14
|
+
texture?: BunWebGPUTextureData;
|
|
15
|
+
/** Label included in WebGPU resources and error messages. */
|
|
16
|
+
label?: string;
|
|
17
|
+
}>;
|
|
18
|
+
export type TerminalBadge3DRendererOptions = Readonly<{
|
|
19
|
+
/** Label included in WebGPU resources and error messages. */
|
|
20
|
+
label?: string;
|
|
21
|
+
}>;
|
|
22
|
+
export declare function rgbaToGray8(rgba: Uint8Array): Uint8Array;
|
|
23
|
+
/** Creates a Bun-only Pull renderer backed by a raw WGSL compute shader. */
|
|
24
|
+
export declare function createBunWebGPU3DRenderer(options: BunWebGPU3DRendererOptions): T3DRenderer;
|
|
25
|
+
/** Creates the direction-E vue-tui terminal badge renderer. */
|
|
26
|
+
export declare function createTerminalBadge3DRenderer(options?: TerminalBadge3DRendererOptions): T3DRenderer;
|