Commit graph

112 commits

Author SHA1 Message Date
enzotar
35b39a1cf1 feat(ds-stream): v2.0-2.3 composable codec pipeline
v2.0 — Pipeline Architecture
  - Frame, CodecResult, Codec trait, Pipeline builder
  - 6 adapters: Passthrough, Dedup, Compress, Pacer, Slicer, Stats

v2.1 — Multi-frame & new codecs
  - CodecOutput::Many fan-out, EncryptCodec, FilterCodec
  - Codec::reset(), encode_all/decode_all, real SlicerCodec chunking

v2.2 — Observability & reassembly
  - PipelineResult (frames+errors+consumed), StageMetric
  - ReassemblyCodec, ConditionalCodec, Pipeline presets & metrics

v2.3 — Integrity & rate control
  - ChecksumCodec (CRC32), RateLimitCodec (token bucket), TagCodec
  - Pipeline::chain(), Pipeline::describe()

13 codec adapters, 474 tests (all green, 0 regressions)
2026-03-11 23:50:35 -07:00
enzotar
fbbdeb0bc4 feat: add initial interactive compiler and ds-stream demos 2026-03-11 18:25:18 -07:00
enzotar
a65094c0d2 compiler: v0.8–v1.0 milestones — generics, traits, async/effects, production hardening
v0.8.0: Generics, Trait System, LSP Foundation (322 tests)
- ds-parser: GenericParam, TraitDecl, ImplBlock, WhereClause, DefaultParam, Destructure
- ds-types: GenericType, TraitRegistry, TypeExpander
- ds-analyzer: AdvancedAnalyzer (unused imports, memo, dep depth, hot paths)
- ds-codegen: CodeGenV2 (generic erasure, for-in/yield, tree shaking, minify)
- ds-layout: FlexLayout (gap, padding, margin, border, position, alignment)
- ds-diagnostic: LspDiagnostic, DiagnosticBatch (LSP format, suppression, dedup)
- ds-incremental: IncrementalV2 (content hash, compile queue, error cache)

v0.9.0: Async/Await, Effect System, Production Hardening (385 tests)
- ds-parser: AsyncFn, EffectDeclV2, TryCatch, PipelineExpr, Decorator
- ds-types: AsyncType (Promise/Future/Effect/Result), AdvancedType (intersection/mapped/conditional/branded)
- ds-analyzer: ProductionAnalyzer (async boundaries, purity, complexity, coverage)
- ds-codegen: CodeGenV3 (async/await, try/catch, pipeline, chunks, CSS, HMR)
- ds-layout: AdvancedLayout (scroll, sticky, flex grow/shrink, shadow, transition)
- ds-diagnostic: DiagnosticPipeline, DiagTag (file index, lint rules, escalation)
- ds-incremental: BuildPipeline (profiles, workers, artifacts, source maps)

v1.0.0: Production-Ready Compiler with Stable API (511 tests)
- ds-parser: ParseError1, PartialAst, VisibilityV2, Namespace, DocComment, Pragma, NumericLit, ParseStats
- ds-types: TypeInference (HM unification), SubtypeChecker, TypeSystemExt (opaque/existential/HKT)
- ds-analyzer: FullAnalyzer (call graph, dead code, tail call, borrow check, vectorize)
- ds-codegen: CodeGenFull (WASM, SSR, hydration, CSS modules, import maps, SIMD)
- ds-layout: Animation, TextLayout, MediaQuery, ColorSpace, Gradient, Filter, LayoutStats
- ds-diagnostic: DiagnosticSuite (SARIF, code frames, budgets, baselines, trending)
- ds-incremental: BuildSystem (remote cache, build graph, plugins, hermetic, signing)
2026-03-11 16:16:42 -07:00
enzotar
dfa0c4151c engine: v0.90–v1.0.0 milestone 🎉
v0.90: World Layers, Stream Encryption V2, Multi-Channel
- ds-physics: set/get layer, gravity scale, angular vel, body type, world gravity, freeze/unfreeze, body tag (183 tests)
- ds-stream: XorCipherV2, ChannelRouter, AckTracker, FramePoolV2, BandwidthEstimatorV2, PriorityMux, NonceGenerator, StreamValidator, RetryQueue (246 tests)
- ds-stream-wasm: 9 exports (156 tests)

