@xylabs/aries 0.1.1 → 0.1.6

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 +6 -688
  2. package/dist/aries.mjs +47 -8466
  3. package/package.json +15 -169
  4. package/dist/actions/audit/auditPaths.mjs +0 -22
  5. package/dist/actions/audit/auditPaths.mjs.map +0 -1
  6. package/dist/actions/audit/index.mjs +0 -739
  7. package/dist/actions/audit/index.mjs.map +0 -1
  8. package/dist/actions/audit/installPlugin.mjs +0 -298
  9. package/dist/actions/audit/installPlugin.mjs.map +0 -1
  10. package/dist/actions/audit/listSessions.mjs +0 -93
  11. package/dist/actions/audit/listSessions.mjs.map +0 -1
  12. package/dist/actions/audit/openAuditDir.mjs +0 -44
  13. package/dist/actions/audit/openAuditDir.mjs.map +0 -1
  14. package/dist/actions/audit/searchAudit.mjs +0 -77
  15. package/dist/actions/audit/searchAudit.mjs.map +0 -1
  16. package/dist/actions/audit/showAiMeta.mjs +0 -105
  17. package/dist/actions/audit/showAiMeta.mjs.map +0 -1
  18. package/dist/actions/audit/showSession.mjs +0 -105
  19. package/dist/actions/audit/showSession.mjs.map +0 -1
  20. package/dist/actions/audit/statusAudit.mjs +0 -98
  21. package/dist/actions/audit/statusAudit.mjs.map +0 -1
  22. package/dist/actions/clamp/clampAudit.mjs +0 -53
  23. package/dist/actions/clamp/clampAudit.mjs.map +0 -1
  24. package/dist/actions/clamp/index.mjs +0 -2258
  25. package/dist/actions/clamp/index.mjs.map +0 -1
  26. package/dist/actions/clamp/ipcServer.mjs +0 -55
  27. package/dist/actions/clamp/ipcServer.mjs.map +0 -1
  28. package/dist/actions/clamp/policyManagement.mjs +0 -144
  29. package/dist/actions/clamp/policyManagement.mjs.map +0 -1
  30. package/dist/actions/clamp/promptUser.mjs +0 -91
  31. package/dist/actions/clamp/promptUser.mjs.map +0 -1
  32. package/dist/actions/clamp/runClamped.mjs +0 -2107
  33. package/dist/actions/clamp/runClamped.mjs.map +0 -1
  34. package/dist/actions/clamp/sandboxExec.mjs +0 -1612
  35. package/dist/actions/clamp/sandboxExec.mjs.map +0 -1
  36. package/dist/actions/clamp/shellEnvSetup.mjs +0 -59
  37. package/dist/actions/clamp/shellEnvSetup.mjs.map +0 -1
  38. package/dist/actions/clamp/shimGenerator.mjs +0 -68
  39. package/dist/actions/clamp/shimGenerator.mjs.map +0 -1
  40. package/dist/actions/clamp/terminalRenderer.mjs +0 -145
  41. package/dist/actions/clamp/terminalRenderer.mjs.map +0 -1
  42. package/dist/actions/datalake/audit/auditLog.mjs +0 -191
  43. package/dist/actions/datalake/audit/auditLog.mjs.map +0 -1
  44. package/dist/actions/datalake/createDatalake.mjs +0 -127
  45. package/dist/actions/datalake/createDatalake.mjs.map +0 -1
  46. package/dist/actions/datalake/describeDatalake.mjs +0 -159
  47. package/dist/actions/datalake/describeDatalake.mjs.map +0 -1
  48. package/dist/actions/datalake/destroyDatalake.mjs +0 -34
  49. package/dist/actions/datalake/destroyDatalake.mjs.map +0 -1
  50. package/dist/actions/datalake/dev/downDevServer.mjs +0 -102
  51. package/dist/actions/datalake/dev/downDevServer.mjs.map +0 -1
  52. package/dist/actions/datalake/dev/index.mjs +0 -369
  53. package/dist/actions/datalake/dev/index.mjs.map +0 -1
  54. package/dist/actions/datalake/dev/logsDevServer.mjs +0 -44
  55. package/dist/actions/datalake/dev/logsDevServer.mjs.map +0 -1
  56. package/dist/actions/datalake/dev/paths.mjs +0 -25
  57. package/dist/actions/datalake/dev/paths.mjs.map +0 -1
  58. package/dist/actions/datalake/dev/resetDevServer.mjs +0 -118
  59. package/dist/actions/datalake/dev/resetDevServer.mjs.map +0 -1
  60. package/dist/actions/datalake/dev/resolveServerBin.mjs +0 -26
  61. package/dist/actions/datalake/dev/resolveServerBin.mjs.map +0 -1
  62. package/dist/actions/datalake/dev/state.mjs +0 -62
  63. package/dist/actions/datalake/dev/state.mjs.map +0 -1
  64. package/dist/actions/datalake/dev/statusDevServer.mjs +0 -101
  65. package/dist/actions/datalake/dev/statusDevServer.mjs.map +0 -1
  66. package/dist/actions/datalake/dev/upDevServer.mjs +0 -221
  67. package/dist/actions/datalake/dev/upDevServer.mjs.map +0 -1
  68. package/dist/actions/datalake/dev/waitForHealth.mjs +0 -22
  69. package/dist/actions/datalake/dev/waitForHealth.mjs.map +0 -1
  70. package/dist/actions/datalake/formatters.mjs +0 -90
  71. package/dist/actions/datalake/formatters.mjs.map +0 -1
  72. package/dist/actions/datalake/grantAccess.mjs +0 -116
  73. package/dist/actions/datalake/grantAccess.mjs.map +0 -1
  74. package/dist/actions/datalake/index.mjs +0 -361
  75. package/dist/actions/datalake/index.mjs.map +0 -1
  76. package/dist/actions/datalake/listDatalakes.mjs +0 -54
  77. package/dist/actions/datalake/listDatalakes.mjs.map +0 -1
  78. package/dist/actions/datalake/login.mjs +0 -20
  79. package/dist/actions/datalake/login.mjs.map +0 -1
  80. package/dist/actions/datalake/logout.mjs +0 -11
  81. package/dist/actions/datalake/logout.mjs.map +0 -1
  82. package/dist/actions/datalake/mintToken.mjs +0 -37
  83. package/dist/actions/datalake/mintToken.mjs.map +0 -1
  84. package/dist/actions/datalake/parseSize.mjs +0 -21
  85. package/dist/actions/datalake/parseSize.mjs.map +0 -1
  86. package/dist/actions/datalake/payloads/fetchPayload.mjs +0 -76
  87. package/dist/actions/datalake/payloads/fetchPayload.mjs.map +0 -1
  88. package/dist/actions/datalake/payloads/index.mjs +0 -271
  89. package/dist/actions/datalake/payloads/index.mjs.map +0 -1
  90. package/dist/actions/datalake/payloads/mintAndConnect.mjs +0 -46
  91. package/dist/actions/datalake/payloads/mintAndConnect.mjs.map +0 -1
  92. package/dist/actions/datalake/payloads/parsePayloadsFile.mjs +0 -71
  93. package/dist/actions/datalake/payloads/parsePayloadsFile.mjs.map +0 -1
  94. package/dist/actions/datalake/payloads/pushPayloads.mjs +0 -181
  95. package/dist/actions/datalake/payloads/pushPayloads.mjs.map +0 -1
  96. package/dist/actions/datalake/payloads/tailPayloads.mjs +0 -106
  97. package/dist/actions/datalake/payloads/tailPayloads.mjs.map +0 -1
  98. package/dist/actions/datalake/resolveTarget.mjs +0 -15
  99. package/dist/actions/datalake/resolveTarget.mjs.map +0 -1
  100. package/dist/actions/datalake/revokeAccess.mjs +0 -108
  101. package/dist/actions/datalake/revokeAccess.mjs.map +0 -1
  102. package/dist/actions/datalake/useDatalake.mjs +0 -22
  103. package/dist/actions/datalake/useDatalake.mjs.map +0 -1
  104. package/dist/actions/detect/detectAiClients.mjs +0 -405
  105. package/dist/actions/detect/detectAiClients.mjs.map +0 -1
  106. package/dist/actions/detect/index.mjs +0 -405
  107. package/dist/actions/detect/index.mjs.map +0 -1
  108. package/dist/actions/hash/algorithms/blockhash.mjs +0 -61
  109. package/dist/actions/hash/algorithms/blockhash.mjs.map +0 -1
  110. package/dist/actions/hash/algorithms/chromaprint.mjs +0 -205
  111. package/dist/actions/hash/algorithms/chromaprint.mjs.map +0 -1
  112. package/dist/actions/hash/algorithms/dhash.mjs +0 -75
  113. package/dist/actions/hash/algorithms/dhash.mjs.map +0 -1
  114. package/dist/actions/hash/algorithms/index.mjs +0 -818
  115. package/dist/actions/hash/algorithms/index.mjs.map +0 -1
  116. package/dist/actions/hash/algorithms/nilsimsa.mjs +0 -27
  117. package/dist/actions/hash/algorithms/nilsimsa.mjs.map +0 -1
  118. package/dist/actions/hash/algorithms/pdq.mjs +0 -83
  119. package/dist/actions/hash/algorithms/pdq.mjs.map +0 -1
  120. package/dist/actions/hash/algorithms/phash.mjs +0 -71
  121. package/dist/actions/hash/algorithms/phash.mjs.map +0 -1
  122. package/dist/actions/hash/algorithms/sha256.mjs +0 -24
  123. package/dist/actions/hash/algorithms/sha256.mjs.map +0 -1
  124. package/dist/actions/hash/algorithms/ssdeep.mjs +0 -203
  125. package/dist/actions/hash/algorithms/ssdeep.mjs.map +0 -1
  126. package/dist/actions/hash/algorithms/tlsh.mjs +0 -66
  127. package/dist/actions/hash/algorithms/tlsh.mjs.map +0 -1
  128. package/dist/actions/hash/algorithms/types.mjs +0 -1
  129. package/dist/actions/hash/algorithms/types.mjs.map +0 -1
  130. package/dist/actions/hash/algorithms/videoFrames.mjs +0 -404
  131. package/dist/actions/hash/algorithms/videoFrames.mjs.map +0 -1
  132. package/dist/actions/hash/algorithms/xyo.mjs +0 -30
  133. package/dist/actions/hash/algorithms/xyo.mjs.map +0 -1
  134. package/dist/actions/hash/compareHashes.mjs +0 -823
  135. package/dist/actions/hash/compareHashes.mjs.map +0 -1
  136. package/dist/actions/hash/hashInput.mjs +0 -868
  137. package/dist/actions/hash/hashInput.mjs.map +0 -1
  138. package/dist/actions/hash/index.mjs +0 -881
  139. package/dist/actions/hash/index.mjs.map +0 -1
  140. package/dist/actions/hash/lib/hamming.mjs +0 -44
  141. package/dist/actions/hash/lib/hamming.mjs.map +0 -1
  142. package/dist/actions/hash/lib/levenshtein.mjs +0 -36
  143. package/dist/actions/hash/lib/levenshtein.mjs.map +0 -1
  144. package/dist/actions/hash/lib/runBinary.mjs +0 -54
  145. package/dist/actions/hash/lib/runBinary.mjs.map +0 -1
  146. package/dist/actions/hash/lib/which.mjs +0 -36
  147. package/dist/actions/hash/lib/which.mjs.map +0 -1
  148. package/dist/actions/hash/lib/withTempfile.mjs +0 -19
  149. package/dist/actions/hash/lib/withTempfile.mjs.map +0 -1
  150. package/dist/actions/index.mjs +0 -4615
  151. package/dist/actions/index.mjs.map +0 -1
  152. package/dist/actions/printVersion.mjs +0 -12
  153. package/dist/actions/printVersion.mjs.map +0 -1
  154. package/dist/actions/sync/index.mjs +0 -51
  155. package/dist/actions/sync/index.mjs.map +0 -1
  156. package/dist/actions/sync/syncAiConfig.mjs +0 -51
  157. package/dist/actions/sync/syncAiConfig.mjs.map +0 -1
  158. package/dist/actions/wallet/account/deriveAndAdd.mjs +0 -394
  159. package/dist/actions/wallet/account/deriveAndAdd.mjs.map +0 -1
  160. package/dist/actions/wallet/account/getActiveWallet.mjs +0 -338
  161. package/dist/actions/wallet/account/getActiveWallet.mjs.map +0 -1
  162. package/dist/actions/wallet/account/labelAccount.mjs +0 -389
  163. package/dist/actions/wallet/account/labelAccount.mjs.map +0 -1
  164. package/dist/actions/wallet/account/listAccounts.mjs +0 -374
  165. package/dist/actions/wallet/account/listAccounts.mjs.map +0 -1
  166. package/dist/actions/wallet/account/removeAccount.mjs +0 -384
  167. package/dist/actions/wallet/account/removeAccount.mjs.map +0 -1
  168. package/dist/actions/wallet/account/showAccount.mjs +0 -368
  169. package/dist/actions/wallet/account/showAccount.mjs.map +0 -1
  170. package/dist/actions/wallet/addressBook/storage.mjs +0 -110
  171. package/dist/actions/wallet/addressBook/storage.mjs.map +0 -1
  172. package/dist/actions/wallet/backup/exportBackup.mjs +0 -93
  173. package/dist/actions/wallet/backup/exportBackup.mjs.map +0 -1
  174. package/dist/actions/wallet/backup/importBackup.mjs +0 -142
  175. package/dist/actions/wallet/backup/importBackup.mjs.map +0 -1
  176. package/dist/actions/wallet/balance/getBalance.mjs +0 -434
  177. package/dist/actions/wallet/balance/getBalance.mjs.map +0 -1
  178. package/dist/actions/wallet/client/walletClient.mjs +0 -64
  179. package/dist/actions/wallet/client/walletClient.mjs.map +0 -1
  180. package/dist/actions/wallet/contact/contactActions.mjs +0 -120
  181. package/dist/actions/wallet/contact/contactActions.mjs.map +0 -1
  182. package/dist/actions/wallet/contact/storage.mjs +0 -69
  183. package/dist/actions/wallet/contact/storage.mjs.map +0 -1
  184. package/dist/actions/wallet/index.mjs +0 -1439
  185. package/dist/actions/wallet/index.mjs.map +0 -1
  186. package/dist/actions/wallet/network/networkActions.mjs +0 -137
  187. package/dist/actions/wallet/network/networkActions.mjs.map +0 -1
  188. package/dist/actions/wallet/network/storage.mjs +0 -93
  189. package/dist/actions/wallet/network/storage.mjs.map +0 -1
  190. package/dist/actions/wallet/password/changePassword.mjs +0 -282
  191. package/dist/actions/wallet/password/changePassword.mjs.map +0 -1
  192. package/dist/actions/wallet/password/getActiveKey.mjs +0 -297
  193. package/dist/actions/wallet/password/getActiveKey.mjs.map +0 -1
  194. package/dist/actions/wallet/password/initOrUnlock.mjs +0 -337
  195. package/dist/actions/wallet/password/initOrUnlock.mjs.map +0 -1
  196. package/dist/actions/wallet/password/passwordStorage.mjs +0 -69
  197. package/dist/actions/wallet/password/passwordStorage.mjs.map +0 -1
  198. package/dist/actions/wallet/password/setPassword.mjs +0 -138
  199. package/dist/actions/wallet/password/setPassword.mjs.map +0 -1
  200. package/dist/actions/wallet/password/validatePassword.mjs +0 -123
  201. package/dist/actions/wallet/password/validatePassword.mjs.map +0 -1
  202. package/dist/actions/wallet/passwordKey.mjs +0 -87
  203. package/dist/actions/wallet/passwordKey.mjs.map +0 -1
  204. package/dist/actions/wallet/paths.mjs +0 -26
  205. package/dist/actions/wallet/paths.mjs.map +0 -1
  206. package/dist/actions/wallet/prompt.mjs +0 -93
  207. package/dist/actions/wallet/prompt.mjs.map +0 -1
  208. package/dist/actions/wallet/seedPhrase/createPhrase.mjs +0 -392
  209. package/dist/actions/wallet/seedPhrase/createPhrase.mjs.map +0 -1
  210. package/dist/actions/wallet/seedPhrase/exportPhrase.mjs +0 -334
  211. package/dist/actions/wallet/seedPhrase/exportPhrase.mjs.map +0 -1
  212. package/dist/actions/wallet/seedPhrase/idGen.mjs +0 -11
  213. package/dist/actions/wallet/seedPhrase/idGen.mjs.map +0 -1
  214. package/dist/actions/wallet/seedPhrase/importPhrase.mjs +0 -393
  215. package/dist/actions/wallet/seedPhrase/importPhrase.mjs.map +0 -1
  216. package/dist/actions/wallet/seedPhrase/listPhrases.mjs +0 -62
  217. package/dist/actions/wallet/seedPhrase/listPhrases.mjs.map +0 -1
  218. package/dist/actions/wallet/seedPhrase/phraseStorage.mjs +0 -89
  219. package/dist/actions/wallet/seedPhrase/phraseStorage.mjs.map +0 -1
  220. package/dist/actions/wallet/seedPhrase/removePhrase.mjs +0 -366
  221. package/dist/actions/wallet/seedPhrase/removePhrase.mjs.map +0 -1
  222. package/dist/actions/wallet/seedPhrase/renamePhrase.mjs +0 -78
  223. package/dist/actions/wallet/seedPhrase/renamePhrase.mjs.map +0 -1
  224. package/dist/actions/wallet/seedPhrase/types.mjs +0 -1
  225. package/dist/actions/wallet/seedPhrase/types.mjs.map +0 -1
  226. package/dist/actions/wallet/seedPhrase/usePhrase.mjs +0 -83
  227. package/dist/actions/wallet/seedPhrase/usePhrase.mjs.map +0 -1
  228. package/dist/actions/wallet/session/machineId.mjs +0 -145
  229. package/dist/actions/wallet/session/machineId.mjs.map +0 -1
  230. package/dist/actions/wallet/session/sessionCache.mjs +0 -221
  231. package/dist/actions/wallet/session/sessionCache.mjs.map +0 -1
  232. package/dist/actions/wallet/session/unlock.mjs +0 -307
  233. package/dist/actions/wallet/session/unlock.mjs.map +0 -1
  234. package/dist/actions/wallet/sign/signPayload.mjs +0 -637
  235. package/dist/actions/wallet/sign/signPayload.mjs.map +0 -1
  236. package/dist/actions/wallet/storage.mjs +0 -51
  237. package/dist/actions/wallet/storage.mjs.map +0 -1
  238. package/dist/actions/wallet/transaction/broadcastTransaction.mjs +0 -453
  239. package/dist/actions/wallet/transaction/broadcastTransaction.mjs.map +0 -1
  240. package/dist/actions/wallet/transaction/sendTransaction.mjs +0 -457
  241. package/dist/actions/wallet/transaction/sendTransaction.mjs.map +0 -1
  242. package/dist/actions/wallet/transaction/signTransactionFile.mjs +0 -378
  243. package/dist/actions/wallet/transaction/signTransactionFile.mjs.map +0 -1
  244. package/dist/actions/xyo/index.mjs +0 -138
  245. package/dist/actions/xyo/index.mjs.map +0 -1
  246. package/dist/actions/xyo/transaction/index.mjs +0 -138
  247. package/dist/actions/xyo/transaction/index.mjs.map +0 -1
  248. package/dist/actions/xyo/transaction/validateTransactions.mjs +0 -138
  249. package/dist/actions/xyo/transaction/validateTransactions.mjs.map +0 -1
  250. package/dist/aries.mjs.map +0 -1
  251. package/dist/bin/aries.mjs +0 -8472
  252. package/dist/bin/aries.mjs.map +0 -1
  253. package/dist/commands/aiCommand.mjs +0 -492
  254. package/dist/commands/aiCommand.mjs.map +0 -1
  255. package/dist/commands/auditAiCommand.mjs +0 -119
  256. package/dist/commands/auditAiCommand.mjs.map +0 -1
  257. package/dist/commands/auditCommand.mjs +0 -857
  258. package/dist/commands/auditCommand.mjs.map +0 -1
  259. package/dist/commands/auditInstallCommand.mjs +0 -324
  260. package/dist/commands/auditInstallCommand.mjs.map +0 -1
  261. package/dist/commands/auditListCommand.mjs +0 -107
  262. package/dist/commands/auditListCommand.mjs.map +0 -1
  263. package/dist/commands/auditOpenCommand.mjs +0 -51
  264. package/dist/commands/auditOpenCommand.mjs.map +0 -1
  265. package/dist/commands/auditSearchCommand.mjs +0 -98
  266. package/dist/commands/auditSearchCommand.mjs.map +0 -1
  267. package/dist/commands/auditShowCommand.mjs +0 -123
  268. package/dist/commands/auditShowCommand.mjs.map +0 -1
  269. package/dist/commands/auditStatusCommand.mjs +0 -105
  270. package/dist/commands/auditStatusCommand.mjs.map +0 -1
  271. package/dist/commands/clampCommand.mjs +0 -2328
  272. package/dist/commands/clampCommand.mjs.map +0 -1
  273. package/dist/commands/clampPolicyCommand.mjs +0 -184
  274. package/dist/commands/clampPolicyCommand.mjs.map +0 -1
  275. package/dist/commands/clampPolicyInitCommand.mjs +0 -63
  276. package/dist/commands/clampPolicyInitCommand.mjs.map +0 -1
  277. package/dist/commands/clampPolicyListCommand.mjs +0 -56
  278. package/dist/commands/clampPolicyListCommand.mjs.map +0 -1
  279. package/dist/commands/clampPolicyShowCommand.mjs +0 -83
  280. package/dist/commands/clampPolicyShowCommand.mjs.map +0 -1
  281. package/dist/commands/clampRunCommand.mjs +0 -2137
  282. package/dist/commands/clampRunCommand.mjs.map +0 -1
  283. package/dist/commands/datalakeAuditCommand.mjs +0 -273
  284. package/dist/commands/datalakeAuditCommand.mjs.map +0 -1
  285. package/dist/commands/datalakeCommand.mjs +0 -1637
  286. package/dist/commands/datalakeCommand.mjs.map +0 -1
  287. package/dist/commands/datalakeCreateCommand.mjs +0 -189
  288. package/dist/commands/datalakeCreateCommand.mjs.map +0 -1
  289. package/dist/commands/datalakeDescribeCommand.mjs +0 -172
  290. package/dist/commands/datalakeDescribeCommand.mjs.map +0 -1
  291. package/dist/commands/datalakeDestroyCommand.mjs +0 -53
  292. package/dist/commands/datalakeDestroyCommand.mjs.map +0 -1
  293. package/dist/commands/datalakeDevCommand.mjs +0 -470
  294. package/dist/commands/datalakeDevCommand.mjs.map +0 -1
  295. package/dist/commands/datalakeDevDownCommand.mjs +0 -111
  296. package/dist/commands/datalakeDevDownCommand.mjs.map +0 -1
  297. package/dist/commands/datalakeDevLogsCommand.mjs +0 -65
  298. package/dist/commands/datalakeDevLogsCommand.mjs.map +0 -1
  299. package/dist/commands/datalakeDevResetCommand.mjs +0 -125
  300. package/dist/commands/datalakeDevResetCommand.mjs.map +0 -1
  301. package/dist/commands/datalakeDevStatusCommand.mjs +0 -110
  302. package/dist/commands/datalakeDevStatusCommand.mjs.map +0 -1
  303. package/dist/commands/datalakeDevUpCommand.mjs +0 -268
  304. package/dist/commands/datalakeDevUpCommand.mjs.map +0 -1
  305. package/dist/commands/datalakeFetchCommand.mjs +0 -106
  306. package/dist/commands/datalakeFetchCommand.mjs.map +0 -1
  307. package/dist/commands/datalakeGrantCommand.mjs +0 -147
  308. package/dist/commands/datalakeGrantCommand.mjs.map +0 -1
  309. package/dist/commands/datalakeListCommand.mjs +0 -61
  310. package/dist/commands/datalakeListCommand.mjs.map +0 -1
  311. package/dist/commands/datalakeLoginCommand.mjs +0 -39
  312. package/dist/commands/datalakeLoginCommand.mjs.map +0 -1
  313. package/dist/commands/datalakeLogoutCommand.mjs +0 -20
  314. package/dist/commands/datalakeLogoutCommand.mjs.map +0 -1
  315. package/dist/commands/datalakePushCommand.mjs +0 -214
  316. package/dist/commands/datalakePushCommand.mjs.map +0 -1
  317. package/dist/commands/datalakeRevokeCommand.mjs +0 -127
  318. package/dist/commands/datalakeRevokeCommand.mjs.map +0 -1
  319. package/dist/commands/datalakeTailCommand.mjs +0 -144
  320. package/dist/commands/datalakeTailCommand.mjs.map +0 -1
  321. package/dist/commands/datalakeTokenCommand.mjs +0 -61
  322. package/dist/commands/datalakeTokenCommand.mjs.map +0 -1
  323. package/dist/commands/datalakeUseCommand.mjs +0 -35
  324. package/dist/commands/datalakeUseCommand.mjs.map +0 -1
  325. package/dist/commands/detectCommand.mjs +0 -419
  326. package/dist/commands/detectCommand.mjs.map +0 -1
  327. package/dist/commands/hashCommand.mjs +0 -976
  328. package/dist/commands/hashCommand.mjs.map +0 -1
  329. package/dist/commands/hashCompareCommand.mjs +0 -865
  330. package/dist/commands/hashCompareCommand.mjs.map +0 -1
  331. package/dist/commands/index.mjs +0 -8461
  332. package/dist/commands/index.mjs.map +0 -1
  333. package/dist/commands/syncCommand.mjs +0 -66
  334. package/dist/commands/syncCommand.mjs.map +0 -1
  335. package/dist/commands/versionCommand.mjs +0 -24
  336. package/dist/commands/versionCommand.mjs.map +0 -1
  337. package/dist/commands/walletAccountCommand.mjs +0 -536
  338. package/dist/commands/walletAccountCommand.mjs.map +0 -1
  339. package/dist/commands/walletAccountDeriveCommand.mjs +0 -415
  340. package/dist/commands/walletAccountDeriveCommand.mjs.map +0 -1
  341. package/dist/commands/walletAccountLabelCommand.mjs +0 -405
  342. package/dist/commands/walletAccountLabelCommand.mjs.map +0 -1
  343. package/dist/commands/walletAccountListCommand.mjs +0 -381
  344. package/dist/commands/walletAccountListCommand.mjs.map +0 -1
  345. package/dist/commands/walletAccountRemoveCommand.mjs +0 -396
  346. package/dist/commands/walletAccountRemoveCommand.mjs.map +0 -1
  347. package/dist/commands/walletAccountShowCommand.mjs +0 -380
  348. package/dist/commands/walletAccountShowCommand.mjs.map +0 -1
  349. package/dist/commands/walletBackupCommand.mjs +0 -222
  350. package/dist/commands/walletBackupCommand.mjs.map +0 -1
  351. package/dist/commands/walletBackupExportCommand.mjs +0 -107
  352. package/dist/commands/walletBackupExportCommand.mjs.map +0 -1
  353. package/dist/commands/walletBackupImportCommand.mjs +0 -154
  354. package/dist/commands/walletBackupImportCommand.mjs.map +0 -1
  355. package/dist/commands/walletBalanceCommand.mjs +0 -448
  356. package/dist/commands/walletBalanceCommand.mjs.map +0 -1
  357. package/dist/commands/walletCommand.mjs +0 -1968
  358. package/dist/commands/walletCommand.mjs.map +0 -1
  359. package/dist/commands/walletContactAddCommand.mjs +0 -111
  360. package/dist/commands/walletContactAddCommand.mjs.map +0 -1
  361. package/dist/commands/walletContactCommand.mjs +0 -184
  362. package/dist/commands/walletContactCommand.mjs.map +0 -1
  363. package/dist/commands/walletContactListCommand.mjs +0 -66
  364. package/dist/commands/walletContactListCommand.mjs.map +0 -1
  365. package/dist/commands/walletContactRemoveCommand.mjs +0 -97
  366. package/dist/commands/walletContactRemoveCommand.mjs.map +0 -1
  367. package/dist/commands/walletContactRenameCommand.mjs +0 -114
  368. package/dist/commands/walletContactRenameCommand.mjs.map +0 -1
  369. package/dist/commands/walletCreateCommand.mjs +0 -407
  370. package/dist/commands/walletCreateCommand.mjs.map +0 -1
  371. package/dist/commands/walletExportCommand.mjs +0 -345
  372. package/dist/commands/walletExportCommand.mjs.map +0 -1
  373. package/dist/commands/walletImportCommand.mjs +0 -413
  374. package/dist/commands/walletImportCommand.mjs.map +0 -1
  375. package/dist/commands/walletListCommand.mjs +0 -69
  376. package/dist/commands/walletListCommand.mjs.map +0 -1
  377. package/dist/commands/walletLockCommand.mjs +0 -56
  378. package/dist/commands/walletLockCommand.mjs.map +0 -1
  379. package/dist/commands/walletNetworkAddCommand.mjs +0 -131
  380. package/dist/commands/walletNetworkAddCommand.mjs.map +0 -1
  381. package/dist/commands/walletNetworkCommand.mjs +0 -206
  382. package/dist/commands/walletNetworkCommand.mjs.map +0 -1
  383. package/dist/commands/walletNetworkListCommand.mjs +0 -104
  384. package/dist/commands/walletNetworkListCommand.mjs.map +0 -1
  385. package/dist/commands/walletNetworkRemoveCommand.mjs +0 -112
  386. package/dist/commands/walletNetworkRemoveCommand.mjs.map +0 -1
  387. package/dist/commands/walletNetworkUseCommand.mjs +0 -110
  388. package/dist/commands/walletNetworkUseCommand.mjs.map +0 -1
  389. package/dist/commands/walletPasswordChangeCommand.mjs +0 -291
  390. package/dist/commands/walletPasswordChangeCommand.mjs.map +0 -1
  391. package/dist/commands/walletPasswordCommand.mjs +0 -301
  392. package/dist/commands/walletPasswordCommand.mjs.map +0 -1
  393. package/dist/commands/walletRemoveCommand.mjs +0 -378
  394. package/dist/commands/walletRemoveCommand.mjs.map +0 -1
  395. package/dist/commands/walletRenameCommand.mjs +0 -94
  396. package/dist/commands/walletRenameCommand.mjs.map +0 -1
  397. package/dist/commands/walletSignCommand.mjs +0 -662
  398. package/dist/commands/walletSignCommand.mjs.map +0 -1
  399. package/dist/commands/walletTxBroadcastCommand.mjs +0 -473
  400. package/dist/commands/walletTxBroadcastCommand.mjs.map +0 -1
  401. package/dist/commands/walletTxCommand.mjs +0 -612
  402. package/dist/commands/walletTxCommand.mjs.map +0 -1
  403. package/dist/commands/walletTxSendCommand.mjs +0 -492
  404. package/dist/commands/walletTxSendCommand.mjs.map +0 -1
  405. package/dist/commands/walletTxSignCommand.mjs +0 -403
  406. package/dist/commands/walletTxSignCommand.mjs.map +0 -1
  407. package/dist/commands/walletUnlockCommand.mjs +0 -308
  408. package/dist/commands/walletUnlockCommand.mjs.map +0 -1
  409. package/dist/commands/walletUseCommand.mjs +0 -95
  410. package/dist/commands/walletUseCommand.mjs.map +0 -1
  411. package/dist/commands/xyoCommand.mjs +0 -188
  412. package/dist/commands/xyoCommand.mjs.map +0 -1
  413. package/dist/commands/xyoTxCommand.mjs +0 -178
  414. package/dist/commands/xyoTxCommand.mjs.map +0 -1
  415. package/dist/commands/xyoTxValidateCommand.mjs +0 -168
  416. package/dist/commands/xyoTxValidateCommand.mjs.map +0 -1
  417. package/dist/index.d.ts +0 -3
  418. package/dist/index.mjs +0 -8466
  419. package/dist/index.mjs.map +0 -1
  420. package/dist/types/modules.d.mjs +0 -1
  421. package/dist/types/modules.d.mjs.map +0 -1
