Commit Graph

50 Commits

Author SHA1 Message Date
Maofeng 427abd15f9 chore(editor): configure Tailwind IntelliSense for Zed
Teach the Tailwind language server to inspect cva, cx, and cn class helpers and use the Tailwind-aware CSS language server for workspace styles.
2026-07-30 15:20:37 +08:00
Maofeng 8c08adc9c2 docs(console-web): document page lifecycle and UI boundaries
Explain the centralized page registry, primary-page retention TTL, typed lifecycle callbacks, and Host/Page state ownership. Document the cva and cn component convention and keep global CSS limited to theme, base rules, and shared keyframes.
2026-07-30 15:16:02 +08:00
Maofeng 9ff3223c44 refactor(console-web): centralize page lifecycle and UI composition
Declare navigation, page metadata, lazy loaders, and keep-alive policy in one registry. Retain primary iframe pages until a continuous inactive TTL expires and expose typed show, hide, and unload events through the Page SDK.

Move business-aware components out of the UI primitive directory, migrate views and Host dialogs to variant primitives and local Tailwind classes, and remove the global component style layer. Keep native dialogs inside the overlay flex context so they remain centered.

Cover iframe expiration, lifecycle dispatch, UI dependency direction, and global style ownership with focused tests.
2026-07-30 15:16:02 +08:00
Maofeng 23fa6137ff feat(console-web): add variant-based UI primitives
Introduce cva-driven Button, form, card, table, and segmented controls.

Use clsx and tailwind-merge through a shared cn helper so callers can override component defaults without relying on global semantic CSS. Control sizes define minimum heights while icon-only actions retain stable square dimensions.
2026-07-30 15:16:02 +08:00
Maofeng 868da49a52 feat(console-web): add swinging iframe load progress
- place an indeterminate progress track below the loading label
- animate the indicator between both ends of the track
- expose an accessible progressbar label for the active view
- honor reduced-motion preferences with a static indicator
2026-07-30 10:11:52 +08:00
Maofeng 391901a71a docs(console-web): define browser tab state ownership
- distinguish Host-global, tab-shell, and Page-private state
- describe the cross-tab handshake and ordering guards
- document mounted and keep-alive Page synchronization rules
- record the BroadcastChannel fallback behavior
2026-07-30 09:57:16 +08:00
Maofeng 88a7fba0b0 feat(console-web): synchronize Host state across tabs
- separate global Host state from tab-local shell and Page state
- replicate control-plane snapshots through a versioned BroadcastChannel
- handshake new tabs without publishing empty startup state
- reject self, stale, and malformed cross-tab messages
- suppress broadcast echoes while applying remote snapshots
- publish API snapshots and connection state atomically
- keep Page state private and update only mounted iframe documents
- test initial synchronization and protocol rejection paths
2026-07-30 09:57:06 +08:00
Maofeng 93f4a505ba docs(console-web): explain iframe retention lifecycle
- document opt-in page policy and the bounded cache
- define activate, deactivate, and dispose responsibilities
- explain hidden-frame state and command handling
- provide a Solid activity accessor example
2026-07-30 09:43:27 +08:00
Maofeng 1b2c50c951 feat(console-web): add bounded iframe keep-alive
- opt service and settings pages into document retention
- preserve iframe identity and local Solid state across navigation
- cap retained documents with deterministic LRU eviction
- deliver activate, deactivate, and dispose lifecycle messages
- reject commands emitted by inactive page documents
- expose page activity as a Solid accessor
- test retention, recreation, eviction, and invalid limits
2026-07-30 09:43:19 +08:00
Maofeng ccad05fa5a docs(console): document Host-page and embedded build workflows
- explain the persistent Host and disposable iframe ownership model
- define SDK compatibility and PWA cache boundaries
- document independent debug servers and release embedding
- record Node, npm, NPM, and WASMELD_BUILD_WEB requirements
- update repository structure and startup commands
2026-07-30 09:22:55 +08:00
Maofeng f6ad94e948 feat(console): embed the management UI in release binaries
- build locked Web dependencies automatically for release profiles
- keep debug Cargo builds independent from the Vite development server
- embed generated Host, Page, manifest, and service worker assets
- serve exact control-plane assets with MIME and cache headers
- reject non-canonical and unknown paths without an SPA fallback
- cover embedded document boundaries and path validation
2026-07-30 09:22:55 +08:00
Maofeng 70ee5e33da feat(console-web): replace TanStack UI with Solid host pages
- move the management frontend under the wasmeld-console crate
- use a persistent Host shell with disposable iframe page documents
- version Host/Page postMessage state and command contracts
- migrate runtime, service, WIT, invocation, and settings workflows
- add Tailwind CSS v4, responsive layouts, and Host-owned dialogs
- emit a dependency-free PWA worker with API cache exclusions
- remove the superseded root TanStack Start application
2026-07-30 09:22:55 +08:00
Maofeng 4e32a1246b docs(console-ui): explain data and byte transformations 2026-07-30 08:13:37 +08:00
Maofeng 223ead37c8 docs(console): clarify API and persistence boundaries 2026-07-30 08:13:33 +08:00
Maofeng aea42ba0a6 docs(runtime): explain actor and resident invariants 2026-07-30 08:13:27 +08:00
Maofeng 73d7c76446 docs(wit): document capability and component contracts 2026-07-30 08:13:24 +08:00
Maofeng a1b808013a docs(package): explain packaging and dependency workflows 2026-07-30 08:13:20 +08:00
Maofeng a5718da1da docs: describe resident component architecture
Document the Host-owned event/effect flow, revision-scoped resource supervision, endpoint policy, versioned resident WIT dependency, and the resident-probe packaging command.
2026-07-30 07:40:11 +08:00
Maofeng 572fed47b4 feat(runtime): supervise resident component resources
Detect the resident actor export, route Host events through the bounded Actor mailbox, enforce fuel, deadlines, payload limits, and translate WIT effects into typed runtime values.

