@jeffusion/bungee-core 5.23.1 → 5.23.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.
@@ -16,7 +16,7 @@
16
16
  "/** Public same-process plugin services. Cross-process callers require the host RPC adapter. */\nimport type { PluginServiceDeclarations, PluginServiceProcess } from './plugin-services/contracts';\nimport { assertSupportedServiceDeclarations, isCrossProcessSelfSnapshot } from './plugin-services/contracts';\nimport { AsyncLocalStorage } from 'node:async_hooks';\nimport { HostRpcAdapter, RpcServiceError, type HostRpcAdapterOptions, type HostRpcLifecycleIdentity, type HostRpcOwnerHandle, type HostRpcInvocationContext, type HostRpcLeaseRequest, type HostRpcLeaseGrant, type HostRpcHandlerFrame } from './plugin-services/host-rpc';\nimport type { RpcCallPurpose, RpcMethodDefinition } from './plugin-services/wire-contract';\nimport type { HostChannelOperation, HostChannelOwnerHandle, PluginChannelCapabilities, PluginChannelOwnerInput, PluginEventServices, PluginSnapshotServices, PluginStreamServices } from './plugin-services/channels';\nexport { defineRpcService } from './plugin-services/wire-contract';\nexport { RpcServiceError } from './plugin-services/host-rpc';\nexport { HostSnapshotStore, type HostSnapshotStoreOptions } from './plugin-services/snapshot-store';\nexport type { AsyncRpcClient, HostRpcCommandCapabilities, RpcCallOptions, RpcServiceErrorCode } from './plugin-services/host-rpc';\nexport type { RpcHandlerMap, RpcHandlerContext } from './plugin-services/rpc-runtime';\nexport type { RpcDataSchema, RpcMethodDefinition, InferRpcData } from './plugin-services/wire-contract';\nexport type { PluginServiceDeclarations, PluginServicePublication, PluginServiceConsumption, PluginServiceProcess, PluginServiceKind, PluginServiceScope } from './plugin-services/contracts';\nexport type {\n PluginStreamServices, PluginSnapshotServices, PluginEventServices, PluginStreamContract, PluginSnapshotContract,\n PluginEventContract, PluginChannelPublication, PluginStreamReadInput, PluginStreamWriteInput, PluginStreamDuplexInput,\n PluginSnapshotView, PluginSnapshotStatus, PluginEventPublisher, PluginChannelCapabilities, HostChannelPublicationView,\n PluginSnapshotVersionSource, HostSnapshotStoreOptionsView,\n} from './plugin-services/channels';\nexport type { PluginChannelDuplexSession, PluginChannelDuplexResult } from './plugin-services/peer-channel-hub';\n\nconst CHANNEL_KINDS = new Set(['events', 'snapshot', 'stream']);\n\nexport interface PluginServices {\n /** Explicit owner-bound background invocation; never inherits a stale/request frame. */\n runBackground?<T>(run: () => T): T;\n onDispose(cleanup: () => void): void;\n publish<T extends object>(serviceId: string, contractVersion: number, implementation: T): void;\n consume<T extends object>(provider: string, serviceId: string, contractVersion: number): Readonly<T>;\n /** Typed asynchronous data-only services, when the host communication runtime is configured. */\n readonly rpc?: Pick<HostRpcOwnerHandle, 'publish' | 'consume'>;\n /** Bounded, cancelable chunked byte channels over the authenticated peer link. */\n readonly stream?: PluginStreamServices;\n /** Transient notifications and durable at-least-once topics. */\n readonly events?: PluginEventServices;\n /** Versioned immutable snapshots with digest verification. */\n readonly snapshot?: PluginSnapshotServices;\n /** Explicit deployment capabilities for the channel lanes (checked before declaring work). */\n readonly channelCapabilities?: PluginChannelCapabilities;\n}\n\nexport interface PluginServiceCommunications extends Omit<HostRpcAdapterOptions, 'process' | 'enterHostHandlerFrame'> {\n /** Real process/owner identity supplied by the runtime, never invented by the plugin. */\n readonly identity: (plugin: string, scope: string) => HostRpcLifecycleIdentity;\n /**\n * Trusted host hook, called for one declared RPC consumption before the\n * adapter resolves its route. It lets the host register the native remote\n * proxy for the consumer's own contract so `resolvePlacement` can select it.\n * A host that does not implement remote routing simply omits it.\n */\n readonly ensureRemoteRoute?: (input: {\n readonly plugin: string;\n readonly scope: string;\n readonly provider: string;\n readonly contract: { readonly id: string; readonly version: number; readonly methods: Record<string, RpcMethodDefinition> };\n }) => void;\n /**\n * Host-owned event/snapshot/stream adapter. It is created by the same process\n * composition that owns the peer link, so channel work rides the one\n * authenticated transport and the canonical owner lifecycle.\n */\n readonly channels?: (input: PluginChannelOwnerInput) => HostChannelOwnerHandle;\n}\nexport interface PluginServiceInvocation {\n readonly purpose: RpcCallPurpose;\n /** Exact pre-admission lease returned by this host; request/attempt require it. */\n readonly lease?: () => void;\n readonly callee?: unknown;\n readonly signal?: AbortSignal;\n readonly deadlineAt?: number;\n}\ninterface LeaseProof { readonly retained: ReadonlySet<Owner>; released: boolean }\ninterface InvocationFrame extends HostRpcInvocationContext { readonly proof?: LeaseProof; readonly callee?: unknown; readonly ownerAuthority?: Owner; readonly peerAuthenticated?: boolean }\ninterface RpcReference { readonly owner: Owner }\n\ntype Owner = {\n plugin: string; scope: string; dependencies: Readonly<Record<string, string>>;\n ready: boolean; retiring: boolean; revoked: boolean; cleaning: boolean; leases: number;\n pending: Set<Promise<unknown>>; waiters: Array<() => void>; cleanups: Set<() => void>;\n consumed: Set<Owner>;\n rpcConsumed: Map<string, RpcReference>;\n rpc?: HostRpcOwnerHandle;\n channels?: HostChannelOwnerHandle;\n};\ntype Publication = { owner: Owner; id: string; version: number; kind: 'local' | 'rpc'; implementation?: object };\n\n/** Cleanup failed after the context was fully revoked; runtime teardown must still run. */\nexport class PluginServiceCleanupError extends AggregateError {\n constructor(failures: readonly unknown[]) { super(failures, 'Plugin service cleanup failed'); }\n}\n\nexport class PluginServiceHost {\n readonly rpc?: HostRpcAdapter;\n private readonly frames = new AsyncLocalStorage<InvocationFrame>();\n private readonly leaseProofs = new WeakMap<() => void, LeaseProof>();\n private readonly liveInvocations = new WeakSet<object>();\n private readonly ownerTokens = new WeakSet<object>();\n private readonly disposals = new WeakMap<Owner, Promise<void>>();\n private readonly communications?: PluginServiceCommunications;\n constructor(readonly process: PluginServiceProcess = 'worker', communications?: PluginServiceCommunications) {\n this.communications = communications;\n if (communications) this.rpc = new HostRpcAdapter({\n ...communications, process,\n enterHostHandlerFrame: (hostFrame, run) => this.runHostHandlerFrame(hostFrame, run),\n });\n }\n private contracts?: ReadonlyMap<string, PluginServiceDeclarations>;\n setDeclarations(contracts: ReadonlyMap<string, PluginServiceDeclarations>): void {\n for (const declarations of contracts.values()) assertSupportedServiceDeclarations(declarations);\n this.contracts = new Map(contracts);\n }\n /** Trusted host view of the declared service graph; never exposed to plugins. */\n serviceDeclarations(): ReadonlyMap<string, PluginServiceDeclarations> { return this.contracts ?? new Map(); }\n private owners = new Map<string, Owner>();\n private contexts = new WeakMap<PluginServices, Owner>();\n private publications = new Map<string, Publication>();\n private key(plugin: string, scope: string): string { return `${plugin}\\0${scope}`; }\n private publicationKey(plugin: string, scope: string, id: string, version: number): string {\n return `${plugin}\\0${scope}\\0${id}\\0${version}`;\n }\n isReady(plugin: string, scope = 'global'): boolean {\n const owner = this.owners.get(this.key(plugin, scope));\n return !!owner?.ready && !owner.retiring && !owner.revoked;\n }\n /** Trusted runtime entry; not exposed through PluginServices. */\n runInInvocation<T>(context: PluginServices, invocation: PluginServiceInvocation, run: () => T): T {\n const owner = this.contexts.get(context);\n if (!owner || owner.revoked || this.owners.get(this.key(owner.plugin, owner.scope)) !== owner) throw new RpcServiceError('unauthorized');\n const proof = invocation.lease === undefined ? undefined : this.leaseProofs.get(invocation.lease);\n if (invocation.purpose === 'request' || invocation.purpose === 'attempt') {\n if (!proof || proof.released || !proof.retained.has(owner)) throw new RpcServiceError('unauthorized');\n } else if (owner.retiring) throw new RpcServiceError('retired');\n const frame: InvocationFrame = Object.freeze({ ...invocation, proof, token: Object.freeze({}) });\n this.liveInvocations.add(frame.token);\n return this.frames.run(frame, () => {\n try {\n const result = run();\n if (result && (typeof result === 'object' || typeof result === 'function') && typeof (result as { then?: unknown }).then === 'function') {\n return Promise.resolve(result).finally(() => this.liveInvocations.delete(frame.token)) as T;\n }\n this.liveInvocations.delete(frame.token);\n return result;\n } catch (error) { this.liveInvocations.delete(frame.token); throw error; }\n });\n }\n /** Broker-only entry after physical-peer and per-call identity projection. */\n runPeerInvocation<T>(purpose: 'request' | 'attempt', callee: unknown, run: () => T): T {\n const frame: InvocationFrame = Object.freeze({purpose, callee, peerAuthenticated: true, token: Object.freeze({})});\n this.liveInvocations.add(frame.token);\n return this.frames.run(frame, () => {\n try {\n const result = run();\n if (result && typeof (result as any).then === 'function') return Promise.resolve(result).finally(() => this.liveInvocations.delete(frame.token)) as T;\n this.liveInvocations.delete(frame.token); return result;\n } catch (error) { this.liveInvocations.delete(frame.token); throw error; }\n });\n }\n /** Read by the trusted callee resolver to carry management/request authority. */\n currentInvocation(): Readonly<HostRpcInvocationContext & { readonly callee?: unknown }> | null {\n const frame = this.frames.getStore();\n return frame === undefined || !this.liveInvocations.has(frame.token) ? null : Object.freeze({ purpose: frame.purpose, token: frame.token, signal: frame.signal, deadlineAt: frame.deadlineAt, callee: frame.callee });\n }\n /**\n * Enters one live host-handler frame bound to the exact published owner, so a\n * native RPC handler shares the SAME trusted invocation store as local\n * dispatch. The frame is live only for the handler's real duration; a stale\n * (settled) frame is therefore never observable.\n */\n private runHostHandlerFrame(host: HostRpcHandlerFrame, run: () => unknown): unknown {\n const owner = host.ownerToken !== null && this.ownerTokens.has(host.ownerToken) ? host.ownerToken as Owner : undefined;\n const frame: InvocationFrame = Object.freeze({\n purpose: host.purpose,\n token: Object.freeze({}),\n ...(host.signal === undefined ? {} : { signal: host.signal }),\n ...(host.deadlineAt === undefined ? {} : { deadlineAt: host.deadlineAt }),\n ...(owner === undefined ? {} : { ownerAuthority: owner }),\n });\n this.liveInvocations.add(frame.token);\n const settle = (): void => { this.liveInvocations.delete(frame.token); };\n return this.frames.run(frame, () => {\n try {\n const result = run();\n if (result !== null && (typeof result === 'object' || typeof result === 'function') && typeof (result as { then?: unknown }).then === 'function') {\n return Promise.resolve(result).finally(settle);\n }\n settle();\n return result;\n } catch (error) { settle(); throw error; }\n });\n }\n createContext(plugin: string, scope = 'global', dependencies: Readonly<Record<string, string>> = {}): PluginServices {\n const key = this.key(plugin, scope);\n if (this.owners.has(key)) throw new Error(`Service context already exists: ${plugin}/${scope}`);\n const declarations = this.contracts?.get(plugin);\n if (!this.rpc && (declarations?.provides?.some(service => service.process === this.process && service.kind === 'rpc')\n || declarations?.consumes?.some(service => service.process === this.process && service.kind === 'rpc'))) {\n throw new RpcServiceError('capability_unavailable');\n }\n const channelProvider = declarations?.provides?.some(service => service.process === this.process && CHANNEL_KINDS.has(service.kind ?? 'local')) === true;\n const channelConsumer = declarations?.consumes?.some(service => service.process === this.process && CHANNEL_KINDS.has(service.kind ?? 'local')) === true;\n // A declared channel provider or required consumer without the host channel\n // adapter is refused here (capability_unavailable), never silently degraded.\n if ((channelProvider || channelConsumer) && this.communications?.channels === undefined) {\n throw new RpcServiceError('capability_unavailable');\n }\n const owner: Owner = { plugin, scope, dependencies: Object.freeze({ ...dependencies }), consumed: new Set(), rpcConsumed: new Map(), ready: false, retiring: false, revoked: false, cleaning: false, leases: 0, pending: new Set(), waiters: [], cleanups: new Set() };\n this.owners.set(key, owner);\n this.ownerTokens.add(owner);\n try {\n if (this.rpc) {\n owner.rpc = this.rpc.createOwner({\n token: owner, plugin, scope, dependencies: owner.dependencies,\n declarations: this.contracts?.get(plugin) ?? {}, lifecycle: this.communications!.identity(plugin, scope),\n getLifecycleState: () => ({ ready: owner.ready, retiring: owner.retiring, revoked: owner.revoked }),\n acquireLease: request => this.acquireRpcLease(owner, request),\n resolveInvocationContext: () => this.currentInvocation(),\n registerPublication: publication => {\n const publicationKey = this.publicationKey(plugin, scope, publication.id, publication.version);\n if (this.publications.has(publicationKey)) throw new RpcServiceError('invalid_registration');\n this.publications.set(publicationKey, { owner, id: publication.id, version: publication.version, kind: 'rpc' });\n },\n registerConsumption: (declaration, providerToken) => {\n const referenceKey = this.publicationKey(declaration.plugin, 'global', declaration.id, declaration.version);\n if (providerToken) {\n const provider = [...this.owners.values()].find(candidate => candidate === providerToken);\n if (!provider || provider.revoked) throw new RpcServiceError('unavailable');\n owner.rpcConsumed.set(referenceKey, { owner: provider });\n } else owner.rpcConsumed.delete(referenceKey);\n },\n });\n }\n if (this.communications?.channels !== undefined && (channelProvider || channelConsumer)) {\n owner.channels = this.communications.channels({\n plugin, scope, declarations: this.contracts?.get(plugin) ?? {},\n dependencies: owner.dependencies,\n lifecycle: this.communications.identity(plugin, scope),\n getLifecycleState: () => ({ ready: owner.ready, retiring: owner.retiring, revoked: owner.revoked }),\n trackPending: (pending: Promise<unknown>) => {\n owner.pending.add(pending);\n void pending.finally(() => { owner.pending.delete(pending); this.notify(owner); }).catch(() => {});\n },\n beginOperation: (options) => this.beginChannelOperation(plugin, scope, options),\n });\n }\n } catch (error) { this.owners.delete(key); throw error; }\n const assertActive = (target = owner) => {\n if (target.revoked || (target.retiring && !target.cleaning && !owner.cleaning && target.leases === 0 && target.pending.size === 0)) throw new Error(`Plugin service handle revoked: ${target.plugin}`);\n };\n const signals = new WeakMap<AbortSignal, WeakMap<Owner, AbortSignal>>();\n const track = <T>(pending: Promise<T>, provider: Owner): Promise<T> => {\n owner.pending.add(pending); provider.pending.add(pending);\n void pending.finally(() => {\n owner.pending.delete(pending); provider.pending.delete(pending);\n this.notify(owner); this.notify(provider);\n }).catch(() => {});\n return pending;\n };\n // These handles stay in-process. RPC retains its separate data-only wire contract.\n const wrap = (value: unknown, provider: Owner, receiver?: object, argument = false): any => {\n const active = (): void => { assertActive(); assertActive(provider); };\n if (typeof value === 'function') return (...args: unknown[]) => {\n active();\n return wrap(Reflect.apply(value, receiver, args.map(arg => wrap(arg, provider, undefined, !argument))), provider, undefined, argument);\n };\n if (value instanceof AbortSignal) {\n active();\n let projections = signals.get(value);\n if (!projections) signals.set(value, projections = new WeakMap());\n const existing = projections.get(provider);\n if (existing) return existing;\n const controller = new AbortController();\n const detach = (): void => {\n value.removeEventListener('abort', abort);\n owner.cleanups.delete(revoke); provider.cleanups.delete(revoke);\n };\n const abort = (): void => { detach(); controller.abort(value.reason); };\n const revoke = (): void => { detach(); controller.abort(new Error('Plugin service handle revoked')); };\n projections.set(provider, controller.signal);\n if (value.aborted) abort();\n else {\n value.addEventListener('abort', abort, { once: true });\n owner.cleanups.add(revoke); provider.cleanups.add(revoke);\n }\n return controller.signal;\n }\n if (value instanceof Promise) {\n active();\n return track(value.then(output => { active(); return wrap(output, provider, undefined, argument); }), provider);\n }\n if (value instanceof Uint8Array) return new Uint8Array(value);\n if (value instanceof ArrayBuffer) return ArrayBuffer.prototype.slice.call(value,0);\n if (value && typeof value === 'object' && typeof (value as AsyncIterable<unknown>)[Symbol.asyncIterator] === 'function') {\n return Object.freeze({ [Symbol.asyncIterator]: () => {\n active();\n const iterator = (value as AsyncIterable<unknown>)[Symbol.asyncIterator]();\n const invoke = (method: 'next' | 'return' | 'throw', args: unknown[]): Promise<unknown> => {\n active();\n const operation = iterator[method];\n if (!operation) return method === 'throw' ? Promise.reject(args[0]) : Promise.resolve({ done: true, value: args[0] });\n return wrap(Promise.resolve(Reflect.apply(operation, iterator, args.map(arg => wrap(arg, provider, undefined, !argument)))), provider, undefined, argument);\n };\n const facade = Object.freeze({\n next: (...args: unknown[]) => invoke('next', args),\n return: (...args: unknown[]) => invoke('return', args),\n throw: (...args: unknown[]) => invoke('throw', args),\n [Symbol.asyncIterator]: () => { active(); return facade; },\n });\n return facade;\n } });\n }\n if (Array.isArray(value)) return Object.freeze(value.map(item => wrap(item, provider, undefined, argument)));\n if (value && typeof value === 'object') {\n if (argument) {\n const prototype = Object.getPrototypeOf(value);\n if (prototype !== Object.prototype && prototype !== null) throw new TypeError('Unsupported plugin service argument handle');\n return Object.freeze(Object.fromEntries(Object.entries(value).map(([key, item]) => [key, wrap(item, provider, value, true)])));\n }\n // A fresh facade prevents access to implementation identity or mutable provider fields.\n const facade: Record<string, unknown> = {};\n for (const key of Object.keys(value)) Object.defineProperty(facade, key, {\n enumerable: true, get: () => { active(); return wrap((value as any)[key], provider, value as object); },\n });\n return Object.freeze(facade);\n }\n return value;\n };\n const consume = <T extends object>(provider: string, id: string, version: number): Readonly<T> => {\n assertActive();\n const declaration = this.contracts?.get(plugin)?.consumes?.find(value => value.plugin === provider && value.id === id && value.version === version && value.process === this.process);\n if (this.contracts && !declaration) throw new Error(`Undeclared plugin service consumption: ${plugin} -> ${provider}/${id}`);\n if (declaration?.kind && declaration.kind !== 'local') throw new Error('Non-local services require their asynchronous host adapter');\n if (provider === plugin || !Object.hasOwn(owner.dependencies, provider)) throw new Error(`Undeclared plugin service dependency: ${plugin} -> ${provider}`);\n const targetScope = 'global';\n const publication = this.publications.get(this.publicationKey(provider, targetScope, id, version));\n if (!publication || !publication.owner.ready || publication.owner.retiring || publication.owner.revoked) {\n if ([...this.publications.values()].some(value => value.owner.plugin === provider && value.owner.scope === targetScope && value.id === id && value.version !== version)) throw new Error(`Plugin service contract mismatch: ${provider}/${id}`);\n throw new Error(`Plugin service not ready: ${provider}/${id}`);\n }\n owner.consumed.add(publication.owner);\n return wrap(publication.implementation, publication.owner);\n };\n const context: PluginServices = Object.freeze({\n runBackground: <T>(run: () => T): T => {\n if (this.contexts.get(context) !== owner || this.owners.get(key) !== owner\n || !owner.ready || owner.retiring || owner.revoked) throw new RpcServiceError('retired');\n const release = this.acquireLease(plugin, scope);\n try {\n const result = this.runInInvocation(context, { purpose: 'background' }, run);\n if (result && (typeof result === 'object' || typeof result === 'function') && typeof (result as { then?: unknown }).then === 'function') {\n return Promise.resolve(result).finally(release) as T;\n }\n release();\n return result;\n } catch (error) { release(); throw error; }\n },\n onDispose: (cleanup: () => void) => { assertActive(); owner.cleanups.add(cleanup); },\n publish: <T extends object>(id: string, version: number, implementation: T) => {\n assertActive();\n const candidates = this.contracts?.get(plugin)?.provides?.filter(value => value.id === id && value.version === version && value.process === this.process);\n const declaration = candidates?.[0];\n if (this.contracts && !declaration) throw new Error(`Undeclared plugin service publication: ${plugin}/${id}`);\n if (declaration?.kind && declaration.kind !== 'local') throw new Error('Non-local services require their asynchronous host adapter');\n if (owner.scope !== 'global') throw new Error('Only global providers may publish global services');\n if (!Number.isSafeInteger(version) || version < 1) throw new Error('Invalid service contract version');\n const publicationKey = this.publicationKey(plugin, owner.scope, id, version);\n if (this.publications.has(publicationKey)) throw new Error(`Service already published: ${plugin}/${id}`);\n this.publications.set(publicationKey, { owner, id, version, implementation, kind: 'local' });\n },\n consume: <T extends object>(provider: string, id: string, version: number): Readonly<T> => consume<T>(provider, id, version),\n rpc: owner.rpc === undefined ? undefined : (() => {\n const ownerHandle = owner.rpc!;\n const prepare = (provider: string, contract: { readonly id: string; readonly version: number; readonly methods: Record<string, RpcMethodDefinition> }): void => {\n try { this.communications?.ensureRemoteRoute?.({ plugin, scope: owner.scope, provider, contract }); }\n catch { /* an unroutable remote declaration stays unavailable, never guessed */ }\n };\n return Object.freeze({\n publish: ownerHandle.publish,\n consume: <const M extends Record<string, RpcMethodDefinition>>(provider: string, contract: { readonly id: string; readonly version: number; readonly methods: M }) => {\n prepare(provider, contract);\n return ownerHandle.consume(provider, contract);\n },\n });\n })(),\n stream: owner.channels?.stream,\n events: owner.channels?.events,\n snapshot: owner.channels?.snapshot,\n channelCapabilities: owner.channels?.capabilities,\n });\n this.contexts.set(context, owner);\n return context;\n }\n markReady(plugin: string, scope = 'global', expectedContext?: PluginServices): void {\n const owner = this.requireOwner(plugin, scope, expectedContext);\n if (owner.retiring || owner.revoked) throw new Error(`Plugin service disposed: ${plugin}`);\n for (const publication of this.contracts?.get(plugin)?.provides ?? []) {\n if (publication.kind === 'rpc' && publication.process === this.process && (publication.scope ?? 'global') === (scope === 'global' ? 'global' : 'binding')\n && this.publications.get(this.publicationKey(plugin, scope, publication.id, publication.version))?.kind !== 'rpc') throw new RpcServiceError('not_ready');\n }\n owner.rpc?.markReady();\n owner.channels?.markReady();\n owner.ready = true;\n }\n retire(plugin: string, scope = 'global', expectedContext?: PluginServices): void {\n const owner = this.requireOwner(plugin, scope, expectedContext);\n owner.retiring = true;\n owner.rpc?.retire();\n try { owner.channels?.retire(); } catch { /* host-owned */ }\n }\n /**\n * Host-only: retires admission for EVERY live owner at once. It is wired to\n * the real drain admission point, so after it no new bootstrap/background work\n * is admitted while every already-accepted lease, result and terminal keeps\n * draining normally (nothing is revoked here).\n */\n retireAll(): void {\n for (const owner of this.owners.values()) {\n if (owner.revoked) continue;\n owner.retiring = true;\n try { owner.rpc?.retire(); } catch { /* host-owned */ }\n try { owner.channels?.retire(); } catch { /* host-owned */ }\n }\n }\n /**\n * Host-only: begins ONE channel operation for an owner. It applies the exact\n * same invocation-frame rules as an RPC call (management only from a\n * management frame, request/attempt only with a live retained lease proof, no\n * new work while retiring, bootstrap-only before ready) and holds a real\n * owner lease for the operation's whole lifetime, so owner disposal can never\n * race a live lane task. `null` refuses the operation.\n */\n beginChannelOperation(\n plugin: string,\n scope = 'global',\n incoming?: {\n readonly purpose?: RpcCallPurpose;\n readonly deadlineAt?: number;\n readonly signal?: AbortSignal;\n readonly authenticated?: boolean;\n /**\n * Host-managed background work: the operation runs in an EXPLICIT\n * independent background context and deliberately ignores any frame the\n * caller happens to be inside (typically a closed bootstrap/init closure).\n */\n readonly background?: boolean;\n },\n ): HostChannelOperation | null {\n const owner = this.owners.get(this.key(plugin, scope));\n if (!owner || owner.revoked) return null;\n if (this.owners.get(this.key(plugin, scope)) !== owner) return null;\n const stored = this.frames.getStore();\n let frame: InvocationFrame | undefined;\n if (incoming?.background === true) {\n // Explicit Host background context: no inherited purpose/deadline/signal.\n frame = undefined;\n } else {\n // A stale (already settled) frame is REFUSED: a finished invocation must\n // never be reused as fresh authority nor laundered into another purpose.\n // Legitimate background work either runs outside a frame or asks for the\n // explicit Host background context above.\n if (stored !== undefined && !this.liveInvocations.has(stored.token)) return null;\n frame = stored;\n }\n const leaseBound = frame !== undefined\n && (frame.purpose === 'request' || frame.purpose === 'attempt')\n && ((frame.proof !== undefined && !frame.proof.released && frame.proof.retained.has(owner))\n || frame.ownerAuthority === owner);\n if (frame !== undefined && (frame.purpose === 'request' || frame.purpose === 'attempt') && !leaseBound) return null;\n // A peer-authenticated inbound channel request carries the caller host's real\n // purpose, but only request/attempt/background may cross that boundary: a peer\n // may never claim management or bootstrap authority for a provider lease.\n const peerPurpose = frame === undefined && incoming?.authenticated === true\n && (incoming.purpose === 'request' || incoming.purpose === 'attempt' || incoming.purpose === 'background')\n ? incoming.purpose\n : undefined;\n const purpose = frame?.purpose ?? peerPurpose ?? 'background';\n const requestBound = leaseBound || peerPurpose === 'request' || peerPurpose === 'attempt';\n // Retirement refuses NEW work; already-accepted request/attempt work finishes.\n if (owner.retiring && !requestBound) return null;\n if (!owner.ready && !requestBound && purpose !== 'bootstrap') return null;\n const deadlineAt = minDefined(frame?.deadlineAt, incoming?.deadlineAt);\n const signal = combineAbortSignals(frame?.signal, incoming?.signal);\n owner.leases += 1;\n let released = false;\n const release = () => { if (released) return; released = true; owner.leases -= 1; this.notify(owner); };\n return Object.freeze({\n purpose,\n ...(signal === undefined ? {} : { signal }),\n ...(deadlineAt === undefined ? {} : { deadlineAt }),\n release,\n });\n }\n\n /** Capture before admission; release only after all consumers finish old-request processing. */\n acquireLease(plugin: string, scope = 'global'): () => void {\n const owner = this.requireOwner(plugin, scope);\n if (!owner.ready || owner.retiring || owner.revoked) throw new Error(`Plugin service not ready: ${plugin}`);\n const retained = new Set<Owner>();\n const retain = (target: Owner): void => {\n if (retained.has(target)) return;\n if (!target.ready || target.retiring || target.revoked) throw new Error(`Plugin service not ready: ${target.plugin}`);\n retained.add(target);\n for (const provider of this.dependencyOwners(target)) retain(provider);\n for (const provider of target.consumed) if (provider.ready && !provider.retiring && !provider.revoked) retain(provider);\n // A declared in-process channel provider is an exact required\n // reference too, and its ready provider owner enters the lease proof so a\n // request/attempt frame can authorize real channel work on it.\n for (const provider of this.channelDependencyOwners(target)) {\n if (provider.ready && !provider.retiring && !provider.revoked) retain(provider);\n }\n for (const reference of target.rpcConsumed.values()) retain(reference.owner);\n };\n retain(owner);\n for (const target of retained) target.leases++;\n let released = false;\n const proof: LeaseProof = { retained, released: false };\n const release = () => { if (released) return; released = true; proof.released = true; for (const target of retained) { target.leases--; this.notify(target); } };\n this.leaseProofs.set(release, proof);\n return release;\n }\n\n references(plugin: string): ReadonlyArray<{ plugin: string; scope: string; leases: number }> {\n return [...this.owners.values()].filter(o => !o.revoked && (o.plugin === plugin || [...this.dependencyOwners(o), ...this.consumedOwners(o)].some(provider => provider.plugin === plugin)))\n .map(o => Object.freeze({ plugin: o.plugin, scope: o.scope, leases: o.leases }));\n }\n /** Stop admission immediately, preserve acquired handles until leases and calls drain. */\n dispose(plugin: string, scope = 'global', expectedContext?: PluginServices): Promise<void> {\n let owner: Owner;\n try { owner = this.requireOwner(plugin, scope, expectedContext); } catch (error) { return Promise.reject(error); }\n const existing = this.disposals.get(owner);\n if (existing) return existing;\n let resolve!: () => void;\n let reject!: (error: unknown) => void;\n const task = new Promise<void>((accept, fail) => { resolve = accept; reject = fail; });\n // Install before cleanup can synchronously re-enter disposal.\n this.disposals.set(owner, task);\n void this.disposeOwner(owner).then(() => {\n this.disposals.delete(owner); resolve();\n }, error => { this.disposals.delete(owner); reject(error); });\n return task;\n }\n private async disposeOwner(owner: Owner): Promise<void> {\n const { plugin, scope } = owner;\n const hasPublications = [...this.publications.values()].some(publication => publication.owner === owner);\n if (hasPublications) {\n const dependents = [...this.owners.values()].filter(candidate => candidate !== owner && !candidate.revoked && (this.dependencyOwners(candidate).includes(owner) || this.consumedOwners(candidate).includes(owner)));\n if (dependents.length) throw new Error(`Plugin service provider is referenced: ${plugin} <- ${dependents.map(candidate => `${candidate.plugin}/${candidate.scope}`).join(', ')}`);\n }\n owner.retiring = true;\n owner.rpc?.retire();\n try { owner.channels?.retire(); } catch { /* host-owned */ }\n if (owner.leases || owner.pending.size) await new Promise<void>(resolve => owner.waiters.push(resolve));\n if (owner.channels) {\n try { await owner.channels.dispose(); } catch { /* provider release is best-effort here */ }\n }\n if (owner.rpc) {\n const result = await owner.rpc.dispose();\n if (!result.drained) throw new RpcServiceError('timeout');\n }\n // Cleanup may invoke its cached unsubscribe handle after drain, before final revocation.\n owner.cleaning = true;\n const failures: unknown[] = [];\n try {\n for (const cleanup of owner.cleanups) { try { cleanup(); } catch (error) { failures.push(error); } }\n } finally {\n owner.cleanups.clear(); owner.consumed.clear(); owner.rpcConsumed.clear(); owner.cleaning = false;\n owner.revoked = true; owner.ready = false;\n for (const [key, publication] of this.publications) if (publication.owner === owner) this.publications.delete(key);\n if (this.owners.get(this.key(plugin, scope)) === owner) this.owners.delete(this.key(plugin, scope));\n }\n if (failures.length) throw new PluginServiceCleanupError(failures);\n }\n /** Actual local provider owners, not activation edges to another process/binding. */\n private dependencyOwners(owner: Owner): Owner[] {\n const result = new Set<Owner>();\n for (const dependency of Object.keys(owner.dependencies)) {\n const declarations = this.contracts?.get(owner.plugin)?.consumes?.filter(service => service.plugin === dependency && service.process === this.process);\n if (declarations?.length) {\n for (const service of declarations) {\n // RPC providers are retained through `rpcConsumed`/`acquireRpcLease`,\n // never here. A local channel provider (events/snapshot/stream) IS a\n // real provider owner, so a request/attempt lease must retain it too,\n // or `beginChannelOperation` would refuse exact in-process channel work.\n if ((service.kind ?? 'local') === 'rpc') continue;\n const provider = this.owners.get(this.key(dependency, 'global'));\n if (provider) result.add(provider);\n }\n } else {\n const provider = this.owners.get(this.key(dependency, 'global'));\n if (provider) result.add(provider);\n }\n }\n return [...result];\n }\n /** Local providers of this owner's declared channel consumptions. */\n private channelDependencyOwners(owner: Owner): Owner[] {\n const result = new Set<Owner>();\n for (const service of this.contracts?.get(owner.plugin)?.consumes ?? []) {\n if (service.process !== this.process) continue;\n if (!CHANNEL_KINDS.has(service.kind ?? 'local')) continue;\n if (typeof service.plugin !== 'string' || !service.plugin) continue;\n if (isCrossProcessSelfSnapshot(owner.plugin, service, this.contracts?.get(owner.plugin) ?? {})) continue;\n if (!Object.hasOwn(owner.dependencies, service.plugin)) continue;\n const provider = this.owners.get(this.key(service.plugin, 'global'));\n if (provider) result.add(provider);\n }\n return [...result];\n }\n /** Consumers release all actual references before providers. */\n disposalOrder(): ReadonlyArray<{ plugin: string; scope: string }> {\n const visited = new Set<Owner>(), visiting = new Set<Owner>(), ordered: Owner[] = [];\n const visit = (owner: Owner): void => {\n if (visited.has(owner)) return;\n if (visiting.has(owner)) throw new Error('Plugin service reference cycle during disposal');\n visiting.add(owner);\n for (const provider of [...this.dependencyOwners(owner), ...this.consumedOwners(owner)]) if (!provider.revoked) visit(provider);\n visiting.delete(owner); visited.add(owner); ordered.push(owner);\n };\n for (const owner of this.owners.values()) visit(owner);\n return ordered.reverse().map(owner => Object.freeze({ plugin: owner.plugin, scope: owner.scope }));\n }\n private requireOwner(plugin: string, scope: string, expectedContext?: PluginServices): Owner {\n const owner = this.owners.get(this.key(plugin, scope));\n if (!owner) throw new Error(`Missing plugin service context: ${plugin}/${scope}`);\n if (expectedContext && this.contexts.get(expectedContext) !== owner) throw new Error(`Stale plugin service context: ${plugin}/${scope}`);\n return owner;\n }\n private notify(owner: Owner): void {\n if (!owner.leases && !owner.pending.size) for (const resolve of owner.waiters.splice(0)) resolve();\n }\n private consumedOwners(owner: Owner): Owner[] {\n return [...new Set([...owner.consumed, ...[...owner.rpcConsumed.values()].map(reference => reference.owner)])];\n }\n /** Each real RPC task borrows the canonical owner until actual business work settles. */\n private acquireRpcLease(owner: Owner, request: HostRpcLeaseRequest): HostRpcLeaseGrant {\n if (owner.revoked || this.owners.get(this.key(owner.plugin, owner.scope)) !== owner) throw new RpcServiceError('revoked');\n const frame = this.frames.getStore();\n if (frame && !this.liveInvocations.has(frame.token)) throw new RpcServiceError('unauthorized');\n if (request.purpose === 'management' && frame?.purpose !== 'management') throw new RpcServiceError('unauthorized');\n const existing = (request.purpose === 'request' || request.purpose === 'attempt')\n && frame?.purpose === request.purpose && ((frame.proof !== undefined && !frame.proof.released && frame.proof.retained.has(owner)) || (request.role === 'callee' && frame.peerAuthenticated === true));\n if ((request.purpose === 'request' || request.purpose === 'attempt') && !existing) throw new RpcServiceError('unauthorized');\n if (owner.retiring && !existing) throw new RpcServiceError('retired');\n if (!owner.ready && request.purpose !== 'bootstrap') throw new RpcServiceError('not_ready');\n owner.leases++;\n let released = false;\n return { allowRetired: existing, release: () => { if (released) return; released = true; owner.leases--; this.notify(owner); } };\n }\n}\n\n/** Smallest defined deadline, or undefined when neither side has one. */\nfunction minDefined(left: number | undefined, right: number | undefined): number | undefined {\n if (left === undefined) return right;\n if (right === undefined) return left;\n return Math.min(left, right);\n}\n\n/** Combines local and peer-provided abort signals without dropping either. */\nfunction combineAbortSignals(...signals: ReadonlyArray<AbortSignal | undefined>): AbortSignal | undefined {\n const present = signals.filter((signal): signal is AbortSignal => signal !== undefined);\n if (present.length === 0) return undefined;\n if (present.length === 1) return present[0];\n const any = (AbortSignal as unknown as { any?: (list: readonly AbortSignal[]) => AbortSignal }).any;\n if (typeof any === 'function') return any.call(AbortSignal, present);\n const controller = new AbortController();\n const abort = (signal: AbortSignal) => { if (!controller.signal.aborted) controller.abort(signal.reason); };\n for (const signal of present) {\n if (signal.aborted) { abort(signal); break; }\n signal.addEventListener('abort', () => abort(signal), { once: true });\n }\n return controller.signal;\n}\n\nexport const TOKEN_METERING_SERVICE_ID = 'token-metering.v1';\nexport const TOKEN_METERING_CONTRACT_VERSION = 1;\nexport type TokenMeteringSource = 'official' | 'estimated' | 'partial' | 'none';\nexport type TokenMeteringAuthority = 'official' | 'local' | 'heuristic' | 'partial' | 'none';\nexport interface TokenMeteringResult {\n readonly requestId: string; readonly attemptId: string; readonly routeId: string; readonly upstreamId: string;\n readonly keyId?: string | null;\n readonly provider: string; readonly model?: string; readonly pricingProvider?: string;\n readonly inputTokens?: number; readonly outputTokens?: number; readonly cacheReadTokens?: number; readonly cacheWriteTokens?: number;\n readonly inputSource: TokenMeteringSource; readonly outputSource: TokenMeteringSource;\n readonly inputAuthority: TokenMeteringAuthority; readonly outputAuthority: TokenMeteringAuthority;\n readonly complete: boolean; readonly observationIncomplete: boolean;\n readonly outcome: 'completed' | 'failed' | 'aborted'; readonly finishedAtMs: number; readonly settlementVersion: number;\n}\nexport interface TokenMeteringSubscription {\n /** Omit for degradable all-request reporting; required consumers bind their admitted request. */\n readonly requestId?: string;\n readonly required?: boolean;\n readonly onResult: (result: TokenMeteringResult) => void | Promise<void>;\n readonly onFailure?: (error: unknown, result: TokenMeteringResult) => void | Promise<void>;\n}\nexport interface TokenMeteringService {\n /** Final completion boundary: await this request's required settlement/failure callbacks before releasing its host lease. */\n drainRequest(requestId: string): Promise<void>;\n subscribe(subscription: TokenMeteringSubscription): () => void;\n prepareAttempt(input: Readonly<{ requestId: string; attemptId: string; routeId: string; upstreamId: string; url: string; body: unknown }>): Readonly<{ supported: boolean; provider?: string; model?: string; pricingProvider?: string }>;\n /** Consumer calls before request admission to pin demand; framework init also captures report subscriptions. */\n prepareRequest(requestId: string): boolean;\n}\n\nexport const TOKEN_PRICING_SERVICE_ID = 'token-stats.pricing.v1';\nexport const TOKEN_PRICING_CONTRACT_VERSION = 1;\n/** Costs are quantized to safe integer nanoUSD (1 USD = 1e9 nanoUSD); unknown remains null. */\nexport interface TokenPricingService {\n canPrice(input: Readonly<{ model?: string; pricingProvider?: string }>): Promise<boolean>;\n price(result: TokenMeteringResult): Promise<Readonly<{ costUsd: number | null; costNanoUsd: number | null }>>;\n}\n",
