@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.
- package/README.md +693 -0
- package/dist/actions/audit/auditPaths.mjs +22 -0
- package/dist/actions/audit/auditPaths.mjs.map +1 -0
- package/dist/actions/audit/index.mjs +739 -0
- package/dist/actions/audit/index.mjs.map +1 -0
- package/dist/actions/audit/installPlugin.mjs +298 -0
- package/dist/actions/audit/installPlugin.mjs.map +1 -0
- package/dist/actions/audit/listSessions.mjs +93 -0
- package/dist/actions/audit/listSessions.mjs.map +1 -0
- package/dist/actions/audit/openAuditDir.mjs +44 -0
- package/dist/actions/audit/openAuditDir.mjs.map +1 -0
- package/dist/actions/audit/searchAudit.mjs +77 -0
- package/dist/actions/audit/searchAudit.mjs.map +1 -0
- package/dist/actions/audit/showAiMeta.mjs +105 -0
- package/dist/actions/audit/showAiMeta.mjs.map +1 -0
- package/dist/actions/audit/showSession.mjs +105 -0
- package/dist/actions/audit/showSession.mjs.map +1 -0
- package/dist/actions/audit/statusAudit.mjs +98 -0
- package/dist/actions/audit/statusAudit.mjs.map +1 -0
- package/dist/actions/clamp/clampAudit.mjs +53 -0
- package/dist/actions/clamp/clampAudit.mjs.map +1 -0
- package/dist/actions/clamp/index.mjs +2258 -0
- package/dist/actions/clamp/index.mjs.map +1 -0
- package/dist/actions/clamp/ipcServer.mjs +55 -0
- package/dist/actions/clamp/ipcServer.mjs.map +1 -0
- package/dist/actions/clamp/policyManagement.mjs +144 -0
- package/dist/actions/clamp/policyManagement.mjs.map +1 -0
- package/dist/actions/clamp/promptUser.mjs +91 -0
- package/dist/actions/clamp/promptUser.mjs.map +1 -0
- package/dist/actions/clamp/runClamped.mjs +2107 -0
- package/dist/actions/clamp/runClamped.mjs.map +1 -0
- package/dist/actions/clamp/sandboxExec.mjs +1612 -0
- package/dist/actions/clamp/sandboxExec.mjs.map +1 -0
- package/dist/actions/clamp/shellEnvSetup.mjs +59 -0
- package/dist/actions/clamp/shellEnvSetup.mjs.map +1 -0
- package/dist/actions/clamp/shimGenerator.mjs +68 -0
- package/dist/actions/clamp/shimGenerator.mjs.map +1 -0
- package/dist/actions/clamp/terminalRenderer.mjs +145 -0
- package/dist/actions/clamp/terminalRenderer.mjs.map +1 -0
- package/dist/actions/datalake/audit/auditLog.mjs +191 -0
- package/dist/actions/datalake/audit/auditLog.mjs.map +1 -0
- package/dist/actions/datalake/createDatalake.mjs +127 -0
- package/dist/actions/datalake/createDatalake.mjs.map +1 -0
- package/dist/actions/datalake/describeDatalake.mjs +159 -0
- package/dist/actions/datalake/describeDatalake.mjs.map +1 -0
- package/dist/actions/datalake/destroyDatalake.mjs +34 -0
- package/dist/actions/datalake/destroyDatalake.mjs.map +1 -0
- package/dist/actions/datalake/dev/downDevServer.mjs +102 -0
- package/dist/actions/datalake/dev/downDevServer.mjs.map +1 -0
- package/dist/actions/datalake/dev/index.mjs +369 -0
- package/dist/actions/datalake/dev/index.mjs.map +1 -0
- package/dist/actions/datalake/dev/logsDevServer.mjs +44 -0
- package/dist/actions/datalake/dev/logsDevServer.mjs.map +1 -0
- package/dist/actions/datalake/dev/paths.mjs +25 -0
- package/dist/actions/datalake/dev/paths.mjs.map +1 -0
- package/dist/actions/datalake/dev/resetDevServer.mjs +118 -0
- package/dist/actions/datalake/dev/resetDevServer.mjs.map +1 -0
- package/dist/actions/datalake/dev/resolveServerBin.mjs +26 -0
- package/dist/actions/datalake/dev/resolveServerBin.mjs.map +1 -0
- package/dist/actions/datalake/dev/state.mjs +62 -0
- package/dist/actions/datalake/dev/state.mjs.map +1 -0
- package/dist/actions/datalake/dev/statusDevServer.mjs +101 -0
- package/dist/actions/datalake/dev/statusDevServer.mjs.map +1 -0
- package/dist/actions/datalake/dev/upDevServer.mjs +221 -0
- package/dist/actions/datalake/dev/upDevServer.mjs.map +1 -0
- package/dist/actions/datalake/dev/waitForHealth.mjs +22 -0
- package/dist/actions/datalake/dev/waitForHealth.mjs.map +1 -0
- package/dist/actions/datalake/formatters.mjs +90 -0
- package/dist/actions/datalake/formatters.mjs.map +1 -0
- package/dist/actions/datalake/grantAccess.mjs +116 -0
- package/dist/actions/datalake/grantAccess.mjs.map +1 -0
- package/dist/actions/datalake/index.mjs +361 -0
- package/dist/actions/datalake/index.mjs.map +1 -0
- package/dist/actions/datalake/listDatalakes.mjs +54 -0
- package/dist/actions/datalake/listDatalakes.mjs.map +1 -0
- package/dist/actions/datalake/login.mjs +20 -0
- package/dist/actions/datalake/login.mjs.map +1 -0
- package/dist/actions/datalake/logout.mjs +11 -0
- package/dist/actions/datalake/logout.mjs.map +1 -0
- package/dist/actions/datalake/mintToken.mjs +37 -0
- package/dist/actions/datalake/mintToken.mjs.map +1 -0
- package/dist/actions/datalake/parseSize.mjs +21 -0
- package/dist/actions/datalake/parseSize.mjs.map +1 -0
- package/dist/actions/datalake/payloads/fetchPayload.mjs +76 -0
- package/dist/actions/datalake/payloads/fetchPayload.mjs.map +1 -0
- package/dist/actions/datalake/payloads/index.mjs +271 -0
- package/dist/actions/datalake/payloads/index.mjs.map +1 -0
- package/dist/actions/datalake/payloads/mintAndConnect.mjs +46 -0
- package/dist/actions/datalake/payloads/mintAndConnect.mjs.map +1 -0
- package/dist/actions/datalake/payloads/parsePayloadsFile.mjs +71 -0
- package/dist/actions/datalake/payloads/parsePayloadsFile.mjs.map +1 -0
- package/dist/actions/datalake/payloads/pushPayloads.mjs +181 -0
- package/dist/actions/datalake/payloads/pushPayloads.mjs.map +1 -0
- package/dist/actions/datalake/payloads/tailPayloads.mjs +106 -0
- package/dist/actions/datalake/payloads/tailPayloads.mjs.map +1 -0
- package/dist/actions/datalake/resolveTarget.mjs +15 -0
- package/dist/actions/datalake/resolveTarget.mjs.map +1 -0
- package/dist/actions/datalake/revokeAccess.mjs +108 -0
- package/dist/actions/datalake/revokeAccess.mjs.map +1 -0
- package/dist/actions/datalake/useDatalake.mjs +22 -0
- package/dist/actions/datalake/useDatalake.mjs.map +1 -0
- package/dist/actions/detect/detectAiClients.mjs +405 -0
- package/dist/actions/detect/detectAiClients.mjs.map +1 -0
- package/dist/actions/detect/index.mjs +405 -0
- package/dist/actions/detect/index.mjs.map +1 -0
- package/dist/actions/hash/algorithms/blockhash.mjs +61 -0
- package/dist/actions/hash/algorithms/blockhash.mjs.map +1 -0
- package/dist/actions/hash/algorithms/chromaprint.mjs +205 -0
- package/dist/actions/hash/algorithms/chromaprint.mjs.map +1 -0
- package/dist/actions/hash/algorithms/dhash.mjs +75 -0
- package/dist/actions/hash/algorithms/dhash.mjs.map +1 -0
- package/dist/actions/hash/algorithms/index.mjs +818 -0
- package/dist/actions/hash/algorithms/index.mjs.map +1 -0
- package/dist/actions/hash/algorithms/nilsimsa.mjs +27 -0
- package/dist/actions/hash/algorithms/nilsimsa.mjs.map +1 -0
- package/dist/actions/hash/algorithms/pdq.mjs +83 -0
- package/dist/actions/hash/algorithms/pdq.mjs.map +1 -0
- package/dist/actions/hash/algorithms/phash.mjs +71 -0
- package/dist/actions/hash/algorithms/phash.mjs.map +1 -0
- package/dist/actions/hash/algorithms/sha256.mjs +24 -0
- package/dist/actions/hash/algorithms/sha256.mjs.map +1 -0
- package/dist/actions/hash/algorithms/ssdeep.mjs +203 -0
- package/dist/actions/hash/algorithms/ssdeep.mjs.map +1 -0
- package/dist/actions/hash/algorithms/tlsh.mjs +66 -0
- package/dist/actions/hash/algorithms/tlsh.mjs.map +1 -0
- package/dist/actions/hash/algorithms/types.mjs +1 -0
- package/dist/actions/hash/algorithms/types.mjs.map +1 -0
- package/dist/actions/hash/algorithms/videoFrames.mjs +404 -0
- package/dist/actions/hash/algorithms/videoFrames.mjs.map +1 -0
- package/dist/actions/hash/algorithms/xyo.mjs +30 -0
- package/dist/actions/hash/algorithms/xyo.mjs.map +1 -0
- package/dist/actions/hash/compareHashes.mjs +823 -0
- package/dist/actions/hash/compareHashes.mjs.map +1 -0
- package/dist/actions/hash/hashInput.mjs +868 -0
- package/dist/actions/hash/hashInput.mjs.map +1 -0
- package/dist/actions/hash/index.mjs +881 -0
- package/dist/actions/hash/index.mjs.map +1 -0
- package/dist/actions/hash/lib/hamming.mjs +44 -0
- package/dist/actions/hash/lib/hamming.mjs.map +1 -0
- package/dist/actions/hash/lib/levenshtein.mjs +36 -0
- package/dist/actions/hash/lib/levenshtein.mjs.map +1 -0
- package/dist/actions/hash/lib/runBinary.mjs +54 -0
- package/dist/actions/hash/lib/runBinary.mjs.map +1 -0
- package/dist/actions/hash/lib/which.mjs +36 -0
- package/dist/actions/hash/lib/which.mjs.map +1 -0
- package/dist/actions/hash/lib/withTempfile.mjs +19 -0
- package/dist/actions/hash/lib/withTempfile.mjs.map +1 -0
- package/dist/actions/index.mjs +4615 -0
- package/dist/actions/index.mjs.map +1 -0
- package/dist/actions/printVersion.mjs +12 -0
- package/dist/actions/printVersion.mjs.map +1 -0
- package/dist/actions/sync/index.mjs +51 -0
- package/dist/actions/sync/index.mjs.map +1 -0
- package/dist/actions/sync/syncAiConfig.mjs +51 -0
- package/dist/actions/sync/syncAiConfig.mjs.map +1 -0
- package/dist/actions/wallet/account/deriveAndAdd.mjs +394 -0
- package/dist/actions/wallet/account/deriveAndAdd.mjs.map +1 -0
- package/dist/actions/wallet/account/getActiveWallet.mjs +338 -0
- package/dist/actions/wallet/account/getActiveWallet.mjs.map +1 -0
- package/dist/actions/wallet/account/labelAccount.mjs +389 -0
- package/dist/actions/wallet/account/labelAccount.mjs.map +1 -0
- package/dist/actions/wallet/account/listAccounts.mjs +374 -0
- package/dist/actions/wallet/account/listAccounts.mjs.map +1 -0
- package/dist/actions/wallet/account/removeAccount.mjs +384 -0
- package/dist/actions/wallet/account/removeAccount.mjs.map +1 -0
- package/dist/actions/wallet/account/showAccount.mjs +368 -0
- package/dist/actions/wallet/account/showAccount.mjs.map +1 -0
- package/dist/actions/wallet/addressBook/storage.mjs +110 -0
- package/dist/actions/wallet/addressBook/storage.mjs.map +1 -0
- package/dist/actions/wallet/backup/exportBackup.mjs +93 -0
- package/dist/actions/wallet/backup/exportBackup.mjs.map +1 -0
- package/dist/actions/wallet/backup/importBackup.mjs +142 -0
- package/dist/actions/wallet/backup/importBackup.mjs.map +1 -0
- package/dist/actions/wallet/balance/getBalance.mjs +434 -0
- package/dist/actions/wallet/balance/getBalance.mjs.map +1 -0
- package/dist/actions/wallet/client/walletClient.mjs +64 -0
- package/dist/actions/wallet/client/walletClient.mjs.map +1 -0
- package/dist/actions/wallet/contact/contactActions.mjs +120 -0
- package/dist/actions/wallet/contact/contactActions.mjs.map +1 -0
- package/dist/actions/wallet/contact/storage.mjs +69 -0
- package/dist/actions/wallet/contact/storage.mjs.map +1 -0
- package/dist/actions/wallet/index.mjs +1439 -0
- package/dist/actions/wallet/index.mjs.map +1 -0
- package/dist/actions/wallet/network/networkActions.mjs +137 -0
- package/dist/actions/wallet/network/networkActions.mjs.map +1 -0
- package/dist/actions/wallet/network/storage.mjs +93 -0
- package/dist/actions/wallet/network/storage.mjs.map +1 -0
- package/dist/actions/wallet/password/changePassword.mjs +282 -0
- package/dist/actions/wallet/password/changePassword.mjs.map +1 -0
- package/dist/actions/wallet/password/getActiveKey.mjs +297 -0
- package/dist/actions/wallet/password/getActiveKey.mjs.map +1 -0
- package/dist/actions/wallet/password/initOrUnlock.mjs +337 -0
- package/dist/actions/wallet/password/initOrUnlock.mjs.map +1 -0
- package/dist/actions/wallet/password/passwordStorage.mjs +69 -0
- package/dist/actions/wallet/password/passwordStorage.mjs.map +1 -0
- package/dist/actions/wallet/password/setPassword.mjs +138 -0
- package/dist/actions/wallet/password/setPassword.mjs.map +1 -0
- package/dist/actions/wallet/password/validatePassword.mjs +123 -0
- package/dist/actions/wallet/password/validatePassword.mjs.map +1 -0
- package/dist/actions/wallet/passwordKey.mjs +87 -0
- package/dist/actions/wallet/passwordKey.mjs.map +1 -0
- package/dist/actions/wallet/paths.mjs +26 -0
- package/dist/actions/wallet/paths.mjs.map +1 -0
- package/dist/actions/wallet/prompt.mjs +93 -0
- package/dist/actions/wallet/prompt.mjs.map +1 -0
- package/dist/actions/wallet/seedPhrase/createPhrase.mjs +392 -0
- package/dist/actions/wallet/seedPhrase/createPhrase.mjs.map +1 -0
- package/dist/actions/wallet/seedPhrase/exportPhrase.mjs +334 -0
- package/dist/actions/wallet/seedPhrase/exportPhrase.mjs.map +1 -0
- package/dist/actions/wallet/seedPhrase/idGen.mjs +11 -0
- package/dist/actions/wallet/seedPhrase/idGen.mjs.map +1 -0
- package/dist/actions/wallet/seedPhrase/importPhrase.mjs +393 -0
- package/dist/actions/wallet/seedPhrase/importPhrase.mjs.map +1 -0
- package/dist/actions/wallet/seedPhrase/listPhrases.mjs +62 -0
- package/dist/actions/wallet/seedPhrase/listPhrases.mjs.map +1 -0
- package/dist/actions/wallet/seedPhrase/phraseStorage.mjs +89 -0
- package/dist/actions/wallet/seedPhrase/phraseStorage.mjs.map +1 -0
- package/dist/actions/wallet/seedPhrase/removePhrase.mjs +366 -0
- package/dist/actions/wallet/seedPhrase/removePhrase.mjs.map +1 -0
- package/dist/actions/wallet/seedPhrase/renamePhrase.mjs +78 -0
- package/dist/actions/wallet/seedPhrase/renamePhrase.mjs.map +1 -0
- package/dist/actions/wallet/seedPhrase/types.mjs +1 -0
- package/dist/actions/wallet/seedPhrase/types.mjs.map +1 -0
- package/dist/actions/wallet/seedPhrase/usePhrase.mjs +83 -0
- package/dist/actions/wallet/seedPhrase/usePhrase.mjs.map +1 -0
- package/dist/actions/wallet/session/machineId.mjs +145 -0
- package/dist/actions/wallet/session/machineId.mjs.map +1 -0
- package/dist/actions/wallet/session/sessionCache.mjs +221 -0
- package/dist/actions/wallet/session/sessionCache.mjs.map +1 -0
- package/dist/actions/wallet/session/unlock.mjs +307 -0
- package/dist/actions/wallet/session/unlock.mjs.map +1 -0
- package/dist/actions/wallet/sign/signPayload.mjs +637 -0
- package/dist/actions/wallet/sign/signPayload.mjs.map +1 -0
- package/dist/actions/wallet/storage.mjs +51 -0
- package/dist/actions/wallet/storage.mjs.map +1 -0
- package/dist/actions/wallet/transaction/broadcastTransaction.mjs +453 -0
- package/dist/actions/wallet/transaction/broadcastTransaction.mjs.map +1 -0
- package/dist/actions/wallet/transaction/sendTransaction.mjs +457 -0
- package/dist/actions/wallet/transaction/sendTransaction.mjs.map +1 -0
- package/dist/actions/wallet/transaction/signTransactionFile.mjs +378 -0
- package/dist/actions/wallet/transaction/signTransactionFile.mjs.map +1 -0
- package/dist/actions/xyo/index.mjs +138 -0
- package/dist/actions/xyo/index.mjs.map +1 -0
- package/dist/actions/xyo/transaction/index.mjs +138 -0
- package/dist/actions/xyo/transaction/index.mjs.map +1 -0
- package/dist/actions/xyo/transaction/validateTransactions.mjs +138 -0
- package/dist/actions/xyo/transaction/validateTransactions.mjs.map +1 -0
- package/dist/aries.mjs +8466 -0
- package/dist/aries.mjs.map +1 -0
- package/dist/bin/aries.mjs +8472 -0
- package/dist/bin/aries.mjs.map +1 -0
- package/dist/commands/aiCommand.mjs +492 -0
- package/dist/commands/aiCommand.mjs.map +1 -0
- package/dist/commands/auditAiCommand.mjs +119 -0
- package/dist/commands/auditAiCommand.mjs.map +1 -0
- package/dist/commands/auditCommand.mjs +857 -0
- package/dist/commands/auditCommand.mjs.map +1 -0
- package/dist/commands/auditInstallCommand.mjs +324 -0
- package/dist/commands/auditInstallCommand.mjs.map +1 -0
- package/dist/commands/auditListCommand.mjs +107 -0
- package/dist/commands/auditListCommand.mjs.map +1 -0
- package/dist/commands/auditOpenCommand.mjs +51 -0
- package/dist/commands/auditOpenCommand.mjs.map +1 -0
- package/dist/commands/auditSearchCommand.mjs +98 -0
- package/dist/commands/auditSearchCommand.mjs.map +1 -0
- package/dist/commands/auditShowCommand.mjs +123 -0
- package/dist/commands/auditShowCommand.mjs.map +1 -0
- package/dist/commands/auditStatusCommand.mjs +105 -0
- package/dist/commands/auditStatusCommand.mjs.map +1 -0
- package/dist/commands/clampCommand.mjs +2328 -0
- package/dist/commands/clampCommand.mjs.map +1 -0
- package/dist/commands/clampPolicyCommand.mjs +184 -0
- package/dist/commands/clampPolicyCommand.mjs.map +1 -0
- package/dist/commands/clampPolicyInitCommand.mjs +63 -0
- package/dist/commands/clampPolicyInitCommand.mjs.map +1 -0
- package/dist/commands/clampPolicyListCommand.mjs +56 -0
- package/dist/commands/clampPolicyListCommand.mjs.map +1 -0
- package/dist/commands/clampPolicyShowCommand.mjs +83 -0
- package/dist/commands/clampPolicyShowCommand.mjs.map +1 -0
- package/dist/commands/clampRunCommand.mjs +2137 -0
- package/dist/commands/clampRunCommand.mjs.map +1 -0
- package/dist/commands/datalakeAuditCommand.mjs +273 -0
- package/dist/commands/datalakeAuditCommand.mjs.map +1 -0
- package/dist/commands/datalakeCommand.mjs +1637 -0
- package/dist/commands/datalakeCommand.mjs.map +1 -0
- package/dist/commands/datalakeCreateCommand.mjs +189 -0
- package/dist/commands/datalakeCreateCommand.mjs.map +1 -0
- package/dist/commands/datalakeDescribeCommand.mjs +172 -0
- package/dist/commands/datalakeDescribeCommand.mjs.map +1 -0
- package/dist/commands/datalakeDestroyCommand.mjs +53 -0
- package/dist/commands/datalakeDestroyCommand.mjs.map +1 -0
- package/dist/commands/datalakeDevCommand.mjs +470 -0
- package/dist/commands/datalakeDevCommand.mjs.map +1 -0
- package/dist/commands/datalakeDevDownCommand.mjs +111 -0
- package/dist/commands/datalakeDevDownCommand.mjs.map +1 -0
- package/dist/commands/datalakeDevLogsCommand.mjs +65 -0
- package/dist/commands/datalakeDevLogsCommand.mjs.map +1 -0
- package/dist/commands/datalakeDevResetCommand.mjs +125 -0
- package/dist/commands/datalakeDevResetCommand.mjs.map +1 -0
- package/dist/commands/datalakeDevStatusCommand.mjs +110 -0
- package/dist/commands/datalakeDevStatusCommand.mjs.map +1 -0
- package/dist/commands/datalakeDevUpCommand.mjs +268 -0
- package/dist/commands/datalakeDevUpCommand.mjs.map +1 -0
- package/dist/commands/datalakeFetchCommand.mjs +106 -0
- package/dist/commands/datalakeFetchCommand.mjs.map +1 -0
- package/dist/commands/datalakeGrantCommand.mjs +147 -0
- package/dist/commands/datalakeGrantCommand.mjs.map +1 -0
- package/dist/commands/datalakeListCommand.mjs +61 -0
- package/dist/commands/datalakeListCommand.mjs.map +1 -0
- package/dist/commands/datalakeLoginCommand.mjs +39 -0
- package/dist/commands/datalakeLoginCommand.mjs.map +1 -0
- package/dist/commands/datalakeLogoutCommand.mjs +20 -0
- package/dist/commands/datalakeLogoutCommand.mjs.map +1 -0
- package/dist/commands/datalakePushCommand.mjs +214 -0
- package/dist/commands/datalakePushCommand.mjs.map +1 -0
- package/dist/commands/datalakeRevokeCommand.mjs +127 -0
- package/dist/commands/datalakeRevokeCommand.mjs.map +1 -0
- package/dist/commands/datalakeTailCommand.mjs +144 -0
- package/dist/commands/datalakeTailCommand.mjs.map +1 -0
- package/dist/commands/datalakeTokenCommand.mjs +61 -0
- package/dist/commands/datalakeTokenCommand.mjs.map +1 -0
- package/dist/commands/datalakeUseCommand.mjs +35 -0
- package/dist/commands/datalakeUseCommand.mjs.map +1 -0
- package/dist/commands/detectCommand.mjs +419 -0
- package/dist/commands/detectCommand.mjs.map +1 -0
- package/dist/commands/hashCommand.mjs +976 -0
- package/dist/commands/hashCommand.mjs.map +1 -0
- package/dist/commands/hashCompareCommand.mjs +865 -0
- package/dist/commands/hashCompareCommand.mjs.map +1 -0
- package/dist/commands/index.mjs +8461 -0
- package/dist/commands/index.mjs.map +1 -0
- package/dist/commands/syncCommand.mjs +66 -0
- package/dist/commands/syncCommand.mjs.map +1 -0
- package/dist/commands/versionCommand.mjs +24 -0
- package/dist/commands/versionCommand.mjs.map +1 -0
- package/dist/commands/walletAccountCommand.mjs +536 -0
- package/dist/commands/walletAccountCommand.mjs.map +1 -0
- package/dist/commands/walletAccountDeriveCommand.mjs +415 -0
- package/dist/commands/walletAccountDeriveCommand.mjs.map +1 -0
- package/dist/commands/walletAccountLabelCommand.mjs +405 -0
- package/dist/commands/walletAccountLabelCommand.mjs.map +1 -0
- package/dist/commands/walletAccountListCommand.mjs +381 -0
- package/dist/commands/walletAccountListCommand.mjs.map +1 -0
- package/dist/commands/walletAccountRemoveCommand.mjs +396 -0
- package/dist/commands/walletAccountRemoveCommand.mjs.map +1 -0
- package/dist/commands/walletAccountShowCommand.mjs +380 -0
- package/dist/commands/walletAccountShowCommand.mjs.map +1 -0
- package/dist/commands/walletBackupCommand.mjs +222 -0
- package/dist/commands/walletBackupCommand.mjs.map +1 -0
- package/dist/commands/walletBackupExportCommand.mjs +107 -0
- package/dist/commands/walletBackupExportCommand.mjs.map +1 -0
- package/dist/commands/walletBackupImportCommand.mjs +154 -0
- package/dist/commands/walletBackupImportCommand.mjs.map +1 -0
- package/dist/commands/walletBalanceCommand.mjs +448 -0
- package/dist/commands/walletBalanceCommand.mjs.map +1 -0
- package/dist/commands/walletCommand.mjs +1968 -0
- package/dist/commands/walletCommand.mjs.map +1 -0
- package/dist/commands/walletContactAddCommand.mjs +111 -0
- package/dist/commands/walletContactAddCommand.mjs.map +1 -0
- package/dist/commands/walletContactCommand.mjs +184 -0
- package/dist/commands/walletContactCommand.mjs.map +1 -0
- package/dist/commands/walletContactListCommand.mjs +66 -0
- package/dist/commands/walletContactListCommand.mjs.map +1 -0
- package/dist/commands/walletContactRemoveCommand.mjs +97 -0
- package/dist/commands/walletContactRemoveCommand.mjs.map +1 -0
- package/dist/commands/walletContactRenameCommand.mjs +114 -0
- package/dist/commands/walletContactRenameCommand.mjs.map +1 -0
- package/dist/commands/walletCreateCommand.mjs +407 -0
- package/dist/commands/walletCreateCommand.mjs.map +1 -0
- package/dist/commands/walletExportCommand.mjs +345 -0
- package/dist/commands/walletExportCommand.mjs.map +1 -0
- package/dist/commands/walletImportCommand.mjs +413 -0
- package/dist/commands/walletImportCommand.mjs.map +1 -0
- package/dist/commands/walletListCommand.mjs +69 -0
- package/dist/commands/walletListCommand.mjs.map +1 -0
- package/dist/commands/walletLockCommand.mjs +56 -0
- package/dist/commands/walletLockCommand.mjs.map +1 -0
- package/dist/commands/walletNetworkAddCommand.mjs +131 -0
- package/dist/commands/walletNetworkAddCommand.mjs.map +1 -0
- package/dist/commands/walletNetworkCommand.mjs +206 -0
- package/dist/commands/walletNetworkCommand.mjs.map +1 -0
- package/dist/commands/walletNetworkListCommand.mjs +104 -0
- package/dist/commands/walletNetworkListCommand.mjs.map +1 -0
- package/dist/commands/walletNetworkRemoveCommand.mjs +112 -0
- package/dist/commands/walletNetworkRemoveCommand.mjs.map +1 -0
- package/dist/commands/walletNetworkUseCommand.mjs +110 -0
- package/dist/commands/walletNetworkUseCommand.mjs.map +1 -0
- package/dist/commands/walletPasswordChangeCommand.mjs +291 -0
- package/dist/commands/walletPasswordChangeCommand.mjs.map +1 -0
- package/dist/commands/walletPasswordCommand.mjs +301 -0
- package/dist/commands/walletPasswordCommand.mjs.map +1 -0
- package/dist/commands/walletRemoveCommand.mjs +378 -0
- package/dist/commands/walletRemoveCommand.mjs.map +1 -0
- package/dist/commands/walletRenameCommand.mjs +94 -0
- package/dist/commands/walletRenameCommand.mjs.map +1 -0
- package/dist/commands/walletSignCommand.mjs +662 -0
- package/dist/commands/walletSignCommand.mjs.map +1 -0
- package/dist/commands/walletTxBroadcastCommand.mjs +473 -0
- package/dist/commands/walletTxBroadcastCommand.mjs.map +1 -0
- package/dist/commands/walletTxCommand.mjs +612 -0
- package/dist/commands/walletTxCommand.mjs.map +1 -0
- package/dist/commands/walletTxSendCommand.mjs +492 -0
- package/dist/commands/walletTxSendCommand.mjs.map +1 -0
- package/dist/commands/walletTxSignCommand.mjs +403 -0
- package/dist/commands/walletTxSignCommand.mjs.map +1 -0
- package/dist/commands/walletUnlockCommand.mjs +308 -0
- package/dist/commands/walletUnlockCommand.mjs.map +1 -0
- package/dist/commands/walletUseCommand.mjs +95 -0
- package/dist/commands/walletUseCommand.mjs.map +1 -0
- package/dist/commands/xyoCommand.mjs +188 -0
- package/dist/commands/xyoCommand.mjs.map +1 -0
- package/dist/commands/xyoTxCommand.mjs +178 -0
- package/dist/commands/xyoTxCommand.mjs.map +1 -0
- package/dist/commands/xyoTxValidateCommand.mjs +168 -0
- package/dist/commands/xyoTxValidateCommand.mjs.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.mjs +8466 -0
- package/dist/index.mjs.map +1 -0
- package/dist/types/modules.d.mjs +1 -0
- package/dist/types/modules.d.mjs.map +1 -0
- package/package.json +197 -0
|
@@ -0,0 +1,66 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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":[]}
|
|
@@ -0,0 +1,536 @@
|
|
|
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
|