



























@@ -38,18 +38,14 @@ describe("buildBootstrapInjectionStats", () => {
3838 injectedFiles,
3939});
4040expect(stats).toHaveLength(2);
41-expect(stats[0]).toMatchObject({
42-name: "AGENTS.md",
43-rawChars: 100,
44-injectedChars: 100,
45-truncated: false,
46-});
47-expect(stats[1]).toMatchObject({
48-name: "SOUL.md",
49-rawChars: 50,
50-injectedChars: 20,
51-truncated: true,
52-});
41+expect(stats[0]?.name).toBe("AGENTS.md");
42+expect(stats[0]?.rawChars).toBe(100);
43+expect(stats[0]?.injectedChars).toBe(100);
44+expect(stats[0]?.truncated).toBe(false);
45+expect(stats[1]?.name).toBe("SOUL.md");
46+expect(stats[1]?.rawChars).toBe(50);
47+expect(stats[1]?.injectedChars).toBe(20);
48+expect(stats[1]?.truncated).toBe(true);
5349});
5450});
5551@@ -213,18 +209,23 @@ describe("bootstrap prompt warnings", () => {
213209expect(first.warningShown).toBe(true);
214210expect(first.signature).toBeTypeOf("string");
215211expect(first.signature).not.toBe("");
216-expect(JSON.parse(first.signature ?? "{}")).toMatchObject({
217-bootstrapMaxChars: 120,
218-bootstrapTotalMaxChars: 200,
219-files: [
220-{
221-path: "/tmp/AGENTS.md",
222-rawChars: 150,
223-injectedChars: 100,
224-causes: ["per-file-limit"],
225-},
226-],
227-});
212+const signature = JSON.parse(first.signature ?? "{}") as {
213+bootstrapMaxChars?: unknown;
214+bootstrapTotalMaxChars?: unknown;
215+files?: Array<{
216+path?: unknown;
217+rawChars?: unknown;
218+injectedChars?: unknown;
219+causes?: unknown;
220+}>;
221+};
222+expect(signature.bootstrapMaxChars).toBe(120);
223+expect(signature.bootstrapTotalMaxChars).toBe(200);
224+expect(signature.files).toHaveLength(1);
225+expect(signature.files?.[0]?.path).toBe("/tmp/AGENTS.md");
226+expect(signature.files?.[0]?.rawChars).toBe(150);
227+expect(signature.files?.[0]?.injectedChars).toBe(100);
228+expect(signature.files?.[0]?.causes).toStrictEqual(["per-file-limit"]);
228229expect(first.lines.join("\n")).toContain("AGENTS.md");
229230230231const second = buildBootstrapPromptWarning({
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。