17
17
  "/** Declarative repair request; the host owns the next upstream attempt. */\nconst retryActionBrand=Symbol.for('@jeffusion/bungee/request-retry-action');\nexport class RequestRetryAction extends Error {\n readonly body:unknown;\n constructor(body: unknown, readonly reason: string) {\n super('gateway request repair retry');\n this.name = 'RequestRetryAction';\n Object.defineProperty(this,retryActionBrand,{value:true});\n Object.defineProperty(this,'body',{value:body,enumerable:false});\n }\n /** Plugins and host may bundle the SDK independently in the same process. */\n static [Symbol.hasInstance](value:unknown):boolean {\n return value instanceof Error && (value as unknown as Record<symbol,unknown>)[retryActionBrand]===true;\n }\n}\n",
18
18
  "import type { TokenStatsRange } from './plugin.types';\n\nconst HOUR = 3_600_000;\nexport const TOKEN_STATS_RETENTION_MS = 31 * 24 * HOUR;\nexport const TOKEN_STATS_RANGES = ['1h', '12h', '24h', '1d', '7d', '30d', 'day', 'week', 'month'] as const;\n\n/** Recent page ranges are consecutive elapsed hours; calendar ranges use local dates. */\nexport function tokenStatsWindow(range: TokenStatsRange, asOfMs: number, timeZone = 'UTC') {\n if (range === '1h' || range === '12h' || range === '24h') {\n const duration = { '1h': HOUR, '12h': 12 * HOUR, '24h': 24 * HOUR };\n const bucketMs = { '1h': 300_000, '12h': HOUR, '24h': 2 * HOUR }[range];\n return { startMs: asOfMs - duration[range], endMs: asOfMs, bucketMs };\n }\n if (range === '1d' || range === '7d' || range === '30d') {\n const days = { '1d': 1, '7d': 7, '30d': 30 }[range];\n const bucketMs = range === '1d' ? HOUR : 24 * HOUR;\n const startMs = asOfMs - days * 24 * HOUR;\n const bucketStarts = Array.from({ length: range === '1d' ? 24 : days }, (_, i) => startMs + i * bucketMs);\n return { startMs, endMs: asOfMs, bucketMs, bucketStarts };\n }\n const format = new Intl.DateTimeFormat('en-US', {\n timeZone, year: 'numeric', month: 'numeric', day: 'numeric',\n hour: 'numeric', minute: 'numeric', second: 'numeric', hourCycle: 'h23',\n });\n const parts = (ms: number) => Object.fromEntries(format.formatToParts(ms)\n .filter(part => part.type !== 'literal').map(part => [part.type, Number(part.value)]));\n const today = parts(asOfMs);\n const day = Date.UTC(today.year!, today.month! - 1, today.day!);\n // Resolve each local midnight separately so DST days can contain 23 or 25 hours.\n const midnight = (date: number) => {\n let candidate = date;\n for (let i = 0; i < 4; i++) {\n const p = parts(candidate);\n const local = Date.UTC(p.year!, p.month! - 1, p.day!, p.hour!, p.minute!, p.second!);\n const next = candidate + date - local;\n if (next === candidate) return candidate;\n candidate = next;\n }\n return candidate;\n };\n if (range === 'day') {\n const startMs = midnight(day);\n const bucketEndMs = midnight(day + 24 * HOUR);\n const bucketStarts = Array.from({ length: Math.ceil((bucketEndMs - startMs) / HOUR) }, (_, i) => startMs + i * HOUR);\n return { startMs, endMs: asOfMs, bucketMs: HOUR, bucketStarts, bucketEndMs };\n }\n const firstDay = range === 'month' ? Date.UTC(today.year!, today.month! - 1, 1)\n : day - ((new Date(day).getUTCDay() + 6) % 7) * 24 * HOUR;\n const nextPeriod = range === 'month' ? Date.UTC(today.year!, today.month!, 1) : firstDay + 7 * 24 * HOUR;\n const days = (nextPeriod - firstDay) / (24 * HOUR);\n const bucketStarts = Array.from({ length: days }, (_, i) => midnight(firstDay + i * 24 * HOUR));\n return { startMs: bucketStarts[0]!, endMs: asOfMs, bucketMs: 24 * HOUR, bucketStarts, bucketEndMs: midnight(nextPeriod) };\n}\n",
