zevairouter 1.0.173 → 1.0.174

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 (314) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/cli/app/.next-cli-build/BUILD_ID +1 -1
  3. package/cli/app/.next-cli-build/app-path-routes-manifest.json +11 -11
  4. package/cli/app/.next-cli-build/build-manifest.json +2 -2
  5. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/automation/page_client-reference-manifest.js +1 -1
  6. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  7. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  8. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  9. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  10. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  11. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/context/page_client-reference-manifest.js +1 -1
  12. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  13. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  14. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  15. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  16. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  17. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  18. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  19. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
  20. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  21. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  22. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  23. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  24. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  25. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  26. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  27. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  28. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/terminal/page_client-reference-manifest.js +1 -1
  29. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  30. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  31. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  32. package/cli/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  33. package/cli/app/.next-cli-build/server/app/_global-error.html +1 -1
  34. package/cli/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  35. package/cli/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  36. package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  37. package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  38. package/cli/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  39. package/cli/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  40. package/cli/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  41. package/cli/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  42. package/cli/app/.next-cli-build/server/app/_not-found.html +1 -1
  43. package/cli/app/.next-cli-build/server/app/_not-found.rsc +3 -3
  44. package/cli/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
  45. package/cli/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  46. package/cli/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +3 -3
  47. package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  48. package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  49. package/cli/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  50. package/cli/app/.next-cli-build/server/app/api/models/route.js +1 -1
  51. package/cli/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  52. package/cli/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  53. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  54. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  55. package/cli/app/.next-cli-build/server/app/api/version/route.js +1 -1
  56. package/cli/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  57. package/cli/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  58. package/cli/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  59. package/cli/app/.next-cli-build/server/app/callback.html +1 -1
  60. package/cli/app/.next-cli-build/server/app/callback.rsc +3 -3
  61. package/cli/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
  62. package/cli/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  63. package/cli/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +3 -3
  64. package/cli/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  65. package/cli/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  66. package/cli/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  67. package/cli/app/.next-cli-build/server/app/dashboard/automation.html +1 -1
  68. package/cli/app/.next-cli-build/server/app/dashboard/automation.rsc +5 -5
  69. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation/__PAGE__.segment.rsc +2 -2
  70. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation.segment.rsc +1 -1
  71. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  72. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  73. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_full.segment.rsc +5 -5
  74. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_head.segment.rsc +1 -1
  75. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_index.segment.rsc +3 -3
  76. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_tree.segment.rsc +1 -1
  77. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  78. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +5 -5
  79. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  80. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  81. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  82. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  83. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +5 -5
  84. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  85. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +3 -3
  86. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  87. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  88. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +5 -5
  89. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  90. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  91. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  92. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  93. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +5 -5
  94. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  95. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +3 -3
  96. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  97. package/cli/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  98. package/cli/app/.next-cli-build/server/app/dashboard/combos.rsc +5 -5
  99. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  100. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  101. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  102. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  103. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
  104. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  105. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +3 -3
  106. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  107. package/cli/app/.next-cli-build/server/app/dashboard/context.html +1 -1
  108. package/cli/app/.next-cli-build/server/app/dashboard/context.rsc +5 -5
  109. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context/__PAGE__.segment.rsc +2 -2
  110. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context.segment.rsc +1 -1
  111. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  112. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  113. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_full.segment.rsc +5 -5
  114. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_head.segment.rsc +1 -1
  115. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_index.segment.rsc +3 -3
  116. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_tree.segment.rsc +1 -1
  117. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  118. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.rsc +5 -5
  119. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  120. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  121. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  122. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  123. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +5 -5
  124. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  125. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +3 -3
  126. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  127. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  128. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +5 -5
  129. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  130. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  131. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  132. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  133. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  134. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +5 -5
  135. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  136. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +3 -3
  137. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  138. package/cli/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  139. package/cli/app/.next-cli-build/server/app/dashboard/mitm.rsc +5 -5
  140. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  141. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  142. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  143. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  144. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +5 -5
  145. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  146. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +3 -3
  147. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  148. package/cli/app/.next-cli-build/server/app/dashboard/playground.html +1 -1
  149. package/cli/app/.next-cli-build/server/app/dashboard/playground.rsc +5 -5
  150. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground/__PAGE__.segment.rsc +2 -2
  151. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground.segment.rsc +1 -1
  152. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  153. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  154. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_full.segment.rsc +5 -5
  155. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_head.segment.rsc +1 -1
  156. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_index.segment.rsc +3 -3
  157. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_tree.segment.rsc +1 -1
  158. package/cli/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  159. package/cli/app/.next-cli-build/server/app/dashboard/profile.rsc +5 -5
  160. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  161. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  162. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  163. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  164. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
  165. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  166. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +3 -3
  167. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  168. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  169. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.rsc +5 -5
  170. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  171. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  172. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  173. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  174. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  175. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
  176. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  177. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +3 -3
  178. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  179. package/cli/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  180. package/cli/app/.next-cli-build/server/app/dashboard/providers.rsc +5 -5
  181. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  182. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  183. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  184. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  185. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
  186. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  187. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +3 -3
  188. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  189. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  190. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +5 -5
  191. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  192. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  193. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  194. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  195. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +5 -5
  196. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  197. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +3 -3
  198. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  199. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  200. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +5 -5
  201. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
  202. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe.segment.rsc +1 -1
  203. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  204. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  205. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +5 -5
  206. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_head.segment.rsc +1 -1
  207. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_index.segment.rsc +3 -3
  208. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
  209. package/cli/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  210. package/cli/app/.next-cli-build/server/app/dashboard/quota.rsc +6 -6
  211. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  212. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  213. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  214. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  215. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +6 -6
  216. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  217. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +3 -3
  218. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  219. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  220. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +4 -4
  221. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  222. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing.segment.rsc +1 -1
  223. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings.segment.rsc +1 -1
  224. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  225. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  226. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
  227. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  228. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +3 -3
  229. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  230. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  231. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.rsc +5 -5
  232. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
  233. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
  234. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  235. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  236. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +5 -5
  237. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
  238. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +3 -3
  239. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  240. package/cli/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  241. package/cli/app/.next-cli-build/server/app/dashboard/translator.rsc +5 -5
  242. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  243. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  244. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  245. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  246. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
  247. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  248. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +3 -3
  249. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  250. package/cli/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  251. package/cli/app/.next-cli-build/server/app/dashboard/usage.rsc +5 -5
  252. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  253. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  254. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  255. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  256. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
  257. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  258. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +3 -3
  259. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  260. package/cli/app/.next-cli-build/server/app/dashboard.html +1 -1
  261. package/cli/app/.next-cli-build/server/app/dashboard.rsc +5 -5
  262. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  263. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  264. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  265. package/cli/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +5 -5
  266. package/cli/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  267. package/cli/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +3 -3
  268. package/cli/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  269. package/cli/app/.next-cli-build/server/app/index.html +1 -1
  270. package/cli/app/.next-cli-build/server/app/index.rsc +3 -3
  271. package/cli/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  272. package/cli/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
  273. package/cli/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  274. package/cli/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +3 -3
  275. package/cli/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  276. package/cli/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  277. package/cli/app/.next-cli-build/server/app/landing.html +1 -1
  278. package/cli/app/.next-cli-build/server/app/landing.rsc +4 -4
  279. package/cli/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +4 -4
  280. package/cli/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  281. package/cli/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +3 -3
  282. package/cli/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  283. package/cli/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +2 -2
  284. package/cli/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  285. package/cli/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  286. package/cli/app/.next-cli-build/server/app/login.html +1 -1
  287. package/cli/app/.next-cli-build/server/app/login.rsc +4 -4
  288. package/cli/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
  289. package/cli/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  290. package/cli/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +3 -3
  291. package/cli/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  292. package/cli/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  293. package/cli/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  294. package/cli/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  295. package/cli/app/.next-cli-build/server/app-paths-manifest.json +11 -11
  296. package/cli/app/.next-cli-build/server/chunks/3155.js +1 -1
  297. package/cli/app/.next-cli-build/server/chunks/4746.js +1 -1
  298. package/cli/app/.next-cli-build/server/chunks/5307.js +1 -1
  299. package/cli/app/.next-cli-build/server/chunks/8306.js +1 -1
  300. package/cli/app/.next-cli-build/server/chunks/9621.js +1 -1
  301. package/cli/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  302. package/cli/app/.next-cli-build/server/pages/404.html +1 -1
  303. package/cli/app/.next-cli-build/server/pages/500.html +1 -1
  304. package/cli/app/.next-cli-build/static/chunks/{620-c15094ea3b9eda2c.js → 620-2db5cff0e3ebc21f.js} +1 -1
  305. package/cli/app/CHANGELOG.md +5 -0
  306. package/cli/app/package.json +1 -1
  307. package/cli/app/src/lib/updater/updater.js +19 -4
  308. package/cli/cli.js +305 -78
  309. package/cli/package.json +1 -1
  310. package/cli/src/cli/routerProcessLifecycle.js +685 -0
  311. package/cli/src/cli/tray/autostart.js +43 -35
  312. package/package.json +1 -1
  313. /package/cli/app/.next-cli-build/static/{nTTf6L7b6eAK9eItpJOcH → 9Vz4OT0qlhev-svz548oQ}/_buildManifest.js +0 -0
  314. /package/cli/app/.next-cli-build/static/{nTTf6L7b6eAK9eItpJOcH → 9Vz4OT0qlhev-svz548oQ}/_ssgManifest.js +0 -0
