@jingyi0605/codingns 0.8.0 → 0.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (620) hide show
  1. package/bin/codingns.mjs +180 -0
  2. package/dist/public/assets/{AdaptiveButlerPage-BsgVNRAa.js → AdaptiveButlerPage-CJw8Ae62.js} +3 -3
  3. package/dist/public/assets/App-BOHBGFOd.js +30 -0
  4. package/dist/public/assets/{BootstrapPage--MDOigQi.js → BootstrapPage-BxHQT4nA.js} +1 -1
  5. package/dist/public/assets/{ConversationPage-BBss5ED8.js → ConversationPage-DWFsF6BB.js} +6 -6
  6. package/dist/public/assets/{DesktopDetachPreviewPage-CB8DoqwU.js → DesktopDetachPreviewPage-DOgEjYEf.js} +1 -1
  7. package/dist/public/assets/DesktopModal-D_A8sgQU.js +1 -0
  8. package/dist/public/assets/DesktopWindowPage-DK7L7osV.js +2 -0
  9. package/dist/public/assets/FileContextPanel-BdCoubcJ.js +1 -0
  10. package/dist/public/assets/GitSidebar-BeZ0hj7A.js +6 -0
  11. package/dist/public/assets/MobileCreateSessionSheet-DfLMVu8q.js +1 -0
  12. package/dist/public/assets/MobileSheet-5kZ-w-gU.js +1 -0
  13. package/dist/public/assets/{MobileTopHeaderFrame-DGVOzXyg.js → MobileTopHeaderFrame-lcp2GscV.js} +1 -1
  14. package/dist/public/assets/MobileWorkspaceSwitcherHeader-C6JMiOq_.js +1 -0
  15. package/dist/public/assets/PluginAccessOverview-DGcKAMQl.js +1 -0
  16. package/dist/public/assets/PluginContainerPage-BlY-xJDh.js +1 -0
  17. package/dist/public/assets/PluginDetailPage-CAJ7LFpD.js +1 -0
  18. package/dist/public/assets/PluginsListPage-BxZG1NyT.js +1 -0
  19. package/dist/public/assets/{RelayConnectEntryPage-0MPPjxtQ.js → RelayConnectEntryPage-CfNO_TIl.js} +1 -1
  20. package/dist/public/assets/ServerSettingsModal-by36Z_5k.js +1 -0
  21. package/dist/public/assets/SessionIndexPage-DkBp9Mqz.js +1 -0
  22. package/dist/public/assets/SettingsPage-C-ASmJAG.js +2 -0
  23. package/dist/public/assets/TerminalManagerPanel-NVZRxxmH.js +1 -0
  24. package/dist/public/assets/{TerminalPage-B6Rdhylx.js → TerminalPage-C4LNoPBp.js} +3 -3
  25. package/dist/public/assets/TerminalRuntimeFallbackModal-Bzum5nZ0.js +1 -0
  26. package/dist/public/assets/ToolFilesPage-47zbdgTW.js +1 -0
  27. package/dist/public/assets/ToolGitPage-Fuk_b_jg.js +1 -0
  28. package/dist/public/assets/ToolProcessesPage-sWSMWD-9.js +1 -0
  29. package/dist/public/assets/ToolsHomePage-R1mZlbZi.js +1 -0
  30. package/dist/public/assets/WorkbenchLandingPage-CqmiFH2u.js +1 -0
  31. package/dist/public/assets/WorkbenchLayout-OFi6CWgH.js +244 -0
  32. package/dist/public/assets/WorkbenchModal-C7qoQElW.js +1 -0
  33. package/dist/public/assets/WorkbenchShellRoute-BAQe_E0O.js +1 -0
  34. package/dist/public/assets/WorkspaceDebugDetailPage-DhKa6e9y.js +1 -0
  35. package/dist/public/assets/WorkspaceDetailPage-BPsrFffw.js +1 -0
  36. package/dist/public/assets/WorkspaceHomePage-KAtqZOAb.js +1 -0
  37. package/dist/public/assets/{client-runtime-manager-DGdKvYzx.js → client-runtime-manager-wmCJZKYd.js} +1 -1
  38. package/dist/public/assets/file-tree-icon-Mg1DiBRX.js +590 -0
  39. package/dist/public/assets/{index-CcaQt50x.css → index-C4t-vvqk.css} +1 -1
  40. package/dist/public/assets/index-CL97fwWB.js +42 -0
  41. package/dist/public/assets/{login-direct-candidate-resolver-DEP_xCmR.js → login-direct-candidate-resolver-BOAgTuUf.js} +1 -1
  42. package/dist/public/assets/plugin-permission-copy-Cq99cnzV.js +1 -0
  43. package/dist/public/assets/plugins-api-BQTV5DOp.js +1 -0
  44. package/dist/public/assets/{preferences-service-CV6Ih0BG.js → preferences-service-DJxbEEeg.js} +1 -1
  45. package/dist/public/assets/realtime-client-CLafKzzJ.js +1 -0
  46. package/dist/public/assets/{relay-entry-C751A-Sm.js → relay-entry-D-LfvdiX.js} +1 -1
  47. package/dist/public/assets/{terminal-runtime-meta-CRAVR-8G.js → terminal-runtime-meta-BJmy8dyK.js} +1 -1
  48. package/dist/public/assets/useRegisteredDebugTemplates-DQAWVdCo.js +1 -0
  49. package/dist/public/assets/workbench-navigation-MEzCSmsK.js +1 -0
  50. package/dist/public/index.html +2 -2
  51. package/dist/server/config/env.d.ts +1 -0
  52. package/dist/server/config/env.js +4 -0
  53. package/dist/server/config/env.js.map +1 -1
  54. package/dist/server/helpers/wechat-claw-runtime/modules/runtime-state-store.js +1 -1
  55. package/dist/server/helpers/wechat-claw-runtime/modules/runtime-state-store.js.map +1 -1
  56. package/dist/server/main.js +2 -0
  57. package/dist/server/main.js.map +1 -1
  58. package/dist/server/modules/assistant-capability/assistant-capability-controller.d.ts +1 -0
  59. package/dist/server/modules/assistant-capability/assistant-capability-controller.js +1 -0
  60. package/dist/server/modules/assistant-capability/assistant-capability-controller.js.map +1 -1
  61. package/dist/server/modules/assistant-capability/assistant-capability-service.d.ts +1 -0
  62. package/dist/server/modules/assistant-capability/assistant-capability-service.js +1 -0
  63. package/dist/server/modules/assistant-capability/assistant-capability-service.js.map +1 -1
  64. package/dist/server/modules/browser-runtime/browser-runtime-controller.d.ts +2 -1
  65. package/dist/server/modules/browser-runtime/browser-runtime-controller.js +1 -0
  66. package/dist/server/modules/browser-runtime/browser-runtime-controller.js.map +1 -1
  67. package/dist/server/modules/browser-runtime/browser-runtime-service.d.ts +4 -1
  68. package/dist/server/modules/browser-runtime/browser-runtime-service.js +40 -0
  69. package/dist/server/modules/browser-runtime/browser-runtime-service.js.map +1 -1
  70. package/dist/server/modules/browser-runtime/browser-task-payload.d.ts +2 -0
  71. package/dist/server/modules/browser-runtime/browser-task-payload.js.map +1 -1
  72. package/dist/server/modules/file/file-access-guard.d.ts +2 -0
  73. package/dist/server/modules/file/file-access-guard.js +24 -2
  74. package/dist/server/modules/file/file-access-guard.js.map +1 -1
  75. package/dist/server/modules/file/file-controller.d.ts +153 -1
  76. package/dist/server/modules/file/file-controller.js +215 -1
  77. package/dist/server/modules/file/file-controller.js.map +1 -1
  78. package/dist/server/modules/file/file-preview-link-service.d.ts +2 -0
  79. package/dist/server/modules/file/file-preview-link-service.js +5 -1
  80. package/dist/server/modules/file/file-preview-link-service.js.map +1 -1
  81. package/dist/server/modules/file/runtime/codingns-workspace-bridge.js +911 -0
  82. package/dist/server/modules/file/workspace-file-bridge-service.d.ts +126 -0
  83. package/dist/server/modules/file/workspace-file-bridge-service.js +471 -0
  84. package/dist/server/modules/file/workspace-file-bridge-service.js.map +1 -0
  85. package/dist/server/modules/file/workspace-file-bridge-watch-service.d.ts +42 -0
  86. package/dist/server/modules/file/workspace-file-bridge-watch-service.js +304 -0
  87. package/dist/server/modules/file/workspace-file-bridge-watch-service.js.map +1 -0
  88. package/dist/server/modules/git/git-command-helper-process.js +0 -18
  89. package/dist/server/modules/git/git-command-helper-process.js.map +1 -1
  90. package/dist/server/modules/git/git-command-runner.js +0 -18
  91. package/dist/server/modules/git/git-command-runner.js.map +1 -1
  92. package/dist/server/modules/model-switch/cc-switch-adapter.js +1 -1
  93. package/dist/server/modules/model-switch/cc-switch-adapter.js.map +1 -1
  94. package/dist/server/modules/plugins/plugin-controller.d.ts +131 -0
  95. package/dist/server/modules/plugins/plugin-controller.js +277 -0
  96. package/dist/server/modules/plugins/plugin-controller.js.map +1 -0
  97. package/dist/server/modules/plugins/plugin-file-gateway-service.d.ts +38 -0
  98. package/dist/server/modules/plugins/plugin-file-gateway-service.js +178 -0
  99. package/dist/server/modules/plugins/plugin-file-gateway-service.js.map +1 -0
  100. package/dist/server/modules/plugins/plugin-manifest.d.ts +8 -0
  101. package/dist/server/modules/plugins/plugin-manifest.js +420 -0
  102. package/dist/server/modules/plugins/plugin-manifest.js.map +1 -0
  103. package/dist/server/modules/plugins/plugin-permission-service.d.ts +49 -0
  104. package/dist/server/modules/plugins/plugin-permission-service.js +267 -0
  105. package/dist/server/modules/plugins/plugin-permission-service.js.map +1 -0
  106. package/dist/server/modules/plugins/plugin-process-runner.d.ts +21 -0
  107. package/dist/server/modules/plugins/plugin-process-runner.js +127 -0
  108. package/dist/server/modules/plugins/plugin-process-runner.js.map +1 -0
  109. package/dist/server/modules/plugins/plugin-registry-service.d.ts +41 -0
  110. package/dist/server/modules/plugins/plugin-registry-service.js +238 -0
  111. package/dist/server/modules/plugins/plugin-registry-service.js.map +1 -0
  112. package/dist/server/modules/plugins/plugin-runtime-service.d.ts +55 -0
  113. package/dist/server/modules/plugins/plugin-runtime-service.js +252 -0
  114. package/dist/server/modules/plugins/plugin-runtime-service.js.map +1 -0
  115. package/dist/server/modules/plugins/plugin-runtime-session-service.d.ts +21 -0
  116. package/dist/server/modules/plugins/plugin-runtime-session-service.js +83 -0
  117. package/dist/server/modules/plugins/plugin-runtime-session-service.js.map +1 -0
  118. package/dist/server/modules/plugins/plugin-scheduler-service.d.ts +31 -0
  119. package/dist/server/modules/plugins/plugin-scheduler-service.js +232 -0
  120. package/dist/server/modules/plugins/plugin-scheduler-service.js.map +1 -0
  121. package/dist/server/modules/plugins/plugin-static-service.d.ts +11 -0
  122. package/dist/server/modules/plugins/plugin-static-service.js +145 -0
  123. package/dist/server/modules/plugins/plugin-static-service.js.map +1 -0
  124. package/dist/server/modules/presentation/presentation-controller.d.ts +3 -0
  125. package/dist/server/modules/presentation/presentation-controller.js +11 -0
  126. package/dist/server/modules/presentation/presentation-controller.js.map +1 -1
  127. package/dist/server/modules/presentation/presentation-export-task-service.d.ts +6 -0
  128. package/dist/server/modules/presentation/presentation-export-task-service.js +52 -8
  129. package/dist/server/modules/presentation/presentation-export-task-service.js.map +1 -1
  130. package/dist/server/modules/presentation/presentation-pptx-export-service.js +200 -14
  131. package/dist/server/modules/presentation/presentation-pptx-export-service.js.map +1 -1
  132. package/dist/server/modules/presentation/presentation-renderer.d.ts +50 -0
  133. package/dist/server/modules/presentation/presentation-renderer.js +450 -37
  134. package/dist/server/modules/presentation/presentation-renderer.js.map +1 -1
  135. package/dist/server/modules/sessions/session-live-runtime-service.js +46 -3
  136. package/dist/server/modules/sessions/session-live-runtime-service.js.map +1 -1
  137. package/dist/server/modules/sessions/workspace-session-runtime-context-service.d.ts +1 -0
  138. package/dist/server/modules/sessions/workspace-session-runtime-context-service.js +11 -2
  139. package/dist/server/modules/sessions/workspace-session-runtime-context-service.js.map +1 -1
  140. package/dist/server/modules/skills/builtin-skills/codingns-workspace-session/SKILL.md +2 -2
  141. package/dist/server/modules/tasks/task-types.d.ts +2 -0
  142. package/dist/server/modules/tasks/task-types.js +2 -0
  143. package/dist/server/modules/tasks/task-types.js.map +1 -1
  144. package/dist/server/modules/terminal/runtime/terminal-log-writer-process.js +1 -1
  145. package/dist/server/modules/terminal/runtime/terminal-log-writer-process.js.map +1 -1
  146. package/dist/server/routes/files.js +40 -0
  147. package/dist/server/routes/files.js.map +1 -1
  148. package/dist/server/routes/plugins-public.d.ts +3 -0
  149. package/dist/server/routes/plugins-public.js +5 -0
  150. package/dist/server/routes/plugins-public.js.map +1 -0
  151. package/dist/server/routes/plugins.d.ts +3 -0
  152. package/dist/server/routes/plugins.js +19 -0
  153. package/dist/server/routes/plugins.js.map +1 -0
  154. package/dist/server/routes/presentation.js +1 -0
  155. package/dist/server/routes/presentation.js.map +1 -1
  156. package/dist/server/server/create-server.d.ts +20 -0
  157. package/dist/server/server/create-server.js +47 -1
  158. package/dist/server/server/create-server.js.map +1 -1
  159. package/dist/server/shared/http/error-handler.js +63 -25
  160. package/dist/server/shared/http/error-handler.js.map +1 -1
  161. package/dist/server/shared/runtime/better-sqlite3.d.ts +5 -0
  162. package/dist/server/shared/runtime/better-sqlite3.js +6 -0
  163. package/dist/server/shared/runtime/better-sqlite3.js.map +1 -0
  164. package/dist/server/shared/utils/install-console-timestamp-prefix.d.ts +1 -0
  165. package/dist/server/shared/utils/install-console-timestamp-prefix.js +28 -0
  166. package/dist/server/shared/utils/install-console-timestamp-prefix.js.map +1 -0
  167. package/dist/server/storage/repositories/plugin-audit-event-repository.d.ts +8 -0
  168. package/dist/server/storage/repositories/plugin-audit-event-repository.js +49 -0
  169. package/dist/server/storage/repositories/plugin-audit-event-repository.js.map +1 -0
  170. package/dist/server/storage/repositories/plugin-definition-repository.d.ts +10 -0
  171. package/dist/server/storage/repositories/plugin-definition-repository.js +84 -0
  172. package/dist/server/storage/repositories/plugin-definition-repository.js.map +1 -0
  173. package/dist/server/storage/repositories/plugin-enablement-repository.d.ts +9 -0
  174. package/dist/server/storage/repositories/plugin-enablement-repository.js +74 -0
  175. package/dist/server/storage/repositories/plugin-enablement-repository.js.map +1 -0
  176. package/dist/server/storage/repositories/plugin-permission-grant-repository.d.ts +12 -0
  177. package/dist/server/storage/repositories/plugin-permission-grant-repository.js +142 -0
  178. package/dist/server/storage/repositories/plugin-permission-grant-repository.js.map +1 -0
  179. package/dist/server/storage/repositories/plugin-run-repository.d.ts +10 -0
  180. package/dist/server/storage/repositories/plugin-run-repository.js +111 -0
  181. package/dist/server/storage/repositories/plugin-run-repository.js.map +1 -0
  182. package/dist/server/storage/repositories/plugin-runtime-session-repository.d.ts +10 -0
  183. package/dist/server/storage/repositories/plugin-runtime-session-repository.js +86 -0
  184. package/dist/server/storage/repositories/plugin-runtime-session-repository.js.map +1 -0
  185. package/dist/server/storage/sqlite/client.d.ts +2 -2
  186. package/dist/server/storage/sqlite/client.js +250 -1
  187. package/dist/server/storage/sqlite/client.js.map +1 -1
  188. package/dist/server/storage/sqlite/schema.sql +140 -0
  189. package/dist/server/types/domain.d.ts +122 -0
  190. package/node_modules/@codingns/session-sync-core/dist/claude-message-utils.d.ts +42 -0
  191. package/node_modules/@codingns/session-sync-core/dist/claude-message-utils.js +346 -0
  192. package/node_modules/@codingns/session-sync-core/dist/claude-message-utils.js.map +1 -0
  193. package/node_modules/@codingns/session-sync-core/dist/codex-resume-history.d.ts +1 -0
  194. package/node_modules/@codingns/session-sync-core/dist/codex-resume-history.js +80 -0
  195. package/node_modules/@codingns/session-sync-core/dist/codex-resume-history.js.map +1 -0
  196. package/node_modules/@codingns/session-sync-core/dist/index.d.ts +18 -0
  197. package/node_modules/@codingns/session-sync-core/dist/index.js +19 -0
  198. package/node_modules/@codingns/session-sync-core/dist/index.js.map +1 -0
  199. package/node_modules/@codingns/session-sync-core/dist/kimi-message-normalizer.d.ts +18 -0
  200. package/node_modules/@codingns/session-sync-core/dist/kimi-message-normalizer.js +659 -0
  201. package/node_modules/@codingns/session-sync-core/dist/kimi-message-normalizer.js.map +1 -0
  202. package/node_modules/@codingns/session-sync-core/dist/kimi-shared.d.ts +11 -0
  203. package/node_modules/@codingns/session-sync-core/dist/kimi-shared.js +72 -0
  204. package/node_modules/@codingns/session-sync-core/dist/kimi-shared.js.map +1 -0
  205. package/node_modules/@codingns/session-sync-core/dist/patch-builder.d.ts +67 -0
  206. package/node_modules/@codingns/session-sync-core/dist/patch-builder.js +752 -0
  207. package/node_modules/@codingns/session-sync-core/dist/patch-builder.js.map +1 -0
  208. package/node_modules/@codingns/session-sync-core/dist/providers/claude-code.d.ts +48 -0
  209. package/node_modules/@codingns/session-sync-core/dist/providers/claude-code.js +1184 -0
  210. package/node_modules/@codingns/session-sync-core/dist/providers/claude-code.js.map +1 -0
  211. package/node_modules/@codingns/session-sync-core/dist/providers/claude-session-store.d.ts +11 -0
  212. package/node_modules/@codingns/session-sync-core/dist/providers/claude-session-store.js +105 -0
  213. package/node_modules/@codingns/session-sync-core/dist/providers/claude-session-store.js.map +1 -0
  214. package/node_modules/@codingns/session-sync-core/dist/providers/codex.d.ts +84 -0
  215. package/node_modules/@codingns/session-sync-core/dist/providers/codex.js +2436 -0
  216. package/node_modules/@codingns/session-sync-core/dist/providers/codex.js.map +1 -0
  217. package/node_modules/@codingns/session-sync-core/dist/providers/gemini.d.ts +47 -0
  218. package/node_modules/@codingns/session-sync-core/dist/providers/gemini.js +1480 -0
  219. package/node_modules/@codingns/session-sync-core/dist/providers/gemini.js.map +1 -0
  220. package/node_modules/@codingns/session-sync-core/dist/providers/kimi.d.ts +33 -0
  221. package/node_modules/@codingns/session-sync-core/dist/providers/kimi.js +684 -0
  222. package/node_modules/@codingns/session-sync-core/dist/providers/kimi.js.map +1 -0
  223. package/node_modules/@codingns/session-sync-core/dist/providers/legna-code.d.ts +9 -0
  224. package/node_modules/@codingns/session-sync-core/dist/providers/legna-code.js +17 -0
  225. package/node_modules/@codingns/session-sync-core/dist/providers/legna-code.js.map +1 -0
  226. package/node_modules/@codingns/session-sync-core/dist/providers/opencode-permissions.d.ts +1 -0
  227. package/node_modules/@codingns/session-sync-core/dist/providers/opencode-permissions.js +8 -0
  228. package/node_modules/@codingns/session-sync-core/dist/providers/opencode-permissions.js.map +1 -0
  229. package/node_modules/@codingns/session-sync-core/dist/providers/opencode-shared.d.ts +48 -0
  230. package/node_modules/@codingns/session-sync-core/dist/providers/opencode-shared.js +373 -0
  231. package/node_modules/@codingns/session-sync-core/dist/providers/opencode-shared.js.map +1 -0
  232. package/node_modules/@codingns/session-sync-core/dist/providers/opencode.d.ts +61 -0
  233. package/node_modules/@codingns/session-sync-core/dist/providers/opencode.js +1191 -0
  234. package/node_modules/@codingns/session-sync-core/dist/providers/opencode.js.map +1 -0
  235. package/node_modules/@codingns/session-sync-core/dist/providers/utils.d.ts +27 -0
  236. package/node_modules/@codingns/session-sync-core/dist/providers/utils.js +415 -0
  237. package/node_modules/@codingns/session-sync-core/dist/providers/utils.js.map +1 -0
  238. package/node_modules/@codingns/session-sync-core/dist/registry.d.ts +7 -0
  239. package/node_modules/@codingns/session-sync-core/dist/registry.js +22 -0
  240. package/node_modules/@codingns/session-sync-core/dist/registry.js.map +1 -0
  241. package/node_modules/@codingns/session-sync-core/dist/runtime/active-run-registry.d.ts +24 -0
  242. package/node_modules/@codingns/session-sync-core/dist/runtime/active-run-registry.js +329 -0
  243. package/node_modules/@codingns/session-sync-core/dist/runtime/active-run-registry.js.map +1 -0
  244. package/node_modules/@codingns/session-sync-core/dist/runtime/claude-runtime.d.ts +30 -0
  245. package/node_modules/@codingns/session-sync-core/dist/runtime/claude-runtime.js +939 -0
  246. package/node_modules/@codingns/session-sync-core/dist/runtime/claude-runtime.js.map +1 -0
  247. package/node_modules/@codingns/session-sync-core/dist/runtime/codex-permissions.d.ts +1 -0
  248. package/node_modules/@codingns/session-sync-core/dist/runtime/codex-permissions.js +16 -0
  249. package/node_modules/@codingns/session-sync-core/dist/runtime/codex-permissions.js.map +1 -0
  250. package/node_modules/@codingns/session-sync-core/dist/runtime/codex-runtime.d.ts +70 -0
  251. package/node_modules/@codingns/session-sync-core/dist/runtime/codex-runtime.js +2571 -0
  252. package/node_modules/@codingns/session-sync-core/dist/runtime/codex-runtime.js.map +1 -0
  253. package/node_modules/@codingns/session-sync-core/dist/runtime/gemini-runtime.d.ts +21 -0
  254. package/node_modules/@codingns/session-sync-core/dist/runtime/gemini-runtime.js +561 -0
  255. package/node_modules/@codingns/session-sync-core/dist/runtime/gemini-runtime.js.map +1 -0
  256. package/node_modules/@codingns/session-sync-core/dist/runtime/kimi-runtime.d.ts +38 -0
  257. package/node_modules/@codingns/session-sync-core/dist/runtime/kimi-runtime.js +911 -0
  258. package/node_modules/@codingns/session-sync-core/dist/runtime/kimi-runtime.js.map +1 -0
  259. package/node_modules/@codingns/session-sync-core/dist/runtime/legna-runtime.d.ts +15 -0
  260. package/node_modules/@codingns/session-sync-core/dist/runtime/legna-runtime.js +16 -0
  261. package/node_modules/@codingns/session-sync-core/dist/runtime/legna-runtime.js.map +1 -0
  262. package/node_modules/@codingns/session-sync-core/dist/runtime/opencode-runtime.d.ts +38 -0
  263. package/node_modules/@codingns/session-sync-core/dist/runtime/opencode-runtime.js +970 -0
  264. package/node_modules/@codingns/session-sync-core/dist/runtime/opencode-runtime.js.map +1 -0
  265. package/node_modules/@codingns/session-sync-core/dist/runtime/provider-runtime-service.d.ts +21 -0
  266. package/node_modules/@codingns/session-sync-core/dist/runtime/provider-runtime-service.js +168 -0
  267. package/node_modules/@codingns/session-sync-core/dist/runtime/provider-runtime-service.js.map +1 -0
  268. package/node_modules/@codingns/session-sync-core/dist/runtime/types.d.ts +152 -0
  269. package/node_modules/@codingns/session-sync-core/dist/runtime/types.js +2 -0
  270. package/node_modules/@codingns/session-sync-core/dist/runtime/types.js.map +1 -0
  271. package/node_modules/@codingns/session-sync-core/dist/services.d.ts +28 -0
  272. package/node_modules/@codingns/session-sync-core/dist/services.js +148 -0
  273. package/node_modules/@codingns/session-sync-core/dist/services.js.map +1 -0
  274. package/node_modules/@codingns/session-sync-core/dist/sqlite/node-sqlite.d.ts +6 -0
  275. package/node_modules/@codingns/session-sync-core/dist/sqlite/node-sqlite.js +9 -0
  276. package/node_modules/@codingns/session-sync-core/dist/sqlite/node-sqlite.js.map +1 -0
  277. package/node_modules/@codingns/session-sync-core/dist/types.d.ts +198 -0
  278. package/node_modules/@codingns/session-sync-core/dist/types.js +2 -0
  279. package/node_modules/@codingns/session-sync-core/dist/types.js.map +1 -0
  280. package/node_modules/@codingns/session-sync-core/package.json +33 -0
  281. package/package.json +15 -6
  282. package/scripts/postinstall.mjs +248 -11
  283. package/vendor/better-sqlite3-win32-x64-node22/LICENSE +21 -0
  284. package/vendor/better-sqlite3-win32-x64-node22/README.md +12 -0
  285. package/vendor/better-sqlite3-win32-x64-node22/README.upstream.md +99 -0
  286. package/vendor/better-sqlite3-win32-x64-node22/binding.gyp +38 -0
  287. package/vendor/better-sqlite3-win32-x64-node22/build/Release/better_sqlite3.node +0 -0
  288. package/vendor/better-sqlite3-win32-x64-node22/deps/common.gypi +68 -0
  289. package/vendor/better-sqlite3-win32-x64-node22/deps/copy.js +31 -0
  290. package/vendor/better-sqlite3-win32-x64-node22/deps/defines.gypi +41 -0
  291. package/vendor/better-sqlite3-win32-x64-node22/deps/download.sh +122 -0
  292. package/vendor/better-sqlite3-win32-x64-node22/deps/patches/1208.patch +15 -0
  293. package/vendor/better-sqlite3-win32-x64-node22/deps/sqlite3/sqlite3.c +265994 -0
  294. package/vendor/better-sqlite3-win32-x64-node22/deps/sqlite3/sqlite3.h +13968 -0
  295. package/vendor/better-sqlite3-win32-x64-node22/deps/sqlite3/sqlite3ext.h +730 -0
  296. package/vendor/better-sqlite3-win32-x64-node22/deps/sqlite3.gyp +80 -0
  297. package/vendor/better-sqlite3-win32-x64-node22/deps/test_extension.c +21 -0
  298. package/vendor/better-sqlite3-win32-x64-node22/lib/database.js +90 -0
  299. package/vendor/better-sqlite3-win32-x64-node22/lib/index.js +3 -0
  300. package/vendor/better-sqlite3-win32-x64-node22/lib/methods/aggregate.js +43 -0
  301. package/vendor/better-sqlite3-win32-x64-node22/lib/methods/backup.js +67 -0
  302. package/vendor/better-sqlite3-win32-x64-node22/lib/methods/function.js +31 -0
  303. package/vendor/better-sqlite3-win32-x64-node22/lib/methods/inspect.js +7 -0
  304. package/vendor/better-sqlite3-win32-x64-node22/lib/methods/pragma.js +12 -0
  305. package/vendor/better-sqlite3-win32-x64-node22/lib/methods/serialize.js +16 -0
  306. package/vendor/better-sqlite3-win32-x64-node22/lib/methods/table.js +189 -0
  307. package/vendor/better-sqlite3-win32-x64-node22/lib/methods/transaction.js +78 -0
  308. package/vendor/better-sqlite3-win32-x64-node22/lib/methods/wrappers.js +54 -0
  309. package/vendor/better-sqlite3-win32-x64-node22/lib/sqlite-error.js +20 -0
  310. package/vendor/better-sqlite3-win32-x64-node22/lib/util.js +12 -0
  311. package/vendor/better-sqlite3-win32-x64-node22/package.json +38 -0
  312. package/vendor/better-sqlite3-win32-x64-node22/scripts/verify-runtime.cjs +42 -0
  313. package/vendor/better-sqlite3-win32-x64-node22/src/addon.cpp +47 -0
  314. package/vendor/better-sqlite3-win32-x64-node22/src/better_sqlite3.cpp +74 -0
  315. package/vendor/better-sqlite3-win32-x64-node22/src/objects/backup.cpp +120 -0
  316. package/vendor/better-sqlite3-win32-x64-node22/src/objects/backup.hpp +36 -0
  317. package/vendor/better-sqlite3-win32-x64-node22/src/objects/database.cpp +417 -0
  318. package/vendor/better-sqlite3-win32-x64-node22/src/objects/database.hpp +103 -0
  319. package/vendor/better-sqlite3-win32-x64-node22/src/objects/statement-iterator.cpp +113 -0
  320. package/vendor/better-sqlite3-win32-x64-node22/src/objects/statement-iterator.hpp +50 -0
  321. package/vendor/better-sqlite3-win32-x64-node22/src/objects/statement.cpp +383 -0
  322. package/vendor/better-sqlite3-win32-x64-node22/src/objects/statement.hpp +58 -0
  323. package/vendor/better-sqlite3-win32-x64-node22/src/util/bind-map.cpp +73 -0
  324. package/vendor/better-sqlite3-win32-x64-node22/src/util/binder.cpp +193 -0
  325. package/vendor/better-sqlite3-win32-x64-node22/src/util/constants.cpp +172 -0
  326. package/vendor/better-sqlite3-win32-x64-node22/src/util/custom-aggregate.cpp +121 -0
  327. package/vendor/better-sqlite3-win32-x64-node22/src/util/custom-function.cpp +59 -0
  328. package/vendor/better-sqlite3-win32-x64-node22/src/util/custom-table.cpp +409 -0
  329. package/vendor/better-sqlite3-win32-x64-node22/src/util/data-converter.cpp +17 -0
  330. package/vendor/better-sqlite3-win32-x64-node22/src/util/data.cpp +194 -0
  331. package/vendor/better-sqlite3-win32-x64-node22/src/util/helpers.cpp +109 -0
  332. package/vendor/better-sqlite3-win32-x64-node22/src/util/macros.cpp +83 -0
  333. package/vendor/better-sqlite3-win32-x64-node22/src/util/query-macros.cpp +71 -0
  334. package/vendor/better-sqlite3-win32-x64-node22/src/util/row-builder.cpp +49 -0
  335. package/vendor/node-pty-fork/LICENSE +69 -0
  336. package/vendor/node-pty-fork/README.md +92 -0
  337. package/vendor/node-pty-fork/binding.gyp +117 -0
  338. package/vendor/node-pty-fork/deps/.editorconfig +2 -0
  339. package/vendor/node-pty-fork/deps/winpty/.drone.yml +17 -0
  340. package/vendor/node-pty-fork/deps/winpty/.gitattributes +19 -0
  341. package/vendor/node-pty-fork/deps/winpty/LICENSE +21 -0
  342. package/vendor/node-pty-fork/deps/winpty/Makefile +166 -0
  343. package/vendor/node-pty-fork/deps/winpty/README.md +151 -0
  344. package/vendor/node-pty-fork/deps/winpty/RELEASES.md +280 -0
  345. package/vendor/node-pty-fork/deps/winpty/VERSION.txt +1 -0
  346. package/vendor/node-pty-fork/deps/winpty/configure +167 -0
  347. package/vendor/node-pty-fork/deps/winpty/misc/BufferResizeTests.cc +90 -0
  348. package/vendor/node-pty-fork/deps/winpty/misc/ChangeScreenBuffer.cc +53 -0
  349. package/vendor/node-pty-fork/deps/winpty/misc/ClearConsole.cc +72 -0
  350. package/vendor/node-pty-fork/deps/winpty/misc/ConinMode.cc +117 -0
  351. package/vendor/node-pty-fork/deps/winpty/misc/ConinMode.ps1 +116 -0
  352. package/vendor/node-pty-fork/deps/winpty/misc/ConoutMode.cc +113 -0
  353. package/vendor/node-pty-fork/deps/winpty/misc/DebugClient.py +42 -0
  354. package/vendor/node-pty-fork/deps/winpty/misc/DebugServer.py +63 -0
  355. package/vendor/node-pty-fork/deps/winpty/misc/DumpLines.py +5 -0
  356. package/vendor/node-pty-fork/deps/winpty/misc/EnableExtendedFlags.txt +46 -0
  357. package/vendor/node-pty-fork/deps/winpty/misc/Font-Report-June2016/CP437-Consolas.txt +528 -0
  358. package/vendor/node-pty-fork/deps/winpty/misc/Font-Report-June2016/CP437-Lucida.txt +633 -0
  359. package/vendor/node-pty-fork/deps/winpty/misc/Font-Report-June2016/CP932.txt +630 -0
  360. package/vendor/node-pty-fork/deps/winpty/misc/Font-Report-June2016/CP936.txt +630 -0
  361. package/vendor/node-pty-fork/deps/winpty/misc/Font-Report-June2016/CP949.txt +630 -0
  362. package/vendor/node-pty-fork/deps/winpty/misc/Font-Report-June2016/CP950.txt +630 -0
  363. package/vendor/node-pty-fork/deps/winpty/misc/Font-Report-June2016/MinimumWindowWidths.txt +16 -0
  364. package/vendor/node-pty-fork/deps/winpty/misc/Font-Report-June2016/Results.txt +4 -0
  365. package/vendor/node-pty-fork/deps/winpty/misc/Font-Report-June2016/Windows10SetFontBugginess.txt +144 -0
  366. package/vendor/node-pty-fork/deps/winpty/misc/FontSurvey.cc +100 -0
  367. package/vendor/node-pty-fork/deps/winpty/misc/FormatChar.h +21 -0
  368. package/vendor/node-pty-fork/deps/winpty/misc/FreezePerfTest.cc +62 -0
  369. package/vendor/node-pty-fork/deps/winpty/misc/GetCh.cc +20 -0
  370. package/vendor/node-pty-fork/deps/winpty/misc/GetConsolePos.cc +41 -0
  371. package/vendor/node-pty-fork/deps/winpty/misc/GetFont.cc +261 -0
  372. package/vendor/node-pty-fork/deps/winpty/misc/IdentifyConsoleWindow.ps1 +51 -0
  373. package/vendor/node-pty-fork/deps/winpty/misc/IsNewConsole.cc +87 -0
  374. package/vendor/node-pty-fork/deps/winpty/misc/MouseInputNotes.txt +90 -0
  375. package/vendor/node-pty-fork/deps/winpty/misc/MoveConsoleWindow.cc +34 -0
  376. package/vendor/node-pty-fork/deps/winpty/misc/Notes.txt +219 -0
  377. package/vendor/node-pty-fork/deps/winpty/misc/OSVersion.cc +27 -0
  378. package/vendor/node-pty-fork/deps/winpty/misc/ScreenBufferFreezeInactive.cc +101 -0
  379. package/vendor/node-pty-fork/deps/winpty/misc/ScreenBufferTest.cc +671 -0
  380. package/vendor/node-pty-fork/deps/winpty/misc/ScreenBufferTest2.cc +151 -0
  381. package/vendor/node-pty-fork/deps/winpty/misc/SelectAllTest.cc +45 -0
  382. package/vendor/node-pty-fork/deps/winpty/misc/SetBufferSize.cc +32 -0
  383. package/vendor/node-pty-fork/deps/winpty/misc/SetCursorPos.cc +10 -0
  384. package/vendor/node-pty-fork/deps/winpty/misc/SetFont.cc +145 -0
  385. package/vendor/node-pty-fork/deps/winpty/misc/SetWindowRect.cc +36 -0
  386. package/vendor/node-pty-fork/deps/winpty/misc/ShowArgv.cc +12 -0
  387. package/vendor/node-pty-fork/deps/winpty/misc/ShowConsoleInput.cc +40 -0
  388. package/vendor/node-pty-fork/deps/winpty/misc/Spew.py +5 -0
  389. package/vendor/node-pty-fork/deps/winpty/misc/TestUtil.cc +172 -0
  390. package/vendor/node-pty-fork/deps/winpty/misc/UnicodeDoubleWidthTest.cc +102 -0
  391. package/vendor/node-pty-fork/deps/winpty/misc/UnicodeWideTest1.cc +246 -0
  392. package/vendor/node-pty-fork/deps/winpty/misc/UnicodeWideTest2.cc +130 -0
  393. package/vendor/node-pty-fork/deps/winpty/misc/UnixEcho.cc +89 -0
  394. package/vendor/node-pty-fork/deps/winpty/misc/Utf16Echo.cc +46 -0
  395. package/vendor/node-pty-fork/deps/winpty/misc/VeryLargeRead.cc +122 -0
  396. package/vendor/node-pty-fork/deps/winpty/misc/VkEscapeTest.cc +56 -0
  397. package/vendor/node-pty-fork/deps/winpty/misc/Win10ResizeWhileFrozen.cc +52 -0
  398. package/vendor/node-pty-fork/deps/winpty/misc/Win10WrapTest1.cc +57 -0
  399. package/vendor/node-pty-fork/deps/winpty/misc/Win10WrapTest2.cc +30 -0
  400. package/vendor/node-pty-fork/deps/winpty/misc/Win32Echo1.cc +26 -0
  401. package/vendor/node-pty-fork/deps/winpty/misc/Win32Echo2.cc +19 -0
  402. package/vendor/node-pty-fork/deps/winpty/misc/Win32Test1.cc +46 -0
  403. package/vendor/node-pty-fork/deps/winpty/misc/Win32Test2.cc +70 -0
  404. package/vendor/node-pty-fork/deps/winpty/misc/Win32Test3.cc +78 -0
  405. package/vendor/node-pty-fork/deps/winpty/misc/Win32Write1.cc +44 -0
  406. package/vendor/node-pty-fork/deps/winpty/misc/WindowsBugCrashReader.cc +27 -0
  407. package/vendor/node-pty-fork/deps/winpty/misc/WriteConsole.cc +106 -0
  408. package/vendor/node-pty-fork/deps/winpty/misc/build32.sh +9 -0
  409. package/vendor/node-pty-fork/deps/winpty/misc/build64.sh +9 -0
  410. package/vendor/node-pty-fork/deps/winpty/misc/color-test.sh +212 -0
  411. package/vendor/node-pty-fork/deps/winpty/misc/font-notes.txt +300 -0
  412. package/vendor/node-pty-fork/deps/winpty/misc/winbug-15048.cc +201 -0
  413. package/vendor/node-pty-fork/deps/winpty/ship/build-pty4j-libpty.bat +36 -0
  414. package/vendor/node-pty-fork/deps/winpty/ship/common_ship.py +53 -0
  415. package/vendor/node-pty-fork/deps/winpty/ship/make_msvc_package.py +165 -0
  416. package/vendor/node-pty-fork/deps/winpty/ship/ship.py +108 -0
  417. package/vendor/node-pty-fork/deps/winpty/src/agent/Agent.cc +605 -0
  418. package/vendor/node-pty-fork/deps/winpty/src/agent/Agent.h +103 -0
  419. package/vendor/node-pty-fork/deps/winpty/src/agent/AgentCreateDesktop.cc +84 -0
  420. package/vendor/node-pty-fork/deps/winpty/src/agent/AgentCreateDesktop.h +28 -0
  421. package/vendor/node-pty-fork/deps/winpty/src/agent/ConsoleFont.cc +632 -0
  422. package/vendor/node-pty-fork/deps/winpty/src/agent/ConsoleFont.h +28 -0
  423. package/vendor/node-pty-fork/deps/winpty/src/agent/ConsoleInput.cc +852 -0
  424. package/vendor/node-pty-fork/deps/winpty/src/agent/ConsoleInput.h +109 -0
  425. package/vendor/node-pty-fork/deps/winpty/src/agent/ConsoleInputReencoding.cc +121 -0
  426. package/vendor/node-pty-fork/deps/winpty/src/agent/ConsoleInputReencoding.h +36 -0
  427. package/vendor/node-pty-fork/deps/winpty/src/agent/ConsoleLine.cc +152 -0
  428. package/vendor/node-pty-fork/deps/winpty/src/agent/ConsoleLine.h +41 -0
  429. package/vendor/node-pty-fork/deps/winpty/src/agent/Coord.h +87 -0
  430. package/vendor/node-pty-fork/deps/winpty/src/agent/DebugShowInput.cc +239 -0
  431. package/vendor/node-pty-fork/deps/winpty/src/agent/DebugShowInput.h +32 -0
  432. package/vendor/node-pty-fork/deps/winpty/src/agent/DefaultInputMap.cc +422 -0
  433. package/vendor/node-pty-fork/deps/winpty/src/agent/DefaultInputMap.h +28 -0
  434. package/vendor/node-pty-fork/deps/winpty/src/agent/DsrSender.h +30 -0
  435. package/vendor/node-pty-fork/deps/winpty/src/agent/EventLoop.cc +99 -0
  436. package/vendor/node-pty-fork/deps/winpty/src/agent/EventLoop.h +47 -0
  437. package/vendor/node-pty-fork/deps/winpty/src/agent/InputMap.cc +246 -0
  438. package/vendor/node-pty-fork/deps/winpty/src/agent/InputMap.h +114 -0
  439. package/vendor/node-pty-fork/deps/winpty/src/agent/LargeConsoleRead.cc +71 -0
  440. package/vendor/node-pty-fork/deps/winpty/src/agent/LargeConsoleRead.h +68 -0
  441. package/vendor/node-pty-fork/deps/winpty/src/agent/NamedPipe.cc +378 -0
  442. package/vendor/node-pty-fork/deps/winpty/src/agent/NamedPipe.h +125 -0
  443. package/vendor/node-pty-fork/deps/winpty/src/agent/Scraper.cc +699 -0
  444. package/vendor/node-pty-fork/deps/winpty/src/agent/Scraper.h +103 -0
  445. package/vendor/node-pty-fork/deps/winpty/src/agent/SimplePool.h +75 -0
  446. package/vendor/node-pty-fork/deps/winpty/src/agent/SmallRect.h +143 -0
  447. package/vendor/node-pty-fork/deps/winpty/src/agent/Terminal.cc +535 -0
  448. package/vendor/node-pty-fork/deps/winpty/src/agent/Terminal.h +69 -0
  449. package/vendor/node-pty-fork/deps/winpty/src/agent/UnicodeEncoding.h +157 -0
  450. package/vendor/node-pty-fork/deps/winpty/src/agent/UnicodeEncodingTest.cc +189 -0
  451. package/vendor/node-pty-fork/deps/winpty/src/agent/Win32Console.cc +107 -0
  452. package/vendor/node-pty-fork/deps/winpty/src/agent/Win32Console.h +67 -0
  453. package/vendor/node-pty-fork/deps/winpty/src/agent/Win32ConsoleBuffer.cc +193 -0
  454. package/vendor/node-pty-fork/deps/winpty/src/agent/Win32ConsoleBuffer.h +99 -0
  455. package/vendor/node-pty-fork/deps/winpty/src/agent/main.cc +114 -0
  456. package/vendor/node-pty-fork/deps/winpty/src/agent/subdir.mk +61 -0
  457. package/vendor/node-pty-fork/deps/winpty/src/configurations.gypi +60 -0
  458. package/vendor/node-pty-fork/deps/winpty/src/debugserver/DebugServer.cc +117 -0
  459. package/vendor/node-pty-fork/deps/winpty/src/debugserver/subdir.mk +41 -0
  460. package/vendor/node-pty-fork/deps/winpty/src/include/winpty.h +242 -0
  461. package/vendor/node-pty-fork/deps/winpty/src/include/winpty_constants.h +131 -0
  462. package/vendor/node-pty-fork/deps/winpty/src/libwinpty/AgentLocation.cc +75 -0
  463. package/vendor/node-pty-fork/deps/winpty/src/libwinpty/AgentLocation.h +28 -0
  464. package/vendor/node-pty-fork/deps/winpty/src/libwinpty/LibWinptyException.h +54 -0
  465. package/vendor/node-pty-fork/deps/winpty/src/libwinpty/WinptyInternal.h +72 -0
  466. package/vendor/node-pty-fork/deps/winpty/src/libwinpty/subdir.mk +46 -0
  467. package/vendor/node-pty-fork/deps/winpty/src/libwinpty/winpty.cc +970 -0
  468. package/vendor/node-pty-fork/deps/winpty/src/shared/AgentMsg.h +38 -0
  469. package/vendor/node-pty-fork/deps/winpty/src/shared/BackgroundDesktop.cc +122 -0
  470. package/vendor/node-pty-fork/deps/winpty/src/shared/BackgroundDesktop.h +73 -0
  471. package/vendor/node-pty-fork/deps/winpty/src/shared/Buffer.cc +103 -0
  472. package/vendor/node-pty-fork/deps/winpty/src/shared/Buffer.h +102 -0
  473. package/vendor/node-pty-fork/deps/winpty/src/shared/DebugClient.cc +187 -0
  474. package/vendor/node-pty-fork/deps/winpty/src/shared/DebugClient.h +38 -0
  475. package/vendor/node-pty-fork/deps/winpty/src/shared/GenRandom.cc +138 -0
  476. package/vendor/node-pty-fork/deps/winpty/src/shared/GenRandom.h +55 -0
  477. package/vendor/node-pty-fork/deps/winpty/src/shared/GetCommitHash.bat +13 -0
  478. package/vendor/node-pty-fork/deps/winpty/src/shared/Mutex.h +54 -0
  479. package/vendor/node-pty-fork/deps/winpty/src/shared/OsModule.h +63 -0
  480. package/vendor/node-pty-fork/deps/winpty/src/shared/OwnedHandle.cc +36 -0
  481. package/vendor/node-pty-fork/deps/winpty/src/shared/OwnedHandle.h +45 -0
  482. package/vendor/node-pty-fork/deps/winpty/src/shared/PrecompiledHeader.h +43 -0
  483. package/vendor/node-pty-fork/deps/winpty/src/shared/StringBuilder.h +227 -0
  484. package/vendor/node-pty-fork/deps/winpty/src/shared/StringBuilderTest.cc +114 -0
  485. package/vendor/node-pty-fork/deps/winpty/src/shared/StringUtil.cc +55 -0
  486. package/vendor/node-pty-fork/deps/winpty/src/shared/StringUtil.h +80 -0
  487. package/vendor/node-pty-fork/deps/winpty/src/shared/TimeMeasurement.h +63 -0
  488. package/vendor/node-pty-fork/deps/winpty/src/shared/UnixCtrlChars.h +45 -0
  489. package/vendor/node-pty-fork/deps/winpty/src/shared/UpdateGenVersion.bat +20 -0
  490. package/vendor/node-pty-fork/deps/winpty/src/shared/WindowsSecurity.cc +460 -0
  491. package/vendor/node-pty-fork/deps/winpty/src/shared/WindowsSecurity.h +104 -0
  492. package/vendor/node-pty-fork/deps/winpty/src/shared/WindowsVersion.cc +252 -0
  493. package/vendor/node-pty-fork/deps/winpty/src/shared/WindowsVersion.h +29 -0
  494. package/vendor/node-pty-fork/deps/winpty/src/shared/WinptyAssert.cc +55 -0
  495. package/vendor/node-pty-fork/deps/winpty/src/shared/WinptyAssert.h +64 -0
  496. package/vendor/node-pty-fork/deps/winpty/src/shared/WinptyException.cc +57 -0
  497. package/vendor/node-pty-fork/deps/winpty/src/shared/WinptyException.h +43 -0
  498. package/vendor/node-pty-fork/deps/winpty/src/shared/WinptyVersion.cc +42 -0
  499. package/vendor/node-pty-fork/deps/winpty/src/shared/WinptyVersion.h +27 -0
  500. package/vendor/node-pty-fork/deps/winpty/src/shared/winpty_snprintf.h +99 -0
  501. package/vendor/node-pty-fork/deps/winpty/src/subdir.mk +5 -0
  502. package/vendor/node-pty-fork/deps/winpty/src/tests/subdir.mk +28 -0
  503. package/vendor/node-pty-fork/deps/winpty/src/tests/trivial_test.cc +158 -0
  504. package/vendor/node-pty-fork/deps/winpty/src/unix-adapter/InputHandler.cc +114 -0
  505. package/vendor/node-pty-fork/deps/winpty/src/unix-adapter/InputHandler.h +56 -0
  506. package/vendor/node-pty-fork/deps/winpty/src/unix-adapter/OutputHandler.cc +80 -0
  507. package/vendor/node-pty-fork/deps/winpty/src/unix-adapter/OutputHandler.h +53 -0
  508. package/vendor/node-pty-fork/deps/winpty/src/unix-adapter/Util.cc +86 -0
  509. package/vendor/node-pty-fork/deps/winpty/src/unix-adapter/Util.h +31 -0
  510. package/vendor/node-pty-fork/deps/winpty/src/unix-adapter/WakeupFd.cc +70 -0
  511. package/vendor/node-pty-fork/deps/winpty/src/unix-adapter/WakeupFd.h +42 -0
  512. package/vendor/node-pty-fork/deps/winpty/src/unix-adapter/main.cc +729 -0
  513. package/vendor/node-pty-fork/deps/winpty/src/unix-adapter/subdir.mk +41 -0
  514. package/vendor/node-pty-fork/deps/winpty/src/winpty.gyp +206 -0
  515. package/vendor/node-pty-fork/deps/winpty/vcbuild.bat +83 -0
  516. package/vendor/node-pty-fork/lib/conpty_console_list_agent.js +20 -0
  517. package/vendor/node-pty-fork/lib/conpty_console_list_agent.js.map +1 -0
  518. package/vendor/node-pty-fork/lib/eventEmitter2.js +47 -0
  519. package/vendor/node-pty-fork/lib/eventEmitter2.js.map +1 -0
  520. package/vendor/node-pty-fork/lib/eventEmitter2.test.js +30 -0
  521. package/vendor/node-pty-fork/lib/eventEmitter2.test.js.map +1 -0
  522. package/vendor/node-pty-fork/lib/index.js +51 -0
  523. package/vendor/node-pty-fork/lib/index.js.map +1 -0
  524. package/vendor/node-pty-fork/lib/interfaces.js +7 -0
  525. package/vendor/node-pty-fork/lib/interfaces.js.map +1 -0
  526. package/vendor/node-pty-fork/lib/shared/conout.js +11 -0
  527. package/vendor/node-pty-fork/lib/shared/conout.js.map +1 -0
  528. package/vendor/node-pty-fork/lib/terminal.js +190 -0
  529. package/vendor/node-pty-fork/lib/terminal.js.map +1 -0
  530. package/vendor/node-pty-fork/lib/terminal.test.js +139 -0
  531. package/vendor/node-pty-fork/lib/terminal.test.js.map +1 -0
  532. package/vendor/node-pty-fork/lib/testUtils.test.js +28 -0
  533. package/vendor/node-pty-fork/lib/testUtils.test.js.map +1 -0
  534. package/vendor/node-pty-fork/lib/types.js +7 -0
  535. package/vendor/node-pty-fork/lib/types.js.map +1 -0
  536. package/vendor/node-pty-fork/lib/unixTerminal.js +304 -0
  537. package/vendor/node-pty-fork/lib/unixTerminal.js.map +1 -0
  538. package/vendor/node-pty-fork/lib/unixTerminal.test.js +330 -0
  539. package/vendor/node-pty-fork/lib/unixTerminal.test.js.map +1 -0
  540. package/vendor/node-pty-fork/lib/utils.js +17 -0
  541. package/vendor/node-pty-fork/lib/utils.js.map +1 -0
  542. package/vendor/node-pty-fork/lib/windowsConoutConnection.js +122 -0
  543. package/vendor/node-pty-fork/lib/windowsConoutConnection.js.map +1 -0
  544. package/vendor/node-pty-fork/lib/windowsPtyAgent.js +324 -0
  545. package/vendor/node-pty-fork/lib/windowsPtyAgent.js.map +1 -0
  546. package/vendor/node-pty-fork/lib/windowsPtyAgent.test.js +90 -0
  547. package/vendor/node-pty-fork/lib/windowsPtyAgent.test.js.map +1 -0
  548. package/vendor/node-pty-fork/lib/windowsTerminal.js +201 -0
  549. package/vendor/node-pty-fork/lib/windowsTerminal.js.map +1 -0
  550. package/vendor/node-pty-fork/lib/windowsTerminal.test.js +203 -0
  551. package/vendor/node-pty-fork/lib/windowsTerminal.test.js.map +1 -0
  552. package/vendor/node-pty-fork/lib/worker/conoutSocketWorker.js +22 -0
  553. package/vendor/node-pty-fork/lib/worker/conoutSocketWorker.js.map +1 -0
  554. package/vendor/node-pty-fork/package.json +35 -0
  555. package/vendor/node-pty-fork/scripts/apply-patches.mjs +341 -0
  556. package/vendor/node-pty-fork/scripts/fetch-upstream.mjs +41 -0
  557. package/vendor/node-pty-fork/scripts/install-smoke.cjs +59 -0
  558. package/vendor/node-pty-fork/scripts/runtime-install-context.cjs +24 -0
  559. package/vendor/node-pty-fork/scripts/smoke-load.cjs +10 -0
  560. package/vendor/node-pty-fork/scripts/sync-upstream.mjs +29 -0
  561. package/vendor/node-pty-fork/scripts/verify-runtime.cjs +62 -0
  562. package/vendor/node-pty-fork/scripts/verify-runtime.test.cjs +52 -0
  563. package/vendor/node-pty-fork/scripts/verify-tarball.cjs +80 -0
  564. package/vendor/node-pty-fork/src/conpty_console_list_agent.ts +19 -0
  565. package/vendor/node-pty-fork/src/eventEmitter2.test.ts +30 -0
  566. package/vendor/node-pty-fork/src/eventEmitter2.ts +48 -0
  567. package/vendor/node-pty-fork/src/index.ts +51 -0
  568. package/vendor/node-pty-fork/src/interfaces.ts +129 -0
  569. package/vendor/node-pty-fork/src/native.d.ts +56 -0
  570. package/vendor/node-pty-fork/src/shared/conout.ts +15 -0
  571. package/vendor/node-pty-fork/src/terminal.test.ts +119 -0
  572. package/vendor/node-pty-fork/src/terminal.ts +211 -0
  573. package/vendor/node-pty-fork/src/testUtils.test.ts +23 -0
  574. package/vendor/node-pty-fork/src/tsconfig.json +22 -0
  575. package/vendor/node-pty-fork/src/types.ts +15 -0
  576. package/vendor/node-pty-fork/src/unix/pty.cc +826 -0
  577. package/vendor/node-pty-fork/src/unix/spawn-helper.cc +23 -0
  578. package/vendor/node-pty-fork/src/unixTerminal.test.ts +335 -0
  579. package/vendor/node-pty-fork/src/unixTerminal.ts +320 -0
  580. package/vendor/node-pty-fork/src/utils.ts +9 -0
  581. package/vendor/node-pty-fork/src/win/conpty.cc +500 -0
  582. package/vendor/node-pty-fork/src/win/conpty_console_list.cc +43 -0
  583. package/vendor/node-pty-fork/src/win/path_util.cc +73 -0
  584. package/vendor/node-pty-fork/src/win/path_util.h +22 -0
  585. package/vendor/node-pty-fork/src/win/winpty.cc +322 -0
  586. package/vendor/node-pty-fork/src/windowsConoutConnection.ts +79 -0
  587. package/vendor/node-pty-fork/src/windowsPtyAgent.test.ts +94 -0
  588. package/vendor/node-pty-fork/src/windowsPtyAgent.ts +323 -0
  589. package/vendor/node-pty-fork/src/windowsTerminal.test.ts +214 -0
  590. package/vendor/node-pty-fork/src/windowsTerminal.ts +208 -0
  591. package/vendor/node-pty-fork/src/worker/conoutSocketWorker.ts +22 -0
  592. package/vendor/node-pty-fork/typings/node-pty.d.ts +203 -0
  593. package/vendor-src/better-sqlite3-win32-x64-node22/README.md +12 -0
  594. package/dist/public/assets/App-tPcbyRdS.js +0 -30
  595. package/dist/public/assets/DesktopWindowPage-GtIx5m8K.js +0 -2
  596. package/dist/public/assets/FileContextPanel-BcM7AIT4.js +0 -1
  597. package/dist/public/assets/GitSidebar-CMtkaxuI.js +0 -6
  598. package/dist/public/assets/MobileCreateSessionSheet-CrFY41_8.js +0 -1
  599. package/dist/public/assets/MobileWorkspaceSwitcherHeader-DLkACTnQ.js +0 -1
  600. package/dist/public/assets/ServerSettingsModal-vgOhwus4.js +0 -1
  601. package/dist/public/assets/SessionIndexPage-KK626Ra9.js +0 -1
  602. package/dist/public/assets/SettingsPage-B3edBJIo.js +0 -2
  603. package/dist/public/assets/TerminalManagerPanel-BxlhZp8c.js +0 -1
  604. package/dist/public/assets/TerminalRuntimeFallbackModal-BVLfrpSa.js +0 -1
  605. package/dist/public/assets/ToolFilesPage-N_gwwUjD.js +0 -1
  606. package/dist/public/assets/ToolGitPage-DOcuuWM1.js +0 -1
  607. package/dist/public/assets/ToolProcessesPage-D-FfJ7Re.js +0 -1
  608. package/dist/public/assets/ToolsHomePage-CHfPxd20.js +0 -1
  609. package/dist/public/assets/WorkbenchLandingPage-CTTnfovY.js +0 -1
  610. package/dist/public/assets/WorkbenchLayout-CbpJg0g1.js +0 -244
  611. package/dist/public/assets/WorkbenchModal-Bt_1fYmM.js +0 -1
  612. package/dist/public/assets/WorkbenchShellRoute-DyaMnPfS.js +0 -1
  613. package/dist/public/assets/WorkspaceDebugDetailPage-s7yuDIxR.js +0 -1
  614. package/dist/public/assets/WorkspaceDetailPage-Cf-gVpqK.js +0 -1
  615. package/dist/public/assets/WorkspaceHomePage-COf6I8sT.js +0 -1
  616. package/dist/public/assets/file-tree-icon-BeHqeru9.js +0 -590
  617. package/dist/public/assets/index-CuzMc7q2.js +0 -42
  618. package/dist/public/assets/model-switch-api-c6kcbBGm.js +0 -1
  619. package/dist/public/assets/realtime-client-CRCx5xBt.js +0 -1
  620. package/dist/public/assets/useRegisteredDebugTemplates-D6YtNS0r.js +0 -1
