refactor: hide core helper internals · openclaw/openclaw@bf67976
steipete
·
2026-05-02
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -5,7 +5,6 @@ import { countPendingDescendantRunsFromRuns } from "../../../agents/subagent-reg
|
5 | 5 | import { getSubagentRunsSnapshotForRead } from "../../../agents/subagent-registry-state.js"; |
6 | 6 | import type { SubagentRunRecord } from "../../../agents/subagent-registry.types.js"; |
7 | 7 | import { |
8 | | -extractAssistantText, |
9 | 8 | resolveInternalSessionKey, |
10 | 9 | resolveMainSessionAlias, |
11 | 10 | stripToolMessages, |
@@ -27,7 +26,7 @@ import {
|
27 | 26 | type SubagentTargetResolution, |
28 | 27 | } from "../subagents-utils.js"; |
29 | 28 | |
30 | | -export { extractAssistantText, stripToolMessages }; |
| 29 | +export { stripToolMessages }; |
31 | 30 | export { resolveCommandSurfaceChannel, resolveChannelAccountId }; |
32 | 31 | export type { ChatMessage } from "../commands-subagents-text.js"; |
33 | 32 | |
@@ -67,7 +66,7 @@ type SubagentsAction =
|
67 | 66 | | "agents" |
68 | 67 | | "help"; |
69 | 68 | |
70 | | -export type SubagentsCommandParams = Parameters<CommandHandler>[0]; |
| 69 | +type SubagentsCommandParams = Parameters<CommandHandler>[0]; |
71 | 70 | |
72 | 71 | export type SubagentsCommandContext = { |
73 | 72 | params: SubagentsCommandParams; |
@@ -213,7 +212,7 @@ export function resolveSubagentsAction(params: {
|
213 | 212 | return "steer"; |
214 | 213 | } |
215 | 214 | |
216 | | -export type FocusTargetResolution = { |
| 215 | +type FocusTargetResolution = { |
217 | 216 | targetKind: "subagent" | "acp"; |
218 | 217 | targetSessionKey: string; |
219 | 218 | agentId: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -9,7 +9,7 @@ import type {
|
9 | 9 | import { ErrorCodes, errorShape } from "../protocol/index.js"; |
10 | 10 | import type { GatewayClient, GatewayRequestContext, RespondFn } from "./types.js"; |
11 | 11 | |
12 | | -export const APPROVAL_NOT_FOUND_DETAILS = { |
| 12 | +const APPROVAL_NOT_FOUND_DETAILS = { |
13 | 13 | reason: ErrorCodes.APPROVAL_NOT_FOUND, |
14 | 14 | remediation: "Re-request the action; pending approvals are cleared after expiry or restart.", |
15 | 15 | } as const; |
@@ -51,7 +51,7 @@ export function isApprovalDecision(value: string): value is ExecApprovalDecision
|
51 | 51 | return value === "allow-once" || value === "allow-always" || value === "deny"; |
52 | 52 | } |
53 | 53 | |
54 | | -export function respondUnknownOrExpiredApproval(respond: RespondFn): void { |
| 54 | +function respondUnknownOrExpiredApproval(respond: RespondFn): void { |
55 | 55 | respond( |
56 | 56 | false, |
57 | 57 | undefined, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -70,7 +70,6 @@ import type { GatewayRequestHandlers } from "./types.js";
|
70 | 70 | |
71 | 71 | export { |
72 | 72 | clearNodeWakeState, |
73 | | -NODE_WAKE_RECONNECT_POLL_MS, |
74 | 73 | NODE_WAKE_RECONNECT_RETRY_WAIT_MS, |
75 | 74 | NODE_WAKE_RECONNECT_WAIT_MS, |
76 | 75 | } from "./nodes-wake-state.js"; |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | | -export const RESERVED_ADMIN_GATEWAY_METHOD_PREFIXES = [ |
| 1 | +const RESERVED_ADMIN_GATEWAY_METHOD_PREFIXES = [ |
2 | 2 | "exec.approvals.", |
3 | 3 | "config.", |
4 | 4 | "wizard.", |
5 | 5 | "update.", |
6 | 6 | ] as const; |
7 | 7 | |
8 | | -export const RESERVED_ADMIN_GATEWAY_METHOD_SCOPE = "operator.admin" as const; |
| 8 | +const RESERVED_ADMIN_GATEWAY_METHOD_SCOPE = "operator.admin" as const; |
9 | 9 | |
10 | | -export function isReservedAdminGatewayMethod(method: string): boolean { |
| 10 | +function isReservedAdminGatewayMethod(method: string): boolean { |
11 | 11 | return RESERVED_ADMIN_GATEWAY_METHOD_PREFIXES.some((prefix) => method.startsWith(prefix)); |
12 | 12 | } |
13 | 13 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。