|
|
@@ -3,7 +3,6 @@
|
|
|
import type { Context, Fiber } from '@deepseek-ai/cordis'
|
|
|
import type { Session, SessionEvent, SessionHeader, SessionId } from '@deepseek-ai/dsh-session'
|
|
|
import type SessionPersistence from '@deepseek-ai/dsh-session-persistence'
|
|
|
-import type { SessionPersistenceCorruptionError } from '@deepseek-ai/dsh-session-persistence'
|
|
|
import type { SessionRecord } from './types.ts'
|
|
|
import { SessionQueryError } from './config.ts'
|
|
|
import { assertSessionHeadersCompatible } from './sources.ts'
|
|
|
@@ -275,7 +274,7 @@ async function inspectPersisted(
|
|
|
return await persistence.inspect(sessionId, signal)
|
|
|
} catch (error: unknown) {
|
|
|
if (signal?.aborted) signal.throwIfAborted()
|
|
|
- if ((error as SessionPersistenceCorruptionError).name === 'SessionPersistenceCorruptionError') {
|
|
|
+ if (error instanceof Error && error.name === 'SessionPersistenceCorruptionError') {
|
|
|
throw new SessionQueryError(
|
|
|
`stored session "${sessionId}" is corrupt: ${errorMessage(error)}`,
|
|
|
'SESSION_QUERY_CORRUPT_SESSION',
|