vibeman 0.0.13 → 0.0.14

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 (315) hide show
  1. package/dist/api.js +483 -11
  2. package/dist/commit.txt +1 -1
  3. package/dist/index.js +1 -0
  4. package/dist/node_modules/node-pty/LICENSE +69 -0
  5. package/dist/node_modules/node-pty/README.md +165 -0
  6. package/dist/node_modules/node-pty/binding.gyp +111 -0
  7. package/dist/node_modules/node-pty/deps/.editorconfig +2 -0
  8. package/dist/node_modules/node-pty/deps/winpty/.drone.yml +17 -0
  9. package/dist/node_modules/node-pty/deps/winpty/.gitattributes +19 -0
  10. package/dist/node_modules/node-pty/deps/winpty/LICENSE +21 -0
  11. package/dist/node_modules/node-pty/deps/winpty/Makefile +166 -0
  12. package/dist/node_modules/node-pty/deps/winpty/README.md +151 -0
  13. package/dist/node_modules/node-pty/deps/winpty/RELEASES.md +280 -0
  14. package/dist/node_modules/node-pty/deps/winpty/VERSION.txt +1 -0
  15. package/dist/node_modules/node-pty/deps/winpty/configure +167 -0
  16. package/dist/node_modules/node-pty/deps/winpty/misc/BufferResizeTests.cc +90 -0
  17. package/dist/node_modules/node-pty/deps/winpty/misc/ChangeScreenBuffer.cc +53 -0
  18. package/dist/node_modules/node-pty/deps/winpty/misc/ClearConsole.cc +72 -0
  19. package/dist/node_modules/node-pty/deps/winpty/misc/ConinMode.cc +117 -0
  20. package/dist/node_modules/node-pty/deps/winpty/misc/ConinMode.ps1 +116 -0
  21. package/dist/node_modules/node-pty/deps/winpty/misc/ConoutMode.cc +113 -0
  22. package/dist/node_modules/node-pty/deps/winpty/misc/DebugClient.py +42 -0
  23. package/dist/node_modules/node-pty/deps/winpty/misc/DebugServer.py +63 -0
  24. package/dist/node_modules/node-pty/deps/winpty/misc/DumpLines.py +5 -0
  25. package/dist/node_modules/node-pty/deps/winpty/misc/EnableExtendedFlags.txt +46 -0
  26. package/dist/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/CP437-Consolas.txt +528 -0
  27. package/dist/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/CP437-Lucida.txt +633 -0
  28. package/dist/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/CP932.txt +630 -0
  29. package/dist/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/CP936.txt +630 -0
  30. package/dist/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/CP949.txt +630 -0
  31. package/dist/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/CP950.txt +630 -0
  32. package/dist/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/MinimumWindowWidths.txt +16 -0
  33. package/dist/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/Results.txt +4 -0
  34. package/dist/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/Windows10SetFontBugginess.txt +144 -0
  35. package/dist/node_modules/node-pty/deps/winpty/misc/FontSurvey.cc +100 -0
  36. package/dist/node_modules/node-pty/deps/winpty/misc/FormatChar.h +21 -0
  37. package/dist/node_modules/node-pty/deps/winpty/misc/FreezePerfTest.cc +62 -0
  38. package/dist/node_modules/node-pty/deps/winpty/misc/GetCh.cc +20 -0
  39. package/dist/node_modules/node-pty/deps/winpty/misc/GetConsolePos.cc +41 -0
  40. package/dist/node_modules/node-pty/deps/winpty/misc/GetFont.cc +261 -0
  41. package/dist/node_modules/node-pty/deps/winpty/misc/IdentifyConsoleWindow.ps1 +51 -0
  42. package/dist/node_modules/node-pty/deps/winpty/misc/IsNewConsole.cc +87 -0
  43. package/dist/node_modules/node-pty/deps/winpty/misc/MouseInputNotes.txt +90 -0
  44. package/dist/node_modules/node-pty/deps/winpty/misc/MoveConsoleWindow.cc +34 -0
  45. package/dist/node_modules/node-pty/deps/winpty/misc/Notes.txt +219 -0
  46. package/dist/node_modules/node-pty/deps/winpty/misc/OSVersion.cc +27 -0
  47. package/dist/node_modules/node-pty/deps/winpty/misc/ScreenBufferFreezeInactive.cc +101 -0
  48. package/dist/node_modules/node-pty/deps/winpty/misc/ScreenBufferTest.cc +671 -0
  49. package/dist/node_modules/node-pty/deps/winpty/misc/ScreenBufferTest2.cc +151 -0
  50. package/dist/node_modules/node-pty/deps/winpty/misc/SelectAllTest.cc +45 -0
  51. package/dist/node_modules/node-pty/deps/winpty/misc/SetBufferSize.cc +32 -0
  52. package/dist/node_modules/node-pty/deps/winpty/misc/SetCursorPos.cc +10 -0
  53. package/dist/node_modules/node-pty/deps/winpty/misc/SetFont.cc +145 -0
  54. package/dist/node_modules/node-pty/deps/winpty/misc/SetWindowRect.cc +36 -0
  55. package/dist/node_modules/node-pty/deps/winpty/misc/ShowArgv.cc +12 -0
  56. package/dist/node_modules/node-pty/deps/winpty/misc/ShowConsoleInput.cc +40 -0
  57. package/dist/node_modules/node-pty/deps/winpty/misc/Spew.py +5 -0
  58. package/dist/node_modules/node-pty/deps/winpty/misc/TestUtil.cc +172 -0
  59. package/dist/node_modules/node-pty/deps/winpty/misc/UnicodeDoubleWidthTest.cc +102 -0
  60. package/dist/node_modules/node-pty/deps/winpty/misc/UnicodeWideTest1.cc +246 -0
  61. package/dist/node_modules/node-pty/deps/winpty/misc/UnicodeWideTest2.cc +130 -0
  62. package/dist/node_modules/node-pty/deps/winpty/misc/UnixEcho.cc +89 -0
  63. package/dist/node_modules/node-pty/deps/winpty/misc/Utf16Echo.cc +46 -0
  64. package/dist/node_modules/node-pty/deps/winpty/misc/VeryLargeRead.cc +122 -0
  65. package/dist/node_modules/node-pty/deps/winpty/misc/VkEscapeTest.cc +56 -0
  66. package/dist/node_modules/node-pty/deps/winpty/misc/Win10ResizeWhileFrozen.cc +52 -0
  67. package/dist/node_modules/node-pty/deps/winpty/misc/Win10WrapTest1.cc +57 -0
  68. package/dist/node_modules/node-pty/deps/winpty/misc/Win10WrapTest2.cc +30 -0
  69. package/dist/node_modules/node-pty/deps/winpty/misc/Win32Echo1.cc +26 -0
  70. package/dist/node_modules/node-pty/deps/winpty/misc/Win32Echo2.cc +19 -0
  71. package/dist/node_modules/node-pty/deps/winpty/misc/Win32Test1.cc +46 -0
  72. package/dist/node_modules/node-pty/deps/winpty/misc/Win32Test2.cc +70 -0
  73. package/dist/node_modules/node-pty/deps/winpty/misc/Win32Test3.cc +78 -0
  74. package/dist/node_modules/node-pty/deps/winpty/misc/Win32Write1.cc +44 -0
  75. package/dist/node_modules/node-pty/deps/winpty/misc/WindowsBugCrashReader.cc +27 -0
  76. package/dist/node_modules/node-pty/deps/winpty/misc/WriteConsole.cc +106 -0
  77. package/dist/node_modules/node-pty/deps/winpty/misc/build32.sh +9 -0
  78. package/dist/node_modules/node-pty/deps/winpty/misc/build64.sh +9 -0
  79. package/dist/node_modules/node-pty/deps/winpty/misc/color-test.sh +212 -0
  80. package/dist/node_modules/node-pty/deps/winpty/misc/font-notes.txt +300 -0
  81. package/dist/node_modules/node-pty/deps/winpty/misc/winbug-15048.cc +201 -0
  82. package/dist/node_modules/node-pty/deps/winpty/ship/build-pty4j-libpty.bat +36 -0
  83. package/dist/node_modules/node-pty/deps/winpty/ship/common_ship.py +53 -0
  84. package/dist/node_modules/node-pty/deps/winpty/ship/make_msvc_package.py +165 -0
  85. package/dist/node_modules/node-pty/deps/winpty/ship/ship.py +108 -0
  86. package/dist/node_modules/node-pty/deps/winpty/src/agent/Agent.cc +613 -0
  87. package/dist/node_modules/node-pty/deps/winpty/src/agent/Agent.h +103 -0
  88. package/dist/node_modules/node-pty/deps/winpty/src/agent/AgentCreateDesktop.cc +84 -0
  89. package/dist/node_modules/node-pty/deps/winpty/src/agent/AgentCreateDesktop.h +28 -0
  90. package/dist/node_modules/node-pty/deps/winpty/src/agent/ConsoleFont.cc +632 -0
  91. package/dist/node_modules/node-pty/deps/winpty/src/agent/ConsoleFont.h +28 -0
  92. package/dist/node_modules/node-pty/deps/winpty/src/agent/ConsoleInput.cc +852 -0
  93. package/dist/node_modules/node-pty/deps/winpty/src/agent/ConsoleInput.h +109 -0
  94. package/dist/node_modules/node-pty/deps/winpty/src/agent/ConsoleInputReencoding.cc +121 -0
  95. package/dist/node_modules/node-pty/deps/winpty/src/agent/ConsoleInputReencoding.h +36 -0
  96. package/dist/node_modules/node-pty/deps/winpty/src/agent/ConsoleLine.cc +152 -0
  97. package/dist/node_modules/node-pty/deps/winpty/src/agent/ConsoleLine.h +41 -0
  98. package/dist/node_modules/node-pty/deps/winpty/src/agent/Coord.h +87 -0
  99. package/dist/node_modules/node-pty/deps/winpty/src/agent/DebugShowInput.cc +239 -0
  100. package/dist/node_modules/node-pty/deps/winpty/src/agent/DebugShowInput.h +32 -0
  101. package/dist/node_modules/node-pty/deps/winpty/src/agent/DefaultInputMap.cc +422 -0
  102. package/dist/node_modules/node-pty/deps/winpty/src/agent/DefaultInputMap.h +28 -0
  103. package/dist/node_modules/node-pty/deps/winpty/src/agent/DsrSender.h +30 -0
  104. package/dist/node_modules/node-pty/deps/winpty/src/agent/EventLoop.cc +99 -0
  105. package/dist/node_modules/node-pty/deps/winpty/src/agent/EventLoop.h +47 -0
  106. package/dist/node_modules/node-pty/deps/winpty/src/agent/InputMap.cc +246 -0
  107. package/dist/node_modules/node-pty/deps/winpty/src/agent/InputMap.h +114 -0
  108. package/dist/node_modules/node-pty/deps/winpty/src/agent/LargeConsoleRead.cc +71 -0
  109. package/dist/node_modules/node-pty/deps/winpty/src/agent/LargeConsoleRead.h +68 -0
  110. package/dist/node_modules/node-pty/deps/winpty/src/agent/NamedPipe.cc +378 -0
  111. package/dist/node_modules/node-pty/deps/winpty/src/agent/NamedPipe.h +125 -0
  112. package/dist/node_modules/node-pty/deps/winpty/src/agent/Scraper.cc +699 -0
  113. package/dist/node_modules/node-pty/deps/winpty/src/agent/Scraper.h +103 -0
  114. package/dist/node_modules/node-pty/deps/winpty/src/agent/SimplePool.h +75 -0
  115. package/dist/node_modules/node-pty/deps/winpty/src/agent/SmallRect.h +143 -0
  116. package/dist/node_modules/node-pty/deps/winpty/src/agent/Terminal.cc +535 -0
  117. package/dist/node_modules/node-pty/deps/winpty/src/agent/Terminal.h +69 -0
  118. package/dist/node_modules/node-pty/deps/winpty/src/agent/UnicodeEncoding.h +157 -0
  119. package/dist/node_modules/node-pty/deps/winpty/src/agent/UnicodeEncodingTest.cc +189 -0
  120. package/dist/node_modules/node-pty/deps/winpty/src/agent/Win32Console.cc +107 -0
  121. package/dist/node_modules/node-pty/deps/winpty/src/agent/Win32Console.h +67 -0
  122. package/dist/node_modules/node-pty/deps/winpty/src/agent/Win32ConsoleBuffer.cc +193 -0
  123. package/dist/node_modules/node-pty/deps/winpty/src/agent/Win32ConsoleBuffer.h +99 -0
  124. package/dist/node_modules/node-pty/deps/winpty/src/agent/main.cc +114 -0
  125. package/dist/node_modules/node-pty/deps/winpty/src/agent/subdir.mk +61 -0
  126. package/dist/node_modules/node-pty/deps/winpty/src/configurations.gypi +60 -0
  127. package/dist/node_modules/node-pty/deps/winpty/src/debugserver/DebugServer.cc +117 -0
  128. package/dist/node_modules/node-pty/deps/winpty/src/debugserver/subdir.mk +41 -0
  129. package/dist/node_modules/node-pty/deps/winpty/src/include/winpty.h +242 -0
  130. package/dist/node_modules/node-pty/deps/winpty/src/include/winpty_constants.h +131 -0
  131. package/dist/node_modules/node-pty/deps/winpty/src/libwinpty/AgentLocation.cc +75 -0
  132. package/dist/node_modules/node-pty/deps/winpty/src/libwinpty/AgentLocation.h +28 -0
  133. package/dist/node_modules/node-pty/deps/winpty/src/libwinpty/LibWinptyException.h +54 -0
  134. package/dist/node_modules/node-pty/deps/winpty/src/libwinpty/WinptyInternal.h +72 -0
  135. package/dist/node_modules/node-pty/deps/winpty/src/libwinpty/subdir.mk +46 -0
  136. package/dist/node_modules/node-pty/deps/winpty/src/libwinpty/winpty.cc +970 -0
  137. package/dist/node_modules/node-pty/deps/winpty/src/shared/AgentMsg.h +38 -0
  138. package/dist/node_modules/node-pty/deps/winpty/src/shared/BackgroundDesktop.cc +122 -0
  139. package/dist/node_modules/node-pty/deps/winpty/src/shared/BackgroundDesktop.h +73 -0
  140. package/dist/node_modules/node-pty/deps/winpty/src/shared/Buffer.cc +103 -0
  141. package/dist/node_modules/node-pty/deps/winpty/src/shared/Buffer.h +102 -0
  142. package/dist/node_modules/node-pty/deps/winpty/src/shared/DebugClient.cc +187 -0
  143. package/dist/node_modules/node-pty/deps/winpty/src/shared/DebugClient.h +38 -0
  144. package/dist/node_modules/node-pty/deps/winpty/src/shared/GenRandom.cc +138 -0
  145. package/dist/node_modules/node-pty/deps/winpty/src/shared/GenRandom.h +55 -0
  146. package/dist/node_modules/node-pty/deps/winpty/src/shared/GetCommitHash.bat +13 -0
  147. package/dist/node_modules/node-pty/deps/winpty/src/shared/Mutex.h +54 -0
  148. package/dist/node_modules/node-pty/deps/winpty/src/shared/OsModule.h +63 -0
  149. package/dist/node_modules/node-pty/deps/winpty/src/shared/OwnedHandle.cc +36 -0
  150. package/dist/node_modules/node-pty/deps/winpty/src/shared/OwnedHandle.h +45 -0
  151. package/dist/node_modules/node-pty/deps/winpty/src/shared/PrecompiledHeader.h +43 -0
  152. package/dist/node_modules/node-pty/deps/winpty/src/shared/StringBuilder.h +227 -0
  153. package/dist/node_modules/node-pty/deps/winpty/src/shared/StringBuilderTest.cc +114 -0
  154. package/dist/node_modules/node-pty/deps/winpty/src/shared/StringUtil.cc +55 -0
  155. package/dist/node_modules/node-pty/deps/winpty/src/shared/StringUtil.h +80 -0
  156. package/dist/node_modules/node-pty/deps/winpty/src/shared/TimeMeasurement.h +63 -0
  157. package/dist/node_modules/node-pty/deps/winpty/src/shared/UnixCtrlChars.h +45 -0
  158. package/dist/node_modules/node-pty/deps/winpty/src/shared/UpdateGenVersion.bat +20 -0
  159. package/dist/node_modules/node-pty/deps/winpty/src/shared/WindowsSecurity.cc +460 -0
  160. package/dist/node_modules/node-pty/deps/winpty/src/shared/WindowsSecurity.h +104 -0
  161. package/dist/node_modules/node-pty/deps/winpty/src/shared/WindowsVersion.cc +252 -0
  162. package/dist/node_modules/node-pty/deps/winpty/src/shared/WindowsVersion.h +29 -0
  163. package/dist/node_modules/node-pty/deps/winpty/src/shared/WinptyAssert.cc +55 -0
  164. package/dist/node_modules/node-pty/deps/winpty/src/shared/WinptyAssert.h +64 -0
  165. package/dist/node_modules/node-pty/deps/winpty/src/shared/WinptyException.cc +57 -0
  166. package/dist/node_modules/node-pty/deps/winpty/src/shared/WinptyException.h +43 -0
  167. package/dist/node_modules/node-pty/deps/winpty/src/shared/WinptyVersion.cc +42 -0
  168. package/dist/node_modules/node-pty/deps/winpty/src/shared/WinptyVersion.h +27 -0
  169. package/dist/node_modules/node-pty/deps/winpty/src/shared/winpty_snprintf.h +99 -0
  170. package/dist/node_modules/node-pty/deps/winpty/src/subdir.mk +5 -0
  171. package/dist/node_modules/node-pty/deps/winpty/src/tests/subdir.mk +28 -0
  172. package/dist/node_modules/node-pty/deps/winpty/src/tests/trivial_test.cc +158 -0
  173. package/dist/node_modules/node-pty/deps/winpty/src/unix-adapter/InputHandler.cc +114 -0
  174. package/dist/node_modules/node-pty/deps/winpty/src/unix-adapter/InputHandler.h +56 -0
  175. package/dist/node_modules/node-pty/deps/winpty/src/unix-adapter/OutputHandler.cc +80 -0
  176. package/dist/node_modules/node-pty/deps/winpty/src/unix-adapter/OutputHandler.h +53 -0
  177. package/dist/node_modules/node-pty/deps/winpty/src/unix-adapter/Util.cc +86 -0
  178. package/dist/node_modules/node-pty/deps/winpty/src/unix-adapter/Util.h +31 -0
  179. package/dist/node_modules/node-pty/deps/winpty/src/unix-adapter/WakeupFd.cc +70 -0
  180. package/dist/node_modules/node-pty/deps/winpty/src/unix-adapter/WakeupFd.h +42 -0
  181. package/dist/node_modules/node-pty/deps/winpty/src/unix-adapter/main.cc +729 -0
  182. package/dist/node_modules/node-pty/deps/winpty/src/unix-adapter/subdir.mk +41 -0
  183. package/dist/node_modules/node-pty/deps/winpty/src/winpty.gyp +234 -0
  184. package/dist/node_modules/node-pty/deps/winpty/vcbuild.bat +83 -0
  185. package/dist/node_modules/node-pty/lib/conpty_console_list_agent.js +16 -0
  186. package/dist/node_modules/node-pty/lib/conpty_console_list_agent.js.map +1 -0
  187. package/dist/node_modules/node-pty/lib/eventEmitter2.js +47 -0
  188. package/dist/node_modules/node-pty/lib/eventEmitter2.js.map +1 -0
  189. package/dist/node_modules/node-pty/lib/eventEmitter2.test.js +30 -0
  190. package/dist/node_modules/node-pty/lib/eventEmitter2.test.js.map +1 -0
  191. package/dist/node_modules/node-pty/lib/index.js +52 -0
  192. package/dist/node_modules/node-pty/lib/index.js.map +1 -0
  193. package/dist/node_modules/node-pty/lib/interfaces.js +7 -0
  194. package/dist/node_modules/node-pty/lib/interfaces.js.map +1 -0
  195. package/dist/node_modules/node-pty/lib/shared/conout.js +11 -0
  196. package/dist/node_modules/node-pty/lib/shared/conout.js.map +1 -0
  197. package/dist/node_modules/node-pty/lib/terminal.js +190 -0
  198. package/dist/node_modules/node-pty/lib/terminal.js.map +1 -0
  199. package/dist/node_modules/node-pty/lib/terminal.test.js +139 -0
  200. package/dist/node_modules/node-pty/lib/terminal.test.js.map +1 -0
  201. package/dist/node_modules/node-pty/lib/testUtils.test.js +28 -0
  202. package/dist/node_modules/node-pty/lib/testUtils.test.js.map +1 -0
  203. package/dist/node_modules/node-pty/lib/types.js +7 -0
  204. package/dist/node_modules/node-pty/lib/types.js.map +1 -0
  205. package/dist/node_modules/node-pty/lib/unixTerminal.js +346 -0
  206. package/dist/node_modules/node-pty/lib/unixTerminal.js.map +1 -0
  207. package/dist/node_modules/node-pty/lib/unixTerminal.test.js +351 -0
  208. package/dist/node_modules/node-pty/lib/unixTerminal.test.js.map +1 -0
  209. package/dist/node_modules/node-pty/lib/utils.js +39 -0
  210. package/dist/node_modules/node-pty/lib/utils.js.map +1 -0
  211. package/dist/node_modules/node-pty/lib/windowsConoutConnection.js +125 -0
  212. package/dist/node_modules/node-pty/lib/windowsConoutConnection.js.map +1 -0
  213. package/dist/node_modules/node-pty/lib/windowsPtyAgent.js +320 -0
  214. package/dist/node_modules/node-pty/lib/windowsPtyAgent.js.map +1 -0
  215. package/dist/node_modules/node-pty/lib/windowsPtyAgent.test.js +90 -0
  216. package/dist/node_modules/node-pty/lib/windowsPtyAgent.test.js.map +1 -0
  217. package/dist/node_modules/node-pty/lib/windowsTerminal.js +199 -0
  218. package/dist/node_modules/node-pty/lib/windowsTerminal.js.map +1 -0
  219. package/dist/node_modules/node-pty/lib/windowsTerminal.test.js +219 -0
  220. package/dist/node_modules/node-pty/lib/windowsTerminal.test.js.map +1 -0
  221. package/dist/node_modules/node-pty/lib/worker/conoutSocketWorker.js +22 -0
  222. package/dist/node_modules/node-pty/lib/worker/conoutSocketWorker.js.map +1 -0
  223. package/dist/node_modules/node-pty/package.json +64 -0
  224. package/dist/node_modules/node-pty/prebuilds/darwin-arm64/pty.node +0 -0
  225. package/dist/node_modules/node-pty/prebuilds/darwin-arm64/spawn-helper +0 -0
  226. package/dist/node_modules/node-pty/prebuilds/darwin-x64/pty.node +0 -0
  227. package/dist/node_modules/node-pty/prebuilds/darwin-x64/spawn-helper +0 -0
  228. package/dist/node_modules/node-pty/prebuilds/win32-arm64/conpty/OpenConsole.exe +0 -0
  229. package/dist/node_modules/node-pty/prebuilds/win32-arm64/conpty/conpty.dll +0 -0
  230. package/dist/node_modules/node-pty/prebuilds/win32-arm64/conpty.node +0 -0
  231. package/dist/node_modules/node-pty/prebuilds/win32-arm64/conpty.pdb +0 -0
  232. package/dist/node_modules/node-pty/prebuilds/win32-arm64/conpty_console_list.node +0 -0
  233. package/dist/node_modules/node-pty/prebuilds/win32-arm64/conpty_console_list.pdb +0 -0
  234. package/dist/node_modules/node-pty/prebuilds/win32-arm64/pty.node +0 -0
  235. package/dist/node_modules/node-pty/prebuilds/win32-arm64/pty.pdb +0 -0
  236. package/dist/node_modules/node-pty/prebuilds/win32-arm64/winpty-agent.exe +0 -0
  237. package/dist/node_modules/node-pty/prebuilds/win32-arm64/winpty-agent.pdb +0 -0
  238. package/dist/node_modules/node-pty/prebuilds/win32-arm64/winpty.dll +0 -0
  239. package/dist/node_modules/node-pty/prebuilds/win32-arm64/winpty.pdb +0 -0
  240. package/dist/node_modules/node-pty/prebuilds/win32-x64/conpty/OpenConsole.exe +0 -0
  241. package/dist/node_modules/node-pty/prebuilds/win32-x64/conpty/conpty.dll +0 -0
  242. package/dist/node_modules/node-pty/prebuilds/win32-x64/conpty.node +0 -0
  243. package/dist/node_modules/node-pty/prebuilds/win32-x64/conpty.pdb +0 -0
  244. package/dist/node_modules/node-pty/prebuilds/win32-x64/conpty_console_list.node +0 -0
  245. package/dist/node_modules/node-pty/prebuilds/win32-x64/conpty_console_list.pdb +0 -0
  246. package/dist/node_modules/node-pty/prebuilds/win32-x64/pty.node +0 -0
  247. package/dist/node_modules/node-pty/prebuilds/win32-x64/pty.pdb +0 -0
  248. package/dist/node_modules/node-pty/prebuilds/win32-x64/winpty-agent.exe +0 -0
  249. package/dist/node_modules/node-pty/prebuilds/win32-x64/winpty-agent.pdb +0 -0
  250. package/dist/node_modules/node-pty/prebuilds/win32-x64/winpty.dll +0 -0
  251. package/dist/node_modules/node-pty/prebuilds/win32-x64/winpty.pdb +0 -0
  252. package/dist/node_modules/node-pty/scripts/gen-compile-commands.js +8 -0
  253. package/dist/node_modules/node-pty/scripts/increment-version.js +54 -0
  254. package/dist/node_modules/node-pty/scripts/post-install.js +80 -0
  255. package/dist/node_modules/node-pty/scripts/prebuild.js +34 -0
  256. package/dist/node_modules/node-pty/src/conpty_console_list_agent.ts +15 -0
  257. package/dist/node_modules/node-pty/src/eventEmitter2.test.ts +30 -0
  258. package/dist/node_modules/node-pty/src/eventEmitter2.ts +48 -0
  259. package/dist/node_modules/node-pty/src/index.ts +52 -0
  260. package/dist/node_modules/node-pty/src/interfaces.ts +130 -0
  261. package/dist/node_modules/node-pty/src/native.d.ts +54 -0
  262. package/dist/node_modules/node-pty/src/shared/conout.ts +15 -0
  263. package/dist/node_modules/node-pty/src/terminal.test.ts +119 -0
  264. package/dist/node_modules/node-pty/src/terminal.ts +211 -0
  265. package/dist/node_modules/node-pty/src/testUtils.test.ts +23 -0
  266. package/dist/node_modules/node-pty/src/tsconfig.json +22 -0
  267. package/dist/node_modules/node-pty/src/types.ts +15 -0
  268. package/dist/node_modules/node-pty/src/unix/pty.cc +799 -0
  269. package/dist/node_modules/node-pty/src/unix/spawn-helper.cc +23 -0
  270. package/dist/node_modules/node-pty/src/unixTerminal.test.ts +367 -0
  271. package/dist/node_modules/node-pty/src/unixTerminal.ts +388 -0
  272. package/dist/node_modules/node-pty/src/utils.ts +29 -0
  273. package/dist/node_modules/node-pty/src/win/conpty.cc +583 -0
  274. package/dist/node_modules/node-pty/src/win/conpty.h +41 -0
  275. package/dist/node_modules/node-pty/src/win/conpty_console_list.cc +44 -0
  276. package/dist/node_modules/node-pty/src/win/path_util.cc +95 -0
  277. package/dist/node_modules/node-pty/src/win/path_util.h +26 -0
  278. package/dist/node_modules/node-pty/src/win/winpty.cc +333 -0
  279. package/dist/node_modules/node-pty/src/windowsConoutConnection.ts +82 -0
  280. package/dist/node_modules/node-pty/src/windowsPtyAgent.test.ts +94 -0
  281. package/dist/node_modules/node-pty/src/windowsPtyAgent.ts +321 -0
  282. package/dist/node_modules/node-pty/src/windowsTerminal.test.ts +229 -0
  283. package/dist/node_modules/node-pty/src/windowsTerminal.ts +203 -0
  284. package/dist/node_modules/node-pty/src/worker/conoutSocketWorker.ts +22 -0
  285. package/dist/node_modules/node-pty/third_party/conpty/1.23.251008001/win10-arm64/OpenConsole.exe +0 -0
  286. package/dist/node_modules/node-pty/third_party/conpty/1.23.251008001/win10-arm64/conpty.dll +0 -0
  287. package/dist/node_modules/node-pty/third_party/conpty/1.23.251008001/win10-x64/OpenConsole.exe +0 -0
  288. package/dist/node_modules/node-pty/third_party/conpty/1.23.251008001/win10-x64/conpty.dll +0 -0
  289. package/dist/node_modules/node-pty/typings/node-pty.d.ts +211 -0
  290. package/dist/ui/assets/{index-C8FDQRxy.js → index-B65NvzF3.js} +192 -186
  291. package/dist/ui/assets/{index-BnaWildZ.js → index-B6f0IvI8.js} +1 -1
  292. package/dist/ui/assets/{index-C-AZWfRD.js → index-BCfnrf9x.js} +1 -1
  293. package/dist/ui/assets/{index-CuieGJbi.js → index-BHpxmbNr.js} +1 -1
  294. package/dist/ui/assets/{index-BrOS5hPg.js → index-BRbvQP4r.js} +1 -1
  295. package/dist/ui/assets/{index-Dhu8BZu7.js → index-BcFJG3pn.js} +1 -1
  296. package/dist/ui/assets/{index-AacKgcwz.js → index-Bepe4gRM.js} +1 -1
  297. package/dist/ui/assets/{index-B_lr0R8Z.js → index-BkA7So3L.js} +1 -1
  298. package/dist/ui/assets/{index-D_uhpUwJ.css → index-BlYNw2Nz.css} +1 -1
  299. package/dist/ui/assets/{index-BvHGNf4Y.js → index-BxqUzAmT.js} +1 -1
  300. package/dist/ui/assets/{index-BCRvuZjU.js → index-C86nRoc4.js} +1 -1
  301. package/dist/ui/assets/{index-D3gXfrX-.js → index-CUwqevMv.js} +1 -1
  302. package/dist/ui/assets/{index-Btdv65e_.js → index-ClTXL7da.js} +1 -1
  303. package/dist/ui/assets/{index-D1F9nIOz.js → index-CyH0t-7C.js} +1 -1
  304. package/dist/ui/assets/{index-DkFfIHJr.js → index-DQJMJ04n.js} +1 -1
  305. package/dist/ui/assets/{index-B-SoOQ3F.js → index-Dc4Up0Ir.js} +1 -1
  306. package/dist/ui/assets/{index-q7X3WW0-.js → index-DdwbXAJq.js} +1 -1
  307. package/dist/ui/assets/{index-CBQN5qXY.js → index-DfsBdEGr.js} +1 -1
  308. package/dist/ui/assets/{index-CWcSlUCR.js → index-GYxfKBT1.js} +1 -1
  309. package/dist/ui/assets/{index-DWT6BjYW.js → index-KwWhSMUi.js} +1 -1
  310. package/dist/ui/assets/{index-cS068OSU.js → index-R05wI85b.js} +1 -1
  311. package/dist/ui/assets/{index-o8f2ilDp.js → index-TlK-Z_4f.js} +1 -1
  312. package/dist/ui/assets/{index-BK62XAzY.js → index-iiYTe0B1.js} +1 -1
  313. package/dist/ui/assets/{index-CXV7fZxu.js → index-kh7xKB6N.js} +1 -1
  314. package/dist/ui/index.html +2 -2
  315. package/package.json +2 -2
