@urun-sh/core 0.4.3 → 0.5.1

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,51 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.1
4
+
5
+ - **FIX: `end()`'s own transport teardown no longer clobbers the server's confirmed park
6
+ reason.** `Session.end()` → `POST /api/sessions/{id}/end` already answers authoritatively
7
+ (`{status: 'paused', reason: 'client_ended'}`), but the transport teardown that same call
8
+ triggers used to unconditionally re-stamp `session.phase` with a hardcoded
9
+ `client_detached` — so the reactive `session.phase` stream never reflected what the server
10
+ actually said. `TransportSession.disconnect()` now takes an optional `reason` (default
11
+ `client_detached`, unchanged for an unsolicited transport loss); `Session.end()` threads the
12
+ `/end` response's own `reason` through `Session.detach()` into it, so a self-initiated end
13
+ settles at the server's answer instead of a generic client-side detach. Every other caller
14
+ of `disconnect()`/`detach()` (including an unsolicited socket death) is unaffected.
15
+ - Lockstep release of `@urun-sh/core`, `@urun-sh/react`, `@urun-sh/openai`, `@urun-sh/next`
16
+ (peer ranges bumped to `^0.5.1` where they pin core).
17
+
18
+ - **BREAKING: `end()` PARKS, and `cancel()` is the admission-ticket verb** (owner ruling D3,
19
+ 2026-09-06; Review A §5.1 "two end verbs", §3.3 residue).
20
+ - `Session.end()` / `sessionDirectory().end(id)` both go through the one implementation
21
+ `endSession()` → `POST /api/sessions/{id}/end` → `urun_park_session(client_ended)`.
22
+ It resolves `{ status: 'paused', sessionId, reason }`. `'paused'` can never throw; a
23
+ TERMINAL word on that route is now the loud error (`invalid_end_response`), because a
24
+ terminal write on the session plane is what the model forbids.
25
+ - `Session.cancel()` (new) → `POST /api/session-requests/{id}/cancel`. Request plane only,
26
+ never addressed by session id. Every outcome the control plane can answer maps to
27
+ `{ status: 'canceled' }`; an unrecognized word stays loud.
28
+ - `SessionEndResult` is now `{ status: 'paused'; sessionId; reason } | { status: 'canceled';
29
+ requestId; platformStatus? }` — the `'ended'` member is gone.
30
+ - `SessionEndError.requestId` is optional and `sessionId` is new.
31
+ - `allocateSession`'s `onRequest` handle carries `sessionId` as soon as the create envelope
32
+ names one, so a hang-up racing allocation parks the session instead of cancelling the
33
+ ticket of a session that already exists.
34
+ - `SessionGatewayStatus` gains `'paused'`.
35
+ - The end request is `keepalive`, like the teardown beacon: an `end()` can race the tab
36
+ close that triggered it. It sends NO body: the verb names the cause server-side, and
37
+ session-api reads a wire `reason` only to tolerate it — so `end()` now speaks the same
38
+ wire shape as the pagehide beacon hitting that same route.
39
+ - **The one routing rule holds on the paths that are not the two verbs** (review findings):
40
+ a page teardown that cancelled a still-queued TICKET finishes on the SESSION plane if
41
+ promotion won the race (otherwise the promoted session holds a GPU seat with no client),
42
+ and the give-up cancel parks instead of cancelling when allocation threw AFTER the control
43
+ plane allocated (an unusable `session_api_base` / `ws_url` — the ticket-cancel route
44
+ refuses those with 409 `request_has_session`).
45
+ - A REFUSED `cancel()` is not a cancel: the release claim and the re-attach bookmark are
46
+ only taken on success, so a later `pagehide` still beacons the ticket cancel instead of
47
+ being suppressed by a release that never happened.
48
+
3
49
  ## 0.4.3
4
50
 
5
51
  - **FIX: no server status word can reach a user as a benign lie — on EITHER path.**
@@ -109,7 +155,6 @@
109
155
 
110
156
  ## 0.4.1
111
157
 
112
-
113
158
  - **FIX: a re-dial no longer leaves the playout element bound to a DEAD track**
114
159
  (urun-infra#2132; the prod qwen-voice "assistant audio drops mid-session and
115
160
  never self-heals, reload fixes it" signature). `recvTransport.consume()` /