19
- "/**\n * Public contract of the models-dev catalog provider.\n *\n * This is the ONLY file other plugins may import from models-dev. It contains the\n * declared service identity, the wire-contract snapshot literal and the data types\n * of the read surface; it never exposes the downloader, the private storage keys or\n * the internal catalog representation.\n *\n * Consumers must declare a real dependency on `models-dev` and consume the local\n * service for their own process. The service methods are synchronous and read an\n * already-loaded in-memory view: no per-request network or SQL is performed.\n */\n\n/** Provider plugin name. Must match the manifest. */\nexport const MODELS_DEV_PLUGIN_NAME = 'models-dev';\n\n/** The single upstream source; models-dev is the only component allowed to fetch it. */\nexport const MODELS_DEV_SOURCE_URL = 'https://models.dev/api.json';\n\n/** Same-process local read service, published in both the control and worker processes. */\nexport const MODELS_DEV_CATALOG_SERVICE_ID = 'models-dev.catalog.v1';\nexport const MODELS_DEV_CATALOG_CONTRACT_VERSION = 1;\n\n/** Versioned immutable snapshot of the full catalog, published by the control writer. */\nexport const MODELS_DEV_CATALOG_SNAPSHOT_ID = 'models-dev.catalog.snapshot.v1';\nexport const MODELS_DEV_CATALOG_SNAPSHOT_CONTRACT_VERSION = 1;\n/**\n * One atomic record keeps fetchedAt and the immutable catalog with its version.\n * The catalog remains unrestricted JSON so every upstream field is preserved.\n */\nexport const MODELS_DEV_CATALOG_SNAPSHOT_SCHEMA = Object.freeze({\n type: 'object', properties: {\n version: { type: 'number', integer: true, minimum: 1 },\n fetchedAt: { type: 'number', minimum: 0 },\n catalog: { type: 'json', maxBytes: 32 * 1024 * 1024 },\n },\n} as const);\nexport const MODELS_DEV_CATALOG_SNAPSHOT_CONTRACT = Object.freeze({\n id: MODELS_DEV_CATALOG_SNAPSHOT_ID,\n version: MODELS_DEV_CATALOG_SNAPSHOT_CONTRACT_VERSION,\n content: MODELS_DEV_CATALOG_SNAPSHOT_SCHEMA,\n});\n\n/** Catalog availability is separate from whether the service is published. */\nexport type ModelsDevCatalogState = 'empty' | 'ready' | 'stale' | 'failed';\n\nexport interface ModelsDevCatalogStatus {\n readonly state: ModelsDevCatalogState;\n /** Monotonic published data version; `null` before the first successful load. */\n readonly version: number | null;\n readonly fetchedAt: number | null;\n readonly providerCount: number;\n readonly modelCount: number;\n /** Last failure reason; `null` after a fully successful load. */\n readonly error: string | null;\n}\n\nexport interface ModelsDevProviderSummary {\n readonly provider: string;\n readonly name: string;\n /** Normalized upstream API base (`provider.api`), or `null` when models.dev declares none. */\n readonly api: string | null;\n readonly modelCount: number;\n}\n\n/** One selectable catalog model. `provider` is the pricing provider, never the protocol. */\nexport interface ModelsDevModelOption {\n readonly provider: string;\n readonly providerName: string;\n readonly model: string;\n readonly name: string;\n}\n\nexport interface ModelsDevModelPage {\n readonly models: readonly ModelsDevModelOption[];\n readonly total: number;\n /** 1-based page actually returned. */\n readonly page: number;\n readonly pageSize: number;\n}\n\n/** USD per million tokens, applied to the whole request at this input threshold. */\nexport interface ModelsDevContextTier {\n readonly minimumInputTokens: number;\n readonly input: number;\n readonly output: number;\n readonly cacheRead: number | null;\n readonly cacheWrite: number | null;\n}\n\n/** A resolved catalog entry with optional ascending context price bands. */\nexport interface ModelsDevModelMatch {\n readonly provider: string;\n readonly model: string;\n readonly input: number;\n readonly output: number;\n readonly cacheRead: number | null;\n readonly cacheWrite: number | null;\n readonly tiered: boolean;\n readonly contextTiers?: readonly ModelsDevContextTier[];\n}\n\nexport interface ModelsDevProviderMatch {\n readonly provider: string;\n}\n\n/**\n * The declared local read surface. Implementations must be side-effect free and\n * must never throw for a miss/corruption of the current view: an unavailable\n * catalog returns an `empty`/`failed` status instead of a fabricated price.\n */\nexport interface ModelsDevCatalogService {\n status(): ModelsDevCatalogStatus;\n providers(): readonly ModelsDevProviderSummary[];\n modelOptions(input?: { readonly provider?: string; readonly search?: string; readonly page?: number; readonly pageSize?: number }): ModelsDevModelPage;\n /**\n * Resolve exactly one catalog entry for a client model name.\n *\n * `url` (when supplied) is canonicalized to host + path and matched against the\n * full catalog's `provider.api`; more than one candidate is ambiguous and returns\n * null. `pricingProvider` is a catalog provider id and takes priority over URL and\n * prefix inference. A model id present under several providers without an explicit\n * provider is ambiguous. Matching defaults to exact and case-sensitive.\n * `estimate` additionally permits normalized names, original-lab prices and\n * dated members of the same family. Explicit provider IDs remain binding;\n * an unresolved URL is only a hint in estimate mode.\n */\n resolveModel(input: { readonly model: string; readonly pricingProvider?: string; readonly url?: string; readonly mode?: 'exact' | 'estimate' }): ModelsDevModelMatch | null;\n /** Resolve one provider from a real upstream URL via `provider.api`; ambiguous/none => null. */\n resolveProvider(input: { readonly url: string }): ModelsDevProviderMatch | null;\n}\n\n/** Capability reads are additive; existing catalog.v1 consumers stay unchanged. */\nexport const MODELS_DEV_CAPABILITIES_SERVICE_ID = 'models-dev.capabilities.v1';\nexport const MODELS_DEV_CAPABILITIES_CONTRACT_VERSION = 1;\n/** Upstream control values; null/default do not name a concrete effort level. */\nexport type ModelsDevReasoningEffortValue = null | 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'default';\n/** Validated models.dev reasoning_options, without inferred controls or levels. */\nexport type ModelsDevReasoningOption =\n | { readonly type: 'effort'; readonly values: readonly ModelsDevReasoningEffortValue[] }\n | { readonly type: 'toggle' }\n | { readonly type: 'budget_tokens'; readonly min?: number; readonly max?: number };\nexport type ModelsDevReasoningOptionsStatus = 'known' | 'missing' | 'invalid';\nexport interface ModelsDevCapabilities {\n readonly provider: string;\n readonly model: string;\n readonly name: string;\n readonly contextWindow: number | null;\n readonly outputLimit: number | null;\n readonly toolCall: boolean;\n readonly reasoning: boolean;\n /** null for missing/invalid metadata; a validated empty list remains known. */\n readonly reasoningOptions: readonly ModelsDevReasoningOption[] | null;\n readonly reasoningOptionsStatus: ModelsDevReasoningOptionsStatus;\n /** Version of the same complete snapshot that supplied all fields of this result. */\n readonly catalogVersion: number;\n readonly inputModalities: readonly string[];\n}\nexport interface ModelsDevCapabilitiesService {\n status(): ModelsDevCatalogStatus;\n /** Without a provider, require a unique exact model or a declared API URL match. */\n model(input: { readonly provider?: string; readonly model: string; readonly url?: string }): ModelsDevCapabilities | null;\n}\n",
19
+ "/**\n * Public contract of the models-dev catalog provider.\n *\n * This is the ONLY file other plugins may import from models-dev. It contains the\n * declared service identity, the wire-contract snapshot literal and the data types\n * of the read surface; it never exposes the downloader, the private storage keys or\n * the internal catalog representation.\n *\n * Consumers must declare a real dependency on `models-dev` and consume the local\n * service for their own process. The service methods are synchronous and read an\n * already-loaded in-memory view: no per-request network or SQL is performed.\n */\n\n/** Provider plugin name. Must match the manifest. */\nexport const MODELS_DEV_PLUGIN_NAME = 'models-dev';\n\n/** Explicit catalog identity, independent from the provider's wire model name. */\nexport interface CatalogModelReference {\n readonly provider: string;\n readonly model: string;\n}\nexport interface ModelIdentityDeclaration {\n readonly wireModel: string;\n readonly catalogModel: CatalogModelReference;\n}\nexport const MODEL_IDENTITY_ANNOTATION_KEY = 'models-dev.model-identity';\n\n/** The single upstream source; models-dev is the only component allowed to fetch it. */\nexport const MODELS_DEV_SOURCE_URL = 'https://models.dev/api.json';\n\n/** Same-process local read service, published in both the control and worker processes. */\nexport const MODELS_DEV_CATALOG_SERVICE_ID = 'models-dev.catalog.v1';\nexport const MODELS_DEV_CATALOG_CONTRACT_VERSION = 1;\n\n/** Versioned immutable snapshot of the full catalog, published by the control writer. */\nexport const MODELS_DEV_CATALOG_SNAPSHOT_ID = 'models-dev.catalog.snapshot.v1';\nexport const MODELS_DEV_CATALOG_SNAPSHOT_CONTRACT_VERSION = 1;\n/**\n * One atomic record keeps fetchedAt and the immutable catalog with its version.\n * The catalog remains unrestricted JSON so every upstream field is preserved.\n */\nexport const MODELS_DEV_CATALOG_SNAPSHOT_SCHEMA = Object.freeze({\n type: 'object', properties: {\n version: { type: 'number', integer: true, minimum: 1 },\n fetchedAt: { type: 'number', minimum: 0 },\n catalog: { type: 'json', maxBytes: 32 * 1024 * 1024 },\n },\n} as const);\nexport const MODELS_DEV_CATALOG_SNAPSHOT_CONTRACT = Object.freeze({\n id: MODELS_DEV_CATALOG_SNAPSHOT_ID,\n version: MODELS_DEV_CATALOG_SNAPSHOT_CONTRACT_VERSION,\n content: MODELS_DEV_CATALOG_SNAPSHOT_SCHEMA,\n});\n\n/** Catalog availability is separate from whether the service is published. */\nexport type ModelsDevCatalogState = 'empty' | 'ready' | 'stale' | 'failed';\n\nexport interface ModelsDevCatalogStatus {\n readonly state: ModelsDevCatalogState;\n /** Monotonic published data version; `null` before the first successful load. */\n readonly version: number | null;\n readonly fetchedAt: number | null;\n readonly providerCount: number;\n readonly modelCount: number;\n /** Last failure reason; `null` after a fully successful load. */\n readonly error: string | null;\n}\n\nexport interface ModelsDevProviderSummary {\n readonly provider: string;\n readonly name: string;\n /** Normalized upstream API base (`provider.api`), or `null` when models.dev declares none. */\n readonly api: string | null;\n readonly modelCount: number;\n}\n\n/** One selectable catalog model. `provider` is the pricing provider, never the protocol. */\nexport interface ModelsDevModelOption {\n readonly provider: string;\n readonly providerName: string;\n readonly model: string;\n readonly name: string;\n}\n\nexport interface ModelsDevModelPage {\n readonly models: readonly ModelsDevModelOption[];\n readonly total: number;\n /** 1-based page actually returned. */\n readonly page: number;\n readonly pageSize: number;\n}\n\n/** USD per million tokens, applied to the whole request at this input threshold. */\nexport interface ModelsDevContextTier {\n readonly minimumInputTokens: number;\n readonly input: number;\n readonly output: number;\n readonly cacheRead: number | null;\n readonly cacheWrite: number | null;\n}\n\n/** A resolved catalog entry with optional ascending context price bands. */\nexport interface ModelsDevModelMatch {\n readonly provider: string;\n readonly model: string;\n readonly input: number;\n readonly output: number;\n readonly cacheRead: number | null;\n readonly cacheWrite: number | null;\n readonly tiered: boolean;\n readonly contextTiers?: readonly ModelsDevContextTier[];\n}\n\nexport interface ModelsDevProviderMatch {\n readonly provider: string;\n}\n\n/**\n * The declared local read surface. Implementations must be side-effect free and\n * must never throw for a miss/corruption of the current view: an unavailable\n * catalog returns an `empty`/`failed` status instead of a fabricated price.\n */\nexport interface ModelsDevCatalogService {\n status(): ModelsDevCatalogStatus;\n providers(): readonly ModelsDevProviderSummary[];\n modelOptions(input?: { readonly provider?: string; readonly search?: string; readonly page?: number; readonly pageSize?: number }): ModelsDevModelPage;\n /**\n * Resolve exactly one catalog entry for a client model name.\n *\n * `url` (when supplied) is canonicalized to host + path and matched against the\n * full catalog's `provider.api`; more than one candidate is ambiguous and returns\n * null. `pricingProvider` is a catalog provider id and takes priority over URL and\n * prefix inference. A model id present under several providers without an explicit\n * provider is ambiguous. Matching defaults to exact and case-sensitive.\n * `estimate` additionally permits normalized names, original-lab prices and\n * dated members of the same family. Explicit provider IDs remain binding;\n * an unresolved URL is only a hint in estimate mode.\n */\n resolveModel(input: { readonly model: string; readonly pricingProvider?: string; readonly url?: string; readonly mode?: 'exact' | 'estimate' }): ModelsDevModelMatch | null;\n /** Resolve one provider from a real upstream URL via `provider.api`; ambiguous/none => null. */\n resolveProvider(input: { readonly url: string }): ModelsDevProviderMatch | null;\n}\n\n/** Capability reads are additive; existing catalog.v1 consumers stay unchanged. */\nexport const MODELS_DEV_CAPABILITIES_SERVICE_ID = 'models-dev.capabilities.v1';\nexport const MODELS_DEV_CAPABILITIES_CONTRACT_VERSION = 1;\n/** Upstream control values; null/default do not name a concrete effort level. */\nexport type ModelsDevReasoningEffortValue = null | 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'default';\n/** Validated models.dev reasoning_options, without inferred controls or levels. */\nexport type ModelsDevReasoningOption =\n | { readonly type: 'effort'; readonly values: readonly ModelsDevReasoningEffortValue[] }\n | { readonly type: 'toggle' }\n | { readonly type: 'budget_tokens'; readonly min?: number; readonly max?: number };\nexport type ModelsDevReasoningOptionsStatus = 'known' | 'missing' | 'invalid';\nexport interface ModelsDevCapabilities {\n readonly provider: string;\n readonly model: string;\n readonly name: string;\n readonly contextWindow: number | null;\n readonly outputLimit: number | null;\n readonly toolCall: boolean;\n readonly reasoning: boolean;\n /** null for missing/invalid metadata; a validated empty list remains known. */\n readonly reasoningOptions: readonly ModelsDevReasoningOption[] | null;\n readonly reasoningOptionsStatus: ModelsDevReasoningOptionsStatus;\n /** Version of the same complete snapshot that supplied all fields of this result. */\n readonly catalogVersion: number;\n readonly inputModalities: readonly string[];\n}\nexport interface ModelsDevCapabilitiesService {\n status(): ModelsDevCatalogStatus;\n /** Without a provider, require a unique exact model or a declared API URL match. */\n model(input: { readonly provider?: string; readonly model: string; readonly url?: string }): ModelsDevCapabilities | null;\n}\n",
20
20
  "/** Name-only heuristics: prices always come from the current catalog. */\nfunction resourceName(name: string): string {\n return name.replace(/^(?:projects\\/[^/]+\\/locations\\/[^/]+\\/)?publishers\\/google\\/models\\//, '')\n .replace(/^models\\//, '');\n}\n\nfunction claudeVersion(name: string): string {\n return name.replace(/^(claude-(?:(?:opus|sonnet|haiku)-)?\\d+)-(\\d+)(?=-|$)/, '$1.$2');\n}\n\nfunction withoutDate(name: string): string {\n return name.replace(/-(?:\\d{8}|\\d{4}-\\d{2}-\\d{2})$/, '');\n}\n\nfunction withoutEffort(name: string): string {\n return name.replace(/-(?:minimal|low|medium|high|xhigh)$/, '');\n}\n\nfunction withoutPreview(name: string): string {\n return name.replace(/-(?:latest|preview|exp)$/, '');\n}\n\n/** At most 32 candidates, including combined date/effort suffixes. */\nexport function estimateNames(model: string): readonly string[] {\n const names = new Set([model.trim().toLowerCase()]);\n const transforms = [resourceName, claudeVersion, withoutDate, withoutEffort, withoutPreview];\n for (const name of names) {\n for (const transform of transforms) {\n const candidate = transform(name);\n if (candidate && names.size < 32) names.add(candidate);\n }\n }\n return [...names];\n}\n\nexport function canonicalModelName(model: string): string {\n return claudeVersion(resourceName(model.trim().toLowerCase()));\n}\n\nexport function modelFamily(model: string): string {\n let name = canonicalModelName(model);\n // Each pass removes a suffix; the length bound also bounds this loop.\n for (;;) {\n const next = withoutPreview(withoutEffort(withoutDate(name)));\n if (next === name) return name;\n name = next;\n }\n}\n\nexport function modelDate(model: string): string {\n return model.toLowerCase().match(/-(\\d{8}|\\d{4}-\\d{2}-\\d{2})(?:-(?:minimal|low|medium|high|xhigh|latest|preview|exp))*$/)?.[1]?.replaceAll('-', '') ?? '';\n}\n\nexport function originalLab(model: string): string | null {\n const name = resourceName(model.trim().toLowerCase());\n if (/^(?:gpt-|o\\d+(?:-|$))/.test(name)) return 'openai';\n if (name.startsWith('claude-')) return 'anthropic';\n if (name.startsWith('gemini-')) return 'google';\n if (name.startsWith('grok-')) return 'xai';\n return null;\n}\n",
