@urun-sh/react 0.2.21 → 0.2.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,40 @@
1
1
  # Changelog
2
2
 
3
+ ## Unreleased
4
+
5
+ - **Prebaked media I/O, bare-name canonical exports** (owner mandate 2026-07-13 — the UrunX
6
+ component convention is dead): the declarative send/show surface, keyed on session stream
7
+ names, bound via the new `<SessionScope session={...}>` (every component also takes an
8
+ explicit `session` prop).
9
+ - `<Video stream="output" />` — NEW root-entry live video display (the canonical
10
+ "LiveVideo" pattern the app frontends hand-rolled: one persistent `srcObject`,
11
+ muted+autoplay+playsinline with iOS attrs asserted, missed-event poll fallback,
12
+ fill-container sizing, honest empty state via `placeholder` +
13
+ `data-urun-video-live`). No video.js — the root entry stays player-framework-free.
14
+ - `<Image stream="canvas" />` — NEW semantic wrapper over `<Video>` for the platform
15
+ image lane (images ship as H.264 intra frames on a video stream; default stream
16
+ `"image"`).
17
+ - `<Camera stream="cam" front|back visible />` — canonical rename of `UrunCamera` plus
18
+ the declarative surface: `front`/`back` facing props, auto-start on mount
19
+ (level-triggered convergence; `autoStart={false}` for the imperative `ref.start()`
20
+ mode), and **viewless by default** (`visible` opts into the self-view).
21
+ - `<Mic stream="mic" />` — NEW viewless mic publish (capture-only half of `<Voice>`,
22
+ same one-capture/whenLive/attach engine); `visible` renders a minimal level meter.
23
+ - `<Audio stream="voice" />` — canonical rename of `UrunAudio` (sound-only by default,
24
+ `controls` for a native player; unchanged autoplay-unlock contract).
25
+ - `<Voice />` — canonical rename of `UrunVoice`; new `playback={false}` capture-only
26
+ mode (what `<Mic>` rides on).
27
+ - `@urun-sh/react/video`: `UrunVideo` renamed `VideoPlayer` — the video.js-backed
28
+ player now positioned for VOD/recordings playback (seek/scrub); live session streams
29
+ should use the root `<Video>`.
30
+ - Deprecated aliases kept for ONE release so pinned fleet frontends compile:
31
+ `UrunAudio`, `UrunVoice`, `UrunCamera` (behavior-preserving shim: preview on,
32
+ no auto-start), `UrunVideo` (subpath), plus their prop/handle type names.
33
+ **Removed next minor.**
34
+ - Removed the dead compositing-era files (`use-scene`, `use-layout`,
35
+ `compositor-provider`, `scene-store` — never exported from the package root), guarded
36
+ against reintroduction by `compositing-era-removed.test.ts`.
37
+
3
38
  ## 0.2.19
4
39
 
5
40
  - `UrunProvider` gains an optional `eventsUrl` prop: a trusted (typically
@@ -20,7 +55,7 @@
20
55
  ride the same `stream.messages()` API, now fed exclusively by the §5
21
56
  server-push DataConsumer path).
22
57
 
23
- ## Unreleased
58
+ ## 0.2.7
24
59
 
25
60
  - **BREAKING**: `UrunVideo` moved from the root entry to the `./video` subpath
26
61
  — import it as `import { UrunVideo } from '@urun-sh/react/video'`. video.js
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
- import { RefObject, ReactNode, Component, ErrorInfo, ComponentType } from 'react';
3
+ import { RefObject, ReactNode, Component, ErrorInfo, ComponentType, CSSProperties } from 'react';
4
4
  import { SessionInterface, SessionDocument, SessionStream, SessionPhase, SessionStatus, SessionDiagnostic, CaptureController, ActivationEvent, PrewakeResult, RuntimeAvailability } from '@urun-sh/core';
5
5
  export { ActivationEvent, ActivationState, App as AppInterface, AppOptions, PrewakeResult, PrewakeStatus, RuntimeAvailability, SessionDocument, Session as SessionInterface, SessionPhase, SessionPhaseName, SessionStream, describeSessionPhase, isWakingPhase } from '@urun-sh/core';
