@urun-sh/core 0.5.5 → 0.6.0

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,24 @@
1
1
  # Changelog
2
2
 
3
+ ## Unreleased
4
+
5
+ - **`start()` adopts its own already-allocated request even without sessionStorage** (live
6
+ 2026-09-21 07:24Z: the long-poll returned 200 allocated; the next start() click issued a
7
+ brand-new create and was answered 429 `cold_start_exceeded` "session request is expired").
8
+ The bookmark now has an in-memory adoption tier with the same same-tab semantics, so a realm
9
+ with no sessionStorage (worker scope, sandboxed iframe) still attaches to the session it just
10
+ allocated instead of re-creating.
11
+ - **The persisted session bookmark is scoped to the ACTOR** (the token's `sub`): a fresh actor
12
+ (cleared `urun_visitor` cookie, rotated federated subject) never presents a previous actor's
13
+ session name — no 403 `session_name_not_yours` round-trip at all. A bookmark the control
14
+ plane nonetheless refuses with `session_name_not_yours` is terminal for that name: it is
15
+ surfaced on the console, dropped, and exactly ONE fresh session is minted — never a retry
16
+ storm. Legacy entries without an actor keep working; the 403 rail stays their backstop.
17
+ - **The allocation-timeout message is honest**: `[urun] session allocation wait expired at
18
+ <url> — the CLIENT-side wait budget elapsed (last server status: …)` replaces the old
19
+ "timed out waiting for session allocation at <url>", which read as a server fault when the
20
+ SDK's own wait expired with the gateway reporting no failure.
21
+
3
22
  ## 0.5.3
4
23
 
5
24
  - A tab bookmark refused with `session_name_not_yours` is dropped and the call
@@ -0,0 +1,41 @@
1
+
2
+ interface UrunChatSession {
3
+ complete(payload: unknown, options?: {
4
+ signal?: AbortSignal;
5
+ }): Promise<unknown>;
6
+ requestStream(payload: unknown, options?: {
7
+ signal?: AbortSignal;
8
+ }): AsyncIterable<string>;
9
+ }
10
+
11
+ interface UrunAccessTokenOptions {
12
+ forceRefresh?: boolean;
13
+ reason?: 'initial' | 'unauthorized' | 'background';
14
+ }
15
+ interface UrunConnectionSettings {
16
+
17
+ session?: UrunChatSession | (() => UrunChatSession | Promise<UrunChatSession>);
18
+
19
+ baseUrl?: string;
20
+
21
+ orgId?: string;
22
+
23
+ jwt?: string;
24
+
25
+ getAccessToken?: (options?: UrunAccessTokenOptions) => string | null | undefined | Promise<string | null | undefined>;
26
+
27
+ authProvider?: string;
28
+
29
+ app?: string;
30
+
31
+ functionName?: string;
32
+ }
33
+
34
+ interface UrunSessionResolverOptions {
35
+
36
+ adapter: string;
37
+ }
38
+
39
+ declare function createSessionResolver(settings: UrunConnectionSettings, options: UrunSessionResolverOptions): () => Promise<UrunChatSession>;
40
+
41
+ export { type UrunAccessTokenOptions, type UrunChatSession, type UrunConnectionSettings, type UrunSessionResolverOptions, createSessionResolver };
@@ -0,0 +1,41 @@
1
+
2
+ interface UrunChatSession {
3
+ complete(payload: unknown, options?: {
4
+ signal?: AbortSignal;
5
+ }): Promise<unknown>;
6
+ requestStream(payload: unknown, options?: {
7
+ signal?: AbortSignal;
8
+ }): AsyncIterable<string>;
9
+ }
10
+
11
+ interface UrunAccessTokenOptions {
12
+ forceRefresh?: boolean;
13
+ reason?: 'initial' | 'unauthorized' | 'background';
14
+ }
15
+ interface UrunConnectionSettings {
16
+
17
+ session?: UrunChatSession | (() => UrunChatSession | Promise<UrunChatSession>);
18
+
19
+ baseUrl?: string;
20
+
21
+ orgId?: string;
22
+
23
+ jwt?: string;
24
+
25
+ getAccessToken?: (options?: UrunAccessTokenOptions) => string | null | undefined | Promise<string | null | undefined>;
26
+
27
+ authProvider?: string;
28
+
29
+ app?: string;
30
+
31
+ functionName?: string;
32
+ }
33
+
34
+ interface UrunSessionResolverOptions {
35
+
36
+ adapter: string;
37
+ }
38
+
39
+ declare function createSessionResolver(settings: UrunConnectionSettings, options: UrunSessionResolverOptions): () => Promise<UrunChatSession>;
40
+
41
+ export { type UrunAccessTokenOptions, type UrunChatSession, type UrunConnectionSettings, type UrunSessionResolverOptions, createSessionResolver };