v0.95: Scene Graph, Stream Compression V2, Telemetry
- ds-physics: body count all, step count, get gravity, is frozen, get color, AABB, raycast, restitution, emitter count (192 tests)
- ds-stream: Lz4Lite, TelemetrySink, FrameDiffer, BackoffTimer, StreamMirror, QuotaManager, HeartbeatV2, TagFilter, MovingAverage (255 tests)
- ds-stream-wasm: 9 exports (165 tests)

v1.0.0: Production Ready — ECS Foundation, Stream Pipeline, Protocol Finalization
- ds-physics: get tag, body list, impulse, mass, friction, world bounds, body exists, reset world, engine version (201 tests)
- ds-stream: StreamPipeline, ProtocolHeader, FrameSplitterV2, CongestionWindowV2, StreamStatsV2, AckWindow, CodecRegistryV2, FlowControllerV2, VersionNegotiator (264 tests)
- ds-stream-wasm: 9 exports (174 tests)

Total: 639 tests across 3 packages
2026-03-11 14:58:39 -07:00
enzotar
93cdbb75d7 engine: v0.28–v0.50 milestone
ds-physics v0.50.0 (138 tests)
- v0.28: apply_body_torque, is_body_sleeping, get_body_angle
- v0.30: set_body_gravity, set_linear_damping, count_awake_bodies
- v0.40: joints (distance/pin), raycast, kinematic, time scale, world stats
- v0.50: point query, explosion, velocity/position set, contacts, gravity, collision groups

ds-stream v0.50.0 (201 tests)
- v0.28: BufferPool, PacketJitterBuffer, RttTracker
- v0.30: FrameRingBuffer, PacketLossDetector, ConnectionQuality
- v0.40: QualityAdapter, SourceMixer, FrameDeduplicator, BackpressureController, HeartbeatMonitor, CompressionTracker, FecEncoder, StreamSnapshot, AdaptivePriorityQueue
- v0.50: StreamCipher, ChannelMux/Demux, FramePacer, CongestionWindow, FlowController, ProtocolNegotiator, ReplayRecorder, BandwidthShaper

ds-stream-wasm v0.50.0 (111 tests)
- WASM bindings for all stream features

ds-screencast v0.50.0
- CLI: --jitter-buffer, --latency-window, --ring-buffer, --loss-threshold, --adaptive, --dedup, --backpressure, --heartbeat-ms, --fec, --encrypt-key, --channels, --pacing-ms, --max-bps, --replay-file
2026-03-11 12:47:56 -07:00
enzotar
3c14beea50 feat(engine): v0.14-v0.16 releases
ds-physics 0.16.0 (81 tests):
- v0.14: proximity queries, physics regions
- v0.15: event hooks, transform hierarchy, timeline
- v0.16: deterministic seed/checksum, collision manifolds, distance+hinge constraints

ds-stream 0.16.0 (143 tests):
- v0.14: FrameCompressor (RLE), MultiClientSync, BandwidthThrottle, FrameType::Compressed
- v0.15: AdaptiveBitrate, MetricsSnapshot, FramePipeline
- v0.16: FrameEncryptor (XOR), StreamMigration, FrameDedup, PriorityQueue

ds-stream-wasm 0.16.0 (54 tests):
- v0.14: RLE compress/decompress, sync drift, bandwidth limiting
- v0.15: adaptive quality, metrics snapshot, frame transforms
- v0.16: encrypt/decrypt frames, migration handoff, frame dedup