package/dist/api.js CHANGED
@@ -44302,6 +44302,7 @@ var init_dist_layout = __esm(() => {
44302
44302
  prismaRoot: "prisma",
44303
44303
  prismaSchema: "prisma/schema.prisma",
44304
44304
  resourcesRoot: "resources",
44305
+ nodePtyPackageRoot: "node_modules/node-pty",
44305
44306
  scriptsRoot: "scripts",
44306
44307
  fixtureInitScript: "scripts/init-test-repo.mjs",
44307
44308
  fixtureSeedScript: "scripts/seed-test-fixtures.mjs",
@@ -123103,16 +123104,463 @@ function isAddressInUseError(error48) {
123103
123104
  var MIN_PORT = 1, MAX_PORT = 65535;
123104
123105
  var init_port_utils = () => {};
123105
123106
 
123107
+ // ../api/src/services/pty-session.ts
123108
+ import { chmodSync, statSync as statSync3 } from "node:fs";
123109
+ import { createRequire as createRequire3 } from "node:module";
123110
+ import { dirname as dirname6, join as join8 } from "node:path";
123111
+ import * as pty from "node-pty";
123112
+ import { randomUUID as randomUUID2 } from "node:crypto";
123113
+ import { fileURLToPath as fileURLToPath4 } from "node:url";
123114
+ function buildShellCandidates() {
123115
+ if (process.platform === "win32") {
123116
+ return ["powershell.exe", "pwsh.exe", "cmd.exe"];
123117
+ }
123118
+ const candidates = new Set;
123119
+ const configured = process.env.SHELL?.trim();
123120
+ if (configured) {
123121
+ candidates.add(configured);
123122
+ }
123123
+ for (const fallbackShell of NON_WINDOWS_FALLBACK_SHELLS) {
123124
+ try {
123125
+ const stats = statSync3(fallbackShell);
123126
+ if (stats.isFile()) {
123127
+ candidates.add(fallbackShell);
123128
+ }
123129
+ } catch {}
123130
+ }
123131
+ return Array.from(candidates);
123132
+ }
123133
+ function generateId() {
123134
+ return `pty_${randomUUID2()}`;
123135
+ }
123136
+ function ensureNodePtySpawnHelperExecutable() {
123137
+ if (process.platform !== "darwin")
123138
+ return;
123139
+ const helperCandidates = new Set;
123140
+ try {
123141
+ const packageJsonPath = require2.resolve("node-pty/package.json");
123142
+ helperCandidates.add(join8(dirname6(packageJsonPath), "prebuilds", `darwin-${process.arch}`, "spawn-helper"));
123143
+ } catch {}
123144
+ const bundledDistHelperPath = join8(dirname6(fileURLToPath4(import.meta.url)), "prebuilds", `darwin-${process.arch}`, "spawn-helper");
123145
+ helperCandidates.add(bundledDistHelperPath);
123146
+ for (const helperPath of helperCandidates) {
123147
+ try {
123148
+ const stats = statSync3(helperPath);
123149
+ if ((stats.mode & 73) !== 0) {
123150
+ return;
123151
+ }
123152
+ chmodSync(helperPath, stats.mode | 493);
123153
+ log.info({ helperPath }, "Restored execute bit on node-pty spawn-helper");
123154
+ return;
123155
+ } catch {}
123156
+ }
123157
+ log.warn({ helperPaths: Array.from(helperCandidates) }, "Failed to ensure node-pty spawn-helper is executable");
123158
+ }
123159
+ function createSession(options2) {
123160
+ const id = generateId();
123161
+ const cols = options2.cols ?? DEFAULT_COLS;
123162
+ const rows = options2.rows ?? DEFAULT_ROWS;
123163
+ const shellCandidates = buildShellCandidates();
123164
+ const env = {
123165
+ ...process.env,
123166
+ TERM: "xterm-256color",
123167
+ COLORTERM: "truecolor",
123168
+ VIBEMAN_TERMINAL: options2.scope
123169
+ };
123170
+ ensureNodePtySpawnHelperExecutable();
123171
+ let proc = null;
123172
+ let resolvedShell = "";
123173
+ let lastError;
123174
+ for (const shell of shellCandidates) {
123175
+ try {
123176
+ proc = pty.spawn(shell, [], {
123177
+ name: "xterm-256color",
123178
+ cols,
123179
+ rows,
123180
+ cwd: options2.cwd,
123181
+ env
123182
+ });
123183
+ resolvedShell = shell;
123184
+ break;
123185
+ } catch (error48) {
123186
+ lastError = error48;
123187
+ log.warn({ shell, error: error48 }, "Failed to spawn PTY with shell candidate");
123188
+ }
123189
+ }
123190
+ if (!proc) {
123191
+ const fallbackText = shellCandidates.length > 0 ? shellCandidates.join(", ") : process.platform === "win32" ? "powershell.exe" : NON_WINDOWS_FALLBACK_SHELLS.join(", ");
123192
+ const suffix = lastError instanceof Error ? `${lastError.name}: ${lastError.message}` : typeof lastError === "string" ? lastError : "unknown error";
123193
+ throw new Error(`Failed to spawn terminal shell. Tried: ${fallbackText}. Last error: ${suffix}`);
123194
+ }
123195
+ const session = {
123196
+ meta: { id, scope: options2.scope, cwd: options2.cwd, createdAt: Date.now() },
123197
+ process: proc,
123198
+ listeners: new Set,
123199
+ exitListeners: new Set,
123200
+ scrollback: [],
123201
+ scrollbackBytes: 0,
123202
+ exited: false
123203
+ };
123204
+ proc.onData((data) => {
123205
+ session.scrollback.push(data);
123206
+ session.scrollbackBytes += data.length;
123207
+ if (session.scrollback.length > SCROLLBACK_LIMIT) {
123208
+ const removed = session.scrollback.splice(0, session.scrollback.length - SCROLLBACK_LIMIT);
123209
+ for (const chunk of removed)
123210
+ session.scrollbackBytes -= chunk.length;
123211
+ }
123212
+ while (session.scrollbackBytes > SCROLLBACK_BYTE_LIMIT && session.scrollback.length > 0) {
123213
+ const removed = session.scrollback.shift();
123214
+ session.scrollbackBytes -= removed.length;
123215
+ }
123216
+ for (const listener of session.listeners) {
123217
+ try {
123218
+ listener(data);
123219
+ } catch {}
123220
+ }
123221
+ });
123222
+ proc.onExit(({ exitCode, signal }) => {
123223
+ log.info({ sessionId: id, exitCode, signal }, "PTY session exited");
123224
+ session.exited = true;
123225
+ const exitInfo = { exitCode, signal };
123226
+ for (const listener of session.exitListeners) {
123227
+ try {
123228
+ listener(exitInfo);
123229
+ } catch {}
123230
+ }
123231
+ session.exitListeners.clear();
123232
+ setTimeout(() => {
123233
+ if (sessions.get(id) === session) {
123234
+ sessions.delete(id);
123235
+ log.debug({ sessionId: id }, "Exited session removed after retention period");
123236
+ }
123237
+ }, EXITED_SESSION_RETENTION_MS);
123238
+ });
123239
+ sessions.set(id, session);
123240
+ log.info({ sessionId: id, scope: options2.scope, cwd: options2.cwd, shell: resolvedShell }, "PTY session created");
123241
+ return session.meta;
123242
+ }
123243
+ function writeToSession(sessionId, data) {
123244
+ const session = sessions.get(sessionId);
123245
+ if (!session)
123246
+ return false;
123247
+ try {
123248
+ session.process.write(data);
123249
+ } catch (error48) {
123250
+ log.warn({ sessionId, error: error48 }, "Failed to write to PTY session");
123251
+ return false;
123252
+ }
123253
+ return true;
123254
+ }
123255
+ function resizeSession(sessionId, cols, rows) {
123256
+ const session = sessions.get(sessionId);
123257
+ if (!session)
123258
+ return false;
123259
+ try {
123260
+ session.process.resize(cols, rows);
123261
+ } catch (error48) {
123262
+ log.warn({ sessionId, cols, rows, error: error48 }, "Failed to resize PTY");
123263
+ }
123264
+ return true;
123265
+ }
123266
+ function destroySession(sessionId) {
123267
+ const session = sessions.get(sessionId);
123268
+ if (!session)
123269
+ return false;
123270
+ try {
123271
+ session.process.kill();
123272
+ } catch {}
123273
+ sessions.delete(sessionId);
123274
+ log.info({ sessionId }, "PTY session destroyed");
123275
+ return true;
123276
+ }
123277
+ function getSession(sessionId) {
123278
+ return sessions.get(sessionId)?.meta ?? null;
123279
+ }
123280
+ function addDataListener(sessionId, listener) {
123281
+ const session = sessions.get(sessionId);
123282
+ if (!session)
123283
+ return false;
123284
+ session.listeners.add(listener);
123285
+ return true;
123286
+ }
123287
+ function removeDataListener(sessionId, listener) {
123288
+ sessions.get(sessionId)?.listeners.delete(listener);
123289
+ }
123290
+ function addExitListener(sessionId, listener) {
123291
+ const session = sessions.get(sessionId);
123292
+ if (!session)
123293
+ return false;
123294
+ if (session.exited) {
123295
+ try {
123296
+ listener({ exitCode: -1 });
123297
+ } catch {}
123298
+ return true;
123299
+ }
123300
+ session.exitListeners.add(listener);
123301
+ return true;
123302
+ }
123303
+ function removeExitListener(sessionId, listener) {
123304
+ sessions.get(sessionId)?.exitListeners.delete(listener);
123305
+ }
123306
+ function getScrollback(sessionId) {
123307
+ return sessions.get(sessionId)?.scrollback ?? [];
123308
+ }
123309
+ function destroyAllSessions() {
123310
+ for (const [id] of sessions) {
123311
+ destroySession(id);
123312
+ }
123313
+ }
123314
+ async function gracefulShutdownSessions(timeoutMs = 3000) {
123315
+ const ids = Array.from(sessions.keys());
123316
+ if (ids.length === 0)
123317
+ return;
123318
+ log.info({ count: ids.length }, "Gracefully shutting down PTY sessions");
123319
+ for (const id of ids) {
123320
+ const session = sessions.get(id);
123321
+ if (!session || session.exited)
123322
+ continue;
123323
+ try {
123324
+ session.process.kill();
123325
+ } catch {}
123326
+ }
123327
+ const deadline = Date.now() + timeoutMs;
123328
+ while (sessions.size > 0 && Date.now() < deadline) {
123329
+ await new Promise((r) => setTimeout(r, 100));
123330
+ }
123331
+ if (sessions.size > 0) {
123332
+ log.warn({ remaining: sessions.size }, "Force destroying remaining PTY sessions");
123333
+ destroyAllSessions();
123334
+ }
123335
+ }
123336
+ var log, require2, SCROLLBACK_LIMIT = 500, SCROLLBACK_BYTE_LIMIT, DEFAULT_COLS = 120, DEFAULT_ROWS = 30, EXITED_SESSION_RETENTION_MS = 60000, NON_WINDOWS_FALLBACK_SHELLS, sessions;
123337
+ var init_pty_session = __esm(() => {
123338
+ init_log();
123339
+ log = logger.child({ module: "pty-session" });
123340
+ require2 = createRequire3(import.meta.url);
123341
+ SCROLLBACK_BYTE_LIMIT = 1024 * 1024;
123342
+ NON_WINDOWS_FALLBACK_SHELLS = ["/bin/bash", "/bin/zsh", "/bin/sh"];
123343
+ sessions = new Map;
123344
+ });
123345
+
123346
+ // ../api/src/server/terminal-ws.ts
123347
+ import { dirname as dirname7, resolve as resolve21, sep as sep6 } from "node:path";
123348
+ import { existsSync as existsSync13, statSync as statSync4 } from "node:fs";
123349
+ function validateCwd(cwd2, root) {
123350
+ if (!cwd2 || typeof cwd2 !== "string")
123351
+ return null;
123352
+ const resolved = resolve21(cwd2);
123353
+ const resolvedRoot = resolve21(root);
123354
+ const parentDir = dirname7(resolvedRoot) + sep6;
123355
+ const isWithinRoot2 = resolved === resolvedRoot || resolved.startsWith(resolvedRoot + sep6);
123356
+ const isSibling = resolved.startsWith(parentDir);
123357
+ if (!isWithinRoot2 && !isSibling)
123358
+ return null;
123359
+ if (!existsSync13(resolved))
123360
+ return null;
123361
+ try {
123362
+ if (!statSync4(resolved).isDirectory())
123363
+ return null;
123364
+ } catch {
123365
+ return null;
123366
+ }
123367
+ return resolved;
123368
+ }
123369
+ function createTerminalWebSocketServer(root) {
123370
+ if (root)
123371
+ configuredRoot = root;
123372
+ if (wss)
123373
+ return wss;
123374
+ wss = new import_websocket_server.default({ noServer: true });
123375
+ wss.on("connection", (ws) => {
123376
+ let currentSessionId = null;
123377
+ let dataListener = null;
123378
+ let exitListener = null;
123379
+ const cleanup = () => {
123380
+ if (currentSessionId && dataListener) {
123381
+ removeDataListener(currentSessionId, dataListener);
123382
+ }
123383
+ if (currentSessionId && exitListener) {
123384
+ removeExitListener(currentSessionId, exitListener);
123385
+ }
123386
+ dataListener = null;
123387
+ exitListener = null;
123388
+ currentSessionId = null;
123389
+ };
123390
+ const sendJson = (payload) => {
123391
+ if (ws.readyState === import_websocket.default.OPEN) {
123392
+ ws.send(JSON.stringify(payload));
123393
+ }
123394
+ };
123395
+ const attachToSession = (sessionId) => {
123396
+ cleanup();
123397
+ cancelOrphanDestroy(sessionId);
123398
+ const meta3 = getSession(sessionId);
123399
+ if (!meta3) {
123400
+ sendJson({ type: "error", message: `Session ${sessionId} not found` });
123401
+ return false;
123402
+ }
123403
+ currentSessionId = sessionId;
123404
+ dataListener = (data) => {
123405
+ sendJson({ type: "output", data });
123406
+ };
123407
+ exitListener = (info) => {
123408
+ sendJson({ type: "exited", exitCode: info.exitCode });
123409
+ cleanup();
123410
+ };
123411
+ const scrollback = getScrollback(sessionId);
123412
+ if (scrollback.length > 0) {
123413
+ sendJson({ type: "output", data: scrollback.join("") });
123414
+ }
123415
+ addDataListener(sessionId, dataListener);
123416
+ addExitListener(sessionId, exitListener);
123417
+ return true;
123418
+ };
123419
+ ws.on("message", (raw2) => {
123420
+ let msg;
123421
+ try {
123422
+ msg = JSON.parse(typeof raw2 === "string" ? raw2 : raw2.toString("utf-8"));
123423
+ } catch {
123424
+ sendJson({ type: "error", message: "Invalid JSON" });
123425
+ return;
123426
+ }
123427
+ switch (msg.type) {
123428
+ case "create": {
123429
+ if (!msg.cwd || !msg.scope) {
123430
+ sendJson({ type: "error", message: "Missing required fields: scope, cwd" });
123431
+ return;
123432
+ }
123433
+ const root2 = configuredRoot;
123434
+ if (!root2) {
123435
+ sendJson({ type: "error", message: "Server root not configured" });
123436
+ return;
123437
+ }
123438
+ const validatedCwd = validateCwd(msg.cwd, root2) ?? root2;
123439
+ try {
123440
+ const meta3 = createSession({
123441
+ scope: msg.scope,
123442
+ cwd: validatedCwd,
123443
+ cols: msg.cols,
123444
+ rows: msg.rows
123445
+ });
123446
+ sendJson({ type: "created", sessionId: meta3.id, scope: meta3.scope, cwd: meta3.cwd });
123447
+ attachToSession(meta3.id);
123448
+ } catch (error48) {
123449
+ log2.error({ error: error48, cwd: validatedCwd, scope: msg.scope }, "Failed to create PTY session");
123450
+ sendJson({
123451
+ type: "error",
123452
+ message: `Failed to create terminal session: ${error48 instanceof Error ? error48.message : "unknown error"}`
123453
+ });
123454
+ }
123455
+ break;
123456
+ }
123457
+ case "attach": {
123458
+ if (!msg.sessionId) {
123459
+ sendJson({ type: "error", message: "Missing sessionId" });
123460
+ return;
123461
+ }
123462
+ const attached = attachToSession(msg.sessionId);
123463
+ if (attached) {
123464
+ sendJson({ type: "attached", sessionId: msg.sessionId });
123465
+ }
123466
+ break;
123467
+ }
123468
+ case "input": {
123469
+ if (!currentSessionId) {
123470
+ sendJson({ type: "error", message: "No active session" });
123471
+ return;
123472
+ }
123473
+ if (!writeToSession(currentSessionId, msg.data)) {
123474
+ sendJson({ type: "exited" });
123475
+ cleanup();
123476
+ }
123477
+ break;
123478
+ }
123479
+ case "resize": {
123480
+ if (!currentSessionId)
123481
+ return;
123482
+ if (typeof msg.cols === "number" && typeof msg.rows === "number" && msg.cols > 0 && msg.rows > 0) {
123483
+ resizeSession(currentSessionId, msg.cols, msg.rows);
123484
+ }
123485
+ break;
123486
+ }
123487
+ case "destroy": {
123488
+ if (currentSessionId) {
123489
+ const sid = currentSessionId;
123490
+ cleanup();
123491
+ destroySession(sid);
123492
+ sendJson({ type: "exited" });
123493
+ }
123494
+ break;
123495
+ }
123496
+ default:
123497
+ sendJson({ type: "error", message: `Unknown message type` });
123498
+ }
123499
+ });
123500
+ ws.on("close", () => {
123501
+ const sid = currentSessionId;
123502
+ log2.debug({ sessionId: sid }, "Terminal WebSocket closed");
123503
+ cleanup();
123504
+ if (sid) {
123505
+ scheduleOrphanDestroy(sid);
123506
+ }
123507
+ });
123508
+ ws.on("error", (error48) => {
123509
+ const sid = currentSessionId;
123510
+ log2.warn({ sessionId: sid, error: error48 }, "Terminal WebSocket error");
123511
+ cleanup();
123512
+ if (sid) {
123513
+ scheduleOrphanDestroy(sid);
123514
+ }
123515
+ });
123516
+ });
123517
+ return wss;
123518
+ }
123519
+ function scheduleOrphanDestroy(sessionId) {
123520
+ if (orphanTimers.has(sessionId))
123521
+ return;
123522
+ const timer = setTimeout(() => {
123523
+ orphanTimers.delete(sessionId);
123524
+ if (getSession(sessionId)) {
123525
+ log2.info({ sessionId }, "Destroying orphaned PTY session after timeout");
123526
+ destroySession(sessionId);
123527
+ }
123528
+ }, ORPHAN_SESSION_TIMEOUT_MS);
123529
+ orphanTimers.set(sessionId, timer);
123530
+ }
123531
+ function cancelOrphanDestroy(sessionId) {
123532
+ const timer = orphanTimers.get(sessionId);
123533
+ if (timer) {
123534
+ clearTimeout(timer);
123535
+ orphanTimers.delete(sessionId);
123536
+ }
123537
+ }
123538
+ function handleTerminalUpgrade(req, socket, head) {
123539
+ const server = createTerminalWebSocketServer();
123540
+ server.handleUpgrade(req, socket, head, (ws) => {
123541
+ server.emit("connection", ws, req);
123542
+ });
123543
+ }
123544
+ var log2, ORPHAN_SESSION_TIMEOUT_MS, orphanTimers, wss = null, configuredRoot = null;
123545
+ var init_terminal_ws = __esm(() => {
123546
+ init_wrapper();
123547
+ init_pty_session();
123548
+ init_log();
123549
+ log2 = logger.child({ module: "terminal-ws" });
123550
+ ORPHAN_SESSION_TIMEOUT_MS = 5 * 60 * 1000;
123551
+ orphanTimers = new Map;
123552
+ });
123553
+
123106
123554
  // ../api/src/server/http.ts
123107
123555
  var exports_http = {};
123108
123556
  __export(exports_http, {
123109
123557
  startServer: () => startServer
123110
123558
  });
123111
123559
  import { createServer as createServer2 } from "node:http";
123112
- import { existsSync as existsSync13 } from "node:fs";
123560
+ import { existsSync as existsSync14 } from "node:fs";
123113
123561
  import { createReadStream } from "node:fs";
123114
123562
  import { stat as stat2 } from "node:fs/promises";
123115
- import { extname as extname2, resolve as resolve21, sep as sep6 } from "node:path";
123563
+ import { extname as extname2, resolve as resolve22, sep as sep7 } from "node:path";
123116
123564
  async function startServer(options2) {
123117
123565
  const startedAt = Date.now();
123118
123566
  const taskFileWatch = createTaskFileWatchService(options2.root);
@@ -123134,7 +123582,7 @@ async function startServer(options2) {
123134
123582
  logger.error(`tRPC request failed ${JSON.stringify(details, (_key, value) => value === undefined ? "[undefined]" : value)}`);
123135
123583
  }
123136
123584
  });
123137
- const hasUi = Boolean(options2.uiRoot && existsSync13(options2.uiRoot));
123585
+ const hasUi = Boolean(options2.uiRoot && existsSync14(options2.uiRoot));
123138
123586
  const server = createServer2(async (req, res) => {
123139
123587
  const url2 = new URL(req.url ?? "/", `http://${req.headers.host ?? "localhost"}`);
123140
123588
  if (url2.pathname === "/api/health/live") {
@@ -123190,10 +123638,26 @@ async function startServer(options2) {
123190
123638
  res.end(`Server error: ${error48 instanceof Error ? error48.message : "unknown"}`);
123191
123639
  }
123192
123640
  });
123193
- const log = logger.child({ module: "api" });
123641
+ createTerminalWebSocketServer(options2.root);
123642
+ server.on("upgrade", (req, socket, head) => {
123643
+ const url2 = new URL(req.url ?? "/", `http://${req.headers.host ?? "localhost"}`);
123644
+ if (url2.pathname === "/api/terminal") {
123645
+ const remoteAddr = req.socket.remoteAddress ?? "";
123646
+ const isLocalhost2 = remoteAddr === "127.0.0.1" || remoteAddr === "::1" || remoteAddr === "::ffff:127.0.0.1";
123647
+ if (!isLocalhost2) {
123648
+ logger.warn({ remoteAddress: remoteAddr }, "Rejected terminal WebSocket from non-localhost address");
123649
+ socket.destroy();
123650
+ return;
123651
+ }
123652
+ handleTerminalUpgrade(req, socket, head);
123653
+ } else {
123654
+ socket.destroy();
123655
+ }
123656
+ });
123657
+ const log3 = logger.child({ module: "api" });
123194
123658
  const portResolution = await listenWithPortFallback(server, options2.port);
123195
123659
  if (portResolution.fallbackUsed) {
123196
- log.warn({
123660
+ log3.warn({
123197
123661
  event: "startup.port.conflict",
123198
123662
  requestedPort: portResolution.requestedPort,
123199
123663
  resolvedPort: portResolution.resolvedPort,
@@ -123201,17 +123665,23 @@ async function startServer(options2) {
123201
123665
  });
123202
123666
  }
123203
123667
  const apiUrl = `http://localhost:${portResolution.resolvedPort}`;
123204
- log.info({
123668
+ log3.info({
123205
123669
  event: "startup.ready",
123206
123670
  apiUrl,
123207
123671
  hint: "Press Ctrl+C to stop"
123208
123672
  }, `Ready: ${apiUrl} (Ctrl+C to stop)`);
123209
123673
  server.on("close", () => {
123210
123674
  taskFileWatch.stop();
123211
- log.info({
123212
- event: "startup.closed"
123213
- }, "API server closed.");
123675
+ destroyAllSessions();
123676
+ log3.info({ event: "startup.closed" }, "API server closed.");
123214
123677
  });
123678
+ const gracefulShutdown = async () => {
123679
+ log3.info({ event: "startup.shutting_down" }, "Graceful shutdown initiated");
123680
+ await gracefulShutdownSessions();
123681
+ server.close();
123682
+ };
123683
+ process.once("SIGINT", () => void gracefulShutdown());
123684
+ process.once("SIGTERM", () => void gracefulShutdown());
123215
123685
  return {
123216
123686
  server,
123217
123687
  port: portResolution.resolvedPort
@@ -123297,8 +123767,8 @@ async function serveVibemanImage(options2) {
123297
123767
  return;
123298
123768
  }
123299
123769
  const requested = decodedPath.replace(/^\//, "");
123300
- const absoluteTarget = resolve21(rootPath, requested);
123301
- if (!absoluteTarget.startsWith(imagesDir + sep6)) {
123770
+ const absoluteTarget = resolve22(rootPath, requested);
123771
+ if (!absoluteTarget.startsWith(imagesDir + sep7)) {
123302
123772
  res.statusCode = 404;
123303
123773
  res.setHeader("content-type", "text/plain; charset=utf-8");
123304
123774
  res.end("Not found");
@@ -123364,6 +123834,8 @@ var init_http2 = __esm(() => {
123364
123834
  init_task_file_watch();
123365
123835
  init_port_utils();
123366
123836
  init_health_report();
123837
+ init_terminal_ws();
123838
+ init_pty_session();
123367
123839
  import_serve_handler = __toESM(require_src3(), 1);
123368
123840
  });
123369
123841
 
package/dist/commit.txt CHANGED
@@ -1 +1 @@
1
- cf5eb36
1
+ 0842e29
package/dist/index.js CHANGED
@@ -2053,6 +2053,7 @@ var DIST_LAYOUT = {
2053
2053
  prismaRoot: "prisma",
2054
2054
  prismaSchema: "prisma/schema.prisma",
2055
2055
  resourcesRoot: "resources",
2056
+ nodePtyPackageRoot: "node_modules/node-pty",
2056
2057
  scriptsRoot: "scripts",
2057
2058
  fixtureInitScript: "scripts/init-test-repo.mjs",
2058
2059
  fixtureSeedScript: "scripts/seed-test-fixtures.mjs",
@@ -0,0 +1,69 @@
1
+ Copyright (c) 2012-2015, Christopher Jeffrey (https://github.com/chjj/)
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
20
+
21
+
22
+
23
+ The MIT License (MIT)
24
+
25
+ Copyright (c) 2016, Daniel Imms (http://www.growingwiththeweb.com)
26
+
27
+ Permission is hereby granted, free of charge, to any person obtaining a copy
28
+ of this software and associated documentation files (the "Software"), to deal
29
+ in the Software without restriction, including without limitation the rights
30
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
31
+ copies of the Software, and to permit persons to whom the Software is
32
+ furnished to do so, subject to the following conditions:
33
+
34
+ The above copyright notice and this permission notice shall be included in all
35
+ copies or substantial portions of the Software.
36
+
37
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
38
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
39
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
40
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
41
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
42
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
43
+ SOFTWARE.
44
+
45
+
46
+
47
+ MIT License
48
+
49
+ Copyright (c) 2018 - present Microsoft Corporation
50
+
51
+ All rights reserved.
52
+
53
+ Permission is hereby granted, free of charge, to any person obtaining a copy
54
+ of this software and associated documentation files (the "Software"), to deal
55
+ in the Software without restriction, including without limitation the rights
56
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
57
+ copies of the Software, and to permit persons to whom the Software is
58
+ furnished to do so, subject to the following conditions:
59
+
60
+ The above copyright notice and this permission notice shall be included in all
61
+ copies or substantial portions of the Software.
62
+
63
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
64
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
65
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
66
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
67
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
68
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
69
+ SOFTWARE.