mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 08:50:43 +00:00
refactor: hide core helper internals
This commit is contained in:
@@ -5,7 +5,6 @@ import { countPendingDescendantRunsFromRuns } from "../../../agents/subagent-reg
|
||||
import { getSubagentRunsSnapshotForRead } from "../../../agents/subagent-registry-state.js";
|
||||
import type { SubagentRunRecord } from "../../../agents/subagent-registry.types.js";
|
||||
import {
|
||||
extractAssistantText,
|
||||
resolveInternalSessionKey,
|
||||
resolveMainSessionAlias,
|
||||
stripToolMessages,
|
||||
@@ -27,7 +26,7 @@ import {
|
||||
type SubagentTargetResolution,
|
||||
} from "../subagents-utils.js";
|
||||
|
||||
export { extractAssistantText, stripToolMessages };
|
||||
export { stripToolMessages };
|
||||
export { resolveCommandSurfaceChannel, resolveChannelAccountId };
|
||||
export type { ChatMessage } from "../commands-subagents-text.js";
|
||||
|
||||
@@ -67,7 +66,7 @@ type SubagentsAction =
|
||||
| "agents"
|
||||
| "help";
|
||||
|
||||
export type SubagentsCommandParams = Parameters<CommandHandler>[0];
|
||||
type SubagentsCommandParams = Parameters<CommandHandler>[0];
|
||||
|
||||
export type SubagentsCommandContext = {
|
||||
params: SubagentsCommandParams;
|
||||
@@ -213,7 +212,7 @@ export function resolveSubagentsAction(params: {
|
||||
return "steer";
|
||||
}
|
||||
|
||||
export type FocusTargetResolution = {
|
||||
type FocusTargetResolution = {
|
||||
targetKind: "subagent" | "acp";
|
||||
targetSessionKey: string;
|
||||
agentId: string;
|
||||
|
||||
@@ -9,7 +9,7 @@ import type {
|
||||
import { ErrorCodes, errorShape } from "../protocol/index.js";
|
||||
import type { GatewayClient, GatewayRequestContext, RespondFn } from "./types.js";
|
||||
|
||||
export const APPROVAL_NOT_FOUND_DETAILS = {
|
||||
const APPROVAL_NOT_FOUND_DETAILS = {
|
||||
reason: ErrorCodes.APPROVAL_NOT_FOUND,
|
||||
remediation: "Re-request the action; pending approvals are cleared after expiry or restart.",
|
||||
} as const;
|
||||
@@ -51,7 +51,7 @@ export function isApprovalDecision(value: string): value is ExecApprovalDecision
|
||||
return value === "allow-once" || value === "allow-always" || value === "deny";
|
||||
}
|
||||
|
||||
export function respondUnknownOrExpiredApproval(respond: RespondFn): void {
|
||||
function respondUnknownOrExpiredApproval(respond: RespondFn): void {
|
||||
respond(
|
||||
false,
|
||||
undefined,
|
||||
|
||||
@@ -70,7 +70,6 @@ import type { GatewayRequestHandlers } from "./types.js";
|
||||
|
||||
export {
|
||||
clearNodeWakeState,
|
||||
NODE_WAKE_RECONNECT_POLL_MS,
|
||||
NODE_WAKE_RECONNECT_RETRY_WAIT_MS,
|
||||
NODE_WAKE_RECONNECT_WAIT_MS,
|
||||
} from "./nodes-wake-state.js";
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
export const RESERVED_ADMIN_GATEWAY_METHOD_PREFIXES = [
|
||||
const RESERVED_ADMIN_GATEWAY_METHOD_PREFIXES = [
|
||||
"exec.approvals.",
|
||||
"config.",
|
||||
"wizard.",
|
||||
"update.",
|
||||
] as const;
|
||||
|
||||
export const RESERVED_ADMIN_GATEWAY_METHOD_SCOPE = "operator.admin" as const;
|
||||
const RESERVED_ADMIN_GATEWAY_METHOD_SCOPE = "operator.admin" as const;
|
||||
|
||||
export function isReservedAdminGatewayMethod(method: string): boolean {
|
||||
function isReservedAdminGatewayMethod(method: string): boolean {
|
||||
return RESERVED_ADMIN_GATEWAY_METHOD_PREFIXES.some((prefix) => method.startsWith(prefix));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user