@kortix/sdk 0.14.9 → 0.14.10

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 (87) hide show
  1. package/README.md +52 -12
  2. package/dist/browser/session-sync/server-transcript-mirror.d.ts +4 -80
  3. package/dist/browser/session-sync/server-transcript-mirror.d.ts.map +1 -1
  4. package/dist/browser/session-sync/server-transcript-mirror.js +3 -128
  5. package/dist/browser/session-sync/server-transcript-mirror.js.map +1 -1
  6. package/dist/browser/session-sync/session-sync-registry.d.ts +6 -6
  7. package/dist/browser/session-sync/session-sync-registry.js +8 -8
  8. package/dist/browser/session-sync/session-sync-registry.js.map +1 -1
  9. package/dist/core/client/kortix.d.ts +17 -0
  10. package/dist/core/client/kortix.d.ts.map +1 -1
  11. package/dist/core/client/kortix.js +2 -0
  12. package/dist/core/client/kortix.js.map +1 -1
  13. package/dist/core/client/project-artifacts.d.ts +22 -0
  14. package/dist/core/client/project-artifacts.d.ts.map +1 -0
  15. package/dist/core/client/project-artifacts.js +18 -0
  16. package/dist/core/client/project-artifacts.js.map +1 -0
  17. package/dist/core/client/project-core.d.ts.map +1 -1
  18. package/dist/core/rest/projects-client/artifacts.d.ts +150 -0
  19. package/dist/core/rest/projects-client/artifacts.d.ts.map +1 -1
  20. package/dist/core/rest/projects-client/artifacts.js +33 -0
  21. package/dist/core/rest/projects-client/artifacts.js.map +1 -1
  22. package/dist/core/rest/projects-client/chrome.d.ts +38 -0
  23. package/dist/core/rest/projects-client/chrome.d.ts.map +1 -0
  24. package/dist/core/rest/projects-client/chrome.js +21 -0
  25. package/dist/core/rest/projects-client/chrome.js.map +1 -0
  26. package/dist/core/rest/projects-client/iam-actions.d.ts +1 -0
  27. package/dist/core/rest/projects-client/iam-actions.d.ts.map +1 -1
  28. package/dist/core/rest/projects-client/iam-actions.js +1 -0
  29. package/dist/core/rest/projects-client/iam-actions.js.map +1 -1
  30. package/dist/core/rest/projects-client/index.d.ts +1 -0
  31. package/dist/core/rest/projects-client/index.d.ts.map +1 -1
  32. package/dist/core/rest/projects-client/index.js +1 -0
  33. package/dist/core/rest/projects-client/index.js.map +1 -1
  34. package/dist/core/rest/projects-client/projects.d.ts +3 -1
  35. package/dist/core/rest/projects-client/projects.d.ts.map +1 -1
  36. package/dist/core/rest/projects-client/projects.js +2 -0
  37. package/dist/core/rest/projects-client/projects.js.map +1 -1
  38. package/dist/core/session/open-bundle.d.ts +6 -36
  39. package/dist/core/session/open-bundle.d.ts.map +1 -1
  40. package/dist/core/session/open-bundle.js +3 -74
  41. package/dist/core/session/open-bundle.js.map +1 -1
  42. package/dist/core/session-log/source.d.ts +11 -3
  43. package/dist/core/session-log/source.d.ts.map +1 -1
  44. package/dist/core/session-log/source.js +26 -14
  45. package/dist/core/session-log/source.js.map +1 -1
  46. package/dist/core/session-sync/saved-transcript.d.ts +12 -42
  47. package/dist/core/session-sync/saved-transcript.d.ts.map +1 -1
  48. package/dist/core/session-sync/saved-transcript.js +11 -74
  49. package/dist/core/session-sync/saved-transcript.js.map +1 -1
  50. package/dist/kortix.esm.min.js +35 -35
  51. package/dist/kortix.global.js +34 -34
  52. package/dist/react/index.d.ts +2 -1
  53. package/dist/react/index.d.ts.map +1 -1
  54. package/dist/react/index.js +2 -1
  55. package/dist/react/index.js.map +1 -1
  56. package/dist/react/query-keys.d.ts +5 -0
  57. package/dist/react/query-keys.d.ts.map +1 -1
  58. package/dist/react/query-keys.js +2 -0
  59. package/dist/react/query-keys.js.map +1 -1
  60. package/dist/react/use-artifacts.d.ts +209 -1
  61. package/dist/react/use-artifacts.d.ts.map +1 -1
  62. package/dist/react/use-artifacts.js +79 -2
  63. package/dist/react/use-artifacts.js.map +1 -1
  64. package/dist/react/use-chrome-connections.d.ts +15 -0
  65. package/dist/react/use-chrome-connections.d.ts.map +1 -0
  66. package/dist/react/use-chrome-connections.js +42 -0
  67. package/dist/react/use-chrome-connections.js.map +1 -0
  68. package/dist/react/use-session-log.d.ts +12 -7
  69. package/dist/react/use-session-log.d.ts.map +1 -1
  70. package/dist/react/use-session-log.js +49 -26
  71. package/dist/react/use-session-log.js.map +1 -1
  72. package/dist/react/use-session-sync.d.ts +9 -16
  73. package/dist/react/use-session-sync.d.ts.map +1 -1
  74. package/dist/react/use-session-sync.js +17 -120
  75. package/dist/react/use-session-sync.js.map +1 -1
  76. package/dist/react/use-session.d.ts.map +1 -1
  77. package/dist/react/use-session.js +16 -25
  78. package/dist/react/use-session.js.map +1 -1
  79. package/package.json +2 -2
  80. package/dist/browser/session-sync/mirror-paging.d.ts +0 -32
  81. package/dist/browser/session-sync/mirror-paging.d.ts.map +0 -1
  82. package/dist/browser/session-sync/mirror-paging.js +0 -36
  83. package/dist/browser/session-sync/mirror-paging.js.map +0 -1
  84. package/dist/react/use-session-transcript-history.d.ts +0 -11
  85. package/dist/react/use-session-transcript-history.d.ts.map +0 -1
  86. package/dist/react/use-session-transcript-history.js +0 -35
  87. package/dist/react/use-session-transcript-history.js.map +0 -1
