@simon_he/vue-tui 1.0.2 → 1.1.1

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.
Files changed (104) hide show
  1. package/README.md +44 -26
  2. package/dist/TMermaidText-CXm_L969.js +885 -0
  3. package/dist/{TSelect-DR0FomSu.js → TSelect-CiyMvwl-.js} +60 -81
  4. package/dist/{TTree-kzhlB5P0.js → TTree-DKGiuIcM.js} +140 -103
  5. package/dist/agent/mermaid.cjs +2 -0
  6. package/dist/agent/mermaid.d.cts +2 -0
  7. package/dist/agent/mermaid.d.ts +2 -0
  8. package/dist/agent/mermaid.js +1 -0
  9. package/dist/agent.cjs +31184 -24907
  10. package/dist/agent.d.cts +11 -1
  11. package/dist/agent.d.ts +11 -1
  12. package/dist/agent.js +1700 -13
  13. package/dist/block-source-5CQp4tF8.js +3230 -0
  14. package/dist/cli/stdin-buffer.d.ts +1 -1
  15. package/dist/cli.cjs +5037 -6767
  16. package/dist/cli.d.cts +4 -0
  17. package/dist/cli.d.ts +4 -0
  18. package/dist/cli.js +2733 -148
  19. package/dist/core/buffer/eaw-ranges-unicode-17.d.ts +14 -0
  20. package/dist/core/perf/instrumentation-noop.d.ts +48 -0
  21. package/dist/core/perf/instrumentation.d.ts +136 -0
  22. package/dist/core/terminal/create-terminal.d.ts +1 -0
  23. package/dist/core.cjs +843 -1469
  24. package/dist/core.js +6 -6
  25. package/dist/{create-terminal-DBFNYr8f.js → create-terminal-DXuZ2fci.js} +39 -13
  26. package/dist/debug-logger-ChY_PXVk.js +74 -0
  27. package/dist/{dom-renderer-BniJSQyX.js → dom-renderer-DNzmg2As.js} +2 -2
  28. package/dist/experimental.cjs +4115 -5928
  29. package/dist/experimental.d.cts +2 -0
  30. package/dist/experimental.d.ts +2 -0
  31. package/dist/experimental.js +1490 -9
  32. package/dist/frame-perf-BBhE-iuS.js +111 -0
  33. package/dist/{sgr-BmzxEjAO.js → hyperlink-B35-O-cW.js} +100 -1
  34. package/dist/index.cjs +5017 -10339
  35. package/dist/index.js +16 -14
  36. package/dist/{linkify-D_gzn9Xq.js → linkify-CuuquMQT.js} +32 -3
  37. package/dist/markdown.cjs +21295 -12691
  38. package/dist/markdown.d.cts +1 -1
  39. package/dist/markdown.d.ts +1 -1
  40. package/dist/markdown.js +211 -51
  41. package/dist/mermaid-CWto52Wk.js +123 -0
  42. package/dist/mermaid.cjs +1707 -0
  43. package/dist/mermaid.d.cts +3 -0
  44. package/dist/mermaid.d.ts +3 -0
  45. package/dist/mermaid.js +6 -0
  46. package/dist/observability/frame-perf-store.d.ts +2 -1
  47. package/dist/observability/frame-perf.d.ts +33 -0
  48. package/dist/observability.cjs +106 -107
  49. package/dist/observability.d.cts +2 -2
  50. package/dist/observability.d.ts +2 -2
  51. package/dist/observability.js +3 -3
  52. package/dist/{path-suggest-BNqcuE3-.js → path-suggest-fPzRsgPv.js} +1 -1
  53. package/dist/{wheel-scroll-vBRaQ7p-.js → rect-Ng-3eKzF.js} +253 -117
  54. package/dist/renderer/cli/stdout-metrics.d.ts +10 -0
  55. package/dist/renderer/cli/stdout-renderer.d.ts +3 -0
  56. package/dist/renderer/terminal-graphic-render-queue.d.ts +50 -0
  57. package/dist/renderer/terminal-graphics-trace.d.ts +53 -0
  58. package/dist/renderer/terminal-graphics.d.ts +146 -0
  59. package/dist/renderer-dom.cjs +364 -903
  60. package/dist/renderer-dom.js +4 -4
  61. package/dist/runtime/index.d.ts +2 -0
  62. package/dist/{runtime-rfcZCyJq.js → runtime-D77C03RM.js} +28 -15
  63. package/dist/runtime.cjs +427 -889
  64. package/dist/runtime.js +2 -2
  65. package/dist/{terminal-selection-DBinO6p5.js → terminal-selection-CQYr--26.js} +4 -1
  66. package/dist/{tlog-theme-CvLFNMwk.js → tlog-theme-CopRt9SC.js} +37 -6
  67. package/dist/{trace-CjzYeIxN.js → trace-CYHDKM1m.js} +5 -0
  68. package/dist/vue/agent/create-png-terminal-graphic-renderer.d.ts +19 -0
  69. package/dist/vue/components/TAgentTerminalGraphic.d.ts +481 -0
  70. package/dist/vue/components/TCharts.d.ts +1121 -0
  71. package/dist/vue/components/TFeedback.d.ts +1 -1
  72. package/dist/vue/components/TFlex.d.ts +389 -0
  73. package/dist/vue/components/TForm.d.ts +4 -4
  74. package/dist/vue/components/TLogSearchBar.d.ts +3 -3
  75. package/dist/vue/components/TLogSearchPager.d.ts +2 -2
  76. package/dist/vue/components/TMarkdownText.d.ts +162 -4
  77. package/dist/vue/components/TMermaidText.d.ts +900 -0
  78. package/dist/vue/components/TVirtualList.d.ts +9 -0
  79. package/dist/vue/components/TVirtualMarkdown.d.ts +170 -9
  80. package/dist/vue/components/TVirtualRows.d.ts +9 -0
  81. package/dist/vue/components/TerminalProvider.d.ts +2 -0
  82. package/dist/vue/context.d.ts +24 -0
  83. package/dist/vue/index.d.ts +5 -0
  84. package/dist/vue/layout/flex.d.ts +67 -0
  85. package/dist/vue/markdown/ast.d.ts +5 -2
  86. package/dist/vue/markdown/document.d.ts +5 -0
  87. package/dist/vue/markdown/image-actions.d.ts +14 -0
  88. package/dist/vue/markdown/image.d.ts +11 -0
  89. package/dist/vue/markdown/link-actions.d.ts +14 -0
  90. package/dist/vue/markdown/math-actions.d.ts +14 -0
  91. package/dist/vue/markdown/math.d.ts +6 -0
  92. package/dist/vue/markdown/render.d.ts +28 -0
  93. package/dist/vue/markdown/types.d.ts +78 -0
  94. package/dist/vue/mermaid/beautiful-mermaid.d.ts +1436 -0
  95. package/dist/vue/render/render-manager.d.ts +7 -0
  96. package/dist/vue.cjs +7207 -12437
  97. package/dist/vue.js +706 -39
  98. package/dist/wheel-scroll-CQ22Hcyj.js +106 -0
  99. package/dist/{hyperlink-Bn02UXJb.js → width-GqllnV8C.js} +166 -111
  100. package/package.json +85 -14
  101. package/dist/block-source-CKUOnkgT.js +0 -1663
  102. package/dist/frame-perf-C6Xfg85O.js +0 -24
  103. /package/dist/{env-Cl8qmNFN.js → env-DNCzvX8b.js} +0 -0
  104. /package/dist/{path-mnSgEpCm.js → path-BI9W15Zt.js} +0 -0