ds-screencast 0.16.0:
- v0.14: --roi, /clients, --compress, --migrate-on-crash
- v0.15: --adaptive-bitrate, /metrics, --viewport-transform, --cdn-push
- v0.16: /tabs, --encrypt-key, --watermark, --graceful-shutdown
2026-03-10 22:47:44 -07:00
enzotar
4a15e0b70c feat: Bump package versions, add physics body sleeping, revolute motor, and prismatic joints, and enhance type checker exhaustiveness. 2026-03-10 21:07:22 -07:00
enzotar
9cc395d2a7 feat(demo): pixel streaming demo with delta+RLE encoding
- Source (index.html): physics sim → pixel capture → delta XOR + RLE encode → WebSocket
- Receiver (receiver.html): WebSocket → decode delta/keyframe → render + click interaction + RTT
- Relay (relay.js): bidirectional WebSocket relay (pixels ↓ signals ↑)
- 97% compression (18KB/frame vs 675KB raw RGBA)
- Interactive: click on receiver → impulse force on source → round-trip latency measured
- Frame types: 0x11 keyframe (every 60 frames), 0x12 delta+RLE
- No buffer bloat: drops frames when pipe is busy
2026-03-10 20:49:35 -07:00
enzotar
b0440e2e47 feat(compiler): v0.4 + v0.5 — CLI modularity, diagnostic pipeline, test suite
v0.4 — CLI Modularity:
- Split monolithic main.rs (2,038 lines) into 8 command modules + slim dispatch (107 lines)
- Add 12 JS codegen tests (signals, derived, views, events, loops, match, enums, components, interpolation, springs, tree-shaking)

v0.5 — Diagnostic Quality + Analyzer Confidence:
- Add From<ParseError> for Diagnostic (E0001) in ds-diagnostic
- Add errors_as_diagnostics() to TypeChecker (E0100–E0110)
- Wire Elm-style diagnostics through dreamstack check and build commands
- Switch incremental compiler to parse_program_resilient() for multi-error collection
- Add 12 analyzer tests (chains, fan-out, diamond deps, empty programs, conditionals, handlers, views)
- Add 2 diagnostic conversion tests

Test suite: 97 → 123 tests (26 new, 0 failures)
2026-03-10 09:09:02 -07:00
enzotar
878e55b962 chore: add per-package versioning, changesets, and clean changelogs
- Add cliff.toml for git-cliff changelog generation (one-line entries,
  no commit body dumps, improve/refine prefixes mapped)
- Add @changesets/cli config and README in .changeset/
- Add release.sh script with per-package version bumps from changesets,
  changeset-driven per-crate changelog updates, and --all/--dry-run flags
- Switch all crates from workspace version to independent version = "0.1.0"
- Generate clean root CHANGELOG.md and per-crate CHANGELOGs with [0.1.0]
- Retag v1.0.0 → v0.1.0 to match actual crate versions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 23:12:54 -07:00
enzotar
9e2cb29dd9 feat: Implement ds-screencast engine, panel preview, and Waveshare ESP-NOW communication. 2026-03-07 02:34:57 -08:00
enzotar
bf2b7c3cd5 feat: Implement Panel IR emitter to generate JSON UI descriptions for LVGL panels. 2026-03-06 20:06:33 -08:00
enzotar
cc6aac8697 feat: Add Waveshare P4 panel device integration with display streaming and touch input, alongside core streaming engine and compiler updates. 2026-03-02 16:08:49 -08:00
enzotar
f01cd10c0a feat: complete tetris rewrite — flat grid, SRS rotation, ghost piece toggle
Rewrote game-tetris.ds from scratch using a single flat 200-element
grid array instead of 20 separate row signals, eliminating all row
dispatch chains. Added SRS-standard rotations for all 7 pieces via
array lookups, full collision detection (down/left/right/rotation),
line clear with slice/concat cascade, computed ghost piece with
togglable visibility (G key or button), hard drop, per-piece colors,
and next piece preview.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 16:40:12 -08:00
enzotar
9fb65e6a77 refactor: complete collision system rewrite — decomposed sub-signals
Replaced single monolithic blocked expression with 4 composable signals:
- blockedWall: piece-type aware bottom wall (T=18, others=19)
- blockedTop: grid[py+1] at px,px+1,px+2 (all pieces)
- blockedFoot: grid[py+2] at px+1 (T-piece foot only)
- blockedI4: grid[py+1] at px+3 (I-piece 4th cell only)
- blocked: OR combination of all 4

