@linxiraos/pi-utils 1.1.8 → 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 (170) hide show
  1. package/CHANGELOG.md +2 -3
  2. package/README.md +18 -18
  3. package/package.json +57 -63
  4. package/src/async.ts +16 -0
  5. package/src/dirs.ts +15 -10
  6. package/src/incoming-json.ts +856 -0
  7. package/src/index.ts +1 -0
  8. package/src/json-lexer.ts +413 -0
  9. package/src/json-parse.ts +93 -350
  10. package/src/tls-fetch.ts +2 -16
  11. package/THIRD-PARTY-NOTICES.txt +0 -22909
  12. package/dist/types/abortable.d.ts +0 -32
  13. package/dist/types/acp/connection.d.ts +0 -118
  14. package/dist/types/acp/protocol.d.ts +0 -526
  15. package/dist/types/acp/schema.d.ts +0 -41
  16. package/dist/types/acp/stream.d.ts +0 -8
  17. package/dist/types/acp/transport.d.ts +0 -88
  18. package/dist/types/acp.d.ts +0 -6
  19. package/dist/types/ar/arj.d.ts +0 -5
  20. package/dist/types/ar/asar.d.ts +0 -7
  21. package/dist/types/ar/bytes.d.ts +0 -20
  22. package/dist/types/ar/cab.d.ts +0 -5
  23. package/dist/types/ar/checksums.d.ts +0 -10
  24. package/dist/types/ar/codecs/bzip2.d.ts +0 -4
  25. package/dist/types/ar/codecs/gzip.d.ts +0 -6
  26. package/dist/types/ar/codecs/lzma.d.ts +0 -6
  27. package/dist/types/ar/codecs/lzw.d.ts +0 -4
  28. package/dist/types/ar/codecs/lzx.d.ts +0 -7
  29. package/dist/types/ar/codecs/xz.d.ts +0 -4
  30. package/dist/types/ar/codecs/zstd.d.ts +0 -6
  31. package/dist/types/ar/cpio.d.ts +0 -7
  32. package/dist/types/ar/deb.d.ts +0 -5
  33. package/dist/types/ar/entries.d.ts +0 -22
  34. package/dist/types/ar/error.d.ts +0 -8
  35. package/dist/types/ar/index.d.ts +0 -11
  36. package/dist/types/ar/iso.d.ts +0 -5
  37. package/dist/types/ar/limits.d.ts +0 -33
  38. package/dist/types/ar/lzh.d.ts +0 -7
  39. package/dist/types/ar/open.d.ts +0 -45
  40. package/dist/types/ar/paths.d.ts +0 -18
  41. package/dist/types/ar/rar/rar4-decoder.d.ts +0 -6
  42. package/dist/types/ar/rar/rar5-decoder.d.ts +0 -6
  43. package/dist/types/ar/rar.d.ts +0 -5
  44. package/dist/types/ar/reader.d.ts +0 -28
  45. package/dist/types/ar/registry.d.ts +0 -17
  46. package/dist/types/ar/rpm.d.ts +0 -5
  47. package/dist/types/ar/sevenzip/decode.d.ts +0 -33
  48. package/dist/types/ar/sevenzip.d.ts +0 -5
  49. package/dist/types/ar/source.d.ts +0 -54
  50. package/dist/types/ar/tar.d.ts +0 -9
  51. package/dist/types/ar/types.d.ts +0 -99
  52. package/dist/types/ar/unix-ar.d.ts +0 -7
  53. package/dist/types/ar/write.d.ts +0 -10
  54. package/dist/types/ar/zip.d.ts +0 -10
  55. package/dist/types/async.d.ts +0 -22
  56. package/dist/types/binary.d.ts +0 -23
  57. package/dist/types/browsers.d.ts +0 -68
  58. package/dist/types/chalk.d.ts +0 -125
  59. package/dist/types/cli.d.ts +0 -134
  60. package/dist/types/color.d.ts +0 -136
  61. package/dist/types/dates.d.ts +0 -7
  62. package/dist/types/dirs.d.ts +0 -325
  63. package/dist/types/docx/converter.d.ts +0 -46
  64. package/dist/types/docx/xml.d.ts +0 -26
  65. package/dist/types/docx.d.ts +0 -11
  66. package/dist/types/dom/core.d.ts +0 -431
  67. package/dist/types/dom/parser.d.ts +0 -7
  68. package/dist/types/dom/selector.d.ts +0 -5
  69. package/dist/types/dom.d.ts +0 -5
  70. package/dist/types/env.d.ts +0 -133
  71. package/dist/types/fetch-retry.d.ts +0 -98
  72. package/dist/types/file-lock.d.ts +0 -23
  73. package/dist/types/format.d.ts +0 -37
  74. package/dist/types/frontmatter.d.ts +0 -46
  75. package/dist/types/fs-error.d.ts +0 -31
  76. package/dist/types/glob.d.ts +0 -28
  77. package/dist/types/headers.d.ts +0 -34
  78. package/dist/types/index.d.ts +0 -42
  79. package/dist/types/json-parse.d.ts +0 -83
  80. package/dist/types/json.d.ts +0 -20
  81. package/dist/types/logger/rotating-file.d.ts +0 -18
  82. package/dist/types/logger.d.ts +0 -96
  83. package/dist/types/loop-phase.d.ts +0 -10
  84. package/dist/types/lru.d.ts +0 -46
  85. package/dist/types/marked/core.d.ts +0 -445
  86. package/dist/types/marked.d.ts +0 -2
  87. package/dist/types/materialize-string.d.ts +0 -7
  88. package/dist/types/math-delimiters.d.ts +0 -45
  89. package/dist/types/mermaid-ascii.d.ts +0 -11
  90. package/dist/types/mime.d.ts +0 -29
  91. package/dist/types/module-timer.d.ts +0 -1
  92. package/dist/types/path-tree.d.ts +0 -76
  93. package/dist/types/path.d.ts +0 -4
  94. package/dist/types/peek-file.d.ts +0 -29
  95. package/dist/types/postmortem.d.ts +0 -178
  96. package/dist/types/process-name.d.ts +0 -7
  97. package/dist/types/procmgr.d.ts +0 -74
  98. package/dist/types/prompt.d.ts +0 -18
  99. package/dist/types/ptree.d.ts +0 -124
  100. package/dist/types/readability/readability.d.ts +0 -9
  101. package/dist/types/readability/readerable.d.ts +0 -10
  102. package/dist/types/readability/types.d.ts +0 -70
  103. package/dist/types/readability.d.ts +0 -4
  104. package/dist/types/ring.d.ts +0 -93
  105. package/dist/types/runtime-install.d.ts +0 -85
  106. package/dist/types/sanitize-text.d.ts +0 -29
  107. package/dist/types/snowflake.d.ts +0 -25
  108. package/dist/types/sqlite.d.ts +0 -26
  109. package/dist/types/stderr-guard.d.ts +0 -22
  110. package/dist/types/stream.d.ts +0 -75
  111. package/dist/types/tab-spacing.d.ts +0 -24
  112. package/dist/types/temp.d.ts +0 -24
  113. package/dist/types/template.d.ts +0 -62
  114. package/dist/types/timing-buffer.d.ts +0 -22
  115. package/dist/types/tls-fetch.d.ts +0 -37
  116. package/dist/types/turndown/gfm.d.ts +0 -11
  117. package/dist/types/turndown/html.d.ts +0 -5
  118. package/dist/types/turndown/service.d.ts +0 -21
  119. package/dist/types/turndown/types.d.ts +0 -70
  120. package/dist/types/turndown.d.ts +0 -4
  121. package/dist/types/type-guards.d.ts +0 -5
  122. package/dist/types/vendor/mermaid-ascii/ascii/ansi.d.ts +0 -41
  123. package/dist/types/vendor/mermaid-ascii/ascii/canvas.d.ts +0 -89
  124. package/dist/types/vendor/mermaid-ascii/ascii/class-diagram.d.ts +0 -7
  125. package/dist/types/vendor/mermaid-ascii/ascii/converter.d.ts +0 -12
  126. package/dist/types/vendor/mermaid-ascii/ascii/draw.d.ts +0 -66
  127. package/dist/types/vendor/mermaid-ascii/ascii/edge-bundling.d.ts +0 -48
  128. package/dist/types/vendor/mermaid-ascii/ascii/edge-routing.d.ts +0 -43
  129. package/dist/types/vendor/mermaid-ascii/ascii/er-diagram.d.ts +0 -7
  130. package/dist/types/vendor/mermaid-ascii/ascii/grid.d.ts +0 -56
  131. package/dist/types/vendor/mermaid-ascii/ascii/index.d.ts +0 -65
  132. package/dist/types/vendor/mermaid-ascii/ascii/multiline-utils.d.ts +0 -27
  133. package/dist/types/vendor/mermaid-ascii/ascii/pathfinder.d.ts +0 -17
  134. package/dist/types/vendor/mermaid-ascii/ascii/sequence.d.ts +0 -7
  135. package/dist/types/vendor/mermaid-ascii/ascii/shapes/circle.d.ts +0 -11
  136. package/dist/types/vendor/mermaid-ascii/ascii/shapes/corners.d.ts +0 -34
  137. package/dist/types/vendor/mermaid-ascii/ascii/shapes/diamond.d.ts +0 -11
  138. package/dist/types/vendor/mermaid-ascii/ascii/shapes/hexagon.d.ts +0 -11
  139. package/dist/types/vendor/mermaid-ascii/ascii/shapes/index.d.ts +0 -26
  140. package/dist/types/vendor/mermaid-ascii/ascii/shapes/rectangle.d.ts +0 -31
  141. package/dist/types/vendor/mermaid-ascii/ascii/shapes/rounded.d.ts +0 -11
  142. package/dist/types/vendor/mermaid-ascii/ascii/shapes/special.d.ts +0 -59
  143. package/dist/types/vendor/mermaid-ascii/ascii/shapes/stadium.d.ts +0 -17
  144. package/dist/types/vendor/mermaid-ascii/ascii/shapes/state.d.ts +0 -30
  145. package/dist/types/vendor/mermaid-ascii/ascii/shapes/types.d.ts +0 -55
  146. package/dist/types/vendor/mermaid-ascii/ascii/types.d.ts +0 -206
  147. package/dist/types/vendor/mermaid-ascii/ascii/validate.d.ts +0 -51
  148. package/dist/types/vendor/mermaid-ascii/ascii/xychart.d.ts +0 -2
  149. package/dist/types/vendor/mermaid-ascii/class/parser.d.ts +0 -6
  150. package/dist/types/vendor/mermaid-ascii/class/types.d.ts +0 -102
  151. package/dist/types/vendor/mermaid-ascii/er/parser.d.ts +0 -6
  152. package/dist/types/vendor/mermaid-ascii/er/types.d.ts +0 -76
  153. package/dist/types/vendor/mermaid-ascii/index.d.ts +0 -1
  154. package/dist/types/vendor/mermaid-ascii/multiline-utils.d.ts +0 -9
  155. package/dist/types/vendor/mermaid-ascii/parser.d.ts +0 -7
  156. package/dist/types/vendor/mermaid-ascii/sequence/parser.d.ts +0 -6
  157. package/dist/types/vendor/mermaid-ascii/sequence/types.d.ts +0 -130
  158. package/dist/types/vendor/mermaid-ascii/text-metrics.d.ts +0 -23
  159. package/dist/types/vendor/mermaid-ascii/types.d.ts +0 -114
  160. package/dist/types/vendor/mermaid-ascii/xychart/colors.d.ts +0 -25
  161. package/dist/types/vendor/mermaid-ascii/xychart/parser.d.ts +0 -6
  162. package/dist/types/vendor/mermaid-ascii/xychart/types.d.ts +0 -145
  163. package/dist/types/version.d.ts +0 -18
  164. package/dist/types/vterm/buffer.d.ts +0 -99
  165. package/dist/types/vterm/query-responder.d.ts +0 -24
  166. package/dist/types/vterm/terminal.d.ts +0 -44
  167. package/dist/types/vterm.d.ts +0 -9
  168. package/dist/types/which.d.ts +0 -37
  169. package/dist/types/worker-host.d.ts +0 -51
  170. package/dist/types/xml.d.ts +0 -31
