@jsonstudio/zterm-daemon-win32-x64 0.0.0-stage → 0.1.3

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 (319) hide show
  1. package/LICENSE +191 -0
  2. package/README.md +2 -2
  3. package/package.json +25 -4
  4. package/runtime/dagpipe.node +0 -0
  5. package/runtime/node_modules/@roamhq/wrtc/AUTHORS +17 -0
  6. package/runtime/node_modules/@roamhq/wrtc/CHANGELOG.md +1094 -0
  7. package/runtime/node_modules/@roamhq/wrtc/LICENSE.md +30 -0
  8. package/runtime/node_modules/@roamhq/wrtc/README.md +74 -0
  9. package/runtime/node_modules/@roamhq/wrtc/lib/binding.js +31 -0
  10. package/runtime/node_modules/@roamhq/wrtc/lib/browser.js +18 -0
  11. package/runtime/node_modules/@roamhq/wrtc/lib/datachannelevent.js +26 -0
  12. package/runtime/node_modules/@roamhq/wrtc/lib/datachannelmessageevent.js +9 -0
  13. package/runtime/node_modules/@roamhq/wrtc/lib/error.js +20 -0
  14. package/runtime/node_modules/@roamhq/wrtc/lib/eventtarget.js +59 -0
  15. package/runtime/node_modules/@roamhq/wrtc/lib/icecandidate.js +43 -0
  16. package/runtime/node_modules/@roamhq/wrtc/lib/index.js +85 -0
  17. package/runtime/node_modules/@roamhq/wrtc/lib/mediadevices.js +30 -0
  18. package/runtime/node_modules/@roamhq/wrtc/lib/peerconnection.js +333 -0
  19. package/runtime/node_modules/@roamhq/wrtc/lib/rtcpeerconnectioniceerrorevent.js +36 -0
  20. package/runtime/node_modules/@roamhq/wrtc/lib/rtcpeerconnectioniceevent.js +20 -0
  21. package/runtime/node_modules/@roamhq/wrtc/lib/sessiondescription.js +19 -0
  22. package/runtime/node_modules/@roamhq/wrtc/package.json +68 -0
  23. package/runtime/node_modules/@roamhq/wrtc/types/index.d.ts +32 -0
  24. package/runtime/node_modules/@roamhq/wrtc/types/nonstandard.d.ts +81 -0
  25. package/runtime/node_modules/@roamhq/wrtc-win32-x64/index.js +1 -0
  26. package/runtime/node_modules/@roamhq/wrtc-win32-x64/package.json +16 -0
  27. package/runtime/node_modules/@roamhq/wrtc-win32-x64/wrtc.node +0 -0
  28. package/runtime/node_modules/node-pty/LICENSE +69 -0
  29. package/runtime/node_modules/node-pty/README.md +165 -0
  30. package/runtime/node_modules/node-pty/binding.gyp +111 -0
  31. package/runtime/node_modules/node-pty/build/Release/conpty/OpenConsole.exe +0 -0
  32. package/runtime/node_modules/node-pty/build/Release/conpty/conpty.dll +0 -0
  33. package/runtime/node_modules/node-pty/deps/.editorconfig +2 -0
  34. package/runtime/node_modules/node-pty/deps/winpty/.drone.yml +17 -0
  35. package/runtime/node_modules/node-pty/deps/winpty/.gitattributes +19 -0
  36. package/runtime/node_modules/node-pty/deps/winpty/LICENSE +21 -0
  37. package/runtime/node_modules/node-pty/deps/winpty/Makefile +166 -0
  38. package/runtime/node_modules/node-pty/deps/winpty/README.md +151 -0
  39. package/runtime/node_modules/node-pty/deps/winpty/RELEASES.md +280 -0
  40. package/runtime/node_modules/node-pty/deps/winpty/VERSION.txt +1 -0
  41. package/runtime/node_modules/node-pty/deps/winpty/configure +167 -0
  42. package/runtime/node_modules/node-pty/deps/winpty/misc/BufferResizeTests.cc +90 -0
  43. package/runtime/node_modules/node-pty/deps/winpty/misc/ChangeScreenBuffer.cc +53 -0
  44. package/runtime/node_modules/node-pty/deps/winpty/misc/ClearConsole.cc +72 -0
  45. package/runtime/node_modules/node-pty/deps/winpty/misc/ConinMode.cc +117 -0
  46. package/runtime/node_modules/node-pty/deps/winpty/misc/ConinMode.ps1 +116 -0
  47. package/runtime/node_modules/node-pty/deps/winpty/misc/ConoutMode.cc +113 -0
  48. package/runtime/node_modules/node-pty/deps/winpty/misc/DebugClient.py +42 -0
  49. package/runtime/node_modules/node-pty/deps/winpty/misc/DebugServer.py +63 -0
  50. package/runtime/node_modules/node-pty/deps/winpty/misc/DumpLines.py +5 -0
  51. package/runtime/node_modules/node-pty/deps/winpty/misc/EnableExtendedFlags.txt +46 -0
  52. package/runtime/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/CP437-Consolas.txt +528 -0
  53. package/runtime/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/CP437-Lucida.txt +633 -0
  54. package/runtime/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/CP932.txt +630 -0
  55. package/runtime/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/CP936.txt +630 -0
  56. package/runtime/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/CP949.txt +630 -0
  57. package/runtime/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/CP950.txt +630 -0
  58. package/runtime/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/MinimumWindowWidths.txt +16 -0
  59. package/runtime/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/Results.txt +4 -0
  60. package/runtime/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/Windows10SetFontBugginess.txt +144 -0
  61. package/runtime/node_modules/node-pty/deps/winpty/misc/FontSurvey.cc +100 -0
  62. package/runtime/node_modules/node-pty/deps/winpty/misc/FormatChar.h +21 -0
  63. package/runtime/node_modules/node-pty/deps/winpty/misc/FreezePerfTest.cc +62 -0
  64. package/runtime/node_modules/node-pty/deps/winpty/misc/GetCh.cc +20 -0
  65. package/runtime/node_modules/node-pty/deps/winpty/misc/GetConsolePos.cc +41 -0
  66. package/runtime/node_modules/node-pty/deps/winpty/misc/GetFont.cc +261 -0
  67. package/runtime/node_modules/node-pty/deps/winpty/misc/IdentifyConsoleWindow.ps1 +51 -0
  68. package/runtime/node_modules/node-pty/deps/winpty/misc/IsNewConsole.cc +87 -0
  69. package/runtime/node_modules/node-pty/deps/winpty/misc/MouseInputNotes.txt +90 -0
  70. package/runtime/node_modules/node-pty/deps/winpty/misc/MoveConsoleWindow.cc +34 -0
  71. package/runtime/node_modules/node-pty/deps/winpty/misc/Notes.txt +219 -0
  72. package/runtime/node_modules/node-pty/deps/winpty/misc/OSVersion.cc +27 -0
  73. package/runtime/node_modules/node-pty/deps/winpty/misc/ScreenBufferFreezeInactive.cc +101 -0
  74. package/runtime/node_modules/node-pty/deps/winpty/misc/ScreenBufferTest.cc +671 -0
  75. package/runtime/node_modules/node-pty/deps/winpty/misc/ScreenBufferTest2.cc +151 -0
  76. package/runtime/node_modules/node-pty/deps/winpty/misc/SelectAllTest.cc +45 -0
  77. package/runtime/node_modules/node-pty/deps/winpty/misc/SetBufferSize.cc +32 -0
  78. package/runtime/node_modules/node-pty/deps/winpty/misc/SetCursorPos.cc +10 -0
  79. package/runtime/node_modules/node-pty/deps/winpty/misc/SetFont.cc +145 -0
  80. package/runtime/node_modules/node-pty/deps/winpty/misc/SetWindowRect.cc +36 -0
  81. package/runtime/node_modules/node-pty/deps/winpty/misc/ShowArgv.cc +12 -0
  82. package/runtime/node_modules/node-pty/deps/winpty/misc/ShowConsoleInput.cc +40 -0
  83. package/runtime/node_modules/node-pty/deps/winpty/misc/Spew.py +5 -0
  84. package/runtime/node_modules/node-pty/deps/winpty/misc/TestUtil.cc +172 -0
  85. package/runtime/node_modules/node-pty/deps/winpty/misc/UnicodeDoubleWidthTest.cc +102 -0
  86. package/runtime/node_modules/node-pty/deps/winpty/misc/UnicodeWideTest1.cc +246 -0
  87. package/runtime/node_modules/node-pty/deps/winpty/misc/UnicodeWideTest2.cc +130 -0
  88. package/runtime/node_modules/node-pty/deps/winpty/misc/UnixEcho.cc +89 -0
  89. package/runtime/node_modules/node-pty/deps/winpty/misc/Utf16Echo.cc +46 -0
  90. package/runtime/node_modules/node-pty/deps/winpty/misc/VeryLargeRead.cc +122 -0
  91. package/runtime/node_modules/node-pty/deps/winpty/misc/VkEscapeTest.cc +56 -0
  92. package/runtime/node_modules/node-pty/deps/winpty/misc/Win10ResizeWhileFrozen.cc +52 -0
  93. package/runtime/node_modules/node-pty/deps/winpty/misc/Win10WrapTest1.cc +57 -0
  94. package/runtime/node_modules/node-pty/deps/winpty/misc/Win10WrapTest2.cc +30 -0
  95. package/runtime/node_modules/node-pty/deps/winpty/misc/Win32Echo1.cc +26 -0
  96. package/runtime/node_modules/node-pty/deps/winpty/misc/Win32Echo2.cc +19 -0
  97. package/runtime/node_modules/node-pty/deps/winpty/misc/Win32Test1.cc +46 -0
  98. package/runtime/node_modules/node-pty/deps/winpty/misc/Win32Test2.cc +70 -0
  99. package/runtime/node_modules/node-pty/deps/winpty/misc/Win32Test3.cc +78 -0
  100. package/runtime/node_modules/node-pty/deps/winpty/misc/Win32Write1.cc +44 -0
  101. package/runtime/node_modules/node-pty/deps/winpty/misc/WindowsBugCrashReader.cc +27 -0
  102. package/runtime/node_modules/node-pty/deps/winpty/misc/WriteConsole.cc +106 -0
  103. package/runtime/node_modules/node-pty/deps/winpty/misc/build32.sh +9 -0
  104. package/runtime/node_modules/node-pty/deps/winpty/misc/build64.sh +9 -0
  105. package/runtime/node_modules/node-pty/deps/winpty/misc/color-test.sh +212 -0
  106. package/runtime/node_modules/node-pty/deps/winpty/misc/font-notes.txt +300 -0
  107. package/runtime/node_modules/node-pty/deps/winpty/misc/winbug-15048.cc +201 -0
  108. package/runtime/node_modules/node-pty/deps/winpty/ship/build-pty4j-libpty.bat +36 -0
  109. package/runtime/node_modules/node-pty/deps/winpty/ship/common_ship.py +53 -0
  110. package/runtime/node_modules/node-pty/deps/winpty/ship/make_msvc_package.py +165 -0
  111. package/runtime/node_modules/node-pty/deps/winpty/ship/ship.py +108 -0
  112. package/runtime/node_modules/node-pty/deps/winpty/src/agent/Agent.cc +613 -0
  113. package/runtime/node_modules/node-pty/deps/winpty/src/agent/Agent.h +103 -0
  114. package/runtime/node_modules/node-pty/deps/winpty/src/agent/AgentCreateDesktop.cc +84 -0
  115. package/runtime/node_modules/node-pty/deps/winpty/src/agent/AgentCreateDesktop.h +28 -0
  116. package/runtime/node_modules/node-pty/deps/winpty/src/agent/ConsoleFont.cc +632 -0
  117. package/runtime/node_modules/node-pty/deps/winpty/src/agent/ConsoleFont.h +28 -0
  118. package/runtime/node_modules/node-pty/deps/winpty/src/agent/ConsoleInput.cc +852 -0
  119. package/runtime/node_modules/node-pty/deps/winpty/src/agent/ConsoleInput.h +109 -0
  120. package/runtime/node_modules/node-pty/deps/winpty/src/agent/ConsoleInputReencoding.cc +121 -0
  121. package/runtime/node_modules/node-pty/deps/winpty/src/agent/ConsoleInputReencoding.h +36 -0
  122. package/runtime/node_modules/node-pty/deps/winpty/src/agent/ConsoleLine.cc +152 -0
  123. package/runtime/node_modules/node-pty/deps/winpty/src/agent/ConsoleLine.h +41 -0
  124. package/runtime/node_modules/node-pty/deps/winpty/src/agent/Coord.h +87 -0
  125. package/runtime/node_modules/node-pty/deps/winpty/src/agent/DebugShowInput.cc +239 -0
  126. package/runtime/node_modules/node-pty/deps/winpty/src/agent/DebugShowInput.h +32 -0
  127. package/runtime/node_modules/node-pty/deps/winpty/src/agent/DefaultInputMap.cc +422 -0
  128. package/runtime/node_modules/node-pty/deps/winpty/src/agent/DefaultInputMap.h +28 -0
  129. package/runtime/node_modules/node-pty/deps/winpty/src/agent/DsrSender.h +30 -0
  130. package/runtime/node_modules/node-pty/deps/winpty/src/agent/EventLoop.cc +99 -0
  131. package/runtime/node_modules/node-pty/deps/winpty/src/agent/EventLoop.h +47 -0
  132. package/runtime/node_modules/node-pty/deps/winpty/src/agent/InputMap.cc +246 -0
  133. package/runtime/node_modules/node-pty/deps/winpty/src/agent/InputMap.h +114 -0
  134. package/runtime/node_modules/node-pty/deps/winpty/src/agent/LargeConsoleRead.cc +71 -0
  135. package/runtime/node_modules/node-pty/deps/winpty/src/agent/LargeConsoleRead.h +68 -0
  136. package/runtime/node_modules/node-pty/deps/winpty/src/agent/NamedPipe.cc +378 -0
  137. package/runtime/node_modules/node-pty/deps/winpty/src/agent/NamedPipe.h +125 -0
  138. package/runtime/node_modules/node-pty/deps/winpty/src/agent/Scraper.cc +699 -0
  139. package/runtime/node_modules/node-pty/deps/winpty/src/agent/Scraper.h +103 -0
  140. package/runtime/node_modules/node-pty/deps/winpty/src/agent/SimplePool.h +75 -0
  141. package/runtime/node_modules/node-pty/deps/winpty/src/agent/SmallRect.h +143 -0
  142. package/runtime/node_modules/node-pty/deps/winpty/src/agent/Terminal.cc +535 -0
  143. package/runtime/node_modules/node-pty/deps/winpty/src/agent/Terminal.h +69 -0
  144. package/runtime/node_modules/node-pty/deps/winpty/src/agent/UnicodeEncoding.h +157 -0
  145. package/runtime/node_modules/node-pty/deps/winpty/src/agent/UnicodeEncodingTest.cc +189 -0
  146. package/runtime/node_modules/node-pty/deps/winpty/src/agent/Win32Console.cc +107 -0
  147. package/runtime/node_modules/node-pty/deps/winpty/src/agent/Win32Console.h +67 -0
  148. package/runtime/node_modules/node-pty/deps/winpty/src/agent/Win32ConsoleBuffer.cc +193 -0
  149. package/runtime/node_modules/node-pty/deps/winpty/src/agent/Win32ConsoleBuffer.h +99 -0
  150. package/runtime/node_modules/node-pty/deps/winpty/src/agent/main.cc +114 -0
  151. package/runtime/node_modules/node-pty/deps/winpty/src/agent/subdir.mk +61 -0
  152. package/runtime/node_modules/node-pty/deps/winpty/src/configurations.gypi +60 -0
  153. package/runtime/node_modules/node-pty/deps/winpty/src/debugserver/DebugServer.cc +117 -0
  154. package/runtime/node_modules/node-pty/deps/winpty/src/debugserver/subdir.mk +41 -0
  155. package/runtime/node_modules/node-pty/deps/winpty/src/include/winpty.h +242 -0
  156. package/runtime/node_modules/node-pty/deps/winpty/src/include/winpty_constants.h +131 -0
  157. package/runtime/node_modules/node-pty/deps/winpty/src/libwinpty/AgentLocation.cc +75 -0
  158. package/runtime/node_modules/node-pty/deps/winpty/src/libwinpty/AgentLocation.h +28 -0
  159. package/runtime/node_modules/node-pty/deps/winpty/src/libwinpty/LibWinptyException.h +54 -0
  160. package/runtime/node_modules/node-pty/deps/winpty/src/libwinpty/WinptyInternal.h +72 -0
  161. package/runtime/node_modules/node-pty/deps/winpty/src/libwinpty/subdir.mk +46 -0
  162. package/runtime/node_modules/node-pty/deps/winpty/src/libwinpty/winpty.cc +970 -0
  163. package/runtime/node_modules/node-pty/deps/winpty/src/shared/AgentMsg.h +38 -0
  164. package/runtime/node_modules/node-pty/deps/winpty/src/shared/BackgroundDesktop.cc +122 -0
  165. package/runtime/node_modules/node-pty/deps/winpty/src/shared/BackgroundDesktop.h +73 -0
  166. package/runtime/node_modules/node-pty/deps/winpty/src/shared/Buffer.cc +103 -0
  167. package/runtime/node_modules/node-pty/deps/winpty/src/shared/Buffer.h +102 -0
  168. package/runtime/node_modules/node-pty/deps/winpty/src/shared/DebugClient.cc +187 -0
  169. package/runtime/node_modules/node-pty/deps/winpty/src/shared/DebugClient.h +38 -0
  170. package/runtime/node_modules/node-pty/deps/winpty/src/shared/GenRandom.cc +138 -0
  171. package/runtime/node_modules/node-pty/deps/winpty/src/shared/GenRandom.h +55 -0
  172. package/runtime/node_modules/node-pty/deps/winpty/src/shared/GetCommitHash.bat +13 -0
  173. package/runtime/node_modules/node-pty/deps/winpty/src/shared/Mutex.h +54 -0
  174. package/runtime/node_modules/node-pty/deps/winpty/src/shared/OsModule.h +63 -0
  175. package/runtime/node_modules/node-pty/deps/winpty/src/shared/OwnedHandle.cc +36 -0
  176. package/runtime/node_modules/node-pty/deps/winpty/src/shared/OwnedHandle.h +45 -0
  177. package/runtime/node_modules/node-pty/deps/winpty/src/shared/PrecompiledHeader.h +43 -0
  178. package/runtime/node_modules/node-pty/deps/winpty/src/shared/StringBuilder.h +227 -0
  179. package/runtime/node_modules/node-pty/deps/winpty/src/shared/StringBuilderTest.cc +114 -0
  180. package/runtime/node_modules/node-pty/deps/winpty/src/shared/StringUtil.cc +55 -0
  181. package/runtime/node_modules/node-pty/deps/winpty/src/shared/StringUtil.h +80 -0
  182. package/runtime/node_modules/node-pty/deps/winpty/src/shared/TimeMeasurement.h +63 -0
  183. package/runtime/node_modules/node-pty/deps/winpty/src/shared/UnixCtrlChars.h +45 -0
  184. package/runtime/node_modules/node-pty/deps/winpty/src/shared/UpdateGenVersion.bat +20 -0
  185. package/runtime/node_modules/node-pty/deps/winpty/src/shared/WindowsSecurity.cc +460 -0
  186. package/runtime/node_modules/node-pty/deps/winpty/src/shared/WindowsSecurity.h +104 -0
  187. package/runtime/node_modules/node-pty/deps/winpty/src/shared/WindowsVersion.cc +252 -0
  188. package/runtime/node_modules/node-pty/deps/winpty/src/shared/WindowsVersion.h +29 -0
  189. package/runtime/node_modules/node-pty/deps/winpty/src/shared/WinptyAssert.cc +55 -0
  190. package/runtime/node_modules/node-pty/deps/winpty/src/shared/WinptyAssert.h +64 -0
  191. package/runtime/node_modules/node-pty/deps/winpty/src/shared/WinptyException.cc +57 -0
  192. package/runtime/node_modules/node-pty/deps/winpty/src/shared/WinptyException.h +43 -0
  193. package/runtime/node_modules/node-pty/deps/winpty/src/shared/WinptyVersion.cc +42 -0
  194. package/runtime/node_modules/node-pty/deps/winpty/src/shared/WinptyVersion.h +27 -0
  195. package/runtime/node_modules/node-pty/deps/winpty/src/shared/winpty_snprintf.h +99 -0
  196. package/runtime/node_modules/node-pty/deps/winpty/src/subdir.mk +5 -0
  197. package/runtime/node_modules/node-pty/deps/winpty/src/tests/subdir.mk +28 -0
  198. package/runtime/node_modules/node-pty/deps/winpty/src/tests/trivial_test.cc +158 -0
  199. package/runtime/node_modules/node-pty/deps/winpty/src/unix-adapter/InputHandler.cc +114 -0
  200. package/runtime/node_modules/node-pty/deps/winpty/src/unix-adapter/InputHandler.h +56 -0
  201. package/runtime/node_modules/node-pty/deps/winpty/src/unix-adapter/OutputHandler.cc +80 -0
  202. package/runtime/node_modules/node-pty/deps/winpty/src/unix-adapter/OutputHandler.h +53 -0
  203. package/runtime/node_modules/node-pty/deps/winpty/src/unix-adapter/Util.cc +86 -0
  204. package/runtime/node_modules/node-pty/deps/winpty/src/unix-adapter/Util.h +31 -0
  205. package/runtime/node_modules/node-pty/deps/winpty/src/unix-adapter/WakeupFd.cc +70 -0
  206. package/runtime/node_modules/node-pty/deps/winpty/src/unix-adapter/WakeupFd.h +42 -0
  207. package/runtime/node_modules/node-pty/deps/winpty/src/unix-adapter/main.cc +729 -0
  208. package/runtime/node_modules/node-pty/deps/winpty/src/unix-adapter/subdir.mk +41 -0
  209. package/runtime/node_modules/node-pty/deps/winpty/src/winpty.gyp +234 -0
  210. package/runtime/node_modules/node-pty/deps/winpty/vcbuild.bat +83 -0
  211. package/runtime/node_modules/node-pty/lib/conpty_console_list_agent.js +16 -0
  212. package/runtime/node_modules/node-pty/lib/conpty_console_list_agent.js.map +1 -0
  213. package/runtime/node_modules/node-pty/lib/eventEmitter2.js +47 -0
  214. package/runtime/node_modules/node-pty/lib/eventEmitter2.js.map +1 -0
  215. package/runtime/node_modules/node-pty/lib/eventEmitter2.test.js +30 -0
  216. package/runtime/node_modules/node-pty/lib/eventEmitter2.test.js.map +1 -0
  217. package/runtime/node_modules/node-pty/lib/index.js +52 -0
  218. package/runtime/node_modules/node-pty/lib/index.js.map +1 -0
  219. package/runtime/node_modules/node-pty/lib/interfaces.js +7 -0
  220. package/runtime/node_modules/node-pty/lib/interfaces.js.map +1 -0
  221. package/runtime/node_modules/node-pty/lib/shared/conout.js +11 -0
  222. package/runtime/node_modules/node-pty/lib/shared/conout.js.map +1 -0
  223. package/runtime/node_modules/node-pty/lib/terminal.js +190 -0
  224. package/runtime/node_modules/node-pty/lib/terminal.js.map +1 -0
  225. package/runtime/node_modules/node-pty/lib/terminal.test.js +139 -0
  226. package/runtime/node_modules/node-pty/lib/terminal.test.js.map +1 -0
  227. package/runtime/node_modules/node-pty/lib/testUtils.test.js +28 -0
  228. package/runtime/node_modules/node-pty/lib/testUtils.test.js.map +1 -0
  229. package/runtime/node_modules/node-pty/lib/types.js +7 -0
  230. package/runtime/node_modules/node-pty/lib/types.js.map +1 -0
  231. package/runtime/node_modules/node-pty/lib/unixTerminal.js +346 -0
  232. package/runtime/node_modules/node-pty/lib/unixTerminal.js.map +1 -0
  233. package/runtime/node_modules/node-pty/lib/unixTerminal.test.js +351 -0
  234. package/runtime/node_modules/node-pty/lib/unixTerminal.test.js.map +1 -0
  235. package/runtime/node_modules/node-pty/lib/utils.js +39 -0
  236. package/runtime/node_modules/node-pty/lib/utils.js.map +1 -0
  237. package/runtime/node_modules/node-pty/lib/windowsConoutConnection.js +125 -0
  238. package/runtime/node_modules/node-pty/lib/windowsConoutConnection.js.map +1 -0
  239. package/runtime/node_modules/node-pty/lib/windowsPtyAgent.js +320 -0
  240. package/runtime/node_modules/node-pty/lib/windowsPtyAgent.js.map +1 -0
  241. package/runtime/node_modules/node-pty/lib/windowsPtyAgent.test.js +90 -0
  242. package/runtime/node_modules/node-pty/lib/windowsPtyAgent.test.js.map +1 -0
  243. package/runtime/node_modules/node-pty/lib/windowsTerminal.js +199 -0
  244. package/runtime/node_modules/node-pty/lib/windowsTerminal.js.map +1 -0
  245. package/runtime/node_modules/node-pty/lib/windowsTerminal.test.js +219 -0
  246. package/runtime/node_modules/node-pty/lib/windowsTerminal.test.js.map +1 -0
  247. package/runtime/node_modules/node-pty/lib/worker/conoutSocketWorker.js +22 -0
  248. package/runtime/node_modules/node-pty/lib/worker/conoutSocketWorker.js.map +1 -0
  249. package/runtime/node_modules/node-pty/package.json +64 -0
  250. package/runtime/node_modules/node-pty/prebuilds/darwin-arm64/pty.node +0 -0
  251. package/runtime/node_modules/node-pty/prebuilds/darwin-arm64/spawn-helper +0 -0
  252. package/runtime/node_modules/node-pty/prebuilds/darwin-x64/pty.node +0 -0
  253. package/runtime/node_modules/node-pty/prebuilds/darwin-x64/spawn-helper +0 -0
  254. package/runtime/node_modules/node-pty/prebuilds/win32-arm64/conpty/OpenConsole.exe +0 -0
  255. package/runtime/node_modules/node-pty/prebuilds/win32-arm64/conpty/conpty.dll +0 -0
  256. package/runtime/node_modules/node-pty/prebuilds/win32-arm64/conpty.node +0 -0
  257. package/runtime/node_modules/node-pty/prebuilds/win32-arm64/conpty.pdb +0 -0
  258. package/runtime/node_modules/node-pty/prebuilds/win32-arm64/conpty_console_list.node +0 -0
  259. package/runtime/node_modules/node-pty/prebuilds/win32-arm64/conpty_console_list.pdb +0 -0
  260. package/runtime/node_modules/node-pty/prebuilds/win32-arm64/pty.node +0 -0
  261. package/runtime/node_modules/node-pty/prebuilds/win32-arm64/pty.pdb +0 -0
  262. package/runtime/node_modules/node-pty/prebuilds/win32-arm64/winpty-agent.exe +0 -0
  263. package/runtime/node_modules/node-pty/prebuilds/win32-arm64/winpty-agent.pdb +0 -0
  264. package/runtime/node_modules/node-pty/prebuilds/win32-arm64/winpty.dll +0 -0
  265. package/runtime/node_modules/node-pty/prebuilds/win32-arm64/winpty.pdb +0 -0
  266. package/runtime/node_modules/node-pty/prebuilds/win32-x64/conpty/OpenConsole.exe +0 -0
  267. package/runtime/node_modules/node-pty/prebuilds/win32-x64/conpty/conpty.dll +0 -0
  268. package/runtime/node_modules/node-pty/prebuilds/win32-x64/conpty.node +0 -0
  269. package/runtime/node_modules/node-pty/prebuilds/win32-x64/conpty.pdb +0 -0
  270. package/runtime/node_modules/node-pty/prebuilds/win32-x64/conpty_console_list.node +0 -0
  271. package/runtime/node_modules/node-pty/prebuilds/win32-x64/conpty_console_list.pdb +0 -0
  272. package/runtime/node_modules/node-pty/prebuilds/win32-x64/pty.node +0 -0
  273. package/runtime/node_modules/node-pty/prebuilds/win32-x64/pty.pdb +0 -0
  274. package/runtime/node_modules/node-pty/prebuilds/win32-x64/winpty-agent.exe +0 -0
  275. package/runtime/node_modules/node-pty/prebuilds/win32-x64/winpty-agent.pdb +0 -0
  276. package/runtime/node_modules/node-pty/prebuilds/win32-x64/winpty.dll +0 -0
  277. package/runtime/node_modules/node-pty/prebuilds/win32-x64/winpty.pdb +0 -0
  278. package/runtime/node_modules/node-pty/scripts/gen-compile-commands.js +8 -0
  279. package/runtime/node_modules/node-pty/scripts/increment-version.js +54 -0
  280. package/runtime/node_modules/node-pty/scripts/post-install.js +80 -0
  281. package/runtime/node_modules/node-pty/scripts/prebuild.js +34 -0
  282. package/runtime/node_modules/node-pty/src/conpty_console_list_agent.ts +15 -0
  283. package/runtime/node_modules/node-pty/src/eventEmitter2.test.ts +30 -0
  284. package/runtime/node_modules/node-pty/src/eventEmitter2.ts +48 -0
  285. package/runtime/node_modules/node-pty/src/index.ts +52 -0
  286. package/runtime/node_modules/node-pty/src/interfaces.ts +130 -0
  287. package/runtime/node_modules/node-pty/src/native.d.ts +54 -0
  288. package/runtime/node_modules/node-pty/src/shared/conout.ts +15 -0
  289. package/runtime/node_modules/node-pty/src/terminal.test.ts +119 -0
  290. package/runtime/node_modules/node-pty/src/terminal.ts +211 -0
  291. package/runtime/node_modules/node-pty/src/testUtils.test.ts +23 -0
  292. package/runtime/node_modules/node-pty/src/tsconfig.json +22 -0
  293. package/runtime/node_modules/node-pty/src/types.ts +15 -0
  294. package/runtime/node_modules/node-pty/src/unix/pty.cc +799 -0
  295. package/runtime/node_modules/node-pty/src/unix/spawn-helper.cc +23 -0
  296. package/runtime/node_modules/node-pty/src/unixTerminal.test.ts +367 -0
  297. package/runtime/node_modules/node-pty/src/unixTerminal.ts +388 -0
  298. package/runtime/node_modules/node-pty/src/utils.ts +29 -0
  299. package/runtime/node_modules/node-pty/src/win/conpty.cc +583 -0
  300. package/runtime/node_modules/node-pty/src/win/conpty.h +41 -0
  301. package/runtime/node_modules/node-pty/src/win/conpty_console_list.cc +44 -0
  302. package/runtime/node_modules/node-pty/src/win/path_util.cc +95 -0
  303. package/runtime/node_modules/node-pty/src/win/path_util.h +26 -0
  304. package/runtime/node_modules/node-pty/src/win/winpty.cc +333 -0
  305. package/runtime/node_modules/node-pty/src/windowsConoutConnection.ts +82 -0
  306. package/runtime/node_modules/node-pty/src/windowsPtyAgent.test.ts +94 -0
  307. package/runtime/node_modules/node-pty/src/windowsPtyAgent.ts +321 -0
  308. package/runtime/node_modules/node-pty/src/windowsTerminal.test.ts +229 -0
  309. package/runtime/node_modules/node-pty/src/windowsTerminal.ts +203 -0
  310. package/runtime/node_modules/node-pty/src/worker/conoutSocketWorker.ts +22 -0
  311. package/runtime/node_modules/node-pty/third_party/conpty/1.23.251008001/win10-arm64/OpenConsole.exe +0 -0
  312. package/runtime/node_modules/node-pty/third_party/conpty/1.23.251008001/win10-arm64/conpty.dll +0 -0
  313. package/runtime/node_modules/node-pty/third_party/conpty/1.23.251008001/win10-x64/OpenConsole.exe +0 -0
  314. package/runtime/node_modules/node-pty/third_party/conpty/1.23.251008001/win10-x64/conpty.dll +0 -0
  315. package/runtime/node_modules/node-pty/typings/node-pty.d.ts +211 -0
  316. package/runtime/server.cjs +27142 -0
  317. package/support/terminal-config-command.cjs +579 -0
  318. package/support/windows/zterm-daemon.ps1 +438 -0
  319. package/zterm-package.json +26 -0
