UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

35 lines (34 loc) • 2 kB
import { a as resolveGlobalSingleton } from "./global-singleton-D7yf05nR.mjs"; import { i as collectNestedErrorCandidates } from "./error-coercion-hDrHOSGy.mjs"; //#region src/state/incognito-session-error.ts const IncognitoSessionEndedError = resolveGlobalSingleton(Symbol.for("openclaw.incognitoSessionEndedError"), () => class IncognitoEndedError extends Error { constructor(e) { super("Incognito session ended. Create a new incognito session to continue.", e); this.code = "INCOGNITO_SESSION_ENDED"; this.name = "IncognitoSessionEndedError"; } }); const IncognitoSessionMissingError = resolveGlobalSingleton(Symbol.for("openclaw.incognitoSessionMissingError"), () => class IncognitoMissingError extends Error { constructor() { super("No incognito session owner. Create a new incognito session to continue."); this.code = "INCOGNITO_SESSION_MISSING"; this.name = "IncognitoSessionMissingError"; } }); /** * Shared by the host and SDK graphs so legacy adapters retain the actionable refusal. * @internal Knip production exception; P7d removes this tag when it installs sync refusal preflight. */ const IncognitoSessionSyncAccessError = resolveGlobalSingleton(Symbol.for("openclaw.incognitoSessionSyncAccessError"), () => class IncognitoSyncAccessError extends Error { constructor(e, t) { super(`${e} cannot access an incognito session synchronously. Await ${t} instead.`); this.code = "INCOGNITO_SESSION_SYNC_ACCESS"; this.name = "IncognitoSessionSyncAccessError"; } }); /** An ended actor or unsupported sync access is never an empty or successfully updated session. */ function rethrowIncognitoSessionError(e) { if (collectNestedErrorCandidates(e).some((e) => e instanceof IncognitoSessionMissingError || e instanceof IncognitoSessionSyncAccessError || e instanceof IncognitoSessionEndedError)) throw e; } //#endregion export { rethrowIncognitoSessionError as i, IncognitoSessionMissingError as n, IncognitoSessionSyncAccessError as r, IncognitoSessionEndedError as t };