21
21
  "import type { ModelsDevCapabilities, ModelsDevReasoningEffortValue, ModelsDevReasoningOption } from '../contract';\n\nexport type ParsedReasoningOptions = Pick<ModelsDevCapabilities, 'reasoningOptions' | 'reasoningOptionsStatus'>;\n\nconst EFFORT_VALUES = new Set<unknown>(['none', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max', 'default']);\nconst MISSING: ParsedReasoningOptions = Object.freeze({ reasoningOptions: null, reasoningOptionsStatus: 'missing' });\nconst INVALID: ParsedReasoningOptions = Object.freeze({ reasoningOptions: null, reasoningOptionsStatus: 'invalid' });\n\nfunction record(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === 'object' && !Array.isArray(value);\n}\n\nfunction onlyKeys(value: Record<string, unknown>, allowed: readonly string[]): boolean {\n return Object.keys(value).every(key => allowed.includes(key));\n}\n\nfunction budget(value: unknown, minimum: number): value is number {\n return typeof value === 'number' && Number.isFinite(value) && value >= minimum;\n}\n\n/**\n * Mirrors the strict ReasoningOption union in models.dev/packages/core/src/schema.ts.\n * Validation happens while building the snapshot index. Invalid metadata is isolated\n * from the rest of the model and yields a fixed status, never raw diagnostic content.\n */\nexport function parseReasoningOptions(value: unknown): ParsedReasoningOptions {\n if (value === undefined) return MISSING;\n if (!Array.isArray(value)) return INVALID;\n const options: ModelsDevReasoningOption[] = [];\n for (const option of value) {\n if (!record(option)) return INVALID;\n if (option.type === 'toggle') {\n if (!onlyKeys(option, ['type'])) return INVALID;\n options.push(Object.freeze({ type: 'toggle' }));\n } else if (option.type === 'effort') {\n if (!onlyKeys(option, ['type', 'values']) || !Array.isArray(option.values)) return INVALID;\n const values: ModelsDevReasoningEffortValue[] = [];\n for (const raw of option.values) {\n // Upstream accepts the authored string \"null\" and canonicalizes it to null.\n const effort = raw === 'null' ? null : raw;\n if (effort !== null && !EFFORT_VALUES.has(effort)) return INVALID;\n values.push(effort as ModelsDevReasoningEffortValue);\n }\n options.push(Object.freeze({ type: 'effort', values: Object.freeze(values) }));\n } else if (option.type === 'budget_tokens') {\n if (!onlyKeys(option, ['type', 'min', 'max'])\n || (option.min !== undefined && !budget(option.min, -1))\n || (option.max !== undefined && !budget(option.max, 0))) return INVALID;\n const min = option.min as number | undefined;\n const max = option.max as number | undefined;\n if (min !== undefined && max !== undefined && min > max) return INVALID;\n options.push(Object.freeze({ type: 'budget_tokens',\n ...(min === undefined ? {} : { min }), ...(max === undefined ? {} : { max }),\n }));\n } else return INVALID;\n }\n return Object.freeze({ reasoningOptions: Object.freeze(options), reasoningOptionsStatus: 'known' });\n}\n",
