refactor(runtime): remove unused helper probes · openclaw/openclaw@e2292d1
vincentkoc
·
2026-06-17
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -50,13 +50,6 @@ export function appendSerializedJsonlEntrySync(
|
50 | 50 | return content; |
51 | 51 | } |
52 | 52 | |
53 | | -export function appendJsonlEntriesSync(filePath: string, entries: readonly unknown[]): void { |
54 | | -if (entries.length === 0) { |
55 | | -return; |
56 | | -} |
57 | | -appendFileSync(filePath, serializeJsonlEntries(entries), "utf-8"); |
58 | | -} |
59 | | - |
60 | 53 | export async function writeJsonlEntry( |
61 | 54 | filePath: string, |
62 | 55 | entry: unknown, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -105,14 +105,6 @@ export function resolveOwnedSessionTranscriptWriteLockRunner(params: {
|
105 | 105 | return context.withSessionWriteLock; |
106 | 106 | } |
107 | 107 | |
108 | | -export function hasOwnedSessionTranscriptWriteContext(params: { |
109 | | -sessionFile?: string; |
110 | | -sessionKey?: string; |
111 | | -}): boolean { |
112 | | -const context = ownedTranscriptWriteContext.getStore(); |
113 | | -return Boolean(context && contextMatches({ context, ...params })); |
114 | | -} |
115 | | - |
116 | 108 | export function canAdvanceOwnedSessionEntryCache(params: { |
117 | 109 | sessionFile?: string; |
118 | 110 | sessionKey?: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -139,17 +139,6 @@ export function isCronActiveJobMarkerCurrent(marker: CronActiveJobMarker | undef
|
139 | 139 | ); |
140 | 140 | } |
141 | 141 | |
142 | | -/** Returns whether any other cron run is active in this process. */ |
143 | | -export function hasOtherActiveCronJobs(jobId: string) { |
144 | | -const state = getCronActiveJobState(); |
145 | | -for (const [activeJobId, marker] of state.activeJobs) { |
146 | | -if (activeJobId !== jobId && isMarkerActiveInGeneration(marker, state.generation)) { |
147 | | -return true; |
148 | | -} |
149 | | -} |
150 | | -return false; |
151 | | -} |
152 | | - |
153 | 142 | /** Returns whether any cron run is active in this process. */ |
154 | 143 | export function hasActiveCronJobs() { |
155 | 144 | return getActiveCronJobCountForGeneration(getCronActiveJobState()) > 0; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -431,23 +431,6 @@ export async function parseMessageWithAttachments(
|
431 | 431 | }; |
432 | 432 | } |
433 | 433 | |
434 | | -export async function resolveChatAttachmentLooksLikeImage( |
435 | | -attachment: ChatAttachment, |
436 | | -index = 0, |
437 | | -): Promise<boolean> { |
438 | | -const normalized = normalizeAttachment(attachment, index, { |
439 | | -stripDataUrlPrefix: true, |
440 | | -requireImageMime: false, |
441 | | -}); |
442 | | -if (!isValidBase64(normalized.base64)) { |
443 | | -throw new Error(`attachment ${normalized.label}: invalid base64 content`); |
444 | | -} |
445 | | -const providedMime = normalizeMime(normalized.mime); |
446 | | -const sniffedMime = normalizeMime(await sniffMimeFromBase64(normalized.base64)); |
447 | | -const labelMime = normalizeMime(mimeTypeFromFilePath(normalized.label)); |
448 | | -return isImageMime(resolveAttachmentMime({ sniffedMime, providedMime, labelMime })); |
449 | | -} |
450 | | - |
451 | 434 | /** |
452 | 435 | * @deprecated Use parseMessageWithAttachments instead. |
453 | 436 | * This function converts images to markdown data URLs which Claude API cannot process as images. |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -63,21 +63,6 @@ export function isApprovalMethod(method: string): boolean {
|
63 | 63 | return resolveScopedMethod(method) === APPROVALS_SCOPE; |
64 | 64 | } |
65 | 65 | |
66 | | -/** Returns true when a method requires the pairing operator scope. */ |
67 | | -export function isPairingMethod(method: string): boolean { |
68 | | -return resolveScopedMethod(method) === PAIRING_SCOPE; |
69 | | -} |
70 | | - |
71 | | -/** Returns true when a method can be satisfied by read or stronger write/admin scopes. */ |
72 | | -export function isReadMethod(method: string): boolean { |
73 | | -return resolveScopedMethod(method) === READ_SCOPE; |
74 | | -} |
75 | | - |
76 | | -/** Returns true when a method requires write or admin operator scope. */ |
77 | | -export function isWriteMethod(method: string): boolean { |
78 | | -return resolveScopedMethod(method) === WRITE_SCOPE; |
79 | | -} |
80 | | - |
81 | 66 | /** Returns true when a method is reserved for node-role clients instead of operators. */ |
82 | 67 | export function isNodeRoleMethod(method: string): boolean { |
83 | 68 | return isCoreNodeGatewayMethod(method); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。