Fixed auto-drop cap from py<18 to py<19 so flat pieces
reach the bottom row. Fixed hard drop and keyboard per piece type.
2026-02-27 13:57:51 -08:00
enzotar
d2cb302961 fix: I-piece now persists all 4 cells and renders at correct row
Added px+3 freeze writes for I-piece (piece==1) at all 20 rows.
Fixed I-piece rendering from py+1 to py for consistent positioning.
Extended collision to check px+3 for I-piece at every py level.
I-piece now correctly shows and persists as 4 cells in a row.
2026-02-27 13:48:32 -08:00
enzotar
7ad8bde38b fix: no-overlap rendering — hide foot cell for non-T pieces, render all 20 rows
Cell 3 (foot/bottom cell) was always visible for ALL pieces,
creating a phantom T-shape foot that overlapped frozen blocks.
Now hidden via opacity:0 for non-T/non-I pieces.

Also added frozen grid rendering for rows 0-12 (was only 13-19).
All 20 rows now fully rendered, frozen, and collision-checked.
2026-02-27 13:33:30 -08:00
enzotar
5e382ce25d feat: full grid collision, freeze, and T-piece support (20 rows)
Extended collision detection from py 12-17 to py 0-17 (full grid).
Extended freeze writes from rows 13-19 to all 20 rows (0-19).
Extended T-piece bottom cell freeze from 6 rows to all 19 rows.
Pieces now correctly collide at ANY height in the grid.
Previously pieces fell through tall stacks because collision
only checked rows 12-17.
2026-02-27 13:02:06 -08:00
enzotar
5c8b397d7b fix: piece-type aware collision — only T-piece checks bottom cell
grid[py+2] at px+1 now only checked when piece==6 (T-piece).
Other pieces (I, J, L, O, S, Z) only check grid[py+1] for
top row collision. Flat pieces stack flush; T-pieces correctly
account for their protruding foot.
2026-02-27 12:52:13 -08:00
enzotar
30a3485440 fix: complete collision — checks both top row and bottom cell
Added grid[py+2] at px+1 check for the T-piece's protruding
bottom cell. Collision now checks 4 cells total per piece:
- grid[py+1] at px, px+1, px+2 (top row destination)
- grid[py+2] at px+1 (bottom cell destination)

This prevents pieces from passing through the angled/protruding
parts of frozen T-shaped blocks.
2026-02-27 12:47:37 -08:00
enzotar
d4f353394f fix: keyboard inputs now respect collision — soft drop and hard drop gated on blocked
ArrowDown soft drop, Space hard drop, and Drop button all bypassed
the blocked signal, letting pieces pass through frozen blocks.
Now all three gate on blocked before modifying py.
2026-02-27 12:44:19 -08:00
enzotar
b8fb60d8c4 fix: collision off-by-one — pieces now stack adjacently
Collision was checking grid[py+2] instead of grid[py+1].
Pieces stopped one row too early, creating gaps.
Now checks grid[py+1] (where top cells would land) with full
3-column width (px, px+1, px+2).
Pieces now stack directly on top of each other.
2026-02-27 12:29:42 -08:00
enzotar
df8b74bab3 feat: live signal debug panel for tetris
Replaced static signal key with live debug panel showing:
- Piece state: piece, px, py, rotation, blocked, lockTick
- Physics: score, lines, level, gravityTick, dropInterval
- Grid rows: g13-g19 with full array contents

Blocks confirmed persisting correctly after collision.
2026-02-27 12:26:01 -08:00
enzotar
d9e0e31d1b fix: tetris collision detection — pieces now stack properly
Added 'blocked' signal that checks frozen grid cells below active piece.
Collision check branches on py to inspect the correct grid row (13-19).
Gravity only drops when not blocked. Lock triggers on blocked state.
Freeze writes piece into correct row based on py (7 rows supported).
Added grid rendering for rows 13-15 (total 7 visible frozen rows).
Build output: 84KB
2026-02-27 12:20:09 -08:00
enzotar
075c4a20fe feat: tetris — signal composition showcase with 6 reactive layers
game-tetris.ds demonstrates DreamStack signal composition:
- Layer 1: Data signals (20 grid rows, piece state, next piece)
- Layer 2: Physics signals (gravity tick, drop speed, level scaling)
- Layer 3: Input signals (keyboard events -> movement commands)
- Layer 4: Derived signals (lock detection, line clear, game over)
- Layer 5: Sound signals (lock, clear, game over tones)
- Layer 6: Stream signals (30+ signals broadcast for spectators)