22
22
  "/**\n * Internal catalog representation for models-dev.\n *\n * It is derived from the full models.dev JSON with no trimming: providers without\n * price data are kept, every model field stays addressable and `provider.api` is\n * preserved for URL-based provider resolution. This module is provider-internal;\n * consumers only see the public `contract.ts` service.\n */\n\nimport type {\n ModelsDevCatalogStatus,\n ModelsDevCatalogService,\n ModelsDevContextTier,\n ModelsDevModelMatch,\n ModelsDevModelOption,\n ModelsDevModelPage,\n ModelsDevProviderMatch,\n ModelsDevProviderSummary,\n} from '../contract';\nimport { canonicalModelName, estimateNames, modelDate, modelFamily, originalLab } from './model-names';\nimport { parseReasoningOptions, type ParsedReasoningOptions } from './reasoning';\n\nexport const MAX_PROVIDERS = 4_096;\nexport const MAX_MODELS_PER_PROVIDER = 16_384;\nexport const MAX_MODEL_OPTION_PAGE_SIZE = 100;\n/** Bounded full-catalog scan budget (the real catalog has ~8.4k models). */\nexport const MAX_RESOLVE_CANDIDATES = 20_000;\n\nexport interface NormalizedPrice {\n readonly input: number;\n readonly output: number;\n readonly cacheRead: number | null;\n readonly cacheWrite: number | null;\n readonly tiered: boolean;\n readonly contextTiers: readonly ModelsDevContextTier[];\n}\n\ninterface CatalogModel {\n readonly id: string;\n readonly name: string;\n readonly price: NormalizedPrice | null;\n readonly reasoningControls: ParsedReasoningOptions;\n /** Raw model entry, retained so every original field stays reachable. */\n readonly raw: unknown;\n}\n\ninterface CatalogProvider {\n readonly id: string;\n readonly name: string;\n readonly api: string | null;\n readonly apiHost: string | null;\n readonly apiPathSegments: readonly string[] | null;\n readonly models: Map<string, CatalogModel>;\n readonly lowerModels: ReadonlyMap<string, CatalogModel | null>;\n readonly familyModels: ReadonlyMap<string, CatalogModel>;\n readonly raw: unknown;\n}\n\nexport interface CatalogIndex {\n readonly version: number;\n readonly fetchedAt: number;\n readonly providers: readonly CatalogProvider[];\n readonly byProvider: ReadonlyMap<string, CatalogProvider>;\n readonly modelCount: number;\n readonly exactModels: ReadonlyMap<string, ModelsDevModelMatch | null>;\n readonly exactCapabilityProviders: ReadonlyMap<string, string | null>;\n readonly lowerModels: ReadonlyMap<string, ModelsDevModelMatch | null>;\n readonly familyModels: ReadonlyMap<string, ModelsDevModelMatch | null>;\n readonly byApiHost: ReadonlyMap<string, readonly CatalogProvider[]>;\n}\n\nexport interface CatalogRecord {\n readonly version: number;\n readonly fetchedAt: number;\n readonly catalog: unknown;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction finiteNonNegative(value: unknown): number | null {\n return typeof value === 'number' && Number.isFinite(value) && value >= 0 ? value : null;\n}\n\nfunction contextTier(cost: unknown, minimumInputTokens: number): ModelsDevContextTier | null {\n if (!isRecord(cost) || !Number.isSafeInteger(minimumInputTokens) || minimumInputTokens < 0) return null;\n const input = finiteNonNegative(cost.input);\n const output = finiteNonNegative(cost.output);\n if (input === null || output === null) return null;\n return Object.freeze({ minimumInputTokens, input, output,\n cacheRead: finiteNonNegative(cost.cache_read), cacheWrite: finiteNonNegative(cost.cache_write) });\n}\n\nfunction contextTiers(cost: Record<string, unknown>): readonly ModelsDevContextTier[] {\n if (Array.isArray(cost.tiers) && cost.tiers.length > 0) {\n const tiers: ModelsDevContextTier[] = [];\n const thresholds = new Set<number>();\n for (const value of cost.tiers) {\n const tier = isRecord(value) && isRecord(value.tier)\n && (value.tier.type === undefined || value.tier.type === 'context')\n ? contextTier(value, value.tier.size as number) : null;\n if (tier === null || thresholds.has(tier.minimumInputTokens)) { tiers.length = 0; break; }\n thresholds.add(tier.minimumInputTokens);\n tiers.push(tier);\n }\n if (tiers.length > 0) return Object.freeze(tiers.sort((a, b) => a.minimumInputTokens - b.minimumInputTokens));\n }\n // Legacy over-200k is strictly greater, represented as an inclusive integer band.\n const legacy = contextTier(cost.context_over_200k, 200_001);\n return Object.freeze(legacy === null ? [] : [legacy]);\n}\n\n/** Preserve base prices and canonical context bands, using legacy output only as fallback. */\nexport function normalizePrice(cost: unknown): NormalizedPrice | null {\n if (!isRecord(cost)) return null;\n const input = finiteNonNegative(cost.input);\n const output = finiteNonNegative(cost.output);\n if (input === null || output === null) return null;\n const tiered = 'tiers' in cost || 'context_over_200k' in cost;\n return Object.freeze({\n input,\n output,\n cacheRead: finiteNonNegative(cost.cache_read),\n cacheWrite: finiteNonNegative(cost.cache_write),\n tiered,\n contextTiers: contextTiers(cost),\n });\n}\n\n/** Split an API base into lowercase host + path segments; `${...}` segments are wildcards. */\nfunction parseApiBase(api: unknown): { host: string; pathSegments: string[] } | null {\n if (typeof api !== 'string' || api.length === 0 || api.length > 2_048) return null;\n let parsed: URL;\n try { parsed = new URL(api.replace(/\\$\\{[^}]*\\}/g, 'wildcard')); } catch { return null; }\n const host = parsed.hostname.toLowerCase();\n if (!host) return null;\n const pathSegments = parsed.pathname.split('/').filter(Boolean).map(segment => segment.toLowerCase());\n return { host, pathSegments };\n}\n\nfunction pathMatches(template: readonly string[], request: readonly string[]): boolean {\n if (template.length > request.length) return false;\n for (let index = 0; index < template.length; index += 1) {\n if (template[index] !== '*' && template[index] !== request[index]) return false;\n }\n return true;\n}\n\nfunction nameIndexes(models: ReadonlyMap<string, CatalogModel>): Pick<CatalogProvider, 'lowerModels' | 'familyModels'> {\n const lowerModels = new Map<string, CatalogModel | null>();\n const familyModels = new Map<string, CatalogModel>();\n for (const model of models.values()) {\n if (model.price === null) continue;\n for (const lower of new Set([model.id.toLowerCase(), canonicalModelName(model.id)])) {\n lowerModels.set(lower, lowerModels.has(lower) ? null : model);\n }\n const family = modelFamily(model.id);\n const current = familyModels.get(family);\n // A canonical undated base wins; otherwise newest dated version, then stable ID.\n const rank = (entry: CatalogModel): string => `${canonicalModelName(entry.id) === family ? '1' : '0'}:${modelDate(entry.id)}`;\n if (current === undefined || rank(model) > rank(current)\n || (rank(model) === rank(current) && model.id < current.id)) familyModels.set(family, model);\n }\n return { lowerModels, familyModels };\n}\n\n/** Build all lookup indexes on refresh, never in the synchronous request path. */\nexport function buildCatalogIndex(record: CatalogRecord): CatalogIndex {\n if (!isRecord(record.catalog)) throw new Error('models-dev catalog record is invalid');\n const providers: CatalogProvider[] = [];\n const byProvider = new Map<string, CatalogProvider>();\n let modelCount = 0;\n for (const [providerKey, providerValue] of Object.entries(record.catalog)) {\n if (!isRecord(providerValue)) continue;\n if (providers.length >= MAX_PROVIDERS) throw new Error('models-dev catalog exceeds the provider budget');\n const id = typeof providerValue.id === 'string' && providerValue.id.trim() ? providerValue.id.trim() : providerKey.trim();\n if (!id || id.length > 256) continue;\n const name = typeof providerValue.name === 'string' && providerValue.name.trim() ? providerValue.name.trim() : id;\n const parsedApi = parseApiBase(providerValue.api);\n const models = new Map<string, CatalogModel>();\n if (isRecord(providerValue.models)) {\n for (const [modelKey, modelValue] of Object.entries(providerValue.models)) {\n if (!isRecord(modelValue)) continue;\n if (models.size >= MAX_MODELS_PER_PROVIDER) throw new Error('models-dev catalog exceeds the model budget');\n const modelId = typeof modelValue.id === 'string' && modelValue.id.trim() ? modelValue.id.trim() : modelKey.trim();\n if (!modelId || modelId.length > 512) continue;\n const modelName = typeof modelValue.name === 'string' && modelValue.name.trim() ? modelValue.name.trim() : modelId;\n models.set(modelId, Object.freeze({ id: modelId, name: modelName, price: normalizePrice(modelValue.cost),\n reasoningControls: parseReasoningOptions(modelValue.reasoning_options), raw: modelValue }));\n modelCount += 1;\n }\n }\n const provider: CatalogProvider = Object.freeze({\n id, name, api: typeof providerValue.api === 'string' ? providerValue.api : null,\n apiHost: parsedApi?.host ?? null,\n apiPathSegments: parsedApi === null ? null : Object.freeze(parsedApi.pathSegments.map(segment => segment.includes('wildcard') ? '*' : segment)),\n models, ...nameIndexes(models), raw: providerValue,\n });\n providers.push(provider);\n if (!byProvider.has(id)) byProvider.set(id, provider);\n }\n providers.sort((left, right) => left.id.localeCompare(right.id));\n const exactModels = new Map<string, ModelsDevModelMatch | null>();\n const exactCapabilityProviders = new Map<string, string | null>();\n const lowerModels = new Map<string, ModelsDevModelMatch | null>();\n const familyModels = new Map<string, ModelsDevModelMatch | null>();\n const byApiHost = new Map<string, CatalogProvider[]>();\n for (const provider of providers) {\n if (provider.apiHost !== null) {\n const sameHost = byApiHost.get(provider.apiHost) ?? [];\n sameHost.push(provider);\n byApiHost.set(provider.apiHost, sameHost);\n }\n for (const model of provider.models.values()) {\n exactCapabilityProviders.set(model.id, exactCapabilityProviders.has(model.id) ? null : provider.id);\n const match = catalogModelIn(provider, model.id);\n if (match === null) continue;\n exactModels.set(model.id, exactModels.has(model.id) ? null : match);\n const lower = model.id.toLowerCase();\n lowerModels.set(lower, lowerModels.has(lower) ? null : match);\n }\n for (const [family, model] of provider.familyModels) {\n familyModels.set(family, familyModels.has(family) ? null : catalogModelIn(provider, model.id));\n }\n }\n for (const providers of byApiHost.values()) Object.freeze(providers);\n return Object.freeze({ version: record.version, fetchedAt: record.fetchedAt, providers: Object.freeze(providers), byProvider, modelCount, exactModels, exactCapabilityProviders, lowerModels, familyModels, byApiHost });\n}\n\nexport function emptyStatus(): ModelsDevCatalogStatus {\n return Object.freeze({ state: 'empty', version: null, fetchedAt: null, providerCount: 0, modelCount: 0, error: null });\n}\n\nexport function statusOf(index: CatalogIndex | null, state: 'ready' | 'stale' | 'failed', error: string | null): ModelsDevCatalogStatus {\n if (index === null) return Object.freeze({ state: error === null ? 'empty' : 'failed', version: null, fetchedAt: null, providerCount: 0, modelCount: 0, error });\n return Object.freeze({ state, version: index.version, fetchedAt: index.fetchedAt, providerCount: index.providers.length, modelCount: index.modelCount, error });\n}\n\n/** One real upstream URL resolved through the full catalog's `provider.api`. */\nexport function resolveProviderFromUrl(index: CatalogIndex | null, rawUrl: string): ModelsDevProviderMatch | null {\n if (index === null || typeof rawUrl !== 'string' || rawUrl.length === 0 || rawUrl.length > 8_192) return null;\n let parsed: URL;\n try { parsed = new URL(rawUrl); } catch { return null; }\n const host = parsed.hostname.toLowerCase();\n const segments = parsed.pathname.split('/').filter(Boolean).map(segment => segment.toLowerCase());\n const matches: string[] = [];\n for (const provider of index.byApiHost.get(host) ?? []) {\n if (provider.apiHost !== host || provider.apiPathSegments === null) continue;\n if (!pathMatches(provider.apiPathSegments, segments)) continue;\n matches.push(provider.id);\n if (matches.length > 1) return null; // Ambiguity is never guessed.\n }\n return matches.length === 1 ? Object.freeze({ provider: matches[0]! }) : null;\n}\n\nfunction catalogModelIn(provider: CatalogProvider, modelId: string): ModelsDevModelMatch | null {\n const model = provider.models.get(modelId);\n if (model === undefined || model.price === null) return null;\n return Object.freeze({\n provider: provider.id, model: model.id,\n input: model.price.input, output: model.price.output,\n cacheRead: model.price.cacheRead, cacheWrite: model.price.cacheWrite,\n tiered: model.price.tiered,\n contextTiers: model.price.contextTiers,\n });\n}\n\nfunction providerPrefix(model: string): { provider: string; modelId: string } | null {\n const colon = model.indexOf(':');\n const slash = model.indexOf('/');\n const index = [colon, slash].filter(value => value > 0).sort((left, right) => left - right)[0];\n if (index === undefined) return null;\n const provider = model.slice(0, index);\n const modelId = model.slice(index + 1);\n return provider && modelId ? { provider, modelId } : null;\n}\n\n/**\n * Exact, unambiguous resolution. Priority: explicit catalog provider hint\n * (resolved from the hint itself or the URL), a known provider prefix, then a\n * UNIQUE exact model match across the catalog. Case-sensitive throughout.\n */\nexport function resolveModelInCatalog(index: CatalogIndex | null, input: Parameters<ModelsDevCatalogService['resolveModel']>[0]): ModelsDevModelMatch | null {\n if (index === null || typeof input.model !== 'string' || input.model.length === 0 || input.model.length > 512) return null;\n if (input.mode === 'estimate') return resolveEstimate(index, input);\n const model = input.model;\n const hintProvider = typeof input.pricingProvider === 'string' && input.pricingProvider.length > 0 && input.pricingProvider.length <= 512\n ? input.pricingProvider\n : undefined;\n\n if (hintProvider !== undefined) {\n const direct = index.byProvider.get(hintProvider);\n if (direct !== undefined) {\n // An explicit provider that does not carry the model is unknown, not a cue\n // to guess another provider.\n return catalogModelIn(direct, model);\n }\n if (hintProvider.includes('://') || hintProvider.includes('/')) {\n const resolved = resolveProviderFromUrl(index, hintProvider);\n return resolved === null ? null : catalogModelIn(index.byProvider.get(resolved.provider)!, model);\n }\n // An explicit provider that is not in the catalog is unknown, never guessed.\n return null;\n }\n\n if (input.url !== undefined && input.url.length > 0) {\n const resolved = resolveProviderFromUrl(index, input.url);\n if (resolved !== null) return catalogModelIn(index.byProvider.get(resolved.provider)!, model);\n }\n\n const prefixed = providerPrefix(model);\n if (prefixed !== null) {\n const provider = index.byProvider.get(prefixed.provider);\n if (provider !== undefined) {\n const match = catalogModelIn(provider, prefixed.modelId);\n if (match !== null) return match;\n }\n }\n\n return index.exactModels.get(model) ?? null;\n}\n\nfunction estimateIn(provider: CatalogProvider, model: string): ModelsDevModelMatch | null {\n const exact = catalogModelIn(provider, model);\n if (exact !== null) return exact;\n for (const name of estimateNames(model)) {\n const candidate = provider.lowerModels.get(name);\n if (candidate) return catalogModelIn(provider, candidate.id);\n }\n const family = provider.familyModels.get(modelFamily(model));\n return family === undefined ? null : catalogModelIn(provider, family.id);\n}\n\nfunction resolveEstimate(index: CatalogIndex, input: Parameters<ModelsDevCatalogService['resolveModel']>[0]): ModelsDevModelMatch | null {\n const model = input.model.trim();\n if (!model) return null;\n const hint = input.pricingProvider;\n const direct = hint ? index.byProvider.get(hint) : undefined;\n if (direct !== undefined) return estimateIn(direct, model);\n // Metering carries a URL in pricingProvider; only directory IDs are binding.\n const hintIsUrl = typeof hint === 'string' && (hint.includes('://') || hint.includes('/'));\n if (hint && !hintIsUrl) {\n const provider = index.byProvider.get(hint);\n return provider === undefined ? null : estimateIn(provider, model);\n }\n const prefixed = providerPrefix(model);\n if (prefixed !== null) {\n const provider = index.byProvider.get(prefixed.provider.toLowerCase());\n if (provider !== undefined) return estimateIn(provider, prefixed.modelId);\n }\n const url = hintIsUrl ? hint! : input.url;\n if (url) {\n const resolved = resolveProviderFromUrl(index, url);\n if (resolved !== null) {\n const match = estimateIn(index.byProvider.get(resolved.provider)!, model);\n if (match !== null) return match;\n }\n }\n const exact = index.exactModels.get(model);\n if (exact) return exact;\n const lower = index.lowerModels.get(model.toLowerCase());\n if (lower) return lower;\n const lab = originalLab(model);\n if (lab !== null) {\n const provider = index.byProvider.get(lab);\n return provider === undefined ? null : estimateIn(provider, model);\n }\n // Unknown labs may still have one uniquely identified normalized catalog entry.\n for (const name of estimateNames(model)) {\n const match = index.lowerModels.get(name);\n if (match) return match;\n }\n return index.familyModels.get(modelFamily(model)) ?? null;\n}\n\nexport function providerSummaries(index: CatalogIndex | null): readonly ModelsDevProviderSummary[] {\n if (index === null) return Object.freeze([]);\n return Object.freeze(index.providers.map(provider => Object.freeze({\n provider: provider.id, name: provider.name, api: provider.api, modelCount: provider.models.size,\n })));\n}\n\nexport function modelOptions(index: CatalogIndex | null, input: { provider?: string; search?: string; page?: number; pageSize?: number } = {}): ModelsDevModelPage {\n const pageSize = Math.min(Math.max(1, Math.trunc(input.pageSize ?? 50)), MAX_MODEL_OPTION_PAGE_SIZE);\n const requestedPage = Math.max(1, Math.trunc(input.page ?? 1));\n if (index === null) return Object.freeze({ models: Object.freeze([]), total: 0, page: 1, pageSize });\n const providerFilter = input.provider;\n const search = input.search;\n const needle = typeof search === 'string' && search.length > 0 ? search.toLocaleLowerCase() : null;\n const providers = providerFilter === undefined ? index.providers : index.providers.filter(provider => provider.id === providerFilter);\n const matchesSearch = (provider: CatalogProvider, model: CatalogModel): boolean => needle === null\n || `${model.id}\\n${model.name}\\n${provider.id}\\n${provider.name}`.toLocaleLowerCase().includes(needle);\n let total = 0;\n for (const provider of providers) {\n if (needle === null) total += provider.models.size;\n else for (const model of provider.models.values()) if (matchesSearch(provider, model)) total++;\n if (total > MAX_RESOLVE_CANDIDATES) throw new Error('models-dev model option scan exceeded the budget');\n }\n const lastPage = Math.max(1, Math.ceil(total / pageSize));\n const page = Math.min(requestedPage, lastPage);\n let skip = (page - 1) * pageSize;\n const models: ModelsDevModelOption[] = [];\n for (const provider of providers) {\n if (needle === null && skip >= provider.models.size) { skip -= provider.models.size; continue; }\n for (const model of provider.models.values()) {\n if (!matchesSearch(provider, model)) continue;\n if (skip > 0) { skip--; continue; }\n models.push({ provider: provider.id, providerName: provider.name, model: model.id, name: model.name });\n if (models.length === pageSize) break;\n }\n if (models.length === pageSize) break;\n }\n return Object.freeze({ models: Object.freeze(models), total, page, pageSize });\n}\n",
