libraryPackage manifestv6.0.4

lib.contracts-runtime-client-react

React runtime adapters for ContractSpec contracts

@lssm-tech/lib.contracts-runtime-client-react
Source, release and verification context

Source snapshot bcc79fcc · Declared package version 6.0.4. This page combines the checked-in package guide and manifest; commands and runtime behavior were not executed in this review.

Package source ↗ Manifest ↗
webserverbrowserbunnode
EXPLORE THE PACKAGE

See where this package fits.

Follow a declared connection, inspect an import, then open the source guide when you need the detail.

THIS PACKAGElib.contracts-runtime-client-reactplatform

Arrows point from a package to its direct dependency. Each count is derived from the captured manifests.

8 declarations · first 6 shownSELECT TO INSPECT

@lssm-tech/lib.contracts-runtime-client-react

React runtime adapters for ContractSpec contracts.

Query/result primitives, feature and presentation declarations use their complete Core owners. Locale and translation factory exports use TranslationRuntime; feature registration retains the canonical Kernel FeatureRegistry class. The form renderer uses the complete Core Form contracts and FormsRuntime runtime helpers. Its tests retain the canonical DesignCatalog showcase singleton and Core identity/layout helpers. PWA update checks consume the complete portable Core /pwa/types contracts; all Source and test imports use their canonical owners. Public entrypoints and React peer requirements are unchanged. The canonical registry and Forms runtime bindings require Forms839a and the complete Kernel FeatureRegistry owner to be composed before qualification.

What It Provides

  • Layer: lib.
  • Consumers: design-system, presentation-runtime-react, bundles.
  • Related ContractSpec packages include @lssm-tech/lib.contracts-spec, @lssm-tech/lib.schema, @lssm-tech/tool.bun, @lssm-tech/tool.typescript.
  • Related ContractSpec packages include @lssm-tech/lib.contracts-spec, @lssm-tech/lib.schema, @lssm-tech/tool.bun, @lssm-tech/tool.typescript.

Installation

npm install @lssm-tech/lib.contracts-runtime-client-react

or

bun add @lssm-tech/lib.contracts-runtime-client-react

Usage

Import the root entrypoint from @lssm-tech/lib.contracts-runtime-client-react, or choose a documented subpath when you only need one part of the package surface.

The form renderer supports the expanded FormSpec field set: readonly inputs, email, autocomplete, address, phone, date, time, datetime, semantic groups, repeated grouped arrays, grid layout hints, progressive layout.flow sections/steps, and text/textarea/email input groups. Drivers are expected to provide dedicated slots for rich widgets plus shadcn/Radix-style Field* and optional InputGroup* slots. Email fields render through the standard input slot with native email input behavior. When input-group slots are absent, text, email, and textarea fields fall back to plain controls.

Autocomplete fields support local filtering and resolver-backed search. Resolver calls receive the current query, watched dependency values, field name, and an AbortSignal through the existing resolver args object; stale responses are ignored and selected remote options remain visible when later searches return a different result set. Custom autocomplete driver slots can read optional loading, error, emptyText, loadingText, and errorText props to expose async state.

PWA update checks

usePwaUpdateChecker from @lssm-tech/lib.contracts-runtime-client-react/pwa-update-client checks the pwa.update.check API, exposes required/blocking versus optional update state, supports polling, and delegates actual service worker activation to a host-provided onApply callback.

LSSM OS durable-operation status

useLssmOsOperationStatusV1 from @lssm-tech/lib.contracts-runtime-client-react/lssm-os-operation-status accepts the provider-neutral Runtime Node operation client port and returns its ui projection unchanged. HTTP hosts may inject @lssm-tech/integration.lssm-os-operation-client, but this React library has no upward integration dependency. It polls only while the canonical operation is nonterminal or its canonical error is retryable, aborts obsolete scopes, and never derives a UI-specific status, receipt, or error mapping.

Adaptive form support

resolveAdaptiveFormExperience from @lssm-tech/lib.contracts-runtime-client-react/adaptive-form maps ResolvedAdaptiveExperience into generic form guidance, density, control, and recovery defaults. It is a lightweight adapter for form renderers and vertical applications that want adaptive behavior without coupling forms to analytics or product-specific labels.

Use the result as an editable runtime recommendation. It should not override permissions, validation, authorization, or business rules.

Query and mutation hooks

