@xylabs/aries 0.1.1

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 (421) hide show
  1. package/README.md +693 -0
  2. package/dist/actions/audit/auditPaths.mjs +22 -0
  3. package/dist/actions/audit/auditPaths.mjs.map +1 -0
  4. package/dist/actions/audit/index.mjs +739 -0
  5. package/dist/actions/audit/index.mjs.map +1 -0
  6. package/dist/actions/audit/installPlugin.mjs +298 -0
  7. package/dist/actions/audit/installPlugin.mjs.map +1 -0
  8. package/dist/actions/audit/listSessions.mjs +93 -0
  9. package/dist/actions/audit/listSessions.mjs.map +1 -0
  10. package/dist/actions/audit/openAuditDir.mjs +44 -0
  11. package/dist/actions/audit/openAuditDir.mjs.map +1 -0
  12. package/dist/actions/audit/searchAudit.mjs +77 -0
  13. package/dist/actions/audit/searchAudit.mjs.map +1 -0
  14. package/dist/actions/audit/showAiMeta.mjs +105 -0
  15. package/dist/actions/audit/showAiMeta.mjs.map +1 -0
  16. package/dist/actions/audit/showSession.mjs +105 -0
  17. package/dist/actions/audit/showSession.mjs.map +1 -0
  18. package/dist/actions/audit/statusAudit.mjs +98 -0
  19. package/dist/actions/audit/statusAudit.mjs.map +1 -0
  20. package/dist/actions/clamp/clampAudit.mjs +53 -0
  21. package/dist/actions/clamp/clampAudit.mjs.map +1 -0
  22. package/dist/actions/clamp/index.mjs +2258 -0
  23. package/dist/actions/clamp/index.mjs.map +1 -0
  24. package/dist/actions/clamp/ipcServer.mjs +55 -0
  25. package/dist/actions/clamp/ipcServer.mjs.map +1 -0
  26. package/dist/actions/clamp/policyManagement.mjs +144 -0
  27. package/dist/actions/clamp/policyManagement.mjs.map +1 -0
  28. package/dist/actions/clamp/promptUser.mjs +91 -0
  29. package/dist/actions/clamp/promptUser.mjs.map +1 -0
  30. package/dist/actions/clamp/runClamped.mjs +2107 -0
  31. package/dist/actions/clamp/runClamped.mjs.map +1 -0
  32. package/dist/actions/clamp/sandboxExec.mjs +1612 -0
  33. package/dist/actions/clamp/sandboxExec.mjs.map +1 -0
  34. package/dist/actions/clamp/shellEnvSetup.mjs +59 -0
  35. package/dist/actions/clamp/shellEnvSetup.mjs.map +1 -0
  36. package/dist/actions/clamp/shimGenerator.mjs +68 -0
  37. package/dist/actions/clamp/shimGenerator.mjs.map +1 -0
  38. package/dist/actions/clamp/terminalRenderer.mjs +145 -0
  39. package/dist/actions/clamp/terminalRenderer.mjs.map +1 -0
  40. package/dist/actions/datalake/audit/auditLog.mjs +191 -0
  41. package/dist/actions/datalake/audit/auditLog.mjs.map +1 -0
  42. package/dist/actions/datalake/createDatalake.mjs +127 -0
  43. package/dist/actions/datalake/createDatalake.mjs.map +1 -0
  44. package/dist/actions/datalake/describeDatalake.mjs +159 -0
  45. package/dist/actions/datalake/describeDatalake.mjs.map +1 -0
  46. package/dist/actions/datalake/destroyDatalake.mjs +34 -0
  47. package/dist/actions/datalake/destroyDatalake.mjs.map +1 -0
  48. package/dist/actions/datalake/dev/downDevServer.mjs +102 -0
  49. package/dist/actions/datalake/dev/downDevServer.mjs.map +1 -0
  50. package/dist/actions/datalake/dev/index.mjs +369 -0
  51. package/dist/actions/datalake/dev/index.mjs.map +1 -0
  52. package/dist/actions/datalake/dev/logsDevServer.mjs +44 -0
  53. package/dist/actions/datalake/dev/logsDevServer.mjs.map +1 -0
  54. package/dist/actions/datalake/dev/paths.mjs +25 -0
  55. package/dist/actions/datalake/dev/paths.mjs.map +1 -0
  56. package/dist/actions/datalake/dev/resetDevServer.mjs +118 -0
  57. package/dist/actions/datalake/dev/resetDevServer.mjs.map +1 -0
  58. package/dist/actions/datalake/dev/resolveServerBin.mjs +26 -0
  59. package/dist/actions/datalake/dev/resolveServerBin.mjs.map +1 -0
  60. package/dist/actions/datalake/dev/state.mjs +62 -0
  61. package/dist/actions/datalake/dev/state.mjs.map +1 -0
  62. package/dist/actions/datalake/dev/statusDevServer.mjs +101 -0
  63. package/dist/actions/datalake/dev/statusDevServer.mjs.map +1 -0
  64. package/dist/actions/datalake/dev/upDevServer.mjs +221 -0
  65. package/dist/actions/datalake/dev/upDevServer.mjs.map +1 -0
  66. package/dist/actions/datalake/dev/waitForHealth.mjs +22 -0
  67. package/dist/actions/datalake/dev/waitForHealth.mjs.map +1 -0
  68. package/dist/actions/datalake/formatters.mjs +90 -0
  69. package/dist/actions/datalake/formatters.mjs.map +1 -0
  70. package/dist/actions/datalake/grantAccess.mjs +116 -0
  71. package/dist/actions/datalake/grantAccess.mjs.map +1 -0
  72. package/dist/actions/datalake/index.mjs +361 -0
  73. package/dist/actions/datalake/index.mjs.map +1 -0
  74. package/dist/actions/datalake/listDatalakes.mjs +54 -0
  75. package/dist/actions/datalake/listDatalakes.mjs.map +1 -0
  76. package/dist/actions/datalake/login.mjs +20 -0
  77. package/dist/actions/datalake/login.mjs.map +1 -0
  78. package/dist/actions/datalake/logout.mjs +11 -0
  79. package/dist/actions/datalake/logout.mjs.map +1 -0
  80. package/dist/actions/datalake/mintToken.mjs +37 -0
  81. package/dist/actions/datalake/mintToken.mjs.map +1 -0
  82. package/dist/actions/datalake/parseSize.mjs +21 -0
  83. package/dist/actions/datalake/parseSize.mjs.map +1 -0
  84. package/dist/actions/datalake/payloads/fetchPayload.mjs +76 -0
  85. package/dist/actions/datalake/payloads/fetchPayload.mjs.map +1 -0
  86. package/dist/actions/datalake/payloads/index.mjs +271 -0
  87. package/dist/actions/datalake/payloads/index.mjs.map +1 -0
  88. package/dist/actions/datalake/payloads/mintAndConnect.mjs +46 -0
  89. package/dist/actions/datalake/payloads/mintAndConnect.mjs.map +1 -0
  90. package/dist/actions/datalake/payloads/parsePayloadsFile.mjs +71 -0
  91. package/dist/actions/datalake/payloads/parsePayloadsFile.mjs.map +1 -0
  92. package/dist/actions/datalake/payloads/pushPayloads.mjs +181 -0
  93. package/dist/actions/datalake/payloads/pushPayloads.mjs.map +1 -0
  94. package/dist/actions/datalake/payloads/tailPayloads.mjs +106 -0
  95. package/dist/actions/datalake/payloads/tailPayloads.mjs.map +1 -0
  96. package/dist/actions/datalake/resolveTarget.mjs +15 -0
  97. package/dist/actions/datalake/resolveTarget.mjs.map +1 -0
  98. package/dist/actions/datalake/revokeAccess.mjs +108 -0
  99. package/dist/actions/datalake/revokeAccess.mjs.map +1 -0
  100. package/dist/actions/datalake/useDatalake.mjs +22 -0
  101. package/dist/actions/datalake/useDatalake.mjs.map +1 -0
  102. package/dist/actions/detect/detectAiClients.mjs +405 -0
  103. package/dist/actions/detect/detectAiClients.mjs.map +1 -0
  104. package/dist/actions/detect/index.mjs +405 -0
  105. package/dist/actions/detect/index.mjs.map +1 -0
  106. package/dist/actions/hash/algorithms/blockhash.mjs +61 -0
  107. package/dist/actions/hash/algorithms/blockhash.mjs.map +1 -0
  108. package/dist/actions/hash/algorithms/chromaprint.mjs +205 -0
  109. package/dist/actions/hash/algorithms/chromaprint.mjs.map +1 -0
  110. package/dist/actions/hash/algorithms/dhash.mjs +75 -0
  111. package/dist/actions/hash/algorithms/dhash.mjs.map +1 -0
  112. package/dist/actions/hash/algorithms/index.mjs +818 -0
  113. package/dist/actions/hash/algorithms/index.mjs.map +1 -0
  114. package/dist/actions/hash/algorithms/nilsimsa.mjs +27 -0
  115. package/dist/actions/hash/algorithms/nilsimsa.mjs.map +1 -0
  116. package/dist/actions/hash/algorithms/pdq.mjs +83 -0
  117. package/dist/actions/hash/algorithms/pdq.mjs.map +1 -0
  118. package/dist/actions/hash/algorithms/phash.mjs +71 -0
  119. package/dist/actions/hash/algorithms/phash.mjs.map +1 -0
  120. package/dist/actions/hash/algorithms/sha256.mjs +24 -0
  121. package/dist/actions/hash/algorithms/sha256.mjs.map +1 -0
  122. package/dist/actions/hash/algorithms/ssdeep.mjs +203 -0
  123. package/dist/actions/hash/algorithms/ssdeep.mjs.map +1 -0
  124. package/dist/actions/hash/algorithms/tlsh.mjs +66 -0
  125. package/dist/actions/hash/algorithms/tlsh.mjs.map +1 -0
  126. package/dist/actions/hash/algorithms/types.mjs +1 -0
  127. package/dist/actions/hash/algorithms/types.mjs.map +1 -0
  128. package/dist/actions/hash/algorithms/videoFrames.mjs +404 -0
  129. package/dist/actions/hash/algorithms/videoFrames.mjs.map +1 -0
  130. package/dist/actions/hash/algorithms/xyo.mjs +30 -0
  131. package/dist/actions/hash/algorithms/xyo.mjs.map +1 -0
  132. package/dist/actions/hash/compareHashes.mjs +823 -0
  133. package/dist/actions/hash/compareHashes.mjs.map +1 -0
  134. package/dist/actions/hash/hashInput.mjs +868 -0
  135. package/dist/actions/hash/hashInput.mjs.map +1 -0
  136. package/dist/actions/hash/index.mjs +881 -0
  137. package/dist/actions/hash/index.mjs.map +1 -0
  138. package/dist/actions/hash/lib/hamming.mjs +44 -0
  139. package/dist/actions/hash/lib/hamming.mjs.map +1 -0
  140. package/dist/actions/hash/lib/levenshtein.mjs +36 -0
  141. package/dist/actions/hash/lib/levenshtein.mjs.map +1 -0
  142. package/dist/actions/hash/lib/runBinary.mjs +54 -0
  143. package/dist/actions/hash/lib/runBinary.mjs.map +1 -0
  144. package/dist/actions/hash/lib/which.mjs +36 -0
  145. package/dist/actions/hash/lib/which.mjs.map +1 -0
  146. package/dist/actions/hash/lib/withTempfile.mjs +19 -0
  147. package/dist/actions/hash/lib/withTempfile.mjs.map +1 -0
  148. package/dist/actions/index.mjs +4615 -0
  149. package/dist/actions/index.mjs.map +1 -0
  150. package/dist/actions/printVersion.mjs +12 -0
  151. package/dist/actions/printVersion.mjs.map +1 -0
  152. package/dist/actions/sync/index.mjs +51 -0
  153. package/dist/actions/sync/index.mjs.map +1 -0
  154. package/dist/actions/sync/syncAiConfig.mjs +51 -0
  155. package/dist/actions/sync/syncAiConfig.mjs.map +1 -0
  156. package/dist/actions/wallet/account/deriveAndAdd.mjs +394 -0
  157. package/dist/actions/wallet/account/deriveAndAdd.mjs.map +1 -0
  158. package/dist/actions/wallet/account/getActiveWallet.mjs +338 -0
  159. package/dist/actions/wallet/account/getActiveWallet.mjs.map +1 -0
  160. package/dist/actions/wallet/account/labelAccount.mjs +389 -0
  161. package/dist/actions/wallet/account/labelAccount.mjs.map +1 -0
  162. package/dist/actions/wallet/account/listAccounts.mjs +374 -0
  163. package/dist/actions/wallet/account/listAccounts.mjs.map +1 -0
  164. package/dist/actions/wallet/account/removeAccount.mjs +384 -0
  165. package/dist/actions/wallet/account/removeAccount.mjs.map +1 -0
  166. package/dist/actions/wallet/account/showAccount.mjs +368 -0
  167. package/dist/actions/wallet/account/showAccount.mjs.map +1 -0
  168. package/dist/actions/wallet/addressBook/storage.mjs +110 -0
  169. package/dist/actions/wallet/addressBook/storage.mjs.map +1 -0
  170. package/dist/actions/wallet/backup/exportBackup.mjs +93 -0
  171. package/dist/actions/wallet/backup/exportBackup.mjs.map +1 -0
  172. package/dist/actions/wallet/backup/importBackup.mjs +142 -0
  173. package/dist/actions/wallet/backup/importBackup.mjs.map +1 -0
  174. package/dist/actions/wallet/balance/getBalance.mjs +434 -0
  175. package/dist/actions/wallet/balance/getBalance.mjs.map +1 -0
  176. package/dist/actions/wallet/client/walletClient.mjs +64 -0
  177. package/dist/actions/wallet/client/walletClient.mjs.map +1 -0
  178. package/dist/actions/wallet/contact/contactActions.mjs +120 -0
  179. package/dist/actions/wallet/contact/contactActions.mjs.map +1 -0
  180. package/dist/actions/wallet/contact/storage.mjs +69 -0
  181. package/dist/actions/wallet/contact/storage.mjs.map +1 -0
  182. package/dist/actions/wallet/index.mjs +1439 -0
  183. package/dist/actions/wallet/index.mjs.map +1 -0
  184. package/dist/actions/wallet/network/networkActions.mjs +137 -0
  185. package/dist/actions/wallet/network/networkActions.mjs.map +1 -0
  186. package/dist/actions/wallet/network/storage.mjs +93 -0
  187. package/dist/actions/wallet/network/storage.mjs.map +1 -0
  188. package/dist/actions/wallet/password/changePassword.mjs +282 -0
  189. package/dist/actions/wallet/password/changePassword.mjs.map +1 -0
  190. package/dist/actions/wallet/password/getActiveKey.mjs +297 -0
  191. package/dist/actions/wallet/password/getActiveKey.mjs.map +1 -0
  192. package/dist/actions/wallet/password/initOrUnlock.mjs +337 -0
  193. package/dist/actions/wallet/password/initOrUnlock.mjs.map +1 -0
  194. package/dist/actions/wallet/password/passwordStorage.mjs +69 -0
  195. package/dist/actions/wallet/password/passwordStorage.mjs.map +1 -0
  196. package/dist/actions/wallet/password/setPassword.mjs +138 -0
  197. package/dist/actions/wallet/password/setPassword.mjs.map +1 -0
  198. package/dist/actions/wallet/password/validatePassword.mjs +123 -0
  199. package/dist/actions/wallet/password/validatePassword.mjs.map +1 -0
  200. package/dist/actions/wallet/passwordKey.mjs +87 -0
  201. package/dist/actions/wallet/passwordKey.mjs.map +1 -0
  202. package/dist/actions/wallet/paths.mjs +26 -0
  203. package/dist/actions/wallet/paths.mjs.map +1 -0
  204. package/dist/actions/wallet/prompt.mjs +93 -0
  205. package/dist/actions/wallet/prompt.mjs.map +1 -0
  206. package/dist/actions/wallet/seedPhrase/createPhrase.mjs +392 -0
  207. package/dist/actions/wallet/seedPhrase/createPhrase.mjs.map +1 -0
  208. package/dist/actions/wallet/seedPhrase/exportPhrase.mjs +334 -0
  209. package/dist/actions/wallet/seedPhrase/exportPhrase.mjs.map +1 -0
  210. package/dist/actions/wallet/seedPhrase/idGen.mjs +11 -0
  211. package/dist/actions/wallet/seedPhrase/idGen.mjs.map +1 -0
  212. package/dist/actions/wallet/seedPhrase/importPhrase.mjs +393 -0
  213. package/dist/actions/wallet/seedPhrase/importPhrase.mjs.map +1 -0
  214. package/dist/actions/wallet/seedPhrase/listPhrases.mjs +62 -0
  215. package/dist/actions/wallet/seedPhrase/listPhrases.mjs.map +1 -0
  216. package/dist/actions/wallet/seedPhrase/phraseStorage.mjs +89 -0
  217. package/dist/actions/wallet/seedPhrase/phraseStorage.mjs.map +1 -0
  218. package/dist/actions/wallet/seedPhrase/removePhrase.mjs +366 -0
  219. package/dist/actions/wallet/seedPhrase/removePhrase.mjs.map +1 -0
  220. package/dist/actions/wallet/seedPhrase/renamePhrase.mjs +78 -0
  221. package/dist/actions/wallet/seedPhrase/renamePhrase.mjs.map +1 -0
  222. package/dist/actions/wallet/seedPhrase/types.mjs +1 -0
  223. package/dist/actions/wallet/seedPhrase/types.mjs.map +1 -0
  224. package/dist/actions/wallet/seedPhrase/usePhrase.mjs +83 -0
  225. package/dist/actions/wallet/seedPhrase/usePhrase.mjs.map +1 -0
  226. package/dist/actions/wallet/session/machineId.mjs +145 -0
  227. package/dist/actions/wallet/session/machineId.mjs.map +1 -0
  228. package/dist/actions/wallet/session/sessionCache.mjs +221 -0
  229. package/dist/actions/wallet/session/sessionCache.mjs.map +1 -0
  230. package/dist/actions/wallet/session/unlock.mjs +307 -0
  231. package/dist/actions/wallet/session/unlock.mjs.map +1 -0
  232. package/dist/actions/wallet/sign/signPayload.mjs +637 -0
  233. package/dist/actions/wallet/sign/signPayload.mjs.map +1 -0
  234. package/dist/actions/wallet/storage.mjs +51 -0
  235. package/dist/actions/wallet/storage.mjs.map +1 -0
  236. package/dist/actions/wallet/transaction/broadcastTransaction.mjs +453 -0
  237. package/dist/actions/wallet/transaction/broadcastTransaction.mjs.map +1 -0
  238. package/dist/actions/wallet/transaction/sendTransaction.mjs +457 -0
  239. package/dist/actions/wallet/transaction/sendTransaction.mjs.map +1 -0
  240. package/dist/actions/wallet/transaction/signTransactionFile.mjs +378 -0
  241. package/dist/actions/wallet/transaction/signTransactionFile.mjs.map +1 -0
  242. package/dist/actions/xyo/index.mjs +138 -0
  243. package/dist/actions/xyo/index.mjs.map +1 -0
  244. package/dist/actions/xyo/transaction/index.mjs +138 -0
  245. package/dist/actions/xyo/transaction/index.mjs.map +1 -0
  246. package/dist/actions/xyo/transaction/validateTransactions.mjs +138 -0
  247. package/dist/actions/xyo/transaction/validateTransactions.mjs.map +1 -0
  248. package/dist/aries.mjs +8466 -0
  249. package/dist/aries.mjs.map +1 -0
  250. package/dist/bin/aries.mjs +8472 -0
  251. package/dist/bin/aries.mjs.map +1 -0
  252. package/dist/commands/aiCommand.mjs +492 -0
  253. package/dist/commands/aiCommand.mjs.map +1 -0
  254. package/dist/commands/auditAiCommand.mjs +119 -0
  255. package/dist/commands/auditAiCommand.mjs.map +1 -0
  256. package/dist/commands/auditCommand.mjs +857 -0
  257. package/dist/commands/auditCommand.mjs.map +1 -0
  258. package/dist/commands/auditInstallCommand.mjs +324 -0
  259. package/dist/commands/auditInstallCommand.mjs.map +1 -0
  260. package/dist/commands/auditListCommand.mjs +107 -0
  261. package/dist/commands/auditListCommand.mjs.map +1 -0
  262. package/dist/commands/auditOpenCommand.mjs +51 -0
  263. package/dist/commands/auditOpenCommand.mjs.map +1 -0
  264. package/dist/commands/auditSearchCommand.mjs +98 -0
  265. package/dist/commands/auditSearchCommand.mjs.map +1 -0
  266. package/dist/commands/auditShowCommand.mjs +123 -0
  267. package/dist/commands/auditShowCommand.mjs.map +1 -0
  268. package/dist/commands/auditStatusCommand.mjs +105 -0
  269. package/dist/commands/auditStatusCommand.mjs.map +1 -0
  270. package/dist/commands/clampCommand.mjs +2328 -0
  271. package/dist/commands/clampCommand.mjs.map +1 -0
  272. package/dist/commands/clampPolicyCommand.mjs +184 -0
  273. package/dist/commands/clampPolicyCommand.mjs.map +1 -0
  274. package/dist/commands/clampPolicyInitCommand.mjs +63 -0
  275. package/dist/commands/clampPolicyInitCommand.mjs.map +1 -0
  276. package/dist/commands/clampPolicyListCommand.mjs +56 -0
  277. package/dist/commands/clampPolicyListCommand.mjs.map +1 -0
  278. package/dist/commands/clampPolicyShowCommand.mjs +83 -0
  279. package/dist/commands/clampPolicyShowCommand.mjs.map +1 -0
  280. package/dist/commands/clampRunCommand.mjs +2137 -0
  281. package/dist/commands/clampRunCommand.mjs.map +1 -0
  282. package/dist/commands/datalakeAuditCommand.mjs +273 -0
  283. package/dist/commands/datalakeAuditCommand.mjs.map +1 -0
  284. package/dist/commands/datalakeCommand.mjs +1637 -0
  285. package/dist/commands/datalakeCommand.mjs.map +1 -0
  286. package/dist/commands/datalakeCreateCommand.mjs +189 -0
  287. package/dist/commands/datalakeCreateCommand.mjs.map +1 -0
  288. package/dist/commands/datalakeDescribeCommand.mjs +172 -0
  289. package/dist/commands/datalakeDescribeCommand.mjs.map +1 -0
  290. package/dist/commands/datalakeDestroyCommand.mjs +53 -0
  291. package/dist/commands/datalakeDestroyCommand.mjs.map +1 -0
  292. package/dist/commands/datalakeDevCommand.mjs +470 -0
  293. package/dist/commands/datalakeDevCommand.mjs.map +1 -0
  294. package/dist/commands/datalakeDevDownCommand.mjs +111 -0
  295. package/dist/commands/datalakeDevDownCommand.mjs.map +1 -0
  296. package/dist/commands/datalakeDevLogsCommand.mjs +65 -0
  297. package/dist/commands/datalakeDevLogsCommand.mjs.map +1 -0
  298. package/dist/commands/datalakeDevResetCommand.mjs +125 -0
  299. package/dist/commands/datalakeDevResetCommand.mjs.map +1 -0
  300. package/dist/commands/datalakeDevStatusCommand.mjs +110 -0
  301. package/dist/commands/datalakeDevStatusCommand.mjs.map +1 -0
  302. package/dist/commands/datalakeDevUpCommand.mjs +268 -0
  303. package/dist/commands/datalakeDevUpCommand.mjs.map +1 -0
  304. package/dist/commands/datalakeFetchCommand.mjs +106 -0
  305. package/dist/commands/datalakeFetchCommand.mjs.map +1 -0
  306. package/dist/commands/datalakeGrantCommand.mjs +147 -0
  307. package/dist/commands/datalakeGrantCommand.mjs.map +1 -0
  308. package/dist/commands/datalakeListCommand.mjs +61 -0
  309. package/dist/commands/datalakeListCommand.mjs.map +1 -0
  310. package/dist/commands/datalakeLoginCommand.mjs +39 -0
  311. package/dist/commands/datalakeLoginCommand.mjs.map +1 -0
  312. package/dist/commands/datalakeLogoutCommand.mjs +20 -0
  313. package/dist/commands/datalakeLogoutCommand.mjs.map +1 -0
  314. package/dist/commands/datalakePushCommand.mjs +214 -0
  315. package/dist/commands/datalakePushCommand.mjs.map +1 -0
  316. package/dist/commands/datalakeRevokeCommand.mjs +127 -0
  317. package/dist/commands/datalakeRevokeCommand.mjs.map +1 -0
  318. package/dist/commands/datalakeTailCommand.mjs +144 -0
  319. package/dist/commands/datalakeTailCommand.mjs.map +1 -0
  320. package/dist/commands/datalakeTokenCommand.mjs +61 -0
  321. package/dist/commands/datalakeTokenCommand.mjs.map +1 -0
  322. package/dist/commands/datalakeUseCommand.mjs +35 -0
  323. package/dist/commands/datalakeUseCommand.mjs.map +1 -0
  324. package/dist/commands/detectCommand.mjs +419 -0
  325. package/dist/commands/detectCommand.mjs.map +1 -0
  326. package/dist/commands/hashCommand.mjs +976 -0
  327. package/dist/commands/hashCommand.mjs.map +1 -0
  328. package/dist/commands/hashCompareCommand.mjs +865 -0
  329. package/dist/commands/hashCompareCommand.mjs.map +1 -0
  330. package/dist/commands/index.mjs +8461 -0
  331. package/dist/commands/index.mjs.map +1 -0
  332. package/dist/commands/syncCommand.mjs +66 -0
  333. package/dist/commands/syncCommand.mjs.map +1 -0
  334. package/dist/commands/versionCommand.mjs +24 -0
  335. package/dist/commands/versionCommand.mjs.map +1 -0
  336. package/dist/commands/walletAccountCommand.mjs +536 -0
  337. package/dist/commands/walletAccountCommand.mjs.map +1 -0
  338. package/dist/commands/walletAccountDeriveCommand.mjs +415 -0
  339. package/dist/commands/walletAccountDeriveCommand.mjs.map +1 -0
  340. package/dist/commands/walletAccountLabelCommand.mjs +405 -0
  341. package/dist/commands/walletAccountLabelCommand.mjs.map +1 -0
  342. package/dist/commands/walletAccountListCommand.mjs +381 -0
  343. package/dist/commands/walletAccountListCommand.mjs.map +1 -0
  344. package/dist/commands/walletAccountRemoveCommand.mjs +396 -0
  345. package/dist/commands/walletAccountRemoveCommand.mjs.map +1 -0
  346. package/dist/commands/walletAccountShowCommand.mjs +380 -0
  347. package/dist/commands/walletAccountShowCommand.mjs.map +1 -0
  348. package/dist/commands/walletBackupCommand.mjs +222 -0
  349. package/dist/commands/walletBackupCommand.mjs.map +1 -0
  350. package/dist/commands/walletBackupExportCommand.mjs +107 -0
  351. package/dist/commands/walletBackupExportCommand.mjs.map +1 -0
  352. package/dist/commands/walletBackupImportCommand.mjs +154 -0
  353. package/dist/commands/walletBackupImportCommand.mjs.map +1 -0
  354. package/dist/commands/walletBalanceCommand.mjs +448 -0
  355. package/dist/commands/walletBalanceCommand.mjs.map +1 -0
  356. package/dist/commands/walletCommand.mjs +1968 -0
  357. package/dist/commands/walletCommand.mjs.map +1 -0
  358. package/dist/commands/walletContactAddCommand.mjs +111 -0
  359. package/dist/commands/walletContactAddCommand.mjs.map +1 -0
  360. package/dist/commands/walletContactCommand.mjs +184 -0
  361. package/dist/commands/walletContactCommand.mjs.map +1 -0
  362. package/dist/commands/walletContactListCommand.mjs +66 -0
  363. package/dist/commands/walletContactListCommand.mjs.map +1 -0
  364. package/dist/commands/walletContactRemoveCommand.mjs +97 -0
  365. package/dist/commands/walletContactRemoveCommand.mjs.map +1 -0
  366. package/dist/commands/walletContactRenameCommand.mjs +114 -0
  367. package/dist/commands/walletContactRenameCommand.mjs.map +1 -0
  368. package/dist/commands/walletCreateCommand.mjs +407 -0
  369. package/dist/commands/walletCreateCommand.mjs.map +1 -0
  370. package/dist/commands/walletExportCommand.mjs +345 -0
  371. package/dist/commands/walletExportCommand.mjs.map +1 -0
  372. package/dist/commands/walletImportCommand.mjs +413 -0
  373. package/dist/commands/walletImportCommand.mjs.map +1 -0
  374. package/dist/commands/walletListCommand.mjs +69 -0
  375. package/dist/commands/walletListCommand.mjs.map +1 -0
  376. package/dist/commands/walletLockCommand.mjs +56 -0
  377. package/dist/commands/walletLockCommand.mjs.map +1 -0
  378. package/dist/commands/walletNetworkAddCommand.mjs +131 -0
  379. package/dist/commands/walletNetworkAddCommand.mjs.map +1 -0
  380. package/dist/commands/walletNetworkCommand.mjs +206 -0
  381. package/dist/commands/walletNetworkCommand.mjs.map +1 -0
  382. package/dist/commands/walletNetworkListCommand.mjs +104 -0
  383. package/dist/commands/walletNetworkListCommand.mjs.map +1 -0
  384. package/dist/commands/walletNetworkRemoveCommand.mjs +112 -0
  385. package/dist/commands/walletNetworkRemoveCommand.mjs.map +1 -0
  386. package/dist/commands/walletNetworkUseCommand.mjs +110 -0
  387. package/dist/commands/walletNetworkUseCommand.mjs.map +1 -0
  388. package/dist/commands/walletPasswordChangeCommand.mjs +291 -0
  389. package/dist/commands/walletPasswordChangeCommand.mjs.map +1 -0
  390. package/dist/commands/walletPasswordCommand.mjs +301 -0
  391. package/dist/commands/walletPasswordCommand.mjs.map +1 -0
  392. package/dist/commands/walletRemoveCommand.mjs +378 -0
  393. package/dist/commands/walletRemoveCommand.mjs.map +1 -0
  394. package/dist/commands/walletRenameCommand.mjs +94 -0
  395. package/dist/commands/walletRenameCommand.mjs.map +1 -0
  396. package/dist/commands/walletSignCommand.mjs +662 -0
  397. package/dist/commands/walletSignCommand.mjs.map +1 -0
  398. package/dist/commands/walletTxBroadcastCommand.mjs +473 -0
  399. package/dist/commands/walletTxBroadcastCommand.mjs.map +1 -0
  400. package/dist/commands/walletTxCommand.mjs +612 -0
  401. package/dist/commands/walletTxCommand.mjs.map +1 -0
  402. package/dist/commands/walletTxSendCommand.mjs +492 -0
  403. package/dist/commands/walletTxSendCommand.mjs.map +1 -0
  404. package/dist/commands/walletTxSignCommand.mjs +403 -0
  405. package/dist/commands/walletTxSignCommand.mjs.map +1 -0
  406. package/dist/commands/walletUnlockCommand.mjs +308 -0
  407. package/dist/commands/walletUnlockCommand.mjs.map +1 -0
  408. package/dist/commands/walletUseCommand.mjs +95 -0
  409. package/dist/commands/walletUseCommand.mjs.map +1 -0
  410. package/dist/commands/xyoCommand.mjs +188 -0
  411. package/dist/commands/xyoCommand.mjs.map +1 -0
  412. package/dist/commands/xyoTxCommand.mjs +178 -0
  413. package/dist/commands/xyoTxCommand.mjs.map +1 -0
  414. package/dist/commands/xyoTxValidateCommand.mjs +168 -0
  415. package/dist/commands/xyoTxValidateCommand.mjs.map +1 -0
  416. package/dist/index.d.ts +3 -0
  417. package/dist/index.mjs +8466 -0
  418. package/dist/index.mjs.map +1 -0
  419. package/dist/types/modules.d.mjs +1 -0
  420. package/dist/types/modules.d.mjs.map +1 -0
  421. package/package.json +197 -0
