From 524203921995857e33ad1143635fdbdef8579c90 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Fri, 24 Apr 2026 05:59:49 +0700 Subject: [PATCH] chore(lint): no-explicit-any in snapshot-mutation-ownership.test --- .../snapshot-mutation-ownership.test.ts | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/packages/server/src/server/snapshot-mutation-ownership.test.ts b/packages/server/src/server/snapshot-mutation-ownership.test.ts index 1b2889934..5ce991d40 100644 --- a/packages/server/src/server/snapshot-mutation-ownership.test.ts +++ b/packages/server/src/server/snapshot-mutation-ownership.test.ts @@ -4,8 +4,19 @@ import { mkdtempSync, rmSync } from "node:fs"; import { afterEach, describe, expect, test, vi } from "vitest"; import { Session } from "./session.js"; +import type { SessionOptions } from "./session.js"; import { createTestPaseoDaemon } from "./test-utils/paseo-daemon.js"; +interface SessionInternals { + archiveAgentForClose(agentId: string): Promise<{ archivedAt: string }>; + handleUpdateAgentRequest( + agentId: string, + title: string, + labels: Record, + requestId: string, + ): Promise; +} + describe("snapshot mutation ownership boundary", () => { afterEach(() => { vi.restoreAllMocks(); @@ -82,9 +93,9 @@ describe("snapshot mutation ownership boundary", () => { const session = new Session({ clientId: "test-client", onMessage, - logger: logger as any, - downloadTokenStore: {} as any, - pushTokenStore: {} as any, + logger: logger as unknown as SessionOptions["logger"], + downloadTokenStore: {} as unknown as SessionOptions["downloadTokenStore"], + pushTokenStore: {} as unknown as SessionOptions["pushTokenStore"], paseoHome: "/tmp/paseo-test", agentManager: { subscribe: () => () => {}, @@ -92,13 +103,13 @@ describe("snapshot mutation ownership boundary", () => { getAgent: () => null, archiveSnapshot, updateAgentMetadata, - } as any, + } as unknown as SessionOptions["agentManager"], agentStorage: { list: async () => [], get: async () => storedRecord, applySnapshot: directStorageWrite, upsert: directStorageWrite, - } as any, + } as unknown as SessionOptions["agentStorage"], projectRegistry: { initialize: async () => {}, existsOnDisk: async () => true, @@ -107,7 +118,7 @@ describe("snapshot mutation ownership boundary", () => { upsert: async () => {}, archive: async () => {}, remove: async () => {}, - } as any, + } as unknown as SessionOptions["projectRegistry"], workspaceRegistry: { initialize: async () => {}, existsOnDisk: async () => true, @@ -116,14 +127,14 @@ describe("snapshot mutation ownership boundary", () => { upsert: async () => {}, archive: async () => {}, remove: async () => {}, - } as any, + } as unknown as SessionOptions["workspaceRegistry"], createAgentMcpTransport: async () => { throw new Error("not used"); }, stt: null, tts: null, terminalManager: null, - }) as any; + }) as unknown as SessionInternals; const archiveResult = await session.archiveAgentForClose("agent-1"); expect(archiveSnapshot).toHaveBeenCalledTimes(1);