@hexclave/next 1.0.74 → 1.0.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/dist/{admin-app-impl-FZdANO62.d.ts → admin-app-impl-CsH-gVGz.d.ts} +2 -2
  2. package/dist/{admin-app-impl-FZdANO62.d.ts.map → admin-app-impl-CsH-gVGz.d.ts.map} +1 -1
  3. package/dist/components/api-key-dialogs.d.ts +1 -1
  4. package/dist/dev-tool/dev-tool-core.d.ts.map +1 -1
  5. package/dist/dev-tool/dev-tool-core.js +2 -2
  6. package/dist/dev-tool/dev-tool-core.js.map +1 -1
  7. package/dist/dev-tool/index.d.ts.map +1 -1
  8. package/dist/dev-tool/index.js +2 -8
  9. package/dist/dev-tool/index.js.map +1 -1
  10. package/dist/esm/components/api-key-dialogs.d.ts +1 -1
  11. package/dist/esm/dev-tool/dev-tool-core.d.ts.map +1 -1
  12. package/dist/esm/dev-tool/dev-tool-core.js +1 -1
  13. package/dist/esm/dev-tool/dev-tool-core.js.map +1 -1
  14. package/dist/esm/dev-tool/index.d.ts.map +1 -1
  15. package/dist/esm/dev-tool/index.js +2 -8
  16. package/dist/esm/dev-tool/index.js.map +1 -1
  17. package/dist/esm/generated/quetzal-translations.d.ts +2 -2
  18. package/dist/esm/in-page-ui/dev-environment.d.ts +5 -0
  19. package/dist/esm/in-page-ui/dev-environment.d.ts.map +1 -0
  20. package/dist/esm/in-page-ui/dev-environment.js +18 -0
  21. package/dist/esm/in-page-ui/dev-environment.js.map +1 -0
  22. package/dist/esm/in-page-ui/issue-card.d.ts +52 -0
  23. package/dist/esm/in-page-ui/issue-card.d.ts.map +1 -0
  24. package/dist/esm/in-page-ui/issue-card.js +392 -0
  25. package/dist/esm/in-page-ui/issue-card.js.map +1 -0
  26. package/dist/esm/in-page-ui/issue-card.test.d.ts +1 -0
  27. package/dist/esm/in-page-ui/issue-card.test.js +60 -0
  28. package/dist/esm/in-page-ui/issue-card.test.js.map +1 -0
  29. package/dist/esm/in-page-ui/logo.d.ts +5 -0
  30. package/dist/esm/in-page-ui/logo.d.ts.map +1 -0
  31. package/dist/esm/in-page-ui/logo.js +6 -0
  32. package/dist/esm/in-page-ui/logo.js.map +1 -0
  33. package/dist/esm/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts +1 -1
  34. package/dist/esm/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts.map +1 -1
  35. package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.cross-domain.test.js +140 -15
  36. package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.cross-domain.test.js.map +1 -1
  37. package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.d.ts.map +1 -1
  38. package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.js +95 -12
  39. package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.js.map +1 -1
  40. package/dist/esm/lib/hexclave-app/apps/implementations/common.js +2 -2
  41. package/dist/esm/lib/hexclave-app/apps/implementations/redirect-page-urls.test.js +1 -0
  42. package/dist/esm/lib/hexclave-app/apps/implementations/redirect-page-urls.test.js.map +1 -1
  43. package/dist/esm/pushed-config-error-overlay/index.d.ts.map +1 -1
  44. package/dist/esm/pushed-config-error-overlay/index.js +42 -343
  45. package/dist/esm/pushed-config-error-overlay/index.js.map +1 -1
  46. package/dist/esm/setup-error-overlay/index.d.ts +16 -0
  47. package/dist/esm/setup-error-overlay/index.d.ts.map +1 -0
  48. package/dist/esm/setup-error-overlay/index.js +106 -0
  49. package/dist/esm/setup-error-overlay/index.js.map +1 -0
  50. package/dist/esm/setup-error-overlay/index.test.d.ts +1 -0
  51. package/dist/esm/setup-error-overlay/index.test.js +125 -0
  52. package/dist/esm/setup-error-overlay/index.test.js.map +1 -0
  53. package/dist/generated/quetzal-translations.d.ts +1 -1
  54. package/dist/{hexclave-provider-BKxi3Vy-.d.ts → hexclave-provider-BA97jMlx.d.ts} +2 -2
  55. package/dist/{hexclave-provider-BKxi3Vy-.d.ts.map → hexclave-provider-BA97jMlx.d.ts.map} +1 -1
  56. package/dist/in-page-ui/dev-environment.d.ts +5 -0
  57. package/dist/in-page-ui/dev-environment.d.ts.map +1 -0
  58. package/dist/in-page-ui/dev-environment.js +19 -0
  59. package/dist/in-page-ui/dev-environment.js.map +1 -0
  60. package/dist/in-page-ui/issue-card.d.ts +52 -0
  61. package/dist/in-page-ui/issue-card.d.ts.map +1 -0
  62. package/dist/in-page-ui/issue-card.js +397 -0
  63. package/dist/in-page-ui/issue-card.js.map +1 -0
  64. package/dist/in-page-ui/issue-card.test.d.ts +1 -0
  65. package/dist/in-page-ui/issue-card.test.js +59 -0
  66. package/dist/in-page-ui/issue-card.test.js.map +1 -0
  67. package/dist/in-page-ui/logo.d.ts +5 -0
  68. package/dist/in-page-ui/logo.d.ts.map +1 -0
  69. package/dist/in-page-ui/logo.js +7 -0
  70. package/dist/in-page-ui/logo.js.map +1 -0
  71. package/dist/index.d.ts +1 -1
  72. package/dist/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts +1 -1
  73. package/dist/lib/hexclave-app/apps/implementations/client-app-impl.cross-domain.test.js +140 -15
  74. package/dist/lib/hexclave-app/apps/implementations/client-app-impl.cross-domain.test.js.map +1 -1
  75. package/dist/lib/hexclave-app/apps/implementations/client-app-impl.d.ts +1 -1
  76. package/dist/lib/hexclave-app/apps/implementations/client-app-impl.js +94 -11
  77. package/dist/lib/hexclave-app/apps/implementations/client-app-impl.js.map +1 -1
  78. package/dist/lib/hexclave-app/apps/implementations/common.js +2 -2
  79. package/dist/lib/hexclave-app/apps/implementations/index.d.ts +1 -1
  80. package/dist/lib/hexclave-app/apps/implementations/redirect-page-urls.test.js +1 -0
  81. package/dist/lib/hexclave-app/apps/implementations/redirect-page-urls.test.js.map +1 -1
  82. package/dist/lib/hexclave-app/apps/implementations/server-app-impl.d.ts +1 -1
  83. package/dist/providers/hexclave-provider.d.ts +1 -1
  84. package/dist/providers/translation-provider.d.ts +1 -1
  85. package/dist/pushed-config-error-overlay/index.d.ts.map +1 -1
  86. package/dist/pushed-config-error-overlay/index.js +41 -342
  87. package/dist/pushed-config-error-overlay/index.js.map +1 -1
  88. package/dist/{quetzal-translations-XeH3zQ9l.d.ts → quetzal-translations-CK45_4Dm.d.ts} +3 -3
  89. package/dist/{quetzal-translations-XeH3zQ9l.d.ts.map → quetzal-translations-CK45_4Dm.d.ts.map} +1 -1
  90. package/dist/setup-error-overlay/index.d.ts +16 -0
  91. package/dist/setup-error-overlay/index.d.ts.map +1 -0
  92. package/dist/setup-error-overlay/index.js +108 -0
  93. package/dist/setup-error-overlay/index.js.map +1 -0
  94. package/dist/setup-error-overlay/index.test.d.ts +1 -0
  95. package/dist/setup-error-overlay/index.test.js +124 -0
  96. package/dist/setup-error-overlay/index.test.js.map +1 -0
  97. package/dist/{translation-provider-WOaZXqAz.d.ts → translation-provider-DQ3BJepJ.d.ts} +2 -2
  98. package/dist/{translation-provider-WOaZXqAz.d.ts.map → translation-provider-DQ3BJepJ.d.ts.map} +1 -1
  99. package/package.json +4 -4
  100. package/src/dev-tool/dev-tool-core.ts +1 -4
  101. package/src/dev-tool/index.ts +4 -15
  102. package/src/in-page-ui/dev-environment.ts +33 -0
  103. package/src/in-page-ui/issue-card.test.ts +67 -0
  104. package/src/in-page-ui/issue-card.ts +500 -0
  105. package/src/in-page-ui/logo.ts +8 -0
  106. package/src/lib/hexclave-app/apps/implementations/client-app-impl.cross-domain.test.ts +158 -0
  107. package/src/lib/hexclave-app/apps/implementations/client-app-impl.ts +125 -17
  108. package/src/lib/hexclave-app/apps/implementations/redirect-page-urls.test.ts +1 -0
  109. package/src/pushed-config-error-overlay/index.ts +45 -386
  110. package/src/setup-error-overlay/index.test.ts +133 -0
  111. package/src/setup-error-overlay/index.ts +150 -0
@@ -14,8 +14,8 @@ import { Store } from "@hexclave/shared/dist/utils/stores";
14
14
  import { envVars } from "../../../../generated/env.js";
15
15
  import { resolveHandlerUrls } from "../../url-targets.js";
16
16
  //#region src/lib/hexclave-app/apps/implementations/common.ts
