@agent-native/core 0.48.3 → 0.48.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../src/client/ErrorBoundary.tsx"],"names":[],"mappings":"AAsGA,wBAAgB,aAAa,4CAI5B"}
1
+ {"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../src/client/ErrorBoundary.tsx"],"names":[],"mappings":"AAmJA,wBAAgB,aAAa,4CAI5B"}
@@ -1,7 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect } from "react";
2
+ import { useEffect, useState } from "react";
3
3
  import { isRouteErrorResponse, useInRouterContext, useRouteError, } from "react-router";
4
4
  import { appPath } from "./api-path.js";
5
+ import { isDynamicImportFailureMessage, recoverFromStaleChunkError, } from "./route-chunk-recovery.js";
5
6
  const homeLinkClassName = "mt-6 inline-flex items-center gap-1.5 rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow-sm hover:bg-primary/90 cursor-pointer";
6
7
  function useApplyThemeClass() {
7
8
  useEffect(() => {
@@ -23,7 +24,39 @@ function useApplyThemeClass() {
23
24
  catch { }
24
25
  }, []);
25
26
  }
27
+ function errorMessageOf(error) {
28
+ if (error instanceof Error)
29
+ return error.message;
30
+ return typeof error === "string" ? error : "";
31
+ }
32
+ /**
33
+ * When a route renders against a stale lazy chunk after a deploy (the chunk's
34
+ * hashed filename no longer exists), the import rejection surfaces here. Reload
35
+ * once to fetch fresh assets instead of stranding the user on an error screen.
36
+ * The reload is loop-guarded; if it cannot recover, fall back to the screen.
37
+ */
38
+ function useStaleChunkRecovery(error) {
39
+ const [recovering, setRecovering] = useState(() => isDynamicImportFailureMessage(errorMessageOf(error)));
40
+ useEffect(() => {
41
+ if (!isDynamicImportFailureMessage(errorMessageOf(error))) {
42
+ setRecovering(false);
43
+ return;
44
+ }
45
+ if (!recoverFromStaleChunkError(error))
46
+ setRecovering(false);
47
+ }, [error]);
48
+ return recovering;
49
+ }
50
+ function UpdatingScreen() {
51
+ return (_jsx("main", { className: "flex items-center justify-center min-h-screen p-4 bg-background text-foreground", children: _jsx("p", { className: "text-muted-foreground text-sm", children: "Loading the latest version\u2026" }) }));
52
+ }
26
53
  function ErrorScreen({ error }) {
54
+ const recovering = useStaleChunkRecovery(error);
55
+ // While auto-recovering a stale chunk, show a neutral state and skip the
56
+ // console.error below so the transient, self-healing failure does not get
57
+ // reported as a hard error.
58
+ if (recovering)
59
+ return _jsx(UpdatingScreen, {});
27
60
  let status = null;
28
61
  let title = "Something went wrong";
29
62
  let details = "An unexpected error occurred.";
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorBoundary.js","sourceRoot":"","sources":["../../src/client/ErrorBoundary.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,GACd,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,MAAM,iBAAiB,GACrB,gKAAgK,CAAC;AAEnK,SAAS,kBAAkB;IACzB,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,IAAI,GAAG,QAAQ,CAAC,eAAe,CAAC;QACtC,IAAI,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC;YACrE,OAAO;QACT,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YAC7C,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;gBACtB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YAC7B,CAAC;iBAAM,IAAI,MAAM,KAAK,OAAO,EAAE,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SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,EAAE,CAAC;QAC9C,OAAO,GAAG,KAAK,CAAC;IAClB,CAAC;IAED,mEAAmE;IACnE,8DAA8D;IAC9D,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,KAAK,EAAE,CAAC;QAC5C,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;IAED,OAAO,CACL,eAAM,SAAS,EAAC,iFAAiF,YAC/F,eAAK,SAAS,EAAC,iDAAiD,aAC7D,MAAM,IAAI,CACT,eAAM,SAAS,EAAC,4DAA4D,YACzE,MAAM,GACF,CACR,EACD,aAAI,SAAS,EAAC,6BAA6B,YAAE,KAAK,GAAM,EACxD,YAAG,SAAS,EAAC,oCAAoC,YAAE,OAAO,GAAK,EAC/D,YAAG,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,SAAS,EAAE,iBAAiB,wBAE/C,EACJ,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,EACvC,SAAS,EAAC,4KAA4K,uBAG/K,EACR,KAAK,IAAI,CACR,cAAK,SAAS,EAAC,kEAAkE,YAC/E,yBAAO,KAAK,GAAQ,GAChB,CACP,IACG,GACD,CACR,CAAC;AACJ,CAAC;AAED,SAAS,iBAAiB;IACxB,OAAO,KAAC,WAAW,IAAC,KAAK,EAAE,aAAa,EAAE,GAAI,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,kBAAkB,EAAE,CAAC;IACrB,IAAI,CAAC,kBAAkB,EAAE;QAAE,OAAO,KAAC,WAAW,IAAC,KAAK,EAAE,SAAS,GAAI,CAAC;IACpE,OAAO,KAAC,iBAAiB,KAAG,CAAC;AAC/B,CAAC","sourcesContent":["import { useEffect } from \"react\";\nimport {\n isRouteErrorResponse,\n useInRouterContext,\n useRouteError,\n} from \"react-router\";\nimport { appPath } from \"./api-path.js\";\n\nconst homeLinkClassName =\n \"mt-6 inline-flex items-center gap-1.5 rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow-sm hover:bg-primary/90 cursor-pointer\";\n\nfunction useApplyThemeClass() {\n useEffect(() => {\n const root = document.documentElement;\n if (root.classList.contains(\"dark\") || root.classList.contains(\"light\"))\n return;\n try {\n const stored = localStorage.getItem(\"theme\");\n if (stored === \"dark\") {\n root.classList.add(\"dark\");\n } else if (stored === \"light\") {\n root.classList.add(\"light\");\n } else if (window.matchMedia(\"(prefers-color-scheme: dark)\").matches) {\n root.classList.add(\"dark\");\n }\n } catch {}\n }, []);\n}\n\nfunction ErrorScreen({ error }: { error: unknown }) {\n let status: number | null = null;\n let title = \"Something went wrong\";\n let details = \"An unexpected error occurred.\";\n let stack: string | undefined;\n\n if (isRouteErrorResponse(error)) {\n status = error.status;\n if (error.status === 404) {\n title = \"Page not found\";\n details = \"We couldn't find this page.\";\n } else {\n title = `${error.status} Error`;\n details = error.statusText || details;\n }\n } else if (error instanceof Error) {\n // Always surface the underlying error message — a generic\n // \"An unexpected error occurred.\" in production tells users (and us)\n // nothing. The stack trace is still gated to dev so we don't leak\n // internals to end users.\n if (error.message) {\n details = error.message;\n }\n if (\n typeof process !== \"undefined\" &&\n process.env.NODE_ENV !== \"production\"\n ) {\n stack = error.stack;\n }\n } else if (typeof error === \"string\" && error) {\n details = error;\n }\n\n // Log to the console so the underlying failure is recoverable from\n // browser devtools / Sentry even when the UI hides the stack.\n if (typeof console !== \"undefined\" && error) {\n console.error(\"[ErrorBoundary]\", error);\n }\n\n return (\n <main className=\"flex items-center justify-center min-h-screen p-4 bg-background text-foreground\">\n <div className=\"flex flex-col items-center text-center max-w-md\">\n {status && (\n <span className=\"text-7xl font-bold tracking-tight text-muted-foreground/40\">\n {status}\n </span>\n )}\n <h1 className=\"mt-3 text-2xl font-semibold\">{title}</h1>\n <p className=\"mt-2 text-muted-foreground text-sm\">{details}</p>\n <a href={appPath(\"/\")} className={homeLinkClassName}>\n Go home\n </a>\n <button\n type=\"button\"\n onClick={() => window.location.reload()}\n className=\"mt-3 inline-flex cursor-pointer items-center gap-1.5 rounded-md border border-border bg-background px-4 py-2 text-sm font-medium text-foreground shadow-sm hover:bg-accent\"\n >\n Reload\n </button>\n {stack && (\n <pre className=\"mt-6 w-full text-left text-xs overflow-auto p-4 bg-muted rounded\">\n <code>{stack}</code>\n </pre>\n )}\n </div>\n </main>\n );\n}\n\nfunction RoutedErrorScreen() {\n return <ErrorScreen error={useRouteError()} />;\n}\n\nexport function ErrorBoundary() {\n useApplyThemeClass();\n if (!useInRouterContext()) return <ErrorScreen error={undefined} />;\n return <RoutedErrorScreen />;\n}\n"]}
1
+ {"version":3,"file":"ErrorBoundary.js","sourceRoot":"","sources":["../../src/client/ErrorBoundary.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,GACd,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,GAC3B,MAAM,2BAA2B,CAAC;AAEnC,MAAM,iBAAiB,GACrB,gKAAgK,CAAC;AAEnK,SAAS,kBAAkB;IACzB,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,IAAI,GAAG,QAAQ,CAAC,eAAe,CAAC;QACtC,IAAI,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC;YACrE,OAAO;QACT,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YAC7C,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;gBACtB,IAAI,CAAC,SAAS,CAAC,GAAG,C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,WAAW,IAAI,KAAK,EAAE,CAAC;QAC5C,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;IAED,OAAO,CACL,eAAM,SAAS,EAAC,iFAAiF,YAC/F,eAAK,SAAS,EAAC,iDAAiD,aAC7D,MAAM,IAAI,CACT,eAAM,SAAS,EAAC,4DAA4D,YACzE,MAAM,GACF,CACR,EACD,aAAI,SAAS,EAAC,6BAA6B,YAAE,KAAK,GAAM,EACxD,YAAG,SAAS,EAAC,oCAAoC,YAAE,OAAO,GAAK,EAC/D,YAAG,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,SAAS,EAAE,iBAAiB,wBAE/C,EACJ,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,EACvC,SAAS,EAAC,4KAA4K,uBAG/K,EACR,KAAK,IAAI,CACR,cAAK,SAAS,EAAC,kEAAkE,YAC/E,yBAAO,KAAK,GAAQ,GAChB,CACP,IACG,GACD,CACR,CAAC;AACJ,CAAC;AAED,SAAS,iBAAiB;IACxB,OAAO,KAAC,WAAW,IAAC,KAAK,EAAE,aAAa,EAAE,GAAI,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,kBAAkB,EAAE,CAAC;IACrB,IAAI,CAAC,kBAAkB,EAAE;QAAE,OAAO,KAAC,WAAW,IAAC,KAAK,EAAE,SAAS,GAAI,CAAC;IACpE,OAAO,KAAC,iBAAiB,KAAG,CAAC;AAC/B,CAAC","sourcesContent":["import { useEffect, useState } from \"react\";\nimport {\n isRouteErrorResponse,\n useInRouterContext,\n useRouteError,\n} from \"react-router\";\nimport { appPath } from \"./api-path.js\";\nimport {\n isDynamicImportFailureMessage,\n recoverFromStaleChunkError,\n} from \"./route-chunk-recovery.js\";\n\nconst homeLinkClassName =\n \"mt-6 inline-flex items-center gap-1.5 rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow-sm hover:bg-primary/90 cursor-pointer\";\n\nfunction useApplyThemeClass() {\n useEffect(() => {\n const root = document.documentElement;\n if (root.classList.contains(\"dark\") || root.classList.contains(\"light\"))\n return;\n try {\n const stored = localStorage.getItem(\"theme\");\n if (stored === \"dark\") {\n root.classList.add(\"dark\");\n } else if (stored === \"light\") {\n root.classList.add(\"light\");\n } else if (window.matchMedia(\"(prefers-color-scheme: dark)\").matches) {\n root.classList.add(\"dark\");\n }\n } catch {}\n }, []);\n}\n\nfunction errorMessageOf(error: unknown): string {\n if (error instanceof Error) return error.message;\n return typeof error === \"string\" ? error : \"\";\n}\n\n/**\n * When a route renders against a stale lazy chunk after a deploy (the chunk's\n * hashed filename no longer exists), the import rejection surfaces here. Reload\n * once to fetch fresh assets instead of stranding the user on an error screen.\n * The reload is loop-guarded; if it cannot recover, fall back to the screen.\n */\nfunction useStaleChunkRecovery(error: unknown): boolean {\n const [recovering, setRecovering] = useState(() =>\n isDynamicImportFailureMessage(errorMessageOf(error)),\n );\n useEffect(() => {\n if (!isDynamicImportFailureMessage(errorMessageOf(error))) {\n setRecovering(false);\n return;\n }\n if (!recoverFromStaleChunkError(error)) setRecovering(false);\n }, [error]);\n return recovering;\n}\n\nfunction UpdatingScreen() {\n return (\n <main className=\"flex items-center justify-center min-h-screen p-4 bg-background text-foreground\">\n <p className=\"text-muted-foreground text-sm\">\n Loading the latest version…\n </p>\n </main>\n );\n}\n\nfunction ErrorScreen({ error }: { error: unknown }) {\n const recovering = useStaleChunkRecovery(error);\n // While auto-recovering a stale chunk, show a neutral state and skip the\n // console.error below so the transient, self-healing failure does not get\n // reported as a hard error.\n if (recovering) return <UpdatingScreen />;\n\n let status: number | null = null;\n let title = \"Something went wrong\";\n let details = \"An unexpected error occurred.\";\n let stack: string | undefined;\n\n if (isRouteErrorResponse(error)) {\n status = error.status;\n if (error.status === 404) {\n title = \"Page not found\";\n details = \"We couldn't find this page.\";\n } else {\n title = `${error.status} Error`;\n details = error.statusText || details;\n }\n } else if (error instanceof Error) {\n // Always surface the underlying error message — a generic\n // \"An unexpected error occurred.\" in production tells users (and us)\n // nothing. The stack trace is still gated to dev so we don't leak\n // internals to end users.\n if (error.message) {\n details = error.message;\n }\n if (\n typeof process !== \"undefined\" &&\n process.env.NODE_ENV !== \"production\"\n ) {\n stack = error.stack;\n }\n } else if (typeof error === \"string\" && error) {\n details = error;\n }\n\n // Log to the console so the underlying failure is recoverable from\n // browser devtools / Sentry even when the UI hides the stack.\n if (typeof console !== \"undefined\" && error) {\n console.error(\"[ErrorBoundary]\", error);\n }\n\n return (\n <main className=\"flex items-center justify-center min-h-screen p-4 bg-background text-foreground\">\n <div className=\"flex flex-col items-center text-center max-w-md\">\n {status && (\n <span className=\"text-7xl font-bold tracking-tight text-muted-foreground/40\">\n {status}\n </span>\n )}\n <h1 className=\"mt-3 text-2xl font-semibold\">{title}</h1>\n <p className=\"mt-2 text-muted-foreground text-sm\">{details}</p>\n <a href={appPath(\"/\")} className={homeLinkClassName}>\n Go home\n </a>\n <button\n type=\"button\"\n onClick={() => window.location.reload()}\n className=\"mt-3 inline-flex cursor-pointer items-center gap-1.5 rounded-md border border-border bg-background px-4 py-2 text-sm font-medium text-foreground shadow-sm hover:bg-accent\"\n >\n Reload\n </button>\n {stack && (\n <pre className=\"mt-6 w-full text-left text-xs overflow-auto p-4 bg-muted rounded\">\n <code>{stack}</code>\n </pre>\n )}\n </div>\n </main>\n );\n}\n\nfunction RoutedErrorScreen() {\n return <ErrorScreen error={useRouteError()} />;\n}\n\nexport function ErrorBoundary() {\n useApplyThemeClass();\n if (!useInRouterContext()) return <ErrorScreen error={undefined} />;\n return <RoutedErrorScreen />;\n}\n"]}
@@ -63,7 +63,7 @@ export { StarfieldBackground, type StarfieldBackgroundProps, } from "./Starfield
63
63
  export { FeedbackButton, type FeedbackButtonProps } from "./FeedbackButton.js";
64
64
  export { DevDatabaseLink, type DevDatabaseLinkProps, } from "./db-admin/DevDatabaseLink.js";
65
65
  export { ErrorBoundary } from "./ErrorBoundary.js";
66
- export { installRouteChunkRecovery } from "./route-chunk-recovery.js";
66
+ export { installRouteChunkRecovery, reloadForStaleChunk, recoverFromStaleChunkError, } from "./route-chunk-recovery.js";
67
67
  export { ClientOnly } from "./ClientOnly.js";
68
68
  export { DefaultSpinner } from "./DefaultSpinner.js";
69
69
  export { getThemeInitScript, themeInitScript, type ThemePreference, } from "./theme.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,qBAAqB,EACrB,+BAA+B,EAC/B,qBAAqB,EACrB,oCAAoC,EACpC,oBAAoB,EACpB,uBAAuB,EACvB,0BAA0B,EAC1B,eAAe,EACf,uBAAuB,EACvB,qBAAqB,EACrB,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,+BAA+B,EACpC,KAAK,6BAA6B,EAClC,KAAK,0BAA0B,EAC/B,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,GACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,qBAAqB,EACrB,KAAK,mBAAmB,EACxB,KAAK,4BAA4B,GAClC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EACL,mBAAmB,EACnB,KAAK,yBAAyB,GAC/B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EACL,eAAe,EACf,UAAU,EACV,WAAW,EACX,OAAO,GACR,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,GAChC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,kBAAkB,EAClB,0BAA0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KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,aAAa,GACnB,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,qBAAqB,EACrB,+BAA+B,EAC/B,qBAAqB,EACrB,oCAAoC,EACpC,oBAAoB,EACpB,uBAAuB,EACvB,0BAA0B,EAC1B,eAAe,EACf,uBAAuB,EACvB,qBAAqB,EACrB,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,+BAA+B,EACpC,KAAK,6BAA6B,EAClC,KAAK,0BAA0B,EAC/B,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,GACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,qBAAqB,EACrB,KAAK,mBAAmB,EACxB,KAAK,4BAA4B,GAClC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EACL,mBAAmB,EACnB,KAAK,yBAAyB,GAC/B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EACL,eAAe,EACf,UAAU,EACV,WAAW,EACX,OAAO,GACR,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,GAChC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,kBAAkB,EAClB,0BAA0B,EAC1B,KAAK,kBAAkB,EACvB,KAAK,iCAAiC,EACtC,KAAK,yBAAyB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nB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,aAAa,GACnB,MAAM,mBAAmB,CAAC"}
