Versioned contracts

Find the contract behind every behavior.

Follow the v0.1 browser runtime, character-pack, input, density, dismissal, security, and performance contracts.

01 · RELEASE BOUNDARY

This map describes published 0.1.5.

The public contract is the exact npm release built from the immutable v0.1.5 source tag. Package exports, schema, declarations, runtime behavior, and release evidence must agree before a field can be described as part of that version.

Released artifact identity

peekling.min.js
117,503 bytes. SHA-256 5b88583691fc2780933b2f85e739ff44aedca0813846f9d326ba136bbb4d4a20.
peekling.css
3,234 bytes. SHA-256 af83c829e6d99504dbd896877d089b42a4311da29c8b0957b5330312f0d350f6.
@peekling/runtime
Version 0.1.5 with zero production dependencies.
source
Immutable tag v0.1.5, release commit a8182b7.
Release 0.1.5 keeps one versioned Plan contract across its JSON schema, declarations, validator, and runtime.

02 · PUBLIC SURFACES

One runtime, three ways in.

hatch()
Named ESM export. Returns one owned instance with ready, finished, emit, override, pause, resume, and destroy.
Peekling.hatch()
The same creation contract in the complete browser file.
<peekling-character>
A lifecycle facade. Connection hatches and disconnection destroys.

The ESM root also exports site visibility helpers and explicit Web Component registration. Supported package subpaths are ., ./pack, ./preflight, ./canvas, ./browser, and ./peekling.css. These exports and subpaths define the complete public API.

The complete browser file preserves an existing globalThis.Peekling value or foreign custom element. It reports an occupied surface through peekling:collision.

03 · CONFIGURATION CONTRACT

Closed objects keep the boundary legible.

Serializable Configuration uses closed JSON objects. Static schema checks establish shape and lexical limits. Shared semantic validation then checks URLs, references, channel ownership, Pack Capabilities, and selected States.

Pack source
At least one of character, packUrl, or pack. Runtime precedence is inline Pack, explicit manifest, then registered alias.
Render bounds
scale is an integer from 1 through 4. density and maxDensity accept 1, 2, or 4.
Position
bottom-left, bottom-right, center, or finite coordinates from -100000 through 100000.
URLs
Same-origin relative paths or canonical, credential-free absolute HTTPS URLs with valid authority data.
JavaScript-only seams
Host mounts, loggers, diagnostic callbacks, and injected browser objects live on the runtime Configuration object. Pack and Plan remain serialized data.

A Native format-1 Pack is data only. It declares identity, SPDX license, metadata, PNG atlas candidates, States, optional Capabilities, timing, and hashes. Every Pack includes idle. Its closed schema contains character data, while the host owns Rules, callbacks, rendered HTML, and application services.

04 · PLAN CONTRACT

Immutable policy, bounded runtime state.

BaselineAlways owns a valid character State
Event admissionValidate, snapshot, and queue one fact
Rule evaluationUse typed conditions in declaration order
Channel compositionCombine compatible Effects
Pack resolutionSelect only a declared State or Capability
Plan
One baseline plus at most 64 declaration-ordered Rules.
Browser Events
pointer.click, pointer.move, document.visibility, window.focus, window.scroll, section.visibility, and page.lifecycle.
Channels
motion, state, and named surface:<id> channels. Each Effect lists every channel it owns.
Motion
Published 0.1.5 supports follow-pointer, viewport-traverse, move-to, move-to-target, jump-to, and svg-path. Each form has bounded, validated inputs.
Disposition
A competing named surface explicitly chooses update, replace, ignore, or interrupt.

Application Events use a 32-item FIFO queue. Payloads are immutable JSON-like own data up to 8 KiB, with bounded depth, strings, collections, and value count. A full queue preserves every accepted Event and returns a rejection for the incoming Event.

An Override uses the same Effect model and leaves the immutable Plan intact. It owns declared channels for its lifetime. The runtime permits at most eight active disjoint Overrides. Every lifetime has a one-hour ceiling or an earlier explicit release.

05 · RESOURCE AND SECURITY CONTRACT

Every fetched byte keeps a named boundary.

Browser policy map

script-src
The ESM or complete browser runtime.
style-src
The external runtime stylesheet loaded into closed shadow roots.
connect-src
Manifest and atlas Fetch requests.
img-src blob:
The object URL created only after atlas bytes pass verification.
  • Manifest and atlas requests have a 30-second deadline.
  • Fetched Native manifests are limited to 64 KiB and Native atlas input to 4 MiB.
  • Atlas dimensions are capped at 4096 by 4096 pixels.
  • Every atlas candidate requires a lowercase SHA-256 declaration.
  • Strict CSP uses external styles, registered event listeners, and static execution.
  • The upstream runtime is telemetry-free and connectionless.

SRI, CSP, pinned URLs, CORS, and origin allowlists provide complementary layers of defense. Pair them with source provenance checks and provider review. Cross-origin assets also depend on correct browser policy and provider availability.

06 · LIFECYCLE AND ACCESSIBILITY

Park cleanly. Finish once.

  • ready resolves after Pack, stylesheet, Plan, first State, and owned DOM are usable.
  • finished always settles once after terminal cleanup.
  • Host pause, hidden documents, and site dismissal compose as suspension reasons. Resume happens after the final reason clears.
  • Reduced motion suppresses movement and renders a validated static tableau.
  • pagehide ends the instance. SPA route changes require host teardown or Web Component disconnection.
  • Sprite art stays aria-hidden. An accessible interaction control and host content surfaces expose actions without moving focus unexpectedly.

Closed Shadow DOM provides presentation encapsulation. Validation, trusted host code, and browser security policy provide the security boundary. Host-rendered mount failures stay contained to the affected surface where browser behavior permits.

07 · RELEASE EVIDENCE

Measured promises stay bounded.

The canonical release measurement combines the complete production browser file and required stylesheet. Under Node 22.14.0, npm 11.16.0, and Node zlib defaults, release 0.1.5 records 38,428 bytes gzip and 33,684 bytes Brotli. Both formats have a 40 KiB cap and a required 256-byte reserve.

Release browser coverage targets current evergreen Chromium, Firefox, and WebKit under the documented matrices. That evidence applies to the exact source, artifacts, browsers, machines, and scenarios tested. Each new host page, device, extension, and callback receives its own integration checks.

The complete browser file has a fixed delivery size. Production bundlers may remove unused static ESM imports where package side effects permit, producing a separate application-specific bundle.

08 · CANONICAL PUBLIC REFERENCES

Follow the authority for the question.

Ready to integrate?

Use the task-focused developer guide.

Open developer docs →