17
- const clientVersion = "js @hexclave/next@1.0.74";
18
- if ("js @hexclave/next@1.0.74".startsWith("STACK_COMPILE_TIME"));
17
+ const clientVersion = "js @hexclave/next@1.0.76";
18
+ if ("js @hexclave/next@1.0.76".startsWith("STACK_COMPILE_TIME"));
19
19
  const replaceHexclavePortPrefix = (input) => {
20
20
  if (!input) return input;
21
21
  const prefix = envVars.HEXCLAVE_PORT_PREFIX;
@@ -7,6 +7,7 @@ async function plan(options) {
7
7
  ...options,
8
8
  noRedirectBack: options.noRedirectBack === true,
9
9
  localOAuthCallbackUrl,
10
+ rawHomeUrl: "/",
10
11
  getCrossDomainHandoffParams: async () => {
11
12
  throw new Error("Continuation-only redirects must not mint a new cross-domain handoff");
12
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"redirect-page-urls.test.js","names":[],"sources":["../../../../../../src/lib/hexclave-app/apps/implementations/redirect-page-urls.test.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { describe, expect, it } from \"vitest\";\nimport { crossDomainAuthQueryParams, planRedirectToHandler } from \"./redirect-page-urls\";\n\nconst localOAuthCallbackUrl = \"https://hosted.example.test/handler/oauth-callback\";\n\nasync function plan(options: {\n handlerName: \"signIn\" | \"forgotPassword\" | \"passwordReset\" | \"afterSignIn\" | \"afterSignUp\",\n rawHandlerUrl: string,\n currentUrl: URL,\n noRedirectBack?: boolean,\n}) {\n return await planRedirectToHandler({\n ...options,\n noRedirectBack: options.noRedirectBack === true,\n localOAuthCallbackUrl,\n getCrossDomainHandoffParams: async () => {\n throw new Error(\"Continuation-only redirects must not mint a new cross-domain handoff\");\n },\n });\n}\n\nfunction expectRedirectUrl(planResult: Awaited<ReturnType<typeof plan>>, baseUrl: URL): URL {\n if (planResult.type !== \"redirect\") {\n throw new Error(\"Expected a direct redirect plan\");\n }\n return new URL(planResult.url, baseUrl);\n}\n\nfunction expectContinuation(url: URL, expectedReturnTo: string): void {\n expect(url.searchParams.get(\"after_auth_return_to\")).toBe(expectedReturnTo);\n expect(url.searchParams.get(crossDomainAuthQueryParams.state)).toBe(\"outer-state\");\n expect(url.searchParams.get(crossDomainAuthQueryParams.codeChallenge)).toBe(\"outer-challenge\");\n expect(url.searchParams.get(crossDomainAuthQueryParams.afterCallbackRedirectUrl)).toBe(\"https://customer.example.test/dashboard\");\n}\n\ndescribe(\"password-flow redirect continuation\", () => {\n it(\"carries the complete customer return state through forgot-password and a reset-email new tab\", async () => {\n const customerReturnTo = \"https://customer.example.test/handler/oauth-callback?hexclave_cross_domain_auth=1\";\n const signInUrl = new URL(\"https://hosted.example.test/handler/sign-in\");\n signInUrl.searchParams.set(\"after_auth_return_to\", customerReturnTo);\n signInUrl.searchParams.set(crossDomainAuthQueryParams.state, \"outer-state\");\n signInUrl.searchParams.set(crossDomainAuthQueryParams.codeChallenge, \"outer-challenge\");\n signInUrl.searchParams.set(crossDomainAuthQueryParams.afterCallbackRedirectUrl, \"https://customer.example.test/dashboard\");\n\n const forgotPlan = await plan({\n handlerName: \"forgotPassword\",\n rawHandlerUrl: \"/handler/forgot-password\",\n currentUrl: signInUrl,\n });\n const forgotUrl = expectRedirectUrl(forgotPlan, signInUrl);\n expectContinuation(forgotUrl, customerReturnTo);\n\n const callbackPlan = await plan({\n handlerName: \"passwordReset\",\n rawHandlerUrl: \"/handler/password-reset\",\n currentUrl: forgotUrl,\n });\n const resetEmailCallbackUrl = expectRedirectUrl(callbackPlan, forgotUrl);\n expectContinuation(resetEmailCallbackUrl, customerReturnTo);\n\n // Model opening the callback in a new tab: only URL state is available.\n resetEmailCallbackUrl.searchParams.set(\"code\", \"reset-code\");\n const signInPlan = await plan({\n handlerName: \"signIn\",\n rawHandlerUrl: \"/handler/sign-in\",\n currentUrl: resetEmailCallbackUrl,\n noRedirectBack: true,\n });\n const finalSignInUrl = expectRedirectUrl(signInPlan, resetEmailCallbackUrl);\n expectContinuation(finalSignInUrl, customerReturnTo);\n expect(finalSignInUrl.searchParams.has(\"code\")).toBe(false);\n });\n\n it.each([\n [\"forgotPassword\", \"/handler/forgot-password\"],\n [\"passwordReset\", \"/handler/password-reset\"],\n ] as const)(\"never synthesizes the current %s page as a return target\", async (handlerName, rawHandlerUrl) => {\n const currentUrl = new URL(`https://hosted.example.test${rawHandlerUrl}?code=reset-code`);\n const result = expectRedirectUrl(await plan({\n handlerName,\n rawHandlerUrl,\n currentUrl,\n }), currentUrl);\n\n expect(result.searchParams.has(\"after_auth_return_to\")).toBe(false);\n expect(result.searchParams.has(\"code\")).toBe(false);\n });\n\n it(\"makes sign-in noRedirectBack suppress capture while preserving only inherited state\", async () => {\n const resetUrlWithoutContinuation = new URL(\"https://hosted.example.test/handler/password-reset?code=reset-code\");\n const result = expectRedirectUrl(await plan({\n handlerName: \"signIn\",\n rawHandlerUrl: \"/handler/sign-in\",\n currentUrl: resetUrlWithoutContinuation,\n noRedirectBack: true,\n }), resetUrlWithoutContinuation);\n\n expect(result.toString()).toBe(\"https://hosted.example.test/handler/sign-in\");\n });\n\n it.each([\"afterSignIn\", \"afterSignUp\"] as const)(\n \"keeps existing %s noRedirectBack semantics\",\n async (handlerName) => {\n const currentUrl = new URL(\"https://hosted.example.test/handler/sign-in?after_auth_return_to=%2Fcustomer\");\n const result = expectRedirectUrl(await plan({\n handlerName,\n rawHandlerUrl: \"/default-after-auth\",\n currentUrl,\n noRedirectBack: true,\n }), currentUrl);\n\n expect(result.toString()).toBe(\"https://hosted.example.test/default-after-auth\");\n },\n );\n});\n"],"mappings":";;;AAOA,MAAM,wBAAwB;AAE9B,eAAe,KAAK,SAKjB;CACD,OAAO,MAAM,sBAAsB;EACjC,GAAG;EACH,gBAAgB,QAAQ,mBAAmB;EAC3C;EACA,6BAA6B,YAAY;GACvC,MAAM,IAAI,MAAM,sEAAsE;EACxF;CACF,CAAC;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EACnD,OAAO,eAAe,aAAa,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,KAAK;CAC5D,CAAC;CAED,GAAG,KAAK,CACN,CAAC,kBAAkB,0BAA0B,GAC7C,CAAC,iBAAiB,yBAAyB,CAC7C,CAAU,CAAC,CAAC,4DAA4D,OAAO,aAAa,kBAAkB;EAC5G,MAAM,aAAa,IAAI,IAAI,8BAA8B,cAAc,iBAAiB;EACxF,MAAM,SAAS,kBAAkB,MAAM,KAAK;GAC1C;GACA;GACA;EACF,CAAC,GAAG,UAAU;EAEd,OAAO,OAAO,aAAa,IAAI,sBAAsB,CAAC,CAAC,CAAC,KAAK,KAAK;EAClE,OAAO,OAAO,aAAa,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,KAAK;CACpD,CAAC;CAED,GAAG,uFAAuF,YAAY;EACpG,MAAM,8BAA8B,IAAI,IAAI,oEAAoE;EAQhH,OAPe,kBAAkB,MAAM,KAAK;GAC1C,aAAa;GACb,eAAe;GACf,YAAY;GACZ,gBAAgB;EAClB,CAAC,GAAG,2BAEQ,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,6CAA6C;CAC9E,CAAC;CAED,GAAG,KAAK,CAAC,eAAe,aAAa,CAAU,CAAC,CAC9C,8CACA,OAAO,gBAAgB;EACrB,MAAM,aAAa,IAAI,IAAI,8EAA8E;EAQzG,OAPe,kBAAkB,MAAM,KAAK;GAC1C;GACA,eAAe;GACf;GACA,gBAAgB;EAClB,CAAC,GAAG,UAEQ,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,gDAAgD;CACjF,CACF;AACF,CAAC"}
1
+ {"version":3,"file":"redirect-page-urls.test.js","names":[],"sources":["../../../../../../src/lib/hexclave-app/apps/implementations/redirect-page-urls.test.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { describe, expect, it } from \"vitest\";\nimport { crossDomainAuthQueryParams, planRedirectToHandler } from \"./redirect-page-urls\";\n\nconst localOAuthCallbackUrl = \"https://hosted.example.test/handler/oauth-callback\";\n\nasync function plan(options: {\n handlerName: \"signIn\" | \"forgotPassword\" | \"passwordReset\" | \"afterSignIn\" | \"afterSignUp\",\n rawHandlerUrl: string,\n currentUrl: URL,\n noRedirectBack?: boolean,\n}) {\n return await planRedirectToHandler({\n ...options,\n noRedirectBack: options.noRedirectBack === true,\n localOAuthCallbackUrl,\n rawHomeUrl: \"/\",\n getCrossDomainHandoffParams: async () => {\n throw new Error(\"Continuation-only redirects must not mint a new cross-domain handoff\");\n },\n });\n}\n\nfunction expectRedirectUrl(planResult: Awaited<ReturnType<typeof plan>>, baseUrl: URL): URL {\n if (planResult.type !== \"redirect\") {\n throw new Error(\"Expected a direct redirect plan\");\n }\n return new URL(planResult.url, baseUrl);\n}\n\nfunction expectContinuation(url: URL, expectedReturnTo: string): void {\n expect(url.searchParams.get(\"after_auth_return_to\")).toBe(expectedReturnTo);\n expect(url.searchParams.get(crossDomainAuthQueryParams.state)).toBe(\"outer-state\");\n expect(url.searchParams.get(crossDomainAuthQueryParams.codeChallenge)).toBe(\"outer-challenge\");\n expect(url.searchParams.get(crossDomainAuthQueryParams.afterCallbackRedirectUrl)).toBe(\"https://customer.example.test/dashboard\");\n}\n\ndescribe(\"password-flow redirect continuation\", () => {\n it(\"carries the complete customer return state through forgot-password and a reset-email new tab\", async () => {\n const customerReturnTo = \"https://customer.example.test/handler/oauth-callback?hexclave_cross_domain_auth=1\";\n const signInUrl = new URL(\"https://hosted.example.test/handler/sign-in\");\n signInUrl.searchParams.set(\"after_auth_return_to\", customerReturnTo);\n signInUrl.searchParams.set(crossDomainAuthQueryParams.state, \"outer-state\");\n signInUrl.searchParams.set(crossDomainAuthQueryParams.codeChallenge, \"outer-challenge\");\n signInUrl.searchParams.set(crossDomainAuthQueryParams.afterCallbackRedirectUrl, \"https://customer.example.test/dashboard\");\n\n const forgotPlan = await plan({\n handlerName: \"forgotPassword\",\n rawHandlerUrl: \"/handler/forgot-password\",\n currentUrl: signInUrl,\n });\n const forgotUrl = expectRedirectUrl(forgotPlan, signInUrl);\n expectContinuation(forgotUrl, customerReturnTo);\n\n const callbackPlan = await plan({\n handlerName: \"passwordReset\",\n rawHandlerUrl: \"/handler/password-reset\",\n currentUrl: forgotUrl,\n });\n const resetEmailCallbackUrl = expectRedirectUrl(callbackPlan, forgotUrl);\n expectContinuation(resetEmailCallbackUrl, customerReturnTo);\n\n // Model opening the callback in a new tab: only URL state is available.\n resetEmailCallbackUrl.searchParams.set(\"code\", \"reset-code\");\n const signInPlan = await plan({\n handlerName: \"signIn\",\n rawHandlerUrl: \"/handler/sign-in\",\n currentUrl: resetEmailCallbackUrl,\n noRedirectBack: true,\n });\n const finalSignInUrl = expectRedirectUrl(signInPlan, resetEmailCallbackUrl);\n expectContinuation(finalSignInUrl, customerReturnTo);\n expect(finalSignInUrl.searchParams.has(\"code\")).toBe(false);\n });\n\n it.each([\n [\"forgotPassword\", \"/handler/forgot-password\"],\n [\"passwordReset\", \"/handler/password-reset\"],\n ] as const)(\"never synthesizes the current %s page as a return target\", async (handlerName, rawHandlerUrl) => {\n const currentUrl = new URL(`https://hosted.example.test${rawHandlerUrl}?code=reset-code`);\n const result = expectRedirectUrl(await plan({\n handlerName,\n rawHandlerUrl,\n currentUrl,\n }), currentUrl);\n\n expect(result.searchParams.has(\"after_auth_return_to\")).toBe(false);\n expect(result.searchParams.has(\"code\")).toBe(false);\n });\n\n it(\"makes sign-in noRedirectBack suppress capture while preserving only inherited state\", async () => {\n const resetUrlWithoutContinuation = new URL(\"https://hosted.example.test/handler/password-reset?code=reset-code\");\n const result = expectRedirectUrl(await plan({\n handlerName: \"signIn\",\n rawHandlerUrl: \"/handler/sign-in\",\n currentUrl: resetUrlWithoutContinuation,\n noRedirectBack: true,\n }), resetUrlWithoutContinuation);\n\n expect(result.toString()).toBe(\"https://hosted.example.test/handler/sign-in\");\n });\n\n it.each([\"afterSignIn\", \"afterSignUp\"] as const)(\n \"keeps existing %s noRedirectBack semantics\",\n async (handlerName) => {\n const currentUrl = new URL(\"https://hosted.example.test/handler/sign-in?after_auth_return_to=%2Fcustomer\");\n const result = expectRedirectUrl(await plan({\n handlerName,\n rawHandlerUrl: \"/default-after-auth\",\n currentUrl,\n noRedirectBack: true,\n }), currentUrl);\n\n expect(result.toString()).toBe(\"https://hosted.example.test/default-after-auth\");\n },\n );\n});\n"],"mappings":";;;AAOA,MAAM,wBAAwB;AAE9B,eAAe,KAAK,SAKjB;CACD,OAAO,MAAM,sBAAsB;EACjC,GAAG;EACH,gBAAgB,QAAQ,mBAAmB;EAC3C;EACA,YAAY;EACZ,6BAA6B,YAAY;GACvC,MAAM,IAAI,MAAM,sEAAsE;EACxF;CACF,CAAC;AACH;AAEA,SAAS,kBAAkB,YAA8C,SAAmB;CAC1F,IAAI,WAAW,SAAS,YACtB,MAAM,IAAI,MAAM,iCAAiC;CAEnD,OAAO,IAAI,IAAI,WAAW,KAAK,OAAO;AACxC;AAEA,SAAS,mBAAmB,KAAU,kBAAgC;CACpE,OAAO,IAAI,aAAa,IAAI,sBAAsB,CAAC,CAAC,CAAC,KAAK,gBAAgB;CAC1E,OAAO,IAAI,aAAa,IAAI,2BAA2B,KAAK,CAAC,CAAC,CAAC,KAAK,aAAa;CACjF,OAAO,IAAI,aAAa,IAAI,2BAA2B,aAAa,CAAC,CAAC,CAAC,KAAK,iBAAiB;CAC7F,OAAO,IAAI,aAAa,IAAI,2BAA2B,wBAAwB,CAAC,CAAC,CAAC,KAAK,yCAAyC;AAClI;AAEA,SAAS,6CAA6C;CACpD,GAAG,gGAAgG,YAAY;EAC7G,MAAM,mBAAmB;EACzB,MAAM,YAAY,IAAI,IAAI,6CAA6C;EACvE,UAAU,aAAa,IAAI,wBAAwB,gBAAgB;EACnE,UAAU,aAAa,IAAI,2BAA2B,OAAO,aAAa;EAC1E,UAAU,a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KAAK,6CAA6C;CAC9E,CAAC;CAED,GAAG,KAAK,CAAC,eAAe,aAAa,CAAU,CAAC,CAC9C,8CACA,OAAO,gBAAgB;EACrB,MAAM,aAAa,IAAI,IAAI,8EAA8E;EAQzG,OAPe,kBAAkB,MAAM,KAAK;GAC1C;GACA,eAAe;GACf;GACA,gBAAgB;EAClB,CAAC,GAAG,UAEQ,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,gDAAgD;CACjF,CACF;AACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/pushed-config-error-overlay/index.ts"],"mappings":";;;iBA6VgB,6BAAA,CAA8B,GAAyB,EAApB,cAAc"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/pushed-config-error-overlay/index.ts"],"mappings":";;;iBAkEgB,6BAAA,CAA8B,GAAyB,EAApB,cAAc"}
@@ -1,250 +1,13 @@
1
1
  import { runAsynchronously } from "@hexclave/shared/dist/utils/promises";
2
- import { canMountIntoDom, getGlobalUiInstance, h, setGlobalUiInstance, setHtml } from "../in-page-ui/dom.js";
3
- import { getInPageUiBaseCSS } from "../in-page-ui/base-styles.js";
2
+ import { canMountIntoDom, getGlobalUiInstance, h, setGlobalUiInstance } from "../in-page-ui/dom.js";
4
3
  import { captureError } from "@hexclave/shared/dist/utils/errors";
5
- import { isLocalhost } from "@hexclave/shared/dist/utils/urls";
6
- import { envVars } from "../generated/env.js";
4
+ import { isLikelyDevelopmentEnvironment } from "../in-page-ui/dev-environment.js";
5
+ import { getIssueCardCSS, renderIssueCard, renderIssuePill, trapFocusInIssueCard } from "../in-page-ui/issue-card.js";
7
6
  //#region src/pushed-config-error-overlay/index.ts
8
7
  const GLOBAL_INSTANCE_KEY = "__hexclave-pushed-config-error-overlay";
9
8
  const MINIMIZED_STORAGE_KEY = "hexclave-pushed-config-error-minimized-key";
10
9
  const REFRESH_INTERVAL_MS = 5e3;
11
- const HEXCLAVE_LOGO_SVG = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 48 48\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"3\" stroke-linejoin=\"miter\"><path d=\"M 24 4 L 41.32 14 L 41.32 34 L 24 44 L 6.68 34 L 6.68 14 Z\"/><path d=\"M 11 16.87 L 14 15.13 L 14 32.87 L 11 31.13 Z\" fill=\"currentColor\" stroke=\"none\"/><path d=\"M 11 16.87 L 14 15.13 L 14 32.87 L 11 31.13 Z\" fill=\"currentColor\" stroke=\"none\" transform=\"rotate(120 24 24)\"/><path d=\"M 11 16.87 L 14 15.13 L 14 32.87 L 11 31.13 Z\" fill=\"currentColor\" stroke=\"none\" transform=\"rotate(240 24 24)\"/></svg>";
12
- const COPY_ICON_SVG = "<svg width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.25\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect x=\"9\" y=\"9\" width=\"13\" height=\"13\" rx=\"2\"/><path d=\"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1\"/></svg>";
13
- const css = getInPageUiBaseCSS(".hexclave-config-error-overlay") + `
14
- .hexclave-config-error-overlay .hce-backdrop {
15
- position: fixed;
16
- inset: 0;
17
- z-index: 2147483647;
18
- display: flex;
19
- align-items: center;
20
- justify-content: center;
21
- padding: 24px;
22
- background: rgba(0, 0, 0, 0.46);
23
- backdrop-filter: blur(6px);
24
- overflow: auto;
25
- }
26
-
27
- .hexclave-config-error-overlay .hce-card {
28
- --hce-status: var(--sdt-error);
29
- width: min(720px, calc(100vw - 32px));
30
- max-height: min(640px, calc(100dvh - 48px));
31
- border: 1px solid color-mix(in srgb, var(--hce-status) 35%, var(--sdt-border));
32
- border-radius: 18px;
33
- background: var(--sdt-overlay-bg);
34
- box-shadow: var(--sdt-shadow);
35
- backdrop-filter: blur(18px);
36
- display: flex;
37
- overflow: hidden;
38
- }
39
-
40
- .hexclave-config-error-overlay .hce-card-warning {
41
- --hce-status: var(--sdt-warning);
42
- }
43
-
44
- .hexclave-config-error-overlay .hce-card-inner {
45
- padding: 18px;
46
- width: 100%;
47
- overflow: auto;
48
- }
49
-
50
- .hexclave-config-error-overlay .hce-header {
51
- display: flex;
52
- align-items: flex-start;
53
- justify-content: space-between;
54
- gap: 12px;
55
- margin-bottom: 12px;
56
- }
57
-
58
- .hexclave-config-error-overlay .hce-title-row {
59
- display: flex;
60
- align-items: flex-start;
61
- gap: 10px;
62
- min-width: 0;
63
- }
64
-
65
- .hexclave-config-error-overlay .hce-logo {
66
- flex-shrink: 0;
67
- display: flex;
68
- align-items: center;
69
- justify-content: center;
70
- width: 34px;
71
- height: 34px;
72
- border-radius: 10px;
73
- background: var(--hce-status);
74
- color: white;
75
- box-shadow: 0 10px 30px color-mix(in srgb, var(--hce-status) 32%, transparent);
76
- }
77
-
78
- .hexclave-config-error-overlay .hce-badge {
79
- display: inline-flex;
80
- flex-shrink: 0;
81
- padding: 2px 6px;
82
- border-radius: 999px;
83
- background: var(--hce-status);
84
- color: white;
85
- font-size: 10px;
86
- font-weight: 700;
87
- letter-spacing: 0.06em;
88
- text-transform: uppercase;
89
- }
90
-
91
- .hexclave-config-error-overlay .hce-title {
92
- color: var(--sdt-text);
93
- margin-top: 4px;
94
- font-size: 18px;
95
- font-weight: 700;
96
- line-height: 1.25;
97
- }
98
-
99
- .hexclave-config-error-overlay .hce-actions {
100
- display: flex;
101
- gap: 4px;
102
- }
103
-
104
- .hexclave-config-error-overlay .hce-icon-btn {
105
- display: inline-flex;
106
- align-items: center;
107
- justify-content: center;
108
- width: 28px;
109
- height: 28px;
110
- border: 1px solid var(--sdt-border);
111
- border-radius: 8px;
112
- background: var(--sdt-bg-elevated);
113
- color: var(--sdt-text-secondary);
114
- cursor: pointer;
115
- font: inherit;
116
- line-height: 1;
117
- vertical-align: top;
118
- }
119
-
120
- .hexclave-config-error-overlay .hce-icon-btn svg {
121
- display: block;
122
- flex-shrink: 0;
123
- }
124
-
125
- .hexclave-config-error-overlay .hce-text-btn {
126
- align-items: center;
127
- gap: 6px;
128
- min-height: 28px;
129
- padding: 0 10px;
130
- width: auto;
131
- font-size: 12px;
132
- line-height: 1;
133
- }
134
-
135
- .hexclave-config-error-overlay .hce-icon-btn:hover {
136
- background: var(--sdt-bg-hover);
137
- color: var(--sdt-text);
138
- }
139
-
140
- .hexclave-config-error-overlay .hce-body {
141
- color: var(--sdt-text-secondary);
142
- font-size: 14px;
143
- line-height: 1.5;
144
- }
145
-
146
- .hexclave-config-error-overlay .hce-message-header {
147
- display: flex;
148
- align-items: center;
149
- justify-content: space-between;
150
- gap: 10px;
151
- margin-top: 14px;
152
- margin-bottom: 8px;
153
- }
154
-
155
- .hexclave-config-error-overlay .hce-message-label {
156
- color: var(--sdt-text);
157
- font-size: 12px;
158
- font-weight: 650;
159
- }
160
-
161
- .hexclave-config-error-overlay .hce-message {
162
- padding: 12px;
163
- max-height: min(260px, max(96px, 30dvh));
164
- overflow: auto;
165
- border: 1px solid var(--sdt-border-subtle);
166
- border-radius: 10px;
167
- background: var(--sdt-bg-subtle);
168
- color: var(--sdt-text);
169
- font-family: var(--sdt-font-mono);
170
- font-size: 12px;
171
- white-space: pre-wrap;
172
- overflow-wrap: anywhere;
173
- }
174
-
175
- .hexclave-config-error-overlay .hce-footer {
176
- margin-top: 10px;
177
- color: var(--sdt-text-tertiary);
178
- font-size: 12px;
179
- }
180
-
181
- .hexclave-config-error-overlay .hce-pill {
182
- position: fixed;
183
- right: 18px;
184
- bottom: 18px;
185
- z-index: 2147483647;
186
- display: flex;
187
- align-items: center;
188
- gap: 8px;
189
- padding: 8px 12px 8px 8px;
190
- --hce-status: var(--sdt-error);
191
- border: 1px solid color-mix(in srgb, var(--hce-status) 35%, var(--sdt-border));
192
- border-radius: 999px;
193
- background: var(--sdt-overlay-bg);
194
- box-shadow: var(--sdt-trigger-shadow);
195
- color: var(--sdt-text);
196
- cursor: pointer;
197
- font: inherit;
198
- backdrop-filter: blur(18px);
199
- }
200
-
201
- .hexclave-config-error-overlay .hce-pill-warning {
202
- --hce-status: var(--sdt-warning);
203
- }
204
-
205
- .hexclave-config-error-overlay .hce-pill-logo {
206
- display: flex;
207
- align-items: center;
208
- justify-content: center;
209
- width: 26px;
210
- height: 26px;
211
- border-radius: 999px;
212
- background: var(--hce-status);
213
- color: white;
214
- }
215
-
216
- @media (max-height: 520px) {
217
- .hexclave-config-error-overlay .hce-backdrop {
218
- align-items: flex-start;
219
- padding: 12px;
220
- }
221
-
222
- .hexclave-config-error-overlay .hce-card {
223
- width: min(720px, calc(100vw - 24px));
224
- max-height: calc(100dvh - 24px);
225
- }
226
-
227
- .hexclave-config-error-overlay .hce-card-inner {
228
- padding: 12px;
229
- }
230
-
231
- .hexclave-config-error-overlay .hce-header {
232
- margin-bottom: 8px;
233
- }
234
-
235
- .hexclave-config-error-overlay .hce-title {
236
- font-size: 16px;
237
- }
238
-
239
- .hexclave-config-error-overlay .hce-body {
240
- font-size: 13px;
241
- }
242
-
243
- .hexclave-config-error-overlay .hce-message {
244
- max-height: max(80px, 24dvh);
245
- }
246
- }
247
- `;
10
+ const css = getIssueCardCSS(".hexclave-config-error-overlay");
248
11
  function storageGet(key) {
249
12
  try {
250
13
  return localStorage.getItem(key);
@@ -263,38 +26,7 @@ function storageRemove(key) {
263
26
  } catch {}
264
27
  }
265
28
  function shouldMount() {
266
- if (!canMountIntoDom()) return false;
267
- const nodeEnv = envVars.NODE_ENV;
268
- if (nodeEnv !== void 0) return nodeEnv === "development";
269
- try {
270
- if (new URL(window.location.href).protocol === "file:") return true;
271
- } catch {
272
- return false;
273
- }
274
- return isLocalhost(window.location.href);
275
- }
276
- async function copyTextToClipboard(text) {
277
- const clipboard = Reflect.get(navigator, "clipboard");
278
- const writeText = clipboard != null && typeof clipboard === "object" ? Reflect.get(clipboard, "writeText") : null;
279
- if (typeof writeText === "function") {
280
- await writeText.call(clipboard, text);
281
- return;
282
- }
283
- const textarea = h("textarea", {
284
- style: {
285
- position: "fixed",
286
- left: "-9999px",
287
- top: "0",
288
- opacity: "0"
289
- },
290
- readonly: "true"
291
- });
292
- textarea.value = text;
293
- document.body.appendChild(textarea);
294
- textarea.select();
295
- const copied = document.execCommand("copy");
296
- textarea.remove();
297
- if (!copied) throw new Error("Browser refused to copy the config error message.");
29
+ return canMountIntoDom() && isLikelyDevelopmentEnvironment();
298
30
  }
299
31
  function buildConfigIssueAiPrompt(issue) {
300
32
  const issueLabel = issue.kind === "error" ? "error" : "warning";
@@ -321,11 +53,19 @@ function mountPushedConfigErrorOverlay(app) {
321
53
  let lastErrorKey = null;
322
54
  let lastConsoleErrorKey = null;
323
55
  let minimized = false;
56
+ let focusedIssueKey = null;
57
+ let focusTrap = null;
58
+ const releaseFocusIfHeld = () => {
59
+ focusTrap?.release();
60
+ focusTrap = null;
61
+ focusedIssueKey = null;
62
+ };
324
63
  const render = (issue) => {
325
64
  root.replaceChildren(style);
326
65
  if (issue == null) {
327
66
  lastErrorKey = null;
328
67
  minimized = false;
68
+ releaseFocusIfHeld();
329
69
  return;
330
70
  }
331
71
  const issueMessage = "Hexclave config " + issue.kind + ": " + issue.messages.join("\n");
@@ -345,87 +85,45 @@ function mountPushedConfigErrorOverlay(app) {
345
85
  minimized = storageGet(MINIMIZED_STORAGE_KEY) === issueKey;
346
86
  }
347
87
  if (minimized) {
348
- const logoSpan = h("span", { className: "hce-pill-logo" });
349
- setHtml(logoSpan, HEXCLAVE_LOGO_SVG);
350
- root.appendChild(h("button", {
351
- className: issue.kind === "error" ? "hce-pill" : "hce-pill hce-pill-warning",
352
- type: "button",
88
+ releaseFocusIfHeld();
89
+ root.appendChild(renderIssuePill({
90
+ kind: issue.kind,
91
+ label: issue.kind === "error" ? "Config error" : "Config warning",
92
+ ariaLabel: `Show Hexclave config ${issueLabel}`,
353
93
  onClick: () => {
354
94
  minimized = false;
355
95
  storageRemove(MINIMIZED_STORAGE_KEY);
356
96
  render(issue);
357
97
  }
358
- }, logoSpan, h("span", null, issue.kind === "error" ? "Config error" : "Config warning")));
98
+ }));
359
99
  return;
360
100
  }
361
- const logoSpan = h("span", { className: "hce-logo" });
362
- setHtml(logoSpan, HEXCLAVE_LOGO_SVG);
363
- const copyButton = h("button", {
364
- className: "hce-icon-btn hce-text-btn",
365
- type: "button",
366
- title: issue.kind === "error" ? "Copy error message" : "Copy warning message",
367
- "aria-label": issue.kind === "error" ? "Copy config error message" : "Copy config warning message",
368
- onClick: () => {
369
- runAsynchronously(async () => {
370
- await copyTextToClipboard(issueMessage);
371
- copyButton.textContent = "Copied";
372
- setTimeout(() => {
373
- setHtml(copyButton, `${COPY_ICON_SVG}Copy`);
374
- }, 1500);
375
- }, {
376
- noErrorLogging: true,
377
- onError: (copyError) => {
378
- captureError("pushed-config-error-overlay-copy", copyError);
379
- copyButton.textContent = "Copy failed";
380
- setTimeout(() => {
381
- setHtml(copyButton, `${COPY_ICON_SVG}Copy`);
382
- }, 1500);
383
- }
384
- });
385
- }
386
- });
387
- setHtml(copyButton, `${COPY_ICON_SVG}Copy`);
388
- const aiPromptCopyButton = h("button", {
389
- className: "hce-icon-btn",
390
- type: "button",
391
- title: "Copy AI prompt",
392
- "aria-label": issue.kind === "error" ? "Copy AI prompt for config error" : "Copy AI prompt for config warning",
393
- onClick: () => {
394
- runAsynchronously(async () => {
395
- await copyTextToClipboard(buildConfigIssueAiPrompt(issue));
396
- aiPromptCopyButton.textContent = "✓";
397
- setTimeout(() => {
398
- setHtml(aiPromptCopyButton, COPY_ICON_SVG);
399
- }, 1500);
400
- }, {
401
- noErrorLogging: true,
402
- onError: (copyError) => {
403
- captureError("pushed-config-error-overlay-copy-ai-prompt", copyError);
404
- aiPromptCopyButton.textContent = "!";
405
- setTimeout(() => {
406
- setHtml(aiPromptCopyButton, COPY_ICON_SVG);
407
- }, 1500);
408
- }
409
- });
410
- }
411
- });
412
- setHtml(aiPromptCopyButton, COPY_ICON_SVG);
413
- root.appendChild(h("div", { className: "hce-backdrop" }, h("div", {
414
- className: issue.kind === "error" ? "hce-card" : "hce-card hce-card-warning",
415
- role: "alertdialog",
416
- "aria-modal": "true",
417
- "aria-label": `Hexclave config ${issueLabel}`
418
- }, h("div", { className: "hce-card-inner" }, h("div", { className: "hce-header" }, h("div", { className: "hce-title-row" }, logoSpan, h("div", null, h("span", { className: "hce-badge" }, `Config ${issueLabel}`), h("div", { className: "hce-title" }, issueTitle))), h("div", { className: "hce-actions" }, aiPromptCopyButton, h("button", {
419
- className: "hce-icon-btn",
420
- type: "button",
421
- title: "Minimize",
422
- "aria-label": issue.kind === "error" ? "Minimize config error" : "Minimize config warning",
423
- onClick: () => {
101
+ root.appendChild(renderIssueCard({
102
+ kind: issue.kind,
103
+ badge: `Config ${issueLabel}`,
104
+ title: issueTitle,
105
+ bodyText,
106
+ messageLabel: issue.kind === "error" ? "Error message" : "Warning message",
107
+ message: issueMessage,
108
+ footerText,
109
+ ariaLabel: `Hexclave config ${issueLabel}`,
110
+ aiPrompt: buildConfigIssueAiPrompt(issue),
111
+ onCopyError: (copyError) => captureError("pushed-config-error-overlay-copy", copyError),
112
+ onCopyAiPromptError: (copyError) => captureError("pushed-config-error-overlay-copy-ai-prompt", copyError),
113
+ onMinimize: () => {
424
114
  minimized = true;
425
115
  storageSet(MINIMIZED_STORAGE_KEY, issueKey);
426
116
  render(issue);
427
117
  }
428
- }, "–"))), h("div", { className: "hce-body" }, bodyText, h("div", { className: "hce-message-header" }, h("div", { className: "hce-message-label" }, issue.kind === "error" ? "Error message" : "Warning message"), copyButton), h("div", { className: "hce-message" }, issueMessage), h("div", { className: "hce-footer" }, footerText))))));
118
+ }));
119
+ const isNewIssue = focusedIssueKey !== issueKey;
120
+ const previouslyFocused = isNewIssue ? void 0 : focusTrap?.previouslyFocused ?? null;
121
+ focusTrap?.release({ restoreFocus: isNewIssue });
122
+ focusedIssueKey = issueKey;
123
+ focusTrap = trapFocusInIssueCard(root, {
124
+ moveFocusIntoCard: isNewIssue,
125
+ previouslyFocused
126
+ });
429
127
  };
430
128
  const refresh = () => {
431
129
  if (disposed || !canMountIntoDom()) return;
@@ -451,6 +149,7 @@ function mountPushedConfigErrorOverlay(app) {
451
149
  const cleanup = () => {
452
150
  disposed = true;
453
151
  clearInterval(interval);
152
+ releaseFocusIfHeld();
454
153
  root.remove();
455
154
  if (getGlobalUiInstance(GLOBAL_INSTANCE_KEY)?.cleanup === cleanup) setGlobalUiInstance(GLOBAL_INSTANCE_KEY, null);
456
155
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/pushed-config-error-overlay/index.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\n\nimport { captureError } from \"@hexclave/shared/dist/utils/errors\";\nimport { runAsynchronously } from \"@hexclave/shared/dist/utils/promises\";\nimport { isLocalhost } from \"@hexclave/shared/dist/utils/urls\";\nimport { envVars } from \"../generated/env\";\nimport { getInPageUiBaseCSS } from \"../in-page-ui/base-styles\";\nimport { canMountIntoDom, getGlobalUiInstance, h, setGlobalUiInstance, setHtml } from \"../in-page-ui/dom\";\nimport type { StackClientApp } from \"../lib/hexclave-app\";\n\nconst GLOBAL_INSTANCE_KEY = \"__hexclave-pushed-config-error-overlay\";\nconst MINIMIZED_STORAGE_KEY = \"hexclave-pushed-config-error-minimized-key\";\nconst REFRESH_INTERVAL_MS = 5_000;\nconst HEXCLAVE_LOGO_SVG = '<svg width=\"16\" height=\"16\" viewBox=\"0 0 48 48\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"3\" stroke-linejoin=\"miter\"><path d=\"M 24 4 L 41.32 14 L 41.32 34 L 24 44 L 6.68 34 L 6.68 14 Z\"/><path d=\"M 11 16.87 L 14 15.13 L 14 32.87 L 11 31.13 Z\" fill=\"currentColor\" stroke=\"none\"/><path d=\"M 11 16.87 L 14 15.13 L 14 32.87 L 11 31.13 Z\" fill=\"currentColor\" stroke=\"none\" transform=\"rotate(120 24 24)\"/><path d=\"M 11 16.87 L 14 15.13 L 14 32.87 L 11 31.13 Z\" fill=\"currentColor\" stroke=\"none\" transform=\"rotate(240 24 24)\"/></svg>';\nconst COPY_ICON_SVG = '<svg width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.25\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect x=\"9\" y=\"9\" width=\"13\" height=\"13\" rx=\"2\"/><path d=\"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1\"/></svg>';\n\ntype ConfigIssue = {\n kind: \"error\" | \"warning\",\n messages: string[],\n};\n\nconst css = getInPageUiBaseCSS(\".hexclave-config-error-overlay\") + `\n .hexclave-config-error-overlay .hce-backdrop {\n position: fixed;\n inset: 0;\n z-index: 2147483647;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 24px;\n background: rgba(0, 0, 0, 0.46);\n backdrop-filter: blur(6px);\n overflow: auto;\n }\n\n .hexclave-config-error-overlay .hce-card {\n --hce-status: var(--sdt-error);\n width: min(720px, calc(100vw - 32px));\n max-height: min(640px, calc(100dvh - 48px));\n border: 1px solid color-mix(in srgb, var(--hce-status) 35%, var(--sdt-border));\n border-radius: 18px;\n background: var(--sdt-overlay-bg);\n box-shadow: var(--sdt-shadow);\n backdrop-filter: blur(18px);\n display: flex;\n overflow: hidden;\n }\n\n .hexclave-config-error-overlay .hce-card-warning {\n --hce-status: var(--sdt-warning);\n }\n\n .hexclave-config-error-overlay .hce-card-inner {\n padding: 18px;\n width: 100%;\n overflow: auto;\n }\n\n .hexclave-config-error-overlay .hce-header {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n gap: 12px;\n margin-bottom: 12px;\n }\n\n .hexclave-config-error-overlay .hce-title-row {\n display: flex;\n align-items: flex-start;\n gap: 10px;\n min-width: 0;\n }\n\n .hexclave-config-error-overlay .hce-logo {\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 34px;\n height: 34px;\n border-radius: 10px;\n background: var(--hce-status);\n color: white;\n box-shadow: 0 10px 30px color-mix(in srgb, var(--hce-status) 32%, transparent);\n }\n\n .hexclave-config-error-overlay .hce-badge {\n display: inline-flex;\n flex-shrink: 0;\n padding: 2px 6px;\n border-radius: 999px;\n background: var(--hce-status);\n color: white;\n font-size: 10px;\n font-weight: 700;\n letter-spacing: 0.06em;\n text-transform: uppercase;\n }\n\n .hexclave-config-error-overlay .hce-title {\n color: var(--sdt-text);\n margin-top: 4px;\n font-size: 18px;\n font-weight: 700;\n line-height: 1.25;\n }\n\n .hexclave-config-error-overlay .hce-actions {\n display: flex;\n gap: 4px;\n }\n\n .hexclave-config-error-overlay .hce-icon-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n border: 1px solid var(--sdt-border);\n border-radius: 8px;\n background: var(--sdt-bg-elevated);\n color: var(--sdt-text-secondary);\n cursor: pointer;\n font: inherit;\n line-height: 1;\n vertical-align: top;\n }\n\n .hexclave-config-error-overlay .hce-icon-btn svg {\n display: block;\n flex-shrink: 0;\n }\n\n .hexclave-config-error-overlay .hce-text-btn {\n align-items: center;\n gap: 6px;\n min-height: 28px;\n padding: 0 10px;\n width: auto;\n font-size: 12px;\n line-height: 1;\n }\n\n .hexclave-config-error-overlay .hce-icon-btn:hover {\n background: var(--sdt-bg-hover);\n color: var(--sdt-text);\n }\n\n .hexclave-config-error-overlay .hce-body {\n color: var(--sdt-text-secondary);\n font-size: 14px;\n line-height: 1.5;\n }\n\n .hexclave-config-error-overlay .hce-message-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 10px;\n margin-top: 14px;\n margin-bottom: 8px;\n }\n\n .hexclave-config-error-overlay .hce-message-label {\n color: var(--sdt-text);\n font-size: 12px;\n font-weight: 650;\n }\n\n .hexclave-config-error-overlay .hce-message {\n padding: 12px;\n max-height: min(260px, max(96px, 30dvh));\n overflow: auto;\n border: 1px solid var(--sdt-border-subtle);\n border-radius: 10px;\n background: var(--sdt-bg-subtle);\n color: var(--sdt-text);\n font-family: var(--sdt-font-mono);\n font-size: 12px;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n }\n\n .hexclave-config-error-overlay .hce-footer {\n margin-top: 10px;\n color: var(--sdt-text-tertiary);\n font-size: 12px;\n }\n\n .hexclave-config-error-overlay .hce-pill {\n position: fixed;\n right: 18px;\n bottom: 18px;\n z-index: 2147483647;\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 12px 8px 8px;\n --hce-status: var(--sdt-error);\n border: 1px solid color-mix(in srgb, var(--hce-status) 35%, var(--sdt-border));\n border-radius: 999px;\n background: var(--sdt-overlay-bg);\n box-shadow: var(--sdt-trigger-shadow);\n color: var(--sdt-text);\n cursor: pointer;\n font: inherit;\n backdrop-filter: blur(18px);\n }\n\n .hexclave-config-error-overlay .hce-pill-warning {\n --hce-status: var(--sdt-warning);\n }\n\n .hexclave-config-error-overlay .hce-pill-logo {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 26px;\n height: 26px;\n border-radius: 999px;\n background: var(--hce-status);\n color: white;\n }\n\n @media (max-height: 520px) {\n .hexclave-config-error-overlay .hce-backdrop {\n align-items: flex-start;\n padding: 12px;\n }\n\n .hexclave-config-error-overlay .hce-card {\n width: min(720px, calc(100vw - 24px));\n max-height: calc(100dvh - 24px);\n }\n\n .hexclave-config-error-overlay .hce-card-inner {\n padding: 12px;\n }\n\n .hexclave-config-error-overlay .hce-header {\n margin-bottom: 8px;\n }\n\n .hexclave-config-error-overlay .hce-title {\n font-size: 16px;\n }\n\n .hexclave-config-error-overlay .hce-body {\n font-size: 13px;\n }\n\n .hexclave-config-error-overlay .hce-message {\n max-height: max(80px, 24dvh);\n }\n }\n`;\n\nfunction storageGet(key: string): string | null {\n try {\n return localStorage.getItem(key);\n } catch {\n return null;\n }\n}\n\nfunction storageSet(key: string, value: string): void {\n try {\n localStorage.setItem(key, value);\n } catch {\n // Storage may be unavailable in private or embedded contexts.\n }\n}\n\nfunction storageRemove(key: string): void {\n try {\n localStorage.removeItem(key);\n } catch {\n // Storage may be unavailable in private or embedded contexts.\n }\n}\n\nfunction shouldMount(): boolean {\n if (!canMountIntoDom()) {\n return false;\n }\n\n const nodeEnv = envVars.NODE_ENV;\n if (nodeEnv !== undefined) {\n return nodeEnv === \"development\";\n }\n\n try {\n const url = new URL(window.location.href);\n if (url.protocol === \"file:\") {\n return true;\n }\n } catch {\n return false;\n }\n return isLocalhost(window.location.href);\n}\n\nasync function copyTextToClipboard(text: string): Promise<void> {\n const clipboard: unknown = Reflect.get(navigator, \"clipboard\");\n const writeText = clipboard != null && typeof clipboard === \"object\"\n ? Reflect.get(clipboard, \"writeText\")\n : null;\n if (typeof writeText === \"function\") {\n await writeText.call(clipboard, text);\n return;\n }\n\n const textarea = h(\"textarea\", {\n style: {\n position: \"fixed\",\n left: \"-9999px\",\n top: \"0\",\n opacity: \"0\",\n },\n readonly: \"true\",\n }) as HTMLTextAreaElement;\n textarea.value = text;\n document.body.appendChild(textarea);\n textarea.select();\n const copied = document.execCommand(\"copy\");\n textarea.remove();\n if (!copied) {\n throw new Error(\"Browser refused to copy the config error message.\");\n }\n}\n\nfunction buildConfigIssueAiPrompt(issue: ConfigIssue): string {\n const issueLabel = issue.kind === \"error\" ? \"error\" : \"warning\";\n return [\n `Help me fix this Hexclave config ${issueLabel}.`,\n \"\",\n \"Hexclave reminder:\",\n `This ${issueLabel} comes from a pushed Hexclave config file. The app may keep running with the synced Hexclave config, but I need to fix the config file mentioned in the message and save it again so Hexclave can sync the config successfully and clear the dialog. Use your web fetch tool to read https://skill.hexclave.com to learn more about Hexclave.`,\n \"\",\n issue.kind === \"error\" ? \"Error message:\" : \"Warning message:\",\n issue.messages.join(\"\\n\"),\n \"\",\n \"Please explain the likely cause, identify the config key or value I should change, and suggest the smallest safe fix.\",\n ].join(\"\\n\");\n}\n\nexport function mountPushedConfigErrorOverlay(app: StackClientApp<true>): () => void {\n if (!shouldMount()) {\n return () => {};\n }\n\n getGlobalUiInstance(GLOBAL_INSTANCE_KEY)?.cleanup();\n\n const root = h(\"div\", { className: \"hexclave-config-error-overlay\" });\n const style = h(\"style\", null, css);\n root.appendChild(style);\n document.body.appendChild(root);\n\n let disposed = false;\n let lastErrorKey: string | null = null;\n let lastConsoleErrorKey: string | null = null;\n let minimized = false;\n\n const render = (issue: ConfigIssue | null) => {\n root.replaceChildren(style);\n if (issue == null) {\n lastErrorKey = null;\n minimized = false;\n return;\n }\n\n const issueMessage = \"Hexclave config \" + issue.kind + \": \" + issue.messages.join(\"\\n\");\n const issueKey = `${app.projectId}:${issue.kind}:${issueMessage}`;\n const issueLabel = issue.kind === \"error\" ? \"error\" : \"warning\";\n const issueTitle = issue.kind === \"error\"\n ? \"Your Hexclave config has been saved, but contains errors\"\n : \"Your Hexclave config has been saved, but has warnings\";\n const bodyText = issue.kind === \"error\"\n ? \"Your app can keep running, but Hexclave is still using the last valid config until this is fixed.\"\n : \"Your app can keep running, but part of your Hexclave config may not behave the way you expect until this is fixed.\";\n const footerText = issue.kind === \"error\"\n ? \"Fix the config file mentioned above and save it again. This message will disappear after the config sync succeeds.\"\n : \"Fix the config file mentioned above and save it again. This warning will disappear after Hexclave syncs a config without warnings.\";\n if (issueKey !== lastConsoleErrorKey) {\n lastConsoleErrorKey = issueKey;\n const consoleMessage = `[Hexclave] Config ${issueLabel}: ${issueMessage}`;\n if (issue.kind === \"error\") {\n console.error(consoleMessage);\n } else {\n console.warn(consoleMessage);\n }\n }\n\n if (issueKey !== lastErrorKey) {\n lastErrorKey = issueKey;\n minimized = storageGet(MINIMIZED_STORAGE_KEY) === issueKey;\n }\n\n if (minimized) {\n const logoSpan = h(\"span\", { className: \"hce-pill-logo\" });\n setHtml(logoSpan, HEXCLAVE_LOGO_SVG);\n root.appendChild(h(\"button\", {\n className: issue.kind === \"error\" ? \"hce-pill\" : \"hce-pill hce-pill-warning\",\n type: \"button\",\n onClick: () => {\n minimized = false;\n storageRemove(MINIMIZED_STORAGE_KEY);\n render(issue);\n },\n },\n logoSpan,\n h(\"span\", null, issue.kind === \"error\" ? \"Config error\" : \"Config warning\")));\n return;\n }\n\n const logoSpan = h(\"span\", { className: \"hce-logo\" });\n setHtml(logoSpan, HEXCLAVE_LOGO_SVG);\n const copyButton = h(\"button\", {\n className: \"hce-icon-btn hce-text-btn\",\n type: \"button\",\n title: issue.kind === \"error\" ? \"Copy error message\" : \"Copy warning message\",\n \"aria-label\": issue.kind === \"error\" ? \"Copy config error message\" : \"Copy config warning message\",\n onClick: () => {\n runAsynchronously(async () => {\n await copyTextToClipboard(issueMessage);\n copyButton.textContent = \"Copied\";\n setTimeout(() => {\n setHtml(copyButton, `${COPY_ICON_SVG}Copy`);\n }, 1500);\n }, {\n noErrorLogging: true,\n onError: (copyError) => {\n captureError(\"pushed-config-error-overlay-copy\", copyError);\n copyButton.textContent = \"Copy failed\";\n setTimeout(() => {\n setHtml(copyButton, `${COPY_ICON_SVG}Copy`);\n }, 1500);\n },\n });\n },\n });\n setHtml(copyButton, `${COPY_ICON_SVG}Copy`);\n\n const aiPromptCopyButton = h(\"button\", {\n className: \"hce-icon-btn\",\n type: \"button\",\n title: \"Copy AI prompt\",\n \"aria-label\": issue.kind === \"error\" ? \"Copy AI prompt for config error\" : \"Copy AI prompt for config warning\",\n onClick: () => {\n runAsynchronously(async () => {\n await copyTextToClipboard(buildConfigIssueAiPrompt(issue));\n aiPromptCopyButton.textContent = \"✓\";\n setTimeout(() => {\n setHtml(aiPromptCopyButton, COPY_ICON_SVG);\n }, 1500);\n }, {\n noErrorLogging: true,\n onError: (copyError) => {\n captureError(\"pushed-config-error-overlay-copy-ai-prompt\", copyError);\n aiPromptCopyButton.textContent = \"!\";\n setTimeout(() => {\n setHtml(aiPromptCopyButton, COPY_ICON_SVG);\n }, 1500);\n },\n });\n },\n });\n setHtml(aiPromptCopyButton, COPY_ICON_SVG);\n\n root.appendChild(h(\"div\", { className: \"hce-backdrop\" },\n h(\"div\", { className: issue.kind === \"error\" ? \"hce-card\" : \"hce-card hce-card-warning\", role: \"alertdialog\", \"aria-modal\": \"true\", \"aria-label\": `Hexclave config ${issueLabel}` },\n h(\"div\", { className: \"hce-card-inner\" },\n h(\"div\", { className: \"hce-header\" },\n h(\"div\", { className: \"hce-title-row\" },\n logoSpan,\n h(\"div\", null,\n h(\"span\", { className: \"hce-badge\" }, `Config ${issueLabel}`),\n h(\"div\", { className: \"hce-title\" }, issueTitle),\n ),\n ),\n h(\"div\", { className: \"hce-actions\" },\n aiPromptCopyButton,\n h(\"button\", {\n className: \"hce-icon-btn\",\n type: \"button\",\n title: \"Minimize\",\n \"aria-label\": issue.kind === \"error\" ? \"Minimize config error\" : \"Minimize config warning\",\n onClick: () => {\n minimized = true;\n storageSet(MINIMIZED_STORAGE_KEY, issueKey);\n render(issue);\n },\n }, \"–\"),\n ),\n ),\n h(\"div\", { className: \"hce-body\" },\n bodyText,\n h(\"div\", { className: \"hce-message-header\" },\n h(\"div\", { className: \"hce-message-label\" }, issue.kind === \"error\" ? \"Error message\" : \"Warning message\"),\n copyButton,\n ),\n h(\"div\", { className: \"hce-message\" }, issueMessage),\n h(\"div\", { className: \"hce-footer\" }, footerText),\n ),\n ),\n )));\n };\n\n const refresh = () => {\n if (disposed || !canMountIntoDom()) {\n return;\n }\n runAsynchronously(async () => {\n const project = await app.getProject();\n if (disposed) {\n return;\n }\n render(project.pushedConfigError == null\n ? project.configWarnings.length === 0\n ? null\n : { kind: \"warning\", messages: project.configWarnings.map((warning) => warning.message) }\n : { kind: \"error\", messages: [project.pushedConfigError.message] });\n }, {\n noErrorLogging: true,\n onError: (error) => {\n captureError(\"pushed-config-error-overlay-refresh\", error);\n },\n });\n };\n\n // This is mounted from the base client-app constructor, which also runs\n // before subclass field initializers. Defer the first app call so overridden\n // methods like adminApp.getProject() can safely touch subclass caches.\n queueMicrotask(refresh);\n const interval = setInterval(refresh, REFRESH_INTERVAL_MS);\n\n const cleanup = () => {\n disposed = true;\n clearInterval(interval);\n root.remove();\n if (getGlobalUiInstance(GLOBAL_INSTANCE_KEY)?.cleanup === cleanup) {\n setGlobalUiInstance(GLOBAL_INSTANCE_KEY, null);\n }\n };\n setGlobalUiInstance(GLOBAL_INSTANCE_KEY, { cleanup });\n return cleanup;\n}\n\n"],"mappings":";;;;;;;AAaA,MAAM,sBAAsB;AAC5B,MAAM,wBAAwB;AAC9B,MAAM,sBAAsB;AAC5B,MAAM,oBAAoB;AAC1B,MAAM,gBAAgB;AAOtB,MAAM,MAAM,mBAAmB,gCAAgC,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4OnE,SAAS,WAAW,KAA4B;CAC9C,IAAI;EACF,OAAO,aAAa,QAAQ,GAAG;CACjC,QAAQ;EACN,OAAO;CACT;AACF;AAEA,SAAS,WAAW,KAAa,OAAqB;CACpD,IAAI;EACF,aAAa,QAAQ,KAAK,KAAK;CACjC,QAAQ,CAER;AACF;AAEA,SAAS,cAAc,KAAmB;CACxC,IAAI;EACF,aAAa,WAAW,GAAG;CAC7B,QAAQ,CAER;AACF;AAEA,SAAS,cAAuB;CAC9B,IAAI,CAAC,gBAAgB,GACnB,OAAO;CAGT,MAAM,UAAU,QAAQ;CACxB,IAAI,YAAY,KAAA,GACd,OAAO,YAAY;CAGrB,IAAI;EAEF,IAAI,IADY,IAAI,OAAO,SAAS,IAC9B,CAAC,CAAC,aAAa,SACnB,OAAO;CAEX,QAAQ;EACN,OAAO;CACT;CACA,OAAO,YA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MAAM,SAAS,UAAU,0BAA0B;GACjE,eAAe;IACb,YAAY;IACZ,WAAW,uBAAuB,QAAQ;IAC1C,OAAO,KAAK;GACd;EACF,GAAG,GAAG,CACR,CACF,GACA,EAAE,OAAO,EAAE,WAAW,WAAW,GAC/B,UACA,EAAE,OAAO,EAAE,WAAW,qBAAqB,GACzC,EAAE,OAAO,EAAE,WAAW,oBAAoB,GAAG,MAAM,SAAS,UAAU,kBAAkB,iBAAiB,GACzG,UACF,GACA,EAAE,OAAO,EAAE,WAAW,cAAc,GAAG,YAAY,GACnD,EAAE,OAAO,EAAE,WAAW,aAAa,GAAG,UAAU,CAClD,CACF,CACF,CAAC,CAAC;CACJ;CAEA,MAAM,gBAAgB;EACpB,IAAI,YAAY,CAAC,gBAAgB,GAC/B;EAEF,kBAAkB,YAAY;GAC5B,MAAM,UAAU,MAAM,IAAI,WAAW;GACrC,IAAI,UACF;GAEF,OAAO,QAAQ,qBAAqB,OAChC,QAAQ,eAAe,WAAW,IAChC,OACA;IAAE,MAAM;IAAW,UAAU,QAAQ,eAAe,KAAK,YAAY,QAAQ,OAAO;GAAE,IACxF;IAAE,MAAM;IAAS,UAAU,CAAC,QAAQ,kBAAkB,OAAO;GAAE,CAAC;EACtE,GAAG;GACD,gBAAgB;GAChB,UAAU,UAAU;IAClB,aAAa,uCAAuC,KAAK;GAC3D;EACF,CAAC;CACH;CAKA,eAAe,OAAO;CACtB,MAAM,WAAW,YAAY,SAAS,mBAAmB;CAEzD,MAAM,gBAAgB;EACpB,WAAW;EACX,cAAc,QAAQ;EACtB,KAAK,OAAO;EACZ,IAAI,oBAAoB,mBAAmB,CAAC,EAAE,YAAY,SACxD,oBAAoB,qBAAqB,IAAI;CAEjD;CACA,oBAAoB,qBAAqB,EAAE,QAAQ,CAAC;CACpD,OAAO;AACT"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/pushed-config-error-overlay/index.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\n\nimport { captureError } from \"@hexclave/shared/dist/utils/errors\";\nimport { runAsynchronously } from \"@hexclave/shared/dist/utils/promises\";\nimport { isLikelyDevelopmentEnvironment } from \"../in-page-ui/dev-environment\";\nimport { canMountIntoDom, getGlobalUiInstance, h, setGlobalUiInstance } from \"../in-page-ui/dom\";\nimport { getIssueCardCSS, renderIssueCard, renderIssuePill, trapFocusInIssueCard, type IssueCardFocusTrap } from \"../in-page-ui/issue-card\";\nimport type { StackClientApp } from \"../lib/hexclave-app\";\n\nconst GLOBAL_INSTANCE_KEY = \"__hexclave-pushed-config-error-overlay\";\nconst MINIMIZED_STORAGE_KEY = \"hexclave-pushed-config-error-minimized-key\";\nconst REFRESH_INTERVAL_MS = 5_000;\n\ntype ConfigIssue = {\n kind: \"error\" | \"warning\",\n messages: string[],\n};\n\nconst css = getIssueCardCSS(\".hexclave-config-error-overlay\");\n\nfunction storageGet(key: string): string | null {\n try {\n return localStorage.getItem(key);\n } catch {\n return null;\n }\n}\n\nfunction storageSet(key: string, value: string): void {\n try {\n localStorage.setItem(key, value);\n } catch {\n // Storage may be unavailable in private or embedded contexts.\n }\n}\n\nfunction storageRemove(key: string): void {\n try {\n localStorage.removeItem(key);\n } catch {\n // Storage may be unavailable in private or embedded contexts.\n }\n}\n\nfunction shouldMount(): boolean {\n return canMountIntoDom() && isLikelyDevelopmentEnvironment();\n}\n\nfunction buildConfigIssueAiPrompt(issue: ConfigIssue): string {\n const issueLabel = issue.kind === \"error\" ? \"error\" : \"warning\";\n return [\n `Help me fix this Hexclave config ${issueLabel}.`,\n \"\",\n \"Hexclave reminder:\",\n `This ${issueLabel} comes from a pushed Hexclave config file. The app may keep running with the synced Hexclave config, but I need to fix the config file mentioned in the message and save it again so Hexclave can sync the config successfully and clear the dialog. Use your web fetch tool to read https://skill.hexclave.com to learn more about Hexclave.`,\n \"\",\n issue.kind === \"error\" ? \"Error message:\" : \"Warning message:\",\n issue.messages.join(\"\\n\"),\n \"\",\n \"Please explain the likely cause, identify the config key or value I should change, and suggest the smallest safe fix.\",\n ].join(\"\\n\");\n}\n\nexport function mountPushedConfigErrorOverlay(app: StackClientApp<true>): () => void {\n if (!shouldMount()) {\n return () => {};\n }\n\n getGlobalUiInstance(GLOBAL_INSTANCE_KEY)?.cleanup();\n\n const root = h(\"div\", { className: \"hexclave-config-error-overlay\" });\n const style = h(\"style\", null, css);\n root.appendChild(style);\n document.body.appendChild(root);\n\n let disposed = false;\n let lastErrorKey: string | null = null;\n let lastConsoleErrorKey: string | null = null;\n let minimized = false;\n // The card element is replaced on every poll, so the trap has to be rebound to the new one each time or it would keep\n // trapping Tab inside the detached card. Focus is only *moved* into the card when a card first appears for an issue;\n // doing it on every render would yank focus out of whatever the developer is doing every few seconds.\n let focusedIssueKey: string | null = null;\n let focusTrap: IssueCardFocusTrap | null = null;\n const releaseFocusIfHeld = () => {\n focusTrap?.release();\n focusTrap = null;\n focusedIssueKey = null;\n };\n\n const render = (issue: ConfigIssue | null) => {\n root.replaceChildren(style);\n if (issue == null) {\n lastErrorKey = null;\n minimized = false;\n releaseFocusIfHeld();\n return;\n }\n\n const issueMessage = \"Hexclave config \" + issue.kind + \": \" + issue.messages.join(\"\\n\");\n const issueKey = `${app.projectId}:${issue.kind}:${issueMessage}`;\n const issueLabel = issue.kind === \"error\" ? \"error\" : \"warning\";\n const issueTitle = issue.kind === \"error\"\n ? \"Your Hexclave config has been saved, but contains errors\"\n : \"Your Hexclave config has been saved, but has warnings\";\n const bodyText = issue.kind === \"error\"\n ? \"Your app can keep running, but Hexclave is still using the last valid config until this is fixed.\"\n : \"Your app can keep running, but part of your Hexclave config may not behave the way you expect until this is fixed.\";\n const footerText = issue.kind === \"error\"\n ? \"Fix the config file mentioned above and save it again. This message will disappear after the config sync succeeds.\"\n : \"Fix the config file mentioned above and save it again. This warning will disappear after Hexclave syncs a config without warnings.\";\n if (issueKey !== lastConsoleErrorKey) {\n lastConsoleErrorKey = issueKey;\n const consoleMessage = `[Hexclave] Config ${issueLabel}: ${issueMessage}`;\n if (issue.kind === \"error\") {\n console.error(consoleMessage);\n } else {\n console.warn(consoleMessage);\n }\n }\n\n if (issueKey !== lastErrorKey) {\n lastErrorKey = issueKey;\n minimized = storageGet(MINIMIZED_STORAGE_KEY) === issueKey;\n }\n\n if (minimized) {\n releaseFocusIfHeld();\n root.appendChild(renderIssuePill({\n kind: issue.kind,\n label: issue.kind === \"error\" ? \"Config error\" : \"Config warning\",\n ariaLabel: `Show Hexclave config ${issueLabel}`,\n onClick: () => {\n minimized = false;\n storageRemove(MINIMIZED_STORAGE_KEY);\n render(issue);\n },\n }));\n return;\n }\n\n root.appendChild(renderIssueCard({\n kind: issue.kind,\n badge: `Config ${issueLabel}`,\n title: issueTitle,\n bodyText,\n messageLabel: issue.kind === \"error\" ? \"Error message\" : \"Warning message\",\n message: issueMessage,\n footerText,\n ariaLabel: `Hexclave config ${issueLabel}`,\n aiPrompt: buildConfigIssueAiPrompt(issue),\n onCopyError: (copyError) => captureError(\"pushed-config-error-overlay-copy\", copyError),\n onCopyAiPromptError: (copyError) => captureError(\"pushed-config-error-overlay-copy-ai-prompt\", copyError),\n onMinimize: () => {\n minimized = true;\n storageSet(MINIMIZED_STORAGE_KEY, issueKey);\n render(issue);\n },\n }));\n const isNewIssue = focusedIssueKey !== issueKey;\n const previouslyFocused = isNewIssue ? undefined : focusTrap?.previouslyFocused ?? null;\n focusTrap?.release({ restoreFocus: isNewIssue });\n focusedIssueKey = issueKey;\n focusTrap = trapFocusInIssueCard(root, { moveFocusIntoCard: isNewIssue, previouslyFocused });\n };\n\n const refresh = () => {\n if (disposed || !canMountIntoDom()) {\n return;\n }\n runAsynchronously(async () => {\n const project = await app.getProject();\n if (disposed) {\n return;\n }\n render(project.pushedConfigError == null\n ? project.configWarnings.length === 0\n ? null\n : { kind: \"warning\", messages: project.configWarnings.map((warning) => warning.message) }\n : { kind: \"error\", messages: [project.pushedConfigError.message] });\n }, {\n noErrorLogging: true,\n onError: (error) => {\n captureError(\"pushed-config-error-overlay-refresh\", error);\n },\n });\n };\n\n // This is mounted from the base client-app constructor, which also runs\n // before subclass field initializers. Defer the first app call so overridden\n // methods like adminApp.getProject() can safely touch subclass caches.\n queueMicrotask(refresh);\n const interval = setInterval(refresh, REFRESH_INTERVAL_MS);\n\n const cleanup = () => {\n disposed = true;\n clearInterval(interval);\n releaseFocusIfHeld();\n root.remove();\n if (getGlobalUiInstance(GLOBAL_INSTANCE_KEY)?.cleanup === cleanup) {\n setGlobalUiInstance(GLOBAL_INSTANCE_KEY, null);\n }\n };\n setGlobalUiInstance(GLOBAL_INSTANCE_KEY, { cleanup });\n return cleanup;\n}\n\n"],"mappings":";;;;;;AAYA,MAAM,sBAAsB;AAC5B,MAAM,wBAAwB;AAC9B,MAAM,sBAAsB;AAO5B,MAAM,MAAM,gBAAgB,gCAAgC;AAE5D,SAAS,WAAW,KAA4B;CAC9C,IAAI;EACF,OAAO,aAAa,QAAQ,GAAG;CACjC,QAAQ;EACN,OAAO;CACT;AACF;AAEA,SAAS,WAAW,KAAa,OAAqB;CACpD,IAAI;EACF,aAAa,QAAQ,KAAK,KAAK;CACjC,QAAQ,CAER;AACF;AAEA,SAAS,cAAc,KAAmB;CACxC,IAAI;EACF,aAAa,WAAW,GAAG;CAC7B,QAAQ,CAER;AACF;AAEA,SAAS,cAAuB;CAC9B,OAAO,gBAAgB,KAAK,+BAA+B;AAC7D;AAEA,SAAS,yBAAyB,OAA4B;CAC5D,MAAM,aAAa,MAAM,SAAS,UAAU,UAAU;CACtD,OAAO;EACL,oCAAoC,WAAW;EAC/C;EACA;EACA,QAAQ,WAAW;EACnB;EACA,MAAM,SAAS,UAAU,mBAAmB;EAC5C,MAAM,SAAS,KAAK,IAAI;EACxB;EACA;CACF,CAAC,CAAC,KAAK,IAAI;AACb;AAEA,SAAgB,8BAA8B,KAAuC;CACnF,IAAI,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,mBAAmB,CAAC,EAAE,YAAY,SACxD,oBAAoB,qBAAqB,IAAI;CAEjD;CACA,oBAAoB,qBAAqB,EAAE,QAAQ,CAAC;CACpD,OAAO;AACT"}
@@ -0,0 +1,16 @@
1
+ //#region src/setup-error-overlay/index.d.ts
2
+ /** Exported so tests can drop the singleton; every other consumer should go through `showSetupErrorOverlay`. */
3
+ declare const SETUP_ERROR_OVERLAY_GLOBAL_INSTANCE_KEY = "__hexclave-setup-error-overlay";
4
+ /**
5
+ * Shows `error` as an error card on the current page.
6
+ *
7
+ * Setup errors are always shown, because the flow they aborted cannot complete no matter what the end user does, and
8
+ * their messages are written for exactly this purpose. Any other error is only shown while developing — those messages
9
+ * are internal diagnostics, so in production they stay in captureError's hands.
10
+ *
11
+ * Returns a cleanup function that removes the card again.
12
+ */
13
+ declare function showSetupErrorOverlay(error: unknown): () => void;
14
+ //#endregion
15
+ export { SETUP_ERROR_OVERLAY_GLOBAL_INSTANCE_KEY, showSetupErrorOverlay };
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/setup-error-overlay/index.ts"],"mappings":";;cAiBa,uCAAA;;;;AAAuC;AA8DpD;;;;AAAoD;iBAApC,qBAAA,CAAsB,KAAc"}