@urun-sh/core 0.1.6 → 0.1.7

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/README.md CHANGED
@@ -22,8 +22,10 @@ const app = App('my-app', {
22
22
 
23
23
  const session = app.generate({ prompt: 'A sunset' })
24
24
 
25
- const track = session.stream('video')
26
- videoElement.srcObject = new MediaStream([track])
25
+ const video = session.stream('video')
26
+ if (video.track) {
27
+ videoElement.srcObject = new MediaStream([video.track])
28
+ }
27
29
 
28
30
  session.doc('control').set({ prompt: { text: 'A forest' } })
29
31
  ```
@@ -39,10 +41,13 @@ The names mirror the Python side:
39
41
 
40
42
  - `App(appId, options)` — reference a deployed urun app.
41
43
  - `app.<function>(args?)` — call a Python function and get a session handle.
42
- - `session.stream(name)` — receive a named media track.
43
- - `session.stream(name, track)` — send a local media track upstream.
44
+ - `session.stream(name)` — get or create a named media stream.
45
+ - `session.stream(name).track` — read the latest inbound browser track.
46
+ - `session.stream(name).attach(track)` — send a local browser track upstream.
47
+ - `session.stream(name).detach()` — stop sending the local browser track.
48
+ - `session.stream(name).seek(seconds)` — seek a persisted finite stream to seconds from start.
49
+ - `session.stream(name).seek('live')` — return a live stream to the live edge.
44
50
  - `session.doc(name).set(patch)` — update a session document.
45
- - `session.on(name, handler)` — subscribe to named session events.
46
51
  - `createStore(options)` — advanced global key/value access.
47
52
 
48
53
  ## Authentication