@@ -1,66 +0,0 @@
1
- // src/actions/sync/syncAiConfig.ts
2
- import {
3
- copyFileSync,
4
- cpSync,
5
- existsSync,
6
- rmSync
7
- } from "fs";
8
- import path from "path";
9
- import chalk from "chalk";
10
- function resolveMapping(from, cwd) {
11
- if (from === "claude") {
12
- return {
13
- destDir: path.join(cwd, ".agents"),
14
- destFile: path.join(cwd, "AGENTS.md"),
15
- sourceDir: path.join(cwd, ".claude"),
16
- sourceFile: path.join(cwd, "CLAUDE.md")
17
- };
18
- }
19
- return {
20
- destDir: path.join(cwd, ".claude"),
21
- destFile: path.join(cwd, "CLAUDE.md"),
22
- sourceDir: path.join(cwd, ".agents"),
23
- sourceFile: path.join(cwd, "AGENTS.md")
24
- };
25
- }
26
- function syncAiConfig(from) {
27
- const cwd = process.cwd();
28
- const mapping = resolveMapping(from, cwd);
29
- if (!existsSync(mapping.sourceDir)) {
30
- throw new Error(chalk.red(`Source directory not found: ${mapping.sourceDir}`));
31
- }
32
- if (!existsSync(mapping.sourceFile)) {
33
- throw new Error(chalk.red(`Source file not found: ${mapping.sourceFile}`));
34
- }
35
- if (existsSync(mapping.destDir)) {
36
- rmSync(mapping.destDir, { recursive: true });
37
- }
38
- if (existsSync(mapping.destFile)) {
39
- rmSync(mapping.destFile);
40
- }
41
- cpSync(mapping.sourceDir, mapping.destDir, { recursive: true });
42
- copyFileSync(mapping.sourceFile, mapping.destFile);
43
- const label = from === "claude" ? "Claude \u2192 Codex" : "Codex \u2192 Claude";
44
- console.log(chalk.green(`Synced ${label}:`));
45
- console.log(` ${path.basename(mapping.sourceDir)}/ \u2192 ${path.basename(mapping.destDir)}/`);
46
- console.log(` ${path.basename(mapping.sourceFile)} \u2192 ${path.basename(mapping.destFile)}`);
47
- }
48
-
49
- // src/commands/syncCommand.ts
50
- var syncCommand = {
51
- builder: (yargs) => yargs.option("from", {
52
- choices: ["claude", "agents"],
53
- default: "claude",
54
- describe: "Source to sync from (the authority)",
55
- type: "string"
56
- }),
57
- command: "sync",
58
- describe: "Sync AI config between Claude Code and Codex",
59
- handler: (argv) => {
60
- syncAiConfig(argv.from);
61
- }
62
- };
63
- export {
64
- syncCommand
65
- };
66
- //# sourceMappingURL=syncCommand.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/actions/sync/syncAiConfig.ts","../../src/commands/syncCommand.ts"],"sourcesContent":["import {\n copyFileSync,\n cpSync,\n existsSync,\n rmSync,\n} from 'node:fs'\nimport path from 'node:path'\n\nimport chalk from 'chalk'\n\ntype SyncSource = 'agents' | 'claude'\n\ninterface SyncMapping {\n destDir: string\n destFile: string\n sourceDir: string\n sourceFile: string\n}\n\nfunction resolveMapping(from: SyncSource, cwd: string): SyncMapping {\n if (from === 'claude') {\n return {\n destDir: path.join(cwd, '.agents'),\n destFile: path.join(cwd, 'AGENTS.md'),\n sourceDir: path.join(cwd, '.claude'),\n sourceFile: path.join(cwd, 'CLAUDE.md'),\n }\n }\n return {\n destDir: path.join(cwd, '.claude'),\n destFile: path.join(cwd, 'CLAUDE.md'),\n sourceDir: path.join(cwd, '.agents'),\n sourceFile: path.join(cwd, 'AGENTS.md'),\n }\n}\n\nexport function syncAiConfig(from: SyncSource): void {\n const cwd = process.cwd()\n const mapping = resolveMapping(from, cwd)\n\n if (!existsSync(mapping.sourceDir)) {\n throw new Error(chalk.red(`Source directory not found: ${mapping.sourceDir}`))\n }\n\n if (!existsSync(mapping.sourceFile)) {\n throw new Error(chalk.red(`Source file not found: ${mapping.sourceFile}`))\n }\n\n if (existsSync(mapping.destDir)) {\n rmSync(mapping.destDir, { recursive: true })\n }\n\n if (existsSync(mapping.destFile)) {\n rmSync(mapping.destFile)\n }\n\n cpSync(mapping.sourceDir, mapping.destDir, { recursive: true })\n copyFileSync(mapping.sourceFile, mapping.destFile)\n\n const label = from === 'claude' ? 'Claude → Codex' : 'Codex → Claude'\n console.log(chalk.green(`Synced ${label}:`))\n console.log(` ${path.basename(mapping.sourceDir)}/ → ${path.basename(mapping.destDir)}/`)\n console.log(` ${path.basename(mapping.sourceFile)} → ${path.basename(mapping.destFile)}`)\n}\n","import type { CommandModule } from 'yargs'\n\nimport { syncAiConfig } from '../actions/sync/index.ts'\n\nexport const syncCommand: CommandModule = {\n builder: yargs =>\n yargs\n .option('from', {\n choices: ['claude', 'agents'] as const,\n default: 'claude',\n describe: 'Source to sync from (the authority)',\n type: 'string',\n }),\n command: 'sync',\n describe: 'Sync AI config between Claude Code and Codex',\n handler: (argv) => {\n syncAiConfig(argv.from as 'agents' | 'claude')\n },\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,OAAO,UAAU;AAEjB,OAAO,WAAW;AAWlB,SAAS,eAAe,MAAkB,KAA0B;AAClE,MAAI,SAAS,UAAU;AACrB,WAAO;AAAA,MACL,SAAS,KAAK,KAAK,KAAK,SAAS;AAAA,MACjC,UAAU,KAAK,KAAK,KAAK,WAAW;AAAA,MACpC,WAAW,KAAK,KAAK,KAAK,SAAS;AAAA,MACnC,YAAY,KAAK,KAAK,KAAK,WAAW;AAAA,IACxC;AAAA,EACF;AACA,SAAO;AAAA,IACL,SAAS,KAAK,KAAK,KAAK,SAAS;AAAA,IACjC,UAAU,KAAK,KAAK,KAAK,WAAW;AAAA,IACpC,WAAW,KAAK,KAAK,KAAK,SAAS;AAAA,IACnC,YAAY,KAAK,KAAK,KAAK,WAAW;AAAA,EACxC;AACF;AAEO,SAAS,aAAa,MAAwB;AACnD,QAAM,MAAM,QAAQ,IAAI;AACxB,QAAM,UAAU,eAAe,MAAM,GAAG;AAExC,MAAI,CAAC,WAAW,QAAQ,SAAS,GAAG;AAClC,UAAM,IAAI,MAAM,MAAM,IAAI,+BAA+B,QAAQ,SAAS,EAAE,CAAC;AAAA,EAC/E;AAEA,MAAI,CAAC,WAAW,QAAQ,UAAU,GAAG;AACnC,UAAM,IAAI,MAAM,MAAM,IAAI,0BAA0B,QAAQ,UAAU,EAAE,CAAC;AAAA,EAC3E;AAEA,MAAI,WAAW,QAAQ,OAAO,GAAG;AAC/B,WAAO,QAAQ,SAAS,EAAE,WAAW,KAAK,CAAC;AAAA,EAC7C;AAEA,MAAI,WAAW,QAAQ,QAAQ,GAAG;AAChC,WAAO,QAAQ,QAAQ;AAAA,EACzB;AAEA,SAAO,QAAQ,WAAW,QAAQ,SAAS,EAAE,WAAW,KAAK,CAAC;AAC9D,eAAa,QAAQ,YAAY,QAAQ,QAAQ;AAEjD,QAAM,QAAQ,SAAS,WAAW,wBAAmB;AACrD,UAAQ,IAAI,MAAM,MAAM,UAAU,KAAK,GAAG,CAAC;AAC3C,UAAQ,IAAI,KAAK,KAAK,SAAS,QAAQ,SAAS,CAAC,YAAO,KAAK,SAAS,QAAQ,OAAO,CAAC,GAAG;AACzF,UAAQ,IAAI,KAAK,KAAK,SAAS,QAAQ,UAAU,CAAC,WAAM,KAAK,SAAS,QAAQ,QAAQ,CAAC,EAAE;AAC3F;;;AC3DO,IAAM,cAA6B;AAAA,EACxC,SAAS,WACP,MACG,OAAO,QAAQ;AAAA,IACd,SAAS,CAAC,UAAU,QAAQ;AAAA,IAC5B,SAAS;AAAA,IACT,UAAU;AAAA,IACV,MAAM;AAAA,EACR,CAAC;AAAA,EACL,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS,CAAC,SAAS;AACjB,iBAAa,KAAK,IAA2B;AAAA,EAC/C;AACF;","names":[]}
@@ -1,24 +0,0 @@
1
- // src/actions/printVersion.ts
2
- import chalk from "chalk";
3
- function printVersion() {
4
- console.log(chalk.cyan("ariestools"));
5
- console.log(` Node: ${process.version}`);
6
- console.log(` Platform: ${process.platform}`);
7
- console.log(` Arch: ${process.arch}`);
8
- }
9
-
10
- // src/actions/index.ts
11
- import { executeWitness, registerWitnessCommand } from "@xylabs/aries-witness-cli";
12
-
13
- // src/commands/versionCommand.ts
14
- var versionCommand = {
15
- command: "info",
16
- describe: "Display ariestools version and environment info",
17
- handler: () => {
18
- printVersion();
19
- }
20
- };
21
- export {
22
- versionCommand
23
- };
24
- //# sourceMappingURL=versionCommand.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/actions/printVersion.ts","../../src/actions/index.ts","../../src/commands/versionCommand.ts"],"sourcesContent":["import chalk from 'chalk'\n\nexport function printVersion(): void {\n console.log(chalk.cyan('ariestools'))\n console.log(` Node: ${process.version}`)\n console.log(` Platform: ${process.platform}`)\n console.log(` Arch: ${process.arch}`)\n}\n","export { installPlugin, uninstallPlugin } from './audit/index.ts'\nexport { listSessions } from './audit/index.ts'\nexport { searchAudit } from './audit/index.ts'\nexport { showSession } from './audit/index.ts'\nexport { statusAudit } from './audit/index.ts'\nexport { runClamped } from './clamp/index.ts'\nexport { detectAiClients } from './detect/index.ts'\nexport { printVersion } from './printVersion.ts'\nexport { syncAiConfig } from './sync/index.ts'\nexport * from './wallet/index.ts'\nexport { executeWitness, registerWitnessCommand } from '@xylabs/aries-witness-cli'\n","import type { CommandModule } from 'yargs'\n\nimport { printVersion } from '../actions/index.ts'\n\nexport const versionCommand: CommandModule = {\n command: 'info',\n describe: 'Display ariestools version and environment info',\n handler: () => {\n printVersion()\n },\n}\n"],"mappings":";AAAA,OAAO,WAAW;AAEX,SAAS,eAAqB;AACnC,UAAQ,IAAI,MAAM,KAAK,YAAY,CAAC;AACpC,UAAQ,IAAI,cAAc,QAAQ,OAAO,EAAE;AAC3C,UAAQ,IAAI,eAAe,QAAQ,QAAQ,EAAE;AAC7C,UAAQ,IAAI,eAAe,QAAQ,IAAI,EAAE;AAC3C;;;ACGA,SAAS,gBAAgB,8BAA8B;;;ACNhD,IAAM,iBAAgC;AAAA,EAC3C,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS,MAAM;AACb,iBAAa;AAAA,EACf;AACF;","names":[]}
@@ -1,536 +0,0 @@
1
- // src/actions/wallet/account/deriveAndAdd.ts
2
- import chalk from "chalk";
3
-
4
- // src/actions/wallet/paths.ts
5
- import OS from "os";
6
- import PATH from "path";
7
- function walletRoot() {
8
- const override = process.env.ARIES_WALLET_HOME;
9
- if (override) return override;
10
- return PATH.join(OS.homedir(), ".aries", "wallet");
11
- }
12
- function walletPaths(root = walletRoot()) {
13
- return {
14
- root,
15
- password: PATH.join(root, "password.json"),
16
- phrases: PATH.join(root, "phrases.json"),
17
- active: PATH.join(root, "active.json"),
18
- addressBooks: PATH.join(root, "address-books.json"),
19
- contacts: PATH.join(root, "contacts.json"),
20
- networks: PATH.join(root, "networks.json"),
21
- session: PATH.join(root, "session.json"),
22
- machineId: PATH.join(root, ".machine-id")
23
- };
24
- }
25
-
26
- // src/actions/wallet/storage.ts
27
- import FS from "fs";
28
- import PATH2 from "path";
29
- function ensureWalletDir(root = walletRoot()) {
30
- if (!FS.existsSync(root)) {
31
- FS.mkdirSync(root, { recursive: true, mode: 448 });
32
- return;
33
- }
34
- try {
35
- FS.chmodSync(root, 448);
36
- } catch {
37
- }
38
- }
39
- function readJsonFile(file) {
40
- if (!FS.existsSync(file)) return void 0;
41
- const raw = FS.readFileSync(file, "utf8");
42
- if (raw.trim().length === 0) return void 0;
43
- return JSON.parse(raw);
44
- }
45
- function writeJsonFile(file, value) {
46
- ensureWalletDir(PATH2.dirname(file));
47
- const tmp = `${file}.tmp`;
48
- FS.writeFileSync(tmp, `${JSON.stringify(value, null, 2)}
49
- `, { mode: 384 });
50
- FS.renameSync(tmp, file);
51
- try {
52
- FS.chmodSync(file, 384);
53
- } catch {
54
- }
55
- }
56
- function deleteFile(file) {
57
- if (FS.existsSync(file)) FS.unlinkSync(file);
58
- }
59
-
60
- // src/actions/wallet/addressBook/storage.ts
61
- var ADDRESS_BOOK_VERSION = 1;
62
- function readAllAddressBooks() {
63
- return readJsonFile(walletPaths().addressBooks) ?? {};
64
- }
65
- function writeAllAddressBooks(data) {
66
- writeJsonFile(walletPaths().addressBooks, data);
67
- }
68
- function readAddressBook(rootAddress) {
69
- const all = readAllAddressBooks();
70
- const key = rootAddress.toLowerCase();
71
- return all[key] ?? {
72
- rootAddress: key,
73
- entries: [{ offset: "0" }, { offset: "1" }, { offset: "2" }],
74
- version: ADDRESS_BOOK_VERSION
75
- };
76
- }
77
- function writeAddressBook(book) {
78
- const all = readAllAddressBooks();
79
- all[book.rootAddress.toLowerCase()] = book;
80
- writeAllAddressBooks(all);
81
- }
82
- function upsertAddressBookEntry(rootAddress, entry) {
83
- const book = readAddressBook(rootAddress);
84
- const existing = book.entries.find((e) => e.offset === entry.offset);
85
- if (existing) {
86
- if (entry.label !== void 0) existing.label = entry.label;
87
- } else {
88
- book.entries.push(entry);
89
- }
90
- writeAddressBook(book);
91
- return book;
92
- }
93
- function removeAddressBookEntry(rootAddress, offset) {
94
- const book = readAddressBook(rootAddress);
95
- book.entries = book.entries.filter((e) => e.offset !== offset);
96
- writeAddressBook(book);
97
- return book;
98
- }
99
-
100
- // src/actions/wallet/account/getActiveWallet.ts
101
- import { HDWallet } from "@xyo-network/sdk-js";
102
- import { DEFAULT_WALLET_PATH } from "@xyo-network/xl1-protocol-sdk";
103
-
104
- // src/actions/wallet/prompt.ts
105
- import { execFileSync } from "child_process";
106
- import {
107
- closeSync,
108
- openSync,
109
- readSync,
110
- writeSync
111
- } from "fs";
112
- var CTRL_C = 3;
113
- var ENTER = 13;
114
- var NEWLINE = 10;
115
- var BACKSPACE_DELETE = 127;
116
- var BACKSPACE = 8;
117
- function readChars(readFd, writeFd, mask) {
118
- const chars = [];
119
- const buf = Buffer.alloc(1);
120
- for (; ; ) {
121
- const bytes = readSync(readFd, buf, 0, 1, null);
122
- if (bytes === 0) break;
123
- const ch = buf[0];
124
- if (ch === ENTER || ch === NEWLINE) break;
125
- if (ch === CTRL_C) {
126
- writeSync(writeFd, "\n");
127
- throw new Error("Aborted");
128
- }
129
- if (ch === BACKSPACE_DELETE || ch === BACKSPACE) {
130
- if (chars.length > 0) {
131
- chars.pop();
132
- writeSync(writeFd, "\b \b");
133
- }
134
- continue;
135
- }
136
- chars.push(ch);
137
- writeSync(writeFd, mask ? "*" : String.fromCodePoint(ch));
138
- }
139
- writeSync(writeFd, "\n");
140
- return Buffer.from(chars).toString("utf8");
141
- }
142
- function saveStty(readFd) {
143
- try {
144
- return execFileSync("stty", ["-g"], {
145
- stdio: [readFd, "pipe", "ignore"],
146
- encoding: "utf8"
147
- }).trim();
148
- } catch {
149
- return void 0;
150
- }
151
- }
152
- function applyStty(readFd, args) {
153
- try {
154
- execFileSync("stty", args, { stdio: [readFd, "ignore", "ignore"] });
155
- } catch {
156
- }
157
- }
158
- function promptTty(options) {
159
- const readFd = openSync("/dev/tty", "r");
160
- const writeFd = openSync("/dev/tty", "w");
161
- const saved = saveStty(readFd);
162
- try {
163
- if (saved) applyStty(readFd, ["-echo", "-icanon", "min", "1", "time", "0"]);
164
- writeSync(writeFd, options.prompt);
165
- return readChars(readFd, writeFd, options.mask === true);
166
- } finally {
167
- if (saved) applyStty(readFd, [saved]);
168
- try {
169
- closeSync(readFd);
170
- } catch {
171
- }
172
- try {
173
- closeSync(writeFd);
174
- } catch {
175
- }
176
- }
177
- }
178
- function promptPassword(prompt = "Password: ") {
179
- const env = process.env.ARIES_WALLET_PASSWORD;
180
- if (env !== void 0 && env.length > 0) return env;
181
- return promptTty({ prompt, mask: true });
182
- }
183
-
184
- // src/actions/wallet/session/sessionCache.ts
185
- import { webcrypto as webcrypto3 } from "crypto";
186
-
187
- // src/actions/wallet/passwordKey.ts
188
- import { webcrypto } from "crypto";
189
- var subtle = webcrypto.subtle;
190
- var INITIALIZATION_VECTOR_LENGTH = 12;
191
- var PBKDF2_ITERATIONS = 1e5;
192
- var SALT_BYTES = 16;
193
- var PasswordKey = class _PasswordKey {
194
- password;
195
- salt;
196
- constructor(password, salt = _PasswordKey.generateSalt()) {
197
- this.password = password;
198
- this.salt = salt;
199
- }
200
- static async decryptString(key, data) {
201
- const encryptedData = new Uint8Array(Buffer.from(data, "base64"));
202
- const iv = encryptedData.slice(0, INITIALIZATION_VECTOR_LENGTH);
203
- const ciphertext = encryptedData.slice(INITIALIZATION_VECTOR_LENGTH);
204
- const decrypted = await subtle.decrypt({ name: "AES-GCM", iv }, key, ciphertext);
205
- return new TextDecoder("utf-8").decode(decrypted);
206
- }
207
- static async encryptString(key, data) {
208
- const iv = webcrypto.getRandomValues(new Uint8Array(INITIALIZATION_VECTOR_LENGTH));
209
- const ciphertext = await subtle.encrypt({ name: "AES-GCM", iv }, key, new TextEncoder().encode(data));
210
- const combined = new Uint8Array(iv.length + ciphertext.byteLength);
211
- combined.set(iv, 0);
212
- combined.set(new Uint8Array(ciphertext), iv.length);
213
- return Buffer.from(combined).toString("base64");
214
- }
215
- static generateSalt() {
216
- const array = new Uint8Array(SALT_BYTES);
217
- webcrypto.getRandomValues(array);
218
- return [...array].map((byte) => byte.toString(16).padStart(2, "0")).join("");
219
- }
220
- static async getHashFromKey(key) {
221
- const exported = await subtle.exportKey("raw", key);
222
- const digest = await subtle.digest("SHA-256", exported);
223
- return [...new Uint8Array(digest)].map((byte) => byte.toString(16).padStart(2, "0")).join("");
224
- }
225
- static async importEncryptionKey(rawKey) {
226
- return await subtle.importKey("raw", rawKey, { name: "AES-GCM" }, false, ["encrypt", "decrypt"]);
227
- }
228
- static async importExtractableKey(rawKey) {
229
- return await subtle.importKey("raw", rawKey, { name: "AES-GCM" }, true, ["encrypt", "decrypt"]);
230
- }
231
- static async serializeKey(key, salt = _PasswordKey.generateSalt()) {
232
- const hash = await _PasswordKey.getHashFromKey(key);
233
- return { hash, salt };
234
- }
235
- async deriveKey() {
236
- const encoder = new TextEncoder();
237
- const passphraseKey = await subtle.importKey(
238
- "raw",
239
- encoder.encode(this.password),
240
- { name: "PBKDF2" },
241
- false,
242
- ["deriveKey"]
243
- );
244
- return await subtle.deriveKey(
245
- {
246
- name: "PBKDF2",
247
- salt: encoder.encode(this.salt),
248
- iterations: PBKDF2_ITERATIONS,
249
- hash: "SHA-256"
250
- },
251
- passphraseKey,
252
- { name: "AES-GCM", length: 256 },
253
- true,
254
- ["encrypt", "decrypt"]
255
- );
256
- }
257
- };
258
- async function decryptWithKey(key, data) {
259
- const exported = await subtle.exportKey("raw", key);
260
- const encKey = await PasswordKey.importEncryptionKey(exported);
261
- return await PasswordKey.decryptString(encKey, data);
262
- }
263
-
264
- // src/actions/wallet/session/machineId.ts
265
- import { webcrypto as webcrypto2 } from "crypto";
266
- import FS2 from "fs";
267
- import OS2 from "os";
268
- function generateMachineSecret() {
269
- const bytes = new Uint8Array(32);
270
- webcrypto2.getRandomValues(bytes);
271
- return [...bytes].map((b) => b.toString(16).padStart(2, "0")).join("");
272
- }
273
- function loadMachineSecret() {
274
- ensureWalletDir();
275
- const path = walletPaths().machineId;
276
- if (FS2.existsSync(path)) {
277
- return FS2.readFileSync(path, "utf8").trim();
278
- }
279
- const secret = generateMachineSecret();
280
- FS2.writeFileSync(path, `${secret}
281
- `, { mode: 384 });
282
- try {
283
- FS2.chmodSync(path, 384);
284
- } catch {
285
- }
286
- return secret;
287
- }
288
- async function deriveMachineKey() {
289
- const secret = loadMachineSecret();
290
- const stable = `${OS2.hostname()}:${OS2.userInfo().username}:${secret}`;
291
- const passwordKey = new PasswordKey(stable, "aries-wallet-machine-kek-v1");
292
- return await passwordKey.deriveKey();
293
- }
294
-
295
- // src/actions/wallet/session/sessionCache.ts
296
- var subtle2 = webcrypto3.subtle;
297
- var DEFAULT_SESSION_TTL_SECONDS = 15 * 60;
298
- function lockSession() {
299
- deleteFile(walletPaths().session);
300
- }
301
- async function readSession() {
302
- const data = readJsonFile(walletPaths().session);
303
- if (!data) return void 0;
304
- if (data.expiresAt <= Date.now()) {
305
- lockSession();
306
- return void 0;
307
- }
308
- try {
309
- const machineKey = await deriveMachineKey();
310
- const exportedBase64 = await decryptWithKey(machineKey, data.encryptedKey);
311
- const raw = Buffer.from(exportedBase64, "base64");
312
- return await PasswordKey.importExtractableKey(
313
- raw.buffer.slice(raw.byteOffset, raw.byteOffset + raw.byteLength)
314
- );
315
- } catch {
316
- lockSession();
317
- return void 0;
318
- }
319
- }
320
-
321
- // src/actions/wallet/password/passwordStorage.ts
322
- function readPassword() {
323
- return readJsonFile(walletPaths().password);
324
- }
325
- function hasPassword() {
326
- return readPassword() !== void 0;
327
- }
328
-
329
- // src/actions/wallet/password/validatePassword.ts
330
- async function validatePassword(password) {
331
- const stored = readPassword();
332
- if (!stored) return void 0;
333
- const passwordKey = new PasswordKey(password, stored.salt);
334
- const key = await passwordKey.deriveKey();
335
- const hash = await PasswordKey.getHashFromKey(key);
336
- if (hash !== stored.hash) return void 0;
337
- return key;
338
- }
339
-
340
- // src/actions/wallet/password/getActiveKey.ts
341
- async function getActiveKey() {
342
- if (!hasPassword()) {
343
- throw new Error("Wallet not initialized. Run `aries wallet create` or `aries wallet import` first.");
344
- }
345
- const cached = await readSession();
346
- if (cached) return cached;
347
- const password = promptPassword("Wallet password: ");
348
- const key = await validatePassword(password);
349
- if (!key) throw new Error("Incorrect password.");
350
- return key;
351
- }
352
-
353
- // src/actions/wallet/seedPhrase/phraseStorage.ts
354
- function readPhrases() {
355
- const data = readJsonFile(walletPaths().phrases);
356
- return data?.phrases ?? [];
357
- }
358
- function readActive() {
359
- return readJsonFile(walletPaths().active) ?? {};
360
- }
361
- function getActivePhrase() {
362
- const phrases = readPhrases();
363
- if (phrases.length === 0) return void 0;
364
- const active = readActive();
365
- if (active.phraseId) {
366
- const found = phrases.find((p) => p.id === active.phraseId);
367
- if (found) return found;
368
- }
369
- return phrases[0];
370
- }
371
-
372
- // src/actions/wallet/account/getActiveWallet.ts
373
- async function getActiveWallet() {
374
- const record = getActivePhrase();
375
- if (!record) throw new Error("No active wallet. Run `aries wallet create` or `aries wallet import` first.");
376
- const key = await getActiveKey();
377
- const mnemonic = await decryptWithKey(key, record.encryptedPhrase);
378
- const rootWallet = await HDWallet.fromPhrase(mnemonic, DEFAULT_WALLET_PATH);
379
- return {
380
- record,
381
- mnemonic,
382
- rootWallet
383
- };
384
- }
385
- async function deriveAccount(rootWallet, offset) {
386
- return await rootWallet.derivePath(offset);
387
- }
388
-
389
- // src/actions/wallet/account/deriveAndAdd.ts
390
- async function deriveAndAdd(options) {
391
- const { rootWallet } = await getActiveWallet();
392
- const account = await deriveAccount(rootWallet, options.offset);
393
- upsertAddressBookEntry(rootWallet.address, { offset: options.offset, label: options.label });
394
- console.log(chalk.green(`Derived account at offset ${chalk.cyan(options.offset)}: 0x${account.address}`));
395
- if (options.label) console.log(chalk.gray(` label: ${options.label}`));
396
- }
397
-
398
- // src/actions/wallet/account/labelAccount.ts
399
- import chalk2 from "chalk";
400
- async function labelAccount(offset, label) {
401
- const { rootWallet } = await getActiveWallet();
402
- upsertAddressBookEntry(rootWallet.address, { offset, label });
403
- console.log(chalk2.green(`Labeled account ${chalk2.cyan(offset)} as ${chalk2.white(label)}`));
404
- }
405
-
406
- // src/actions/wallet/account/listAccounts.ts
407
- import chalk3 from "chalk";
408
- async function listAccounts() {
409
- const { record, rootWallet } = await getActiveWallet();
410
- const book = readAddressBook(rootWallet.address);
411
- console.log(chalk3.cyan(`Wallet ${record.label} (${record.id})`));
412
- console.log(chalk3.gray(` root: ${rootWallet.address}`));
413
- console.log();
414
- if (book.entries.length === 0) {
415
- console.log(chalk3.gray(" No derived accounts. Run `aries wallet account derive <offset>`."));
416
- return;
417
- }
418
- for (const entry of book.entries) {
419
- const account = await deriveAccount(rootWallet, entry.offset);
420
- const offset = chalk3.cyan(entry.offset.padEnd(6));
421
- const label = chalk3.white((entry.label ?? "").padEnd(20));
422
- console.log(` ${offset} ${label} 0x${account.address}`);
423
- }
424
- }
425
-
426
- // src/actions/wallet/account/removeAccount.ts
427
- import chalk4 from "chalk";
428
- async function removeAccount(offset) {
429
- const { rootWallet } = await getActiveWallet();
430
- removeAddressBookEntry(rootWallet.address, offset);
431
- console.log(chalk4.green(`Removed account at offset ${chalk4.cyan(offset)} from address book`));
432
- }
433
-
434
- // src/actions/wallet/account/showAccount.ts
435
- import chalk5 from "chalk";
436
- async function showAccount(offset) {
437
- const { rootWallet } = await getActiveWallet();
438
- const book = readAddressBook(rootWallet.address);
439
- const entry = book.entries.find((e) => e.offset === offset);
440
- const account = await deriveAccount(rootWallet, offset);
441
- console.log(chalk5.cyan(`Account ${offset}`));
442
- console.log(` ${chalk5.gray("label:")} ${entry?.label ?? "\u2014"}`);
443
- console.log(` ${chalk5.gray("address:")} 0x${account.address}`);
444
- if (account.public) console.log(` ${chalk5.gray("public:")} ${account.public.hex}`);
445
- console.log(` ${chalk5.gray("path:")} ${offset}`);
446
- }
447
-
448
- // src/commands/walletAccountDeriveCommand.ts
449
- var walletAccountDeriveCommand = {
450
- command: "derive <offset>",
451
- describe: "Derive a new account at the given HD offset",
452
- builder: (yargs) => yargs.positional("offset", {
453
- type: "string",
454
- demandOption: true,
455
- describe: "HD path offset (e.g. 0)"
456
- }).option("label", {
457
- alias: "l",
458
- type: "string",
459
- describe: "Friendly label for the account"
460
- }),
461
- handler: async (argv) => {
462
- await deriveAndAdd({
463
- offset: argv.offset,
464
- label: argv.label
465
- });
466
- }
467
- };
468
-
469
- // src/commands/walletAccountLabelCommand.ts
470
- var walletAccountLabelCommand = {
471
- command: "label <offset> <label>",
472
- describe: "Label a derived account",
473
- builder: (yargs) => yargs.positional("offset", {
474
- type: "string",
475
- demandOption: true,
476
- describe: "HD path offset"
477
- }).positional("label", {
478
- type: "string",
479
- demandOption: true,
480
- describe: "Label text"
481
- }),
482
- handler: async (argv) => {
483
- await labelAccount(argv.offset, argv.label);
484
- }
485
- };
486
-
487
- // src/commands/walletAccountListCommand.ts
488
- var walletAccountListCommand = {
489
- command: "list",
490
- describe: "List derived accounts in the active wallet",
491
- handler: async () => {
492
- await listAccounts();
493
- }
494
- };
495
-
496
- // src/commands/walletAccountRemoveCommand.ts
497
- var walletAccountRemoveCommand = {
498
- command: "remove <offset>",
499
- describe: "Remove an account from the address book",
500
- builder: (yargs) => yargs.positional("offset", {
501
- type: "string",
502
- demandOption: true,
503
- describe: "HD path offset"
504
- }),
505
- handler: async (argv) => {
506
- await removeAccount(argv.offset);
507
- }
508
- };
509
-
510
- // src/commands/walletAccountShowCommand.ts
511
- var walletAccountShowCommand = {
512
- command: "show <offset>",
513
- describe: "Show details for a derived account",
514
- builder: (yargs) => yargs.positional("offset", {
515
- type: "string",
516
- demandOption: true,
517
- describe: "HD path offset (e.g. 0)"
518
- }),
519
- handler: async (argv) => {
520
- await showAccount(argv.offset);
521
- }
522
- };
523
-
524
- // src/commands/walletAccountCommand.ts
525
- var walletAccountCommand = {
526
- command: "account",
527
- describe: "Manage derived accounts in the active wallet",
528
- builder: (yargs) => yargs.command(walletAccountListCommand).command(walletAccountShowCommand).command(walletAccountDeriveCommand).command(walletAccountLabelCommand).command(walletAccountRemoveCommand).demandCommand(1).strictCommands(),
529
- // eslint-disable-next-line @typescript-eslint/no-empty-function
530
- handler: () => {
531
- }
532
- };
533
- export {
534
- walletAccountCommand
535
- };
536
- //# sourceMappingURL=walletAccountCommand.mjs.map