Add a revision-scoped ResidentSession with deny-by-default TCP, UDP, and Unix endpoint policies, non-reused resource IDs, stream lifecycle and backpressure state, atomic effect validation, timers, subscriptions, extension sources, and shutdown handling.

Cover passive rejection, real Component ABI round trips, resource ownership, endpoint policy, and driver operation validation with integration tests.
2026-07-30 07:40:08 +08:00
Maofeng 949b8d6cdb feat(wit): define resident actor protocol
Add the versioned wasmeld:resident@0.1.0 event/effect contract for timers, streams, datagrams, messages, extension sources, and shutdown.

Add a resident-probe Component with locked service and resident WIT dependencies so the ABI can be built, packed, and exercised independently.
2026-07-30 07:40:02 +08:00
Maofeng b304b038a4 docs: describe resilient development and telemetry
Document queued rebuilds and artifact-preserving deployment retries for wasmeld dev.

Describe asynchronous invocation telemetry, its durability boundary, graceful flushing, and the default Wasmtime compilation cache location.
2026-07-30 07:18:36 +08:00
Maofeng 0f0effb3c3 refactor(console-ui): split dashboard responsibilities
Reduce the root TanStack route to orchestration and shell state. Move backend-to-view mapping and binary invocation formatting into console-model, presentation views into components/views, and modal workflows into components/dialogs.

Update the rendered artifact test to assert behavior at the new module boundaries without changing the generated UI or routes.
2026-07-30 07:18:29 +08:00
Maofeng 68218b2eae perf(console): decouple invocation telemetry writes
Move Axum management and gateway adapters into a dedicated module while preserving the existing public routers and response contracts.

Replace per-invocation full snapshots with a bounded asynchronous writer that batches metric deltas and events. Serialize it with control snapshots, flush before lifecycle persistence and graceful shutdown, and keep invocation results independent from telemetry failures.

Enable the Runtime compilation cache beside the Console artifact directory and verify metric recovery across a lifecycle flush.
2026-07-30 07:18:25 +08:00
Maofeng 53a8c6b690 feat(runtime): cache compiled components
Enable Wasmtime's persistent compilation cache and expose an optional cache directory in RuntimeConfig.

Create and canonicalize the configured directory before Engine construction, and report cache filesystem and configuration failures through dedicated RuntimeError variants.
2026-07-30 07:18:21 +08:00
Maofeng 38a397fa20 fix(package): make dev deployments retryable
Track the source fingerprint captured before compilation so edits made during a build trigger another cycle.

Keep successful build artifacts pending while the Console is unavailable and retry deployment without recompiling. Make activation retries idempotent by pruning every stale matching development revision after the active revision is switched.
2026-07-30 07:18:17 +08:00
Maofeng 2650b8ef14 docs(cli): add Wasmeld command reference
Document Component project requirements, live preview behavior and options, package construction, WIT dependency locking and replacement, Registry publishing, and CLI environment variables.

