mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 12:40:43 +00:00
refactor: trim agent core helper exports
This commit is contained in:
@@ -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[];
|
||||
};
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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"];
|
||||
};
|
||||
|
||||
|
||||
@@ -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. */
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export type InstallCommandResult = {
|
||||
type InstallCommandResult = {
|
||||
code: number | null;
|
||||
stdout: string;
|
||||
stderr: string;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { AssistantMessage, StopReason, Usage } from "@mariozechner/pi-ai";
|
||||
|
||||
export type StreamModelDescriptor = {
|
||||
type StreamModelDescriptor = {
|
||||
api: string;
|
||||
provider: string;
|
||||
id: string;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { normalizeToolName } from "./tool-policy.js";
|
||||
|
||||
export type ExplicitToolAllowlistSource = {
|
||||
type ExplicitToolAllowlistSource = {
|
||||
label: string;
|
||||
entries: string[];
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user