@@ -0,0 +1,3 @@
1
+ export type { TMermaidAsciiOptions, TMermaidAsciiTheme, TMermaidCopyPayload, TMermaidRenderer, TMermaidRenderEligibility, TMermaidRenderEligibilityContext, TMermaidResolvedAsciiOptions, TMermaidTextProps, TMermaidTransientErrorClassifier, TMermaidTransientErrorContext, } from "./vue/components/TMermaidText.js";
2
+ export { isSimpleMermaidFlowchartSource, markMermaidRenderErrorFatal, } from "./vue/components/TMermaidText.js";
3
+ export { beautifulMermaidRenderer, createBeautifulMermaidRenderer, TBeautifulMermaid, TBeautifulMermaidText, TMermaid, TMermaidText, } from "./vue/mermaid/beautiful-mermaid.js";
@@ -0,0 +1,3 @@
1
+ export type { TMermaidAsciiOptions, TMermaidAsciiTheme, TMermaidCopyPayload, TMermaidRenderer, TMermaidRenderEligibility, TMermaidRenderEligibilityContext, TMermaidResolvedAsciiOptions, TMermaidTextProps, TMermaidTransientErrorClassifier, TMermaidTransientErrorContext, } from "./vue/components/TMermaidText.js";
2
+ export { isSimpleMermaidFlowchartSource, markMermaidRenderErrorFatal, } from "./vue/components/TMermaidText.js";
3
+ export { beautifulMermaidRenderer, createBeautifulMermaidRenderer, TBeautifulMermaid, TBeautifulMermaidText, TMermaid, TMermaidText, } from "./vue/mermaid/beautiful-mermaid.js";
@@ -0,0 +1,6 @@
1
+ import "./width-GqllnV8C.js";
2
+ import "./rect-Ng-3eKzF.js";
3
+ import { isSimpleMermaidFlowchartSource, markMermaidRenderErrorFatal } from "./TMermaidText-CXm_L969.js";
4
+ import { TBeautifulMermaid, TBeautifulMermaidText, TMermaid, TMermaidText, beautifulMermaidRenderer, createBeautifulMermaidRenderer } from "./mermaid-CWto52Wk.js";
5
+
6
+ export { TBeautifulMermaid, TBeautifulMermaidText, TMermaid, TMermaidText, beautifulMermaidRenderer, createBeautifulMermaidRenderer, isSimpleMermaidFlowchartSource, markMermaidRenderErrorFatal };
@@ -1,5 +1,5 @@
1
1
  import type { Ref } from "vue";