@@ -83,7 +83,7 @@ export { StarfieldBackground, } from "./StarfieldBackground.js";
83
83
  export { FeedbackButton } from "./FeedbackButton.js";
84
84
  export { DevDatabaseLink, } from "./db-admin/DevDatabaseLink.js";
85
85
  export { ErrorBoundary } from "./ErrorBoundary.js";
86
- export { installRouteChunkRecovery } from "./route-chunk-recovery.js";
86
+ export { installRouteChunkRecovery, reloadForStaleChunk, recoverFromStaleChunkError, } from "./route-chunk-recovery.js";
87
87
  export { ClientOnly } from "./ClientOnly.js";
88
88
  export { DefaultSpinner } from "./DefaultSpinner.js";
89
89
  export { getThemeInitScript, themeInitScript, } from "./theme.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AAEvE,yBAAyB,EAAE,CAAC;AAC5B,6BAA6B,EAAE,CAAC;AAEhC,OAAO,EACL,qBAAqB,EACrB,+BAA+B,EAC/B,qBAAqB,EACrB,oCAAoC,EACpC,oBAAoB,EACpB,uBAAuB,EACvB,0BAA0B,EAC1B,eAAe,EACf,uBAAuB,EACvB,qBAAqB,EACrB,aAAa,GAQd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,qBAAqB,GAGtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EACL,mBAAmB,GAEpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,mBAAmB,C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BAA8B,GAgB/B,MAAM,mBAAmB,CAAC","sourcesContent":["import { installRouteChunkRecovery } from \"./route-chunk-recovery.js\";\nimport { stripAuthRedirectParamFromUrl } from \"./auth-redirect-url.js\";\n\ninstallRouteChunkRecovery();\nstripAuthRedirectParamFromUrl();\n\nexport {\n addContextToAgentChat,\n appendAgentChatContextToMessage,\n clearAgentChatContext,\n formatAgentChatContextItemsForPrompt,\n listAgentChatContext,\n refreshAgentChatContext,\n removeAgentChatContextItem,\n sendToAgentChat,\n setAgentChatContextItem,\n setContextToAgentChat,\n generateTabId,\n type AgentChatContextItem,\n type AgentChatContextMessage,\n type AgentChatContextMutationOptions,\n type AgentChatContextRemoveOptions,\n type AgentChatContextSetOptions,\n type AgentChatContextState,\n type AgentChatMessage,\n} from \"./agent-chat.js\";\nexport {\n saveAgentEngineApiKey,\n type AgentEngineProvider,\n type SaveAgentEngineApiKeyOptions,\n} from \"./agent-engine-key.js\";\nexport { useAgentChatGenerating } from \"./use-agent-chat.js\";\nexport {\n useAgentChatContext,\n type UseAgentChatContextResult,\n} from \"./use-agent-chat-context.js\";\nexport { useCodeMode, useDevMode } from \"./use-dev-mode.js\";\nexport {\n agentNativePath,\n appApiPath,\n appBasePath,\n appPath,\n} from \"./api-path.js\";\nexport {\n deleteClientAppState,\n readClientAppState,\n setClientAppState,\n writeClientAppState,\n type ClientAppStateReadOptions,\n type ClientAppStateWriteOptions,\n} from \"./application-state.js\";\nexport {\n useAgentRouteState,\n useSemanticNavigationState,\n type AgentRouteLocation,\n type SemanticNavigationCommandEnvelope,\n type UseAgentRouteStateOptions,\n type UseAgentRouteStateResult,\n type UseSemanticNavigationStateOptions,\n type UseSemanticNavigationStateResult,\n} from \"./route-state.js\";\nexport {\n ensureEmbedAuthFetchInterceptor,\n getEmbedAuthToken,\n isEmbedAuthActive,\n isEmbedMcpChatBridgeActive,\n} from \"./embed-auth.js\";\nexport {\n codeAgentTranscriptEventsToContent,\n createCodeAgentChatAdapter,\n type CodeAgentChatController,\n type CodeAgentChatControlResult,\n type CodeAgentChatFollowUpMode,\n type CodeAgentChatTranscriptEvent,\n type CreateCodeAgentChatAdapterOptions,\n} from \"./code-agent-chat-adapter.js\";\nexport {\n buildRepositoryFromCodeAgentTranscript,\n type BuildRepositoryFromCodeAgentTranscriptOptions,\n type CodeAgentThreadTranscriptEvent,\n} from \"../agent/thread-data-builder.js\";\nexport {\n compareCodeAgentTranscriptEvents,\n getCodeAgentTranscriptSeq,\n isCodeAgentRunActive,\n mergeCodeAgentTranscriptEvents,\n type CodeAgentRunStateLike,\n type CodeAgentTranscriptOrderEvent,\n} from \"../code-agents/transcript-order.js\";\nexport { useSendToAgentChat } from \"./use-send-to-agent-chat.js\";\nexport {\n useChatModels,\n type UseChatModelsResult,\n type EngineModelGroup,\n} from \"./use-chat-models.js\";\nexport {\n CodeRequiredDialog,\n type CodeRequiredDialogProps,\n} from \"./components/CodeRequiredDialog.js\";\nexport {\n AgentConversation,\n AgentConversationMessageView,\n normalizeCodeAgentTranscriptForConversation,\n useNearBottomAutoscroll,\n type CodeAgentConversationTranscriptEvent,\n type CodeAgentConversationTranscriptEventType,\n type NormalizeCodeAgentTranscriptOptions,\n type AgentConversationArtifact,\n type AgentConversationAttachment,\n type AgentConversationMessage,\n type AgentConversationMessagePart,\n type AgentConversationMessageRole,\n type AgentConversationNotice,\n type AgentConversationNoticeTone,\n type AgentConversationToolCall,\n type AgentConversationToolState,\n} from \"./conversation/index.js\";\nexport { McpAppRenderer } from \"./mcp-apps/McpAppRenderer.js\";\nexport {\n AGENT_NATIVE_MCP_APP_HOST_MESSAGE_TYPES,\n getMcpAppHostContext,\n openMcpAppHostLink,\n requestMcpAppDisplayMode,\n sendMcpAppHostMessage,\n updateMcpAppModelContext,\n useMcpAppHostContext,\n type AgentNativeMcpAppHostMessageType,\n type McpAppDisplayMode,\n type McpAppHostChatMessage,\n type McpAppHostCapabilities,\n type McpAppHostContext,\n type McpAppHostContextSnapshot,\n type McpAppModelContextContentPart,\n type McpAppModelContextUpdate,\n} from \"./mcp-app-host.js\";\nexport {\n CodeAgentIndicator,\n type CodeAgentIndicatorProps,\n} from \"./components/CodeAgentIndicator.js\";\nexport {\n useDbSync,\n useFileWatcher,\n useScreenRefreshKey,\n} from \"./use-db-sync.js\";\nexport {\n useChangeVersion,\n useChangeVersions,\n getChangeVersion,\n bumpChangeVersion,\n} from \"./use-change-version.js\";\nexport { useReconciledState } from \"./use-external-value.js\";\nexport {\n buildDynamicAgentSuggestions,\n dedupeSuggestions,\n mergeAgentSuggestions,\n normalizeAgentDynamicSuggestionsConfig,\n useAgentDynamicSuggestions,\n type AgentDynamicSuggestionContext,\n type AgentDynamicSuggestionsConfig,\n type AgentDynamicSuggestionsOption,\n} from \"./dynamic-suggestions.js\";\nexport { cn } from \"./utils.js\";\nexport {\n // Shared editor core (Phase 1): the ONE configurable surface both the plan\n // and content editors build on.\n SharedRichEditor,\n createSharedEditorExtensions,\n MARKDOWN_DIALECT_CONFIG,\n useCollabReconcile,\n RICH_MARKDOWN_PROGRAMMATIC_TRANSACTION,\n getEditorMarkdown,\n SlashCommandMenu,\n DEFAULT_SLASH_COMMANDS,\n createImageSlashCommand,\n // Shared block-level image node + injectable upload contract. Plans opt in\n // via `features.image` + `onImageUpload`; Content keeps its own image block.\n SharedImage,\n createImageExtension,\n pickAndInsertImage,\n uploadEditorImage,\n BubbleToolbar,\n buildDefaultBubbleItems,\n // Back-compat alias + factory kept for existing embedders and specs.\n RichMarkdownEditor,\n createRichMarkdownExtensions,\n // Single-doc plan editor primitives: the GFM↔ProseMirror serializer, the\n // run-id prose attribute, and the shared drag-handle (block grip + reorder).\n RunId,\n RUN_ID_NODE_TYPES,\n gfmToProseJSON,\n proseJSONToGfm,\n DragHandle,\n DEFAULT_DRAG_HANDLE_WRAPPER_SELECTOR,\n // Generic registry-block Tiptap NodeView + side-map provider + dedupe plugin.\n // Hosts mount the node from `createRegistryBlockNode` as an extra extension\n // and wrap the editor in `RegistryBlockDataProvider`.\n createRegistryBlockNode,\n RegistryBlockNodeView,\n RegistryBlockDataProvider,\n useRegistryBlockData,\n // Shared registry-derived block slash-command builder (plan + content adapt it).\n buildRegistryBlockSlashItems,\n getRegistryBlockSlashDescription,\n getRegistryBlockSlashSearchText,\n type BuildRegistryBlockSlashItemsOptions,\n type DragHandleDropContext,\n type DragHandleDropPlacement,\n type DragHandleOptions,\n type CreateRegistryBlockNodeOptions,\n type RegistryBlockDataValue,\n type RegistryBlockSideMapBlock,\n type SharedRichEditorProps,\n type SharedEditorCollab,\n type SharedEditorFeatures,\n type CreateSharedEditorExtensionsOptions,\n type UseCollabReconcileOptions,\n type UseCollabReconcileResult,\n type SlashCommandItem,\n type SlashCommandMenuProps,\n type ImageUploadFn,\n type SharedImageOptions,\n type BubbleToolbarItem,\n type BubbleToolbarProps,\n type RichMarkdownDialect,\n type RichMarkdownEditorPreset,\n type RichMarkdownEditorProps,\n type RichMarkdownCollabUser,\n type CreateRichMarkdownExtensionsOptions,\n} from \"./rich-markdown-editor/index.js\";\n// ProseMirror node JSON shape — re-exported so the plan template (which has no\n// direct @tiptap dep) can type its doc↔blocks serializer.\nexport type { JSONContent } from \"@tiptap/core\";\nexport { ApiKeySettings } from \"./components/ApiKeySettings.js\";\nexport { useSession, type AuthSession } from \"./use-session.js\";\nexport {\n RequireSession,\n buildSignInReturnHref,\n type RequireSessionProps,\n} from \"./require-session.js\";\nexport {\n sendToFrame,\n onFrameMessage,\n requestUserInfo,\n getFrameOrigin,\n getFramePostMessageTargetOrigin,\n getCallbackOrigin,\n oauthRedirectUri,\n isInFrame,\n enterStyleEditing,\n enterTextEditing,\n exitSelectionMode,\n type UserInfo,\n} from \"./frame.js\";\nexport {\n getBuilderParentOrigin,\n isInBuilderFrame,\n sendToBuilderChat,\n type BuilderChatMessage,\n} from \"./builder-frame.js\";\nexport {\n AgentNative,\n useAgentNativeScreenContext,\n type AgentNativeCommandCallback,\n type AgentNativeCommandCallbackInfo,\n type AgentNativeProps,\n} from \"./AgentNative.js\";\nexport {\n AgentNativeEmbedded,\n useAgentNativeEmbeddedBrowserSession,\n type AgentNativeEmbeddedBrowserSessionOptions,\n type AgentNativeEmbeddedCommandCallback,\n type AgentNativeEmbeddedCommandCallbackInfo,\n type AgentNativeEmbeddedProps,\n type UseAgentNativeEmbeddedBrowserSessionOptions,\n} from \"./AgentNativeEmbedded.js\";\nexport {\n defineClientAction,\n type AgentNativeClientActionDefinition,\n type AgentNativeClientActionRunner,\n} from \"./client-action.js\";\nexport {\n AgentNativeFrame,\n type AgentNativeFrameProps,\n} from \"./AgentNativeFrame.js\";\nexport {\n AgentNativeRouteWarmup,\n type AgentNativeRouteWarmupProps,\n} from \"./route-warmup.js\";\nexport {\n AgentNativeExtensionFrame,\n AgentNativeExtensionSlot,\n type AgentNativeExtensionFrameProps,\n type AgentNativeExtensionPermissionList,\n type AgentNativeExtensionSlotProps,\n type AgentNativeExtensionStorageScopeList,\n} from \"./extensions/AgentNativeExtensionFrame.js\";\nexport {\n AGENT_NATIVE_EXTENSION_MESSAGE_TYPES,\n buildAgentNativeExtensionHtml,\n createHttpAgentNativeExtensionStorage,\n createLocalStorageAgentNativeExtensionStorage,\n getAgentNativeExtensionManifest,\n isAgentNativeExtensionAllowedInSlot,\n normalizeAgentNativeExtensionSandbox,\n type AgentNativeExtensionDefinition,\n type AgentNativeExtensionManifest,\n type AgentNativeExtensionMessageType,\n type AgentNativeExtensionStorage,\n type AgentNativeExtensionStorageContext,\n type AgentNativeExtensionStorageOptions,\n type AgentNativeExtensionStorageRow,\n type AgentNativeExtensionStorageScope,\n type BuildAgentNativeExtensionHtmlOptions,\n type CreateHttpAgentNativeExtensionStorageOptions,\n} from \"./extensions/portable-extension.js\";\nexport {\n AGENT_NATIVE_HOST_BRIDGE_VERSION,\n AGENT_NATIVE_HOST_MESSAGE_TYPES,\n announceAgentNativeFrameReady,\n createAgentNativeHostBridge,\n defaultAgentNativeHostCommands,\n onAgentNativeHostInit,\n readAgentNativeScreenContext,\n requestAgentNativeHostActions,\n requestAgentNativeHostContext,\n runAgentNativeHostAction,\n sendAgentNativeHostCommand,\n type AgentNativeActionAvailability,\n type AgentNativeActionManifestEntry,\n type AgentNativeClientAction,\n type AgentNativeClientActionApprovalConfig,\n type AgentNativeClientActionGetter,\n type AgentNativeClientActionRuntime,\n type AgentNativeClientActions,\n type AgentNativeHostAuth,\n type AgentNativeHostAuthPayload,\n type AgentNativeHostBridge,\n type AgentNativeHostBridgeEvent,\n type AgentNativeHostBridgeOptions,\n type AgentNativeHostCapabilities,\n type AgentNativeHostCommandHandler,\n type AgentNativeHostCommandHandlers,\n type AgentNativeHostCommandRequest,\n type AgentNativeHostContext,\n type AgentNativeHostContextGetter,\n type AgentNativeHostInit,\n type AgentNativeHostMessageType,\n type AgentNativeHostRequestOptions,\n type AgentNativeHostResourceContext,\n type AgentNativeHostRouteContext,\n type AgentNativeHostSelectionContext,\n type AgentNativeHostSession,\n type AgentNativeJsonSchema,\n type AgentNativeScreenSnapshot,\n type AgentNativeScreenSnapshotOptions,\n type BuiltInAgentNativeHostCommand,\n} from \"./host-bridge.js\";\nexport {\n AGENT_NATIVE_HOST_TOOL_NAMES,\n createAgentNativeHostTools,\n type AgentNativeHostToolDefinition,\n type AgentNativeHostToolName,\n type AgentNativeHostToolParameters,\n type AgentNativeHostToolSet,\n type CreateAgentNativeHostToolsOptions,\n type RunAgentNativeHostActionToolInput,\n type SendAgentNativeHostCommandToolInput,\n} from \"./host-tools.js\";\nexport {\n createAgentNativeBrowserSessionBridge,\n startAgentNativeBrowserSessionBridge,\n type AgentNativeBrowserSessionBridge,\n type AgentNativeBrowserSessionBridgeOptions,\n} from \"./browser-session-bridge.js\";\nexport type {\n AgentNativeBrowserSession,\n AgentNativeBrowserSessionAction,\n AgentNativeBrowserSessionRecord,\n AgentNativeBrowserSessionRequest,\n AgentNativeBrowserSessionRequestStatus,\n AgentNativeBrowserSessionRequestType,\n CreateAgentNativeBrowserSessionRequestInput,\n RegisterAgentNativeBrowserSessionInput,\n} from \"../browser-sessions/types.js\";\nexport {\n NewWorkspaceAppFlow,\n type NewWorkspaceAppFlowProps,\n type VaultSecretOption,\n} from \"./NewWorkspaceAppFlow.js\";\nexport {\n AssistantChat,\n clearChatStorage,\n type AssistantChatProps,\n type AssistantChatHandle,\n type AssistantChatAdapterContext,\n} from \"./AssistantChat.js\";\nexport {\n MultiTabAssistantChat,\n type MultiTabAssistantChatProps,\n type MultiTabAssistantChatHeaderProps,\n} from \"./MultiTabAssistantChat.js\";\nexport { RunStuckBanner, type RunStuckBannerProps } from \"./RunStuckBanner.js\";\nexport {\n useRunStuckDetection,\n useAbortRun,\n type RunStuckState,\n type UseRunStuckDetectionOptions,\n} from \"./use-run-stuck-detection.js\";\nexport {\n createAgentChatAdapter,\n type AgentChatSurfaceKind,\n type CreateAgentChatAdapterOptions,\n} from \"./agent-chat-adapter.js\";\nexport {\n AgentComposerFrame,\n type AgentComposerFrameProps,\n PromptComposer,\n TiptapComposer,\n AGENT_PROMPT_MAX_INLINE_IMAGE_BYTES,\n AGENT_PROMPT_MAX_INLINE_TEXT_CHARS,\n escapePromptAttachmentAttribute,\n formatPromptWithAttachments,\n isInlineableAgentPromptFile,\n readAgentPromptAttachment,\n type PromptComposerProps,\n type PromptComposerFile,\n type PromptComposerSubmitOptions,\n type ComposerSubmitIntent,\n type AgentPromptAttachment,\n type ReadAgentPromptAttachmentOptions,\n type AgentComposerLayoutVariant,\n type SlashCommand,\n type SkillResult,\n type TiptapComposerHandle,\n type TiptapComposerProps,\n type TiptapComposerSubmitOptions,\n} from \"./composer/index.js\";\nexport {\n GuidedQuestionFlow,\n useGuidedQuestionFlow,\n askUserQuestion,\n formatGuidedAnswerValue,\n formatGuidedAnswersForAgent,\n getOtherGuidedAnswerText,\n hasGuidedAnswer,\n isOtherGuidedAnswer,\n makeOtherGuidedAnswer,\n normalizeGuidedAnswers,\n type AskUserQuestionInput,\n type AskUserQuestionOption,\n type AskUserQuestionResult,\n type GuidedQuestion,\n type GuidedQuestionAnswers,\n type GuidedQuestionFlowProps,\n type GuidedQuestionOption,\n type GuidedQuestionPayload,\n type GuidedQuestionType,\n type UseGuidedQuestionFlowOptions,\n} from \"./guided-questions.js\";\nexport {\n useChatThreads,\n type ChatThreadScope,\n type ChatThreadSnapshot,\n type ChatThreadSummary,\n type ChatThreadData,\n type UseChatThreadsOptions,\n} from \"./use-chat-threads.js\";\nexport {\n AgentChatSurface,\n AgentPanel,\n AgentSidebar,\n AgentToggleButton,\n focusAgentChat,\n type AgentChatSurfaceMode,\n type AgentChatSurfaceProps,\n type AgentPanelProps,\n type AgentSidebarProps,\n} from \"./AgentPanel.js\";\nexport {\n SIDEBAR_STATE_CHANGE_EVENT,\n type AgentSidebarStateChangeDetail,\n type AgentSidebarStateMode,\n type AgentSidebarStateSource,\n} from \"./agent-sidebar-state.js\";\nexport { AgentNativeIcon } from \"./components/icons/AgentNativeIcon.js\";\nexport { SettingsPanel, type SettingsPanelProps } from \"./settings/index.js\";\nexport { useBuilderStatus } from \"./settings/useBuilderStatus.js\";\nexport {\n openBuilderConnectPopup,\n useBuilderConnectFlow,\n type BuilderConnectFlow,\n type BuilderConnectFlowOptions,\n type OpenBuilderConnectPopupOptions,\n} from \"./settings/useBuilderStatus.js\";\n// Deprecated — use AgentSidebar + AgentToggleButton instead\nexport {\n ProductionAgentPanel,\n type ProductionAgentPanelProps,\n} from \"./ProductionAgentPanel.js\";\nexport {\n useProductionAgent,\n type ProductionAgentMessage,\n type UseProductionAgentOptions,\n type UseProductionAgentResult,\n} from \"./useProductionAgent.js\";\nexport { Turnstile, type TurnstileProps } from \"./Turnstile.js\";\nexport {\n OpenSourceBadge,\n PoweredByBadge,\n type OpenSourceBadgeProps,\n type PoweredByBadgeProps,\n} from \"./PoweredByBadge.js\";\nexport {\n StarfieldBackground,\n type StarfieldBackgroundProps,\n} from \"./StarfieldBackground.js\";\nexport { FeedbackButton, type FeedbackButtonProps } from \"./FeedbackButton.js\";\nexport {\n DevDatabaseLink,\n type DevDatabaseLinkProps,\n} from \"./db-admin/DevDatabaseLink.js\";\nexport { ErrorBoundary } from \"./ErrorBoundary.js\";\nexport { installRouteChunkRecovery } from \"./route-chunk-recovery.js\";\nexport { ClientOnly } from \"./ClientOnly.js\";\nexport { DefaultSpinner } from \"./DefaultSpinner.js\";\nexport {\n getThemeInitScript,\n themeInitScript,\n type ThemePreference,\n} from \"./theme.js\";\nexport {\n APPEARANCE_PRESETS,\n applyAppearance,\n getStoredAppearance,\n useAppearance,\n useAppearanceSync,\n type AppearancePresetId,\n} from \"./appearance.js\";\nexport {\n AppearancePicker,\n type AppearancePickerProps,\n} from \"./AppearancePicker.js\";\nexport { AgentTerminal, type AgentTerminalProps } from \"./terminal/index.js\";\nexport {\n trackEvent,\n trackSessionStatus,\n configureTracking,\n setSentryUser,\n captureError,\n captureClientException,\n type ClientCaptureContext,\n} from \"./analytics.js\";\nexport { track } from \"./track.js\";\nexport {\n useCollaborativeDoc,\n isReconcileLeadClient,\n emailToColor,\n emailToName,\n dedupeCollabUsersByEmail,\n type UseCollaborativeDocOptions,\n type UseCollaborativeDocResult,\n type CollabUser,\n} from \"../collab/client.js\";\nexport { AGENT_CLIENT_ID } from \"../collab/agent-identity.js\";\n// Presence kit\nexport {\n usePresence,\n toNormalized,\n fromNormalized,\n type OtherPresence,\n type PresencePayload,\n type UsePresenceResult,\n type NormalizedPoint,\n} from \"../collab/presence.js\";\nexport {\n useFollowUser,\n type UseFollowUserOptions,\n type UseFollowUserResult,\n type ViewportDescriptor,\n} from \"../collab/follow-mode.js\";\nexport {\n ResourcesPanel,\n ResourceTree,\n ResourceEditor,\n useResources,\n useResourceTree,\n useResource,\n useCreateResource,\n useUpdateResource,\n useDeleteResource,\n useUploadResource,\n type Resource,\n type ResourceMeta,\n type TreeNode,\n type ResourceScope,\n type ResourceTreeProps,\n type ResourceEditorProps,\n} from \"./resources/index.js\";\nexport type {\n AppToFrameMessage,\n FrameToAppMessage,\n FrameMessage,\n CodeCompleteMessage,\n ChatRunningMessage,\n} from \"./frame-protocol.js\";\nexport {\n CommandMenu,\n useCommandMenuShortcut,\n openAgentSidebar,\n submitToAgent,\n type CommandMenuProps,\n type CommandGroupProps,\n type CommandItemProps,\n type CommandShortcutProps,\n} from \"./CommandMenu.js\";\nexport {\n DevOverlay,\n useDevOverlayShortcut,\n registerDevPanel,\n unregisterDevPanel,\n listDevPanels,\n subscribeDevPanels,\n useDevOption,\n clearAllDevOverlayStorage,\n devOptionKey,\n DEV_OVERLAY_STORAGE_PREFIX,\n type DevOverlayProps,\n type DevPanel,\n type DevOption,\n type DevBooleanOption,\n type DevSelectOption,\n type DevStringOption,\n type DevActionOption,\n type DevOptionValue,\n} from \"./dev-overlay/index.js\";\nexport {\n callAction,\n useActionQuery,\n useActionMutation,\n type ActionRegistry,\n type ClientActionCallOptions,\n type ClientActionMethod,\n} from \"./use-action.js\";\nexport { createAgentNativeQueryClient } from \"./create-query-client.js\";\nexport { AppProviders, type AppProvidersProps } from \"./app-providers.js\";\nexport { usePinchZoom, type UsePinchZoomOptions } from \"./use-pinch-zoom.js\";\nexport {\n ShareButton,\n ShareDialog,\n VisibilityBadge,\n type ShareButtonProps,\n type ShareDialogProps,\n type VisibilityBadgeProps,\n} from \"./sharing/index.js\";\nexport {\n postNavigate,\n isInAgentEmbed,\n AGENT_NAVIGATE_MESSAGE_TYPE,\n type AgentNavigateMessage,\n} from \"./embed.js\";\nexport { IframeEmbed, parseEmbedBody } from \"./IframeEmbed.js\";\nexport {\n useAvatarUrl,\n uploadAvatar,\n invalidateAvatarCache,\n} from \"./use-avatar.js\";\nexport {\n ObservabilityDashboard,\n ThumbsFeedback,\n} from \"./observability/index.js\";\n// Presence UI components\nexport {\n PresenceBar,\n type PresenceBarProps,\n} from \"./components/PresenceBar.js\";\nexport {\n AgentPresenceChip,\n type AgentPresenceChipProps,\n} from \"./components/AgentPresenceChip.js\";\nexport {\n LiveCursorOverlay,\n type LiveCursorOverlayProps,\n type CursorMapFn,\n} from \"./components/LiveCursorOverlay.js\";\nexport {\n RemoteSelectionRings,\n type RemoteSelectionRingsProps,\n} from \"./components/RemoteSelectionRings.js\";\n// Structured data collaboration hooks\nexport {\n useCollaborativeMap,\n useCollaborativeArray,\n type UseCollaborativeMapOptions,\n type UseCollaborativeMapResult,\n type UseCollaborativeArrayOptions,\n type UseCollaborativeArrayResult,\n} from \"../collab/client-struct.js\";\nexport { NotificationsBell } from \"./notifications/index.js\";\n// Block registry (also available as the dedicated `@agent-native/core/blocks`\n// subpath, which server/agent code should prefer via `/blocks/server`).\nexport {\n defineBlock,\n BlockRegistry,\n registerBlocks,\n BlockRegistryProvider,\n useBlockRegistry,\n useOptionalBlockRegistry,\n BlockView,\n SchemaBlockEditor,\n markdown,\n richtext,\n introspect,\n serializeSpecBlock,\n parseSpecBlock,\n createAttrReader,\n describeBlocksForAgent,\n renderBlockVocabularyReference,\n type BlockSpec,\n type BlockPlacement,\n type BlockMdxConfig,\n type BlockAttrReader,\n type BlockRenderContext,\n type BlockReadProps,\n type BlockEditProps,\n type MdxAttrValue,\n type FieldKind,\n type FieldDescriptor,\n type MdxJsxNode,\n type MdxAttrNode,\n type SerializableBlock,\n type ParsedBlockBase,\n type BlockAgentDoc,\n} from \"./blocks/index.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AAEvE,yBAAyB,EAAE,CAAC;AAC5B,6BAA6B,EAAE,CAAC;AAEhC,OAAO,EACL,qBAAqB,EACrB,+BAA+B,EAC/B,qBAAqB,EACrB,oCAAoC,EACpC,oBAAoB,EACpB,uBAAuB,EACvB,0BAA0B,EAC1B,eAAe,EACf,uBAAuB,EACvB,qBAAqB,EACrB,aAAa,GAQd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,qBAAqB,GAGt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,wEAAwE;AACxE,OAAO,EACL,WAAW,EACX,aAAa,EACb,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,wBAAwB,EACxB,SAAS,EACT,iBAAiB,EACjB,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,8BAA8B,GAgB/B,MAAM,mBAAmB,CAAC","sourcesContent":["import { installRouteChunkRecovery } from \"./route-chunk-recovery.js\";\nimport { stripAuthRedirectParamFromUrl } from \"./auth-redirect-url.js\";\n\ninstallRouteChunkRecovery();\nstripAuthRedirectParamFromUrl();\n\nexport {\n addContextToAgentChat,\n appendAgentChatContextToMessage,\n clearAgentChatContext,\n formatAgentChatContextItemsForPrompt,\n listAgentChatContext,\n refreshAgentChatContext,\n removeAgentChatContextItem,\n sendToAgentChat,\n setAgentChatContextItem,\n setContextToAgentChat,\n generateTabId,\n type AgentChatContextItem,\n type AgentChatContextMessage,\n type AgentChatContextMutationOptions,\n type AgentChatContextRemoveOptions,\n type AgentChatContextSetOptions,\n type AgentChatContextState,\n type AgentChatMessage,\n} from \"./agent-chat.js\";\nexport {\n saveAgentEngineApiKey,\n type AgentEngineProvider,\n type SaveAgentEngineApiKeyOptions,\n} from \"./agent-engine-key.js\";\nexport { useAgentChatGenerating } from \"./use-agent-chat.js\";\nexport {\n useAgentChatContext,\n type UseAgentChatContextResult,\n} from \"./use-agent-chat-context.js\";\nexport { useCodeMode, useDevMode } from \"./use-dev-mode.js\";\nexport {\n agentNativePath,\n appApiPath,\n appBasePath,\n appPath,\n} from \"./api-path.js\";\nexport {\n deleteClientAppState,\n readClientAppState,\n setClientAppState,\n writeClientAppState,\n type ClientAppStateReadOptions,\n type ClientAppStateWriteOptions,\n} from \"./application-state.js\";\nexport {\n useAgentRouteState,\n useSemanticNavigationState,\n type AgentRouteLocation,\n type SemanticNavigationCommandEnvelope,\n type UseAgentRouteStateOptions,\n type UseAgentRouteStateResult,\n type UseSemanticNavigationStateOptions,\n type UseSemanticNavigationStateResult,\n} from \"./route-state.js\";\nexport {\n ensureEmbedAuthFetchInterceptor,\n getEmbedAuthToken,\n isEmbedAuthActive,\n isEmbedMcpChatBridgeActive,\n} from \"./embed-auth.js\";\nexport {\n codeAgentTranscriptEventsToContent,\n createCodeAgentChatAdapter,\n type CodeAgentChatController,\n type CodeAgentChatControlResult,\n type CodeAgentChatFollowUpMode,\n type CodeAgentChatTranscriptEvent,\n type CreateCodeAgentChatAdapterOptions,\n} from \"./code-agent-chat-adapter.js\";\nexport {\n buildRepositoryFromCodeAgentTranscript,\n type BuildRepositoryFromCodeAgentTranscriptOptions,\n type CodeAgentThreadTranscriptEvent,\n} from \"../agent/thread-data-builder.js\";\nexport {\n compareCodeAgentTranscriptEvents,\n getCodeAgentTranscriptSeq,\n isCodeAgentRunActive,\n mergeCodeAgentTranscriptEvents,\n type CodeAgentRunStateLike,\n type CodeAgentTranscriptOrderEvent,\n} from \"../code-agents/transcript-order.js\";\nexport { useSendToAgentChat } from \"./use-send-to-agent-chat.js\";\nexport {\n useChatModels,\n type UseChatModelsResult,\n type EngineModelGroup,\n} from \"./use-chat-models.js\";\nexport {\n CodeRequiredDialog,\n type CodeRequiredDialogProps,\n} from \"./components/CodeRequiredDialog.js\";\nexport {\n AgentConversation,\n AgentConversationMessageView,\n normalizeCodeAgentTranscriptForConversation,\n useNearBottomAutoscroll,\n type CodeAgentConversationTranscriptEvent,\n type CodeAgentConversationTranscriptEventType,\n type NormalizeCodeAgentTranscriptOptions,\n type AgentConversationArtifact,\n type AgentConversationAttachment,\n type AgentConversationMessage,\n type AgentConversationMessagePart,\n type AgentConversationMessageRole,\n type AgentConversationNotice,\n type AgentConversationNoticeTone,\n type AgentConversationToolCall,\n type AgentConversationToolState,\n} from \"./conversation/index.js\";\nexport { McpAppRenderer } from \"./mcp-apps/McpAppRenderer.js\";\nexport {\n AGENT_NATIVE_MCP_APP_HOST_MESSAGE_TYPES,\n getMcpAppHostContext,\n openMcpAppHostLink,\n requestMcpAppDisplayMode,\n sendMcpAppHostMessage,\n updateMcpAppModelContext,\n useMcpAppHostContext,\n type AgentNativeMcpAppHostMessageType,\n type McpAppDisplayMode,\n type McpAppHostChatMessage,\n type McpAppHostCapabilities,\n type McpAppHostContext,\n type McpAppHostContextSnapshot,\n type McpAppModelContextContentPart,\n type McpAppModelContextUpdate,\n} from \"./mcp-app-host.js\";\nexport {\n CodeAgentIndicator,\n type CodeAgentIndicatorProps,\n} from \"./components/CodeAgentIndicator.js\";\nexport {\n useDbSync,\n useFileWatcher,\n useScreenRefreshKey,\n} from \"./use-db-sync.js\";\nexport {\n useChangeVersion,\n useChangeVersions,\n getChangeVersion,\n bumpChangeVersion,\n} from \"./use-change-version.js\";\nexport { useReconciledState } from \"./use-external-value.js\";\nexport {\n buildDynamicAgentSuggestions,\n dedupeSuggestions,\n mergeAgentSuggestions,\n normalizeAgentDynamicSuggestionsConfig,\n useAgentDynamicSuggestions,\n type AgentDynamicSuggestionContext,\n type AgentDynamicSuggestionsConfig,\n type AgentDynamicSuggestionsOption,\n} from \"./dynamic-suggestions.js\";\nexport { cn } from \"./utils.js\";\nexport {\n // Shared editor core (Phase 1): the ONE configurable surface both the plan\n // and content editors build on.\n SharedRichEditor,\n createSharedEditorExtensions,\n MARKDOWN_DIALECT_CONFIG,\n useCollabReconcile,\n RICH_MARKDOWN_PROGRAMMATIC_TRANSACTION,\n getEditorMarkdown,\n SlashCommandMenu,\n DEFAULT_SLASH_COMMANDS,\n createImageSlashCommand,\n // Shared block-level image node + injectable upload contract. Plans opt in\n // via `features.image` + `onImageUpload`; Content keeps its own image block.\n SharedImage,\n createImageExtension,\n pickAndInsertImage,\n uploadEditorImage,\n BubbleToolbar,\n buildDefaultBubbleItems,\n // Back-compat alias + factory kept for existing embedders and specs.\n RichMarkdownEditor,\n createRichMarkdownExtensions,\n // Single-doc plan editor primitives: the GFM↔ProseMirror serializer, the\n // run-id prose attribute, and the shared drag-handle (block grip + reorder).\n RunId,\n RUN_ID_NODE_TYPES,\n gfmToProseJSON,\n proseJSONToGfm,\n DragHandle,\n DEFAULT_DRAG_HANDLE_WRAPPER_SELECTOR,\n // Generic registry-block Tiptap NodeView + side-map provider + dedupe plugin.\n // Hosts mount the node from `createRegistryBlockNode` as an extra extension\n // and wrap the editor in `RegistryBlockDataProvider`.\n createRegistryBlockNode,\n RegistryBlockNodeView,\n RegistryBlockDataProvider,\n useRegistryBlockData,\n // Shared registry-derived block slash-command builder (plan + content adapt it).\n buildRegistryBlockSlashItems,\n getRegistryBlockSlashDescription,\n getRegistryBlockSlashSearchText,\n type BuildRegistryBlockSlashItemsOptions,\n type DragHandleDropContext,\n type DragHandleDropPlacement,\n type DragHandleOptions,\n type CreateRegistryBlockNodeOptions,\n type RegistryBlockDataValue,\n type RegistryBlockSideMapBlock,\n type SharedRichEditorProps,\n type SharedEditorCollab,\n type SharedEditorFeatures,\n type CreateSharedEditorExtensionsOptions,\n type UseCollabReconcileOptions,\n type UseCollabReconcileResult,\n type SlashCommandItem,\n type SlashCommandMenuProps,\n type ImageUploadFn,\n type SharedImageOptions,\n type BubbleToolbarItem,\n type BubbleToolbarProps,\n type RichMarkdownDialect,\n type RichMarkdownEditorPreset,\n type RichMarkdownEditorProps,\n type RichMarkdownCollabUser,\n type CreateRichMarkdownExtensionsOptions,\n} from \"./rich-markdown-editor/index.js\";\n// ProseMirror node JSON shape — re-exported so the plan template (which has no\n// direct @tiptap dep) can type its doc↔blocks serializer.\nexport type { JSONContent } from \"@tiptap/core\";\nexport { ApiKeySettings } from \"./components/ApiKeySettings.js\";\nexport { useSession, type AuthSession } from \"./use-session.js\";\nexport {\n RequireSession,\n buildSignInReturnHref,\n type RequireSessionProps,\n} from \"./require-session.js\";\nexport {\n sendToFrame,\n onFrameMessage,\n requestUserInfo,\n getFrameOrigin,\n getFramePostMessageTargetOrigin,\n getCallbackOrigin,\n oauthRedirectUri,\n isInFrame,\n enterStyleEditing,\n enterTextEditing,\n exitSelectionMode,\n type UserInfo,\n} from \"./frame.js\";\nexport {\n getBuilderParentOrigin,\n isInBuilderFrame,\n sendToBuilderChat,\n type BuilderChatMessage,\n} from \"./builder-frame.js\";\nexport {\n AgentNative,\n useAgentNativeScreenContext,\n type AgentNativeCommandCallback,\n type AgentNativeCommandCallbackInfo,\n type AgentNativeProps,\n} from \"./AgentNative.js\";\nexport {\n AgentNativeEmbedded,\n useAgentNativeEmbeddedBrowserSession,\n type AgentNativeEmbeddedBrowserSessionOptions,\n type AgentNativeEmbeddedCommandCallback,\n type AgentNativeEmbeddedCommandCallbackInfo,\n type AgentNativeEmbeddedProps,\n type UseAgentNativeEmbeddedBrowserSessionOptions,\n} from \"./AgentNativeEmbedded.js\";\nexport {\n defineClientAction,\n type AgentNativeClientActionDefinition,\n type AgentNativeClientActionRunner,\n} from \"./client-action.js\";\nexport {\n AgentNativeFrame,\n type AgentNativeFrameProps,\n} from \"./AgentNativeFrame.js\";\nexport {\n AgentNativeRouteWarmup,\n type AgentNativeRouteWarmupProps,\n} from \"./route-warmup.js\";\nexport {\n AgentNativeExtensionFrame,\n AgentNativeExtensionSlot,\n type AgentNativeExtensionFrameProps,\n type AgentNativeExtensionPermissionList,\n type AgentNativeExtensionSlotProps,\n type AgentNativeExtensionStorageScopeList,\n} from \"./extensions/AgentNativeExtensionFrame.js\";\nexport {\n AGENT_NATIVE_EXTENSION_MESSAGE_TYPES,\n buildAgentNativeExtensionHtml,\n createHttpAgentNativeExtensionStorage,\n createLocalStorageAgentNativeExtensionStorage,\n getAgentNativeExtensionManifest,\n isAgentNativeExtensionAllowedInSlot,\n normalizeAgentNativeExtensionSandbox,\n type AgentNativeExtensionDefinition,\n type AgentNativeExtensionManifest,\n type AgentNativeExtensionMessageType,\n type AgentNativeExtensionStorage,\n type AgentNativeExtensionStorageContext,\n type AgentNativeExtensionStorageOptions,\n type AgentNativeExtensionStorageRow,\n type AgentNativeExtensionStorageScope,\n type BuildAgentNativeExtensionHtmlOptions,\n type CreateHttpAgentNativeExtensionStorageOptions,\n} from \"./extensions/portable-extension.js\";\nexport {\n AGENT_NATIVE_HOST_BRIDGE_VERSION,\n AGENT_NATIVE_HOST_MESSAGE_TYPES,\n announceAgentNativeFrameReady,\n createAgentNativeHostBridge,\n defaultAgentNativeHostCommands,\n onAgentNativeHostInit,\n readAgentNativeScreenContext,\n requestAgentNativeHostActions,\n requestAgentNativeHostContext,\n runAgentNativeHostAction,\n sendAgentNativeHostCommand,\n type AgentNativeActionAvailability,\n type AgentNativeActionManifestEntry,\n type AgentNativeClientAction,\n type AgentNativeClientActionApprovalConfig,\n type AgentNativeClientActionGetter,\n type AgentNativeClientActionRuntime,\n type AgentNativeClientActions,\n type AgentNativeHostAuth,\n type AgentNativeHostAuthPayload,\n type AgentNativeHostBridge,\n type AgentNativeHostBridgeEvent,\n type AgentNativeHostBridgeOptions,\n type AgentNativeHostCapabilities,\n type AgentNativeHostCommandHandler,\n type AgentNativeHostCommandHandlers,\n type AgentNativeHostCommandRequest,\n type AgentNativeHostContext,\n type AgentNativeHostContextGetter,\n type AgentNativeHostInit,\n type AgentNativeHostMessageType,\n type AgentNativeHostRequestOptions,\n type AgentNativeHostResourceContext,\n type AgentNativeHostRouteContext,\n type AgentNativeHostSelectionContext,\n type AgentNativeHostSession,\n type AgentNativeJsonSchema,\n type AgentNativeScreenSnapshot,\n type AgentNativeScreenSnapshotOptions,\n type BuiltInAgentNativeHostCommand,\n} from \"./host-bridge.js\";\nexport {\n AGENT_NATIVE_HOST_TOOL_NAMES,\n createAgentNativeHostTools,\n type AgentNativeHostToolDefinition,\n type AgentNativeHostToolName,\n type AgentNativeHostToolParameters,\n type AgentNativeHostToolSet,\n type CreateAgentNativeHostToolsOptions,\n type RunAgentNativeHostActionToolInput,\n type SendAgentNativeHostCommandToolInput,\n} from \"./host-tools.js\";\nexport {\n createAgentNativeBrowserSessionBridge,\n startAgentNativeBrowserSessionBridge,\n type AgentNativeBrowserSessionBridge,\n type AgentNativeBrowserSessionBridgeOptions,\n} from \"./browser-session-bridge.js\";\nexport type {\n AgentNativeBrowserSession,\n AgentNativeBrowserSessionAction,\n AgentNativeBrowserSessionRecord,\n AgentNativeBrowserSessionRequest,\n AgentNativeBrowserSessionRequestStatus,\n AgentNativeBrowserSessionRequestType,\n CreateAgentNativeBrowserSessionRequestInput,\n RegisterAgentNativeBrowserSessionInput,\n} from \"../browser-sessions/types.js\";\nexport {\n NewWorkspaceAppFlow,\n type NewWorkspaceAppFlowProps,\n type VaultSecretOption,\n} from \"./NewWorkspaceAppFlow.js\";\nexport {\n AssistantChat,\n clearChatStorage,\n type AssistantChatProps,\n type AssistantChatHandle,\n type AssistantChatAdapterContext,\n} from \"./AssistantChat.js\";\nexport {\n MultiTabAssistantChat,\n type MultiTabAssistantChatProps,\n type MultiTabAssistantChatHeaderProps,\n} from \"./MultiTabAssistantChat.js\";\nexport { RunStuckBanner, type RunStuckBannerProps } from \"./RunStuckBanner.js\";\nexport {\n useRunStuckDetection,\n useAbortRun,\n type RunStuckState,\n type UseRunStuckDetectionOptions,\n} from \"./use-run-stuck-detection.js\";\nexport {\n createAgentChatAdapter,\n type AgentChatSurfaceKind,\n type CreateAgentChatAdapterOptions,\n} from \"./agent-chat-adapter.js\";\nexport {\n AgentComposerFrame,\n type AgentComposerFrameProps,\n PromptComposer,\n TiptapComposer,\n AGENT_PROMPT_MAX_INLINE_IMAGE_BYTES,\n AGENT_PROMPT_MAX_INLINE_TEXT_CHARS,\n escapePromptAttachmentAttribute,\n formatPromptWithAttachments,\n isInlineableAgentPromptFile,\n readAgentPromptAttachment,\n type PromptComposerProps,\n type PromptComposerFile,\n type PromptComposerSubmitOptions,\n type ComposerSubmitIntent,\n type AgentPromptAttachment,\n type ReadAgentPromptAttachmentOptions,\n type AgentComposerLayoutVariant,\n type SlashCommand,\n type SkillResult,\n type TiptapComposerHandle,\n type TiptapComposerProps,\n type TiptapComposerSubmitOptions,\n} from \"./composer/index.js\";\nexport {\n GuidedQuestionFlow,\n useGuidedQuestionFlow,\n askUserQuestion,\n formatGuidedAnswerValue,\n formatGuidedAnswersForAgent,\n getOtherGuidedAnswerText,\n hasGuidedAnswer,\n isOtherGuidedAnswer,\n makeOtherGuidedAnswer,\n normalizeGuidedAnswers,\n type AskUserQuestionInput,\n type AskUserQuestionOption,\n type AskUserQuestionResult,\n type GuidedQuestion,\n type GuidedQuestionAnswers,\n type GuidedQuestionFlowProps,\n type GuidedQuestionOption,\n type GuidedQuestionPayload,\n type GuidedQuestionType,\n type UseGuidedQuestionFlowOptions,\n} from \"./guided-questions.js\";\nexport {\n useChatThreads,\n type ChatThreadScope,\n type ChatThreadSnapshot,\n type ChatThreadSummary,\n type ChatThreadData,\n type UseChatThreadsOptions,\n} from \"./use-chat-threads.js\";\nexport {\n AgentChatSurface,\n AgentPanel,\n AgentSidebar,\n AgentToggleButton,\n focusAgentChat,\n type AgentChatSurfaceMode,\n type AgentChatSurfaceProps,\n type AgentPanelProps,\n type AgentSidebarProps,\n} from \"./AgentPanel.js\";\nexport {\n SIDEBAR_STATE_CHANGE_EVENT,\n type AgentSidebarStateChangeDetail,\n type AgentSidebarStateMode,\n type AgentSidebarStateSource,\n} from \"./agent-sidebar-state.js\";\nexport { AgentNativeIcon } from \"./components/icons/AgentNativeIcon.js\";\nexport { SettingsPanel, type SettingsPanelProps } from \"./settings/index.js\";\nexport { useBuilderStatus } from \"./settings/useBuilderStatus.js\";\nexport {\n openBuilderConnectPopup,\n useBuilderConnectFlow,\n type BuilderConnectFlow,\n type BuilderConnectFlowOptions,\n type OpenBuilderConnectPopupOptions,\n} from \"./settings/useBuilderStatus.js\";\n// Deprecated — use AgentSidebar + AgentToggleButton instead\nexport {\n ProductionAgentPanel,\n type ProductionAgentPanelProps,\n} from \"./ProductionAgentPanel.js\";\nexport {\n useProductionAgent,\n type ProductionAgentMessage,\n type UseProductionAgentOptions,\n type UseProductionAgentResult,\n} from \"./useProductionAgent.js\";\nexport { Turnstile, type TurnstileProps } from \"./Turnstile.js\";\nexport {\n OpenSourceBadge,\n PoweredByBadge,\n type OpenSourceBadgeProps,\n type PoweredByBadgeProps,\n} from \"./PoweredByBadge.js\";\nexport {\n StarfieldBackground,\n type StarfieldBackgroundProps,\n} from \"./StarfieldBackground.js\";\nexport { FeedbackButton, type FeedbackButtonProps } from \"./FeedbackButton.js\";\nexport {\n DevDatabaseLink,\n type DevDatabaseLinkProps,\n} from \"./db-admin/DevDatabaseLink.js\";\nexport { ErrorBoundary } from \"./ErrorBoundary.js\";\nexport {\n installRouteChunkRecovery,\n reloadForStaleChunk,\n recoverFromStaleChunkError,\n} from \"./route-chunk-recovery.js\";\nexport { ClientOnly } from \"./ClientOnly.js\";\nexport { DefaultSpinner } from \"./DefaultSpinner.js\";\nexport {\n getThemeInitScript,\n themeInitScript,\n type ThemePreference,\n} from \"./theme.js\";\nexport {\n APPEARANCE_PRESETS,\n applyAppearance,\n getStoredAppearance,\n useAppearance,\n useAppearanceSync,\n type AppearancePresetId,\n} from \"./appearance.js\";\nexport {\n AppearancePicker,\n type AppearancePickerProps,\n} from \"./AppearancePicker.js\";\nexport { AgentTerminal, type AgentTerminalProps } from \"./terminal/index.js\";\nexport {\n trackEvent,\n trackSessionStatus,\n configureTracking,\n setSentryUser,\n captureError,\n captureClientException,\n type ClientCaptureContext,\n} from \"./analytics.js\";\nexport { track } from \"./track.js\";\nexport {\n useCollaborativeDoc,\n isReconcileLeadClient,\n emailToColor,\n emailToName,\n dedupeCollabUsersByEmail,\n type UseCollaborativeDocOptions,\n type UseCollaborativeDocResult,\n type CollabUser,\n} from \"../collab/client.js\";\nexport { AGENT_CLIENT_ID } from \"../collab/agent-identity.js\";\n// Presence kit\nexport {\n usePresence,\n toNormalized,\n fromNormalized,\n type OtherPresence,\n type PresencePayload,\n type UsePresenceResult,\n type NormalizedPoint,\n} from \"../collab/presence.js\";\nexport {\n useFollowUser,\n type UseFollowUserOptions,\n type UseFollowUserResult,\n type ViewportDescriptor,\n} from \"../collab/follow-mode.js\";\nexport {\n ResourcesPanel,\n ResourceTree,\n ResourceEditor,\n useResources,\n useResourceTree,\n useResource,\n useCreateResource,\n useUpdateResource,\n useDeleteResource,\n useUploadResource,\n type Resource,\n type ResourceMeta,\n type TreeNode,\n type ResourceScope,\n type ResourceTreeProps,\n type ResourceEditorProps,\n} from \"./resources/index.js\";\nexport type {\n AppToFrameMessage,\n FrameToAppMessage,\n FrameMessage,\n CodeCompleteMessage,\n ChatRunningMessage,\n} from \"./frame-protocol.js\";\nexport {\n CommandMenu,\n useCommandMenuShortcut,\n openAgentSidebar,\n submitToAgent,\n type CommandMenuProps,\n type CommandGroupProps,\n type CommandItemProps,\n type CommandShortcutProps,\n} from \"./CommandMenu.js\";\nexport {\n DevOverlay,\n useDevOverlayShortcut,\n registerDevPanel,\n unregisterDevPanel,\n listDevPanels,\n subscribeDevPanels,\n useDevOption,\n clearAllDevOverlayStorage,\n devOptionKey,\n DEV_OVERLAY_STORAGE_PREFIX,\n type DevOverlayProps,\n type DevPanel,\n type DevOption,\n type DevBooleanOption,\n type DevSelectOption,\n type DevStringOption,\n type DevActionOption,\n type DevOptionValue,\n} from \"./dev-overlay/index.js\";\nexport {\n callAction,\n useActionQuery,\n useActionMutation,\n type ActionRegistry,\n type ClientActionCallOptions,\n type ClientActionMethod,\n} from \"./use-action.js\";\nexport { createAgentNativeQueryClient } from \"./create-query-client.js\";\nexport { AppProviders, type AppProvidersProps } from \"./app-providers.js\";\nexport { usePinchZoom, type UsePinchZoomOptions } from \"./use-pinch-zoom.js\";\nexport {\n ShareButton,\n ShareDialog,\n VisibilityBadge,\n type ShareButtonProps,\n type ShareDialogProps,\n type VisibilityBadgeProps,\n} from \"./sharing/index.js\";\nexport {\n postNavigate,\n isInAgentEmbed,\n AGENT_NAVIGATE_MESSAGE_TYPE,\n type AgentNavigateMessage,\n} from \"./embed.js\";\nexport { IframeEmbed, parseEmbedBody } from \"./IframeEmbed.js\";\nexport {\n useAvatarUrl,\n uploadAvatar,\n invalidateAvatarCache,\n} from \"./use-avatar.js\";\nexport {\n ObservabilityDashboard,\n ThumbsFeedback,\n} from \"./observability/index.js\";\n// Presence UI components\nexport {\n PresenceBar,\n type PresenceBarProps,\n} from \"./components/PresenceBar.js\";\nexport {\n AgentPresenceChip,\n type AgentPresenceChipProps,\n} from \"./components/AgentPresenceChip.js\";\nexport {\n LiveCursorOverlay,\n type LiveCursorOverlayProps,\n type CursorMapFn,\n} from \"./components/LiveCursorOverlay.js\";\nexport {\n RemoteSelectionRings,\n type RemoteSelectionRingsProps,\n} from \"./components/RemoteSelectionRings.js\";\n// Structured data collaboration hooks\nexport {\n useCollaborativeMap,\n useCollaborativeArray,\n type UseCollaborativeMapOptions,\n type UseCollaborativeMapResult,\n type UseCollaborativeArrayOptions,\n type UseCollaborativeArrayResult,\n} from \"../collab/client-struct.js\";\nexport { NotificationsBell } from \"./notifications/index.js\";\n// Block registry (also available as the dedicated `@agent-native/core/blocks`\n// subpath, which server/agent code should prefer via `/blocks/server`).\nexport {\n defineBlock,\n BlockRegistry,\n registerBlocks,\n BlockRegistryProvider,\n useBlockRegistry,\n useOptionalBlockRegistry,\n BlockView,\n SchemaBlockEditor,\n markdown,\n richtext,\n introspect,\n serializeSpecBlock,\n parseSpecBlock,\n createAttrReader,\n describeBlocksForAgent,\n renderBlockVocabularyReference,\n type BlockSpec,\n type BlockPlacement,\n type BlockMdxConfig,\n type BlockAttrReader,\n type BlockRenderContext,\n type BlockReadProps,\n type BlockEditProps,\n type MdxAttrValue,\n type FieldKind,\n type FieldDescriptor,\n type MdxJsxNode,\n type MdxAttrNode,\n type SerializableBlock,\n type ParsedBlockBase,\n type BlockAgentDoc,\n} from \"./blocks/index.js\";\n"]}
