repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by bugabinga

test(leaks): add full validation gates

c21d3b193d60251a52cb6b305fee833b2dafcb9f

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (15)

extensions/leaks/SPEC.md

Modified
528 528 | V1 provider boundary | Pi docs grep for `context`, `before_provider_request`, `tool_call`, `message_end`; temp `pi -p` extension with local fake OpenAI provider | context-stage sentinel, provider-payload sentinel, provider auth header, placeholder tool arg, placeholder assistant text | provider body redacted by both stages; provider auth header present; tool arg restored; assistant message restored |
529 529 | V2 placeholders | temp Node placeholder/selector prototype | stable same-value mapping, random per-store HMAC key, HMAC12 format, collision suffix, tag caps, overflow cap, restore lookup, overlap selector, existing placeholder skip | stable within store; different across stores; collision `_2`; 6 tags; 64-char tag cap; overflow non-restorable; selected password component plus whole JWT |
530 530 | V3 settings | temp Node settings/regex compiler prototype | valid rule, zero/one/multi-capture rules, unsupported `flags`, missing/invalid/long labels, syntax error, unsafe regex patterns, 513-char pattern | positive controls pass; unsafe/syntax/long patterns ignored with warnings; group 1 selected with warning for multiple groups; labels fall back to `CUSTOM_REGEX` |
531 -| V4 built-ins | temp Node detector-family corpus checker over `/home/me/Workspace/tmp/demo-secrets` | 140 generated secret files; positive controls for all minimum detector families; negative controls for broad opaque keys `lineage` and `value` | all eight minimum families present; no missing families; broad keys remain negative; no unexpected negatives |
532 -| V5 learned values | temp Node dotenv/env classifier prototype plus sampled `/home/me/Workspace/tmp/demo-secrets` files | fixed `.env` files, no recursive dotenv, quoted/comment parsing, process env `ENV_KEY`, public prefixes, weak references, credentialed URL components, demo key/class sample | fixed files only; parser strips comments/quotes; env names collapse to `ENV_KEY`; weak refs ignored; URL components learned instead of whole URL; demo key/classes reported without values |
533 -| V6 component parsers | temp Node URL/header/cookie/assignment prototype plus sampled `/home/me/Workspace/tmp/demo-secrets` files | credentialed URL password/query, URL-without-creds negative, Bearer/Basic/X-API-Key/Cookie, six assignment syntaxes, embedded shell header, four weak metadata negatives | URL structure preserved; secret components redacted; safe URL/header/cookie parts preserved; embedded shell header redacted without redacting whole command; demo classes reported without values |
534 -| V7 false positives | temp Node false-positive classifier prototype plus sampled `/home/me/Workspace/tmp/demo-secrets` files | 16 hand negative controls, 4 positive controls, custom-regex override, demo metadata classes, SSH public key, TLS certificate | refs, hosts, ordinary URLs, IDs, names, UUID/hex, public prefixes, public keys, and certs stay metadata; high-confidence values still redact; custom regex can override |
531 +| V4 built-ins | detector-family corpus checker over vendored `extensions/leaks/__fixtures__/demo-secrets` | 140 generated secret files; positive controls for all minimum detector families; negative controls for broad opaque keys `lineage` and `value` | all eight minimum families present; no missing families; broad keys remain negative; no unexpected negatives |
532 +| V5 learned values | dotenv/env classifier plus sampled vendored `extensions/leaks/__fixtures__/demo-secrets` files | fixed `.env` files, no recursive dotenv, quoted/comment parsing, process env `ENV_KEY`, public prefixes, weak references, credentialed URL components, demo key/class sample | fixed files only; parser strips comments/quotes; env names collapse to `ENV_KEY`; weak refs ignored; URL components learned instead of whole URL; demo key/classes reported without values |
533 +| V6 component parsers | URL/header/cookie/assignment tests plus sampled vendored `extensions/leaks/__fixtures__/demo-secrets` files | credentialed URL password/query, URL-without-creds negative, Bearer/Basic/X-API-Key/Cookie, six assignment syntaxes, embedded shell header, four weak metadata negatives | URL structure preserved; secret components redacted; safe URL/header/cookie parts preserved; embedded shell header redacted without redacting whole command; demo classes reported without values |
534 +| V7 false positives | false-positive tests plus sampled vendored `extensions/leaks/__fixtures__/demo-secrets` files | 16 hand negative controls, 4 positive controls, custom-regex override, demo metadata classes, SSH public key, TLS certificate | refs, hosts, ordinary URLs, IDs, names, UUID/hex, public prefixes, public keys, and certs stay metadata; high-confidence values still redact; custom regex can override |
535 535 | V8 UX | temp Node UX/command-state prototype | provider turn summary, footer/status string, `/leaks status`, `/leaks reload`, `/leaks test`, `/leaks clear`, env key name, secret value | one aggregate notification for redacting turn; no notification for clean turn; status has required fields; diagnostics omit secret and env name; test output redacted; clear respects cancel |
536 536 | V9 performance/failure | temp Node bounded-engine prototype | 40 precompiled rules, operation counter, mapping cap, cyclic object, depth-70 object, throwing detector | compile once; operations bounded by input size × rule count; map cap enforced; depth cap warning; cyclic traversal terminates; detector failure fails open and warns once |

extensions/leaks/__tests__/direct-modules.test.ts

