@linxiraos/pi-utils 1.0.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.
Files changed (244) hide show
  1. package/CHANGELOG.md +449 -0
  2. package/README.md +36 -0
  3. package/dist/types/abortable.d.ts +32 -0
  4. package/dist/types/acp/connection.d.ts +118 -0
  5. package/dist/types/acp/protocol.d.ts +526 -0
  6. package/dist/types/acp/schema.d.ts +41 -0
  7. package/dist/types/acp/stream.d.ts +8 -0
  8. package/dist/types/acp/transport.d.ts +81 -0
  9. package/dist/types/acp.d.ts +6 -0
  10. package/dist/types/async.d.ts +20 -0
  11. package/dist/types/binary.d.ts +17 -0
  12. package/dist/types/browsers.d.ts +68 -0
  13. package/dist/types/chalk.d.ts +125 -0
  14. package/dist/types/cli.d.ts +134 -0
  15. package/dist/types/color.d.ts +102 -0
  16. package/dist/types/dates.d.ts +7 -0
  17. package/dist/types/dirs.d.ts +282 -0
  18. package/dist/types/docx/converter.d.ts +46 -0
  19. package/dist/types/docx/xml.d.ts +26 -0
  20. package/dist/types/docx/zip.d.ts +6 -0
  21. package/dist/types/docx.d.ts +11 -0
  22. package/dist/types/dom/core.d.ts +431 -0
  23. package/dist/types/dom/parser.d.ts +7 -0
  24. package/dist/types/dom/selector.d.ts +5 -0
  25. package/dist/types/dom.d.ts +5 -0
  26. package/dist/types/env.d.ts +124 -0
  27. package/dist/types/fetch-retry.d.ts +96 -0
  28. package/dist/types/file-lock.d.ts +23 -0
  29. package/dist/types/format.d.ts +37 -0
  30. package/dist/types/frontmatter.d.ts +46 -0
  31. package/dist/types/fs-error.d.ts +31 -0
  32. package/dist/types/glob.d.ts +28 -0
  33. package/dist/types/headers.d.ts +34 -0
  34. package/dist/types/index.d.ts +39 -0
  35. package/dist/types/json-parse.d.ts +74 -0
  36. package/dist/types/json.d.ts +14 -0
  37. package/dist/types/logger/rotating-file.d.ts +18 -0
  38. package/dist/types/logger.d.ts +96 -0
  39. package/dist/types/loop-phase.d.ts +10 -0
  40. package/dist/types/lru.d.ts +46 -0
  41. package/dist/types/marked/core.d.ts +445 -0
  42. package/dist/types/marked.d.ts +2 -0
  43. package/dist/types/mermaid-ascii.d.ts +11 -0
  44. package/dist/types/mime.d.ts +29 -0
  45. package/dist/types/module-timer.d.ts +1 -0
  46. package/dist/types/path-tree.d.ts +76 -0
  47. package/dist/types/path.d.ts +2 -0
  48. package/dist/types/peek-file.d.ts +29 -0
  49. package/dist/types/postmortem.d.ts +104 -0
  50. package/dist/types/process-name.d.ts +7 -0
  51. package/dist/types/procmgr.d.ts +74 -0
  52. package/dist/types/prompt.d.ts +18 -0
  53. package/dist/types/ptree.d.ts +110 -0
  54. package/dist/types/readability/readability.d.ts +9 -0
  55. package/dist/types/readability/readerable.d.ts +10 -0
  56. package/dist/types/readability/types.d.ts +70 -0
  57. package/dist/types/readability.d.ts +4 -0
  58. package/dist/types/ring.d.ts +93 -0
  59. package/dist/types/runtime-install.d.ts +78 -0
  60. package/dist/types/sanitize-text.d.ts +29 -0
  61. package/dist/types/snowflake.d.ts +25 -0
  62. package/dist/types/stderr-guard.d.ts +22 -0
  63. package/dist/types/stream.d.ts +67 -0
  64. package/dist/types/tab-spacing.d.ts +24 -0
  65. package/dist/types/temp.d.ts +17 -0
  66. package/dist/types/template.d.ts +62 -0
  67. package/dist/types/timing-buffer.d.ts +22 -0
  68. package/dist/types/tls-fetch.d.ts +37 -0
  69. package/dist/types/turndown/gfm.d.ts +11 -0
  70. package/dist/types/turndown/html.d.ts +5 -0
  71. package/dist/types/turndown/service.d.ts +21 -0
  72. package/dist/types/turndown/types.d.ts +70 -0
  73. package/dist/types/turndown.d.ts +4 -0
  74. package/dist/types/type-guards.d.ts +5 -0
  75. package/dist/types/vendor/mermaid-ascii/ascii/ansi.d.ts +41 -0
  76. package/dist/types/vendor/mermaid-ascii/ascii/canvas.d.ts +89 -0
  77. package/dist/types/vendor/mermaid-ascii/ascii/class-diagram.d.ts +7 -0
  78. package/dist/types/vendor/mermaid-ascii/ascii/converter.d.ts +12 -0
  79. package/dist/types/vendor/mermaid-ascii/ascii/draw.d.ts +66 -0
  80. package/dist/types/vendor/mermaid-ascii/ascii/edge-bundling.d.ts +48 -0
  81. package/dist/types/vendor/mermaid-ascii/ascii/edge-routing.d.ts +43 -0
  82. package/dist/types/vendor/mermaid-ascii/ascii/er-diagram.d.ts +7 -0
  83. package/dist/types/vendor/mermaid-ascii/ascii/grid.d.ts +56 -0
  84. package/dist/types/vendor/mermaid-ascii/ascii/index.d.ts +65 -0
  85. package/dist/types/vendor/mermaid-ascii/ascii/multiline-utils.d.ts +27 -0
  86. package/dist/types/vendor/mermaid-ascii/ascii/pathfinder.d.ts +17 -0
  87. package/dist/types/vendor/mermaid-ascii/ascii/sequence.d.ts +7 -0
  88. package/dist/types/vendor/mermaid-ascii/ascii/shapes/circle.d.ts +11 -0
  89. package/dist/types/vendor/mermaid-ascii/ascii/shapes/corners.d.ts +34 -0
  90. package/dist/types/vendor/mermaid-ascii/ascii/shapes/diamond.d.ts +11 -0
  91. package/dist/types/vendor/mermaid-ascii/ascii/shapes/hexagon.d.ts +11 -0
  92. package/dist/types/vendor/mermaid-ascii/ascii/shapes/index.d.ts +26 -0
  93. package/dist/types/vendor/mermaid-ascii/ascii/shapes/rectangle.d.ts +31 -0
  94. package/dist/types/vendor/mermaid-ascii/ascii/shapes/rounded.d.ts +11 -0
  95. package/dist/types/vendor/mermaid-ascii/ascii/shapes/special.d.ts +59 -0
  96. package/dist/types/vendor/mermaid-ascii/ascii/shapes/stadium.d.ts +17 -0
  97. package/dist/types/vendor/mermaid-ascii/ascii/shapes/state.d.ts +30 -0
  98. package/dist/types/vendor/mermaid-ascii/ascii/shapes/types.d.ts +55 -0
  99. package/dist/types/vendor/mermaid-ascii/ascii/types.d.ts +206 -0
  100. package/dist/types/vendor/mermaid-ascii/ascii/validate.d.ts +51 -0
  101. package/dist/types/vendor/mermaid-ascii/ascii/xychart.d.ts +2 -0
  102. package/dist/types/vendor/mermaid-ascii/class/parser.d.ts +6 -0
  103. package/dist/types/vendor/mermaid-ascii/class/types.d.ts +102 -0
  104. package/dist/types/vendor/mermaid-ascii/er/parser.d.ts +6 -0
  105. package/dist/types/vendor/mermaid-ascii/er/types.d.ts +76 -0
  106. package/dist/types/vendor/mermaid-ascii/index.d.ts +1 -0
  107. package/dist/types/vendor/mermaid-ascii/multiline-utils.d.ts +9 -0
  108. package/dist/types/vendor/mermaid-ascii/parser.d.ts +7 -0
  109. package/dist/types/vendor/mermaid-ascii/sequence/parser.d.ts +6 -0
  110. package/dist/types/vendor/mermaid-ascii/sequence/types.d.ts +130 -0
  111. package/dist/types/vendor/mermaid-ascii/text-metrics.d.ts +21 -0
  112. package/dist/types/vendor/mermaid-ascii/types.d.ts +114 -0
  113. package/dist/types/vendor/mermaid-ascii/xychart/colors.d.ts +25 -0
  114. package/dist/types/vendor/mermaid-ascii/xychart/parser.d.ts +6 -0
  115. package/dist/types/vendor/mermaid-ascii/xychart/types.d.ts +145 -0
  116. package/dist/types/version.d.ts +18 -0
  117. package/dist/types/vterm/buffer.d.ts +99 -0
  118. package/dist/types/vterm/terminal.d.ts +44 -0
  119. package/dist/types/vterm.d.ts +8 -0
  120. package/dist/types/which.d.ts +37 -0
  121. package/dist/types/worker-host.d.ts +51 -0
  122. package/dist/types/xml.d.ts +31 -0
  123. package/package.json +59 -0
  124. package/src/abortable.ts +109 -0
  125. package/src/acp/connection.ts +344 -0
  126. package/src/acp/protocol.ts +466 -0
  127. package/src/acp/schema.ts +160 -0
  128. package/src/acp/stream.ts +82 -0
  129. package/src/acp/transport.ts +213 -0
  130. package/src/acp.ts +6 -0
  131. package/src/async.ts +91 -0
  132. package/src/binary.ts +50 -0
  133. package/src/browsers.ts +501 -0
  134. package/src/chalk.ts +312 -0
  135. package/src/cli.ts +529 -0
  136. package/src/color.ts +302 -0
  137. package/src/dates.ts +194 -0
  138. package/src/dirs.ts +1026 -0
  139. package/src/docx/converter.ts +681 -0
  140. package/src/docx/xml.ts +166 -0
  141. package/src/docx/zip.ts +87 -0
  142. package/src/docx.ts +20 -0
  143. package/src/dom/core.ts +1254 -0
  144. package/src/dom/parser.ts +370 -0
  145. package/src/dom/selector.ts +290 -0
  146. package/src/dom.ts +33 -0
  147. package/src/env.ts +400 -0
  148. package/src/fetch-retry.ts +379 -0
  149. package/src/file-lock.ts +69 -0
  150. package/src/format.ts +113 -0
  151. package/src/frontmatter.ts +205 -0
  152. package/src/fs-error.ts +56 -0
  153. package/src/glob.ts +189 -0
  154. package/src/headers.ts +167 -0
  155. package/src/index.ts +59 -0
  156. package/src/json-parse.ts +821 -0
  157. package/src/json.ts +23 -0
  158. package/src/logger/rotating-file.ts +149 -0
  159. package/src/logger.ts +798 -0
  160. package/src/loop-phase.ts +49 -0
  161. package/src/lru.ts +185 -0
  162. package/src/marked/core.ts +1576 -0
  163. package/src/marked.ts +2 -0
  164. package/src/mermaid-ascii.ts +31 -0
  165. package/src/mime.ts +159 -0
  166. package/src/module-timer.ts +148 -0
  167. package/src/path-tree.ts +147 -0
  168. package/src/path.ts +28 -0
  169. package/src/peek-file.ts +188 -0
  170. package/src/postmortem.ts +433 -0
  171. package/src/process-name.ts +57 -0
  172. package/src/procmgr.ts +247 -0
  173. package/src/prompt.ts +545 -0
  174. package/src/ptree.ts +412 -0
  175. package/src/readability/readability.ts +533 -0
  176. package/src/readability/readerable.ts +51 -0
  177. package/src/readability/types.ts +72 -0
  178. package/src/readability.ts +11 -0
  179. package/src/ring.ts +169 -0
  180. package/src/runtime-install.ts +393 -0
  181. package/src/sanitize-text.ts +96 -0
  182. package/src/snowflake.ts +121 -0
  183. package/src/stderr-guard.ts +155 -0
  184. package/src/stream.ts +454 -0
  185. package/src/tab-spacing.ts +336 -0
  186. package/src/temp.ts +134 -0
  187. package/src/template.ts +586 -0
  188. package/src/timing-buffer.ts +47 -0
  189. package/src/tls-fetch.ts +178 -0
  190. package/src/turndown/gfm.ts +106 -0
  191. package/src/turndown/html.ts +257 -0
  192. package/src/turndown/service.ts +334 -0
  193. package/src/turndown/types.ts +81 -0
  194. package/src/turndown.ts +5 -0
  195. package/src/type-guards.ts +17 -0
  196. package/src/vendor/mermaid-ascii/NOTICE +33 -0
  197. package/src/vendor/mermaid-ascii/ascii/ansi.ts +409 -0
  198. package/src/vendor/mermaid-ascii/ascii/canvas.ts +476 -0
  199. package/src/vendor/mermaid-ascii/ascii/class-diagram.ts +699 -0
  200. package/src/vendor/mermaid-ascii/ascii/converter.ts +271 -0
  201. package/src/vendor/mermaid-ascii/ascii/draw.ts +1382 -0
  202. package/src/vendor/mermaid-ascii/ascii/edge-bundling.ts +328 -0
  203. package/src/vendor/mermaid-ascii/ascii/edge-routing.ts +297 -0
  204. package/src/vendor/mermaid-ascii/ascii/er-diagram.ts +441 -0
  205. package/src/vendor/mermaid-ascii/ascii/grid.ts +578 -0
  206. package/src/vendor/mermaid-ascii/ascii/index.ts +187 -0
  207. package/src/vendor/mermaid-ascii/ascii/multiline-utils.ts +78 -0
  208. package/src/vendor/mermaid-ascii/ascii/pathfinder.ts +277 -0
  209. package/src/vendor/mermaid-ascii/ascii/sequence.ts +460 -0
  210. package/src/vendor/mermaid-ascii/ascii/shapes/circle.ts +27 -0
  211. package/src/vendor/mermaid-ascii/ascii/shapes/corners.ts +127 -0
  212. package/src/vendor/mermaid-ascii/ascii/shapes/diamond.ts +27 -0
  213. package/src/vendor/mermaid-ascii/ascii/shapes/hexagon.ts +27 -0
  214. package/src/vendor/mermaid-ascii/ascii/shapes/index.ts +101 -0
  215. package/src/vendor/mermaid-ascii/ascii/shapes/rectangle.ts +175 -0
  216. package/src/vendor/mermaid-ascii/ascii/shapes/rounded.ts +27 -0
  217. package/src/vendor/mermaid-ascii/ascii/shapes/special.ts +296 -0
  218. package/src/vendor/mermaid-ascii/ascii/shapes/stadium.ts +114 -0
  219. package/src/vendor/mermaid-ascii/ascii/shapes/state.ts +192 -0
  220. package/src/vendor/mermaid-ascii/ascii/shapes/types.ts +73 -0
  221. package/src/vendor/mermaid-ascii/ascii/types.ts +273 -0
  222. package/src/vendor/mermaid-ascii/ascii/validate.ts +120 -0
  223. package/src/vendor/mermaid-ascii/ascii/xychart.ts +875 -0
  224. package/src/vendor/mermaid-ascii/class/parser.ts +290 -0
  225. package/src/vendor/mermaid-ascii/class/types.ts +121 -0
  226. package/src/vendor/mermaid-ascii/er/parser.ts +181 -0
  227. package/src/vendor/mermaid-ascii/er/types.ts +91 -0
  228. package/src/vendor/mermaid-ascii/index.ts +14 -0
  229. package/src/vendor/mermaid-ascii/multiline-utils.ts +30 -0
  230. package/src/vendor/mermaid-ascii/parser.ts +645 -0
  231. package/src/vendor/mermaid-ascii/sequence/parser.ts +207 -0
  232. package/src/vendor/mermaid-ascii/sequence/types.ts +146 -0
  233. package/src/vendor/mermaid-ascii/text-metrics.ts +71 -0
  234. package/src/vendor/mermaid-ascii/types.ts +164 -0
  235. package/src/vendor/mermaid-ascii/xychart/colors.ts +140 -0
  236. package/src/vendor/mermaid-ascii/xychart/parser.ts +115 -0
  237. package/src/vendor/mermaid-ascii/xychart/types.ts +150 -0
  238. package/src/version.ts +99 -0
  239. package/src/vterm/buffer.ts +218 -0
  240. package/src/vterm/terminal.ts +773 -0
  241. package/src/vterm.ts +8 -0
  242. package/src/which.ts +234 -0
  243. package/src/worker-host.ts +100 -0
  244. package/src/xml.ts +313 -0