useContractQuery(envelope, options?) and useContractMutation(options?) are thin bindings over the in-house engine in @lssm-tech/lib.contracts-runtime-core† — no @tanstack/*. Wrap the surface in ContractDataEngineProvider with a createDataEngine({ transport }), then:

  • useContractQuery returns the canonical QueryState<TData> verbatim (status, fetchStatus, data, error, cacheStatus, isStale, isOffline, conflict, versionToken) plus refetch — so it flows straight into the I/O-free design-system QueryState components with zero adapter.
  • useContractMutation returns the canonical mutation state (status, data, problem, conflictOutcome, isPending) plus mutate(request, { optimistic? }).

The engine owns the cache, request dedup, durable offline queue + replay, etag conflict resolution, optimistic apply/rollback, and recoverable auth-expiry. This package no longer ships cache-key/storage/policy helpers or a ./query-client subpath — they were removed in the data-fetching ecosystem reset (the engine owns all of it). parseContractResponse (structuredContent-first MCP/GraphQL decode) remains for non-engine response interpretation.

Provider props for the local/offline mode

ContractDataEngineProvider accepts either a host-composed engine or a transport from which it builds and owns the engine:

tsx
<ContractDataEngineProvider
  transport={transport}
  mode={offlineEnabled ? "offline-capable" : "online-only"}
  offline={{ storage, reachability }}
>
  <App />
</ContractDataEngineProvider>
  • mode takes online-only, memory-cache or offline-capable, or a policy resolved with resolveLocalOfflinePolicy({ env, flag }). Without mode, offline.storage selects offline-capable and no storage keeps online-only.
  • offline is passed to the engine as its advanced options. Durable offline.storage and offline.cacheStore are forwarded only in offline-capable mode and dropped in online-only and memory-cache, so the same offline object works while mode toggles.
  • The engine is rebuilt only when transport, the resolved mode, the forwarded offline.storage or offline.reachability changes, so inline offline objects are safe.
  • The host reachability source is followed only while the provider is mounted, so a replaced engine stops draining the offline queue.
  • On the explicit path, engine keeps working unchanged. An optional transport there only feeds realtime subscriptions.

Realtime subscriptions

useContractSubscription(tags, options?) listens on the provider transport's subscribe() seam, for example createWebSocketTransport from @lssm-tech/lib.contracts-runtime-core. For each pushed event it marks the matching cached reads stale and, when any matched, runs the engine's maintenance.revalidateStale(), then calls onInvalidate. That pass refetches every stale cache entry, not only the reads for the pushed tags. It returns { supported, active, lastEvent, eventCount }. A transport without subscribe(), such as REST, reports supported: false. Reconnects, backpressure and resync stay in the transport. Revalidation runs on the engine's background path without a per-call ctx, and a failed invalidation or revalidation goes to onError. An online-only engine has no cache to revalidate, so in that mode use onInvalidate to refetch.

Architecture

  • src/adaptive-form.ts is part of the package's public or composition surface.
  • src/drivers is part of the package's public or composition surface.
  • src/feature-render.ts is part of the package's public or composition surface.
  • src/form-render.impl.tsx is part of the package's public or composition surface.
  • src/form-render.ts is part of the package's public or composition surface.
  • src/index.ts is the root public barrel and package entrypoint.

Public Entry Points

  • Export . resolves through ./src/index.ts.
  • Export ./adaptive-form resolves through ./src/adaptive-form.ts.
  • Export ./drivers/rn-reusables resolves through ./src/drivers/rn-reusables.ts.
  • Export ./drivers/shadcn resolves through ./src/drivers/shadcn.ts.
  • Export ./feature-render resolves through ./src/feature-render.ts.
  • Export ./form-render resolves through ./src/form-render.ts.
  • Export ./form-render.impl resolves through ./src/form-render.impl.tsx.
  • Export ./pwa-update-client resolves through ./src/pwa-update-client.tsx.
  • Export ./lssm-os-operation-status resolves through ./src/lssm-os-operation-status.tsx.
  • Export ./subscriptions/use-contract-subscription resolves through ./src/subscriptions/use-contract-subscription.tsx.

Local Commands

  • bun run dev — contractspec-bun-build dev
  • bun run build — contractspec-bun-build build
  • bun run lint — bun run lint:fix
  • bun run lint:check — biome check .
  • bun run lint:fix — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
  • bun run typecheck — tsgo --noEmit
  • bun run publish:pkg — bun publish --tolerate-republish --ignore-scripts --verbose
  • bun run publish:pkg:canary — bun publish:pkg --tag canary
  • bun run clean — rm -rf dist
  • bun run build:bundle — contractspec-bun-build transpile
  • bun run build:types — contractspec-bun-build types
  • bun run prebuild — contractspec-bun-build prebuild

Recent Updates

  • Replace eslint+prettier by biomejs to optimize speed.
  • Add generic adaptive form experience helpers for runtime guidance defaults.

Notes

  • Driver interface must stay compatible with both shadcn and RN Reusables.
  • Form rendering pipeline is a critical path; test thoroughly before changing.

Declared capabilities.

Lib Contracts Runtime Client React

React runtime adapters for ContractSpec contracts

Use it to

  • Adopt react runtime adapters for contractspec contracts

Requires

  • TypeScript

Choose another boundary when

  • The @lssm-tech/lib.contracts-runtime-client-react package constraints do not match the target runtime or platform.

@lssm-tech/lib.contracts-runtime-client-react

@lssm-tech/lib.contracts-runtime-client-react/adaptive-form

@lssm-tech/lib.contracts-runtime-client-react/contract-data-engine-context

@lssm-tech/lib.contracts-runtime-client-react/contract-result-client

@lssm-tech/lib.contracts-runtime-client-react/contracts-runtime-client-react.feature

@lssm-tech/lib.contracts-runtime-client-react/drivers/rn-reusables

@lssm-tech/lib.contracts-runtime-client-react/drivers/shadcn

@lssm-tech/lib.contracts-runtime-client-react/feature-render

@lssm-tech/lib.contracts-runtime-client-react/form-render

@lssm-tech/lib.contracts-runtime-client-react/form-render.impl

@lssm-tech/lib.contracts-runtime-client-react/i18n

@lssm-tech/lib.contracts-runtime-client-react/lssm-os-operation-statususeLssmOsOperationStatusV1

@lssm-tech/lib.contracts-runtime-client-react/i18n/catalogs

@lssm-tech/lib.contracts-runtime-client-react/subscriptions/use-contract-subscriptionuseContractSubscription

Imports and export paths.

24 entries

These are package-manifest entry points. Named symbols listed above come from the capability catalogue; this is not an exhaustive TypeScript symbol reference.

24 imports

Dependencies and related packages.

Runtime dependencies 8
Peer dependencies 5
@hookform/resolvers
catalog:ui
@types/react
catalog:types
react
catalog:
react-dom
catalog:
react-hook-form
catalog:ui
Development dependencies 5
happy-dom
catalog:testing
typescript
catalog:

Package scripts.

Commands declared by this package. Review its setup requirements before running them; no command here was executed by this review.

publish:pkgbun publish --tolerate-republish --ignore-scripts --verbose
publish:pkg:canarybun publish:pkg --tag canary
cleanrm -rf dist
lintbun run lint:fix
lint:fixnode ../../../../scripts/biome.cjs check --write --unsafe --only=nursery/useSortedClasses . && node ../../../../scripts/biome.cjs check --write .
lint:checknode ../../../../scripts/biome.cjs check .
pack:verifybun run build && bun scripts/verify-packed-package.ts
buildcontractspec-bun-build build
build:bundlecontractspec-bun-build transpile
build:typescontractspec-bun-build types
prebuildcontractspec-bun-build prebuild
typechecktsgo --noEmit
devcontractspec-bun-build dev
Your view

Make room for your context.

Shape the presentation around this moment. You can change it whenever you need.

Your context

The different parts of you

Choose a starting point

A useful mix of context, visuals and gentle guidance.

Tune each dimension
Each dimension can change independently. Product permissions and available actions stay unchanged.

Support the way you begin and return

Tune your support

Reading comfort

Choose your language

Interface language changes text only. Markets, prices and workflows keep their own settings.

Translation coverage

Original source

Navigation151
Graph616
Categories378
Portfolio833
Examples2,035
Source preview1,542

More translations will be added as content is reviewed.

This preference is saved on this browser.

Search the website

Useful starting points

No results. Try a shorter phrase, an operation name or another search area.

A LITTLE ROOM TO EXPLORE

Find something to explore.

Open a closer look on this page, try a different perspective, or follow the detail into its own page.

How previews and controls work
01

Look before you leave

Hover a link or focus it with Tab to see a preview. Clicking the original link or pressing Enter always opens its destination.

02

Stay with the context

Move into the preview to explore its sections. Use Alt + ↓ from a focused link to enter it with the keyboard. Escape closes it.

03

Open the possibilities

Disclosure rows, perspective choices and highlighted controls reveal more. Your view changes reading comfort and the context you explore.

A separate button for a closer look

Show small preview buttons beside links where there is room. Tap the eye to inspect, or tap the link to go straight there. This choice stays in this tab.

No browsing history is collected. Reduced motion follows your device and Your view.