@@ -24,7 +24,7 @@
24
24
  "/**\n * models-dev in-process read view. The view is the ONLY object exposed through the\n * public local service; it never performs I/O. The provider's own durable snapshot\n * body is owned by the Host snapshot store (`services.snapshot.store()`), never by\n * an in-plugin fallback.\n */\n\nimport { createHash } from 'node:crypto';\nimport type { PluginChannelSnapshotRead } from '@jeffusion/bungee-core/plugin';\nimport type {\n ModelsDevCatalogService,\n ModelsDevCapabilitiesService,\n ModelsDevCapabilities,\n ModelsDevCatalogStatus,\n ModelsDevModelMatch,\n ModelsDevModelPage,\n ModelsDevProviderMatch,\n ModelsDevProviderSummary,\n} from '../contract';\nimport {\n buildCatalogIndex,\n emptyStatus,\n modelOptions,\n providerSummaries,\n resolveModelInCatalog,\n resolveProviderFromUrl,\n statusOf,\n type CatalogIndex,\n} from './catalog';\nimport { parseCatalogRecord } from './store';\nimport type { CatalogRecord } from './catalog';\n\nexport interface SnapshotSource {\n readonly descriptor: {\n readonly owner: string; readonly epoch: number; readonly version: number; readonly schemaVersion: number;\n readonly digest: `sha256:${string}`; readonly size: number; readonly chunkBytes: number;\n };\n read(offset: number, length: number): Promise<Uint8Array>;\n retain?(): void;\n release?(): void | Promise<void>;\n}\n\n/** Read-only view over the loaded catalog. Mutations are whole-index swaps. */\nexport class CatalogView implements ModelsDevCatalogService {\n #index: CatalogIndex | null = null;\n #state: 'empty' | 'ready' | 'stale' | 'failed' = 'empty';\n #error: string | null = null;\n\n apply(index: CatalogIndex, state: 'ready' | 'stale' = 'ready', error: string | null = null): void {\n this.#index = index;\n this.#state = state;\n this.#error = error;\n }\n\n /** A failed refresh keeps the last valid index and only records the error. */\n fail(error: string): void {\n this.#error = error;\n this.#state = this.#index === null ? 'failed' : 'stale';\n }\n\n loaded(): boolean { return this.#index !== null; }\n\n status(): ModelsDevCatalogStatus {\n return this.#index === null && this.#state === 'empty' ? emptyStatus() : statusOf(this.#index, this.#state === 'empty' ? 'ready' : this.#state, this.#error);\n }\n\n providers(): readonly ModelsDevProviderSummary[] { return providerSummaries(this.#index); }\n\n modelOptions(input?: { provider?: string; search?: string; page?: number; pageSize?: number }): ModelsDevModelPage {\n return modelOptions(this.#index, input);\n }\n\n resolveModel(input: Parameters<ModelsDevCatalogService['resolveModel']>[0]): ModelsDevModelMatch | null {\n return resolveModelInCatalog(this.#index, input);\n }\n\n capabilities(input: { provider?: string; model: string; url?: string }): ModelsDevCapabilities | null {\n const index = this.#index;\n const provider = input.provider ?? (input.url ? resolveProviderFromUrl(index,input.url)?.provider : index?.exactCapabilityProviders.get(input.model));\n const entry = provider ? index?.byProvider.get(provider)?.models.get(input.model) : undefined;\n if (!index || !entry || !entry.raw || typeof entry.raw !== 'object') return null;\n const raw = entry.raw as Record<string, any>;\n const limit = (value: unknown) => typeof value === 'number' && Number.isSafeInteger(value) && value > 0 ? value : null;\n return Object.freeze({provider: provider!, model: entry.id, name: entry.name,\n contextWindow: limit(raw.limit?.context), outputLimit: limit(raw.limit?.output),\n toolCall: raw.tool_call === true, reasoning: raw.reasoning === true,\n ...entry.reasoningControls, catalogVersion: index.version,\n inputModalities: Object.freeze(Array.isArray(raw.modalities?.input)\n ? raw.modalities.input.filter((value: unknown): value is string => typeof value === 'string') : []),\n });\n }\n\n resolveProvider(input: { url: string }): ModelsDevProviderMatch | null {\n return resolveProviderFromUrl(this.#index, input.url);\n }\n}\n\n/** Plain, own-property service object (the service facade only exposes own enumerable keys). */\nexport function catalogServiceOf(view: CatalogView): ModelsDevCatalogService {\n return {\n status: () => view.status(),\n providers: () => view.providers(),\n modelOptions: (input) => view.modelOptions(input),\n resolveModel: (input) => view.resolveModel(input),\n resolveProvider: (input) => view.resolveProvider(input),\n };\n}\n\n/** Shared content validation for the persisted control source and verified worker view. */\nexport function decodeCatalogSnapshot(bytes: Uint8Array, version: number): CatalogRecord {\n const record = parseCatalogRecord(JSON.parse(new TextDecoder('utf-8', { fatal: true }).decode(bytes)));\n if (record.version !== version) throw new Error('catalog_version_mismatch');\n return record;\n}\n\nexport async function readCatalogSnapshot(source: SnapshotSource): Promise<CatalogRecord> {\n const { size, chunkBytes, digest, version } = source.descriptor;\n if (!Number.isSafeInteger(size) || size < 1 || size > 32 * 1024 * 1024\n || !Number.isSafeInteger(chunkBytes) || chunkBytes < 1) throw new Error('catalog_snapshot_size');\n source.retain?.();\n try {\n const bytes = new Uint8Array(size);\n for (let offset = 0; offset < size; offset += chunkBytes) {\n const length = Math.min(chunkBytes, size - offset);\n const chunk = await source.read(offset, length);\n if (chunk.byteLength !== length) throw new Error('catalog_snapshot_truncated');\n bytes.set(chunk, offset);\n }\n if (`sha256:${createHash('sha256').update(bytes).digest('hex')}` !== digest) throw new Error('catalog_snapshot_digest');\n return decodeCatalogSnapshot(bytes, version);\n } finally { await source.release?.(); }\n}\n\n/** Apply only a complete Host-verified snapshot; a failed read never clears the prior view. */\nexport function reconcileCatalogView(snapshot: PluginChannelSnapshotRead | null, view: CatalogView): 'applied' | 'unchanged' | 'failed' {\n try {\n if (snapshot === null) {\n if (!view.loaded()) return 'unchanged';\n view.fail('catalog_missing');\n return 'failed';\n }\n const currentVersion = view.status().version;\n if (currentVersion !== null && currentVersion >= snapshot.descriptor.version) return 'unchanged';\n const record = decodeCatalogSnapshot(snapshot.bytes, snapshot.descriptor.version);\n const index = buildCatalogIndex(record);\n view.apply(index, 'ready', null);\n return 'applied';\n } catch (error) {\n view.fail(error instanceof Error ? error.message.slice(0, 64) : 'catalog_read_failed');\n return 'failed';\n }\n}\n\nexport function capabilitiesServiceOf(view: CatalogView): ModelsDevCapabilitiesService {\n return { status: () => view.status(), model: input => view.capabilities(input) };\n}\n",