Link the root and Console guides to the maintained CLI reference and remove links to excluded design documents.
2026-07-29 20:52:32 +08:00
Maofeng c982753eb8 docs: clarify live WIT dependency updates
Recommend unlocked development mode when editing local WIT replacements, while retaining --locked for source-only work that must preserve the existing contract graph.
2026-07-29 20:26:57 +08:00
Maofeng 2c6e761288 docs: document live Component preview workflow
Explain the wasmeld dev watch-build-package-deploy loop, isolated development service IDs, hash revisions, failure retention, cleanup behavior, and command options.

Document the inactive-revision DELETE endpoint and the switch-before-unregister safety rule.
2026-07-29 20:26:25 +08:00
Maofeng 839874fb56 feat(cli): add live Component development loop
Add wasmeld dev with source and local WIT replace watching, Debug builds by default, deterministic hash-based development revisions, and optional one-shot or Release operation.

Build and validate before registering, switch the isolated development Deployment only after successful startup, and unregister the prior matching development revision after the switch.

Keep generated WIT dependencies and build output outside the watch fingerprint, retain the previous deployment after failures, and avoid introducing a platform-specific watcher dependency.
2026-07-29 20:26:16 +08:00
Maofeng 201d99c7e0 feat(console-ui): display revision unregister events
Extend the typed event model and activity feed metadata so development cleanup remains visible in the management console.
2026-07-29 20:26:10 +08:00
Maofeng d0d2e06f68 feat(console): unregister inactive revisions
Expose a management DELETE endpoint that refuses to remove an active Deployment, delegates Actor and compiled Component cleanup to Runtime, and removes stored artifacts.

Reconcile Toasty snapshots by deleting absent service and Deployment rows so removed revisions do not reappear after restart.

Persist unregister lifecycle events and verify active-revision protection, artifact deletion, Runtime cleanup, and restart behavior.
2026-07-29 20:26:06 +08:00
Maofeng 778fbd2a06 feat(runtime): unregister service revisions
Add a lifecycle-serialized unregister operation that stops a resident Actor before releasing its registered and compiled Component.

Return the existing not-registered and unavailable errors without leaving a partially removed live revision, and cover Actor and registration count cleanup.
2026-07-29 20:25:58 +08:00
Maofeng 71654a8bcf docs: document persistent Host KV
Describe the versioned KV capability, service-level namespace, persistence behavior, limits, and kv-probe packaging workflow.

Record the v0.1 exclusions for TTL, enumeration, transactions, and compare-and-swap.
2026-07-29 19:37:19 +08:00
Maofeng a325c60421 feat(console): persist Host KV in libSQL
Store KV entries through Toasty with a composite service ID and key primary key, including an additive table migration for existing Console databases.

Bridge synchronous Wasmtime Host calls to async persistence with a bounded worker queue and response timeout capped by the service deadline.

Verify same-service revision sharing, cross-service isolation, deletion, exact capability reporting, and persistence after reopening Console.
2026-07-29 19:37:17 +08:00
Maofeng 8d8d136510 feat(runtime): host service-scoped KV capability
Introduce an injectable, deadline-aware KvBackend boundary and link only the exact wasmeld:kv/store@0.1.0 import requested by a Component.

Namespace entries by service ID so revisions share state while services remain isolated, reject registrations without a backend, and enforce 256-byte keys and 64 KiB values.

Cover capability discovery, cross-revision sharing, service isolation, missing backends, and resource limits with Component integration tests.
2026-07-29 19:37:10 +08:00
Maofeng 044b64a9c7 feat(component): add KV capability probe
Add a small Component that imports wasmeld:kv/store@0.1.0 and exercises get, set, and delete through a byte-oriented test protocol.

Pin service and KV WIT dependencies in wit.lock while keeping generated wit/deps content out of source control.
2026-07-29 19:37:05 +08:00
Maofeng 5edf185c90 feat(wit): add versioned KV store package
Define wasmeld:kv/store@0.1.0 with get, set, and delete operations.

