chore(deps): update runtime and development packages

This commit is contained in:
Federico Jaramillo Martinez
2026-07-10 22:10:40 +02:00
parent abcf44b962
commit 32907bba5f
9 changed files with 1140 additions and 1326 deletions
@@ -64,9 +64,10 @@ describe("selectable row activation", () => {
type EventWithPath = Pick<Event, "composedPath">;
type KeyboardEventWithPath = EventWithPath & Pick<KeyboardEvent, "key" | "preventDefault" | "stopPropagation">;
type MatchTarget = EventTarget & Pick<Element, "matches">;
type MatchTarget = EventTarget & { matches: (selector: string) => boolean };
type MatchPredicate = (selector: string) => boolean;
function matchTarget(matches: Element["matches"]): MatchTarget {
function matchTarget(matches: MatchPredicate): MatchTarget {
return Object.assign(new EventTarget(), { matches });
}
+1
View File
@@ -0,0 +1 @@
/// <reference types="vite/client" />
+6 -3
View File
@@ -54,8 +54,11 @@ function sessionRef(id: string, cwd = "/workspace") {
return { id, cwd };
}
const TEST_MODEL_PROVIDER = "anthropic";
const TEST_MODEL_ID = "claude-sonnet-4-5-20250929";
function testModel(): NonNullable<PiAgentSession["model"]> {
const model = ModelRegistry.inMemory(AuthStorage.inMemory()).find("anthropic", "claude-3-5-sonnet-20241022");
const model = ModelRegistry.inMemory(AuthStorage.inMemory()).find(TEST_MODEL_PROVIDER, TEST_MODEL_ID);
if (model === undefined) throw new Error("test model not found");
return model;
}
@@ -1142,7 +1145,7 @@ describe("PiSessionService", () => {
const hub = new CapturingSessionEventHub();
const authStorage = AuthStorage.inMemory({ anthropic: { type: "api_key", key: "sk-test" } });
const modelRegistry = ModelRegistry.inMemory(authStorage);
const model = modelRegistry.find("anthropic", "claude-3-5-sonnet-20241022");
const model = modelRegistry.find(TEST_MODEL_PROVIDER, TEST_MODEL_ID);
if (model === undefined) throw new Error("Expected Anthropic model fixture");
const fake = fakeRuntime("auth-session", { model, modelRegistry });
@@ -1161,7 +1164,7 @@ describe("PiSessionService", () => {
service.applyAuthChange({ removedProviderId: "anthropic" });
service.applyAuthChange({ removedProviderId: "anthropic" });
const warningCount = () => hub.sessionEvents.filter(({ event }) => event.type === "command.output" && event.level === "error" && event.message.includes("anthropic/claude-3-5-sonnet-20241022")).length;
const warningCount = () => hub.sessionEvents.filter(({ event }) => event.type === "command.output" && event.level === "error" && event.message.includes(`${TEST_MODEL_PROVIDER}/${TEST_MODEL_ID}`)).length;
expect(warningCount()).toBe(1);
expect(hub.globalEvents.some((event) => event.type === "status.update" && event.status.sessionId === "auth-session")).toBe(true);
+7 -6
View File
@@ -30,14 +30,14 @@ describe("thinkingLevels", () => {
const known = KNOWN_THINKING_LEVELS;
it("derives bar count from the available set (excluding the off level)", () => {
// 6 known levels => 5 bars.
expect(thinkingGauge("off", known).total).toBe(5);
// 7 known levels => 6 bars.
expect(thinkingGauge("off", known).total).toBe(6);
expect(thinkingGauge("off", ["off", "low", "high"]).total).toBe(2);
});
it("treats the first level as no thinking (0 filled)", () => {
expect(thinkingGauge("off", known)).toEqual({ total: 5, filled: 0 });
expect(thinkingGauge(undefined, known)).toEqual({ total: 5, filled: 0 });
expect(thinkingGauge("off", known)).toEqual({ total: 6, filled: 0 });
expect(thinkingGauge(undefined, known)).toEqual({ total: 6, filled: 0 });
});
it("fills up to the current level's rank", () => {
@@ -46,6 +46,7 @@ describe("thinkingLevels", () => {
expect(thinkingGauge("medium", known).filled).toBe(3);
expect(thinkingGauge("high", known).filled).toBe(4);
expect(thinkingGauge("xhigh", known).filled).toBe(5);
expect(thinkingGauge("max", known).filled).toBe(6);
});
it("adapts to a runtime-provided set of a different size", () => {
@@ -56,8 +57,8 @@ describe("thinkingLevels", () => {
});
it("falls back to the known set when no usable available set is given", () => {
expect(thinkingGauge("high", [])).toEqual({ total: 5, filled: 4 });
expect(thinkingGauge("high", ["only-one"])).toEqual({ total: 5, filled: 4 });
expect(thinkingGauge("high", [])).toEqual({ total: 6, filled: 4 });
expect(thinkingGauge("high", ["only-one"])).toEqual({ total: 6, filled: 4 });
});
it("fills 0 for an unknown current level instead of throwing", () => {
+1 -1
View File
@@ -13,7 +13,7 @@ export type { ThinkingLevel };
* either breaks, update this list and give the new level a label/description
* where thinking levels are presented.
*/
export const KNOWN_THINKING_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh"] as const satisfies readonly ThinkingLevel[];
export const KNOWN_THINKING_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh", "max"] as const satisfies readonly ThinkingLevel[];
export function isKnownThinkingLevel(value: string): value is ThinkingLevel {
return KNOWN_THINKING_LEVELS.some((level) => level === value);