mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:50:43 +00:00
refactor: hide auto reply internals
This commit is contained in:
@@ -11,7 +11,7 @@ const DEFAULT_ACP_HIDDEN_BOUNDARY_SEPARATOR_LIVE = "space";
|
||||
const DEFAULT_ACP_MAX_OUTPUT_CHARS = 24_000;
|
||||
const DEFAULT_ACP_MAX_SESSION_UPDATE_CHARS = 320;
|
||||
|
||||
export const ACP_TAG_VISIBILITY_DEFAULTS: Record<AcpSessionUpdateTag, boolean> = {
|
||||
const ACP_TAG_VISIBILITY_DEFAULTS: Record<AcpSessionUpdateTag, boolean> = {
|
||||
agent_message_chunk: true,
|
||||
tool_call: false,
|
||||
tool_call_update: false,
|
||||
|
||||
@@ -98,7 +98,7 @@ export function setAgentRunnerMemoryTestDeps(overrides?: Partial<typeof memoryDe
|
||||
});
|
||||
}
|
||||
|
||||
export function estimatePromptTokensForMemoryFlush(prompt?: string): number | undefined {
|
||||
function estimatePromptTokensForMemoryFlush(prompt?: string): number | undefined {
|
||||
const trimmed = normalizeOptionalString(prompt);
|
||||
if (!trimmed) {
|
||||
return undefined;
|
||||
@@ -111,7 +111,7 @@ export function estimatePromptTokensForMemoryFlush(prompt?: string): number | un
|
||||
return Math.ceil(tokens);
|
||||
}
|
||||
|
||||
export function resolveEffectivePromptTokens(
|
||||
function resolveEffectivePromptTokens(
|
||||
basePromptTokens?: number,
|
||||
lastOutputTokens?: number,
|
||||
promptTokenEstimate?: number,
|
||||
@@ -124,7 +124,7 @@ export function resolveEffectivePromptTokens(
|
||||
return base + output + estimate;
|
||||
}
|
||||
|
||||
export function resolveMemoryFlushModelFallbackOptions(
|
||||
function resolveMemoryFlushModelFallbackOptions(
|
||||
run: FollowupRun["run"],
|
||||
model?: string,
|
||||
configOverride: FollowupRun["run"]["config"] = run.config,
|
||||
|
||||
@@ -2,7 +2,7 @@ import { loadCronStore, resolveCronStorePath } from "../../cron/store.js";
|
||||
import { normalizeLowercaseStringOrEmpty } from "../../shared/string-coerce.js";
|
||||
import type { ReplyPayload } from "../types.js";
|
||||
|
||||
export const UNSCHEDULED_REMINDER_NOTE =
|
||||
const UNSCHEDULED_REMINDER_NOTE =
|
||||
"Note: I did not schedule a reminder in this turn, so this will not trigger automatically.";
|
||||
|
||||
const REMINDER_COMMITMENT_PATTERNS: RegExp[] = [
|
||||
|
||||
@@ -189,7 +189,7 @@ export function buildEmbeddedRunBaseParams(
|
||||
});
|
||||
}
|
||||
|
||||
export function buildEmbeddedContextFromTemplate(params: {
|
||||
function buildEmbeddedContextFromTemplate(params: {
|
||||
run: FollowupRun["run"];
|
||||
sessionCtx: TemplateContext;
|
||||
hasRepliedRef: { value: boolean } | undefined;
|
||||
@@ -229,7 +229,7 @@ function normalizeMemberRoleIds(value: TemplateContext["MemberRoleIds"]): string
|
||||
return roles.length > 0 ? roles : undefined;
|
||||
}
|
||||
|
||||
export function buildTemplateSenderContext(sessionCtx: TemplateContext) {
|
||||
function buildTemplateSenderContext(sessionCtx: TemplateContext) {
|
||||
return {
|
||||
senderId: normalizeOptionalString(sessionCtx.SenderId),
|
||||
senderName: normalizeOptionalString(sessionCtx.SenderName),
|
||||
|
||||
@@ -184,7 +184,7 @@ export function resolveBlockStreamingChunking(
|
||||
};
|
||||
}
|
||||
|
||||
export function resolveBlockStreamingCoalescing(
|
||||
function resolveBlockStreamingCoalescing(
|
||||
cfg: OpenClawConfig | undefined,
|
||||
provider?: string,
|
||||
accountId?: string | null,
|
||||
|
||||
@@ -10,7 +10,7 @@ export type ParsedSlashCommand =
|
||||
| { ok: true; action: string; args: string }
|
||||
| { ok: false; message: string };
|
||||
|
||||
export function parseSlashCommandActionArgs(raw: string, slash: string): SlashCommandParseResult {
|
||||
function parseSlashCommandActionArgs(raw: string, slash: string): SlashCommandParseResult {
|
||||
const trimmed = raw.trim();
|
||||
const slashLower = normalizeLowercaseStringOrEmpty(slash);
|
||||
if (!normalizeLowercaseStringOrEmpty(trimmed).startsWith(slashLower)) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export const DEFAULT_PENDING_TOOL_DRAIN_IDLE_TIMEOUT_MS = 30_000;
|
||||
const DEFAULT_PENDING_TOOL_DRAIN_IDLE_TIMEOUT_MS = 30_000;
|
||||
|
||||
export type PendingToolTaskDrainResult =
|
||||
| { kind: "settled" }
|
||||
|
||||
@@ -3,7 +3,7 @@ import { buildInboundMediaNote } from "../media-note.js";
|
||||
import type { MsgContext, TemplateContext } from "../templating.js";
|
||||
import { appendUntrustedContext } from "./untrusted-context.js";
|
||||
|
||||
export const REPLY_MEDIA_HINT =
|
||||
const REPLY_MEDIA_HINT =
|
||||
"To send an image back, prefer the message tool (media/path/filePath). If you must inline, use MEDIA:https://example.com/image.jpg (spaces ok, quote if needed) or a safe relative path like MEDIA:./image.jpg. Absolute and ~ paths only work when they stay inside your allowed file-read boundary; host file:// URLs are blocked. Keep caption in the text body.";
|
||||
|
||||
export function buildReplyPromptBodies(params: {
|
||||
|
||||
Reference in New Issue
Block a user