25
25
  "/**\n * models-dev worker instance.\n *\n * It consumes the control provider's authenticated, verified snapshot. The Host\n * reconciles it in the background; request-time lookups only use the local index.\n */\n\nimport type { Plugin } from '@jeffusion/bungee-core/plugin';\nimport { definePlugin } from '@jeffusion/bungee-core/plugin';\nimport type { PluginHooks, PluginInitContext, PluginLogger } from '@jeffusion/bungee-core/plugin';\nimport { MODELS_DEV_CAPABILITIES_SERVICE_ID, MODELS_DEV_CAPABILITIES_CONTRACT_VERSION, MODELS_DEV_CATALOG_CONTRACT_VERSION, MODELS_DEV_CATALOG_SERVICE_ID, MODELS_DEV_CATALOG_SNAPSHOT_CONTRACT } from '../contract';\nimport { CatalogView, capabilitiesServiceOf, catalogServiceOf, reconcileCatalogView } from './local';\n\nconst RECONCILE_INTERVAL_MS = 5_000;\n\nexport const ModelsDevPlugin = definePlugin(\n class implements Plugin {\n static readonly name = 'models-dev';\n static readonly version = '1.0.0';\n logger!: PluginLogger;\n private readonly view = new CatalogView();\n private cleanup: (() => void) | undefined;\n\n async init(context: PluginInitContext): Promise<void> {\n this.logger = context.logger;\n const services = context.services;\n if (services?.snapshot === undefined) throw new Error('models-dev requires the snapshot service context');\n const snapshot = services.snapshot.consume('models-dev', MODELS_DEV_CATALOG_SNAPSHOT_CONTRACT);\n const apply = (current: ReturnType<typeof snapshot.current>) => {\n if (reconcileCatalogView(current, this.view) === 'failed') this.logger.warn('models-dev catalog snapshot is unavailable');\n };\n const unsubscribe = snapshot.onApplied(apply);\n await snapshot.sync();\n if (this.view.status().version === null) apply(snapshot.current());\n const local = catalogServiceOf(this.view);\n services.publish(MODELS_DEV_CAPABILITIES_SERVICE_ID, MODELS_DEV_CAPABILITIES_CONTRACT_VERSION, capabilitiesServiceOf(this.view));\n services.publish(MODELS_DEV_CATALOG_SERVICE_ID, MODELS_DEV_CATALOG_CONTRACT_VERSION, {\n ...local,\n status: () => {\n const status = local.status(), transport = snapshot.status();\n return transport.status === 'failed' || transport.status === 'stale'\n ? { ...status, state: status.version === null ? 'failed' as const : 'stale' as const, error: transport.error }\n : status;\n },\n });\n const stop = snapshot.start({ intervalMs: RECONCILE_INTERVAL_MS });\n this.cleanup = () => { unsubscribe(); stop(); };\n services.onDispose(() => this.stopTimer());\n this.logger.info('models-dev worker catalog view initialized');\n }\n\n bodyRequirements() { return { request: 'none' as const }; }\n\n register(_hooks: PluginHooks): void {}\n\n async onDestroy(): Promise<void> {\n this.stopTimer();\n this.logger?.info('models-dev worker destroyed');\n }\n\n private stopTimer(): void {\n this.cleanup?.();\n this.cleanup = undefined;\n }\n },\n);\n\nexport default ModelsDevPlugin;\n"
