@kortix/sdk 0.13.31 → 0.13.32
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 +21 -10
- package/dist/browser/session-sync/server-transcript-mirror.d.ts.map +1 -1
- package/dist/browser/session-sync/server-transcript-mirror.js +6 -1
- package/dist/browser/session-sync/server-transcript-mirror.js.map +1 -1
- package/dist/core/auth/session.d.ts.map +1 -1
- package/dist/core/auth/session.js +56 -15
- package/dist/core/auth/session.js.map +1 -1
- package/dist/core/client/kortix.d.ts +7 -0
- package/dist/core/client/kortix.d.ts.map +1 -1
- package/dist/core/client/kortix.js +6 -0
- package/dist/core/client/kortix.js.map +1 -1
- package/dist/core/files/client.d.ts +30 -9
- package/dist/core/files/client.d.ts.map +1 -1
- package/dist/core/files/client.js +71 -29
- package/dist/core/files/client.js.map +1 -1
- package/dist/core/http/api/errors.d.ts +23 -8
- package/dist/core/http/api/errors.d.ts.map +1 -1
- package/dist/core/http/api/errors.js +44 -23
- package/dist/core/http/api/errors.js.map +1 -1
- package/dist/core/http/api-client.d.ts +9 -14
- package/dist/core/http/api-client.d.ts.map +1 -1
- package/dist/core/http/api-client.js +35 -87
- package/dist/core/http/api-client.js.map +1 -1
- package/dist/core/http/auth.d.ts +12 -15
- package/dist/core/http/auth.d.ts.map +1 -1
- package/dist/core/http/auth.js +24 -68
- package/dist/core/http/auth.js.map +1 -1
- package/dist/core/http/transport.d.ts +46 -0
- package/dist/core/http/transport.d.ts.map +1 -0
- package/dist/core/http/transport.js +135 -0
- package/dist/core/http/transport.js.map +1 -0
- package/dist/core/rest/platform-client/host-boundary.d.ts +35 -1
- package/dist/core/rest/platform-client/host-boundary.d.ts.map +1 -1
- package/dist/core/rest/platform-client/host-boundary.js.map +1 -1
- package/dist/core/rest/platform-client/instance-admin.d.ts +16 -9
- package/dist/core/rest/platform-client/instance-admin.d.ts.map +1 -1
- package/dist/core/rest/platform-client/instance-admin.js +21 -25
- package/dist/core/rest/platform-client/instance-admin.js.map +1 -1
- package/dist/core/rest/platform-client/invites.d.ts +11 -3
- package/dist/core/rest/platform-client/invites.d.ts.map +1 -1
- package/dist/core/rest/platform-client/invites.js +16 -18
- package/dist/core/rest/platform-client/invites.js.map +1 -1
- package/dist/core/rest/platform-client/shared.d.ts +0 -7
- package/dist/core/rest/platform-client/shared.d.ts.map +1 -1
- package/dist/core/rest/platform-client/shared.js +0 -49
- package/dist/core/rest/platform-client/shared.js.map +1 -1
- package/dist/core/rest/projects-client/channels.d.ts +32 -0
- package/dist/core/rest/projects-client/channels.d.ts.map +1 -1
- package/dist/core/rest/projects-client/channels.js +27 -0
- package/dist/core/rest/projects-client/channels.js.map +1 -1
- package/dist/core/rest/projects-client/iam.d.ts +21 -0
- package/dist/core/rest/projects-client/iam.d.ts.map +1 -1
- package/dist/core/rest/projects-client/iam.js +9 -0
- package/dist/core/rest/projects-client/iam.js.map +1 -1
- package/dist/core/rest/projects-client/presentations.d.ts +4 -2
- package/dist/core/rest/projects-client/presentations.d.ts.map +1 -1
- package/dist/core/rest/projects-client/presentations.js +14 -6
- package/dist/core/rest/projects-client/presentations.js.map +1 -1
- package/dist/core/rest/projects-client/projects.d.ts +8 -10
- package/dist/core/rest/projects-client/projects.d.ts.map +1 -1
- package/dist/core/rest/projects-client/projects.js +8 -8
- package/dist/core/rest/projects-client/projects.js.map +1 -1
- package/dist/core/rest/projects-client/referrals.d.ts +9 -3
- package/dist/core/rest/projects-client/referrals.d.ts.map +1 -1
- package/dist/core/rest/projects-client/referrals.js +20 -17
- package/dist/core/rest/projects-client/referrals.js.map +1 -1
- package/dist/core/rest/projects-client/secrets.d.ts +15 -0
- package/dist/core/rest/projects-client/secrets.d.ts.map +1 -1
- package/dist/core/rest/projects-client/secrets.js +1 -0
- package/dist/core/rest/projects-client/secrets.js.map +1 -1
- package/dist/core/rest/projects-client/session-sandbox.d.ts +4 -1
- package/dist/core/rest/projects-client/session-sandbox.d.ts.map +1 -1
- package/dist/core/rest/projects-client/session-sandbox.js.map +1 -1
- package/dist/core/rest/projects-client/sessions.d.ts +56 -0
- package/dist/core/rest/projects-client/sessions.d.ts.map +1 -1
- package/dist/core/rest/projects-client/sessions.js.map +1 -1
- package/dist/core/rest/projects-client/templates.d.ts +4 -4
- package/dist/core/rest/projects-client/templates.d.ts.map +1 -1
- package/dist/core/rest/projects-client/templates.js +11 -8
- package/dist/core/rest/projects-client/templates.js.map +1 -1
- package/dist/core/session/open-bundle.d.ts +6 -0
- package/dist/core/session/open-bundle.d.ts.map +1 -1
- package/dist/core/session/open-bundle.js +22 -2
- package/dist/core/session/open-bundle.js.map +1 -1
- package/dist/core/session/preview-auth.d.ts +3 -2
- package/dist/core/session/preview-auth.d.ts.map +1 -1
- package/dist/core/session/preview-auth.js +11 -3
- package/dist/core/session/preview-auth.js.map +1 -1
- package/dist/core/session/preview-config.d.ts +5 -0
- package/dist/core/session/preview-config.d.ts.map +1 -1
- package/dist/core/session/preview-config.js +7 -0
- package/dist/core/session/preview-config.js.map +1 -1
- package/dist/core/session/preview-origin-trust.d.ts +24 -0
- package/dist/core/session/preview-origin-trust.d.ts.map +1 -0
- package/dist/core/session/preview-origin-trust.js +100 -0
- package/dist/core/session/preview-origin-trust.js.map +1 -0
- package/dist/core/session/preview.d.ts +7 -1
- package/dist/core/session/preview.d.ts.map +1 -1
- package/dist/core/session/preview.js +10 -2
- package/dist/core/session/preview.js.map +1 -1
- package/dist/core/session-sync/saved-transcript.d.ts +49 -0
- package/dist/core/session-sync/saved-transcript.d.ts.map +1 -0
- package/dist/core/session-sync/saved-transcript.js +40 -0
- package/dist/core/session-sync/saved-transcript.js.map +1 -0
- package/dist/core/session-sync/session-sync-controller.d.ts +20 -1
- package/dist/core/session-sync/session-sync-controller.d.ts.map +1 -1
- package/dist/core/session-sync/session-sync-controller.js +54 -5
- package/dist/core/session-sync/session-sync-controller.js.map +1 -1
- package/dist/core/stream/event-stream.d.ts +5 -4
- package/dist/core/stream/event-stream.d.ts.map +1 -1
- package/dist/core/stream/event-stream.js +34 -8
- package/dist/core/stream/event-stream.js.map +1 -1
- package/dist/core/turns/errors.d.ts +7 -0
- package/dist/core/turns/errors.d.ts.map +1 -1
- package/dist/core/turns/errors.js +58 -0
- package/dist/core/turns/errors.js.map +1 -1
- package/dist/core/turns/state.d.ts +7 -1
- package/dist/core/turns/state.d.ts.map +1 -1
- package/dist/core/turns/state.js +16 -3
- package/dist/core/turns/state.js.map +1 -1
- package/dist/index.d.ts +1 -1
- 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 +37 -35
- package/dist/kortix.global.js +37 -35
- package/dist/node/auth.d.ts +8 -1
- package/dist/node/auth.d.ts.map +1 -1
- package/dist/node/auth.js +21 -3
- package/dist/node/auth.js.map +1 -1
- package/dist/platform/auth-core.d.ts +0 -5
- package/dist/platform/auth-core.d.ts.map +1 -1
- package/dist/platform/auth-core.js +0 -20
- package/dist/platform/auth-core.js.map +1 -1
- package/dist/react/file-keys.d.ts +15 -7
- package/dist/react/file-keys.d.ts.map +1 -1
- package/dist/react/file-keys.js +15 -7
- package/dist/react/file-keys.js.map +1 -1
- package/dist/react/identity-reset-registry.d.ts +3 -0
- package/dist/react/identity-reset-registry.d.ts.map +1 -0
- package/dist/react/identity-reset-registry.js +22 -0
- package/dist/react/identity-reset-registry.js.map +1 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +6 -0
- package/dist/react/index.js.map +1 -1
- package/dist/react/query-keys.d.ts +7 -5
- package/dist/react/query-keys.d.ts.map +1 -1
- package/dist/react/query-keys.js +9 -5
- package/dist/react/query-keys.js.map +1 -1
- package/dist/react/reset-identity-state.d.ts +19 -0
- package/dist/react/reset-identity-state.d.ts.map +1 -0
- package/dist/react/reset-identity-state.js +35 -0
- package/dist/react/reset-identity-state.js.map +1 -0
- package/dist/react/retired-endpoint.d.ts +10 -0
- package/dist/react/retired-endpoint.d.ts.map +1 -0
- package/dist/react/retired-endpoint.js +22 -0
- package/dist/react/retired-endpoint.js.map +1 -0
- package/dist/react/session-stop.d.ts +101 -0
- package/dist/react/session-stop.d.ts.map +1 -0
- package/dist/react/session-stop.js +162 -0
- package/dist/react/session-stop.js.map +1 -0
- package/dist/react/sign-in-with-kortix.d.ts +1 -1
- package/dist/react/use-admin-accounts.d.ts +1 -0
- package/dist/react/use-admin-accounts.d.ts.map +1 -1
- package/dist/react/use-admin-accounts.js +3 -10
- package/dist/react/use-admin-accounts.js.map +1 -1
- package/dist/react/use-admin-analytics.d.ts +36 -8
- package/dist/react/use-admin-analytics.d.ts.map +1 -1
- package/dist/react/use-admin-analytics.js +63 -458
- package/dist/react/use-admin-analytics.js.map +1 -1
- package/dist/react/use-admin-billing.d.ts +6 -2
- package/dist/react/use-admin-billing.d.ts.map +1 -1
- package/dist/react/use-admin-billing.js +15 -52
- package/dist/react/use-admin-billing.js.map +1 -1
- package/dist/react/use-admin-feedback.d.ts +10 -1
- package/dist/react/use-admin-feedback.d.ts.map +1 -1
- package/dist/react/use-admin-feedback.js +24 -111
- package/dist/react/use-admin-feedback.js.map +1 -1
- package/dist/react/use-admin-sandboxes.d.ts +13 -5
- package/dist/react/use-admin-sandboxes.d.ts.map +1 -1
- package/dist/react/use-admin-sandboxes.js +20 -104
- package/dist/react/use-admin-sandboxes.js.map +1 -1
- package/dist/react/use-authenticated-preview-url.d.ts.map +1 -1
- package/dist/react/use-authenticated-preview-url.js +7 -1
- package/dist/react/use-authenticated-preview-url.js.map +1 -1
- package/dist/react/use-canonical-opencode-session.d.ts +8 -0
- package/dist/react/use-canonical-opencode-session.d.ts.map +1 -1
- package/dist/react/use-canonical-opencode-session.js +1 -0
- package/dist/react/use-canonical-opencode-session.js.map +1 -1
- package/dist/react/use-model-store.d.ts.map +1 -1
- package/dist/react/use-model-store.js +15 -0
- package/dist/react/use-model-store.js.map +1 -1
- package/dist/react/use-opencode-events/handle-event.d.ts.map +1 -1
- package/dist/react/use-opencode-events/handle-event.js +43 -35
- package/dist/react/use-opencode-events/handle-event.js.map +1 -1
- package/dist/react/use-session-send.d.ts +1 -73
- package/dist/react/use-session-send.d.ts.map +1 -1
- package/dist/react/use-session-send.js +6 -146
- package/dist/react/use-session-send.js.map +1 -1
- package/dist/react/use-session-sync.d.ts +8 -0
- package/dist/react/use-session-sync.d.ts.map +1 -1
- package/dist/react/use-session-sync.js +31 -2
- package/dist/react/use-session-sync.js.map +1 -1
- package/dist/react/use-session-transcript-history.d.ts +3 -0
- package/dist/react/use-session-transcript-history.d.ts.map +1 -1
- package/dist/react/use-session-transcript-history.js +7 -1
- package/dist/react/use-session-transcript-history.js.map +1 -1
- package/dist/react/use-session.d.ts +18 -2
- package/dist/react/use-session.d.ts.map +1 -1
- package/dist/react/use-session.js +51 -34
- package/dist/react/use-session.js.map +1 -1
- package/dist/react/use-static-file-preview.d.ts.map +1 -1
- package/dist/react/use-static-file-preview.js +2 -1
- package/dist/react/use-static-file-preview.js.map +1 -1
- package/dist/react/use-system-status.d.ts +7 -3
- package/dist/react/use-system-status.d.ts.map +1 -1
- package/dist/react/use-system-status.js +14 -67
- package/dist/react/use-system-status.js.map +1 -1
- package/package.json +2 -2
|
@@ -58,6 +58,8 @@ export const OPEN_BUNDLE_TRANSCRIPT_TTL_MS = 60_000;
|
|
|
58
58
|
export const OPEN_BUNDLE_TRANSCRIPT_LIMIT = 40;
|
|
59
59
|
const entries = new Map();
|
|
60
60
|
const transcripts = new Map();
|
|
61
|
+
/** When an open's bundle answered its transcript leg with NO saved copy. */
|
|
62
|
+
const absentTranscripts = new Map();
|
|
61
63
|
function scopeKey(projectId, sessionId) {
|
|
62
64
|
return `${projectId}/${sessionId}`;
|
|
63
65
|
}
|
|
@@ -66,6 +68,7 @@ function scopeKey(projectId, sessionId) {
|
|
|
66
68
|
export function resetSessionOpenBundles() {
|
|
67
69
|
entries.clear();
|
|
68
70
|
transcripts.clear();
|
|
71
|
+
absentTranscripts.clear();
|
|
69
72
|
}
|
|
70
73
|
/**
|
|
71
74
|
* Start the session-open read for `(projectId, sessionId)`.
|
|
@@ -158,9 +161,13 @@ function stashTranscript(key, bundle, nowMs) {
|
|
|
158
161
|
if (!transcript || transcript.known !== true || transcript.requested !== true)
|
|
159
162
|
return;
|
|
160
163
|
// An unavailable mirror is not a transcript. Stashing it would let a hydrate
|
|
161
|
-
// paint an empty thread as a complete one.
|
|
162
|
-
|
|
164
|
+
// paint an empty thread as a complete one. It IS an answer, though: the
|
|
165
|
+
// server holds no saved copy. Recorded separately, so the mirror read does
|
|
166
|
+
// not spend a second round trip asking the transcript route the same thing.
|
|
167
|
+
if (!transcript.available || transcript.messages.length === 0) {
|
|
168
|
+
absentTranscripts.set(key, nowMs);
|
|
163
169
|
return;
|
|
170
|
+
}
|
|
164
171
|
const { known: _known, requested: _requested, ...envelope } = transcript;
|
|
165
172
|
transcripts.set(key, { envelope, stashedAtMs: nowMs });
|
|
166
173
|
}
|
|
@@ -171,6 +178,19 @@ function stashTranscript(key, bundle, nowMs) {
|
|
|
171
178
|
* paint a snapshot, and a second paint over a store the runtime has already
|
|
172
179
|
* filled is how a transcript grows ghosts.
|
|
173
180
|
*/
|
|
181
|
+
/**
|
|
182
|
+
* Did this open's bundle answer "the server holds no saved copy"? ONCE, like
|
|
183
|
+
* the stash: a later read asks the server again, since a turn may have ended
|
|
184
|
+
* and written one since.
|
|
185
|
+
*/
|
|
186
|
+
export function takeOpenBundleTranscriptAbsence(projectId, sessionId, nowMs = Date.now()) {
|
|
187
|
+
const key = scopeKey(projectId, sessionId);
|
|
188
|
+
const answeredAtMs = absentTranscripts.get(key);
|
|
189
|
+
if (answeredAtMs === undefined)
|
|
190
|
+
return false;
|
|
191
|
+
absentTranscripts.delete(key);
|
|
192
|
+
return nowMs - answeredAtMs <= OPEN_BUNDLE_TRANSCRIPT_TTL_MS;
|
|
193
|
+
}
|
|
174
194
|
export function takeOpenBundleTranscript(projectId, sessionId, nowMs = Date.now()) {
|
|
175
195
|
const key = scopeKey(projectId, sessionId);
|
|
176
196
|
const stash = transcripts.get(key);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open-bundle.js","sourceRoot":"","sources":["../../../src/core/session/open-bundle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,EAOL,oBAAoB,GACrB,MAAM,kCAAkC,CAAC;AAE1C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAE1C;;kEAEkE;AAClE,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC;AAEpD;0CAC0C;AAC1C,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,CAAC;AAkB/C,MAAM,OAAO,GAAG,IAAI,GAAG,EAAuB,CAAC;AAC/C,MAAM,WAAW,GAAG,IAAI,GAAG,EAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"open-bundle.js","sourceRoot":"","sources":["../../../src/core/session/open-bundle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,EAOL,oBAAoB,GACrB,MAAM,kCAAkC,CAAC;AAE1C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAE1C;;kEAEkE;AAClE,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC;AAEpD;0CAC0C;AAC1C,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,CAAC;AAkB/C,MAAM,OAAO,GAAG,IAAI,GAAG,EAAuB,CAAC;AAC/C,MAAM,WAAW,GAAG,IAAI,GAAG,EAA2B,CAAC;AACvD,4EAA4E;AAC5E,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAkB,CAAC;AAEpD,SAAS,QAAQ,CAAC,SAAiB,EAAE,SAAiB;IACpD,OAAO,GAAG,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,GAAG,GAAG,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAC3C,MAAM,YAAY,GAAG,iBAAiB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAChD,IAAI,YAAY,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IAC7C,iBAAiB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC9B,OAAO,KAAK,GAAG,YAAY,IAAI,6BAA6B,CAAC;AAC/D,CAAC;AAED,MAAM,UAAU,wBAAwB,CACtC,SAAiB,EACjB,SAAiB,EACjB,QAAgB,IAAI,CAAC,GAAG,EAAE;IAE1B,MAAM,GAAG,GAAG,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAC3C,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACnC,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACxB,IAAI,KAAK,GAAG,KAAK,CAAC,WAAW,GAAG,6BAA6B;QAAE,OAAO,IAAI,CAAC;IAC3E,OAAO,KAAK,CAAC,QAAQ,CAAC;AACxB,CAAC"}
|
|
@@ -47,8 +47,9 @@ export declare function ensurePreviewSessionCookie(previewUrl: string, options?:
|
|
|
47
47
|
* - Path proxy (`/v1/p/{sandbox}/{port}/…`): same origin as the API, so the
|
|
48
48
|
* cookie works; mint it and return the URL untouched.
|
|
49
49
|
*
|
|
50
|
-
* Never throws. With no token,
|
|
51
|
-
*
|
|
50
|
+
* Never throws. With no token, for a URL that is not a preview at all, or for
|
|
51
|
+
* a preview-shaped host this deployment does not serve, the input is returned
|
|
52
|
+
* unchanged — the destination then answers for itself, which
|
|
52
53
|
* is more honest than fabricating a URL that cannot work.
|
|
53
54
|
*/
|
|
54
55
|
export declare function authorizePreviewUrl(previewUrl: string, options?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview-auth.d.ts","sourceRoot":"","sources":["../../../src/core/session/preview-auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;
|
|
1
|
+
{"version":3,"file":"preview-auth.d.ts","sourceRoot":"","sources":["../../../src/core/session/preview-auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAOH;;;;;;;;GAQG;AACH,wBAAsB,0BAA0B,CAC9C,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,GACnC,OAAO,CAAC,OAAO,CAAC,CAwBlB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,GACnC,OAAO,CAAC,MAAM,CAAC,CAUjB"}
|
|
@@ -18,7 +18,9 @@
|
|
|
18
18
|
* reloaded, bookmarked, or sent to anyone.
|
|
19
19
|
*/
|
|
20
20
|
import { getAuthToken } from '../http/auth.js';
|
|
21
|
+
import { platformConfig } from '../http/config.js';
|
|
21
22
|
import { appendPreviewToken, buildPreviewAuthEndpoint, isSubdomainPreviewUrl } from './preview.js';
|
|
23
|
+
import { shouldAttachPreviewToken } from './preview-origin-trust.js';
|
|
22
24
|
/**
|
|
23
25
|
* Mint the `__preview_session` cookie for `previewUrl`'s proxy origin.
|
|
24
26
|
*
|
|
@@ -29,7 +31,8 @@ import { appendPreviewToken, buildPreviewAuthEndpoint, isSubdomainPreviewUrl } f
|
|
|
29
31
|
* tolerates a failed refresh.
|
|
30
32
|
*/
|
|
31
33
|
export async function ensurePreviewSessionCookie(previewUrl, options = {}) {
|
|
32
|
-
|
|
34
|
+
// The configured backend is the trusted origin when the caller names none.
|
|
35
|
+
const authEndpoint = buildPreviewAuthEndpoint(previewUrl, options.serverUrl || platformConfig().backendUrl || undefined);
|
|
33
36
|
if (!authEndpoint)
|
|
34
37
|
return false;
|
|
35
38
|
const token = await getAuthToken();
|
|
@@ -68,12 +71,17 @@ export async function ensurePreviewSessionCookie(previewUrl, options = {}) {
|
|
|
68
71
|
* - Path proxy (`/v1/p/{sandbox}/{port}/…`): same origin as the API, so the
|
|
69
72
|
* cookie works; mint it and return the URL untouched.
|
|
70
73
|
*
|
|
71
|
-
* Never throws. With no token,
|
|
72
|
-
*
|
|
74
|
+
* Never throws. With no token, for a URL that is not a preview at all, or for
|
|
75
|
+
* a preview-shaped host this deployment does not serve, the input is returned
|
|
76
|
+
* unchanged — the destination then answers for itself, which
|
|
73
77
|
* is more honest than fabricating a URL that cannot work.
|
|
74
78
|
*/
|
|
75
79
|
export async function authorizePreviewUrl(previewUrl, options = {}) {
|
|
76
80
|
if (isSubdomainPreviewUrl(previewUrl)) {
|
|
81
|
+
// The shape alone proves nothing: only an origin this deployment serves
|
|
82
|
+
// may receive the credential. Anything else opens bare.
|
|
83
|
+
if (!(await shouldAttachPreviewToken(previewUrl, options)))
|
|
84
|
+
return previewUrl;
|
|
77
85
|
const token = await getAuthToken();
|
|
78
86
|
return token ? appendPreviewToken(previewUrl, token) : previewUrl;
|
|
79
87
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview-auth.js","sourceRoot":"","sources":["../../../src/core/session/preview-auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"preview-auth.js","sourceRoot":"","sources":["../../../src/core/session/preview-auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,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AAE,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;IACpE,CAAC;IACD,MAAM,0BAA0B,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IACtD,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
* which is why they need no distinction at the call site.
|
|
5
5
|
*/
|
|
6
6
|
export declare function cachedPreviewUrlTemplate(backendUrl: string): string | null;
|
|
7
|
+
/**
|
|
8
|
+
* Every preview template a configured backend has advertised. The credential
|
|
9
|
+
* rule (`preview-origin-trust.ts`) trusts only origins these build.
|
|
10
|
+
*/
|
|
11
|
+
export declare function knownPreviewUrlTemplates(): string[];
|
|
7
12
|
/**
|
|
8
13
|
* Whether this backend has ANSWERED yet — as opposed to "answered null", which
|
|
9
14
|
* is a real answer meaning "this deployment serves no preview domain".
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview-config.d.ts","sourceRoot":"","sources":["../../../src/core/session/preview-config.ts"],"names":[],"mappings":"AAiCA;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAE1E;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED;;;;GAIG;AACH,wBAAsB,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAgCvF;AAED,iFAAiF;AACjF,wBAAgB,uBAAuB,IAAI,IAAI,CAG9C"}
|
|
1
|
+
{"version":3,"file":"preview-config.d.ts","sourceRoot":"","sources":["../../../src/core/session/preview-config.ts"],"names":[],"mappings":"AAiCA;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAE1E;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,EAAE,CAEnD;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED;;;;GAIG;AACH,wBAAsB,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAgCvF;AAED,iFAAiF;AACjF,wBAAgB,uBAAuB,IAAI,IAAI,CAG9C"}
|
|
@@ -33,6 +33,13 @@ function key(backendUrl) {
|
|
|
33
33
|
export function cachedPreviewUrlTemplate(backendUrl) {
|
|
34
34
|
return templates.get(key(backendUrl)) ?? null;
|
|
35
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Every preview template a configured backend has advertised. The credential
|
|
38
|
+
* rule (`preview-origin-trust.ts`) trusts only origins these build.
|
|
39
|
+
*/
|
|
40
|
+
export function knownPreviewUrlTemplates() {
|
|
41
|
+
return [...templates.values()].filter((template) => typeof template === 'string');
|
|
42
|
+
}
|
|
36
43
|
/**
|
|
37
44
|
* Whether this backend has ANSWERED yet — as opposed to "answered null", which
|
|
38
45
|
* is a real answer meaning "this deployment serves no preview domain".
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview-config.js","sourceRoot":"","sources":["../../../src/core/session/preview-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAMhD,MAAM,SAAS,GAAG,IAAI,GAAG,EAAyB,CAAC;AACnD,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAkC,CAAC;AAE3D;;;;GAIG;AACH,SAAS,GAAG,CAAC,UAAkB;IAC7B,IAAI,GAAG,GAAG,UAAU,CAAC,MAAM,CAAC;IAC5B,OAAO,GAAG,GAAG,CAAC,IAAI,UAAU,CAAC,UAAU,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,SAAS;QAAE,GAAG,EAAE,CAAC;IACzE,OAAO,UAAU,CAAC,KAAK,CAAC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AAO,QAAQ,CAAC;QAClB,CAAC;QAAC,MAAM,CAAC;YACP,uEAAuE;YACvE,8DAA8D;YAC9D,OAAO,IAAI,CAAC;QACd,CAAC;gBAAS,CAAC;YACT,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC,CAAC,EAAE,CAAC;IAEL,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAChC,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,uBAAuB;IACrC,SAAS,CAAC,KAAK,EAAE,CAAC;IAClB,QAAQ,CAAC,KAAK,EAAE,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure trust decision for a preview-origin URL.
|
|
3
|
+
*
|
|
4
|
+
* - Deployed form: the URL's origin must be one an advertised template builds.
|
|
5
|
+
* - Local form: `p{port}-{sandbox}.localhost` on the SAME port as a configured
|
|
6
|
+
* local backend — that host resolves to the viewer's own machine, where the
|
|
7
|
+
* local API serves it.
|
|
8
|
+
*/
|
|
9
|
+
export declare function isTrustedPreviewOrigin(candidateUrl: string, input: {
|
|
10
|
+
templates: readonly string[];
|
|
11
|
+
backendUrls: readonly string[];
|
|
12
|
+
}): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Whether `previewUrl` should carry the one-shot `?token`.
|
|
15
|
+
*
|
|
16
|
+
* Asks the configured backend for its preview template first when it has not
|
|
17
|
+
* answered yet. A URL that has the preview shape but no deployment behind it
|
|
18
|
+
* gets no credential; the caller opens it bare and the destination answers for
|
|
19
|
+
* itself.
|
|
20
|
+
*/
|
|
21
|
+
export declare function shouldAttachPreviewToken(previewUrl: string, options?: {
|
|
22
|
+
serverUrl?: string;
|
|
23
|
+
}): Promise<boolean>;
|
|
24
|
+
//# sourceMappingURL=preview-origin-trust.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-origin-trust.d.ts","sourceRoot":"","sources":["../../../src/core/session/preview-origin-trust.ts"],"names":[],"mappings":"AAyDA;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE;IAAE,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GACtE,OAAO,CAiBT;AAED;;;;;;;GAOG;AACH,wBAAsB,wBAAwB,CAC5C,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,GACnC,OAAO,CAAC,OAAO,CAAC,CAQlB"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which preview origins may receive the caller's credential.
|
|
3
|
+
*
|
|
4
|
+
* A preview ORIGIN (`{env}-p{port}-{sandbox}.{domain}`, or the local
|
|
5
|
+
* `p{port}-{sandbox}.localhost:{port}`) cannot see the API's host-only
|
|
6
|
+
* `__preview_session` cookie, so its first request carries the bearer as a
|
|
7
|
+
* one-shot `?token`. That token is a full account credential, so the decision
|
|
8
|
+
* to attach it must rest on the deployment's own answer — the template from
|
|
9
|
+
* `GET /v1/p/config`, or the configured local backend — and never on the shape
|
|
10
|
+
* of the hostname alone. Any host can be named `p3000-something.example`.
|
|
11
|
+
*
|
|
12
|
+
* Internal: not exported from a public entry point.
|
|
13
|
+
*/
|
|
14
|
+
import { platformConfig } from '../http/config.js';
|
|
15
|
+
import { isSubdomainPreviewUrl } from './preview.js';
|
|
16
|
+
import { knownPreviewUrlTemplates, loadPreviewUrlTemplate } from './preview-config.js';
|
|
17
|
+
const LOCAL_PREVIEW_HOST = /^p\d{1,5}-[a-z0-9-]+\.localhost$/;
|
|
18
|
+
function escapeRegExp(value) {
|
|
19
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Whether `origin` (scheme + host + port, no path) is one the template builds.
|
|
23
|
+
* The template's literal text must match exactly; `{port}` matches digits and
|
|
24
|
+
* `{sandbox}` one hostname label.
|
|
25
|
+
*/
|
|
26
|
+
function originMatchesTemplate(origin, template) {
|
|
27
|
+
if (!template.includes('{port}') || !template.includes('{sandbox}'))
|
|
28
|
+
return false;
|
|
29
|
+
const schemeEnd = template.indexOf('://');
|
|
30
|
+
if (schemeEnd <= 0)
|
|
31
|
+
return false;
|
|
32
|
+
const scheme = template.slice(0, schemeEnd).toLowerCase();
|
|
33
|
+
if (scheme !== 'https' && scheme !== 'http')
|
|
34
|
+
return false;
|
|
35
|
+
// Compare origins only: a path or trailing slash in the template is ignored.
|
|
36
|
+
const authority = (template.slice(schemeEnd + 3).split('/')[0] ?? '').toLowerCase();
|
|
37
|
+
const source = `${scheme}://${authority}`
|
|
38
|
+
.split('{port}')
|
|
39
|
+
.map((part) => part.split('{sandbox}').map(escapeRegExp).join('[a-z0-9-]+'))
|
|
40
|
+
.join('\\d{1,5}');
|
|
41
|
+
return new RegExp(`^${source}$`).test(origin);
|
|
42
|
+
}
|
|
43
|
+
function isLocalBackend(backendUrl) {
|
|
44
|
+
try {
|
|
45
|
+
const url = new URL(backendUrl);
|
|
46
|
+
return url.hostname === 'localhost' || url.hostname === '127.0.0.1' ? url : null;
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function effectivePort(url) {
|
|
53
|
+
if (url.port)
|
|
54
|
+
return url.port;
|
|
55
|
+
return url.protocol === 'https:' ? '443' : '80';
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Pure trust decision for a preview-origin URL.
|
|
59
|
+
*
|
|
60
|
+
* - Deployed form: the URL's origin must be one an advertised template builds.
|
|
61
|
+
* - Local form: `p{port}-{sandbox}.localhost` on the SAME port as a configured
|
|
62
|
+
* local backend — that host resolves to the viewer's own machine, where the
|
|
63
|
+
* local API serves it.
|
|
64
|
+
*/
|
|
65
|
+
export function isTrustedPreviewOrigin(candidateUrl, input) {
|
|
66
|
+
let url;
|
|
67
|
+
try {
|
|
68
|
+
url = new URL(candidateUrl);
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
if (url.protocol !== 'https:' && url.protocol !== 'http:')
|
|
74
|
+
return false;
|
|
75
|
+
if (LOCAL_PREVIEW_HOST.test(url.hostname)) {
|
|
76
|
+
return input.backendUrls.some((backendUrl) => {
|
|
77
|
+
const backend = isLocalBackend(backendUrl);
|
|
78
|
+
return backend !== null && effectivePort(backend) === effectivePort(url);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
return input.templates.some((template) => originMatchesTemplate(url.origin, template));
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Whether `previewUrl` should carry the one-shot `?token`.
|
|
85
|
+
*
|
|
86
|
+
* Asks the configured backend for its preview template first when it has not
|
|
87
|
+
* answered yet. A URL that has the preview shape but no deployment behind it
|
|
88
|
+
* gets no credential; the caller opens it bare and the destination answers for
|
|
89
|
+
* itself.
|
|
90
|
+
*/
|
|
91
|
+
export async function shouldAttachPreviewToken(previewUrl, options = {}) {
|
|
92
|
+
if (!isSubdomainPreviewUrl(previewUrl))
|
|
93
|
+
return false;
|
|
94
|
+
const backendUrl = platformConfig().backendUrl;
|
|
95
|
+
if (backendUrl)
|
|
96
|
+
await loadPreviewUrlTemplate(backendUrl).catch(() => null);
|
|
97
|
+
const backendUrls = [backendUrl, options.serverUrl].filter((value) => typeof value === 'string' && value.length > 0);
|
|
98
|
+
return isTrustedPreviewOrigin(previewUrl, { templates: knownPreviewUrlTemplates(), backendUrls });
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=preview-origin-trust.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-origin-trust.js","sourceRoot":"","sources":["../../../src/core/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G,cAAc,CAAC,UAAU,CAAC,CAAC;YAC3C,OAAO,OAAO,KAAK,IAAI,IAAI,aAAa,CAAC,OAAO,CAAC,KAAK,aAAa,CAAC,GAAG,CAAC,CAAC;QAC3E,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,qBAAqB,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzF,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,UAAkB,EAClB,UAAkC,EAAE;IAEpC,IAAI,CAAC,qBAAqB,CAAC,UAAU,CAAC;QAAE,OAAO,KAAK,CAAC;IACrD,MAAM,UAAU,GAAG,cAAc,EAAE,CAAC,UAAU,CAAC;IAC/C,IAAI,UAAU;QAAE,MAAM,sBAAsB,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IAC3E,MAAM,WAAW,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC,MAAM,CACxD,CAAC,KAAK,EAAmB,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAC1E,CAAC;IACF,OAAO,sBAAsB,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,wBAAwB,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC;AACpG,CAAC"}
|
|
@@ -10,13 +10,19 @@
|
|
|
10
10
|
/**
|
|
11
11
|
* Resolve the `POST /…/p/auth` endpoint that sets the `__preview_session`
|
|
12
12
|
* cookie for a given preview URL. Returns null when the URL isn't a trusted
|
|
13
|
-
* preview-proxy URL.
|
|
13
|
+
* preview-proxy URL. Trusted means the origin of `serverUrl` or, in a browser,
|
|
14
|
+
* the page's own origin; with neither known, nothing is trusted.
|
|
14
15
|
*/
|
|
15
16
|
export declare function buildPreviewAuthEndpoint(previewUrl: string, serverUrl?: string): string | null;
|
|
16
17
|
/**
|
|
17
18
|
* Preview ORIGIN form: `p{port}-{sandbox}.{host}` locally, or the deployed
|
|
18
19
|
* `{env}-p{port}-{sandbox}.{domain}`.
|
|
19
20
|
*
|
|
21
|
+
* A SHAPE test only. It says which credential form a preview would need, not
|
|
22
|
+
* whether a host may receive one: any host can carry this shape. The SDK's own
|
|
23
|
+
* token paths (`authorizePreviewUrl`, `useAuthenticatedPreviewUrl`) also require
|
|
24
|
+
* the origin to match the deployment's advertised preview template.
|
|
25
|
+
*
|
|
20
26
|
* These can't use the host-only `/v1/p/` session cookie — it never reaches
|
|
21
27
|
* another hostname — so they authenticate the FIRST request with a one-shot
|
|
22
28
|
* `?token`, which the proxy exchanges for a cookie on the preview origin and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../../src/core/session/preview.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../../src/core/session/preview.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA+CH;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,MAAM,EAClB,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,GAAG,IAAI,CAMf;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAUnE;AAED,+DAA+D;AAC/D,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAQ5E"}
|
|
@@ -41,7 +41,9 @@ function isPreviewProxyUrl(candidateUrl, serverUrl) {
|
|
|
41
41
|
if (typeof window !== 'undefined') {
|
|
42
42
|
trustedOrigins.add(window.location.origin);
|
|
43
43
|
}
|
|
44
|
-
|
|
44
|
+
// No known origin means nothing can be trusted: the bearer is never sent
|
|
45
|
+
// to an origin the caller did not name.
|
|
46
|
+
return trustedOrigins.has(url.origin);
|
|
45
47
|
}
|
|
46
48
|
catch {
|
|
47
49
|
return false;
|
|
@@ -50,7 +52,8 @@ function isPreviewProxyUrl(candidateUrl, serverUrl) {
|
|
|
50
52
|
/**
|
|
51
53
|
* Resolve the `POST /…/p/auth` endpoint that sets the `__preview_session`
|
|
52
54
|
* cookie for a given preview URL. Returns null when the URL isn't a trusted
|
|
53
|
-
* preview-proxy URL.
|
|
55
|
+
* preview-proxy URL. Trusted means the origin of `serverUrl` or, in a browser,
|
|
56
|
+
* the page's own origin; with neither known, nothing is trusted.
|
|
54
57
|
*/
|
|
55
58
|
export function buildPreviewAuthEndpoint(previewUrl, serverUrl) {
|
|
56
59
|
if (!isPreviewProxyUrl(previewUrl, serverUrl))
|
|
@@ -62,6 +65,11 @@ export function buildPreviewAuthEndpoint(previewUrl, serverUrl) {
|
|
|
62
65
|
* Preview ORIGIN form: `p{port}-{sandbox}.{host}` locally, or the deployed
|
|
63
66
|
* `{env}-p{port}-{sandbox}.{domain}`.
|
|
64
67
|
*
|
|
68
|
+
* A SHAPE test only. It says which credential form a preview would need, not
|
|
69
|
+
* whether a host may receive one: any host can carry this shape. The SDK's own
|
|
70
|
+
* token paths (`authorizePreviewUrl`, `useAuthenticatedPreviewUrl`) also require
|
|
71
|
+
* the origin to match the deployment's advertised preview template.
|
|
72
|
+
*
|
|
65
73
|
* These can't use the host-only `/v1/p/` session cookie — it never reaches
|
|
66
74
|
* another hostname — so they authenticate the FIRST request with a one-shot
|
|
67
75
|
* `?token`, which the proxy exchanges for a cookie on the preview origin and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview.js","sourceRoot":"","sources":["../../../src/core/session/preview.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,SAAS,yBAAyB,CAAC,YAAoB;IACrD,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI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,KAAK,CAAC,CAAC;QACnC,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC;IACtB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,UAAU,CAAC;IACpB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Can this session show its saved conversation before its computer wakes?
|
|
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
|
|
6
|
+
* 5-240 s to wake. A host that knows a saved copy is on its way shows the
|
|
7
|
+
* session with placeholder rows for that one round trip. A host that knows
|
|
8
|
+
* there is none shows its boot screen, because nothing can be read until the
|
|
9
|
+
* runtime is up. This decides which of the two is true, from what the session
|
|
10
|
+
* hook already tracks:
|
|
11
|
+
*
|
|
12
|
+
* `loading` — a saved copy may still paint: a read is in flight, or the
|
|
13
|
+
* OpenCode root it is keyed by is still resolving.
|
|
14
|
+
* `shown` — the store holds messages for this session (saved or live).
|
|
15
|
+
* `none` — nothing can paint before the runtime answers: the saved copy
|
|
16
|
+
* is absent or was refused, or no root is known and no
|
|
17
|
+
* control-plane read is left that could supply one.
|
|
18
|
+
*
|
|
19
|
+
* `none` is only ever an answer the server gave. A hook that has not started
|
|
20
|
+
* its reads yet (no signed-in user) says `loading`: an unknown is never
|
|
21
|
+
* rendered as a negative.
|
|
22
|
+
*/
|
|
23
|
+
export type SavedTranscript = 'loading' | 'shown' | 'none';
|
|
24
|
+
export interface SavedTranscriptInput {
|
|
25
|
+
/** The session hook is running its reads (it waits for a signed-in user). */
|
|
26
|
+
enabled: boolean;
|
|
27
|
+
/** The store holds at least one message for this session's root. */
|
|
28
|
+
hasMessages: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* The saved-history read (`GET …/transcript?history=true`), which paints
|
|
31
|
+
* the copy when the project's `session_transcript_history` flag is on.
|
|
32
|
+
* `off` when the flag is off.
|
|
33
|
+
*/
|
|
34
|
+
history: 'off' | 'loading' | 'present' | 'absent';
|
|
35
|
+
/**
|
|
36
|
+
* The mirror paint in `useSessionSync`: `idle` until it can run (no root
|
|
37
|
+
* yet), `loading` while its read is in flight, `painted` once it hydrated,
|
|
38
|
+
* `absent` when the read answered with nothing it may paint.
|
|
39
|
+
*/
|
|
40
|
+
mirror: 'idle' | 'loading' | 'painted' | 'absent';
|
|
41
|
+
/**
|
|
42
|
+
* The OpenCode root the transcript is keyed by: `known`, `pending` while a
|
|
43
|
+
* control-plane read that can supply it is outstanding, or `unknown` when
|
|
44
|
+
* none is left (only the runtime can name it now).
|
|
45
|
+
*/
|
|
46
|
+
root: 'known' | 'pending' | 'unknown';
|
|
47
|
+
}
|
|
48
|
+
export declare function resolveSavedTranscript(input: SavedTranscriptInput): SavedTranscript;
|
|
49
|
+
//# sourceMappingURL=saved-transcript.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"saved-transcript.d.ts","sourceRoot":"","sources":["../../../src/core/session-sync/saved-transcript.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,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;;;;OAIG;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;CACvC;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,oBAAoB,GAAG,eAAe,CASnF"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Can this session show its saved conversation before its computer wakes?
|
|
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
|
|
6
|
+
* 5-240 s to wake. A host that knows a saved copy is on its way shows the
|
|
7
|
+
* session with placeholder rows for that one round trip. A host that knows
|
|
8
|
+
* there is none shows its boot screen, because nothing can be read until the
|
|
9
|
+
* runtime is up. This decides which of the two is true, from what the session
|
|
10
|
+
* hook already tracks:
|
|
11
|
+
*
|
|
12
|
+
* `loading` — a saved copy may still paint: a read is in flight, or the
|
|
13
|
+
* OpenCode root it is keyed by is still resolving.
|
|
14
|
+
* `shown` — the store holds messages for this session (saved or live).
|
|
15
|
+
* `none` — nothing can paint before the runtime answers: the saved copy
|
|
16
|
+
* is absent or was refused, or no root is known and no
|
|
17
|
+
* control-plane read is left that could supply one.
|
|
18
|
+
*
|
|
19
|
+
* `none` is only ever an answer the server gave. A hook that has not started
|
|
20
|
+
* its reads yet (no signed-in user) says `loading`: an unknown is never
|
|
21
|
+
* rendered as a negative.
|
|
22
|
+
*/
|
|
23
|
+
export function resolveSavedTranscript(input) {
|
|
24
|
+
if (input.hasMessages)
|
|
25
|
+
return 'shown';
|
|
26
|
+
if (!input.enabled)
|
|
27
|
+
return 'loading';
|
|
28
|
+
if (input.history === 'absent')
|
|
29
|
+
return 'none';
|
|
30
|
+
if (input.history === 'loading')
|
|
31
|
+
return 'loading';
|
|
32
|
+
if (input.root === 'unknown')
|
|
33
|
+
return 'none';
|
|
34
|
+
if (input.root === 'pending')
|
|
35
|
+
return 'loading';
|
|
36
|
+
if (input.mirror === 'absent')
|
|
37
|
+
return 'none';
|
|
38
|
+
return 'loading';
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=saved-transcript.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"saved-transcript.js","sourceRoot":"","sources":["../../../src/core/session-sync/saved-transcript.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AA6BH,MAAM,UAAU,sBAAsB,CAAC,KAA2B;IAChE,IAAI,KAAK,CAAC,WAAW;QAAE,OAAO,OAAO,CAAC;IACtC,IAAI,CAAC,KAAK,CAAC,OAAO;QAAE,OAAO,SAAS,CAAC;IACrC,IAAI,KAAK,CAAC,OAAO,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC;IAC9C,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAClD,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC;IAC5C,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC/C,IAAI,KAAK,CAAC,MAAM,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC;IAC7C,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -144,8 +144,19 @@ export interface SessionSyncControllerOptions {
|
|
|
144
144
|
* healthy stream the hydrate is a no-op.
|
|
145
145
|
*/
|
|
146
146
|
verifyIntervalMs?: number;
|
|
147
|
+
/**
|
|
148
|
+
* Max time one page read may take before it is abandoned. Default 120s.
|
|
149
|
+
*
|
|
150
|
+
* A read proxied to the sandbox can park forever: a wedged runtime or a
|
|
151
|
+
* stalled proxy hop accepts the request and never answers. Reads are
|
|
152
|
+
* single-flight, so without a bound that one read held the slot and every
|
|
153
|
+
* later repair — turn end, SSE gap, liveness poll — waited on it until the
|
|
154
|
+
* controller was destroyed. On expiry the read's signal is aborted, the slot
|
|
155
|
+
* is released, and the tail read is retried with backoff.
|
|
156
|
+
*/
|
|
157
|
+
readTimeoutMs?: number;
|
|
147
158
|
}
|
|
148
|
-
export interface HttpSessionSyncControllerOptions extends Pick<SessionSyncControllerOptions, 'sessionId' | 'hydrate' | 'markLoaded' | 'setStatus' | 'onTelemetry' | 'scheduler' | 'livenessIntervalMs' | 'verifyIntervalMs'> {
|
|
159
|
+
export interface HttpSessionSyncControllerOptions extends Pick<SessionSyncControllerOptions, 'sessionId' | 'hydrate' | 'markLoaded' | 'setStatus' | 'onTelemetry' | 'scheduler' | 'livenessIntervalMs' | 'verifyIntervalMs' | 'readTimeoutMs'> {
|
|
149
160
|
baseUrl: string;
|
|
150
161
|
getToken?: () => string | null | Promise<string | null>;
|
|
151
162
|
fetch?: SessionSyncFetch;
|
|
@@ -180,6 +191,7 @@ export declare class SessionSyncController {
|
|
|
180
191
|
private readonly scheduler;
|
|
181
192
|
private readonly livenessIntervalMs;
|
|
182
193
|
private readonly verifyIntervalMs;
|
|
194
|
+
private readonly readTimeoutMs;
|
|
183
195
|
/** When the last tail read was ISSUED — see `verifyIntervalMs`. */
|
|
184
196
|
private lastTailReadAt;
|
|
185
197
|
/** Consecutive failed tail reads, for the retry backoff. Reset by success. */
|
|
@@ -234,6 +246,13 @@ export declare class SessionSyncController {
|
|
|
234
246
|
*/
|
|
235
247
|
private scheduleTailRetry;
|
|
236
248
|
private loadPage;
|
|
249
|
+
/**
|
|
250
|
+
* Run one read under its own signal: aborted when the controller is
|
|
251
|
+
* destroyed, and when `readTimeoutMs` elapses. The timeout also rejects the
|
|
252
|
+
* returned promise directly, so a loader that ignores its signal still
|
|
253
|
+
* releases the single-flight slot.
|
|
254
|
+
*/
|
|
255
|
+
private boundedRead;
|
|
237
256
|
private loadCompleteOlderTurn;
|
|
238
257
|
private loadCompleteTurn;
|
|
239
258
|
private rememberUserMessages;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-sync-controller.d.ts","sourceRoot":"","sources":["../../../src/core/session-sync/session-sync-controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"session-sync-controller.d.ts","sourceRoot":"","sources":["../../../src/core/session-sync/session-sync-controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EA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