@@ -0,0 +1,685 @@
1
+ "use strict";
2
+
3
+ const path = require("path");
4
+ const { execFileSync } = require("child_process");
5
+
6
+ const DEFAULT_TERM_TIMEOUT_MS = 4_000;
7
+ const DEFAULT_KILL_TIMEOUT_MS = 1_000;
8
+ const DEFAULT_POLL_INTERVAL_MS = 100;
9
+ const MAX_WAIT_TIMEOUT_MS = 60_000;
10
+
11
+ class RouterProcessLifecycleError extends Error {
12
+ constructor(code, message, details = {}) {
13
+ super(message);
14
+ this.name = "RouterProcessLifecycleError";
15
+ this.code = code;
16
+ this.details = details;
17
+ }
18
+ }
19
+
20
+ function lifecycleError(code, message, details) {
21
+ return new RouterProcessLifecycleError(code, message, details);
22
+ }
23
+
24
+ function isValidPid(value) {
25
+ return Number.isInteger(value) && value > 1;
26
+ }
27
+
28
+ function normalizeListenerPids(value) {
29
+ if (!Array.isArray(value)) {
30
+ throw lifecycleError(
31
+ "LISTENER_ENUMERATION_FAILED",
32
+ "Listener enumeration did not return an array.",
33
+ );
34
+ }
35
+
36
+ const pids = [];
37
+ const seen = new Set();
38
+ for (const pid of value) {
39
+ if (!isValidPid(pid)) {
40
+ throw lifecycleError(
41
+ "LISTENER_ENUMERATION_FAILED",
42
+ `Listener enumeration returned an invalid PID: ${String(pid)}.`,
43
+ );
44
+ }
45
+ if (!seen.has(pid)) {
46
+ seen.add(pid);
47
+ pids.push(pid);
48
+ }
49
+ }
50
+ return pids.sort((left, right) => left - right);
51
+ }
52
+
53
+ function normalizePort(value) {
54
+ if (!Number.isInteger(value) || value < 1 || value > 65_535) {
55
+ throw lifecycleError("INVALID_INPUT", `Invalid listener port: ${String(value)}.`);
56
+ }
57
+ return value;
58
+ }
59
+
60
+ function normalizeWait(value, name, { allowZero = true } = {}) {
61
+ const minimum = allowZero ? 0 : 1;
62
+ if (!Number.isInteger(value) || value < minimum || value > MAX_WAIT_TIMEOUT_MS) {
63
+ throw lifecycleError(
64
+ "INVALID_INPUT",
65
+ `${name} must be an integer from ${minimum} to ${MAX_WAIT_TIMEOUT_MS}.`,
66
+ );
67
+ }
68
+ return value;
69
+ }
70
+
71
+ function canonicalAbsolutePosixPath(value) {
72
+ if (
73
+ typeof value !== "string"
74
+ || value.length === 0
75
+ || /[\0\r\n]/.test(value)
76
+ || !path.posix.isAbsolute(value)
77
+ || (value.length > 1 && value.endsWith("/"))
78
+ || path.posix.normalize(value) !== value
79
+ ) {
80
+ return null;
81
+ }
82
+ return value;
83
+ }
84
+
85
+ function isAllowedMacOsRouterCwd(cwd, globalRoot) {
86
+ const root = canonicalAbsolutePosixPath(globalRoot);
87
+ const candidate = canonicalAbsolutePosixPath(cwd);
88
+ if (!root || root === "/" || !candidate) return false;
89
+
90
+ if (candidate === path.posix.join(root, "zevairouter", "cli", "app")) {
91
+ return true;
92
+ }
93
+
94
+ const relative = path.posix.relative(root, candidate);
95
+ const parts = relative.split("/");
96
+ return parts.length === 3
97
+ && /^\.zevairouter-[A-Za-z0-9_-]+$/.test(parts[0])
98
+ && parts[1] === "cli"
99
+ && parts[2] === "app";
100
+ }
101
+
102
+ function isExactNextServerCommand(command) {
103
+ return typeof command === "string"
104
+ && /^next-server(?: \(v[^()\s]+\))?$/.test(command);
105
+ }
106
+
107
+ function parseMacOsLsofCwdMetadata(output, expectedPid) {
108
+ if (typeof output !== "string" || !isValidPid(expectedPid)) return null;
109
+
110
+ let pid = null;
111
+ let command = null;
112
+ let descriptor = null;
113
+ let cwd = null;
114
+ for (const line of output.split(/\r?\n/)) {
115
+ if (!line) continue;
116
+ const field = line[0];
117
+ const value = line.slice(1);
118
+ if (field === "p") {
119
+ if (pid != null || !/^\d+$/.test(value)) return null;
120
+ pid = Number(value);
121
+ } else if (field === "c") {
122
+ if (pid == null || command != null) return null;
123
+ command = value;
124
+ } else if (field === "f") {
125
+ if (command == null || descriptor != null) return null;
126
+ descriptor = value;
127
+ } else if (field === "n") {
128
+ if (descriptor !== "cwd" || cwd != null) return null;
129
+ cwd = value;
130
+ } else {
131
+ return null;
132
+ }
133
+ }
134
+
135
+ if (pid !== expectedPid || command !== "node" || descriptor !== "cwd" || !cwd) {
136
+ return null;
137
+ }
138
+ return { pid, command, cwd };
139
+ }
140
+
141
+ function parseLinuxProcStatStartToken(output, expectedPid) {
142
+ if (typeof output !== "string" || !isValidPid(expectedPid) || /[\r\n]/.test(output.trim())) {
143
+ return null;
144
+ }
145
+ const value = output.trim();
146
+ const openParen = value.indexOf(" (");
147
+ const closeParen = value.lastIndexOf(") ");
148
+ if (openParen < 1 || closeParen <= openParen + 2) return null;
149
+ if (Number(value.slice(0, openParen)) !== expectedPid) return null;
150
+ const fieldsAfterCommand = value.slice(closeParen + 2).split(/\s+/);
151
+ const startTime = fieldsAfterCommand[19];
152
+ if (fieldsAfterCommand.length < 20 || !/^\d+$/.test(startTime)) return null;
153
+ return `${expectedPid}:${startTime}`;
154
+ }
155
+
156
+ function outputFromNoMatch(error) {
157
+ if (error?.status !== 1) return null;
158
+ if (typeof error.stdout === "string") return error.stdout;
159
+ if (Buffer.isBuffer(error.stdout)) return error.stdout.toString("utf8");
160
+ return "";
161
+ }
162
+
163
+ function parseListenerPidOutput(output) {
164
+ const pids = [];
165
+ for (const line of String(output || "").split(/\r?\n/)) {
166
+ if (!line) continue;
167
+ const match = line.match(/^(\d+)$/);
168
+ if (!match) {
169
+ throw lifecycleError(
170
+ "LISTENER_ENUMERATION_FAILED",
171
+ "lsof returned malformed listener metadata.",
172
+ );
173
+ }
174
+ pids.push(Number(match[1]));
175
+ }
176
+ return normalizeListenerPids(pids);
177
+ }
178
+
179
+ function parsePsProcessDetails(output, expectedPid) {
180
+ const lines = String(output || "").split(/\r?\n/).filter((line) => line.trim());
181
+ if (lines.length !== 1) return null;
182
+ const match = lines[0].match(/^\s*(\d+)\s+(\d+)\s+(\S+)\s+(.+?)\s*$/);
183
+ if (!match || Number(match[1]) !== expectedPid || !match[4]) return null;
184
+ return {
185
+ pid: Number(match[1]),
186
+ ppid: Number(match[2]),
187
+ state: match[3],
188
+ command: match[4],
189
+ };
190
+ }
191
+
192
+ function parsePsStartToken(output, expectedPid) {
193
+ const lines = String(output || "").split(/\r?\n/).filter((line) => line.trim());
194
+ if (lines.length !== 1) return null;
195
+ const match = lines[0].match(/^\s*(\d+)\s+(.+?)\s*$/);
196
+ if (!match || Number(match[1]) !== expectedPid || !match[2]) return null;
197
+ return match[2];
198
+ }
199
+
200
+ function defaultSyncSleep(ms) {
201
+ Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
202
+ }
203
+
204
+ function createMacOsProcessLifecycleDependencies(options = {}) {
205
+ const run = options.execFileSync || execFileSync;
206
+ const lsofPath = options.lsofPath || "/usr/sbin/lsof";
207
+ const psPath = options.psPath || "/bin/ps";
208
+ const processKill = options.processKill || process.kill.bind(process);
209
+ const sleep = options.sleep || defaultSyncSleep;
210
+ const timeoutMs = options.commandTimeoutMs ?? 5_000;
211
+ if (typeof run !== "function" || typeof processKill !== "function" || typeof sleep !== "function") {
212
+ throw lifecycleError("INVALID_INPUT", "Invalid macOS lifecycle dependency override.");
213
+ }
214
+ if (typeof lsofPath !== "string" || !lsofPath || typeof psPath !== "string" || !psPath) {
215
+ throw lifecycleError("INVALID_INPUT", "macOS lifecycle executable paths are required.");
216
+ }
217
+ normalizeWait(timeoutMs, "commandTimeoutMs", { allowZero: false });
218
+
219
+ const runOptions = {
220
+ encoding: "utf8",
221
+ stdio: ["ignore", "pipe", "ignore"],
222
+ timeout: timeoutMs,
223
+ windowsHide: true,
224
+ };
225
+
226
+ return {
227
+ listListenerPids(port) {
228
+ normalizePort(port);
229
+ let output;
230
+ try {
231
+ output = run(lsofPath, [
232
+ "-nP",
233
+ `-tiTCP:${port}`,
234
+ "-sTCP:LISTEN",
235
+ ], runOptions);
236
+ } catch (error) {
237
+ output = outputFromNoMatch(error);
238
+ if (output == null) throw error;
239
+ }
240
+ return parseListenerPidOutput(output);
241
+ },
242
+
243
+ readProcessIdentity(pid) {
244
+ if (!isValidPid(pid)) return null;
245
+ let detailsOutput;
246
+ let startOutput;
247
+ try {
248
+ detailsOutput = run(psPath, [
249
+ "-p",
250
+ String(pid),
251
+ "-o",
252
+ "pid=,ppid=,state=,command=",
253
+ ], runOptions);
254
+ } catch (error) {
255
+ detailsOutput = outputFromNoMatch(error);
256
+ if (detailsOutput == null) throw error;
257
+ }
258
+ const details = parsePsProcessDetails(detailsOutput, pid);
259
+ if (!details) return null;
260
+ try {
261
+ startOutput = run(psPath, [
262
+ "-p",
263
+ String(pid),
264
+ "-o",
265
+ "pid=,lstart=",
266
+ ], runOptions);
267
+ } catch (error) {
268
+ startOutput = outputFromNoMatch(error);
269
+ if (startOutput == null) throw error;
270
+ }
271
+ const startToken = parsePsStartToken(startOutput, pid);
272
+ return startToken == null ? null : { ...details, startToken };
273
+ },
274
+
275
+ readLsofMetadata(pid) {
276
+ if (!isValidPid(pid)) return "";
277
+ try {
278
+ return run(lsofPath, [
279
+ "-n",
280
+ "-P",
281
+ "-a",
282
+ "-p",
283
+ String(pid),
284
+ "-d",
285
+ "cwd",
286
+ "-F",
287
+ "pcn",
288
+ ], runOptions);
289
+ } catch (error) {
290
+ const output = outputFromNoMatch(error);
291
+ if (output == null) throw error;
292
+ return output;
293
+ }
294
+ },
295
+
296
+ sendSignal(pid, signal) {
297
+ processKill(pid, signal);
298
+ },
299
+
300
+ sleep,
301
+ };
302
+ }
303
+
304
+ function validStartToken(value) {
305
+ return (typeof value === "number" && Number.isFinite(value))
306
+ || (typeof value === "string" && value.length > 0 && !/[\0\r\n]/.test(value));
307
+ }
308
+
309
+ function requireDependencies(dependencies, names) {
310
+ if (!dependencies || typeof dependencies !== "object") {
311
+ throw lifecycleError("INVALID_INPUT", "Lifecycle dependencies are required.");
312
+ }
313
+ for (const name of names) {
314
+ if (typeof dependencies[name] !== "function") {
315
+ throw lifecycleError("INVALID_INPUT", `Lifecycle dependency ${name} is required.`);
316
+ }
317
+ }
318
+ }
319
+
320
+ function readOwnedMacOsOrphanIdentity(pid, globalRoot, dependencies) {
321
+ let processInfo;
322
+ let lsofOutput;
323
+ try {
324
+ processInfo = dependencies.readProcessIdentity(pid);
325
+ lsofOutput = dependencies.readLsofMetadata(pid);
326
+ } catch (error) {
327
+ throw lifecycleError(
328
+ "OWNERSHIP_UNPROVEN",
329
+ `Could not inspect listener PID ${pid}: ${error.message}`,
330
+ { pid, cause: error },
331
+ );
332
+ }
333
+
334
+ if (
335
+ !processInfo
336
+ || processInfo.pid !== pid
337
+ || processInfo.ppid !== 1
338
+ || typeof processInfo.state !== "string"
339
+ || processInfo.state.length === 0
340
+ || processInfo.state.startsWith("Z")
341
+ || !isExactNextServerCommand(processInfo.command)
342
+ || !validStartToken(processInfo.startToken)
343
+ ) {
344
+ throw lifecycleError(
345
+ "OWNERSHIP_UNPROVEN",
346
+ `Listener PID ${pid} is not an exact orphaned ZevaiRouter next-server process.`,
347
+ { pid },
348
+ );
349
+ }
350
+
351
+ const metadata = parseMacOsLsofCwdMetadata(lsofOutput, pid);
352
+ if (!metadata || !isAllowedMacOsRouterCwd(metadata.cwd, globalRoot)) {
353
+ throw lifecycleError(
354
+ "OWNERSHIP_UNPROVEN",
355
+ `Listener PID ${pid} does not have an exact ZevaiRouter runtime working directory.`,
356
+ { pid },
357
+ );
358
+ }
359
+
360
+ return Object.freeze({
361
+ pid,
362
+ ppid: processInfo.ppid,
363
+ command: processInfo.command,
364
+ startToken: processInfo.startToken,
365
+ lsofCommand: metadata.command,
366
+ cwd: metadata.cwd,
367
+ });
368
+ }
369
+
370
+ function resolveOwnedMacOsOrphanListeners(options = {}) {
371
+ const { globalRoot, dependencies } = options;
372
+ requireDependencies(dependencies, ["readProcessIdentity", "readLsofMetadata"]);
373
+ if (!canonicalAbsolutePosixPath(globalRoot) || globalRoot === "/") {
374
+ throw lifecycleError("INVALID_INPUT", "globalRoot must be a canonical absolute path.");
375
+ }
376
+
377
+ const listenerPids = normalizeListenerPids(options.listenerPids || []);
378
+ return listenerPids.map((pid) => (
379
+ readOwnedMacOsOrphanIdentity(pid, globalRoot, dependencies)
380
+ ));
381
+ }
382
+
383
+ function sameIdentity(left, right) {
384
+ return Boolean(left && right)
385
+ && left.pid === right.pid
386
+ && left.ppid === right.ppid
387
+ && left.command === right.command
388
+ && Object.is(left.startToken, right.startToken)
389
+ && left.lsofCommand === right.lsofCommand
390
+ && left.cwd === right.cwd;
391
+ }
392
+
393
+ function enumerateListenerPids(port, dependencies) {
394
+ try {
395
+ return normalizeListenerPids(dependencies.listListenerPids(port));
396
+ } catch (error) {
397
+ if (error instanceof RouterProcessLifecycleError) throw error;
398
+ throw lifecycleError(
399
+ "LISTENER_ENUMERATION_FAILED",
400
+ `Could not enumerate listeners on port ${port}: ${error.message}`,
401
+ { port, cause: error },
402
+ );
403
+ }
404
+ }
405
+
406
+ function assertKnownListenerSubset(currentPids, capturedByPid, port) {
407
+ const unknownPids = currentPids.filter((pid) => !capturedByPid.has(pid));
408
+ if (unknownPids.length > 0) {
409
+ throw lifecycleError(
410
+ "LISTENER_SET_CHANGED",
411
+ `Port ${port} gained an unverified listener; no further process was signaled.`,
412
+ { port, unknownPids },
413
+ );
414
+ }
415
+ }
416
+
417
+ function revalidateCapturedListeners(pids, capturedByPid, globalRoot, dependencies) {
418
+ const refreshed = pids.map((pid) => (
419
+ readOwnedMacOsOrphanIdentity(pid, globalRoot, dependencies)
420
+ ));
421
+ for (const identity of refreshed) {
422
+ if (!sameIdentity(capturedByPid.get(identity.pid), identity)) {
423
+ throw lifecycleError(
424
+ "PROCESS_IDENTITY_CHANGED",
425
+ `Listener PID ${identity.pid} changed identity before signaling.`,
426
+ { pid: identity.pid },
427
+ );
428
+ }
429
+ }
430
+ }
431
+
432
+ function remainingCapturedProcessPids(pids, capturedByPid, dependencies) {
433
+ const remaining = [];
434
+ for (const pid of pids) {
435
+ let processInfo;
436
+ try {
437
+ processInfo = dependencies.readProcessIdentity(pid);
438
+ } catch (error) {
439
+ throw lifecycleError(
440
+ "OWNERSHIP_UNPROVEN",
441
+ `Could not inspect captured PID ${pid}: ${error.message}`,
442
+ { pid, cause: error },
443
+ );
444
+ }
445
+ if (!processInfo || String(processInfo.state || "").startsWith("Z")) continue;
446
+ const captured = capturedByPid.get(pid);
447
+ if (
448
+ !captured
449
+ || processInfo.pid !== captured.pid
450
+ || processInfo.ppid !== captured.ppid
451
+ || processInfo.command !== captured.command
452
+ || !Object.is(processInfo.startToken, captured.startToken)
453
+ ) {
454
+ throw lifecycleError(
455
+ "PROCESS_IDENTITY_CHANGED",
456
+ `Captured PID ${pid} changed identity while waiting for shutdown.`,
457
+ { pid },
458
+ );
459
+ }
460
+ remaining.push(pid);
461
+ }
462
+ return remaining;
463
+ }
464
+
465
+ function signalListeners(
466
+ pids,
467
+ signal,
468
+ port,
469
+ capturedByPid,
470
+ globalRoot,
471
+ dependencies,
472
+ { requireListener = true } = {},
473
+ ) {
474
+ const signaled = [];
475
+ for (const pid of pids) {
476
+ // A previous listener signal or a slow lsof call can create a PID-reuse
477
+ // window. Recheck membership, then identity, immediately before each kill.
478
+ const current = enumerateListenerPids(port, dependencies);
479
+ assertKnownListenerSubset(current, capturedByPid, port);
480
+ if (requireListener && !current.includes(pid)) continue;
481
+ revalidateCapturedListeners([pid], capturedByPid, globalRoot, dependencies);
482
+ try {
483
+ dependencies.sendSignal(pid, signal);
484
+ signaled.push(pid);
485
+ } catch (error) {
486
+ const current = enumerateListenerPids(port, dependencies);
487
+ assertKnownListenerSubset(current, capturedByPid, port);
488
+ if (current.includes(pid)) {
489
+ throw lifecycleError(
490
+ "SIGNAL_FAILED",
491
+ `Failed to send ${signal} to owned listener PID ${pid}: ${error.message}`,
492
+ { pid, signal, cause: error },
493
+ );
494
+ }
495
+ }
496
+ }
497
+ return signaled;
498
+ }
499
+
500
+ function waitForRelease({
501
+ port,
502
+ processPids,
503
+ timeoutMs,
504
+ pollIntervalMs,
505
+ capturedByPid,
506
+ dependencies,
507
+ }) {
508
+ let remainingMs = timeoutMs;
509
+ while (true) {
510
+ const listenerPids = enumerateListenerPids(port, dependencies);
511
+ assertKnownListenerSubset(listenerPids, capturedByPid, port);
512
+ const liveProcessPids = remainingCapturedProcessPids(
513
+ processPids,
514
+ capturedByPid,
515
+ dependencies,
516
+ );
517
+ if ((listenerPids.length === 0 && liveProcessPids.length === 0) || remainingMs === 0) {
518
+ return { listenerPids, processPids: liveProcessPids };
519
+ }
520
+ const delay = Math.min(pollIntervalMs, remainingMs);
521
+ dependencies.sleep(delay);
522
+ remainingMs -= delay;
523
+ }
524
+ }
525
+
526
+ function lifecycleResult(initialPids, termPids = [], killPids = []) {
527
+ return {
528
+ stopped: termPids.length > 0 || killPids.length > 0,
529
+ listenerPids: initialPids,
530
+ termSignaledPids: termPids,
531
+ killSignaledPids: killPids,
532
+ forced: killPids.length > 0,
533
+ };
534
+ }
535
+
536
+ function stopOwnedMacOsOrphanListeners(options = {}) {
537
+ const platform = options.platform ?? process.platform;
538
+ if (platform !== "darwin") {
539
+ throw lifecycleError(
540
+ "UNSUPPORTED_PLATFORM",
541
+ "Orphan next-server recovery is restricted to macOS.",
542
+ );
543
+ }
544
+
545
+ const port = normalizePort(options.port);
546
+ const globalRoot = options.globalRoot;
547
+ const termTimeoutMs = normalizeWait(
548
+ options.termTimeoutMs ?? DEFAULT_TERM_TIMEOUT_MS,
549
+ "termTimeoutMs",
550
+ );
551
+ const killTimeoutMs = normalizeWait(
552
+ options.killTimeoutMs ?? DEFAULT_KILL_TIMEOUT_MS,
553
+ "killTimeoutMs",
554
+ );
555
+ const pollIntervalMs = normalizeWait(
556
+ options.pollIntervalMs ?? DEFAULT_POLL_INTERVAL_MS,
557
+ "pollIntervalMs",
558
+ { allowZero: false },
559
+ );
560
+ const { dependencies } = options;
561
+ requireDependencies(dependencies, [
562
+ "listListenerPids",
563
+ "readProcessIdentity",
564
+ "readLsofMetadata",
565
+ "sendSignal",
566
+ "sleep",
567
+ ]);
568
+
569
+ const initialPids = enumerateListenerPids(port, dependencies);
570
+ if (initialPids.length === 0) return lifecycleResult([]);
571
+
572
+ // Resolve every listener before signaling any of them. A mixed listener set
573
+ // therefore fails atomically without touching even the verified processes.
574
+ const captured = resolveOwnedMacOsOrphanListeners({
575
+ listenerPids: initialPids,
576
+ globalRoot,
577
+ dependencies,
578
+ });
579
+ const capturedByPid = new Map(captured.map((identity) => [identity.pid, identity]));
580
+
581
+ revalidateCapturedListeners(initialPids, capturedByPid, globalRoot, dependencies);
582
+ const beforeTerm = enumerateListenerPids(port, dependencies);
583
+ assertKnownListenerSubset(beforeTerm, capturedByPid, port);
584
+ const beforeTermProcesses = remainingCapturedProcessPids(
585
+ initialPids,
586
+ capturedByPid,
587
+ dependencies,
588
+ );
589
+ if (beforeTerm.length === 0 && beforeTermProcesses.length === 0) {
590
+ return lifecycleResult(initialPids);
591
+ }
592
+
593
+ const termSignaledPids = signalListeners(
594
+ beforeTermProcesses,
595
+ "SIGTERM",
596
+ port,
597
+ capturedByPid,
598
+ globalRoot,
599
+ dependencies,
600
+ { requireListener: false },
601
+ );
602
+ let remaining = waitForRelease({
603
+ port,
604
+ processPids: initialPids,
605
+ timeoutMs: termTimeoutMs,
606
+ pollIntervalMs,
607
+ capturedByPid,
608
+ dependencies,
609
+ });
610
+ if (remaining.listenerPids.length === 0 && remaining.processPids.length === 0) {
611
+ const confirmed = enumerateListenerPids(port, dependencies);
612
+ if (confirmed.length !== 0) assertKnownListenerSubset(confirmed, capturedByPid, port);
613
+ if (confirmed.length !== 0) {
614
+ throw lifecycleError(
615
+ "PORT_STILL_OCCUPIED",
616
+ `Port ${port} was reclaimed before release could be confirmed.`,
617
+ { port, listenerPids: confirmed },
618
+ );
619
+ }
620
+ return lifecycleResult(initialPids, termSignaledPids);
621
+ }
622
+
623
+ revalidateCapturedListeners(remaining.processPids, capturedByPid, globalRoot, dependencies);
624
+ const beforeKill = enumerateListenerPids(port, dependencies);
625
+ assertKnownListenerSubset(beforeKill, capturedByPid, port);
626
+ const beforeKillProcesses = remainingCapturedProcessPids(
627
+ remaining.processPids,
628
+ capturedByPid,
629
+ dependencies,
630
+ );
631
+ if (beforeKill.length === 0 && beforeKillProcesses.length === 0) {
632
+ return lifecycleResult(initialPids, termSignaledPids);
633
+ }
634
+
635
+ const killSignaledPids = signalListeners(
636
+ beforeKillProcesses,
637
+ "SIGKILL",
638
+ port,
639
+ capturedByPid,
640
+ globalRoot,
641
+ dependencies,
642
+ { requireListener: false },
643
+ );
644
+ remaining = waitForRelease({
645
+ port,
646
+ processPids: beforeKillProcesses,
647
+ timeoutMs: killTimeoutMs,
648
+ pollIntervalMs,
649
+ capturedByPid,
650
+ dependencies,
651
+ });
652
+ if (remaining.listenerPids.length !== 0 || remaining.processPids.length !== 0) {
653
+ throw lifecycleError(
654
+ "PORT_STILL_OCCUPIED",
655
+ `Owned next-server processes did not fully release port ${port}.`,
656
+ {
657
+ port,
658
+ listenerPids: remaining.listenerPids,
659
+ processPids: remaining.processPids,
660
+ },
661
+ );
662
+ }
663
+
664
+ const confirmed = enumerateListenerPids(port, dependencies);
665
+ if (confirmed.length !== 0) {
666
+ assertKnownListenerSubset(confirmed, capturedByPid, port);
667
+ throw lifecycleError(
668
+ "PORT_STILL_OCCUPIED",
669
+ `Port ${port} was reclaimed before release could be confirmed.`,
670
+ { port, listenerPids: confirmed },
671
+ );
672
+ }
673
+ return lifecycleResult(initialPids, termSignaledPids, killSignaledPids);
674
+ }
675
+
676
+ module.exports = {
677
+ RouterProcessLifecycleError,
678
+ createMacOsProcessLifecycleDependencies,
679
+ isAllowedMacOsRouterCwd,
680
+ isExactNextServerCommand,
681
+ parseLinuxProcStatStartToken,
682
+ parseMacOsLsofCwdMetadata,
683
+ resolveOwnedMacOsOrphanListeners,
684
+ stopOwnedMacOsOrphanListeners,
685
+ };