26
26
  ],
27
- "mappings": ";;AAOA,IAAM,UAAU,OAAO,IAAI,mCAAmC;AAI9D,SAAS,YAAY,CAAC,WAAoB,CAAC,GAAkB;AAAA,EAC3D,MAAM,SAAS,CAAC,UACd,CAAC,OAAyB,YAAqB;AAAA,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;AAAA,EAG/D,gBAAgB,GAAG;AAAA,IAAE,OAAO,EAAE,SAAS,OAAgB;AAAA;AAAA,EAEvD,QAAQ,CAAC,QAA2B;AAAA,OAE9B,UAAS,GAAkB;AAAA,IAC/B,KAAK,UAAU;AAAA,IACf,KAAK,QAAQ,KAAK,6BAA6B;AAAA;AAAA,EAGzC,SAAS,GAAS;AAAA,IACxB,KAAK,UAAU;AAAA,IACf,KAAK,UAAU;AAAA;AAEnB,CACF;AAEA,IAAe;",
28
+ "debugId": "EFD4BC638065364964756E2164756E21",
29
29
  "names": []
30
30
  }
@@ -922,4 +922,4 @@ export {
922
922
  control_default as default
923
923
  };
924
924
 
925
- //# debugId=10CD0331CBCFED0164756E2164756E21
925
+ //# debugId=9122F1BC80C45E9664756E2164756E21