mirror of https://github.com/openclaw/openclaw.git
fix: resolve pi-tools typing regressions
This commit is contained in:
parent
2380c1b5fd
commit
6ab9e00e17
|
|
@ -75,10 +75,14 @@ export function createPluginRuntimeMock(overrides: DeepPartial<PluginRuntime> =
|
|||
chunkMarkdownTextWithMode: vi.fn((text: string) => (text ? [text] : [])),
|
||||
chunkText: vi.fn((text: string) => (text ? [text] : [])),
|
||||
chunkTextWithMode: vi.fn((text: string) => (text ? [text] : [])),
|
||||
resolveChunkMode: vi.fn(() => "length"),
|
||||
resolveChunkMode: vi.fn(
|
||||
() => "length",
|
||||
) as unknown as PluginRuntime["channel"]["text"]["resolveChunkMode"],
|
||||
resolveTextChunkLimit: vi.fn(() => 4000),
|
||||
hasControlCommand: vi.fn(() => false),
|
||||
resolveMarkdownTableMode: vi.fn(() => "code"),
|
||||
resolveMarkdownTableMode: vi.fn(
|
||||
() => "code",
|
||||
) as unknown as PluginRuntime["channel"]["text"]["resolveMarkdownTableMode"],
|
||||
convertMarkdownTables: vi.fn((text: string) => text),
|
||||
},
|
||||
reply: {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
import fs from "node:fs/promises";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import type { EditToolOptions } from "@mariozechner/pi-coding-agent";
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
const mocks = vi.hoisted(() => ({
|
||||
|
|
@ -16,7 +17,7 @@ vi.mock("@mariozechner/pi-coding-agent", async (importOriginal) => {
|
|||
const actual = await importOriginal<typeof import("@mariozechner/pi-coding-agent")>();
|
||||
return {
|
||||
...actual,
|
||||
createEditTool: (cwd: string, options?: { operations?: unknown }) => {
|
||||
createEditTool: (cwd: string, options?: EditToolOptions) => {
|
||||
const base = actual.createEditTool(cwd, options);
|
||||
return {
|
||||
...base,
|
||||
|
|
|
|||
Loading…
Reference in New Issue