failproofai 1.0.11-beta.3 → 1.0.11

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 (128) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/build-manifest.json +3 -3
  3. package/.next/standalone/.next/prerender-manifest.json +4 -4
  4. package/.next/standalone/.next/required-server-files.json +1 -1
  5. package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
  6. package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
  7. package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.rsc +2 -2
  10. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
  11. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +2 -2
  12. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  14. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  15. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  16. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  17. package/.next/standalone/.next/server/app/_not-found.rsc +3 -3
  18. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  19. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  20. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  21. package/.next/standalone/.next/server/app/api/audit/invite/route.js.nft.json +1 -1
  22. package/.next/standalone/.next/server/app/api/audit/run/route.js.nft.json +1 -1
  23. package/.next/standalone/.next/server/app/api/audit/status/route.js.nft.json +1 -1
  24. package/.next/standalone/.next/server/app/api/auth/login-request/route.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/api/auth/login-verify/route.js.nft.json +1 -1
  26. package/.next/standalone/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
  27. package/.next/standalone/.next/server/app/api/auth/status/route.js.nft.json +1 -1
  28. package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js.nft.json +1 -1
  29. package/.next/standalone/.next/server/app/audit/page/server-reference-manifest.json +2 -2
  30. package/.next/standalone/.next/server/app/audit/page.js.nft.json +1 -1
  31. package/.next/standalone/.next/server/app/audit/page_client-reference-manifest.js +1 -1
  32. package/.next/standalone/.next/server/app/index.html +1 -1
  33. package/.next/standalone/.next/server/app/index.rsc +3 -3
  34. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  35. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +3 -3
  36. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  37. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
  38. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  39. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  40. package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +14 -14
  41. package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
  42. package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
  43. package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
  44. package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
  45. package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
  46. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
  47. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
  48. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
  49. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
  50. package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
  51. package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
  52. package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  53. package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +8 -8
  54. package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
  55. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  56. package/.next/standalone/.next/server/chunks/_09dz7xva4ce_2._.js +1 -1
  57. package/.next/standalone/.next/server/chunks/_0tovk6q0miud6._.js +1 -1
  58. package/.next/standalone/.next/server/chunks/_0trp3ycqv17cl._.js +1 -1
  59. package/.next/standalone/.next/server/chunks/_1vslkoe35wok6._.js +1 -1
  60. package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4vkpxxu7._.js +1 -1
  61. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__08ch3staq3ejw._.js +1 -1
  62. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0m2etnchhciwn._.js → [root-of-the-server]__0_lbstb5x2t15._.js} +2 -2
  63. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0bigvy9xmv2ka._.js +1 -1
  64. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h86bl2qf0k_o._.js +1 -1
  65. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0pia5h3p8re4c._.js +1 -1
  66. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1-ey9fgesfbc0._.js +1 -1
  67. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__15usvs-ms-0hf._.js +1 -1
  68. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__16gb3_92zvk5x._.js +1 -1
  69. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1avi2kypusyb_._.js +1 -1
  70. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1r7drlqli-ado._.js +1 -1
  71. package/.next/standalone/.next/server/chunks/ssr/{_0g62t_u7bsc4i._.js → _0dc-of_bn0cim._.js} +2 -2
  72. package/.next/standalone/.next/server/chunks/ssr/_0eoura3_9gjb-._.js +1 -1
  73. package/.next/standalone/.next/server/chunks/ssr/_0pedwblqdoh58._.js +1 -1
  74. package/.next/standalone/.next/server/chunks/ssr/_1djqs9i27e4kg._.js +1 -1
  75. package/.next/standalone/.next/server/chunks/ssr/_1gb0ifpkowwub._.js +1 -1
  76. package/.next/standalone/.next/server/chunks/ssr/_next-internal_server_app_policies_page_actions_1sp2-yo5_vm5f.js +2 -2
  77. package/.next/standalone/.next/server/chunks/ssr/app_actions_get-scheduled-audit_ts_0ei9snixb5fd-._.js +1 -1
  78. package/.next/standalone/.next/server/chunks/ssr/app_audit__components_audit-dashboard_tsx_0p9ud47q0xq5w._.js +1 -1
  79. package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_1kp6l3x33jqb6._.js +1 -1
  80. package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_19dqvpcz0uxur._.js +1 -1
  81. package/.next/standalone/.next/server/chunks/ssr/app_settings_02tf1h47jmhhd._.js +1 -1
  82. package/.next/standalone/.next/server/chunks/ssr/{node_modules_html-to-image_es_index_1pr0bebnuzhnk.js → node_modules_html-to-image_es_index_1f_ymmaonkksc.js} +1 -1
  83. package/.next/standalone/.next/server/chunks/ssr/package_json_[json]_cjs_013tntikdft59._.js +1 -1
  84. package/.next/standalone/.next/server/chunks/ssr/src_hooks_pack-cli_ts_0t7me658zqmh_._.js +1 -1
  85. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  86. package/.next/standalone/.next/server/pages/404.html +1 -1
  87. package/.next/standalone/.next/server/pages/500.html +1 -1
  88. package/.next/standalone/.next/server/preview-props.json +3 -3
  89. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  90. package/.next/standalone/.next/server/server-reference-manifest.json +23 -23
  91. package/.next/standalone/.next/static/chunks/{08ri7z1cva-nm.js → 0ol2gj4ntfn56.js} +1 -1
  92. package/.next/standalone/.next/static/chunks/{0ychntysspq47.js → 15rm15u5a6dua.js} +1 -1
  93. package/.next/standalone/.next/static/chunks/{2ifk4hst9gfec.js → 16z6_d7sp61jm.js} +1 -1
  94. package/.next/standalone/.next/static/chunks/{2dbn-cl_ju3yb.js → 1_c0dc7zqj1n7.js} +1 -1
  95. package/.next/standalone/.next/static/chunks/{0kv4jur9k6mb0.js → 1kwj8uqxuv85t.js} +1 -1
  96. package/.next/standalone/.next/static/chunks/{0jz_z_4al287_.js → 302llgh97ce6w.js} +1 -1
  97. package/.next/standalone/.next/static/chunks/{1ti1i01dr_j1i.js → 37stoe-_yd852.js} +1 -1
  98. package/.next/standalone/.next/static/chunks/3hj5_7i3nw4zj.js +1 -0
  99. package/.next/standalone/.next/static/chunks/3iyoapeoq_hup.js +1 -0
  100. package/.next/standalone/.next/static/chunks/{1qbr87v23mzk5.js → 44a7k2_62qc-9.js} +2 -2
  101. package/.next/standalone/hermes-plugin/plugin.yaml +1 -1
  102. package/.next/standalone/package.json +9 -9
  103. package/.next/standalone/sdk/python/CHANGELOG.md +17 -5
  104. package/.next/standalone/sdk/python/failproofai_sdk/_redact.py +3 -5
  105. package/.next/standalone/sdk/python/failproofai_sdk/_resolver.py +13 -2
  106. package/.next/standalone/sdk/python/failproofai_sdk/integrations/otel.py +3 -1
  107. package/.next/standalone/sdk/python/tests/test_otel.py +25 -0
  108. package/.next/standalone/sdk/typescript/CHANGELOG.md +26 -1
  109. package/.next/standalone/sdk/typescript/integration/fixtures/mastra-0/package-lock.json +3 -3
  110. package/.next/standalone/sdk/typescript/integration/fixtures/nextjs/package-lock.json +162 -162
  111. package/.next/standalone/sdk/typescript/integration/fixtures/nextjs/package.json +1 -1
  112. package/.next/standalone/sdk/typescript/src/integrations/otel.ts +2 -1
  113. package/.next/standalone/sdk/typescript/src/resolver.ts +2 -1
  114. package/.next/standalone/sdk/typescript/test/otel.test.ts +25 -0
  115. package/.next/standalone/server.js +1 -1
  116. package/dist/cli.mjs +39 -23
  117. package/dist/worker.mjs +1 -1
  118. package/hermes-plugin/plugin.yaml +1 -1
  119. package/package.json +9 -9
  120. package/src/hooks/cloud-connection.ts +4 -1
  121. package/src/hooks/config-status.ts +2 -2
  122. package/src/hooks/otel-cli.ts +26 -8
  123. package/src/hooks/otel-writers.ts +16 -1
  124. package/.next/standalone/.next/static/chunks/140-bwb6l7ue8.js +0 -1
  125. package/.next/standalone/.next/static/chunks/3qx-e3n59bxxv.js +0 -1
  126. /package/.next/standalone/.next/static/{7n08rZWjZdMWbpBpp08dI → kEFP3ybXwZdriNEQmWwlH}/_buildManifest.js +0 -0
  127. /package/.next/standalone/.next/static/{7n08rZWjZdMWbpBpp08dI → kEFP3ybXwZdriNEQmWwlH}/_clientMiddlewareManifest.js +0 -0
  128. /package/.next/standalone/.next/static/{7n08rZWjZdMWbpBpp08dI → kEFP3ybXwZdriNEQmWwlH}/_ssgManifest.js +0 -0
@@ -15,7 +15,7 @@
15
15
  "@mastra/core": "1.68.0",
16
16
  "ai": "7.0.111",
17
17
  "llamaindex": "0.12.1",
18
- "next": "16.3.6",
18
+ "next": "16.4.1",
19
19
  "react": "19.3.0",
20
20
  "react-dom": "19.3.0",
21
21
  "zod": "4.6.5"
