Skip to main content

Module firstparty

Module firstparty 

Source
Expand description

First-party standard adapters embedded in the toolchain (v0.17 §4.2).

The sources, bindings and metadata live in the data-only bynk-std crate (standard-library track, #1940). This module re-exports them unchanged, so bynk_check::firstparty::* keeps resolving for every consumer. Parsing and injecting the sources is checker logic, and stays here in project_model.

Structs§

Instantiable
A capability a context may declare instances of (S4a, #1966, track D3).
Unit
One first-party unit, as data (standard-library track, S1 #1945). Adding a unit to the standard library is an entry in UNITS plus its files; the checker’s injection reads this table and needs no change.

Enums§

Binding
The TypeScript binding the toolchain supplies for a first-party unit.
OptionKind
The literal an instance option takes (standard-library P3, #2342).
Platform
The deploy platform — a selection axis distinct from the --target {bundle,workers} emit mode (§6.2). It chooses which bynk-<platform>.ts binding is linked for the bynk surface. v0.17 shipped cloudflare; v0.18 adds node, making the axis observable (and giving v0.19’s platform-lock enforcement a second platform to fire against).
Stability
Whether a first-party item is under the 1.0 promise (track D2).
UnitKind
What a first-party unit is, and so how a project brings it in: an adapter is injected when a unit consumes it, a commons when a unit uses it. Local to this crate, which has no dependencies; bynk-check maps it onto its own unit kind.

Constants§

BYNK_ADAPTER_SRC
The reserved bynk conformance-surface adapter (env-free core). It has no binding clause — the toolchain supplies one per platform (see Platform::bynk_binding_source).
BYNK_CRYPTO_SRC
bynk.crypto — digests, HMAC, constant-time comparison, and signing and verification with imported keys, as Effects over Web Crypto.
BYNK_LIST_SRC
bynk.list — combinators over the List kernel (fold, prepend, length, get, foldEff), written in ordinary Bynk (decision 0034): the first real consumer of v0.20a generics, lambdas, and effectful traversal. Order-preserving combinators build with fold + prepend and a final reverse — O(n) builds, never append (which would be O(n²) over the array lowering).
BYNK_LOCALE_SRC
bynk.locale — the bundle-free render/renderArg helpers and the message/withText/withWhole/withNum/withMoment builder API (slice 1: render formats code plus a deterministic sorted-by-key rendering of params; no lookup, no locale-dependent behaviour). uses bynk.locale.types for the types its own signatures name.
BYNK_LOCALE_TYPES_SRC
bynk.locale.types — LocaleTag, MessageArg, Message: a dependency-free leaf (no uses of its own) so any consumer, including the bynk adapter itself, can reach these types without also reaching bynk.locale’s value-level API.
BYNK_MAP_SRC
bynk.map — combinators over the Map kernel (empty, insert, get, keys, length). fromList is deliberately absent: Bynk has no pair type to spell a List[(K, V)] with, so map construction is Map.empty()
BYNK_STRING_SRC
bynk.string — Bynk-written helpers over the v0.22a string kernel (concat, the List fold, and the Option kernel methods). The kernel itself is compiler built-in (ADR 0046); only derived helpers live here. join folds to Option[String] so empty-string elements are joined faithfully (a bare "" accumulator could not tell “nothing yet” from “first element was empty”).
BYNK_SURFACE_CAPABILITIES
The capabilities the env-free bynk surface exports (its exports capability { … } line in bynk.bynk). First-party symbols live on synthetic files and are excluded from the binding index, so the unknown-name quick-fix (#852) offering consumes bynk { … } needs this explicit list. Kept in sync with the adapter source by bynk_surface_capabilities_match_the_adapter.
BYNK_UNIT
The unit name of the reserved first-party surface adapter.
CLOUDFLARE_ADAPTER_SRC
The first-party Cloudflare platform adapter (v0.19): the platform’s real infrastructure capabilities, as they are — no portable intersection (decision 0016). The v0.19 surface was the minimal, collection-free Kv (decision 0023); v0.23 adds the list drain and putTtl (0050/0051); structured values are v0.22-codec composition, and Queue remains its own future increment. Like the bynk surface it has no binding clause — the toolchain supplies the binding.
CLOUDFLARE_BINDING_FILENAME
The output path of the Cloudflare platform adapter’s binding module, beside the adapter’s emitted bynk/cloudflare.ts (distinct from the bynk surface’s per-platform bynk-cloudflare.ts).
CLOUDFLARE_UNIT
The unit name of the first-party Cloudflare platform adapter (v0.19, decision 0026): inside the reserved bynk.* prefix, so no separate reservation rule is needed. The surface unit bynk stays the portability marker; bynk.<platform> units are the platform-locked ones.
CRYPTO_KEY_TYPES
The opaque key types bynk.crypto exports. A value of one holds a non-extractable platform key, so it is never stored, persisted, logged or sent (bynk.types.key_at_boundary), as a Stream is not. The checker finds them by the unit’s reserved span file, so a user type of the same name is not mistaken for one.
CRYPTO_UNIT
The unit name of the first-party cryptography adapter (standard-library K4, D5/D6): a flat sibling of bynk, platform-free, with a binding per platform.
EDGE_CACHE_BINDING_PREFIX
The prefix an EdgeCache instance’s binding name would carry (first-party registry L7, #2414). Workers Cache is a Worker-wide [cache] setting with no env binding, so the name is never emitted: the instance is built from the entry’s ctx instead.
FIRSTPARTY_SOURCES
Every first-party .bynk source, paired with its unit name — the single list every consumer iterates: hover (describe_firstparty_symbol), completion (EMBEDDED_UNITS), and the parse guard (every_first_party_source_parses). Before this list each consumer kept its own hand-maintained copy, and bynk.locale/bynk.locale.types were added to none of them — so the whole locale surface hovered as nothing and was absent from completion (#901).
KV_BINDING_NAME
The fixed Worker binding name for the Kv namespace (decision C1, v0.19): one namespace, one [[kv_namespaces]] stanza, one env.KV field.
LIST_UNIT
The unit names of the first-party collection commons (v0.20b): the Bynk-written combinator stdlib over the built-in List/Map kernel. Inside the reserved bynk.* prefix; injected when uses-imported.
LOCALE_TYPES_UNIT
Inside the reserved bynk.* prefix; injected when uses-imported. Also uses-imported by the bynk adapter itself, to give capability Locale’s current() -> Effect[LocaleTag] a type to name (an adapter may uses a commons; a commons cannot in turn reference an adapter). Split out of bynk.locale (locale-negotiation-slice-2 follow-up, #886) specifically so a context can reach LocaleTag without also pulling in bynk.locale’s own render — which previously collided with a message-bundle commons’s own synthesised render (ADR 0272) the moment a context needed both.
LOCALE_UNIT
Inside the reserved bynk.* prefix; injected when uses-imported by application code (a message-bundle commons, ADR 0272) — never directly by the bynk adapter itself any more (see LOCALE_TYPES_UNIT).
MAP_UNIT
R2_BINDING_PREFIX
The Worker binding prefix of an R2 instance (standard-library P5, #2323): capability Archives = R2 binds as R2_ARCHIVES, an [[r2_buckets]] entry.
R2_JURISDICTIONS
The jurisdictions an R2 bucket may be pinned to, as @jurisdiction(…) takes them and wrangler r2 bucket create --jurisdiction accepts them.
R2_JURISDICTION_OPTION
The one creation option of an R2 instance: the bucket’s jurisdiction.
RATELIMIT_BINDING_PREFIX
The Worker binding prefix of a RateLimit instance (standard-library P3, #2342): capability LoginLimit = RateLimit @limit(100) @period(60.seconds) binds as RATELIMIT_LOGIN_LIMIT, a [[ratelimits]] entry.
RATELIMIT_LIMIT_OPTION
A RateLimit instance’s count: the calls per key allowed in one period.
RATELIMIT_PERIODS
The windows the Workers Rate Limiting binding offers, in seconds.
RATELIMIT_PERIOD_OPTION
A RateLimit instance’s window.
SERVICE_BINDING_PREFIX
The Worker binding prefix of a Service instance (interop I5, #1972): capability Billing = Service @worker("legacy-billing") binds as SERVICE_BILLING, a [[services]] entry naming legacy-billing.
SERVICE_WORKER_OPTION
The option of a Service instance that names the Worker it reaches. worker, not D4’s service: service is a keyword, so @service(…) does not parse, and widening the annotation grammar is language work (ADR 0023).
STRING_UNIT
Inside the reserved bynk.* prefix; injected when uses-imported.
UNITS
The standard library’s first-party units. Dependencies between them are not listed here: they are the uses/consumes lines of each unit’s own source, which the checker follows when it injects. The table’s order is FIRSTPARTY_SOURCES’ order; injection follows Unit::id_block.

Functions§

allow_entry_is_live
Whether entry, an [unstable] allow entry, reaches anything in experimental (a list of experimental item paths, such as experimental_items): it names an experimental item, lies under one, or contains one. An entry that reaches nothing is stale.
allows
Whether an [unstable] allow list covers path: an entry covers itself and everything under it.
cloudflare_binding_source
The toolchain-supplied binding for the Cloudflare platform adapter.
covers
Whether path is prefix or lies under it, by whole dotted segments.
experimental_items
Every experimental item, as a full path: each experimental unit, and each listed item of a stable one.
experimental_items_in
experimental_items over a given table.
exported_names
The names a first-party unit exports: those on its exports … { … } lines (an adapter) and its own fns and types (a commons). Read from the source, so the list cannot fall behind it.
instantiable
The instance kind capability of unit is, if a context may declare named instances of it (S4a, #1966).
is_extensible
Whether name, an enum exported by unit, is extensible.
is_extensible_in
is_extensible over a given table.
names_first_party_item
Whether path names a first-party unit or an item it exports. Operation paths (bynk.cloudflare.Kv.list) are accepted when their item exists.
names_first_party_item_in
names_first_party_item over a given table.
platform_of
v0.19 decision 0024: which first-party units are platform-native — consuming one locks its deployment unit to the returned platform. This is the metadata that drives effective-platform computation, env resource typing, and wrangler.toml stanza derivation; no user-facing marker syntax exists (additive later, when third-party platform adapters become a goal).
provider_takes_env
v0.18 decision 0021 / v0.19 decision 0025: which first-party provider classes take the Worker env as a constructor argument, keyed by (unit, provider class). SecretsProvider accepts an optional env with a globalThis probe fallback; WorkersKv requires env on use — KV namespaces exist only on the Worker env, never on globalThis.
split_item_path
The unit a dotted item path lies in, and the rest of the path relative to it (empty for the unit itself). Unit names contain dots, so the longest unit name that is a whole-segment prefix wins: bynk.cloudflare.Kv is in bynk.cloudflare, not in bynk.
split_item_path_in
split_item_path over a given table (tests pass a synthetic one).
stability_of
The stability of a first-party item: a unit (bynk.cloudflare), an exported item (bynk.cloudflare.Kv) or a capability operation (bynk.cloudflare.Kv.list). An item in an experimental unit, or under an experimental item, is experimental. None when no first-party unit holds the path.
stability_of_in
stability_of over a given table.
unit
The registry entry for name, if it is a first-party unit.