lib.provider-spec
Provider routing and runtime-target contracts for ContractSpec Builder.
@lssm-tech/lib.provider-specbun add @lssm-tech/lib.provider-specManifest declarations describe the current workspace; they do not verify registry publication or runtime execution.
Package guide
The published build realizes every advertised Bun, Node, browser and declaration target, including the streaming-transcription catalog. After bun run build, run bun scripts/check-built-exports.mjs from this package to verify actual production tarballs and byte parity with built outputs. It never publishes or changes the provider model allowlist. In a source checkout, scripts/check-packed-consumer.mjs takes a JSON report destination and runs the existing locked, isolated Node/Bun/browser and strict NodeNext/Bundler declaration battery, including declaration byte parity.
Website: https://contractspec.io
Typed provider-routing, runtime-target, execution-receipt, comparison, and patch-proposal contracts for the Builder control plane.
What It Provides
- Runtime-mode, provider-kind, task-type, risk, and comparison enums.
- Runtime target, handshake, trust-profile, and lease contracts.
- External execution provider, routing policy, context bundle, receipt, and patch proposal types.
- Validation helpers for routing policies, receipts, and runtime target records.
- Provider-neutral capability observations for usage, cost, latency, freshness, coverage, health, rate limits, trusted receipts, budgets, evidence, and replay.
Public Entry Points
.resolves through./src/index.ts./typesresolves through./src/types.ts./validationresolves through./src/validation.ts./provider-observationresolves the additive observation contract and pinned schema identity./provider-observation-aggregationresolves deterministic aggregation and fail-closed budget evaluation./provider-meteringand./provider-metering-runtimeresolve additive reconciliation, health freshness, budget-reference, and tenant-query surfaces./provider-shadow-selectionand./provider-shadow-selectorresolve deterministic, explainable, no-dispatch provider shadow selection./fixtures/provider-observationresolves neutral, no-network observation and budget fixtures./gateway-model-catalogresolves the shared Vercel AI Gateway EU model allowlist (EU inference zone, zero retention, no training; Mistral excluded) used by CommunicationOS and OPA briefings, and./gateway-model-resolutionthe deterministic request → user → workspace → environment → catalog precedence over it
Notes
- This package is a qualified pure platform spec (
contractspec.architecture.role: platform-spec). Its runtime sources and their workspace suppliers perform no I/O, ambient clock or random reads, async effects or provider dispatch, so domain specs such as@lssm-tech/lib.builder-specmay depend on it directly. fingerprintProviderCapabilityDeclarationandvalidateProviderCapabilityDeclarationcompute the SHA-256 digest synchronously with@lssm-tech/lib.crypto-utils/sha256. They keep theirPromisereturn types, digests and rejection-on-malformed-input behavior.- This package is a compatibility surface. Prefer additive evolution.
- Provider routing stays explicit policy, not hidden heuristics.
- Provider declarations use narrow Core serialization/features and the canonical
@lssm-tech/lib.orchestration-spec/ai-improvementevidence declaration.
Provider type declarations are grouped internally by runtime target, routing, and execution receipt responsibility. The root and /types exports retain their existing names, literal unions, mutability, and structural contracts. Runtime leases and evidence references retain their existing authority boundaries.
Observation aggregation, input validation/grouping/cost summation and budget projection have separate cohesive private modules, per-observation accumulator updates separated from grouping and normalized output; each computational utility within 100 lines after canonical formatting, with the existing public facade. Aggregation remains deterministic and budget projection never grants external effect authority.
The additive ProviderWorkspaceInput, MobileParityInput, MobileReviewCard, and MobileParitySummary root exports are provider-neutral supplied-data contracts. They carry no workspace or approval authority. Builder retains its existing review-card and parity type names as aliases to the same canonical models.
Relationships
Arrows point from a package to its direct dependency. Counts are derived from captured workspace manifests.
3 declarations
@lssm-tech/lib.contracts-spec-coreworkspace:^
Read the package manual ↗@lssm-tech/lib.crypto-utilsworkspace:^
Read the package manual ↗@lssm-tech/lib.orchestration-specworkspace:^
Read the package manual ↗
Declared capabilities
Provider routing and runtime-target contracts for ContractSpec Builder.
Scripts
publish:pkgbun publish --tolerate-republish --ignore-scripts --verbosepublish:pkg:canarybun publish:pkg --tag canarybuildcontractspec-bun-build buildbuild:bundlecontractspec-bun-build transpilebuild:typescontractspec-bun-build typesdevcontractspec-bun-build devcleanrimraf dist .turbolintbun lint:fixlint:fixnode ../../../../scripts/biome.cjs check --write --unsafe --only=nursery/useSortedClasses . && node ../../../../scripts/biome.cjs check --write .lint:checknode ../../../../scripts/biome.cjs check .testbun testprebuildcontractspec-bun-build prebuildtypechecktsgo --noEmit