diff --git a/src/config/sessions/transcript-jsonl.ts b/src/config/sessions/transcript-jsonl.ts index e15eee9aa579..39d587b7b78f 100644 --- a/src/config/sessions/transcript-jsonl.ts +++ b/src/config/sessions/transcript-jsonl.ts @@ -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, diff --git a/src/config/sessions/transcript-write-context.ts b/src/config/sessions/transcript-write-context.ts index 95259ef29d47..caf8a042f3b1 100644 --- a/src/config/sessions/transcript-write-context.ts +++ b/src/config/sessions/transcript-write-context.ts @@ -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; diff --git a/src/cron/active-jobs.ts b/src/cron/active-jobs.ts index 7d4499db57d4..d66df63633b1 100644 --- a/src/cron/active-jobs.ts +++ b/src/cron/active-jobs.ts @@ -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; diff --git a/src/gateway/chat-attachments.ts b/src/gateway/chat-attachments.ts index 83429caa3381..b6a54fc2c158 100644 --- a/src/gateway/chat-attachments.ts +++ b/src/gateway/chat-attachments.ts @@ -431,23 +431,6 @@ export async function parseMessageWithAttachments( }; } -export async function resolveChatAttachmentLooksLikeImage( - attachment: ChatAttachment, - index = 0, -): Promise { - 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. diff --git a/src/gateway/method-scopes.ts b/src/gateway/method-scopes.ts index bf5421198680..1494916b0e8c 100644 --- a/src/gateway/method-scopes.ts +++ b/src/gateway/method-scopes.ts @@ -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);