@circuitwall/jarela 0.14.0 → 1.0.0

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 (164) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-path-routes-manifest.json +1 -1
  3. package/.next/standalone/.next/build-manifest.json +2 -2
  4. package/.next/standalone/.next/prerender-manifest.json +3 -3
  5. package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  6. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  7. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  11. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  12. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  13. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  14. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/.next/standalone/.next/server/app/_not-found.html +2 -2
  16. package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
  17. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  18. package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  19. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  20. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  21. package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  22. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  23. package/.next/standalone/.next/server/app/api/v1/agents/[id]/route.js +6 -1
  24. package/.next/standalone/.next/server/app/api/v1/agents/[id]/route.js.map +1 -1
  25. package/.next/standalone/.next/server/app/api/v1/agents/route.js +6 -1
  26. package/.next/standalone/.next/server/app/api/v1/agents/route.js.map +1 -1
  27. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/route.js +9 -1
  28. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/route.js.map +1 -1
  29. package/.next/standalone/.next/server/app/api/v1/bridges/route.js +9 -1
  30. package/.next/standalone/.next/server/app/api/v1/bridges/route.js.map +1 -1
  31. package/.next/standalone/.next/server/app/api/v1/builtin-tools/route.js +36 -29
  32. package/.next/standalone/.next/server/app/api/v1/builtin-tools/route.js.map +1 -1
  33. package/.next/standalone/.next/server/app/api/v1/events/route.js +7 -1
  34. package/.next/standalone/.next/server/app/api/v1/events/route.js.map +1 -1
  35. package/.next/standalone/.next/server/app/api/v1/extensions/route.js +3 -3
  36. package/.next/standalone/.next/server/app/api/v1/extensions/route.js.map +1 -1
  37. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/secrets/route.js +4 -4
  38. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/secrets/route.js.map +1 -1
  39. package/.next/standalone/.next/server/app/api/v1/health/route.js +7 -1
  40. package/.next/standalone/.next/server/app/api/v1/health/route.js.map +1 -1
  41. package/.next/standalone/.next/server/app/api/v1/mcp-servers/[name]/route.js +9 -1
  42. package/.next/standalone/.next/server/app/api/v1/mcp-servers/[name]/route.js.map +1 -1
  43. package/.next/standalone/.next/server/app/api/v1/mcp-servers/route.js +9 -1
  44. package/.next/standalone/.next/server/app/api/v1/mcp-servers/route.js.map +1 -1
  45. package/.next/standalone/.next/server/app/api/v1/models/route.js +6 -1
  46. package/.next/standalone/.next/server/app/api/v1/models/route.js.map +1 -1
  47. package/.next/standalone/.next/server/app/api/v1/page-capture/route.js +7 -1
  48. package/.next/standalone/.next/server/app/api/v1/page-capture/route.js.map +1 -1
  49. package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/approve/route.js +14 -7
  50. package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/approve/route.js.map +1 -1
  51. package/.next/standalone/.next/server/app/api/v1/providers/[provider]/models/route.js +28 -0
  52. package/.next/standalone/.next/server/app/api/v1/providers/[provider]/models/route.js.map +1 -1
  53. package/.next/standalone/.next/server/app/api/v1/providers/route.js +7 -1
  54. package/.next/standalone/.next/server/app/api/v1/providers/route.js.map +1 -1
  55. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/route.js +16 -2
  56. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/route.js.map +1 -1
  57. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/run/route.js +8 -1
  58. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/run/route.js.map +1 -1
  59. package/.next/standalone/.next/server/app/api/v1/threads/route.js +6 -1
  60. package/.next/standalone/.next/server/app/api/v1/threads/route.js.map +1 -1
  61. package/.next/standalone/.next/server/app/api/v1/tools/route.js +10 -3
  62. package/.next/standalone/.next/server/app/api/v1/tools/route.js.map +1 -1
  63. package/.next/standalone/.next/server/app/index.html +2 -2
  64. package/.next/standalone/.next/server/app/index.rsc +3 -3
  65. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  66. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +3 -3
  67. package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  68. package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +2 -2
  69. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  70. package/.next/standalone/.next/server/app/page.js +56 -0
  71. package/.next/standalone/.next/server/app/page.js.map +1 -1
  72. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  73. package/.next/standalone/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  74. package/.next/standalone/.next/server/app/setup.html +1 -1
  75. package/.next/standalone/.next/server/app/setup.rsc +2 -2
  76. package/.next/standalone/.next/server/app/setup.segments/_full.segment.rsc +2 -2
  77. package/.next/standalone/.next/server/app/setup.segments/_head.segment.rsc +1 -1
  78. package/.next/standalone/.next/server/app/setup.segments/_index.segment.rsc +2 -2
  79. package/.next/standalone/.next/server/app/setup.segments/_tree.segment.rsc +2 -2
  80. package/.next/standalone/.next/server/app/setup.segments/setup/__PAGE__.segment.rsc +1 -1
  81. package/.next/standalone/.next/server/app/setup.segments/setup.segment.rsc +1 -1
  82. package/.next/standalone/.next/server/app-paths-manifest.json +1 -1
  83. package/.next/standalone/.next/server/chunks/1683.js +2 -2
  84. package/.next/standalone/.next/server/chunks/2082.js +122 -13
  85. package/.next/standalone/.next/server/chunks/2082.js.map +1 -1
  86. package/.next/standalone/.next/server/chunks/210.js +3 -3
  87. package/.next/standalone/.next/server/chunks/210.js.map +1 -1
  88. package/.next/standalone/.next/server/chunks/239.js +1902 -1487
  89. package/.next/standalone/.next/server/chunks/239.js.map +1 -1
  90. package/.next/standalone/.next/server/chunks/2447.js +9 -1
  91. package/.next/standalone/.next/server/chunks/2447.js.map +1 -1
  92. package/.next/standalone/.next/server/chunks/423.js +125 -16
  93. package/.next/standalone/.next/server/chunks/423.js.map +1 -1
  94. package/.next/standalone/.next/server/chunks/4631.js +36 -29
  95. package/.next/standalone/.next/server/chunks/4631.js.map +1 -1
  96. package/.next/standalone/.next/server/chunks/5937.js +3 -2
  97. package/.next/standalone/.next/server/chunks/5937.js.map +1 -1
  98. package/.next/standalone/.next/server/chunks/{947.js → 8866.js} +11321 -10883
  99. package/.next/standalone/.next/server/chunks/8866.js.map +1 -0
  100. package/.next/standalone/.next/server/chunks/9032.js +3 -3
  101. package/.next/standalone/.next/server/chunks/9032.js.map +1 -1
  102. package/.next/standalone/.next/server/middleware-build-manifest.js +2 -2
  103. package/.next/standalone/.next/server/middleware.js +122 -13
  104. package/.next/standalone/.next/server/pages/404.html +2 -2
  105. package/.next/standalone/.next/server/pages/500.html +1 -1
  106. package/.next/standalone/.next/server/proxy.js.map +1 -1
  107. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  108. package/.next/standalone/.next/static/chunks/app/{page-473b39ec30c7f569.js → page-a7cae65f235e2942.js} +57 -1
  109. package/.next/standalone/.next/static/chunks/app/page-a7cae65f235e2942.js.map +1 -0
  110. package/.next/standalone/.next/static/css/{6f8b1a84bcbcd467.css → e57bdbbbb5a05779.css} +2 -2
  111. package/.next/standalone/.next/static/css/e57bdbbbb5a05779.css.map +1 -0
  112. package/.next/standalone/package.json +9 -1
  113. package/CHANGELOG.md +90 -0
  114. package/README.md +30 -2
  115. package/api/types.ts +8 -0
  116. package/app/api/v1/agents/[id]/route.ts +7 -0
  117. package/app/api/v1/agents/route.ts +7 -0
  118. package/app/api/v1/events/route.ts +8 -0
  119. package/app/api/v1/extensions/route.ts +2 -2
  120. package/app/api/v1/extensions/tools/[name]/secrets/route.ts +3 -3
  121. package/app/api/v1/health/route.ts +8 -0
  122. package/app/api/v1/models/route.ts +7 -0
  123. package/app/api/v1/page-capture/route.ts +8 -0
  124. package/app/api/v1/providers/route.ts +8 -0
  125. package/app/api/v1/threads/[thread_id]/route.ts +8 -0
  126. package/app/api/v1/threads/[thread_id]/run/route.ts +9 -0
  127. package/app/api/v1/threads/route.ts +7 -0
  128. package/app/api/v1/tools/route.ts +9 -0
  129. package/components/chat/ContextUsageBar.tsx +44 -0
  130. package/lib/agents/llm.ts +25 -2
  131. package/lib/agents/run-thread.ts +13 -1
  132. package/lib/agents/stream-collector.ts +9 -1
  133. package/lib/api/serializers.test.ts +15 -0
  134. package/lib/api/serializers.ts +8 -0
  135. package/lib/db/migrations.ts +15 -0
  136. package/lib/health/runner.test.ts +24 -2
  137. package/lib/mcp/registry.ts +14 -6
  138. package/lib/providers/anthropic.test.ts +95 -0
  139. package/lib/providers/anthropic.ts +106 -10
  140. package/lib/providers/jarela-chat-model.ts +9 -1
  141. package/lib/providers/known-context-windows.ts +21 -0
  142. package/lib/providers/types.ts +21 -1
  143. package/lib/stores/message-usage.test.ts +34 -0
  144. package/lib/stores/message-usage.ts +15 -3
  145. package/lib/stores/pricing.test.ts +52 -0
  146. package/lib/stores/pricing.ts +26 -1
  147. package/lib/tools/builtins.ts +4 -0
  148. package/lib/tools/extension-surfaces.test.ts +79 -0
  149. package/lib/tools/extension-surfaces.ts +153 -0
  150. package/lib/tools/index.ts +27 -8
  151. package/lib/tools/list-tools.test.ts +76 -0
  152. package/lib/tools/list-tools.ts +84 -0
  153. package/lib/tools/mcp-servers-info.test.ts +73 -0
  154. package/lib/tools/mcp-servers-info.ts +71 -0
  155. package/lib/tools/providers-info.test.ts +73 -0
  156. package/lib/tools/providers-info.ts +106 -0
  157. package/lib/tools/registry.ts +36 -25
  158. package/lib/tools/types.ts +13 -0
  159. package/package.json +9 -1
  160. package/.next/standalone/.next/server/chunks/947.js.map +0 -1
  161. package/.next/standalone/.next/static/chunks/app/page-473b39ec30c7f569.js.map +0 -1
  162. package/.next/standalone/.next/static/css/6f8b1a84bcbcd467.css.map +0 -1
  163. /package/.next/standalone/.next/static/{T0p2VVPsJPj44rwbmjaFb → d_vhp-lJqfdjRFpnLVIqZ}/_buildManifest.js +0 -0
  164. /package/.next/standalone/.next/static/{T0p2VVPsJPj44rwbmjaFb → d_vhp-lJqfdjRFpnLVIqZ}/_ssgManifest.js +0 -0
