refactor(runtime): remove unused helper exports · openclaw/openclaw@2e27a37
vincentkoc
·
2026-06-17
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -62,14 +62,6 @@ export function resolveGatewayDiscoveryEndpoint(
|
62 | 62 | }; |
63 | 63 | } |
64 | 64 | |
65 | | -export function pickResolvedGatewayHost(beacon: GatewayBonjourBeacon): string | null { |
66 | | -return resolveGatewayDiscoveryEndpoint(beacon)?.host ?? null; |
67 | | -} |
68 | | - |
69 | | -export function pickResolvedGatewayPort(beacon: GatewayBonjourBeacon): number | null { |
70 | | -return resolveGatewayDiscoveryEndpoint(beacon)?.port ?? null; |
71 | | -} |
72 | | - |
73 | 65 | type GatewayBonjourDiscoverOpts = { |
74 | 66 | timeoutMs?: number; |
75 | 67 | domains?: string[]; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -150,10 +150,3 @@ export function isContextOverflow(message: AssistantMessage, contextWindow?: num
|
150 | 150 | |
151 | 151 | return false; |
152 | 152 | } |
153 | | - |
154 | | -/** |
155 | | - * Get the overflow patterns for testing purposes. |
156 | | - */ |
157 | | -export function getOverflowPatterns(): RegExp[] { |
158 | | -return [...OVERFLOW_PATTERNS]; |
159 | | -} |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -54,18 +54,6 @@ export function parseAssistantTextSignature(
|
54 | 54 | } |
55 | 55 | } |
56 | 56 | |
57 | | -/** Encodes versioned assistant text metadata stored alongside streamed text blocks. */ |
58 | | -export function encodeAssistantTextSignature(params: { |
59 | | -id: string; |
60 | | -phase?: AssistantPhase; |
61 | | -}): string { |
62 | | -return JSON.stringify({ |
63 | | -v: 1, |
64 | | -id: params.id, |
65 | | - ...(params.phase ? { phase: params.phase } : {}), |
66 | | -}); |
67 | | -} |
68 | | - |
69 | 57 | /** Resolves a message phase only when the top-level phase or all explicit blocks agree. */ |
70 | 58 | export function resolveAssistantMessagePhase(message: unknown): AssistantPhase | undefined { |
71 | 59 | if (!message || typeof message !== "object") { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -256,10 +256,6 @@ function resolveSkillsLimits(config?: OpenClawConfig, agentId?: string): Resolve
|
256 | 256 | }; |
257 | 257 | } |
258 | 258 | |
259 | | -export function resolveSkillRootScanLimit(config?: OpenClawConfig): number { |
260 | | -return config?.skills?.limits?.maxCandidatesPerRoot ?? DEFAULT_MAX_CANDIDATES_PER_ROOT; |
261 | | -} |
262 | | - |
263 | 259 | function listChildDirectories( |
264 | 260 | dir: string, |
265 | 261 | opts?: { |
@@ -1698,13 +1694,6 @@ export async function syncSkillsToWorkspace(params: {
|
1698 | 1694 | }); |
1699 | 1695 | } |
1700 | 1696 | |
1701 | | -export function filterWorkspaceSkillEntries( |
1702 | | -entries: SkillEntry[], |
1703 | | -config?: OpenClawConfig, |
1704 | | -): SkillEntry[] { |
1705 | | -return filterSkillEntries(entries, config); |
1706 | | -} |
1707 | | - |
1708 | 1697 | export function filterWorkspaceSkillEntriesWithOptions( |
1709 | 1698 | entries: SkillEntry[], |
1710 | 1699 | opts?: { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -15,7 +15,6 @@ import {
|
15 | 15 | isParentFlowLinkError, |
16 | 16 | linkTaskToFlowById, |
17 | 17 | listTasksForFlowId, |
18 | | -markTaskLostById, |
19 | 18 | markTaskRunningByRunId, |
20 | 19 | finalizeTaskRunByRunId as finalizeTaskRunByRunIdInRegistry, |
21 | 20 | recordTaskProgressByRunId, |
@@ -207,16 +206,6 @@ export function failTaskRunByRunId(params: {
|
207 | 206 | }); |
208 | 207 | } |
209 | 208 | |
210 | | -export function markTaskRunLostById(params: { |
211 | | -taskId: string; |
212 | | -endedAt: number; |
213 | | -lastEventAt?: number; |
214 | | -error?: string; |
215 | | -cleanupAfter?: number; |
216 | | -}) { |
217 | | -return markTaskLostById(params); |
218 | | -} |
219 | | - |
220 | 209 | export function setDetachedTaskDeliveryStatusByRunId(params: { |
221 | 210 | runId: string; |
222 | 211 | runtime?: TaskRuntime; |
@@ -362,15 +351,6 @@ export function retryBlockedFlowAsQueuedTaskRun(
|
362 | 351 | }); |
363 | 352 | } |
364 | 353 | |
365 | | -export function retryBlockedFlowAsRunningTaskRun( |
366 | | -params: Omit<RetryBlockedFlowParams, "status">, |
367 | | -): RetryBlockedFlowResult { |
368 | | -return retryBlockedFlowTask({ |
369 | | - ...params, |
370 | | -status: "running", |
371 | | -}); |
372 | | -} |
373 | | - |
374 | 354 | type CancelFlowResult = { |
375 | 355 | found: boolean; |
376 | 356 | cancelled: boolean; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1253,8 +1253,3 @@ export function configureTaskRegistryMaintenance(options: {
|
1253 | 1253 | configuredRuntimeAuthoritative = options.runtimeAuthoritative; |
1254 | 1254 | } |
1255 | 1255 | } |
1256 | | - |
1257 | | -export function getReconciledTaskById(taskId: string): TaskRecord | undefined { |
1258 | | -const task = getTaskById(taskId); |
1259 | | -return task ? reconcileTaskRecordForOperatorInspection(task) : undefined; |
1260 | | -} |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2283,11 +2283,6 @@ function listTasksFromIndex(index: Map<string, Set<string>>, key: string): TaskR
|
2283 | 2283 | .map(({ insertionIndex: _, ...task }) => task); |
2284 | 2284 | } |
2285 | 2285 | |
2286 | | -export function findLatestTaskForSessionKey(sessionKey: string): TaskRecord | undefined { |
2287 | | -const task = listTasksForSessionKey(sessionKey)[0]; |
2288 | | -return task ? cloneTaskRecord(task) : undefined; |
2289 | | -} |
2290 | | - |
2291 | 2286 | export function listTasksForSessionKey(sessionKey: string): TaskRecord[] { |
2292 | 2287 | ensureTaskRegistryReady(); |
2293 | 2288 | const key = normalizeOptionalString(sessionKey); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。