@todayai-labs/tck-host-native
Bundle-artifact package for non-Vite native hosts (macOS / iOS / iPadOS / visionOS). Ships dist/ with harness.html + importmap-resolved shared deps for WebView consumers.
Bundle-artifact package for non-Vite native hosts that load .tckb widgets via WebView — WKWebView on macOS / iOS / iPadOS / visionOS, plus Capacitor / Electron / Tauri equivalents.
The package's dist/ is what you consume — copy it into your native bundle's resources and point a custom URL scheme handler at it.
What's in dist/
| Path | Purpose |
|---|---|
harness.html | Single static HTML harness that hosts one widget per WebView. Bundle-agnostic; reads bundleHash, size, theme, instance id from window.location. |
__deps__/react-runtime.mjs | Pre-bundled React + ReactDOM + scheduler + JSX runtime, wired through the harness's import map. |
__deps__/tck.mjs | Pre-bundled @todayai-labs/tck. |
__deps__/tck-host.mjs | Pre-bundled @todayai-labs/tck-host. |
__deps__/tck-host-mount.mjs | Pre-bundled @todayai-labs/tck-host/mount (the mountHost entry point). |
__deps__/tck-host-style.css | Host stylesheet — linked from the harness <head>. |
spec/tckb-format.md | Canonical .tckb wire-format spec (mirror of packages/tck-bundle-format/FORMAT.md). |
spec/manifest.schema.json | JSON Schema for manifest.json (mirror of @todayai-labs/tck's schema). |
Versioning
Not in the fixed SDK group. Walks its own version line (currently 0.x) — see VERSIONING.md. The package's cadence is tied to native-shell releases rather than the JS SDK's, and its consumers (native apps with their own release trains) need to pin against a specific dist snapshot rather than tracking the SDK's fixed-group bumps.
Integration
Two common shapes — cp -R dist/ into your native bundle as a build step, or read individual paths via the package's helpers:
DIST=$(node -e "console.log(require('@todayai-labs/tck-host-native').getDistDir())")
cp -R "$DIST/" "$APP_BUNDLE/Contents/Resources/tck/"Or granularly:
import { getHarnessHtmlPath, getDepsDir, getSpecDir } from '@todayai-labs/tck-host-native'
// Inside a justfile, an Xcode pre-build phase, etc.
console.log(getHarnessHtmlPath()) // → /abs/path/.../dist/harness.html
console.log(getDepsDir()) // → /abs/path/.../dist/__deps__
console.log(getSpecDir()) // → /abs/path/.../dist/specWire the harness URL to a custom scheme (e.g. tckb://<hash>/?size=...&theme=...); the WebView loads harness.html and the harness imports widgets from the same scheme. See clients/macos/ for the reference WKWebView consumer.
Why this exists
The Vite-based hosts (workbench, tck-preview, today-platform-web) build their own __tck/v1/* output via apps/web/scripts/build-host-deps.mts invoking tck-shared-deps. A native host has no Vite — tck-host-native is the canonical pre-built equivalent, packaged so the native build pipeline doesn't need a Node toolchain at build time.
Source
- Package:
packages/tck-host-native - Reference consumer:
clients/macos/ - Underlying builder:
tck-shared-deps— the package whose outputtck-host-nativepre-builds for distribution.