@linxiraos/pi-utils 1.1.7 → 1.1.9

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 (188) hide show
  1. package/CHANGELOG.md +2 -8
  2. package/README.md +18 -18
  3. package/package.json +57 -63
  4. package/src/acp/connection.ts +6 -10
  5. package/src/ar/entries.ts +1 -1
  6. package/src/ar/sevenzip.ts +17 -2
  7. package/src/async.ts +25 -4
  8. package/src/browsers.ts +11 -5
  9. package/src/dirs.ts +15 -10
  10. package/src/dom/core.ts +4 -4
  11. package/src/env.ts +12 -0
  12. package/src/fetch-retry.ts +36 -1
  13. package/src/format.ts +1 -1
  14. package/src/frontmatter.ts +1 -0
  15. package/src/incoming-json.ts +856 -0
  16. package/src/index.ts +2 -0
  17. package/src/json-lexer.ts +413 -0
  18. package/src/json-parse.ts +93 -350
  19. package/src/marked/core.ts +8 -1
  20. package/src/materialize-string.ts +10 -0
  21. package/src/path.ts +14 -0
  22. package/src/postmortem.ts +33 -6
  23. package/src/prompt.ts +1 -0
  24. package/src/ring.ts +1 -0
  25. package/src/temp.ts +16 -4
  26. package/src/template.ts +2 -2
  27. package/src/tls-fetch.ts +2 -16
  28. package/src/turndown/html.ts +1 -1
  29. package/src/vterm/query-responder.ts +76 -0
  30. package/src/vterm.ts +1 -0
  31. package/THIRD-PARTY-NOTICES.txt +0 -22909
  32. package/dist/types/abortable.d.ts +0 -32
  33. package/dist/types/acp/connection.d.ts +0 -118
  34. package/dist/types/acp/protocol.d.ts +0 -526
  35. package/dist/types/acp/schema.d.ts +0 -41
  36. package/dist/types/acp/stream.d.ts +0 -8
  37. package/dist/types/acp/transport.d.ts +0 -88
  38. package/dist/types/acp.d.ts +0 -6
  39. package/dist/types/ar/arj.d.ts +0 -5
  40. package/dist/types/ar/asar.d.ts +0 -7
  41. package/dist/types/ar/bytes.d.ts +0 -20
  42. package/dist/types/ar/cab.d.ts +0 -5
  43. package/dist/types/ar/checksums.d.ts +0 -10
  44. package/dist/types/ar/codecs/bzip2.d.ts +0 -4
  45. package/dist/types/ar/codecs/gzip.d.ts +0 -6
  46. package/dist/types/ar/codecs/lzma.d.ts +0 -6
  47. package/dist/types/ar/codecs/lzw.d.ts +0 -4
  48. package/dist/types/ar/codecs/lzx.d.ts +0 -7
  49. package/dist/types/ar/codecs/xz.d.ts +0 -4
  50. package/dist/types/ar/codecs/zstd.d.ts +0 -6
  51. package/dist/types/ar/cpio.d.ts +0 -7
  52. package/dist/types/ar/deb.d.ts +0 -5
  53. package/dist/types/ar/entries.d.ts +0 -22
  54. package/dist/types/ar/error.d.ts +0 -8
  55. package/dist/types/ar/index.d.ts +0 -11
  56. package/dist/types/ar/iso.d.ts +0 -5
  57. package/dist/types/ar/limits.d.ts +0 -33
  58. package/dist/types/ar/lzh.d.ts +0 -7
  59. package/dist/types/ar/open.d.ts +0 -45
  60. package/dist/types/ar/paths.d.ts +0 -18
  61. package/dist/types/ar/rar/rar4-decoder.d.ts +0 -6
  62. package/dist/types/ar/rar/rar5-decoder.d.ts +0 -6
  63. package/dist/types/ar/rar.d.ts +0 -5
  64. package/dist/types/ar/reader.d.ts +0 -28
  65. package/dist/types/ar/registry.d.ts +0 -17
  66. package/dist/types/ar/rpm.d.ts +0 -5
  67. package/dist/types/ar/sevenzip/decode.d.ts +0 -33
  68. package/dist/types/ar/sevenzip.d.ts +0 -5
  69. package/dist/types/ar/source.d.ts +0 -54
  70. package/dist/types/ar/tar.d.ts +0 -9
  71. package/dist/types/ar/types.d.ts +0 -99
  72. package/dist/types/ar/unix-ar.d.ts +0 -7
  73. package/dist/types/ar/write.d.ts +0 -10
  74. package/dist/types/ar/zip.d.ts +0 -10
  75. package/dist/types/async.d.ts +0 -22
  76. package/dist/types/binary.d.ts +0 -23
  77. package/dist/types/browsers.d.ts +0 -68
  78. package/dist/types/chalk.d.ts +0 -125
  79. package/dist/types/cli.d.ts +0 -134
  80. package/dist/types/color.d.ts +0 -136
  81. package/dist/types/dates.d.ts +0 -7
  82. package/dist/types/dirs.d.ts +0 -325
  83. package/dist/types/docx/converter.d.ts +0 -46
  84. package/dist/types/docx/xml.d.ts +0 -26
  85. package/dist/types/docx.d.ts +0 -11
  86. package/dist/types/dom/core.d.ts +0 -431
  87. package/dist/types/dom/parser.d.ts +0 -7
  88. package/dist/types/dom/selector.d.ts +0 -5
  89. package/dist/types/dom.d.ts +0 -5
  90. package/dist/types/env.d.ts +0 -124
  91. package/dist/types/fetch-retry.d.ts +0 -96
  92. package/dist/types/file-lock.d.ts +0 -23
  93. package/dist/types/format.d.ts +0 -37
  94. package/dist/types/frontmatter.d.ts +0 -46
  95. package/dist/types/fs-error.d.ts +0 -31
  96. package/dist/types/glob.d.ts +0 -28
  97. package/dist/types/headers.d.ts +0 -34
  98. package/dist/types/index.d.ts +0 -41
  99. package/dist/types/json-parse.d.ts +0 -83
  100. package/dist/types/json.d.ts +0 -20
  101. package/dist/types/logger/rotating-file.d.ts +0 -18
  102. package/dist/types/logger.d.ts +0 -96
  103. package/dist/types/loop-phase.d.ts +0 -10
  104. package/dist/types/lru.d.ts +0 -46
  105. package/dist/types/marked/core.d.ts +0 -445
  106. package/dist/types/marked.d.ts +0 -2
  107. package/dist/types/math-delimiters.d.ts +0 -45
  108. package/dist/types/mermaid-ascii.d.ts +0 -11
  109. package/dist/types/mime.d.ts +0 -29
  110. package/dist/types/module-timer.d.ts +0 -1
  111. package/dist/types/path-tree.d.ts +0 -76
  112. package/dist/types/path.d.ts +0 -2
  113. package/dist/types/peek-file.d.ts +0 -29
  114. package/dist/types/postmortem.d.ts +0 -174
  115. package/dist/types/process-name.d.ts +0 -7
  116. package/dist/types/procmgr.d.ts +0 -74
  117. package/dist/types/prompt.d.ts +0 -18
  118. package/dist/types/ptree.d.ts +0 -124
  119. package/dist/types/readability/readability.d.ts +0 -9
  120. package/dist/types/readability/readerable.d.ts +0 -10
  121. package/dist/types/readability/types.d.ts +0 -70
  122. package/dist/types/readability.d.ts +0 -4
  123. package/dist/types/ring.d.ts +0 -93
  124. package/dist/types/runtime-install.d.ts +0 -85
  125. package/dist/types/sanitize-text.d.ts +0 -29
  126. package/dist/types/snowflake.d.ts +0 -25
  127. package/dist/types/sqlite.d.ts +0 -26
  128. package/dist/types/stderr-guard.d.ts +0 -22
  129. package/dist/types/stream.d.ts +0 -75
  130. package/dist/types/tab-spacing.d.ts +0 -24
  131. package/dist/types/temp.d.ts +0 -17
  132. package/dist/types/template.d.ts +0 -62
  133. package/dist/types/timing-buffer.d.ts +0 -22
  134. package/dist/types/tls-fetch.d.ts +0 -37
  135. package/dist/types/turndown/gfm.d.ts +0 -11
  136. package/dist/types/turndown/html.d.ts +0 -5
  137. package/dist/types/turndown/service.d.ts +0 -21
  138. package/dist/types/turndown/types.d.ts +0 -70
  139. package/dist/types/turndown.d.ts +0 -4
  140. package/dist/types/type-guards.d.ts +0 -5
  141. package/dist/types/vendor/mermaid-ascii/ascii/ansi.d.ts +0 -41
  142. package/dist/types/vendor/mermaid-ascii/ascii/canvas.d.ts +0 -89
  143. package/dist/types/vendor/mermaid-ascii/ascii/class-diagram.d.ts +0 -7
  144. package/dist/types/vendor/mermaid-ascii/ascii/converter.d.ts +0 -12
  145. package/dist/types/vendor/mermaid-ascii/ascii/draw.d.ts +0 -66
  146. package/dist/types/vendor/mermaid-ascii/ascii/edge-bundling.d.ts +0 -48
  147. package/dist/types/vendor/mermaid-ascii/ascii/edge-routing.d.ts +0 -43
  148. package/dist/types/vendor/mermaid-ascii/ascii/er-diagram.d.ts +0 -7
  149. package/dist/types/vendor/mermaid-ascii/ascii/grid.d.ts +0 -56
  150. package/dist/types/vendor/mermaid-ascii/ascii/index.d.ts +0 -65
  151. package/dist/types/vendor/mermaid-ascii/ascii/multiline-utils.d.ts +0 -27
  152. package/dist/types/vendor/mermaid-ascii/ascii/pathfinder.d.ts +0 -17
  153. package/dist/types/vendor/mermaid-ascii/ascii/sequence.d.ts +0 -7
  154. package/dist/types/vendor/mermaid-ascii/ascii/shapes/circle.d.ts +0 -11
  155. package/dist/types/vendor/mermaid-ascii/ascii/shapes/corners.d.ts +0 -34
  156. package/dist/types/vendor/mermaid-ascii/ascii/shapes/diamond.d.ts +0 -11
  157. package/dist/types/vendor/mermaid-ascii/ascii/shapes/hexagon.d.ts +0 -11
  158. package/dist/types/vendor/mermaid-ascii/ascii/shapes/index.d.ts +0 -26
  159. package/dist/types/vendor/mermaid-ascii/ascii/shapes/rectangle.d.ts +0 -31
  160. package/dist/types/vendor/mermaid-ascii/ascii/shapes/rounded.d.ts +0 -11
  161. package/dist/types/vendor/mermaid-ascii/ascii/shapes/special.d.ts +0 -59
  162. package/dist/types/vendor/mermaid-ascii/ascii/shapes/stadium.d.ts +0 -17
  163. package/dist/types/vendor/mermaid-ascii/ascii/shapes/state.d.ts +0 -30
  164. package/dist/types/vendor/mermaid-ascii/ascii/shapes/types.d.ts +0 -55
  165. package/dist/types/vendor/mermaid-ascii/ascii/types.d.ts +0 -206
  166. package/dist/types/vendor/mermaid-ascii/ascii/validate.d.ts +0 -51
  167. package/dist/types/vendor/mermaid-ascii/ascii/xychart.d.ts +0 -2
  168. package/dist/types/vendor/mermaid-ascii/class/parser.d.ts +0 -6
  169. package/dist/types/vendor/mermaid-ascii/class/types.d.ts +0 -102
  170. package/dist/types/vendor/mermaid-ascii/er/parser.d.ts +0 -6
  171. package/dist/types/vendor/mermaid-ascii/er/types.d.ts +0 -76
  172. package/dist/types/vendor/mermaid-ascii/index.d.ts +0 -1
  173. package/dist/types/vendor/mermaid-ascii/multiline-utils.d.ts +0 -9
  174. package/dist/types/vendor/mermaid-ascii/parser.d.ts +0 -7
  175. package/dist/types/vendor/mermaid-ascii/sequence/parser.d.ts +0 -6
  176. package/dist/types/vendor/mermaid-ascii/sequence/types.d.ts +0 -130
  177. package/dist/types/vendor/mermaid-ascii/text-metrics.d.ts +0 -23
  178. package/dist/types/vendor/mermaid-ascii/types.d.ts +0 -114
  179. package/dist/types/vendor/mermaid-ascii/xychart/colors.d.ts +0 -25
  180. package/dist/types/vendor/mermaid-ascii/xychart/parser.d.ts +0 -6
  181. package/dist/types/vendor/mermaid-ascii/xychart/types.d.ts +0 -145
  182. package/dist/types/version.d.ts +0 -18
  183. package/dist/types/vterm/buffer.d.ts +0 -99
  184. package/dist/types/vterm/terminal.d.ts +0 -44
  185. package/dist/types/vterm.d.ts +0 -8
  186. package/dist/types/which.d.ts +0 -37
  187. package/dist/types/worker-host.d.ts +0 -51
  188. package/dist/types/xml.d.ts +0 -31
