@urun-sh/react 0.2.23 → 0.2.24

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +8 -1
  2. package/README.md +34 -18
  3. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,6 +1,13 @@
1
1
  # Changelog
2
2
 
3
- ## Unreleased
3
+ ## 0.2.24
4
+
5
+ - Docs-only release: README accuracy pass against the 0.2.23+ surface — the quick start now
6
+ composes `<SessionScope>` + `<Camera>`/`<Video>` (the prebaked components) instead of
7
+ hand-rolled track plumbing, the API section documents the component/hook surface, and the
8
+ retired "generative UI" framing is replaced by the component registry. No runtime changes.
9
+
10
+ ## 0.2.23
4
11
 
5
12
  - **Prebaked media I/O, bare-name canonical exports** (owner mandate 2026-07-13 — the UrunX
6
13
  component convention is dead): the declarative send/show surface, keyed on session stream
package/README.md CHANGED
@@ -12,26 +12,21 @@ npm install @urun-sh/react @urun-sh/core
12
12
 
13
13
  ```tsx
14
14
  import '@urun-sh/react/styles.css'
15
- import { UrunProvider, useApp } from '@urun-sh/react'
15
+ import { UrunProvider, useApp, SessionScope, Camera, Video } from '@urun-sh/react'
16
16
  import { UrunWorkOSProvider } from '@urun-sh/react/workos'
17
- import { useEffect, useRef } from 'react'
18
17
 
19
- function VideoPlayer() {
18
+ function Restyle() {
20
19
  const app = useApp()
21
20
  const session = app.generate({ prompt: 'A sunset' })
22
- const video = session.stream('video')
23
- const videoRef = useRef<HTMLVideoElement>(null)
24
-
25
- useEffect(() => {
26
- if (video.track && videoRef.current) {
27
- videoRef.current.srcObject = new MediaStream([video.track])
28
- }
29
- }, [video.track])
30
21
 
31
22
  return (
32
- <button onClick={() => session.doc('control').set({ desired: { prompt: { text: 'A forest' } } })}>
33
- Generate
34
- </button>
23
+ <SessionScope session={session}>
24
+ <Camera stream="cam" front /> {/* publish the webcam → the runtime's ctx.stream("cam") */}
25
+ <Video stream="video" /> {/* render the runtime's video output */}
26
+ <button onClick={() => session.doc('control').set({ desired: { prompt: { text: 'A forest' } } })}>
27
+ Restyle
28
+ </button>
29
+ </SessionScope>
35
30
  )
36
31
  }
37
32
 
@@ -44,7 +39,7 @@ export default function App() {
44
39
  authProvider="workos"
45
40
  appId="my-app"
46
41
  >
47
- <VideoPlayer />
42
+ <Restyle />
48
43
  </UrunProvider>
49
44
  </UrunWorkOSProvider>
50
45
  )
@@ -71,12 +66,33 @@ For other auth providers, use `UrunAuthProvider` with a `getAccessToken` functio
71
66
 
72
67
  ## API
73
68
 
74
- - `UrunProvider` — configures the app proxy.
69
+ - `UrunProvider` — configures the app proxy (and is the auth onramp).
75
70
  - `useApp()` — returns the deployed app proxy configured by `appId`.
76
71
  - `app.<function>(args?)` — starts or reconnects a running function call and returns a render-safe session proxy.
77
72
  - `session.stream(name)` — returns a render-safe named symmetric stream (first use decides direction) with `.track`, `.attach(track)`, `.detach()`, `.seek(seconds | 'live')`, and lifecycle events.
78
73
  - `session.doc(name)` — returns a render-safe synced document with `.get()`, `.set(patch)` (write `desired.*` state), and lifecycle events.
79
- - `registerComponent()` and built-in components — optional generative UI support.
74
+
75
+ ### Prebaked media components
76
+
77
+ The declarative send/show surface, keyed on the runtime's stream names. Bind one session for
78
+ a whole subtree with `<SessionScope session={session}>` (every component also takes an
79
+ explicit `session` prop). They own capture, the persistent `srcObject`, iOS attributes, the
80
+ autoplay unlock, and front/back switching — hand-rolled `getUserMedia` / `.track` →
81
+ `srcObject` effects in app code are the anti-pattern.
82
+
83
+ - Send: `<Camera stream="cam" front|back visible />` (viewless unless `visible`), `<Mic stream="mic" />`.
84
+ - Show: `<Video stream="video" />` (live inbound video), `<Image stream="image" />` (the platform image lane — H.264 intra frames), `<Audio stream="audio" controls? />`, `<Voice stream="audio" />` (full-duplex voice loop on one name).
85
+ - VOD/recordings playback (seek/scrub): `VideoPlayer` from `@urun-sh/react/video` — video.js is an optional peer, deliberately not in the root export.
86
+ - The `UrunAudio` / `UrunVoice` / `UrunCamera` (root) and `UrunVideo` (`/video` subpath) aliases are deprecated and removed next minor — write the bare names.
87
+
88
+ ### Hooks and building blocks
89
+
90
+ - Session doc/data: `useDocStore`, `useSessionDoc`, `useStreamMessages`, `useSessionTrack`.
91
+ - Continuous input (keyboard/mouse/pointer riding awareness presence): `useInputPresence(session)`.
92
+ - Request/response over the session doc: `useRequest`, `useCompletion`, `useChat`.
93
+ - Session honesty: `UrunSessionStatus`, `UrunSessionGate`, `UrunSessionClock`, `UrunSessionEnded`, `UrunIdleWarning`, `UrunSessionWaking`, `UrunActivationOverlay` (+ `useSessionPhase`, `useSessionEndsAt`, `useSessionIdle`, `useSessionWake`, `useActivation`).
94
+ - Session debug workbench: `UrunStreamTail`, `UrunDocPanel`, `UrunControlSender`, `UrunEventSpine` (see `docs/session-workbench-building-blocks.md`).
95
+ - Component registry: `registerComponent()` / `ComponentRenderer` plus the schema-validated built-ins (`ProgressCard`, `StatusBadge`, `TextStream`, `ImageFrame`, `MetricsPanel`) rendered from app-defined named data streams.
80
96
 
81
97
  ## Session docs as a zustand store
82
98
 
@@ -138,4 +154,4 @@ import '@urun-sh/react/styles.css'
138
154
 
139
155
  ## Peer dependencies
140
156
 
141
- `@urun-sh/react` supports React 18 and 19 and expects `@urun-sh/core` of the same release line. WorkOS React and Next.js integrations are optional peers used only by `@urun-sh/react/workos` and `@urun-sh/react/next-workos`.
157
+ `@urun-sh/react` supports React 18 and 19 and expects `@urun-sh/core` of the same release line. WorkOS React and Next.js integrations are optional peers used only by `@urun-sh/react/workos` and `@urun-sh/react/next-workos`; video.js is an optional peer used only by `@urun-sh/react/video`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@urun-sh/react",
3
- "version": "0.2.23",
3
+ "version": "0.2.24",
4
4
  "description": "React bindings for the urun TypeScript SDK",
5
5
  "repository": {
6
6
  "type": "git",
@@ -53,7 +53,7 @@
53
53
  "dev": "tsup --watch"
54
54
  },
55
55
  "peerDependencies": {
56
- "@urun-sh/core": "^0.2.23",
56
+ "@urun-sh/core": "^0.2.24",
57
57
  "@workos-inc/authkit-nextjs": "^3.0.0",
58
58
  "@workos-inc/authkit-react": "^0.15.0 || ^0.16.0",
59
59
  "next": "^15.0.0 || ^16.0.0",