@@ -28,20 +28,16 @@
28
28
  * re-read the transcript and the model catalogue every 15 s for the life of the
29
29
  * tab. Starting is the open path's decision; claiming is everyone else's.
30
30
  *
31
- * THE TRANSCRIPT LEG is claimed like every other leg, by the one saved-history
32
- * read (`loadSavedTranscript`). That read runs at mount, keyed by the Kortix
33
- * session, so it does not wait for the OpenCode root and fits the share window.
34
- * A snapshot never paints over a store the runtime filled:
35
- * `shouldHydrateFromMirror` refuses it. A host that read the window before the
36
- * bind (`readSavedSessionCopy`, a connecting view) leaves it held: the open
37
- * then asks for the pointer only, and the read answers from the held window.
31
+ * THE TRANSCRIPT LEG is not read: an open asks for the pointer only
32
+ * (`transcript: 0`). The session log's first page (`GET …/log`) is the saved
33
+ * history, and no client reads the v1 window (P8.3).
38
34
  *
39
35
  * EVERY LEG IS TRI-STATE. `known: false` projects to `null`, which sends the
40
36
  * consumer to its endpoint. It must never project to the NEGATIVE answer — an
41
37
  * empty queue, an idle turn, an empty thread — because a default rendered as an
42
38
  * answer is the defect the bundle exists to remove.
43
39
  */
44
- import { type SessionAudit, type SessionOpenBundle, type SessionPrompt, type SessionTranscriptSyncEnvelope, type SessionTurn, type SessionTurnEnded, type SessionTurnFailure } from '../rest/projects-client/sessions.js';
40
+ import { type SessionAudit, type SessionOpenBundle, type SessionPrompt, type SessionTurn, type SessionTurnEnded, type SessionTurnFailure } from '../rest/projects-client/sessions.js';
45
41
  /**
46
42
  * How long a resolved bundle keeps answering claims.
47
43
  *
@@ -51,30 +47,14 @@ import { type SessionAudit, type SessionOpenBundle, type SessionPrompt, type Ses
51
47
  * window sits just under the fastest of those cadences on purpose.
52
48
  */
53
49
  export declare const OPEN_BUNDLE_SHARE_MS = 5000;
54
- /** The mirrored-message window an open asks for — the same span the sync
55
- * controller's own first read covers. */
56
- export declare const OPEN_BUNDLE_TRANSCRIPT_LIMIT = 40;
57
- /**
58
- * How long the saved window a host read before `useSession` bound the session
59
- * (`readSavedSessionCopy`: a connecting view) answers that session's open. It
60
- * covers one wake: up to 240 s measured, and apps/mobile gives up at 4 min.
61
- * After the bind the runtime's own read outranks the window, so an older one
62
- * costs only the moment until that read lands.
63
- */
64
- export declare const SAVED_WINDOW_HOLD_MS: number;
65
- /** Keep the saved window a host read before `useSession` binds the session. */
66
- export declare function holdSavedWindow(projectId: string, sessionId: string, envelope: SessionTranscriptSyncEnvelope, nowMs?: number): void;
67
- /** The held saved window of this session, or null when none is held or it is
68
- * older than {@link SAVED_WINDOW_HOLD_MS}. */
69
- export declare function heldSavedWindow(projectId: string, sessionId: string, nowMs?: number): SessionTranscriptSyncEnvelope | null;
70
50
  /** Drop everything: on an identity change (`resetIdentityState`), and in
71
51
  * tests — a module singleton with no reset is a test that passes because of
72
52
  * the one before it. */
73
53
  export declare function resetSessionOpenBundles(): void;