@@ -1,130 +0,0 @@
1
- /** Parsed sequence diagram — logical structure from mermaid text */
2
- export interface SequenceDiagram {
3
- /** Ordered list of actors/participants */
4
- actors: Actor[];
5
- /** Messages between actors in chronological order */
6
- messages: Message[];
7
- /** Structural blocks (loop, alt, opt, par, critical) */
8
- blocks: Block[];
9
- /** Notes attached to actors */
10
- notes: Note[];
11
- }
12
- export interface Actor {
13
- id: string;
14
- label: string;
15
- /** 'participant' renders as a box, 'actor' renders as a stick figure */
16
- type: 'participant' | 'actor';
17
- }
18
- export interface Message {
19
- from: string;
20
- to: string;
21
- label: string;
22
- /** Arrow style: solid line or dashed line */
23
- lineStyle: 'solid' | 'dashed';
24
- /** Arrow head: filled (closed) or open */
25
- arrowHead: 'filled' | 'open';
26
- /** Activate the target lifeline (+) */
27
- activate?: boolean;
28
- /** Deactivate the source lifeline (-) */
29
- deactivate?: boolean;
30
- }
31
- export interface Block {
32
- /** Block type keyword */
33
- type: 'loop' | 'alt' | 'opt' | 'par' | 'critical' | 'break' | 'rect';
34
- /** Label for the block header */
35
- label: string;
36
- /** Index of the first message inside this block */
37
- startIndex: number;
38
- /** Index of the last message inside this block (inclusive) */
39
- endIndex: number;
40
- /** For alt/par blocks: indices where "else"/"and" dividers appear (message indices) */
41
- dividers: Array<{
42
- index: number;
43
- label: string;
44
- }>;
45
- }
46
- export interface Note {
47
- /** Which actor(s) the note is attached to */
48
- actorIds: string[];
49
- /** Note text content */
50
- text: string;
51
- /** Position relative to the actor(s) */
52
- position: 'left' | 'right' | 'over';
53
- /** Message index after which this note appears */
54
- afterIndex: number;
55
- }
56
- export interface PositionedSequenceDiagram {
57
- width: number;
58
- height: number;
59
- actors: PositionedActor[];
60
- lifelines: Lifeline[];
61
- messages: PositionedMessage[];
62
- activations: Activation[];
63
- blocks: PositionedBlock[];
64
- notes: PositionedNote[];
65
- }
66
- export interface PositionedActor {
67
- id: string;
68
- label: string;
69
- type: 'participant' | 'actor';
70
- /** Center x of the actor box */
71
- x: number;
72
- /** Top y of the actor box */
73
- y: number;
74
- width: number;
75
- height: number;
76
- }
77
- /** Vertical dashed line from actor to bottom of diagram */
78
- export interface Lifeline {
79
- actorId: string;
80
- x: number;
81
- topY: number;
82
- bottomY: number;
83
- }
84
- export interface PositionedMessage {
85
- from: string;
86
- to: string;
87
- label: string;
88
- lineStyle: 'solid' | 'dashed';
89
- arrowHead: 'filled' | 'open';
90
- /** Start point (from actor's lifeline) */
91
- x1: number;
92
- /** End point (to actor's lifeline) */
93
- x2: number;
94
- /** Vertical position */
95
- y: number;
96
- /** Whether this is a self-message (same actor) */
97
- isSelf: boolean;
98
- }
99
- /** Narrow rectangle on a lifeline showing active processing */
100
- export interface Activation {
101
- actorId: string;
102
- x: number;
103
- topY: number;
104
- bottomY: number;
105
- width: number;
106
- }
107
- export interface PositionedBlock {
108
- type: Block['type'];
109
- label: string;
110
- x: number;
111
- y: number;
112
- width: number;
113
- height: number;
114
- /** Divider lines within the block (for alt/par) */
115
- dividers: Array<{
116
- y: number;
117
- label: string;
118
- }>;
119
- }
120
- export interface PositionedNote {
121
- text: string;
122
- x: number;
123
- y: number;
124
- width: number;
125
- height: number;
126
- /** Actor IDs this note is attached to (for SVG attribution) */
127
- actors?: string[];
128
- /** Note position relative to actors (for SVG attribution) */
129
- position?: 'left' | 'right' | 'over';
130
- }
@@ -1,23 +0,0 @@
1
- /**
2
- * Placeholder occupying the second cell of a fullwidth glyph on the ASCII
3
- * canvas. U+0000 cannot appear in parsed Mermaid labels, is treated as
4
- * occupied label content by canvas merging, and is stripped at
5
- * serialization time. Invariant: a WIDE_PAD cell always sits immediately
6
- * right of its lead cell; canvas writes keep the pair atomic.
7
- */
8
- export declare const WIDE_PAD = "\0";
9
- /** Opaque label-space placeholder that serializes back to a regular space. */
10
- export declare const LABEL_SPACE = "\u0001";
11
- /**
12
- * Display width of a string in terminal columns, summed over grapheme
13
- * clusters so it always equals `toCells(text).length`. ASCII-only strings
14
- * take a fast path.
15
- */
16
- export declare function displayWidth(text: string): number;
17
- /**
18
- * Expand a string into ASCII-canvas cells: each 2-column grapheme cluster
19
- * is stored whole in one cell and followed by WIDE_PAD, so that
20
- * `cells.length === displayWidth(text)`. Per-character placement loops can
21
- * iterate the result with plain cell offsets.
22
- */
23
- export declare function toCells(text: string): string[];
@@ -1,114 +0,0 @@
1
- export interface MermaidGraph {
2
- direction: Direction;
3
- nodes: Map<string, MermaidNode>;
4
- edges: MermaidEdge[];
5
- subgraphs: MermaidSubgraph[];
6
- classDefs: Map<string, Record<string, string>>;
7
- /** Maps node IDs to their class names (from `class X className` or `:::className` shorthand) */
8
- classAssignments: Map<string, string>;
9
- /** Maps node IDs to inline styles (from `style X fill:#f00,stroke:#333`) */
10
- nodeStyles: Map<string, Record<string, string>>;
11
- /** Maps edge indices (or 'default') to inline styles from `linkStyle` directives */
12
- linkStyles: Map<number | 'default', Record<string, string>>;
13
- }
14
- export type Direction = 'TD' | 'TB' | 'LR' | 'BT' | 'RL';
15
- export interface MermaidNode {
16
- id: string;
17
- label: string;
18
- shape: NodeShape;
19
- }
20
- export type NodeShape = 'rectangle' | 'rounded' | 'diamond' | 'stadium' | 'circle' | 'subroutine' | 'doublecircle' | 'hexagon' | 'cylinder' | 'asymmetric' | 'trapezoid' | 'trapezoid-alt' | 'state-start' | 'state-end';
21
- export interface MermaidEdge {
22
- source: string;
23
- target: string;
24
- label?: string;
25
- style: EdgeStyle;
26
- /** Whether to render an arrowhead at the start (source end) of the edge */
27
- hasArrowStart: boolean;
28
- /** Whether to render an arrowhead at the end (target end) of the edge */
29
- hasArrowEnd: boolean;
30
- }
31
- export type EdgeStyle = 'solid' | 'dotted' | 'thick';
32
- export interface MermaidSubgraph {
33
- id: string;
34
- label: string;
35
- nodeIds: string[];
36
- children: MermaidSubgraph[];
37
- /** Optional direction override for this subgraph's internal layout */
38
- direction?: Direction;
39
- }
40
- export interface PositionedGraph {
41
- width: number;
42
- height: number;
43
- nodes: PositionedNode[];
44
- edges: PositionedEdge[];
45
- groups: PositionedGroup[];
46
- }
47
- export interface PositionedNode {
48
- id: string;
49
- label: string;
50
- shape: NodeShape;
51
- x: number;
52
- y: number;
53
- width: number;
54
- height: number;
55
- /** Inline styles resolved from classDef + explicit `style` statements — override theme defaults */
56
- inlineStyle?: Record<string, string>;
57
- }
58
- export interface PositionedEdge {
59
- source: string;
60
- target: string;
61
- label?: string;
62
- style: EdgeStyle;
63
- hasArrowStart: boolean;
64
- hasArrowEnd: boolean;
65
- /** Full path including bends — array of {x, y} points */
66
- points: Point[];
67
- /** Layout-computed label center position (avoids label-label collisions) */
68
- labelPosition?: Point;
69
- /** Inline styles resolved from `linkStyle` directives — override theme defaults */
70
- inlineStyle?: Record<string, string>;
71
- }
72
- export interface Point {
73
- x: number;
74
- y: number;
75
- }
76
- export interface PositionedGroup {
77
- id: string;
78
- label: string;
79
- x: number;
80
- y: number;
81
- width: number;
82
- height: number;
83
- children: PositionedGroup[];
84
- }
85
- export interface RenderOptions {
86
- /** Background color → CSS variable --bg. Default: '#FFFFFF' */
87
- bg?: string;
88
- /** Foreground / primary text color → CSS variable --fg. Default: '#27272A' */
89
- fg?: string;
90
- /** Edge/connector color → CSS variable --line */
91
- line?: string;
92
- /** Arrow heads, highlights → CSS variable --accent */
93
- accent?: string;
94
- /** Secondary text, edge labels → CSS variable --muted */
95
- muted?: string;
96
- /** Node/box fill tint → CSS variable --surface */
97
- surface?: string;
98
- /** Node/group stroke color → CSS variable --border */
99
- border?: string;
100
- /** Font family for all text. Default: 'Inter' */
101
- font?: string;
102
- /** Canvas padding in px. Default: 40 */
103
- padding?: number;
104
- /** Horizontal spacing between sibling nodes. Default: 24 */
105
- nodeSpacing?: number;
106
- /** Vertical spacing between layers. Default: 40 */
107
- layerSpacing?: number;
108
- /** Spacing between disconnected components. Default: nodeSpacing (24) */
109
- componentSpacing?: number;
110
- /** Render with transparent background (no background style on SVG). Default: false */
111
- transparent?: boolean;
112
- /** Enable hover tooltips on chart data points (xychart only). Default: false */
113
- interactive?: boolean;
114
- }
@@ -1,25 +0,0 @@
1
- /** Default accent for charts when the theme doesn't provide one. */
2
- export declare const CHART_ACCENT_FALLBACK = "#3b82f6";
3
- /** Check whether a string is a valid 6-digit hex color (e.g. "#3b82f6"). */
4
- export declare function isValidHex(color: string): boolean;
5
- /**
6
- * Detect whether a background color is dark (lightness < 50%).
7
- */
8
- export declare function isDarkBackground(bgHex: string): boolean;
9
- /**
10
- * Mix two hex colors in RGB space.
11
- * `ratio` controls how much of `fgHex` shows: 0 = pure bg, 1 = pure fg.
12
- * Equivalent to alpha-compositing fg over bg at the given opacity.
13
- */
14
- export declare function mixHexColors(bgHex: string, fgHex: string, ratio: number): string;
15
- /**
16
- * Get the hex color for a series index.
17
- * Index 0 returns the accent color as-is.
18
- * Index 1+ alternate between darker and lighter shades of the same hue
19
- * with subtle hue drift (±8-12° per tier) to stay in the same family.
20
- *
21
- * When `bgColor` is provided, shade direction adapts to the background:
22
- * - Light bg: odd = darker, even = lighter (default)
23
- * - Dark bg: odd = lighter, even = darker (so shades stay visible)
24
- */
25
- export declare function getSeriesColor(index: number, accentColor: string, bgColor?: string): string;
@@ -1,6 +0,0 @@
1
- import type { XYChart } from './types.js';
2
- /**
3
- * Parse a Mermaid xychart-beta diagram from preprocessed lines.
4
- * Lines should already be trimmed and comment-stripped.
5
- */
6
- export declare function parseXYChart(lines: string[]): XYChart;
@@ -1,145 +0,0 @@
1
- /** Parsed XY chart — logical structure from mermaid text */
2
- export interface XYChart {
3
- /** Optional chart title */
4
- title?: string;
5
- /** Chart orientation: vertical (default) or horizontal */
6
- horizontal: boolean;
7
- /** X-axis configuration */
8
- xAxis: XYAxis;
9
- /** Y-axis configuration */
10
- yAxis: XYAxis;
11
- /** Data series (bar and/or line) */
12
- series: XYChartSeries[];
13
- }
14
- /** Axis configuration — categorical (labels) or numeric (range) */
15
- export interface XYAxis {
16
- /** Optional axis title/label */
17
- title?: string;
18
- /** Categorical labels (e.g., ["jan", "feb", "mar"]) — mutually exclusive with range */
19
- categories?: string[];
20
- /** Numeric range — mutually exclusive with categories */
21
- range?: {
22
- min: number;
23
- max: number;
24
- };
25
- }
26
- /** A single data series (bar or line) */
27
- export interface XYChartSeries {
28
- /** Series type */
29
- type: 'bar' | 'line';
30
- /** Data values — one per category, or evenly spaced across numeric range */
31
- data: number[];
32
- }
33
- export interface PositionedXYChart {
34
- width: number;
35
- height: number;
36
- /** Whether this is a horizontal (rotated) chart */
37
- horizontal?: boolean;
38
- /** Title text and position (if present) */
39
- title?: PositionedTitle;
40
- /** Positioned x-axis with tick marks and labels */
41
- xAxis: PositionedAxis;
42
- /** Positioned y-axis with tick marks and labels */
43
- yAxis: PositionedAxis;
44
- /** The plot area bounds (inside axes) */
45
- plotArea: PlotArea;
46
- /** Positioned bar groups */
47
- bars: PositionedBar[];
48
- /** Positioned line polylines */
49
- lines: PositionedLine[];
50
- /** Horizontal grid lines for readability */
51
- gridLines: GridLine[];
52
- /** Legend items (shown when multiple series) */
53
- legend: LegendItem[];
54
- }
55
- export interface LegendItem {
56
- /** Display label */
57
- label: string;
58
- /** Position of the swatch/icon */
59
- x: number;
60
- y: number;
61
- /** Series type determines swatch shape (rect for bar, line+dot for line) */
62
- type: 'bar' | 'line';
63
- /** Series index within its type (for layout grouping) */
64
- seriesIndex: number;
65
- /** Global color index across all series (for unified color assignment) */
66
- colorIndex: number;
67
- }
68
- export interface PositionedTitle {
69
- text: string;
70
- x: number;
71
- y: number;
72
- }
73
- export interface PositionedAxis {
74
- /** Optional axis title text and position */
75
- title?: {
76
- text: string;
77
- x: number;
78
- y: number;
79
- rotate?: number;
80
- };
81
- /** Tick positions along the axis */
82
- ticks: AxisTick[];
83
- /** Axis line: start and end coordinates */
84
- line: {
85
- x1: number;
86
- y1: number;
87
- x2: number;
88
- y2: number;
89
- };
90
- }
91
- export interface AxisTick {
92
- /** Label text for this tick */
93
- label: string;
94
- /** Position of the tick mark on the axis */
95
- x: number;
96
- y: number;
97
- /** End of the tick mark (short perpendicular line) */
98
- tx: number;
99
- ty: number;
100
- /** Label anchor position */
101
- labelX: number;
102
- labelY: number;
103
- /** Text anchor for label */
104
- textAnchor: 'start' | 'middle' | 'end';
105
- }
106
- export interface PlotArea {
107
- x: number;
108
- y: number;
109
- width: number;
110
- height: number;
111
- }
112
- export interface PositionedBar {
113
- /** Bar rectangle in SVG coordinates */
114
- x: number;
115
- y: number;
116
- width: number;
117
- height: number;
118
- /** Original data value */
119
- value: number;
120
- /** Category label for this bar (e.g. "Jan") */
121
- label?: string;
122
- /** Series index within bar type (for layout grouping) */
123
- seriesIndex: number;
124
- /** Global color index across all series */
125
- colorIndex: number;
126
- }
127
- export interface PositionedLine {
128
- /** Polyline points */
129
- points: Array<{
130
- x: number;
131
- y: number;
132
- value: number;
133
- label?: string;
134
- }>;
135
- /** Series index within line type (for layout grouping) */
136
- seriesIndex: number;
137
- /** Global color index across all series */
138
- colorIndex: number;
139
- }
140
- export interface GridLine {
141
- x1: number;
142
- y1: number;
143
- x2: number;
144
- y2: number;
145
- }
@@ -1,18 +0,0 @@
1
- /**
2
- * Compare two version strings.
3
- *
4
- * Canonical comparator that supersedes the historical in-repo copies
5
- * (update-cli, hackage scraper, release scripts):
6
- * - inputs are trimmed and at most one leading `v`/`V` is stripped
7
- * - dot-separated segments are compared numerically, missing trailing
8
- * segments count as 0, so `1.2` === `1.2.0` and any segment count works
9
- * - a SemVer-2.0 prerelease suffix sorts before the plain release
10
- * (`1.0.0-beta` < `1.0.0`); prerelease identifiers follow SemVer order
11
- * (numeric < alphanumeric, numeric compared by value, alphanumeric
12
- * compared lexically, longer sets of equal fields win)
13
- * - SemVer build metadata begins at the first `+` and does not participate
14
- * in precedence; it is stripped before core/prerelease parsing
15
- * - malformed numeric segments compare as 0 (`1.2.x` === `1.2.0`)
16
- * - never throws; returns only -1 | 0 | 1
17
- */
18
- export declare function compareVersions(a: string, b: string): number;
@@ -1,99 +0,0 @@
1
- /** Cell rendition tracked by the virtual terminal. */
2
- export interface CellAttributes {
3
- bold: boolean;
4
- dim: boolean;
5
- italic: boolean;
6
- underline: boolean;
7
- inverse: boolean;
8
- strikethrough: boolean;
9
- overline: boolean;
10
- fgMode: 0 | 1 | 2;
11
- fg: number;
12
- bgMode: 0 | 1 | 2;
13
- bg: number;
14
- }
15
- /** A mutable terminal grid cell. */
16
- export interface CellData {
17
- chars: string;
18
- width: number;
19
- attrs: CellAttributes;
20
- }
21
- /** Creates the default rendition. */
22
- export declare function defaultAttributes(): CellAttributes;
23
- /** Creates an empty cell with the supplied rendition. */
24
- export declare function blankCell(attrs?: CellAttributes): CellData;
25
- /** Proposed xterm-compatible cell readback object. */
26
- export declare class BufferCell {
27
- #private;
28
- /** Reuses this object for another grid cell. */
29
- setFrom(cell: CellData): this;
30
- /** Returns the grapheme stored in this cell. */
31
- getChars(): string;
32
- /** Returns the cell width, with zero denoting a wide-cell continuation. */
33
- getWidth(): number;
34
- /** Returns the packed foreground palette index or RGB value. */
35
- getFgColor(): number;
36
- /** Returns the packed background palette index or RGB value. */
37
- getBgColor(): number;
38
- /** Reports bold rendition. */
39
- isBold(): number;
40
- /** Reports dim rendition. */
41
- isDim(): number;
42
- /** Reports italic rendition. */
43
- isItalic(): number;
44
- /** Reports underline rendition. */
45
- isUnderline(): number;
46
- /** Reports inverse rendition. */
47
- isInverse(): number;
48
- /** Reports strikethrough rendition. */
49
- isStrikethrough(): number;
50
- /** Reports overline rendition. */
51
- isOverline(): number;
52
- /** Reports a true-color foreground. */
53
- isFgRGB(): boolean;
54
- /** Reports a true-color background. */
55
- isBgRGB(): boolean;
56
- /** Reports a palette foreground. */
57
- isFgPalette(): boolean;
58
- /** Reports a palette background. */
59
- isBgPalette(): boolean;
60
- }
61
- /** One physical row in a terminal buffer. */
62
- export declare class BufferLine {
63
- cells: CellData[];
64
- isWrapped: boolean;
65
- constructor(columns: number, attrs?: CellAttributes);
66
- /** Number of grid columns in the line. */
67
- get length(): number;
68
- /** Reads a cell, optionally reusing the caller's object. */
69
- getCell(column: number, cell?: BufferCell): BufferCell | undefined;
70
- /** Converts a column range to text. */
71
- translateToString(trimRight?: boolean, startColumn?: number, endColumn?: number): string;
72
- }
73
- /** Storage backing one terminal screen and its history. */
74
- export interface BufferState {
75
- lines: BufferLine[];
76
- baseY: number;
77
- viewportY: number;
78
- cursorX: number;
79
- cursorY: number;
80
- }
81
- /** Public xterm-compatible view over a buffer state. */
82
- export declare class BufferView {
83
- private readonly state;
84
- constructor(state: () => BufferState);
85
- /** Number of physical lines, including scrollback. */
86
- get length(): number;
87
- /** First row of the live screen in the full buffer. */
88
- get baseY(): number;
89
- /** First row currently exposed by the viewport. */
90
- get viewportY(): number;
91
- /** Cursor column in the live screen. */
92
- get cursorX(): number;
93
- /** Cursor row in the live screen. */
94
- get cursorY(): number;
95
- /** Reads a physical buffer line. */
96
- getLine(row: number): BufferLine | undefined;
97
- /** Creates a reusable empty cell readback object. */
98
- getNullCell(): BufferCell;
99
- }
@@ -1,44 +0,0 @@
1
- import { BufferView } from "./buffer.js";
2
- /** Construction options supported by the headless virtual terminal. */
3
- export interface TerminalOptions {
4
- cols?: number;
5
- rows?: number;
6
- scrollback?: number;
7
- allowProposedApi?: boolean;
8
- disableStdin?: boolean;
9
- }
10
- /** Disposable event subscription. */
11
- export interface Disposable {
12
- dispose(): void;
13
- }
14
- /** Observable terminal modes used by interactive input normalization. */
15
- export interface TerminalModes {
16
- applicationCursorKeysMode: boolean;
17
- }
18
- /** Buffer collection exposed by the virtual terminal. */
19
- export interface TerminalBuffers {
20
- readonly active: BufferView;
21
- readonly normal: BufferView;
22
- readonly alternate: BufferView;
23
- }
24
- /** Behavior-compatible reimplementation of @xterm/headless's used surface. */
25
- export declare class Terminal {
26
- #private;
27
- /** Current terminal column count. */
28
- cols: number;
29
- /** Current terminal row count. */
30
- rows: number;
31
- /** Normal, alternate, and active buffer views. */
32
- readonly buffer: TerminalBuffers;
33
- /** Currently active input modes. */
34
- readonly modes: TerminalModes;
35
- constructor(options?: TerminalOptions);
36
- /** Parses terminal output and invokes the callback after the write is committed. */
37
- write(data: string | Uint8Array, callback?: () => void): void;
38
- /** Changes the terminal grid and reflows wrapped normal-buffer lines. */
39
- resize(columns: number, rows: number): void;
40
- /** Subscribes to terminal-generated input replies. */
41
- onData(listener: (data: string) => void): Disposable;
42
- /** Releases parser state and event listeners. */
43
- dispose(): void;
44
- }
@@ -1,8 +0,0 @@
1
- /** Behavior-compatible reimplementation of @xterm/headless's used surface. */
2
- export * from "./vterm/buffer.js";
3
- export * from "./vterm/terminal.js";
4
- import { Terminal } from "./vterm/terminal.js";
5
- declare const vterm: {
6
- Terminal: typeof Terminal;
7
- };
8
- export default vterm;
@@ -1,37 +0,0 @@
1
- /**
2
- * Cache policy for which lookups.
3
- */
4
- export declare const enum WhichCachePolicy {
5
- /**
6
- * Use cached result if available.
7
- */
8
- Cached = 0,
9
- /**
10
- * Bypass cache and perform a new lookup.
11
- */
12
- Bypass = 1,
13
- /**
14
- * Always update cache.
15
- */
16
- Fresh = 2,
17
- /**
18
- * Read-only, serves from cache if present, but doesn't write.
19
- */
20
- ReadOnly = 3
21
- }
22
- export interface WhichOptions extends Bun.WhichOptions {
23
- /**
24
- * Cache policy for the lookup.
25
- * Defaults to `WhichCachePolicy.Fresh`.
26
- */
27
- cache?: WhichCachePolicy;
28
- }
29
- export declare const whichFresh: typeof Bun.which;
30
- /**
31
- * Locate binary on PATH (with flexible caching).
32
- *
33
- * @param command - Binary name to resolve
34
- * @param options - Bun.WhichOptions plus `cache` control
35
- * @returns Filesystem path if found, else null
36
- */
37
- export declare function $which(command: string, options?: WhichOptions): string | null;