2
- import type { FramePerfSample } from "./frame-perf.js";
2
+ import type { FramePerfSample, FramePerfSummary } from "./frame-perf.js";
3
3
  import type { ComponentPerf, TuiPerfEvent, TuiPerfSink } from "./perf-sink.js";
4
4
  export type FramePerfStore = Readonly<{
5
5
  enabled: Ref<boolean>;
@@ -10,6 +10,7 @@ export type FramePerfStore = Readonly<{
10
10
  addSink: (sink: TuiPerfSink) => () => void;
11
11
  latest: () => FramePerfSample | null;
12
12
  list: () => FramePerfSample[];
13
+ summary: () => FramePerfSummary;
13
14
  clear: () => void;
14
15
  }>;
15
16
  export declare function createFramePerfStore(limit?: number, opts?: Readonly<{
@@ -36,5 +36,38 @@ export type FramePerfSample = Readonly<{
36
36
  queueDepth: number;
37
37
  liveReasons?: readonly string[];
38
38
  }>;
39
+ export type FramePerfMetricStats = Readonly<{
40
+ avg: number;
41
+ max: number;
42
+ min: number;
43
+ }>;
44
+ export type FramePerfDirtyRowsStats = Readonly<{
45
+ avg: number;
46
+ max: number;
47
+ sampledFrames: number;
48
+ fullFrames: number;
49
+ }>;
50
+ export type FramePerfSummary = Readonly<{
51
+ frames: number;
52
+ firstFrameId: number | null;
53
+ latestFrameId: number | null;
54
+ windowMs: number;
55
+ durationMs: FramePerfMetricStats;
56
+ renderManagerMs: FramePerfMetricStats;
57
+ commitMs: FramePerfMetricStats;
58
+ domFlushMs: FramePerfMetricStats;
59
+ stdoutFlushMs: FramePerfMetricStats;
60
+ dirtyRows: FramePerfDirtyRowsStats;
61
+ scannedNodes: FramePerfMetricStats;
62
+ paintedNodes: FramePerfMetricStats;
63
+ coalescedInvalidates: number;
64
+ coalescedFrameTasks: number;
65
+ droppedUpdates: number;
66
+ maxQueueDepth: number;
67
+ rowBucketFallbacks: number;
68
+ reasons: Partial<Record<FramePerfReason, number>>;
69
+ activePlanes: Record<string, number>;
70
+ }>;
71
+ export declare function summarizeFramePerf(samples: readonly FramePerfSample[]): FramePerfSummary;
39
72
  export declare function framePerfNow(): number;
40
73
  export declare function mergeFramePerfReason(prev: FramePerfReason | undefined, next: FramePerfReason | undefined): FramePerfReason;
@@ -5,17 +5,14 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
6
  var __export = (target, all) => {
7
7
  for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
8
+ __defProp(target, name, { get: all[name], enumerable: !0 });
9
+ }, __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from == "object" || typeof from == "function")
12
11
  for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
12
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
13
  return to;
17
14
  };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
19
16
 
20
17
  // src/observability.ts
21
18
  var observability_exports = {};
@@ -24,63 +21,94 @@ __export(observability_exports, {
24
21
  createJsonlPerfSink: () => createJsonlPerfSink,
25
22
  createTraceStore: () => createTraceStore,
26
23
  framePerfNow: () => framePerfNow,
27
- installTuiPerf: () => installTuiPerf
24
+ installTuiPerf: () => installTuiPerf,
25
+ summarizeFramePerf: () => summarizeFramePerf
28
26
  });
29
27
  module.exports = __toCommonJS(observability_exports);
30
28
 
31
29
  // src/observability/frame-perf.ts
30
+ var EMPTY_METRIC_STATS = Object.freeze({ avg: 0, max: 0, min: 0 });
31
+ function metricStats(values) {
32
+ if (!values.length)
33
+ return EMPTY_METRIC_STATS;
34
+ let sum = 0, max = Number.NEGATIVE_INFINITY, min = Number.POSITIVE_INFINITY;
35
+ for (let value of values)
36
+ sum += value, value > max && (max = value), value < min && (min = value);
37
+ return { avg: sum / values.length, max, min };
38
+ }
39
+ function summarizeFramePerf(samples) {
40
+ let durationMs = [], renderManagerMs = [], commitMs = [], domFlushMs = [], stdoutFlushMs = [], dirtyRows = [], scannedNodes = [], paintedNodes = [], reasons = {}, activePlanes = {}, fullDirtyFrames = 0, coalescedInvalidates = 0, coalescedFrameTasks = 0, droppedUpdates = 0, maxQueueDepth = 0, rowBucketFallbacks = 0;
41
+ for (let sample of samples) {
42
+ durationMs.push(sample.durationMs), renderManagerMs.push(sample.renderManagerMs), commitMs.push(sample.commitMs), scannedNodes.push(sample.scannedNodes), paintedNodes.push(sample.paintedNodes), sample.domFlushMs != null && domFlushMs.push(sample.domFlushMs), sample.stdoutFlushMs != null && stdoutFlushMs.push(sample.stdoutFlushMs), sample.dirtyRows == null ? fullDirtyFrames++ : dirtyRows.push(sample.dirtyRows), reasons[sample.reason] = (reasons[sample.reason] ?? 0) + 1;
43
+ let planes = sample.activePlanes;
44
+ if (!planes)
45
+ activePlanes.all = (activePlanes.all ?? 0) + 1;
46
+ else
47
+ for (let plane of planes)
48
+ activePlanes[plane] = (activePlanes[plane] ?? 0) + 1;
49
+ coalescedInvalidates += sample.coalescedInvalidates, coalescedFrameTasks += sample.coalescedFrameTasks, droppedUpdates += sample.droppedUpdates, sample.queueDepth > maxQueueDepth && (maxQueueDepth = sample.queueDepth), rowBucketFallbacks += sample.rowBucketFallbacks?.length ?? 0;
50
+ }
51
+ let first = samples[0] ?? null, latest = samples[samples.length - 1] ?? null;
52
+ return {
53
+ frames: samples.length,
54
+ firstFrameId: first?.frameId ?? null,
55
+ latestFrameId: latest?.frameId ?? null,
56
+ windowMs: first && latest ? Math.max(0, latest.startedAt - first.startedAt) : 0,
57
+ durationMs: metricStats(durationMs),
58
+ renderManagerMs: metricStats(renderManagerMs),
59
+ commitMs: metricStats(commitMs),
60
+ domFlushMs: metricStats(domFlushMs),
61
+ stdoutFlushMs: metricStats(stdoutFlushMs),
62
+ dirtyRows: {
63
+ avg: dirtyRows.length ? dirtyRows.reduce((sum, value) => sum + value, 0) / dirtyRows.length : 0,
64
+ max: dirtyRows.length ? Math.max(...dirtyRows) : 0,
65
+ sampledFrames: dirtyRows.length,
66
+ fullFrames: fullDirtyFrames
67
+ },
68
+ scannedNodes: metricStats(scannedNodes),
69
+ paintedNodes: metricStats(paintedNodes),
70
+ coalescedInvalidates,
71
+ coalescedFrameTasks,
72
+ droppedUpdates,
73
+ maxQueueDepth,
74
+ rowBucketFallbacks,
75
+ reasons,
76
+ activePlanes
77
+ };
78
+ }
32
79
  function framePerfNow() {
33
- const p = globalThis.performance;
34
- if (p && typeof p.now === "function")
35
- return p.now();
36
- return Date.now();
80
+ let p = globalThis.performance;
81
+ return p && typeof p.now == "function" ? p.now() : Date.now();
37
82
  }
38
83
 
39
84
  // src/observability/frame-perf-store.ts
40
85
  var import_vue = require("vue");
41
86
 
42
87
  // src/observability/perf-sink.ts
43
- var installedTuiPerf = { enabled: false, sink: null };
88
+ var installedTuiPerf = { enabled: !1, sink: null };
44
89
  function shouldSample(rate) {
45
- if (rate <= 0)
46
- return false;
47
- if (rate >= 1)
48
- return true;
49
- return Math.random() < rate;
90
+ return rate <= 0 ? !1 : rate >= 1 ? !0 : Math.random() < rate;
50
91
  }
51
92
  function normalizeSampleRate(value) {
52
- const n = Number(value);
53
- if (!Number.isFinite(n))
54
- return 1;
55
- return Math.max(0, Math.min(1, n));
93
+ let n = Number(value);
94
+ return Number.isFinite(n) ? Math.max(0, Math.min(1, n)) : 1;
56
95
  }
57
96
  function createJsonlPerfSink(options = {}) {
58
- const sampleRate = normalizeSampleRate(options.sampleRate);
59
- const includeComponents = options.includeComponents ?? true;
60
- const includeEvents = options.includeEvents ?? false;
97
+ let sampleRate = normalizeSampleRate(options.sampleRate), includeComponents = options.includeComponents ?? !0, includeEvents = options.includeEvents ?? !1;
61
98
  function emit(value) {
62
- const line = JSON.stringify(value);
63
- if (options.file && options.fileWriter?.appendFileSync) {
64
- options.fileWriter.appendFileSync(options.file, `${line}
65
- `);
66
- }
67
- options.write?.(line);
99
+ let line = JSON.stringify(value);
100
+ options.file && options.fileWriter?.appendFileSync && options.fileWriter.appendFileSync(options.file, `${line}
101
+ `), options.write?.(line);
68
102
  }
69
103
  return {
70
104
  onFramePerf(sample) {
71
- if (!shouldSample(sampleRate))
72
- return;
73
- emit({ type: "frame", ...sample });
105
+ shouldSample(sampleRate) && emit({ type: "frame", ...sample });
74
106
  },
75
107
  onComponentPerf(sample) {
76
- if (!includeComponents || !shouldSample(sampleRate))
77
- return;
78
- emit({ type: "component", ...sample });
108
+ !includeComponents || !shouldSample(sampleRate) || emit({ type: "component", ...sample });
79
109
  },
80
110
  onEvent(event) {
81
- if (!includeEvents || !shouldSample(sampleRate))
82
- return;
83
- emit({
111
+ !includeEvents || !shouldSample(sampleRate) || emit({
84
112
  type: "event",
85
113
  eventType: event.type,
86
114
  ts: event.ts ?? Date.now(),
@@ -92,24 +120,12 @@ function createJsonlPerfSink(options = {}) {
92
120
  };
93
121
  }
94
122
  function installTuiPerf(options = {}) {
95
- const previous = installedTuiPerf;
96
- const previousDebugPerf = globalThis.__VT_DEBUG_PERF__;
97
- const current = {
98
- enabled: options.enabled ?? Boolean(options.sink),
123
+ let previous = installedTuiPerf, previousDebugPerf = globalThis.__VT_DEBUG_PERF__, current = {
124
+ enabled: options.enabled ?? !!options.sink,
99
125
  sink: options.sink ?? null
100
126
  };
101
- installedTuiPerf = current;
102
- if (options.debugOverlay != null) {
103
- globalThis.__VT_DEBUG_PERF__ = Boolean(options.debugOverlay);
104
- }
105
- return () => {
106
- current.sink?.dispose?.();
107
- if (installedTuiPerf === current)
108
- installedTuiPerf = previous;
109
- if (previousDebugPerf === void 0)
110
- delete globalThis.__VT_DEBUG_PERF__;
111
- else
112
- globalThis.__VT_DEBUG_PERF__ = previousDebugPerf;
127
+ return installedTuiPerf = current, options.debugOverlay != null && (globalThis.__VT_DEBUG_PERF__ = !!options.debugOverlay), () => {
128
+ current.sink?.dispose?.(), installedTuiPerf === current && (installedTuiPerf = previous), previousDebugPerf === void 0 ? delete globalThis.__VT_DEBUG_PERF__ : globalThis.__VT_DEBUG_PERF__ = previousDebugPerf;
113
129
  };
114
130
  }
115
131
  function getInstalledTuiPerf() {
@@ -118,72 +134,47 @@ function getInstalledTuiPerf() {
118
134
 
119
135
  // src/observability/frame-perf-store.ts
120
136
  function createFramePerfStore(limit = 120, opts) {
121
- const max = Math.max(1, Math.floor(limit));
122
- const installed = getInstalledTuiPerf();
123
- const manualEnabled = (0, import_vue.ref)(Boolean(opts?.enabled ?? installed.enabled));
124
- const leaseCount = (0, import_vue.ref)(0);
125
- const enabled = (0, import_vue.computed)({
137
+ let max = Math.max(1, Math.floor(limit)), installed = getInstalledTuiPerf(), manualEnabled = (0, import_vue.ref)(!!(opts?.enabled ?? installed.enabled)), leaseCount = (0, import_vue.ref)(0), enabled = (0, import_vue.computed)({
126
138
  get: () => manualEnabled.value || leaseCount.value > 0,
127
139
  set: (next) => {
128
- manualEnabled.value = Boolean(next);
140
+ manualEnabled.value = !!next;
129
141
  }
130
- });
131
- const samples = [];
132
- const sinks = [];
133
- if (installed.sink)
134
- sinks.push(installed.sink);
135
- const configuredSink = opts?.sink;
136
- if (Array.isArray(configuredSink))
137
- sinks.push(...configuredSink);
138
- else if (configuredSink)
139
- sinks.push(configuredSink);
142
+ }), samples = [], sinks = [];
143
+ installed.sink && sinks.push(installed.sink);
144
+ let configuredSink = opts?.sink;
145
+ Array.isArray(configuredSink) ? sinks.push(...configuredSink) : configuredSink && sinks.push(configuredSink);
140
146
  function emitToSinks(fn) {
141
- for (const sink of sinks) {
147
+ for (let sink of sinks)
142
148
  try {
143
149
  fn(sink);
144
150
  } catch {
145
151
  }
146
- }
147
152
  }
148
153
  function acquire(_reason) {
149
154
  leaseCount.value++;
150
- let released = false;
155
+ let released = !1;
151
156
  return () => {
152
- if (released)
153
- return;
154
- released = true;
155
- leaseCount.value = Math.max(0, leaseCount.value - 1);
157
+ released || (released = !0, leaseCount.value = Math.max(0, leaseCount.value - 1));
156
158
  };
157
159
  }
158
160
  function push(sample) {
159
- if (!enabled.value)
160
- return;
161
- samples.push(sample);
162
- if (samples.length > max)
163
- samples.splice(0, samples.length - max);
164
- emitToSinks((sink) => sink.onFramePerf(sample));
161
+ enabled.value && (samples.push(sample), samples.length > max && samples.splice(0, samples.length - max), emitToSinks((sink) => sink.onFramePerf(sample)));
165
162
  }
166
163
  function recordComponent(sample) {
167
- if (!enabled.value)
168
- return;
169
- emitToSinks((sink) => sink.onComponentPerf?.(sample));
164
+ enabled.value && emitToSinks((sink) => sink.onComponentPerf?.(sample));
170
165
  }
171
166
  function recordEvent(event) {
172
- if (!enabled.value)
173
- return;
174
- emitToSinks((sink) => sink.onEvent?.(event));
167
+ enabled.value && emitToSinks((sink) => sink.onEvent?.(event));
175
168
  }
176
169
  function addSink(sink) {
177
170
  sinks.push(sink);
178
- let disposed = false;
171
+ let disposed = !1;
179
172
  return () => {
180
173
  if (disposed)
181
174
  return;
182
- disposed = true;
183
- const index = sinks.indexOf(sink);
184
- if (index >= 0)
185
- sinks.splice(index, 1);
186
- sink.dispose?.();
175
+ disposed = !0;
176
+ let index = sinks.indexOf(sink);
177
+ index >= 0 && sinks.splice(index, 1), sink.dispose?.();
187
178
  };
188
179
  }
189
180
  function latest() {
@@ -192,24 +183,32 @@ function createFramePerfStore(limit = 120, opts) {
192
183
  function list() {
193
184
  return samples.slice();
194
185
  }
186
+ function summary() {
187
+ return summarizeFramePerf(samples);
188
+ }
195
189
  function clear() {
196
190
  samples.length = 0;
197
191
  }
198
- return { enabled, acquire, push, recordComponent, recordEvent, addSink, latest, list, clear };
192
+ return {
193
+ enabled,
194
+ acquire,
195
+ push,
196
+ recordComponent,
197
+ recordEvent,
198
+ addSink,
199
+ latest,
200
+ list,
201
+ summary,
202
+ clear
203
+ };
199
204
  }
200
205
 
201
206
  // src/observability/trace.ts
202
207
  var import_vue2 = require("vue");
203
208
  function createTraceStore(opts) {
204
- const enabled = (0, import_vue2.ref)(Boolean(opts?.enabled));
205
- const records = (0, import_vue2.shallowReactive)([]);
206
- const max = Math.max(10, Math.floor(opts?.max ?? 400));
209
+ let enabled = (0, import_vue2.ref)(!!opts?.enabled), records = (0, import_vue2.shallowReactive)([]), max = Math.max(10, Math.floor(opts?.max ?? 400));
207
210
  function push(record) {
208
- if (!enabled.value)
209
- return;
210
- records.push(record);
211
- if (records.length > max)
212
- records.splice(0, records.length - max);
211
+ enabled.value && (records.push(record), records.length > max && records.splice(0, records.length - max));
213
212
  }
214
213
  function clear() {
215
214
  records.splice(0, records.length);
@@ -1,5 +1,5 @@
1
- export type { FramePerfReason, FramePerfRowBucketFallback, FramePerfSample, } from "./observability/frame-perf.js";
2
- export { framePerfNow } from "./observability/frame-perf.js";
1
+ export type { FramePerfDirtyRowsStats, FramePerfMetricStats, FramePerfReason, FramePerfRowBucketFallback, FramePerfSample, FramePerfSummary, } from "./observability/frame-perf.js";
2
+ export { framePerfNow, summarizeFramePerf } from "./observability/frame-perf.js";
3
3
  export type { FramePerfStore } from "./observability/frame-perf-store.js";
4
4
  export { createFramePerfStore } from "./observability/frame-perf-store.js";
5
5
  export type { ComponentPerf, CreateJsonlPerfSinkOptions, FramePerf, InstallTuiPerfOptions, TuiPerfEvent, TuiPerfSink, } from "./observability/perf-sink.js";
@@ -1,5 +1,5 @@
1
- export type { FramePerfReason, FramePerfRowBucketFallback, FramePerfSample, } from "./observability/frame-perf.js";
2
- export { framePerfNow } from "./observability/frame-perf.js";
1
+ export type { FramePerfDirtyRowsStats, FramePerfMetricStats, FramePerfReason, FramePerfRowBucketFallback, FramePerfSample, FramePerfSummary, } from "./observability/frame-perf.js";
2
+ export { framePerfNow, summarizeFramePerf } from "./observability/frame-perf.js";
3
3
  export type { FramePerfStore } from "./observability/frame-perf-store.js";
4
4
  export { createFramePerfStore } from "./observability/frame-perf-store.js";
5
5
  export type { ComponentPerf, CreateJsonlPerfSinkOptions, FramePerf, InstallTuiPerfOptions, TuiPerfEvent, TuiPerfSink, } from "./observability/perf-sink.js";
@@ -1,4 +1,4 @@
1
- import { createFramePerfStore, createJsonlPerfSink, createTraceStore, installTuiPerf } from "./trace-CjzYeIxN.js";
2
- import { framePerfNow } from "./frame-perf-C6Xfg85O.js";
1
+ import { framePerfNow, summarizeFramePerf } from "./frame-perf-BBhE-iuS.js";
2
+ import { createFramePerfStore, createJsonlPerfSink, createTraceStore, installTuiPerf } from "./trace-CYHDKM1m.js";
3
3
 
4
- export { createFramePerfStore, createJsonlPerfSink, createTraceStore, framePerfNow, installTuiPerf };
4
+ export { createFramePerfStore, createJsonlPerfSink, createTraceStore, framePerfNow, installTuiPerf, summarizeFramePerf };
@@ -1,4 +1,4 @@
1
- import { dirname, isAbsolutePath, joinPath, normalizePath, resolvePath } from "./path-mnSgEpCm.js";
1
+ import { dirname, isAbsolutePath, joinPath, normalizePath, resolvePath } from "./path-BI9W15Zt.js";
2
2
 
3
3
  //#region src/core/path-suggest.ts
4
4
  function lower(s) {