6
6
  import { ZodSchema, z } from 'zod';
@@ -375,18 +375,114 @@ declare function useMetricsPanel(props: MetricsPanelProps): {
375
375
  };
376
376
  declare function MetricsPanel(props: MetricsPanelProps): react_jsx_runtime.JSX.Element;
377
377
 
378
- interface UrunAudioStreamSource {
378
+ interface ScopedStreamSource {
379
+
380
+ readonly track: MediaStreamTrack | null;
381
+
382
+ on(event: 'track', handler: (track: MediaStreamTrack | null) => void): () => void;
383
+
384
+ attach(track: MediaStreamTrack): Promise<void>;
385
+
386
+ detach(): Promise<void>;
387
+
388
+ attachVideo(track: MediaStreamTrack): Promise<void>;
389
+
390
+ detachVideo(): Promise<void>;
391
+ }
392
+
393
+ interface ScopedSession {
394
+
395
+ stream(name: string): ScopedStreamSource;
396
+
397
+ whenLive(options?: {
398
+ timeout?: number;
399
+ signal?: AbortSignal;
400
+ }): Promise<void>;
401
+
402
+ readonly status?: SessionStatus;
403
+
404
+ onRecovery?(hook: () => void): () => void;
405
+ }
406
+
407
+ interface SessionScopeProps {
408
+
409
+ session: ScopedSession | null;
410
+ children: ReactNode;
411
+ }
412
+
413
+ declare function SessionScope({ session, children }: SessionScopeProps): react_jsx_runtime.JSX.Element;
414
+
415
+ interface VideoStreamSource {
416
+
417
+ readonly track: MediaStreamTrack | null;
418
+
419
+ on(event: 'track', handler: (track: MediaStreamTrack | null) => void): () => void;
420
+ }
421
+
422
+ interface VideoSessionSource {
423
+ stream(name: string): VideoStreamSource;
424
+ }
425
+
426
+ interface VideoHandle {
427
+
428
+ readonly element: HTMLVideoElement | null;
429
+
430
+ readonly live: boolean;
431
+ }
432
+
433
+ interface VideoProps {
434
+
435
+ session?: VideoSessionSource | null;
436
+
437
+ stream?: string;
438
+
439
+ track?: MediaStreamTrack | null;
440
+
441
+ muted?: boolean;
442
+
443
+ mirror?: boolean;
444
+
445
+ objectFit?: CSSProperties['objectFit'];
446
+
447
+ className?: string;
448
+
449
+ style?: CSSProperties;
450
+
451
+ videoClassName?: string;
452
+
453
+ placeholder?: ReactNode;
454
+
455
+ children?: ReactNode;
456
+
457
+ onTrack?: (track: MediaStreamTrack | null) => void;
458
+ }
459
+
460
+ declare const Video: react.ForwardRefExoticComponent<VideoProps & react.RefAttributes<VideoHandle>>;
461
+
462
+ type ImageProps = Omit<VideoProps, 'muted' | 'mirror' | 'stream'> & {
463
+
464
+ stream?: string;
465
+ };
466
+
467
+ type ImageHandle = VideoHandle;
468
+
469
+ declare const Image: react.ForwardRefExoticComponent<Omit<VideoProps, "stream" | "muted" | "mirror"> & {
470
+
471
+ stream?: string;
472
+ } & react.RefAttributes<VideoHandle>>;
473
+
474
+ interface AudioStreamSource {
379
475
 
380
476
  readonly track: MediaStreamTrack | null;
381
477
 
382
478
  on(event: 'track', handler: (track: MediaStreamTrack | null) => void): () => void;
383
479
  }
384
480
 
385
- interface UrunAudioSessionSource {
386
- stream(name: string): UrunAudioStreamSource;
481
+ interface AudioSessionSource {
482
+ stream(name: string): AudioStreamSource;
387
483
  }
388
484
 
389
- interface UrunAudioHandle {
485
+ interface AudioHandle {
390
486
 
391
487
  unlock(): void;
392
488
 
@@ -395,9 +491,9 @@ interface UrunAudioHandle {
395
491
  readonly element: HTMLAudioElement | null;
396
492
  }
397
493
 
398
- interface UrunAudioProps {
494
+ interface AudioProps {
399
495
 
400
- session?: UrunAudioSessionSource | null;
496
+ session?: AudioSessionSource | null;
401
497
 
402
498
  stream?: string;
403
499
 
@@ -414,15 +510,25 @@ interface UrunAudioProps {
414
510
  onAudioElement?: (el: HTMLAudioElement | null) => void;
415
511
  }
416
512
 
417
- declare const UrunAudio: react.ForwardRefExoticComponent<UrunAudioProps & react.RefAttributes<UrunAudioHandle>>;
513
+ declare const Audio: react.ForwardRefExoticComponent<AudioProps & react.RefAttributes<AudioHandle>>;
514
+
515
+ declare const UrunAudio: react.ForwardRefExoticComponent<AudioProps & react.RefAttributes<AudioHandle>>;
516
+
517
+ type UrunAudioProps = AudioProps;
518
+
519
+ type UrunAudioHandle = AudioHandle;
418
520
 
419
- interface UrunVoiceStreamSource extends UrunAudioStreamSource {
521
+ type UrunAudioStreamSource = AudioStreamSource;
522
+
523
+ type UrunAudioSessionSource = AudioSessionSource;
524
+
525
+ interface VoiceStreamSource extends AudioStreamSource {
420
526
  attach(track: MediaStreamTrack): Promise<void>;
421
527
  detach(): Promise<void>;
422
528
  }
423
529
 
424
- interface UrunVoiceSessionSource {
425
- stream(name: string): UrunVoiceStreamSource;
530
+ interface VoiceSessionSource {
531
+ stream(name: string): VoiceStreamSource;
426
532
 
427
533
  whenLive(options?: {
428
534
  timeout?: number;
@@ -434,7 +540,7 @@ interface UrunVoiceSessionSource {
434
540
  onRecovery?(hook: () => void): () => void;
435
541
  }
436
542
 
437
- interface UrunVoiceHandle {
543
+ interface VoiceHandle {
438
544
 
439
545
  start(): Promise<void>;
440
546
 
@@ -446,15 +552,17 @@ interface UrunVoiceHandle {
446
552
 
447
553
  unlock(): void;
448
554
 
449
- readonly audio: UrunAudioHandle | null;
555
+ readonly audio: AudioHandle | null;
450
556
  }
451
557
 
452
- interface UrunVoiceProps {
558
+ interface VoiceProps {
453
559
 
454
- session: UrunVoiceSessionSource;
560
+ session?: VoiceSessionSource | null;
455
561
 
456
562
  stream?: string;
457
563
 
564
+ playback?: boolean;
565
+
458
566
  constraints?: MediaTrackConstraints;
459
567
 
460
568
  connectTimeoutMs?: number;
@@ -478,15 +586,61 @@ interface UrunVoiceProps {
478
586
 
479
587
  declare const DEFAULT_VOICE_CONSTRAINTS: MediaTrackConstraints;
480
588
 
481
- declare const UrunVoice: react.ForwardRefExoticComponent<UrunVoiceProps & react.RefAttributes<UrunVoiceHandle>>;
589
+ declare const Voice: react.ForwardRefExoticComponent<VoiceProps & react.RefAttributes<VoiceHandle>>;
590
+
591
+ declare const UrunVoice: react.ForwardRefExoticComponent<VoiceProps & react.RefAttributes<VoiceHandle>>;
592
+
593
+ type UrunVoiceProps = VoiceProps;
594
+
595
+ type UrunVoiceHandle = VoiceHandle;
596
+
597
+ type UrunVoiceStreamSource = VoiceStreamSource;
598
+
599
+ type UrunVoiceSessionSource = VoiceSessionSource;
600
+
601
+ interface MicHandle {
602
+
603
+ start(): Promise<void>;
604
+
605
+ stop(): Promise<void>;
606
+
607
+ readonly active: boolean;
608
+
609
+ readonly micStream: MediaStream | null;
610
+ }
611
+
612
+ interface MicProps {
613
+
614
+ session?: VoiceSessionSource | null;
615
+
616
+ stream?: string;
617
+
618
+ constraints?: MediaTrackConstraints;
619
+
620
+ autoStart?: boolean;
621
+
622
+ visible?: boolean;
623
+
624
+ className?: string;
625
+
626
+ onActiveChange?: (active: boolean) => void;
627
+
628
+ onError?: (error: Error) => void;
629
+
630
+ onMicStream?: (stream: MediaStream | null) => void;
631
+
632
+ capture?: CaptureController;
633
+ }
634
+
635
+ declare const Mic: react.ForwardRefExoticComponent<MicProps & react.RefAttributes<MicHandle>>;
482
636
 
483
- interface UrunCameraStreamSource {
637
+ interface CameraStreamSource {
484
638
  attachVideo(track: MediaStreamTrack): Promise<void>;
485
639
  detachVideo(): Promise<void>;
486
640
  }
487
641
 
488
- interface UrunCameraSessionSource {
489
- stream(name: string): UrunCameraStreamSource;
642
+ interface CameraSessionSource {
643
+ stream(name: string): CameraStreamSource;
490
644
 
491
645
  whenLive(options?: {
492
646
  timeout?: number;
@@ -496,44 +650,50 @@ interface UrunCameraSessionSource {
496
650
  readonly status?: SessionStatus;
497
651
  }
498
652
 
499
- type UrunCameraFacing = 'user' | 'environment';
653
+ type CameraFacing = 'user' | 'environment';
500
654
 
501
- interface UrunCameraHandle {
655
+ interface CameraHandle {
502
656
 
503
657
  start(options?: {
504
- facingMode?: UrunCameraFacing;
658
+ facingMode?: CameraFacing;
505
659
  }): Promise<void>;
506
660
 
507
661
  stop(): Promise<void>;
508
662
 
509
663
  flip(): Promise<void>;
510
664
 
511
- setFacingMode(mode: UrunCameraFacing): Promise<void>;
665
+ setFacingMode(mode: CameraFacing): Promise<void>;
512
666
 
513
667
  readonly active: boolean;
514
668
 
515
- readonly facingMode: UrunCameraFacing;
669
+ readonly facingMode: CameraFacing;
516
670
 
517
671
  readonly stream: MediaStream | null;
518
672
 
519
673
  readonly element: HTMLVideoElement | null;
520
674
  }
521
675
 
522
- interface UrunCameraProps {
676
+ interface CameraProps {
523
677
 
524
- session: UrunCameraSessionSource;
678
+ session?: CameraSessionSource | null;
525
679
 
526
680
  stream?: string;
527
681
 
528
682
  constraints?: MediaTrackConstraints;
529
683
 
530
- facingMode?: UrunCameraFacing;
684
+ front?: boolean;
685
+
686
+ back?: boolean;
687
+
688
+ facingMode?: CameraFacing;
689
+
690
+ autoStart?: boolean;
531
691
 
532
692
  mirror?: boolean | 'auto';
533
693
 
534
694
  connectTimeoutMs?: number;
535
695
 
536
- preview?: boolean;
696
+ visible?: boolean;
537
697
 
538
698
  className?: string;
539
699
 
@@ -560,7 +720,24 @@ interface UrunCameraProps {
560
720
 
561
721
  declare const DEFAULT_CAMERA_CONSTRAINTS: MediaTrackConstraints;
562
722
 
563
- declare const UrunCamera: react.ForwardRefExoticComponent<UrunCameraProps & react.RefAttributes<UrunCameraHandle>>;
723
+ declare const Camera: react.ForwardRefExoticComponent<CameraProps & react.RefAttributes<CameraHandle>>;
724
+
725
+ interface UrunCameraProps extends Omit<CameraProps, 'session' | 'front' | 'back' | 'autoStart' | 'visible'> {
726
+
727
+ session: CameraSessionSource;
728
+
729
+ preview?: boolean;
730
+ }
731
+
732
+ declare const UrunCamera: react.ForwardRefExoticComponent<UrunCameraProps & react.RefAttributes<CameraHandle>>;
733
+
734
+ type UrunCameraHandle = CameraHandle;
735
+
736
+ type UrunCameraFacing = CameraFacing;
737
+
738
+ type UrunCameraStreamSource = CameraStreamSource;
739
+
740
+ type UrunCameraSessionSource = CameraSessionSource;
564
741
 
565
742
  interface UseUrunAudioLevelOptions {
566
743
 
@@ -885,4 +1062,4 @@ interface UrunActivationOverlayProps {
885
1062
 
886
1063
  declare function UrunActivationOverlay({ session, stream, videoElement, render, className, }: UrunActivationOverlayProps): react_jsx_runtime.JSX.Element | null;
887
1064
 
888
- export { type ActivationProgress, type ChatMessage, type ChatRole, ComponentRenderer, type CreateDocStoreOptions, DEFAULT_CAMERA_CONSTRAINTS, DEFAULT_LOG_CAP, DEFAULT_VOICE_CONSTRAINTS, type DeepPartial, type DocPatch, DocPatchForm, type DocState, type DocStore, ImageFrame, ImageFrameSchema, type InputPresenceControls, type InputPresenceSession, type JsonObjectParse, MetricsPanel, MetricsPanelSchema, ProgressCard, ProgressCardSchema, type ReactApp, type ReactSession, type ReactSessionDocument, type ReactSessionStream, type RegisteredComponent, type RequestCapableSession, type RequestStream, type SessionIdleState, type SessionRequestOptions, type SessionWake, type SpineEntry, StatusBadge, StatusBadgeSchema, type StreamMessageEntry, TextStream, TextStreamSchema, type UrunAccessToken, type UrunAccessTokenProvider, UrunActivationOverlay, type UrunActivationOverlayProps, UrunAudio, type UrunAudioHandle, type UrunAudioLevel, type UrunAudioProps, type UrunAudioSessionSource, type UrunAudioStreamSource, type UrunAuthContextValue, type UrunAuthMode, UrunAuthProvider, type UrunAuthProviderProps, UrunCamera, type UrunCameraFacing, type UrunCameraHandle, type UrunCameraProps, type UrunCameraSessionSource, type UrunCameraStreamSource, UrunControlSender, type UrunControlSenderProps, UrunDocPanel, type UrunDocPanelProps, UrunErrorBoundary, UrunEventSpine, type UrunEventSpineProps, UrunIdleWarning, type UrunIdleWarningProps, UrunJwtProvider, UrunProvider, UrunSessionClock, type UrunSessionClockProps, UrunSessionEnded, type UrunSessionEndedProps, UrunSessionGate, type UrunSessionGateProps, UrunSessionStatus, type UrunSessionStatusProps, UrunSessionWaking, type UrunSessionWakingProps, UrunStreamTail, type UrunStreamTailProps, UrunVoice, type UrunVoiceHandle, type UrunVoiceProps, type UrunVoiceSessionSource, type UrunVoiceStreamSource, type UseChatOptions, type UseChatResult, type UseCompletionOptions, type UseCompletionResult, type UseInputPresenceOptions, type UseRequestOptions, type UseRequestResult, type UseSessionDocResult, type UseStreamMessagesOptions, type UseUrunAudioLevelOptions, type UseUrunPrewakeOptions, type WorkbenchDocSource, type WorkbenchSession, type WorkbenchStreamSource, authMode, createDocStore, formatPayload, getUrunAudioContext, parseJsonObject, pushCapped, registerComponent, resumeUrunAudioContext, urunPublicEnv, useActivation, useApp, useChat, useCompletion, useDocStore, useImageFrame, useInputPresence, useMetricsPanel, useProgressCard, useRequest, useSessionDoc, useSessionEndsAt, useSessionIdle, useSessionPhase, useSessionTrack, useSessionWake, useStatusBadge, useStreamMessages, useTextStream, useUrunAudioLevel, useUrunAuth, useUrunPrewake, usesWorkOSAuth };
1065
+ export { type ActivationProgress, Audio, type AudioHandle, type AudioProps, type AudioSessionSource, type AudioStreamSource, Camera, type CameraFacing, type CameraHandle, type CameraProps, type CameraSessionSource, type CameraStreamSource, type ChatMessage, type ChatRole, ComponentRenderer, type CreateDocStoreOptions, DEFAULT_CAMERA_CONSTRAINTS, DEFAULT_LOG_CAP, DEFAULT_VOICE_CONSTRAINTS, type DeepPartial, type DocPatch, DocPatchForm, type DocState, type DocStore, Image, ImageFrame, ImageFrameSchema, type ImageHandle, type ImageProps, type InputPresenceControls, type InputPresenceSession, type JsonObjectParse, MetricsPanel, MetricsPanelSchema, Mic, type MicHandle, type MicProps, ProgressCard, ProgressCardSchema, type ReactApp, type ReactSession, type ReactSessionDocument, type ReactSessionStream, type RegisteredComponent, type RequestCapableSession, type RequestStream, type ScopedSession, type ScopedStreamSource, type SessionIdleState, type SessionRequestOptions, SessionScope, type SessionScopeProps, type SessionWake, type SpineEntry, StatusBadge, StatusBadgeSchema, type StreamMessageEntry, TextStream, TextStreamSchema, type UrunAccessToken, type UrunAccessTokenProvider, UrunActivationOverlay, type UrunActivationOverlayProps, UrunAudio, type UrunAudioHandle, type UrunAudioLevel, type UrunAudioProps, type UrunAudioSessionSource, type UrunAudioStreamSource, type UrunAuthContextValue, type UrunAuthMode, UrunAuthProvider, type UrunAuthProviderProps, UrunCamera, type UrunCameraFacing, type UrunCameraHandle, type UrunCameraProps, type UrunCameraSessionSource, type UrunCameraStreamSource, UrunControlSender, type UrunControlSenderProps, UrunDocPanel, type UrunDocPanelProps, UrunErrorBoundary, UrunEventSpine, type UrunEventSpineProps, UrunIdleWarning, type UrunIdleWarningProps, UrunJwtProvider, UrunProvider, UrunSessionClock, type UrunSessionClockProps, UrunSessionEnded, type UrunSessionEndedProps, UrunSessionGate, type UrunSessionGateProps, UrunSessionStatus, type UrunSessionStatusProps, UrunSessionWaking, type UrunSessionWakingProps, UrunStreamTail, type UrunStreamTailProps, UrunVoice, type UrunVoiceHandle, type UrunVoiceProps, type UrunVoiceSessionSource, type UrunVoiceStreamSource, type UseChatOptions, type UseChatResult, type UseCompletionOptions, type UseCompletionResult, type UseInputPresenceOptions, type UseRequestOptions, type UseRequestResult, type UseSessionDocResult, type UseStreamMessagesOptions, type UseUrunAudioLevelOptions, type UseUrunPrewakeOptions, Video, type VideoHandle, type VideoProps, type VideoSessionSource, type VideoStreamSource, Voice, type VoiceHandle, type VoiceProps, type VoiceSessionSource, type VoiceStreamSource, type WorkbenchDocSource, type WorkbenchSession, type WorkbenchStreamSource, authMode, createDocStore, formatPayload, getUrunAudioContext, parseJsonObject, pushCapped, registerComponent, resumeUrunAudioContext, urunPublicEnv, useActivation, useApp, useChat, useCompletion, useDocStore, useImageFrame, useInputPresence, useMetricsPanel, useProgressCard, useRequest, useSessionDoc, useSessionEndsAt, useSessionIdle, useSessionPhase, useSessionTrack, useSessionWake, useStatusBadge, useStreamMessages, useTextStream, useUrunAudioLevel, useUrunAuth, useUrunPrewake, usesWorkOSAuth };