Expose explicit invalid-key, value-too-large, and operation-failed variants so components can handle bounded storage failures without relying on host-specific errors.
2026-07-29 19:37:00 +08:00
Maofeng 72c901c478 fix(console-ui): render binary invocation output safely
- decode UTF-8 responses in fatal mode and reject control-byte payloads
- fall back to hexadecimal output instead of replacement characters
- show response byte count, selected representation, automatic fallback, and latency
- preserve the existing counter u64 representation and cover the wiring in SSR tests
2026-07-29 19:20:15 +08:00
Maofeng 51b452ecc5 docs: explain host capability discovery
- document exact-version import resolution and deny-by-default behavior
- clarify that Component imports remain the capability source of truth
- describe structured capability metadata returned by the Console API
2026-07-29 19:13:51 +08:00
Maofeng bdbf868f75 feat(console-ui): show component host capabilities
- consume structured capability metadata from service responses
- add a stable-width Host Capability column to the full service table
- preserve compact overview density and horizontal overflow on narrow screens
- cover API typing and capability rendering wiring in SSR source tests
2026-07-29 19:13:45 +08:00
Maofeng 72a264e0d1 feat(console): expose component capabilities
- project structured capability package, name, version, and interface fields
- derive capabilities during registration and artifact restoration
- keep Component imports as the source of truth without changing .wasmpkg
- verify empty and Clock capability responses through the management API
2026-07-29 19:13:41 +08:00
Maofeng 5b32886efe feat(runtime): modularize host capabilities
- add an exact-version Capability Registry and structured descriptors
- move Clock bindings, host state, and Linker installation into its own module
- derive required capabilities from Component imports and link only requested interfaces
- cover exact-version resolution and minimal per-component capability sets
2026-07-29 19:13:35 +08:00
Maofeng 3f5bb344f7 docs: document gateway deployment workflow
- explain the separate control-plane and data-plane listeners
- document revision activation and raw binary invocation
- clarify restart restoration and actor-memory semantics
2026-07-29 16:32:21 +08:00
Maofeng 9160362fc0 feat(console-ui): manage active deployments
- load deployment state with the console snapshot
- mark externally routed revisions in service tables
- add guarded activation confirmation and pending states
- cover deployment API wiring in SSR tests
2026-07-29 16:32:16 +08:00
Maofeng 1d3fac4be8 feat(console): add deployment-routed gateway
- persist service-to-revision deployments in libSQL with an additive migration
- restore active actors and atomically switch revisions
- expose an isolated raw-byte gateway on a second listener with stable errors
- cover routing, isolation, revision switching, and restart restoration
2026-07-29 16:32:12 +08:00
Maofeng a872008d44 docs: add project overview
- summarize the package, Runtime, Console, component, and frontend modules
- provide startup, component packaging, and WIT publication commands
- explain Registry dependency resolution and local path replace
- keep local architecture design drafts outside version control
2026-07-27 05:19:30 +08:00
Maofeng 8de300b634 feat(console-ui): add TanStack management console
- provide Runtime overview, service lifecycle, invocation, and event views
- add immutable WIT package listing, publication, and download workflows
- connect all state to the Rust management API without direct database access
- use TanStack Start with Node serving, Oxlint, Oxfmt, and SSR checks
- include responsive operational layouts and empty Actor placeholders
2026-07-27 05:02:35 +08:00
Maofeng 12992186a9 feat(console): add runtime management and WIT Registry
- embed wasmeld-runtime behind an Axum management API
- persist service metadata, metrics, and events with Toasty and libSQL
- register immutable component artifacts with platform-owned limits
- publish, list, inspect, and download binary WIT package versions
- verify Runtime lifecycle, persistence, Registry immutability, and transitive fetch
2026-07-27 05:01:26 +08:00
Maofeng cfac7d85f0 feat(runtime): add resident Wasmtime actor runtime
- define versioned service and clock WIT contracts
- enforce import allowlists, fuel, epoch, memory, I/O, and mailbox limits
- keep one Store and Component Instance resident per serial Actor
- add echo, counter, fault, spin, and capability probe components
- cover lifecycle, concurrency, sandbox, and fault recovery behavior
2026-07-27 04:59:33 +08:00
Maofeng 893895a76c feat(package): add component and WIT package tooling
- define the constrained .wasmpkg archive and integrity checks
- encode and inspect standard binary WIT packages
- resolve exact Registry dependencies with wit.lock and path replace
- provide wasmeld pack and wit build/fetch/publish CLI commands
2026-07-27 04:57:34 +08:00