@@ -1,99 +0,0 @@
1
- import type { ArchiveLimits } from "./limits.js";
2
- import type { ByteSource } from "./source.js";
3
- /** Archive container formats readable by the unified archive API. */
4
- export type ArchiveFormat = "zip" | "tar" | "tar.gz" | "tar.bz2" | "tar.xz" | "tar.zst" | "tar.Z" | "asar" | "rar" | "7z" | "iso" | "cab" | "cpio" | "rpm" | "ar" | "deb" | "lzh" | "arj" | "gz" | "bz2" | "xz" | "zst" | "Z" | "lzma";
5
- /** Archive formats the unified API can serialize. Everything else is read-only. */
6
- export type WritableArchiveFormat = "zip" | "tar" | "tar.gz" | "tar.zst" | "asar";
7
- /**
8
- * Where to read an archive from: an extension-inferred filesystem path, a
9
- * format-tagged filesystem path, in-memory bytes, or any caller-provided
10
- * {@link ByteSource} (e.g. `httpByteSource` for ranged remote reads).
11
- * File- and source-backed ZIP/ASAR/RAR/7z/ISO are read lazily.
12
- */
13
- export type ArchiveSource = string | {
14
- bytes: Uint8Array;
15
- format: ArchiveFormat;
16
- } | {
17
- path: string;
18
- format: ArchiveFormat;
19
- } | {
20
- source: ByteSource;
21
- format: ArchiveFormat;
22
- path?: string;
23
- };
24
- /** Content for a member when packing or extracting an archive. */
25
- export type ArchiveMemberContent = string | Uint8Array | Blob;
26
- /** One `archive.ext:inner/path` split candidate (see `parseArchivePathCandidates`). */
27
- export interface ArchivePathCandidate {
28
- archivePath: string;
29
- subPath: string;
30
- }
31
- /** A file or directory node visible through an `ArchiveReader`. */
32
- export interface ArchiveNode {
33
- path: string;
34
- isDirectory: boolean;
35
- size: number;
36
- mtimeMs?: number;
37
- /** Unix permission/type bits when the container records them. */
38
- mode?: number;
39
- }
40
- /** An {@link ArchiveNode} with its name relative to the listed directory. */
41
- export interface ArchiveDirectoryEntry extends ArchiveNode {
42
- name: string;
43
- }
44
- /** An {@link ArchiveNode} with its extracted payload. */
45
- export interface ExtractedArchiveFile extends ArchiveNode {
46
- bytes: Uint8Array;
47
- }
48
- /**
49
- * Format-owned handle that extracts one member's bytes on demand. Instances
50
- * may share per-archive state (solid-block decoders, 7z folder caches).
51
- * Prefer classes with prototype methods over closures: archives can index
52
- * hundreds of thousands of members.
53
- */
54
- export interface MemberSource {
55
- /**
56
- * Read this member's bytes. `size` is the entry's declared uncompressed
57
- * size (already bounds-checked); `memberPath` is for error messages.
58
- * Implementations must verify the produced byte count (and checksums when
59
- * the container records them) and throw {@link ArchiveError} on mismatch.
60
- */
61
- read(size: number, memberPath: string): Promise<Uint8Array>;
62
- }
63
- /**
64
- * How an indexed entry's bytes are stored. `link` entries alias another
65
- * archive path and are resolved lazily by the reader core; `member` entries
66
- * defer to their format module.
67
- */
68
- export type EntryStorage = {
69
- type: "link";
70
- targetPath: string;
71
- /** Follow before target kind is known (ASAR link records do not encode it). */
72
- resolveTarget: boolean;
73
- } | {
74
- type: "member";
75
- source: MemberSource;
76
- };
77
- /** One indexed entry as produced by a format reader, before core resolution. */
78
- export interface ArchiveIndexEntry extends ArchiveNode {
79
- storage?: EntryStorage;
80
- }
81
- /** Context passed to every format reader. */
82
- export interface FormatReadOptions {
83
- limits: ArchiveLimits;
84
- /**
85
- * Filesystem path of the archive when file-backed. Formats that reference
86
- * sibling files use it (ASAR `.unpacked` payloads, multi-volume RAR).
87
- */
88
- archivePath?: string;
89
- }
90
- /**
91
- * Contract implemented by every format module: index `source` into normalized
92
- * entries without materializing member payloads unless the container forces
93
- * it (tar streams, solid archives). Implementations must:
94
- * - normalize paths via `normalizeArchiveEntryPath` and drop unrepresentable ones,
95
- * - enforce `options.limits` before metadata-driven allocations,
96
- * - throw {@link ArchiveError} for malformed, truncated, encrypted, or
97
- * unsupported input — never a bare `Error`, and never process-fatal paths.
98
- */
99
- export type FormatReader = (source: ByteSource, options: FormatReadOptions) => Promise<ArchiveIndexEntry[]>;
@@ -1,7 +0,0 @@
1
- import type { ArchiveIndexEntry, FormatReader, FormatReadOptions } from "./types.js";
2
- /** Parse a fully materialized Unix ar archive for composition by formats such as deb. */
3
- export declare function readUnixArEntriesFromBuffer(bytes: Uint8Array, options: FormatReadOptions): ArchiveIndexEntry[];
4
- /** Read a Unix ar, static-library, or COFF import-library container. */
5
- export declare const readUnixAr: FormatReader;
6
- /** Detect the Unix ar global header. */
7
- export declare function sniffUnixAr(bytes: Uint8Array): boolean;
@@ -1,10 +0,0 @@
1
- import type { ArchiveFormat, ArchiveMemberContent, WritableArchiveFormat } from "./types.js";
2
- /** Whether `format` can be serialized by {@link writeArchive} (rest are read-only). */
3
- export declare function isWritableArchiveFormat(format: ArchiveFormat): format is WritableArchiveFormat;
4
- /**
5
- * Serialize `entries` into an archive of `format` in memory. String members
6
- * are encoded as UTF-8; member names are normalized to forward slashes.
7
- */
8
- export declare function encodeArchive(format: WritableArchiveFormat, entries: Iterable<readonly [string, ArchiveMemberContent]>): Promise<Uint8Array>;
9
- /** {@link encodeArchive}, written to `destPath` (parent directories auto-created). */
10
- export declare function writeArchive(destPath: string, format: WritableArchiveFormat, entries: Iterable<readonly [string, ArchiveMemberContent]>): Promise<void>;
@@ -1,10 +0,0 @@
1
- import { type ArchiveLimits } from "./limits.js";
2
- import type { FormatReader } from "./types.js";
3
- /** Index a ZIP/ZIP64 archive lazily from its central directory. */
4
- export declare const readZip: FormatReader;
5
- /** Detect a ZIP local header, empty-archive end record, or leading data descriptor. */
6
- export declare function sniffZip(bytes: Uint8Array): boolean;
7
- /** Materialize every regular ZIP member into a path-to-bytes map for document converters. */
8
- export declare function readZipEager(bytes: Uint8Array, limits?: ArchiveLimits): Promise<Map<string, Uint8Array>>;
9
- /** Encode deterministic stored/deflated ZIP bytes, emitting ZIP64 end records when the entry count requires them. */
10
- export declare function encodeZip(members: Iterable<readonly [string, Uint8Array]>): Promise<Uint8Array>;
@@ -1,22 +0,0 @@
1
- /**
2
- * Wrap a promise with a timeout and optional abort signal.
3
- * Rejects with the given error or a new error containing the given message if
4
- * the timeout fires first. Cleans up all listeners on settlement.
5
- */
6
- export declare function withTimeout<T>(promise: Promise<T>, ms: number, timeout: string | Error, signal?: AbortSignal): Promise<T>;
7
- /**
8
- * Coalesces rapid-fire writes into one deferred batch. `push` queues a value
9
- * and returns a promise for the batch flush; the first push of a batch arms a
10
- * timer (`delayMs`, or a microtask at 0), and every push before it fires joins
11
- * the same batch and shares the same promise. Used to keep hot paths off
12
- * synchronous storage (prompt history, model perf).
13
- */
14
- export declare class AsyncDrain<T> {
15
- #private;
16
- readonly delayMs: number;
17
- constructor(delayMs?: number);
18
- /** Queue `value`; `hnd` receives the whole batch when the window closes. */
19
- push(value: T, hnd: (values: T[]) => Promise<void> | void): Promise<void>;
20
- /** Runs the pending batch handler immediately and returns its completion promise. */
21
- flush(): Promise<void>;
22
- }
@@ -1,23 +0,0 @@
1
- /**
2
- * Header window sniffed for the binary heuristic; mirrors git's 8000-byte scan.
3
- * Exported so callers that already hold the whole file in memory can sniff the
4
- * identical prefix through {@link isProbablyBinaryHeader} instead of reopening.
5
- */
6
- export declare const BINARY_SNIFF_BYTES = 8192;
7
- /**
8
- * Classify an in-memory byte header as binary (non-UTF-8-text).
9
- *
10
- * Binary when the header contains a NUL byte (true binary, plus UTF-16/UTF-32
11
- * text whose ASCII range is NUL-padded) or when it is not valid UTF-8. The
12
- * decode runs in streaming mode so a multibyte sequence truncated at the header
13
- * boundary is tolerated, while any genuinely invalid byte still fails — matching
14
- * the strict `fatal` decode the `local://`/`ssh://` read paths already use.
15
- */
16
- export declare function isProbablyBinaryHeader(header: Uint8Array): boolean;
17
- /**
18
- * Sniff the first {@link BINARY_SNIFF_BYTES} of `filePath` and report whether it
19
- * is binary (non-UTF-8-text). See {@link isProbablyBinaryHeader} for the rule.
20
- */
21
- export declare function isProbablyBinary(filePath: string, maxBytes?: number): Promise<boolean>;
22
- /** Synchronous {@link isProbablyBinary}. */
23
- export declare function isProbablyBinarySync(filePath: string, maxBytes?: number): boolean;
@@ -1,68 +0,0 @@
1
- /** Behavior-compatible reimplementation of @puppeteer/browsers' used surface. */
2
- /** Supported browser products. */
3
- export declare enum Browser {
4
- CHROME = "chrome",
5
- CHROMEHEADLESSSHELL = "chrome-headless-shell",
6
- CHROMIUM = "chromium",
7
- FIREFOX = "firefox",
8
- CHROMEDRIVER = "chromedriver"
9
- }
10
- /** Browser download platform identifiers. */
11
- export declare enum BrowserPlatform {
12
- LINUX = "linux",
13
- LINUX_ARM = "linux_arm",
14
- MAC = "mac",
15
- MAC_ARM = "mac_arm",
16
- WIN32 = "win32",
17
- WIN64 = "win64"
18
- }
19
- /** Chrome-for-Testing release channel tags accepted by {@link resolveBuildId}. */
20
- export declare enum BrowserTag {
21
- CANARY = "canary",
22
- NIGHTLY = "nightly",
23
- BETA = "beta",
24
- DEV = "dev",
25
- DEVEDITION = "devedition",
26
- STABLE = "stable",
27
- ESR = "esr",
28
- LATEST = "latest"
29
- }
30
- /** Download progress reported while a browser archive is streamed to disk. */
31
- export interface BrowserDownloadProgress {
32
- downloadedBytes: number;
33
- totalBytes: number;
34
- }
35
- /** Inputs used to locate an installed browser executable. */
36
- export interface ComputeExecutablePathOptions {
37
- browser: Browser;
38
- buildId: string;
39
- cacheDir: string;
40
- platform?: BrowserPlatform;
41
- }
42
- /** Inputs used to download and install a browser. */
43
- export interface InstallOptions extends ComputeExecutablePathOptions {
44
- baseUrl?: string;
45
- downloadProgressCallback?: (progress: BrowserDownloadProgress) => void;
46
- }
47
- /** Metadata for one browser installation found in a Puppeteer cache. */
48
- export interface InstalledBrowser {
49
- browser: Browser;
50
- buildId: string;
51
- platform: BrowserPlatform;
52
- path: string;
53
- executablePath: string;
54
- }
55
- /** Detect the current host's Puppeteer browser platform. */
56
- export declare function detectBrowserPlatform(): BrowserPlatform | undefined;
57
- /** Resolve a Chrome-for-Testing channel, milestone, or build prefix to a full build ID. */
58
- export declare function resolveBuildId(browser: Browser, _platform: BrowserPlatform, tag: string | BrowserTag): Promise<string>;
59
- /** Return the Chrome-for-Testing archive URL for a browser build. */
60
- export declare function getDownloadUrl(browser: Browser, platform: BrowserPlatform, buildId: string, baseUrl?: string): URL;
61
- /** Compute the executable path in Puppeteer's cache layout. */
62
- export declare function computeExecutablePath(options: ComputeExecutablePathOptions): string;
63
- /** Scan a Puppeteer cache for browser installation directories. */
64
- export declare function getInstalledBrowsers(options: {
65
- cacheDir: string;
66
- }): Promise<InstalledBrowser[]>;
67
- /** Download and unpack Chrome into Puppeteer's existing cache layout. */
68
- export declare function install(options: InstallOptions): Promise<InstalledBrowser>;
@@ -1,125 +0,0 @@
1
- /** Behavior-compatible reimplementation of chalk's used surface. */
2
- /** ANSI color capability level. */
3
- export type ColorLevel = 0 | 1 | 2 | 3;
4
- /** Details about a terminal's supported color depth. */
5
- export interface ColorSupport {
6
- /** Highest supported ANSI color level. */
7
- level: ColorLevel;
8
- /** Whether the terminal supports the basic 16 colors. */
9
- hasBasic: boolean;
10
- /** Whether the terminal supports the 256-color palette. */
11
- has256: boolean;
12
- /** Whether the terminal supports 24-bit color. */
13
- has16m: boolean;
14
- }
15
- interface ChalkOptions {
16
- level?: ColorLevel;
17
- }
18
- /** A callable, chainable ANSI text formatter. */
19
- export interface ChalkInstance {
20
- (...text: unknown[]): string;
21
- /** Active color capability level. */
22
- level: ColorLevel;
23
- /** Reset every active terminal style. */
24
- readonly reset: ChalkInstance;
25
- /** Render bold text. */
26
- readonly bold: ChalkInstance;
27
- /** Render faint text. */
28
- readonly dim: ChalkInstance;
29
- /** Render italic text. */
30
- readonly italic: ChalkInstance;
31
- /** Render underlined text. */
32
- readonly underline: ChalkInstance;
33
- /** Swap foreground and background colors. */
34
- readonly inverse: ChalkInstance;
35
- /** Render struck-through text. */
36
- readonly strikethrough: ChalkInstance;
37
- /** Render black text. */
38
- readonly black: ChalkInstance;
39
- /** Render red text. */
40
- readonly red: ChalkInstance;
41
- /** Render green text. */
42
- readonly green: ChalkInstance;
43
- /** Render yellow text. */
44
- readonly yellow: ChalkInstance;
45
- /** Render blue text. */
46
- readonly blue: ChalkInstance;
47
- /** Render magenta text. */
48
- readonly magenta: ChalkInstance;
49
- /** Render cyan text. */
50
- readonly cyan: ChalkInstance;
51
- /** Render white text. */
52
- readonly white: ChalkInstance;
53
- /** Render gray text. */
54
- readonly gray: ChalkInstance;
55
- /** Alias for gray text. */
56
- readonly grey: ChalkInstance;
57
- /** Render bright black text. */
58
- readonly blackBright: ChalkInstance;
59
- /** Render bright red text. */
60
- readonly redBright: ChalkInstance;
61
- /** Render bright green text. */
62
- readonly greenBright: ChalkInstance;
63
- /** Render bright yellow text. */
64
- readonly yellowBright: ChalkInstance;
65
- /** Render bright blue text. */
66
- readonly blueBright: ChalkInstance;
67
- /** Render bright magenta text. */
68
- readonly magentaBright: ChalkInstance;
69
- /** Render bright cyan text. */
70
- readonly cyanBright: ChalkInstance;
71
- /** Render bright white text. */
72
- readonly whiteBright: ChalkInstance;
73
- /** Render text on a black background. */
74
- readonly bgBlack: ChalkInstance;
75
- /** Render text on a red background. */
76
- readonly bgRed: ChalkInstance;
77
- /** Render text on a green background. */
78
- readonly bgGreen: ChalkInstance;
79
- /** Render text on a yellow background. */
80
- readonly bgYellow: ChalkInstance;
81
- /** Render text on a blue background. */
82
- readonly bgBlue: ChalkInstance;
83
- /** Render text on a magenta background. */
84
- readonly bgMagenta: ChalkInstance;
85
- /** Render text on a cyan background. */
86
- readonly bgCyan: ChalkInstance;
87
- /** Render text on a white background. */
88
- readonly bgWhite: ChalkInstance;
89
- /** Render text on a gray background. */
90
- readonly bgGray: ChalkInstance;
91
- /** Alias for a gray background. */
92
- readonly bgGrey: ChalkInstance;
93
- /** Render text on a bright black background. */
94
- readonly bgBlackBright: ChalkInstance;
95
- /** Render text on a bright red background. */
96
- readonly bgRedBright: ChalkInstance;
97
- /** Render text on a bright green background. */
98
- readonly bgGreenBright: ChalkInstance;
99
- /** Render text on a bright yellow background. */
100
- readonly bgYellowBright: ChalkInstance;
101
- /** Render text on a bright blue background. */
102
- readonly bgBlueBright: ChalkInstance;
103
- /** Render text on a bright magenta background. */
104
- readonly bgMagentaBright: ChalkInstance;
105
- /** Render text on a bright cyan background. */
106
- readonly bgCyanBright: ChalkInstance;
107
- /** Render text on a bright white background. */
108
- readonly bgWhiteBright: ChalkInstance;
109
- /** Render text with an arbitrary hexadecimal foreground color. */
110
- hex(color: string): ChalkInstance;
111
- }
112
- /** Constructor for an independently configured chalk formatter. */
113
- export interface ChalkConstructor {
114
- new (options?: ChalkOptions): ChalkInstance;
115
- }
116
- /** Detect an ANSI color level from terminal environment and TTY state. */
117
- export declare function detectColorLevel(environment: NodeJS.ProcessEnv, isTTY: boolean): ColorLevel;
118
- /** Color support detected for standard output. */
119
- export declare const supportsColor: false | ColorSupport;
120
- /** Color support detected for standard error. */
121
- export declare const supportsColorStderr: false | ColorSupport;
122
- /** Construct an independently configured chalk formatter. */
123
- export declare const Chalk: ChalkConstructor;
124
- declare const chalk: ChalkInstance;
125
- export default chalk;
@@ -1,134 +0,0 @@
1
- /**
2
- * A user-facing argument/flag validation failure. Thrown by {@link Command.parse}
3
- * for missing/invalid positionals and flags. The top-level {@link run} handler
4
- * prints its message plus the command usage line to stderr and exits 1, instead
5
- * of letting it bubble to the process-level catch — which would dump a minified
6
- * `dist/cli.js` code frame over a plain argument mistake (issue #5369).
7
- */
8
- export declare class CliUsageError extends Error {
9
- constructor(message: string);
10
- }
11
- export interface FlagDescriptor<K extends "string" | "boolean" | "integer" = "string" | "boolean" | "integer"> {
12
- kind: K;
13
- description?: string;
14
- char?: string;
15
- default?: unknown;
16
- multiple?: boolean;
17
- options?: readonly string[];
18
- required?: boolean;
19
- }
20
- export interface ArgDescriptor {
21
- kind: "string";
22
- description?: string;
23
- required?: boolean;
24
- multiple?: boolean;
25
- options?: readonly string[];
26
- }
27
- interface FlagInput {
28
- description?: string;
29
- char?: string;
30
- default?: unknown;
31
- multiple?: boolean;
32
- options?: readonly string[];
33
- required?: boolean;
34
- }
35
- interface ArgInput {
36
- description?: string;
37
- required?: boolean;
38
- multiple?: boolean;
39
- options?: readonly string[];
40
- }
41
- /** Builders that match the `Flags.*()` / `Args.*()` API from oclif. */
42
- export declare const Flags: {
43
- string<T extends FlagInput>(opts?: T): FlagDescriptor<"string"> & T;
44
- boolean<T extends FlagInput>(opts?: T): FlagDescriptor<"boolean"> & T;
45
- integer<T extends FlagInput & {
46
- default?: number;
47
- }>(opts?: T): FlagDescriptor<"integer"> & T;
48
- };
49
- export declare const Args: {
50
- string<T extends ArgInput>(opts?: T): ArgDescriptor & T;
51
- };
52
- type FlagValue<D extends FlagDescriptor> = D["kind"] extends "boolean" ? D extends {
53
- default: boolean;
54
- } ? boolean : boolean | undefined : D["kind"] extends "integer" ? D extends {
55
- default: number;
56
- } ? number : number | undefined : D extends {
57
- multiple: true;
58
- } ? string[] | undefined : string | undefined;
59
- type ArgValue<D extends ArgDescriptor> = D extends {
60
- multiple: true;
61
- } ? string[] | undefined : string | undefined;
62
- type FlagValues<T extends Record<string, FlagDescriptor>> = {
63
- [K in keyof T]: FlagValue<T[K]>;
64
- };
65
- type ArgValues<T extends Record<string, ArgDescriptor>> = {
66
- [K in keyof T]: ArgValue<T[K]>;
67
- };
68
- export interface ParseOutput<F extends Record<string, FlagDescriptor> = Record<string, FlagDescriptor>, A extends Record<string, ArgDescriptor> = Record<string, ArgDescriptor>> {
69
- flags: FlagValues<F>;
70
- args: ArgValues<A>;
71
- argv: string[];
72
- }
73
- export interface CommandMetadata {
74
- description?: string;
75
- hidden?: boolean;
76
- flags?: Record<string, FlagDescriptor>;
77
- args?: Record<string, ArgDescriptor>;
78
- examples?: string[];
79
- }
80
- export interface CommandCtor extends CommandMetadata {
81
- new (argv: string[], config: CliConfig): Command;
82
- strict?: boolean;
83
- aliases?: string[];
84
- }
85
- /** Configuration passed to every command instance and help renderers. */
86
- export interface CliConfig<TCommand extends CommandMetadata = CommandCtor> {
87
- bin: string;
88
- version: string;
89
- /** All registered commands keyed by their canonical name. */
90
- commands: Map<string, TCommand>;
91
- }
92
- /** Minimal Command base matching the oclif surface we use. */
93
- export declare abstract class Command {
94
- argv: string[];
95
- config: CliConfig;
96
- constructor(argv: string[], config: CliConfig);
97
- abstract run(): Promise<void>;
98
- /**
99
- * Parse argv against the static `flags` and `args` declared on the
100
- * concrete command class. Returns a typed `{ flags, args, argv }` object.
101
- */
102
- parse<C extends CommandCtor>(_Cmd: C): Promise<ParseOutput<NonNullable<C["flags"]> extends Record<string, FlagDescriptor> ? NonNullable<C["flags"]> : Record<string, FlagDescriptor>, NonNullable<C["args"]> extends Record<string, ArgDescriptor> ? NonNullable<C["args"]> : Record<string, ArgDescriptor>>>;
103
- }
104
- /** Render full root help: header, default command details, subcommand list. */
105
- export declare function renderRootHelp(config: CliConfig<CommandMetadata>): void;
106
- /** Build the single USAGE line for a command (without the leading label). */
107
- export declare function commandUsageLine(bin: string, id: string, Cmd: CommandCtor): string;
108
- /** Render help for a single command. */
109
- export declare function renderCommandHelp(bin: string, id: string, Cmd: CommandCtor): void;
110
- /** A lazily-loaded command: canonical name, loader, and optional aliases. */
111
- export interface CommandEntry {
112
- name: string;
113
- load: () => Promise<CommandCtor>;
114
- help?: CommandMetadata;
115
- aliases?: string[];
116
- }
117
- export interface RunOptions {
118
- bin: string;
119
- version: string;
120
- argv: string[];
121
- commands: CommandEntry[];
122
- /** Custom help renderer with the fully loaded command constructors. */
123
- help?: (config: CliConfig) => Promise<void> | void;
124
- /** Lightweight help renderer backed by static command metadata. */
125
- metadataHelp?: (config: CliConfig<CommandMetadata>) => Promise<void> | void;
126
- }
127
- /**
128
- * Main entry point — replaces `run()` from @oclif/core.
129
- *
130
- * Each command is explicitly registered with a lazy loader.
131
- * No filesystem scanning, no plugin system, no package.json reading.
132
- */
133
- export declare function run(opts: RunOptions): Promise<void>;
134
- export {};
@@ -1,136 +0,0 @@
1
- /**
2
- * Color manipulation utilities for hex colors.
3
- *
4
- * @example
5
- * ```ts
6
- * import { hexToHsv, hsvToHex } from "@linxiraos/pi-utils";
7
- *
8
- * // Rotate the hue by 90°
9
- * const hsv = hexToHsv("#4ade80");
10
- * hsv.h = (hsv.h + 90) % 360;
11
- * const newHex = hsvToHex(hsv);
12
- * ```
13
- */
14
- export interface HSV {
15
- /** Hue in degrees (0-360) */
16
- h: number;
17
- /** Saturation (0-1) */
18
- s: number;
19
- /** Value/brightness (0-1) */
20
- v: number;
21
- }
22
- export interface RGB {
23
- /** Red (0-255) */
24
- r: number;
25
- /** Green (0-255) */
26
- g: number;
27
- /** Blue (0-255) */
28
- b: number;
29
- }
30
- /**
31
- * Parse a hex color string to RGB.
32
- * Supports #RGB, #RRGGBB formats.
33
- */
34
- export declare function hexToRgb(hex: string): RGB;
35
- /**
36
- * Convert RGB to hex color string.
37
- */
38
- export declare function rgbToHex(rgb: RGB): string;
39
- /**
40
- * Convert RGB to HSV.
41
- */
42
- export declare function rgbToHsv(rgb: RGB): HSV;
43
- /**
44
- * Convert HSV to RGB.
45
- */
46
- export declare function hsvToRgb(hsv: HSV): RGB;
47
- /**
48
- * Convert hex color to HSV.
49
- */
50
- export declare function hexToHsv(hex: string): HSV;
51
- /**
52
- * Convert HSV to hex color.
53
- */
54
- export declare function hsvToHex(hsv: HSV): string;
55
- /**
56
- * Shift the hue of a hex color by a given number of degrees.
57
- */
58
- export declare function shiftHue(hex: string, degrees: number): string;
59
- export interface HSVAdjustment {
60
- /** Hue shift in degrees (additive) */
61
- h?: number;
62
- /** Saturation multiplier */
63
- s?: number;
64
- /** Value/brightness multiplier */
65
- v?: number;
66
- }
67
- /**
68
- * Adjust HSV components of a hex color.
69
- *
70
- * @param hex - Hex color string (#RGB or #RRGGBB)
71
- * @param adj - Adjustments: h is additive degrees, s and v are multipliers
72
- * @returns New hex color string
73
- *
74
- * @example
75
- * ```ts
76
- * // Shift hue +60°, reduce saturation to 71%
77
- * adjustHsv("#00ff88", { h: 60, s: 0.71 }) // "#4a9eff"
78
- * ```
79
- */
80
- export declare function adjustHsv(hex: string, adj: HSVAdjustment): string;
81
- /**
82
- * Convert HSL (h: 0-360, s: 0-1, l: 0-1) to a CSS hex string.
83
- */
84
- export declare function hslToHex(h: number, s: number, l: number): string;
85
- export interface OKLCH {
86
- /** Perceptual lightness (0-1) */
87
- l: number;
88
- /** Chroma (0 = gray; sRGB peaks around 0.37) */
89
- c: number;
90
- /** Hue in degrees (0-360) */
91
- h: number;
92
- }
93
- /**
94
- * Convert a hex color to OKLCH (perceptual lightness/chroma/hue).
95
- *
96
- * Unlike HSL, equal `l`/`c` values look equally bright and colorful across
97
- * hues, so carrying them between colors preserves the palette's "weight".
98
- */
99
- export declare function hexToOklch(hex: string): OKLCH;
100
- /**
101
- * The sRGB gamut cusp for an OKLCH hue: the lightness/chroma point where the
102
- * hue reaches its maximum chroma inside sRGB.
103
- *
104
- * The cusp lightness varies wildly per hue (yellow ≈ 0.97, blue ≈ 0.45), so
105
- * transferring absolute OKLCH lightness/chroma between hues distorts
106
- * vividness; normalize against the cusp instead. See `getSessionAccentHex`.
107
- */
108
- export declare function oklchCusp(h: number): {
109
- l: number;
110
- c: number;
111
- };
112
- /**
113
- * Convert OKLCH to a CSS hex string, gamut-mapping by chroma reduction.
114
- *
115
- * Out-of-gamut inputs keep their lightness and hue while chroma is bisected
116
- * down until the color fits sRGB, matching CSS Color 4's recommended intent.
117
- */
118
- export declare function oklchToHex(oklch: OKLCH): string;
119
- /**
120
- * Perceptual luma (gamma-encoded BT.709 weights over raw sRGB), normalized to 0..1.
121
- *
122
- * Accepts a hex string (`#rgb` / `#rrggbb`) or a 256-color palette index; returns
123
- * `undefined` for var refs, empty strings, or anything unparseable.
124
- *
125
- * Cheap and good enough for a light/dark *classification* threshold. NOT suitable
126
- * for contrast ratios — use {@link relativeLuminance} for those.
127
- */
128
- export declare function colorLuma(value: string | number): number | undefined;
129
- /**
130
- * WCAG 2.x relative luminance (BT.709 weights over linearized sRGB), normalized to
131
- * 0..1. This is the value the WCAG contrast-ratio formula expects.
132
- *
133
- * Accepts a hex string (`#rgb` / `#rrggbb`) or a 256-color palette index; returns
134
- * `undefined` for var refs, empty strings, or anything unparseable.
135
- */
136
- export declare function relativeLuminance(value: string | number): number | undefined;
@@ -1,7 +0,0 @@
1
- /** Behavior-compatible reimplementation of date-fns's used surface. */
2
- /** Format a date with the supported date-fns v4 tokens and quoted literals. */
3
- export declare function format(value: Date | number, pattern: string): string;
4
- /** Describe the distance from a date to now using date-fns's English thresholds. */
5
- export declare function formatDistanceToNow(value: Date | number, options?: {
6
- addSuffix?: boolean;
7
- }): string;