@kortix/sdk 0.16.3 → 0.16.5
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 +50 -10
- package/dist/browser/cache/idb-sync-cache.d.ts +6 -18
- package/dist/browser/cache/idb-sync-cache.d.ts.map +1 -1
- package/dist/browser/cache/idb-sync-cache.js +7 -22
- package/dist/browser/cache/idb-sync-cache.js.map +1 -1
- package/dist/browser/session-sync/session-scope.d.ts +10 -0
- package/dist/browser/session-sync/session-scope.d.ts.map +1 -0
- package/dist/browser/session-sync/session-scope.js +18 -0
- package/dist/browser/session-sync/session-scope.js.map +1 -0
- package/dist/browser/session-sync/session-sync-registry.d.ts +0 -2
- package/dist/browser/session-sync/session-sync-registry.d.ts.map +1 -1
- package/dist/browser/session-sync/session-sync-registry.js +4 -4
- package/dist/browser/session-sync/session-sync-registry.js.map +1 -1
- package/dist/browser/stores/sync-store.d.ts +4 -2
- package/dist/browser/stores/sync-store.d.ts.map +1 -1
- package/dist/browser/stores/sync-store.js +2 -2
- package/dist/browser/stores/sync-store.js.map +1 -1
- package/dist/core/client/kortix.d.ts +8 -6
- package/dist/core/client/kortix.d.ts.map +1 -1
- package/dist/core/client/project-core.d.ts +5 -0
- package/dist/core/client/project-core.d.ts.map +1 -1
- package/dist/core/client/project-core.js +5 -0
- package/dist/core/client/project-core.js.map +1 -1
- package/dist/core/client/session-handle.d.ts +0 -2
- package/dist/core/client/session-handle.d.ts.map +1 -1
- package/dist/core/client/session-lifecycle-security.d.ts +0 -14
- package/dist/core/client/session-lifecycle-security.d.ts.map +1 -1
- package/dist/core/client/session-lifecycle-security.js +0 -14
- package/dist/core/client/session-lifecycle-security.js.map +1 -1
- package/dist/core/rest/platform-client/host-boundary.d.ts +21 -3
- package/dist/core/rest/platform-client/host-boundary.d.ts.map +1 -1
- package/dist/core/rest/platform-client/host-boundary.js +14 -1
- package/dist/core/rest/platform-client/host-boundary.js.map +1 -1
- package/dist/core/rest/projects-client/artifacts.d.ts +34 -0
- package/dist/core/rest/projects-client/artifacts.d.ts.map +1 -1
- package/dist/core/rest/projects-client/artifacts.js +13 -0
- package/dist/core/rest/projects-client/artifacts.js.map +1 -1
- package/dist/core/rest/projects-client/dictation.d.ts +40 -0
- package/dist/core/rest/projects-client/dictation.d.ts.map +1 -0
- package/dist/core/rest/projects-client/dictation.js +47 -0
- package/dist/core/rest/projects-client/dictation.js.map +1 -0
- package/dist/core/rest/projects-client/index.d.ts +1 -1
- package/dist/core/rest/projects-client/index.d.ts.map +1 -1
- package/dist/core/rest/projects-client/index.js +1 -1
- package/dist/core/rest/projects-client/index.js.map +1 -1
- package/dist/core/rest/projects-client/projects.d.ts +14 -11
- package/dist/core/rest/projects-client/projects.d.ts.map +1 -1
- package/dist/core/rest/projects-client/projects.js +1 -3
- package/dist/core/rest/projects-client/projects.js.map +1 -1
- package/dist/core/rest/projects-client/secrets.d.ts +3 -1
- package/dist/core/rest/projects-client/secrets.d.ts.map +1 -1
- package/dist/core/rest/projects-client/secrets.js.map +1 -1
- package/dist/core/rest/projects-client/sessions.d.ts +5 -157
- package/dist/core/rest/projects-client/sessions.d.ts.map +1 -1
- package/dist/core/rest/projects-client/sessions.js +3 -67
- package/dist/core/rest/projects-client/sessions.js.map +1 -1
- package/dist/core/rest/projects-client/workspaces.d.ts +2 -1
- package/dist/core/rest/projects-client/workspaces.d.ts.map +1 -1
- package/dist/core/rest/projects-client/workspaces.js +2 -1
- package/dist/core/rest/projects-client/workspaces.js.map +1 -1
- package/dist/core/session/open-bundle.d.ts +5 -9
- package/dist/core/session/open-bundle.d.ts.map +1 -1
- package/dist/core/session/open-bundle.js +6 -8
- package/dist/core/session/open-bundle.js.map +1 -1
- package/dist/core/session/runtime-actions.d.ts +0 -10
- package/dist/core/session/runtime-actions.d.ts.map +1 -1
- package/dist/core/session/runtime-actions.js +0 -25
- package/dist/core/session/runtime-actions.js.map +1 -1
- package/dist/core/session-log/saved-log.d.ts +5 -18
- package/dist/core/session-log/saved-log.d.ts.map +1 -1
- package/dist/core/session-log/saved-log.js +0 -16
- package/dist/core/session-log/saved-log.js.map +1 -1
- package/dist/core/session-log/source.d.ts +12 -0
- package/dist/core/session-log/source.d.ts.map +1 -1
- package/dist/core/session-log/source.js +3 -1
- package/dist/core/session-log/source.js.map +1 -1
- package/dist/core/session-log/store.d.ts +14 -1
- package/dist/core/session-log/store.d.ts.map +1 -1
- package/dist/core/session-log/store.js +59 -9
- package/dist/core/session-log/store.js.map +1 -1
- package/dist/core/session-log/turns/agent-runs.d.ts.map +1 -1
- package/dist/core/session-log/turns/agent-runs.js +108 -14
- package/dist/core/session-log/turns/agent-runs.js.map +1 -1
- package/dist/core/session-log/turns/blocks.d.ts +4 -2
- package/dist/core/session-log/turns/blocks.d.ts.map +1 -1
- package/dist/core/session-log/turns/blocks.js +8 -10
- package/dist/core/session-log/turns/blocks.js.map +1 -1
- package/dist/core/session-sync/copy-store-types.d.ts +6 -7
- package/dist/core/session-sync/copy-store-types.d.ts.map +1 -1
- package/dist/core/session-sync/copy-store-types.js +5 -0
- package/dist/core/session-sync/copy-store-types.js.map +1 -1
- package/dist/core/session-sync/saved-copy-store.d.ts +27 -32
- package/dist/core/session-sync/saved-copy-store.d.ts.map +1 -1
- package/dist/core/session-sync/saved-copy-store.js +34 -91
- package/dist/core/session-sync/saved-copy-store.js.map +1 -1
- package/dist/core/session-sync/saved-transcript.d.ts +5 -26
- package/dist/core/session-sync/saved-transcript.d.ts.map +1 -1
- package/dist/core/session-sync/saved-transcript.js +8 -26
- package/dist/core/session-sync/saved-transcript.js.map +1 -1
- package/dist/core/turns/parts.d.ts.map +1 -1
- package/dist/core/turns/parts.js +40 -7
- package/dist/core/turns/parts.js.map +1 -1
- package/dist/core/turns/segments/group-steps.d.ts.map +1 -1
- package/dist/core/turns/segments/group-steps.js +5 -0
- package/dist/core/turns/segments/group-steps.js.map +1 -1
- package/dist/core/turns/segments/retried-agent-failures.d.ts +11 -0
- package/dist/core/turns/segments/retried-agent-failures.d.ts.map +1 -0
- package/dist/core/turns/segments/retried-agent-failures.js +38 -0
- package/dist/core/turns/segments/retried-agent-failures.js.map +1 -0
- package/dist/core/turns/segments/segment-turn.d.ts.map +1 -1
- package/dist/core/turns/segments/segment-turn.js +5 -0
- package/dist/core/turns/segments/segment-turn.js.map +1 -1
- package/dist/core/turns/segments/session-activity-groups.d.ts +1 -3
- package/dist/core/turns/segments/session-activity-groups.d.ts.map +1 -1
- package/dist/core/turns/segments/session-activity-groups.js +13 -3
- package/dist/core/turns/segments/session-activity-groups.js.map +1 -1
- package/dist/core/turns/segments/show-group.d.ts +4 -1
- package/dist/core/turns/segments/show-group.d.ts.map +1 -1
- package/dist/core/turns/segments/show-group.js +2 -11
- package/dist/core/turns/segments/show-group.js.map +1 -1
- package/dist/core/turns/segments/started-work.d.ts +2 -1
- package/dist/core/turns/segments/started-work.d.ts.map +1 -1
- package/dist/core/turns/segments/started-work.js +3 -2
- package/dist/core/turns/segments/started-work.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/kortix.esm.min.js +58 -58
- package/dist/kortix.global.js +59 -59
- package/dist/node/auth.d.ts.map +1 -1
- package/dist/node/auth.js +4 -10
- package/dist/node/auth.js.map +1 -1
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/index.js.map +1 -1
- package/dist/react/use-artifacts.d.ts +11 -1
- package/dist/react/use-artifacts.d.ts.map +1 -1
- package/dist/react/use-artifacts.js +28 -2
- package/dist/react/use-artifacts.js.map +1 -1
- package/dist/react/use-feature-flag.d.ts +2 -2
- package/dist/react/use-feature-flag.d.ts.map +1 -1
- package/dist/react/use-feature-flag.js +8 -4
- package/dist/react/use-feature-flag.js.map +1 -1
- package/dist/react/use-session-log.d.ts +22 -19
- package/dist/react/use-session-log.d.ts.map +1 -1
- package/dist/react/use-session-log.js +73 -107
- package/dist/react/use-session-log.js.map +1 -1
- package/dist/react/use-session-sync.d.ts +11 -12
- package/dist/react/use-session-sync.d.ts.map +1 -1
- package/dist/react/use-session-sync.js +19 -100
- package/dist/react/use-session-sync.js.map +1 -1
- package/dist/react/use-session.d.ts.map +1 -1
- package/dist/react/use-session.js +4 -10
- package/dist/react/use-session.js.map +1 -1
- package/package.json +2 -2
- package/dist/browser/session-sync/server-transcript-mirror.d.ts +0 -69
- package/dist/browser/session-sync/server-transcript-mirror.d.ts.map +0 -1
- package/dist/browser/session-sync/server-transcript-mirror.js +0 -112
- package/dist/browser/session-sync/server-transcript-mirror.js.map +0 -1
- package/dist/core/rest/projects-client/public-session-shares.d.ts +0 -77
- package/dist/core/rest/projects-client/public-session-shares.d.ts.map +0 -1
- package/dist/core/rest/projects-client/public-session-shares.js +0 -74
- package/dist/core/rest/projects-client/public-session-shares.js.map +0 -1
|
@@ -109,29 +109,27 @@ export function sessionLogOpenCall(call) {
|
|
|
109
109
|
}
|
|
110
110
|
return open;
|
|
111
111
|
}
|
|
112
|
-
/**
|
|
113
|
-
* A failed call keeps its slot as an `error` item whose `content` is the message. An item
|
|
114
|
-
* whose own call's output gives its file a sha256 carries it (R38, `showItemDigest`).
|
|
115
|
-
*/
|
|
112
|
+
/** An item whose own call's output gives its file a sha256 carries it (R38, `showItemDigest`). */
|
|
116
113
|
function carouselItem(item, call) {
|
|
117
|
-
const { callID: _callID, error, ...rest } = item;
|
|
118
|
-
if (item.status === 'error')
|
|
119
|
-
return { ...rest, type: 'error', content: error || 'This output failed to load.' };
|
|
114
|
+
const { callID: _callID, error: _error, ...rest } = item;
|
|
120
115
|
const sha256 = call && showItemDigest(call, item.path);
|
|
121
116
|
return sha256 ? { ...rest, sha256 } : rest;
|
|
122
117
|
}
|
|
123
118
|
/**
|
|
124
119
|
* A run of adjacent `show` calls (a `show-group` segment) as ONE `show` call: the first call's
|
|
125
|
-
* id
|
|
126
|
-
*
|
|
120
|
+
* id, the call id of the first call that did not fail (so "Open" lands on what was shown, not
|
|
121
|
+
* on a failed attempt), `input.items` the carousel of every call's items (a failed call has none),
|
|
122
|
+
* `running` while any call is open, else `complete`. N single calls and one N-item call render
|
|
123
|
+
* the same card.
|
|
127
124
|
*/
|
|
128
125
|
export function sessionLogShowGroupCall(calls) {
|
|
129
126
|
const parts = calls.map(toolPartOf);
|
|
130
127
|
const first = parts[0];
|
|
128
|
+
const target = parts.find((p) => p.state.status !== 'error') ?? first;
|
|
131
129
|
const running = parts.some((p) => p.state.status === 'running' || p.state.status === 'pending');
|
|
132
130
|
const byCallId = new Map(calls.map((block) => [block.call_id, block]));
|
|
133
131
|
const items = showGroupItems(parts).map((item) => carouselItem(item, byCallId.get(item.callID)));
|
|
134
|
-
return toolCallBlock({ ...first, state: { ...first.state, status: running ? 'running' : 'completed', input: { items } } });
|
|
132
|
+
return toolCallBlock({ ...first, callID: target.callID, state: { ...first.state, status: running ? 'running' : 'completed', input: { items } } });
|
|
135
133
|
}
|
|
136
134
|
/**
|
|
137
135
|
* A `question` call as answered with `answers` (one list per question) the harness has not
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocks.js","sourceRoot":"","sources":["../../../../src/core/session-log/turns/blocks.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAuB,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACpF,OAAO,EAAE,YAAY,EAAE,cAAc,EAAqB,MAAM,oCAAoC,CAAC;AACrG,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAkB,MAAM,kCAAkC,CAAC;AAEvG,OAAO,EAAE,WAAW,EAA2B,MAAM,mCAAmC,CAAC;AACzF,OAAO,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAA+C,MAAM,iCAAiC,CA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CAAC,CAAC,CAAC,QAAQ,CAAC;QACxC,WAAW,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Internal types of the device's saved copies (`saved-copy-store.ts`), shared with the
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Internal types of the device's saved copies (`saved-copy-store.ts`), shared with the codec of
|
|
3
|
+
* the session-log page (`../session-log/saved-log.ts`). Kept out of `saved-copy-store.ts`, which
|
|
4
|
+
* the package root re-exports whole: none of these is public.
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export interface StoredCopy<T = SessionTranscriptSyncEnvelope> {
|
|
6
|
+
/** One kept copy. `e` is the payload: a session-log page (`saved-log.ts`). */
|
|
7
|
+
export interface StoredCopy<T> {
|
|
9
8
|
v: number;
|
|
10
9
|
user: string;
|
|
11
10
|
at: number;
|
|
@@ -18,7 +17,7 @@ export interface CopyCodec<T> {
|
|
|
18
17
|
fit(stored: StoredCopy<T>, maxChars: number): string | null;
|
|
19
18
|
capturedAt(value: T): number;
|
|
20
19
|
}
|
|
21
|
-
/** The store over one kind of copy; `SavedCopyStore` is this over the
|
|
20
|
+
/** The store over one kind of copy; `SavedCopyStore` is this over the session-log page. */
|
|
22
21
|
export interface CopyStore<T> {
|
|
23
22
|
keyFor(projectId: string, sessionId: string): string;
|
|
24
23
|
read(projectId: string, sessionId: string): T | null | Promise<T | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy-store-types.d.ts","sourceRoot":"","sources":["../../../src/core/session-sync/copy-store-types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"copy-store-types.d.ts","sourceRoot":"","sources":["../../../src/core/session-sync/copy-store-types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,8EAA8E;AAC9E,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,EAAE,CAAC,CAAC;CACN;AAED,iHAAiH;AACjH,MAAM,WAAW,SAAS,CAAC,CAAC;IAC1B,SAAS,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,KAAK,IAAI,CAAC,CAAC;IACnD,sFAAsF;IACtF,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC5D,UAAU,CAAC,KAAK,EAAE,CAAC,GAAG,MAAM,CAAC;CAC9B;AAED,2FAA2F;AAC3F,MAAM,WAAW,SAAS,CAAC,CAAC;IAC1B,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IACrD,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IACzE,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5D,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB"}
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal types of the device's saved copies (`saved-copy-store.ts`), shared with the codec of
|
|
3
|
+
* the session-log page (`../session-log/saved-log.ts`). Kept out of `saved-copy-store.ts`, which
|
|
4
|
+
* the package root re-exports whole: none of these is public.
|
|
5
|
+
*/
|
|
1
6
|
export {};
|
|
2
7
|
//# sourceMappingURL=copy-store-types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy-store-types.js","sourceRoot":"","sources":["../../../src/core/session-sync/copy-store-types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"copy-store-types.js","sourceRoot":"","sources":["../../../src/core/session-sync/copy-store-types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -2,21 +2,18 @@
|
|
|
2
2
|
* The last saved copies of a user's sessions, kept on the device.
|
|
3
3
|
*
|
|
4
4
|
* Opening a session painted nothing until the control plane answered with the
|
|
5
|
-
* saved
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* message id.
|
|
5
|
+
* session's saved history: skeleton rows for 0.3-2.3 s on every cold open, and
|
|
6
|
+
* for as long as the backend took when it was slow. With this store the next
|
|
7
|
+
* open paints the last copy as soon as the device reads it (one task after the
|
|
8
|
+
* first frame), and the fresh page reconciles into it by message id.
|
|
10
9
|
*
|
|
11
|
-
* WHAT IT STORES, AND WHY THAT IS SAFE. Only
|
|
12
|
-
*
|
|
13
|
-
* the
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* wrong, and the painting side keeps its root-identity guard
|
|
19
|
-
* (`shouldHydrateFromMirror`).
|
|
10
|
+
* WHAT IT STORES, AND WHY THAT IS SAFE. Only pages the SERVER sent: the newest
|
|
11
|
+
* page of the session log's root thread (`GET …/log`, `SessionLogPage`), which
|
|
12
|
+
* the daemon journals at each turn end. Every read validates the page
|
|
13
|
+
* (`isSessionLogPage`). It never stores the live transcript. An IndexedDB mirror
|
|
14
|
+
* of the live store was deleted (`5a7a43517f`) because its write test read the
|
|
15
|
+
* transcript's shape, missed a Stop, and painted a stopped turn as running. A
|
|
16
|
+
* server page has no client-side freshness test to get wrong.
|
|
20
17
|
*
|
|
21
18
|
* Framework-free: the host passes the storage (IndexedDB on web, through
|
|
22
19
|
* `indexedDBKeyValueStorage`; AsyncStorage on mobile) and the signed-in user.
|
|
@@ -24,7 +21,7 @@
|
|
|
24
21
|
* corrupt or missing store — costs only the old cold open; nothing throws.
|
|
25
22
|
*/
|
|
26
23
|
import type { KeyValueStorage } from '../cache/persisted-query-cache.js';
|
|
27
|
-
import type {
|
|
24
|
+
import type { SessionLogPage } from '../session-log/source.js';
|
|
28
25
|
export interface SavedCopyStoreOptions {
|
|
29
26
|
storage: KeyValueStorage;
|
|
30
27
|
/** The signed-in user. Only this user's copies are read or written. */
|
|
@@ -34,42 +31,40 @@ export interface SavedCopyStoreOptions {
|
|
|
34
31
|
/** Upper bound of all copies together, in UTF-16 code units. Default: 1,500,000. */
|
|
35
32
|
maxBytes?: number;
|
|
36
33
|
/**
|
|
37
|
-
* Upper bound of one session's copy, in UTF-16 code units. A larger
|
|
38
|
-
* keeps its newest messages that fit and pages the rest
|
|
39
|
-
* one whose newest message alone does not fit is not kept.
|
|
34
|
+
* Upper bound of one session's copy, in UTF-16 code units. A larger page
|
|
35
|
+
* keeps its newest messages that fit (`has_more: true`) and pages the rest
|
|
36
|
+
* from the server; one whose newest message alone does not fit is not kept.
|
|
37
|
+
* Default: 300,000.
|
|
40
38
|
*/
|
|
41
39
|
maxEnvelopeBytes?: number;
|
|
42
40
|
/** A copy older than this is not painted. Default: 14 days. */
|
|
43
41
|
maxAgeMs?: number;
|
|
44
|
-
/** Storage key prefix. Default: `kortix.saved-copy`. */
|
|
42
|
+
/** Storage key prefix. Copies live under `<namespace>.log`. Default: `kortix.saved-copy`. */
|
|
45
43
|
namespace?: string;
|
|
46
44
|
now?: () => number;
|
|
47
45
|
}
|
|
48
46
|
export interface SavedCopyStore {
|
|
49
|
-
/** The storage key of one session's copy
|
|
47
|
+
/** The storage key of one session's copy: `<namespace>.log:<user>:<project>/<session>`. */
|
|
50
48
|
keyFor(projectId: string, sessionId: string): string;
|
|
51
|
-
/** The last saved
|
|
52
|
-
read(projectId: string, sessionId: string):
|
|
49
|
+
/** The last saved page, synchronously when the storage is synchronous. */
|
|
50
|
+
read(projectId: string, sessionId: string): SessionLogPage | null | Promise<SessionLogPage | null>;
|
|
53
51
|
/**
|
|
54
|
-
* Keep `
|
|
55
|
-
*
|
|
56
|
-
*
|
|
52
|
+
* Keep `page` (the newest page of the session log's root thread) as this
|
|
53
|
+
* session's copy. A page that cannot be painted (invalid, or no messages)
|
|
54
|
+
* removes the copy instead: the server no longer vouches for one.
|
|
57
55
|
*/
|
|
58
|
-
write(projectId: string, sessionId: string,
|
|
56
|
+
write(projectId: string, sessionId: string, page: SessionLogPage): Promise<void>;
|
|
59
57
|
remove(projectId: string, sessionId: string): Promise<void>;
|
|
60
58
|
/** Forget every copy of this user. */
|
|
61
59
|
clear(): Promise<void>;
|
|
62
60
|
}
|
|
63
|
-
/** A copy worth painting: a non-empty mirror window that names its runtime root. */
|
|
64
|
-
export declare function isPaintableSavedCopy(envelope: SessionTranscriptSyncEnvelope | null | undefined): envelope is SessionTranscriptSyncEnvelope;
|
|
65
61
|
/**
|
|
66
|
-
* The
|
|
67
|
-
*
|
|
68
|
-
* read as the other. `remove` and `clear` forget both.
|
|
62
|
+
* The device's store of saved session-log pages, under `<namespace>.log`. It also deletes the
|
|
63
|
+
* v1 copies an older SDK kept under `<namespace>` (`RETIRED_V1_COPY`).
|
|
69
64
|
*/
|
|
70
65
|
export declare function createSavedCopyStore(options: SavedCopyStoreOptions): SavedCopyStore;
|
|
71
66
|
/**
|
|
72
|
-
* The store the session
|
|
67
|
+
* The store the session log paints from and writes to. The host sets it
|
|
73
68
|
* when a user signs in and sets `null` on sign-out (after `clear()`), because
|
|
74
69
|
* only the host knows who is signed in. With no store, opening a session
|
|
75
70
|
* behaves exactly as before: nothing is read or written on the device.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"saved-copy-store.d.ts","sourceRoot":"","sources":["../../../src/core/session-sync/saved-copy-store.ts"],"names":[],"mappings":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xB;AAmBD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,qBAAqB,GAAG,cAAc,CAkBnF;AA+GD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,GAAG,IAAI,CAEpE;AAED,wBAAgB,qBAAqB,IAAI,cAAc,GAAG,IAAI,CAE7D"}
|
|
@@ -2,120 +2,63 @@
|
|
|
2
2
|
* The last saved copies of a user's sessions, kept on the device.
|
|
3
3
|
*
|
|
4
4
|
* Opening a session painted nothing until the control plane answered with the
|
|
5
|
-
* saved
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* message id.
|
|
5
|
+
* session's saved history: skeleton rows for 0.3-2.3 s on every cold open, and
|
|
6
|
+
* for as long as the backend took when it was slow. With this store the next
|
|
7
|
+
* open paints the last copy as soon as the device reads it (one task after the
|
|
8
|
+
* first frame), and the fresh page reconciles into it by message id.
|
|
10
9
|
*
|
|
11
|
-
* WHAT IT STORES, AND WHY THAT IS SAFE. Only
|
|
12
|
-
*
|
|
13
|
-
* the
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* wrong, and the painting side keeps its root-identity guard
|
|
19
|
-
* (`shouldHydrateFromMirror`).
|
|
10
|
+
* WHAT IT STORES, AND WHY THAT IS SAFE. Only pages the SERVER sent: the newest
|
|
11
|
+
* page of the session log's root thread (`GET …/log`, `SessionLogPage`), which
|
|
12
|
+
* the daemon journals at each turn end. Every read validates the page
|
|
13
|
+
* (`isSessionLogPage`). It never stores the live transcript. An IndexedDB mirror
|
|
14
|
+
* of the live store was deleted (`5a7a43517f`) because its write test read the
|
|
15
|
+
* transcript's shape, missed a Stop, and painted a stopped turn as running. A
|
|
16
|
+
* server page has no client-side freshness test to get wrong.
|
|
20
17
|
*
|
|
21
18
|
* Framework-free: the host passes the storage (IndexedDB on web, through
|
|
22
19
|
* `indexedDBKeyValueStorage`; AsyncStorage on mobile) and the signed-in user.
|
|
23
20
|
* Both are asynchronous, so no read blocks a frame. Every failure — a full,
|
|
24
21
|
* corrupt or missing store — costs only the old cold open; nothing throws.
|
|
25
22
|
*/
|
|
26
|
-
import {
|
|
23
|
+
import { SESSION_LOG_COPY } from '../session-log/saved-log.js';
|
|
27
24
|
import { VERSION, createSavedCopyIndex, isPromise, then } from './saved-copy-index.js';
|
|
28
|
-
/** A copy worth painting: a non-empty mirror window that names its runtime root. */
|
|
29
|
-
export function isPaintableSavedCopy(envelope) {
|
|
30
|
-
return (!!envelope &&
|
|
31
|
-
envelope.available === true &&
|
|
32
|
-
envelope.source === 'mirror' &&
|
|
33
|
-
Array.isArray(envelope.messages) &&
|
|
34
|
-
envelope.messages.length > 0 &&
|
|
35
|
-
// A copy saved by an SDK before W4 names the root only `runtime_session_id`.
|
|
36
|
-
!!envelope.runtime_session_id);
|
|
37
|
-
}
|
|
38
25
|
const DEFAULT_MAX_SESSIONS = 12;
|
|
39
26
|
const DEFAULT_MAX_BYTES = 1_500_000;
|
|
40
27
|
const DEFAULT_MAX_ENVELOPE_BYTES = 300_000;
|
|
41
28
|
const DEFAULT_MAX_AGE_MS = 14 * 24 * 60 * 60 * 1000;
|
|
42
29
|
const DEFAULT_NAMESPACE = 'kortix.saved-copy';
|
|
43
30
|
/**
|
|
44
|
-
* The
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* when not even the newest message fits.
|
|
48
|
-
*
|
|
49
|
-
* Copies carry every tool call 1:1, so a 40-message window of a tool-heavy
|
|
50
|
-
* thread outgrows the bound. The newest messages are what the first frame
|
|
51
|
-
* shows; refusing the whole copy gave exactly those sessions a cold open.
|
|
31
|
+
* The v1 transcript window an SDK before the session-log major kept under `<namespace>:`.
|
|
32
|
+
* Never painted: a read deletes it, and `write`, `remove` and `clear` delete it too, so a
|
|
33
|
+
* device frees the space without a migration.
|
|
52
34
|
*/
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const { messages } = stored.e;
|
|
58
|
-
if (messages.length === 0)
|
|
59
|
-
return null;
|
|
60
|
-
const trimmed = (keep) => {
|
|
61
|
-
const kept = messages.slice(messages.length - keep);
|
|
62
|
-
return JSON.stringify({
|
|
63
|
-
...stored,
|
|
64
|
-
e: {
|
|
65
|
-
...stored.e,
|
|
66
|
-
messages: kept,
|
|
67
|
-
message_count: kept.length,
|
|
68
|
-
complete: false,
|
|
69
|
-
next_cursor: String(kept[0].info.id),
|
|
70
|
-
},
|
|
71
|
-
});
|
|
72
|
-
};
|
|
73
|
-
// Count what fits from the newest message back, then confirm on the real
|
|
74
|
-
// text: the cursor and count fields change length with the cut.
|
|
75
|
-
let size = trimmed(1).length - JSON.stringify(messages[messages.length - 1]).length;
|
|
76
|
-
let keep = 0;
|
|
77
|
-
while (keep < messages.length) {
|
|
78
|
-
const next = JSON.stringify(messages[messages.length - 1 - keep]).length + (keep > 0 ? 1 : 0);
|
|
79
|
-
if (size + next > maxChars)
|
|
80
|
-
break;
|
|
81
|
-
size += next;
|
|
82
|
-
keep += 1;
|
|
83
|
-
}
|
|
84
|
-
for (; keep > 0; keep -= 1) {
|
|
85
|
-
const text = trimmed(keep);
|
|
86
|
-
if (text.length <= maxChars)
|
|
87
|
-
return text;
|
|
88
|
-
}
|
|
89
|
-
return null;
|
|
90
|
-
}
|
|
91
|
-
function capturedAtMs(envelope) {
|
|
92
|
-
const parsed = envelope.captured_at ? Date.parse(envelope.captured_at) : Number.NaN;
|
|
93
|
-
return Number.isFinite(parsed) ? parsed : 0;
|
|
94
|
-
}
|
|
95
|
-
const ENVELOPE = {
|
|
96
|
-
paintable: isPaintableSavedCopy,
|
|
97
|
-
fit: fitSavedCopy,
|
|
98
|
-
capturedAt: capturedAtMs,
|
|
35
|
+
const RETIRED_V1_COPY = {
|
|
36
|
+
paintable: (_value) => false,
|
|
37
|
+
fit: () => null,
|
|
38
|
+
capturedAt: () => 0,
|
|
99
39
|
};
|
|
100
40
|
/**
|
|
101
|
-
* The
|
|
102
|
-
*
|
|
103
|
-
* read as the other. `remove` and `clear` forget both.
|
|
41
|
+
* The device's store of saved session-log pages, under `<namespace>.log`. It also deletes the
|
|
42
|
+
* v1 copies an older SDK kept under `<namespace>` (`RETIRED_V1_COPY`).
|
|
104
43
|
*/
|
|
105
44
|
export function createSavedCopyStore(options) {
|
|
106
|
-
const
|
|
107
|
-
const
|
|
108
|
-
const
|
|
109
|
-
|
|
45
|
+
const namespace = options.namespace ?? DEFAULT_NAMESPACE;
|
|
46
|
+
const pages = createCopyStore({ ...options, namespace: `${namespace}.log` }, SESSION_LOG_COPY);
|
|
47
|
+
const retired = createCopyStore({ ...options, namespace }, RETIRED_V1_COPY);
|
|
48
|
+
return {
|
|
49
|
+
keyFor: pages.keyFor,
|
|
50
|
+
read: pages.read,
|
|
51
|
+
write: async (projectId, sessionId, page) => {
|
|
52
|
+
await pages.write(projectId, sessionId, page);
|
|
53
|
+
await retired.remove(projectId, sessionId);
|
|
54
|
+
},
|
|
110
55
|
remove: async (projectId, sessionId) => {
|
|
111
|
-
await Promise.all([
|
|
56
|
+
await Promise.all([pages.remove(projectId, sessionId), retired.remove(projectId, sessionId)]);
|
|
112
57
|
},
|
|
113
58
|
clear: async () => {
|
|
114
|
-
await Promise.all([
|
|
59
|
+
await Promise.all([pages.clear(), retired.clear()]);
|
|
115
60
|
},
|
|
116
61
|
};
|
|
117
|
-
registerSessionLogCopies(store, v2, v1.remove);
|
|
118
|
-
return store;
|
|
119
62
|
}
|
|
120
63
|
function createCopyStore(options, codec) {
|
|
121
64
|
const { storage, userId, maxSessions = DEFAULT_MAX_SESSIONS, maxBytes = DEFAULT_MAX_BYTES, maxEnvelopeBytes = DEFAULT_MAX_ENVELOPE_BYTES, maxAgeMs = DEFAULT_MAX_AGE_MS, namespace = DEFAULT_NAMESPACE, now = () => Date.now(), } = options;
|
|
@@ -217,7 +160,7 @@ function createCopyStore(options, codec) {
|
|
|
217
160
|
}
|
|
218
161
|
let currentStore = null;
|
|
219
162
|
/**
|
|
220
|
-
* The store the session
|
|
163
|
+
* The store the session log paints from and writes to. The host sets it
|
|
221
164
|
* when a user signs in and sets `null` on sign-out (after `clear()`), because
|
|
222
165
|
* only the host knows who is signed in. With no store, opening a session
|
|
223
166
|
* behaves exactly as before: nothing is read or written on the device.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"saved-copy-store.js","sourceRoot":"","sources":["../../../src/core/session-sync/saved-copy-store.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"saved-copy-store.js","sourceRoot":"","sources":["../../../src/core/session-sync/saved-copy-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,IAAI,EAAmB,MAAM,oBAAoB,CAAC;AAwCrG,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAChC,MAAM,iBAAiB,GAAG,SAAS,CAAC;AACpC,MAAM,0BAA0B,GAAG,OAAO,CAAC;AAC3C,MAAM,kBAAkB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AACpD,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AAE9C;;;;GAIG;AACH,MAAM,eAAe,GAAqB;IACxC,SAAS,EAAE,CAAC,MAAM,EAAmB,EAAE,CAAC,KAAK;IAC7C,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI;IACf,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC;CACpB,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAA8B;IACjE,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,iBAAiB,CAAC;IACzD,MAAM,KAAK,GAAG,eAAe,CAAC,EAAE,GAAG,OAAO,EAAE,SAAS,E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AK,MAAM,CAAC,CAAC,CAAC,CAAC;oBAC9D,CAAC;oBACD,IAAI,CAAC;wBACH,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;oBACnC,CAAC;oBAAC,MAAM,CAAC;wBACP,MAAM,UAAU,CAAC,GAAG,CAAC,CAAC;wBACtB,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC;oBAC3D,CAAC;gBACH,CAAC;gBACD,MAAM,SAAS,CAAC,IAAI,CAAC,CAAC;YACxB,CAAC,CAAC,CAAC;QACL,CAAC;QAED,MAAM,CAAC,SAAS,EAAE,SAAS;YACzB,OAAO,WAAW,CAAC,GAAG,SAAS,IAAI,SAAS,EAAE,CAAC,CAAC;QAClD,CAAC;QAED,KAAK;YACH,OAAO,OAAO,CAAC,KAAK,IAAI,EAAE;gBACxB,MAAM,OAAO,GAAG,MAAM,SAAS,EAAE,CAAC;gBAClC,KAAK,MAAM,KAAK,IAAI,OAAO;oBAAE,MAAM,UAAU,CAAC,GAAG,MAAM,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;gBACrE,MAAM,UAAU,CAAC,QAAQ,CAAC,CAAC;YAC7B,CAAC,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC;AAED,IAAI,YAAY,GAA0B,IAAI,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAA4B;IAC5D,YAAY,GAAG,KAAK,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,qBAAqB;IACnC,OAAO,YAAY,CAAC;AACtB,CAAC"}
|
|
@@ -20,14 +20,8 @@
|
|
|
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 { type SessionTranscriptSyncEnvelope } from '../rest/projects-client/sessions.js';
|
|
24
23
|
import { type SessionLogPage } from '../session-log/source.js';
|
|
25
24
|
export interface SavedSessionCopy {
|
|
26
|
-
/**
|
|
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.
|
|
29
|
-
*/
|
|
30
|
-
envelope: SessionTranscriptSyncEnvelope | null;
|
|
31
25
|
/**
|
|
32
26
|
* The conversation is proven empty, with nothing to wait for
|
|
33
27
|
* ({@link isEmptyConversation}): show the composer, not a boot screen.
|
|
@@ -43,13 +37,12 @@ export interface SavedSessionCopy {
|
|
|
43
37
|
* The saved copy of a session, for a host that shows the session before
|
|
44
38
|
* `useSession` binds it (a connecting view while the computer wakes).
|
|
45
39
|
*
|
|
46
|
-
* The session log
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
40
|
+
* The session log's newest page of the root thread (`GET …/log`), as `log`. The host puts it
|
|
41
|
+
* in the session store (`applySessionLogPage`) and renders `useSessionLogThread`, which loads a
|
|
42
|
+
* sub-agent's thread from the heads that page names. `useSession` reads the page again at the
|
|
43
|
+
* bind.
|
|
50
44
|
*
|
|
51
|
-
* Any other answer (a 404, a failed read, an invalid page) answers no copy: `log: null`.
|
|
52
|
-
* window is read (`GET …/transcript`, P8.3).
|
|
45
|
+
* Any other answer (a 404, a failed read, an invalid page) answers no copy: `log: null`.
|
|
53
46
|
*
|
|
54
47
|
* The turn record is read only when the page proves `runtimeSessionId` empty. Never throws.
|
|
55
48
|
*/
|
|
@@ -59,11 +52,6 @@ export declare function readSavedSessionCopy(input: {
|
|
|
59
52
|
sessionId: string;
|
|
60
53
|
/** The runtime session the copy belongs to (the root). */
|
|
61
54
|
runtimeSessionId: string;
|
|
62
|
-
/**
|
|
63
|
-
* @deprecated Ignored: the session log is always read, and no v1 window. The project flag
|
|
64
|
-
* `session_log` it carried is gone.
|
|
65
|
-
*/
|
|
66
|
-
sessionLog?: boolean;
|
|
67
55
|
}): Promise<SavedSessionCopy>;
|
|
68
56
|
export type SavedTranscript = 'loading' | 'shown' | 'none';
|
|
69
57
|
export interface SavedTranscriptInput {
|
|
@@ -96,15 +84,6 @@ export interface SavedTranscriptInput {
|
|
|
96
84
|
emptyAwaitingTurnRead?: boolean;
|
|
97
85
|
}
|
|
98
86
|
export declare function resolveSavedTranscript(input: SavedTranscriptInput): SavedTranscript;
|
|
99
|
-
/**
|
|
100
|
-
* The runtime root a saved window proves EMPTY, or null.
|
|
101
|
-
*
|
|
102
|
-
* The proof is the server's: a complete read of the runtime that found no
|
|
103
|
-
* messages, served as an available, complete window that counts zero. `total`
|
|
104
|
-
* must say so explicitly; an older API sends none and never answers an empty
|
|
105
|
-
* window as available.
|
|
106
|
-
*/
|
|
107
|
-
export declare function savedCopyEmptyRoot(envelope: SessionTranscriptSyncEnvelope | null | undefined): string | null;
|
|
108
87
|
export interface EmptyConversationInput {
|
|
109
88
|
/**
|
|
110
89
|
* The runtime root the server's saved copy proves empty: a complete read of
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"saved-transcript.d.ts","sourceRoot":"","sources":["../../../src/core/session-sync/saved-transcript.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;
|
|
1
|
+
{"version":3,"file":"saved-transcript.d.ts","sourceRoot":"","sources":["../../../src/core/session-sync/saved-transcript.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EAAiD,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAI3G,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,GAAG,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;CAC7B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,oBAAoB,CAAC,KAAK,EAAE;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,6BAA6B;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,gBAAgB,EAAE,MAAM,CAAC;CAC1B,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAQ5B;AAqBD,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAE3D,MAAM,WAAW,oBAAoB;IACnC,6EAA6E;IAC7E,OAAO,EAAE,OAAO,CAAC;IACjB,oEAAoE;IACpE,WAAW,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,OAAO,EAAE,KAAK,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;IAClD;;;;OAIG;IACH,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;IAClD;;;;OAIG;IACH,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;IACtC;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,oBAAoB,GAAG,eAAe,CAUnF;AAED,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,uEAAuE;IACvE,aAAa,EAAE,MAAM,CAAC;IACtB,4DAA4D;IAC5D,QAAQ,EAAE,OAAO,CAAC;IAClB,0DAA0D;IAC1D,YAAY,EAAE,OAAO,CAAC;IACtB,+DAA+D;IAC/D,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAQ1E"}
|
|
@@ -28,26 +28,25 @@ import { sessionLogRoot } from '../session-log/v1-view.js';
|
|
|
28
28
|
* The saved copy of a session, for a host that shows the session before
|
|
29
29
|
* `useSession` binds it (a connecting view while the computer wakes).
|
|
30
30
|
*
|
|
31
|
-
* The session log
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
31
|
+
* The session log's newest page of the root thread (`GET …/log`), as `log`. The host puts it
|
|
32
|
+
* in the session store (`applySessionLogPage`) and renders `useSessionLogThread`, which loads a
|
|
33
|
+
* sub-agent's thread from the heads that page names. `useSession` reads the page again at the
|
|
34
|
+
* bind.
|
|
35
35
|
*
|
|
36
|
-
* Any other answer (a 404, a failed read, an invalid page) answers no copy: `log: null`.
|
|
37
|
-
* window is read (`GET …/transcript`, P8.3).
|
|
36
|
+
* Any other answer (a 404, a failed read, an invalid page) answers no copy: `log: null`.
|
|
38
37
|
*
|
|
39
38
|
* The turn record is read only when the page proves `runtimeSessionId` empty. Never throws.
|
|
40
39
|
*/
|
|
41
40
|
export async function readSavedSessionCopy(input) {
|
|
42
41
|
const { projectId, sessionId, runtimeSessionId } = input;
|
|
43
42
|
if (!projectId || !sessionId || !runtimeSessionId)
|
|
44
|
-
return {
|
|
43
|
+
return { empty: false };
|
|
45
44
|
const log = await readFirstSessionLogAnswer(loadSessionLogPage, projectId, sessionId);
|
|
46
45
|
if (!log || log === 'missing')
|
|
47
|
-
return {
|
|
46
|
+
return { empty: false, log: null };
|
|
48
47
|
const root = sessionLogRoot(applySessionLogPage(EMPTY_SESSION_LOG_STATE, log));
|
|
49
48
|
const provenEmpty = !!root?.empty && root.runtimeSessionId === runtimeSessionId;
|
|
50
|
-
return {
|
|
49
|
+
return { empty: provenEmpty && (await noTurnSince(projectId, sessionId, runtimeSessionId)), log };
|
|
51
50
|
}
|
|
52
51
|
/**
|
|
53
52
|
* A page proved `runtimeSessionId` empty: no turn ended since and none is open (the page is
|
|
@@ -87,23 +86,6 @@ export function resolveSavedTranscript(input) {
|
|
|
87
86
|
return 'none';
|
|
88
87
|
return 'loading';
|
|
89
88
|
}
|
|
90
|
-
/**
|
|
91
|
-
* The runtime root a saved window proves EMPTY, or null.
|
|
92
|
-
*
|
|
93
|
-
* The proof is the server's: a complete read of the runtime that found no
|
|
94
|
-
* messages, served as an available, complete window that counts zero. `total`
|
|
95
|
-
* must say so explicitly; an older API sends none and never answers an empty
|
|
96
|
-
* window as available.
|
|
97
|
-
*/
|
|
98
|
-
export function savedCopyEmptyRoot(envelope) {
|
|
99
|
-
return envelope?.available &&
|
|
100
|
-
envelope.source === 'mirror' &&
|
|
101
|
-
envelope.complete &&
|
|
102
|
-
envelope.total === 0 &&
|
|
103
|
-
envelope.messages.length === 0
|
|
104
|
-
? (envelope.runtime_session_id ?? null)
|
|
105
|
-
: null;
|
|
106
|
-
}
|
|
107
89
|
/**
|
|
108
90
|
* Is this session's conversation empty, with nothing to wait for?
|
|
109
91
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"saved-transcript.js","sourceRoot":"","sources":["../../../src/core/session-sync/saved-transcript.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"saved-transcript.js","sourceRoot":"","sources":["../../../src/core/session-sync/saved-transcript.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAuB,MAAM,uBAAuB,CAAC;AAC3G,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAexD;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,KAM1C;IACC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,gBAAgB,EAAE,GAAG,KAAK,CAAC;IACzD,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,IAAI,CAAC,gBAAgB;QAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;IAC3E,MAAM,GAAG,GAAG,MAAM,yBAAyB,CAAC,kBAAkB,EAAE,SAAS,EAAE,SAAS,CAAC,C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