auvrynt 1.0.2 → 1.0.5

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 (550) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +366 -233
  3. package/addons/auvrynt_bridge/auvrynt_bridge.gd +500 -0
  4. package/addons/auvrynt_bridge/plugin.cfg +7 -0
  5. package/bin/auvrynt-launcher.cjs +77 -0
  6. package/dist/artifact-registry.js +1 -0
  7. package/dist/aseprite-tools.js +1 -0
  8. package/dist/auth/connection-registry.js +145 -0
  9. package/dist/auth/connection-status.js +176 -0
  10. package/dist/auth/oauth-provider.js +617 -0
  11. package/dist/auth/room-registry.js +131 -0
  12. package/dist/auth/session-registry.js +531 -0
  13. package/dist/background-lifecycle.js +1 -0
  14. package/dist/blender-client.js +1 -109
  15. package/dist/blender-tools.js +1 -930
  16. package/dist/browser-stability.js +1 -0
  17. package/dist/cli/commands/help-command.js +10 -0
  18. package/dist/cli/commands/init-command.js +190 -0
  19. package/dist/cli/commands/integration-commands.js +88 -0
  20. package/dist/cli/commands/serve-command.js +83 -0
  21. package/dist/cli/commands/setup-command.js +81 -0
  22. package/dist/cli/commands/status-commands.js +166 -0
  23. package/dist/cli/commands/tunnel-command.js +127 -0
  24. package/dist/cli/commands/user-config-commands.js +105 -0
  25. package/dist/cli/dashboard-actions.js +516 -0
  26. package/dist/cli/dashboard-native-actions.js +282 -0
  27. package/dist/cli/foreground-server.js +270 -0
  28. package/dist/cli/instance-control.js +21 -0
  29. package/dist/cli/instance-lock.js +123 -0
  30. package/dist/cli/integration-bootstrap.js +206 -0
  31. package/dist/cli/lifecycle-manager.js +493 -0
  32. package/dist/cli/runtime-support.js +74 -0
  33. package/dist/cli/serena-detected-default.js +27 -0
  34. package/dist/cli/tunnel-health-monitor.js +182 -0
  35. package/dist/cli.js +82 -739
  36. package/dist/config.js +1 -243
  37. package/dist/connection-registry.js +1 -73
  38. package/dist/connection-status.js +1 -139
  39. package/dist/control-retry.js +1 -0
  40. package/dist/crash-recovery.js +1 -0
  41. package/dist/db/client.js +16 -3
  42. package/dist/db/schema.js +30 -0
  43. package/dist/dotnet-tools.js +1 -223
  44. package/dist/git-worktrees.js +1 -134
  45. package/dist/git.js +1 -41
  46. package/dist/godot-animation-tilemap.js +1 -82
  47. package/dist/godot-csharp-build.js +1 -93
  48. package/dist/godot-csharp-project.js +1 -157
  49. package/dist/godot-csharp-runner.js +1 -146
  50. package/dist/godot-csharp-semantic.js +1 -161
  51. package/dist/godot-csharp-validate.js +1 -71
  52. package/dist/godot-dotnet-env.js +1 -169
  53. package/dist/godot-editor-bridge.js +1 -140
  54. package/dist/godot-gdscript.js +1 -824
  55. package/dist/godot-project-settings.js +1 -223
  56. package/dist/godot-runtime-testing.js +1 -249
  57. package/dist/godot-tools.js +1 -183
  58. package/dist/http-rate-limit.js +1 -0
  59. package/dist/http-server-hardening.js +1 -0
  60. package/dist/image-tools.js +1 -157
  61. package/dist/infrastructure/command-reference.js +32 -0
  62. package/dist/infrastructure/config.js +424 -0
  63. package/dist/infrastructure/context7-auth.js +55 -0
  64. package/dist/infrastructure/http-rate-limit.js +42 -0
  65. package/dist/infrastructure/http-server-hardening.js +23 -0
  66. package/dist/infrastructure/integration-queue.js +46 -0
  67. package/dist/infrastructure/logger.js +129 -0
  68. package/dist/infrastructure/mcp-event-store.js +103 -0
  69. package/dist/infrastructure/ngrok-auth-pool.js +208 -0
  70. package/dist/infrastructure/request-context.js +14 -0
  71. package/dist/infrastructure/shutdown.js +37 -0
  72. package/dist/infrastructure/sse-heartbeat.js +47 -0
  73. package/dist/infrastructure/tool-capabilities.js +67 -0
  74. package/dist/infrastructure/tool-result-budget.js +175 -0
  75. package/dist/infrastructure/user-config.js +167 -0
  76. package/dist/integration-discovery.js +1 -98
  77. package/dist/integration-queue.js +1 -0
  78. package/dist/integrations/agent-reach/agent-reach-tools.js +196 -0
  79. package/dist/integrations/agent-reach/native-channels.js +468 -0
  80. package/dist/integrations/aseprite/aseprite-analysis-tools.js +368 -0
  81. package/dist/integrations/aseprite/aseprite-editing-tools.js +647 -0
  82. package/dist/integrations/aseprite/aseprite-live-tools.js +297 -0
  83. package/dist/integrations/aseprite/aseprite-safety-tools.js +594 -0
  84. package/dist/integrations/aseprite/aseprite-specialized-tools.js +289 -0
  85. package/dist/integrations/aseprite/aseprite-tools.js +837 -0
  86. package/dist/integrations/blender/blender-catalog-mesh.js +593 -0
  87. package/dist/integrations/blender/blender-catalog-object.js +906 -0
  88. package/dist/integrations/blender/blender-catalog-scene.js +266 -0
  89. package/dist/integrations/blender/blender-catalog-select.js +581 -0
  90. package/dist/integrations/blender/blender-catalog-stubs.js +7512 -0
  91. package/dist/integrations/blender/blender-catalog.js +165 -0
  92. package/dist/integrations/blender/blender-client.js +105 -0
  93. package/dist/integrations/blender/blender-tools.js +2243 -0
  94. package/dist/integrations/context7/context7-tools.js +106 -0
  95. package/dist/integrations/dotnet/dotnet-tools.js +195 -0
  96. package/dist/integrations/godot/godot-animation-tilemap.js +74 -0
  97. package/dist/integrations/godot/godot-csharp-build.js +91 -0
  98. package/dist/integrations/godot/godot-csharp-project.js +155 -0
  99. package/dist/integrations/godot/godot-csharp-runner.js +118 -0
  100. package/dist/integrations/godot/godot-csharp-semantic.js +146 -0
  101. package/dist/integrations/godot/godot-csharp-validate.js +71 -0
  102. package/dist/integrations/godot/godot-dotnet-env.js +134 -0
  103. package/dist/integrations/godot/godot-editor-bridge.js +328 -0
  104. package/dist/integrations/godot/godot-gdscript.js +536 -0
  105. package/dist/integrations/godot/godot-project-settings.js +178 -0
  106. package/dist/integrations/godot/godot-runtime-testing.js +263 -0
  107. package/dist/integrations/godot/godot-tools.js +193 -0
  108. package/dist/integrations/images/image-tools.js +414 -0
  109. package/dist/integrations/images/png-codec.js +251 -0
  110. package/dist/integrations/images/view-image.js +99 -0
  111. package/dist/integrations/images/window-capture.js +148 -0
  112. package/dist/integrations/integration-discovery.js +185 -0
  113. package/dist/integrations/obsidian/obsidian-tools.js +205 -0
  114. package/dist/integrations/playwright/browser-session.js +516 -0
  115. package/dist/integrations/playwright/browser-stability.js +36 -0
  116. package/dist/integrations/playwright/playwright-runtime.js +105 -0
  117. package/dist/integrations/playwright/web-tools.js +504 -0
  118. package/dist/integrations/roblox/roblox-helpers.js +381 -0
  119. package/dist/integrations/roblox/roblox-studio-client.js +112 -0
  120. package/dist/integrations/roblox/roblox-tools.js +106 -0
  121. package/dist/integrations/serena/serena-manager.js +464 -0
  122. package/dist/integrations/serena/serena-tools.js +411 -0
  123. package/dist/logger.js +1 -76
  124. package/dist/mcp-event-store.js +1 -0
  125. package/dist/oauth-provider.js +1 -377
  126. package/dist/pi-tools.js +1 -81
  127. package/dist/playwright-runtime.js +1 -0
  128. package/dist/process/background-lifecycle.js +189 -0
  129. package/dist/process/control-retry.js +42 -0
  130. package/dist/process/crash-recovery.js +23 -0
  131. package/dist/process/processes.js +456 -0
  132. package/dist/processes.js +1 -218
  133. package/dist/request-context.js +1 -0
  134. package/dist/review-checkpoints.js +1 -142
  135. package/dist/room-registry.js +1 -0
  136. package/dist/roots.js +1 -53
  137. package/dist/search-discovery.js +1 -271
  138. package/dist/serena-manager.js +1 -443
  139. package/dist/serena-tools.js +1 -411
  140. package/dist/server/dashboard-page-styles.js +331 -0
  141. package/dist/server/dashboard-page.js +1509 -0
  142. package/dist/server/dashboard-routes.js +46 -0
  143. package/dist/server/dashboard.js +240 -0
  144. package/dist/server/http-helpers.js +30 -0
  145. package/dist/server/integration-profile-update.js +37 -0
  146. package/dist/server/mcp-policy.js +169 -0
  147. package/dist/server/mcp-server-factory.js +127 -0
  148. package/dist/server/mcp-tool-registrar.js +182 -0
  149. package/dist/server/openai-session-hint.js +14 -0
  150. package/dist/server/tool-groups.js +29 -0
  151. package/dist/server/tool-logging.js +33 -0
  152. package/dist/server/tool-registration-shared.js +59 -0
  153. package/dist/server/tools/aseprite-advanced-tools-registration.js +547 -0
  154. package/dist/server/tools/aseprite-tools-registration.js +213 -0
  155. package/dist/server/tools/blender-tools-registration.js +690 -0
  156. package/dist/server/tools/core-file-tools-registration.js +459 -0
  157. package/dist/server/tools/dotnet-godot-window-tools-registration.js +120 -0
  158. package/dist/server/tools/godot-csharp-tools-registration.js +252 -0
  159. package/dist/server/tools/godot-gdscript-tools-registration.js +189 -0
  160. package/dist/server/tools/process-project-tools-registration.js +155 -0
  161. package/dist/server/tools/roblox-tools-registration.js +514 -0
  162. package/dist/server/tools/web-image-tools-registration.js +326 -0
  163. package/dist/server/tools/workspace-lifecycle-tools-registration.js +130 -0
  164. package/dist/server/ui-assets.js +97 -0
  165. package/dist/server/workspace-analytics.js +92 -0
  166. package/dist/server.js +453 -2713
  167. package/dist/session-registry.js +1 -0
  168. package/dist/shutdown.js +1 -0
  169. package/dist/skills.js +1 -45
  170. package/dist/sse-heartbeat.js +1 -0
  171. package/dist/tool-capabilities.js +1 -0
  172. package/dist/tool-result-budget.js +1 -0
  173. package/dist/tools/pi-tools.js +81 -0
  174. package/dist/tunnels/cloudflare-tunnel.js +217 -0
  175. package/dist/tunnels/cloudflared-service.js +174 -0
  176. package/dist/tunnels/ngrok-tunnel.js +220 -0
  177. package/dist/tunnels/tunnel-manager.js +186 -0
  178. package/dist/tunnels/tunnel-types.js +1 -0
  179. package/dist/tunnels/tunnel-utils.js +62 -0
  180. package/dist/ui/.vite/manifest.json +9 -2487
  181. package/dist/ui/assets/heavy-payload-D42A9ceL.js +1 -0
  182. package/dist/ui/assets/lightweight-diff-Cv4g9Hdr.js +13 -0
  183. package/dist/ui/assets/review-payload-DKIg1cKF.js +1 -0
  184. package/dist/ui/assets/workspace-app-CeK3NhmB.css +1 -0
  185. package/dist/ui/assets/{workspace-app-C5QsE314.js → workspace-app-CkUXnpl4.js} +6 -6
  186. package/dist/ui/brand-theme.js +23 -0
  187. package/dist/ui/workspace-app.html +15 -15
  188. package/dist/user-config.js +1 -57
  189. package/dist/view-image.js +1 -104
  190. package/dist/web-tools.js +1 -200
  191. package/dist/window-capture.js +1 -74
  192. package/dist/workspace/artifact-registry.js +69 -0
  193. package/dist/workspace/git-worktrees.js +141 -0
  194. package/dist/workspace/git.js +42 -0
  195. package/dist/workspace/review-checkpoints.js +142 -0
  196. package/dist/workspace/roots.js +56 -0
  197. package/dist/workspace/search-discovery.js +264 -0
  198. package/dist/workspace/skills.js +45 -0
  199. package/dist/workspace/workspace-store.js +219 -0
  200. package/dist/workspace/workspaces.js +314 -0
  201. package/dist/workspace-store.js +1 -125
  202. package/dist/workspaces.js +1 -226
  203. package/docs/CREATOR_STORE_FREE_ASSETS.md +162 -0
  204. package/docs/DEVELOPMENT_TOOLS.md +136 -93
  205. package/docs/assets/auvrynt-icon.png +0 -0
  206. package/docs/assets/auvrynt-icon.svg +20 -0
  207. package/docs/chatgpt-coding-workflow.md +143 -143
  208. package/docs/configuration.md +156 -124
  209. package/docs/diagnostics.md +79 -0
  210. package/docs/gotchas.md +244 -202
  211. package/docs/multi-agent-and-long-projects.md +91 -0
  212. package/docs/security.md +138 -100
  213. package/docs/setup.md +171 -131
  214. package/docs/source-layout.md +60 -0
  215. package/extensions/auvrynt_bridge/auvrynt_bridge.lua +594 -0
  216. package/extensions/auvrynt_bridge/live_analysis.lua +181 -0
  217. package/extensions/auvrynt_bridge/live_animation.lua +134 -0
  218. package/extensions/auvrynt_bridge/live_commands.lua +24 -0
  219. package/extensions/auvrynt_bridge/live_common.lua +130 -0
  220. package/extensions/auvrynt_bridge/live_document.lua +78 -0
  221. package/extensions/auvrynt_bridge/live_drawing.lua +125 -0
  222. package/extensions/auvrynt_bridge/live_effects.lua +91 -0
  223. package/extensions/auvrynt_bridge/live_palette_template.lua +167 -0
  224. package/extensions/auvrynt_bridge/live_selection.lua +110 -0
  225. package/extensions/auvrynt_bridge/live_structure.lua +129 -0
  226. package/extensions/auvrynt_bridge/package.json +17 -0
  227. package/guides/ASEPRITE_AGENT_GUIDE.md +133 -0
  228. package/guides/BLENDER_AGENT_GUIDE.md +472 -0
  229. package/guides/GODOT_AGENT_GUIDE.md +298 -0
  230. package/guides/PROJECT_ROUTER.md +165 -0
  231. package/guides/ROBLOX_AGENT_GUIDE.md +75 -0
  232. package/guides/SOFTWARE_AGENT_GUIDE.md +104 -0
  233. package/guides/WEB_AGENT_GUIDE.md +287 -0
  234. package/package.json +78 -70
  235. package/scripts/dev-server.mjs +121 -120
  236. package/scripts/live-tunnel-smoke.mjs +538 -0
  237. package/scripts/repo-hygiene.mjs +74 -0
  238. package/scripts/restart-after-crash.mjs +49 -0
  239. package/scripts/run-tests.mjs +166 -0
  240. package/dist/ui/assets/abap-CLvhMVsD.js +0 -1
  241. package/dist/ui/assets/actionscript-3--17pq3dv.js +0 -1
  242. package/dist/ui/assets/ada-C5qYipkI.js +0 -1
  243. package/dist/ui/assets/andromeeda-vGVdxbeo.js +0 -1
  244. package/dist/ui/assets/angular-html-BJqQFYI6.js +0 -1
  245. package/dist/ui/assets/angular-ts-CMJECO0Y.js +0 -1
  246. package/dist/ui/assets/apache-U0d_L8uA.js +0 -1
  247. package/dist/ui/assets/apex-CGTLDQj6.js +0 -1
  248. package/dist/ui/assets/apl-DWeXpBBr.js +0 -1
  249. package/dist/ui/assets/applescript-CCn79oCD.js +0 -1
  250. package/dist/ui/assets/ara-4CJ0cIlV.js +0 -1
  251. package/dist/ui/assets/asciidoc-DE70LPWp.js +0 -1
  252. package/dist/ui/assets/asm-Cmm7eHzH.js +0 -1
  253. package/dist/ui/assets/astro-CLbttLOq.js +0 -1
  254. package/dist/ui/assets/aurora-x-CDeNXAV0.js +0 -1
  255. package/dist/ui/assets/awk-BWXHIvNe.js +0 -1
  256. package/dist/ui/assets/ayu-dark-DluEY0Gj.js +0 -1
  257. package/dist/ui/assets/ayu-light-C3h-C4tm.js +0 -1
  258. package/dist/ui/assets/ayu-mirage-Bqwy1Gya.js +0 -1
  259. package/dist/ui/assets/ballerina-B7ZEbQpA.js +0 -1
  260. package/dist/ui/assets/bat-Bo4NYOV-.js +0 -1
  261. package/dist/ui/assets/beancount-D-usSTwE.js +0 -1
  262. package/dist/ui/assets/berry-DKpUyyne.js +0 -1
  263. package/dist/ui/assets/bibtex-Ci_nEsc7.js +0 -1
  264. package/dist/ui/assets/bicep-CUHmPFLl.js +0 -1
  265. package/dist/ui/assets/bird2-C2hNVINV.js +0 -1
  266. package/dist/ui/assets/blade-BOzY0P2V.js +0 -1
  267. package/dist/ui/assets/bsl-BkkzgIyY.js +0 -1
  268. package/dist/ui/assets/c-BG-8uJvh.js +0 -1
  269. package/dist/ui/assets/c3-CnJL0r0V.js +0 -1
  270. package/dist/ui/assets/cadence-CQ2zXKGN.js +0 -1
  271. package/dist/ui/assets/cairo-DLTphjLi.js +0 -1
  272. package/dist/ui/assets/catppuccin-frappe-3VR1Za6u.js +0 -1
  273. package/dist/ui/assets/catppuccin-latte-DwIHMF0Q.js +0 -1
  274. package/dist/ui/assets/catppuccin-macchiato-DYnBP6_5.js +0 -1
  275. package/dist/ui/assets/catppuccin-mocha-DYhrFGRu.js +0 -1
  276. package/dist/ui/assets/clarity-SemFz856.js +0 -1
  277. package/dist/ui/assets/clojure-DqKBuwfJ.js +0 -1
  278. package/dist/ui/assets/cmake-Bj61d0ZC.js +0 -1
  279. package/dist/ui/assets/cobol-I_17IuGe.js +0 -1
  280. package/dist/ui/assets/codeowners-C8r90Shi.js +0 -1
  281. package/dist/ui/assets/codeql-oeQT6MSM.js +0 -1
  282. package/dist/ui/assets/coffee-C0B8hmok.js +0 -1
  283. package/dist/ui/assets/common-lisp-Cv5bFMCO.js +0 -1
  284. package/dist/ui/assets/coq-BrsZFFmf.js +0 -1
  285. package/dist/ui/assets/cpp-DDJXt6Vs.js +0 -1
  286. package/dist/ui/assets/crystal-Bexqace6.js +0 -1
  287. package/dist/ui/assets/csharp-Ct8U2NOr.js +0 -1
  288. package/dist/ui/assets/css-DSQhw_9R.js +0 -1
  289. package/dist/ui/assets/csv-Dx-8-gkx.js +0 -1
  290. package/dist/ui/assets/cue-CE9AQfxI.js +0 -1
  291. package/dist/ui/assets/cypher-ClKdZ_lG.js +0 -1
  292. package/dist/ui/assets/d-qD-0Kul2.js +0 -1
  293. package/dist/ui/assets/dark-plus-Cs2F2srj.js +0 -1
  294. package/dist/ui/assets/dart-DkHntEIa.js +0 -1
  295. package/dist/ui/assets/dax-BkyTk9wS.js +0 -1
  296. package/dist/ui/assets/desktop-Dlh5hvp9.js +0 -1
  297. package/dist/ui/assets/diff-woXpYk--.js +0 -1
  298. package/dist/ui/assets/docker-IyjqRm3v.js +0 -1
  299. package/dist/ui/assets/dotenv-_5a1GRtc.js +0 -1
  300. package/dist/ui/assets/dracula-BHWKrbxM.js +0 -1
  301. package/dist/ui/assets/dracula-soft-5eyTD99u.js +0 -1
  302. package/dist/ui/assets/dream-maker-DW3nJb8Q.js +0 -1
  303. package/dist/ui/assets/edge-Z8YYkHOr.js +0 -1
  304. package/dist/ui/assets/elixir-CG9uKtAF.js +0 -1
  305. package/dist/ui/assets/elm-GfWG2IfT.js +0 -1
  306. package/dist/ui/assets/emacs-lisp-C9PiwqqW.js +0 -1
  307. package/dist/ui/assets/erb-xe89e73J.js +0 -1
  308. package/dist/ui/assets/erlang-Cphh6RMH.js +0 -1
  309. package/dist/ui/assets/everforest-dark-sB-x3p7T.js +0 -1
  310. package/dist/ui/assets/everforest-light-Df2xbC6M.js +0 -1
  311. package/dist/ui/assets/fennel-DQxkIbk2.js +0 -1
  312. package/dist/ui/assets/fish-BJitypiv.js +0 -1
  313. package/dist/ui/assets/fluent-C03EYrpw.js +0 -1
  314. package/dist/ui/assets/fortran-fixed-form-DEKoE2YW.js +0 -1
  315. package/dist/ui/assets/fortran-free-form-CYNrtFtB.js +0 -1
  316. package/dist/ui/assets/fsharp-D13ZGOAj.js +0 -1
  317. package/dist/ui/assets/gdresource-C0sCabJj.js +0 -1
  318. package/dist/ui/assets/gdscript-Cp2uCuqX.js +0 -1
  319. package/dist/ui/assets/gdshader-CBce3t8t.js +0 -1
  320. package/dist/ui/assets/genie-CV2tkWYe.js +0 -1
  321. package/dist/ui/assets/gherkin-DExj1W_8.js +0 -1
  322. package/dist/ui/assets/git-commit-BSykSTBG.js +0 -1
  323. package/dist/ui/assets/git-rebase-CoTL_uSE.js +0 -1
  324. package/dist/ui/assets/github-dark-C-LZuMrd.js +0 -1
  325. package/dist/ui/assets/github-dark-default-DXG-b-1a.js +0 -1
  326. package/dist/ui/assets/github-dark-dimmed-Bx1FflLF.js +0 -1
  327. package/dist/ui/assets/github-dark-high-contrast-B_tTalzw.js +0 -1
  328. package/dist/ui/assets/github-light-EUqPIrTm.js +0 -1
  329. package/dist/ui/assets/github-light-default-BXViO-2h.js +0 -1
  330. package/dist/ui/assets/github-light-high-contrast-B68TUdTA.js +0 -1
  331. package/dist/ui/assets/gleam-CSRkHgEL.js +0 -1
  332. package/dist/ui/assets/glimmer-js-DAn4UCSu.js +0 -1
  333. package/dist/ui/assets/glimmer-ts-Tjyi6Gh5.js +0 -1
  334. package/dist/ui/assets/glsl-CtTDZoqR.js +0 -1
  335. package/dist/ui/assets/gn-ilITqXS6.js +0 -1
  336. package/dist/ui/assets/gnuplot-7GGW24-e.js +0 -1
  337. package/dist/ui/assets/go-BJwz_mda.js +0 -1
  338. package/dist/ui/assets/graphql-D5gcC_Jk.js +0 -1
  339. package/dist/ui/assets/groovy-CacY0gHj.js +0 -1
  340. package/dist/ui/assets/gruvbox-dark-hard-C820rvS2.js +0 -1
  341. package/dist/ui/assets/gruvbox-dark-medium-BPjhmG05.js +0 -1
  342. package/dist/ui/assets/gruvbox-dark-soft-MrdJrrXF.js +0 -1
  343. package/dist/ui/assets/gruvbox-light-hard-BC_s9l72.js +0 -1
  344. package/dist/ui/assets/gruvbox-light-medium-BAWPOn9u.js +0 -1
  345. package/dist/ui/assets/gruvbox-light-soft-BSMLrYjP.js +0 -1
  346. package/dist/ui/assets/hack-BJXY27dt.js +0 -1
  347. package/dist/ui/assets/haml-BLfFoZf7.js +0 -1
  348. package/dist/ui/assets/handlebars-Dw6CWkvN.js +0 -1
  349. package/dist/ui/assets/haskell-D8IpX4py.js +0 -1
  350. package/dist/ui/assets/haxe-OTjmBuCE.js +0 -1
  351. package/dist/ui/assets/hcl-Dh228itO.js +0 -1
  352. package/dist/ui/assets/heavy-payload-Dcg0-F-S.js +0 -4
  353. package/dist/ui/assets/hjson-CxZEssPk.js +0 -1
  354. package/dist/ui/assets/hlsl-Cvrh5tZx.js +0 -1
  355. package/dist/ui/assets/horizon-CE9ld1lL.js +0 -1
  356. package/dist/ui/assets/horizon-bright-Br1oVSNq.js +0 -1
  357. package/dist/ui/assets/houston-CsvMBhTu.js +0 -1
  358. package/dist/ui/assets/html-CAcAWvoN.js +0 -1
  359. package/dist/ui/assets/html-derivative-8aSW2E_7.js +0 -1
  360. package/dist/ui/assets/http-B2YR_3V1.js +0 -1
  361. package/dist/ui/assets/hurl-BnDJ9Zhf.js +0 -1
  362. package/dist/ui/assets/hxml-B0Qn7Nwc.js +0 -1
  363. package/dist/ui/assets/hy-CZbG8q4J.js +0 -1
  364. package/dist/ui/assets/imba-DsUTQ-LC.js +0 -1
  365. package/dist/ui/assets/ini-B5eOa1yu.js +0 -1
  366. package/dist/ui/assets/java-Doxi4W8u.js +0 -1
  367. package/dist/ui/assets/javascript-BbRdEqti.js +0 -1
  368. package/dist/ui/assets/jinja-CS3Tpv_Q.js +0 -1
  369. package/dist/ui/assets/jison-BkPGYVHR.js +0 -1
  370. package/dist/ui/assets/json-BMt1m3m8.js +0 -1
  371. package/dist/ui/assets/json5-BR5RXkoi.js +0 -1
  372. package/dist/ui/assets/jsonc-CYpm1nAK.js +0 -1
  373. package/dist/ui/assets/jsonl-CmCQp5Yx.js +0 -1
  374. package/dist/ui/assets/jsonnet-CJTPZ8u_.js +0 -1
  375. package/dist/ui/assets/jssm-DXw9l8Rf.js +0 -1
  376. package/dist/ui/assets/jsx-CQKrJXXY.js +0 -1
  377. package/dist/ui/assets/julia-BuN7i2du.js +0 -1
  378. package/dist/ui/assets/just-BswEPFPu.js +0 -1
  379. package/dist/ui/assets/kanagawa-dragon-CXtmUGW6.js +0 -1
  380. package/dist/ui/assets/kanagawa-lotus-BN08jTvb.js +0 -1
  381. package/dist/ui/assets/kanagawa-wave-CTweb8Dz.js +0 -1
  382. package/dist/ui/assets/kdl-CsD5j6eV.js +0 -1
  383. package/dist/ui/assets/kotlin-DhhofPvG.js +0 -1
  384. package/dist/ui/assets/kusto-BUv0MjJC.js +0 -1
  385. package/dist/ui/assets/laserwave-C_8bwKvT.js +0 -1
  386. package/dist/ui/assets/latex-DU2VyFfA.js +0 -1
  387. package/dist/ui/assets/lean-CewbzKMR.js +0 -1
  388. package/dist/ui/assets/less-DVTAwKKz.js +0 -1
  389. package/dist/ui/assets/light-plus-DVQuIRkW.js +0 -1
  390. package/dist/ui/assets/liquid-Cmz1L3dq.js +0 -1
  391. package/dist/ui/assets/llvm-Cm23YOpf.js +0 -1
  392. package/dist/ui/assets/log-BNLmms1o.js +0 -1
  393. package/dist/ui/assets/logo-Cluzi2Zq.js +0 -1
  394. package/dist/ui/assets/lua-CfVXhkaJ.js +0 -1
  395. package/dist/ui/assets/luau-CNKltnaQ.js +0 -1
  396. package/dist/ui/assets/make-Dixweg8N.js +0 -1
  397. package/dist/ui/assets/markdown-BYOwaDjH.js +0 -1
  398. package/dist/ui/assets/marko-C5bfqGiA.js +0 -1
  399. package/dist/ui/assets/material-theme-Bm3Qr25_.js +0 -1
  400. package/dist/ui/assets/material-theme-darker-2IIEA8gg.js +0 -1
  401. package/dist/ui/assets/material-theme-lighter-uhdI0v04.js +0 -1
  402. package/dist/ui/assets/material-theme-ocean-CHQ94UKr.js +0 -1
  403. package/dist/ui/assets/material-theme-palenight-B5W6OYN7.js +0 -1
  404. package/dist/ui/assets/matlab-D7qyCx1q.js +0 -1
  405. package/dist/ui/assets/mdc-CVBXYfyq.js +0 -1
  406. package/dist/ui/assets/mdx-DQZ5AkYe.js +0 -1
  407. package/dist/ui/assets/mermaid-Bk4SNUv9.js +0 -1
  408. package/dist/ui/assets/min-dark-BSWPekZh.js +0 -1
  409. package/dist/ui/assets/min-light-DDpmG2fV.js +0 -1
  410. package/dist/ui/assets/mipsasm-BMqwQI7S.js +0 -1
  411. package/dist/ui/assets/mojo-BgCJLMeH.js +0 -1
  412. package/dist/ui/assets/monokai-CdkpiU2Y.js +0 -1
  413. package/dist/ui/assets/moonbit-CaWjb8XO.js +0 -1
  414. package/dist/ui/assets/move-B1IS1UjX.js +0 -1
  415. package/dist/ui/assets/narrat-_X_XdTYD.js +0 -1
  416. package/dist/ui/assets/nextflow-Bbiyy34d.js +0 -1
  417. package/dist/ui/assets/nextflow-groovy-Dc_ddanL.js +0 -1
  418. package/dist/ui/assets/nginx-CzJafxLa.js +0 -1
  419. package/dist/ui/assets/night-owl-DhmEMT88.js +0 -1
  420. package/dist/ui/assets/night-owl-light-eJ-hLW7d.js +0 -1
  421. package/dist/ui/assets/nim-DABKtHtM.js +0 -1
  422. package/dist/ui/assets/nix-IvuFDN5E.js +0 -1
  423. package/dist/ui/assets/nord-Cb4Vim4T.js +0 -1
  424. package/dist/ui/assets/nushell-DcLAeLz5.js +0 -1
  425. package/dist/ui/assets/objective-c-D1A_Heim.js +0 -1
  426. package/dist/ui/assets/objective-cpp-BsSzOQcm.js +0 -1
  427. package/dist/ui/assets/ocaml-O90oeIOV.js +0 -1
  428. package/dist/ui/assets/odin-B1RWQWA5.js +0 -1
  429. package/dist/ui/assets/one-dark-pro-CLwyXe_n.js +0 -1
  430. package/dist/ui/assets/one-light-D7Lr4KcI.js +0 -1
  431. package/dist/ui/assets/openscad-BUDT5pXO.js +0 -1
  432. package/dist/ui/assets/pascal-4ZHwLPI5.js +0 -1
  433. package/dist/ui/assets/perl-CBh7L3lZ.js +0 -1
  434. package/dist/ui/assets/php-DFbI9q5p.js +0 -1
  435. package/dist/ui/assets/pierre-dark-sU4Zdns8.js +0 -1
  436. package/dist/ui/assets/pierre-dark-soft-HXgun5vs.js +0 -1
  437. package/dist/ui/assets/pierre-light-DWBk51d8.js +0 -1
  438. package/dist/ui/assets/pierre-light-soft-CodEzPxf.js +0 -1
  439. package/dist/ui/assets/pkl-ot-7Btpt.js +0 -1
  440. package/dist/ui/assets/plastic-DQwYfKfQ.js +0 -1
  441. package/dist/ui/assets/plsql-DGHpHOYJ.js +0 -1
  442. package/dist/ui/assets/po-BiJDBrnU.js +0 -1
  443. package/dist/ui/assets/poimandres-DRFjx7u4.js +0 -1
  444. package/dist/ui/assets/polar-C7UOKdEL.js +0 -1
  445. package/dist/ui/assets/postcss-BXeXVLqQ.js +0 -1
  446. package/dist/ui/assets/powerquery-DNMTfnFr.js +0 -1
  447. package/dist/ui/assets/powershell-DshXNtvi.js +0 -1
  448. package/dist/ui/assets/prisma-BsRQq5mF.js +0 -1
  449. package/dist/ui/assets/prolog-iXnhIJG7.js +0 -1
  450. package/dist/ui/assets/proto-DB4EqR-F.js +0 -1
  451. package/dist/ui/assets/pug-C_PxC7gO.js +0 -1
  452. package/dist/ui/assets/puppet-CDv2pdJW.js +0 -1
  453. package/dist/ui/assets/purescript-9MfHhQsQ.js +0 -1
  454. package/dist/ui/assets/python-gzcpVVnB.js +0 -1
  455. package/dist/ui/assets/qml-DtngoFFK.js +0 -1
  456. package/dist/ui/assets/qmldir-DCQb3MpD.js +0 -1
  457. package/dist/ui/assets/qss-Fe1Jh2GI.js +0 -1
  458. package/dist/ui/assets/r-DohkcevW.js +0 -1
  459. package/dist/ui/assets/racket-DcIDlBhZ.js +0 -1
  460. package/dist/ui/assets/raku-B3gFvitq.js +0 -1
  461. package/dist/ui/assets/razor-C4t8J0_E.js +0 -1
  462. package/dist/ui/assets/red-CJ3rzSJv.js +0 -1
  463. package/dist/ui/assets/reg-CRGYupPL.js +0 -1
  464. package/dist/ui/assets/regexp-OGbTbjgY.js +0 -1
  465. package/dist/ui/assets/rel-BtDbiS_P.js +0 -1
  466. package/dist/ui/assets/review-payload-C5Qz60Kq.js +0 -1
  467. package/dist/ui/assets/riscv-Ckw8ddFX.js +0 -1
  468. package/dist/ui/assets/ron-VUp2lXgN.js +0 -1
  469. package/dist/ui/assets/rose-pine-BthvhNj6.js +0 -1
  470. package/dist/ui/assets/rose-pine-dawn-Dg85fqjY.js +0 -1
  471. package/dist/ui/assets/rose-pine-moon-hon4tzzS.js +0 -1
  472. package/dist/ui/assets/rosmsg-CAekHB0j.js +0 -1
  473. package/dist/ui/assets/rst-CfBbbcvC.js +0 -1
  474. package/dist/ui/assets/ruby-Bw0mpxHY.js +0 -1
  475. package/dist/ui/assets/rust-Cfkwpbl8.js +0 -1
  476. package/dist/ui/assets/sas-Cs3s9JOf.js +0 -1
  477. package/dist/ui/assets/sass-DXrisJhu.js +0 -1
  478. package/dist/ui/assets/scala-DKOlJaKm.js +0 -1
  479. package/dist/ui/assets/scheme-DQCgrYNe.js +0 -1
  480. package/dist/ui/assets/scss-sRxNJS54.js +0 -1
  481. package/dist/ui/assets/sdbl-bTVj8UrX.js +0 -1
  482. package/dist/ui/assets/shaderlab-TOUzSsQk.js +0 -1
  483. package/dist/ui/assets/shellscript-B0X6wh0R.js +0 -1
  484. package/dist/ui/assets/shellsession-D2FdOioR.js +0 -1
  485. package/dist/ui/assets/slack-dark-DnToyrRv.js +0 -1
  486. package/dist/ui/assets/slack-ochin-B2OO5cIa.js +0 -1
  487. package/dist/ui/assets/smalltalk-B16xEiuN.js +0 -1
  488. package/dist/ui/assets/snazzy-light-4G7pJPwS.js +0 -1
  489. package/dist/ui/assets/solarized-dark-DV17i1UV.js +0 -1
  490. package/dist/ui/assets/solarized-light-DSh2HLQt.js +0 -1
  491. package/dist/ui/assets/solidity-CKzVLygQ.js +0 -1
  492. package/dist/ui/assets/soy-s6g9OjJ1.js +0 -1
  493. package/dist/ui/assets/sparql-D_iOobhT.js +0 -1
  494. package/dist/ui/assets/splunk-BC2Px7Mm.js +0 -1
  495. package/dist/ui/assets/sql-DVTnh5V-.js +0 -1
  496. package/dist/ui/assets/ssh-config-BgfXC-Er.js +0 -1
  497. package/dist/ui/assets/stata-DFIDiXF9.js +0 -1
  498. package/dist/ui/assets/stylus-B6D30XZt.js +0 -1
  499. package/dist/ui/assets/surrealql-DVfrsLyg.js +0 -1
  500. package/dist/ui/assets/svelte-D5GsxESq.js +0 -1
  501. package/dist/ui/assets/swift-DonLKvLd.js +0 -1
  502. package/dist/ui/assets/synthwave-84-nFMaYfgc.js +0 -1
  503. package/dist/ui/assets/system-verilog-DJ5XKQeo.js +0 -1
  504. package/dist/ui/assets/systemd-BxMlprV5.js +0 -1
  505. package/dist/ui/assets/talonscript-CohzipZa.js +0 -1
  506. package/dist/ui/assets/tasl-DMoTqEGO.js +0 -1
  507. package/dist/ui/assets/tcl-CZd0xW_V.js +0 -1
  508. package/dist/ui/assets/templ-DI-Zyqzd.js +0 -1
  509. package/dist/ui/assets/terraform-DswuEJGm.js +0 -1
  510. package/dist/ui/assets/tex-WHHmlbJI.js +0 -1
  511. package/dist/ui/assets/tokyo-night-oM2G3aXe.js +0 -1
  512. package/dist/ui/assets/toml-CcmNWLt0.js +0 -1
  513. package/dist/ui/assets/ts-tags-Dwpo2RFJ.js +0 -1
  514. package/dist/ui/assets/tsv-sltzmVWM.js +0 -1
  515. package/dist/ui/assets/tsx-ph_idaAW.js +0 -1
  516. package/dist/ui/assets/turtle-ByJddavk.js +0 -1
  517. package/dist/ui/assets/twig-YO17jFjR.js +0 -1
  518. package/dist/ui/assets/typescript-CbAxjhkl.js +0 -1
  519. package/dist/ui/assets/typespec-B88KGewJ.js +0 -1
  520. package/dist/ui/assets/typst-DI99ib-x.js +0 -1
  521. package/dist/ui/assets/useFileDiffInstance-B2DLX3Vg.js +0 -244
  522. package/dist/ui/assets/v-DETTlOr0.js +0 -1
  523. package/dist/ui/assets/vala-zf12oZj6.js +0 -1
  524. package/dist/ui/assets/vb-Djn5o6TS.js +0 -1
  525. package/dist/ui/assets/verilog-CiiDBU1e.js +0 -1
  526. package/dist/ui/assets/vesper-D5bVUKB1.js +0 -1
  527. package/dist/ui/assets/vhdl-BroJfC0k.js +0 -1
  528. package/dist/ui/assets/viml-DvXPmvsu.js +0 -1
  529. package/dist/ui/assets/vitesse-black-fwtXNY1n.js +0 -1
  530. package/dist/ui/assets/vitesse-dark-BZCL-v6S.js +0 -1
  531. package/dist/ui/assets/vitesse-light-VbXTXTou.js +0 -1
  532. package/dist/ui/assets/vue-CraHL-Ps.js +0 -1
  533. package/dist/ui/assets/vue-html-e9tyZNtS.js +0 -1
  534. package/dist/ui/assets/vue-vine-CofmxaUb.js +0 -1
  535. package/dist/ui/assets/vyper-CgoNMtux.js +0 -1
  536. package/dist/ui/assets/wasm-BnjxR4X6.js +0 -1
  537. package/dist/ui/assets/wasm-ByWQv1Qj.js +0 -1
  538. package/dist/ui/assets/wenyan-C8pVoKbM.js +0 -1
  539. package/dist/ui/assets/wgsl-BsKzXJz4.js +0 -1
  540. package/dist/ui/assets/wikitext-ClFFjSW2.js +0 -1
  541. package/dist/ui/assets/wit-DdvCle-K.js +0 -1
  542. package/dist/ui/assets/wolfram-DLL8P-h_.js +0 -1
  543. package/dist/ui/assets/workspace-app-8--oTbCd.css +0 -1
  544. package/dist/ui/assets/xml-BWSdPZHm.js +0 -1
  545. package/dist/ui/assets/xsl-BtCt7Hx8.js +0 -1
  546. package/dist/ui/assets/yaml-BZiTw7cQ.js +0 -1
  547. package/dist/ui/assets/zenscript-BnlCZFoB.js +0 -1
  548. package/dist/ui/assets/zig-CMLA9XwU.js +0 -1
  549. package/docs/assets/auvrynt-logo-light.png +0 -0
  550. package/docs/assets/auvrynt-screenshot.png +0 -0