@@ -11,5 +11,22 @@ export declare function isDynamicImportFailureMessage(value: unknown): boolean;
11
11
  export declare function rememberIntendedNavigation(state: RouteChunkRecoveryState, href: string, now?: number): void;
12
12
  export declare function getFreshIntendedNavigation(state: RouteChunkRecoveryState, currentHref: string, now?: number): string | null;
13
13
  export declare function intendedHrefFromClick(win: Window, event: MouseEvent): string | null;
14
+ /**
15
+ * Last resort when a stale lazy chunk fails to load for the *current* route —
16
+ * an old tab whose hashed chunk filenames no longer exist after a deploy — and
17
+ * there is no fresh cross-route navigation to recover to. A single guarded
18
+ * reload pulls a fresh index.html plus chunk manifest. A sessionStorage cooldown
19
+ * prevents a reload loop when the chunk is genuinely unreachable (e.g. offline),
20
+ * letting the error surface to Sentry as before in that case.
21
+ *
22
+ * Returns true when a reload was triggered.
23
+ */
24
+ export declare function reloadForStaleChunk(win?: Window | undefined, now?: number): boolean;
25
+ /**
26
+ * Recover when a caught error (e.g. a `React.lazy` rejection surfaced to an
27
+ * error boundary) is a stale dynamic-import failure. No-op and returns false
28
+ * for any other error so callers can fall through to their normal handling.
29
+ */
30
+ export declare function recoverFromStaleChunkError(error: unknown, win?: Window | undefined): boolean;
14
31
  export declare function installRouteChunkRecovery(win?: Window | undefined): void;
