refactor: trim agent core helper exports

This commit is contained in:
Peter Steinberger
2026-05-01 21:46:58 +01:00
parent cf511288b8
commit b97a6f2849
10 changed files with 14 additions and 14 deletions

View File

@@ -102,13 +102,13 @@ const modifiableNamedKeys = new Set([
"dc",
]);
export type KeyEncodingRequest = {
type KeyEncodingRequest = {
keys?: string[];
hex?: string[];
literal?: string;
};
export type KeyEncodingResult = {
type KeyEncodingResult = {
data: string;
warnings: string[];
};

View File

@@ -3,7 +3,7 @@ import type { OpenClawConfig } from "../config/types.openclaw.js";
import { normalizeOptionalLowercaseString } from "../shared/string-coerce.js";
import { resolveChannelPromptCapabilities } from "./channel-tools.js";
export function mergeRuntimeCapabilities(
function mergeRuntimeCapabilities(
base?: readonly string[] | null,
additions: readonly string[] = [],
): string[] | undefined {

View File

@@ -2,7 +2,7 @@ import type { SessionManager } from "@mariozechner/pi-coding-agent";
const RAW_APPEND_MESSAGE = Symbol("openclaw.session.rawAppendMessage");
export type SessionManagerWithRawAppend = SessionManager & {
type SessionManagerWithRawAppend = SessionManager & {
[RAW_APPEND_MESSAGE]?: SessionManager["appendMessage"];
};

View File

@@ -10,7 +10,7 @@ import {
import { resolveLiveToolResultMaxChars } from "./pi-embedded-runner/tool-result-truncation.js";
import { installSessionToolResultGuard } from "./session-tool-result-guard.js";
export type GuardedSessionManager = SessionManager & {
type GuardedSessionManager = SessionManager & {
/** Flush any synthetic tool results for pending tool calls. Idempotent. */
flushPendingToolResults?: () => void;
/** Clear pending tool calls without persisting synthetic tool results. Idempotent. */

View File

@@ -1,6 +1,6 @@
export type PendingToolCall = { id: string; name?: string };
type PendingToolCall = { id: string; name?: string };
export type PendingToolCallState = {
type PendingToolCallState = {
size: () => number;
entries: () => IterableIterator<[string, string | undefined]>;
getToolName: (id: string) => string | undefined;

View File

@@ -1,4 +1,4 @@
export const SESSION_WRITE_LOCK_TIMEOUT_CODE = "OPENCLAW_SESSION_WRITE_LOCK_TIMEOUT";
const SESSION_WRITE_LOCK_TIMEOUT_CODE = "OPENCLAW_SESSION_WRITE_LOCK_TIMEOUT";
export class SessionWriteLockTimeoutError extends Error {
readonly code = SESSION_WRITE_LOCK_TIMEOUT_CODE;

View File

@@ -1,4 +1,4 @@
export type InstallCommandResult = {
type InstallCommandResult = {
code: number | null;
stdout: string;
stderr: string;

View File

@@ -1,6 +1,6 @@
import type { AssistantMessage, StopReason, Usage } from "@mariozechner/pi-ai";
export type StreamModelDescriptor = {
type StreamModelDescriptor = {
api: string;
provider: string;
id: string;

View File

@@ -1,6 +1,6 @@
import { normalizeToolName } from "./tool-policy.js";
export type ExplicitToolAllowlistSource = {
type ExplicitToolAllowlistSource = {
label: string;
entries: string[];
};

View File

@@ -1,7 +1,7 @@
import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js";
export const TOOL_CALL_NAME_MAX_CHARS = 64;
export const TOOL_CALL_NAME_RE = /^[A-Za-z0-9_:.-]+$/;
const TOOL_CALL_NAME_MAX_CHARS = 64;
const TOOL_CALL_NAME_RE = /^[A-Za-z0-9_:.-]+$/;
export const REDACTED_SESSIONS_SPAWN_ATTACHMENT_CONTENT = "__OPENCLAW_REDACTED__";
export const SESSIONS_SPAWN_ATTACHMENT_METADATA_KEYS = ["name", "encoding", "mimeType"] as const;
@@ -66,7 +66,7 @@ export function isRedactedSessionsSpawnAttachment(item: unknown): boolean {
return true;
}
export type SessionsSpawnAttachmentToolCallBlock = {
type SessionsSpawnAttachmentToolCallBlock = {
name?: unknown;
input?: unknown;
arguments?: unknown;