Board: 10x20 grid, 7 piece types, ghost piece indicator
Controls: Arrow keys, space (hard drop), P (pause)
Side panel: next piece preview, stats, signal layer key
Compiles to 76KB HTML+JS
2026-02-27 12:13:22 -08:00
enzotar
003118ec10 refine: type system second pass — deeper unification throughout
Refinement pass:
- DotAccess: unwraps Signal/Derived before field lookup
- UnaryOp: uses unification instead of manual matching
- Call: unifies each arg with param type, applies subst to return
- List: unifies all element types (not just first)
- If/else: unifies both branches, checks condition is Bool
- When/else: unifies body with else body, checks condition
- Match: unifies all arm types for consistency
- Assign: checks assigned value compatible with variable type
- ForIn: binds iteration variable from Array element type

Tests: 39 ds-types (up from 34), 164 workspace total, 0 failures
2026-02-27 11:54:15 -08:00
enzotar
8fb2214ac0 feat: complete type system — HM unification, signal-aware types, effect scoping
Type System Completion:
- Add unify() with occurs check for proper type variable binding
- Add apply_subst() to chase type variables through substitution map
- Add SignalInfo/SignalClass for graph-based signal classification
- Add check_program_with_signals() accepting optional signal graph data
- Push Dom effect handler scope automatically when checking view blocks
- Wire unification into BinOp, comparison, and logical operator inference
- Include List/Record literals in source signal heuristic

Tests: 34 ds-types tests (up from 11), 159 workspace total, 0 failures
2026-02-27 11:36:28 -08:00
enzotar
ebf11889a3 docs: comprehensive documentation update
- DREAMSTACK.md: rewritten with accurate counts (48 examples, 14
  components, 136 tests), full CLI reference, architecture diagrams,
  quick start guide, comparison table, and phased roadmap
- IMPLEMENTATION_PLAN.md: rewritten with all 10 phases showing
  accurate completion status, current capabilities, and next steps
- BITSTREAM_INTEGRATION.md: updated test count (82 → 136)
- USE_CASES.md and STREAM_COMPOSITION.md: already current, unchanged
2026-02-27 11:15:54 -08:00
enzotar
d4c7ba2385 feat: core language & stream improvements
Language improvements:
- Reactive container class: prop (wraps in DS.effect when signal-dependent)
- Stream output filtering (_streamDiff skips non-output signals)
- Stream exponential reconnect backoff (2s → 4s → 8s, max 30s)
- Breakout game: classic row order with all 5 rows having collision

Verified: reactive text + derived signals already work.
All 48 examples compile, 136 tests pass
2026-02-27 11:03:53 -08:00
enzotar
4ac584c81e fix: reactive component props + breakout improvements
Compiler fixes:
- Component props with signal-dependent expressions now wrapped as
  reactive getters (() => expr) at call site
- Component declarations handle fn-typed props via
  { get value() { return props.x(); } } for live reactivity
- Container style: prop wrapped in DS.effect when expr contains .value
- Timer merging: all same-interval 'every' statements grouped into
  single setInterval with one DS.flush()

Breakout game improvements:
- Classic row order: blue top (far), red bottom (near paddle)
- All 5 rows have full collision detection (was only 2)
- Faster ball (4px/frame) and paddle (40px/keypress)
- Score/Lives badges now update in real-time

All 48 examples compile, 136 tests pass
2026-02-27 10:53:27 -08:00
enzotar
e8bbfcbcb7 perf: merge same-interval timers + breakout game + beats viewer
Performance:
- All every N statements with same interval now merge into one setInterval
- Pong: 24 timers → 1, Breakout: 38 timers → 1 (single DS.flush per frame)

New examples:
- game-breakout.ds: brick-breaker with 5×10 colored bricks, keyboard, audio
- beats-viewer.ds: step sequencer spectator via relay

Fixes:
- _playTone/_playNoise early-exit when freq/duration <= 0
- Breakout score race: score+bounce checks before brick destruction
- Score sound effects in pong (220Hz/440Hz sawtooth)