@@ -36,11 +36,11 @@ async function bootNode() {
36
36
  installConsolePatch();
37
37
  const { registerShutdownHandlers } = await Promise.all(/* import() */[__webpack_require__.e(8067), __webpack_require__.e(9032)]).then(__webpack_require__.bind(__webpack_require__, 39032));
38
38
  registerShutdownHandlers();
39
- const { initTools } = await Promise.all(/* import() */[__webpack_require__.e(1218), __webpack_require__.e(6447), __webpack_require__.e(127), __webpack_require__.e(3169), __webpack_require__.e(423), __webpack_require__.e(8067), __webpack_require__.e(947), __webpack_require__.e(2768)]).then(__webpack_require__.bind(__webpack_require__, 59198));
39
+ const { initTools } = await Promise.all(/* import() */[__webpack_require__.e(1218), __webpack_require__.e(6447), __webpack_require__.e(127), __webpack_require__.e(3169), __webpack_require__.e(423), __webpack_require__.e(8067), __webpack_require__.e(8866), __webpack_require__.e(2768)]).then(__webpack_require__.bind(__webpack_require__, 32920));
40
40
  initTools();
41
- const triggers = await Promise.all(/* import() */[__webpack_require__.e(1218), __webpack_require__.e(6447), __webpack_require__.e(127), __webpack_require__.e(3169), __webpack_require__.e(423), __webpack_require__.e(8067), __webpack_require__.e(947), __webpack_require__.e(2768)]).then(__webpack_require__.bind(__webpack_require__, 64439));
41
+ const triggers = await Promise.all(/* import() */[__webpack_require__.e(1218), __webpack_require__.e(6447), __webpack_require__.e(127), __webpack_require__.e(3169), __webpack_require__.e(423), __webpack_require__.e(8067), __webpack_require__.e(8866), __webpack_require__.e(2768)]).then(__webpack_require__.bind(__webpack_require__, 64439));
42
42
  await triggers.startAllTriggerHandlers();
43
- const { startScheduler } = await Promise.all(/* import() */[__webpack_require__.e(1218), __webpack_require__.e(6447), __webpack_require__.e(127), __webpack_require__.e(3169), __webpack_require__.e(423), __webpack_require__.e(8067), __webpack_require__.e(947), __webpack_require__.e(2768)]).then(__webpack_require__.bind(__webpack_require__, 3464));
43
+ const { startScheduler } = await Promise.all(/* import() */[__webpack_require__.e(1218), __webpack_require__.e(6447), __webpack_require__.e(127), __webpack_require__.e(3169), __webpack_require__.e(423), __webpack_require__.e(8067), __webpack_require__.e(8866), __webpack_require__.e(2768)]).then(__webpack_require__.bind(__webpack_require__, 3464));
44
44
  startScheduler();
45
45
  warnIfExposedBind();
46
46
  }