15
32
  //# sourceMappingURL=route-chunk-recovery.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"route-chunk-recovery.d.ts","sourceRoot":"","sources":["../../src/client/route-chunk-recovery.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,wBAAgB,6BAA6B,IAAI,uBAAuB,CAQvE;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAKlE;AAED,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAOrE;AAED,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,uBAAuB,EAC9B,IAAI,EAAE,MAAM,EACZ,GAAG,SAAa,GACf,IAAI,CAGN;AAED,wBAAgB,0BAA0B,CACxC,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K,EAAE,OAAO,EACd,GAAG,GAAE,MAAM,GAAG,SAA8D,GAC3E,OAAO,CAIT;AAwED,wBAAgB,yBAAyB,CACvC,GAAG,GAAE,MAAM,GAAG,SAA8D,QA8D7E"}
@@ -1,5 +1,10 @@
1
1
  const INSTALL_KEY = "__agentNativeRouteChunkRecoveryInstalled";
2
2
  const INTENDED_NAV_MAX_AGE_MS = 15_000;
3
+ // Last-resort reload bookkeeping. Persisted in sessionStorage so the cooldown
4
+ // survives the reload it triggers (the in-memory closure is destroyed), with a
5
+ // window-scoped fallback for environments where sessionStorage throws.
6
+ const STALE_CHUNK_RELOAD_AT_KEY = "__agentNativeStaleChunkReloadAt";
7
+ const STALE_CHUNK_RELOAD_COOLDOWN_MS = 10_000;
3
8
  export function createRouteChunkRecoveryState() {
4
9
  return {
5
10
  intendedHref: null,
@@ -82,6 +87,61 @@ function hardNavigate(win, href) {
82
87
  function isAgentNativeDesktop(win) {
83
88
  return /AgentNativeDesktop/i.test(win.navigator?.userAgent || "");
84
89
  }
90
+ function readStaleChunkReloadAt(win) {
91
+ try {
92
+ const raw = win.sessionStorage?.getItem(STALE_CHUNK_RELOAD_AT_KEY);
93
+ const parsed = raw == null ? NaN : Number(raw);
94
+ if (Number.isFinite(parsed))
95
+ return parsed;
96
+ }
97
+ catch { }
98
+ const mem = win[STALE_CHUNK_RELOAD_AT_KEY];
99
+ return typeof mem === "number" ? mem : 0;
100
+ }
101
+ function markStaleChunkReload(win, now) {
102
+ win[STALE_CHUNK_RELOAD_AT_KEY] = now;
103
+ try {
104
+ win.sessionStorage?.setItem(STALE_CHUNK_RELOAD_AT_KEY, String(now));
105
+ }
106
+ catch { }
107
+ }
108
+ /**
109
+ * Last resort when a stale lazy chunk fails to load for the *current* route —
110
+ * an old tab whose hashed chunk filenames no longer exist after a deploy — and
111
+ * there is no fresh cross-route navigation to recover to. A single guarded
112
+ * reload pulls a fresh index.html plus chunk manifest. A sessionStorage cooldown
113
+ * prevents a reload loop when the chunk is genuinely unreachable (e.g. offline),
114
+ * letting the error surface to Sentry as before in that case.
115
+ *
116
+ * Returns true when a reload was triggered.
117
+ */
118
+ export function reloadForStaleChunk(win = typeof window === "undefined" ? undefined : window, now = Date.now()) {
119
+ if (!win?.location)
120
+ return false;
121
+ // Desktop webviews intentionally stay open across deploys; a forced reload
122
+ // reads as a random tab refresh, matching recoverToIntendedNavigation().
123
+ if (isAgentNativeDesktop(win))
124
+ return false;
125
+ const lastReloadAt = readStaleChunkReloadAt(win);
126
+ if (lastReloadAt > 0 &&
127
+ now - lastReloadAt <= STALE_CHUNK_RELOAD_COOLDOWN_MS) {
128
+ return false;
129
+ }
130
+ markStaleChunkReload(win, now);
131
+ hardNavigate(win, win.location.href);
132
+ return true;
133
+ }
134
+ /**
135
+ * Recover when a caught error (e.g. a `React.lazy` rejection surfaced to an
136
+ * error boundary) is a stale dynamic-import failure. No-op and returns false
137
+ * for any other error so callers can fall through to their normal handling.
138
+ */
139
+ export function recoverFromStaleChunkError(error, win = typeof window === "undefined" ? undefined : window) {
140
+ const message = error instanceof Error ? error.message : String(error ?? "");
141
+ if (!isDynamicImportFailureMessage(message))
142
+ return false;
143
+ return reloadForStaleChunk(win);
144
+ }
85
145
  function recoverToIntendedNavigation(win, state) {
86
146
  const target = getFreshIntendedNavigation(state, win.location.href);
87
147
  if (!target)
@@ -172,6 +232,13 @@ export function installRouteChunkRecovery(win = typeof window === "undefined" ?
172
232
  state.routeModuleFailureAt = Date.now();
173
233
  if (recoverToIntendedNavigation(win, state)) {
174
234
  event.preventDefault();
235
+ return;
236
+ }
237
+ // No fresh cross-route target — the current route's own chunk went stale.
238
+ // Reload once (guarded) to fetch fresh assets instead of leaving the user
239
+ // on a broken view.
240
+ if (reloadForStaleChunk(win)) {
241
+ event.preventDefault();
175
242
  }
176
243
  });
177
244
  // React Router catches stale route-module import failures and reloads the
@@ -1 +1 @@
1
- {"version":3,"file":"route-chunk-recovery.js","sourceRoot":"","sources":["../../src/client/route-chunk-recovery.ts"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AAC,GAAG,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;IAC/C,WAAW,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAExB,GAAG,CAAC,gBAAgB,CAAC,oBAAoB,EAAE,CAAC,KAAK,EAAE,EAAE;QACnD,MAAM,MAAM,GAAI,KAA+B,CAAC,MAAM,CAAC;QACvD,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,IAAI,MAAM,IAAI,EAAE,CAAC,CAAC;QACxD,IAAI,CAAC,6BAA6B,CAAC,OAAO,CAAC;YAAE,OAAO;QACpD,KAAK,CAAC,oBAAoB,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACxC,IAAI,2BAA2B,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC;YAC5C,KAAK,CAAC,cAAc,EAAE,CAAC;QACzB,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,0EAA0E;IAC1E,6EAA6E;IAC7E,MAAM,aAAa,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACxD,IAAI,CAAC;QACH,UAAU,CAAC,KAAK,GAAG,CAAC,GAAG,IAAe,EAAE,EAAE;YACxC,IAAI,IAAI,CAAC,IAAI,CAAC,0BAA0B,CAAC,EAAE,CAAC;gBAC1C,KAAK,CAAC,oBAAoB,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;gBACxC,2BAA2B,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YAC1C,CAAC;YACD,aAAa,CAAC,GAAG,IAAI,CAAC,CAAC;QACzB,CAAC,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;AACZ,CAAC","sourcesContent":["const INSTALL_KEY = \"__agentNativeRouteChunkRecoveryInstalled\";\nconst INTENDED_NAV_MAX_AGE_MS = 15_000;\n\nexport interface RouteChunkRecoveryState {\n intendedHref: string | null;\n intendedAt: number;\n routeModuleFailureAt: number;\n recoveryHref: string | null;\n recovering: boolean;\n}\n\nexport function createRouteChunkRecoveryState(): RouteChunkRecoveryState {\n return {\n intendedHref: null,\n intendedAt: 0,\n routeModuleFailureAt: 0,\n recoveryHref: null,\n recovering: false,\n };\n}\n\nexport function isRouteModuleReloadMessage(value: unknown): boolean {\n return (\n typeof value === \"string\" &&\n /Error loading route module `[^`]+`, reloading page\\.\\.\\./.test(value)\n );\n}\n\nexport function isDynamicImportFailureMessage(value: unknown): boolean {\n if (typeof value !== \"string\") return false;\n return (\n value.includes(\"Failed to fetch dynamically imported module\") ||\n value.includes(\"error loading dynamically imported module\") ||\n value.includes(\"Importing a module script failed\")\n );\n}\n\nexport function rememberIntendedNavigation(\n state: RouteChunkRecoveryState,\n href: string,\n now = Date.now(),\n): void {\n state.intendedHref = href;\n state.intendedAt = now;\n}\n\nexport function getFreshIntendedNavigation(\n state: RouteChunkRecoveryState,\n currentHref: string,\n now = Date.now(),\n): string | null {\n if (!state.intendedHref) return null;\n if (now - state.intendedAt > INTENDED_NAV_MAX_AGE_MS) return null;\n if (state.intendedHref === currentHref) return null;\n return state.intendedHref;\n}\n\nfunction anchorFromTarget(\n target: EventTarget | null,\n): HTMLAnchorElement | null {\n let node = target as HTMLElement | null;\n while (node) {\n if (\n node.tagName?.toUpperCase() === \"A\" &&\n typeof (node as HTMLAnchorElement).href === \"string\"\n ) {\n return node as HTMLAnchorElement;\n }\n node = node.parentElement;\n }\n return null;\n}\n\nfunction sameOriginHref(win: Window, href: string): string | null {\n try {\n const url = new URL(href, win.location.href);\n return url.origin === win.location.origin ? url.href : null;\n } catch {\n return null;\n }\n}\n\nexport function intendedHrefFromClick(\n win: Window,\n event: MouseEvent,\n): string | null {\n if (event.defaultPrevented) return null;\n if (event.button !== 0) return null;\n if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) {\n return null;\n }\n\n const anchor = anchorFromTarget(event.target);\n if (!anchor) return null;\n if (anchor.hasAttribute(\"download\")) return null;\n const target = anchor.getAttribute(\"target\");\n if (target && target !== \"_self\") return null;\n return sameOriginHref(win, anchor.href);\n}\n\nfunction hardNavigate(win: Window, href: string): void {\n try {\n win.location.assign(href);\n } catch {\n win.location.href = href;\n }\n}\n\nfunction isAgentNativeDesktop(win: Window): boolean {\n return /AgentNativeDesktop/i.test(win.navigator?.userAgent || \"\");\n}\n\nfunction recoverToIntendedNavigation(\n win: Window,\n state: RouteChunkRecoveryState,\n): boolean {\n const target = getFreshIntendedNavigation(state, win.location.href);\n if (!target) return false;\n state.recovering = true;\n state.recoveryHref = target;\n // Desktop webviews stay open across many deploys; a forced navigation here\n // reads as a random tab reload. Leave the current view alive instead.\n if (isAgentNativeDesktop(win)) return true;\n try {\n win.history.replaceState(win.history.state, \"\", target);\n } catch {}\n hardNavigate(win, target);\n return true;\n}\n\nfunction patchHistoryMethod(\n win: Window,\n state: RouteChunkRecoveryState,\n method: \"pushState\" | \"replaceState\",\n): void {\n const original = win.history[method];\n win.history[method] = function patchedHistoryMethod(...args) {\n if (typeof args[2] === \"string\" || args[2] instanceof URL) {\n const href = sameOriginHref(win, String(args[2]));\n if (href) rememberIntendedNavigation(state, href);\n }\n return original.apply(this, args);\n };\n}\n\nfunction patchReload(win: Window, state: RouteChunkRecoveryState): void {\n const originalReload = win.location.reload.bind(win.location);\n const patchedReload = function patchedReload() {\n if (\n isAgentNativeDesktop(win) &&\n Date.now() - state.routeModuleFailureAt <= 1_000\n ) {\n return;\n }\n if (\n state.recoveryHref &&\n Date.now() - state.routeModuleFailureAt <= 1_000\n ) {\n hardNavigate(win, state.recoveryHref);\n return;\n }\n if (\n Date.now() - state.routeModuleFailureAt <= 1_000 &&\n recoverToIntendedNavigation(win, state)\n ) {\n return;\n }\n originalReload();\n };\n\n try {\n Object.defineProperty(win.location, \"reload\", {\n configurable: true,\n value: patchedReload,\n });\n } catch {\n try {\n win.location.reload = patchedReload;\n } catch {}\n }\n}\n\nexport function installRouteChunkRecovery(\n win: Window | undefined = typeof window === \"undefined\" ? undefined : window,\n) {\n const consoleRef = (win as unknown as { console?: Console } | undefined)\n ?.console;\n if (\n !win?.document ||\n !win.location ||\n !win.history ||\n typeof win.addEventListener !== \"function\" ||\n !consoleRef\n ) {\n return;\n }\n\n const installedTarget = win as unknown as Record<string, boolean>;\n if (installedTarget[INSTALL_KEY]) return;\n installedTarget[INSTALL_KEY] = true;\n\n const state = createRouteChunkRecoveryState();\n\n win.document.addEventListener(\n \"click\",\n (event) => {\n const href = intendedHrefFromClick(win, event);\n if (href) rememberIntendedNavigation(state, href);\n },\n true,\n );\n\n patchHistoryMethod(win, state, \"pushState\");\n patchHistoryMethod(win, state, \"replaceState\");\n patchReload(win, state);\n\n win.addEventListener(\"unhandledrejection\", (event) => {\n const reason = (event as PromiseRejectionEvent).reason;\n const message = String(reason?.message || reason || \"\");\n if (!isDynamicImportFailureMessage(message)) return;\n state.routeModuleFailureAt = Date.now();\n if (recoverToIntendedNavigation(win, state)) {\n event.preventDefault();\n }\n });\n\n // React Router catches stale route-module import failures and reloads the\n // current URL. Its console message is the only signal exposed before reload.\n const originalError = consoleRef.error.bind(consoleRef);\n try {\n consoleRef.error = (...args: unknown[]) => {\n if (args.some(isRouteModuleReloadMessage)) {\n state.routeModuleFailureAt = Date.now();\n recoverToIntendedNavigation(win, state);\n }\n originalError(...args);\n };\n } catch {}\n}\n"]}
1
+ {"version":3,"file":"route-chunk-recovery.js","sourceRoot":"","sources":["../../src/client/route-chunk-recovery.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG,0CAA0C,CAAC;AAC/D,MAAM,uBAAuB,GAAG,MAAM,CAAC;AACvC,8EAA8E;AAC9E,+EAA+E;AAC/E,uEAAuE;AACvE,MAAM,yBAAyB,GAAG,iCAAiC,CAAC;AACpE,MAAM,8BAA8B,GAAG,MAAM,CAAC;AAU9C,MAAM,UAAU,6BAA6B;IAC3C,OAAO;QACL,YAAY,EAAE,IAAI;QAClB,UAAU,EAAE,CAAC;QACb,oBAAoB,EAAE,CAAC;QACvB,YAAY,EAAE,IAAI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AU,CAAC,KAAK,GAAG,CAAC,GAAG,IAAe,EAAE,EAAE;YACxC,IAAI,IAAI,CAAC,IAAI,CAAC,0BAA0B,CAAC,EAAE,CAAC;gBAC1C,KAAK,CAAC,oBAAoB,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;gBACxC,2BAA2B,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YAC1C,CAAC;YACD,aAAa,CAAC,GAAG,IAAI,CAAC,CAAC;QACzB,CAAC,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;AACZ,CAAC","sourcesContent":["const INSTALL_KEY = \"__agentNativeRouteChunkRecoveryInstalled\";\nconst INTENDED_NAV_MAX_AGE_MS = 15_000;\n// Last-resort reload bookkeeping. Persisted in sessionStorage so the cooldown\n// survives the reload it triggers (the in-memory closure is destroyed), with a\n// window-scoped fallback for environments where sessionStorage throws.\nconst STALE_CHUNK_RELOAD_AT_KEY = \"__agentNativeStaleChunkReloadAt\";\nconst STALE_CHUNK_RELOAD_COOLDOWN_MS = 10_000;\n\nexport interface RouteChunkRecoveryState {\n intendedHref: string | null;\n intendedAt: number;\n routeModuleFailureAt: number;\n recoveryHref: string | null;\n recovering: boolean;\n}\n\nexport function createRouteChunkRecoveryState(): RouteChunkRecoveryState {\n return {\n intendedHref: null,\n intendedAt: 0,\n routeModuleFailureAt: 0,\n recoveryHref: null,\n recovering: false,\n };\n}\n\nexport function isRouteModuleReloadMessage(value: unknown): boolean {\n return (\n typeof value === \"string\" &&\n /Error loading route module `[^`]+`, reloading page\\.\\.\\./.test(value)\n );\n}\n\nexport function isDynamicImportFailureMessage(value: unknown): boolean {\n if (typeof value !== \"string\") return false;\n return (\n value.includes(\"Failed to fetch dynamically imported module\") ||\n value.includes(\"error loading dynamically imported module\") ||\n value.includes(\"Importing a module script failed\")\n );\n}\n\nexport function rememberIntendedNavigation(\n state: RouteChunkRecoveryState,\n href: string,\n now = Date.now(),\n): void {\n state.intendedHref = href;\n state.intendedAt = now;\n}\n\nexport function getFreshIntendedNavigation(\n state: RouteChunkRecoveryState,\n currentHref: string,\n now = Date.now(),\n): string | null {\n if (!state.intendedHref) return null;\n if (now - state.intendedAt > INTENDED_NAV_MAX_AGE_MS) return null;\n if (state.intendedHref === currentHref) return null;\n return state.intendedHref;\n}\n\nfunction anchorFromTarget(\n target: EventTarget | null,\n): HTMLAnchorElement | null {\n let node = target as HTMLElement | null;\n while (node) {\n if (\n node.tagName?.toUpperCase() === \"A\" &&\n typeof (node as HTMLAnchorElement).href === \"string\"\n ) {\n return node as HTMLAnchorElement;\n }\n node = node.parentElement;\n }\n return null;\n}\n\nfunction sameOriginHref(win: Window, href: string): string | null {\n try {\n const url = new URL(href, win.location.href);\n return url.origin === win.location.origin ? url.href : null;\n } catch {\n return null;\n }\n}\n\nexport function intendedHrefFromClick(\n win: Window,\n event: MouseEvent,\n): string | null {\n if (event.defaultPrevented) return null;\n if (event.button !== 0) return null;\n if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) {\n return null;\n }\n\n const anchor = anchorFromTarget(event.target);\n if (!anchor) return null;\n if (anchor.hasAttribute(\"download\")) return null;\n const target = anchor.getAttribute(\"target\");\n if (target && target !== \"_self\") return null;\n return sameOriginHref(win, anchor.href);\n}\n\nfunction hardNavigate(win: Window, href: string): void {\n try {\n win.location.assign(href);\n } catch {\n win.location.href = href;\n }\n}\n\nfunction isAgentNativeDesktop(win: Window): boolean {\n return /AgentNativeDesktop/i.test(win.navigator?.userAgent || \"\");\n}\n\nfunction readStaleChunkReloadAt(win: Window): number {\n try {\n const raw = (\n win as unknown as { sessionStorage?: Storage }\n ).sessionStorage?.getItem(STALE_CHUNK_RELOAD_AT_KEY);\n const parsed = raw == null ? NaN : Number(raw);\n if (Number.isFinite(parsed)) return parsed;\n } catch {}\n const mem = (win as unknown as Record<string, unknown>)[\n STALE_CHUNK_RELOAD_AT_KEY\n ];\n return typeof mem === \"number\" ? mem : 0;\n}\n\nfunction markStaleChunkReload(win: Window, now: number): void {\n (win as unknown as Record<string, unknown>)[STALE_CHUNK_RELOAD_AT_KEY] = now;\n try {\n (win as unknown as { sessionStorage?: Storage }).sessionStorage?.setItem(\n STALE_CHUNK_RELOAD_AT_KEY,\n String(now),\n );\n } catch {}\n}\n\n/**\n * Last resort when a stale lazy chunk fails to load for the *current* route —\n * an old tab whose hashed chunk filenames no longer exist after a deploy — and\n * there is no fresh cross-route navigation to recover to. A single guarded\n * reload pulls a fresh index.html plus chunk manifest. A sessionStorage cooldown\n * prevents a reload loop when the chunk is genuinely unreachable (e.g. offline),\n * letting the error surface to Sentry as before in that case.\n *\n * Returns true when a reload was triggered.\n */\nexport function reloadForStaleChunk(\n win: Window | undefined = typeof window === \"undefined\" ? undefined : window,\n now = Date.now(),\n): boolean {\n if (!win?.location) return false;\n // Desktop webviews intentionally stay open across deploys; a forced reload\n // reads as a random tab refresh, matching recoverToIntendedNavigation().\n if (isAgentNativeDesktop(win)) return false;\n const lastReloadAt = readStaleChunkReloadAt(win);\n if (\n lastReloadAt > 0 &&\n now - lastReloadAt <= STALE_CHUNK_RELOAD_COOLDOWN_MS\n ) {\n return false;\n }\n markStaleChunkReload(win, now);\n hardNavigate(win, win.location.href);\n return true;\n}\n\n/**\n * Recover when a caught error (e.g. a `React.lazy` rejection surfaced to an\n * error boundary) is a stale dynamic-import failure. No-op and returns false\n * for any other error so callers can fall through to their normal handling.\n */\nexport function recoverFromStaleChunkError(\n error: unknown,\n win: Window | undefined = typeof window === \"undefined\" ? undefined : window,\n): boolean {\n const message = error instanceof Error ? error.message : String(error ?? \"\");\n if (!isDynamicImportFailureMessage(message)) return false;\n return reloadForStaleChunk(win);\n}\n\nfunction recoverToIntendedNavigation(\n win: Window,\n state: RouteChunkRecoveryState,\n): boolean {\n const target = getFreshIntendedNavigation(state, win.location.href);\n if (!target) return false;\n state.recovering = true;\n state.recoveryHref = target;\n // Desktop webviews stay open across many deploys; a forced navigation here\n // reads as a random tab reload. Leave the current view alive instead.\n if (isAgentNativeDesktop(win)) return true;\n try {\n win.history.replaceState(win.history.state, \"\", target);\n } catch {}\n hardNavigate(win, target);\n return true;\n}\n\nfunction patchHistoryMethod(\n win: Window,\n state: RouteChunkRecoveryState,\n method: \"pushState\" | \"replaceState\",\n): void {\n const original = win.history[method];\n win.history[method] = function patchedHistoryMethod(...args) {\n if (typeof args[2] === \"string\" || args[2] instanceof URL) {\n const href = sameOriginHref(win, String(args[2]));\n if (href) rememberIntendedNavigation(state, href);\n }\n return original.apply(this, args);\n };\n}\n\nfunction patchReload(win: Window, state: RouteChunkRecoveryState): void {\n const originalReload = win.location.reload.bind(win.location);\n const patchedReload = function patchedReload() {\n if (\n isAgentNativeDesktop(win) &&\n Date.now() - state.routeModuleFailureAt <= 1_000\n ) {\n return;\n }\n if (\n state.recoveryHref &&\n Date.now() - state.routeModuleFailureAt <= 1_000\n ) {\n hardNavigate(win, state.recoveryHref);\n return;\n }\n if (\n Date.now() - state.routeModuleFailureAt <= 1_000 &&\n recoverToIntendedNavigation(win, state)\n ) {\n return;\n }\n originalReload();\n };\n\n try {\n Object.defineProperty(win.location, \"reload\", {\n configurable: true,\n value: patchedReload,\n });\n } catch {\n try {\n win.location.reload = patchedReload;\n } catch {}\n }\n}\n\nexport function installRouteChunkRecovery(\n win: Window | undefined = typeof window === \"undefined\" ? undefined : window,\n) {\n const consoleRef = (win as unknown as { console?: Console } | undefined)\n ?.console;\n if (\n !win?.document ||\n !win.location ||\n !win.history ||\n typeof win.addEventListener !== \"function\" ||\n !consoleRef\n ) {\n return;\n }\n\n const installedTarget = win as unknown as Record<string, boolean>;\n if (installedTarget[INSTALL_KEY]) return;\n installedTarget[INSTALL_KEY] = true;\n\n const state = createRouteChunkRecoveryState();\n\n win.document.addEventListener(\n \"click\",\n (event) => {\n const href = intendedHrefFromClick(win, event);\n if (href) rememberIntendedNavigation(state, href);\n },\n true,\n );\n\n patchHistoryMethod(win, state, \"pushState\");\n patchHistoryMethod(win, state, \"replaceState\");\n patchReload(win, state);\n\n win.addEventListener(\"unhandledrejection\", (event) => {\n const reason = (event as PromiseRejectionEvent).reason;\n const message = String(reason?.message || reason || \"\");\n if (!isDynamicImportFailureMessage(message)) return;\n state.routeModuleFailureAt = Date.now();\n if (recoverToIntendedNavigation(win, state)) {\n event.preventDefault();\n return;\n }\n // No fresh cross-route target — the current route's own chunk went stale.\n // Reload once (guarded) to fetch fresh assets instead of leaving the user\n // on a broken view.\n if (reloadForStaleChunk(win)) {\n event.preventDefault();\n }\n });\n\n // React Router catches stale route-module import failures and reloads the\n // current URL. Its console message is the only signal exposed before reload.\n const originalError = consoleRef.error.bind(consoleRef);\n try {\n consoleRef.error = (...args: unknown[]) => {\n if (args.some(isRouteModuleReloadMessage)) {\n state.routeModuleFailureAt = Date.now();\n recoverToIntendedNavigation(win, state);\n }\n originalError(...args);\n };\n } catch {}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/deploy/build.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;GAYG;AAOH,OAAO,EAML,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,qBAAqB,CAAC;AA0B7B,eAAO,MAAM,6BAA6B,UAiBzC,CAAC;AAuBF,wBAAgB,wCAAwC,CACtD,WAAW,EAAE,MAAM,EAAE,GACpB,MAAM,CAaR;AAgBD,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CAAC,CAAC;AAgBvE,wBAAgB,yCAAyC,CACvD,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,MAAM,EACjB,WAAW,SAAK,GACf,IAAI,CAQN;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,eAAe,EAAE,EACzB,WAAW,EAAE,MAAM,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