All 48 examples compile, 136 tests pass
2026-02-27 10:24:13 -08:00
enzotar
eb21aa2137 feat: beats viewer, score sounds, audio early-exit guards
- New beats-viewer.ds: step sequencer spectator via relay stream
- game-pong.ds: added score sound effects (220Hz/440Hz sawtooth)
- Runtime: _playTone skips when freq<=0, _playNoise skips when dur<=0
- All 47 examples compile, 136 tests pass
2026-02-27 10:05:32 -08:00
enzotar
25b960fa29 feat: pong spectator viewer + stream proxy reactivity fix
- New pong-viewer.ds: full visual court rendered from streamed state
- Extended container prop signal detection: js_val.contains('.value')
  fixes DotAccess on stream proxies (game.value.p1y) not being reactive
- Verified two-tab relay demo: player → relay → viewer syncs in real-time
- All 46 examples compile, 136 tests pass
2026-02-27 09:59:34 -08:00
enzotar
bd926b9e0a feat: keyboard input, Web Audio synthesis, and multiplayer demo
Compiler changes:
- emit_handler: DOM events (keydown/keyup/etc) route to document.addEventListener
- emit_handler: handler params (ev) pushed into scope to prevent .value suffix
- play_tone(freq, dur, type) and play_noise(dur, vol) builtins
- Web Audio runtime: _playTone (oscillator) and _playNoise (filtered noise)
- Reactive textContent: signal-dependent If expressions wrapped in DS.effect

Example updates:
- game-pong.ds: Arrow Up/Down for paddle, Space for pause/resume, paddle-hit sounds
- step-sequencer.ds: 4 audio trigger timers (kick=60Hz, snare=noise, hihat=noise, bass=110Hz)

Verification:
- All 136 tests pass, 45 examples compile
- Relay connects successfully, multiplayer sync confirmed
- Keyboard controls and pause toggle verified in browser
2026-02-27 09:34:20 -08:00
enzotar
0e23ddd88b feat: game-pong.ds + two compiler improvements
- Native DreamStack pong game with visual court (stack container),
  CSS-positioned paddles/ball, 30fps game loop, AI tracking, auto-serve
- Parser: containers (column/row/stack) now support leading props
  e.g. column { style: '...' } [children]
- Codegen: fixed signal detection for container layout props
  (strip .value suffix for signal graph lookup)
- All 136 tests pass, 45 examples compile
2026-02-27 00:02:58 -08:00
enzotar
62830fa82a fix: for-in parser token mismatch + enhanced step sequencer
- Fix for...in parser: TokenKind::In → TokenKind::InKw (was using wrong token)
- Remove dead In variant from TokenKind enum
- Fix pre-existing test: When pattern match 2→3 fields
- Enhanced step-sequencer.ds: 16 steps, 4 instrument arrays, play/pause,
  BPM controls with limits, presets, dynamic variants, streaming output
- All 118 tests pass
2026-02-26 23:42:29 -08:00
enzotar
f7f7363230 feat: snake game streaming via relay
game-snake.html — Full canvas Snake game:
- 20x20 grid with gradient snake (eyes, body fade)
- Keyboard (WASD/arrows) + button controls
- Wall wrapping, self-collision detection
- Speed increases on food eat (200ms → 80ms min)
- Game over screen with restart
- Streams every frame via DreamStack relay (0x31 SignalDiff)
- Periodic auto-sync (0x30 every 50 frames)
- Graceful fallback when relay unavailable

game-viewer.ds — DreamStack receiver:
- Connects to ws://localhost:9100/stream/snake
- Shows live score, length, speed, position
- PLAYING/GAME OVER status badge

game-snake.ds — DreamStack source (simplified)
game-reaction.ds — Reaction game (bonus)
2026-02-26 20:46:53 -08:00
enzotar
f4e5ace37c feat: *= /= operators + 6 new array methods
New assignment operators (full pipeline: lexer → parser → analyzer → codegen):
- *= (MulAssign): count *= 2
- /= (DivAssign): count /= 2

