@ferricstore/ferricstore 0.12.0 → 0.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/langgraph.cjs +395 -125
- package/dist/langgraph.cjs.map +1 -1
- package/dist/langgraph.d.cts +17 -7
- package/dist/langgraph.d.ts +17 -7
- package/dist/langgraph.js +396 -126
- package/dist/langgraph.js.map +1 -1
- package/dist/openai-agents.cjs +161 -24
- package/dist/openai-agents.cjs.map +1 -1
- package/dist/openai-agents.d.cts +10 -4
- package/dist/openai-agents.d.ts +10 -4
- package/dist/openai-agents.js +161 -24
- package/dist/openai-agents.js.map +1 -1
- package/docs/agent-api/assets/hierarchy.js +1 -0
- package/docs/agent-api/assets/highlight.css +92 -0
- package/docs/agent-api/assets/icons.js +18 -0
- package/docs/agent-api/assets/icons.svg +1 -0
- package/docs/agent-api/assets/main.js +60 -0
- package/docs/agent-api/assets/navigation.js +1 -0
- package/docs/agent-api/assets/search.js +1 -0
- package/docs/agent-api/assets/style.css +1648 -0
- package/docs/agent-api/classes/langgraph.FerricStoreSaver.html +297 -0
- package/docs/agent-api/classes/langgraph.FerricStoreStore.html +298 -0
- package/docs/agent-api/classes/langgraph.LangGraphFlow.html +190 -0
- package/docs/agent-api/classes/langgraph.LangGraphFlowContext.html +158 -0
- package/docs/agent-api/classes/langgraph.LangGraphFlowRun.html +133 -0
- package/docs/agent-api/classes/openai-agents.FerricStoreSession.html +241 -0
- package/docs/agent-api/hierarchy.html +44 -0
- package/docs/agent-api/index.html +142 -0
- package/docs/agent-api/interfaces/langgraph.FerricFlowHandlerContext.html +94 -0
- package/docs/agent-api/interfaces/langgraph.FerricStoreCommandClient.html +77 -0
- package/docs/agent-api/interfaces/langgraph.FerricStoreLockOptions.html +81 -0
- package/docs/agent-api/interfaces/langgraph.FerricStoreSaverOptions.html +106 -0
- package/docs/agent-api/interfaces/langgraph.FerricStoreStoreOptions.html +98 -0
- package/docs/agent-api/interfaces/langgraph.InvokableLangGraph.html +83 -0
- package/docs/agent-api/interfaces/langgraph.LangGraphFlowOptions.html +116 -0
- package/docs/agent-api/interfaces/openai-agents.FerricStoreSessionOptions.html +114 -0
- package/docs/agent-api/interfaces/openai-agents.Session.html +208 -0
- package/docs/agent-api/interfaces/openai-agents.SessionHistoryRewriteAwareSession.html +230 -0
- package/docs/agent-api/interfaces/openai-agents.SessionHistoryTransactionAwareSession.html +237 -0
- package/docs/agent-api/modules/langgraph.html +44 -0
- package/docs/agent-api/modules/openai-agents.html +44 -0
- package/docs/agent-api/modules.html +35 -0
- package/docs/agent-api/types/langgraph.LangGraphChannelVersions.html +33 -0
- package/docs/agent-api/types/langgraph.LangGraphInvocationConfig.html +33 -0
- package/docs/agent-api/types/langgraph.LangGraphOutcomeMapper.html +50 -0
- package/docs/agent-api/types/langgraph.LangGraphPendingWrite.html +33 -0
- package/docs/agent-api/types/openai-agents.AgentInputItem.html +35 -0
- package/docs/agent-frameworks.md +25 -8
- package/docs/api/index.html +4 -1
- package/docs/api/media/agent-frameworks.md +25 -8
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/openai-agents.ts","../src/agent-persistence/durability.ts","../src/errors.ts","../src/agent-persistence/snapshot.ts"],"sourcesContent":["import { createHash, randomUUID } from \"node:crypto\";\n\nimport type {\n AgentInputItem,\n Session,\n SessionHistoryRewriteArgs,\n SessionHistoryRewriteAwareSession,\n SessionHistoryTransaction,\n SessionHistoryTransactionArgs,\n SessionHistoryTransactionAwareSession\n} from \"@openai/agents\";\n\nimport {\n normalizeKeyPrefix,\n type FerricStoreCommandClient,\n type FerricStoreLockOptions,\n withMutationLocks\n} from \"./agent-persistence/durability.js\";\nimport {\n cloneSnapshot,\n decodeSnapshot,\n encodeSnapshot,\n snapshotDigest,\n snapshotsEqual\n} from \"./agent-persistence/snapshot.js\";\n\nconst SESSION_FORMAT_VERSION = 1;\nconst SESSION_STATE_FIELD = \"state\";\n\ninterface StoredSessionState {\n readonly formatVersion: typeof SESSION_FORMAT_VERSION;\n readonly items: AgentInputItem[];\n readonly operations: Record<string, string>;\n readonly sessionId: string;\n}\n\nexport interface FerricStoreSessionOptions extends FerricStoreLockOptions {\n /** Existing conversation identifier. A random UUID is created when omitted. */\n sessionId?: string;\n /** Items used only when this session has not yet been persisted. */\n initialItems?: AgentInputItem[];\n /** FerricStore key prefix. Defaults to `openai:agents:session`. */\n keyPrefix?: string;\n}\n\n/**\n * Durable OpenAI Agents SDK conversation history backed by FerricStore.\n *\n * Every mutation is serialized by an ownership-checked, renewable FerricStore\n * lock. History transactions and their operation receipts are persisted in one\n * atomic hash-field write, implementing the SDK's retry-safe transaction\n * capability in addition to its base Session contract.\n */\nexport class FerricStoreSession implements\n Session,\n SessionHistoryRewriteAwareSession,\n SessionHistoryTransactionAwareSession {\n readonly client: FerricStoreCommandClient;\n readonly sessionId: string;\n readonly keyPrefix: string;\n private readonly initialItems: AgentInputItem[];\n private readonly lockOptions: FerricStoreLockOptions;\n private readonly sessionKey: string;\n private readonly lockKey: string;\n\n constructor(client: FerricStoreCommandClient, options: FerricStoreSessionOptions = {}) {\n this.client = client;\n this.sessionId = options.sessionId ?? randomUUID();\n if (typeof this.sessionId !== \"string\" || this.sessionId.trim().length === 0) {\n throw new TypeError(\"sessionId must be a non-empty string\");\n }\n this.keyPrefix = normalizeKeyPrefix(options.keyPrefix ?? \"openai:agents:session\", \"openai:agents:session\");\n this.initialItems = snapshotItems(options.initialItems ?? [], \"initialItems\");\n this.lockOptions = {\n lockRetryMs: options.lockRetryMs,\n lockTtlMs: options.lockTtlMs,\n lockWaitMs: options.lockWaitMs\n };\n const digest = createHash(\"sha256\").update(this.sessionId, \"utf8\").digest(\"hex\");\n this.sessionKey = `${this.keyPrefix}:{oais:${digest}}:session`;\n this.lockKey = `${this.keyPrefix}:{oais:${digest}}:mutation-lock`;\n }\n\n async getSessionId(): Promise<string> {\n await this.mutate(async (state) => state);\n return this.sessionId;\n }\n\n async getItems(limit?: number): Promise<AgentInputItem[]> {\n if (limit != null && limit <= 0) return [];\n if (limit != null && !Number.isSafeInteger(limit)) {\n throw new TypeError(\"limit must be a safe integer\");\n }\n const state = await this.readState();\n const items = limit == null ? state.items : state.items.slice(Math.max(state.items.length - limit, 0));\n return cloneSnapshot(items);\n }\n\n async addItems(items: AgentInputItem[]): Promise<void> {\n if (items.length === 0) return;\n const additions = snapshotItems(items, \"items\");\n await this.mutate(async (state) => ({\n ...state,\n items: [...state.items, ...additions]\n }));\n }\n\n async replaceHistoryWithCompaction(items: AgentInputItem[]): Promise<void> {\n const replacement = snapshotItems(items, \"items\");\n await this.mutate(async (state) => ({ ...state, items: replacement }));\n }\n\n async popItem(): Promise<AgentInputItem | undefined> {\n let popped: AgentInputItem | undefined;\n await this.mutate(async (state) => {\n popped = state.items.at(-1);\n return popped == null ? state : { ...state, items: state.items.slice(0, -1) };\n });\n return popped == null ? undefined : cloneSnapshot(popped);\n }\n\n async clearSession(): Promise<void> {\n await this.mutate(async (state) => ({ ...state, items: [], operations: {} }));\n }\n\n async applyHistoryMutations(args: SessionHistoryRewriteArgs): Promise<void> {\n if (args == null || !Array.isArray(args.mutations)) {\n throw new TypeError(\"session history mutations are invalid\");\n }\n if (args.mutations.length === 0) return;\n const mutations = cloneSnapshot(args.mutations);\n await this.mutate(async (state) => {\n let items = cloneSnapshot(state.items);\n for (const mutation of mutations) {\n if (mutation.type !== \"replace_function_call\") {\n throw new TypeError(\"unsupported session history mutation\");\n }\n const replacement = snapshotItem(mutation.replacement, \"mutation replacement\");\n let keptReplacement = false;\n const next: AgentInputItem[] = [];\n for (const item of items) {\n if (item.type === \"function_call\" && item.callId === mutation.callId) {\n if (!keptReplacement) {\n next.push(replacement);\n keptReplacement = true;\n }\n } else {\n next.push(item);\n }\n }\n items = next;\n }\n return { ...state, items };\n });\n }\n\n async applyHistoryTransaction(args: SessionHistoryTransactionArgs): Promise<void> {\n const { operationId, transaction } = snapshotTransactionArgs(args);\n const digest = snapshotDigest(transaction);\n await this.mutate(async (state) => {\n const existing = Object.getOwnPropertyDescriptor(state.operations, operationId)?.value as unknown;\n if (existing != null) {\n if (typeof existing !== \"string\") throw new Error(\"corrupt session history operation receipt\");\n if (existing !== digest) {\n throw new Error(\"session history operation was already applied with a different transaction\");\n }\n return state;\n }\n\n let items: AgentInputItem[];\n if (transaction.type === \"append_items\") {\n items = [...state.items, ...transaction.items];\n } else {\n const suffixStart = state.items.length - transaction.expectedSuffix.length;\n const actualSuffix = suffixStart < 0 ? [] : state.items.slice(suffixStart);\n if (suffixStart < 0 || !snapshotsEqual(actualSuffix, transaction.expectedSuffix)) {\n throw new Error(\"session history suffix no longer matches the transaction precondition\");\n }\n items = [...state.items.slice(0, suffixStart), ...transaction.replacement];\n }\n return {\n ...state,\n items,\n operations: { ...state.operations, [operationId]: digest }\n };\n });\n }\n\n private async mutate(\n operation: (state: StoredSessionState) => Promise<StoredSessionState>\n ): Promise<void> {\n await withMutationLocks(this.client, [this.lockKey], async () => {\n const current = await this.readState();\n const next = await operation(current);\n await this.client.command(\"HSET\", this.sessionKey, SESSION_STATE_FIELD, encodeSnapshot(next));\n }, this.lockOptions);\n }\n\n private async readState(): Promise<StoredSessionState> {\n const value = await this.client.command(\"HGET\", this.sessionKey, SESSION_STATE_FIELD);\n if (value == null) return this.emptyState();\n const state = decodeSnapshot<StoredSessionState>(value, \"OpenAI Agents session state\");\n if (\n state == null ||\n typeof state !== \"object\" ||\n state.formatVersion !== SESSION_FORMAT_VERSION ||\n state.sessionId !== this.sessionId ||\n !Array.isArray(state.items) ||\n state.operations == null ||\n typeof state.operations !== \"object\" ||\n Array.isArray(state.operations) ||\n Object.values(state.operations).some((digest) => typeof digest !== \"string\")\n ) {\n throw new Error(\"unsupported or corrupt FerricStore OpenAI Agents session state\");\n }\n return state;\n }\n\n private emptyState(): StoredSessionState {\n return {\n formatVersion: SESSION_FORMAT_VERSION,\n items: cloneSnapshot(this.initialItems),\n operations: {},\n sessionId: this.sessionId\n };\n }\n}\n\nfunction snapshotTransactionArgs(args: SessionHistoryTransactionArgs): {\n operationId: string;\n transaction: SessionHistoryTransaction;\n} {\n if (args == null || typeof args !== \"object\") throw new TypeError(\"session history transaction is invalid\");\n if (typeof args.operationId !== \"string\" || args.operationId.trim().length === 0) {\n throw new TypeError(\"session history transaction operationId must be a non-empty string\");\n }\n const transaction = cloneSnapshot(args.transaction);\n if (transaction == null || typeof transaction !== \"object\") {\n throw new TypeError(\"session history transaction must be an object\");\n }\n if (transaction.type === \"append_items\") {\n if (!Array.isArray(transaction.items)) throw new TypeError(\"session history append items are invalid\");\n return {\n operationId: args.operationId,\n transaction: { type: \"append_items\", items: snapshotItems(transaction.items, \"transaction items\") }\n };\n }\n if (transaction.type === \"replace_suffix\") {\n if (!Array.isArray(transaction.expectedSuffix) || !Array.isArray(transaction.replacement)) {\n throw new TypeError(\"session history suffix transaction is invalid\");\n }\n return {\n operationId: args.operationId,\n transaction: {\n type: \"replace_suffix\",\n expectedSuffix: snapshotItems(transaction.expectedSuffix, \"transaction expectedSuffix\"),\n replacement: snapshotItems(transaction.replacement, \"transaction replacement\")\n }\n };\n }\n throw new TypeError(\"unsupported session history transaction type\");\n}\n\nfunction snapshotItems(items: AgentInputItem[], name: string): AgentInputItem[] {\n if (!Array.isArray(items)) throw new TypeError(`${name} must be an array`);\n return items.map((item) => snapshotItem(item, name));\n}\n\nfunction snapshotItem(item: AgentInputItem, name: string): AgentInputItem {\n if (item == null || typeof item !== \"object\" || Array.isArray(item)) {\n throw new TypeError(`${name} contains an invalid agent item`);\n }\n return cloneSnapshot(item);\n}\n\nexport type {\n AgentInputItem,\n Session,\n SessionHistoryRewriteAwareSession,\n SessionHistoryTransactionAwareSession\n} from \"@openai/agents\";\n","import { randomUUID } from \"node:crypto\";\nimport { setTimeout as delay } from \"node:timers/promises\";\n\nimport { LockHeldError } from \"../errors.js\";\nimport type { Command, CommandArgument } from \"../internal.js\";\n\nexport interface FerricStoreCommandClient {\n command(...args: CommandArgument[]): Promise<unknown>;\n pipeline?(commands: readonly Command[]): Promise<unknown[]>;\n}\n\nexport interface FerricStoreLockOptions {\n /** Lease duration for adapter mutation locks. Defaults to five minutes. */\n lockTtlMs?: number;\n /** Maximum time to wait for a contended mutation lock. Defaults to 30 seconds. */\n lockWaitMs?: number;\n /** Delay between lock acquisition attempts. Defaults to 10 milliseconds. */\n lockRetryMs?: number;\n}\n\ninterface RequiredLockOptions {\n readonly lockRetryMs: number;\n readonly lockTtlMs: number;\n readonly lockWaitMs: number;\n}\n\nconst DEFAULT_LOCK_OPTIONS: RequiredLockOptions = {\n lockRetryMs: 10,\n lockTtlMs: 300_000,\n lockWaitMs: 30_000\n};\n\nexport function normalizeKeyPrefix(value: string, defaultValue: string): string {\n const prefix = value.length === 0 ? defaultValue : value;\n if (prefix.includes(\"\\0\")) throw new TypeError(\"keyPrefix must not contain NUL bytes\");\n const normalized = prefix.replace(/:+$/u, \"\");\n if (normalized.length === 0) throw new TypeError(\"keyPrefix must contain a character other than ':'\");\n return normalized;\n}\n\nexport function positiveInteger(value: number | undefined, fallback: number, name: string): number {\n const normalized = value ?? fallback;\n if (!Number.isSafeInteger(normalized) || normalized <= 0) {\n throw new TypeError(`${name} must be a positive safe integer`);\n }\n return normalized;\n}\n\nexport function nonNegativeInteger(value: number | undefined, fallback: number, name: string): number {\n const normalized = value ?? fallback;\n if (!Number.isSafeInteger(normalized) || normalized < 0) {\n throw new TypeError(`${name} must be a non-negative safe integer`);\n }\n return normalized;\n}\n\nexport function textResponse(value: unknown, name: string): string {\n if (typeof value === \"string\") return value;\n if (Buffer.isBuffer(value) || value instanceof Uint8Array) return Buffer.from(value).toString(\"utf8\");\n throw new TypeError(`FerricStore returned an invalid ${name}`);\n}\n\nexport function arrayResponse(value: unknown, name: string): unknown[] {\n if (!Array.isArray(value)) throw new TypeError(`FerricStore returned an invalid ${name}`);\n return value;\n}\n\nexport function integerResponse(value: unknown, name: string): number {\n const parsed = typeof value === \"number\" ? value : Number(textResponse(value, name));\n if (!Number.isSafeInteger(parsed)) throw new TypeError(`FerricStore returned an invalid ${name}`);\n return parsed;\n}\n\nexport async function executeCommands(\n client: FerricStoreCommandClient,\n commands: readonly Command[]\n): Promise<unknown[]> {\n if (commands.length === 0) return [];\n if (client.pipeline != null) return await client.pipeline(commands);\n return await Promise.all(commands.map(async (command) => await client.command(...command)));\n}\n\nexport async function withMutationLocks<T>(\n client: FerricStoreCommandClient,\n keys: readonly string[],\n operation: () => Promise<T>,\n options: FerricStoreLockOptions = {}\n): Promise<T> {\n const orderedKeys = [...new Set(keys)].sort();\n if (orderedKeys.length === 0) return await operation();\n\n const normalized: RequiredLockOptions = {\n lockRetryMs: positiveInteger(options.lockRetryMs, DEFAULT_LOCK_OPTIONS.lockRetryMs, \"lockRetryMs\"),\n lockTtlMs: positiveInteger(options.lockTtlMs, DEFAULT_LOCK_OPTIONS.lockTtlMs, \"lockTtlMs\"),\n lockWaitMs: nonNegativeInteger(options.lockWaitMs, DEFAULT_LOCK_OPTIONS.lockWaitMs, \"lockWaitMs\")\n };\n const owner = randomUUID();\n const acquired: string[] = [];\n const deadline = performance.now() + normalized.lockWaitMs;\n let primaryError: unknown;\n let heartbeatError: unknown;\n let releaseError: unknown;\n let result: T | undefined;\n let operationCompleted = false;\n const heartbeatAbort = new AbortController();\n\n try {\n for (const key of orderedKeys) {\n while (!(await tryAcquireLock(client, key, owner, normalized.lockTtlMs))) {\n if (performance.now() >= deadline) {\n throw new Error(`timed out acquiring FerricStore lock ${JSON.stringify(key)}`);\n }\n await delay(normalized.lockRetryMs);\n }\n acquired.push(key);\n }\n\n const heartbeat = renewLocks(\n client,\n acquired,\n owner,\n normalized.lockTtlMs,\n heartbeatAbort.signal,\n (error) => {\n heartbeatError ??= error;\n }\n );\n try {\n result = await operation();\n operationCompleted = true;\n } catch (error) {\n primaryError = error;\n } finally {\n heartbeatAbort.abort();\n await heartbeat;\n }\n } catch (error) {\n primaryError ??= error;\n } finally {\n heartbeatAbort.abort();\n for (const key of acquired.reverse()) {\n try {\n await client.command(\"UNLOCK\", key, owner);\n } catch (error) {\n releaseError ??= error;\n }\n }\n }\n if (primaryError != null) throw errorObject(primaryError);\n if (heartbeatError != null) throw errorObject(heartbeatError);\n if (releaseError != null) throw errorObject(releaseError);\n if (!operationCompleted) throw new Error(\"FerricStore mutation did not complete\");\n return result as T;\n}\n\nasync function tryAcquireLock(\n client: FerricStoreCommandClient,\n key: string,\n owner: string,\n ttlMs: number\n): Promise<boolean> {\n try {\n const response = await client.command(\"LOCK\", key, owner, ttlMs);\n return response === true || response === \"OK\" || Buffer.isBuffer(response) && response.equals(Buffer.from(\"OK\"));\n } catch (error) {\n if (error instanceof LockHeldError) return false;\n throw error;\n }\n}\n\nasync function renewLocks(\n client: FerricStoreCommandClient,\n keys: readonly string[],\n owner: string,\n ttlMs: number,\n signal: AbortSignal,\n onError: (error: unknown) => void\n): Promise<void> {\n const intervalMs = Math.max(Math.floor(ttlMs / 3), 10);\n const retryMs = Math.min(Math.max(Math.floor(intervalMs / 10), 10), 1_000);\n const lastExtended = new Map(keys.map((key) => [key, performance.now()]));\n let waitMs = intervalMs;\n while (!signal.aborted) {\n try {\n await delay(waitMs, undefined, { signal });\n } catch (error) {\n if (signal.aborted) return;\n onError(error);\n return;\n }\n const now = performance.now();\n let retry = false;\n for (const key of keys) {\n try {\n const response = await client.command(\"EXTEND\", key, owner, ttlMs);\n if (integerResponse(response, \"EXTEND response\") !== 1) {\n onError(new Error(`lost FerricStore lock ${JSON.stringify(key)} while mutating data`));\n return;\n }\n lastExtended.set(key, now);\n } catch (error) {\n if (now - (lastExtended.get(key) ?? 0) >= ttlMs) {\n onError(new Error(`lost FerricStore lock ${JSON.stringify(key)} while mutating data`, { cause: error }));\n return;\n }\n retry = true;\n }\n }\n waitMs = retry ? retryMs : intervalMs;\n }\n}\n\nfunction errorObject(value: unknown): Error {\n return value instanceof Error ? value : new Error(\"FerricStore mutation failed\", { cause: value });\n}\n","export class FerricStoreError extends Error {\n readonly code: string = \"ferricstore_error\";\n readonly raw: unknown;\n readonly retryable: boolean | undefined;\n readonly safeToRetry: boolean | undefined;\n readonly retryAfterMs: number | undefined;\n\n constructor(message: string, options: {\n raw?: unknown;\n cause?: unknown;\n retryable?: boolean;\n safeToRetry?: boolean;\n retryAfterMs?: number;\n } = {}) {\n super(message, { cause: options.cause });\n this.name = new.target.name;\n this.raw = options.raw;\n this.retryable = options.retryable ?? structuredBooleanField(options.raw, \"retryable\");\n this.safeToRetry = options.safeToRetry ?? structuredBooleanField(options.raw, \"safe_to_retry\");\n this.retryAfterMs = options.retryAfterMs ?? structuredIntegerField(options.raw, \"retry_after_ms\");\n }\n}\n\nexport class HTTPTransportError extends FerricStoreError {\n override readonly code = \"http_transport\";\n readonly statusCode: number | undefined;\n\n constructor(message: string, options: ConstructorParameters<typeof FerricStoreError>[1] & {\n statusCode?: number;\n } = {}) {\n super(message, options);\n this.statusCode = options.statusCode;\n }\n}\n\nexport type RequestDisposition = \"unsent\" | \"possibly_sent\";\n/** @deprecated Use RequestDisposition; retained for source compatibility. */\nexport type ConnectionRequestDisposition = RequestDisposition;\n\n/** Connection closure annotated with whether the current request may have reached the server. */\nexport class ConnectionClosedError extends FerricStoreError {\n override readonly code = \"connection_closed\";\n readonly requestDisposition: RequestDisposition;\n\n constructor(\n requestDisposition: RequestDisposition,\n options: { raw?: unknown; cause?: unknown; message?: string } = {}\n ) {\n super(\n options.message ?? (requestDisposition === \"unsent\"\n ? \"FerricStore connection is closed\"\n : \"FerricStore connection closed\"),\n options\n );\n this.requestDisposition = requestDisposition;\n }\n}\n\n/** Request timeout annotated with whether the request may have reached the server. */\nexport class RequestTimeoutError extends FerricStoreError {\n override readonly code = \"request_timeout\";\n readonly requestDisposition: RequestDisposition;\n readonly timeoutMs: number;\n\n constructor(\n timeoutMs: number,\n requestDisposition: RequestDisposition,\n options: { raw?: unknown; cause?: unknown } = {}\n ) {\n super(`FerricStore request timed out after ${timeoutMs}ms`, options);\n this.requestDisposition = requestDisposition;\n this.timeoutMs = timeoutMs;\n }\n}\n\nexport class FlowNotFoundError extends FerricStoreError {\n override readonly code = \"flow_not_found\";\n}\n\nexport class FlowWrongStateError extends FerricStoreError {\n override readonly code = \"flow_wrong_state\";\n}\n\nexport class StaleLeaseError extends FerricStoreError {\n override readonly code = \"stale_lease\";\n}\n\n/** FLOW.POLICY.SET expected_generation did not match the stored generation. */\nexport class StalePolicyGenerationError extends FerricStoreError {\n override readonly code = \"stale_policy_generation\";\n}\n\nexport class FlowAlreadyExistsError extends FerricStoreError {\n override readonly code = \"flow_already_exists\";\n}\n\nexport class LockHeldError extends FerricStoreError {\n override readonly code = \"lock_held\";\n}\n\nexport class LockNotOwnedError extends FerricStoreError {\n override readonly code = \"lock_not_owned\";\n}\n\nexport class InvalidCommandError extends FerricStoreError {\n override readonly code = \"invalid_command\";\n}\n\nexport class OverloadedError extends FerricStoreError {\n override readonly code = \"overloaded\";\n readonly reason: string | undefined;\n\n constructor(\n message: string,\n options: {\n raw?: unknown;\n cause?: unknown;\n retryAfterMs?: number;\n reason?: string;\n retryable?: boolean;\n safeToRetry?: boolean;\n } = {}\n ) {\n const local = options.raw == null;\n super(message, {\n ...options,\n retryable: options.retryable ?? (local ? true : undefined),\n safeToRetry: options.safeToRetry ?? (local ? true : undefined)\n });\n this.reason = options.reason;\n }\n}\n\n/** The contacted endpoint cannot serve this route and topology should be refreshed. */\nexport class RerouteError extends FerricStoreError {\n override readonly code = \"reroute\";\n}\n\nconst OVERLOAD_CODES = new Set([\n \"backpressure\",\n \"busy\",\n \"flow_control_window_exhausted\",\n \"lane_queue_full\",\n \"overloaded\"\n]);\n\nexport function classifyServerError(\n message: string,\n raw?: unknown,\n cause?: unknown,\n status?: number | string\n): FerricStoreError {\n const lower = message.toLowerCase();\n const structuredCode = structuredStringField(raw, \"code\");\n const code = structuredCode?.toLowerCase();\n const retry = {\n retryable: structuredBooleanField(raw, \"retryable\"),\n safeToRetry: structuredBooleanField(raw, \"safe_to_retry\"),\n retryAfterMs: structuredIntegerField(raw, \"retry_after_ms\") ?? intField(lower, \"retry_after_ms\")\n };\n\n if (isRerouteStatus(status) || code === \"reroute\") {\n return new RerouteError(message, { cause, raw, ...definedRetryMetadata(retry) });\n }\n if (isBusyStatus(status) || isOverloadCode(structuredCode) || overloadMessage(lower)) {\n return new OverloadedError(message, {\n cause,\n raw,\n ...definedRetryMetadata(retry),\n reason: structuredStringField(raw, \"reason\") ?? structuredCode ?? stringField(lower, \"reason\"),\n retryAfterMs: retry.retryAfterMs\n });\n }\n if (code === \"flow_already_exists\" || (lower.includes(\"flow\") && lower.includes(\"already exists\"))) {\n return new FlowAlreadyExistsError(message, { cause, raw });\n }\n if (lower.includes(\"flow wrong state\") || code === \"flow_wrong_state\") {\n return new FlowWrongStateError(message, { cause, raw });\n }\n if (\n code === \"stale_lease\"\n || code === \"stale_flow_lease\"\n || lower.includes(\"stale flow lease\")\n || lower.includes(\"stale lease\")\n || lower.includes(\"stale token\")\n ) {\n return new StaleLeaseError(message, { cause, raw });\n }\n if (\n code === \"stale_generation\"\n || code === \"stale_policy_generation\"\n || code === \"stale_flow_policy_generation\"\n || lower.includes(\"stale flow policy generation\")\n || lower.includes(\"stale policy generation\")\n ) {\n return new StalePolicyGenerationError(message, { cause, raw });\n }\n if (\n code === \"flow_not_found\"\n || (lower.includes(\"flow\") && (lower.includes(\"not found\") || lower.includes(\"does not exist\")))\n ) {\n return new FlowNotFoundError(message, { cause, raw });\n }\n if (code === \"lock_held\" || lower.includes(\"lock is held\") || lower.includes(\"held by another owner\")) {\n return new LockHeldError(message, { cause, raw });\n }\n if (code === \"lock_not_owned\" || lower.includes(\"not the lock owner\") || lower.includes(\"caller is not the lock owner\")) {\n return new LockNotOwnedError(message, { cause, raw });\n }\n if (code === \"invalid_command\" || lower.includes(\"wrong number of arguments\") || lower.includes(\"syntax error\")) {\n return new InvalidCommandError(message, { cause, raw });\n }\n\n return new FerricStoreError(message, { cause, raw, ...definedRetryMetadata(retry) });\n}\n\nexport function mapException(error: unknown): unknown {\n if (error instanceof FerricStoreError) {\n return error;\n }\n\n if (!(error instanceof Error)) {\n return error;\n }\n\n const message = error.message;\n const serverLike =\n error.name === \"ResponseError\" ||\n message.startsWith(\"ERR \") ||\n message.startsWith(\"WRONGTYPE \") ||\n message.startsWith(\"DISTLOCK \");\n\n if (!serverLike) {\n return error;\n }\n\n return classifyServerError(message, error, error);\n}\n\nfunction intField(message: string, name: string): number | undefined {\n const match = new RegExp(`\\\\b${name}=([0-9]+)\\\\b`).exec(message);\n return match?.[1] == null ? undefined : nonNegativeSafeIntegerText(match[1]);\n}\n\nfunction isBusyStatus(status: number | string | undefined): boolean {\n return status === 4 || (typeof status === \"string\" && (status === \"4\" || status.toLowerCase() === \"busy\"));\n}\n\nfunction isRerouteStatus(status: number | string | undefined): boolean {\n return status === 5 || (typeof status === \"string\" && (status === \"5\" || status.toLowerCase() === \"reroute\"));\n}\n\nfunction isOverloadCode(code: string | undefined): boolean {\n return code != null && OVERLOAD_CODES.has(code.toLowerCase());\n}\n\nfunction overloadMessage(message: string): boolean {\n return /\\boverloaded\\b/u.test(message) || /(?:^|\\s)busy(?:\\s|:|$)/u.test(message);\n}\n\nfunction structuredIntegerField(raw: unknown, name: string): number | undefined {\n const value = structuredField(raw, name);\n if (typeof value === \"number\") {\n return Number.isSafeInteger(value) && value >= 0 ? value : undefined;\n }\n if (typeof value === \"bigint\") {\n return value >= 0n && value <= BigInt(Number.MAX_SAFE_INTEGER) ? Number(value) : undefined;\n }\n const text = binaryText(value);\n return text == null ? undefined : nonNegativeSafeIntegerText(text);\n}\n\nfunction structuredBooleanField(raw: unknown, name: string): boolean | undefined {\n const value = structuredField(raw, name);\n if (typeof value === \"boolean\") return value;\n const text = binaryText(value)?.toLowerCase();\n if (text === \"true\" || text === \"1\") return true;\n if (text === \"false\" || text === \"0\") return false;\n return undefined;\n}\n\nfunction definedRetryMetadata(metadata: {\n readonly retryable?: boolean;\n readonly safeToRetry?: boolean;\n readonly retryAfterMs?: number;\n}): { retryable?: boolean; safeToRetry?: boolean; retryAfterMs?: number } {\n return {\n ...(metadata.retryable == null ? {} : { retryable: metadata.retryable }),\n ...(metadata.safeToRetry == null ? {} : { safeToRetry: metadata.safeToRetry }),\n ...(metadata.retryAfterMs == null ? {} : { retryAfterMs: metadata.retryAfterMs })\n };\n}\n\nfunction nonNegativeSafeIntegerText(value: string): number | undefined {\n if (!/^[0-9]+$/u.test(value)) return undefined;\n const parsed = Number.parseInt(value, 10);\n return Number.isSafeInteger(parsed) && parsed >= 0 ? parsed : undefined;\n}\n\nfunction structuredStringField(raw: unknown, name: string): string | undefined {\n return binaryText(structuredField(raw, name));\n}\n\nfunction structuredField(raw: unknown, name: string): unknown {\n if (raw instanceof Map) {\n if (raw.has(name)) return raw.get(name);\n for (const [key, value] of raw.entries()) {\n if (binaryText(key) === name) return value;\n }\n return undefined;\n }\n if (typeof raw === \"object\" && raw != null && Object.hasOwn(raw, name)) {\n return (raw as Record<string, unknown>)[name];\n }\n return undefined;\n}\n\nfunction binaryText(value: unknown): string | undefined {\n if (typeof value === \"string\") return value;\n if (Buffer.isBuffer(value) || value instanceof Uint8Array) return Buffer.from(value).toString(\"utf8\");\n return undefined;\n}\n\nfunction stringField(message: string, name: string): string | undefined {\n const match = new RegExp(`\\\\b${name}=([a-z0-9_:-]+)\\\\b`).exec(message);\n return match?.[1];\n}\n","import { createHash } from \"node:crypto\";\n\ntype EncodedSnapshot =\n | [\"array\", EncodedSnapshot[]]\n | [\"binary\", string]\n | [\"boolean\", boolean]\n | [\"null\"]\n | [\"number\", number | \"NaN\" | \"+Infinity\" | \"-Infinity\" | \"-0\"]\n | [\"object\", [string, EncodedSnapshot][]]\n | [\"string\", string]\n | [\"undefined\"];\n\nexport function encodeSnapshot(value: unknown): Buffer {\n return Buffer.from(JSON.stringify(snapshot(value, new WeakSet())), \"utf8\");\n}\n\nexport function decodeSnapshot<T>(value: unknown, name: string): T {\n const bytes = typeof value === \"string\" ? Buffer.from(value, \"utf8\") : Buffer.from(asBytes(value, name));\n let encoded: unknown;\n try {\n encoded = JSON.parse(bytes.toString(\"utf8\"));\n } catch (error) {\n throw new Error(`FerricStore returned an invalid ${name}`, { cause: error });\n }\n return restore(encoded, name) as T;\n}\n\nexport function snapshotDigest(value: unknown): string {\n return createHash(\"sha256\").update(encodeSnapshot(value)).digest(\"hex\");\n}\n\nexport function cloneSnapshot<T>(value: T): T {\n return decodeSnapshot<T>(encodeSnapshot(value), \"snapshot\");\n}\n\nexport function snapshotsEqual(left: unknown, right: unknown): boolean {\n return encodeSnapshot(left).equals(encodeSnapshot(right));\n}\n\nfunction snapshot(value: unknown, ancestors: WeakSet<object>): EncodedSnapshot {\n if (value === null) return [\"null\"];\n if (value === undefined) return [\"undefined\"];\n if (typeof value === \"string\") return [\"string\", value];\n if (typeof value === \"boolean\") return [\"boolean\", value];\n if (typeof value === \"number\") {\n if (Object.is(value, -0)) return [\"number\", \"-0\"];\n if (Number.isNaN(value)) return [\"number\", \"NaN\"];\n if (value === Infinity) return [\"number\", \"+Infinity\"];\n if (value === -Infinity) return [\"number\", \"-Infinity\"];\n return [\"number\", value];\n }\n if (typeof value !== \"object\") throw new TypeError(\"session history contains unsupported data\");\n if (value instanceof Uint8Array) {\n const keys = Reflect.ownKeys(value);\n if (\n keys.length !== value.length ||\n keys.some((key) => typeof key !== \"string\" || !isArrayIndex(key, value.length))\n ) {\n throw new TypeError(\"session history binary data contains custom properties\");\n }\n return [\"binary\", Buffer.from(value).toString(\"base64\")];\n }\n if (ancestors.has(value)) throw new TypeError(\"session history contains cyclic data\");\n ancestors.add(value);\n try {\n if (Array.isArray(value)) {\n const keys = Reflect.ownKeys(value);\n if (\n keys.length !== value.length + 1 ||\n keys.some((key) => typeof key !== \"string\" || key !== \"length\" && !isArrayIndex(key, value.length))\n ) {\n throw new TypeError(\"session history contains a sparse or customized array\");\n }\n const items: EncodedSnapshot[] = [];\n for (let index = 0; index < value.length; index += 1) {\n const descriptor = Object.getOwnPropertyDescriptor(value, String(index));\n if (descriptor == null || !descriptor.enumerable || !(\"value\" in descriptor)) {\n throw new TypeError(\"session history contains an unsupported array item\");\n }\n items.push(snapshot(descriptor.value as unknown, ancestors));\n }\n return [\"array\", items];\n }\n const prototype: unknown = Object.getPrototypeOf(value);\n if (prototype !== Object.prototype && prototype !== null) {\n throw new TypeError(\"session history contains an unsupported object\");\n }\n const keys = Reflect.ownKeys(value);\n if (keys.some((key) => typeof key !== \"string\")) {\n throw new TypeError(\"session history contains a symbol property\");\n }\n const entries: [string, EncodedSnapshot][] = [];\n for (const key of (keys as string[]).sort((left, right) => left.localeCompare(right))) {\n const descriptor = Object.getOwnPropertyDescriptor(value, key);\n if (descriptor == null || !descriptor.enumerable || !(\"value\" in descriptor)) {\n throw new TypeError(\"session history contains an unsupported property\");\n }\n entries.push([key, snapshot(descriptor.value as unknown, ancestors)]);\n }\n return [\"object\", entries];\n } finally {\n ancestors.delete(value);\n }\n}\n\nfunction restore(value: unknown, name: string): unknown {\n if (!Array.isArray(value) || typeof value[0] !== \"string\") throw new TypeError(`invalid ${name}`);\n switch (value[0]) {\n case \"null\": return null;\n case \"undefined\": return undefined;\n case \"string\": return requireValueType(value[1], \"string\", name);\n case \"boolean\": return requireValueType(value[1], \"boolean\", name);\n case \"binary\": return Buffer.from(requireValueType(value[1], \"string\", name), \"base64\");\n case \"number\": return restoreNumber(value[1], name);\n case \"array\": {\n if (!Array.isArray(value[1])) throw new TypeError(`invalid ${name}`);\n return value[1].map((item) => restore(item, name));\n }\n case \"object\": {\n if (!Array.isArray(value[1])) throw new TypeError(`invalid ${name}`);\n const result: Record<string, unknown> = {};\n for (const entry of value[1]) {\n if (!Array.isArray(entry) || entry.length !== 2 || typeof entry[0] !== \"string\") {\n throw new TypeError(`invalid ${name}`);\n }\n Object.defineProperty(result, entry[0], {\n configurable: true,\n enumerable: true,\n value: restore(entry[1], name),\n writable: true\n });\n }\n return result;\n }\n default: throw new TypeError(`invalid ${name}`);\n }\n}\n\nfunction restoreNumber(value: unknown, name: string): number {\n if (typeof value === \"number\") return value;\n if (value === \"NaN\") return Number.NaN;\n if (value === \"+Infinity\") return Infinity;\n if (value === \"-Infinity\") return -Infinity;\n if (value === \"-0\") return -0;\n throw new TypeError(`invalid ${name}`);\n}\n\nfunction requireValueType<T extends \"boolean\" | \"string\">(\n value: unknown,\n type: T,\n name: string\n): T extends \"string\" ? string : boolean {\n if (typeof value !== type) throw new TypeError(`invalid ${name}`);\n return value as T extends \"string\" ? string : boolean;\n}\n\nfunction asBytes(value: unknown, name: string): Uint8Array {\n if (Buffer.isBuffer(value) || value instanceof Uint8Array) return value;\n throw new TypeError(`FerricStore returned a non-binary ${name}`);\n}\n\nfunction isArrayIndex(key: string, length: number): boolean {\n if (!/^(?:0|[1-9]\\d*)$/u.test(key)) return false;\n const index = Number(key);\n return Number.isSafeInteger(index) && index >= 0 && index < length;\n}\n"],"mappings":";AAAA,SAAS,cAAAA,aAAY,cAAAC,mBAAkB;;;ACAvC,SAAS,kBAAkB;AAC3B,SAAS,cAAc,aAAa;;;ACD7B,IAAM,mBAAN,cAA+B,MAAM;AAAA,EACjC,OAAe;AAAA,EACf;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,SAAiB,UAMzB,CAAC,GAAG;AACN,UAAM,SAAS,EAAE,OAAO,QAAQ,MAAM,CAAC;AACvC,SAAK,OAAO,WAAW;AACvB,SAAK,MAAM,QAAQ;AACnB,SAAK,YAAY,QAAQ,aAAa,uBAAuB,QAAQ,KAAK,WAAW;AACrF,SAAK,cAAc,QAAQ,eAAe,uBAAuB,QAAQ,KAAK,eAAe;AAC7F,SAAK,eAAe,QAAQ,gBAAgB,uBAAuB,QAAQ,KAAK,gBAAgB;AAAA,EAClG;AACF;AA2EO,IAAM,gBAAN,cAA4B,iBAAiB;AAAA,EAChC,OAAO;AAC3B;AAkKA,SAAS,uBAAuB,KAAc,MAAkC;AAC9E,QAAM,Q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M,QAAQ,YAAY,cAAc,KAAK,CAAC,MAAM,QAAQ,YAAY,WAAW,GAAG;AACzF,YAAM,IAAI,UAAU,+CAA+C;AAAA,IACrE;AACA,WAAO;AAAA,MACL,aAAa,KAAK;AAAA,MAClB,aAAa;AAAA,QACX,MAAM;AAAA,QACN,gBAAgB,cAAc,YAAY,gBAAgB,4BAA4B;AAAA,QACtF,aAAa,cAAc,YAAY,aAAa,yBAAyB;AAAA,MAC/E;AAAA,IACF;AAAA,EACF;AACA,QAAM,IAAI,UAAU,8CAA8C;AACpE;AAEA,SAAS,cAAc,OAAyB,MAAgC;AAC9E,MAAI,CAAC,MAAM,QAAQ,KAAK,EAAG,OAAM,IAAI,UAAU,GAAG,IAAI,mBAAmB;AACzE,SAAO,MAAM,IAAI,CAAC,SAAS,aAAa,MAAM,IAAI,CAAC;AACrD;AAEA,SAAS,aAAa,MAAsB,MAA8B;AACxE,MAAI,QAAQ,QAAQ,OAAO,SAAS,YAAY,MAAM,QAAQ,IAAI,GAAG;AACnE,UAAM,IAAI,UAAU,GAAG,IAAI,iCAAiC;AAAA,EAC9D;AACA,SAAO,cAAc,IAAI;AAC3B;","names":["createHash","randomUUID","keys","randomUUID","createHash"]}
|
|
1
|
+
{"version":3,"sources":["../src/openai-agents.ts","../src/agent-persistence/durability.ts","../src/errors.ts","../src/agent-persistence/snapshot.ts"],"sourcesContent":["import { createHash, randomUUID } from \"node:crypto\";\n\nimport type {\n AgentInputItem,\n Session,\n SessionHistoryRewriteArgs,\n SessionHistoryRewriteAwareSession,\n SessionHistoryTransaction,\n SessionHistoryTransactionArgs,\n SessionHistoryTransactionAwareSession\n} from \"@openai/agents\";\n\nimport {\n normalizeKeyPrefix,\n readAtomicValue,\n type FerricStoreCommandClient,\n type FerricStoreLockOptions,\n withMutationLocks\n} from \"./agent-persistence/durability.js\";\nimport {\n cloneSnapshot,\n decodeSnapshot,\n encodeSnapshot,\n legacySnapshotDigest,\n snapshotDigest,\n snapshotsEqual\n} from \"./agent-persistence/snapshot.js\";\n\nconst SESSION_FORMAT_VERSION = 1;\nconst SESSION_STATE_FIELD = \"state\";\nconst RECEIPT_DIGEST_VERSION = \"v2:\";\n\ninterface StoredSessionState {\n readonly formatVersion: typeof SESSION_FORMAT_VERSION;\n readonly items: AgentInputItem[];\n readonly operations: Record<string, string>;\n readonly sessionId: string;\n}\n\nexport interface FerricStoreSessionOptions extends FerricStoreLockOptions {\n /** Existing conversation identifier. A random UUID is created when omitted. */\n sessionId?: string;\n /** Items used only when this session has not yet been persisted. */\n initialItems?: AgentInputItem[];\n /** FerricStore key prefix. Defaults to `openai:agents:session`. */\n keyPrefix?: string;\n /** Previous worker locales to accept when migrating unversioned operation receipts. */\n legacyReceiptLocales?: string[];\n}\n\n/**\n * Durable OpenAI Agents SDK conversation history backed by FerricStore.\n *\n * Renewable locks reduce contention, while compare-and-swap makes every state\n * commit safe even if a writer's lease expires in flight. History transactions\n * and their operation receipts are persisted in one atomic value, implementing\n * the SDK's retry-safe transaction capability in addition to its base Session\n * contract.\n */\nexport class FerricStoreSession implements\n Session,\n SessionHistoryRewriteAwareSession,\n SessionHistoryTransactionAwareSession {\n readonly client: FerricStoreCommandClient;\n readonly sessionId: string;\n readonly keyPrefix: string;\n private readonly initialItems: AgentInputItem[];\n private readonly lockOptions: FerricStoreLockOptions;\n private readonly legacyReceiptLocales: readonly string[];\n private readonly sessionKey: string;\n private readonly stateKey: string;\n private readonly lockKey: string;\n\n constructor(client: FerricStoreCommandClient, options: FerricStoreSessionOptions = {}) {\n this.client = client;\n this.sessionId = options.sessionId ?? randomUUID();\n if (typeof this.sessionId !== \"string\" || this.sessionId.trim().length === 0) {\n throw new TypeError(\"sessionId must be a non-empty string\");\n }\n this.keyPrefix = normalizeKeyPrefix(options.keyPrefix ?? \"openai:agents:session\", \"openai:agents:session\");\n this.initialItems = snapshotItems(options.initialItems ?? [], \"initialItems\");\n this.lockOptions = {\n lockRetryMs: options.lockRetryMs,\n lockTtlMs: options.lockTtlMs,\n lockWaitMs: options.lockWaitMs\n };\n if (options.legacyReceiptLocales != null && !Array.isArray(options.legacyReceiptLocales)) {\n throw new TypeError(\"legacyReceiptLocales must be an array\");\n }\n try {\n this.legacyReceiptLocales = Intl.getCanonicalLocales(options.legacyReceiptLocales ?? []);\n } catch (error) {\n throw new TypeError(\"legacyReceiptLocales contains an invalid locale\", { cause: error });\n }\n const digest = createHash(\"sha256\").update(this.sessionId, \"utf8\").digest(\"hex\");\n this.sessionKey = `${this.keyPrefix}:{oais:${digest}}:session`;\n this.stateKey = `${this.sessionKey}:atomic-state`;\n this.lockKey = `${this.keyPrefix}:{oais:${digest}}:mutation-lock`;\n }\n\n async getSessionId(): Promise<string> {\n await this.mutate(async (state) => state);\n return this.sessionId;\n }\n\n async getItems(limit?: number): Promise<AgentInputItem[]> {\n if (limit != null && limit <= 0) return [];\n if (limit != null && !Number.isSafeInteger(limit)) {\n throw new TypeError(\"limit must be a safe integer\");\n }\n const state = await this.readState();\n const items = limit == null ? state.items : state.items.slice(Math.max(state.items.length - limit, 0));\n return cloneSnapshot(items);\n }\n\n async addItems(items: AgentInputItem[]): Promise<void> {\n if (items.length === 0) return;\n const additions = snapshotItems(items, \"items\");\n await this.mutate(async (state) => ({\n ...state,\n items: [...state.items, ...additions]\n }));\n }\n\n async replaceHistoryWithCompaction(items: AgentInputItem[]): Promise<void> {\n const replacement = snapshotItems(items, \"items\");\n await this.mutate(async (state) => ({ ...state, items: replacement }));\n }\n\n async popItem(): Promise<AgentInputItem | undefined> {\n let popped: AgentInputItem | undefined;\n await this.mutate(async (state) => {\n popped = state.items.at(-1);\n return popped == null ? state : { ...state, items: state.items.slice(0, -1) };\n });\n return popped == null ? undefined : cloneSnapshot(popped);\n }\n\n async clearSession(): Promise<void> {\n await this.mutate(async (state) => ({ ...state, items: [], operations: {} }));\n }\n\n async applyHistoryMutations(args: SessionHistoryRewriteArgs): Promise<void> {\n if (args == null || !Array.isArray(args.mutations)) {\n throw new TypeError(\"session history mutations are invalid\");\n }\n if (args.mutations.length === 0) return;\n const mutations = cloneSnapshot(args.mutations);\n await this.mutate(async (state) => {\n let items = cloneSnapshot(state.items);\n for (const mutation of mutations) {\n if (mutation.type !== \"replace_function_call\") {\n throw new TypeError(\"unsupported session history mutation\");\n }\n const replacement = snapshotItem(mutation.replacement, \"mutation replacement\");\n let keptReplacement = false;\n const next: AgentInputItem[] = [];\n for (const item of items) {\n if (item.type === \"function_call\" && item.callId === mutation.callId) {\n if (!keptReplacement) {\n next.push(replacement);\n keptReplacement = true;\n }\n } else {\n next.push(item);\n }\n }\n items = next;\n }\n return { ...state, items };\n });\n }\n\n async applyHistoryTransaction(args: SessionHistoryTransactionArgs): Promise<void> {\n const { operationId, transaction } = snapshotTransactionArgs(args);\n const digest = `${RECEIPT_DIGEST_VERSION}${snapshotDigest(transaction)}`;\n const legacyDigests = new Set([\n snapshotDigest(transaction),\n legacySnapshotDigest(transaction),\n ...this.legacyReceiptLocales.map((locale) => legacySnapshotDigest(transaction, locale))\n ]);\n await this.mutate(async (state) => {\n const existing = Object.getOwnPropertyDescriptor(state.operations, operationId)?.value as unknown;\n if (existing != null) {\n if (typeof existing !== \"string\") throw new Error(\"corrupt session history operation receipt\");\n if (existing === digest) return state;\n if (!legacyDigests.has(existing)) {\n throw new Error(\"session history operation was already applied with a different transaction\");\n }\n return { ...state, operations: { ...state.operations, [operationId]: digest } };\n }\n\n let items: AgentInputItem[];\n if (transaction.type === \"append_items\") {\n items = [...state.items, ...transaction.items];\n } else {\n const suffixStart = state.items.length - transaction.expectedSuffix.length;\n const actualSuffix = suffixStart < 0 ? [] : state.items.slice(suffixStart);\n if (suffixStart < 0 || !snapshotsEqual(actualSuffix, transaction.expectedSuffix)) {\n throw new Error(\"session history suffix no longer matches the transaction precondition\");\n }\n items = [...state.items.slice(0, suffixStart), ...transaction.replacement];\n }\n return {\n ...state,\n items,\n operations: { ...state.operations, [operationId]: digest }\n };\n });\n }\n\n private async mutate(\n operation: (state: StoredSessionState) => Promise<StoredSessionState>\n ): Promise<void> {\n await withMutationLocks(this.client, [this.lockKey], async (lease) => {\n for (let attempt = 0; attempt < 8; attempt += 1) {\n lease.assertOwned();\n const snapshot = await this.readMutationState();\n const next = await operation(snapshot.state);\n if (await lease.compareAndSet(this.stateKey, snapshot.expected, encodeSnapshot(next))) return;\n }\n throw new Error(\"concurrent FerricStore OpenAI Agents session mutation did not converge\");\n }, this.lockOptions);\n }\n\n private async readState(): Promise<StoredSessionState> {\n return (await this.readMutationState()).state;\n }\n\n private async readMutationState(): Promise<{ expected: Buffer | undefined; state: StoredSessionState }> {\n const expected = await readAtomicValue(this.client, this.stateKey, \"OpenAI Agents atomic session state\");\n const value = expected ?? await this.client.command(\"HGET\", this.sessionKey, SESSION_STATE_FIELD);\n if (value == null) return { expected, state: this.emptyState() };\n const state = decodeSnapshot<StoredSessionState>(value, \"OpenAI Agents session state\");\n if (\n state == null ||\n typeof state !== \"object\" ||\n state.formatVersion !== SESSION_FORMAT_VERSION ||\n state.sessionId !== this.sessionId ||\n !Array.isArray(state.items) ||\n state.operations == null ||\n typeof state.operations !== \"object\" ||\n Array.isArray(state.operations) ||\n Object.values(state.operations).some((digest) => typeof digest !== \"string\")\n ) {\n throw new Error(\"unsupported or corrupt FerricStore OpenAI Agents session state\");\n }\n return { expected, state };\n }\n\n private emptyState(): StoredSessionState {\n return {\n formatVersion: SESSION_FORMAT_VERSION,\n items: cloneSnapshot(this.initialItems),\n operations: {},\n sessionId: this.sessionId\n };\n }\n}\n\nfunction snapshotTransactionArgs(args: SessionHistoryTransactionArgs): {\n operationId: string;\n transaction: SessionHistoryTransaction;\n} {\n if (args == null || typeof args !== \"object\") throw new TypeError(\"session history transaction is invalid\");\n if (typeof args.operationId !== \"string\" || args.operationId.trim().length === 0) {\n throw new TypeError(\"session history transaction operationId must be a non-empty string\");\n }\n const transaction = cloneSnapshot(args.transaction);\n if (transaction == null || typeof transaction !== \"object\") {\n throw new TypeError(\"session history transaction must be an object\");\n }\n if (transaction.type === \"append_items\") {\n if (!Array.isArray(transaction.items)) throw new TypeError(\"session history append items are invalid\");\n return {\n operationId: args.operationId,\n transaction: { type: \"append_items\", items: snapshotItems(transaction.items, \"transaction items\") }\n };\n }\n if (transaction.type === \"replace_suffix\") {\n if (!Array.isArray(transaction.expectedSuffix) || !Array.isArray(transaction.replacement)) {\n throw new TypeError(\"session history suffix transaction is invalid\");\n }\n return {\n operationId: args.operationId,\n transaction: {\n type: \"replace_suffix\",\n expectedSuffix: snapshotItems(transaction.expectedSuffix, \"transaction expectedSuffix\"),\n replacement: snapshotItems(transaction.replacement, \"transaction replacement\")\n }\n };\n }\n throw new TypeError(\"unsupported session history transaction type\");\n}\n\nfunction snapshotItems(items: AgentInputItem[], name: string): AgentInputItem[] {\n if (!Array.isArray(items)) throw new TypeError(`${name} must be an array`);\n return items.map((item) => snapshotItem(item, name));\n}\n\nfunction snapshotItem(item: AgentInputItem, name: string): AgentInputItem {\n if (item == null || typeof item !== \"object\" || Array.isArray(item)) {\n throw new TypeError(`${name} contains an invalid agent item`);\n }\n return cloneSnapshot(item);\n}\n\nexport type {\n AgentInputItem,\n Session,\n SessionHistoryRewriteAwareSession,\n SessionHistoryTransactionAwareSession\n} from \"@openai/agents\";\n","import { randomUUID } from \"node:crypto\";\nimport { setTimeout as delay } from \"node:timers/promises\";\n\nimport { LockHeldError } from \"../errors.js\";\nimport type { Command, CommandArgument } from \"../internal.js\";\n\nexport interface FerricStoreCommandClient {\n command(...args: CommandArgument[]): Promise<unknown>;\n pipeline?(commands: readonly Command[]): Promise<unknown[]>;\n}\n\nexport interface FerricStoreLockOptions {\n /** Lease duration for adapter mutation locks. Defaults to five minutes. */\n lockTtlMs?: number;\n /** Maximum time to wait for a contended mutation lock. Defaults to 30 seconds. */\n lockWaitMs?: number;\n /** Delay between lock acquisition attempts. Defaults to 10 milliseconds. */\n lockRetryMs?: number;\n}\n\nexport interface FerricStoreMutationLease {\n /** Aborted as soon as lock ownership is known to have been lost. */\n readonly signal: AbortSignal;\n /** Throw when this mutation no longer owns every requested lock. */\n assertOwned(): void;\n /** Publish an idempotent, add-only discovery entry before its CAS record. */\n publish(...args: CommandArgument[]): Promise<unknown>;\n /** Atomically replace a value only when its last-read bytes are still current. */\n compareAndSet(key: string, expected: Buffer | undefined, value: Buffer): Promise<boolean>;\n}\n\ninterface RequiredLockOptions {\n readonly lockRetryMs: number;\n readonly lockTtlMs: number;\n readonly lockWaitMs: number;\n}\n\nconst DEFAULT_LOCK_OPTIONS: RequiredLockOptions = {\n lockRetryMs: 10,\n lockTtlMs: 300_000,\n lockWaitMs: 30_000\n};\n\nexport function normalizeKeyPrefix(value: string, defaultValue: string): string {\n const prefix = value.length === 0 ? defaultValue : value;\n if (prefix.includes(\"\\0\")) throw new TypeError(\"keyPrefix must not contain NUL bytes\");\n const normalized = prefix.replace(/:+$/u, \"\");\n if (normalized.length === 0) throw new TypeError(\"keyPrefix must contain a character other than ':'\");\n return normalized;\n}\n\nexport function positiveInteger(value: number | undefined, fallback: number, name: string): number {\n const normalized = value ?? fallback;\n if (!Number.isSafeInteger(normalized) || normalized <= 0) {\n throw new TypeError(`${name} must be a positive safe integer`);\n }\n return normalized;\n}\n\nexport function nonNegativeInteger(value: number | undefined, fallback: number, name: string): number {\n const normalized = value ?? fallback;\n if (!Number.isSafeInteger(normalized) || normalized < 0) {\n throw new TypeError(`${name} must be a non-negative safe integer`);\n }\n return normalized;\n}\n\nexport function textResponse(value: unknown, name: string): string {\n if (typeof value === \"string\") return value;\n if (Buffer.isBuffer(value) || value instanceof Uint8Array) return Buffer.from(value).toString(\"utf8\");\n throw new TypeError(`FerricStore returned an invalid ${name}`);\n}\n\nexport function arrayResponse(value: unknown, name: string): unknown[] {\n if (!Array.isArray(value)) throw new TypeError(`FerricStore returned an invalid ${name}`);\n return value;\n}\n\nexport function integerResponse(value: unknown, name: string): number {\n const parsed = typeof value === \"number\" ? value : Number(textResponse(value, name));\n if (!Number.isSafeInteger(parsed)) throw new TypeError(`FerricStore returned an invalid ${name}`);\n return parsed;\n}\n\nexport async function executeCommands(\n client: FerricStoreCommandClient,\n commands: readonly Command[]\n): Promise<unknown[]> {\n if (commands.length === 0) return [];\n if (client.pipeline != null) return await client.pipeline(commands);\n return await Promise.all(commands.map(async (command) => await client.command(...command)));\n}\n\nexport async function readAtomicValue(\n client: FerricStoreCommandClient,\n key: string,\n name: string\n): Promise<Buffer | undefined> {\n const value = await client.command(\"GET\", key);\n if (value == null) return undefined;\n if (typeof value === \"string\") return Buffer.from(value, \"utf8\");\n if (Buffer.isBuffer(value) || value instanceof Uint8Array) return Buffer.from(value);\n throw new TypeError(`FerricStore returned a non-binary ${name}`);\n}\n\nexport async function compareAndSetAtomicValue(\n client: FerricStoreCommandClient,\n key: string,\n expected: Buffer | undefined,\n value: Buffer\n): Promise<boolean> {\n if (expected == null) {\n const response = await client.command(\"SET\", key, value, \"NX\");\n if (response == null || response === false) return false;\n if (response === true) return true;\n return textResponse(response, \"SET NX response\").toUpperCase() === \"OK\";\n }\n const response = await client.command(\"CAS\", key, expected, value);\n if (response == null || response === false) return false;\n if (response === true) return true;\n return integerResponse(response, \"CAS response\") === 1;\n}\n\nexport async function withMutationLocks<T>(\n client: FerricStoreCommandClient,\n keys: readonly string[],\n operation: (lease: FerricStoreMutationLease) => Promise<T>,\n options: FerricStoreLockOptions = {}\n): Promise<T> {\n const orderedKeys = [...new Set(keys)].sort();\n if (orderedKeys.length === 0) {\n const signal = new AbortController().signal;\n return await operation({\n signal,\n assertOwned: () => undefined,\n publish: async (...args) => await additiveCommand(client, args),\n compareAndSet: async (key, expected, value) =>\n await compareAndSetAtomicValue(client, key, expected, value)\n });\n }\n\n const normalized: RequiredLockOptions = {\n lockRetryMs: positiveInteger(options.lockRetryMs, DEFAULT_LOCK_OPTIONS.lockRetryMs, \"lockRetryMs\"),\n lockTtlMs: positiveInteger(options.lockTtlMs, DEFAULT_LOCK_OPTIONS.lockTtlMs, \"lockTtlMs\"),\n lockWaitMs: nonNegativeInteger(options.lockWaitMs, DEFAULT_LOCK_OPTIONS.lockWaitMs, \"lockWaitMs\")\n };\n if (normalized.lockRetryMs >= normalized.lockTtlMs) {\n throw new TypeError(\"lockRetryMs must be less than lockTtlMs\");\n }\n const owner = randomUUID();\n const acquired: string[] = [];\n const deadline = performance.now() + normalized.lockWaitMs;\n let primaryError: unknown;\n let heartbeatError: unknown;\n let releaseError: unknown;\n let result: T | undefined;\n let operationCompleted = false;\n let conditionalCommitCompleted = false;\n const heartbeatAbort = new AbortController();\n const ownershipAbort = new AbortController();\n const lastExtended = new Map<string, number>();\n const loseOwnership = (error: unknown): Error => {\n const normalizedError = errorObject(error);\n heartbeatError ??= normalizedError;\n if (!ownershipAbort.signal.aborted) ownershipAbort.abort(normalizedError);\n return normalizedError;\n };\n const assertOwned = (): void => {\n if (heartbeatError != null) throw errorObject(heartbeatError);\n if (ownershipAbort.signal.aborted) throw errorObject(ownershipAbort.signal.reason);\n };\n const renewOwned = async (): Promise<void> => {\n assertOwned();\n for (const key of acquired) {\n try {\n const response = await client.command(\"EXTEND\", key, owner, normalized.lockTtlMs);\n if (integerResponse(response, \"EXTEND response\") !== 1) {\n throw new Error(`lost FerricStore lock ${JSON.stringify(key)} while mutating data`);\n }\n lastExtended.set(key, performance.now());\n } catch (error) {\n throw loseOwnership(new Error(\n `could not validate FerricStore lock ${JSON.stringify(key)} before mutating data`,\n { cause: error }\n ));\n }\n }\n assertOwned();\n };\n const lease: FerricStoreMutationLease = {\n signal: ownershipAbort.signal,\n assertOwned,\n publish: async (...args) => {\n await renewOwned();\n const response = await additiveCommand(client, args);\n assertOwned();\n return response;\n },\n compareAndSet: async (key, expected, value) => {\n await renewOwned();\n const committed = await compareAndSetAtomicValue(client, key, expected, value);\n if (committed) conditionalCommitCompleted = true;\n else assertOwned();\n return committed;\n }\n };\n\n try {\n for (const key of orderedKeys) {\n while (!(await tryAcquireLock(client, key, owner, normalized.lockTtlMs))) {\n if (performance.now() >= deadline) {\n throw new Error(`timed out acquiring FerricStore lock ${JSON.stringify(key)}`);\n }\n await extendAcquiredLocks(client, acquired, owner, normalized.lockTtlMs);\n await delay(normalized.lockRetryMs);\n }\n acquired.push(key);\n }\n await extendAcquiredLocks(client, acquired, owner, normalized.lockTtlMs);\n for (const key of acquired) lastExtended.set(key, performance.now());\n\n const heartbeat = renewLocks(\n client,\n acquired,\n owner,\n normalized.lockTtlMs,\n lastExtended,\n heartbeatAbort.signal,\n (error) => {\n loseOwnership(error);\n }\n );\n try {\n result = await operation(lease);\n operationCompleted = true;\n } catch (error) {\n primaryError = error;\n } finally {\n heartbeatAbort.abort();\n await heartbeat;\n }\n } catch (error) {\n primaryError ??= error;\n } finally {\n heartbeatAbort.abort();\n for (const key of acquired.reverse()) {\n try {\n await client.command(\"UNLOCK\", key, owner);\n } catch (error) {\n releaseError ??= error;\n }\n }\n }\n if (primaryError != null) throw errorObject(primaryError);\n if (heartbeatError != null && !conditionalCommitCompleted) throw errorObject(heartbeatError);\n if (releaseError != null && !(heartbeatError != null && conditionalCommitCompleted)) {\n throw errorObject(releaseError);\n }\n if (!operationCompleted) throw new Error(\"FerricStore mutation did not complete\");\n return result as T;\n}\n\nasync function additiveCommand(\n client: FerricStoreCommandClient,\n args: readonly CommandArgument[]\n): Promise<unknown> {\n const rawName = args[0];\n const name = typeof rawName === \"string\"\n ? rawName.toUpperCase()\n : Buffer.isBuffer(rawName) || rawName instanceof Uint8Array\n ? Buffer.from(rawName).toString(\"utf8\").toUpperCase()\n : \"\";\n if (name !== \"SADD\" && name !== \"ZADD\") {\n throw new TypeError(\"FerricStore mutation leases only publish add-only SADD or ZADD indexes\");\n }\n if (name === \"ZADD\" && (\n args.length < 4 ||\n args.length % 2 !== 0 ||\n args.slice(2).some((value, index) => index % 2 === 0 && Number(value) !== 0)\n )) {\n throw new TypeError(\"FerricStore mutation leases only publish zero-score ZADD indexes\");\n }\n return await client.command(...args);\n}\n\nasync function extendAcquiredLocks(\n client: FerricStoreCommandClient,\n keys: readonly string[],\n owner: string,\n ttlMs: number\n): Promise<void> {\n for (const key of keys) {\n const response = await client.command(\"EXTEND\", key, owner, ttlMs);\n if (integerResponse(response, \"EXTEND response\") !== 1) {\n throw new Error(`lost FerricStore lock ${JSON.stringify(key)} before mutating data`);\n }\n }\n}\n\nasync function tryAcquireLock(\n client: FerricStoreCommandClient,\n key: string,\n owner: string,\n ttlMs: number\n): Promise<boolean> {\n try {\n const response = await client.command(\"LOCK\", key, owner, ttlMs);\n return response === true || response === \"OK\" || Buffer.isBuffer(response) && response.equals(Buffer.from(\"OK\"));\n } catch (error) {\n if (error instanceof LockHeldError) return false;\n throw error;\n }\n}\n\nasync function renewLocks(\n client: FerricStoreCommandClient,\n keys: readonly string[],\n owner: string,\n ttlMs: number,\n lastExtended: Map<string, number>,\n signal: AbortSignal,\n onError: (error: unknown) => void\n): Promise<void> {\n const intervalMs = Math.max(Math.floor(ttlMs / 3), 1);\n const retryMs = Math.min(Math.max(Math.floor(intervalMs / 10), 1), 1_000);\n let waitMs = intervalMs;\n while (!signal.aborted) {\n try {\n await delay(waitMs, undefined, { signal });\n } catch (error) {\n if (signal.aborted) return;\n onError(error);\n return;\n }\n const now = performance.now();\n let retry = false;\n for (const key of keys) {\n try {\n const response = await client.command(\"EXTEND\", key, owner, ttlMs);\n if (integerResponse(response, \"EXTEND response\") !== 1) {\n onError(new Error(`lost FerricStore lock ${JSON.stringify(key)} while mutating data`));\n return;\n }\n lastExtended.set(key, now);\n } catch (error) {\n if (now - (lastExtended.get(key) ?? 0) >= ttlMs) {\n onError(new Error(`lost FerricStore lock ${JSON.stringify(key)} while mutating data`, { cause: error }));\n return;\n }\n retry = true;\n }\n }\n waitMs = retry ? retryMs : intervalMs;\n }\n}\n\nfunction errorObject(value: unknown): Error {\n return value instanceof Error ? value : new Error(\"FerricStore mutation failed\", { cause: value });\n}\n","export class FerricStoreError extends Error {\n readonly code: string = \"ferricstore_error\";\n readonly raw: unknown;\n readonly retryable: boolean | undefined;\n readonly safeToRetry: boolean | undefined;\n readonly retryAfterMs: number | undefined;\n\n constructor(message: string, options: {\n raw?: unknown;\n cause?: unknown;\n retryable?: boolean;\n safeToRetry?: boolean;\n retryAfterMs?: number;\n } = {}) {\n super(message, { cause: options.cause });\n this.name = new.target.name;\n this.raw = options.raw;\n this.retryable = options.retryable ?? structuredBooleanField(options.raw, \"retryable\");\n this.safeToRetry = options.safeToRetry ?? structuredBooleanField(options.raw, \"safe_to_retry\");\n this.retryAfterMs = options.retryAfterMs ?? structuredIntegerField(options.raw, \"retry_after_ms\");\n }\n}\n\nexport class HTTPTransportError extends FerricStoreError {\n override readonly code = \"http_transport\";\n readonly statusCode: number | undefined;\n\n constructor(message: string, options: ConstructorParameters<typeof FerricStoreError>[1] & {\n statusCode?: number;\n } = {}) {\n super(message, options);\n this.statusCode = options.statusCode;\n }\n}\n\nexport type RequestDisposition = \"unsent\" | \"possibly_sent\";\n/** @deprecated Use RequestDisposition; retained for source compatibility. */\nexport type ConnectionRequestDisposition = RequestDisposition;\n\n/** Connection closure annotated with whether the current request may have reached the server. */\nexport class ConnectionClosedError extends FerricStoreError {\n override readonly code = \"connection_closed\";\n readonly requestDisposition: RequestDisposition;\n\n constructor(\n requestDisposition: RequestDisposition,\n options: { raw?: unknown; cause?: unknown; message?: string } = {}\n ) {\n super(\n options.message ?? (requestDisposition === \"unsent\"\n ? \"FerricStore connection is closed\"\n : \"FerricStore connection closed\"),\n options\n );\n this.requestDisposition = requestDisposition;\n }\n}\n\n/** Request timeout annotated with whether the request may have reached the server. */\nexport class RequestTimeoutError extends FerricStoreError {\n override readonly code = \"request_timeout\";\n readonly requestDisposition: RequestDisposition;\n readonly timeoutMs: number;\n\n constructor(\n timeoutMs: number,\n requestDisposition: RequestDisposition,\n options: { raw?: unknown; cause?: unknown } = {}\n ) {\n super(`FerricStore request timed out after ${timeoutMs}ms`, options);\n this.requestDisposition = requestDisposition;\n this.timeoutMs = timeoutMs;\n }\n}\n\nexport class FlowNotFoundError extends FerricStoreError {\n override readonly code = \"flow_not_found\";\n}\n\nexport class FlowWrongStateError extends FerricStoreError {\n override readonly code = \"flow_wrong_state\";\n}\n\nexport class StaleLeaseError extends FerricStoreError {\n override readonly code = \"stale_lease\";\n}\n\n/** FLOW.POLICY.SET expected_generation did not match the stored generation. */\nexport class StalePolicyGenerationError extends FerricStoreError {\n override readonly code = \"stale_policy_generation\";\n}\n\nexport class FlowAlreadyExistsError extends FerricStoreError {\n override readonly code = \"flow_already_exists\";\n}\n\nexport class LockHeldError extends FerricStoreError {\n override readonly code = \"lock_held\";\n}\n\nexport class LockNotOwnedError extends FerricStoreError {\n override readonly code = \"lock_not_owned\";\n}\n\nexport class InvalidCommandError extends FerricStoreError {\n override readonly code = \"invalid_command\";\n}\n\nexport class OverloadedError extends FerricStoreError {\n override readonly code = \"overloaded\";\n readonly reason: string | undefined;\n\n constructor(\n message: string,\n options: {\n raw?: unknown;\n cause?: unknown;\n retryAfterMs?: number;\n reason?: string;\n retryable?: boolean;\n safeToRetry?: boolean;\n } = {}\n ) {\n const local = options.raw == null;\n super(message, {\n ...options,\n retryable: options.retryable ?? (local ? true : undefined),\n safeToRetry: options.safeToRetry ?? (local ? true : undefined)\n });\n this.reason = options.reason;\n }\n}\n\n/** The contacted endpoint cannot serve this route and topology should be refreshed. */\nexport class RerouteError extends FerricStoreError {\n override readonly code = \"reroute\";\n}\n\nconst OVERLOAD_CODES = new Set([\n \"backpressure\",\n \"busy\",\n \"flow_control_window_exhausted\",\n \"lane_queue_full\",\n \"overloaded\"\n]);\n\nexport function classifyServerError(\n message: string,\n raw?: unknown,\n cause?: unknown,\n status?: number | string\n): FerricStoreError {\n const lower = message.toLowerCase();\n const structuredCode = structuredStringField(raw, \"code\");\n const code = structuredCode?.toLowerCase();\n const retry = {\n retryable: structuredBooleanField(raw, \"retryable\"),\n safeToRetry: structuredBooleanField(raw, \"safe_to_retry\"),\n retryAfterMs: structuredIntegerField(raw, \"retry_after_ms\") ?? intField(lower, \"retry_after_ms\")\n };\n\n if (isRerouteStatus(status) || code === \"reroute\") {\n return new RerouteError(message, { cause, raw, ...definedRetryMetadata(retry) });\n }\n if (isBusyStatus(status) || isOverloadCode(structuredCode) || overloadMessage(lower)) {\n return new OverloadedError(message, {\n cause,\n raw,\n ...definedRetryMetadata(retry),\n reason: structuredStringField(raw, \"reason\") ?? structuredCode ?? stringField(lower, \"reason\"),\n retryAfterMs: retry.retryAfterMs\n });\n }\n if (code === \"flow_already_exists\" || (lower.includes(\"flow\") && lower.includes(\"already exists\"))) {\n return new FlowAlreadyExistsError(message, { cause, raw });\n }\n if (lower.includes(\"flow wrong state\") || code === \"flow_wrong_state\") {\n return new FlowWrongStateError(message, { cause, raw });\n }\n if (\n code === \"stale_lease\"\n || code === \"stale_flow_lease\"\n || lower.includes(\"stale flow lease\")\n || lower.includes(\"stale lease\")\n || lower.includes(\"stale token\")\n ) {\n return new StaleLeaseError(message, { cause, raw });\n }\n if (\n code === \"stale_generation\"\n || code === \"stale_policy_generation\"\n || code === \"stale_flow_policy_generation\"\n || lower.includes(\"stale flow policy generation\")\n || lower.includes(\"stale policy generation\")\n ) {\n return new StalePolicyGenerationError(message, { cause, raw });\n }\n if (\n code === \"flow_not_found\"\n || (lower.includes(\"flow\") && (lower.includes(\"not found\") || lower.includes(\"does not exist\")))\n ) {\n return new FlowNotFoundError(message, { cause, raw });\n }\n if (code === \"lock_held\" || lower.includes(\"lock is held\") || lower.includes(\"held by another owner\")) {\n return new LockHeldError(message, { cause, raw });\n }\n if (code === \"lock_not_owned\" || lower.includes(\"not the lock owner\") || lower.includes(\"caller is not the lock owner\")) {\n return new LockNotOwnedError(message, { cause, raw });\n }\n if (code === \"invalid_command\" || lower.includes(\"wrong number of arguments\") || lower.includes(\"syntax error\")) {\n return new InvalidCommandError(message, { cause, raw });\n }\n\n return new FerricStoreError(message, { cause, raw, ...definedRetryMetadata(retry) });\n}\n\nexport function mapException(error: unknown): unknown {\n if (error instanceof FerricStoreError) {\n return error;\n }\n\n if (!(error instanceof Error)) {\n return error;\n }\n\n const message = error.message;\n const serverLike =\n error.name === \"ResponseError\" ||\n message.startsWith(\"ERR \") ||\n message.startsWith(\"WRONGTYPE \") ||\n message.startsWith(\"DISTLOCK \");\n\n if (!serverLike) {\n return error;\n }\n\n return classifyServerError(message, error, error);\n}\n\nfunction intField(message: string, name: string): number | undefined {\n const match = new RegExp(`\\\\b${name}=([0-9]+)\\\\b`).exec(message);\n return match?.[1] == null ? undefined : nonNegativeSafeIntegerText(match[1]);\n}\n\nfunction isBusyStatus(status: number | string | undefined): boolean {\n return status === 4 || (typeof status === \"string\" && (status === \"4\" || status.toLowerCase() === \"busy\"));\n}\n\nfunction isRerouteStatus(status: number | string | undefined): boolean {\n return status === 5 || (typeof status === \"string\" && (status === \"5\" || status.toLowerCase() === \"reroute\"));\n}\n\nfunction isOverloadCode(code: string | undefined): boolean {\n return code != null && OVERLOAD_CODES.has(code.toLowerCase());\n}\n\nfunction overloadMessage(message: string): boolean {\n return /\\boverloaded\\b/u.test(message) || /(?:^|\\s)busy(?:\\s|:|$)/u.test(message);\n}\n\nfunction structuredIntegerField(raw: unknown, name: string): number | undefined {\n const value = structuredField(raw, name);\n if (typeof value === \"number\") {\n return Number.isSafeInteger(value) && value >= 0 ? value : undefined;\n }\n if (typeof value === \"bigint\") {\n return value >= 0n && value <= BigInt(Number.MAX_SAFE_INTEGER) ? Number(value) : undefined;\n }\n const text = binaryText(value);\n return text == null ? undefined : nonNegativeSafeIntegerText(text);\n}\n\nfunction structuredBooleanField(raw: unknown, name: string): boolean | undefined {\n const value = structuredField(raw, name);\n if (typeof value === \"boolean\") return value;\n const text = binaryText(value)?.toLowerCase();\n if (text === \"true\" || text === \"1\") return true;\n if (text === \"false\" || text === \"0\") return false;\n return undefined;\n}\n\nfunction definedRetryMetadata(metadata: {\n readonly retryable?: boolean;\n readonly safeToRetry?: boolean;\n readonly retryAfterMs?: number;\n}): { retryable?: boolean; safeToRetry?: boolean; retryAfterMs?: number } {\n return {\n ...(metadata.retryable == null ? {} : { retryable: metadata.retryable }),\n ...(metadata.safeToRetry == null ? {} : { safeToRetry: metadata.safeToRetry }),\n ...(metadata.retryAfterMs == null ? {} : { retryAfterMs: metadata.retryAfterMs })\n };\n}\n\nfunction nonNegativeSafeIntegerText(value: string): number | undefined {\n if (!/^[0-9]+$/u.test(value)) return undefined;\n const parsed = Number.parseInt(value, 10);\n return Number.isSafeInteger(parsed) && parsed >= 0 ? parsed : undefined;\n}\n\nfunction structuredStringField(raw: unknown, name: string): string | undefined {\n return binaryText(structuredField(raw, name));\n}\n\nfunction structuredField(raw: unknown, name: string): unknown {\n if (raw instanceof Map) {\n if (raw.has(name)) return raw.get(name);\n for (const [key, value] of raw.entries()) {\n if (binaryText(key) === name) return value;\n }\n return undefined;\n }\n if (typeof raw === \"object\" && raw != null && Object.hasOwn(raw, name)) {\n return (raw as Record<string, unknown>)[name];\n }\n return undefined;\n}\n\nfunction binaryText(value: unknown): string | undefined {\n if (typeof value === \"string\") return value;\n if (Buffer.isBuffer(value) || value instanceof Uint8Array) return Buffer.from(value).toString(\"utf8\");\n return undefined;\n}\n\nfunction stringField(message: string, name: string): string | undefined {\n const match = new RegExp(`\\\\b${name}=([a-z0-9_:-]+)\\\\b`).exec(message);\n return match?.[1];\n}\n","import { createHash } from \"node:crypto\";\n\ntype EncodedSnapshot =\n | [\"array\", EncodedSnapshot[]]\n | [\"binary\", string]\n | [\"boolean\", boolean]\n | [\"null\"]\n | [\"number\", number | \"NaN\" | \"+Infinity\" | \"-Infinity\" | \"-0\"]\n | [\"object\", [string, EncodedSnapshot][]]\n | [\"string\", string]\n | [\"undefined\"];\n\nexport function encodeSnapshot(value: unknown): Buffer {\n return encodeSnapshotWith(value, defaultKeyComparator);\n}\n\nexport function decodeSnapshot<T>(value: unknown, name: string): T {\n const bytes = typeof value === \"string\" ? Buffer.from(value, \"utf8\") : Buffer.from(asBytes(value, name));\n let encoded: unknown;\n try {\n encoded = JSON.parse(bytes.toString(\"utf8\"));\n } catch (error) {\n throw new Error(`FerricStore returned an invalid ${name}`, { cause: error });\n }\n return restore(encoded, name) as T;\n}\n\nexport function snapshotDigest(value: unknown): string {\n return createHash(\"sha256\").update(encodeSnapshot(value)).digest(\"hex\");\n}\n\n/** @internal Compatibility digest for receipts written before deterministic key ordering. */\nexport function legacySnapshotDigest(value: unknown, locale?: string): string {\n return createHash(\"sha256\")\n .update(encodeSnapshotWith(value, (left, right) => left.localeCompare(right, locale)))\n .digest(\"hex\");\n}\n\nexport function cloneSnapshot<T>(value: T): T {\n return decodeSnapshot<T>(encodeSnapshot(value), \"snapshot\");\n}\n\nexport function snapshotsEqual(left: unknown, right: unknown): boolean {\n return encodeSnapshot(left).equals(encodeSnapshot(right));\n}\n\nfunction encodeSnapshotWith(value: unknown, compareKeys: (left: string, right: string) => number): Buffer {\n return Buffer.from(JSON.stringify(snapshot(value, new WeakSet(), compareKeys)), \"utf8\");\n}\n\nfunction defaultKeyComparator(left: string, right: string): number {\n return left < right ? -1 : left > right ? 1 : 0;\n}\n\nfunction snapshot(\n value: unknown,\n ancestors: WeakSet<object>,\n compareKeys: (left: string, right: string) => number\n): EncodedSnapshot {\n if (value === null) return [\"null\"];\n if (value === undefined) return [\"undefined\"];\n if (typeof value === \"string\") return [\"string\", value];\n if (typeof value === \"boolean\") return [\"boolean\", value];\n if (typeof value === \"number\") {\n if (Object.is(value, -0)) return [\"number\", \"-0\"];\n if (Number.isNaN(value)) return [\"number\", \"NaN\"];\n if (value === Infinity) return [\"number\", \"+Infinity\"];\n if (value === -Infinity) return [\"number\", \"-Infinity\"];\n return [\"number\", value];\n }\n if (typeof value !== \"object\") throw new TypeError(\"session history contains unsupported data\");\n if (value instanceof Uint8Array) {\n const keys = Reflect.ownKeys(value);\n if (\n keys.length !== value.length ||\n keys.some((key) => typeof key !== \"string\" || !isArrayIndex(key, value.length))\n ) {\n throw new TypeError(\"session history binary data contains custom properties\");\n }\n return [\"binary\", Buffer.from(value).toString(\"base64\")];\n }\n if (ancestors.has(value)) throw new TypeError(\"session history contains cyclic data\");\n ancestors.add(value);\n try {\n if (Array.isArray(value)) {\n const keys = Reflect.ownKeys(value);\n if (\n keys.length !== value.length + 1 ||\n keys.some((key) => typeof key !== \"string\" || key !== \"length\" && !isArrayIndex(key, value.length))\n ) {\n throw new TypeError(\"session history contains a sparse or customized array\");\n }\n const items: EncodedSnapshot[] = [];\n for (let index = 0; index < value.length; index += 1) {\n const descriptor = Object.getOwnPropertyDescriptor(value, String(index));\n if (descriptor == null || !descriptor.enumerable || !(\"value\" in descriptor)) {\n throw new TypeError(\"session history contains an unsupported array item\");\n }\n items.push(snapshot(descriptor.value as unknown, ancestors, compareKeys));\n }\n return [\"array\", items];\n }\n const prototype: unknown = Object.getPrototypeOf(value);\n if (prototype !== Object.prototype && prototype !== null) {\n throw new TypeError(\"session history contains an unsupported object\");\n }\n const keys = Reflect.ownKeys(value);\n if (keys.some((key) => typeof key !== \"string\")) {\n throw new TypeError(\"session history contains a symbol property\");\n }\n const entries: [string, EncodedSnapshot][] = [];\n for (const key of (keys as string[]).sort(compareKeys)) {\n const descriptor = Object.getOwnPropertyDescriptor(value, key);\n if (descriptor == null || !descriptor.enumerable || !(\"value\" in descriptor)) {\n throw new TypeError(\"session history contains an unsupported property\");\n }\n entries.push([key, snapshot(descriptor.value as unknown, ancestors, compareKeys)]);\n }\n return [\"object\", entries];\n } finally {\n ancestors.delete(value);\n }\n}\n\nfunction restore(value: unknown, name: string): unknown {\n if (!Array.isArray(value) || typeof value[0] !== \"string\") throw new TypeError(`invalid ${name}`);\n switch (value[0]) {\n case \"null\": return null;\n case \"undefined\": return undefined;\n case \"string\": return requireValueType(value[1], \"string\", name);\n case \"boolean\": return requireValueType(value[1], \"boolean\", name);\n case \"binary\": return Buffer.from(requireValueType(value[1], \"string\", name), \"base64\");\n case \"number\": return restoreNumber(value[1], name);\n case \"array\": {\n if (!Array.isArray(value[1])) throw new TypeError(`invalid ${name}`);\n return value[1].map((item) => restore(item, name));\n }\n case \"object\": {\n if (!Array.isArray(value[1])) throw new TypeError(`invalid ${name}`);\n const result: Record<string, unknown> = {};\n for (const entry of value[1]) {\n if (!Array.isArray(entry) || entry.length !== 2 || typeof entry[0] !== \"string\") {\n throw new TypeError(`invalid ${name}`);\n }\n Object.defineProperty(result, entry[0], {\n configurable: true,\n enumerable: true,\n value: restore(entry[1], name),\n writable: true\n });\n }\n return result;\n }\n default: throw new TypeError(`invalid ${name}`);\n }\n}\n\nfunction restoreNumber(value: unknown, name: string): number {\n if (typeof value === \"number\") return value;\n if (value === \"NaN\") return Number.NaN;\n if (value === \"+Infinity\") return Infinity;\n if (value === \"-Infinity\") return -Infinity;\n if (value === \"-0\") return -0;\n throw new TypeError(`invalid ${name}`);\n}\n\nfunction requireValueType<T extends \"boolean\" | \"string\">(\n value: unknown,\n type: T,\n name: string\n): T extends \"string\" ? string : boolean {\n if (typeof value !== type) throw new TypeError(`invalid ${name}`);\n return value as T extends \"string\" ? string : boolean;\n}\n\nfunction asBytes(value: unknown, name: string): Uint8Array {\n if (Buffer.isBuffer(value) || value instanceof Uint8Array) return value;\n throw new TypeError(`FerricStore returned a non-binary ${name}`);\n}\n\nfunction isArrayIndex(key: string, length: number): boolean {\n if (!/^(?:0|[1-9]\\d*)$/u.test(key)) return false;\n const index = Number(key);\n return Number.isSafeInteger(index) && index >= 0 && index < length;\n}\n"],"mappings":";AAAA,SAAS,cAAAA,aAAY,cAAAC,mBAAkB;;;ACAvC,SAAS,kBAAkB;AAC3B,SAAS,cAAc,aAAa;;;ACD7B,IAAM,mBAAN,cAA+B,MAAM;AAAA,EACjC,OAAe;AAAA,EACf;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,SAAiB,UAMzB,CAAC,GAAG;AACN,UAAM,SAAS,EAAE,OAAO,QAAQ,MAAM,CAAC;AACvC,SAAK,OAAO,WAAW;AACvB,SAAK,MAAM,QAAQ;AACnB,SAAK,YAAY,QAAQ,aAAa,uBAAuB,QAAQ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AQ,YAAY,cAAc,KAAK,CAAC,MAAM,QAAQ,YAAY,WAAW,GAAG;AACzF,YAAM,IAAI,UAAU,+CAA+C;AAAA,IACrE;AACA,WAAO;AAAA,MACL,aAAa,KAAK;AAAA,MAClB,aAAa;AAAA,QACX,MAAM;AAAA,QACN,gBAAgB,cAAc,YAAY,gBAAgB,4BAA4B;AAAA,QACtF,aAAa,cAAc,YAAY,aAAa,yBAAyB;AAAA,MAC/E;AAAA,IACF;AAAA,EACF;AACA,QAAM,IAAI,UAAU,8CAA8C;AACpE;AAEA,SAAS,cAAc,OAAyB,MAAgC;AAC9E,MAAI,CAAC,MAAM,QAAQ,KAAK,EAAG,OAAM,IAAI,UAAU,GAAG,IAAI,mBAAmB;AACzE,SAAO,MAAM,IAAI,CAAC,SAAS,aAAa,MAAM,IAAI,CAAC;AACrD;AAEA,SAAS,aAAa,MAAsB,MAA8B;AACxE,MAAI,QAAQ,QAAQ,OAAO,SAAS,YAAY,MAAM,QAAQ,IAAI,GAAG;AACnE,UAAM,IAAI,UAAU,GAAG,IAAI,iCAAiC;AAAA,EAC9D;AACA,SAAO,cAAc,IAAI;AAC3B;","names":["createHash","randomUUID","response","keys","randomUUID","createHash","snapshot"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
window.hierarchyData = "eJyt1E1LAzEQBuD/MudszX6ka3PzIh4EwXorPYTtdDc0TZZJtEjZ/y67xVKs0a31MoeQefMwDNkDORc8yEUhOCuEWDIgXBusgnbWg9xD3hertggS7pFIV/PgCOfovXb2qT1cZLDRdgUyE1MGr2RAgrYBaa0q9DeuRat0omq0wU+iKZMmbA0wqIzyHiQEv0r62OQYBR2DNP1RdKSk2e0nZQgc4YgCDgcdg4yXkdfVG9K4aRhl65pU20wi/ePmkEcpfbmGctI/jlII/j3l0VWbKyQn7SMgDKpGmxWhBbnIWcZLlvNyOfjEie/roozZ2d8WJKJIU1aUMyb4dGCUs3PGg/bB0fsz7kgHvNup802+ABhPu5zekwWfRskvpKxXw0/xT+xI4l/oXfcBwM+vlw=="
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--light-hl-0: #795E26;
|
|
3
|
+
--dark-hl-0: #DCDCAA;
|
|
4
|
+
--light-hl-1: #000000;
|
|
5
|
+
--dark-hl-1: #D4D4D4;
|
|
6
|
+
--light-hl-2: #A31515;
|
|
7
|
+
--dark-hl-2: #CE9178;
|
|
8
|
+
--light-hl-3: #AF00DB;
|
|
9
|
+
--dark-hl-3: #C586C0;
|
|
10
|
+
--light-hl-4: #001080;
|
|
11
|
+
--dark-hl-4: #9CDCFE;
|
|
12
|
+
--light-hl-5: #0000FF;
|
|
13
|
+
--dark-hl-5: #569CD6;
|
|
14
|
+
--light-hl-6: #0070C1;
|
|
15
|
+
--dark-hl-6: #4FC1FF;
|
|
16
|
+
--light-hl-7: #267F99;
|
|
17
|
+
--dark-hl-7: #4EC9B0;
|
|
18
|
+
--light-hl-8: #098658;
|
|
19
|
+
--dark-hl-8: #B5CEA8;
|
|
20
|
+
--light-hl-9: #008000;
|
|
21
|
+
--dark-hl-9: #6A9955;
|
|
22
|
+
--light-code-background: #FFFFFF;
|
|
23
|
+
--dark-code-background: #1E1E1E;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@media (prefers-color-scheme: light) { :root {
|
|
27
|
+
--hl-0: var(--light-hl-0);
|
|
28
|
+
--hl-1: var(--light-hl-1);
|
|
29
|
+
--hl-2: var(--light-hl-2);
|
|
30
|
+
--hl-3: var(--light-hl-3);
|
|
31
|
+
--hl-4: var(--light-hl-4);
|
|
32
|
+
--hl-5: var(--light-hl-5);
|
|
33
|
+
--hl-6: var(--light-hl-6);
|
|
34
|
+
--hl-7: var(--light-hl-7);
|
|
35
|
+
--hl-8: var(--light-hl-8);
|
|
36
|
+
--hl-9: var(--light-hl-9);
|
|
37
|
+
--code-background: var(--light-code-background);
|
|
38
|
+
} }
|
|
39
|
+
|
|
40
|
+
@media (prefers-color-scheme: dark) { :root {
|
|
41
|
+
--hl-0: var(--dark-hl-0);
|
|
42
|
+
--hl-1: var(--dark-hl-1);
|
|
43
|
+
--hl-2: var(--dark-hl-2);
|
|
44
|
+
--hl-3: var(--dark-hl-3);
|
|
45
|
+
--hl-4: var(--dark-hl-4);
|
|
46
|
+
--hl-5: var(--dark-hl-5);
|
|
47
|
+
--hl-6: var(--dark-hl-6);
|
|
48
|
+
--hl-7: var(--dark-hl-7);
|
|
49
|
+
--hl-8: var(--dark-hl-8);
|
|
50
|
+
--hl-9: var(--dark-hl-9);
|
|
51
|
+
--code-background: var(--dark-code-background);
|
|
52
|
+
} }
|
|
53
|
+
|
|
54
|
+
:root[data-theme='light'] {
|
|
55
|
+
--hl-0: var(--light-hl-0);
|
|
56
|
+
--hl-1: var(--light-hl-1);
|
|
57
|
+
--hl-2: var(--light-hl-2);
|
|
58
|
+
--hl-3: var(--light-hl-3);
|
|
59
|
+
--hl-4: var(--light-hl-4);
|
|
60
|
+
--hl-5: var(--light-hl-5);
|
|
61
|
+
--hl-6: var(--light-hl-6);
|
|
62
|
+
--hl-7: var(--light-hl-7);
|
|
63
|
+
--hl-8: var(--light-hl-8);
|
|
64
|
+
--hl-9: var(--light-hl-9);
|
|
65
|
+
--code-background: var(--light-code-background);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
:root[data-theme='dark'] {
|
|
69
|
+
--hl-0: var(--dark-hl-0);
|
|
70
|
+
--hl-1: var(--dark-hl-1);
|
|
71
|
+
--hl-2: var(--dark-hl-2);
|
|
72
|
+
--hl-3: var(--dark-hl-3);
|
|
73
|
+
--hl-4: var(--dark-hl-4);
|
|
74
|
+
--hl-5: var(--dark-hl-5);
|
|
75
|
+
--hl-6: var(--dark-hl-6);
|
|
76
|
+
--hl-7: var(--dark-hl-7);
|
|
77
|
+
--hl-8: var(--dark-hl-8);
|
|
78
|
+
--hl-9: var(--dark-hl-9);
|
|
79
|
+
--code-background: var(--dark-code-background);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.hl-0 { color: var(--hl-0); }
|
|
83
|
+
.hl-1 { color: var(--hl-1); }
|
|
84
|
+
.hl-2 { color: var(--hl-2); }
|
|
85
|
+
.hl-3 { color: var(--hl-3); }
|
|
86
|
+
.hl-4 { color: var(--hl-4); }
|
|
87
|
+
.hl-5 { color: var(--hl-5); }
|
|
88
|
+
.hl-6 { color: var(--hl-6); }
|
|
89
|
+
.hl-7 { color: var(--hl-7); }
|
|
90
|
+
.hl-8 { color: var(--hl-8); }
|
|
91
|
+
.hl-9 { color: var(--hl-9); }
|
|
92
|
+
pre, code, math[display='block'] { background: var(--code-background); }
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
(function() {
|
|
2
|
+
addIcons();
|
|
3
|
+
function addIcons() {
|
|
4
|
+
if (document.readyState === "loading") return document.addEventListener("DOMContentLoaded", addIcons);
|
|
5
|
+
const svg = document.body.appendChild(document.createElementNS("http://www.w3.org/2000/svg", "svg"));
|
|
6
|
+
svg.innerHTML = `<symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Module" id="icon-1"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-module)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">M</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Module" id="icon-2"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-module)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">M</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Namespace" id="icon-4"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">N</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Enumeration" id="icon-8"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-enum)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">E</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Enumeration Member" id="icon-16"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-property)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">P</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Variable" id="icon-32"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-variable)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">V</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Function" id="icon-64"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">F</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Class" id="icon-128"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-class)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">C</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Interface" id="icon-256"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-interface)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">I</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Constructor" id="icon-512"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-constructor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">C</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Property" id="icon-1024"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-property)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">P</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Method" id="icon-2048"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-method)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">M</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Function" id="icon-4096"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">F</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Index Signature" id="icon-8192"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-property)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">P</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Constructor" id="icon-16384"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-constructor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">C</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Property" id="icon-32768"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-property)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">P</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Type Alias" id="icon-65536"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">T</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Type Alias" id="icon-131072"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">T</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Accessor" id="icon-262144"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-accessor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">A</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Accessor" id="icon-524288"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-accessor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">A</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Accessor" id="icon-1048576"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-accessor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">A</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Type Alias" id="icon-2097152"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">T</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Reference" id="icon-4194304"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-reference)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">R</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Document" id="icon-8388608"><rect fill="var(--color-icon-background)" stroke="var(--color-document)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><g stroke="var(--color-icon-text)" fill="none" stroke-width="1.5"><polygon points="6,5 6,19 18,19, 18,10 13,5"></polygon><line x1="9" y1="9" x2="13" y2="9"></line><line x1="9" y1="12" x2="15" y2="12"></line><line x1="9" y1="15" x2="15" y2="15"></line></g></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Folder" id="icon-folder"><rect fill="var(--color-icon-background)" stroke="var(--color-document)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><g stroke="var(--color-icon-text)" fill="none" stroke-width="1.5"><polygon points="5,5 10,5 12,8 19,8 19,18 5,18"></polygon></g></symbol><symbol width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true" id="icon-chevronDown" class="tsd-no-select"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-icon-text)"></path></symbol><symbol width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true" id="icon-chevronSmall" class="tsd-no-select"><path d="M1.5 5.50969L8 11.6609L14.5 5.50969L12.5466 3.66086L8 7.96494L3.45341 3.66086L1.5 5.50969Z" fill="var(--color-icon-text)"></path></symbol><symbol width="32" height="32" viewBox="0 0 32 32" aria-hidden="true" id="icon-checkbox" class="tsd-no-select"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></symbol><symbol width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true" id="icon-menu" class="tsd-no-select"><rect x="1" y="3" width="14" height="2" fill="var(--color-icon-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-icon-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-icon-text)"></rect></symbol><symbol width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true" id="icon-search" class="tsd-no-select"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-icon-text)"></path></symbol><symbol viewBox="0 0 24 24" aria-hidden="true" id="icon-anchor" class="tsd-no-select"><g stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></g></symbol><symbol xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" id="icon-alertNote" class="tsd-no-select"><path fill="var(--color-alert-note)" d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></symbol><symbol width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" id="icon-alertTip" class="tsd-no-select"><path fill="var(--color-alert-tip)" d="M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z"></path></symbol><symbol width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" id="icon-alertImportant" class="tsd-no-select"><path fill="var(--color-alert-important)" d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></symbol><symbol width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" id="icon-alertWarning" class="tsd-no-select"><path fill="var(--color-alert-warning)" d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></symbol><symbol width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" id="icon-alertCaution" class="tsd-no-select"><path fill="var(--color-alert-caution)" d="M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></symbol>`;
|
|
7
|
+
svg.style.display = "none";
|
|
8
|
+
if (location.protocol === "file:") updateUseElements();
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function updateUseElements() {
|
|
12
|
+
document.querySelectorAll("use").forEach(el => {
|
|
13
|
+
if (el.getAttribute("href").includes("#icon-")) {
|
|
14
|
+
el.setAttribute("href", el.getAttribute("href").replace(/.*#/, "#"));
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
})()
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg"><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Module" id="icon-1"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-module)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">M</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Module" id="icon-2"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-module)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">M</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Namespace" id="icon-4"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">N</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Enumeration" id="icon-8"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-enum)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">E</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Enumeration Member" id="icon-16"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-property)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">P</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Variable" id="icon-32"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-variable)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">V</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Function" id="icon-64"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">F</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Class" id="icon-128"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-class)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">C</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Interface" id="icon-256"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-interface)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">I</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Constructor" id="icon-512"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-constructor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">C</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Property" id="icon-1024"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-property)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">P</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Method" id="icon-2048"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-method)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">M</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Function" id="icon-4096"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">F</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Index Signature" id="icon-8192"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-property)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">P</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Constructor" id="icon-16384"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-constructor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">C</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Property" id="icon-32768"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-property)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">P</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Type Alias" id="icon-65536"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">T</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Type Alias" id="icon-131072"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">T</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Accessor" id="icon-262144"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-accessor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">A</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Accessor" id="icon-524288"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-accessor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">A</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Accessor" id="icon-1048576"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-accessor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">A</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Type Alias" id="icon-2097152"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">T</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Reference" id="icon-4194304"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-reference)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">R</text></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Document" id="icon-8388608"><rect fill="var(--color-icon-background)" stroke="var(--color-document)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><g stroke="var(--color-icon-text)" fill="none" stroke-width="1.5"><polygon points="6,5 6,19 18,19, 18,10 13,5"></polygon><line x1="9" y1="9" x2="13" y2="9"></line><line x1="9" y1="12" x2="15" y2="12"></line><line x1="9" y1="15" x2="15" y2="15"></line></g></symbol><symbol class="tsd-kind-icon tsd-no-select" viewBox="0 0 24 24" aria-label="Folder" id="icon-folder"><rect fill="var(--color-icon-background)" stroke="var(--color-document)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><g stroke="var(--color-icon-text)" fill="none" stroke-width="1.5"><polygon points="5,5 10,5 12,8 19,8 19,18 5,18"></polygon></g></symbol><symbol width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true" id="icon-chevronDown" class="tsd-no-select"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-icon-text)"></path></symbol><symbol width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true" id="icon-chevronSmall" class="tsd-no-select"><path d="M1.5 5.50969L8 11.6609L14.5 5.50969L12.5466 3.66086L8 7.96494L3.45341 3.66086L1.5 5.50969Z" fill="var(--color-icon-text)"></path></symbol><symbol width="32" height="32" viewBox="0 0 32 32" aria-hidden="true" id="icon-checkbox" class="tsd-no-select"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></symbol><symbol width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true" id="icon-menu" class="tsd-no-select"><rect x="1" y="3" width="14" height="2" fill="var(--color-icon-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-icon-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-icon-text)"></rect></symbol><symbol width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true" id="icon-search" class="tsd-no-select"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-icon-text)"></path></symbol><symbol viewBox="0 0 24 24" aria-hidden="true" id="icon-anchor" class="tsd-no-select"><g stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></g></symbol><symbol xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" id="icon-alertNote" class="tsd-no-select"><path fill="var(--color-alert-note)" d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></symbol><symbol width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" id="icon-alertTip" class="tsd-no-select"><path fill="var(--color-alert-tip)" d="M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z"></path></symbol><symbol width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" id="icon-alertImportant" class="tsd-no-select"><path fill="var(--color-alert-important)" d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></symbol><symbol width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" id="icon-alertWarning" class="tsd-no-select"><path fill="var(--color-alert-warning)" d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></symbol><symbol width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" id="icon-alertCaution" class="tsd-no-select"><path fill="var(--color-alert-caution)" d="M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></symbol></svg>
|