@simon_he/vue-tui 1.0.2 → 1.1.0
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 +84 -26
- package/dist/TMermaidText-frVr8Ysb.js +885 -0
- package/dist/{TSelect-DR0FomSu.js → TSelect-tJ87rKPM.js} +59 -242
- package/dist/{TTree-kzhlB5P0.js → TTree-CGdE-CYu.js} +138 -102
- package/dist/agent/mermaid.cjs +2 -0
- package/dist/agent/mermaid.d.cts +2 -0
- package/dist/agent/mermaid.d.ts +2 -0
- package/dist/agent/mermaid.js +1 -0
- package/dist/agent.cjs +31188 -24907
- package/dist/agent.d.cts +11 -1
- package/dist/agent.d.ts +11 -1
- package/dist/agent.js +516 -11
- package/dist/{block-source-CKUOnkgT.js → block-source-CrlmaBM5.js} +1039 -66
- package/dist/cli/input.d.ts +8 -0
- package/dist/cli/stdin-buffer.d.ts +1 -1
- 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 +5146 -6767
- package/dist/cli.d.cts +5 -1
- package/dist/cli.d.ts +5 -1
- package/dist/cli.js +2869 -154
- package/dist/core/buffer/eaw-ranges-unicode-17.d.ts +14 -0
- package/dist/core/perf/instrumentation-noop.d.ts +48 -0
- package/dist/core/perf/instrumentation.d.ts +136 -0
- package/dist/core/terminal/create-terminal.d.ts +1 -0
- package/dist/core.cjs +843 -1469
- package/dist/core.js +4 -5
- package/dist/create-terminal-app.d.ts +24 -1
- package/dist/debug-logger-CmsGI4of.js +74 -0
- package/dist/{dom-renderer-BniJSQyX.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 +6876 -6192
- package/dist/experimental.d.cts +7 -0
- package/dist/experimental.d.ts +7 -0
- package/dist/experimental.js +3005 -9
- package/dist/frame-perf-CHpWhbC4.js +111 -0
- package/dist/{create-terminal-DBFNYr8f.js → hyperlink-_1FAj7Wq.js} +440 -13
- package/dist/index.cjs +5017 -10339
- package/dist/index.js +14 -13
- package/dist/{linkify-D_gzn9Xq.js → linkify-D68T7rdW.js} +193 -3
- package/dist/markdown.cjs +21295 -12691
- package/dist/markdown.d.cts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/markdown.js +211 -51
- package/dist/mermaid-BNhM1jAZ.js +123 -0
- package/dist/mermaid.cjs +1707 -0
- package/dist/mermaid.d.cts +3 -0
- package/dist/mermaid.d.ts +3 -0
- package/dist/mermaid.js +6 -0
- package/dist/observability/frame-perf-store.d.ts +2 -1
- package/dist/observability/frame-perf.d.ts +33 -0
- package/dist/observability.cjs +106 -107
- package/dist/observability.d.cts +2 -2
- package/dist/observability.d.ts +2 -2
- package/dist/observability.js +3 -3
- package/dist/{wheel-scroll-vBRaQ7p-.js → rect-DUpeDfBg.js} +253 -117
- package/dist/renderer/cli/stdout-metrics.d.ts +10 -0
- package/dist/renderer/cli/stdout-renderer.d.ts +3 -0
- package/dist/renderer/terminal-graphic-render-queue.d.ts +50 -0
- package/dist/renderer/terminal-graphics-trace.d.ts +53 -0
- package/dist/renderer/terminal-graphics.d.ts +147 -0
- package/dist/renderer-dom.cjs +364 -903
- package/dist/renderer-dom.js +4 -5
- package/dist/runtime/index.d.ts +2 -0
- package/dist/{runtime-rfcZCyJq.js → runtime-Byf8XXOT.js} +28 -15
- package/dist/runtime.cjs +427 -889
- package/dist/runtime.js +2 -2
- package/dist/terminal-graphics-Bbe83wSr.js +597 -0
- package/dist/{terminal-selection-DBinO6p5.js → terminal-selection-4W1SJj4c.js} +4 -1
- package/dist/{tlog-theme-CvLFNMwk.js → tlog-theme-Bul2Na3u.js} +1237 -12
- package/dist/{trace-CjzYeIxN.js → trace-Bh8WnoMo.js} +5 -0
- package/dist/vue/agent/create-png-terminal-graphic-renderer.d.ts +19 -0
- package/dist/vue/components/T3DViewport.d.ts +473 -0
- package/dist/vue/components/TAgentTerminalGraphic.d.ts +494 -0
- package/dist/vue/components/TCharts.d.ts +1121 -0
- package/dist/vue/components/TFeedback.d.ts +1 -1
- package/dist/vue/components/TFlex.d.ts +389 -0
- package/dist/vue/components/TForm.d.ts +4 -4
- package/dist/vue/components/TLogSearchBar.d.ts +3 -3
- package/dist/vue/components/TLogSearchPager.d.ts +2 -2
- package/dist/vue/components/TMarkdownText.d.ts +162 -4
- package/dist/vue/components/TMermaidText.d.ts +900 -0
- package/dist/vue/components/TVideo.d.ts +291 -0
- package/dist/vue/components/TVirtualList.d.ts +9 -0
- package/dist/vue/components/TVirtualMarkdown.d.ts +170 -9
- package/dist/vue/components/TVirtualRows.d.ts +9 -0
- package/dist/vue/components/TerminalProvider.d.ts +2 -0
- package/dist/vue/context.d.ts +24 -0
- package/dist/vue/index.d.ts +5 -0
- package/dist/vue/layout/flex.d.ts +67 -0
- package/dist/vue/markdown/ast.d.ts +5 -2
- package/dist/vue/markdown/document.d.ts +5 -0
- package/dist/vue/markdown/image-actions.d.ts +14 -0
- package/dist/vue/markdown/image.d.ts +11 -0
- package/dist/vue/markdown/link-actions.d.ts +14 -0
- package/dist/vue/markdown/math-actions.d.ts +14 -0
- package/dist/vue/markdown/math.d.ts +6 -0
- package/dist/vue/markdown/render.d.ts +28 -0
- package/dist/vue/markdown/types.d.ts +78 -0
- package/dist/vue/mermaid/beautiful-mermaid.d.ts +1436 -0
- package/dist/vue/render/render-manager.d.ts +7 -0
- package/dist/vue/video/types.d.ts +39 -0
- package/dist/vue.cjs +7207 -12437
- package/dist/vue.js +704 -38
- package/dist/wheel-scroll-DASkEZr-.js +106 -0
- package/dist/{hyperlink-Bn02UXJb.js → width-GqllnV8C.js} +166 -111
- package/package.json +119 -14
- package/dist/frame-perf-C6Xfg85O.js +0 -24
- package/dist/sgr-BmzxEjAO.js +0 -304
- /package/dist/{ansi-palette-CNXqFciC.js → ansi-palette-CH6jc2Z7.js} +0 -0
- /package/dist/{path-suggest-BNqcuE3-.js → path-suggest-Dndu4dTi.js} +0 -0
package/dist/agent.d.cts
CHANGED
|
@@ -3,6 +3,8 @@ export { TDialog } from "./vue/components/TDialog.js";
|
|
|
3
3
|
export { TInput } from "./vue/components/TInput.js";
|
|
4
4
|
export { TSelect } from "./vue/components/TSelect.js";
|
|
5
5
|
export { TText } from "./vue/components/TText.js";
|
|
6
|
+
export { TAgentTerminalGraphic } from "./vue/components/TAgentTerminalGraphic.js";
|
|
7
|
+
export type { TAgentTerminalGraphicKind, TAgentTerminalGraphicRenderer, TAgentTerminalGraphicRendererContext, TAgentTerminalGraphicRenderResult, TAgentTerminalGraphicProps, TAgentTerminalGraphicTraceEvent, } from "./vue/components/TAgentTerminalGraphic.js";
|
|
6
8
|
export { TThinkingView } from "./vue/components/TThinkingView.js";
|
|
7
9
|
export { TToolCallView } from "./vue/components/TToolCallView.js";
|
|
8
10
|
export { TUserMessageView } from "./vue/components/TUserMessageView.js";
|
|
@@ -21,6 +23,14 @@ export { TLogLinksPanel } from "./vue/components/TLogLinksPanel.js";
|
|
|
21
23
|
export { TLogVirtualSearchResults } from "./vue/components/TLogVirtualSearchResults.js";
|
|
22
24
|
export { TLogVirtualLinksPanel } from "./vue/components/TLogVirtualLinksPanel.js";
|
|
23
25
|
export { TVirtualMarkdown } from "./vue/components/TVirtualMarkdown.js";
|
|
26
|
+
export { isSimpleMermaidFlowchartSource, markMermaidRenderErrorFatal, TMermaid, TMermaidText, } from "./vue/components/TMermaidText.js";
|
|
27
|
+
export type { CreatePngTerminalGraphicRendererOptions, PngTerminalGraphicFrame, } from "./vue/agent/create-png-terminal-graphic-renderer.js";
|
|
28
|
+
export { createPngTerminalGraphicRenderer } from "./vue/agent/create-png-terminal-graphic-renderer.js";
|
|
29
|
+
export type { TerminalGraphicRenderQueue, TerminalGraphicRenderQueueMetric, TerminalGraphicRenderQueueOptions, } from "./renderer/terminal-graphic-render-queue.js";
|
|
30
|
+
export { createTerminalGraphicRenderQueue } from "./renderer/terminal-graphic-render-queue.js";
|
|
31
|
+
export type { CreateKittyDeleteGraphicsSequenceOptions, CreateKittyGraphicsSequenceOptions, TerminalGraphicsCapabilities, TerminalGraphicsDetectionInput, TerminalGraphicsFallbackProtocol, TerminalGraphicsMultiplexer, TerminalGraphicsProtocol, TerminalGraphicsResolvedProtocol, } from "./renderer/terminal-graphics.js";
|
|
32
|
+
export { createIterm2InlineImageSequence, createKittyDeleteGraphicsSequence, createKittyGraphicsSequence, createKittyPlacementSequence, detectTerminalGraphicsCapabilities, getTerminalGraphicsOutput, getTerminalGraphicsOutputVersion, subscribeTerminalGraphicsOutput, } from "./renderer/terminal-graphics.js";
|
|
33
|
+
export type { TMermaidAsciiOptions, TMermaidAsciiTheme, TMermaidCopyPayload, TMermaidRenderer, TMermaidRenderEligibility, TMermaidRenderEligibilityContext, TMermaidResolvedAsciiOptions, TMermaidTextProps, TMermaidTransientErrorClassifier, TMermaidTransientErrorContext, } from "./vue/components/TMermaidText.js";
|
|
24
34
|
export { createMarkdownBlockSource } from "./vue/markdown/block-source.js";
|
|
25
35
|
export { createAppendOnlyLogStore } from "./vue/log/append-only-log-store.js";
|
|
26
36
|
export { useTLogLinkController } from "./vue/log/use-tlog-link-controller.js";
|
|
@@ -39,6 +49,6 @@ export type { TTranscriptAction, TTranscriptDataSource, TTranscriptHitRegion, TT
|
|
|
39
49
|
export type { TLogViewHandle, TLogViewLinkActivatePayload, TLogViewLinkClickPayload, TLogViewLinkFocusPayload, TLogViewScrollMetrics, TLogViewSearchError, TLogViewSearchMarker, TLogViewSearchMarkersPayload, TLogViewSearchMatch, TLogViewSearchMatchPayload, TLogViewSearchMode, TLogViewSearchOptions, TLogViewSearchPayload, TLogViewSearchResult, TLogViewSearchResultPreview, TLogViewSearchResultsOptions, TLogViewSearchState, TLogViewSelectSearchMatchOptions, TLogViewVisibleLink, TLogViewVisualIndexPayload, } from "./vue/components/TLogView.js";
|
|
40
50
|
export type { AppendOnlyLogStore, CreateAppendOnlyLogStoreOptions, TLogDataSource, TLogViewScrollPayload, TLogViewVisualIndexOptions, TLogViewVisualIndexStatus, } from "./vue/log/types.js";
|
|
41
51
|
export type { TuiMarkdownBlockSource, TuiMarkdownBlockSourceOptions, TuiMarkdownBlockSourceSnapshot, } from "./vue/markdown/block-source.js";
|
|
42
|
-
export type { TuiMarkdownBlock, TuiMarkdownInlineSegment, TuiMarkdownNode, TuiMarkdownTableCell, TuiMarkdownTableCellAlign, TuiMarkdownVisualRow, TuiMarkdownVisualSegment, } from "./vue/markdown/types.js";
|
|
52
|
+
export type { TuiMarkdownBlock, TuiMarkdownGraphicSegment, TuiMarkdownImageResolver, TuiMarkdownImageResolverResult, TuiMarkdownInlineSegment, TuiMarkdownNode, TuiMarkdownTableCell, TuiMarkdownTableCellAlign, TuiMarkdownVisualRow, TuiMarkdownVisualSegment, } from "./vue/markdown/types.js";
|
|
43
53
|
export type { TLogTheme, TLogUiPreset } from "./vue/log/tlog-theme.js";
|
|
44
54
|
export type { TLogPluginLinkSource, TLogPluginSeverity, TLogPluginVisualSegment, TLogParsedOsc8Link, TLogViewExternalLink, TLogViewExternalMarker, TLogViewPlugin, TLogViewPluginDensityContext, TLogViewPluginDecorateSegmentsContext, TLogViewPluginIndexedLine, TLogViewPluginLineLink, TLogViewPluginLineMarker, TLogViewPluginLineMetadata, TLogViewPluginMarkerContext, TLogViewPluginParseLineContext, TLogUrlPluginOptions, } from "./vue/log/tlog-plugins.js";
|
package/dist/agent.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ export { TDialog } from "./vue/components/TDialog.js";
|
|
|
3
3
|
export { TInput } from "./vue/components/TInput.js";
|
|
4
4
|
export { TSelect } from "./vue/components/TSelect.js";
|
|
5
5
|
export { TText } from "./vue/components/TText.js";
|
|
6
|
+
export { TAgentTerminalGraphic } from "./vue/components/TAgentTerminalGraphic.js";
|
|
7
|
+
export type { TAgentTerminalGraphicKind, TAgentTerminalGraphicRenderer, TAgentTerminalGraphicRendererContext, TAgentTerminalGraphicRenderResult, TAgentTerminalGraphicProps, TAgentTerminalGraphicTraceEvent, } from "./vue/components/TAgentTerminalGraphic.js";
|
|
6
8
|
export { TThinkingView } from "./vue/components/TThinkingView.js";
|
|
7
9
|
export { TToolCallView } from "./vue/components/TToolCallView.js";
|
|
8
10
|
export { TUserMessageView } from "./vue/components/TUserMessageView.js";
|
|
@@ -21,6 +23,14 @@ export { TLogLinksPanel } from "./vue/components/TLogLinksPanel.js";
|
|
|
21
23
|
export { TLogVirtualSearchResults } from "./vue/components/TLogVirtualSearchResults.js";
|
|
22
24
|
export { TLogVirtualLinksPanel } from "./vue/components/TLogVirtualLinksPanel.js";
|
|
23
25
|
export { TVirtualMarkdown } from "./vue/components/TVirtualMarkdown.js";
|
|
26
|
+
export { isSimpleMermaidFlowchartSource, markMermaidRenderErrorFatal, TMermaid, TMermaidText, } from "./vue/components/TMermaidText.js";
|
|
27
|
+
export type { CreatePngTerminalGraphicRendererOptions, PngTerminalGraphicFrame, } from "./vue/agent/create-png-terminal-graphic-renderer.js";
|
|
28
|
+
export { createPngTerminalGraphicRenderer } from "./vue/agent/create-png-terminal-graphic-renderer.js";
|
|
29
|
+
export type { TerminalGraphicRenderQueue, TerminalGraphicRenderQueueMetric, TerminalGraphicRenderQueueOptions, } from "./renderer/terminal-graphic-render-queue.js";
|
|
30
|
+
export { createTerminalGraphicRenderQueue } from "./renderer/terminal-graphic-render-queue.js";
|
|
31
|
+
export type { CreateKittyDeleteGraphicsSequenceOptions, CreateKittyGraphicsSequenceOptions, TerminalGraphicsCapabilities, TerminalGraphicsDetectionInput, TerminalGraphicsFallbackProtocol, TerminalGraphicsMultiplexer, TerminalGraphicsProtocol, TerminalGraphicsResolvedProtocol, } from "./renderer/terminal-graphics.js";
|
|
32
|
+
export { createIterm2InlineImageSequence, createKittyDeleteGraphicsSequence, createKittyGraphicsSequence, createKittyPlacementSequence, detectTerminalGraphicsCapabilities, getTerminalGraphicsOutput, getTerminalGraphicsOutputVersion, subscribeTerminalGraphicsOutput, } from "./renderer/terminal-graphics.js";
|
|
33
|
+
export type { TMermaidAsciiOptions, TMermaidAsciiTheme, TMermaidCopyPayload, TMermaidRenderer, TMermaidRenderEligibility, TMermaidRenderEligibilityContext, TMermaidResolvedAsciiOptions, TMermaidTextProps, TMermaidTransientErrorClassifier, TMermaidTransientErrorContext, } from "./vue/components/TMermaidText.js";
|
|
24
34
|
export { createMarkdownBlockSource } from "./vue/markdown/block-source.js";
|
|
25
35
|
export { createAppendOnlyLogStore } from "./vue/log/append-only-log-store.js";
|
|
26
36
|
export { useTLogLinkController } from "./vue/log/use-tlog-link-controller.js";
|
|
@@ -39,6 +49,6 @@ export type { TTranscriptAction, TTranscriptDataSource, TTranscriptHitRegion, TT
|
|
|
39
49
|
export type { TLogViewHandle, TLogViewLinkActivatePayload, TLogViewLinkClickPayload, TLogViewLinkFocusPayload, TLogViewScrollMetrics, TLogViewSearchError, TLogViewSearchMarker, TLogViewSearchMarkersPayload, TLogViewSearchMatch, TLogViewSearchMatchPayload, TLogViewSearchMode, TLogViewSearchOptions, TLogViewSearchPayload, TLogViewSearchResult, TLogViewSearchResultPreview, TLogViewSearchResultsOptions, TLogViewSearchState, TLogViewSelectSearchMatchOptions, TLogViewVisibleLink, TLogViewVisualIndexPayload, } from "./vue/components/TLogView.js";
|
|
40
50
|
export type { AppendOnlyLogStore, CreateAppendOnlyLogStoreOptions, TLogDataSource, TLogViewScrollPayload, TLogViewVisualIndexOptions, TLogViewVisualIndexStatus, } from "./vue/log/types.js";
|
|
41
51
|
export type { TuiMarkdownBlockSource, TuiMarkdownBlockSourceOptions, TuiMarkdownBlockSourceSnapshot, } from "./vue/markdown/block-source.js";
|
|
42
|
-
export type { TuiMarkdownBlock, TuiMarkdownInlineSegment, TuiMarkdownNode, TuiMarkdownTableCell, TuiMarkdownTableCellAlign, TuiMarkdownVisualRow, TuiMarkdownVisualSegment, } from "./vue/markdown/types.js";
|
|
52
|
+
export type { TuiMarkdownBlock, TuiMarkdownGraphicSegment, TuiMarkdownImageResolver, TuiMarkdownImageResolverResult, TuiMarkdownInlineSegment, TuiMarkdownNode, TuiMarkdownTableCell, TuiMarkdownTableCellAlign, TuiMarkdownVisualRow, TuiMarkdownVisualSegment, } from "./vue/markdown/types.js";
|
|
43
53
|
export type { TLogTheme, TLogUiPreset } from "./vue/log/tlog-theme.js";
|
|
44
54
|
export type { TLogPluginLinkSource, TLogPluginSeverity, TLogPluginVisualSegment, TLogParsedOsc8Link, TLogViewExternalLink, TLogViewExternalMarker, TLogViewPlugin, TLogViewPluginDensityContext, TLogViewPluginDecorateSegmentsContext, TLogViewPluginIndexedLine, TLogViewPluginLineLink, TLogViewPluginLineMarker, TLogViewPluginLineMetadata, TLogViewPluginMarkerContext, TLogViewPluginParseLineContext, TLogUrlPluginOptions, } from "./vue/log/tlog-plugins.js";
|
package/dist/agent.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import "./
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import "./
|
|
7
|
-
import
|
|
8
|
-
import "./
|
|
1
|
+
import "./hyperlink-_1FAj7Wq.js";
|
|
2
|
+
import "./width-GqllnV8C.js";
|
|
3
|
+
import { forEachTextCellSegment, recordTerminalGraphicTrace, sanitizeInlineText, sanitizeTextBlock, sliceByCells, spaces, textCellWidth$1 as textCellWidth, useTerminal, withTextWidthProvider } from "./rect-DUpeDfBg.js";
|
|
4
|
+
import { TText, TView } from "./linkify-D68T7rdW.js";
|
|
5
|
+
import "./frame-perf-CHpWhbC4.js";
|
|
6
|
+
import "./env-Cl8qmNFN.js";
|
|
7
|
+
import "./terminal-selection-4W1SJj4c.js";
|
|
8
|
+
import "./debug-logger-CmsGI4of.js";
|
|
9
|
+
import { TBox, TCommandPalette, TDialog, TInput, TRenderPlane, TSelect, computeCommandPaletteMatchRanges } from "./TSelect-tJ87rKPM.js";
|
|
9
10
|
import "./path-mnSgEpCm.js";
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
11
|
+
import "./wheel-scroll-DASkEZr-.js";
|
|
12
|
+
import { TMermaid$1 as TMermaid, TMermaidText$1 as TMermaidText, isSimpleMermaidFlowchartSource, markMermaidRenderErrorFatal } from "./TMermaidText-frVr8Ysb.js";
|
|
13
|
+
import { createIterm2InlineImageSequence, createKittyDeleteGraphicsSequence, createKittyGraphicsSequence, createKittyPlacementSequence, detectTerminalGraphicsCapabilities, getTerminalGraphicsOutput, getTerminalGraphicsOutputVersion, hashTerminalGraphicsString, isSafeTerminalGraphicsSequence, normalizeTerminalGraphicSize, sanitizeTerminalFallbackText, subscribeTerminalGraphicsOutput } from "./terminal-graphics-Bbe83wSr.js";
|
|
14
|
+
import { TVirtualMarkdown, createMarkdownBlockSource } from "./block-source-CrlmaBM5.js";
|
|
15
|
+
import { TAgentTerminalGraphic, TLogLinksPanel, TLogMinimap, TLogScrollbar, TLogSearchBar, TLogSearchPager, TLogSearchResults, TLogView, TLogVirtualLinksPanel, TLogVirtualSearchResults, TTranscriptView, TVirtualList, createAppendOnlyLogStore, createTLogDensityBucketsFromMarkers, createTLogLevelPlugin, createTLogLineMatcherPlugin, createTLogLinkActionPlugin, createTLogOsc8LinkPlugin, createTLogUrlPlugin, detectTLogUrls, dispatchTLogPluginLinkAction, getTLogPluginMetadata, parseTLogAnnotatedText, resolveTLogLinksPanelTheme, resolveTLogMinimapTheme, resolveTLogScrollbarTheme, resolveTLogSearchBarTheme, resolveTLogSearchPagerTheme, resolveTLogSearchResultsTheme, resolveTLogViewTheme, stripTLogAnsiText, tlogDarkPreset, tlogDarkTheme, tlogDefaultPreset, tlogDefaultTheme, tlogHighContrastPreset, tlogHighContrastTheme, toTLogExternalLinkFromVisibleLink, useTLogLinkController, useTLogRetainedIndex, useTLogSearchController, useTLogSearchResultsPage, useTLogVirtualSearchResults } from "./tlog-theme-Bul2Na3u.js";
|
|
12
16
|
import { computed, defineComponent, h } from "vue";
|
|
13
17
|
|
|
14
18
|
//#region src/vue/agent/view-models.ts
|
|
@@ -825,4 +829,505 @@ const TUserMessageView = defineComponent({
|
|
|
825
829
|
});
|
|
826
830
|
|
|
827
831
|
//#endregion
|
|
828
|
-
|
|
832
|
+
//#region src/renderer/terminal-graphic-render-queue.ts
|
|
833
|
+
const CACHE_MISS = Symbol("terminal-graphic-cache-miss");
|
|
834
|
+
function now() {
|
|
835
|
+
return typeof performance !== "undefined" && typeof performance.now === "function" ? performance.now() : Date.now();
|
|
836
|
+
}
|
|
837
|
+
function createAbortError() {
|
|
838
|
+
const error = new Error("Terminal graphic render aborted");
|
|
839
|
+
error.name = "AbortError";
|
|
840
|
+
return error;
|
|
841
|
+
}
|
|
842
|
+
function positiveFiniteInt(value, fallback) {
|
|
843
|
+
const n = Number(value);
|
|
844
|
+
if (!Number.isFinite(n)) return fallback;
|
|
845
|
+
const int = Math.floor(n);
|
|
846
|
+
return int > 0 ? int : fallback;
|
|
847
|
+
}
|
|
848
|
+
function throwIfAborted$1(signal) {
|
|
849
|
+
if (signal?.aborted) throw createAbortError();
|
|
850
|
+
}
|
|
851
|
+
function raceAbort(promise, signal) {
|
|
852
|
+
if (!signal) return promise;
|
|
853
|
+
if (signal.aborted) return Promise.reject(createAbortError());
|
|
854
|
+
return new Promise((resolve, reject) => {
|
|
855
|
+
const onAbort = () => reject(createAbortError());
|
|
856
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
857
|
+
promise.then((value) => {
|
|
858
|
+
signal.removeEventListener("abort", onAbort);
|
|
859
|
+
resolve(value);
|
|
860
|
+
}, (error) => {
|
|
861
|
+
signal.removeEventListener("abort", onAbort);
|
|
862
|
+
reject(error);
|
|
863
|
+
});
|
|
864
|
+
});
|
|
865
|
+
}
|
|
866
|
+
function createTerminalGraphicRenderQueue(options = {}) {
|
|
867
|
+
const maxConcurrency = positiveFiniteInt(options.maxConcurrency, 2);
|
|
868
|
+
const maxEntries = positiveFiniteInt(options.maxEntries, 128);
|
|
869
|
+
const maxBytes = positiveFiniteInt(options.maxBytes, 32 * 1024 * 1024);
|
|
870
|
+
const ttlMs = positiveFiniteInt(options.ttlMs, 5 * 6e4);
|
|
871
|
+
const dedupeInflight = options.dedupeInflight ?? false;
|
|
872
|
+
let active = 0;
|
|
873
|
+
let cacheBytes = 0;
|
|
874
|
+
let generation = 0;
|
|
875
|
+
const waiters = [];
|
|
876
|
+
const cache = new Map();
|
|
877
|
+
const inflight = new Map();
|
|
878
|
+
function traceQueueState(event) {
|
|
879
|
+
recordTerminalGraphicTrace({
|
|
880
|
+
...event,
|
|
881
|
+
active,
|
|
882
|
+
waiting: waiters.length,
|
|
883
|
+
cacheEntries: cache.size,
|
|
884
|
+
cacheBytes
|
|
885
|
+
});
|
|
886
|
+
}
|
|
887
|
+
function evictUntilBudget() {
|
|
888
|
+
while (cache.size > maxEntries || cacheBytes > maxBytes) {
|
|
889
|
+
const oldestKey = cache.keys().next().value;
|
|
890
|
+
if (!oldestKey) break;
|
|
891
|
+
const entry = cache.get(oldestKey);
|
|
892
|
+
cache.delete(oldestKey);
|
|
893
|
+
if (entry) {
|
|
894
|
+
cacheBytes -= entry.bytes;
|
|
895
|
+
options.onMetric?.({
|
|
896
|
+
type: "evict",
|
|
897
|
+
key: oldestKey,
|
|
898
|
+
bytes: entry.bytes
|
|
899
|
+
});
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
function setCache(key, value, bytes) {
|
|
904
|
+
const prev = cache.get(key);
|
|
905
|
+
if (prev) {
|
|
906
|
+
cache.delete(key);
|
|
907
|
+
cacheBytes -= prev.bytes;
|
|
908
|
+
}
|
|
909
|
+
if (bytes > maxBytes) return;
|
|
910
|
+
cache.set(key, {
|
|
911
|
+
value,
|
|
912
|
+
bytes,
|
|
913
|
+
expiresAt: Date.now() + ttlMs
|
|
914
|
+
});
|
|
915
|
+
cacheBytes += bytes;
|
|
916
|
+
options.onMetric?.({
|
|
917
|
+
type: "cache-store",
|
|
918
|
+
key,
|
|
919
|
+
bytes
|
|
920
|
+
});
|
|
921
|
+
traceQueueState({
|
|
922
|
+
type: "cache-store",
|
|
923
|
+
id: key,
|
|
924
|
+
key,
|
|
925
|
+
bytes
|
|
926
|
+
});
|
|
927
|
+
evictUntilBudget();
|
|
928
|
+
}
|
|
929
|
+
function getCache(key) {
|
|
930
|
+
const entry = cache.get(key);
|
|
931
|
+
if (!entry) return CACHE_MISS;
|
|
932
|
+
if (entry.expiresAt < Date.now()) {
|
|
933
|
+
cache.delete(key);
|
|
934
|
+
cacheBytes -= entry.bytes;
|
|
935
|
+
return CACHE_MISS;
|
|
936
|
+
}
|
|
937
|
+
cache.delete(key);
|
|
938
|
+
cache.set(key, entry);
|
|
939
|
+
options.onMetric?.({
|
|
940
|
+
type: "cache-hit",
|
|
941
|
+
key
|
|
942
|
+
});
|
|
943
|
+
traceQueueState({
|
|
944
|
+
type: "cache-hit",
|
|
945
|
+
id: key,
|
|
946
|
+
key,
|
|
947
|
+
bytes: entry.bytes
|
|
948
|
+
});
|
|
949
|
+
return entry.value;
|
|
950
|
+
}
|
|
951
|
+
function release() {
|
|
952
|
+
active = Math.max(0, active - 1);
|
|
953
|
+
pump();
|
|
954
|
+
}
|
|
955
|
+
function once(fn) {
|
|
956
|
+
let called = false;
|
|
957
|
+
return () => {
|
|
958
|
+
if (called) return;
|
|
959
|
+
called = true;
|
|
960
|
+
fn();
|
|
961
|
+
};
|
|
962
|
+
}
|
|
963
|
+
function observeActiveRenderAbort(key, signal) {
|
|
964
|
+
if (!signal) return () => void 0;
|
|
965
|
+
const onAbort = () => {
|
|
966
|
+
options.onMetric?.({
|
|
967
|
+
type: "render-abort",
|
|
968
|
+
key
|
|
969
|
+
});
|
|
970
|
+
traceQueueState({
|
|
971
|
+
type: "renderer-abort",
|
|
972
|
+
id: key,
|
|
973
|
+
key
|
|
974
|
+
});
|
|
975
|
+
};
|
|
976
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
977
|
+
return () => signal.removeEventListener("abort", onAbort);
|
|
978
|
+
}
|
|
979
|
+
function pump() {
|
|
980
|
+
while (active < maxConcurrency && waiters.length > 0) {
|
|
981
|
+
const waiter = waiters.shift();
|
|
982
|
+
active++;
|
|
983
|
+
traceQueueState({
|
|
984
|
+
type: "queue-depth",
|
|
985
|
+
id: waiter.key,
|
|
986
|
+
key: waiter.key
|
|
987
|
+
});
|
|
988
|
+
waiter.start();
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
function acquire(key, signal) {
|
|
992
|
+
throwIfAborted$1(signal);
|
|
993
|
+
if (active < maxConcurrency) {
|
|
994
|
+
active++;
|
|
995
|
+
traceQueueState({
|
|
996
|
+
type: "queue-depth",
|
|
997
|
+
id: key,
|
|
998
|
+
key
|
|
999
|
+
});
|
|
1000
|
+
return Promise.resolve(release);
|
|
1001
|
+
}
|
|
1002
|
+
const waitStartedAt = now();
|
|
1003
|
+
return new Promise((resolve, reject) => {
|
|
1004
|
+
let onAbort = () => void 0;
|
|
1005
|
+
const cleanup = () => {
|
|
1006
|
+
signal?.removeEventListener("abort", onAbort);
|
|
1007
|
+
};
|
|
1008
|
+
const waiter = {
|
|
1009
|
+
key,
|
|
1010
|
+
start: () => {
|
|
1011
|
+
cleanup();
|
|
1012
|
+
const waitMs = now() - waitStartedAt;
|
|
1013
|
+
options.onMetric?.({
|
|
1014
|
+
type: "queue-wait",
|
|
1015
|
+
key,
|
|
1016
|
+
waitMs
|
|
1017
|
+
});
|
|
1018
|
+
traceQueueState({
|
|
1019
|
+
type: "queue-wait",
|
|
1020
|
+
id: key,
|
|
1021
|
+
key,
|
|
1022
|
+
durationMs: waitMs
|
|
1023
|
+
});
|
|
1024
|
+
resolve(release);
|
|
1025
|
+
},
|
|
1026
|
+
reject: (error) => {
|
|
1027
|
+
cleanup();
|
|
1028
|
+
reject(error);
|
|
1029
|
+
}
|
|
1030
|
+
};
|
|
1031
|
+
onAbort = () => {
|
|
1032
|
+
const index = waiters.indexOf(waiter);
|
|
1033
|
+
if (index >= 0) waiters.splice(index, 1);
|
|
1034
|
+
cleanup();
|
|
1035
|
+
reject(createAbortError());
|
|
1036
|
+
};
|
|
1037
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
1038
|
+
waiters.push(waiter);
|
|
1039
|
+
traceQueueState({
|
|
1040
|
+
type: "queue-depth",
|
|
1041
|
+
id: key,
|
|
1042
|
+
key
|
|
1043
|
+
});
|
|
1044
|
+
});
|
|
1045
|
+
}
|
|
1046
|
+
async function cached(key, signal, render, estimateBytes = () => 0, cachedOptions = {}) {
|
|
1047
|
+
throwIfAborted$1(signal);
|
|
1048
|
+
const cachedValue = getCache(key);
|
|
1049
|
+
if (cachedValue !== CACHE_MISS) return cachedValue;
|
|
1050
|
+
traceQueueState({
|
|
1051
|
+
type: "cache-miss",
|
|
1052
|
+
id: key,
|
|
1053
|
+
key
|
|
1054
|
+
});
|
|
1055
|
+
const shouldDedupeInflight = cachedOptions.dedupeInflight ?? dedupeInflight;
|
|
1056
|
+
const existing = shouldDedupeInflight ? inflight.get(key) : void 0;
|
|
1057
|
+
if (existing) return raceAbort(existing, signal);
|
|
1058
|
+
let promise;
|
|
1059
|
+
promise = (async () => {
|
|
1060
|
+
let releaseSlot = null;
|
|
1061
|
+
let removeAbortObserver = null;
|
|
1062
|
+
const renderGeneration = generation;
|
|
1063
|
+
try {
|
|
1064
|
+
releaseSlot = once(await acquire(key, signal));
|
|
1065
|
+
removeAbortObserver = observeActiveRenderAbort(key, signal);
|
|
1066
|
+
throwIfAborted$1(signal);
|
|
1067
|
+
const cachedAfterWait = getCache(key);
|
|
1068
|
+
if (cachedAfterWait !== CACHE_MISS) return cachedAfterWait;
|
|
1069
|
+
const value = await render();
|
|
1070
|
+
throwIfAborted$1(signal);
|
|
1071
|
+
const rawBytes = Math.floor(Number(estimateBytes(value)));
|
|
1072
|
+
const bytes = Number.isFinite(rawBytes) && rawBytes > 0 ? rawBytes : 0;
|
|
1073
|
+
if (renderGeneration === generation) setCache(key, value, bytes);
|
|
1074
|
+
return value;
|
|
1075
|
+
} finally {
|
|
1076
|
+
removeAbortObserver?.();
|
|
1077
|
+
releaseSlot?.();
|
|
1078
|
+
if (shouldDedupeInflight && inflight.get(key) === promise) inflight.delete(key);
|
|
1079
|
+
}
|
|
1080
|
+
})();
|
|
1081
|
+
if (shouldDedupeInflight) inflight.set(key, promise);
|
|
1082
|
+
return raceAbort(promise, signal);
|
|
1083
|
+
}
|
|
1084
|
+
return {
|
|
1085
|
+
cached,
|
|
1086
|
+
clear() {
|
|
1087
|
+
generation++;
|
|
1088
|
+
cache.clear();
|
|
1089
|
+
inflight.clear();
|
|
1090
|
+
const pending = waiters.splice(0);
|
|
1091
|
+
for (const waiter of pending) waiter.reject(createAbortError());
|
|
1092
|
+
cacheBytes = 0;
|
|
1093
|
+
},
|
|
1094
|
+
stats() {
|
|
1095
|
+
return {
|
|
1096
|
+
active,
|
|
1097
|
+
waiting: waiters.length,
|
|
1098
|
+
cacheEntries: cache.size,
|
|
1099
|
+
cacheBytes
|
|
1100
|
+
};
|
|
1101
|
+
}
|
|
1102
|
+
};
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
//#endregion
|
|
1106
|
+
//#region src/vue/agent/create-png-terminal-graphic-renderer.ts
|
|
1107
|
+
function positiveInt(value) {
|
|
1108
|
+
const n = Math.floor(Number(value));
|
|
1109
|
+
return Number.isFinite(n) && n > 0 ? n : void 0;
|
|
1110
|
+
}
|
|
1111
|
+
function abortError() {
|
|
1112
|
+
const error = new Error("Terminal graphic render aborted");
|
|
1113
|
+
error.name = "AbortError";
|
|
1114
|
+
return error;
|
|
1115
|
+
}
|
|
1116
|
+
function base64PrefixBytes(value, byteCount) {
|
|
1117
|
+
const data = String(value ?? "").replace(/\s+/g, "");
|
|
1118
|
+
const chars = Math.ceil(byteCount / 3) * 4;
|
|
1119
|
+
try {
|
|
1120
|
+
const binary = atob(data.slice(0, chars));
|
|
1121
|
+
const bytes = new Uint8Array(binary.length);
|
|
1122
|
+
for (let index = 0; index < binary.length; index += 1) bytes[index] = binary.charCodeAt(index);
|
|
1123
|
+
return bytes;
|
|
1124
|
+
} catch {
|
|
1125
|
+
return null;
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
function readPngDimensions(base64) {
|
|
1129
|
+
const bytes = base64PrefixBytes(base64, 24);
|
|
1130
|
+
if (!bytes || bytes.length < 24) return null;
|
|
1131
|
+
if (bytes[0] !== 137 || bytes[1] !== 80 || bytes[2] !== 78 || bytes[3] !== 71 || bytes[4] !== 13 || bytes[5] !== 10 || bytes[6] !== 26 || bytes[7] !== 10) return null;
|
|
1132
|
+
const width = (bytes[16] << 24 | bytes[17] << 16 | bytes[18] << 8 | bytes[19]) >>> 0;
|
|
1133
|
+
const height = (bytes[20] << 24 | bytes[21] << 16 | bytes[22] << 8 | bytes[23]) >>> 0;
|
|
1134
|
+
return width > 0 && height > 0 ? {
|
|
1135
|
+
width,
|
|
1136
|
+
height
|
|
1137
|
+
} : null;
|
|
1138
|
+
}
|
|
1139
|
+
function throwIfAborted(signal) {
|
|
1140
|
+
if (signal.aborted) throw abortError();
|
|
1141
|
+
}
|
|
1142
|
+
function defaultCacheKey(content, context, cacheSalt) {
|
|
1143
|
+
const contentIdentity = context.cacheKey != null ? `cache:${context.cacheKey}` : `content:${hashTerminalGraphicsString(content)}`;
|
|
1144
|
+
return [
|
|
1145
|
+
context.kind,
|
|
1146
|
+
context.width,
|
|
1147
|
+
context.height ?? "",
|
|
1148
|
+
context.final ? "final" : "draft",
|
|
1149
|
+
cacheSalt,
|
|
1150
|
+
contentIdentity
|
|
1151
|
+
].join("");
|
|
1152
|
+
}
|
|
1153
|
+
function resolveCacheSalt(options, content, context) {
|
|
1154
|
+
const salt = typeof options.cacheSalt === "function" ? options.cacheSalt(content, context) : options.cacheSalt;
|
|
1155
|
+
return salt == null ? "" : String(salt);
|
|
1156
|
+
}
|
|
1157
|
+
function normalizeCachedPngFrame(frame, context) {
|
|
1158
|
+
const fallbackCols = normalizeTerminalGraphicSize(context.width, 1)?.width ?? 1;
|
|
1159
|
+
const requestedCols = positiveInt(frame.cols) ?? fallbackCols;
|
|
1160
|
+
const cols = Math.min(requestedCols, fallbackCols);
|
|
1161
|
+
const rawRows = positiveInt(frame.rows) ?? positiveInt(context.height);
|
|
1162
|
+
const size = normalizeTerminalGraphicSize(cols, rawRows ?? 1);
|
|
1163
|
+
if (rawRows != null && !size) return {
|
|
1164
|
+
base64: "",
|
|
1165
|
+
fallback: frame.fallback == null ? void 0 : sanitizeTerminalFallbackText(frame.fallback),
|
|
1166
|
+
cols: fallbackCols
|
|
1167
|
+
};
|
|
1168
|
+
const base64 = String(frame.base64 ?? "").replace(/\s+/g, "");
|
|
1169
|
+
const dimensions = readPngDimensions(base64);
|
|
1170
|
+
return {
|
|
1171
|
+
base64,
|
|
1172
|
+
fallback: frame.fallback == null ? void 0 : sanitizeTerminalFallbackText(frame.fallback),
|
|
1173
|
+
cols: size?.width ?? fallbackCols,
|
|
1174
|
+
rows: rawRows == null ? void 0 : size?.height,
|
|
1175
|
+
sourceWidth: dimensions?.width,
|
|
1176
|
+
sourceHeight: dimensions?.height
|
|
1177
|
+
};
|
|
1178
|
+
}
|
|
1179
|
+
function resolveKittyViewportPlacement(png, context) {
|
|
1180
|
+
const rect = context.viewport.rect;
|
|
1181
|
+
const full = context.viewport.fullRect;
|
|
1182
|
+
const columns = positiveInt(rect.w) ?? png.cols;
|
|
1183
|
+
const rows = positiveInt(rect.h) ?? png.rows;
|
|
1184
|
+
const sourceWidth = positiveInt(png.sourceWidth);
|
|
1185
|
+
const sourceHeight = positiveInt(png.sourceHeight);
|
|
1186
|
+
if (!sourceWidth || !sourceHeight || full.w <= 0 || full.h <= 0) return {
|
|
1187
|
+
columns,
|
|
1188
|
+
rows
|
|
1189
|
+
};
|
|
1190
|
+
const offsetX = Math.max(0, rect.x - full.x);
|
|
1191
|
+
const offsetY = Math.max(0, rect.y - full.y);
|
|
1192
|
+
const visibleW = Math.max(0, Math.min(rect.w, full.w - offsetX));
|
|
1193
|
+
const visibleH = Math.max(0, Math.min(rect.h, full.h - offsetY));
|
|
1194
|
+
if (offsetX <= 0 && offsetY <= 0 && visibleW >= full.w && visibleH >= full.h) return {
|
|
1195
|
+
columns,
|
|
1196
|
+
rows
|
|
1197
|
+
};
|
|
1198
|
+
const x0 = Math.max(0, Math.min(sourceWidth - 1, Math.floor(offsetX * sourceWidth / full.w)));
|
|
1199
|
+
const y0 = Math.max(0, Math.min(sourceHeight - 1, Math.floor(offsetY * sourceHeight / full.h)));
|
|
1200
|
+
const x1 = Math.max(x0 + 1, Math.min(sourceWidth, Math.ceil((offsetX + visibleW) * sourceWidth / full.w)));
|
|
1201
|
+
const y1 = Math.max(y0 + 1, Math.min(sourceHeight, Math.ceil((offsetY + visibleH) * sourceHeight / full.h)));
|
|
1202
|
+
return {
|
|
1203
|
+
columns,
|
|
1204
|
+
rows,
|
|
1205
|
+
sourceX: x0,
|
|
1206
|
+
sourceY: y0,
|
|
1207
|
+
sourceWidth: x1 - x0,
|
|
1208
|
+
sourceHeight: y1 - y0
|
|
1209
|
+
};
|
|
1210
|
+
}
|
|
1211
|
+
function pngFrameBytes(frame) {
|
|
1212
|
+
return frame.base64.length + (frame.fallback?.length ?? 0);
|
|
1213
|
+
}
|
|
1214
|
+
function stringBytes(value) {
|
|
1215
|
+
return value.length;
|
|
1216
|
+
}
|
|
1217
|
+
async function resolveFallbackText(options, content, context) {
|
|
1218
|
+
throwIfAborted(context.signal);
|
|
1219
|
+
if (!options.fallback) return void 0;
|
|
1220
|
+
const value = await options.fallback(content, context);
|
|
1221
|
+
throwIfAborted(context.signal);
|
|
1222
|
+
return sanitizeTerminalFallbackText(value);
|
|
1223
|
+
}
|
|
1224
|
+
async function resolvePngFallbackText(frame, options, content, context) {
|
|
1225
|
+
if (frame.fallback != null) return frame.fallback;
|
|
1226
|
+
return resolveFallbackText(options, content, context);
|
|
1227
|
+
}
|
|
1228
|
+
function textFallbackResult(text) {
|
|
1229
|
+
return text == null ? null : {
|
|
1230
|
+
type: "text",
|
|
1231
|
+
text
|
|
1232
|
+
};
|
|
1233
|
+
}
|
|
1234
|
+
function createPngTerminalGraphicRenderer(options) {
|
|
1235
|
+
const queue = options.queue ?? createTerminalGraphicRenderQueue({
|
|
1236
|
+
maxConcurrency: 2,
|
|
1237
|
+
maxEntries: 128,
|
|
1238
|
+
maxBytes: 32 * 1024 * 1024,
|
|
1239
|
+
dedupeInflight: options.dedupeInflight ?? false
|
|
1240
|
+
});
|
|
1241
|
+
return async (content, context) => {
|
|
1242
|
+
throwIfAborted(context.signal);
|
|
1243
|
+
const protocol = context.protocol;
|
|
1244
|
+
if (!context.capabilities.supported || protocol === "unicode" || protocol === "none" || !context.visible || !context.rawVisible || protocol === "sixel" && !options.toSixel) return textFallbackResult(await resolveFallbackText(options, content, context));
|
|
1245
|
+
const key = options.cacheKey?.(content, context) ?? defaultCacheKey(content, context, resolveCacheSalt(options, content, context));
|
|
1246
|
+
throwIfAborted(context.signal);
|
|
1247
|
+
const png = await queue.cached(`${key}\x1Fpng`, void 0, async () => {
|
|
1248
|
+
throwIfAborted(context.signal);
|
|
1249
|
+
const frame = await options.toPngBase64(content, context);
|
|
1250
|
+
return normalizeCachedPngFrame(frame, context);
|
|
1251
|
+
}, pngFrameBytes, { dedupeInflight: options.dedupeInflight ?? false });
|
|
1252
|
+
throwIfAborted(context.signal);
|
|
1253
|
+
let fallbackPromise;
|
|
1254
|
+
const fallback = () => fallbackPromise ?? (fallbackPromise = resolvePngFallbackText(png, options, content, context));
|
|
1255
|
+
const sequenceFallback = async () => {
|
|
1256
|
+
if (png.fallback == null && !options.fallback) return {};
|
|
1257
|
+
const text = await fallback();
|
|
1258
|
+
return text == null ? {} : { fallback: text };
|
|
1259
|
+
};
|
|
1260
|
+
if (!png.base64) return textFallbackResult(await fallback());
|
|
1261
|
+
if (protocol === "kitty") {
|
|
1262
|
+
const placement = resolveKittyViewportPlacement(png, context);
|
|
1263
|
+
const sequence = createKittyGraphicsSequence(png.base64, {
|
|
1264
|
+
imageId: context.imageId,
|
|
1265
|
+
placementId: context.placementId,
|
|
1266
|
+
zIndex: options.zIndex,
|
|
1267
|
+
...placement
|
|
1268
|
+
});
|
|
1269
|
+
const resizeSequence = createKittyPlacementSequence({
|
|
1270
|
+
imageId: context.imageId,
|
|
1271
|
+
placementId: context.placementId,
|
|
1272
|
+
zIndex: options.zIndex,
|
|
1273
|
+
...placement
|
|
1274
|
+
});
|
|
1275
|
+
if (!isSafeTerminalGraphicsSequence(sequence, "kitty", "draw")) return textFallbackResult(await fallback());
|
|
1276
|
+
return {
|
|
1277
|
+
type: "sequence",
|
|
1278
|
+
protocol: "kitty",
|
|
1279
|
+
sequence,
|
|
1280
|
+
resizeSequence,
|
|
1281
|
+
clearSequence: createKittyDeleteGraphicsSequence({
|
|
1282
|
+
imageId: context.imageId,
|
|
1283
|
+
placementId: context.placementId
|
|
1284
|
+
}),
|
|
1285
|
+
...await sequenceFallback(),
|
|
1286
|
+
cols: png.cols,
|
|
1287
|
+
rows: png.rows,
|
|
1288
|
+
sourceWidth: png.sourceWidth,
|
|
1289
|
+
sourceHeight: png.sourceHeight,
|
|
1290
|
+
zIndex: options.zIndex
|
|
1291
|
+
};
|
|
1292
|
+
}
|
|
1293
|
+
if (protocol === "iterm2") {
|
|
1294
|
+
const sequence = createIterm2InlineImageSequence(png.base64, {
|
|
1295
|
+
width: png.cols,
|
|
1296
|
+
height: png.rows,
|
|
1297
|
+
preserveAspectRatio: true,
|
|
1298
|
+
doNotMoveCursor: true
|
|
1299
|
+
});
|
|
1300
|
+
if (!isSafeTerminalGraphicsSequence(sequence, "iterm2", "draw")) return textFallbackResult(await fallback());
|
|
1301
|
+
return {
|
|
1302
|
+
type: "sequence",
|
|
1303
|
+
protocol: "iterm2",
|
|
1304
|
+
sequence,
|
|
1305
|
+
...await sequenceFallback(),
|
|
1306
|
+
cols: png.cols,
|
|
1307
|
+
rows: png.rows
|
|
1308
|
+
};
|
|
1309
|
+
}
|
|
1310
|
+
if (protocol === "sixel") {
|
|
1311
|
+
const sixel = await queue.cached(`${key}\x1Fsixel`, context.signal, async () => {
|
|
1312
|
+
throwIfAborted(context.signal);
|
|
1313
|
+
const sixel$1 = await options.toSixel(png.base64, context);
|
|
1314
|
+
throwIfAborted(context.signal);
|
|
1315
|
+
return sixel$1;
|
|
1316
|
+
}, stringBytes, { dedupeInflight: options.dedupeInflight ?? false });
|
|
1317
|
+
throwIfAborted(context.signal);
|
|
1318
|
+
if (!isSafeTerminalGraphicsSequence(sixel, "sixel", "draw")) return textFallbackResult(await fallback());
|
|
1319
|
+
return {
|
|
1320
|
+
type: "sequence",
|
|
1321
|
+
protocol: "sixel",
|
|
1322
|
+
sequence: sixel,
|
|
1323
|
+
...await sequenceFallback(),
|
|
1324
|
+
cols: png.cols,
|
|
1325
|
+
rows: png.rows
|
|
1326
|
+
};
|
|
1327
|
+
}
|
|
1328
|
+
return textFallbackResult(await fallback());
|
|
1329
|
+
};
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
//#endregion
|
|
1333
|
+
export { TAgentTerminalGraphic, TTranscriptView as TAgentTranscript, TBox, TCommandPalette, TDialog, TInput, TLogLinksPanel, TLogMinimap, TLogScrollbar, TLogSearchBar, TLogSearchPager, TLogSearchResults, TLogView, TLogVirtualLinksPanel, TLogVirtualSearchResults, TMermaid, TMermaidText, TRenderPlane, TSelect, TText, TThinkingView, TToolCallView, TLogView as TToolLogView, TTranscriptView, TUserMessageView, TView, TVirtualList, TVirtualMarkdown, computeCommandPaletteMatchRanges, createAppendOnlyLogStore, createIterm2InlineImageSequence, createKittyDeleteGraphicsSequence, createKittyGraphicsSequence, createKittyPlacementSequence, createMarkdownBlockSource, createPngTerminalGraphicRenderer, createTLogDensityBucketsFromMarkers, createTLogLevelPlugin, createTLogLineMatcherPlugin, createTLogLinkActionPlugin, createTLogOsc8LinkPlugin, createTLogUrlPlugin, createTerminalGraphicRenderQueue, detectTLogUrls, detectTerminalGraphicsCapabilities, dispatchTLogPluginLinkAction, getTLogPluginMetadata, getTerminalGraphicsOutput, getTerminalGraphicsOutputVersion, isSimpleMermaidFlowchartSource, markMermaidRenderErrorFatal, parseTLogAnnotatedText, resolveTLogLinksPanelTheme, resolveTLogMinimapTheme, resolveTLogScrollbarTheme, resolveTLogSearchBarTheme, resolveTLogSearchPagerTheme, resolveTLogSearchResultsTheme, resolveTLogViewTheme, resolveTThinkingViewModel, resolveTToolCallViewModel, resolveTUserMessageViewModel, stripTLogAnsiText, subscribeTerminalGraphicsOutput, tlogDarkPreset, tlogDarkTheme, tlogDefaultPreset, tlogDefaultTheme, tlogHighContrastPreset, tlogHighContrastTheme, toTLogExternalLinkFromVisibleLink, useTLogLinkController, useTLogRetainedIndex, useTLogSearchController, useTLogSearchResultsPage, useTLogVirtualSearchResults };
|