refactor(core): extract shared dedup helpers
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
/**
|
||||
* Test: after_tool_call hook wiring (pi-embedded-subscribe.handlers.tools.ts)
|
||||
*/
|
||||
import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { createBaseToolHandlerState } from "../agents/pi-tool-handler-state.test-helpers.js";
|
||||
|
||||
const hookMocks = vi.hoisted(() => ({
|
||||
runner: {
|
||||
@@ -38,17 +39,7 @@ function createToolHandlerCtx(params: {
|
||||
},
|
||||
state: {
|
||||
toolMetaById: new Map<string, string | undefined>(),
|
||||
toolMetas: [] as Array<{ toolName?: string; meta?: string }>,
|
||||
toolSummaryById: new Set<string>(),
|
||||
lastToolError: undefined,
|
||||
pendingMessagingTexts: new Map<string, string>(),
|
||||
pendingMessagingTargets: new Map<string, unknown>(),
|
||||
pendingMessagingMediaUrls: new Map<string, string[]>(),
|
||||
messagingToolSentTexts: [] as string[],
|
||||
messagingToolSentTextsNormalized: [] as string[],
|
||||
messagingToolSentMediaUrls: [] as string[],
|
||||
messagingToolSentTargets: [] as unknown[],
|
||||
blockBuffer: "",
|
||||
...createBaseToolHandlerState(),
|
||||
},
|
||||
log: { debug: vi.fn(), warn: vi.fn() },
|
||||
flushBlockReplyBuffer: vi.fn(),
|
||||
|
||||
Reference in New Issue
Block a user