@@ -0,0 +1,438 @@
1
+ param(
2
+ [Parameter(ValueFromRemainingArguments = $true)]
3
+ [string[]]$Args
4
+ )
5
+
6
+ $ErrorActionPreference = "Stop"
7
+
8
+ function Resolve-PackageRoot {
9
+ if ($env:ZTERM_PACKAGE_ROOT) {
10
+ if (-not (Test-Path -LiteralPath $env:ZTERM_PACKAGE_ROOT)) {
11
+ throw "missing daemon package root: $env:ZTERM_PACKAGE_ROOT"
12
+ }
13
+ return (Resolve-Path -LiteralPath $env:ZTERM_PACKAGE_ROOT).Path
14
+ }
15
+ return (Resolve-Path -LiteralPath (Join-Path $PSScriptRoot "..\..")).Path
16
+ }
17
+
18
+ $PackageRoot = Resolve-PackageRoot
19
+ $NativeDir = Join-Path $PackageRoot "runtime"
20
+ $DagpipeNative = Join-Path $NativeDir "dagpipe.node"
21
+ if (-not (Test-Path -LiteralPath $DagpipeNative)) {
22
+ throw "missing daemon DAGPIPE native: $DagpipeNative"
23
+ }
24
+ $env:ZTERM_DAGPIPE_NATIVE = $DagpipeNative
25
+ $env:PATH = "$NativeDir;$env:PATH"
26
+ $RuntimeEntry = Join-Path $NativeDir "server.cjs"
27
+ $TerminalConfigCommand = Join-Path $PackageRoot "support\terminal-config-command.cjs"
28
+ $NodeExe = if ($env:ZTERM_NODE_EXE) { $env:ZTERM_NODE_EXE } else { "node.exe" }
29
+ $HomeDir = [Environment]::GetFolderPath("UserProfile")
30
+ $ZtermHome = Join-Path $HomeDir ".zterm"
31
+ $RunDir = Join-Path $ZtermHome "run"
32
+ $LogDir = Join-Path $ZtermHome "logs"
33
+ $PidFile = Join-Path $RunDir "zterm-daemon.pid"
34
+ $TaskName = "ZTermDaemon"
35
+ $FirewallRuleName = "ZTerm Daemon 3333"
36
+
37
+ function Assert-TerminalConfigCommand {
38
+ if (-not (Test-Path -LiteralPath $TerminalConfigCommand)) {
39
+ throw "missing shared terminal config command: $TerminalConfigCommand"
40
+ }
41
+ }
42
+
43
+ function ConvertFrom-ShellSingleQuotedValue([string]$Value) {
44
+ if ($Value.Length -lt 2 -or $Value[0] -ne "'" -or $Value[$Value.Length - 1] -ne "'") {
45
+ throw "invalid terminal config shell value: $Value"
46
+ }
47
+ return $Value.Substring(1, $Value.Length - 2).Replace("'\''", "'")
48
+ }
49
+
50
+ function Invoke-TerminalConfigCommand([string[]]$CommandArgs) {
51
+ Assert-TerminalConfigCommand
52
+ $output = @(& $NodeExe $TerminalConfigCommand @CommandArgs)
53
+ if ($LASTEXITCODE -ne 0) {
54
+ throw "terminal-config-command failed with exit code $LASTEXITCODE"
55
+ }
56
+ return $output
57
+ }
58
+
59
+ function Read-DaemonConfig {
60
+ $values = @{}
61
+ foreach ($line in (Invoke-TerminalConfigCommand @("daemon-config", "--shell"))) {
62
+ if ($line -match '^(HOST|PORT|SESSION_NAME|AUTH_SOURCE|CONFIG_FOUND|CONFIG_DISPLAY_PATH)=(.*)$') {
63
+ $values[$Matches[1]] = ConvertFrom-ShellSingleQuotedValue $Matches[2]
64
+ }
65
+ }
66
+ foreach ($name in @("HOST", "PORT", "SESSION_NAME", "AUTH_SOURCE", "CONFIG_FOUND", "CONFIG_DISPLAY_PATH")) {
67
+ if (-not $values.ContainsKey($name)) {
68
+ throw "terminal config projection omitted $name"
69
+ }
70
+ }
71
+ [pscustomobject]@{
72
+ Host = [string]$values["HOST"]
73
+ Port = [int]$values["PORT"]
74
+ AuthSource = [string]$values["AUTH_SOURCE"]
75
+ ConfigPath = [string]$values["CONFIG_DISPLAY_PATH"]
76
+ ConfigFound = $values["CONFIG_FOUND"] -eq "1"
77
+ }
78
+ }
79
+
80
+ function Test-PortListening([int]$Port) {
81
+ $client = [System.Net.Sockets.TcpClient]::new()
82
+ try {
83
+ $task = $client.ConnectAsync("127.0.0.1", $Port)
84
+ if (-not $task.Wait(250)) { return $false }
85
+ return $client.Connected
86
+ } catch {
87
+ return $false
88
+ } finally {
89
+ $client.Dispose()
90
+ }
91
+ }
92
+
93
+ function Wait-PortListening([int]$Port) {
94
+ for ($i = 0; $i -lt 40; $i++) {
95
+ if (Test-PortListening $Port) { return $true }
96
+ Start-Sleep -Milliseconds 250
97
+ }
98
+ return $false
99
+ }
100
+
101
+ function Wait-PortClosed([int]$Port) {
102
+ for ($i = 0; $i -lt 40; $i++) {
103
+ if (-not (Test-PortListening $Port)) { return $true }
104
+ Start-Sleep -Milliseconds 250
105
+ }
106
+ return $false
107
+ }
108
+
109
+ function Read-DaemonPid {
110
+ if (-not (Test-Path -LiteralPath $PidFile)) { return $null }
111
+ $value = (Get-Content -LiteralPath $PidFile -Raw).Trim()
112
+ if (-not $value) { return $null }
113
+ return [int]$value
114
+ }
115
+
116
+ function Test-PidRunning([int]$ProcessId) {
117
+ try {
118
+ $process = Get-Process -Id $ProcessId -ErrorAction Stop
119
+ return $null -ne $process
120
+ } catch {
121
+ return $false
122
+ }
123
+ }
124
+
125
+ function Ensure-Dirs {
126
+ New-Item -ItemType Directory -Force -Path $ZtermHome, $RunDir, $LogDir | Out-Null
127
+ }
128
+
129
+ function Ensure-WindowsBackendEnv {
130
+ if (-not $env:ZTERM_TERMINAL_BACKEND) {
131
+ $env:ZTERM_TERMINAL_BACKEND = "wezterm"
132
+ }
133
+ if ($env:ZTERM_WEZTERM_EXE -and (Test-Path -LiteralPath $env:ZTERM_WEZTERM_EXE)) {
134
+ return
135
+ }
136
+ $pathCandidate = Get-Command "wezterm.exe" -ErrorAction SilentlyContinue
137
+ if ($pathCandidate -and $pathCandidate.Source) {
138
+ $env:ZTERM_WEZTERM_EXE = $pathCandidate.Source
139
+ return
140
+ }
141
+ $portableRoots = @(
142
+ "D:\zterm-tools\wezterm\portable",
143
+ (Join-Path $HomeDir "zterm-tools\wezterm\portable")
144
+ )
145
+ foreach ($root in $portableRoots) {
146
+ if (-not (Test-Path -LiteralPath $root)) {
147
+ continue
148
+ }
149
+ $candidate = Get-ChildItem -LiteralPath $root -Filter "wezterm.exe" -Recurse -ErrorAction SilentlyContinue |
150
+ Sort-Object FullName |
151
+ Select-Object -First 1
152
+ if ($candidate -and (Test-Path -LiteralPath $candidate.FullName)) {
153
+ $env:ZTERM_WEZTERM_EXE = $candidate.FullName
154
+ return
155
+ }
156
+ }
157
+ }
158
+
159
+ function Invoke-ConfigureRelay([string[]]$CommandArgs) {
160
+ $relayUrl = ""
161
+ $username = ""
162
+ $password = ""
163
+ $hostId = ""
164
+ $deviceId = ""
165
+ $deviceName = ""
166
+ $passwordStdin = $false
167
+ $restartAfterConfig = $false
168
+ for ($i = 0; $i -lt $CommandArgs.Count; $i++) {
169
+ switch ($CommandArgs[$i]) {
170
+ "--relay-url" { $i++; $relayUrl = $CommandArgs[$i]; continue }
171
+ "--username" { $i++; $username = $CommandArgs[$i]; continue }
172
+ "--password" { throw "relay passwords are accepted only with --password-stdin" }
173
+ "--password-env" { throw "relay passwords are accepted only with --password-stdin" }
174
+ "--password-stdin" { $password = [Console]::In.ReadLine(); $passwordStdin = $true; continue }
175
+ "--host-id" { $i++; $hostId = $CommandArgs[$i]; continue }
176
+ "--device-id" { $i++; $deviceId = $CommandArgs[$i]; continue }
177
+ "--device-name" { $i++; $deviceName = $CommandArgs[$i]; continue }
178
+ "--restart-service" { $restartAfterConfig = $true; continue }
179
+ "--no-restart" { $restartAfterConfig = $false; continue }
180
+ default { throw "unknown configure-relay option: $($CommandArgs[$i])" }
181
+ }
182
+ }
183
+ if (-not $relayUrl -or -not $username -or -not $password -or -not $hostId -or -not $passwordStdin) {
184
+ throw "configure-relay requires --relay-url, --username, --password-stdin, and --host-id"
185
+ }
186
+ Assert-TerminalConfigCommand
187
+ $commandArgs = @(
188
+ $TerminalConfigCommand,
189
+ "configure-relay",
190
+ "--relay-url", $relayUrl,
191
+ "--username", $username,
192
+ "--host-id", $hostId,
193
+ "--password-stdin"
194
+ )
195
+ if ($deviceId) { $commandArgs += @("--device-id", $deviceId) }
196
+ if ($deviceName) { $commandArgs += @("--device-name", $deviceName) }
197
+ $password | & $NodeExe @commandArgs
198
+ if ($LASTEXITCODE -ne 0) {
199
+ throw "terminal-config-command failed with exit code $LASTEXITCODE"
200
+ }
201
+ if ($restartAfterConfig) { Invoke-Restart }
202
+ }
203
+
204
+ function Invoke-Config {
205
+ Invoke-TerminalConfigCommand @("daemon-config") | Write-Output
206
+ }
207
+
208
+ function Invoke-Run {
209
+ if (-not (Test-Path -LiteralPath $RuntimeEntry)) {
210
+ throw "missing daemon runtime: $RuntimeEntry"
211
+ }
212
+ Ensure-Dirs
213
+ Ensure-WindowsBackendEnv
214
+ Set-Location $HomeDir
215
+ & $NodeExe $RuntimeEntry
216
+ }
217
+
218
+ function Invoke-StartDirect {
219
+ $config = Read-DaemonConfig
220
+ Ensure-Dirs
221
+ $existingPid = Read-DaemonPid
222
+ if ($existingPid -and (Test-PidRunning $existingPid) -and (Test-PortListening $config.Port)) {
223
+ Write-Output "zterm daemon already running: pid=$existingPid host=$($config.Host) port=$($config.Port) auth=$($config.AuthSource)"
224
+ return
225
+ }
226
+ if ($existingPid -and -not (Test-PidRunning $existingPid)) {
227
+ Remove-Item -LiteralPath $PidFile -Force -ErrorAction SilentlyContinue
228
+ }
229
+ if (Test-PortListening $config.Port) {
230
+ throw "zterm daemon listener already exists on port $($config.Port), but managed pid truth is missing"
231
+ }
232
+ $timestamp = Get-Date -Format "yyyyMMdd-HHmmss"
233
+ $stdoutLog = Join-Path $LogDir "daemon-$($config.Port)-$timestamp.out.log"
234
+ $stderrLog = Join-Path $LogDir "daemon-$($config.Port)-$timestamp.err.log"
235
+ Ensure-WindowsBackendEnv
236
+ $process = Start-Process -FilePath $NodeExe -ArgumentList @($RuntimeEntry) -WorkingDirectory $HomeDir -WindowStyle Hidden -RedirectStandardOutput $stdoutLog -RedirectStandardError $stderrLog -PassThru
237
+ Set-Content -LiteralPath $PidFile -Value ([string]$process.Id)
238
+ if (-not (Wait-PortListening $config.Port)) {
239
+ if (Test-PidRunning $process.Id) {
240
+ Stop-Process -Id $process.Id -ErrorAction SilentlyContinue
241
+ }
242
+ Remove-Item -LiteralPath $PidFile -Force -ErrorAction SilentlyContinue
243
+ throw "zterm daemon failed to become ready on port $($config.Port); stdout=$stdoutLog stderr=$stderrLog"
244
+ }
245
+ Write-Output "zterm daemon started"
246
+ Write-Output "pid=$($process.Id)"
247
+ Write-Output "host=$($config.Host)"
248
+ Write-Output "port=$($config.Port)"
249
+ Write-Output "auth=$($config.AuthSource)"
250
+ Write-Output "config=$($config.ConfigPath)"
251
+ Write-Output "pidFile=$PidFile"
252
+ Write-Output "stdout=$stdoutLog"
253
+ Write-Output "stderr=$stderrLog"
254
+ }
255
+
256
+ function Invoke-StopDirect {
257
+ $config = Read-DaemonConfig
258
+ $daemonPid = Read-DaemonPid
259
+ if (-not $daemonPid) {
260
+ if (Test-PortListening $config.Port) {
261
+ throw "zterm daemon listener is up on port $($config.Port), but managed pid truth is missing"
262
+ }
263
+ Write-Output "zterm daemon not running ($($config.Port))"
264
+ return
265
+ }
266
+ if (-not (Test-PidRunning $daemonPid)) {
267
+ Remove-Item -LiteralPath $PidFile -Force -ErrorAction SilentlyContinue
268
+ if (Test-PortListening $config.Port) {
269
+ throw "zterm daemon listener is up on port $($config.Port), but pid $daemonPid is stale"
270
+ }
271
+ Write-Output "zterm daemon not running ($($config.Port))"
272
+ return
273
+ }
274
+ Stop-Process -Id $daemonPid -ErrorAction Stop
275
+ if (-not (Wait-PortClosed $config.Port)) {
276
+ throw "zterm daemon did not stop listening on port $($config.Port) after pid $daemonPid was terminated"
277
+ }
278
+ Remove-Item -LiteralPath $PidFile -Force -ErrorAction SilentlyContinue
279
+ Write-Output "zterm daemon stopped: pid=$daemonPid"
280
+ }
281
+
282
+ function Test-TaskInstalled {
283
+ $task = Get-ScheduledTask -TaskName $TaskName -ErrorAction SilentlyContinue
284
+ return $null -ne $task
285
+ }
286
+
287
+ function Ensure-FirewallRule {
288
+ $config = Read-DaemonConfig
289
+ $current = Get-NetFirewallRule -DisplayName $FirewallRuleName -ErrorAction SilentlyContinue
290
+ if ($current) {
291
+ return
292
+ }
293
+ New-NetFirewallRule -DisplayName $FirewallRuleName -Direction Inbound -Action Allow -Protocol TCP -LocalPort $config.Port -Profile Any | Out-Null
294
+ }
295
+
296
+ function Invoke-InstallService {
297
+ Ensure-Dirs
298
+ Ensure-FirewallRule
299
+ if (Test-TaskInstalled) {
300
+ Unregister-ScheduledTask -TaskName $TaskName -Confirm:$false
301
+ }
302
+ $taskUser = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name
303
+ $action = New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`" run"
304
+ $triggers = @(
305
+ (New-ScheduledTaskTrigger -AtStartup),
306
+ (New-ScheduledTaskTrigger -AtLogOn -User $taskUser)
307
+ )
308
+ $principal = New-ScheduledTaskPrincipal -UserId $taskUser -LogonType S4U -RunLevel Highest
309
+ $settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -MultipleInstances IgnoreNew -RestartCount 3 -RestartInterval (New-TimeSpan -Minutes 1)
310
+ Register-ScheduledTask -TaskName $TaskName -Action $action -Trigger $triggers -Principal $principal -Settings $settings -Description "ZTerm Windows daemon" | Out-Null
311
+ Start-ScheduledTask -TaskName $TaskName
312
+ $config = Read-DaemonConfig
313
+ if (-not (Wait-PortListening $config.Port)) {
314
+ throw "zterm windows autostart service unhealthy after install: task=$TaskName port=$($config.Port)"
315
+ }
316
+ Write-Output "zterm windows autostart service installed: task=$TaskName port=$($config.Port)"
317
+ }
318
+
319
+ function Invoke-UninstallService {
320
+ if (Test-TaskInstalled) {
321
+ Stop-ScheduledTask -TaskName $TaskName -ErrorAction SilentlyContinue
322
+ Unregister-ScheduledTask -TaskName $TaskName -Confirm:$false
323
+ }
324
+ Write-Output "zterm windows autostart service uninstalled: task=$TaskName"
325
+ }
326
+
327
+ function Invoke-ServiceStatus {
328
+ $config = Read-DaemonConfig
329
+ if (-not (Test-TaskInstalled)) {
330
+ Write-Output "zterm windows autostart service not installed"
331
+ Write-Output "task=$TaskName"
332
+ exit 1
333
+ }
334
+ $task = Get-ScheduledTask -TaskName $TaskName
335
+ if (Test-PortListening $config.Port) {
336
+ Write-Output "zterm windows autostart service running: task=$TaskName host=$($config.Host) port=$($config.Port) auth=$($config.AuthSource) state=$($task.State)"
337
+ return
338
+ }
339
+ Write-Output "zterm windows autostart service installed but unhealthy: task=$TaskName state=$($task.State) listener=down port=$($config.Port)"
340
+ exit 1
341
+ }
342
+
343
+ function Invoke-Status {
344
+ $config = Read-DaemonConfig
345
+ $daemonPid = Read-DaemonPid
346
+ if ($daemonPid -and (Test-PidRunning $daemonPid) -and (Test-PortListening $config.Port)) {
347
+ Write-Output "zterm daemon running: pid=$daemonPid host=$($config.Host) port=$($config.Port) auth=$($config.AuthSource)"
348
+ return
349
+ }
350
+ if (Test-PortListening $config.Port) {
351
+ Write-Output "zterm daemon listener is up on port $($config.Port), but managed pid truth is missing"
352
+ exit 1
353
+ }
354
+ Write-Output "zterm daemon not running ($($config.Port))"
355
+ Write-Output "config=$($config.ConfigPath) found=$($config.ConfigFound) auth=$($config.AuthSource)"
356
+ exit 1
357
+ }
358
+
359
+ function Invoke-Start {
360
+ if (Test-TaskInstalled) {
361
+ Start-ScheduledTask -TaskName $TaskName
362
+ $config = Read-DaemonConfig
363
+ if (-not (Wait-PortListening $config.Port)) {
364
+ throw "zterm windows autostart service unhealthy after start: task=$TaskName port=$($config.Port)"
365
+ }
366
+ Invoke-ServiceStatus
367
+ return
368
+ }
369
+ Invoke-StartDirect
370
+ }
371
+
372
+ function Invoke-Stop {
373
+ if (Test-TaskInstalled) {
374
+ Stop-ScheduledTask -TaskName $TaskName -ErrorAction SilentlyContinue
375
+ $config = Read-DaemonConfig
376
+ if (-not (Wait-PortClosed $config.Port)) {
377
+ throw "zterm windows autostart service did not stop listening on port $($config.Port)"
378
+ }
379
+ Write-Output "zterm windows autostart service stopped: task=$TaskName"
380
+ return
381
+ }
382
+ Invoke-StopDirect
383
+ }
384
+
385
+ function Invoke-Restart {
386
+ if (Test-TaskInstalled) {
387
+ Invoke-Stop
388
+ Start-ScheduledTask -TaskName $TaskName
389
+ $config = Read-DaemonConfig
390
+ if (-not (Wait-PortListening $config.Port)) {
391
+ throw "zterm windows autostart service unhealthy after restart: task=$TaskName port=$($config.Port)"
392
+ }
393
+ Invoke-ServiceStatus
394
+ return
395
+ }
396
+ Invoke-StopDirect
397
+ Invoke-StartDirect
398
+ }
399
+
400
+ function Show-Usage {
401
+ @"
402
+ Usage:
403
+ zterm-daemon run
404
+ zterm-daemon start
405
+ zterm-daemon status
406
+ zterm-daemon config
407
+ zterm-daemon stop
408
+ zterm-daemon restart
409
+ zterm-daemon configure-relay --relay-url URL --username USER --password-stdin --host-id HOST_ID [--device-name NAME] [--restart-service]
410
+ zterm-daemon install-service
411
+ zterm-daemon uninstall-service
412
+ zterm-daemon service-status
413
+ "@
414
+ }
415
+
416
+ $command = if ($Args.Count -gt 0) { $Args[0] } else { "help" }
417
+ $rest = if ($Args.Count -gt 1) { $Args[1..($Args.Count - 1)] } else { @() }
418
+
419
+ switch ($command) {
420
+ "run" { Invoke-Run }
421
+ "start" { Invoke-Start }
422
+ "status" { Invoke-Status }
423
+ "config" { Invoke-Config }
424
+ "stop" { Invoke-Stop }
425
+ "restart" { Invoke-Restart }
426
+ "configure-relay" { Invoke-ConfigureRelay $rest }
427
+ "install-service" { Invoke-InstallService }
428
+ "uninstall-service" { Invoke-UninstallService }
429
+ "service-status" { Invoke-ServiceStatus }
430
+ "help" { Show-Usage }
431
+ "-h" { Show-Usage }
432
+ "--help" { Show-Usage }
433
+ default {
434
+ Write-Error "unknown command: $command"
435
+ Show-Usage
436
+ exit 1
437
+ }
438
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "package": {
4
+ "name": "@jsonstudio/zterm-daemon-win32-x64",
5
+ "version": "0.1.3"
6
+ },
7
+ "platform": {
8
+ "os": "win32",
9
+ "arch": "x64",
10
+ "node": {
11
+ "minimum": "22.0.0",
12
+ "abi": "127"
13
+ }
14
+ },
15
+ "runtimeComponents": [
16
+ "runtime/server.cjs",
17
+ "runtime/dagpipe.node",
18
+ "runtime/node_modules/node-pty",
19
+ "runtime/node_modules/@roamhq/wrtc",
20
+ "runtime/node_modules/@roamhq/wrtc-win32-x64/package.json",
21
+ "runtime/node_modules/@roamhq/wrtc-win32-x64/index.js",
22
+ "runtime/node_modules/@roamhq/wrtc-win32-x64/wrtc.node",
23
+ "support/terminal-config-command.cjs",
24
+ "support/windows/zterm-daemon.ps1"
25
+ ]
26
+ }