Added
new file mode 100644
1 +import { mkdirSync, mkdtempSync, writeFileSync } from "node:fs";
2 +import { tmpdir } from "node:os";
3 +import path from "node:path";
4 +import { describe, expect, it } from "vitest";
5 +import { findBuiltinSpans } from "../src/detectors.ts";
6 +import {
7 + discoverDotenvFiles,
8 + learnEnvironmentValues,
9 + learnedValueSpans,
10 + loadDotenvValues,
11 + parseDotenv,
12 +} from "../src/dotenv.ts";
13 +import { LeaksEngine } from "../src/engine.ts";
14 +import { PlaceholderStore } from "../src/placeholders.ts";
15 +import {
16 + isExistingPlaceholder,
17 + isPlainObject,
18 + isWeakValue,
19 + maskDiagnostic,
20 + sanitizeTag,
21 +} from "../src/safety.ts";
22 +import { selectSecretSpans } from "../src/selector.ts";
23 +import {
24 + compileCustomRegex,
25 + customRegexSpans,
26 + loadLeaksSettings,
27 +} from "../src/settings.ts";
28 +import {
29 + findAssignmentSpans,
30 + findCookieSpans,
31 + findCredentialedUrlSpans,
32 + findHeaderSpans,
33 + findJwtSpans,
34 + findPrivateKeySpans,
35 + findSensitiveQuerySpans,
36 + findStructureSpans,
37 +} from "../src/structures.ts";
38 +import type { SecretSpan, SpanLabel } from "../src/types.ts";
40 +const value = ["direct", "fixture", "secret", "123456789"].join("-");
42 +function tmp() {
43 + return mkdtempSync(path.join(tmpdir(), "leaks-direct-"));
46 +function tag(name: string, source: SpanLabel["source"] = "builtin"): SpanLabel {
47 + return { tag: name, priority: 1, source };
50 +function secretSpan(
51 + start: number,
52 + end: number,
53 + kind: SecretSpan["kind"],
54 +): SecretSpan {
55 + return {
56 + start,
57 + end,
58 + value: "abcdef".slice(0, end - start),
59 + labels: [tag(kind.toUpperCase())],
60 + kind,
61 + confidence: 99,
62 + wholeSpan: kind === "jwt" || kind === "private-key",
63 + };
66 +describe("leaks direct module coverage", () => {
67 + it("hits detector and structure modules directly", () => {
68 + expect(findBuiltinSpans("ghp_" + "A".repeat(36))).toHaveLength(1);
69 + expect(findBuiltinSpans("plain text")).toEqual([]);
70 + const jwt = [
71 + "eyJhbGciOiJIUzI1NiJ9",
72 + "eyJzdWIiOiIxMjM0NTY3ODkwIn0",
73 + "c2lnbmF0dXJl",
74 + ].join(".");
75 + const key = [
76 + "-----BEGIN EC ",
77 + "PRIVATE KEY-----\nbody\n-----END EC ",
78 + "PRIVATE KEY-----",
79 + ].join("");
80 + const text = [
81 + jwt,
82 + key,
83 + `mysql://user:${value}@host/db`,
84 + `https://host/path?api_key=${value}`,
85 + `Authorization: Basic ${value}`,
86 + `Api-Key: ${value}`,
87 + `Cookie: auth=${value}; theme=dark`,
88 + `TOKEN=${value}`,
89 + `<TOKEN>${value}</TOKEN>`,
90 + ].join("\n");
91 + expect(findStructureSpans(text).length).toBeGreaterThan(8);
92 + expect(findPrivateKeySpans(key)).toHaveLength(1);
93 + expect(findJwtSpans(jwt)).toHaveLength(1);
94 + expect(
95 + findCredentialedUrlSpans(`mysql://user:${value}@host/db`),
96 + ).toHaveLength(1);
97 + expect(findSensitiveQuerySpans(`?api_key=${value}`)).toHaveLength(1);
98 + expect(
99 + findHeaderSpans(`Authorization: Basic ${value}\nApi-Key: ${value}`),
100 + ).toHaveLength(2);
101 + expect(findCookieSpans(`Cookie: auth=${value}; flag`)).toHaveLength(1);
102 + expect(
103 + findAssignmentSpans(`TOKEN=${value}\n<TOKEN>${value}</TOKEN>`),
104 + ).toHaveLength(2);
105 + });
107 + it("hits dotenv, settings, safety, selector, placeholder, and engine modules directly", () => {
108 + const cwd = tmp();
109 + mkdirSync(path.join(cwd, "dir"));
110 + writeFileSync(path.join(cwd, ".env"), `TOKEN=${value}\n`, "utf8");
111 + writeFileSync(
112 + path.join(cwd, ".env.test.local"),
113 + `API_KEY=${value}2\n`,
114 + "utf8",
115 + );
116 + expect(discoverDotenvFiles(cwd).map((file) => path.basename(file))).toEqual(
117 + [".env", ".env.test.local"],
118 + );
119 + expect(
120 + parseDotenv("export TOKEN='x' # y\nDOUBLE=\"y\" tail\nBAD\nZ=plain # c"),
121 + ).toEqual([
122 + { key: "TOKEN", value: "x" },
123 + { key: "DOUBLE", value: "y" },
124 + { key: "Z", value: "plain" },
125 + ]);
126 + expect(learnEnvironmentValues({ TOKEN: undefined }).values).toEqual([]);
127 + const learned = loadDotenvValues(cwd).values;
128 + expect(learnedValueSpans(`${value} ${value}2`, learned)).toHaveLength(3);
130 + expect(isPlainObject({})).toBe(true);
131 + expect(isPlainObject(new Date())).toBe(false);
132 + expect(sanitizeTag("a/b")).toBe("A_B");
133 + expect(isExistingPlaceholder("__LEAK_A_abcdef123456_2__")).toBe(true);
134 + expect(maskDiagnostic("a\nb")).toBe("text chars=3 lines=2");
135 + expect(isWeakValue("https://example.test/path")).toBe(true);
137 + const loaded = loadLeaksSettings({
138 + leaks: { regex: [{ pattern: "foo([A-Z]+)", label: "FOO" }] },
139 + });
140 + const compiled = compileCustomRegex(loaded.settings);
141 + expect(customRegexSpans("fooABC", compiled.rules)[0].value).toBe("ABC");
143 + const selected = selectSecretSpans("abcdef", [
144 + secretSpan(0, 6, "builtin"),
145 + secretSpan(1, 4, "structure"),
146 + secretSpan(4, 6, "custom"),
147 + ]);
148 + expect(selected.map((item) => item.value)).toEqual(["ab", "abc"]);
150 + const store = new PlaceholderStore({ digest: () => "abc" });
151 + const placeholder = store.create(value, [tag("DIRECT")]);
152 + expect(store.restore(placeholder)).toBe(value);
153 + store.clear();
154 + expect(store.restore(placeholder)).toBe(placeholder);
156 + expect(customRegexSpans("x", [])).toEqual([]);
158 + const engine = new LeaksEngine({ env: { TOKEN: value } });
159 + const redacted = engine.redactDeep({ value }, "provider");
160 + expect(JSON.stringify(redacted.value)).not.toContain(value);
161 + expect(engine.restoreDeep(redacted.value).value.value).toBe(value);
162 + expect(engine.restoreDeep("clean").changed).toBe(false);
163 + expect(engine.redactDeep(new Date()).value).toBeInstanceOf(Date);
164 + expect(engine.redactDeep(["clean"]).changed).toBe(false);
165 + expect(engine.redactDeep({ clean: "text" }).changed).toBe(false);
166 + engine.clear();
167 + expect(engine.stats().mappingCount).toBe(0);
168 + });
170 + it("hits remaining defensive branches directly", () => {
171 + expect(isWeakValue("NO")).toBe(true);
172 + expect(isWeakValue("42")).toBe(true);
174 + const selectorTie = selectSecretSpans("abcdef", [
175 + { ...secretSpan(0, 3, "builtin"), confidence: 10 },
176 + { ...secretSpan(0, 3, "builtin"), confidence: 99 },
177 + { ...secretSpan(0, 3, "builtin"), labels: [tag("BUILTIN")] },
178 + ]);
179 + expect(selectorTie).toHaveLength(1);
180 + expect(selectorTie[0].labels).toHaveLength(1);
182 + const many: Record<string, string> = {};
183 + for (let index = 0; index < 8194; index++) {
184 + many[`TOKEN_${index}`] = `direct-cap-fixture-${index}-123456789`;
186 + const warned = new LeaksEngine();
187 + warned.reload(tmp(), warned.settings, many);
188 + expect(
189 + warned.stats().warnings.some((warning) => warning.code === "learned.cap"),
190 + ).toBe(true);
192 + const capped = new LeaksEngine();
193 + for (let index = 0; index < 8193; index++) {
194 + capped.redactText(`sk-or-v1-${index.toString().padStart(64, "0")}`);
196 + expect(
197 + capped
198 + .stats()
199 + .warnings.some((warning) => warning.code === "placeholder.cap"),
200 + ).toBe(true);
201 + });
202 +});

extensions/leaks/__tests__/edge-coverage.test.ts

Added
new file mode 100644
1 +import { mkdirSync, mkdtempSync, writeFileSync } from "node:fs";
2 +import { tmpdir } from "node:os";
3 +import path from "node:path";
4 +import { afterEach, describe, expect, it } from "vitest";
5 +import { createTestSession, type TestSession } from "../../../test/harness";
6 +import { __test } from "../index.ts";
7 +import type { SecretSpan, SpanLabel } from "../src/types.ts";
9 +const fixture = ["edge", "fixture", "secret", "123456789"].join("-");
11 +function temp() {
12 + return mkdtempSync(path.join(tmpdir(), "leaks-edge-"));
15 +function label(
16 + tag = "TOKEN",
17 + source: SpanLabel["source"] = "dotenv",
18 +): SpanLabel {
19 + return { tag, priority: 10, source };
22 +function span(
23 + start: number,
24 + end: number,
25 + kind: SecretSpan["kind"],
26 +): SecretSpan {
27 + return {
28 + start,
29 + end,
30 + value: "abcdef".slice(0, end - start),
31 + labels: [
32 + label(kind.toUpperCase(), kind === "builtin" ? "builtin" : "structure"),
33 + ],
34 + kind,
35 + confidence: 50,
36 + wholeSpan: kind === "jwt" || kind === "private-key",
37 + };
40 +describe("leaks edge coverage", () => {
41 + it("covers safety helper branches", () => {
42 + expect(__test.isPlainObject(null)).toBe(false);
43 + expect(__test.isPlainObject([])).toBe(false);
44 + expect(__test.isPlainObject(Object.create(null))).toBe(true);
45 + expect(__test.sanitizeTag("!!!")).toBe("SECRET");
46 + expect(__test.isExistingPlaceholder("__LEAK_TOKEN_abcdef123456__")).toBe(
47 + true,
48 + );
49 + expect(__test.isExistingPlaceholder("nope")).toBe(false);
50 + expect(__test.maskDiagnostic("")).toBe("text chars=0 lines=0");
51 + for (const value of [
52 + "short",
53 + "true",
54 + "123.45",
55 + "$TOKEN",
56 + "${TOKEN}",
57 + "${{ secrets.TOKEN }}",
58 + "process.env.TOKEN",
59 + "550e8400-e29b-41d4-a716-446655440000",
60 + "example.test",
61 + "https://example.test/path",
62 + "~/file",
63 + ]) {
64 + expect(__test.isWeakValue(value), value).toBe(true);
65 + }
66 + expect(
67 + __test.isWeakValue("https://example.test/?" + "tok" + "en=" + fixture),
68 + ).toBe(false);
69 + expect(__test.isWeakValue("not a weak fixture value 123456789")).toBe(
70 + false,
71 + );
72 + });
74 + it("covers dotenv parser and learning branches", () => {
75 + const cwd = temp();
76 + expect(__test.discoverDotenvFiles(cwd)).toEqual([]);
77 + writeFileSync(
78 + path.join(cwd, ".env.local"),
79 + `# comment\nINVALID\nexport TOKEN=${fixture} # comment\nQUOTED="${fixture}"suffix\n` +
80 + `PUBLIC_TOKEN=${fixture}\nOPENROUTER_API_KEY=sk-or-v1-${"a".repeat(64)}\n`,
81 + "utf8",
82 + );
83 + const parsed = __test.parseDotenv("#x\nBAD\nA='one' trailing\nB=two # c\n");
84 + expect(parsed).toEqual([
85 + { key: "A", value: "one" },
86 + { key: "B", value: "two" },
87 + ]);
88 + const loaded = __test.loadDotenvValues(cwd);
89 + expect(loaded.values.map((item) => item.value)).toContain(fixture);
90 + expect(
91 + loaded.values.some((item) => item.labels[0].tag === "OPENROUTER_API_KEY"),
92 + ).toBe(true);
93 + expect(
94 + __test.learnedValueSpans(`${fixture} ${fixture}`, loaded.values),
95 + ).toHaveLength(2);
96 + });
98 + it("covers placeholder fallback and clear branches", () => {
99 + const store = new __test.PlaceholderStore({ digest: () => "xyz" });
100 + const placeholder = store.create(fixture, []);
101 + expect(placeholder).toBe("__LEAK_000000000000__");
102 + expect(store.restore(placeholder)).toBe(fixture);
103 + store.clear();
104 + expect(store.restore(placeholder)).toBe(placeholder);
106 + const collision = new __test.PlaceholderStore({
107 + digest: () => "abcdef123456",
108 + });
109 + collision.create("a", [label()]);
110 + collision.create("b", [label()]);
111 + expect(collision.create("c", [label()])).toBe(
112 + "__LEAK_TOKEN_abcdef123456_3__",
113 + );
114 + });
116 + it("covers selector invalid, placeholder, merge, and ranking branches", () => {
117 + const text = `x __LEAK_TOKEN_abcdef123456__ abcdef`;
118 + const spans = [
119 + span(-1, 2, "builtin"),
120 + span(2, 1, "builtin"),
121 + span(2, 99, "builtin"),
122 + { ...span(2, 10, "builtin"), value: "placeholder" },
123 + { ...span(31, 37, "builtin"), confidence: 99 },
124 + { ...span(31, 37, "custom"), labels: [label("CUSTOM", "custom")] },
125 + { ...span(31, 34, "structure"), value: "abc" },
126 + { ...span(34, 37, "jwt"), value: "def" },
127 + ];
128 + const selected = __test.selectSecretSpans(text, spans);
129 + expect(selected.map((item) => item.value)).toEqual(["abc"]);
130 + });
132 + it("covers settings branches", () => {
133 + expect(__test.loadLeaksSettings(null).settings.regex).toEqual([]);
134 + const loaded = __test.loadLeaksSettings({
135 + leaks: {
136 + regex: [null, { pattern: "x+", label: "OK", flags: "i", extra: true }],
137 + },
138 + });
139 + expect(loaded.settings.regex).toHaveLength(1);
140 + expect(loaded.warnings).toHaveLength(2);
142 + const compiled = __test.compileCustomRegex({
143 + regex: [
144 + { pattern: "", label: "A" },
145 + { pattern: "[", label: "A" },
146 + { pattern: "a".repeat(513), label: "A" },
147 + { pattern: "(a)(b)", label: "bad label" },
148 + { pattern: "(?<x>a)", label: "A" },
149 + { pattern: "a*", label: "A" },
150 + ],
151 + });
152 + expect(compiled.invalidRegexCount).toBe(4);
153 + expect(compiled.rules).toHaveLength(2);
154 + expect(__test.customRegexSpans("bbb", compiled.rules)).toHaveLength(0);
155 + expect(__test.countCaptures(String.raw`\(a)(b)(?:c)`)).toBe(1);
156 + });
158 + it("covers structure parser positive, negative, and fallback branches", () => {
159 + const full = [
161 + "eyJhbGciOiJIUzI1NiJ9",
162 + "eyJzdWIiOiIxMjM0NTY3ODkwIn0",
163 + "c2lnbmF0dXJl",
164 + ].join("."),
165 + `postgres://user:${fixture}@db/app`,
166 + `https://x.test/path?api_key=${fixture}`,
167 + `Authorization: Bearer ${fixture}`,
168 + `X-Api-Key: ${fixture}`,
169 + `Cookie: session=${fixture}`,
170 + `TOKEN=${fixture}`,
171 + `<password>${fixture}</password>`,
172 + ].join("\n");
173 + expect(__test.findStructureSpans(full).length).toBeGreaterThanOrEqual(8);
174 + expect(
175 + __test.findCookieSpans(`Cookie: session=${fixture}; flag`),
176 + ).toHaveLength(1);
177 + expect(__test.findSensitiveQuerySpans("?token=short")).toEqual([]);
178 + expect(__test.findHeaderSpans("Authorization: Digest abc")).toEqual([]);
179 + expect(
180 + __test.findCookieSpans("Cookie: flag; theme=dark; session=short"),
181 + ).toEqual([]);
182 + expect(
183 + __test.findAssignmentSpans(
184 + "TOKEN=true\nlineage=not-fixture-value-123456",
185 + ),
186 + ).toEqual([]);
187 + expect(
188 + __test.findCredentialedUrlSpans("postgres://user:short@db/app"),
189 + ).toEqual([]);
190 + expect(__test.findStructureSpans(`x-api-key: ${fixture}`)).toHaveLength(1);
191 + expect(__test.findJwtSpans("aaa.bbb.ccc")).toEqual([]);
192 + expect(
193 + __test.findPrivateKeySpans(
194 + "-----BEGIN CERTIFICATE-----x-----END CERTIFICATE-----",
195 + ),
196 + ).toEqual([]);
197 + expect(__test.isUnsafeRegex("abc[0-9]+")).toBe(false);
198 + });
200 + it("covers engine deep restore, cycles, depth, reload defaults, and detector failure", () => {
201 + const engine = new __test.LeaksEngine({ env: { TOKEN: fixture } });
202 + const redacted = engine.redactText(fixture, "provider");
203 + const nested: any = { a: redacted.text, b: [redacted.text] };
204 + nested.self = nested;
205 + const restored = engine.restoreDeep(nested);
206 + expect(restored.changed).toBe(true);
207 + expect(restored.count).toBe(2);
208 + expect(restored.value.self).toBe(restored.value);
210 + let deep: any = { value: "end" };
211 + for (let index = 0; index < 70; index++) deep = { deep };
212 + expect(engine.redactDeep(deep).changed).toBe(true);
213 + expect(
214 + engine
215 + .stats()
216 + .warnings.some((warning) => warning.code === "traversal.depth"),
217 + ).toBe(true);
218 + engine.reload();
220 + const failing = new __test.LeaksEngine({
221 + detectors: [
222 + () => {
223 + throw new Error("boom");
224 + },
225 + ],
226 + });
227 + expect(failing.redactText(fixture, "context").text).toBe(fixture);
228 + expect(failing.redactText(fixture, "provider").count).toBe(0);
229 + expect(
230 + failing
231 + .stats()
232 + .warnings.filter((warning) => warning.code === "detector.failure"),
233 + ).toHaveLength(1);
234 + });
235 +});
237 +describe("leaks pi edge coverage", () => {
238 + let t: TestSession | undefined;
239 + afterEach(() => {
240 + t?.dispose();
241 + t = undefined;
242 + });
244 + it("covers invalid settings, tool call without input, message restore, and usage", async () => {
245 + const cwd = temp();
246 + mkdirSync(path.join(cwd, ".pi"));
247 + writeFileSync(path.join(cwd, ".pi", "settings.json"), "{", "utf8");
248 + t = await createTestSession({
249 + cwd,
250 + extensions: [path.resolve(import.meta.dirname, "../index.ts")],
251 + });
252 + await t.session.extensionRunner.emit("tool_call", {});
253 + const provider = await t.session.extensionRunner.emitBeforeProviderRequest({
254 + text: `sk-or-v1-${"b".repeat(64)}`,
255 + });
256 + const message = await t.session.extensionRunner.emitMessageEnd({
257 + type: "message_end",
258 + message: {
259 + role: "assistant",
260 + content: [{ type: "text", text: provider.text }],
261 + },
262 + } as never);
263 + expect(JSON.stringify(message)).toContain("sk-or-v1-");
264 + const command =
265 + t.session.extensionRunner.extensions[0].commands.get("leaks");
266 + const ctx = t.session.extensionRunner.createContext();
267 + await command.handler("unknown", ctx);
268 + await command.handler("", ctx);
269 + const notices = t.events
270 + .uiCallsFor("notify")
271 + .map((call) => String(call.args[0]));
272 + expect(notices.some((notice) => notice.includes("usage: /leaks"))).toBe(
273 + true,
274 + );
275 + expect(notices.at(-1)).toContain("leaks on");
276 + });
277 +});

extensions/leaks/__tests__/pi-direct.test.ts

Added
new file mode 100644
1 +import { mkdirSync, mkdtempSync, writeFileSync } from "node:fs";
2 +import { tmpdir } from "node:os";
3 +import path from "node:path";
4 +import { describe, expect, it } from "vitest";
5 +import leaks from "../src/pi.ts";
7 +type Handler = (event: any, ctx: any) => unknown | Promise<unknown>;
9 +function temp() {
10 + return mkdtempSync(path.join(tmpdir(), "leaks-pi-direct-"));
13 +function fakePi() {
14 + const handlers = new Map<string, Handler>();
15 + const commands = new Map<string, { handler: Handler }>();
16 + return {
17 + handlers,
18 + commands,
19 + pi: {
20 + on(name: string, handler: Handler) {
21 + handlers.set(name, handler);
22 + },
23 + registerCommand(name: string, command: { handler: Handler }) {
24 + commands.set(name, command);
25 + },
26 + },
27 + };
30 +function ui(confirm = true) {
31 + const notices: string[] = [];
32 + const statuses: string[] = [];
33 + return {
34 + notices,
35 + statuses,
36 + ctx: {
37 + hasUI: true,
38 + cwd: temp(),
39 + ui: {
40 + setStatus(_key: string, text: string) {
41 + statuses.push(text);
42 + },
43 + notify(text: string) {
44 + notices.push(text);
45 + },
46 + async confirm() {
47 + return confirm;
48 + },
49 + },
50 + },
51 + };
54 +describe("leaks direct Pi hooks", () => {
55 + it("covers hooks and commands with and without UI", async () => {
56 + const runtime = fakePi();
57 + leaks(runtime.pi as never);
58 + const secret = "sk-or-v1-" + "9".repeat(64);
59 + const view = ui(false);
60 + mkdirSync(path.join(view.ctx.cwd, ".pi"));
61 + writeFileSync(path.join(view.ctx.cwd, ".pi", "settings.json"), "{", "utf8");
63 + await runtime.handlers.get("session_start")?.({}, view.ctx);
64 + expect(view.statuses.at(-1)).toContain("leaks on");
65 + await runtime.handlers.get("session_start")?.(
66 + {},
67 + { ...view.ctx, hasUI: false },
68 + );
69 + await runtime.handlers.get("session_start")?.(
70 + {},
71 + { ...view.ctx, cwd: temp() },
72 + );
74 + const context = await runtime.handlers.get("context")?.(
75 + { messages: [{ content: secret }] },
76 + view.ctx,
77 + );
78 + expect(JSON.stringify(context)).not.toContain(secret);
79 + const providerClean = await runtime.handlers.get(
80 + "before_provider_request",
81 + )?.({ payload: { text: "clean" } }, view.ctx);
82 + expect(providerClean).toEqual({ text: "clean" });
83 + const provider = await runtime.handlers.get("before_provider_request")?.(
84 + { payload: { text: secret } },
85 + view.ctx,
86 + );
87 + expect(JSON.stringify(provider)).not.toContain(secret);
88 + expect(view.notices.some((notice) => notice.includes("redacted"))).toBe(
89 + true,
90 + );
91 + await runtime.handlers.get("before_provider_request")?.(
92 + { payload: { text: secret } },
93 + { ...view.ctx, hasUI: false },
94 + );
96 + const placeholder =
97 + JSON.stringify(provider).match(/__LEAK_[A-Z0-9_]+_[a-f0-9]{12}__/)?.[0] ??
98 + "";
99 + const toolEvent = { input: { value: placeholder } };
100 + await runtime.handlers.get("tool_call")?.(toolEvent, view.ctx);
101 + expect(toolEvent.input.value).toBe(secret);
102 + await runtime.handlers.get("tool_call")?.({}, view.ctx);
103 + const message = await runtime.handlers.get("message_end")?.(
104 + { message: placeholder },
105 + view.ctx,
106 + );
107 + expect(message).toEqual({ message: secret });
109 + const command = runtime.commands.get("leaks");
110 + if (!command) throw new Error("missing leaks command");
111 + await command.handler("", view.ctx);
112 + await command.handler("status", view.ctx);
113 + await command.handler("reload", view.ctx);
114 + await command.handler("test " + secret, view.ctx);
115 + await command.handler("clear", view.ctx);
116 + const confirmed = ui(true);
117 + await command.handler("clear", confirmed.ctx);
118 + await command.handler("clear", { ...view.ctx, hasUI: false });
119 + await command.handler("nope", view.ctx);
120 + expect(view.notices.join("\n")).not.toContain(secret);
121 + expect(
122 + view.notices.some((notice) => notice.includes("clear cancelled")),
123 + ).toBe(true);
124 + expect(
125 + view.notices.some((notice) => notice.includes("usage: /leaks")),
126 + ).toBe(true);
127 + });
128 +});

extensions/leaks/__tests__/real/minimax.test.ts

Added
new file mode 100644
1 +import { spawn } from "node:child_process";
2 +import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
3 +import { tmpdir } from "node:os";
4 +import path from "node:path";
5 +import { describe, expect, it } from "vitest";
7 +const real = process.env.LEAKS_REAL === "1";
8 +const d = real ? describe : describe.skip;
9 +const timeout = 120_000;
10 +const extensionPath = path.resolve(import.meta.dirname, "../../index.ts");
11 +const piBinary = process.env.LEAKS_REAL_PI?.trim() || "/usr/bin/pi";
13 +async function ask(cwd: string, prompt: string) {
14 + const model = process.env.LEAKS_REAL_MODEL?.trim();
15 + const args = [
16 + "-p",
17 + "--approve",
18 + "--offline",
19 + "--no-session",
20 + "--no-extensions",
21 + "--no-skills",
22 + "--no-prompt-templates",
23 + "--no-themes",
24 + "--no-context-files",
25 + "--no-tools",
26 + "-e",
27 + extensionPath,
28 + "--thinking",
29 + "off",
30 + ];
31 + if (model) args.push("--model", model);
32 + args.push(prompt);
33 + return (await runPi(cwd, args)).trim().toUpperCase();
36 +async function runPi(cwd: string, args: string[]) {
37 + return await new Promise<string>((resolve, reject) => {
38 + const child = spawn(piBinary, args, {
39 + cwd,
40 + stdio: ["ignore", "pipe", "pipe"],
41 + });
42 + let stdout = "";
43 + let stderr = "";
44 + let settled = false;
45 + const done = (error?: Error) => {
46 + if (settled) return;
47 + settled = true;
48 + clearTimeout(timer);
49 + if (error) reject(error);
50 + else resolve(stdout);
51 + };
52 + const timer = setTimeout(() => {
53 + child.kill("SIGTERM");
54 + done(new Error("pi real validation timed out"));
55 + }, timeout);
56 + child.stdout.setEncoding("utf8");
57 + child.stderr.setEncoding("utf8");
58 + child.stdout.on("data", (chunk) => {
59 + stdout += chunk;
60 + });
61 + child.stderr.on("data", (chunk) => {
62 + stderr += chunk;
63 + });
64 + child.on("error", done);
65 + child.on("close", (code, signal) => {
66 + if (code === 0) done();
67 + else done(new Error(`pi exited ${code ?? signal}: ${stderr}`));
68 + });
69 + });
72 +async function withProject<T>(fn: (cwd: string) => Promise<T>) {
73 + const cwd = mkdtempSync(path.join(tmpdir(), "leaks-real-"));
74 + try {
75 + return await fn(cwd);
76 + } finally {
77 + rmSync(cwd, { recursive: true, force: true });
78 + }
81 +function expectNo(answer: string) {
82 + expect(answer).toContain("NO");
83 + expect(answer).not.toContain("YES");
86 +d("real provider redaction", () => {
87 + it(
88 + "redacts built-in provider token shape before a real request",
89 + async () => {
90 + await withProject(async (cwd) => {
91 + const value = `sk-or-v1-${"1".repeat(64)}`;
92 + const answer = await ask(
93 + cwd,
94 + `Look only at bracket content. Does it start with sk-or-v1-? Answer exactly YES or NO. [${value}]`,
95 + );
96 + expectNo(answer);
97 + });
98 + },
99 + timeout,
100 + );
102 + it(
103 + "learns fixed dotenv values before a real request",
104 + async () => {
105 + await withProject(async (cwd) => {
106 + const value = ["DENV", "real", "fixture", "123456789"].join("-");
107 + writeFileSync(path.join(cwd, ".env"), `TOKEN=${value}\n`, "utf8");
108 + const answer = await ask(
109 + cwd,
110 + `Look only at bracket content. Does it start with DENV-? Answer exactly YES or NO. [${value}]`,
111 + );
112 + expectNo(answer);
113 + });
114 + },
115 + timeout,
116 + );
118 + it(
119 + "applies spec custom regex before a real request",
120 + async () => {
121 + await withProject(async (cwd) => {
122 + const value = `foo_${"A".repeat(32)}`;
123 + mkdirSync(path.join(cwd, ".pi"), { recursive: true });
124 + writeFileSync(
125 + path.join(cwd, ".pi", "settings.json"),
126 + JSON.stringify({
127 + leaks: {
128 + regex: [{ pattern: "foo_[A-Za-z0-9]{32}", label: "FOO_TOKEN" }],
129 + },
130 + }),
131 + "utf8",
132 + );
133 + const answer = await ask(
134 + cwd,
135 + `Look only at bracket content. Does it start with foo_? Answer exactly YES or NO. [${value}]`,
136 + );
137 + expectNo(answer);
138 + });
139 + },
140 + timeout,
141 + );
142 +});

extensions/leaks/__tests__/safety-direct.test.ts

Added
new file mode 100644
1 +import { describe, expect, it } from "vitest";
2 +import { isWeakValue } from "../src/safety.ts";
4 +describe("leaks safety direct branch returns", () => {
5 + it("returns true for boolean words and numbers", () => {
6 + expect(isWeakValue("undefined")).toBe(true);
7 + expect(isWeakValue("12345678")).toBe(true);
8 + });
9 +});

extensions/leaks/package.json

Modified
5 5 "name": "@bugabinga/pi-ext-leaks",
6 6 "description": "Provider-bound secret redaction for Pi.",
7 7 "type": "module",
8 8 "main": "index.ts",
9 9 "scripts": {
10 - "test:real": "LEAKS_REAL=1 vitest run ./__tests__/real/*.test.ts --timeout 120000"
10 + "test:coverage": "cd ../.. && vitest run extensions/leaks/__tests__ --coverage --config extensions/leaks/vitest.coverage.config.ts",
11 + "test:real": "cd ../.. && LEAKS_REAL=1 vitest run extensions/leaks/__tests__/real/*.test.ts --test-timeout 120000"
12 13 "keywords": [
13 14 "pi",

extensions/leaks/src/detectors.ts

Modified
5 5 tag: string;
6 6 family: string;
7 7 regex: RegExp;
8 - group?: number;
9 - kind?: SecretSpan["kind"];
10 - wholeSpan?: boolean;
8 + group: number;
9 + kind: SecretSpan["kind"];
10 + wholeSpan: boolean;
13 13 export const builtinRules: BuiltinRule[] = [
121 121 for (const item of builtinRules) {
122 122 item.regex.lastIndex = 0;
123 123 for (const match of text.matchAll(item.regex)) {
124 - const group = item.group ?? 0;
125 - const value = match[group] ?? "";
126 - const range = match.indices?.[group];
127 - if (!range || value.length === 0) continue;
124 + const value = match[item.group] as string;
125 + const range = match.indices?.[item.group] as [number, number];
128 126 spans.push({
129 127 start: range[0],
130 128 end: range[1],
131 129 value,
132 130 labels: [label(item.tag)],
133 - kind: item.kind ?? "builtin",
131 + kind: item.kind,
134 132 confidence: item.wholeSpan ? 100 : 90,
135 - wholeSpan: item.wholeSpan ?? false,
133 + wholeSpan: item.wholeSpan,

extensions/leaks/src/dotenv.ts

Modified
71 71 line = line.replace(/^export\s+/, "");
72 72 const match = /^([A-Za-z_][A-Za-z0-9_-]*)\s*=\s*(.*)$/.exec(line);
73 73 if (!match) continue;
74 - let value = match[2] ?? "";
74 + let value = match[2] as string;
76 76 (value.startsWith("'") && value.includes("'", 1)) ||
77 77 (value.startsWith('"') && value.includes('"', 1))

extensions/leaks/src/engine.ts

Modified
57 57 reload(cwd = process.cwd(), settings = this.settings, env = process.env) {
58 - this.settings = { regex: settings.regex ?? [] };
58 + this.settings = { regex: settings.regex };
59 59 this.compileSettings();
60 60 this.learn(cwd, env);

extensions/leaks/src/selector.ts

Modified
15 15 text: string,
16 16 spans: SecretSpan[],
17 17 ): SecretSpan[] {
18 - const placeholderRanges = [...text.matchAll(PLACEHOLDER_RE)].map((match) => ({
19 - start: match.index ?? 0,
20 - end: (match.index ?? 0) + match[0].length,
21 - }));
18 + const placeholderRanges = [...text.matchAll(PLACEHOLDER_RE)].map((match) => {
19 + const start = match.index as number;
20 + return { start, end: start + match[0].length };
21 + });
22 22 const merged = new Map<string, SecretSpan>();
23 23 for (const span of spans) {
24 24 if (span.start < 0 || span.end <= span.start || span.end > text.length)

extensions/leaks/src/structures.ts

Modified
51 51 export function findSensitiveQuerySpans(text: string): SecretSpan[] {
52 52 const spans: SecretSpan[] = [];
53 53 for (const match of text.matchAll(QUERY_RE)) {
54 - const value = match[3] ?? "";
54 + const value = match[3] as string;
55 55 if (isWeakValue(value)) continue;
56 56 spans.push(
57 57 makeSpan(
58 58 match,
60 60 value,
61 - [label(match[2] ?? "QUERY_SECRET", "structure")],
61 + [label(match[2] as string, "structure")],
62 62 "structure",
82 82 export function findCookieSpans(text: string): SecretSpan[] {
83 83 const spans: SecretSpan[] = [];
84 84 for (const line of text.matchAll(COOKIE_LINE_RE)) {
85 - const body = line[1] ?? "";
86 - let offset = line.indices?.[1]?.[0] ?? 0;
85 + const body = line[1] as string;
86 + let offset = (line.indices?.[1] as [number, number])[0];
87 87 for (const part of body.split(";")) {
88 88 const trimmed = part.trim();
89 89 const eq = trimmed.indexOf("=");
117 117 for (const regex of [ASSIGN_RE, XML_RE]) {
118 118 regex.lastIndex = 0;
119 119 for (const match of text.matchAll(regex)) {
120 - const key = match[1] ?? "";
121 - const value = match[2] ?? "";
120 + const key = match[1] as string;
121 + const value = match[2] as string;
122 122 if (!isSensitiveKey(key)) continue;
123 123 if (isWeakValue(value) && !highConfidenceSecretShape(value)) continue;
124 124 spans.push(
132 132 export function findJwtSpans(text: string): SecretSpan[] {
133 133 return [...text.matchAll(JWT_RE)].map((match) => {
134 - const start = match.index ?? 0;
134 + const start = match.index as number;
135 135 return {
136 136 start,
137 137 end: start + match[0].length,
147 147 export function findPrivateKeySpans(text: string): SecretSpan[] {
148 148 return [...text.matchAll(PRIVATE_KEY_RE)].map((match) => {
149 - const start = match.index ?? 0;
149 + const start = match.index as number;
150 + const keyType = match[1] as string;
150 151 return {
151 152 start,
152 153 end: start + match[0].length,
153 154 value: match[0],
154 - labels: [
155 - label((match[1] ?? "PRIVATE KEY").replace(/ /g, "_"), "builtin"),
156 - ],
155 + labels: [label(keyType.replace(/ /g, "_"), "builtin")],
157 156 kind: "private-key",
158 157 confidence: 100,
159 158 wholeSpan: true,
171 170 regex.lastIndex = 0;
172 171 const spans: SecretSpan[] = [];
173 172 for (const match of text.matchAll(regex)) {
174 - const value = match[group] ?? "";
173 + const value = match[group] as string;
175 174 if (isWeakValue(value)) continue;
176 175 spans.push(
177 176 makeSpan(
178 177 match,
179 178 group,
180 179 value,
181 - [label(tag?.(match) ?? fallback, "structure")],
180 + [label(tag ? tag(match) : fallback, "structure")],
182 181 "structure",
193 192 labels: SpanLabel[],
194 193 kind: SecretSpan["kind"],
195 194 ): SecretSpan {
196 - const range = match.indices?.[group];
197 - const start = range?.[0] ?? 0;
195 + const range = match.indices?.[group] as [number, number];
196 + const start = range[0];
198 197 return {
199 198 start,
200 - end: range?.[1] ?? start + value.length,
199 + end: range[1],
201 200 value,
202 201 labels,

extensions/leaks/vitest.coverage.config.ts

Added
new file mode 100644
1 +import { defineConfig } from "vitest/config";
3 +export default defineConfig({
4 + test: {
5 + coverage: {
6 + provider: "istanbul",
7 + reporter: ["text", "json"],
8 + include: ["extensions/leaks/index.ts", "extensions/leaks/src/**/*.ts"],
9 + exclude: ["extensions/leaks/__tests__/**"],
10 + thresholds: {
11 + branches: 100,
12 + functions: 100,
13 + lines: 100,
14 + statements: 100,
15 + },
16 + },
17 + },
18 +});

package-lock.json

Modified
13 13 "devDependencies": {
14 14 "@playwright/test": "^1.60.0",
15 + "@vitest/coverage-istanbul": "^4.1.8",
15 16 "typescript": "^5.7.3",
16 17 "vitest": "^4.1.8"
187 188 "@earendil-works/pi-tui": "*"
191 + "extensions/mode": {
192 + "name": "@bugabinga/pi-ext-mode",
193 + "license": "MIT",
194 + "dependencies": {
195 + "yaml": "^2.9.0"
196 + },
197 + "devDependencies": {
198 + "@marcfargas/pi-test-harness": "^0.6.1",
199 + "vitest": "^4.1.8"
200 + },
201 + "peerDependencies": {
202 + "@earendil-works/pi-coding-agent": "*"
204 + },
190 205 "extensions/model-info": {
191 206 "name": "@bugabinga/pi-ext-model-info",
192 207 "license": "MIT",
924 939 "node": ">=18.0.0"
942 + "node_modules/@babel/code-frame": {
943 + "version": "7.29.7",
944 + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz",
945 + "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==",
946 + "dev": true,
947 + "license": "MIT",
948 + "dependencies": {
949 + "@babel/helper-validator-identifier": "^7.29.7",
950 + "js-tokens": "^4.0.0",
951 + "picocolors": "^1.1.1"
952 + },
953 + "engines": {
954 + "node": ">=6.9.0"
956 + },
957 + "node_modules/@babel/compat-data": {
958 + "version": "7.29.7",
959 + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz",
960 + "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==",
961 + "dev": true,
962 + "license": "MIT",
963 + "engines": {
964 + "node": ">=6.9.0"
966 + },
967 + "node_modules/@babel/core": {
968 + "version": "7.29.7",
969 + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.7.tgz",
970 + "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==",
971 + "dev": true,
972 + "license": "MIT",
973 + "dependencies": {
974 + "@babel/code-frame": "^7.29.7",
975 + "@babel/generator": "^7.29.7",
976 + "@babel/helper-compilation-targets": "^7.29.7",
977 + "@babel/helper-module-transforms": "^7.29.7",
978 + "@babel/helpers": "^7.29.7",
979 + "@babel/parser": "^7.29.7",
980 + "@babel/template": "^7.29.7",
981 + "@babel/traverse": "^7.29.7",
982 + "@babel/types": "^7.29.7",
983 + "@jridgewell/remapping": "^2.3.5",
984 + "convert-source-map": "^2.0.0",
985 + "debug": "^4.1.0",
986 + "gensync": "^1.0.0-beta.2",
987 + "json5": "^2.2.3",
988 + "semver": "^6.3.1"
989 + },
990 + "engines": {
991 + "node": ">=6.9.0"
992 + },
993 + "funding": {
994 + "type": "opencollective",
995 + "url": "https://opencollective.com/babel"
997 + },
998 + "node_modules/@babel/generator": {
999 + "version": "7.29.7",
1000 + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.7.tgz",
1001 + "integrity": "sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ==",
1002 + "dev": true,
1003 + "license": "MIT",
1004 + "dependencies": {
1005 + "@babel/parser": "^7.29.7",
1006 + "@babel/types": "^7.29.7",
1007 + "@jridgewell/gen-mapping": "^0.3.12",
1008 + "@jridgewell/trace-mapping": "^0.3.28",
1009 + "jsesc": "^3.0.2"
1010 + },
1011 + "engines": {
1012 + "node": ">=6.9.0"
1014 + },
1015 + "node_modules/@babel/helper-compilation-targets": {
1016 + "version": "7.29.7",
1017 + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz",
1018 + "integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==",
1019 + "dev": true,
1020 + "license": "MIT",
1021 + "dependencies": {
1022 + "@babel/compat-data": "^7.29.7",
1023 + "@babel/helper-validator-option": "^7.29.7",
1024 + "browserslist": "^4.24.0",
1025 + "lru-cache": "^5.1.1",
1026 + "semver": "^6.3.1"
1027 + },
1028 + "engines": {
1029 + "node": ">=6.9.0"
1031 + },
1032 + "node_modules/@babel/helper-globals": {
1033 + "version": "7.29.7",
1034 + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz",
1035 + "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==",
1036 + "dev": true,
1037 + "license": "MIT",
1038 + "engines": {
1039 + "node": ">=6.9.0"
1041 + },
1042 + "node_modules/@babel/helper-module-imports": {
1043 + "version": "7.29.7",
1044 + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz",
1045 + "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==",
1046 + "dev": true,
1047 + "license": "MIT",
1048 + "dependencies": {
1049 + "@babel/traverse": "^7.29.7",
1050 + "@babel/types": "^7.29.7"
1051 + },
1052 + "engines": {
1053 + "node": ">=6.9.0"
1055 + },
1056 + "node_modules/@babel/helper-module-transforms": {
1057 + "version": "7.29.7",
1058 + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz",
1059 + "integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==",
1060 + "dev": true,
1061 + "license": "MIT",
1062 + "dependencies": {
1063 + "@babel/helper-module-imports": "^7.29.7",
1064 + "@babel/helper-validator-identifier": "^7.29.7",
1065 + "@babel/traverse": "^7.29.7"
1066 + },
1067 + "engines": {
1068 + "node": ">=6.9.0"
1069 + },
1070 + "peerDependencies": {
1071 + "@babel/core": "^7.0.0"
1073 + },
1074 + "node_modules/@babel/helper-string-parser": {
1075 + "version": "7.29.7",
1076 + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz",
1077 + "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==",
1078 + "dev": true,
1079 + "license": "MIT",
1080 + "engines": {
1081 + "node": ">=6.9.0"
1083 + },
1084 + "node_modules/@babel/helper-validator-identifier": {
1085 + "version": "7.29.7",
1086 + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz",
1087 + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==",
1088 + "dev": true,
1089 + "license": "MIT",
1090 + "engines": {
1091 + "node": ">=6.9.0"
1093 + },
1094 + "node_modules/@babel/helper-validator-option": {
1095 + "version": "7.29.7",
1096 + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz",
1097 + "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==",
1098 + "dev": true,
1099 + "license": "MIT",
1100 + "engines": {
1101 + "node": ">=6.9.0"
1103 + },
1104 + "node_modules/@babel/helpers": {
1105 + "version": "7.29.7",
1106 + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.7.tgz",
1107 + "integrity": "sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==",
1108 + "dev": true,
1109 + "license": "MIT",
1110 + "dependencies": {
1111 + "@babel/template": "^7.29.7",
1112 + "@babel/types": "^7.29.7"
1113 + },
1114 + "engines": {
1115 + "node": ">=6.9.0"
1117 + },
1118 + "node_modules/@babel/parser": {
1119 + "version": "7.29.7",
1120 + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.7.tgz",
1121 + "integrity": "sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==",
1122 + "dev": true,
1123 + "license": "MIT",
1124 + "dependencies": {
1125 + "@babel/types": "^7.29.7"
1126 + },
1127 + "bin": {
1128 + "parser": "bin/babel-parser.js"
1129 + },
1130 + "engines": {
1131 + "node": ">=6.0.0"
1133 + },
927 1134 "node_modules/@babel/runtime": {
928 1135 "version": "7.29.7",
929 1136 "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.7.tgz",
934 1141 "node": ">=6.9.0"
1144 + "node_modules/@babel/template": {
1145 + "version": "7.29.7",
1146 + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz",
1147 + "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==",
1148 + "dev": true,
1149 + "license": "MIT",
1150 + "dependencies": {
1151 + "@babel/code-frame": "^7.29.7",
1152 + "@babel/parser": "^7.29.7",
1153 + "@babel/types": "^7.29.7"
1154 + },
1155 + "engines": {
1156 + "node": ">=6.9.0"
1158 + },
1159 + "node_modules/@babel/traverse": {
1160 + "version": "7.29.7",
1161 + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.7.tgz",
1162 + "integrity": "sha512-EhlfNQtZ+NK22w5BM61ciuiq1m58ed33Wr1Xan//ZRTy6hgjnwyCffRYwzsGXdASJSUJ1guZILsErh1eQcl+zw==",
1163 + "dev": true,
1164 + "license": "MIT",
1165 + "dependencies": {
1166 + "@babel/code-frame": "^7.29.7",
1167 + "@babel/generator": "^7.29.7",
1168 + "@babel/helper-globals": "^7.29.7",
1169 + "@babel/parser": "^7.29.7",
1170 + "@babel/template": "^7.29.7",
1171 + "@babel/types": "^7.29.7",
1172 + "debug": "^4.3.1"
1173 + },
1174 + "engines": {
1175 + "node": ">=6.9.0"
1177 + },
1178 + "node_modules/@babel/types": {
1179 + "version": "7.29.7",
1180 + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.7.tgz",
1181 + "integrity": "sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==",
1182 + "dev": true,
1183 + "license": "MIT",
1184 + "dependencies": {
1185 + "@babel/helper-string-parser": "^7.29.7",
1186 + "@babel/helper-validator-identifier": "^7.29.7"
1187 + },
1188 + "engines": {
1189 + "node": ">=6.9.0"
1191 + },
1192 + "node_modules/@bcoe/v8-coverage": {
1193 + "version": "1.0.2",
1194 + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-1.0.2.tgz",
1195 + "integrity": "sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==",
1196 + "dev": true,
1197 + "license": "MIT",
1198 + "optional": true,
1199 + "peer": true,
1200 + "engines": {
1201 + "node": ">=18"
1203 + },
937 1204 "node_modules/@bugabinga/pi-ext-angel": {
938 1205 "resolved": "extensions/angel",
939 1206 "link": true
990 1257 "resolved": "extensions/llmiterate",
991 1258 "link": true
1260 + "node_modules/@bugabinga/pi-ext-mode": {
1261 + "resolved": "extensions/mode",
1262 + "link": true
1263 + },
993 1264 "node_modules/@bugabinga/pi-ext-model-info": {
994 1265 "resolved": "extensions/model-info",
995 1266 "link": true
3394 + "node_modules/@istanbuljs/schema": {
3395 + "version": "0.1.6",
3396 + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.6.tgz",
3397 + "integrity": "sha512-+Sg6GCR/wy1oSmQDFq4LQDAhm3ETKnorxN+y5nbLULOR3P0c14f2Wurzj3/xqPXtasLFfHd5iRFQ7AJt4KH2cw==",
3398 + "dev": true,
3399 + "license": "MIT",
3400 + "engines": {
3401 + "node": ">=8"
3403 + },
3404 + "node_modules/@jridgewell/gen-mapping": {
3405 + "version": "0.3.13",
3406 + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
3407 + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==",
3408 + "dev": true,
3409 + "license": "MIT",
3410 + "dependencies": {
3411 + "@jridgewell/sourcemap-codec": "^1.5.0",
3412 + "@jridgewell/trace-mapping": "^0.3.24"
3414 + },
3415 + "node_modules/@jridgewell/remapping": {
3416 + "version": "2.3.5",
3417 + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz",
3418 + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==",
3419 + "dev": true,
3420 + "license": "MIT",
3421 + "dependencies": {
3422 + "@jridgewell/gen-mapping": "^0.3.5",
3423 + "@jridgewell/trace-mapping": "^0.3.24"
3425 + },
3426 + "node_modules/@jridgewell/resolve-uri": {
3427 + "version": "3.1.2",
3428 + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
3429 + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
3430 + "dev": true,
3431 + "license": "MIT",
3432 + "engines": {
3433 + "node": ">=6.0.0"
3435 + },
3123 3436 "node_modules/@jridgewell/sourcemap-codec": {
3124 3437 "version": "1.5.5",
3125 3438 "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz",
3127 3440 "dev": true,
3128 3441 "license": "MIT"
3443 + "node_modules/@jridgewell/trace-mapping": {
3444 + "version": "0.3.31",
3445 + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz",
3446 + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==",
3447 + "dev": true,
3448 + "license": "MIT",
3449 + "dependencies": {
3450 + "@jridgewell/resolve-uri": "^3.1.0",
3451 + "@jridgewell/sourcemap-codec": "^1.4.14"
3453 + },
3130 3454 "node_modules/@marcfargas/pi-test-harness": {
3131 3455 "version": "0.6.1",
3132 3456 "resolved": "https://registry.npmjs.org/@marcfargas/pi-test-harness/-/pi-test-harness-0.6.1.tgz",
3914 4238 "integrity": "sha512-mUFwbeTqrVgDQxFveS+df2yfap6iuP20NAKAsBt5jDEoOTDew+zwLAOilHCeQJOVSvmgCX4ogqIrA0mnyr08yQ==",
3915 4239 "license": "ISC"
4241 + "node_modules/@vitest/coverage-istanbul": {
4242 + "version": "4.1.8",
4243 + "resolved": "https://registry.npmjs.org/@vitest/coverage-istanbul/-/coverage-istanbul-4.1.8.tgz",
4244 + "integrity": "sha512-/h514nMZMKI6foh21mVgO1zlCH6pdDamwKMbla1uLU2GMxTlfp0PQMxovWozmzQdCIQYZ2XXEzg2zNZom2zAOg==",
4245 + "dev": true,
4246 + "license": "MIT",
4247 + "dependencies": {
4248 + "@babel/core": "^7.29.0",
4249 + "@istanbuljs/schema": "^0.1.3",
4250 + "@jridgewell/gen-mapping": "^0.3.13",
4251 + "@jridgewell/trace-mapping": "0.3.31",
4252 + "istanbul-lib-coverage": "^3.2.2",
4253 + "istanbul-lib-report": "^3.0.1",
4254 + "istanbul-reports": "^3.2.0",
4255 + "magicast": "^0.5.2",
4256 + "obug": "^2.1.1",
4257 + "tinyrainbow": "^3.1.0"
4258 + },
4259 + "funding": {
4260 + "url": "https://opencollective.com/vitest"
4261 + },
4262 + "peerDependencies": {
4263 + "vitest": "4.1.8"
4265 + },
4266 + "node_modules/@vitest/coverage-v8": {
4267 + "version": "4.1.8",
4268 + "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-4.1.8.tgz",
4269 + "integrity": "sha512-lt3kovsyHwYe00wq4D1ti0Z974fWj4NLp6siqiyEufUpyFwK9Yhi7rBhac9JL5aA0zoMrJqc4vYPZRUnI7l7nw==",
4270 + "dev": true,
4271 + "license": "MIT",
4272 + "optional": true,
4273 + "peer": true,
4274 + "dependencies": {
4275 + "@bcoe/v8-coverage": "^1.0.2",
4276 + "@vitest/utils": "4.1.8",
4277 + "ast-v8-to-istanbul": "^1.0.0",
4278 + "istanbul-lib-coverage": "^3.2.2",
4279 + "istanbul-lib-report": "^3.0.1",
4280 + "istanbul-reports": "^3.2.0",
4281 + "magicast": "^0.5.2",
4282 + "obug": "^2.1.1",
4283 + "std-env": "^4.0.0-rc.1",
4284 + "tinyrainbow": "^3.1.0"
4285 + },
4286 + "funding": {
4287 + "url": "https://opencollective.com/vitest"
4288 + },
4289 + "peerDependencies": {
4290 + "@vitest/browser": "4.1.8",
4291 + "vitest": "4.1.8"
4292 + },
4293 + "peerDependenciesMeta": {
4294 + "@vitest/browser": {
4295 + "optional": true
4298 + },
3917 4299 "node_modules/@vitest/expect": {
3918 4300 "version": "4.1.8",
3919 4301 "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.1.8.tgz",
4047 4429 "node": ">=12"
4432 + "node_modules/ast-v8-to-istanbul": {
4433 + "version": "1.0.4",
4434 + "resolved": "https://registry.npmjs.org/ast-v8-to-istanbul/-/ast-v8-to-istanbul-1.0.4.tgz",
4435 + "integrity": "sha512-0bC0/4bTSrnwdhU3IsZDwEdojvuPrSg59OYZfKsLRtJZ0u8VBx9DebfqqG8bRdCC0I7vjgxmPi41P0lpkhJHtA==",
4436 + "dev": true,
4437 + "license": "MIT",
4438 + "optional": true,
4439 + "peer": true,
4440 + "dependencies": {
4441 + "@jridgewell/trace-mapping": "^0.3.31",
4442 + "estree-walker": "^3.0.3",
4443 + "js-tokens": "^10.0.0"
4445 + },
4446 + "node_modules/ast-v8-to-istanbul/node_modules/js-tokens": {
4447 + "version": "10.0.0",
4448 + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-10.0.0.tgz",
4449 + "integrity": "sha512-lM/UBzQmfJRo9ABXbPWemivdCW8V2G8FHaHdypQaIy523snUjog0W71ayWXTjiR+ixeMyVHN2XcpnTd/liPg/Q==",
4450 + "dev": true,
4451 + "license": "MIT",
4452 + "optional": true,
4453 + "peer": true
4454 + },
4050 4455 "node_modules/base64-js": {
4051 4456 "version": "1.5.1",
4052 4457 "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
4068 4473 "license": "MIT",
4069 4474 "peer": true
4476 + "node_modules/baseline-browser-mapping": {
4477 + "version": "2.10.35",
4478 + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.35.tgz",
4479 + "integrity": "sha512-honAfLBde0HAFLdNyBEfuuENkF6zR+ozxqxa/2zJKHBe1qzLqyTSeRKpdPEHAP03rlDGyQOPnCSxnVpVqQo9Mg==",
4480 + "dev": true,
4481 + "license": "Apache-2.0",
4482 + "bin": {
4483 + "baseline-browser-mapping": "dist/cli.cjs"
4484 + },
4485 + "engines": {
4486 + "node": ">=6.0.0"
4488 + },
4071 4489 "node_modules/bignumber.js": {
4072 4490 "version": "9.3.1",
4073 4491 "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.3.1.tgz",
4085 4503 "license": "MIT",
4086 4504 "peer": true
4506 + "node_modules/browserslist": {
4507 + "version": "4.28.2",
4508 + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.2.tgz",
4509 + "integrity": "sha512-48xSriZYYg+8qXna9kwqjIVzuQxi+KYWp2+5nCYnYKPTr0LvD89Jqk2Or5ogxz0NUMfIjhh2lIUX/LyX9B4oIg==",
4510 + "dev": true,
4511 + "funding": [
4513 + "type": "opencollective",
4514 + "url": "https://opencollective.com/browserslist"
4515 + },
4517 + "type": "tidelift",
4518 + "url": "https://tidelift.com/funding/github/npm/browserslist"
4519 + },
4521 + "type": "github",
4522 + "url": "https://github.com/sponsors/ai"
4524 + ],
4525 + "license": "MIT",
4526 + "dependencies": {
4527 + "baseline-browser-mapping": "^2.10.12",
4528 + "caniuse-lite": "^1.0.30001782",
4529 + "electron-to-chromium": "^1.5.328",
4530 + "node-releases": "^2.0.36",
4531 + "update-browserslist-db": "^1.2.3"
4532 + },
4533 + "bin": {
4534 + "browserslist": "cli.js"
4535 + },
4536 + "engines": {
4537 + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
4539 + },
4088 4540 "node_modules/buffer-equal-constant-time": {
4089 4541 "version": "1.0.1",
4090 4542 "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz",
4092 4544 "license": "BSD-3-Clause",
4093 4545 "peer": true
4547 + "node_modules/caniuse-lite": {
4548 + "version": "1.0.30001797",
4549 + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001797.tgz",
4550 + "integrity": "sha512-l8xKG+gwAIExZGl9FrF7KUwuOmk6wbEPC9Xoy/RtnWv1XG0Q4LFlagaLpUv3Kiza3W/wm27zy0yWJEieYKAP6w==",
4551 + "dev": true,
4552 + "funding": [
4554 + "type": "opencollective",
4555 + "url": "https://opencollective.com/browserslist"
4556 + },
4558 + "type": "tidelift",
4559 + "url": "https://tidelift.com/funding/github/npm/caniuse-lite"
4560 + },
4562 + "type": "github",
4563 + "url": "https://github.com/sponsors/ai"
4565 + ],
4566 + "license": "CC-BY-4.0"
4567 + },
4095 4568 "node_modules/ccount": {
4096 4569 "version": "2.0.1",
4097 4570 "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz",
4164 4637 "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
4165 4638 "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
4166 4639 "license": "MIT",
4167 - "peer": true,
4168 4640 "dependencies": {
4169 4641 "ms": "^2.1.3"
4228 4700 "safe-buffer": "^5.0.1"
4703 + "node_modules/electron-to-chromium": {
4704 + "version": "1.5.371",
4705 + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.371.tgz",
4706 + "integrity": "sha512-e9htk9mAYL6AzmkEhSvVVw7IWGSBJ/Bqdn2eRyRLrj1g6sncN4WbFt5qnILYoCktktr45pyjIrOiRvBThQ808w==",
4707 + "dev": true,
4708 + "license": "ISC"
4709 + },
4231 4710 "node_modules/es-module-lexer": {
4232 4711 "version": "2.1.0",
4233 4712 "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.1.0.tgz",
4235 4714 "dev": true,
4236 4715 "license": "MIT"
4717 + "node_modules/escalade": {
4718 + "version": "3.2.0",
4719 + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",
4720 + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==",
4721 + "dev": true,
4722 + "license": "MIT",
4723 + "engines": {
4724 + "node": ">=6"
4726 + },
4238 4727 "node_modules/estree-walker": {
4239 4728 "version": "3.0.3",
4240 4729 "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz",
4401 4890 "node": ">=18"
4893 + "node_modules/gensync": {
4894 + "version": "1.0.0-beta.2",
4895 + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
4896 + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==",
4897 + "dev": true,
4898 + "license": "MIT",
4899 + "engines": {
4900 + "node": ">=6.9.0"
4902 + },
4404 4903 "node_modules/get-east-asian-width": {
4405 4904 "version": "1.6.0",
4406 4905 "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.6.0.tgz",
4442 4941 "node": ">=14"
4944 + "node_modules/has-flag": {
4945 + "version": "4.0.0",
4946 + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
4947 + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
4948 + "dev": true,
4949 + "license": "MIT",
4950 + "engines": {
4951 + "node": ">=8"
4953 + },
4445 4954 "node_modules/hast-util-to-html": {
4446 4955 "version": "9.0.5",
4447 4956 "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-9.0.5.tgz",
4478 4987 "url": "https://opencollective.com/unified"
4990 + "node_modules/html-escaper": {
4991 + "version": "2.0.2",
4992 + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz",
4993 + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==",
4994 + "dev": true,
4995 + "license": "MIT"
4996 + },
4481 4997 "node_modules/html-void-elements": {
4482 4998 "version": "3.0.0",
4483 4999 "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-3.0.0.tgz",
4526 5042 "node": ">= 4"
5045 + "node_modules/istanbul-lib-coverage": {
5046 + "version": "3.2.2",
5047 + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz",
5048 + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==",
5049 + "dev": true,
5050 + "license": "BSD-3-Clause",
5051 + "engines": {
5052 + "node": ">=8"
5054 + },
5055 + "node_modules/istanbul-lib-report": {
5056 + "version": "3.0.1",
5057 + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz",
5058 + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==",
5059 + "dev": true,
5060 + "license": "BSD-3-Clause",
5061 + "dependencies": {
5062 + "istanbul-lib-coverage": "^3.0.0",
5063 + "make-dir": "^4.0.0",
5064 + "supports-color": "^7.1.0"
5065 + },
5066 + "engines": {
5067 + "node": ">=10"
5069 + },
5070 + "node_modules/istanbul-reports": {
5071 + "version": "3.2.0",
5072 + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.2.0.tgz",
5073 + "integrity": "sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==",
5074 + "dev": true,
5075 + "license": "BSD-3-Clause",
5076 + "dependencies": {
5077 + "html-escaper": "^2.0.0",
5078 + "istanbul-lib-report": "^3.0.0"
5079 + },
5080 + "engines": {
5081 + "node": ">=8"
5083 + },
5084 + "node_modules/js-tokens": {
5085 + "version": "4.0.0",
5086 + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
5087 + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
5088 + "dev": true,
5089 + "license": "MIT"
5090 + },
5091 + "node_modules/jsesc": {
5092 + "version": "3.1.0",
5093 + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz",
5094 + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==",
5095 + "dev": true,
5096 + "license": "MIT",
5097 + "bin": {
5098 + "jsesc": "bin/jsesc"
5099 + },
5100 + "engines": {
5101 + "node": ">=6"
5103 + },
4529 5104 "node_modules/json-bigint": {
4530 5105 "version": "1.0.0",
4531 5106 "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz",
4550 5125 "node": ">=16"
5128 + "node_modules/json5": {
5129 + "version": "2.2.3",
5130 + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
5131 + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
5132 + "dev": true,
5133 + "license": "MIT",
5134 + "bin": {
5135 + "json5": "lib/cli.js"
5136 + },
5137 + "engines": {
5138 + "node": ">=6"
5140 + },
4553 5141 "node_modules/jwa": {
4554 5142 "version": "2.0.1",
4555 5143 "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.1.tgz",
4847 5435 "integrity": "sha512-I+lBvqMMFfqaV8CJCISjI3wbjmwVu/VyOoU7+qtu9d7ioW5klMgsTTiUOUp+DJvfTTzKXoPbyC6YfgkNcyPSOg==",
4848 5436 "license": "MIT"
5438 + "node_modules/lru-cache": {
5439 + "version": "5.1.1",
5440 + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
5441 + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
5442 + "dev": true,
5443 + "license": "ISC",
5444 + "dependencies": {
5445 + "yallist": "^3.0.2"
5447 + },
4850 5448 "node_modules/magic-string": {
4851 5449 "version": "0.30.21",
4852 5450 "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz",
4857 5455 "@jridgewell/sourcemap-codec": "^1.5.5"
5458 + "node_modules/magicast": {
5459 + "version": "0.5.3",
5460 + "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.5.3.tgz",
5461 + "integrity": "sha512-pVKE4UdSQ7DvHzivsCIFx2BJn1mHG6KsyrFcaxFx6tONdneEuThrDx0Cj3AMg58KyN4pzYT+LHOotxDQDjNvkw==",
5462 + "dev": true,
5463 + "license": "MIT",
5464 + "dependencies": {
5465 + "@babel/parser": "^7.29.3",
5466 + "@babel/types": "^7.29.0",
5467 + "source-map-js": "^1.2.1"
5469 + },
5470 + "node_modules/make-dir": {
5471 + "version": "4.0.0",
5472 + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz",
5473 + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==",
5474 + "dev": true,
5475 + "license": "MIT",
5476 + "dependencies": {
5477 + "semver": "^7.5.3"
5478 + },
5479 + "engines": {
5480 + "node": ">=10"
5481 + },
5482 + "funding": {
5483 + "url": "https://github.com/sponsors/sindresorhus"
5485 + },
5486 + "node_modules/make-dir/node_modules/semver": {
5487 + "version": "7.8.4",
5488 + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.4.tgz",
5489 + "integrity": "sha512-rUCObTnP32Q08R2uuIrt7r9PlEonuTmtuXYcW6s5kjdlj3xbnwe+21yXptAUYcMAABLkYYTtnmzb3w3EDZfueA==",
5490 + "dev": true,
5491 + "license": "ISC",
5492 + "bin": {
5493 + "semver": "bin/semver.js"
5494 + },
5495 + "engines": {
5496 + "node": ">=10"
5498 + },
4860 5499 "node_modules/marked": {
4861 5500 "version": "15.0.12",
4862 5501 "resolved": "https://registry.npmjs.org/marked/-/marked-15.0.12.tgz",
4984 5623 "version": "2.1.3",
4985 5624 "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
4986 5625 "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
4987 - "license": "MIT",
4988 - "peer": true
5626 + "license": "MIT"
4990 5628 "node_modules/nanoid": {
4991 5629 "version": "3.3.12",
5046 5684 "url": "https://opencollective.com/node-fetch"
5687 + "node_modules/node-releases": {
5688 + "version": "2.0.47",
5689 + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.47.tgz",
5690 + "integrity": "sha512-Uzmd6LXpouKo8EUK68IjH4+E01w/hXyV3R3g/geCJo+rXLNfh1xucB+LOzYEOQPSiUK3h/xZf0cQGcSsmyL2Og==",
5691 + "dev": true,
5692 + "license": "MIT",
5693 + "engines": {
5694 + "node": ">=18"
5696 + },
5049 5697 "node_modules/obug": {
5050 5698 "version": "2.1.2",
5051 5699 "resolved": "https://registry.npmjs.org/obug/-/obug-2.1.2.tgz",
5412 6060 "license": "MIT",
5413 6061 "peer": true
6063 + "node_modules/semver": {
6064 + "version": "6.3.1",
6065 + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
6066 + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
6067 + "dev": true,
6068 + "license": "ISC",
6069 + "bin": {
6070 + "semver": "bin/semver.js"
6072 + },
5415 6073 "node_modules/shiki": {
5416 6074 "version": "3.23.0",
5417 6075 "resolved": "https://registry.npmjs.org/shiki/-/shiki-3.23.0.tgz",
5496 6154 "license": "MIT",
5497 6155 "peer": true
6157 + "node_modules/supports-color": {
6158 + "version": "7.2.0",
6159 + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
6160 + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
6161 + "dev": true,
6162 + "license": "MIT",
6163 + "dependencies": {
6164 + "has-flag": "^4.0.0"
6165 + },
6166 + "engines": {
6167 + "node": ">=8"
6169 + },
5499 6170 "node_modules/tinybench": {
5500 6171 "version": "2.9.0",
5501 6172 "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz",
5659 6330 "url": "https://opencollective.com/unified"
6333 + "node_modules/update-browserslist-db": {
6334 + "version": "1.2.3",
6335 + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz",
6336 + "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==",
6337 + "dev": true,
6338 + "funding": [
6340 + "type": "opencollective",
6341 + "url": "https://opencollective.com/browserslist"
6342 + },
6344 + "type": "tidelift",
6345 + "url": "https://tidelift.com/funding/github/npm/browserslist"
6346 + },
6348 + "type": "github",
6349 + "url": "https://github.com/sponsors/ai"
6351 + ],
6352 + "license": "MIT",
6353 + "dependencies": {
6354 + "escalade": "^3.2.0",
6355 + "picocolors": "^1.1.1"
6356 + },
6357 + "bin": {
6358 + "update-browserslist-db": "cli.js"
6359 + },
6360 + "peerDependencies": {
6361 + "browserslist": ">= 4.21.0"
6363 + },
5662 6364 "node_modules/vfile": {
5663 6365 "version": "6.0.3",
5664 6366 "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz",
5920 6622 "node": ">=16.0.0"
6625 + "node_modules/yallist": {
6626 + "version": "3.1.1",
6627 + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
6628 + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
6629 + "dev": true,
6630 + "license": "ISC"
6631 + },
5923 6632 "node_modules/yaml": {
5924 6633 "version": "2.9.0",
5925 6634 "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz",
5926 6635 "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==",
5927 6636 "license": "ISC",
5928 - "peer": true,
5929 6637 "bin": {
5930 6638 "yaml": "bin.mjs"

package.json

Modified
18 18 "devDependencies": {
19 19 "@playwright/test": "^1.60.0",
20 + "@vitest/coverage-istanbul": "^4.1.8",
20 21 "typescript": "^5.7.3",
21 22 "vitest": "^4.1.8"