@@ -1 +1 @@
1
- {"version":3,"file":"210.js","mappings":";;;;;;;;;;;AAAA,4EAA4E;AAC5E,0EAA0E;AAC1E,uEAAuE;AACvE,EAAE;AACF,uEAAuE;AACvE,wBAAwB;AAEjB,eAAeA;IACpB,sEAAsE;IACtE,oEAAoE;IACpE,qEAAqE;IACrE,6BAA6B;IAC7B,MAAM,EAAEC,0BAA0B,EAAE,GAAG,MAAM,gJAA6B;IAC1E,MAAMC,IAAID;IACV,IAAIC,EAAEC,OAAO,GAAG,KAAKD,EAAEE,OAAO,GAAG,GAAG;QAClC,oEAAoE;QACpE,mEAAmE;QACnE,qBAAqB;QACrBC,QAAQC,MAAM,CAACC,KAAK,CAClB,CAAC,wBAAwB,EAAEL,EAAEC,OAAO,CAAC,UAAU,EAAED,EAAEE,OAAO,CAAC,mBAAmB,CAAC;IAEnF;IAEA,kEAAkE;IAClE,iEAAiE;IACjE,kEAAkE;IAClE,wBAAwB;IACxB,MAAM,EAAEI,mBAAmB,EAAE,GAAG,MAAM,gJAA4B;IAClEA;IAEA,MAAM,EAAEC,wBAAwB,EAAE,GAAG,MAAM,gJAAkC;IAC7EA;IAEA,MAAM,EAAEC,SAAS,EAAE,GAAG,MAAM,2TAAqB;IACjDA;IAEA,MAAMC,WAAW,MAAM,2TAAwB;IAC/C,MAAMA,SAASC,uBAAuB;IAEtC,MAAM,EAAEC,cAAc,EAAE,GAAG,MAAM,0TAAyB;IAC1DA;IAEAC;AACF;AAEA,SAASA;IACP,MAAMC,OAAO,CAACV,QAAQW,GAAG,CAACC,QAAQ,IAAI,EAAC,EAAGC,IAAI;IAC9C,IAAI,CAACH,MAAM;IACX,MAAMI,aACJJ,SAAS,eACTA,SAAS,SACTA,SAAS,eACTA,KAAKK,UAAU,CAAC;IAClB,IAAID,YAAY;IAChB,IAAId,QAAQW,GAAG,CAACK,6BAA6B,KAAK,KAAK;IACvD,IAAI;QACF,MAAMC,KAA+BC,mBAAOA,CAAC,KAAS;QACtD,IAAID,GAAGE,UAAU,CAAC,gBAAgB;IACpC,EAAE,OAAM;IACN,kCAAkC,GACpC;IACA,IAAInB,QAAQW,GAAG,CAACS,uBAAuB,EAAE;IACzCC,QAAQC,IAAI,CACV,CAAC,EAAE,CAAC,GACF,CAAC,8BAA8B,EAAEZ,KAAK,0BAA0B,CAAC,GACjE,CAAC,4EAA4E,CAAC,GAC9E,CAAC,sEAAsE,CAAC,GACxE,CAAC,wEAAwE,CAAC,GAC1E,CAAC,oDAAoD,CAAC,GACtD,CAAC,wEAAwE,CAAC,GAC1E,CAAC,kCAAkC,CAAC;AAE1C","sources":["webpack://@circuitwall/jarela/./instrumentation-node.ts"],"sourcesContent":["// Node-only bootstrap split out of `instrumentation.ts` so the edge-runtime\n// build never has to trace its dependency graph (which transitively pulls\n// in node-only modules like `child_process` via the MCP stdio client).\n//\n// `instrumentation.ts` only loads this file when running on the nodejs\n// server in production.\n\nexport async function bootNode(): Promise<void> {\n // ADR-0060 — apply persisted env-overrides FIRST so subsequent module\n // imports see the overridden values from the start. Done before the\n // logging / shutdown / tools imports because each of them caches env\n // reads at module-init time.\n const { applyOverridesToProcessEnv } = await import(\"@/lib/env/overrides\");\n const r = applyOverridesToProcessEnv();\n if (r.applied > 0 || r.skipped > 0) {\n // Use raw stdout — console isn't patched yet and we don't want this\n // line to land in the logs panel (the entries it produces would be\n // pre-patch anyway).\n process.stdout.write(\n `[env-overrides] applied ${r.applied}, skipped ${r.skipped} (already in env)\\n`,\n );\n }\n\n // ADR-0058 — install the console patch second so every subsequent\n // boot-time log line lands in the in-memory ring + the live Logs\n // panel feed. Idempotent (guarded by a global Symbol), so dev HMR\n // doesn't double-patch.\n const { installConsolePatch } = await import(\"@/lib/logging/sink\");\n installConsolePatch();\n\n const { registerShutdownHandlers } = await import(\"@/lib/lifecycle/shutdown\");\n registerShutdownHandlers();\n\n const { initTools } = await import(\"@/lib/tools\");\n initTools();\n\n const triggers = await import(\"@/lib/triggers\");\n await triggers.startAllTriggerHandlers();\n\n const { startScheduler } = await import(\"@/lib/scheduler\");\n startScheduler();\n\n warnIfExposedBind();\n}\n\nfunction warnIfExposedBind(): void {\n const host = (process.env.HOSTNAME || \"\").trim();\n if (!host) return;\n const isLoopback =\n host === \"127.0.0.1\" ||\n host === \"::1\" ||\n host === \"localhost\" ||\n host.startsWith(\"127.\");\n if (isLoopback) return;\n if (process.env.JARELA_ALLOW_NONLOOPBACK_BIND === \"1\") return;\n try {\n const fs: typeof import(\"node:fs\") = require(\"node:fs\");\n if (fs.existsSync(\"/.dockerenv\")) return;\n } catch {\n /* not on a POSIX runtime, ignore */\n }\n if (process.env.KUBERNETES_SERVICE_HOST) return;\n console.warn(\n `\\n` +\n `[security] Jarela is bound to ${host}, which is NOT loopback.\\n` +\n ` Non-loopback callers are only gated by the Tailscale-User-Login\\n` +\n ` header, which can be forged by anyone on the LAN unless a\\n` +\n ` Tailscale-Serve (or equivalent reverse proxy) is sitting in\\n` +\n ` front of this process and injecting it.\\n` +\n ` Bind to 127.0.0.1 or set JARELA_ALLOW_NONLOOPBACK_BIND=1 to\\n` +\n ` silence this warning.\\n`,\n );\n}\n"],"names":["bootNode","applyOverridesToProcessEnv","r","applied","skipped","process","stdout","write","installConsolePatch","registerShutdownHandlers","initTools","triggers","startAllTriggerHandlers","startScheduler","warnIfExposedBind","host","env","HOSTNAME","trim","isLoopback","startsWith","JARELA_ALLOW_NONLOOPBACK_BIND","fs","require","existsSync","KUBERNETES_SERVICE_HOST","console","warn"],"sourceRoot":"","ignoreList":[]}
1
+ {"version":3,"file":"210.js","mappings":";;;;;;;;;;;AAAA,4EAA4E;AAC5E,0EAA0E;AAC1E,uEAAuE;AACvE,EAAE;AACF,uEAAuE;AACvE,wBAAwB;AAEjB,eAAeA;IACpB,sEAAsE;IACtE,oEAAoE;IACpE,qEAAqE;IACrE,6BAA6B;IAC7B,MAAM,EAAEC,0BAA0B,EAAE,GAAG,MAAM,gJAA6B;IAC1E,MAAMC,IAAID;IACV,IAAIC,EAAEC,OAAO,GAAG,KAAKD,EAAEE,OAAO,GAAG,GAAG;QAClC,oEAAoE;QACpE,mEAAmE;QACnE,qBAAqB;QACrBC,QAAQC,MAAM,CAACC,KAAK,CAClB,CAAC,wBAAwB,EAAEL,EAAEC,OAAO,CAAC,UAAU,EAAED,EAAEE,OAAO,CAAC,mBAAmB,CAAC;IAEnF;IAEA,kEAAkE;IAClE,iEAAiE;IACjE,kEAAkE;IAClE,wBAAwB;IACxB,MAAM,EAAEI,mBAAmB,EAAE,GAAG,MAAM,gJAA4B;IAClEA;IAEA,MAAM,EAAEC,wBAAwB,EAAE,GAAG,MAAM,gJAAkC;IAC7EA;IAEA,MAAM,EAAEC,SAAS,EAAE,GAAG,MAAM,4TAAqB;IACjDA;IAEA,MAAMC,WAAW,MAAM,4TAAwB;IAC/C,MAAMA,SAASC,uBAAuB;IAEtC,MAAM,EAAEC,cAAc,EAAE,GAAG,MAAM,2TAAyB;IAC1DA;IAEAC;AACF;AAEA,SAASA;IACP,MAAMC,OAAO,CAACV,QAAQW,GAAG,CAACC,QAAQ,IAAI,EAAC,EAAGC,IAAI;IAC9C,IAAI,CAACH,MAAM;IACX,MAAMI,aACJJ,SAAS,eACTA,SAAS,SACTA,SAAS,eACTA,KAAKK,UAAU,CAAC;IAClB,IAAID,YAAY;IAChB,IAAId,QAAQW,GAAG,CAACK,6BAA6B,KAAK,KAAK;IACvD,IAAI;QACF,MAAMC,KAA+BC,mBAAOA,CAAC,KAAS;QACtD,IAAID,GAAGE,UAAU,CAAC,gBAAgB;IACpC,EAAE,OAAM;IACN,kCAAkC,GACpC;IACA,IAAInB,QAAQW,GAAG,CAACS,uBAAuB,EAAE;IACzCC,QAAQC,IAAI,CACV,CAAC,EAAE,CAAC,GACF,CAAC,8BAA8B,EAAEZ,KAAK,0BAA0B,CAAC,GACjE,CAAC,4EAA4E,CAAC,GAC9E,CAAC,sEAAsE,CAAC,GACxE,CAAC,wEAAwE,CAAC,GAC1E,CAAC,oDAAoD,CAAC,GACtD,CAAC,wEAAwE,CAAC,GAC1E,CAAC,kCAAkC,CAAC;AAE1C","sources":["webpack://@circuitwall/jarela/./instrumentation-node.ts"],"sourcesContent":["// Node-only bootstrap split out of `instrumentation.ts` so the edge-runtime\n// build never has to trace its dependency graph (which transitively pulls\n// in node-only modules like `child_process` via the MCP stdio client).\n//\n// `instrumentation.ts` only loads this file when running on the nodejs\n// server in production.\n\nexport async function bootNode(): Promise<void> {\n // ADR-0060 — apply persisted env-overrides FIRST so subsequent module\n // imports see the overridden values from the start. Done before the\n // logging / shutdown / tools imports because each of them caches env\n // reads at module-init time.\n const { applyOverridesToProcessEnv } = await import(\"@/lib/env/overrides\");\n const r = applyOverridesToProcessEnv();\n if (r.applied > 0 || r.skipped > 0) {\n // Use raw stdout — console isn't patched yet and we don't want this\n // line to land in the logs panel (the entries it produces would be\n // pre-patch anyway).\n process.stdout.write(\n `[env-overrides] applied ${r.applied}, skipped ${r.skipped} (already in env)\\n`,\n );\n }\n\n // ADR-0058 — install the console patch second so every subsequent\n // boot-time log line lands in the in-memory ring + the live Logs\n // panel feed. Idempotent (guarded by a global Symbol), so dev HMR\n // doesn't double-patch.\n const { installConsolePatch } = await import(\"@/lib/logging/sink\");\n installConsolePatch();\n\n const { registerShutdownHandlers } = await import(\"@/lib/lifecycle/shutdown\");\n registerShutdownHandlers();\n\n const { initTools } = await import(\"@/lib/tools\");\n initTools();\n\n const triggers = await import(\"@/lib/triggers\");\n await triggers.startAllTriggerHandlers();\n\n const { startScheduler } = await import(\"@/lib/scheduler\");\n startScheduler();\n\n warnIfExposedBind();\n}\n\nfunction warnIfExposedBind(): void {\n const host = (process.env.HOSTNAME || \"\").trim();\n if (!host) return;\n const isLoopback =\n host === \"127.0.0.1\" ||\n host === \"::1\" ||\n host === \"localhost\" ||\n host.startsWith(\"127.\");\n if (isLoopback) return;\n if (process.env.JARELA_ALLOW_NONLOOPBACK_BIND === \"1\") return;\n try {\n const fs: typeof import(\"node:fs\") = require(\"node:fs\");\n if (fs.existsSync(\"/.dockerenv\")) return;\n } catch {\n /* not on a POSIX runtime, ignore */\n }\n if (process.env.KUBERNETES_SERVICE_HOST) return;\n console.warn(\n `\\n` +\n `[security] Jarela is bound to ${host}, which is NOT loopback.\\n` +\n ` Non-loopback callers are only gated by the Tailscale-User-Login\\n` +\n ` header, which can be forged by anyone on the LAN unless a\\n` +\n ` Tailscale-Serve (or equivalent reverse proxy) is sitting in\\n` +\n ` front of this process and injecting it.\\n` +\n ` Bind to 127.0.0.1 or set JARELA_ALLOW_NONLOOPBACK_BIND=1 to\\n` +\n ` silence this warning.\\n`,\n );\n}\n"],"names":["bootNode","applyOverridesToProcessEnv","r","applied","skipped","process","stdout","write","installConsolePatch","registerShutdownHandlers","initTools","triggers","startAllTriggerHandlers","startScheduler","warnIfExposedBind","host","env","HOSTNAME","trim","isLoopback","startsWith","JARELA_ALLOW_NONLOOPBACK_BIND","fs","require","existsSync","KUBERNETES_SERVICE_HOST","console","warn"],"sourceRoot":"","ignoreList":[]}