New array methods in event handler (all flush signal + stream diff):
- .clear()   → items = []
- .insert(i, v) → splice at index
- .sort()    → immutable sort
- .reverse() → immutable reverse
- .filter(fn) → filter in place
- .map(fn)   → map in place

New example: language-features.ds (65KB)
- Tests all assignment ops (+=, -=, *=, /=)
- Tests array methods (push, pop, sort, reverse, clear)
- Tests match expressions
- Tests comparison operators
- Tests derived signals (let doubled = count * 2)
- Browser-verified: zero console errors

All 11 examples pass.
2026-02-26 20:29:35 -08:00
enzotar
0125c6e714 feat: expanded variant system — 30+ new CSS class mappings
variant_to_css expanded for all 14 components:
- Button: outline, toggle, toggle-on/off, tab-active/inactive, select
- Text: card-title/subtitle/footer, input-label/error/helper,
  dialog-title, stat-*, separator-label, avatar-*
- Column: stat-card, dialog-panel/overlay, avatar, separator-*,
  progress-fill-*, toast-*, alert-*
- Row: tabs, separator, select-group
- Input: input-default, input-error

variant_map_js expanded for dynamic variant resolution

New CSS:
- ds-btn-outline (transparent with indigo border)
- ds-tab / ds-tab-active (tab switcher styles)
- ds-tabs (flex container with subtle bg)
- ds-select-group (flex wrap)
- ds-separator-row / ds-separator-v
- ds-toast-success/error/warning/info colors
- ds-avatar-status

All 10 examples pass. Build sizes: gallery 93KB, dashboard 60KB.
2026-02-26 19:17:49 -08:00
enzotar
1d554ae7ab feat: enhanced 14 registry components + component gallery
Registry components enhanced with proper DreamStack patterns:
- Card: conditional title/subtitle/footer via when guards, slot for children
- Button: variant as string prop, disabled support
- Dialog: when-guarded overlay, slot for content, close button
- Progress: conditional label, variant support
- Input: conditional label, error state, helper text
- Alert: variant prop, slot for custom content
- Toggle: when-guarded label display
- Toast: when-guarded visibility
- Avatar: initials with variant
- Badge: label with variant prop
- Separator: optional centered label

New components:
- Stat: dashboard metric card (label, value, change delta)
- Tabs: tab switcher supporting 2-3 tabs
- Select: button-based option selector

New example:
- component-gallery.ds (89KB): imports 12 components, uses Card+Button,
  Input+Alert, Progress, Badge+when/else, match expressions,
  Stat metrics, Toggle, Avatar, Toast, Separator, every timer

All 10 examples pass. Browser-tested with zero errors.
2026-02-26 18:25:49 -08:00
enzotar
08e36573a5 feat: HTTP /meta API, signal dedup, periodic auto-sync
Relay HTTP /meta endpoint:
- GET /meta → JSON with all channel stats
- GET /meta/{name} → JSON with specific channel stats, schema, current state
- Uses TCP peek to intercept raw HTTP before WS handshake
- CORS headers for browser access

Signal deduplication:
- _lastSentValues tracks last-sent value per signal
- JSON.stringify comparison skips unchanged values
- Prevents redundant WS frames from derived signals

Periodic auto-sync:
- Every 50 diff batches, source sends full SignalSync (0x30)
- Relay can compact its cache instead of accumulating infinite diffs
- Resets pending_signal_diffs in relay cache

All 57 relay tests pass. All 9 examples pass.
2026-02-26 18:17:25 -08:00
enzotar
598ecde59c feat: comprehensive streaming improvements
Runtime _connectStream improvements:
- Connection status as reactive signals: _connected, _latency, _frames, _reconnects
  injected on stream proxy so UIs can show connection health
- Fixed RLE decoder: 2-byte LE count (was 1-byte, mismatched relay encoder)
- Schema caching: 0x32 SchemaAnnounce frames now parsed and cached
- RTT tracking: receivers send periodic pings (5s), measure round-trip latency
- Better reconnect logging: includes URL and attempt count

Relay tests (57 total):
- catchup_merges_multiple_diffs: sync + 3 diffs → 1 merged frame
- catchup_diffs_only_no_sync: diffs without sync → merged frame
- catchup_preserves_version_counters: conflict resolution versions kept

