mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
refactor(runtime): remove unused helper probes
This commit is contained in:
@@ -50,13 +50,6 @@ export function appendSerializedJsonlEntrySync(
|
||||
return content;
|
||||
}
|
||||
|
||||
export function appendJsonlEntriesSync(filePath: string, entries: readonly unknown[]): void {
|
||||
if (entries.length === 0) {
|
||||
return;
|
||||
}
|
||||
appendFileSync(filePath, serializeJsonlEntries(entries), "utf-8");
|
||||
}
|
||||
|
||||
export async function writeJsonlEntry(
|
||||
filePath: string,
|
||||
entry: unknown,
|
||||
|
||||
@@ -105,14 +105,6 @@ export function resolveOwnedSessionTranscriptWriteLockRunner(params: {
|
||||
return context.withSessionWriteLock;
|
||||
}
|
||||
|
||||
export function hasOwnedSessionTranscriptWriteContext(params: {
|
||||
sessionFile?: string;
|
||||
sessionKey?: string;
|
||||
}): boolean {
|
||||
const context = ownedTranscriptWriteContext.getStore();
|
||||
return Boolean(context && contextMatches({ context, ...params }));
|
||||
}
|
||||
|
||||
export function canAdvanceOwnedSessionEntryCache(params: {
|
||||
sessionFile?: string;
|
||||
sessionKey?: string;
|
||||
|
||||
@@ -139,17 +139,6 @@ export function isCronActiveJobMarkerCurrent(marker: CronActiveJobMarker | undef
|
||||
);
|
||||
}
|
||||
|
||||
/** Returns whether any other cron run is active in this process. */
|
||||
export function hasOtherActiveCronJobs(jobId: string) {
|
||||
const state = getCronActiveJobState();
|
||||
for (const [activeJobId, marker] of state.activeJobs) {
|
||||
if (activeJobId !== jobId && isMarkerActiveInGeneration(marker, state.generation)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Returns whether any cron run is active in this process. */
|
||||
export function hasActiveCronJobs() {
|
||||
return getActiveCronJobCountForGeneration(getCronActiveJobState()) > 0;
|
||||
|
||||
@@ -431,23 +431,6 @@ export async function parseMessageWithAttachments(
|
||||
};
|
||||
}
|
||||
|
||||
export async function resolveChatAttachmentLooksLikeImage(
|
||||
attachment: ChatAttachment,
|
||||
index = 0,
|
||||
): Promise<boolean> {
|
||||
const normalized = normalizeAttachment(attachment, index, {
|
||||
stripDataUrlPrefix: true,
|
||||
requireImageMime: false,
|
||||
});
|
||||
if (!isValidBase64(normalized.base64)) {
|
||||
throw new Error(`attachment ${normalized.label}: invalid base64 content`);
|
||||
}
|
||||
const providedMime = normalizeMime(normalized.mime);
|
||||
const sniffedMime = normalizeMime(await sniffMimeFromBase64(normalized.base64));
|
||||
const labelMime = normalizeMime(mimeTypeFromFilePath(normalized.label));
|
||||
return isImageMime(resolveAttachmentMime({ sniffedMime, providedMime, labelMime }));
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use parseMessageWithAttachments instead.
|
||||
* This function converts images to markdown data URLs which Claude API cannot process as images.
|
||||
|
||||
@@ -63,21 +63,6 @@ export function isApprovalMethod(method: string): boolean {
|
||||
return resolveScopedMethod(method) === APPROVALS_SCOPE;
|
||||
}
|
||||
|
||||
/** Returns true when a method requires the pairing operator scope. */
|
||||
export function isPairingMethod(method: string): boolean {
|
||||
return resolveScopedMethod(method) === PAIRING_SCOPE;
|
||||
}
|
||||
|
||||
/** Returns true when a method can be satisfied by read or stronger write/admin scopes. */
|
||||
export function isReadMethod(method: string): boolean {
|
||||
return resolveScopedMethod(method) === READ_SCOPE;
|
||||
}
|
||||
|
||||
/** Returns true when a method requires write or admin operator scope. */
|
||||
export function isWriteMethod(method: string): boolean {
|
||||
return resolveScopedMethod(method) === WRITE_SCOPE;
|
||||
}
|
||||
|
||||
/** Returns true when a method is reserved for node-role clients instead of operators. */
|
||||
export function isNodeRoleMethod(method: string): boolean {
|
||||
return isCoreNodeGatewayMethod(method);
|
||||
|
||||
Reference in New Issue
Block a user