@ubx/sdk
v1.0.2
Published
The describe-only TypeScript runtime for Ubiquex SDK programs.
Readme
@ubx/sdk
The describe-only TypeScript runtime for Ubiquex SDK programs.
A program built on @ubx/sdk never computes, never reaches a provider,
and never touches a ledger -- it describes a desired end-state (an
ubx:intent/v1 document) and stops. resource() returns a Computed<T>
reference, never a real value, so a resource's not-yet-known attribute
can still be wired into a sibling resource's config at describe time.
This package is the runtime shared by every ubx sdk gen --lang ts
generated bindings package (e.g. ubx-sdk-aws, ubx-sdk-google,
ubx-sdk-azure, ubx-sdk-kubernetes -- one combined repo per provider,
UBI-138) -- a program built against it imports stack/resource/
intent/secret and calls them against the binding's own generated
ResourceBinding/Config types.
evaluator/guards.ts is the eager-nondeterminism guard set the
hermetic evaluator installs before running a program (Date.now,
Math.random, network/filesystem access, ...) -- not something a
program author imports directly.
What it contains
runtime/src/: the real runtime,stack,resource,intent,secretevaluator/guards.ts: the nondeterminism guard set, installed byubx's own hermetic evaluator, not imported by a program directlyembed.go: the realgo:embedbridgeubiquexuses to compile this repo's own TypeScript directly into theubxbinary
Install
deno add jsr:@ubx/sdkIndependent convenience for editor/IDE type-checking. Not required for
evaluation to work, ubx's own hermetic evaluator embeds this repo
directly and never fetches the published package.
Two real roles, one source (UBI-139)
This repo is the canonical source for both:
- The real, published JSR package (
deno add jsr:@ubx/sdk, orjsr:@ubx/sdkas an import specifier) -- an independent convenience for a program author's own editor/IDE type-checking, never required for evaluation to work. - The runtime
ubx's own hermetic Deno-based evaluator actually executes against --github.com/ubiquex/ubiquexmounts this repo as a git submodule atsdk/ts/, andembed.go's owngo:embeddirective compilesevaluator/guards.tsandruntime/src/index.tsdirectly into theubxbinary itself (tsevalextracts both to a temp dir and generates adeno.jsonimport map at evaluation time -- the realjsr:@ubx/sdkpackage is never fetched or consulted;ubx's own hermetic evaluator runs under Deno's--no-remote, which structurally refuses to resolve any remote specifier, jsr: included).
Moving or renaming evaluator/guards.ts or runtime/src/index.ts
within this repo requires a matching update to ubiquex's own
sdk/ts/embed.go, or the whole ubx binary fails to build.
See docs.ubiquex.io for the full SDK guide.
License
Apache-2.0
Links
- Docs: https://docs.ubiquex.io
- Internals (architecture and design): https://github.com/Ubiquex/ubiquex-internals
- Linear board: https://linear.app/ubiquex