New example:
- timer-multi-action.ds: every timer + multi-action buttons verified

Documentation:
- STREAM_COMPOSITION.md: 4 new sections (Diff Batching, Connection Status, RTT, Relay Merging)
- Updated example table with streaming-dashboard.ds and timer-multi-action.ds

All 9 examples pass regression (44-70KB each)
2026-02-26 18:09:14 -08:00
enzotar
746b76fe4f perf: streaming core improvements — batched diffs, RTT tracking, relay merging
Runtime improvements:
- Diff batching: multiple signal changes coalesced into 1 WS frame
  via _pendingDiffs + microtask Promise.resolve()
- Connection status: _streamConnected, _streamLatency, _streamReconnects,
  _streamFrameCount, _streamByteCount tracked for stream health
- RTT tracking: periodic ping/pong every 5s measures round-trip latency
- Removed redundant _streamSync from flush() — diffs are already batched

Relay improvements:
- Diff merging: late joiners receive 1 consolidated sync frame instead
  of replaying hundreds of individual diffs
- Version counters merged: conflict resolution preserved across catchup
- Fallback: if JSON parse fails, falls back to raw sync + all diffs

Test updates:
- state_cache_signal_sync verifies merged payload (count: 1)
- All 54 relay tests pass
- All 8 examples pass regression
2026-02-26 18:02:31 -08:00
enzotar
f29673cbd8 feat: streaming dashboard with imported components + live data
- New streaming-dashboard.ds: first example combining components + streaming
- 4 Card grid with Badge, Button, match, stream receivers
- Receives live data from counter, clock, stats streams
- Button callbacks (Refresh/Reset) work within stream context
- All 8 examples pass regression (47,799 bytes)
2026-02-26 17:51:08 -08:00
enzotar
c47852957f fix: merge duplicate click props + upgrade streaming examples
- Duplicate prop keys now merge into Block expressions
  click: a then click: b → Block([a, b])
- All actions fire in one click (was silently overwriting)
- streaming-mood.ds upgraded to semicolons
- streaming-stats.ds upgraded to semicolons
- Browser-verified: Happy button fires 3 actions (mood+color+energy)
- All 7 examples pass regression
2026-02-26 17:44:21 -08:00
enzotar
10b2717281 feat: multi-statement event handlers with semicolons
- Added Semicolon token to lexer
- Enables: click: items.push(x); input = ""
- Push-and-clear, increment-and-reset, clear-all patterns
- Browser-verified: both actions fire in one click
- All existing examples pass regression
2026-02-26 17:29:47 -08:00
enzotar
6c9d109ebd fix: match parser allows container bodies in arms
- Added can_be_pattern() with look-ahead disambiguation
- Ident only treated as pattern if followed by -> or (
- Keywords (row/column/when/each) correctly terminate match
- Match arms now support: "active" -> row [ Badge + text ]
- Siblings after match (text, button, row) no longer consumed
- Project Manager updated with rich row/Badge match arms
- All 6 existing examples pass regression
2026-02-26 17:19:50 -08:00
enzotar
70c9589573 feat: Project Manager demo — comprehensive 4-page routed app
- Dashboard with metrics, match status, progress bars
- Task Manager with dynamic add/remove via push/remove
- Team directory with member cards and status badges
- Settings with toggle and about section
- 64,622 bytes, zero console errors, all 11 components used
2026-02-26 17:10:32 -08:00
enzotar
51c9c60bfe feat: multi-page routing demo with 4 routes
- Home/Counter/Todos/About with hash navigation
- State persists across route changes
- Uses existing router infrastructure (no compiler changes)
- navigate keyword, matchRoute, _route signal
2026-02-26 17:04:49 -08:00
enzotar
f63ff52e2a feat: upgrade init starter app to showcase all DreamStack features
- Imports Card, Badge, Button from components/
- Counter with callback props, Greeting with when/else
- Mood match expression with Badge, Todo dynamic lists
- Full init → build flow verified (51,401 bytes, 0 errors)
2026-02-26 16:57:08 -08:00