mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-28 02:21:15 +00:00
refactor(agents): remove duplicate session tool exports (#106828)
This commit is contained in:
committed by
GitHub
parent
b4343426f1
commit
821ec6da45
@@ -824,26 +824,10 @@ export const KNIP_UNUSED_EXPORT_BASELINE = [
|
||||
"src/agents/sessions/keybindings.ts: Keybinding",
|
||||
"src/agents/sessions/keybindings.ts: KEYBINDINGS",
|
||||
"src/agents/sessions/keybindings.ts: KeyId",
|
||||
"src/agents/sessions/messages.ts: BranchSummaryMessage",
|
||||
"src/agents/sessions/messages.ts: CompactionSummaryMessage",
|
||||
"src/agents/sessions/prompt-templates.ts: parseCommandArgs",
|
||||
"src/agents/sessions/prompt-templates.ts: substituteArgs",
|
||||
"src/agents/sessions/settings-manager.ts: CompactionSettings",
|
||||
"src/agents/sessions/tools/bash.ts: BashOperations",
|
||||
"src/agents/sessions/tools/bash.ts: BashToolDetails",
|
||||
"src/agents/sessions/tools/bash.ts: BashToolInput",
|
||||
"src/agents/sessions/tools/bash.ts: resolveBashTimeoutMs",
|
||||
"src/agents/sessions/tools/edit.ts: EditToolDetails",
|
||||
"src/agents/sessions/tools/edit.ts: EditToolInput",
|
||||
"src/agents/sessions/tools/find.ts: FindToolDetails",
|
||||
"src/agents/sessions/tools/find.ts: FindToolInput",
|
||||
"src/agents/sessions/tools/grep.ts: GrepToolDetails",
|
||||
"src/agents/sessions/tools/grep.ts: GrepToolInput",
|
||||
"src/agents/sessions/tools/ls.ts: LsToolDetails",
|
||||
"src/agents/sessions/tools/ls.ts: LsToolInput",
|
||||
"src/agents/sessions/tools/read.ts: ReadToolDetails",
|
||||
"src/agents/sessions/tools/read.ts: ReadToolInput",
|
||||
"src/agents/sessions/tools/write.ts: WriteToolInput",
|
||||
"src/agents/shell-snapshot.ts: resetShellSnapshotCacheForTests",
|
||||
"src/agents/shell-snapshot.ts: resolveShellSnapshotDir",
|
||||
"src/agents/shell-utils.ts: getPosixShellArgs",
|
||||
|
||||
@@ -8,7 +8,5 @@ export { convertToLlm } from "../../../packages/agent-core/src/harness/messages.
|
||||
|
||||
export type {
|
||||
BashExecutionMessage,
|
||||
BranchSummaryMessage,
|
||||
CompactionSummaryMessage,
|
||||
CustomMessage,
|
||||
} from "../../../packages/agent-core/src/harness/messages.js";
|
||||
|
||||
@@ -3,12 +3,8 @@ import path from "node:path";
|
||||
// timer-safe millisecond values.
|
||||
import { MAX_TIMER_TIMEOUT_MS } from "@openclaw/normalization-core/number-coercion";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
createBashTool,
|
||||
createLocalBashOperations,
|
||||
resolveBashTimeoutMs,
|
||||
type BashOperations,
|
||||
} from "./bash.js";
|
||||
import type { BashOperations } from "./bash-operations.js";
|
||||
import { createBashTool, createLocalBashOperations, resolveBashTimeoutMs } from "./bash.js";
|
||||
|
||||
describe("bash tool timeout helpers", () => {
|
||||
it("converts positive timeout seconds to timer-safe milliseconds", () => {
|
||||
|
||||
@@ -28,10 +28,6 @@ const bashSchema = Type.Object({
|
||||
command: Type.String({ description: "Bash command." }),
|
||||
timeout: Type.Optional(Type.Number({ description: "Optional timeout seconds; default none." })),
|
||||
});
|
||||
export type { BashToolDetails, BashToolInput } from "./tool-contracts.js";
|
||||
|
||||
export type { BashOperations } from "./bash-operations.js";
|
||||
|
||||
export function resolveBashTimeoutMs(timeoutSeconds: unknown): number | undefined {
|
||||
if (
|
||||
typeof timeoutSeconds !== "number" ||
|
||||
|
||||
@@ -8,12 +8,8 @@ import { applyPatch } from "diff";
|
||||
import { Value } from "typebox/value";
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
import type { Theme } from "../../modes/interactive/theme/theme.js";
|
||||
import {
|
||||
createEditTool,
|
||||
createEditToolDefinition,
|
||||
type EditOperations,
|
||||
type EditToolDetails,
|
||||
} from "./edit.js";
|
||||
import { createEditTool, createEditToolDefinition, type EditOperations } from "./edit.js";
|
||||
import type { EditToolDetails } from "./tool-contracts.js";
|
||||
|
||||
const testTheme = {
|
||||
bg: (_name: string, text: string) => text,
|
||||
|
||||
@@ -68,8 +68,6 @@ const editSchema = Type.Object(
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
export type { EditToolDetails, EditToolInput } from "./tool-contracts.js";
|
||||
|
||||
type LegacyEditToolInput = Record<string, unknown> & {
|
||||
edits?: unknown;
|
||||
oldText?: unknown;
|
||||
|
||||
@@ -47,8 +47,6 @@ const findSchema = Type.Object({
|
||||
path: Type.Optional(Type.String({ description: "Search dir; default cwd." })),
|
||||
limit: Type.Optional(Type.Number({ description: "Max results; default 1000." })),
|
||||
});
|
||||
export type { FindToolDetails, FindToolInput } from "./tool-contracts.js";
|
||||
|
||||
const DEFAULT_LIMIT = 1000;
|
||||
|
||||
/**
|
||||
|
||||
@@ -50,7 +50,6 @@ const grepSchema = Type.Object({
|
||||
),
|
||||
limit: Type.Optional(Type.Number({ description: "Max matches; default 100." })),
|
||||
});
|
||||
export type { GrepToolDetails, GrepToolInput } from "./tool-contracts.js";
|
||||
const DEFAULT_LIMIT = 100;
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,8 +27,6 @@ const lsSchema = Type.Object({
|
||||
path: Type.Optional(Type.String({ description: "Directory; default cwd." })),
|
||||
limit: Type.Optional(Type.Number({ description: "Max entries; default 500." })),
|
||||
});
|
||||
export type { LsToolDetails, LsToolInput } from "./tool-contracts.js";
|
||||
|
||||
const DEFAULT_LIMIT = 500;
|
||||
|
||||
/**
|
||||
|
||||
@@ -41,8 +41,6 @@ const readSchema = Type.Object({
|
||||
offset: Type.Optional(Type.Integer({ minimum: 1, description: "Start line; 1-based." })),
|
||||
limit: Type.Optional(Type.Number({ description: "Max lines." })),
|
||||
});
|
||||
export type { ReadToolDetails, ReadToolInput } from "./tool-contracts.js";
|
||||
|
||||
interface CompactReadClassification {
|
||||
kind: "docs" | "resource" | "skill";
|
||||
label: string;
|
||||
|
||||
@@ -34,8 +34,6 @@ const writeSchema = Type.Object({
|
||||
}),
|
||||
content: Type.String({ description: "File content." }),
|
||||
});
|
||||
export type { WriteToolInput } from "./tool-contracts.js";
|
||||
|
||||
/**
|
||||
* Pluggable operations for the write tool.
|
||||
* Override these to delegate file writing to remote systems (for example SSH).
|
||||
|
||||
Reference in New Issue
Block a user