74
54
  export interface OpenSessionBundleOptions {
75
55
  /** v1 transcript messages to ask for. Default `0`: the POINTER only. An
76
- * open reads the session log first (`GET …/log`), so no host reads the
77
- * snapshot's v1 window; a v1 fallback reads its own window. */
56
+ * open reads the session log (`GET …/log`), so no host reads the
57
+ * snapshot's v1 window. */
78
58
  transcript?: number;
79
59
  /** Injected clock, for tests. */
80
60
  now?: () => number;
@@ -121,14 +101,4 @@ export declare function openBundleQueue(bundle: SessionOpenBundle): SessionPromp
121
101
  * — never `{ actions: [] }`, which would read as "nothing pending" for a
122
102
  * leg that could not answer. */
123
103
  export declare function openBundleAudit(bundle: SessionOpenBundle): SessionAudit | null;
124
- /**
125
- * Project the transcript leg onto what the saved-history read
126
- * (`GET .../transcript?shape=sync&history=true`) answers: the same window, served
127
- * only for the session's CURRENT root. `null` when the leg is unknown or
128
- * pointer-only, and when a saved copy's root is not the root the session row
129
- * names. The route decides those.
130
- *
131
- * @deprecated The snapshot's v1 window. The snapshot's `log` leg is the session log's first page. Removed in the next major.
132
- */
133
- export declare function openBundleHistory(bundle: SessionOpenBundle): SessionTranscriptSyncEnvelope | null;
134
104
  //# sourceMappingURL=open-bundle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"open-bundle.d.ts","sourceRoot":"","sources":["../../../src/core/session/open-bundle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,6BAA6B,EAClC,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EAExB,MAAM,kCAAkC,CAAC;AAE1C;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,OAAQ,CAAC;AAE1C;0CAC0C;AAC1C,eAAO,MAAM,4BAA4B,KAAK,CAAC;AAE/C;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,QAAa,CAAC;AAc/C,+EAA+E;AAC/E,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,6BAA6B,EACvC,KAAK,GAAE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;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,GAAG,6BAA6B,GAAG,IAAI,CASjG"}
1
+ {"version":3,"file":"open-bundle.d.ts","sourceRoot":"","sources":["../../../src/core/session/open-bundle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EAExB,MAAM,kCAAkC,CAAC;AAE1C;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,OAAQ,CAAC;AAmB1C;;yBAEyB;AACzB,wBAAgB,uBAAuB,IAAI,IAAI,CAE9C;AAED,MAAM,WAAW,wBAAwB;IACvC;;gCAE4B;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iCAAiC;IACjC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,wBAA6B,GACrC,IAAI,CAoBN;AASD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,MAAmB,GACzB,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,GAAG,IAAI,CAU1C;AAED;;8EAE8E;AAC9E,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,UAAU,EAAE,gBAAgB,GAAG,SAAS,CAAC;IACzC,eAAe,CAAC,EAAE,kBAAkB,EAAE,CAAC;IACvC,kFAAkF;IAClF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,iBAAiB,GAAG,yBAAyB,GAAG,IAAI,CAW1F;AAED;gEACgE;AAChE,wBAAgB,eAAe,CAAC,MAAM,EAAE,iBAAiB,GAAG,aAAa,EAAE,GAAG,IAAI,CAIjF;AAED;;;;iCAIiC;AACjC,wBAAgB,eAAe,CAAC,MAAM,EAAE,iBAAiB,GAAG,YAAY,GAAG,IAAI,CAU9E"}
@@ -28,13 +28,9 @@
28
28
  * re-read the transcript and the model catalogue every 15 s for the life of the
29
29
  * tab. Starting is the open path's decision; claiming is everyone else's.
30
30
  *
31
- * THE TRANSCRIPT LEG is claimed like every other leg, by the one saved-history
32
- * read (`loadSavedTranscript`). That read runs at mount, keyed by the Kortix
33
- * session, so it does not wait for the OpenCode root and fits the share window.
34
- * A snapshot never paints over a store the runtime filled:
35
- * `shouldHydrateFromMirror` refuses it. A host that read the window before the
36
- * bind (`readSavedSessionCopy`, a connecting view) leaves it held: the open
37
- * then asks for the pointer only, and the read answers from the held window.
31
+ * THE TRANSCRIPT LEG is not read: an open asks for the pointer only
32
+ * (`transcript: 0`). The session log's first page (`GET …/log`) is the saved
33
+ * history, and no client reads the v1 window (P8.3).
38
34
  *
39
35
  * EVERY LEG IS TRI-STATE. `known: false` projects to `null`, which sends the
40
36
  * consumer to its endpoint. It must never project to the NEGATIVE answer — an
@@ -51,51 +47,6 @@ import { getSessionOpenBundle, } from '../rest/projects-client/sessions.js';
51
47
  * window sits just under the fastest of those cadences on purpose.
52
48
  */
53
49
  export const OPEN_BUNDLE_SHARE_MS = 5_000;
54
- /** The mirrored-message window an open asks for — the same span the sync
55
- * controller's own first read covers. */
56
- export const OPEN_BUNDLE_TRANSCRIPT_LIMIT = 40;
57
- /**
58
- * How long the saved window a host read before `useSession` bound the session
59
- * (`readSavedSessionCopy`: a connecting view) answers that session's open. It
60
- * covers one wake: up to 240 s measured, and apps/mobile gives up at 4 min.
61
- * After the bind the runtime's own read outranks the window, so an older one
62
- * costs only the moment until that read lands.
63
- */
64
- export const SAVED_WINDOW_HOLD_MS = 5 * 60_000;
65
- /** How many sessions' holds live at once. A hold exists for the seconds
66
- * between a connecting view's read and that session's bind; a handful is
67
- * generous. The oldest hold gives its slot when the cap is hit, so the map
68
- * stays bounded. */
69
- const HELD_WINDOW_CAP = 16;
70
- // One hold per session, not one global slot: a late hold for session B (its
71
- // connecting view still settling) must not evict session A's hold and send
72
- // A's bind back to a full-window snapshot read — the window downloaded twice
73
- // per open, the exact thing KRTX-189 forbids.
74
- const heldWindows = new Map();
75
- /** Keep the saved window a host read before `useSession` binds the session. */
76
- export function holdSavedWindow(projectId, sessionId, envelope, nowMs = Date.now()) {
77
- const key = scopeKey(projectId, sessionId);
78
- heldWindows.delete(key);
79
- heldWindows.set(key, { envelope, atMs: nowMs });
80
- while (heldWindows.size > HELD_WINDOW_CAP) {
81
- const oldest = heldWindows.keys().next().value;
82
- if (oldest === undefined)
83
- break;
84
- heldWindows.delete(oldest);
85
- }
86
- }
87
- /** The held saved window of this session, or null when none is held or it is
88
- * older than {@link SAVED_WINDOW_HOLD_MS}. */
89
- export function heldSavedWindow(projectId, sessionId, nowMs = Date.now()) {
90
- const held = heldWindows.get(scopeKey(projectId, sessionId));
91
- if (!held)
92
- return null;
93
- if (nowMs - held.atMs > SAVED_WINDOW_HOLD_MS) {
94
- heldWindows.delete(scopeKey(projectId, sessionId));
95
- return null;
96
- }
97
- return held.envelope;
98
- }
99
50
  const entries = new Map();
100
51
  function scopeKey(projectId, sessionId) {
101
52
  return `${projectId}/${sessionId}`;
@@ -105,7 +56,6 @@ function scopeKey(projectId, sessionId) {
105
56
  * the one before it. */
106
57
  export function resetSessionOpenBundles() {
107
58
  entries.clear();
108
- heldWindows.clear();
109
59
  }
110
60
  /**
111
61
  * Start the session-open read for `(projectId, sessionId)`.
@@ -206,25 +156,4 @@ export function openBundleAudit(bundle) {
206
156
  actions: audit.actions,
207
157
  };
208
158
  }
209
- /**
210
- * Project the transcript leg onto what the saved-history read
211
- * (`GET .../transcript?shape=sync&history=true`) answers: the same window, served
212
- * only for the session's CURRENT root. `null` when the leg is unknown or
213
- * pointer-only, and when a saved copy's root is not the root the session row
214
- * names. The route decides those.
215
- *
216
- * @deprecated The snapshot's v1 window. The snapshot's `log` leg is the session log's first page. Removed in the next major.
217
- */
218
- export function openBundleHistory(bundle) {
219
- const transcript = bundle.transcript;
220
- if (!transcript || transcript.known !== true || transcript.requested !== true)
221
- return null;
222
- const { known: _known, requested: _requested, ...envelope } = transcript;
223
- // "No saved copy" is the same answer with or without the root check.
224
- if (!envelope.available)
225
- return envelope;
226
- const root = bundle.session?.runtime_session_id ?? bundle.session?.opencode_session_id;
227
- const savedRoot = envelope.runtime_session_id ?? envelope.opencode_session_id;
228
- return root && savedRoot === root ? envelope : null;
229
- }
230
159
  //# sourceMappingURL=open-bundle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"open-bundle.js","sourceRoot":"","sources":["../../../src/core/session/open-bundle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,EAQL,oBAAoB,GACrB,MAAM,kCAAkC,CAAC;AAE1C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAE1C;0CAC0C;AAC1C,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,GAAG,MAAM,CAAC;AAE/C;;;qBAGqB;AACrB,MAAM,eAAe,GAAG,EAAE,CAAC;AAE3B,4EAA4E;AAC5E,2EAA2E;AAC3E,6EAA6E;AAC7E,8CAA8C;AAC9C,MAAM,WAAW,GAAG,IAAI,GAAG,EAAqE,CAAC;AAEjG,+EAA+E;AAC/E,MAAM,UAAU,eAAe,CAC7B,SAAiB,EACjB,SAAiB,EACjB,QAAuC,EACvC,QAAgB,IAAI,CAAC,GAAG,EAAE;IAE1B,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 -28,12 +28,20 @@ export declare const SESSION_LOG_FIRST_PAGE_LIMIT = 40;
28
28
  /** An older page: the reader scrolls on purpose, so fewer round trips win (the v1 older page is 100 too). */
29
29
  export declare const SESSION_LOG_OLDER_PAGE_LIMIT = 100;
30
30
  export type SessionLogDialect = 'v1' | 'v2';
31
- /** `useSessionLogSync`'s answer: a dialect, or `'missing'` (v2, and the API holds no log for the session yet). */
31
+ /** `useSessionLogSync`'s answer: a dialect, or `'missing'` (v2, and the last read answered no page: the API holds no log for the session yet, or the read failed; a copy painted from the device stays). */
32
32
  export type SessionLogSyncState = SessionLogDialect | 'missing';
33
+ /** {@link readSessionLog}'s answer, and how long a failed read asks a client to wait. */
34
+ export interface SessionLogRead {
35
+ answer: SessionLogPage | 'missing' | null;
36
+ /** A failed read's `Retry-After` (503 `session_log_converting` sends 60 s), in ms; null without one. */
37
+ retryAfterMs: number | null;
38
+ }
39
+ /** {@link readSessionLogAnswer}, with the failed read's `Retry-After`. Never throws. */
40
+ export declare function readSessionLog(load: LoadSessionLogPage, projectId: string, sessionId: string, query: SessionLogPageQuery, signal?: AbortSignal): Promise<SessionLogRead>;
33
41
  /**
34
42
  * One page, validated. `'missing'`: the API serves the session log and this session has none
35
- * yet (a new session): a client stays on the log and reads no v1 copy. Null on any other
36
- * failure (an API older than the log, an invalid page, the network); never throws.
43
+ * yet (a new session). Null on any other failure (a 404 without that code, a 5xx, an invalid
44
+ * page, the network); never throws. A client reads no v1 copy for either.
37
45
  */
38
46
  export declare function readSessionLogAnswer(load: LoadSessionLogPage, projectId: string, sessionId: string, query: SessionLogPageQuery, signal?: AbortSignal): Promise<SessionLogPage | 'missing' | null>;
39
47
  /** One page, validated. Null on any failure; never throws. */
@@ -1 +1 @@
1
- {"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../../src/core/session-log/source.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO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ED,8DAA8D;AAC9D,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,kBAAkB,EACxB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,mBAAmB,EAC1B,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAGhC;AAED,mGAAmG;AACnG,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,kBAAkB,EACxB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,cAAc,GAAG,SAAS,GAAG,IAAI,CAAC,CAE5C;AAED,wFAAwF;AACxF,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,kBAAkB,EACxB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAGhC"}
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * Where the v2 session log comes from, and when a client reads it.
3
3
  *
4
- * NEGOTIATION. A session reads `kortix.session/2` first, always: the first read of an open is
5
- * `GET …/log`. The project flag `session_log` is not read (the API deletes it). A 404 coded
6
- * `session_log_missing` (a session with no stored log yet) keeps the session on the log with
7
- * nothing in it. A 404 without that code or an invalid page (an API that predates the session
8
- * log) falls back to v1, exactly as before the session log existed. The runtime is not asked: the stored log is the API's (a stopped box reads it too), and the session
4
+ * NEGOTIATION. A session reads `kortix.session/2`, always: the first read of an open is
5
+ * `GET …/log`. The project flag `session_log` is not read (the API deletes it). Any answer
6
+ * without a page (a 404 coded `session_log_missing`, a 404 without that code, a failed read, an
7
+ * invalid page) keeps the session on the log with nothing in it. No v1 transcript is read
8
+ * (`GET …/transcript`, P8.3). The runtime is not asked: the stored log is the API's (a stopped box reads it too), and the session
9
9
  * stream serves `schema=v2` for every daemon (it converts the v1 frames of a daemon that
10
10
  * does not list `session.log.v2`).
11
11
  *
@@ -14,7 +14,7 @@
14
14
  * schema's type, written out because this package has no zod; `contract-drift.test.ts` holds
15
15
  * the two equal at typecheck. `SessionLogPage` and `SessionLogPageQuery` are public (the types of
16
16
  * `getSessionLogPage`); the loader is internal. A 404 (the session has no stored log, or no such
17
- * thread) reads as no page, and the session stays on v1.
17
+ * thread) reads as no page.
18
18
  */
19
19
  import { backendApi } from '../http/api-client.js';
20
20
  import { isSessionLogPage } from './guard.js';
@@ -39,20 +39,32 @@ export const SESSION_LOG_FIRST_PAGE_LIMIT = 40;
39
39
  export const SESSION_LOG_OLDER_PAGE_LIMIT = 100;
40
40
  /** The code of the API's 404 for a session with no stored log yet. An API without the route answers 404 with no code. */
41
41
  const SESSION_LOG_MISSING_CODE = 'session_log_missing';
42
- /**
43
- * One page, validated. `'missing'`: the API serves the session log and this session has none
44
- * yet (a new session): a client stays on the log and reads no v1 copy. Null on any other
45
- * failure (an API older than the log, an invalid page, the network); never throws.
46
- */
47
- export async function readSessionLogAnswer(load, projectId, sessionId, query, signal) {
42
+ /** The `Retry-After` seconds of a failed read's response, in ms; null when absent or not a number. */
43
+ function retryAfterMs(error) {
44
+ const header = error?.response?.headers?.get?.('retry-after');
45
+ const seconds = header == null || header === '' ? Number.NaN : Number(header);
46
+ return Number.isFinite(seconds) && seconds >= 0 ? seconds * 1000 : null;
47
+ }
48
+ /** {@link readSessionLogAnswer}, with the failed read's `Retry-After`. Never throws. */
49
+ export async function readSessionLog(load, projectId, sessionId, query, signal) {
48
50
  try {
49
51
  const page = await load(projectId, sessionId, query, signal);
50
- return isSessionLogPage(page) ? page : null;
52
+ return { answer: isSessionLogPage(page) ? page : null, retryAfterMs: null };
51
53
  }
52
54
  catch (error) {
53
- return error?.code === SESSION_LOG_MISSING_CODE ? 'missing' : null;
55
+ if (error?.code === SESSION_LOG_MISSING_CODE)
56
+ return { answer: 'missing', retryAfterMs: null };
57
+ return { answer: null, retryAfterMs: retryAfterMs(error) };
54
58
  }
55
59
  }
60
+ /**
61
+ * One page, validated. `'missing'`: the API serves the session log and this session has none
62
+ * yet (a new session). Null on any other failure (a 404 without that code, a 5xx, an invalid
63
+ * page, the network); never throws. A client reads no v1 copy for either.
64
+ */
65
+ export async function readSessionLogAnswer(load, projectId, sessionId, query, signal) {
66
+ return (await readSessionLog(load, projectId, sessionId, query, signal)).answer;
67
+ }
56
68
  /** One page, validated. Null on any failure; never throws. */
57
69
  export async function fetchSessionLogPage(load, projectId, sessionId, query, signal) {
58
70
  const answer = await readSessionLogAnswer(load, projectId, sessionId, query, signal);
@@ -1 +1 @@
1
- {"version":3,"file":"source.js","sourceRoot":"","sources":["../../../src/core/session-log/source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAiC3C,8FAA8F;AAC9F,MAAM,CAAC,MAAM,kBAAkB,GAA8B,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;IACzG,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;IACrC,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS;QAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACnE,IAAI,KAAK,CAAC,UAAU,KAAK,SAAS;QAAE,MAAM,CAAC,GAAG,CAAC,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;IACvF,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS;QAAE,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IACxE,MAAM,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC7B,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,GAAG,CACnC,aAAa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rF,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;AAC9C,CAAC;AAED,mGAAmG;AACnG,MAAM,UAAU,yBAAyB,CACvC,IAAwB,EACxB,SAAiB,EACjB,SAAiB,EACjB,MAAoB;IAEpB,OAAO,oBAAoB,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,4BAA4B,EAAE,EAAE,MAAM,CAAC,CAAC;AAC3G,CAAC;AAED,wFAAwF;AACxF,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,IAAwB,EACxB,SAAiB,EACjB,SAAiB,EACjB,MAAoB;IAEpB,MAAM,MAAM,GAAG,MAAM,yBAAyB,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IACnF,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;AAC9C,CAAC"}
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Can this session show its saved conversation before its computer wakes?
3
3
  *
4
- * The control plane keeps a copy of every session's transcript (the mirror,
5
- * written at each turn end). It answers in one round trip; the computer takes
4
+ * The control plane keeps every session's history (the session log, journaled
5
+ * at each turn end). It answers in one round trip; the computer takes
6
6
  * 5-240 s to wake. A host that knows a saved copy is on its way shows the
7
7
  * session with placeholder rows for that one round trip. A host that knows
8
8
  * there is none shows its boot screen, because nothing can be read until the
@@ -22,34 +22,10 @@
22
22
  */
23
23
  import { type SessionTranscriptSyncEnvelope } from '../rest/projects-client/sessions.js';
24
24
  import { type SessionLogPage } from '../session-log/source.js';
25
- /**
26
- * How long the saved-history read waits for a session-open snapshot in
27
- * flight. The snapshot is DB-only and answers well inside it; a slower one
28
- * loses to the route, so saved history never waits on a hung snapshot (the
29
- * request timeout is 30 s). That case downloads the window twice.
30
- */
31
- export declare const SAVED_HISTORY_SNAPSHOT_WAIT_MS = 2000;
32
- /**
33
- * THE saved-history read: the newest window of the session's saved copy, for
34
- * its current root. Every reader of a session's saved copy uses it: the web
35
- * (`useSession`), mobile (`readSavedSessionCopy`) and `useSessionSync` for a
36
- * host that passes no `mirror`.
37
- *
38
- * A window a host read before the bind ({@link readSavedSessionCopy}) answers
39
- * first, with no request. The session-open snapshot carries the same window,
40
- * so a snapshot in flight or just answered serves it. The read WAITS for one
41
- * in flight (up to {@link SAVED_HISTORY_SNAPSHOT_WAIT_MS}), as the row, `/turn`
42
- * and `/prompts` reads do: racing it downloaded the window twice. Otherwise
43
- * `GET …/transcript?shape=sync&history=true`. Throws when that route fails.
44
- */
45
- export declare function loadSavedTranscript(projectId: string, sessionId: string, options?: {
46
- signal?: AbortSignal; /** Tests only. */
47
- snapshotWaitMs?: number;
48
- }): Promise<SessionTranscriptSyncEnvelope>;
49
25
  export interface SavedSessionCopy {
50
26
  /**
51
- * The server's v1 saved copy (deprecated: read only when the session log answered 404 or an
52
- * invalid page), or null when the log answered or the read failed.
27
+ * @deprecated Always null: no v1 saved copy is read (`GET …/transcript`, P8.3). The session
28
+ * log's page is `log`. Removed in the next major.
53
29
  */
54
30
  envelope: SessionTranscriptSyncEnvelope | null;
55
31
  /**
@@ -58,8 +34,8 @@ export interface SavedSessionCopy {
58
34
  */
59
35
  empty: boolean;
60
36
  /**
61
- * The session log's newest page of the root thread (`GET …/log`). Absent when the log
62
- * answered 404 or an invalid page: `envelope` is then the v1 copy.
37
+ * The session log's newest page of the root thread (`GET …/log`). Null when the log answered
38
+ * no page: a new session, an unconverted mirror, a failed read or an invalid page.
63
39
  */
64
40
  log?: SessionLogPage | null;
65
41
  }
@@ -72,16 +48,10 @@ export interface SavedSessionCopy {
72
48
  * `useSessionLogThread`, which loads a sub-agent's thread from the heads that page names.
73
49
  * `useSession` reads the page again at the bind. No v1 window is read then.
74
50
  *
75
- * A 404 coded `session_log_missing` (a new session) answers no copy: `log: null`, no v1 read.
76
- * Only when the log answers a 404 without that code or an invalid page (a server older than the
77
- * session log) does it read the v1 copy (deprecated): the window from the
78
- * snapshot or the route, as {@link loadSavedTranscript} does. Hand `envelope` to
79
- * `useSessionSync` as `mirror` to paint it. That copy stays held for the session's open, up
80
- * to `SAVED_WINDOW_HOLD_MS`, so the window is downloaded once per open (KRTX-189).
51
+ * Any other answer (a 404, a failed read, an invalid page) answers no copy: `log: null`. No v1
52
+ * window is read (`GET …/transcript`, P8.3).
81
53
  *
82
- * The turn record is read only when the copy proves `runtimeSessionId` empty. Never throws:
83
- * a failed read answers `{ envelope: null, empty: false }`. A sub-agent's window is not read
84
- * here: `useSessionSync` with `savedChild` reads it.
54
+ * The turn record is read only when the page proves `runtimeSessionId` empty. Never throws.
85
55
  */
86
56
  export declare function readSavedSessionCopy(input: {
87
57
  projectId: string;
@@ -90,8 +60,8 @@ export declare function readSavedSessionCopy(input: {
90
60
  /** The runtime session the copy belongs to (the root). */
91
61
  runtimeSessionId: string;
92
62
  /**
93
- * @deprecated Ignored: the session log is always read first, and the v1 window only when the
94
- * log answers 404. The project flag `session_log` it carried is gone.
63
+ * @deprecated Ignored: the session log is always read, and no v1 window. The project flag
64
+ * `session_log` it carried is gone.
95
65
  */
96
66
  sessionLog?: boolean;
97
67
  }): Promise<SavedSessionCopy>;
@@ -102,7 +72,7 @@ export interface SavedTranscriptInput {
102
72
  /** The store holds at least one message for this session's root. */
103
73
  hasMessages: boolean;
104
74
  /**
105
- * The saved-history read (`GET …/transcript?history=true`), which paints
75
+ * The saved-history read (the session log's page, `GET …/log`), which paints
106
76
  * the copy. `off` when the host does not run it.
107
77
  */
108
78
  history: 'off' | 'loading' | 'present' | 'absent';
@@ -1 +1 @@
1
- {"version":3,"file":"saved-transcript.d.ts","sourceRoot":"","sources":["../../../src/core/session-sync/saved-transcript.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EACL,KAAK,6BAA6B,EAGnC,MAAM,kCAAkC,CAAC;AAQ1C,OAAO,EAAiD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*
4
- * The control plane keeps a copy of every session's transcript (the mirror,
5
- * written at each turn end). It answers in one round trip; the computer takes
4
+ * The control plane keeps every session's history (the session log, journaled
5
+ * at each turn end). It answers in one round trip; the computer takes
6
6
  * 5-240 s to wake. A host that knows a saved copy is on its way shows the
7
7
  * session with placeholder rows for that one round trip. A host that knows
8
8
  * there is none shows its boot screen, because nothing can be read until the
@@ -20,53 +20,10 @@
20
20
  * its reads yet (no signed-in user) says `loading`: an unknown is never
21
21
  * rendered as a negative.
22
22
  */
23
- import { getSessionTranscriptSync, getSessionTurn, } from '../rest/projects-client/sessions.js';
24
- import { OPEN_BUNDLE_TRANSCRIPT_LIMIT, claimOpenBundle, heldSavedWindow, holdSavedWindow, openBundleHistory, } from '../session/open-bundle.js';
23
+ import { getSessionTurn } from '../rest/projects-client/sessions.js';
25
24
  import { loadSessionLogPage, readFirstSessionLogAnswer } from '../session-log/source.js';
26
25
  import { EMPTY_SESSION_LOG_STATE, applySessionLogPage } from '../session-log/store.js';
27
26
  import { sessionLogRoot } from '../session-log/v1-view.js';
28
- /**
29
- * How long the saved-history read waits for a session-open snapshot in
30
- * flight. The snapshot is DB-only and answers well inside it; a slower one
31
- * loses to the route, so saved history never waits on a hung snapshot (the
32
- * request timeout is 30 s). That case downloads the window twice.
33
- */
34
- export const SAVED_HISTORY_SNAPSHOT_WAIT_MS = 2_000;
35
- /**
36
- * THE saved-history read: the newest window of the session's saved copy, for
37
- * its current root. Every reader of a session's saved copy uses it: the web
38
- * (`useSession`), mobile (`readSavedSessionCopy`) and `useSessionSync` for a
39
- * host that passes no `mirror`.
40
- *
41
- * A window a host read before the bind ({@link readSavedSessionCopy}) answers
42
- * first, with no request. The session-open snapshot carries the same window,
43
- * so a snapshot in flight or just answered serves it. The read WAITS for one
44
- * in flight (up to {@link SAVED_HISTORY_SNAPSHOT_WAIT_MS}), as the row, `/turn`
45
- * and `/prompts` reads do: racing it downloaded the window twice. Otherwise
46
- * `GET …/transcript?shape=sync&history=true`. Throws when that route fails.
47
- */
48
- export async function loadSavedTranscript(projectId, sessionId, options = {}) {
49
- return heldSavedWindow(projectId, sessionId) ?? readSavedWindow(projectId, sessionId, options);
50
- }
51
- /** The window from the snapshot or the route. A held window never answers it. */
52
- async function readSavedWindow(projectId, sessionId, options) {
53
- const claimed = claimOpenBundle(projectId, sessionId);
54
- let timer;
55
- const bundle = claimed
56
- ? await Promise.race([
57
- claimed,
58
- new Promise((resolve) => {
59
- timer = setTimeout(resolve, options.snapshotWaitMs ?? SAVED_HISTORY_SNAPSHOT_WAIT_MS, null);
60
- }),
61
- ]).finally(() => clearTimeout(timer))
62
- : null;
63
- return ((bundle && openBundleHistory(bundle)) ??
64
- getSessionTranscriptSync(projectId, sessionId, {
65
- limit: OPEN_BUNDLE_TRANSCRIPT_LIMIT,
66
- history: true,
67
- signal: options.signal,
68
- }));
69
- }
70
27
  /**
71
28
  * The saved copy of a session, for a host that shows the session before
72
29
  * `useSession` binds it (a connecting view while the computer wakes).
@@ -76,44 +33,24 @@ async function readSavedWindow(projectId, sessionId, options) {
76
33
  * `useSessionLogThread`, which loads a sub-agent's thread from the heads that page names.
77
34
  * `useSession` reads the page again at the bind. No v1 window is read then.
78
35
  *
79
- * A 404 coded `session_log_missing` (a new session) answers no copy: `log: null`, no v1 read.
80
- * Only when the log answers a 404 without that code or an invalid page (a server older than the
81
- * session log) does it read the v1 copy (deprecated): the window from the
82
- * snapshot or the route, as {@link loadSavedTranscript} does. Hand `envelope` to
83
- * `useSessionSync` as `mirror` to paint it. That copy stays held for the session's open, up
84
- * to `SAVED_WINDOW_HOLD_MS`, so the window is downloaded once per open (KRTX-189).
36
+ * Any other answer (a 404, a failed read, an invalid page) answers no copy: `log: null`. No v1
37
+ * window is read (`GET …/transcript`, P8.3).
85
38
  *
86
- * The turn record is read only when the copy proves `runtimeSessionId` empty. Never throws:
87
- * a failed read answers `{ envelope: null, empty: false }`. A sub-agent's window is not read
88
- * here: `useSessionSync` with `savedChild` reads it.
39
+ * The turn record is read only when the page proves `runtimeSessionId` empty. Never throws.
89
40
  */
90
41
  export async function readSavedSessionCopy(input) {
91
42
  const { projectId, sessionId, runtimeSessionId } = input;
92
43
  if (!projectId || !sessionId || !runtimeSessionId)
93
44
  return { envelope: null, empty: false };
94
45
  const log = loadSessionLogPage ? await readFirstSessionLogAnswer(loadSessionLogPage, projectId, sessionId) : null;
95
- // The API serves the log and the session has none yet (a new session): no copy, v1 included.
96
- if (log === 'missing')
46
+ if (!log || log === 'missing')
97
47
  return { envelope: null, empty: false, log: null };
98
- if (log) {
99
- const root = sessionLogRoot(applySessionLogPage(EMPTY_SESSION_LOG_STATE, log));
100
- const provenEmpty = !!root?.empty && root.runtimeSessionId === runtimeSessionId;
101
- return { envelope: null, empty: provenEmpty && (await noTurnSince(projectId, sessionId, runtimeSessionId)), log };
102
- }
103
- let envelope;
104
- try {
105
- envelope = await readSavedWindow(projectId, sessionId, {});
106
- }
107
- catch {
108
- return { envelope: null, empty: false };
109
- }
110
- holdSavedWindow(projectId, sessionId, envelope);
111
- if (savedCopyEmptyRoot(envelope) !== runtimeSessionId)
112
- return { envelope, empty: false };
113
- return { envelope, empty: await noTurnSince(projectId, sessionId, runtimeSessionId) };
48
+ const root = sessionLogRoot(applySessionLogPage(EMPTY_SESSION_LOG_STATE, log));
49
+ const provenEmpty = !!root?.empty && root.runtimeSessionId === runtimeSessionId;
50
+ return { envelope: null, empty: provenEmpty && (await noTurnSince(projectId, sessionId, runtimeSessionId)), log };
114
51
  }
115
52
  /**
116
- * A copy proved `runtimeSessionId` empty: no turn ended since and none is open (the copy is
53
+ * A page proved `runtimeSessionId` empty: no turn ended since and none is open (the page is
117
54
  * not older than the conversation). An unanswered turn record is an unknown: false.
118
55
  */
119
56
  async function noTurnSince(projectId, sessionId, runtimeSessionId) {
@@ -1 +1 @@
1
- {"version":3,"file":"saved-transcript.js","sourceRoot":"","sources":["../../../src/core/session-sync/saved-transcript.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;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