refactor: trim agent core helper exports · openclaw/openclaw@b97a6f2
steipete
·
2026-05-02
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -102,13 +102,13 @@ const modifiableNamedKeys = new Set([
|
102 | 102 | "dc", |
103 | 103 | ]); |
104 | 104 | |
105 | | -export type KeyEncodingRequest = { |
| 105 | +type KeyEncodingRequest = { |
106 | 106 | keys?: string[]; |
107 | 107 | hex?: string[]; |
108 | 108 | literal?: string; |
109 | 109 | }; |
110 | 110 | |
111 | | -export type KeyEncodingResult = { |
| 111 | +type KeyEncodingResult = { |
112 | 112 | data: string; |
113 | 113 | warnings: string[]; |
114 | 114 | }; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -3,7 +3,7 @@ import type { OpenClawConfig } from "../config/types.openclaw.js";
|
3 | 3 | import { normalizeOptionalLowercaseString } from "../shared/string-coerce.js"; |
4 | 4 | import { resolveChannelPromptCapabilities } from "./channel-tools.js"; |
5 | 5 | |
6 | | -export function mergeRuntimeCapabilities( |
| 6 | +function mergeRuntimeCapabilities( |
7 | 7 | base?: readonly string[] | null, |
8 | 8 | additions: readonly string[] = [], |
9 | 9 | ): string[] | undefined { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2,7 +2,7 @@ import type { SessionManager } from "@mariozechner/pi-coding-agent";
|
2 | 2 | |
3 | 3 | const RAW_APPEND_MESSAGE = Symbol("openclaw.session.rawAppendMessage"); |
4 | 4 | |
5 | | -export type SessionManagerWithRawAppend = SessionManager & { |
| 5 | +type SessionManagerWithRawAppend = SessionManager & { |
6 | 6 | [RAW_APPEND_MESSAGE]?: SessionManager["appendMessage"]; |
7 | 7 | }; |
8 | 8 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -10,7 +10,7 @@ import {
|
10 | 10 | import { resolveLiveToolResultMaxChars } from "./pi-embedded-runner/tool-result-truncation.js"; |
11 | 11 | import { installSessionToolResultGuard } from "./session-tool-result-guard.js"; |
12 | 12 | |
13 | | -export type GuardedSessionManager = SessionManager & { |
| 13 | +type GuardedSessionManager = SessionManager & { |
14 | 14 | /** Flush any synthetic tool results for pending tool calls. Idempotent. */ |
15 | 15 | flushPendingToolResults?: () => void; |
16 | 16 | /** Clear pending tool calls without persisting synthetic tool results. Idempotent. */ |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | | -export type PendingToolCall = { id: string; name?: string }; |
| 1 | +type PendingToolCall = { id: string; name?: string }; |
2 | 2 | |
3 | | -export type PendingToolCallState = { |
| 3 | +type PendingToolCallState = { |
4 | 4 | size: () => number; |
5 | 5 | entries: () => IterableIterator<[string, string | undefined]>; |
6 | 6 | getToolName: (id: string) => string | undefined; |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | | -export const SESSION_WRITE_LOCK_TIMEOUT_CODE = "OPENCLAW_SESSION_WRITE_LOCK_TIMEOUT"; |
| 1 | +const SESSION_WRITE_LOCK_TIMEOUT_CODE = "OPENCLAW_SESSION_WRITE_LOCK_TIMEOUT"; |
2 | 2 | |
3 | 3 | export class SessionWriteLockTimeoutError extends Error { |
4 | 4 | readonly code = SESSION_WRITE_LOCK_TIMEOUT_CODE; |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | | -export type InstallCommandResult = { |
| 1 | +type InstallCommandResult = { |
2 | 2 | code: number | null; |
3 | 3 | stdout: string; |
4 | 4 | stderr: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import type { AssistantMessage, StopReason, Usage } from "@mariozechner/pi-ai"; |
2 | 2 | |
3 | | -export type StreamModelDescriptor = { |
| 3 | +type StreamModelDescriptor = { |
4 | 4 | api: string; |
5 | 5 | provider: string; |
6 | 6 | id: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import { normalizeToolName } from "./tool-policy.js"; |
2 | 2 | |
3 | | -export type ExplicitToolAllowlistSource = { |
| 3 | +type ExplicitToolAllowlistSource = { |
4 | 4 | label: string; |
5 | 5 | entries: string[]; |
6 | 6 | }; |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js"; |
2 | 2 | |
3 | | -export const TOOL_CALL_NAME_MAX_CHARS = 64; |
4 | | -export const TOOL_CALL_NAME_RE = /^[A-Za-z0-9_:.-]+$/; |
| 3 | +const TOOL_CALL_NAME_MAX_CHARS = 64; |
| 4 | +const TOOL_CALL_NAME_RE = /^[A-Za-z0-9_:.-]+$/; |
5 | 5 | |
6 | 6 | export const REDACTED_SESSIONS_SPAWN_ATTACHMENT_CONTENT = "__OPENCLAW_REDACTED__"; |
7 | 7 | export const SESSIONS_SPAWN_ATTACHMENT_METADATA_KEYS = ["name", "encoding", "mimeType"] as const; |
@@ -66,7 +66,7 @@ export function isRedactedSessionsSpawnAttachment(item: unknown): boolean {
|
66 | 66 | return true; |
67 | 67 | } |
68 | 68 | |
69 | | -export type SessionsSpawnAttachmentToolCallBlock = { |
| 69 | +type SessionsSpawnAttachmentToolCallBlock = { |
70 | 70 | name?: unknown; |
71 | 71 | input?: unknown; |
72 | 72 | arguments?: unknown; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。