@@ -0,0 +1,493 @@
1
+ import * as prompts from "@clack/prompts";
2
+ import { randomBytes } from "node:crypto";
3
+ import { execFileSync, spawn } from "node:child_process";
4
+ import { closeSync, openSync } from "node:fs";
5
+ import { mkdir, readFile, unlink } from "node:fs/promises";
6
+ import { join, resolve } from "node:path";
7
+ import { stdin, stdout } from "node:process";
8
+ import { loadConfig } from "../config.js";
9
+ import { INTEGRATION_KEYS, INTEGRATION_LABELS, acquireManagementLock, atomicWriteJson, isProcessRunning, parseIntegrationProfiles, processIdentityMatches, readJsonFile, rotateLogFile, } from "../background-lifecycle.js";
10
+ import { integrationsForProfiles, postInstanceControl } from "./instance-control.js";
11
+ import { isAuvryntHealthReachable } from "./instance-lock.js";
12
+ import { dashboardUrl, printConsolePanel, RUNNING_COMMAND_HINTS } from "./runtime-support.js";
13
+ import { completeIntegrationsConfig, ensureIntegrationChoicesConfigured } from "./commands/integration-commands.js";
14
+ import { loadAuvryntFiles, writeAuvryntConfig } from "../user-config.js";
15
+ import { ensureManagedTunnel, managedTunnelPath, readManagedTunnel, stopManagedTunnel, tunnelProviderLabel, } from "../tunnels/tunnel-manager.js";
16
+ import { startCloudflaredService, stopCloudflaredService } from "../tunnels/cloudflared-service.js";
17
+ function managedTunnelOptions(stateDir, port, provider, config = loadConfig()) {
18
+ return {
19
+ stateDir,
20
+ port,
21
+ provider,
22
+ ngrokAuthtoken: config.ngrokAuthtoken,
23
+ ngrokUrl: config.ngrokUrl,
24
+ cloudflareTunnelToken: config.cloudflareTunnelToken,
25
+ publicUrl: config.publicBaseUrl,
26
+ };
27
+ }
28
+ export function applyIntegrationProfile(profiles) {
29
+ const selected = new Set(profiles);
30
+ const environmentKeys = {
31
+ godotGdscript: "AUVRYNT_GODOT_GDSCRIPT_ENABLED",
32
+ godotCsharp: "AUVRYNT_GODOT_CSHARP_ENABLED",
33
+ blender: "AUVRYNT_BLENDER_ENABLED",
34
+ aseprite: "AUVRYNT_ASEPRITE_ENABLED",
35
+ serena: "AUVRYNT_SERENA_INTEGRATION_ENABLED",
36
+ playwright: "AUVRYNT_PLAYWRIGHT_ENABLED",
37
+ context7: "AUVRYNT_CONTEXT7_ENABLED",
38
+ obsidian: "AUVRYNT_OBSIDIAN_ENABLED",
39
+ roblox: "AUVRYNT_ROBLOX_ENABLED",
40
+ };
41
+ for (const key of INTEGRATION_KEYS) {
42
+ process.env[environmentKeys[key]] = selected.has(key) ? "true" : "false";
43
+ }
44
+ }
45
+ export function createLifecycleManager(selfHealStartIntegrations) {
46
+ async function readActiveInstance() {
47
+ const config = loadConfig();
48
+ const lockPath = join(config.stateDir, "server.lock");
49
+ const record = await readJsonFile(lockPath);
50
+ if (!record || !Number.isInteger(record.pid) || record.pid < 1)
51
+ return undefined;
52
+ const hasIdentity = Boolean(record.processPath && record.processStartedAt);
53
+ const ownedProcess = hasIdentity
54
+ ? processIdentityMatches(record.pid, record)
55
+ : isProcessRunning(record.pid) && await isAuvryntHealthReachable(record.host, record.port);
56
+ if (ownedProcess)
57
+ return { stateDir: config.stateDir, lockPath, record };
58
+ await unlink(lockPath).catch(() => undefined);
59
+ return undefined;
60
+ }
61
+ async function updateActiveProfiles(active, profiles) {
62
+ const integrations = integrationsForProfiles(profiles);
63
+ const config = loadConfig();
64
+ const currentProfiles = new Set(active.record.profiles ?? []);
65
+ const newlyEnabledProfiles = profiles.filter((profile) => !currentProfiles.has(profile));
66
+ const healed = await selfHealStartIntegrations(active.record.launchRoot ?? resolve(process.cwd()), config.executables, integrationsForProfiles(newlyEnabledProfiles));
67
+ const response = await postInstanceControl(active, "/__auvrynt/control/profiles", {
68
+ integrations,
69
+ serenaExecutable: healed.serenaExecutable,
70
+ });
71
+ const result = await response.json().catch(() => ({}));
72
+ if (!response.ok)
73
+ throw new Error(result.error || `The running Auvrynt instance rejected the update (${response.status}).`);
74
+ active.record.profiles = profiles;
75
+ await atomicWriteJson(active.lockPath, active.record);
76
+ }
77
+ async function terminateRootProcess(pid) {
78
+ try {
79
+ if (process.platform === "win32") {
80
+ execFileSync("taskkill.exe", ["/PID", String(pid), "/F"], { stdio: "ignore", windowsHide: true });
81
+ }
82
+ else {
83
+ process.kill(pid, "SIGTERM");
84
+ }
85
+ }
86
+ catch {
87
+ if (isProcessRunning(pid))
88
+ throw new Error(`Could not stop Auvrynt process ${pid}.`);
89
+ }
90
+ }
91
+ async function waitForProcessExit(pid, timeoutMs) {
92
+ const deadline = Date.now() + timeoutMs;
93
+ while (Date.now() < deadline) {
94
+ if (!isProcessRunning(pid))
95
+ return true;
96
+ await new Promise((resolveDelay) => setTimeout(resolveDelay, 100));
97
+ }
98
+ return !isProcessRunning(pid);
99
+ }
100
+ function findLegacyCloudflaredChildren(parentPid) {
101
+ if (process.platform !== "win32")
102
+ return [];
103
+ try {
104
+ const script = [
105
+ `$items = @(Get-CimInstance Win32_Process -Filter "ParentProcessId = ${parentPid}" -ErrorAction Stop`,
106
+ "| Where-Object { $_.Name -ieq 'cloudflared.exe' }",
107
+ "| ForEach-Object { $p = Get-Process -Id $_.ProcessId -ErrorAction SilentlyContinue; if ($p) { [pscustomobject]@{ pid = $_.ProcessId; processPath = $p.Path; processStartedAt = $p.StartTime.ToUniversalTime().ToString('o') } } })",
108
+ "$items | ConvertTo-Json -Compress",
109
+ ].join(" ; ").replace(/ ; \|/g, " |");
110
+ const raw = execFileSync("powershell.exe", ["-NoProfile", "-NonInteractive", "-Command", script], {
111
+ encoding: "utf8",
112
+ stdio: ["ignore", "pipe", "ignore"],
113
+ windowsHide: true,
114
+ }).trim();
115
+ if (!raw)
116
+ return [];
117
+ const parsed = JSON.parse(raw);
118
+ const items = Array.isArray(parsed) ? parsed : [parsed];
119
+ return items.filter((item) => {
120
+ if (!item || typeof item !== "object")
121
+ return false;
122
+ const candidate = item;
123
+ return Number.isInteger(candidate.pid)
124
+ && typeof candidate.processPath === "string"
125
+ && /(^|[\\/])cloudflared\.exe$/i.test(candidate.processPath)
126
+ && typeof candidate.processStartedAt === "string";
127
+ });
128
+ }
129
+ catch {
130
+ return [];
131
+ }
132
+ }
133
+ async function adoptLegacyManagedTunnel(active) {
134
+ const existing = await readManagedTunnel(managedTunnelOptions(active.stateDir, active.record.port, "cloudflare"));
135
+ if (existing)
136
+ return existing;
137
+ const children = findLegacyCloudflaredChildren(active.record.pid);
138
+ if (children.length !== 1)
139
+ return undefined;
140
+ const output = await readFile(join(active.stateDir, "cloudflared.log"), "utf8").catch(() => "");
141
+ const url = output.match(/https:\/\/[a-zA-Z0-9-]+\.trycloudflare\.com/g)?.at(-1);
142
+ if (!url)
143
+ return undefined;
144
+ const record = { ...children[0], url, port: active.record.port };
145
+ await atomicWriteJson(managedTunnelPath(active.stateDir), record);
146
+ return record;
147
+ }
148
+ async function waitForBackgroundReady(stateDir, pid, host, port, spawnError) {
149
+ const deadline = Date.now() + 30_000;
150
+ const lockPath = join(stateDir, "server.lock");
151
+ while (Date.now() < deadline) {
152
+ const error = spawnError();
153
+ if (error)
154
+ throw new Error(`Auvrynt failed to start: ${error.message}`);
155
+ if (!isProcessRunning(pid))
156
+ throw new Error("Auvrynt exited before becoming ready.");
157
+ const record = await readJsonFile(lockPath);
158
+ if (record?.pid === pid && await isAuvryntHealthReachable(host, port) && processIdentityMatches(pid, record))
159
+ return record;
160
+ await new Promise((resolveDelay) => setTimeout(resolveDelay, 200));
161
+ }
162
+ throw new Error("Auvrynt did not become ready within 30 seconds.");
163
+ }
164
+ async function runBackgroundStartUnlocked(request, launchRoot) {
165
+ const active = await readActiveInstance();
166
+ const config = loadConfig();
167
+ if (config.executables.godotCsharp && !process.env.GODOT_DOTNET_EXECUTABLE) {
168
+ process.env.GODOT_DOTNET_EXECUTABLE = config.executables.godotCsharp;
169
+ }
170
+ if (config.executables.godot && !process.env.GODOT_EXECUTABLE) {
171
+ process.env.GODOT_EXECUTABLE = config.executables.godot;
172
+ }
173
+ const profiles = request.profiles ?? [];
174
+ if (active) {
175
+ let replace = request.replace;
176
+ if (!replace && stdin.isTTY && stdout.isTTY) {
177
+ const answer = await prompts.confirm({ message: `Replace running Auvrynt instance (PID ${active.record.pid})?`, initialValue: false });
178
+ if (prompts.isCancel(answer) || !answer) {
179
+ printConsolePanel("Auvrynt start cancelled");
180
+ return;
181
+ }
182
+ replace = true;
183
+ }
184
+ if (!replace)
185
+ throw new Error(`Auvrynt is already running (PID ${active.record.pid}). Re-run with --replace to override it.`);
186
+ if (resolve(active.record.launchRoot ?? launchRoot) === resolve(launchRoot) && active.record.controlToken) {
187
+ await updateActiveProfiles(active, profiles);
188
+ const tunnel = await readManagedTunnel(managedTunnelOptions(active.stateDir, active.record.port, config.tunnelProvider, config));
189
+ printConsolePanel("Auvrynt updated", [
190
+ { label: "PID", value: String(active.record.pid) },
191
+ { label: "Workspace", value: active.record.launchRoot ?? launchRoot },
192
+ { label: "Integrations", value: profiles.map((key) => INTEGRATION_LABELS[key]).join(", ") || "none" },
193
+ { label: "Dashboard", value: dashboardUrl(active.record.host, active.record.port) },
194
+ ...(tunnel ? [{ label: "Public MCP", value: `${tunnel.url}/mcp` }] : []),
195
+ ], ["Server and tunnel kept running", ...RUNNING_COMMAND_HINTS]);
196
+ return;
197
+ }
198
+ await adoptLegacyManagedTunnel(active);
199
+ await stopActiveInstance(active);
200
+ }
201
+ await mkdir(config.stateDir, { recursive: true, mode: 0o700 });
202
+ await selfHealStartIntegrations(launchRoot, config.executables, integrationsForProfiles(profiles));
203
+ const tunnelOptions = managedTunnelOptions(config.stateDir, config.port, config.tunnelProvider, config);
204
+ const managesCustomTunnel = config.tunnelProvider !== "custom"
205
+ || (Boolean(config.cloudflareTunnelToken) && process.platform !== "win32");
206
+ const tunnelResult = managesCustomTunnel ? await ensureManagedTunnel(tunnelOptions) : undefined;
207
+ const publicBaseUrl = tunnelResult?.record.url ?? config.publicBaseUrl;
208
+ if (config.tunnelProvider === "custom" && !managesCustomTunnel) {
209
+ await stopManagedTunnel(tunnelOptions);
210
+ }
211
+ else if (config.publicBaseUrl !== publicBaseUrl) {
212
+ const files = loadAuvryntFiles();
213
+ writeAuvryntConfig({ ...files.config, publicBaseUrl });
214
+ }
215
+ const logPath = join(config.stateDir, "auvrynt.log");
216
+ await rotateLogFile(logPath);
217
+ const logHandle = openSync(logPath, "a", 0o600);
218
+ const childArgs = [process.argv[1], "start", "--background-child"];
219
+ if (profiles.length > 0)
220
+ childArgs.push(profiles.join(","));
221
+ else
222
+ childArgs.push("--no-integrations");
223
+ const controlToken = randomBytes(32).toString("base64url");
224
+ const child = spawn(process.execPath, childArgs, {
225
+ cwd: launchRoot,
226
+ detached: true,
227
+ stdio: ["ignore", logHandle, logHandle],
228
+ windowsHide: true,
229
+ env: {
230
+ ...process.env,
231
+ AUVRYNT_CONTROL_TOKEN: controlToken,
232
+ ...(config.tunnelProvider === "custom" ? {} : { AUVRYNT_MANAGED_TUNNEL_URL: publicBaseUrl }),
233
+ },
234
+ });
235
+ closeSync(logHandle);
236
+ let childSpawnError;
237
+ child.once("error", (error) => { childSpawnError = error; });
238
+ if (!child.pid) {
239
+ if (tunnelResult?.created)
240
+ await stopManagedTunnel(tunnelOptions);
241
+ throw new Error("Auvrynt could not create its background process.");
242
+ }
243
+ child.unref();
244
+ try {
245
+ await waitForBackgroundReady(config.stateDir, child.pid, config.host, config.port, () => childSpawnError);
246
+ }
247
+ catch (error) {
248
+ await terminateRootProcess(child.pid).catch(() => undefined);
249
+ if (tunnelResult?.created) {
250
+ await stopManagedTunnel(tunnelOptions).catch(() => undefined);
251
+ }
252
+ throw error;
253
+ }
254
+ printConsolePanel("Auvrynt started", [
255
+ { label: "PID", value: String(child.pid) },
256
+ { label: "Workspace", value: launchRoot },
257
+ { label: "Integrations", value: profiles.map((key) => INTEGRATION_LABELS[key]).join(", ") || "no optional integrations" },
258
+ { label: "Dashboard", value: dashboardUrl(config.host, config.port) },
259
+ { label: "Public MCP", value: `${publicBaseUrl}/mcp` },
260
+ ], ["Next: auvrynt status", ...RUNNING_COMMAND_HINTS]);
261
+ }
262
+ async function start(request, launchRoot = resolve(process.cwd())) {
263
+ const config = loadConfig();
264
+ const management = await acquireManagementLock(config.stateDir);
265
+ const useCloudflaredService = process.platform === "win32" && config.tunnelProvider === "custom";
266
+ let serviceStarted = false;
267
+ try {
268
+ if (useCloudflaredService)
269
+ serviceStarted = await startCloudflaredService();
270
+ await runBackgroundStartUnlocked(request, launchRoot);
271
+ }
272
+ catch (error) {
273
+ if (serviceStarted)
274
+ await stopCloudflaredService().catch(() => undefined);
275
+ throw error;
276
+ }
277
+ finally {
278
+ await management.release();
279
+ }
280
+ }
281
+ async function stopActiveInstance(active) {
282
+ const hasIdentity = Boolean(active.record.processPath && active.record.processStartedAt);
283
+ const stillOwned = hasIdentity
284
+ ? processIdentityMatches(active.record.pid, active.record)
285
+ : isProcessRunning(active.record.pid) && await isAuvryntHealthReachable(active.record.host, active.record.port);
286
+ if (!stillOwned) {
287
+ if (isProcessRunning(active.record.pid) || await isAuvryntHealthReachable(active.record.host, active.record.port)) {
288
+ throw new Error(`Auvrynt PID ${active.record.pid} is still running but its process identity could not be verified. Refusing to stop an unowned process.`);
289
+ }
290
+ await unlink(active.lockPath).catch(() => undefined);
291
+ return;
292
+ }
293
+ const activeConfig = loadConfig();
294
+ const managedTunnel = await readManagedTunnel(managedTunnelOptions(active.stateDir, active.record.port, activeConfig.tunnelProvider, activeConfig));
295
+ const legacyTunnels = active.record.controlToken
296
+ ? []
297
+ : findLegacyCloudflaredChildren(active.record.pid).filter((candidate) => candidate.pid !== managedTunnel?.pid);
298
+ if (active.record.controlToken) {
299
+ try {
300
+ const response = await postInstanceControl(active, "/__auvrynt/control/shutdown");
301
+ if (!response.ok)
302
+ throw new Error(`Shutdown request failed (${response.status}).`);
303
+ }
304
+ catch {
305
+ await terminateRootProcess(active.record.pid);
306
+ }
307
+ }
308
+ else {
309
+ await terminateRootProcess(active.record.pid);
310
+ }
311
+ if (!await waitForProcessExit(active.record.pid, 15_000))
312
+ await terminateRootProcess(active.record.pid);
313
+ if (!await waitForProcessExit(active.record.pid, 5_000))
314
+ throw new Error(`Could not stop Auvrynt process ${active.record.pid}.`);
315
+ for (const tunnel of legacyTunnels) {
316
+ if (processIdentityMatches(tunnel.pid, tunnel))
317
+ await terminateRootProcess(tunnel.pid).catch(() => undefined);
318
+ }
319
+ const current = await readJsonFile(active.lockPath);
320
+ if (current?.instanceId === active.record.instanceId) {
321
+ await unlink(active.lockPath).catch((error) => {
322
+ if (error.code !== "ENOENT")
323
+ throw error;
324
+ });
325
+ }
326
+ }
327
+ async function stop() {
328
+ const config = loadConfig();
329
+ const management = await acquireManagementLock(config.stateDir);
330
+ let active;
331
+ let tunnelStopped = false;
332
+ let serverError;
333
+ let tunnelError;
334
+ let serviceError;
335
+ try {
336
+ active = await readActiveInstance();
337
+ try {
338
+ if (active)
339
+ await stopActiveInstance(active);
340
+ }
341
+ catch (error) {
342
+ serverError = error;
343
+ }
344
+ finally {
345
+ try {
346
+ tunnelStopped = await stopManagedTunnel(managedTunnelOptions(config.stateDir, config.port, config.tunnelProvider, config));
347
+ }
348
+ catch (error) {
349
+ tunnelError = error;
350
+ }
351
+ if (process.platform === "win32" && config.tunnelProvider === "custom") {
352
+ try {
353
+ await stopCloudflaredService();
354
+ }
355
+ catch (error) {
356
+ serviceError = error;
357
+ }
358
+ }
359
+ }
360
+ }
361
+ finally {
362
+ await management.release();
363
+ }
364
+ if (serverError || tunnelError || serviceError) {
365
+ throw new AggregateError([serverError, tunnelError, serviceError].filter((error) => Boolean(error)), "Auvrynt could not stop all managed processes.");
366
+ }
367
+ if (await readActiveInstance() || await isAuvryntHealthReachable(config.host, config.port)) {
368
+ throw new Error("Auvrynt stop did not verify that the managed server exited.");
369
+ }
370
+ if (await readManagedTunnel(managedTunnelOptions(config.stateDir, config.port, config.tunnelProvider, config))) {
371
+ throw new Error("Auvrynt stop did not verify that the managed tunnel exited.");
372
+ }
373
+ if (!active && !tunnelStopped) {
374
+ printConsolePanel("Auvrynt", [{ label: "Status", value: "Not running" }]);
375
+ return;
376
+ }
377
+ printConsolePanel("Auvrynt stopped", [
378
+ { label: "Server", value: "Stopped" },
379
+ { label: "Tunnel", value: "Stopped" },
380
+ ], "Start again: auvrynt start");
381
+ }
382
+ async function restart(request, launchRoot, hard) {
383
+ if (hard) {
384
+ const config = loadConfig();
385
+ const management = await acquireManagementLock(config.stateDir);
386
+ try {
387
+ const active = await readActiveInstance();
388
+ const profiles = request.profiles ?? active?.record.profiles;
389
+ if (!profiles)
390
+ await ensureIntegrationChoicesConfigured();
391
+ const restartRoot = resolve(active?.record.launchRoot ?? launchRoot);
392
+ process.env.AUVRYNT_ALLOWED_ROOTS = restartRoot;
393
+ process.env.AUVRYNT_WORKTREE_ROOT = restartRoot;
394
+ if (active) {
395
+ await adoptLegacyManagedTunnel(active);
396
+ await stopActiveInstance(active);
397
+ }
398
+ await stopManagedTunnel(managedTunnelOptions(config.stateDir, config.port, config.tunnelProvider, config));
399
+ await runBackgroundStartUnlocked({ ...request, profiles, replace: true, backgroundChild: false }, restartRoot);
400
+ }
401
+ finally {
402
+ await management.release();
403
+ }
404
+ return;
405
+ }
406
+ const config = loadConfig();
407
+ const management = await acquireManagementLock(config.stateDir);
408
+ try {
409
+ const active = await readActiveInstance();
410
+ if (!active)
411
+ throw new Error("Auvrynt is not running. Use `auvrynt start` instead.");
412
+ const profiles = request.profiles ?? active.record.profiles
413
+ ?? INTEGRATION_KEYS.filter((key) => completeIntegrationsConfig(loadAuvryntFiles().config.integrations)[key]);
414
+ const restartRoot = resolve(active.record.launchRoot ?? launchRoot);
415
+ process.env.AUVRYNT_ALLOWED_ROOTS = restartRoot;
416
+ process.env.AUVRYNT_WORKTREE_ROOT = restartRoot;
417
+ const tunnelBefore = await adoptLegacyManagedTunnel(active)
418
+ ?? await readManagedTunnel(managedTunnelOptions(active.stateDir, active.record.port, config.tunnelProvider, config));
419
+ await stopActiveInstance(active);
420
+ await runBackgroundStartUnlocked({ ...request, profiles, replace: true, backgroundChild: false }, restartRoot);
421
+ const tunnelAfter = await readManagedTunnel(managedTunnelOptions(config.stateDir, config.port, config.tunnelProvider, config));
422
+ if (tunnelBefore && tunnelAfter && tunnelBefore.url !== tunnelAfter.url) {
423
+ printConsolePanel(`${tunnelProviderLabel(config.tunnelProvider)} tunnel replaced`, [
424
+ { label: "Public MCP", value: `${tunnelAfter.url}/mcp` },
425
+ ], "The previous tunnel process was no longer healthy");
426
+ }
427
+ }
428
+ finally {
429
+ await management.release();
430
+ }
431
+ }
432
+ async function changeWorkspace(launchRoot) {
433
+ const config = loadConfig();
434
+ const management = await acquireManagementLock(config.stateDir);
435
+ try {
436
+ const active = await readActiveInstance();
437
+ if (!active)
438
+ throw new Error("Auvrynt is not running. Use `auvrynt start` in this directory instead.");
439
+ const currentRoot = resolve(active.record.launchRoot ?? launchRoot);
440
+ const sameRoot = process.platform === "win32"
441
+ ? currentRoot.toLowerCase() === launchRoot.toLowerCase()
442
+ : currentRoot === launchRoot;
443
+ if (sameRoot) {
444
+ const tunnel = await readManagedTunnel(managedTunnelOptions(active.stateDir, active.record.port, config.tunnelProvider, config));
445
+ printConsolePanel("Auvrynt workspace unchanged", [
446
+ { label: "Workspace", value: launchRoot },
447
+ { label: "Dashboard", value: dashboardUrl(active.record.host, active.record.port) },
448
+ ...(tunnel ? [{ label: "Public MCP", value: `${tunnel.url}/mcp` }] : []),
449
+ ], RUNNING_COMMAND_HINTS);
450
+ return;
451
+ }
452
+ const profiles = active.record.profiles
453
+ ?? INTEGRATION_KEYS.filter((key) => completeIntegrationsConfig(loadAuvryntFiles().config.integrations)[key]);
454
+ await runBackgroundStartUnlocked({ profiles, replace: true, backgroundChild: false }, launchRoot);
455
+ }
456
+ finally {
457
+ await management.release();
458
+ }
459
+ }
460
+ async function addProfiles(args) {
461
+ const additions = parseIntegrationProfiles(args);
462
+ const config = loadConfig();
463
+ const management = await acquireManagementLock(config.stateDir);
464
+ try {
465
+ const active = await readActiveInstance();
466
+ const saved = completeIntegrationsConfig(loadAuvryntFiles().config.integrations);
467
+ const current = active?.record.profiles ?? INTEGRATION_KEYS.filter((key) => saved[key]);
468
+ const profiles = Array.from(new Set([...current, ...additions]));
469
+ if (active) {
470
+ if (!active.record.controlToken) {
471
+ await adoptLegacyManagedTunnel(active);
472
+ await stopActiveInstance(active);
473
+ await runBackgroundStartUnlocked({ profiles, replace: true, backgroundChild: false }, active.record.launchRoot ?? resolve(process.cwd()));
474
+ return;
475
+ }
476
+ await updateActiveProfiles(active, profiles);
477
+ const tunnel = await readManagedTunnel(managedTunnelOptions(active.stateDir, active.record.port, config.tunnelProvider, config));
478
+ printConsolePanel("Auvrynt integrations updated", [
479
+ { label: "PID", value: String(active.record.pid) },
480
+ { label: "Integrations", value: profiles.map((key) => INTEGRATION_LABELS[key]).join(", ") },
481
+ { label: "Dashboard", value: dashboardUrl(active.record.host, active.record.port) },
482
+ ...(tunnel ? [{ label: "Public MCP", value: `${tunnel.url}/mcp` }] : []),
483
+ ], ["Server and tunnel kept running", ...RUNNING_COMMAND_HINTS]);
484
+ return;
485
+ }
486
+ await runBackgroundStartUnlocked({ profiles, replace: true, backgroundChild: false }, resolve(process.cwd()));
487
+ }
488
+ finally {
489
+ await management.release();
490
+ }
491
+ }
492
+ return { readActiveInstance, start, stop, restart, changeWorkspace, addProfiles };
493
+ }
@@ -0,0 +1,74 @@
1
+ import { appendFileSync } from "node:fs";
2
+ import { spawn } from "node:child_process";
3
+ import { fileURLToPath } from "node:url";
4
+ import { join } from "node:path";
5
+ import { planCrashRecovery } from "../crash-recovery.js";
6
+ export function writeFatalLog(stateDir, type, error) {
7
+ const value = error instanceof Error ? (error.stack ?? error.message) : String(error);
8
+ try {
9
+ appendFileSync(join(stateDir, "fatal-errors.log"), `[${new Date().toISOString()}] ${type}\n${value}\n\n`, "utf8");
10
+ }
11
+ catch {
12
+ // Fatal logging must never prevent process termination.
13
+ }
14
+ }
15
+ export function scheduleCrashRecovery(stateDir, reason) {
16
+ if (process.env.AUVRYNT_START_MODE !== "true" || !process.argv[1])
17
+ return false;
18
+ const plan = planCrashRecovery(process.env);
19
+ if (!plan.allowed) {
20
+ writeFatalLog(stateDir, "crashRecoveryStopped", `Restart limit reached after ${plan.attempt - 1} attempts: ${reason}`);
21
+ return false;
22
+ }
23
+ try {
24
+ const helperPath = fileURLToPath(new URL("../../scripts/restart-after-crash.mjs", import.meta.url));
25
+ const encodedArgs = Buffer.from(JSON.stringify(process.argv.slice(2)), "utf8").toString("base64url");
26
+ const helper = spawn(process.execPath, [helperPath, String(process.pid), process.argv[1], encodedArgs], {
27
+ cwd: process.cwd(),
28
+ detached: true,
29
+ stdio: ["ignore", "inherit", "inherit"],
30
+ windowsHide: true,
31
+ env: plan.environment,
32
+ });
33
+ helper.once("error", (error) => writeFatalLog(stateDir, "crashRecoverySpawnFailed", error));
34
+ helper.unref();
35
+ writeFatalLog(stateDir, "crashRecoveryScheduled", `Attempt ${plan.attempt}: ${reason}`);
36
+ return true;
37
+ }
38
+ catch (error) {
39
+ writeFatalLog(stateDir, "crashRecoverySpawnFailed", error);
40
+ return false;
41
+ }
42
+ }
43
+ export function httpUrl(host, port, path = "") {
44
+ const formattedHost = host.includes(":") && !host.startsWith("[") ? `[${host}]` : host;
45
+ return `http://${formattedHost}:${port}${path}`;
46
+ }
47
+ export function localProbeHost(host) {
48
+ return host === "0.0.0.0" || host === "::" ? "127.0.0.1" : host;
49
+ }
50
+ export function dashboardUrl(host, port) {
51
+ return httpUrl(localProbeHost(host), port, "/dashboard");
52
+ }
53
+ export const RUNNING_COMMAND_HINTS = [
54
+ "# auvrynt token — show the owner token for authentication",
55
+ "# auvrynt stop — stop Auvrynt and exit",
56
+ ];
57
+ export function printConsolePanel(title, rows = [], footer) {
58
+ const labelWidth = rows.reduce((width, row) => Math.max(width, row.label.length), 0);
59
+ console.log(`┌ ${title}`);
60
+ for (const row of rows)
61
+ console.log(`│ ${row.label.padEnd(labelWidth)} ${row.value}`);
62
+ const footerLines = footer === undefined
63
+ ? []
64
+ : typeof footer === "string"
65
+ ? [footer]
66
+ : [...footer];
67
+ if (footerLines.length === 0) {
68
+ console.log("└");
69
+ return;
70
+ }
71
+ for (const line of footerLines.slice(0, -1))
72
+ console.log(`│ ${line}`);
73
+ console.log(`└ ${footerLines.at(-1)}`);
74
+ }
@@ -0,0 +1,27 @@
1
+ import { processDetected } from "../integration-discovery.js";
2
+ export function applyDetectedSerenaDefault(config, discovery, userConfig, env = process.env) {
3
+ const executable = discovery.executables.serena;
4
+ if (executable) {
5
+ config.executables.serena = executable;
6
+ if (!hasExplicitSerenaExecutable(userConfig, env))
7
+ config.serena.executable = executable;
8
+ }
9
+ const detected = Boolean(executable || processDetected(discovery, "serena"));
10
+ if (!detected || hasExplicitSerenaEnablement(userConfig, env))
11
+ return false;
12
+ config.integrations.serena = true;
13
+ config.serena.enabled = true;
14
+ return true;
15
+ }
16
+ export function hasExplicitSerenaEnablement(userConfig, env = process.env) {
17
+ return env.AUVRYNT_SERENA_INTEGRATION_ENABLED !== undefined
18
+ || env.AUVRYNT_SERENA_ENABLED !== undefined
19
+ || userConfig.integrations?.serena !== undefined
20
+ || userConfig.serena?.enabled !== undefined;
21
+ }
22
+ function hasExplicitSerenaExecutable(userConfig, env) {
23
+ return env.AUVRYNT_SERENA_EXECUTABLE !== undefined
24
+ || env.AUVRYNT_SERENA_PATH !== undefined
25
+ || userConfig.executables?.serena !== undefined
26
+ || userConfig.serena?.executable !== undefined;
27
+ }