@@ -0,0 +1,500 @@
1
+ /**
2
+ * Copyright (c) 2013-2015, Christopher Jeffrey, Peter Sunde (MIT License)
3
+ * Copyright (c) 2016, Daniel Imms (MIT License).
4
+ * Copyright (c) 2018, Microsoft Corporation (MIT License).
5
+ *
6
+ * pty.cc:
7
+ * This file is responsible for starting processes
8
+ * with pseudo-terminal file descriptors.
9
+ */
10
+
11
+ // node versions lower than 10 define this as 0x502 which disables many of the definitions needed to compile
12
+ #include <node_version.h>
13
+ #if NODE_MODULE_VERSION <= 57
14
+ #define _WIN32_WINNT 0x600
15
+ #endif
16
+
17
+ #include <iostream>
18
+ #include <nan.h>
19
+ #include <Shlwapi.h> // PathCombine, PathIsRelative
20
+ #include <sstream>
21
+ #include <string>
22
+ #include <vector>
23
+ #include <Windows.h>
24
+ #include <strsafe.h>
25
+ #include "path_util.h"
26
+
27
+ extern "C" void init(v8::Local<v8::Object>);
28
+
29
+ // Taken from the RS5 Windows SDK, but redefined here in case we're targeting <= 17134.
30
+ #ifndef PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE
31
+ #define PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE \
32
+ ProcThreadAttributeValue(22, FALSE, TRUE, FALSE)
33
+ #endif
34
+
35
+ #ifndef _HPCON_DEFINED
36
+ typedef VOID* HPCON;
37
+ #endif
38
+
39
+ typedef HRESULT (__stdcall *PFNCREATEPSEUDOCONSOLE)(COORD c, HANDLE hIn, HANDLE hOut, DWORD dwFlags, HPCON* phpcon);
40
+ typedef HRESULT (__stdcall *PFNRESIZEPSEUDOCONSOLE)(HPCON hpc, COORD newSize);
41
+ typedef HRESULT (__stdcall *PFNCLEARPSEUDOCONSOLE)(HPCON hpc);
42
+ typedef void (__stdcall *PFNCLOSEPSEUDOCONSOLE)(HPCON hpc);
43
+
44
+ struct pty_baton {
45
+ int id;
46
+ HANDLE hIn;
47
+ HANDLE hOut;
48
+ HPCON hpc;
49
+
50
+ HANDLE hShell;
51
+ HANDLE hWait;
52
+ Nan::Callback cb;
53
+ uv_async_t async;
54
+ uv_thread_t tid;
55
+
56
+ pty_baton(int _id, HANDLE _hIn, HANDLE _hOut, HPCON _hpc) : id(_id), hIn(_hIn), hOut(_hOut), hpc(_hpc) {};
57
+ };
58
+
59
+ static std::vector<pty_baton*> ptyHandles;
60
+ static volatile LONG ptyCounter;
61
+
62
+ static pty_baton* get_pty_baton(int id) {
63
+ for (size_t i = 0; i < ptyHandles.size(); ++i) {
64
+ pty_baton* ptyHandle = ptyHandles[i];
65
+ if (ptyHandle->id == id) {
66
+ return ptyHandle;
67
+ }
68
+ }
69
+ return nullptr;
70
+ }
71
+
72
+ template <typename T>
73
+ std::vector<T> vectorFromString(const std::basic_string<T> &str) {
74
+ return std::vector<T>(str.begin(), str.end());
75
+ }
76
+
77
+ void throwNanError(const Nan::FunctionCallbackInfo<v8::Value>* info, const char* text, const bool getLastError) {
78
+ std::stringstream errorText;
79
+ errorText << text;
80
+ if (getLastError) {
81
+ errorText << ", error code: " << GetLastError();
82
+ }
83
+ Nan::ThrowError(errorText.str().c_str());
84
+ (*info).GetReturnValue().SetUndefined();
85
+ }
86
+
87
+ // Returns a new server named pipe. It has not yet been connected.
88
+ bool createDataServerPipe(bool write,
89
+ std::wstring kind,
90
+ HANDLE* hServer,
91
+ std::wstring &name,
92
+ const std::wstring &pipeName)
93
+ {
94
+ *hServer = INVALID_HANDLE_VALUE;
95
+
96
+ name = L"\\\\.\\pipe\\" + pipeName + L"-" + kind;
97
+
98
+ const DWORD winOpenMode = PIPE_ACCESS_INBOUND | PIPE_ACCESS_OUTBOUND | FILE_FLAG_FIRST_PIPE_INSTANCE/* | FILE_FLAG_OVERLAPPED */;
99
+
100
+ SECURITY_ATTRIBUTES sa = {};
101
+ sa.nLength = sizeof(sa);
102
+
103
+ *hServer = CreateNamedPipeW(
104
+ name.c_str(),
105
+ /*dwOpenMode=*/winOpenMode,
106
+ /*dwPipeMode=*/PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT,
107
+ /*nMaxInstances=*/1,
108
+ /*nOutBufferSize=*/0,
109
+ /*nInBufferSize=*/0,
110
+ /*nDefaultTimeOut=*/30000,
111
+ &sa);
112
+
113
+ return *hServer != INVALID_HANDLE_VALUE;
114
+ }
115
+
116
+ HRESULT CreateNamedPipesAndPseudoConsole(COORD size,
117
+ DWORD dwFlags,
118
+ HANDLE *phInput,
119
+ HANDLE *phOutput,
120
+ HPCON* phPC,
121
+ std::wstring& inName,
122
+ std::wstring& outName,
123
+ const std::wstring& pipeName)
124
+ {
125
+ HANDLE hLibrary = LoadLibraryExW(L"kernel32.dll", 0, 0);
126
+ bool fLoadedDll = hLibrary != nullptr;
127
+ if (fLoadedDll)
128
+ {
129
+ PFNCREATEPSEUDOCONSOLE const pfnCreate = (PFNCREATEPSEUDOCONSOLE)GetProcAddress((HMODULE)hLibrary, "CreatePseudoConsole");
130
+ if (pfnCreate)
131
+ {
132
+ if (phPC == NULL || phInput == NULL || phOutput == NULL)
133
+ {
134
+ return E_INVALIDARG;
135
+ }
136
+
137
+ bool success = createDataServerPipe(true, L"in", phInput, inName, pipeName);
138
+ if (!success)
139
+ {
140
+ return HRESULT_FROM_WIN32(GetLastError());
141
+ }
142
+ success = createDataServerPipe(false, L"out", phOutput, outName, pipeName);
143
+ if (!success)
144
+ {
145
+ return HRESULT_FROM_WIN32(GetLastError());
146
+ }
147
+ return pfnCreate(size, *phInput, *phOutput, dwFlags, phPC);
148
+ }
149
+ else
150
+ {
151
+ // Failed to find CreatePseudoConsole in kernel32. This is likely because
152
+ // the user is not running a build of Windows that supports that API.
153
+ // We should fall back to winpty in this case.
154
+ return HRESULT_FROM_WIN32(GetLastError());
155
+ }
156
+ }
157
+
158
+ // Failed to find kernel32. This is realy unlikely - honestly no idea how
159
+ // this is even possible to hit. But if it does happen, fall back to winpty.
160
+ return HRESULT_FROM_WIN32(GetLastError());
161
+ }
162
+
163
+ static NAN_METHOD(PtyStartProcess) {
164
+ Nan::HandleScope scope;
165
+
166
+ v8::Local<v8::Object> marshal;
167
+ std::wstring inName, outName;
168
+ BOOL fSuccess = FALSE;
169
+ std::unique_ptr<wchar_t[]> mutableCommandline;
170
+ PROCESS_INFORMATION _piClient{};
171
+
172
+ if (info.Length() != 6 ||
173
+ !info[0]->IsString() ||
174
+ !info[1]->IsNumber() ||
175
+ !info[2]->IsNumber() ||
176
+ !info[3]->IsBoolean() ||
177
+ !info[4]->IsString() ||
178
+ !info[5]->IsBoolean()) {
179
+ Nan::ThrowError("Usage: pty.startProcess(file, cols, rows, debug, pipeName, inheritCursor)");
180
+ return;
181
+ }
182
+
183
+ const std::wstring filename(path_util::to_wstring(Nan::Utf8String(info[0])));
184
+ const SHORT cols = info[1]->Uint32Value(Nan::GetCurrentContext()).FromJust();
185
+ const SHORT rows = info[2]->Uint32Value(Nan::GetCurrentContext()).FromJust();
186
+ const bool debug = Nan::To<bool>(info[3]).FromJust();
187
+ const std::wstring pipeName(path_util::to_wstring(Nan::Utf8String(info[4])));
188
+ const bool inheritCursor = Nan::To<bool>(info[5]).FromJust();
189
+
190
+ // use environment 'Path' variable to determine location of
191
+ // the relative path that we have recieved (e.g cmd.exe)
192
+ std::wstring shellpath;
193
+ if (::PathIsRelativeW(filename.c_str())) {
194
+ shellpath = path_util::get_shell_path(filename.c_str());
195
+ } else {
196
+ shellpath = filename;
197
+ }
198
+
199
+ std::string shellpath_(shellpath.begin(), shellpath.end());
200
+
201
+ if (shellpath.empty() || !path_util::file_exists(shellpath)) {
202
+ std::stringstream why;
203
+ why << "File not found: " << shellpath_;
204
+ Nan::ThrowError(why.str().c_str());
205
+ return;
206
+ }
207
+
208
+ HANDLE hIn, hOut;
209
+ HPCON hpc;
210
+ HRESULT hr = CreateNamedPipesAndPseudoConsole({cols, rows}, inheritCursor ? 1/*PSEUDOCONSOLE_INHERIT_CURSOR*/ : 0, &hIn, &hOut, &hpc, inName, outName, pipeName);
211
+
212
+ // Restore default handling of ctrl+c
213
+ SetConsoleCtrlHandler(NULL, FALSE);
214
+
215
+ // Set return values
216
+ marshal = Nan::New<v8::Object>();
217
+
218
+ if (SUCCEEDED(hr)) {
219
+ // We were able to instantiate a conpty
220
+ const int ptyId = InterlockedIncrement(&ptyCounter);
221
+ Nan::Set(marshal, Nan::New<v8::String>("pty").ToLocalChecked(), Nan::New<v8::Number>(ptyId));
222
+ ptyHandles.insert(ptyHandles.end(), new pty_baton(ptyId, hIn, hOut, hpc));
223
+ } else {
224
+ Nan::ThrowError("Cannot launch conpty");
225
+ return;
226
+ }
227
+
228
+ Nan::Set(marshal, Nan::New<v8::String>("fd").ToLocalChecked(), Nan::New<v8::Number>(-1));
229
+ {
230
+ std::string coninPipeNameStr(inName.begin(), inName.end());
231
+ Nan::Set(marshal, Nan::New<v8::String>("conin").ToLocalChecked(), Nan::New<v8::String>(coninPipeNameStr).ToLocalChecked());
232
+
233
+ std::string conoutPipeNameStr(outName.begin(), outName.end());
234
+ Nan::Set(marshal, Nan::New<v8::String>("conout").ToLocalChecked(), Nan::New<v8::String>(conoutPipeNameStr).ToLocalChecked());
235
+ }
236
+ info.GetReturnValue().Set(marshal);
237
+ }
238
+
239
+ VOID CALLBACK OnProcessExitWinEvent(
240
+ _In_ PVOID context,
241
+ _In_ BOOLEAN TimerOrWaitFired) {
242
+ pty_baton *baton = static_cast<pty_baton*>(context);
243
+
244
+ // Fire OnProcessExit
245
+ uv_async_send(&baton->async);
246
+ }
247
+
248
+ static void OnProcessExit(uv_async_t *async) {
249
+ Nan::HandleScope scope;
250
+ pty_baton *baton = static_cast<pty_baton*>(async->data);
251
+
252
+ UnregisterWait(baton->hWait);
253
+
254
+ // Get exit code
255
+ DWORD exitCode = 0;
256
+ GetExitCodeProcess(baton->hShell, &exitCode);
257
+
258
+ // Call function
259
+ v8::Local<v8::Value> args[1] = {
260
+ Nan::New<v8::Number>(exitCode)
261
+ };
262
+
263
+ Nan::AsyncResource asyncResource("node-pty.callback");
264
+ baton->cb.Call(1, args, &asyncResource);
265
+ // Clean up
266
+ baton->cb.Reset();
267
+ }
268
+
269
+ static NAN_METHOD(PtyConnect) {
270
+ Nan::HandleScope scope;
271
+
272
+ // If we're working with conpty's we need to call ConnectNamedPipe here AFTER
273
+ // the Socket has attempted to connect to the other end, then actually
274
+ // spawn the process here.
275
+
276
+ std::stringstream errorText;
277
+ BOOL fSuccess = FALSE;
278
+
279
+ if (info.Length() != 5 ||
280
+ !info[0]->IsNumber() ||
281
+ !info[1]->IsString() ||
282
+ !info[2]->IsString() ||
283
+ !info[3]->IsArray() ||
284
+ !info[4]->IsFunction()) {
285
+ Nan::ThrowError("Usage: pty.connect(id, cmdline, cwd, env, exitCallback)");
286
+ return;
287
+ }
288
+
289
+ const int id = info[0]->Int32Value(Nan::GetCurrentContext()).FromJust();
290
+ const std::wstring cmdline(path_util::to_wstring(Nan::Utf8String(info[1])));
291
+ const std::wstring cwd(path_util::to_wstring(Nan::Utf8String(info[2])));
292
+ const v8::Local<v8::Array> envValues = info[3].As<v8::Array>();
293
+ const v8::Local<v8::Function> exitCallback = v8::Local<v8::Function>::Cast(info[4]);
294
+
295
+ // Fetch pty handle from ID and start process
296
+ pty_baton* handle = get_pty_baton(id);
297
+ if (!handle) {
298
+ Nan::ThrowError("Invalid pty handle");
299
+ return;
300
+ }
301
+
302
+ // Prepare command line
303
+ std::unique_ptr<wchar_t[]> mutableCommandline = std::make_unique<wchar_t[]>(cmdline.length() + 1);
304
+ HRESULT hr = StringCchCopyW(mutableCommandline.get(), cmdline.length() + 1, cmdline.c_str());
305
+
306
+ // Prepare cwd
307
+ std::unique_ptr<wchar_t[]> mutableCwd = std::make_unique<wchar_t[]>(cwd.length() + 1);
308
+ hr = StringCchCopyW(mutableCwd.get(), cwd.length() + 1, cwd.c_str());
309
+
310
+ // Prepare environment
311
+ std::wstring env;
312
+ if (!envValues.IsEmpty()) {
313
+ std::wstringstream envBlock;
314
+ for(uint32_t i = 0; i < envValues->Length(); i++) {
315
+ std::wstring envValue(path_util::to_wstring(Nan::Utf8String(Nan::Get(envValues, i).ToLocalChecked())));
316
+ envBlock << envValue << L'\0';
317
+ }
318
+ envBlock << L'\0';
319
+ env = envBlock.str();
320
+ }
321
+ auto envV = vectorFromString(env);
322
+ LPWSTR envArg = envV.empty() ? nullptr : envV.data();
323
+
324
+ ConnectNamedPipe(handle->hIn, nullptr);
325
+ ConnectNamedPipe(handle->hOut, nullptr);
326
+
327
+ // Attach the pseudoconsole to the client application we're creating
328
+ STARTUPINFOEXW siEx{0};
329
+ siEx.StartupInfo.cb = sizeof(STARTUPINFOEXW);
330
+ siEx.StartupInfo.dwFlags |= STARTF_USESTDHANDLES;
331
+ siEx.StartupInfo.hStdError = nullptr;
332
+ siEx.StartupInfo.hStdInput = nullptr;
333
+ siEx.StartupInfo.hStdOutput = nullptr;
334
+
335
+ SIZE_T size = 0;
336
+ InitializeProcThreadAttributeList(NULL, 1, 0, &size);
337
+ BYTE *attrList = new BYTE[size];
338
+ siEx.lpAttributeList = reinterpret_cast<PPROC_THREAD_ATTRIBUTE_LIST>(attrList);
339
+
340
+ fSuccess = InitializeProcThreadAttributeList(siEx.lpAttributeList, 1, 0, &size);
341
+ if (!fSuccess) {
342
+ return throwNanError(&info, "InitializeProcThreadAttributeList failed", true);
343
+ }
344
+ fSuccess = UpdateProcThreadAttribute(siEx.lpAttributeList,
345
+ 0,
346
+ PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE,
347
+ handle->hpc,
348
+ sizeof(HPCON),
349
+ NULL,
350
+ NULL);
351
+ if (!fSuccess) {
352
+ return throwNanError(&info, "UpdateProcThreadAttribute failed", true);
353
+ }
354
+
355
+ PROCESS_INFORMATION piClient{};
356
+ fSuccess = !!CreateProcessW(
357
+ nullptr,
358
+ mutableCommandline.get(),
359
+ nullptr, // lpProcessAttributes
360
+ nullptr, // lpThreadAttributes
361
+ false, // bInheritHandles VERY IMPORTANT that this is false
362
+ EXTENDED_STARTUPINFO_PRESENT | CREATE_UNICODE_ENVIRONMENT, // dwCreationFlags
363
+ envArg, // lpEnvironment
364
+ mutableCwd.get(), // lpCurrentDirectory
365
+ &siEx.StartupInfo, // lpStartupInfo
366
+ &piClient // lpProcessInformation
367
+ );
368
+ if (!fSuccess) {
369
+ return throwNanError(&info, "Cannot create process", true);
370
+ }
371
+
372
+ // Update handle
373
+ handle->hShell = piClient.hProcess;
374
+ handle->cb.Reset(exitCallback);
375
+ handle->async.data = handle;
376
+
377
+ // Setup OnProcessExit callback
378
+ uv_async_init(uv_default_loop(), &handle->async, OnProcessExit);
379
+
380
+ // Setup Windows wait for process exit event
381
+ RegisterWaitForSingleObject(&handle->hWait, piClient.hProcess, OnProcessExitWinEvent, (PVOID)handle, INFINITE, WT_EXECUTEONLYONCE);
382
+
383
+ // Return
384
+ v8::Local<v8::Object> marshal = Nan::New<v8::Object>();
385
+ Nan::Set(marshal, Nan::New<v8::String>("pid").ToLocalChecked(), Nan::New<v8::Number>(piClient.dwProcessId));
386
+ info.GetReturnValue().Set(marshal);
387
+ }
388
+
389
+ static NAN_METHOD(PtyResize) {
390
+ Nan::HandleScope scope;
391
+
392
+ if (info.Length() != 3 ||
393
+ !info[0]->IsNumber() ||
394
+ !info[1]->IsNumber() ||
395
+ !info[2]->IsNumber()) {
396
+ Nan::ThrowError("Usage: pty.resize(id, cols, rows)");
397
+ return;
398
+ }
399
+
400
+ int id = info[0]->Int32Value(Nan::GetCurrentContext()).FromJust();
401
+ SHORT cols = info[1]->Uint32Value(Nan::GetCurrentContext()).FromJust();
402
+ SHORT rows = info[2]->Uint32Value(Nan::GetCurrentContext()).FromJust();
403
+
404
+ const pty_baton* handle = get_pty_baton(id);
405
+
406
+ if (handle != nullptr) {
407
+ HANDLE hLibrary = LoadLibraryExW(L"kernel32.dll", 0, 0);
408
+ bool fLoadedDll = hLibrary != nullptr;
409
+ if (fLoadedDll)
410
+ {
411
+ PFNRESIZEPSEUDOCONSOLE const pfnResizePseudoConsole = (PFNRESIZEPSEUDOCONSOLE)GetProcAddress((HMODULE)hLibrary, "ResizePseudoConsole");
412
+ if (pfnResizePseudoConsole)
413
+ {
414
+ COORD size = {cols, rows};
415
+ pfnResizePseudoConsole(handle->hpc, size);
416
+ }
417
+ }
418
+ }
419
+
420
+ return info.GetReturnValue().SetUndefined();
421
+ }
422
+
423
+ static NAN_METHOD(PtyClear) {
424
+ Nan::HandleScope scope;
425
+
426
+ if (info.Length() != 1 ||
427
+ !info[0]->IsNumber()) {
428
+ Nan::ThrowError("Usage: pty.clear(id)");
429
+ return;
430
+ }
431
+
432
+ int id = info[0]->Int32Value(Nan::GetCurrentContext()).FromJust();
433
+
434
+ const pty_baton* handle = get_pty_baton(id);
435
+
436
+ if (handle != nullptr) {
437
+ HANDLE hLibrary = LoadLibraryExW(L"kernel32.dll", 0, 0);
438
+ bool fLoadedDll = hLibrary != nullptr;
439
+ if (fLoadedDll)
440
+ {
441
+ PFNCLEARPSEUDOCONSOLE const pfnClearPseudoConsole = (PFNCLEARPSEUDOCONSOLE)GetProcAddress((HMODULE)hLibrary, "ClearPseudoConsole");
442
+ if (pfnClearPseudoConsole)
443
+ {
444
+ pfnClearPseudoConsole(handle->hpc);
445
+ }
446
+ }
447
+ }
448
+
449
+ return info.GetReturnValue().SetUndefined();
450
+ }
451
+
452
+ static NAN_METHOD(PtyKill) {
453
+ Nan::HandleScope scope;
454
+
455
+ if (info.Length() != 1 ||
456
+ !info[0]->IsNumber()) {
457
+ Nan::ThrowError("Usage: pty.kill(id)");
458
+ return;
459
+ }
460
+
461
+ int id = info[0]->Int32Value(Nan::GetCurrentContext()).FromJust();
462
+
463
+ const pty_baton* handle = get_pty_baton(id);
464
+
465
+ if (handle != nullptr) {
466
+ HANDLE hLibrary = LoadLibraryExW(L"kernel32.dll", 0, 0);
467
+ bool fLoadedDll = hLibrary != nullptr;
468
+ if (fLoadedDll)
469
+ {
470
+ PFNCLOSEPSEUDOCONSOLE const pfnClosePseudoConsole = (PFNCLOSEPSEUDOCONSOLE)GetProcAddress((HMODULE)hLibrary, "ClosePseudoConsole");
471
+ if (pfnClosePseudoConsole)
472
+ {
473
+ pfnClosePseudoConsole(handle->hpc);
474
+ }
475
+ }
476
+
477
+ DisconnectNamedPipe(handle->hIn);
478
+ DisconnectNamedPipe(handle->hOut);
479
+ CloseHandle(handle->hIn);
480
+ CloseHandle(handle->hOut);
481
+ CloseHandle(handle->hShell);
482
+ }
483
+
484
+ return info.GetReturnValue().SetUndefined();
485
+ }
486
+
487
+ /**
488
+ * Init
489
+ */
490
+
491
+ extern "C" void init(v8::Local<v8::Object> target) {
492
+ Nan::HandleScope scope;
493
+ Nan::SetMethod(target, "startProcess", PtyStartProcess);
494
+ Nan::SetMethod(target, "connect", PtyConnect);
495
+ Nan::SetMethod(target, "resize", PtyResize);
496
+ Nan::SetMethod(target, "clear", PtyClear);
497
+ Nan::SetMethod(target, "kill", PtyKill);
498
+ };
499
+
500
+ NODE_MODULE(pty, init);
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Copyright (c) 2019, Microsoft Corporation (MIT License).
3
+ */
4
+
5
+ #include <nan.h>
6
+ #include <windows.h>
7
+
8
+ static NAN_METHOD(ApiConsoleProcessList) {
9
+ if (info.Length() != 1 ||
10
+ !info[0]->IsNumber()) {
11
+ Nan::ThrowError("Usage: getConsoleProcessList(shellPid)");
12
+ return;
13
+ }
14
+
15
+ const SHORT pid = info[0]->Uint32Value(Nan::GetCurrentContext()).FromJust();
16
+
17
+ if (!FreeConsole()) {
18
+ Nan::ThrowError("FreeConsole failed");
19
+ }
20
+ if (!AttachConsole(pid)) {
21
+ Nan::ThrowError("AttachConsole failed");
22
+ }
23
+ auto processList = std::vector<DWORD>(64);
24
+ auto processCount = GetConsoleProcessList(&processList[0], processList.size());
25
+ if (processList.size() < processCount) {
26
+ processList.resize(processCount);
27
+ processCount = GetConsoleProcessList(&processList[0], processList.size());
28
+ }
29
+ FreeConsole();
30
+
31
+ v8::Local<v8::Array> result = Nan::New<v8::Array>();
32
+ for (DWORD i = 0; i < processCount; i++) {
33
+ Nan::Set(result, i, Nan::New<v8::Number>(processList[i]));
34
+ }
35
+ info.GetReturnValue().Set(result);
36
+ }
37
+
38
+ extern "C" void init(v8::Local<v8::Object> target) {
39
+ Nan::HandleScope scope;
40
+ Nan::SetMethod(target, "getConsoleProcessList", ApiConsoleProcessList);
41
+ };
42
+
43
+ NODE_MODULE(pty, init);
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Copyright (c) 2013-2015, Christopher Jeffrey, Peter Sunde (MIT License)
3
+ * Copyright (c) 2016, Daniel Imms (MIT License).
4
+ * Copyright (c) 2018, Microsoft Corporation (MIT License).
5
+ */
6
+
7
+ #include <nan.h>
8
+ #include <Shlwapi.h> // PathCombine
9
+
10
+ #include "path_util.h"
11
+
12
+ namespace path_util {
13
+
14
+ const wchar_t* to_wstring(const Nan::Utf8String& str) {
15
+ const char *bytes = *str;
16
+ unsigned int sizeOfStr = MultiByteToWideChar(CP_UTF8, 0, bytes, -1, NULL, 0);
17
+ wchar_t *output = new wchar_t[sizeOfStr];
18
+ MultiByteToWideChar(CP_UTF8, 0, bytes, -1, output, sizeOfStr);
19
+ return output;
20
+ }
21
+
22
+ bool file_exists(std::wstring filename) {
23
+ DWORD attr = ::GetFileAttributesW(filename.c_str());
24
+ if (attr == INVALID_FILE_ATTRIBUTES || (attr & FILE_ATTRIBUTE_DIRECTORY)) {
25
+ return false;
26
+ }
27
+ return true;
28
+ }
29
+
30
+ // cmd.exe -> C:\Windows\system32\cmd.exe
31
+ std::wstring get_shell_path(std::wstring filename) {
32
+ std::wstring shellpath;
33
+
34
+ if (file_exists(filename)) {
35
+ return shellpath;
36
+ }
37
+
38
+ wchar_t buffer_[MAX_ENV];
39
+ int read = ::GetEnvironmentVariableW(L"Path", buffer_, MAX_ENV);
40
+ if (!read) {
41
+ return shellpath;
42
+ }
43
+
44
+ std::wstring delimiter = L";";
45
+ size_t pos = 0;
46
+ std::vector<std::wstring> paths;
47
+ std::wstring buffer(buffer_);
48
+ while ((pos = buffer.find(delimiter)) != std::wstring::npos) {
49
+ paths.push_back(buffer.substr(0, pos));
50
+ buffer.erase(0, pos + delimiter.length());
51
+ }
52
+
53
+ const wchar_t *filename_ = filename.c_str();
54
+
55
+ for (size_t i = 0; i < paths.size(); ++i) {
56
+ std::wstring path = paths[i];
57
+ wchar_t searchPath[MAX_PATH];
58
+ ::PathCombineW(searchPath, const_cast<wchar_t*>(path.c_str()), filename_);
59
+
60
+ if (searchPath == NULL) {
61
+ continue;
62
+ }
63
+
64
+ if (file_exists(searchPath)) {
65
+ shellpath = searchPath;
66
+ break;
67
+ }
68
+ }
69
+
70
+ return shellpath;
71
+ }
72
+
73
+ } // namespace path_util
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Copyright (c) 2013-2015, Christopher Jeffrey, Peter Sunde (MIT License)
3
+ * Copyright (c) 2016, Daniel Imms (MIT License).
4
+ * Copyright (c) 2018, Microsoft Corporation (MIT License).
5
+ */
6
+
7
+ #ifndef NODE_PTY_PATH_UTIL_H_
8
+ #define NODE_PTY_PATH_UTIL_H_
9
+
10
+ #include <nan.h>
11
+
12
+ #define MAX_ENV 65536
13
+
14
+ namespace path_util {
15
+
16
+ const wchar_t* to_wstring(const Nan::Utf8String& str);
17
+ bool file_exists(std::wstring filename);
18
+ std::wstring get_shell_path(std::wstring filename);
19
+
20
+ } // namespace path_util
21
+
22
+ #endif // NODE_PTY_PATH_UTIL_H_