@@ -0,0 +1,67 @@
1
+ export declare function readLines(stream: ReadableStream<Uint8Array>, signal?: AbortSignal): AsyncGenerator<Uint8Array>;
2
+ export declare function readJsonl<T>(stream: ReadableStream<Uint8Array>, signal?: AbortSignal): AsyncGenerator<T>;
3
+ /**
4
+ * Stream parsed JSON objects from SSE `data:` lines.
5
+ *
6
+ * Thin wrapper over {@link readSseEvents}: yields one parsed JSON value per
7
+ * dispatched SSE event, skipping events with empty `data` and stopping at the
8
+ * OpenAI-style `[DONE]` sentinel. If your consumer doesn't care about `event:`
9
+ * names or doesn't need a custom parse step, use this; otherwise call
10
+ * `readSseEvents` directly.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * for await (const obj of readSseJson(response.body!)) {
15
+ * console.log(obj);
16
+ * }
17
+ * ```
18
+ */
19
+ export type SseEventObserver = (event: ServerSentEvent) => void;
20
+ export declare function readSseJson<T>(stream: ReadableStream<Uint8Array>, signal?: AbortSignal, onEvent?: SseEventObserver): AsyncGenerator<T>;
21
+ /**
22
+ * A single Server-Sent Event dispatched on a blank-line boundary.
23
+ *
24
+ * - `event` is the value of the most recent `event:` field, or `null` if none.
25
+ * - `data` is the concatenation (joined by `\n`) of every `data:` field in the
26
+ * event, exactly as required by the SSE spec.
27
+ * - `raw` is the list of decoded non-empty lines that made up the event,
28
+ * preserved for diagnostic context (error reporting, debugging). The
29
+ * dispatching blank line is not included.
30
+ */
31
+ export interface ServerSentEvent {
32
+ event: string | null;
33
+ data: string;
34
+ raw: string[];
35
+ }
36
+ /**
37
+ * Stream raw Server-Sent Events from an HTTP response body.
38
+ *
39
+ * Yields one `ServerSentEvent` per blank-line dispatch. The consumer is
40
+ * responsible for parsing `data` (e.g. JSON, plain text, error envelope).
41
+ * Use `readSseJson` instead when every event is a single `data:` JSON object
42
+ * and you don't need access to the `event:` field.
43
+ *
44
+ * Internally backed by a Buffer-based reader (`ConcatSink`) that batches all
45
+ * complete lines in each source chunk into one UTF-8 decode.
46
+ *
47
+ * @example
48
+ * ```ts
49
+ * for await (const sse of readSseEvents(response.body!)) {
50
+ * if (sse.event === "ping") continue;
51
+ * const obj = JSON.parse(sse.data);
52
+ * }
53
+ * ```
54
+ */
55
+ export declare function readSseEvents(stream: ReadableStream<Uint8Array>, signal?: AbortSignal): AsyncGenerator<ServerSentEvent>;
56
+ /**
57
+ * Parse a complete JSONL string, skipping malformed lines instead of throwing.
58
+ *
59
+ * Uses `Bun.JSONL.parseChunk` internally. On parse errors, the malformed
60
+ * region is skipped up to the next newline and parsing continues.
61
+ *
62
+ * @example
63
+ * ```ts
64
+ * const entries = parseJsonlLenient<MyType>(fileContents);
65
+ * ```
66
+ */
67
+ export declare function parseJsonlLenient<T>(buffer: string): T[];
@@ -0,0 +1,24 @@
1
+ export declare const MIN_TAB_WIDTH = 1;
2
+ export declare const MAX_TAB_WIDTH = 16;
3
+ export declare const DEFAULT_TAB_WIDTH = 3;
4
+ /**
5
+ * `.editorconfig`-derived formatting options for an LSP `textDocument/formatting` request.
6
+ *
7
+ * Both fields are absent when the resolved `.editorconfig` chain does not pin them, so callers
8
+ * can layer their own fallbacks (content sniffing, project defaults) underneath. Returned values
9
+ * are clamped to {@link MIN_TAB_WIDTH}..{@link MAX_TAB_WIDTH}.
10
+ */
11
+ export interface EditorConfigFormatting {
12
+ /** Effective indent width in columns, from `indent_size` or `tab_width`. */
13
+ tabSize?: number;
14
+ /** `true` for `indent_style = space`, `false` for `indent_style = tab` (or `indent_size = tab`). */
15
+ insertSpaces?: boolean;
16
+ }
17
+ /**
18
+ * Resolve `.editorconfig` formatting hints for `file` without falling back to any default.
19
+ *
20
+ * Used by the LSP format-on-write path so a missing `.editorconfig` declaration falls through
21
+ * to caller-provided defaults instead of clobbering the file with the renderer's
22
+ * display tab width (issue #2329).
23
+ */
24
+ export declare function getEditorConfigFormatting(file?: string | null, projectDir?: string | null): EditorConfigFormatting;
@@ -0,0 +1,17 @@
1
+ export declare class TempDir {
2
+ #private;
3
+ private constructor();
4
+ static createSync(prefix?: string): TempDir;
5
+ static create(prefix?: string): Promise<TempDir>;
6
+ path(): string;
7
+ absolute(): string;
8
+ remove(): Promise<void>;
9
+ removeSync(): void;
10
+ toString(): string;
11
+ join(...paths: string[]): string;
12
+ [Symbol.asyncDispose](): Promise<void>;
13
+ [Symbol.dispose](): void;
14
+ }
15
+ /** Removes a path recursively, retrying transient Windows deletion failures. */
16
+ export declare function removeWithRetries(target: string): Promise<void>;
17
+ export declare function removeSyncWithRetries(target: string): void;
@@ -0,0 +1,62 @@
1
+ /** Behavior-compatible reimplementation of handlebars' used surface. */
2
+ /** Values accepted as registered partial templates. */
3
+ export type Template = string | TemplateDelegate;
4
+ /** A compiled template function. */
5
+ export type TemplateDelegate<T = unknown> = (context?: T, options?: RuntimeOptions) => string;
6
+ /** Runtime options accepted by compiled templates. */
7
+ export interface RuntimeOptions {
8
+ data?: Record<string, unknown>;
9
+ helpers?: Record<string, HelperDelegate>;
10
+ partials?: Record<string, Template>;
11
+ }
12
+ /** Options passed as the final argument to helpers. */
13
+ export interface HelperOptions {
14
+ name: string;
15
+ hash: Record<string, unknown>;
16
+ data: Record<string, unknown>;
17
+ fn: (context?: unknown, options?: {
18
+ data?: Record<string, unknown>;
19
+ }) => string;
20
+ inverse: (context?: unknown, options?: {
21
+ data?: Record<string, unknown>;
22
+ }) => string;
23
+ lookupProperty: (parent: unknown, propertyName: string) => unknown;
24
+ }
25
+ /** A template helper function. */
26
+ export type HelperDelegate = {
27
+ bivarianceHack(this: unknown, ...args: unknown[]): unknown;
28
+ }["bivarianceHack"];
29
+ /** Template compilation behavior. */
30
+ export interface CompileOptions {
31
+ noEscape?: boolean;
32
+ strict?: boolean;
33
+ }
34
+ /** A string that bypasses HTML escaping when interpolated. */
35
+ export declare class SafeString {
36
+ #private;
37
+ constructor(value: unknown);
38
+ /** Return the unescaped string value. */
39
+ toString(): string;
40
+ /** Return the unescaped primitive value. */
41
+ toHTML(): string;
42
+ }
43
+ /** Escape a value with Handlebars' HTML entity set. */
44
+ export declare function escapeExpression(value: unknown): string;
45
+ /** Register a helper for subsequently compiled templates. */
46
+ export declare function registerHelper(name: string, helper: HelperDelegate): void;
47
+ /** Register a partial for subsequently rendered templates. */
48
+ export declare function registerPartial(name: string, partial: Template): void;
49
+ /** Compile a template into a reusable rendering function. */
50
+ export declare function compile<T = unknown>(source: string, options?: CompileOptions): TemplateDelegate<T>;
51
+ /** Create an isolated template engine with its own helper and partial registries. */
52
+ export declare function create(): TemplateEngine;
53
+ /** Isolated template compiler and registry. */
54
+ export declare class TemplateEngine {
55
+ #private;
56
+ /** Register a helper in this engine. */
57
+ registerHelper(name: string, helper: HelperDelegate): void;
58
+ /** Register a partial in this engine. */
59
+ registerPartial(name: string, partial: Template): void;
60
+ /** Compile a template using this engine's registries. */
61
+ compile<T = unknown>(source: string, options?: CompileOptions): TemplateDelegate<T>;
62
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Shared contract between the {@link module-timer} preload and {@link logger}'s
3
+ * timing tree. Kept in its own dependency-free module so the preload can import
4
+ * it without pulling in winston (via logger) and the logger can drain the buffer
5
+ * without importing the Bun-plugin preload.
6
+ */
7
+ export interface ModuleLoadEvent {
8
+ /** Absolute or Bun-resolved module path. */
9
+ path: string;
10
+ /** `performance.now()` timestamp captured at Bun `onLoad` entry. */
11
+ start: number;
12
+ /** Inclusive module window: `onLoad` entry → appended final marker. */
13
+ durationMs: number;
14
+ /** Own top-level body / TLA time: prepended body marker → appended final marker. */
15
+ bodyMs?: number;
16
+ /** Resolved static children imported by this module. */
17
+ imports: string[];
18
+ }
19
+ /** The append-only buffer the preload pushes into (created on first access). */
20
+ export declare function moduleLoadBuffer(): ModuleLoadEvent[];
21
+ /** Drain and return all buffered events, leaving the buffer empty. */
22
+ export declare function drainModuleLoadEvents(): ModuleLoadEvent[];
@@ -0,0 +1,37 @@
1
+ /**
2
+ * `fetch`-compatible function. Accepts any callable matching the standard
3
+ * fetch signature; `preconnect` is optional because non-Bun runtimes
4
+ * (browsers, test mocks) won't expose it.
5
+ */
6
+ export type FetchImpl = ((input: string | URL | Request, init?: RequestInit) => Promise<Response>) & {
7
+ preconnect?: typeof globalThis.fetch.preconnect;
8
+ };
9
+ /**
10
+ * `NODE_EXTRA_CA_CERTS` was set but unusable (path does not exist). This is
11
+ * a config/contract error, not a transient transport fault — it is never
12
+ * retried.
13
+ */
14
+ export declare class ExtraCaError extends Error {
15
+ constructor(message: string, options?: {
16
+ cause?: unknown;
17
+ });
18
+ }
19
+ /** Test seam: drop the cached PEM so a follow-up call re-reads the env. */
20
+ export declare function __resetExtraCaCache(): void;
21
+ /**
22
+ * Wrap `fetchImpl` so every call honours `NODE_EXTRA_CA_CERTS`. Idempotent:
23
+ * a fetch already wrapped is returned unchanged so repeated composition
24
+ * (Anthropic auth-retry replays, request-debug fan-out) never stacks
25
+ * wrappers. When the env var is unset the original fetch is returned, so
26
+ * default deployments pay nothing.
27
+ */
28
+ export declare function wrapFetchForExtraCa(fetchImpl: FetchImpl): FetchImpl;
29
+ /**
30
+ * Convenience for options-bag composition (e.g. the stream-entry path in
31
+ * `@linxiraos/pi-ai`'s `stream.ts`, which mirrors `withRequestDebugFetch` so
32
+ * the proxy/debug/extra-CA wrappers compose uniformly). No-op when the env
33
+ * var is unset.
34
+ */
35
+ export declare function withExtraCaFetch<T extends {
36
+ fetch?: FetchImpl;
37
+ } | undefined>(options: T): T;
@@ -0,0 +1,11 @@
1
+ import type { TurndownPlugin } from "./types.js";
2
+ /** Install GitHub fenced code blocks selected by `highlight-source-*` wrappers. */
3
+ export declare const highlightedCodeBlock: TurndownPlugin;
4
+ /** Install GFM strikethrough conversion. */
5
+ export declare const strikethrough: TurndownPlugin;
6
+ /** Install GFM task-list checkbox conversion. */
7
+ export declare const taskListItems: TurndownPlugin;
8
+ /** Install GFM table conversion for tables with a heading row. */
9
+ export declare const tables: TurndownPlugin;
10
+ /** Install every GFM rule used by the coding agent. */
11
+ export declare const gfm: TurndownPlugin;
@@ -0,0 +1,5 @@
1
+ import type { TurndownNode } from "./types.js";
2
+ /** Parse an HTML fragment into the small DOM subset needed by Turndown. */
3
+ export declare function parseHtmlFragment(html: string): TurndownNode;
4
+ /** Serialize a standards-shaped or internal HTML node. */
5
+ export declare function serializeNode(node: TurndownNode): string;
@@ -0,0 +1,21 @@
1
+ import type { ResolvedTurndownOptions, RuleFilter, TurndownNode, TurndownOptions, TurndownPlugin, TurndownRule } from "./types.js";
2
+ /** Convert HTML fragments to Markdown with extensible Turndown-compatible rules. */
3
+ export default class TurndownService {
4
+ #private;
5
+ readonly options: ResolvedTurndownOptions;
6
+ constructor(options?: TurndownOptions);
7
+ /** Install a highest-priority named conversion rule. */
8
+ addRule(key: string, rule: TurndownRule): this;
9
+ /** Preserve matching elements as HTML when no custom rule handles them. */
10
+ keep(filter: RuleFilter): this;
11
+ /** Drop matching elements and all of their converted content. */
12
+ remove(filter: RuleFilter): this;
13
+ /** Install one plugin or an ordered list of plugins. */
14
+ use(plugin: TurndownPlugin | readonly TurndownPlugin[]): this;
15
+ /** Escape Markdown punctuation using Turndown's public escaping rules. */
16
+ escape(text: string): string;
17
+ /** Convert an HTML string or standards-shaped DOM node to Markdown. */
18
+ turndown(input: string | TurndownNode): string;
19
+ /** Convert only a node's children within the active conversion. */
20
+ convertChildren(node: TurndownNode): string;
21
+ }
@@ -0,0 +1,70 @@
1
+ /** Behavior-compatible reimplementation of turndown's used surface. */
2
+ /** A DOM-shaped node accepted by conversion rules. */
3
+ export interface TurndownNode {
4
+ readonly nodeType: number;
5
+ readonly nodeName: string;
6
+ readonly parentNode: TurndownNode | null;
7
+ readonly childNodes: ArrayLike<TurndownNode>;
8
+ readonly children: ArrayLike<TurndownNode>;
9
+ readonly firstChild: TurndownNode | null;
10
+ readonly lastChild: TurndownNode | null;
11
+ readonly nextSibling: TurndownNode | null;
12
+ readonly previousSibling: TurndownNode | null;
13
+ readonly textContent: string | null;
14
+ readonly outerHTML?: string;
15
+ getAttribute(name: string): string | null;
16
+ hasAttribute(name: string): boolean;
17
+ }
18
+ /** Options supported by the HTML-to-Markdown converter. */
19
+ export interface TurndownOptions {
20
+ headingStyle?: "setext" | "atx";
21
+ hr?: string;
22
+ bulletListMarker?: "*" | "-" | "+";
23
+ codeBlockStyle?: "indented" | "fenced";
24
+ fence?: string;
25
+ emDelimiter?: "_" | "*";
26
+ strongDelimiter?: "**" | "__";
27
+ linkStyle?: "inlined" | "referenced";
28
+ linkReferenceStyle?: "full" | "collapsed" | "shortcut";
29
+ preformattedCode?: boolean;
30
+ blankReplacement?: ReplacementFunction;
31
+ keepReplacement?: ReplacementFunction;
32
+ defaultReplacement?: ReplacementFunction;
33
+ }
34
+ /** Fully resolved options passed to replacement callbacks. */
35
+ export interface ResolvedTurndownOptions {
36
+ headingStyle: "setext" | "atx";
37
+ hr: string;
38
+ bulletListMarker: "*" | "-" | "+";
39
+ codeBlockStyle: "indented" | "fenced";
40
+ fence: string;
41
+ emDelimiter: "_" | "*";
42
+ strongDelimiter: "**" | "__";
43
+ linkStyle: "inlined" | "referenced";
44
+ linkReferenceStyle: "full" | "collapsed" | "shortcut";
45
+ preformattedCode: boolean;
46
+ blankReplacement?: ReplacementFunction;
47
+ keepReplacement?: ReplacementFunction;
48
+ defaultReplacement?: ReplacementFunction;
49
+ }
50
+ /** A tag name, list of tag names, or predicate selecting nodes for a rule. */
51
+ export type RuleFilter = string | readonly string[] | ((node: TurndownNode, options: ResolvedTurndownOptions) => boolean);
52
+ /** Produces Markdown for a matched node and its already-converted children. */
53
+ export type ReplacementFunction = (content: string, node: TurndownNode, options: ResolvedTurndownOptions) => string;
54
+ /** A named conversion rule accepted by `addRule`. */
55
+ export interface TurndownRule {
56
+ filter: RuleFilter;
57
+ replacement: ReplacementFunction;
58
+ }
59
+ /** A plugin that installs one or more conversion rules. */
60
+ export type TurndownPlugin = (service: TurndownServiceLike) => void;
61
+ /** Structural service surface available to plugins. */
62
+ export interface TurndownServiceLike {
63
+ readonly options: ResolvedTurndownOptions;
64
+ addRule(key: string, rule: TurndownRule): this;
65
+ convertChildren(node: TurndownNode): string;
66
+ keep(filter: RuleFilter): this;
67
+ remove(filter: RuleFilter): this;
68
+ turndown(input: string | TurndownNode): string;
69
+ escape(text: string): string;
70
+ }
@@ -0,0 +1,4 @@
1
+ /** Behavior-compatible reimplementation of turndown's used surface. */
2
+ export * from "./turndown/gfm.js";
3
+ export { default, default as TurndownService } from "./turndown/service.js";
4
+ export * from "./turndown/types.js";
@@ -0,0 +1,5 @@
1
+ export declare function isRecord(value: unknown): value is Record<string, unknown>;
2
+ /** Reads an own string-valued property without invoking accessors. */
3
+ export declare function stringProperty(value: object, key: string): string | undefined;
4
+ export declare function asRecord(value: unknown): Record<string, unknown> | null;
5
+ export declare function toError(value: unknown): Error;
@@ -0,0 +1,41 @@
1
+ import type { CharRole, AsciiTheme, ColorMode } from './types.js';
2
+ /**
3
+ * Default ASCII theme derived from the SVG renderer's color palette.
4
+ * Uses the same mixing ratios to maintain visual consistency.
5
+ */
6
+ export declare const DEFAULT_ASCII_THEME: AsciiTheme;
7
+ /**
8
+ * Detect the best color mode for the current environment.
9
+ *
10
+ * Terminal detection order:
11
+ * 1. COLORTERM=truecolor or COLORTERM=24bit → truecolor
12
+ * 2. TERM contains "256color" → ansi256
13
+ * 3. TERM is set and not "dumb" → ansi16
14
+ *
15
+ * Browser: returns 'html' (uses <span> tags with inline styles).
16
+ * Unknown/piped: returns 'none'.
17
+ */
18
+ export declare function detectColorMode(): ColorMode;
19
+ /**
20
+ * Generate the ANSI escape sequence for a role color.
21
+ */
22
+ export declare function getAnsiColor(role: CharRole, theme: AsciiTheme, mode: ColorMode): string;
23
+ /**
24
+ * Get the ANSI reset sequence.
25
+ */
26
+ export declare function getAnsiReset(mode: ColorMode): string;
27
+ /**
28
+ * Wrap a character with ANSI color codes based on its role.
29
+ */
30
+ export declare function colorizeChar(char: string, role: CharRole | null, theme: AsciiTheme, mode: ColorMode): string;
31
+ /**
32
+ * Colorize an entire line efficiently by grouping consecutive same-role characters.
33
+ * This reduces the number of escape sequences (ANSI) or span tags (HTML) in the output.
34
+ */
35
+ export declare function colorizeLine(chars: string[], roles: (CharRole | null)[], theme: AsciiTheme, mode: ColorMode): string;
36
+ /**
37
+ * Colorize a text string with a direct hex color.
38
+ * Used by renderers that need per-cell color control (e.g. multi-series xychart).
39
+ * Handles all output modes: ANSI (16/256/truecolor) and HTML.
40
+ */
41
+ export declare function colorizeText(text: string, hex: string, mode: ColorMode): string;
@@ -0,0 +1,89 @@
1
+ import type { Canvas, DrawingCoord, RoleCanvas, CharRole, AsciiTheme, ColorMode } from './types.js';
2
+ /**
3
+ * Create a blank canvas filled with spaces.
4
+ * Dimensions are inclusive: mkCanvas(3, 2) creates a 4x3 grid (indices 0..3, 0..2).
5
+ */
6
+ export declare function mkCanvas(x: number, y: number): Canvas;
7
+ /** Create a blank canvas with the same dimensions as the given canvas. */
8
+ export declare function copyCanvas(source: Canvas): Canvas;
9
+ /**
10
+ * Create a blank role canvas filled with nulls.
11
+ * Same dimensions as mkCanvas — column-major, roleCanvas[x][y].
12
+ */
13
+ export declare function mkRoleCanvas(x: number, y: number): RoleCanvas;
14
+ /** Create a blank role canvas with the same dimensions as the given role canvas. */
15
+ export declare function copyRoleCanvas(source: RoleCanvas): RoleCanvas;
16
+ /**
17
+ * Grow the role canvas to fit at least (newX, newY), preserving existing roles.
18
+ * Mutates the role canvas in place and returns it.
19
+ */
20
+ export declare function increaseRoleCanvasSize(roleCanvas: RoleCanvas, newX: number, newY: number): RoleCanvas;
21
+ /**
22
+ * Set a role at a specific coordinate.
23
+ * Expands the role canvas if necessary.
24
+ */
25
+ export declare function setRole(roleCanvas: RoleCanvas, x: number, y: number, role: CharRole): void;
26
+ /**
27
+ * Merge role canvases — same logic as mergeCanvases but for roles.
28
+ * Non-null roles in overlays overwrite null roles in base.
29
+ */
30
+ export declare function mergeRoleCanvases(base: RoleCanvas, offset: DrawingCoord, ...overlays: RoleCanvas[]): RoleCanvas;
31
+ /** Returns [maxX, maxY] — the highest valid indices in each dimension. */
32
+ export declare function getCanvasSize(canvas: Canvas): [number, number];
33
+ /**
34
+ * Grow the canvas to fit at least (newX, newY), preserving existing content.
35
+ * Mutates the canvas in place and returns it.
36
+ */
37
+ export declare function increaseSize(canvas: Canvas, newX: number, newY: number): Canvas;
38
+ export declare function isJunctionChar(c: string): boolean;
39
+ export declare function mergeJunctions(c1: string, c2: string): string;
40
+ /**
41
+ * Merge overlay canvases onto a base canvas at the given offset.
42
+ * Non-space characters in overlays overwrite the base.
43
+ * When both characters are Unicode junction chars, they're merged intelligently.
44
+ */
45
+ export declare function mergeCanvases(base: Canvas, offset: DrawingCoord, useAscii: boolean, ...overlays: Canvas[]): Canvas;
46
+ /** Options for converting canvas to string with optional coloring. */
47
+ export interface CanvasToStringOptions {
48
+ /** Role canvas for applying colors. If not provided, output is plain text. */
49
+ roleCanvas?: RoleCanvas;
50
+ /** Color mode for terminal output. Default: 'none' */
51
+ colorMode?: ColorMode;
52
+ /** Theme colors for ASCII output. Uses default theme if not provided. */
53
+ theme?: AsciiTheme;
54
+ }
55
+ /**
56
+ * Convert the canvas to a multi-line string (row by row, left to right).
57
+ * Optionally applies ANSI color codes based on character roles.
58
+ */
59
+ export declare function canvasToString(canvas: Canvas, options?: CanvasToStringOptions): string;
60
+ /**
61
+ * Flip the canvas vertically (mirror across the horizontal center).
62
+ * Reverses row order within each column and remaps directional characters
63
+ * (arrows, corners, junctions) so they point the correct way after flip.
64
+ *
65
+ * Used to transform a TD-rendered canvas into BT output.
66
+ * Mutates the canvas in place and returns it.
67
+ */
68
+ export declare function flipCanvasVertically(canvas: Canvas): Canvas;
69
+ /**
70
+ * Flip the role canvas vertically to match flipCanvasVertically.
71
+ * Mutates the role canvas in place and returns it.
72
+ */
73
+ export declare function flipRoleCanvasVertically(roleCanvas: RoleCanvas): RoleCanvas;
74
+ /**
75
+ * Draw text string onto the canvas starting at the given coordinate.
76
+ * By default, preserves existing non-space characters (labels don't overwrite each other).
77
+ * Set forceOverwrite=true to always overwrite (for box content).
78
+ */
79
+ export declare function drawText(canvas: Canvas, start: DrawingCoord, text: string, forceOverwrite?: boolean): void;
80
+ /**
81
+ * Set the canvas size to fit all grid columns and rows.
82
+ * Called after layout to ensure the canvas covers the full drawing area.
83
+ */
84
+ export declare function setCanvasSizeToGrid(canvas: Canvas, columnWidth: Map<number, number>, rowHeight: Map<number, number>): void;
85
+ /**
86
+ * Set the role canvas size to match the grid dimensions.
87
+ * Should be called alongside setCanvasSizeToGrid.
88
+ */
89
+ export declare function setRoleCanvasSizeToGrid(roleCanvas: RoleCanvas, columnWidth: Map<number, number>, rowHeight: Map<number, number>): void;
@@ -0,0 +1,7 @@
1
+ import type { AsciiConfig, AsciiTheme, ColorMode } from './types.js';
2
+ /**
3
+ * Render a Mermaid class diagram to ASCII/Unicode text.
4
+ *
5
+ * Pipeline: parse → build boxes → level-based layout → draw boxes → draw relationships → string.
6
+ */
7
+ export declare function renderClassAscii(text: string, config: AsciiConfig, colorMode?: ColorMode, theme?: AsciiTheme): string;
@@ -0,0 +1,12 @@
1
+ import type { MermaidGraph } from '../types.js';
2
+ import type { AsciiGraph, AsciiConfig } from './types.js';
3
+ /**
4
+ * Convert a parsed MermaidGraph into an AsciiGraph ready for grid layout.
5
+ *
6
+ * Key mappings:
7
+ * - MermaidGraph.nodes (Map) → ordered AsciiNode[] preserving insertion order
8
+ * - MermaidGraph.edges → AsciiEdge[] with resolved node references
9
+ * - MermaidGraph.subgraphs → AsciiSubgraph[] with parent/child tree
10
+ * - Node labels are used as display names (not raw IDs)
11
+ */
12
+ export declare function convertToAsciiGraph(parsed: MermaidGraph, config: AsciiConfig): AsciiGraph;
@@ -0,0 +1,66 @@
1
+ import type { Canvas, DrawingCoord, AsciiGraph, AsciiNode, AsciiEdge, AsciiSubgraph, AsciiEdgeStyle } from './types.js';
2
+ /**
3
+ * Draw a node using its shape type.
4
+ * Returns a standalone canvas containing the rendered shape.
5
+ *
6
+ * For basic shapes (rectangle, rounded), uses grid-determined dimensions
7
+ * to ensure consistent sizing across nodes in the same column.
8
+ * For special shapes (diamond, circle, state pseudo-states, etc.),
9
+ * uses shape-specific dimension calculation but centers the content
10
+ * within the grid cell dimensions to ensure proper vertical alignment.
11
+ */
12
+ export declare function drawNode(node: AsciiNode, graph: AsciiGraph): Canvas;
13
+ /**
14
+ * Draw a node box with centered label text.
15
+ * Returns a standalone canvas containing just the box.
16
+ * Box size is determined by the grid column/row sizes for the node's position.
17
+ */
18
+ export declare function drawBox(node: AsciiNode, graph: AsciiGraph): Canvas;
19
+ /**
20
+ * Draw a multi-section box with horizontal dividers between sections.
21
+ * Used by class diagrams (header | attributes | methods) and ER diagrams (header | attributes).
22
+ * Each section is an array of text lines to render left-aligned with padding.
23
+ *
24
+ * @param sections - Array of sections, each section is an array of text lines
25
+ * @param useAscii - true for ASCII chars, false for Unicode box-drawing
26
+ * @param padding - horizontal padding inside the box (default 1)
27
+ * @returns A standalone Canvas containing the multi-section box
28
+ */
29
+ export declare function drawMultiBox(sections: string[][], useAscii: boolean, padding?: number): Canvas;
30
+ /**
31
+ * Draw a line between two drawing coordinates using orthogonal Manhattan routing.
32
+ * Returns the list of coordinates that were drawn on.
33
+ * offsetFrom/offsetTo control how many cells to skip at the start/end.
34
+ *
35
+ * All lines use 90° bends only - no diagonal lines are produced.
36
+ * For diagonal directions, uses horizontal-first routing (draws horizontal
37
+ * segment, then vertical segment).
38
+ */
39
+ export declare function drawLine(canvas: Canvas, from: DrawingCoord, to: DrawingCoord, offsetFrom: number, offsetTo: number, useAscii: boolean, style?: AsciiEdgeStyle): DrawingCoord[];
40
+ /**
41
+ * Draw a complete arrow (edge) between two nodes.
42
+ * Returns 6 separate canvases for layered compositing:
43
+ * [path, boxStart, arrowHeadEnd, arrowHeadStart, corners, label]
44
+ *
45
+ * Supports bidirectional arrows via edge.hasArrowStart and edge.hasArrowEnd.
46
+ */
47
+ export declare function drawArrow(graph: AsciiGraph, edge: AsciiEdge): [Canvas, Canvas, Canvas, Canvas, Canvas, Canvas];
48
+ /** Draw a subgraph border rectangle. */
49
+ export declare function drawSubgraphBox(sg: AsciiSubgraph, graph: AsciiGraph): Canvas;
50
+ /** Draw a subgraph label centered in its header area. Supports multi-line labels. */
51
+ export declare function drawSubgraphLabel(sg: AsciiSubgraph, graph: AsciiGraph): [Canvas, DrawingCoord];
52
+ /**
53
+ * Main draw function — renders the entire graph onto the canvas.
54
+ * Drawing order matters for correct layering:
55
+ * 1. Subgraph borders (bottom layer)
56
+ * 2. Node boxes
57
+ * 3. Edge paths (lines)
58
+ * 4. Edge corners
59
+ * 5. Arrowheads
60
+ * 6. Box-start junctions
61
+ * 7. Edge labels
62
+ * 8. Subgraph labels (top layer)
63
+ *
64
+ * Also fills the roleCanvas with character roles for colored output.
65
+ */
66
+ export declare function drawGraph(graph: AsciiGraph): Canvas;
@@ -0,0 +1,48 @@
1
+ import type { AsciiGraph, EdgeBundle, GridCoord } from './types.js';
2
+ /**
3
+ * Analyze graph edges and create bundles for parallel links.
4
+ *
5
+ * Groups edges by:
6
+ * - Fan-in: Multiple edges sharing the same target (A & B --> C)
7
+ * - Fan-out: Multiple edges sharing the same source (A --> B & C)
8
+ *
9
+ * Only creates bundles when:
10
+ * - Graph direction is TD (top-down) - LR routing handles merging naturally
11
+ * - 2+ edges share the endpoint
12
+ * - All edges have the same style (solid/dotted/thick)
13
+ * - None of the edges have labels (labels would overlap at junction)
14
+ * - Edges are not self-loops
15
+ *
16
+ * @returns Array of bundles. Each edge can belong to at most one bundle.
17
+ */
18
+ export declare function analyzeEdgeBundles(graph: AsciiGraph): EdgeBundle[];
19
+ /**
20
+ * Calculate the optimal junction point for a bundle.
21
+ *
22
+ * For fan-in (A & B --> C):
23
+ * - Junction is placed between the sources and the target
24
+ * - In TD: above the target, horizontally centered between sources
25
+ * - In LR: left of the target, vertically centered between sources
26
+ *
27
+ * For fan-out (A --> B & C):
28
+ * - Junction is placed between the source and the targets
29
+ * - In TD: below the source, horizontally centered between targets
30
+ * - In LR: right of the source, vertically centered between targets
31
+ */
32
+ export declare function calculateJunctionPoint(graph: AsciiGraph, bundle: EdgeBundle): GridCoord;
33
+ /**
34
+ * Route all edges in a bundle through the junction point.
35
+ *
36
+ * For fan-in bundles:
37
+ * 1. Route each source → junction (stored in edge.pathToJunction)
38
+ * 2. Route junction → target (stored in bundle.sharedPath)
39
+ *
40
+ * For fan-out bundles:
41
+ * 1. Route source → junction (stored in bundle.sharedPath)
42
+ * 2. Route junction → each target (stored in edge.pathToJunction)
43
+ */
44
+ export declare function routeBundledEdges(graph: AsciiGraph, bundle: EdgeBundle): void;
45
+ /**
46
+ * Process all bundles in a graph: calculate junction points and route edges.
47
+ */
48
+ export declare function processBundles(graph: AsciiGraph): void;