@@ -96,7 +96,8 @@ export class OtelSpanExporter {
96
96
  let result: OtelExportResult = { code: 0 };
97
97
  try {
98
98
  if (this.stopped) throw new Error("OTEL exporter has shut down.");
99
- const dir = this.directory ?? join(process.env.FAILPROOFAI_HOME || join(homedir(), ".failproofai"), "state", "spool-otlp");
99
+ // A blank or whitespace-only FAILPROOFAI_HOME means unset, not the cwd.
100
+ const dir = this.directory ?? join(process.env.FAILPROOFAI_HOME?.trim() || join(homedir(), ".failproofai"), "state", "spool-otlp");
100
101
  // Encode each span once and split batches at the relay's request limit.
101
102
  const chunks: string[] = [];
102
103
  let items: string[] = [];
@@ -72,7 +72,8 @@ export function getBaseDir(): string {
72
72
  * a first batch is written.
73
73
  */
74
74
  export function failproofaiCustomAgentsDir(): string {
75
- const fpHome = process.env.FAILPROOFAI_HOME;
75
+ // Blank or whitespace-only means unset: otherwise it resolves against the cwd.
76
+ const fpHome = process.env.FAILPROOFAI_HOME?.trim();
76
77
  const base = fpHome ? expandUser(fpHome) : join(homedir(), ".failproofai");
77
78
  return join(base, "custom-agents");
78
79
  }
@@ -86,6 +86,31 @@ describe("OTLP/JSON SpanExporter", () => {
86
86
  await provider.shutdown();
87
87
  });
88
88
 
89
+ it.each(["", " "])("a blank FAILPROOFAI_HOME (%j) spools under ~/.failproofai, never the cwd", async blank => {
90
+ const previousHomeDir = process.env.HOME;
91
+ const previousCwd = process.cwd();
92
+ const cwd = mkdtempSync(join(tmpdir(), "fpai-otel-cwd-"));
93
+ process.env.HOME = home;
94
+ process.env.FAILPROOFAI_HOME = blank;
95
+ process.chdir(cwd);
96
+ try {
97
+ const provider = new BasicTracerProvider();
98
+ const span = provider.getTracer("test").startSpan("blank-home");
99
+ span.end();
100
+ const results: number[] = [];
101
+ new OtelSpanExporter().export([span as unknown as ReadableSpan], result => results.push(result.code));
102
+ expect(results).toEqual([0]);
103
+ expect(readdirSync(join(home, ".failproofai", "state", "spool-otlp"))).toHaveLength(1);
104
+ expect(readdirSync(cwd)).toEqual([]);
105
+ await provider.shutdown();
106
+ } finally {
107
+ process.chdir(previousCwd);
108
+ if (previousHomeDir === undefined) delete process.env.HOME;
109
+ else process.env.HOME = previousHomeDir;
110
+ rmSync(cwd, { recursive: true, force: true });
111
+ }
112
+ });
113
+
89
114
  it("splits an export above 8 MiB into complete bounded requests", async () => {
90
115
  const provider = new BasicTracerProvider({ spanLimits: { attributeValueLengthLimit: 10_000_000 } });
91
116
  const span = provider.getTracer("test").startSpan("big", { attributes: { content: "x".repeat(4 * 1024 * 1024) } });
@@ -9,7 +9,7 @@ const currentPort = parseInt(process.env.PORT, 10) || 3000
9
9
  const hostname = process.env.HOSTNAME || '0.0.0.0'
10
10
 
11
11
  let keepAliveTimeout = parseInt(process.env.KEEP_ALIVE_TIMEOUT, 10)
12
- const nextConfig = {"env":{"NEXT_PUBLIC_APP_VERSION":"1.0.11-beta.3"},"typescript":{"ignoreBuildErrors":false},"typedRoutes":false,"distDir":"./.next","cleanDistDir":true,"assetPrefix":"","cacheMaxMemorySize":52428800,"configOrigin":"next.config.ts","useFileSystemPublicRoutes":true,"generateEtags":true,"pageExtensions":["tsx","ts","jsx","js"],"instrumentationClientInject":[],"poweredByHeader":true,"compress":true,"images":{"deviceSizes":[640,750,828,1080,1200,1920,2048,3840],"imageSizes":[32,48,64,96,128,256,384],"path":"/_next/image","loader":"default","loaderFile":"","domains":[],"disableStaticImages":false,"minimumCacheTTL":14400,"formats":["image/webp"],"maximumRedirects":3,"maximumResponseBody":50000000,"dangerouslyAllowLocalIP":false,"dangerouslyAllowSVG":false,"contentSecurityPolicy":"script-src 'none'; frame-src 'none'; sandbox;","contentDispositionType":"attachment","localPatterns":[{"pathname":"**","search":""}],"remotePatterns":[],"qualities":[75],"unoptimized":true,"customCacheHandler":false},"devIndicators":{"position":"bottom-left"},"onDemandEntries":{"maxInactiveAge":60000,"pagesBufferLength":5},"basePath":"","sassOptions":{},"trailingSlash":false,"i18n":null,"productionBrowserSourceMaps":false,"excludeDefaultMomentLocales":true,"reactProductionProfiling":false,"reactStrictMode":null,"reactMaxHeadersLength":6000,"httpAgentOptions":{"keepAlive":true},"logging":{"serverFunctions":true,"browserToTerminal":"warn"},"compiler":{},"expireTime":31536000,"staticPageGenerationTimeout":60,"output":"standalone","modularizeImports":{"@mui/icons-material":{"transform":"@mui/icons-material/{{member}}"},"lodash":{"transform":"lodash/{{member}}"}},"outputFileTracingRoot":"/home/runner/work/failproofai/failproofai","enablePrerenderSourceMaps":true,"cacheComponents":false,"cacheLife":{"default":{"stale":300,"revalidate":900,"expire":4294967294},"seconds":{"stale":30,"revalidate":1,"expire":60},"minutes":{"stale":300,"revalidate":60,"expire":3600},"hours":{"stale":300,"revalidate":3600,"expire":86400},"days":{"stale":300,"revalidate":86400,"expire":604800},"weeks":{"stale":300,"revalidate":604800,"expire":2592000},"max":{"stale":300,"revalidate":2592000,"expire":31536000}},"cacheHandlers":{},"deprecated":{},"experimental":{"agentUpgrade":"security","agentFeedback":false,"coldCacheBadge":false,"collapseAdapterRoutes":true,"devValidationWorker":true,"useSkewCookie":false,"cssChunking":true,"multiZoneDraftMode":false,"appNavFailHandling":false,"parallelRouteMetadata":false,"prerenderEarlyExit":true,"serverMinification":true,"linkNoTouchStart":false,"caseSensitiveRoutes":false,"cachedNavigations":false,"dynamicOnHover":false,"reactBrowserBailout":true,"useOffline":false,"varyParams":true,"optimisticRouting":true,"concurrentRouterQueue":false,"instrumentationClientRouterTransitionEvents":false,"prefetchInlining":{"maxSize":2048,"maxBundleSize":10240},"preloadEntriesOnStart":true,"clientRouterFilter":true,"clientRouterFilterRedirects":false,"fetchCacheKeyPrefix":"","proxyPrefetch":"flexible","optimisticClientCache":true,"manualClientBasePath":false,"cpus":3,"memoryBasedWorkersCount":false,"imgOptConcurrency":null,"imgOptOperationCache":null,"imgOptTimeoutInSeconds":7,"imgOptMaxInputPixels":268402689,"imgOptSequentialRead":null,"imgOptMozjpeg":true,"isrFlushToDisk":true,"workerThreads":false,"optimizeCss":false,"nextScriptWorkers":false,"scrollRestoration":false,"externalDir":false,"devMemoryThresholdRestart":true,"disableOptimizedLoading":false,"gzipSize":true,"craCompat":false,"esmExternals":true,"fullySpecified":false,"swcTraceProfiling":false,"forceSwcTransforms":false,"requestInsights":false,"largePageDataBytes":128000,"typedEnv":false,"parallelServerCompiles":false,"parallelServerBuildTraces":false,"ppr":false,"authInterrupts":false,"webpackMemoryOptimizations":false,"optimizeServerReact":true,"strictRouteTypes":false,"useTypeScriptCli":true,"removeUncaughtErrorAndRejectionListeners":false,"validateRSCRequestHeaders":true,"staleTimes":{"dynamic":0,"static":300},"reactDebugChannel":true,"serverComponentsHmrCache":true,"serverComponentsHmrCancellation":false,"staticGenerationMaxConcurrency":8,"staticGenerationMinPagesPerWorker":25,"transitionIndicator":false,"gestureTransition":false,"inlineCss":false,"useCache":false,"useCacheStaticRootParamTracking":false,"globalNotFound":false,"explicitParallelRouteChildren":true,"strictRouteMatching":true,"browserDebugInfoInTerminal":"warn","lockDistDir":true,"disableResumeDataCacheCompression":false,"proxyClientMaxBodySize":10485760,"hideLogsAfterAbort":false,"mcpServer":true,"exposeRuntimeErrorsToHMR":false,"turbopackFileSystemCacheForDev":true,"turbopackFileSystemCacheForBuild":true,"turbopackStaleOutputMaxAge":604800000,"turbopackInferModuleSideEffects":true,"turbopackPluginRuntimeStrategy":"childProcesses","turbopackSharedRuntime":true,"turbopackMemoryEvictionMode":"auto","optimizePackageImports":["lucide-react","date-fns","lodash-es","ramda","antd","react-bootstrap","ahooks","@ant-design/icons","@headlessui/react","@headlessui-float/react","@heroicons/react/20/solid","@heroicons/react/24/solid","@heroicons/react/24/outline","@visx/visx","@tremor/react","rxjs","@mui/material","@mui/icons-material","recharts","react-use","effect","@effect/schema","@effect/platform","@effect/platform-node","@effect/platform-browser","@effect/platform-bun","@effect/sql","@effect/sql-mssql","@effect/sql-mysql2","@effect/sql-pg","@effect/sql-sqlite-node","@effect/sql-sqlite-bun","@effect/sql-sqlite-wasm","@effect/sql-sqlite-react-native","@effect/rpc","@effect/rpc-http","@effect/typeclass","@effect/experimental","@effect/opentelemetry","@material-ui/core","@material-ui/icons","@tabler/icons-react","mui-core","react-icons/ai","react-icons/bi","react-icons/bs","react-icons/cg","react-icons/ci","react-icons/di","react-icons/fa","react-icons/fa6","react-icons/fc","react-icons/fi","react-icons/gi","react-icons/go","react-icons/gr","react-icons/hi","react-icons/hi2","react-icons/im","react-icons/io","react-icons/io5","react-icons/lia","react-icons/lib","react-icons/lu","react-icons/md","react-icons/pi","react-icons/ri","react-icons/rx","react-icons/si","react-icons/sl","react-icons/tb","react-icons/tfi","react-icons/ti","react-icons/vsc","react-icons/wi"],"useCacheTimeout":54,"instantInsights":{"validationLevel":"warning"},"trustHostHeader":false,"isExperimentalCompile":false},"htmlLimitedBots":"[\\w-]+-Google|Google-[\\w-]+|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|Yeti|googleweblight","bundlePagesRouterDependencies":false,"configFileName":"next.config.ts","outputFileTracingExcludes":{"*":["node_modules/@img/**","node_modules/sharp/**"]},"turbopack":{"root":"/home/runner/work/failproofai/failproofai"},"repoRoot":"/home/runner/work/failproofai/failproofai","distDirRoot":".next"}
12
+ const nextConfig = {"env":{"NEXT_PUBLIC_APP_VERSION":"1.0.11"},"typescript":{"ignoreBuildErrors":false},"typedRoutes":false,"distDir":"./.next","cleanDistDir":true,"assetPrefix":"","cacheMaxMemorySize":52428800,"configOrigin":"next.config.ts","useFileSystemPublicRoutes":true,"generateEtags":true,"pageExtensions":["tsx","ts","jsx","js"],"instrumentationClientInject":[],"poweredByHeader":true,"compress":true,"images":{"deviceSizes":[640,750,828,1080,1200,1920,2048,3840],"imageSizes":[32,48,64,96,128,256,384],"path":"/_next/image","loader":"default","loaderFile":"","domains":[],"disableStaticImages":false,"minimumCacheTTL":14400,"formats":["image/webp"],"maximumRedirects":3,"maximumResponseBody":50000000,"dangerouslyAllowLocalIP":false,"dangerouslyAllowSVG":false,"contentSecurityPolicy":"script-src 'none'; frame-src 'none'; sandbox;","contentDispositionType":"attachment","localPatterns":[{"pathname":"**","search":""}],"remotePatterns":[],"qualities":[75],"unoptimized":true,"customCacheHandler":false},"devIndicators":{"position":"bottom-left"},"onDemandEntries":{"maxInactiveAge":60000,"pagesBufferLength":5},"basePath":"","sassOptions":{},"trailingSlash":false,"i18n":null,"productionBrowserSourceMaps":false,"excludeDefaultMomentLocales":true,"reactProductionProfiling":false,"reactStrictMode":null,"reactMaxHeadersLength":6000,"httpAgentOptions":{"keepAlive":true},"logging":{"serverFunctions":true,"browserToTerminal":"warn"},"compiler":{},"expireTime":31536000,"staticPageGenerationTimeout":60,"output":"standalone","modularizeImports":{"@mui/icons-material":{"transform":"@mui/icons-material/{{member}}"},"lodash":{"transform":"lodash/{{member}}"}},"outputFileTracingRoot":"/home/runner/work/failproofai/failproofai","enablePrerenderSourceMaps":true,"cacheComponents":false,"cacheLife":{"default":{"stale":300,"revalidate":900,"expire":4294967294},"seconds":{"stale":30,"revalidate":1,"expire":60},"minutes":{"stale":300,"revalidate":60,"expire":3600},"hours":{"stale":300,"revalidate":3600,"expire":86400},"days":{"stale":300,"revalidate":86400,"expire":604800},"weeks":{"stale":300,"revalidate":604800,"expire":2592000},"max":{"stale":300,"revalidate":2592000,"expire":31536000}},"cacheHandlers":{},"deprecated":{},"experimental":{"agentUpgrade":"security","agentFeedback":false,"coldCacheBadge":false,"collapseAdapterRoutes":true,"devValidationWorker":true,"useSkewCookie":false,"cssChunking":true,"multiZoneDraftMode":false,"appNavFailHandling":false,"parallelRouteMetadata":false,"prerenderEarlyExit":true,"serverMinification":true,"linkNoTouchStart":false,"caseSensitiveRoutes":false,"cachedNavigations":false,"dynamicOnHover":false,"reactBrowserBailout":true,"useOffline":false,"varyParams":true,"optimisticRouting":true,"concurrentRouterQueue":false,"instrumentationClientRouterTransitionEvents":false,"prefetchInlining":{"maxSize":2048,"maxBundleSize":10240},"preloadEntriesOnStart":true,"clientRouterFilter":true,"clientRouterFilterRedirects":false,"fetchCacheKeyPrefix":"","proxyPrefetch":"flexible","optimisticClientCache":true,"manualClientBasePath":false,"cpus":3,"memoryBasedWorkersCount":false,"imgOptConcurrency":null,"imgOptOperationCache":null,"imgOptTimeoutInSeconds":7,"imgOptMaxInputPixels":268402689,"imgOptSequentialRead":null,"imgOptMozjpeg":true,"isrFlushToDisk":true,"workerThreads":false,"optimizeCss":false,"nextScriptWorkers":false,"scrollRestoration":false,"externalDir":false,"devMemoryThresholdRestart":true,"disableOptimizedLoading":false,"gzipSize":true,"craCompat":false,"esmExternals":true,"fullySpecified":false,"swcTraceProfiling":false,"forceSwcTransforms":false,"requestInsights":false,"largePageDataBytes":128000,"typedEnv":false,"parallelServerCompiles":false,"parallelServerBuildTraces":false,"ppr":false,"authInterrupts":false,"webpackMemoryOptimizations":false,"optimizeServerReact":true,"strictRouteTypes":false,"useTypeScriptCli":true,"removeUncaughtErrorAndRejectionListeners":false,"validateRSCRequestHeaders":true,"staleTimes":{"dynamic":0,"static":300},"reactDebugChannel":true,"serverComponentsHmrCache":true,"serverComponentsHmrCancellation":false,"staticGenerationMaxConcurrency":8,"staticGenerationMinPagesPerWorker":25,"transitionIndicator":false,"gestureTransition":false,"inlineCss":false,"useCache":false,"useCacheStaticRootParamTracking":false,"globalNotFound":false,"explicitParallelRouteChildren":true,"strictRouteMatching":true,"browserDebugInfoInTerminal":"warn","lockDistDir":true,"disableResumeDataCacheCompression":false,"proxyClientMaxBodySize":10485760,"hideLogsAfterAbort":false,"mcpServer":true,"exposeRuntimeErrorsToHMR":false,"turbopackFileSystemCacheForDev":true,"turbopackFileSystemCacheForBuild":true,"turbopackStaleOutputMaxAge":604800000,"turbopackInferModuleSideEffects":true,"turbopackPluginRuntimeStrategy":"childProcesses","turbopackSharedRuntime":true,"turbopackMemoryEvictionMode":"auto","optimizePackageImports":["lucide-react","date-fns","lodash-es","ramda","antd","react-bootstrap","ahooks","@ant-design/icons","@headlessui/react","@headlessui-float/react","@heroicons/react/20/solid","@heroicons/react/24/solid","@heroicons/react/24/outline","@visx/visx","@tremor/react","rxjs","@mui/material","@mui/icons-material","recharts","react-use","effect","@effect/schema","@effect/platform","@effect/platform-node","@effect/platform-browser","@effect/platform-bun","@effect/sql","@effect/sql-mssql","@effect/sql-mysql2","@effect/sql-pg","@effect/sql-sqlite-node","@effect/sql-sqlite-bun","@effect/sql-sqlite-wasm","@effect/sql-sqlite-react-native","@effect/rpc","@effect/rpc-http","@effect/typeclass","@effect/experimental","@effect/opentelemetry","@material-ui/core","@material-ui/icons","@tabler/icons-react","mui-core","react-icons/ai","react-icons/bi","react-icons/bs","react-icons/cg","react-icons/ci","react-icons/di","react-icons/fa","react-icons/fa6","react-icons/fc","react-icons/fi","react-icons/gi","react-icons/go","react-icons/gr","react-icons/hi","react-icons/hi2","react-icons/im","react-icons/io","react-icons/io5","react-icons/lia","react-icons/lib","react-icons/lu","react-icons/md","react-icons/pi","react-icons/ri","react-icons/rx","react-icons/si","react-icons/sl","react-icons/tb","react-icons/tfi","react-icons/ti","react-icons/vsc","react-icons/wi"],"useCacheTimeout":54,"instantInsights":{"validationLevel":"warning"},"trustHostHeader":false,"isExperimentalCompile":false},"htmlLimitedBots":"[\\w-]+-Google|Google-[\\w-]+|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|Yeti|googleweblight","bundlePagesRouterDependencies":false,"configFileName":"next.config.ts","outputFileTracingExcludes":{"*":["node_modules/@img/**","node_modules/sharp/**"]},"turbopack":{"root":"/home/runner/work/failproofai/failproofai"},"repoRoot":"/home/runner/work/failproofai/failproofai","distDirRoot":".next"}
13
13
 
14
14
  process.env.__NEXT_PRIVATE_STANDALONE_CONFIG = JSON.stringify(nextConfig)
15
15
 
package/dist/cli.mjs CHANGED
@@ -29,7 +29,7 @@ var __esm = (fn, res, err) => () => {
29
29
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
30
30
 
31
31
  // package.json
32
- var version2 = "1.0.11-beta.3", package_default;
32
+ var version2 = "1.0.11", package_default;
33
33
  var init_package = __esm(() => {
34
34
  package_default = {
35
35
  name: "failproofai",
@@ -158,16 +158,16 @@ var init_package = __esm(() => {
158
158
  browserslist: "4.28.8"
159
159
  },
160
160
  optionalDependencies: {
161
- "@failproofai/failproofaid-linux-x64": "1.0.11-beta.3",
162
- "@failproofai/failproofaid-linux-arm64": "1.0.11-beta.3",
163
- "@failproofai/failproofaid-darwin-x64": "1.0.11-beta.3",
164
- "@failproofai/failproofaid-darwin-arm64": "1.0.11-beta.3"
161
+ "@failproofai/failproofaid-linux-x64": "1.0.11",
162
+ "@failproofai/failproofaid-linux-arm64": "1.0.11",
163
+ "@failproofai/failproofaid-darwin-x64": "1.0.11",
164
+ "@failproofai/failproofaid-darwin-arm64": "1.0.11"
165
165
  },
166
166
  failproofaidBinaries: {
167
- "linux-x64": "c3533dd4e77f513a3123b7eb14cd3ecfacbdef44d838c2e99b90609fb33b629e",
168
- "linux-arm64": "0379ae9dbe67e08ef0761dc06b2431810915d21c20b4203adb7a0582b5177e6d",
169
- "darwin-x64": "067220d805576a1ae8779ba25dded8ee67264f802113f2494bf1a53f00fce69d",
170
- "darwin-arm64": "bd3c9384ed2f7ea1cbf33c45876c058a35c9e0a889e0338a11f1e494fcc315cc"
167
+ "linux-x64": "49b11d95dafeb2dfecc3b92d7e18243e6b93706ebc2baf44fee9d8875ee1f90a",
168
+ "linux-arm64": "720702120b1a2427e8ccf2d53f2e782f1f549c4b2da8880832af5b468eeefab6",
169
+ "darwin-x64": "8861a67d2155831fa6a3699c59ebcfe7eeabf6c6234ef57b2165b52b78e7e3ca",
170
+ "darwin-arm64": "4acf268dd92bc928d29feb90a3ca7162bf7505af781ae51f56e7b3899420327a"
171
171
  }
172
172
  };
173
173
  });
@@ -34734,10 +34734,10 @@ async function connectToCloud(input) {
34734
34734
  const { since: _drop, ...kept } = orgSwitch ? {} : prev.org ?? {};
34735
34735
  next.org = { ...kept, ...since };
34736
34736
  }
34737
+ writeCredentials(next);
34737
34738
  if (ingestResult.ok && prev.ingest && prev.ingest.key !== input.token) {
34738
34739
  recoverCredentialRefusals(Boolean(prev.org?.id && prev.org.id === known?.orgId && sameOrigin(prev.ingest.url)), prev.org?.id);
34739
34740
  }
34740
- writeCredentials(next);
34741
34741
  if (process.env.FAILPROOFAI_CLOUD_CREDENTIALS) {
34742
34742
  if (policyResult.ok)
34743
34743
  writeCloudCredentials(creds);
@@ -41690,6 +41690,12 @@ function editAgentConfig(text, agent, writes) {
41690
41690
  parse(next);
41691
41691
  return next;
41692
41692
  }
41693
+ function cloudOtlpBase(origin) {
41694
+ return `${origin.replace(/\/+$/, "")}/otel`;
41695
+ }
41696
+ function otlpDestination(origin, local, port) {
41697
+ return local ? `http://127.0.0.1:${port}` : cloudOtlpBase(origin);
41698
+ }
41693
41699
  function agentOtelWrites(agent, endpoint, key, local, content, config = {}) {
41694
41700
  const auth = local ? {} : { Authorization: `Bearer ${key}` };
41695
41701
  const env = {
@@ -41698,7 +41704,7 @@ function agentOtelWrites(agent, endpoint, key, local, content, config = {}) {
41698
41704
  OTEL_METRICS_EXPORTER: "otlp",
41699
41705
  OTEL_EXPORTER_OTLP_ENDPOINT: endpoint,
41700
41706
  OTEL_EXPORTER_OTLP_PROTOCOL: "http/protobuf",
41701
- ...!local ? { OTEL_EXPORTER_OTLP_HEADERS: `Authorization=Bearer%20${encodeURIComponent(key)}` } : {},
41707
+ ...!local ? { OTEL_EXPORTER_OTLP_HEADERS: `Authorization=Bearer ${key}` } : {},
41702
41708
  OTEL_LOG_USER_PROMPTS: content ? "1" : "0",
41703
41709
  OTEL_LOG_TOOL_DETAILS: content ? "1" : "0",
41704
41710
  OTEL_LOG_TOOL_CONTENT: content ? "1" : "0"
@@ -41813,8 +41819,12 @@ function credential() {
41813
41819
  const key = process.env.FAILPROOFAI_INGEST_KEY || ingest?.key;
41814
41820
  if (!key)
41815
41821
  throw new Error("No Cloud API key configured. Run `failproofai config` first.");
41816
- const url = new URL(process.env.FAILPROOFAI_INGEST_URL || ingest?.url || "https://app.befailproof.ai");
41817
- if (!["https:", "http:"].includes(url.protocol) || url.username || url.password)
41822
+ const raw = process.env.FAILPROOFAI_INGEST_URL || ingest?.url || "https://app.befailproof.ai";
41823
+ const checked = validateCloudUrl(raw);
41824
+ if (!checked.ok)
41825
+ throw new Error(`Invalid Cloud ingest URL: ${checked.reason}`);
41826
+ const url = new URL(raw);
41827
+ if (url.username || url.password)
41818
41828
  throw new Error("Invalid Cloud ingest URL.");
41819
41829
  return { key, origin: url.origin };
41820
41830
  }
@@ -41921,7 +41931,7 @@ async function enableAgent(agent, yes, localFlag, content, options) {
41921
41931
  const port = readConfig().collector.otlp?.port ?? 4318;
41922
41932
  if (!Number.isInteger(port) || port < 1 || port > 65535)
41923
41933
  throw new Error("collector.otlp.port must be between 1 and 65535.");
41924
- const destination = local ? `http://127.0.0.1:${port}` : origin;
41934
+ const destination = otlpDestination(origin, local, port);
41925
41935
  const original = existsSync50(file) ? readFileSync38(file, "utf8") : null;
41926
41936
  const parsed = parseAgentConfig(original ?? "", agent);
41927
41937
  const oldState = existing ? privateState(agent) : null;
@@ -41996,9 +42006,6 @@ async function enableAgent(agent, yes, localFlag, content, options) {
41996
42006
  lines.push(`${AGENT_LABELS[agent]} settings cannot carry an auth header; using the local relay automatically.`);
41997
42007
  if (local)
41998
42008
  lines.push("The daemon picks this up within seconds — no restart. Use `failproofai otel status` to check the relay.");
41999
- const result = await introspectKey(origin, key, options.fetchImpl, 3000);
42000
- if (result.kind === "ok" && result.identity.otelIngest === false)
42001
- lines.push(OTEL_ORG_OFF);
42002
42009
  await options.onEvent?.("otel_enabled", { agent, local, content });
42003
42010
  return { lines, exitCode: 0, events: [{ name: "otel_enabled", agent, local, content }] };
42004
42011
  }
@@ -42042,7 +42049,9 @@ async function status(options) {
42042
42049
  try {
42043
42050
  const state = privateState(agent);
42044
42051
  const original = parseAgentConfig(state.original ?? "", agent);
42045
- const expected = parseAgentConfig(editAgentConfig(state.original ?? "", agent, agentOtelWrites(agent, record.destination, credential().key, record.local, record.content, original)), agent);
42052
+ const { key, origin } = credential();
42053
+ const expectedDestination = record.local ? record.destination : cloudOtlpBase(origin);
42054
+ const expected = parseAgentConfig(editAgentConfig(state.original ?? "", agent, agentOtelWrites(agent, expectedDestination, key, record.local, record.content, original)), agent);
42046
42055
  managed = record.keys.every((k) => JSON.stringify(getSetting(parsed, k.path)) === JSON.stringify(getSetting(expected, k.path)));
42047
42056
  } catch {}
42048
42057
  }
@@ -42081,7 +42090,7 @@ async function runOtelCommand(args, options = {}) {
42081
42090
  if (consumed.length)
42082
42091
  throw new Error("env takes only --service <name> and --local.");
42083
42092
  const local = rest.includes("--local");
42084
- const endpoint = local ? `http://127.0.0.1:${readConfig().collector.otlp?.port ?? 4318}` : origin;
42093
+ const endpoint = otlpDestination(origin, local, readConfig().collector.otlp?.port ?? 4318);
42085
42094
  const quote = (s) => `'${s.replace(/'/g, "'\\''")}'`;
42086
42095
  const values = {
42087
42096
  OTEL_EXPORTER_OTLP_ENDPOINT: endpoint,
@@ -42099,6 +42108,13 @@ async function runOtelCommand(args, options = {}) {
42099
42108
  if (rest.slice(1).some((x) => !flags.has(x)))
42100
42109
  throw new Error("Unexpected positional argument.");
42101
42110
  const agents = target === "all" ? [...OTEL_AGENTS] : [target];
42111
+ if (verb === "enable") {
42112
+ const { origin, key } = credential();
42113
+ const org = await introspectKey(origin, key, options.fetchImpl, 3000);
42114
+ if (org.kind === "ok" && org.identity.otelIngest === false) {
42115
+ return { lines: [OTEL_ORG_OFF, "Nothing changed: transcript upload keeps running."], exitCode: 1 };
42116
+ }
42117
+ }
42102
42118
  const result = { lines: [], exitCode: 0, events: [] };
42103
42119
  for (const agent of agents) {
42104
42120
  if (verb === "enable") {
@@ -42132,6 +42148,7 @@ var init_otel_cli = __esm(() => {
42132
42148
  init_fp_home();
42133
42149
  init_safe_config_write();
42134
42150
  init_collector_config();
42151
+ init_cloud_enrollment();
42135
42152
  init_integrations();
42136
42153
  init_tui();
42137
42154
  init_otel_writers();
@@ -42144,6 +42161,7 @@ var init_otel_cli2 = __esm(() => {
42144
42161
  init_fp_home();
42145
42162
  init_safe_config_write();
42146
42163
  init_collector_config();
42164
+ init_cloud_enrollment();
42147
42165
  init_integrations();
42148
42166
  init_tui();
42149
42167
  init_otel_writers();
@@ -49833,10 +49851,8 @@ function renderStatusScreen(facts, opts = {}) {
49833
49851
  };
49834
49852
  const codexValue = () => {
49835
49853
  const codex = facts.codex;
49836
- if (!codex || codex.kind === "none")
49854
+ if (!codex || codex.kind === "none" || codex.kind === "system")
49837
49855
  return null;
49838
- if (codex.kind === "system")
49839
- return `${kit.on} Enforcing (system config)`;
49840
49856
  if (codex.kind === "trusted")
49841
49857
  return `${kit.on} Enforcing (hooks trusted)`;
49842
49858
  if (codex.kind === "ungated")
@@ -50200,7 +50216,7 @@ import { realpathSync as realpathSync9 } from "fs";
50200
50216
  import { dirname as dirname32, resolve as resolve43 } from "path";
50201
50217
  import { fileURLToPath as fileURLToPath4 } from "url";
50202
50218
  // package.json
50203
- var version = "1.0.11-beta.3";
50219
+ var version = "1.0.11";
50204
50220
 
50205
50221
  // bin/failproofai.mjs
50206
50222
  if (!process.env.FAILPROOFAI_PACKAGE_ROOT) {
package/dist/worker.mjs CHANGED
@@ -1165,7 +1165,7 @@ function instruct(reason) {
1165
1165
  }
1166
1166
 
1167
1167
  // package.json
1168
- var version = "1.0.11-beta.3";
1168
+ var version = "1.0.11";
1169
1169
  var init_package = () => {};
1170
1170
 
1171
1171
  // src/hooks/policy-types.ts
@@ -1,5 +1,5 @@
1
1
  name: failproofai
2
- version: 1.0.11-beta.3
2
+ version: 1.0.11
3
3
  description: Real-time FailproofAI policy enforcement for Hermes
4
4
  manifest_version: 2
5
5
  api_version: 1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "failproofai",
3
- "version": "1.0.11-beta.3",
3
+ "version": "1.0.11",
4
4
  "description": "Observability and enforcement for AI agent harnesses. 40 built-in policies hooked into 12 of them — Claude Code, Codex, Cursor, Hermes, OpenClaw and more — blocking the tool call before it runs. Local dashboard included, no account needed.",
5
5
  "bin": {
6
6
  "failproofai": "./dist/cli.mjs",
@@ -125,15 +125,15 @@
125
125
  "browserslist": "4.28.8"
126
126
  },
127
127
  "optionalDependencies": {
128
- "@failproofai/failproofaid-linux-x64": "1.0.11-beta.3",
129
- "@failproofai/failproofaid-linux-arm64": "1.0.11-beta.3",
130
- "@failproofai/failproofaid-darwin-x64": "1.0.11-beta.3",
131
- "@failproofai/failproofaid-darwin-arm64": "1.0.11-beta.3"
128
+ "@failproofai/failproofaid-linux-x64": "1.0.11",
129
+ "@failproofai/failproofaid-linux-arm64": "1.0.11",
130
+ "@failproofai/failproofaid-darwin-x64": "1.0.11",
131
+ "@failproofai/failproofaid-darwin-arm64": "1.0.11"
132
132
  },
133
133
  "failproofaidBinaries": {
134
- "linux-x64": "c3533dd4e77f513a3123b7eb14cd3ecfacbdef44d838c2e99b90609fb33b629e",
135
- "linux-arm64": "0379ae9dbe67e08ef0761dc06b2431810915d21c20b4203adb7a0582b5177e6d",
136
- "darwin-x64": "067220d805576a1ae8779ba25dded8ee67264f802113f2494bf1a53f00fce69d",
137
- "darwin-arm64": "bd3c9384ed2f7ea1cbf33c45876c058a35c9e0a889e0338a11f1e494fcc315cc"
134
+ "linux-x64": "49b11d95dafeb2dfecc3b92d7e18243e6b93706ebc2baf44fee9d8875ee1f90a",
135
+ "linux-arm64": "720702120b1a2427e8ccf2d53f2e782f1f549c4b2da8880832af5b468eeefab6",
136
+ "darwin-x64": "8861a67d2155831fa6a3699c59ebcfe7eeabf6c6234ef57b2165b52b78e7e3ca",
137
+ "darwin-arm64": "4acf268dd92bc928d29feb90a3ca7162bf7505af781ae51f56e7b3899420327a"
138
138
  }
139
139
  }
@@ -368,10 +368,13 @@ export async function connectToCloud(input: ConnectInput): Promise<ConnectOutcom
368
368
  const { since: _drop, ...kept } = orgSwitch ? {} : (prev.org ?? {});
369
369
  next.org = { ...kept, ...since };
370
370
  }
371
+ writeCredentials(next);
372
+ // Only after the replacement key is on disk. Recovery requests a flush, and
373
+ // a flush served before the daemon sees the new key retries these batches
374
+ // with the key that was refused, re-parking them as definitive refusals.
371
375
  if (ingestResult.ok && prev.ingest && prev.ingest.key !== input.token) {
372
376
  recoverCredentialRefusals(Boolean(prev.org?.id && prev.org.id === known?.orgId && sameOrigin(prev.ingest.url)), prev.org?.id);
373
377
  }
374
- writeCredentials(next);
375
378
  // Legacy JSON override remains supported; the consolidated file above is
376
379
  // published once, never as a mixture of previous and replacement slots.
377
380
  if (process.env.FAILPROOFAI_CLOUD_CREDENTIALS) {
@@ -560,8 +560,8 @@ export function renderStatusScreen(facts: StatusFacts, opts: ScreenKitOpts & { c
560
560
  // because hooks being written does not make them run.
561
561
  const codexValue = (): string | null => {
562
562
  const codex = facts.codex;
563
- if (!codex || codex.kind === "none") return null;
564
- if (codex.kind === "system") return `${kit.on} Enforcing (system config)`;
563
+ // Hooks in Codex's system config always run: nothing to say.
564
+ if (!codex || codex.kind === "none" || codex.kind === "system") return null;
565
565
  if (codex.kind === "trusted") return `${kit.on} Enforcing (hooks trusted)`;
566
566
  if (codex.kind === "ungated") return `${kit.on} Enforcing`;
567
567
  return `${kit.off} Not enforcing: ${codex.untrusted === codex.total ? "hooks not trusted" : `${codex.untrusted} of ${codex.total} hooks not trusted`}`;
@@ -12,10 +12,11 @@ import { collectorHealthFile, configFile, otelAgentStateFile, otlpHealthFile } f
12
12
  import { writeConfigFileAtomic } from "./safe-config-write";
13
13
  import { agentSessionsEnabled } from "./collector-config";
14
14
  import { introspectKey } from "./cloud-introspect";
15
+ import { validateCloudUrl } from "./cloud-enrollment";
15
16
  import { readJsonFile } from "./integrations";
16
17
  import { selectOne } from "./tui";
17
18
  import {
18
- AGENT_LABELS, OTEL_AGENTS, agentConfigPath, agentOtelWrites, editAgentConfig,
19
+ AGENT_LABELS, OTEL_AGENTS, agentConfigPath, agentOtelWrites, editAgentConfig, otlpDestination, cloudOtlpBase,
19
20
  getSetting, parseAgentConfig, vscodeInstalled,
20
21
  type JsonObject, type OtelAgent, type SettingWrite,
21
22
  } from "./otel-writers";
@@ -91,8 +92,13 @@ function credential(): { key: string; origin: string } {
91
92
  const ingest = readCredentials().ingest;
92
93
  const key = process.env.FAILPROOFAI_INGEST_KEY || ingest?.key;
93
94
  if (!key) throw new Error("No Cloud API key configured. Run `failproofai config` first.");
94
- const url = new URL(process.env.FAILPROOFAI_INGEST_URL || ingest?.url || "https://app.befailproof.ai");
95
- if (!["https:", "http:"].includes(url.protocol) || url.username || url.password) throw new Error("Invalid Cloud ingest URL.");
95
+ const raw = process.env.FAILPROOFAI_INGEST_URL || ingest?.url || "https://app.befailproof.ai";
96
+ // Every caller sends or prints this key for the origin: the same rule as
97
+ // Cloud enrollment, https or loopback http only, so it never travels in clear.
98
+ const checked = validateCloudUrl(raw);
99
+ if (!checked.ok) throw new Error(`Invalid Cloud ingest URL: ${checked.reason}`);
100
+ const url = new URL(raw);
101
+ if (url.username || url.password) throw new Error("Invalid Cloud ingest URL.");
96
102
  return { key, origin: url.origin };
97
103
  }
98
104
  function backupOnce(path: string, original: string | null): void {
@@ -185,7 +191,7 @@ async function enableAgent(agent: OtelAgent, yes: boolean, localFlag: boolean, c
185
191
  const local = localFlag || agent === "copilot";
186
192
  const port = readConfig().collector.otlp?.port ?? 4318;
187
193
  if (!Number.isInteger(port) || port < 1 || port > 65535) throw new Error("collector.otlp.port must be between 1 and 65535.");
188
- const destination = local ? `http://127.0.0.1:${port}` : origin;
194
+ const destination = otlpDestination(origin, local, port);
189
195
  const original = existsSync(file) ? readFileSync(file, "utf8") : null;
190
196
  const parsed = parseAgentConfig(original ?? "", agent);
191
197
  const oldState = existing ? privateState(agent) : null;
@@ -267,8 +273,6 @@ async function enableAgent(agent: OtelAgent, yes: boolean, localFlag: boolean, c
267
273
  if (keptPromptPrivacy) lines.push("Codex log_user_prompt = false kept; user prompt capture remains off.");
268
274
  if (local && !localFlag) lines.push(`${AGENT_LABELS[agent]} settings cannot carry an auth header; using the local relay automatically.`);
269
275
  if (local) lines.push("The daemon picks this up within seconds — no restart. Use `failproofai otel status` to check the relay.");
270
- const result = await introspectKey(origin, key, options.fetchImpl, 3000);
271
- if (result.kind === "ok" && result.identity.otelIngest === false) lines.push(OTEL_ORG_OFF);
272
276
  await options.onEvent?.("otel_enabled", { agent, local, content });
273
277
  return { lines, exitCode: 0, events: [{ name: "otel_enabled", agent, local, content }] };
274
278
  }
@@ -305,8 +309,12 @@ async function status(options: OtelOptions): Promise<OtelResult> {
305
309
  try {
306
310
  const state = privateState(agent);
307
311
  const original = parseAgentConfig(state.original ?? "", agent);
312
+ const { key, origin } = credential();
313
+ // Cloud's address is recomputed, so settings written for an older
314
+ // address (or another Cloud) read as "not managed" until re-enabled.
315
+ const expectedDestination = record.local ? record.destination : cloudOtlpBase(origin);
308
316
  const expected = parseAgentConfig(editAgentConfig(state.original ?? "", agent,
309
- agentOtelWrites(agent, record.destination, credential().key, record.local, record.content, original)), agent);
317
+ agentOtelWrites(agent, expectedDestination, key, record.local, record.content, original)), agent);
310
318
  managed = record.keys.every(k => JSON.stringify(getSetting(parsed, k.path)) === JSON.stringify(getSetting(expected, k.path)));
311
319
  } catch { /* Missing recovery state or key. */ }
312
320
  }
@@ -341,7 +349,7 @@ export async function runOtelCommand(args: string[], options: OtelOptions = {}):
341
349
  const consumed = rest.filter((_, i) => i !== index && i !== index + 1 || index < 0).filter(x => x !== "--local");
342
350
  if (consumed.length) throw new Error("env takes only --service <name> and --local.");
343
351
  const local = rest.includes("--local");
344
- const endpoint = local ? `http://127.0.0.1:${readConfig().collector.otlp?.port ?? 4318}` : origin;
352
+ const endpoint = otlpDestination(origin, local, readConfig().collector.otlp?.port ?? 4318);
345
353
  const quote = (s: string) => `'${s.replace(/'/g, "'\\''")}'`;
346
354
  const values = {
347
355
  OTEL_EXPORTER_OTLP_ENDPOINT: endpoint, OTEL_EXPORTER_OTLP_PROTOCOL: "http/protobuf",
@@ -355,6 +363,16 @@ export async function runOtelCommand(args: string[], options: OtelOptions = {}):
355
363
  if (!target || (target !== "all" && !OTEL_AGENTS.includes(target as OtelAgent))) throw new Error(`Choose an agent: ${OTEL_AGENTS.join(", ")}, all.`);
356
364
  if (rest.slice(1).some(x => !flags.has(x))) throw new Error("Unexpected positional argument.");
357
365
  const agents = target === "all" ? [...OTEL_AGENTS] : [target as OtelAgent];
366
+ if (verb === "enable") {
367
+ // Enabling stops the agent's transcript upload. With org ingest off, Cloud
368
+ // would refuse the OTEL export too and the sessions would go nowhere, so
369
+ // nothing is written. An unknown answer (offline, older server) proceeds.
370
+ const { origin, key } = credential();
371
+ const org = await introspectKey(origin, key, options.fetchImpl, 3000);
372
+ if (org.kind === "ok" && org.identity.otelIngest === false) {
373
+ return { lines: [OTEL_ORG_OFF, "Nothing changed: transcript upload keeps running."], exitCode: 1 };
374
+ }
375
+ }
358
376
  const result: OtelResult = { lines: [], exitCode: 0, events: [] };
359
377
  for (const agent of agents) {
360
378
  if (verb === "enable") {
@@ -186,13 +186,28 @@ export function editAgentConfig(text: string, agent: OtelAgent, writes: SettingW
186
186
  return next;
187
187
  }
188
188
 
189
+ /**
190
+ * FailproofAI Cloud's OTLP base URL. Exporters append `/v1/<signal>` to it, as
191
+ * the OTLP spec says. The local relay is plain `http://127.0.0.1:<port>`.
192
+ */
193
+ export function cloudOtlpBase(origin: string): string {
194
+ return `${origin.replace(/\/+$/, "")}/otel`;
195
+ }
196
+
197
+ /** Where an agent's exporter points: the local relay, or Cloud's OTLP base. */
198
+ export function otlpDestination(origin: string, local: boolean, port: number): string {
199
+ return local ? `http://127.0.0.1:${port}` : cloudOtlpBase(origin);
200
+ }
201
+
189
202
  export function agentOtelWrites(agent: OtelAgent, endpoint: string, key: string, local: boolean, content: boolean, config: JsonObject = {}): SettingWrite[] {
190
203
  const auth = local ? {} : { Authorization: `Bearer ${key}` };
191
204
  const env: JsonObject = {
192
205
  CLAUDE_CODE_ENABLE_TELEMETRY: "1",
193
206
  OTEL_LOGS_EXPORTER: "otlp", OTEL_METRICS_EXPORTER: "otlp",
194
207
  OTEL_EXPORTER_OTLP_ENDPOINT: endpoint, OTEL_EXPORTER_OTLP_PROTOCOL: "http/protobuf",
195
- ...(!local ? { OTEL_EXPORTER_OTLP_HEADERS: `Authorization=Bearer%20${encodeURIComponent(key)}` } : {}),
208
+ // A literal space, as Claude Code's own docs write it: its exporter sends
209
+ // the value as-is, so the spec's "%20" arrived as "Bearer%20<key>" → 401.
210
+ ...(!local ? { OTEL_EXPORTER_OTLP_HEADERS: `Authorization=Bearer ${key}` } : {}),
196
211
  OTEL_LOG_USER_PROMPTS: content ? "1" : "0",
197
212
  OTEL_LOG_TOOL_DETAILS: content ? "1" : "0",
198
213
  // Tool output needs OTEL_LOG_TOOL_CONTENT; assistant responses follow OTEL_LOG_USER_PROMPTS, so omit OTEL_LOG_ASSISTANT_RESPONSES.
@@ -1 +0,0 @@
1
- (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,94887,e=>{var a=e.i(95187);let t=(0,a.createServerReference)("600aa8312383c0b2abbe98cab59ec887935f27c42e",a.callServer,void 0,a.findSourceMapURL,"searchHookActivityAction");e.s(["f",0,t])},73520,e=>{var a=e.i(43476),t=e.i(24071),r=e.i(67927);e.s(["f",0,function({currentPage:e,totalPages:s,onPageChange:n}){if(s<=1)return null;let l=e=>`px-3 py-2 text-sm rounded-md transition-colors flex items-center gap-1 bg-muted text-muted-foreground ${e?"opacity-50 cursor-not-allowed":"hover:bg-muted/80"}`;return(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2 py-4",children:[(0,a.jsxs)("button",{onClick:()=>n(e-1),disabled:1===e,className:l(1===e),"aria-label":"Previous page",children:[(0,a.jsx)(t.f,{className:"w-4 h-4"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Previous"})]}),(0,a.jsx)("div",{className:"flex items-center gap-1",children:(()=>{if(s<=7)return Array.from({length:s},(e,a)=>a+1);let a=[1],t=Math.max(2,e-1),r=Math.min(s-1,e+1);e<=3&&(r=Math.min(5,s-1)),e>=s-2&&(t=Math.max(2,s-4)),t>2&&a.push("ellipsis-start");for(let e=t;e<=r;e++)a.push(e);return r<s-1&&a.push("ellipsis-end"),a.push(s),a})().map(t=>"string"==typeof t?(0,a.jsx)("span",{className:"px-2 text-muted-foreground",children:"..."},t):(0,a.jsx)("button",{onClick:()=>n(t),className:`min-w-[2.5rem] px-3 py-2 text-sm rounded-md transition-colors ${e===t?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-muted/80"}`,"aria-label":`Page ${t}`,"aria-current":e===t?"page":void 0,children:t},t))}),(0,a.jsxs)("button",{onClick:()=>n(e+1),disabled:e===s,className:l(e===s),"aria-label":"Next page",children:[(0,a.jsx)("span",{className:"hidden sm:inline",children:"Next"}),(0,a.jsx)(r.f,{className:"w-4 h-4"})]})]})}])},34713,e=>{e.s(["M",0,function(e){if(e<1e3)return`${e}ms`;let a=Math.round(e/100);if(a<600)return`${(a/10).toFixed(1)}s`;let t=Math.round(e/1e3);if(t<3600){let e=Math.floor(t/60);return`${e}m ${t%60}s`}let r=Math.round(e/6e4),s=Math.floor(r/60);return`${s}h ${r%60}m`},"g",0,function(e){let a=Date.now()-e;return a<6e4?`${Math.max(1,Math.floor(a/1e3))}s ago`:a<36e5?`${Math.floor(a/6e4)}m ago`:a<864e5?`${Math.floor(a/36e5)}h ago`:`${Math.floor(a/864e5)}d ago`}])},24071,e=>{var a=e.i(56420);let t={name:"chevron-left",size:24,node:[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]};t.node;let r=(0,a.f)(t);e.s(["f",0,r],24071)},67927,e=>{var a=e.i(56420);let t={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};t.node;let r=(0,a.f)(t);e.s(["f",0,r],67927)},16306,e=>{var a=e.i(56420);let t={name:"shield-alert",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]};t.node;let r=(0,a.f)(t);e.s(["f",0,r],16306)},84026,29407,e=>{var a=e.i(56420);let t={name:"shield-check",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]};t.node;let r=(0,a.f)(t);e.s(["f",0,r],84026);let s={name:"shield-x",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]],aliases:["shield-close"]};s.node;let n=(0,a.f)(s);e.s(["f",0,n],29407)},82954,e=>{var a=e.i(56420);let t={name:"shield",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]};t.node;let r=(0,a.f)(t);e.s(["f",0,r],82954)}])})();
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,[46241,e=>{var t=e.i(95187);let r=(0,t.createServerReference)("00afba1de7d164c84e26eba0a0ee28d9a36ad1fa9c",t.callServer,void 0,t.findSourceMapURL,"getTelemetryConfig");e.s(["f",0,r])},97917,e=>{var t=e.i(71645),r=e.i(9969);let n=/\b[\w-]+-extension:\/\//i;function o(e){return"app"===function({stack:e,filename:t,appOrigin:r}){let o=[t,e].filter(Boolean).join("\n");return o.trim()?n.test(o)?"extension":r&&o.includes(r)?"app":"unknown":"unknown"}(e)}e.s(["GlobalErrorListeners",0,function(){return(0,t.useEffect)(()=>{let e=e=>{o({stack:e.error?.stack,filename:e.filename,appOrigin:window.location.origin})&&(0,r.L)("unhandled_exception",{error_message:e.message,error_name:e.error?.name,error_filename:e.filename,error_lineno:e.lineno,error_colno:e.colno})},t=e=>{let t=e.reason;o({stack:t instanceof Error?t.stack:void 0,appOrigin:window.location.origin})&&(0,r.L)("unhandled_rejection",{error_message:t instanceof Error?t.message:String(t),error_name:t instanceof Error?t.name:void 0})};return window.addEventListener("error",e),window.addEventListener("unhandledrejection",t),()=>{window.removeEventListener("error",e),window.removeEventListener("unhandledrejection",t)}},[]),null}],97917)},55574,e=>{var t=e.i(43476),r=e.i(71645);let n=[],o=0,a=new Set;function i(){for(let e of a)e()}function s(e){return a.add(e),()=>a.delete(e)}function l(){return n}function u({message:e}){let[n,o]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{requestAnimationFrame(()=>o(!0));let e=setTimeout(()=>o(!1),2e3);return()=>clearTimeout(e)},[]),(0,t.jsx)("div",{className:`bg-card border border-border text-foreground text-sm px-4 py-2 rounded-lg shadow-lg transition-opacity duration-300 ${n?"opacity-100":"opacity-0"}`,children:e})}e.s(["Toaster",0,function(){let e=(0,r.useSyncExternalStore)(s,l,l);return(0,t.jsx)("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2",children:e.map(e=>(0,t.jsx)(u,{message:e.message},e.id))})},"toast",0,function(e){let t=o++;n=[...n,{id:t,message:e}],i(),setTimeout(()=>{n=n.filter(e=>e.id!==t),i()},2500)}])},63780,e=>{var t=e.i(43476),r=e.i(22016),n=e.i(18566),o=e.i(66794),a=e.i(71645),i=e.i(56420);let s={name:"git-branch",size:24,node:[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]]};s.node;let l=(0,i.f)(s);var u=e.i(16327);let c={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};c.node;let d=(0,i.f)(c),f={name:"book-open",size:24,node:[["path",{d:"M12 5v16",key:"1f6ucr"}],["path",{d:"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z",key:"1fyvmf"}]]};f.node;let h=(0,i.f)(f),p={name:"message-circle",size:24,node:[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]};p.node;let m=(0,i.f)(p),g={name:"messages-square",size:24,node:[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]]};g.node;let b=(0,i.f)(g),v={name:"message-square-warning",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M12 15h.01",key:"q59x07"}],["path",{d:"M12 7v4",key:"xawao1"}]]};v.node;let y=(0,i.f)(v);var x=e.i(67881);let w="failproofai@exosphere.host",k=[{label:"Star us on GitHub",icon:d,href:"https://github.com/failproofai/failproofai",color:"#f5c842",bg:"rgba(245,200,66,0.08)"},{label:"Documentation",icon:h,href:"https://docs.befailproof.ai/introduction",color:"#60a5fa",bg:"rgba(96,165,250,0.08)"},{label:"Join our Discord",icon:m,href:"https://discord.befailproof.ai/",color:"#5865f2",bg:"rgba(88,101,242,0.08)"},{label:"Join r/failproofai",icon:b,href:"https://www.reddit.com/r/failproofai/",color:"#ff4500",bg:"rgba(255,69,0,0.08)"},{label:"Feedback & Issues",icon:y,href:"https://github.com/FailproofAI/failproofai/issues/new/choose",color:"#34d399",bg:"rgba(52,211,153,0.08)"}],j=()=>{let[e,r]=(0,a.useState)(!1),n=(0,a.useCallback)(()=>r(!1),[]),o=(0,a.useCallback)(e=>{"Escape"===e.key&&r(!1)},[]);return(0,t.jsxs)("div",{className:"relative",onKeyDown:o,children:[e&&(0,t.jsx)("div",{className:"fixed inset-0 z-40",onClick:n,"aria-hidden":"true"}),(0,t.jsxs)(x.f,{type:"button",variant:"ghost",size:"sm",onClick:()=>r(e=>!e),"aria-expanded":e,"aria-haspopup":"true",className:"relative z-50 flex items-center gap-1.5 text-muted-foreground hover:text-foreground",children:[(0,t.jsx)(l,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"hidden sm:inline text-xs whitespace-nowrap",children:"Reach Us"}),(0,t.jsx)(u.f,{className:`h-3 w-3 transition-transform ${e?"rotate-180":""}`})]}),e&&(0,t.jsxs)("div",{className:"absolute right-0 mt-2 w-60 rounded-lg border border-border bg-card shadow-xl z-50",role:"menu",style:{boxShadow:"0 8px 32px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.04)"},children:[(0,t.jsxs)("div",{className:"px-3 py-2.5 border-b border-border",style:{background:"linear-gradient(135deg, rgba(236,72,153,0.12) 0%, rgba(139,92,246,0.08) 100%)"},children:[(0,t.jsx)("p",{className:"text-xs font-semibold",style:{color:"#e879f9",letterSpacing:"0.06em"},children:"Reach Developers"}),(0,t.jsx)("p",{className:"text-[0.65rem] text-muted-foreground mt-0.5",children:"We'd love to hear from you"})]}),(0,t.jsx)("div",{className:"py-1",children:k.map(({label:e,icon:r,href:o,color:a,bg:i})=>(0,t.jsxs)("a",{href:o,target:"_blank",rel:"noopener noreferrer",role:"menuitem",className:"flex items-center gap-2.5 px-3 py-2 text-xs transition-colors",style:{color:"var(--muted-foreground)"},onMouseEnter:e=>{e.currentTarget.style.background=i,e.currentTarget.style.color=a},onMouseLeave:e=>{e.currentTarget.style.background="",e.currentTarget.style.color=""},onClick:n,children:[(0,t.jsx)(r,{className:"h-3.5 w-3.5 flex-shrink-0",style:{color:a}}),e]},e))}),(0,t.jsx)("div",{className:"px-3 py-2 border-t border-border",style:{background:"rgba(0,0,0,0.2)"},children:(0,t.jsxs)("p",{className:"text-[0.65rem] text-muted-foreground",children:["or email"," ",(0,t.jsx)("a",{href:`mailto:${w}`,className:"transition-colors",style:{color:"#e879f9"},onMouseEnter:e=>e.currentTarget.style.opacity="0.75",onMouseLeave:e=>e.currentTarget.style.opacity="1",children:w})]})})]})]})},N={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};N.node;let S=(0,i.f)(N);var _=e.i(47163),P=e.i(85881);let E=[{label:"Off",value:0},{label:"5s",value:5},{label:"10s",value:10},{label:"30s",value:30}];function C({className:e}){let r=(0,n.useRouter)(),[o,i]=(0,a.useTransition)(),{intervalSec:s,setIntervalSec:l}=(0,P.useAutoRefresh)(),u=(0,a.useCallback)(()=>{i(()=>r.refresh())},[r]);(0,a.useEffect)(()=>{if(s<=0)return;let e=setInterval(u,1e3*s);return()=>clearInterval(e)},[s,u]);let c=s>0;return(0,t.jsxs)("div",{className:(0,_.f)("inline-flex items-center rounded-lg border border-border bg-muted/50 p-0.5 gap-0.5",e),children:[(0,t.jsx)("button",{onClick:u,title:"Refresh",className:(0,_.f)("inline-flex items-center justify-center rounded-md p-1.5 transition-colors",c?"text-primary hover:bg-primary/10":"text-muted-foreground hover:text-foreground hover:bg-muted"),children:(0,t.jsx)(S,{className:(0,_.f)("w-3.5 h-3.5",o&&"animate-spin")})}),(0,t.jsx)("div",{className:"w-px h-4 bg-border"}),(0,t.jsx)("div",{className:"inline-flex items-center gap-0.5",role:"group","aria-label":"Auto-refresh interval",children:E.map(e=>(0,t.jsx)("button",{onClick:()=>l(e.value),"aria-pressed":s===e.value,className:(0,_.f)("px-2 py-1 text-[11px] font-medium rounded-md transition-colors",s===e.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground hover:bg-muted"),children:e.label},e.value))})]})}var L=e.i(12344);let M=[{href:"/projects",label:"projects"},{href:"/policies",label:"policies"},{href:"/audit",label:"audit"}];e.s(["Navbar",0,({disabledPages:e=[]})=>{let a=(0,n.usePathname)(),{capture:i}=(0,L.usePostHog)(),s=a.startsWith("/policies")?"policies":a.startsWith("/audit")?"audit":a.startsWith("/settings")?"settings":a.startsWith("/projects")||a.startsWith("/project/")?"projects":"";return(0,t.jsxs)("header",{className:"app-header",children:[(0,t.jsx)("a",{href:"https://github.com/failproofai/failproofai",target:"_blank",rel:"noopener noreferrer",className:"h-brand",style:{flex:"none"},"aria-label":"failproof ai · GitHub",children:(0,t.jsx)("img",{src:"/logo.svg",alt:"failproof_ai",style:{height:18,display:"block",flexShrink:0}})}),(0,t.jsx)("nav",{className:"tabs",style:{border:"none",padding:0,gap:0},children:M.filter(({href:t})=>{let r=t.slice(1);return!e.includes(r)}).map(({href:e,label:n})=>{let o="/projects"===e?"/projects"===a||a.startsWith("/project/"):a.startsWith(e);return(0,t.jsx)(r.default,{href:e,className:`tab${o?" is-active":""}`,"aria-current":o?"page":void 0,onClick:()=>{"/audit"===e&&i("audit_nav_clicked",{from_path:a,is_active_tab:o})},children:n},e)})}),(0,t.jsx)("div",{style:{flex:1}}),(0,t.jsxs)("div",{className:"h-meta",children:[(0,t.jsxs)("span",{className:"h-version",children:["v","1.0.11-beta.3"]}),s&&(0,t.jsx)("span",{className:"h-brand-sep","aria-hidden":"true",children:"·"}),s&&(0,t.jsx)("span",{className:"h-brand-section",children:s})]}),(0,t.jsxs)("div",{className:"h-actions",children:[(0,t.jsx)(C,{}),(0,t.jsx)("span",{style:{width:1,height:18,background:"var(--line)",margin:"0 6px"}}),!e.includes("settings")&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.default,{href:"/settings",className:`h-icon-btn${a.startsWith("/settings")?" is-active":""}`,"aria-label":"settings","aria-current":a.startsWith("/settings")?"page":void 0,title:"settings",children:(0,t.jsx)(o.f,{className:"w-3.5 h-3.5",strokeWidth:1.75,"aria-hidden":"true"})}),(0,t.jsx)("span",{style:{width:1,height:18,background:"var(--line)",margin:"0 6px"}})]}),(0,t.jsx)(j,{})]})]})}],63780)},67881,e=>{var t=e.i(43476),r=e.i(71645),n=e.i(47163);let o=r.forwardRef(({className:e,variant:r="default",size:o="default",...a},i)=>(0,t.jsx)("button",{className:(0,n.f)("inline-flex items-center justify-center rounded-md text-sm font-medium transition-[background-color,color,box-shadow,border-color] duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:opacity-50 disabled:pointer-events-none",{"bg-primary text-primary-foreground hover:bg-primary/90 hover:shadow-[0_0_0_1px_var(--primary)]":"default"===r,"text-foreground hover:bg-muted":"ghost"===r,"border border-border bg-transparent hover:border-primary/60 hover:bg-card":"outline"===r,"h-10 py-2 px-4":"default"===o,"h-10 w-10":"icon"===o,"h-9 px-3":"sm"===o,"h-11 px-8":"lg"===o},e),ref:i,...a}));o.displayName="Button",e.s(["f",0,o])},85881,e=>{var t=e.i(43476),r=e.i(71645);let n=(0,r.createContext)(void 0);e.s(["AutoRefreshProvider",0,function({children:e}){let[o,a]=(0,r.useState)(0);return(0,t.jsx)(n.Provider,{value:{intervalSec:o,setIntervalSec:a},children:e})},"useAutoRefresh",0,function(){let e=(0,r.useContext)(n);if(!e)throw Error("useAutoRefresh must be used within AutoRefreshProvider");return e}])},12344,e=>{var t=e.i(43476),r=e.i(71645),n=e.i(18566),o=e.i(46241),a=e.i(9969);let i=(0,r.createContext)(void 0);e.s(["PostHogProvider",0,function({children:e}){let s=(0,n.usePathname)(),l=(0,r.useRef)(null),u=(0,r.useRef)(!1);(0,r.useEffect)(()=>{let e=!1;return(0,o.f)().then(t=>{e||((0,a.$)(t),u.current=!0,(0,a.L)("$pageview"),l.current=window.location.pathname)}),()=>{e=!0}},[]),(0,r.useEffect)(()=>{u.current&&l.current!==s&&(l.current=s,(0,a.L)("$pageview"))},[s]);let c=r.default.useCallback((e,t)=>{(0,a.L)(e,t)},[]);return(0,t.jsx)(i.Provider,{value:{capture:c},children:e})},"usePostHog",0,function(){let e=(0,r.useContext)(i);if(void 0===e)throw Error("usePostHog must be used within a PostHogProvider");return e}])},9969,e=>{let t=null;e.s(["L",0,function(e,r){if(!t||!t.enabled)return;let n=JSON.stringify({api_key:t.apiKey,event:e,distinct_id:t.distinctId,properties:{...r,$lib:"failproofai-web",failproofai_version:t.version,product:"failproofai-oss",$current_url:window.location.href,$pathname:window.location.pathname}});fetch(t.host.replace(/\/+$/,"")+"/capture/",{method:"POST",headers:{"Content-Type":"application/json"},body:n,keepalive:!0,signal:AbortSignal.timeout(5e3)}).catch(()=>{})},"$",0,function(e){t=e}],9969)},5014,e=>{var t=e.i(71645);let r=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"},o=(0,t.createContext)({}),a=(0,t.forwardRef)(({color:e,size:a,width:i,height:s,strokeWidth:l,absoluteStrokeWidth:u,nonScalingStroke:c,className:d="",children:f,iconNode:h=[],icon:p={node:h,aliases:[],size:24},...m},g)=>{let{size:b=24,strokeWidth:v=2,absoluteStrokeWidth:y=!1,nonScalingStroke:x=!1,color:w="currentColor",className:k=""}=(0,t.useContext)(o)??{},j=!!f||(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(m),[N,S,_=[]]=function(e,t={}){return function(e,t={}){let o=t.attributeNames??{},a=e=>o[e]??e,i=e.size??e.width??n.width,s=e.size??e.height??n.height,l=e.aliases?.filter(e=>"string"==typeof e&&""!==e.trim()).map(e=>`lucide-${e}`)??[],u=[...e.name?[`lucide-${e.name}`]:[],...l],c=t.className?.split(" ").filter(Boolean)??[],d=!1===t.includeDefaultClasses?r(...c):r("lucide",...u,...c),f=t.absoluteStrokeWidth?Number(t.strokeWidth??n["stroke-width"])*Number(e.size??e.width??n.width)/Number(t.size??t.width??n.width):t.strokeWidth??n["stroke-width"];return["svg",{...Object.entries(n).reduce((e,[t,r])=>(e[a(t)]=r,e),{}),..."color"in t&&t.color&&{[a("stroke")]:t.color},..."size"in t&&null!=t.size&&{[a("width")]:t.size,[a("height")]:t.size},..."width"in t&&null!=t.width&&{[a("width")]:t.width},..."height"in t&&null!=t.height&&{[a("height")]:t.height},[a("stroke-width")]:f,...d&&{[a("class")]:d},[a("viewBox")]:`0 0 ${i} ${s}`,...!1===t.hasA11yProp?{[a("aria-hidden")]:"true"}:{},..."attributes"in t&&t.attributes},e.node.map(e=>{let[r,n,o]=e,i=t.nonScalingStroke?{[a("vector-effect")]:"non-scaling-stroke",...n}:n;return o?[r,i,o]:[r,i]})]}(e,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}(p,{color:e??w,width:i??a??b,height:s??a??b,strokeWidth:l??v,absoluteStrokeWidth:u??y,nonScalingStroke:c??x,className:r(k,d),hasA11yProp:j,attributes:m});return(0,t.createElement)(N,{ref:g,...S},[..._.map(([e,r])=>(0,t.createElement)(e,r)),...Array.isArray(f)?f:[f]])});e.s(["default",0,a],5014)},56420,e=>{var t=e.i(71645),r=e.i(5014);e.s(["f",0,function(e,n=[],o=[]){let a,i="string"==typeof e?function(e,t,r=[]){if(null==t)throw Error("[lucide]: iconNode is required when icon name is used");return{name:e?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),size:24,node:t,...r.length>0?{aliases:r}:{}}}(e,n,o):e,s=(0,t.forwardRef)(({className:e,...n},o)=>(0,t.createElement)(r.default,{ref:o,icon:i,className:e,...n}));return i.name&&(s.displayName=(a=(e=>{let t="",r=!1;for(let n of e){if("-"===n||"_"===n||n<=" "){r=t.length>0;continue}0===t.length?t+=n.toLowerCase():t+=r?n.toUpperCase():n,r=!1}return t})(i.name)).charAt(0).toUpperCase()+a.slice(1)),s}],56420)},16327,e=>{var t=e.i(56420);let r={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],16327)},66794,e=>{var t=e.i(56420);let r={name:"settings",size:24,node:[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],66794)},95187,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0});var n={callServer:function(){return a.callServer},createServerReference:function(){return s.createServerReference},findSourceMapURL:function(){return i.findSourceMapURL}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=e.r(32120),i=e.r(92245),s=e.r(35326)},22016,(e,t,r)=>{e.i(47167),Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return b},useLinkStatus:function(){return y}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=e.r(90809),i=e.r(43476),s=a._(e.r(71645)),l=e.r(95057),u=e.r(8372),c=e.r(18581),d=e.r(18967),f=e.r(5550),h=e.r(88540),p=e.r(91949),m=e.r(73668),g=e.r(9396);function b(t){var r;let n,o,a,[b,y]=(0,s.useOptimistic)(p.IDLE_LINK_STATUS),x=(0,s.useRef)(null),{href:w,as:k,children:j,prefetch:N=null,passHref:S,replace:_,shallow:P,scroll:E,onClick:C,onMouseEnter:L,onTouchStart:M,legacyBehavior:R=!1,onNavigate:T,transitionTypes:z,ref:A,unstable_dynamicOnHover:$,...O}=t;n=j,R&&("string"==typeof n||"number"==typeof n)&&(n=(0,i.jsx)("a",{children:n}));let U=s.default.useContext(u.AppRouterContext),W=!1!==N,I=!1===N?"none":!0===N?"full":"auto",B="none"!==I?"auto"===I?g.FetchStrategy.PPR:g.FetchStrategy.Full:g.FetchStrategy.PPR,F="string"==typeof(r=k||w)?r:(0,l.formatUrl)(r);if(R){if(n?.$$typeof===Symbol.for("react.lazy"))throw Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag.");o=s.default.Children.only(n)}let D=R?o&&"object"==typeof o&&o.ref:A,H,q=s.default.useCallback(e=>(null!==U&&(x.current=(0,p.mountLinkInstance)(e,F,U,B,W,y,H)),()=>{x.current&&((0,p.unmountLinkForCurrentNavigation)(x.current),x.current=null),(0,p.unmountPrefetchableInstance)(e)}),[W,F,U,B,y,H]),K={ref:(0,c.useMergedRef)(q,D),onClick(t){R||"function"!=typeof C||C(t),R&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(t),!U||t.defaultPrevented||function(t,r,n,o,a,i,s,l="none"){if("u">typeof window){let u,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((u=t.currentTarget.getAttribute("target"))&&"_self"!==u||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,m.isLocalURL)(r)){o&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),i){let e=!1;if(i({preventDefault:()=>{e=!0}}),e)return}let{navigate:d}=e.r(32916);d(r,o?"replace":"push",!1===a?h.ScrollBehavior.NoScroll:h.ScrollBehavior.Default,n.current,s,l)}}(t,F,x,_,E,T,z,I)},onMouseEnter(e){R||"function"!=typeof L||L(e),R&&o.props&&"function"==typeof o.props.onMouseEnter&&o.props.onMouseEnter(e),U&&W&&(0,p.onNavigationIntent)(e.currentTarget,!0===$)},onTouchStart:function(e){R||"function"!=typeof M||M(e),R&&o.props&&"function"==typeof o.props.onTouchStart&&o.props.onTouchStart(e),U&&W&&(0,p.onNavigationIntent)(e.currentTarget,!0===$)}};return(0,d.isAbsoluteUrl)(F)?K.href=F:R&&!S&&("a"!==o.type||"href"in o.props)||(K.href=(0,f.addBasePath)(F)),a=R?s.default.cloneElement(o,K):(0,i.jsx)("a",{...O,...K,children:n}),(0,i.jsx)(v.Provider,{value:b,children:a})}let v=(0,s.createContext)(p.IDLE_LINK_STATUS),y=()=>(0,s.useContext)(v);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},18581,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return o}});let n=e.r(71645);function o(e,t){let r=(0,n.useRef)(null),o=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=o.current;t&&(o.current=null,t())}else e&&(r.current=a(e,n)),t&&(o.current=a(t,n))},[e,t])}function a(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},95057,(e,t,r)=>{e.i(47167),Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return s},formatWithValidation:function(){return u},urlObjectKeys:function(){return l}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=e.r(90809)._(e.r(98183)),i=/https?|ftp|gopher|file/;function s(e){let{auth:t,hostname:r}=e,n=e.protocol||"",o=e.pathname||"",s=e.hash||"",l=e.query||"",u=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?u=t+e.host:r&&(u=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(u+=":"+e.port)),l&&"object"==typeof l&&(l=String(a.urlQueryToSearchParams(l)));let c=e.search||l&&`?${l}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||i.test(n))&&!1!==u?(u="//"+(u||""),o&&"/"!==o[0]&&(o="/"+o)):u||(u=""),s&&"#"!==s[0]&&(s="#"+s),c&&"?"!==c[0]&&(c="?"+c),o=o.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${u}${o}${c}${s}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(e){return s(e)}},73668,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return a}});let n=e.r(18967),o=e.r(52817);function a(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,o.hasBasePath)(r.pathname)}catch(e){return!1}}},18967,(e,t,r)=>{e.i(47167),Object.defineProperty(r,"__esModule",{value:!0});var n={DecodeError:function(){return b},MiddlewareNotFoundError:function(){return w},MissingStaticPage:function(){return x},NormalizeError:function(){return v},PageNotFoundError:function(){return y},SP:function(){return m},ST:function(){return g},WEB_VITALS:function(){return a},execOnce:function(){return i},getDisplayName:function(){return d},getLocationOrigin:function(){return u},getURL:function(){return c},isAbsoluteUrl:function(){return l},isResSent:function(){return f},loadGetInitialProps:function(){return p},normalizeRepeatedSlashes:function(){return h},stringifyError:function(){return k}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let a=["CLS","FCP","INP","LCP","TTFB"];function i(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let s=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,l=e=>{let t=e.charCodeAt(0);return!!(t>=65&&t<=90||t>=97&&t<=122)&&s.test(e)};function u(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function c(){let{href:e}=window.location,t=u();return e.substring(t.length)}function d(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function f(e){return e.finished||e.headersSent}function h(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function p(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await p(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&f(r))return n;if(!n)throw Error(`"${d(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`);return n}let m="u">typeof performance,g=m&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class b extends Error{}class v extends Error{}class y extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class x extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class w extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function k(e){return JSON.stringify({message:e.message,stack:e.stack})}}],18566,(e,t,r)=>{t.exports=e.r(76562)}]);