@@ -0,0 +1,1612 @@
1
+ var __getOwnPropNames = Object.getOwnPropertyNames;
2
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
3
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
4
+ }) : x)(function(x) {
5
+ if (typeof require !== "undefined") return require.apply(this, arguments);
6
+ throw Error('Dynamic require of "' + x + '" is not supported');
7
+ });
8
+ var __commonJS = (cb, mod) => function __require2() {
9
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
+ };
11
+
12
+ // ../../node_modules/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/utils.js
13
+ var require_utils = __commonJS({
14
+ "../../node_modules/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/utils.js"(exports) {
15
+ "use strict";
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.loadNativeModule = exports.assign = void 0;
18
+ function assign(target) {
19
+ var sources = [];
20
+ for (var _i = 1; _i < arguments.length; _i++) {
21
+ sources[_i - 1] = arguments[_i];
22
+ }
23
+ sources.forEach(function(source) {
24
+ return Object.keys(source).forEach(function(key) {
25
+ return target[key] = source[key];
26
+ });
27
+ });
28
+ return target;
29
+ }
30
+ exports.assign = assign;
31
+ function loadNativeModule(name) {
32
+ var dirs = ["build/Release", "build/Debug", "prebuilds/" + process.platform + "-" + process.arch];
33
+ var relative = ["..", "."];
34
+ var lastError;
35
+ for (var _i = 0, dirs_1 = dirs; _i < dirs_1.length; _i++) {
36
+ var d = dirs_1[_i];
37
+ for (var _a = 0, relative_1 = relative; _a < relative_1.length; _a++) {
38
+ var r = relative_1[_a];
39
+ var dir = r + "/" + d + "/";
40
+ try {
41
+ return { dir, module: __require(dir + "/" + name + ".node") };
42
+ } catch (e) {
43
+ lastError = e;
44
+ }
45
+ }
46
+ }
47
+ throw new Error("Failed to load native module: " + name + ".node, checked: " + dirs.join(", ") + ": " + lastError);
48
+ }
49
+ exports.loadNativeModule = loadNativeModule;
50
+ }
51
+ });
52
+
53
+ // ../../node_modules/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/eventEmitter2.js
54
+ var require_eventEmitter2 = __commonJS({
55
+ "../../node_modules/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/eventEmitter2.js"(exports) {
56
+ "use strict";
57
+ Object.defineProperty(exports, "__esModule", { value: true });
58
+ exports.EventEmitter2 = void 0;
59
+ var EventEmitter2 = (
60
+ /** @class */
61
+ (function() {
62
+ function EventEmitter22() {
63
+ this._listeners = [];
64
+ }
65
+ Object.defineProperty(EventEmitter22.prototype, "event", {
66
+ get: function() {
67
+ var _this = this;
68
+ if (!this._event) {
69
+ this._event = function(listener) {
70
+ _this._listeners.push(listener);
71
+ var disposable = {
72
+ dispose: function() {
73
+ for (var i = 0; i < _this._listeners.length; i++) {
74
+ if (_this._listeners[i] === listener) {
75
+ _this._listeners.splice(i, 1);
76
+ return;
77
+ }
78
+ }
79
+ }
80
+ };
81
+ return disposable;
82
+ };
83
+ }
84
+ return this._event;
85
+ },
86
+ enumerable: false,
87
+ configurable: true
88
+ });
89
+ EventEmitter22.prototype.fire = function(data) {
90
+ var queue = [];
91
+ for (var i = 0; i < this._listeners.length; i++) {
92
+ queue.push(this._listeners[i]);
93
+ }
94
+ for (var i = 0; i < queue.length; i++) {
95
+ queue[i].call(void 0, data);
96
+ }
97
+ };
98
+ return EventEmitter22;
99
+ })()
100
+ );
101
+ exports.EventEmitter2 = EventEmitter2;
102
+ }
103
+ });
104
+
105
+ // ../../node_modules/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/terminal.js
106
+ var require_terminal = __commonJS({
107
+ "../../node_modules/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/terminal.js"(exports) {
108
+ "use strict";
109
+ Object.defineProperty(exports, "__esModule", { value: true });
110
+ exports.Terminal = exports.DEFAULT_ROWS = exports.DEFAULT_COLS = void 0;
111
+ var events_1 = __require("events");
112
+ var eventEmitter2_1 = require_eventEmitter2();
113
+ exports.DEFAULT_COLS = 80;
114
+ exports.DEFAULT_ROWS = 24;
115
+ var FLOW_CONTROL_PAUSE = "";
116
+ var FLOW_CONTROL_RESUME = "";
117
+ var Terminal2 = (
118
+ /** @class */
119
+ (function() {
120
+ function Terminal3(opt) {
121
+ this._pid = 0;
122
+ this._fd = 0;
123
+ this._cols = 0;
124
+ this._rows = 0;
125
+ this._readable = false;
126
+ this._writable = false;
127
+ this._onData = new eventEmitter2_1.EventEmitter2();
128
+ this._onExit = new eventEmitter2_1.EventEmitter2();
129
+ this._internalee = new events_1.EventEmitter();
130
+ this.handleFlowControl = !!(opt === null || opt === void 0 ? void 0 : opt.handleFlowControl);
131
+ this._flowControlPause = (opt === null || opt === void 0 ? void 0 : opt.flowControlPause) || FLOW_CONTROL_PAUSE;
132
+ this._flowControlResume = (opt === null || opt === void 0 ? void 0 : opt.flowControlResume) || FLOW_CONTROL_RESUME;
133
+ if (!opt) {
134
+ return;
135
+ }
136
+ this._checkType("name", opt.name ? opt.name : void 0, "string");
137
+ this._checkType("cols", opt.cols ? opt.cols : void 0, "number");
138
+ this._checkType("rows", opt.rows ? opt.rows : void 0, "number");
139
+ this._checkType("cwd", opt.cwd ? opt.cwd : void 0, "string");
140
+ this._checkType("env", opt.env ? opt.env : void 0, "object");
141
+ this._checkType("uid", opt.uid ? opt.uid : void 0, "number");
142
+ this._checkType("gid", opt.gid ? opt.gid : void 0, "number");
143
+ this._checkType("encoding", opt.encoding ? opt.encoding : void 0, "string");
144
+ }
145
+ Object.defineProperty(Terminal3.prototype, "onData", {
146
+ get: function() {
147
+ return this._onData.event;
148
+ },
149
+ enumerable: false,
150
+ configurable: true
151
+ });
152
+ Object.defineProperty(Terminal3.prototype, "onExit", {
153
+ get: function() {
154
+ return this._onExit.event;
155
+ },
156
+ enumerable: false,
157
+ configurable: true
158
+ });
159
+ Object.defineProperty(Terminal3.prototype, "pid", {
160
+ get: function() {
161
+ return this._pid;
162
+ },
163
+ enumerable: false,
164
+ configurable: true
165
+ });
166
+ Object.defineProperty(Terminal3.prototype, "cols", {
167
+ get: function() {
168
+ return this._cols;
169
+ },
170
+ enumerable: false,
171
+ configurable: true
172
+ });
173
+ Object.defineProperty(Terminal3.prototype, "rows", {
174
+ get: function() {
175
+ return this._rows;
176
+ },
177
+ enumerable: false,
178
+ configurable: true
179
+ });
180
+ Terminal3.prototype.write = function(data) {
181
+ if (this.handleFlowControl) {
182
+ if (data === this._flowControlPause) {
183
+ this.pause();
184
+ return;
185
+ }
186
+ if (data === this._flowControlResume) {
187
+ this.resume();
188
+ return;
189
+ }
190
+ }
191
+ this._write(data);
192
+ };
193
+ Terminal3.prototype._forwardEvents = function() {
194
+ var _this = this;
195
+ this.on("data", function(e) {
196
+ return _this._onData.fire(e);
197
+ });
198
+ this.on("exit", function(exitCode, signal) {
199
+ return _this._onExit.fire({ exitCode, signal });
200
+ });
201
+ };
202
+ Terminal3.prototype._checkType = function(name, value, type, allowArray) {
203
+ if (allowArray === void 0) {
204
+ allowArray = false;
205
+ }
206
+ if (value === void 0) {
207
+ return;
208
+ }
209
+ if (allowArray) {
210
+ if (Array.isArray(value)) {
211
+ value.forEach(function(v, i) {
212
+ if (typeof v !== type) {
213
+ throw new Error(name + "[" + i + "] must be a " + type + " (not a " + typeof v[i] + ")");
214
+ }
215
+ });
216
+ return;
217
+ }
218
+ }
219
+ if (typeof value !== type) {
220
+ throw new Error(name + " must be a " + type + " (not a " + typeof value + ")");
221
+ }
222
+ };
223
+ Terminal3.prototype.end = function(data) {
224
+ this._socket.end(data);
225
+ };
226
+ Terminal3.prototype.pipe = function(dest, options) {
227
+ return this._socket.pipe(dest, options);
228
+ };
229
+ Terminal3.prototype.pause = function() {
230
+ return this._socket.pause();
231
+ };
232
+ Terminal3.prototype.resume = function() {
233
+ return this._socket.resume();
234
+ };
235
+ Terminal3.prototype.setEncoding = function(encoding) {
236
+ if (this._socket._decoder) {
237
+ delete this._socket._decoder;
238
+ }
239
+ if (encoding) {
240
+ this._socket.setEncoding(encoding);
241
+ }
242
+ };
243
+ Terminal3.prototype.addListener = function(eventName, listener) {
244
+ this.on(eventName, listener);
245
+ };
246
+ Terminal3.prototype.on = function(eventName, listener) {
247
+ if (eventName === "close") {
248
+ this._internalee.on("close", listener);
249
+ return;
250
+ }
251
+ this._socket.on(eventName, listener);
252
+ };
253
+ Terminal3.prototype.emit = function(eventName) {
254
+ var args = [];
255
+ for (var _i = 1; _i < arguments.length; _i++) {
256
+ args[_i - 1] = arguments[_i];
257
+ }
258
+ if (eventName === "close") {
259
+ return this._internalee.emit.apply(this._internalee, arguments);
260
+ }
261
+ return this._socket.emit.apply(this._socket, arguments);
262
+ };
263
+ Terminal3.prototype.listeners = function(eventName) {
264
+ return this._socket.listeners(eventName);
265
+ };
266
+ Terminal3.prototype.removeListener = function(eventName, listener) {
267
+ this._socket.removeListener(eventName, listener);
268
+ };
269
+ Terminal3.prototype.removeAllListeners = function(eventName) {
270
+ this._socket.removeAllListeners(eventName);
271
+ };
272
+ Terminal3.prototype.once = function(eventName, listener) {
273
+ this._socket.once(eventName, listener);
274
+ };
275
+ Terminal3.prototype._close = function() {
276
+ this._socket.readable = false;
277
+ this.write = function() {
278
+ };
279
+ this.end = function() {
280
+ };
281
+ this._writable = false;
282
+ this._readable = false;
283
+ };
284
+ Terminal3.prototype._parseEnv = function(env) {
285
+ var keys = Object.keys(env || {});
286
+ var pairs = [];
287
+ for (var i = 0; i < keys.length; i++) {
288
+ if (keys[i] === void 0) {
289
+ continue;
290
+ }
291
+ pairs.push(keys[i] + "=" + env[keys[i]]);
292
+ }
293
+ return pairs;
294
+ };
295
+ return Terminal3;
296
+ })()
297
+ );
298
+ exports.Terminal = Terminal2;
299
+ }
300
+ });
301
+
302
+ // ../../node_modules/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/shared/conout.js
303
+ var require_conout = __commonJS({
304
+ "../../node_modules/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/shared/conout.js"(exports) {
305
+ "use strict";
306
+ Object.defineProperty(exports, "__esModule", { value: true });
307
+ exports.getWorkerPipeName = void 0;
308
+ function getWorkerPipeName(conoutPipeName) {
309
+ return conoutPipeName + "-worker";
310
+ }
311
+ exports.getWorkerPipeName = getWorkerPipeName;
312
+ }
313
+ });
314
+
315
+ // ../../node_modules/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/windowsConoutConnection.js
316
+ var require_windowsConoutConnection = __commonJS({
317
+ "../../node_modules/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/windowsConoutConnection.js"(exports) {
318
+ "use strict";
319
+ var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
320
+ function adopt(value) {
321
+ return value instanceof P ? value : new P(function(resolve) {
322
+ resolve(value);
323
+ });
324
+ }
325
+ return new (P || (P = Promise))(function(resolve, reject) {
326
+ function fulfilled(value) {
327
+ try {
328
+ step(generator.next(value));
329
+ } catch (e) {
330
+ reject(e);
331
+ }
332
+ }
333
+ function rejected(value) {
334
+ try {
335
+ step(generator["throw"](value));
336
+ } catch (e) {
337
+ reject(e);
338
+ }
339
+ }
340
+ function step(result) {
341
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
342
+ }
343
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
344
+ });
345
+ };
346
+ var __generator = exports && exports.__generator || function(thisArg, body) {
347
+ var _ = { label: 0, sent: function() {
348
+ if (t[0] & 1) throw t[1];
349
+ return t[1];
350
+ }, trys: [], ops: [] }, f, y, t, g;
351
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
352
+ return this;
353
+ }), g;
354
+ function verb(n) {
355
+ return function(v) {
356
+ return step([n, v]);
357
+ };
358
+ }
359
+ function step(op) {
360
+ if (f) throw new TypeError("Generator is already executing.");
361
+ while (_) try {
362
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
363
+ if (y = 0, t) op = [op[0] & 2, t.value];
364
+ switch (op[0]) {
365
+ case 0:
366
+ case 1:
367
+ t = op;
368
+ break;
369
+ case 4:
370
+ _.label++;
371
+ return { value: op[1], done: false };
372
+ case 5:
373
+ _.label++;
374
+ y = op[1];
375
+ op = [0];
376
+ continue;
377
+ case 7:
378
+ op = _.ops.pop();
379
+ _.trys.pop();
380
+ continue;
381
+ default:
382
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
383
+ _ = 0;
384
+ continue;
385
+ }
386
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
387
+ _.label = op[1];
388
+ break;
389
+ }
390
+ if (op[0] === 6 && _.label < t[1]) {
391
+ _.label = t[1];
392
+ t = op;
393
+ break;
394
+ }
395
+ if (t && _.label < t[2]) {
396
+ _.label = t[2];
397
+ _.ops.push(op);
398
+ break;
399
+ }
400
+ if (t[2]) _.ops.pop();
401
+ _.trys.pop();
402
+ continue;
403
+ }
404
+ op = body.call(thisArg, _);
405
+ } catch (e) {
406
+ op = [6, e];
407
+ y = 0;
408
+ } finally {
409
+ f = t = 0;
410
+ }
411
+ if (op[0] & 5) throw op[1];
412
+ return { value: op[0] ? op[1] : void 0, done: true };
413
+ }
414
+ };
415
+ Object.defineProperty(exports, "__esModule", { value: true });
416
+ exports.ConoutConnection = void 0;
417
+ var worker_threads_1 = __require("worker_threads");
418
+ var conout_1 = require_conout();
419
+ var path_1 = __require("path");
420
+ var eventEmitter2_1 = require_eventEmitter2();
421
+ var FLUSH_DATA_INTERVAL = 1e3;
422
+ var ConoutConnection = (
423
+ /** @class */
424
+ (function() {
425
+ function ConoutConnection2(_conoutPipeName, _useConptyDll) {
426
+ var _this = this;
427
+ this._conoutPipeName = _conoutPipeName;
428
+ this._useConptyDll = _useConptyDll;
429
+ this._isDisposed = false;
430
+ this._onReady = new eventEmitter2_1.EventEmitter2();
431
+ var workerData = {
432
+ conoutPipeName: _conoutPipeName
433
+ };
434
+ var scriptPath = __dirname.replace("node_modules.asar", "node_modules.asar.unpacked");
435
+ this._worker = new worker_threads_1.Worker(path_1.join(scriptPath, "worker/conoutSocketWorker.js"), { workerData });
436
+ this._worker.on("message", function(message) {
437
+ switch (message) {
438
+ case 1:
439
+ _this._onReady.fire();
440
+ return;
441
+ default:
442
+ console.warn("Unexpected ConoutWorkerMessage", message);
443
+ }
444
+ });
445
+ }
446
+ Object.defineProperty(ConoutConnection2.prototype, "onReady", {
447
+ get: function() {
448
+ return this._onReady.event;
449
+ },
450
+ enumerable: false,
451
+ configurable: true
452
+ });
453
+ ConoutConnection2.prototype.dispose = function() {
454
+ if (!this._useConptyDll && this._isDisposed) {
455
+ return;
456
+ }
457
+ this._isDisposed = true;
458
+ this._drainDataAndClose();
459
+ };
460
+ ConoutConnection2.prototype.connectSocket = function(socket) {
461
+ socket.connect(conout_1.getWorkerPipeName(this._conoutPipeName));
462
+ };
463
+ ConoutConnection2.prototype._drainDataAndClose = function() {
464
+ var _this = this;
465
+ if (this._drainTimeout) {
466
+ clearTimeout(this._drainTimeout);
467
+ }
468
+ this._drainTimeout = setTimeout(function() {
469
+ return _this._destroySocket();
470
+ }, FLUSH_DATA_INTERVAL);
471
+ };
472
+ ConoutConnection2.prototype._destroySocket = function() {
473
+ return __awaiter(this, void 0, void 0, function() {
474
+ return __generator(this, function(_a) {
475
+ switch (_a.label) {
476
+ case 0:
477
+ return [4, this._worker.terminate()];
478
+ case 1:
479
+ _a.sent();
480
+ return [
481
+ 2
482
+ /*return*/
483
+ ];
484
+ }
485
+ });
486
+ });
487
+ };
488
+ return ConoutConnection2;
489
+ })()
490
+ );
491
+ exports.ConoutConnection = ConoutConnection;
492
+ }
493
+ });
494
+
495
+ // ../../node_modules/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/windowsPtyAgent.js
496
+ var require_windowsPtyAgent = __commonJS({
497
+ "../../node_modules/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/windowsPtyAgent.js"(exports) {
498
+ "use strict";
499
+ Object.defineProperty(exports, "__esModule", { value: true });
500
+ exports.argsToCommandLine = exports.WindowsPtyAgent = void 0;
501
+ var fs = __require("fs");
502
+ var os = __require("os");
503
+ var path2 = __require("path");
504
+ var child_process_1 = __require("child_process");
505
+ var net_1 = __require("net");
506
+ var windowsConoutConnection_1 = require_windowsConoutConnection();
507
+ var utils_1 = require_utils();
508
+ var conptyNative;
509
+ var winptyNative;
510
+ var FLUSH_DATA_INTERVAL = 1e3;
511
+ var WindowsPtyAgent = (
512
+ /** @class */
513
+ (function() {
514
+ function WindowsPtyAgent2(file, args, env, cwd, cols, rows, debug, _useConpty, _useConptyDll, conptyInheritCursor) {
515
+ var _this = this;
516
+ if (_useConptyDll === void 0) {
517
+ _useConptyDll = false;
518
+ }
519
+ if (conptyInheritCursor === void 0) {
520
+ conptyInheritCursor = false;
521
+ }
522
+ this._useConpty = _useConpty;
523
+ this._useConptyDll = _useConptyDll;
524
+ this._pid = 0;
525
+ this._innerPid = 0;
526
+ if (this._useConpty === void 0 || this._useConpty === true) {
527
+ this._useConpty = this._getWindowsBuildNumber() >= 18309;
528
+ }
529
+ if (this._useConpty) {
530
+ if (!conptyNative) {
531
+ conptyNative = utils_1.loadNativeModule("conpty").module;
532
+ }
533
+ } else {
534
+ if (!winptyNative) {
535
+ winptyNative = utils_1.loadNativeModule("pty").module;
536
+ }
537
+ }
538
+ this._ptyNative = this._useConpty ? conptyNative : winptyNative;
539
+ cwd = path2.resolve(cwd);
540
+ var commandLine = argsToCommandLine(file, args);
541
+ var term;
542
+ if (this._useConpty) {
543
+ term = this._ptyNative.startProcess(file, cols, rows, debug, this._generatePipeName(), conptyInheritCursor, this._useConptyDll);
544
+ } else {
545
+ term = this._ptyNative.startProcess(file, commandLine, env, cwd, cols, rows, debug);
546
+ this._pid = term.pid;
547
+ this._innerPid = term.innerPid;
548
+ }
549
+ this._fd = term.fd;
550
+ this._pty = term.pty;
551
+ this._outSocket = new net_1.Socket();
552
+ this._outSocket.setEncoding("utf8");
553
+ this._conoutSocketWorker = new windowsConoutConnection_1.ConoutConnection(term.conout, this._useConptyDll);
554
+ this._conoutSocketWorker.onReady(function() {
555
+ _this._conoutSocketWorker.connectSocket(_this._outSocket);
556
+ });
557
+ this._outSocket.on("connect", function() {
558
+ _this._outSocket.emit("ready_datapipe");
559
+ });
560
+ var inSocketFD = fs.openSync(term.conin, "w");
561
+ this._inSocket = new net_1.Socket({
562
+ fd: inSocketFD,
563
+ readable: false,
564
+ writable: true
565
+ });
566
+ this._inSocket.setEncoding("utf8");
567
+ if (this._useConpty) {
568
+ var connect = this._ptyNative.connect(this._pty, commandLine, cwd, env, this._useConptyDll, function(c) {
569
+ return _this._$onProcessExit(c);
570
+ });
571
+ this._innerPid = connect.pid;
572
+ }
573
+ }
574
+ Object.defineProperty(WindowsPtyAgent2.prototype, "inSocket", {
575
+ get: function() {
576
+ return this._inSocket;
577
+ },
578
+ enumerable: false,
579
+ configurable: true
580
+ });
581
+ Object.defineProperty(WindowsPtyAgent2.prototype, "outSocket", {
582
+ get: function() {
583
+ return this._outSocket;
584
+ },
585
+ enumerable: false,
586
+ configurable: true
587
+ });
588
+ Object.defineProperty(WindowsPtyAgent2.prototype, "fd", {
589
+ get: function() {
590
+ return this._fd;
591
+ },
592
+ enumerable: false,
593
+ configurable: true
594
+ });
595
+ Object.defineProperty(WindowsPtyAgent2.prototype, "innerPid", {
596
+ get: function() {
597
+ return this._innerPid;
598
+ },
599
+ enumerable: false,
600
+ configurable: true
601
+ });
602
+ Object.defineProperty(WindowsPtyAgent2.prototype, "pty", {
603
+ get: function() {
604
+ return this._pty;
605
+ },
606
+ enumerable: false,
607
+ configurable: true
608
+ });
609
+ WindowsPtyAgent2.prototype.resize = function(cols, rows) {
610
+ if (this._useConpty) {
611
+ if (this._exitCode !== void 0) {
612
+ throw new Error("Cannot resize a pty that has already exited");
613
+ }
614
+ this._ptyNative.resize(this._pty, cols, rows, this._useConptyDll);
615
+ return;
616
+ }
617
+ this._ptyNative.resize(this._pid, cols, rows);
618
+ };
619
+ WindowsPtyAgent2.prototype.clear = function() {
620
+ if (this._useConpty) {
621
+ this._ptyNative.clear(this._pty, this._useConptyDll);
622
+ }
623
+ };
624
+ WindowsPtyAgent2.prototype.kill = function() {
625
+ var _this = this;
626
+ if (this._useConpty) {
627
+ if (!this._useConptyDll) {
628
+ this._inSocket.readable = false;
629
+ this._outSocket.readable = false;
630
+ this._getConsoleProcessList().then(function(consoleProcessList) {
631
+ consoleProcessList.forEach(function(pid) {
632
+ try {
633
+ process.kill(pid);
634
+ } catch (e) {
635
+ }
636
+ });
637
+ });
638
+ this._ptyNative.kill(this._pty, this._useConptyDll);
639
+ this._conoutSocketWorker.dispose();
640
+ } else {
641
+ this._inSocket.destroy();
642
+ this._ptyNative.kill(this._pty, this._useConptyDll);
643
+ this._outSocket.on("data", function() {
644
+ _this._conoutSocketWorker.dispose();
645
+ });
646
+ }
647
+ } else {
648
+ var processList = this._ptyNative.getProcessList(this._pid);
649
+ this._ptyNative.kill(this._pid, this._innerPid);
650
+ processList.forEach(function(pid) {
651
+ try {
652
+ process.kill(pid);
653
+ } catch (e) {
654
+ }
655
+ });
656
+ }
657
+ };
658
+ WindowsPtyAgent2.prototype._getConsoleProcessList = function() {
659
+ var _this = this;
660
+ return new Promise(function(resolve) {
661
+ var agent = child_process_1.fork(path2.join(__dirname, "conpty_console_list_agent"), [_this._innerPid.toString()]);
662
+ agent.on("message", function(message) {
663
+ clearTimeout(timeout);
664
+ resolve(message.consoleProcessList);
665
+ });
666
+ var timeout = setTimeout(function() {
667
+ agent.kill();
668
+ resolve([_this._innerPid]);
669
+ }, 5e3);
670
+ });
671
+ };
672
+ Object.defineProperty(WindowsPtyAgent2.prototype, "exitCode", {
673
+ get: function() {
674
+ if (this._useConpty) {
675
+ return this._exitCode;
676
+ }
677
+ var winptyExitCode = this._ptyNative.getExitCode(this._innerPid);
678
+ return winptyExitCode === -1 ? void 0 : winptyExitCode;
679
+ },
680
+ enumerable: false,
681
+ configurable: true
682
+ });
683
+ WindowsPtyAgent2.prototype._getWindowsBuildNumber = function() {
684
+ var osVersion = /(\d+)\.(\d+)\.(\d+)/g.exec(os.release());
685
+ var buildNumber = 0;
686
+ if (osVersion && osVersion.length === 4) {
687
+ buildNumber = parseInt(osVersion[3]);
688
+ }
689
+ return buildNumber;
690
+ };
691
+ WindowsPtyAgent2.prototype._generatePipeName = function() {
692
+ return "conpty-" + Math.random() * 1e7;
693
+ };
694
+ WindowsPtyAgent2.prototype._$onProcessExit = function(exitCode) {
695
+ var _this = this;
696
+ this._exitCode = exitCode;
697
+ if (!this._useConptyDll) {
698
+ this._flushDataAndCleanUp();
699
+ this._outSocket.on("data", function() {
700
+ return _this._flushDataAndCleanUp();
701
+ });
702
+ }
703
+ };
704
+ WindowsPtyAgent2.prototype._flushDataAndCleanUp = function() {
705
+ var _this = this;
706
+ if (this._useConptyDll) {
707
+ return;
708
+ }
709
+ if (this._closeTimeout) {
710
+ clearTimeout(this._closeTimeout);
711
+ }
712
+ this._closeTimeout = setTimeout(function() {
713
+ return _this._cleanUpProcess();
714
+ }, FLUSH_DATA_INTERVAL);
715
+ };
716
+ WindowsPtyAgent2.prototype._cleanUpProcess = function() {
717
+ if (this._useConptyDll) {
718
+ return;
719
+ }
720
+ this._inSocket.readable = false;
721
+ this._outSocket.readable = false;
722
+ this._outSocket.destroy();
723
+ };
724
+ return WindowsPtyAgent2;
725
+ })()
726
+ );
727
+ exports.WindowsPtyAgent = WindowsPtyAgent;
728
+ function argsToCommandLine(file, args) {
729
+ if (isCommandLine(args)) {
730
+ if (args.length === 0) {
731
+ return file;
732
+ }
733
+ return argsToCommandLine(file, []) + " " + args;
734
+ }
735
+ var argv = [file];
736
+ Array.prototype.push.apply(argv, args);
737
+ var result = "";
738
+ for (var argIndex = 0; argIndex < argv.length; argIndex++) {
739
+ if (argIndex > 0) {
740
+ result += " ";
741
+ }
742
+ var arg = argv[argIndex];
743
+ var hasLopsidedEnclosingQuote = xOr(arg[0] !== '"', arg[arg.length - 1] !== '"');
744
+ var hasNoEnclosingQuotes = arg[0] !== '"' && arg[arg.length - 1] !== '"';
745
+ var quote = arg === "" || (arg.indexOf(" ") !== -1 || arg.indexOf(" ") !== -1) && (arg.length > 1 && (hasLopsidedEnclosingQuote || hasNoEnclosingQuotes));
746
+ if (quote) {
747
+ result += '"';
748
+ }
749
+ var bsCount = 0;
750
+ for (var i = 0; i < arg.length; i++) {
751
+ var p = arg[i];
752
+ if (p === "\\") {
753
+ bsCount++;
754
+ } else if (p === '"') {
755
+ result += repeatText("\\", bsCount * 2 + 1);
756
+ result += '"';
757
+ bsCount = 0;
758
+ } else {
759
+ result += repeatText("\\", bsCount);
760
+ bsCount = 0;
761
+ result += p;
762
+ }
763
+ }
764
+ if (quote) {
765
+ result += repeatText("\\", bsCount * 2);
766
+ result += '"';
767
+ } else {
768
+ result += repeatText("\\", bsCount);
769
+ }
770
+ }
771
+ return result;
772
+ }
773
+ exports.argsToCommandLine = argsToCommandLine;
774
+ function isCommandLine(args) {
775
+ return typeof args === "string";
776
+ }
777
+ function repeatText(text, count) {
778
+ var result = "";
779
+ for (var i = 0; i < count; i++) {
780
+ result += text;
781
+ }
782
+ return result;
783
+ }
784
+ function xOr(arg1, arg2) {
785
+ return arg1 && !arg2 || !arg1 && arg2;
786
+ }
787
+ }
788
+ });
789
+
790
+ // ../../node_modules/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/windowsTerminal.js
791
+ var require_windowsTerminal = __commonJS({
792
+ "../../node_modules/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/windowsTerminal.js"(exports) {
793
+ "use strict";
794
+ var __extends = exports && exports.__extends || /* @__PURE__ */ (function() {
795
+ var extendStatics = function(d, b) {
796
+ extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
797
+ d2.__proto__ = b2;
798
+ } || function(d2, b2) {
799
+ for (var p in b2) if (b2.hasOwnProperty(p)) d2[p] = b2[p];
800
+ };
801
+ return extendStatics(d, b);
802
+ };
803
+ return function(d, b) {
804
+ extendStatics(d, b);
805
+ function __() {
806
+ this.constructor = d;
807
+ }
808
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
809
+ };
810
+ })();
811
+ Object.defineProperty(exports, "__esModule", { value: true });
812
+ exports.WindowsTerminal = void 0;
813
+ var terminal_1 = require_terminal();
814
+ var windowsPtyAgent_1 = require_windowsPtyAgent();
815
+ var utils_1 = require_utils();
816
+ var DEFAULT_FILE = "cmd.exe";
817
+ var DEFAULT_NAME = "Windows Shell";
818
+ var WindowsTerminal = (
819
+ /** @class */
820
+ (function(_super) {
821
+ __extends(WindowsTerminal2, _super);
822
+ function WindowsTerminal2(file, args, opt) {
823
+ var _this = _super.call(this, opt) || this;
824
+ _this._checkType("args", args, "string", true);
825
+ args = args || [];
826
+ file = file || DEFAULT_FILE;
827
+ opt = opt || {};
828
+ opt.env = opt.env || process.env;
829
+ if (opt.encoding) {
830
+ console.warn("Setting encoding on Windows is not supported");
831
+ }
832
+ var env = utils_1.assign({}, opt.env);
833
+ _this._cols = opt.cols || terminal_1.DEFAULT_COLS;
834
+ _this._rows = opt.rows || terminal_1.DEFAULT_ROWS;
835
+ var cwd = opt.cwd || process.cwd();
836
+ var name = opt.name || env.TERM || DEFAULT_NAME;
837
+ var parsedEnv = _this._parseEnv(env);
838
+ _this._isReady = false;
839
+ _this._deferreds = [];
840
+ _this._agent = new windowsPtyAgent_1.WindowsPtyAgent(file, args, parsedEnv, cwd, _this._cols, _this._rows, false, opt.useConpty, opt.useConptyDll, opt.conptyInheritCursor);
841
+ _this._socket = _this._agent.outSocket;
842
+ _this._pid = _this._agent.innerPid;
843
+ _this._fd = _this._agent.fd;
844
+ _this._pty = _this._agent.pty;
845
+ _this._socket.on("ready_datapipe", function() {
846
+ _this._socket.once("data", function() {
847
+ if (!_this._isReady) {
848
+ _this._isReady = true;
849
+ _this._deferreds.forEach(function(fn) {
850
+ fn.run();
851
+ });
852
+ _this._deferreds = [];
853
+ }
854
+ });
855
+ _this._socket.on("error", function(err) {
856
+ _this._close();
857
+ if (err.code) {
858
+ if (~err.code.indexOf("errno 5") || ~err.code.indexOf("EIO"))
859
+ return;
860
+ }
861
+ if (_this.listeners("error").length < 2) {
862
+ throw err;
863
+ }
864
+ });
865
+ _this._socket.on("close", function() {
866
+ _this.emit("exit", _this._agent.exitCode);
867
+ _this._close();
868
+ });
869
+ });
870
+ _this._file = file;
871
+ _this._name = name;
872
+ _this._readable = true;
873
+ _this._writable = true;
874
+ _this._forwardEvents();
875
+ return _this;
876
+ }
877
+ WindowsTerminal2.prototype._write = function(data) {
878
+ this._defer(this._doWrite, data);
879
+ };
880
+ WindowsTerminal2.prototype._doWrite = function(data) {
881
+ this._agent.inSocket.write(data);
882
+ };
883
+ WindowsTerminal2.open = function(options) {
884
+ throw new Error("open() not supported on windows, use Fork() instead.");
885
+ };
886
+ WindowsTerminal2.prototype.resize = function(cols, rows) {
887
+ var _this = this;
888
+ if (cols <= 0 || rows <= 0 || isNaN(cols) || isNaN(rows) || cols === Infinity || rows === Infinity) {
889
+ throw new Error("resizing must be done using positive cols and rows");
890
+ }
891
+ this._deferNoArgs(function() {
892
+ _this._agent.resize(cols, rows);
893
+ _this._cols = cols;
894
+ _this._rows = rows;
895
+ });
896
+ };
897
+ WindowsTerminal2.prototype.clear = function() {
898
+ var _this = this;
899
+ this._deferNoArgs(function() {
900
+ _this._agent.clear();
901
+ });
902
+ };
903
+ WindowsTerminal2.prototype.destroy = function() {
904
+ var _this = this;
905
+ this._deferNoArgs(function() {
906
+ _this.kill();
907
+ });
908
+ };
909
+ WindowsTerminal2.prototype.kill = function(signal) {
910
+ var _this = this;
911
+ this._deferNoArgs(function() {
912
+ if (signal) {
913
+ throw new Error("Signals not supported on windows.");
914
+ }
915
+ _this._close();
916
+ _this._agent.kill();
917
+ });
918
+ };
919
+ WindowsTerminal2.prototype._deferNoArgs = function(deferredFn) {
920
+ var _this = this;
921
+ if (this._isReady) {
922
+ deferredFn.call(this);
923
+ return;
924
+ }
925
+ this._deferreds.push({
926
+ run: function() {
927
+ return deferredFn.call(_this);
928
+ }
929
+ });
930
+ };
931
+ WindowsTerminal2.prototype._defer = function(deferredFn, arg) {
932
+ var _this = this;
933
+ if (this._isReady) {
934
+ deferredFn.call(this, arg);
935
+ return;
936
+ }
937
+ this._deferreds.push({
938
+ run: function() {
939
+ return deferredFn.call(_this, arg);
940
+ }
941
+ });
942
+ };
943
+ Object.defineProperty(WindowsTerminal2.prototype, "process", {
944
+ get: function() {
945
+ return this._name;
946
+ },
947
+ enumerable: false,
948
+ configurable: true
949
+ });
950
+ Object.defineProperty(WindowsTerminal2.prototype, "master", {
951
+ get: function() {
952
+ throw new Error("master is not supported on Windows");
953
+ },
954
+ enumerable: false,
955
+ configurable: true
956
+ });
957
+ Object.defineProperty(WindowsTerminal2.prototype, "slave", {
958
+ get: function() {
959
+ throw new Error("slave is not supported on Windows");
960
+ },
961
+ enumerable: false,
962
+ configurable: true
963
+ });
964
+ return WindowsTerminal2;
965
+ })(terminal_1.Terminal)
966
+ );
967
+ exports.WindowsTerminal = WindowsTerminal;
968
+ }
969
+ });
970
+
971
+ // ../../node_modules/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/unixTerminal.js
972
+ var require_unixTerminal = __commonJS({
973
+ "../../node_modules/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/unixTerminal.js"(exports) {
974
+ "use strict";
975
+ var __extends = exports && exports.__extends || /* @__PURE__ */ (function() {
976
+ var extendStatics = function(d, b) {
977
+ extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
978
+ d2.__proto__ = b2;
979
+ } || function(d2, b2) {
980
+ for (var p in b2) if (b2.hasOwnProperty(p)) d2[p] = b2[p];
981
+ };
982
+ return extendStatics(d, b);
983
+ };
984
+ return function(d, b) {
985
+ extendStatics(d, b);
986
+ function __() {
987
+ this.constructor = d;
988
+ }
989
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
990
+ };
991
+ })();
992
+ Object.defineProperty(exports, "__esModule", { value: true });
993
+ exports.UnixTerminal = void 0;
994
+ var fs = __require("fs");
995
+ var path2 = __require("path");
996
+ var tty = __require("tty");
997
+ var terminal_1 = require_terminal();
998
+ var utils_1 = require_utils();
999
+ var native = utils_1.loadNativeModule("pty");
1000
+ var pty = native.module;
1001
+ var helperPath = native.dir + "/spawn-helper";
1002
+ helperPath = path2.resolve(__dirname, helperPath);
1003
+ helperPath = helperPath.replace("app.asar", "app.asar.unpacked");
1004
+ helperPath = helperPath.replace("node_modules.asar", "node_modules.asar.unpacked");
1005
+ var DEFAULT_FILE = "sh";
1006
+ var DEFAULT_NAME = "xterm";
1007
+ var DESTROY_SOCKET_TIMEOUT_MS = 200;
1008
+ var UnixTerminal = (
1009
+ /** @class */
1010
+ (function(_super) {
1011
+ __extends(UnixTerminal2, _super);
1012
+ function UnixTerminal2(file, args, opt) {
1013
+ var _a, _b;
1014
+ var _this = _super.call(this, opt) || this;
1015
+ _this._boundClose = false;
1016
+ _this._emittedClose = false;
1017
+ if (typeof args === "string") {
1018
+ throw new Error("args as a string is not supported on unix.");
1019
+ }
1020
+ args = args || [];
1021
+ file = file || DEFAULT_FILE;
1022
+ opt = opt || {};
1023
+ opt.env = opt.env || process.env;
1024
+ _this._cols = opt.cols || terminal_1.DEFAULT_COLS;
1025
+ _this._rows = opt.rows || terminal_1.DEFAULT_ROWS;
1026
+ var uid = (_a = opt.uid) !== null && _a !== void 0 ? _a : -1;
1027
+ var gid = (_b = opt.gid) !== null && _b !== void 0 ? _b : -1;
1028
+ var env = utils_1.assign({}, opt.env);
1029
+ if (opt.env === process.env) {
1030
+ _this._sanitizeEnv(env);
1031
+ }
1032
+ var cwd = opt.cwd || process.cwd();
1033
+ env.PWD = cwd;
1034
+ var name = opt.name || env.TERM || DEFAULT_NAME;
1035
+ env.TERM = name;
1036
+ var parsedEnv = _this._parseEnv(env);
1037
+ var encoding = opt.encoding === void 0 ? "utf8" : opt.encoding;
1038
+ var onexit = function(code, signal) {
1039
+ if (!_this._emittedClose) {
1040
+ if (_this._boundClose) {
1041
+ return;
1042
+ }
1043
+ _this._boundClose = true;
1044
+ var timeout_1 = setTimeout(function() {
1045
+ timeout_1 = null;
1046
+ _this._socket.destroy();
1047
+ }, DESTROY_SOCKET_TIMEOUT_MS);
1048
+ _this.once("close", function() {
1049
+ if (timeout_1 !== null) {
1050
+ clearTimeout(timeout_1);
1051
+ }
1052
+ _this.emit("exit", code, signal);
1053
+ });
1054
+ return;
1055
+ }
1056
+ _this.emit("exit", code, signal);
1057
+ };
1058
+ var term = pty.fork(file, args, parsedEnv, cwd, _this._cols, _this._rows, uid, gid, encoding === "utf8", helperPath, onexit);
1059
+ _this._socket = new tty.ReadStream(term.fd);
1060
+ if (encoding !== null) {
1061
+ _this._socket.setEncoding(encoding);
1062
+ }
1063
+ _this._writeStream = new CustomWriteStream(term.fd, encoding || void 0);
1064
+ _this._socket.on("error", function(err) {
1065
+ if (err.code) {
1066
+ if (~err.code.indexOf("EAGAIN")) {
1067
+ return;
1068
+ }
1069
+ }
1070
+ _this._close();
1071
+ if (!_this._emittedClose) {
1072
+ _this._emittedClose = true;
1073
+ _this.emit("close");
1074
+ }
1075
+ if (err.code) {
1076
+ if (~err.code.indexOf("errno 5") || ~err.code.indexOf("EIO")) {
1077
+ return;
1078
+ }
1079
+ }
1080
+ if (_this.listeners("error").length < 2) {
1081
+ throw err;
1082
+ }
1083
+ });
1084
+ _this._pid = term.pid;
1085
+ _this._fd = term.fd;
1086
+ _this._pty = term.pty;
1087
+ _this._file = file;
1088
+ _this._name = name;
1089
+ _this._readable = true;
1090
+ _this._writable = true;
1091
+ _this._socket.on("close", function() {
1092
+ if (_this._emittedClose) {
1093
+ return;
1094
+ }
1095
+ _this._emittedClose = true;
1096
+ _this._close();
1097
+ _this.emit("close");
1098
+ });
1099
+ _this._forwardEvents();
1100
+ return _this;
1101
+ }
1102
+ Object.defineProperty(UnixTerminal2.prototype, "master", {
1103
+ get: function() {
1104
+ return this._master;
1105
+ },
1106
+ enumerable: false,
1107
+ configurable: true
1108
+ });
1109
+ Object.defineProperty(UnixTerminal2.prototype, "slave", {
1110
+ get: function() {
1111
+ return this._slave;
1112
+ },
1113
+ enumerable: false,
1114
+ configurable: true
1115
+ });
1116
+ UnixTerminal2.prototype._write = function(data) {
1117
+ this._writeStream.write(data);
1118
+ };
1119
+ Object.defineProperty(UnixTerminal2.prototype, "fd", {
1120
+ /* Accessors */
1121
+ get: function() {
1122
+ return this._fd;
1123
+ },
1124
+ enumerable: false,
1125
+ configurable: true
1126
+ });
1127
+ Object.defineProperty(UnixTerminal2.prototype, "ptsName", {
1128
+ get: function() {
1129
+ return this._pty;
1130
+ },
1131
+ enumerable: false,
1132
+ configurable: true
1133
+ });
1134
+ UnixTerminal2.open = function(opt) {
1135
+ var self = Object.create(UnixTerminal2.prototype);
1136
+ opt = opt || {};
1137
+ if (arguments.length > 1) {
1138
+ opt = {
1139
+ cols: arguments[1],
1140
+ rows: arguments[2]
1141
+ };
1142
+ }
1143
+ var cols = opt.cols || terminal_1.DEFAULT_COLS;
1144
+ var rows = opt.rows || terminal_1.DEFAULT_ROWS;
1145
+ var encoding = opt.encoding === void 0 ? "utf8" : opt.encoding;
1146
+ var term = pty.open(cols, rows);
1147
+ self._master = new tty.ReadStream(term.master);
1148
+ if (encoding !== null) {
1149
+ self._master.setEncoding(encoding);
1150
+ }
1151
+ self._master.resume();
1152
+ self._slave = new tty.ReadStream(term.slave);
1153
+ if (encoding !== null) {
1154
+ self._slave.setEncoding(encoding);
1155
+ }
1156
+ self._slave.resume();
1157
+ self._socket = self._master;
1158
+ self._pid = -1;
1159
+ self._fd = term.master;
1160
+ self._pty = term.pty;
1161
+ self._file = process.argv[0] || "node";
1162
+ self._name = process.env.TERM || "";
1163
+ self._readable = true;
1164
+ self._writable = true;
1165
+ self._socket.on("error", function(err) {
1166
+ self._close();
1167
+ if (self.listeners("error").length < 2) {
1168
+ throw err;
1169
+ }
1170
+ });
1171
+ self._socket.on("close", function() {
1172
+ self._close();
1173
+ });
1174
+ return self;
1175
+ };
1176
+ UnixTerminal2.prototype.destroy = function() {
1177
+ var _this = this;
1178
+ this._close();
1179
+ this._socket.once("close", function() {
1180
+ _this.kill("SIGHUP");
1181
+ });
1182
+ this._socket.destroy();
1183
+ this._writeStream.dispose();
1184
+ };
1185
+ UnixTerminal2.prototype.kill = function(signal) {
1186
+ try {
1187
+ process.kill(this.pid, signal || "SIGHUP");
1188
+ } catch (e) {
1189
+ }
1190
+ };
1191
+ Object.defineProperty(UnixTerminal2.prototype, "process", {
1192
+ /**
1193
+ * Gets the name of the process.
1194
+ */
1195
+ get: function() {
1196
+ if (process.platform === "darwin") {
1197
+ var title = pty.process(this._fd);
1198
+ return title !== "kernel_task" ? title : this._file;
1199
+ }
1200
+ return pty.process(this._fd, this._pty) || this._file;
1201
+ },
1202
+ enumerable: false,
1203
+ configurable: true
1204
+ });
1205
+ UnixTerminal2.prototype.resize = function(cols, rows) {
1206
+ if (cols <= 0 || rows <= 0 || isNaN(cols) || isNaN(rows) || cols === Infinity || rows === Infinity) {
1207
+ throw new Error("resizing must be done using positive cols and rows");
1208
+ }
1209
+ pty.resize(this._fd, cols, rows);
1210
+ this._cols = cols;
1211
+ this._rows = rows;
1212
+ };
1213
+ UnixTerminal2.prototype.clear = function() {
1214
+ };
1215
+ UnixTerminal2.prototype._sanitizeEnv = function(env) {
1216
+ delete env["TMUX"];
1217
+ delete env["TMUX_PANE"];
1218
+ delete env["STY"];
1219
+ delete env["WINDOW"];
1220
+ delete env["WINDOWID"];
1221
+ delete env["TERMCAP"];
1222
+ delete env["COLUMNS"];
1223
+ delete env["LINES"];
1224
+ };
1225
+ return UnixTerminal2;
1226
+ })(terminal_1.Terminal)
1227
+ );
1228
+ exports.UnixTerminal = UnixTerminal;
1229
+ var CustomWriteStream = (
1230
+ /** @class */
1231
+ (function() {
1232
+ function CustomWriteStream2(_fd, _encoding) {
1233
+ this._fd = _fd;
1234
+ this._encoding = _encoding;
1235
+ this._writeQueue = [];
1236
+ }
1237
+ CustomWriteStream2.prototype.dispose = function() {
1238
+ clearImmediate(this._writeImmediate);
1239
+ this._writeImmediate = void 0;
1240
+ };
1241
+ CustomWriteStream2.prototype.write = function(data) {
1242
+ var buffer = typeof data === "string" ? Buffer.from(data, this._encoding) : Buffer.from(data);
1243
+ if (buffer.byteLength !== 0) {
1244
+ this._writeQueue.push({ buffer, offset: 0 });
1245
+ if (this._writeQueue.length === 1) {
1246
+ this._processWriteQueue();
1247
+ }
1248
+ }
1249
+ };
1250
+ CustomWriteStream2.prototype._processWriteQueue = function() {
1251
+ var _this = this;
1252
+ this._writeImmediate = void 0;
1253
+ if (this._writeQueue.length === 0) {
1254
+ return;
1255
+ }
1256
+ var task = this._writeQueue[0];
1257
+ fs.write(this._fd, task.buffer, task.offset, function(err, written) {
1258
+ if (err) {
1259
+ if ("code" in err && err.code === "EAGAIN") {
1260
+ _this._writeImmediate = setImmediate(function() {
1261
+ return _this._processWriteQueue();
1262
+ });
1263
+ } else {
1264
+ _this._writeQueue.length = 0;
1265
+ console.error("Unhandled pty write error", err);
1266
+ }
1267
+ return;
1268
+ }
1269
+ task.offset += written;
1270
+ if (task.offset >= task.buffer.byteLength) {
1271
+ _this._writeQueue.shift();
1272
+ }
1273
+ _this._processWriteQueue();
1274
+ });
1275
+ };
1276
+ return CustomWriteStream2;
1277
+ })()
1278
+ );
1279
+ }
1280
+ });
1281
+
1282
+ // ../../node_modules/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/index.js
1283
+ var require_lib = __commonJS({
1284
+ "../../node_modules/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/index.js"(exports) {
1285
+ "use strict";
1286
+ Object.defineProperty(exports, "__esModule", { value: true });
1287
+ exports.native = exports.open = exports.createTerminal = exports.fork = exports.spawn = void 0;
1288
+ var utils_1 = require_utils();
1289
+ var terminalCtor;
1290
+ if (process.platform === "win32") {
1291
+ terminalCtor = require_windowsTerminal().WindowsTerminal;
1292
+ } else {
1293
+ terminalCtor = require_unixTerminal().UnixTerminal;
1294
+ }
1295
+ function spawn2(file, args, opt) {
1296
+ return new terminalCtor(file, args, opt);
1297
+ }
1298
+ exports.spawn = spawn2;
1299
+ function fork(file, args, opt) {
1300
+ return new terminalCtor(file, args, opt);
1301
+ }
1302
+ exports.fork = fork;
1303
+ function createTerminal(file, args, opt) {
1304
+ return new terminalCtor(file, args, opt);
1305
+ }
1306
+ exports.createTerminal = createTerminal;
1307
+ function open(options) {
1308
+ return terminalCtor.open(options);
1309
+ }
1310
+ exports.open = open;
1311
+ exports.native = process.platform !== "win32" ? utils_1.loadNativeModule("pty").module : null;
1312
+ }
1313
+ });
1314
+
1315
+ // src/actions/clamp/sandboxExec.ts
1316
+ import { spawn } from "child_process";
1317
+ import {
1318
+ mkdtempSync,
1319
+ rmSync,
1320
+ writeFileSync
1321
+ } from "fs";
1322
+ import { tmpdir } from "os";
1323
+ import path from "path";
1324
+ import { detectPlatform, generateMacOSProfile } from "@xylabs/aries-clamp-core";
1325
+ import chalk from "chalk";
1326
+
1327
+ // src/actions/clamp/terminalRenderer.ts
1328
+ import pkg from "@xterm/headless";
1329
+ var { Terminal } = pkg;
1330
+ var STATUS_BAR_HEIGHT = 2;
1331
+ var ESC = "\x1B[";
1332
+ var moveTo = (row, col) => `${ESC}${row};${col}H`;
1333
+ var resetStyle = `${ESC}0m`;
1334
+ var hideCursor = `${ESC}?25l`;
1335
+ var showCursor = `${ESC}?25h`;
1336
+ var clearScreen = `${ESC}2J`;
1337
+ var setBg = (r, g, b) => `${ESC}48;2;${r};${g};${b}m`;
1338
+ var setFg = (r, g, b) => `${ESC}38;2;${r};${g};${b}m`;
1339
+ var fgPalette = (n) => `${ESC}38;5;${n}m`;
1340
+ var bgPalette = (n) => `${ESC}48;5;${n}m`;
1341
+ var bold = `${ESC}1m`;
1342
+ var dim = `${ESC}2m`;
1343
+ var italic = `${ESC}3m`;
1344
+ var underline = `${ESC}4m`;
1345
+ var inverse = `${ESC}7m`;
1346
+ var strikethrough = `${ESC}9m`;
1347
+ function getCellStyle(cell) {
1348
+ if (!cell) return {
1349
+ attrs: "",
1350
+ bg: "",
1351
+ fg: ""
1352
+ };
1353
+ let fg = "";
1354
+ let bg = "";
1355
+ let attrs = "";
1356
+ if (cell.isFgRGB()) {
1357
+ const color = cell.getFgColor();
1358
+ fg = setFg(color >> 16 & 255, color >> 8 & 255, color & 255);
1359
+ } else if (cell.getFgColorMode() !== 0) {
1360
+ fg = fgPalette(cell.getFgColor());
1361
+ }
1362
+ if (cell.isBgRGB()) {
1363
+ const color = cell.getBgColor();
1364
+ bg = setBg(color >> 16 & 255, color >> 8 & 255, color & 255);
1365
+ } else if (cell.getBgColorMode() !== 0) {
1366
+ bg = bgPalette(cell.getBgColor());
1367
+ }
1368
+ if (cell.isBold()) attrs += bold;
1369
+ if (cell.isDim()) attrs += dim;
1370
+ if (cell.isItalic()) attrs += italic;
1371
+ if (cell.isUnderline()) attrs += underline;
1372
+ if (cell.isInverse()) attrs += inverse;
1373
+ if (cell.isStrikethrough()) attrs += strikethrough;
1374
+ return {
1375
+ attrs,
1376
+ bg,
1377
+ fg
1378
+ };
1379
+ }
1380
+ function createTerminalRenderer() {
1381
+ const realCols = process.stdout.columns ?? 80;
1382
+ const realRows = process.stdout.rows ?? 24;
1383
+ const innerRows = realRows - STATUS_BAR_HEIGHT;
1384
+ const terminal = new Terminal({
1385
+ cols: realCols,
1386
+ rows: innerRows
1387
+ });
1388
+ let statusLine = "";
1389
+ let renderScheduled = false;
1390
+ function renderBuffer() {
1391
+ const buf = terminal.buffer.active;
1392
+ const cols = terminal.cols;
1393
+ const rows = terminal.rows;
1394
+ const output = [hideCursor];
1395
+ for (let y = 0; y < rows; y++) {
1396
+ const line = buf.getLine(y);
1397
+ output.push(moveTo(y + 1, 1));
1398
+ if (!line) {
1399
+ output.push(resetStyle + " ".repeat(cols));
1400
+ continue;
1401
+ }
1402
+ let lineStr = "";
1403
+ let lastStyle = "";
1404
+ for (let x = 0; x < cols; x++) {
1405
+ const cell = line.getCell(x);
1406
+ if (!cell || cell.getWidth() === 0) continue;
1407
+ const style = getCellStyle(cell);
1408
+ const styleStr = resetStyle + style.fg + style.bg + style.attrs;
1409
+ if (styleStr !== lastStyle) {
1410
+ lineStr += styleStr;
1411
+ lastStyle = styleStr;
1412
+ }
1413
+ const ch = cell.getChars();
1414
+ lineStr += ch || " ";
1415
+ }
1416
+ output.push(lineStr + resetStyle);
1417
+ }
1418
+ const statusRow = realRows - 1;
1419
+ output.push(
1420
+ moveTo(statusRow, 1),
1421
+ resetStyle + dim + "\u2500".repeat(realCols) + resetStyle,
1422
+ moveTo(statusRow + 1, 1),
1423
+ resetStyle,
1424
+ statusLine.padEnd(realCols).slice(0, realCols),
1425
+ resetStyle
1426
+ );
1427
+ const cursorY = buf.cursorY + 1;
1428
+ const cursorX = buf.cursorX + 1;
1429
+ output.push(moveTo(cursorY, cursorX), showCursor);
1430
+ process.stdout.write(output.join(""));
1431
+ }
1432
+ function scheduleRender() {
1433
+ if (renderScheduled) return;
1434
+ renderScheduled = true;
1435
+ setImmediate(() => {
1436
+ renderScheduled = false;
1437
+ renderBuffer();
1438
+ });
1439
+ }
1440
+ function handleResize() {
1441
+ const newCols = process.stdout.columns ?? 80;
1442
+ const newRows = process.stdout.rows ?? 24;
1443
+ const newInnerRows = newRows - STATUS_BAR_HEIGHT;
1444
+ terminal.resize(newCols, newInnerRows);
1445
+ process.stdout.write(clearScreen);
1446
+ scheduleRender();
1447
+ }
1448
+ process.stdout.on("resize", handleResize);
1449
+ process.stdout.write(clearScreen + moveTo(1, 1));
1450
+ return {
1451
+ destroy: () => {
1452
+ process.stdout.removeListener("resize", handleResize);
1453
+ process.stdout.write(clearScreen + moveTo(1, 1) + showCursor + resetStyle);
1454
+ terminal.dispose();
1455
+ },
1456
+ render: scheduleRender,
1457
+ setStatusLine: (line) => {
1458
+ statusLine = line;
1459
+ scheduleRender();
1460
+ },
1461
+ terminal,
1462
+ write: (data) => {
1463
+ terminal.write(data);
1464
+ scheduleRender();
1465
+ }
1466
+ };
1467
+ }
1468
+
1469
+ // src/actions/clamp/sandboxExec.ts
1470
+ function createMacOSSandbox(policy) {
1471
+ const profileContent = generateMacOSProfile(policy, process.cwd());
1472
+ const profileDir = mkdtempSync(path.join(tmpdir(), "aries-clamp-sb-"));
1473
+ const profilePath = path.join(profileDir, "sandbox.sb");
1474
+ writeFileSync(profilePath, profileContent, "utf8");
1475
+ console.error(chalk.gray("[clamp] macOS sandbox enabled"));
1476
+ return {
1477
+ args: ["-f", profilePath],
1478
+ cleanup: () => {
1479
+ try {
1480
+ rmSync(profileDir, { force: true, recursive: true });
1481
+ } catch {
1482
+ }
1483
+ }
1484
+ };
1485
+ }
1486
+ function resolveSpawnCommand(command, args, policy) {
1487
+ const platform = detectPlatform();
1488
+ const cleanupFns = [];
1489
+ if (platform === "darwin" && policy.filesystem) {
1490
+ const sandbox = createMacOSSandbox(policy);
1491
+ cleanupFns.push(sandbox.cleanup);
1492
+ return {
1493
+ cleanupFns,
1494
+ spawnArgs: [...sandbox.args, command, ...args],
1495
+ spawnCommand: "sandbox-exec"
1496
+ };
1497
+ }
1498
+ if (platform === "linux" && policy.filesystem) {
1499
+ console.error(chalk.yellow("[clamp] Linux filesystem sandbox: Landlock integration pending"));
1500
+ } else if (policy.filesystem) {
1501
+ console.error(chalk.yellow(`[clamp] OS filesystem sandbox not available on ${platform}`));
1502
+ }
1503
+ return {
1504
+ cleanupFns,
1505
+ spawnArgs: args,
1506
+ spawnCommand: command
1507
+ };
1508
+ }
1509
+ function cleanEnvRecord(env) {
1510
+ const clean = {};
1511
+ for (const [k, v] of Object.entries(env)) {
1512
+ if (v !== void 0) clean[k] = v;
1513
+ }
1514
+ return clean;
1515
+ }
1516
+ function spawnWithRenderedPty(spawnCommand, spawnArgs, env) {
1517
+ try {
1518
+ const pty = require_lib();
1519
+ const renderer = createTerminalRenderer();
1520
+ const innerRows = (process.stdout.rows ?? 24) - 2;
1521
+ const ptyProcess = pty.spawn(spawnCommand, spawnArgs, {
1522
+ cols: process.stdout.columns ?? 80,
1523
+ cwd: process.cwd(),
1524
+ env,
1525
+ name: process.env.TERM ?? "xterm-256color",
1526
+ rows: innerRows
1527
+ });
1528
+ let paused = false;
1529
+ ptyProcess.onData((data) => {
1530
+ if (!paused) {
1531
+ renderer.write(data);
1532
+ }
1533
+ });
1534
+ if (process.stdin.isTTY) process.stdin.setRawMode(true);
1535
+ process.stdin.resume();
1536
+ const onStdin = (data) => {
1537
+ ptyProcess.write(data.toString());
1538
+ };
1539
+ process.stdin.on("data", onStdin);
1540
+ const onResize = () => {
1541
+ const newInnerRows = (process.stdout.rows ?? 24) - 2;
1542
+ ptyProcess.resize(process.stdout.columns ?? 80, newInnerRows);
1543
+ };
1544
+ process.stdout.on("resize", onResize);
1545
+ const exitCode = new Promise((resolve) => {
1546
+ ptyProcess.onExit(({ exitCode: code }) => {
1547
+ process.stdin.removeListener("data", onStdin);
1548
+ process.stdout.removeListener("resize", onResize);
1549
+ if (process.stdin.isTTY) process.stdin.setRawMode(false);
1550
+ process.stdin.pause();
1551
+ renderer.destroy();
1552
+ resolve(code);
1553
+ });
1554
+ });
1555
+ return {
1556
+ cleanup: () => {
1557
+ },
1558
+ exitCode,
1559
+ ok: true,
1560
+ pause: () => {
1561
+ paused = true;
1562
+ },
1563
+ renderer,
1564
+ resume: () => {
1565
+ paused = false;
1566
+ renderer.render();
1567
+ }
1568
+ };
1569
+ } catch {
1570
+ return { ok: false };
1571
+ }
1572
+ }
1573
+ function spawnFallback(spawnCommand, spawnArgs, env) {
1574
+ console.error(chalk.yellow("[clamp] PTY unavailable, falling back to basic stdio passthrough"));
1575
+ const child = spawn(spawnCommand, spawnArgs, { env, stdio: "inherit" });
1576
+ const exitCode = new Promise((resolve) => {
1577
+ child.on("close", (code) => resolve(code));
1578
+ child.on("error", () => resolve(1));
1579
+ });
1580
+ const noop = () => {
1581
+ };
1582
+ return {
1583
+ cleanup: noop,
1584
+ exitCode,
1585
+ pause: noop,
1586
+ renderer: void 0,
1587
+ resume: noop
1588
+ };
1589
+ }
1590
+ function spawnSandboxed(options) {
1591
+ const { env, policy } = options;
1592
+ const {
1593
+ spawnCommand,
1594
+ spawnArgs,
1595
+ cleanupFns
1596
+ } = resolveSpawnCommand(options.command, options.args, policy);
1597
+ const cleanEnv = cleanEnvRecord(env);
1598
+ const ptyResult = spawnWithRenderedPty(spawnCommand, spawnArgs, cleanEnv);
1599
+ const result = ptyResult.ok ? ptyResult : spawnFallback(spawnCommand, spawnArgs, env);
1600
+ const originalCleanup = result.cleanup;
1601
+ return {
1602
+ ...result,
1603
+ cleanup: () => {
1604
+ originalCleanup();
1605
+ for (const fn of cleanupFns) fn();
1606
+ }
1607
+ };
1608
+ }
1609
+ export {
1610
+ spawnSandboxed
1611
+ };
1612
+ //# sourceMappingURL=sandboxExec.mjs.map