@agent-native/core 0.201.0 → 0.201.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/a2a/handlers.js +96 -44
- package/dist/a2a/organization-identity.d.ts +9 -0
- package/dist/a2a/organization-identity.js +34 -0
- package/dist/a2a/server.d.ts +13 -7
- package/dist/a2a/server.js +187 -88
- package/dist/a2a/task-store.d.ts +7 -2
- package/dist/a2a/task-store.js +23 -8
- package/dist/a2a-claims.js +12 -2
- package/dist/app-config/mcp.d.ts +4 -0
- package/dist/app-config/mcp.js +7 -0
- package/dist/app-config/schema.d.ts +3 -0
- package/dist/app-config/schema.js +2 -0
- package/dist/automation/index.d.ts +1 -1
- package/dist/client/route-chunk-recovery.js +75 -11
- package/dist/client/route-warmup.d.ts +2 -0
- package/dist/client/route-warmup.js +3 -0
- package/dist/client/vite-dev-recovery-script.js +85 -17
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/deploy/build.js +3 -1
- package/dist/feature-flags/a2a-action-route.js +3 -4
- package/dist/mcp/build-server.d.ts +4 -0
- package/dist/mcp/build-server.js +152 -43
- package/dist/mcp/embed-app.js +5 -5
- package/dist/mcp/server.d.ts +0 -18
- package/dist/mcp/server.js +99 -9
- package/dist/onboarding/app-profile.js +2 -1
- package/dist/onboarding/workspace-services.js +3 -0
- package/dist/org/context.d.ts +13 -0
- package/dist/org/context.js +60 -0
- package/dist/org/handlers.d.ts +1 -1
- package/dist/org/index.d.ts +1 -1
- package/dist/org/membership.d.ts +6 -0
- package/dist/org/membership.js +23 -5
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +7 -7
- package/dist/provider-api/actions/provider-api.d.ts +6 -6
- package/dist/secrets/routes.d.ts +11 -11
- package/dist/server/action-routes.js +12 -5
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/agent-engine-default-model-route.d.ts +1 -1
- package/dist/server/builder-browser.d.ts +4 -2
- package/dist/server/builder-browser.js +147 -9
- package/dist/server/core-routes-plugin.js +13 -6
- package/dist/server/entry-server.js +43 -2
- package/dist/server/sentry.js +9 -1
- package/dist/server/ssr-handler.d.ts +1 -1
- package/dist/server/ssr-handler.js +3 -7
- package/dist/shared/cache-control.d.ts +4 -1
- package/dist/shared/cache-control.js +11 -6
- package/dist/shared/route-chunk-recovery-bootstrap.d.ts +7 -0
- package/dist/shared/route-chunk-recovery-bootstrap.js +38 -0
- package/package.json +5 -3
|
@@ -1,7 +1,6 @@
|
|
|
1
|
+
import { CHUNK_RECOVERY_CACHE_BUSTER_PARAM, CHUNK_RECOVERY_QUERY_PARAM, CHUNK_RECOVERY_QUERY_VALUE, ROUTE_WARMUP_PRELOAD_ATTRIBUTE, STALE_CHUNK_RELOAD_AT_KEY, STALE_CHUNK_RELOAD_COOLDOWN_MS, } from "../shared/route-chunk-recovery-bootstrap.js";
|
|
1
2
|
const INSTALL_KEY = "__agentNativeRouteChunkRecoveryInstalled";
|
|
2
3
|
const INTENDED_NAV_MAX_AGE_MS = 15_000;
|
|
3
|
-
const STALE_CHUNK_RELOAD_AT_KEY = "__agentNativeStaleChunkReloadAt";
|
|
4
|
-
const STALE_CHUNK_RELOAD_COOLDOWN_MS = 10_000;
|
|
5
4
|
const STALE_CHUNK_EXHAUSTED_KEY = "__agentNativeStaleChunkRecoveryExhausted";
|
|
6
5
|
/**
|
|
7
6
|
* Fired on `window` the first time a stale chunk could not be recovered by a
|
|
@@ -91,6 +90,50 @@ function hardNavigate(win, href) {
|
|
|
91
90
|
win.location.href = href;
|
|
92
91
|
}
|
|
93
92
|
}
|
|
93
|
+
function withChunkRecoveryCacheBuster(win, href, now = Date.now()) {
|
|
94
|
+
const url = new URL(href, win.location.href);
|
|
95
|
+
url.searchParams.set(CHUNK_RECOVERY_QUERY_PARAM, CHUNK_RECOVERY_QUERY_VALUE);
|
|
96
|
+
url.searchParams.set(CHUNK_RECOVERY_CACHE_BUSTER_PARAM, `${now.toString(36)}-${Math.random().toString(36).slice(2)}`);
|
|
97
|
+
return url.href;
|
|
98
|
+
}
|
|
99
|
+
function readRecoveryAttemptAt(win) {
|
|
100
|
+
const url = new URL(win.location.href);
|
|
101
|
+
if (url.searchParams.get(CHUNK_RECOVERY_QUERY_PARAM) !==
|
|
102
|
+
CHUNK_RECOVERY_QUERY_VALUE) {
|
|
103
|
+
return 0;
|
|
104
|
+
}
|
|
105
|
+
const timestamp = url.searchParams.get(CHUNK_RECOVERY_CACHE_BUSTER_PARAM)?.split("-", 1)[0] ??
|
|
106
|
+
"";
|
|
107
|
+
if (!/^[0-9a-z]+$/i.test(timestamp))
|
|
108
|
+
return 0;
|
|
109
|
+
const parsed = Number.parseInt(timestamp, 36);
|
|
110
|
+
return Number.isSafeInteger(parsed) && parsed <= Date.now() ? parsed : 0;
|
|
111
|
+
}
|
|
112
|
+
function clearChunkRecoveryCacheBuster(win) {
|
|
113
|
+
const url = new URL(win.location.href);
|
|
114
|
+
if (url.searchParams.get(CHUNK_RECOVERY_QUERY_PARAM) !==
|
|
115
|
+
CHUNK_RECOVERY_QUERY_VALUE) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
// Keep the fixed marker as a cooldown when session storage is unavailable.
|
|
119
|
+
const recoveryStartedAt = readRecoveryAttemptAt(win);
|
|
120
|
+
if (markStaleChunkReload(win, recoveryStartedAt || Date.now()) !== true) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
url.searchParams.delete(CHUNK_RECOVERY_QUERY_PARAM);
|
|
124
|
+
url.searchParams.delete(CHUNK_RECOVERY_CACHE_BUSTER_PARAM);
|
|
125
|
+
win.history.replaceState(win.history.state, "", `${url.pathname}${url.search}${url.hash}`);
|
|
126
|
+
}
|
|
127
|
+
function isModuleAssetLoadFailure(event) {
|
|
128
|
+
const target = event.target;
|
|
129
|
+
const tagName = target?.tagName?.toUpperCase();
|
|
130
|
+
if (tagName === "LINK" && target) {
|
|
131
|
+
if (target.hasAttribute?.(ROUTE_WARMUP_PRELOAD_ATTRIBUTE))
|
|
132
|
+
return false;
|
|
133
|
+
return /(?:^|\s)modulepreload(?:\s|$)/i.test(target.getAttribute?.("rel") ?? target.rel ?? "");
|
|
134
|
+
}
|
|
135
|
+
return tagName === "SCRIPT" && target?.type?.toLowerCase() === "module";
|
|
136
|
+
}
|
|
94
137
|
function isAgentNativeDesktop(win) {
|
|
95
138
|
return /AgentNativeDesktop/i.test(win.navigator?.userAgent || "");
|
|
96
139
|
}
|
|
@@ -121,22 +164,33 @@ function isViteOptimizerFailureMessage(message) {
|
|
|
121
164
|
message.includes("/@fs/"));
|
|
122
165
|
}
|
|
123
166
|
function readStaleChunkReloadAt(win) {
|
|
167
|
+
const mem = win[STALE_CHUNK_RELOAD_AT_KEY];
|
|
168
|
+
const fallback = Math.max(typeof mem === "number" && Number.isFinite(mem) ? mem : 0, readRecoveryAttemptAt(win));
|
|
124
169
|
try {
|
|
125
170
|
const raw = win.sessionStorage?.getItem(STALE_CHUNK_RELOAD_AT_KEY);
|
|
126
171
|
const parsed = raw == null ? NaN : Number(raw);
|
|
127
172
|
if (Number.isFinite(parsed))
|
|
128
|
-
return parsed;
|
|
173
|
+
return Math.max(fallback, parsed);
|
|
129
174
|
}
|
|
130
|
-
catch {
|
|
131
|
-
|
|
132
|
-
|
|
175
|
+
catch {
|
|
176
|
+
return fallback;
|
|
177
|
+
}
|
|
178
|
+
return fallback;
|
|
133
179
|
}
|
|
134
180
|
function markStaleChunkReload(win, now) {
|
|
135
|
-
|
|
181
|
+
const winState = win;
|
|
182
|
+
winState[STALE_CHUNK_RELOAD_AT_KEY] = now;
|
|
136
183
|
try {
|
|
137
|
-
win
|
|
184
|
+
const storage = win
|
|
185
|
+
.sessionStorage;
|
|
186
|
+
if (!storage)
|
|
187
|
+
return "unavailable";
|
|
188
|
+
storage.setItem(STALE_CHUNK_RELOAD_AT_KEY, String(now));
|
|
189
|
+
return true;
|
|
190
|
+
}
|
|
191
|
+
catch {
|
|
192
|
+
return "unavailable";
|
|
138
193
|
}
|
|
139
|
-
catch { }
|
|
140
194
|
}
|
|
141
195
|
/** The recorded exhaustion for this page session, if recovery ever gave up. */
|
|
142
196
|
export function readStaleChunkRecoveryExhausted(win = typeof window === "undefined" ? undefined : window) {
|
|
@@ -172,7 +226,9 @@ export function reloadForStaleChunk(win = typeof window === "undefined" ? undefi
|
|
|
172
226
|
return false;
|
|
173
227
|
}
|
|
174
228
|
markStaleChunkReload(win, now);
|
|
175
|
-
hardNavigate(win, win
|
|
229
|
+
hardNavigate(win, hasViteDevRecovery(win) === true
|
|
230
|
+
? win.location.href
|
|
231
|
+
: withChunkRecoveryCacheBuster(win, win.location.href, now));
|
|
176
232
|
return true;
|
|
177
233
|
}
|
|
178
234
|
export function recoverFromStaleChunkError(error, win = typeof window === "undefined" ? undefined : window) {
|
|
@@ -202,7 +258,9 @@ function recoverToIntendedNavigation(win, state) {
|
|
|
202
258
|
win.history.replaceState(win.history.state, "", recoveryTarget);
|
|
203
259
|
}
|
|
204
260
|
catch { }
|
|
205
|
-
hardNavigate(win,
|
|
261
|
+
hardNavigate(win, hasViteDevRecovery(win) === true
|
|
262
|
+
? recoveryTarget
|
|
263
|
+
: withChunkRecoveryCacheBuster(win, recoveryTarget));
|
|
206
264
|
return true;
|
|
207
265
|
}
|
|
208
266
|
function recoverFromDynamicImportFailure(win, state, message) {
|
|
@@ -275,12 +333,18 @@ export function installRouteChunkRecovery(win = typeof window === "undefined" ?
|
|
|
275
333
|
if (installedTarget[INSTALL_KEY])
|
|
276
334
|
return;
|
|
277
335
|
installedTarget[INSTALL_KEY] = true;
|
|
336
|
+
clearChunkRecoveryCacheBuster(win);
|
|
278
337
|
const state = createRouteChunkRecoveryState();
|
|
279
338
|
win.document.addEventListener("click", (event) => {
|
|
280
339
|
const href = intendedHrefFromClick(win, event);
|
|
281
340
|
if (href)
|
|
282
341
|
rememberIntendedNavigation(state, href);
|
|
283
342
|
}, true);
|
|
343
|
+
win.document.addEventListener("error", (event) => {
|
|
344
|
+
if (isModuleAssetLoadFailure(event) && hasViteDevRecovery(win) !== true) {
|
|
345
|
+
reloadForStaleChunk(win);
|
|
346
|
+
}
|
|
347
|
+
}, true);
|
|
284
348
|
patchHistoryMethod(win, state, "pushState");
|
|
285
349
|
patchHistoryMethod(win, state, "replaceState");
|
|
286
350
|
patchReload(win, state);
|
|
@@ -40,6 +40,7 @@ declare function getManifestRouteTree(manifest: ReactRouterManifest): WarmupRout
|
|
|
40
40
|
export declare function isClientRouteUrl(url: URL): boolean;
|
|
41
41
|
declare function hasWarmableRouteAssets(): boolean;
|
|
42
42
|
declare function routeAssetUrlsForHref(href: string): string[];
|
|
43
|
+
declare function warmRouteAssetsForHref(href: string): void;
|
|
43
44
|
declare function renderWarmupLinksForSelector(selector: string): HTMLAnchorElement[];
|
|
44
45
|
declare function resetRouteWarmupCachesForTests(): void;
|
|
45
46
|
export declare function AgentNativeRouteWarmup({ config, }: AgentNativeRouteWarmupProps): null;
|
|
@@ -54,5 +55,6 @@ export declare const __routeWarmupInternalsForTests: {
|
|
|
54
55
|
renderWarmupLinksForSelector: typeof renderWarmupLinksForSelector;
|
|
55
56
|
routeAssetUrlsForHref: typeof routeAssetUrlsForHref;
|
|
56
57
|
resetRouteWarmupCachesForTests: typeof resetRouteWarmupCachesForTests;
|
|
58
|
+
warmRouteAssetsForHref: typeof warmRouteAssetsForHref;
|
|
57
59
|
};
|
|
58
60
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useEffect } from "react";
|
|
2
2
|
import { matchRoutes } from "react-router";
|
|
3
|
+
import { ROUTE_WARMUP_PRELOAD_ATTRIBUTE } from "../shared/route-chunk-recovery-bootstrap.js";
|
|
3
4
|
import { mergeAgentNativeRouteWarmupConfig, } from "../shared/route-warmup-config.js";
|
|
4
5
|
import { isServerRoutePath } from "./api-path.js";
|
|
5
6
|
const PREFETCH_ATTR = "data-an-prefetch";
|
|
@@ -300,6 +301,7 @@ function warmRouteAssetsForHref(href) {
|
|
|
300
301
|
const link = document.createElement("link");
|
|
301
302
|
link.rel = "modulepreload";
|
|
302
303
|
link.href = assetUrl;
|
|
304
|
+
link.setAttribute(ROUTE_WARMUP_PRELOAD_ATTRIBUTE, "true");
|
|
303
305
|
document.head.appendChild(link);
|
|
304
306
|
}
|
|
305
307
|
}
|
|
@@ -556,4 +558,5 @@ export const __routeWarmupInternalsForTests = {
|
|
|
556
558
|
renderWarmupLinksForSelector,
|
|
557
559
|
routeAssetUrlsForHref,
|
|
558
560
|
resetRouteWarmupCachesForTests,
|
|
561
|
+
warmRouteAssetsForHref,
|
|
559
562
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EMBED_MODE_QUERY_PARAM, EMBED_TOKEN_QUERY_PARAM, } from "../shared/embed-auth.js";
|
|
2
|
+
import { ROUTE_WARMUP_PRELOAD_ATTRIBUTE } from "../shared/route-chunk-recovery-bootstrap.js";
|
|
2
3
|
export function getViteDevRecoveryScript() {
|
|
3
4
|
const embedModeParam = JSON.stringify(EMBED_MODE_QUERY_PARAM);
|
|
4
5
|
const embedTokenParam = JSON.stringify(EMBED_TOKEN_QUERY_PARAM);
|
|
@@ -15,6 +16,8 @@ export function getViteDevRecoveryScript() {
|
|
|
15
16
|
window[INSTALL_KEY] = true;
|
|
16
17
|
|
|
17
18
|
var RELOAD_KEY = "__an_optimize_reload";
|
|
19
|
+
var RELOAD_HISTORY_PARAM = "__an_vite_dev_recovery";
|
|
20
|
+
var routeWarmupAttribute = ${JSON.stringify(ROUTE_WARMUP_PRELOAD_ATTRIBUTE)};
|
|
18
21
|
var MAX_RELOADS = 3;
|
|
19
22
|
var MIN_RELOAD_INTERVAL_MS = 2000;
|
|
20
23
|
var RESET_AFTER_MS = 8000;
|
|
@@ -26,24 +29,70 @@ export function getViteDevRecoveryScript() {
|
|
|
26
29
|
// in a short window, stop and show a manual-refresh message instead of
|
|
27
30
|
// looping forever.
|
|
28
31
|
function readReloadHistory() {
|
|
32
|
+
var cutoff = Date.now() - 30000;
|
|
33
|
+
var history = [];
|
|
29
34
|
try {
|
|
30
35
|
var raw = sessionStorage.getItem(RELOAD_KEY);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
var arr = raw ? JSON.parse(raw) : [];
|
|
37
|
+
if (Array.isArray(arr)) {
|
|
38
|
+
history = arr.filter(function(t) {
|
|
39
|
+
return typeof t === "number" && Number.isFinite(t) && t > cutoff;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
} catch (e) {
|
|
43
|
+
// coercion-ok: blocked or corrupt storage falls back to the URL history marker.
|
|
44
|
+
}
|
|
45
|
+
var params = new URLSearchParams(window.location.search || "");
|
|
46
|
+
var encoded = params.get(RELOAD_HISTORY_PARAM);
|
|
47
|
+
if (encoded) {
|
|
48
|
+
encoded.split(".").forEach(function(value) {
|
|
49
|
+
var timestamp = Number.parseInt(value, 36);
|
|
50
|
+
if (Number.isSafeInteger(timestamp) && timestamp > cutoff) {
|
|
51
|
+
history.push(timestamp);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return history.filter(function(timestamp, index, values) {
|
|
56
|
+
return values.indexOf(timestamp) === index;
|
|
57
|
+
}).sort(function(a, b) { return a - b; });
|
|
36
58
|
}
|
|
37
|
-
function
|
|
59
|
+
function writeReloadHistory(history) {
|
|
60
|
+
var savedInSession = false;
|
|
38
61
|
try {
|
|
39
|
-
var history = readReloadHistory();
|
|
40
|
-
history.push(Date.now());
|
|
41
62
|
sessionStorage.setItem(RELOAD_KEY, JSON.stringify(history));
|
|
42
|
-
|
|
63
|
+
savedInSession = true;
|
|
64
|
+
} catch (e) {
|
|
65
|
+
// coercion-ok: blocked storage falls back to the URL history marker.
|
|
66
|
+
}
|
|
67
|
+
try {
|
|
68
|
+
var url = new URL(window.location.href);
|
|
69
|
+
if (history.length) {
|
|
70
|
+
url.searchParams.set(RELOAD_HISTORY_PARAM, history.map(function(timestamp) {
|
|
71
|
+
return timestamp.toString(36);
|
|
72
|
+
}).join("."));
|
|
73
|
+
} else {
|
|
74
|
+
url.searchParams.delete(RELOAD_HISTORY_PARAM);
|
|
75
|
+
}
|
|
76
|
+
window.history.replaceState(
|
|
77
|
+
window.history.state,
|
|
78
|
+
"",
|
|
79
|
+
url.pathname + url.search + url.hash,
|
|
80
|
+
);
|
|
81
|
+
return true;
|
|
82
|
+
} catch (error) {
|
|
83
|
+
console.warn("[agent-native] Could not persist Vite recovery history.", error);
|
|
84
|
+
return savedInSession;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function recordReload() {
|
|
88
|
+
var history = readReloadHistory();
|
|
89
|
+
history.push(Date.now());
|
|
90
|
+
return writeReloadHistory(history);
|
|
43
91
|
}
|
|
44
92
|
// Reset the counter after a stable period (page didn't fail again).
|
|
45
93
|
setTimeout(function() {
|
|
46
94
|
try { sessionStorage.removeItem(RELOAD_KEY); } catch (e) {}
|
|
95
|
+
writeReloadHistory([]);
|
|
47
96
|
}, RESET_AFTER_MS);
|
|
48
97
|
|
|
49
98
|
function showOverlay(title, subtitle) {
|
|
@@ -85,7 +134,13 @@ export function getViteDevRecoveryScript() {
|
|
|
85
134
|
return;
|
|
86
135
|
}
|
|
87
136
|
console.log("[agent-native] Vite re-bundled deps (" + reason + "), reloading\\u2026");
|
|
88
|
-
recordReload()
|
|
137
|
+
if (!recordReload()) {
|
|
138
|
+
showOverlay(
|
|
139
|
+
"Dev server out of sync",
|
|
140
|
+
"Auto-reload could not track attempts. Refresh the page manually.",
|
|
141
|
+
);
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
89
144
|
// First reload is silent. One refresh almost always fixes it and the
|
|
90
145
|
// overlay flash is more disruptive than the reload itself. Only show
|
|
91
146
|
// the overlay starting on the second attempt, when something is clearly
|
|
@@ -144,18 +199,31 @@ export function getViteDevRecoveryScript() {
|
|
|
144
199
|
|
|
145
200
|
function looksLikeViteDep(url) {
|
|
146
201
|
if (!url) return false;
|
|
147
|
-
//
|
|
148
|
-
//
|
|
202
|
+
// Generic resource errors are ambiguous for app route modules; only Vite's
|
|
203
|
+
// transformed module URLs are safe evidence of an optimizer failure.
|
|
149
204
|
try {
|
|
150
205
|
var u = new URL(url, window.location.href);
|
|
151
206
|
if (u.origin !== window.location.origin) return false;
|
|
152
207
|
} catch (e) { return false; }
|
|
153
208
|
return url.indexOf("/node_modules/.vite/deps/") !== -1
|
|
154
209
|
|| url.indexOf("/@fs/") !== -1
|
|
155
|
-
|| url.indexOf("/@id/") !== -1
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
210
|
+
|| url.indexOf("/@id/") !== -1;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
function looksLikeLocalViteModule(url, target) {
|
|
214
|
+
if (!url || !target) return false;
|
|
215
|
+
var hostname = window.location.hostname;
|
|
216
|
+
var localDevHost = hostname === "localhost"
|
|
217
|
+
|| hostname.endsWith(".localhost")
|
|
218
|
+
|| /^127(?:\\.\\d{1,3}){3}$/.test(hostname)
|
|
219
|
+
|| hostname === "::1"
|
|
220
|
+
|| hostname === "[::1]";
|
|
221
|
+
if (!localDevHost) return false;
|
|
222
|
+
if (url.indexOf(window.location.origin + "/") !== 0) return false;
|
|
223
|
+
if (target.tagName === "SCRIPT") return String(target.type || "").toLowerCase() === "module";
|
|
224
|
+
return target.tagName === "LINK"
|
|
225
|
+
&& !(target.hasAttribute && target.hasAttribute(routeWarmupAttribute))
|
|
226
|
+
&& /(?:^|\\s)modulepreload(?:\\s|$)/i.test(target.rel || "");
|
|
159
227
|
}
|
|
160
228
|
|
|
161
229
|
// 1) <script type="module"> / <link> 504. These fire on the element, not
|
|
@@ -172,7 +240,7 @@ export function getViteDevRecoveryScript() {
|
|
|
172
240
|
var tag = t.tagName;
|
|
173
241
|
if (tag !== "SCRIPT" && tag !== "LINK") return;
|
|
174
242
|
var url = t.src || t.href || "";
|
|
175
|
-
if (looksLikeViteDep(url)) {
|
|
243
|
+
if (looksLikeViteDep(url) || looksLikeLocalViteModule(url, t)) {
|
|
176
244
|
var name = url.split("/").pop();
|
|
177
245
|
scheduleReload("script 504: " + name);
|
|
178
246
|
}
|
|
@@ -38,19 +38,19 @@ export declare const postAwareness: import("h3").EventHandlerWithFetch<import("h
|
|
|
38
38
|
error: string;
|
|
39
39
|
states?: undefined;
|
|
40
40
|
} | {
|
|
41
|
+
error?: undefined;
|
|
41
42
|
states: {
|
|
42
43
|
clientId: number;
|
|
43
44
|
state: string;
|
|
44
45
|
}[];
|
|
45
|
-
error?: undefined;
|
|
46
46
|
}>>;
|
|
47
47
|
export declare const getActiveUsers: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
48
48
|
error: string;
|
|
49
49
|
users?: undefined;
|
|
50
50
|
} | {
|
|
51
|
+
error?: undefined;
|
|
51
52
|
users: {
|
|
52
53
|
clientId: number;
|
|
53
54
|
lastSeen: number;
|
|
54
55
|
}[];
|
|
55
|
-
error?: undefined;
|
|
56
56
|
}>>;
|
package/dist/deploy/build.js
CHANGED
|
@@ -1613,7 +1613,9 @@ function applyDefaultSsrCacheHeader(headers, status, pathname) {
|
|
|
1613
1613
|
headers.set(name, value);
|
|
1614
1614
|
}
|
|
1615
1615
|
const netlifyVary = varyByQuery
|
|
1616
|
-
? SSR_CACHE_KEY_HEADERS["netlify-vary"]
|
|
1616
|
+
? SSR_CACHE_KEY_HEADERS["netlify-vary"]
|
|
1617
|
+
? "query"
|
|
1618
|
+
: undefined
|
|
1617
1619
|
: SSR_CACHE_KEY_HEADERS["netlify-vary"];
|
|
1618
1620
|
if (netlifyVary) headers.set("netlify-vary", netlifyVary);
|
|
1619
1621
|
else headers.delete("netlify-vary");
|
|
@@ -34,9 +34,8 @@ export function createFeatureFlagA2AActionRouteAuth(actionName) {
|
|
|
34
34
|
if (!claims || !claims.scope.includes(FLAG_ACTION_SCOPES[actionName])) {
|
|
35
35
|
throw new Error("Invalid feature flag delegation");
|
|
36
36
|
}
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
if (!localOrg && !isFeatureFlagAdminEmail(claims.email)) {
|
|
37
|
+
const orgId = claims.orgId?.trim() || null;
|
|
38
|
+
if (!orgId && !isFeatureFlagAdminEmail(claims.email)) {
|
|
40
39
|
throw new Error("Invalid feature flag delegation");
|
|
41
40
|
}
|
|
42
41
|
if (actionName === "set-feature-flag" &&
|
|
@@ -45,7 +44,7 @@ export function createFeatureFlagA2AActionRouteAuth(actionName) {
|
|
|
45
44
|
}
|
|
46
45
|
return {
|
|
47
46
|
owner: claims.email,
|
|
48
|
-
orgId
|
|
47
|
+
orgId,
|
|
49
48
|
anonymous: false,
|
|
50
49
|
delegationJti: claims.jti,
|
|
51
50
|
delegationIssuer: claims.issuer,
|
|
@@ -103,6 +103,10 @@ export declare function conciseToolResultText(name: string, result: unknown, opt
|
|
|
103
103
|
export declare function createMCPServerForRequest(config: MCPConfig, identity: MCPCallerIdentity | undefined, requestMeta?: MCPRequestMeta): Promise<import("@modelcontextprotocol/server").Server>;
|
|
104
104
|
export declare function getAccessTokens(): string[];
|
|
105
105
|
export declare function getBearerToken(authHeader: string | undefined): string | undefined;
|
|
106
|
+
export declare class McpIdentityVerificationUnavailableError extends Error {
|
|
107
|
+
readonly cause: unknown;
|
|
108
|
+
constructor(cause: unknown);
|
|
109
|
+
}
|
|
106
110
|
export type VerifyAuthResult = {
|
|
107
111
|
authed: boolean;
|
|
108
112
|
identity?: MCPCallerIdentity;
|