@xylabs/aries 0.1.1 → 0.1.7
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 +6 -688
- package/dist/aries.mjs +47 -8466
- package/package.json +14 -169
- package/dist/actions/audit/auditPaths.mjs +0 -22
- package/dist/actions/audit/auditPaths.mjs.map +0 -1
- package/dist/actions/audit/index.mjs +0 -739
- package/dist/actions/audit/index.mjs.map +0 -1
- package/dist/actions/audit/installPlugin.mjs +0 -298
- package/dist/actions/audit/installPlugin.mjs.map +0 -1
- package/dist/actions/audit/listSessions.mjs +0 -93
- package/dist/actions/audit/listSessions.mjs.map +0 -1
- package/dist/actions/audit/openAuditDir.mjs +0 -44
- package/dist/actions/audit/openAuditDir.mjs.map +0 -1
- package/dist/actions/audit/searchAudit.mjs +0 -77
- package/dist/actions/audit/searchAudit.mjs.map +0 -1
- package/dist/actions/audit/showAiMeta.mjs +0 -105
- package/dist/actions/audit/showAiMeta.mjs.map +0 -1
- package/dist/actions/audit/showSession.mjs +0 -105
- package/dist/actions/audit/showSession.mjs.map +0 -1
- package/dist/actions/audit/statusAudit.mjs +0 -98
- package/dist/actions/audit/statusAudit.mjs.map +0 -1
- package/dist/actions/clamp/clampAudit.mjs +0 -53
- package/dist/actions/clamp/clampAudit.mjs.map +0 -1
- package/dist/actions/clamp/index.mjs +0 -2258
- package/dist/actions/clamp/index.mjs.map +0 -1
- package/dist/actions/clamp/ipcServer.mjs +0 -55
- package/dist/actions/clamp/ipcServer.mjs.map +0 -1
- package/dist/actions/clamp/policyManagement.mjs +0 -144
- package/dist/actions/clamp/policyManagement.mjs.map +0 -1
- package/dist/actions/clamp/promptUser.mjs +0 -91
- package/dist/actions/clamp/promptUser.mjs.map +0 -1
- package/dist/actions/clamp/runClamped.mjs +0 -2107
- package/dist/actions/clamp/runClamped.mjs.map +0 -1
- package/dist/actions/clamp/sandboxExec.mjs +0 -1612
- package/dist/actions/clamp/sandboxExec.mjs.map +0 -1
- package/dist/actions/clamp/shellEnvSetup.mjs +0 -59
- package/dist/actions/clamp/shellEnvSetup.mjs.map +0 -1
- package/dist/actions/clamp/shimGenerator.mjs +0 -68
- package/dist/actions/clamp/shimGenerator.mjs.map +0 -1
- package/dist/actions/clamp/terminalRenderer.mjs +0 -145
- package/dist/actions/clamp/terminalRenderer.mjs.map +0 -1
- package/dist/actions/datalake/audit/auditLog.mjs +0 -191
- package/dist/actions/datalake/audit/auditLog.mjs.map +0 -1
- package/dist/actions/datalake/createDatalake.mjs +0 -127
- package/dist/actions/datalake/createDatalake.mjs.map +0 -1
- package/dist/actions/datalake/describeDatalake.mjs +0 -159
- package/dist/actions/datalake/describeDatalake.mjs.map +0 -1
- package/dist/actions/datalake/destroyDatalake.mjs +0 -34
- package/dist/actions/datalake/destroyDatalake.mjs.map +0 -1
- package/dist/actions/datalake/dev/downDevServer.mjs +0 -102
- package/dist/actions/datalake/dev/downDevServer.mjs.map +0 -1
- package/dist/actions/datalake/dev/index.mjs +0 -369
- package/dist/actions/datalake/dev/index.mjs.map +0 -1
- package/dist/actions/datalake/dev/logsDevServer.mjs +0 -44
- package/dist/actions/datalake/dev/logsDevServer.mjs.map +0 -1
- package/dist/actions/datalake/dev/paths.mjs +0 -25
- package/dist/actions/datalake/dev/paths.mjs.map +0 -1
- package/dist/actions/datalake/dev/resetDevServer.mjs +0 -118
- package/dist/actions/datalake/dev/resetDevServer.mjs.map +0 -1
- package/dist/actions/datalake/dev/resolveServerBin.mjs +0 -26
- package/dist/actions/datalake/dev/resolveServerBin.mjs.map +0 -1
- package/dist/actions/datalake/dev/state.mjs +0 -62
- package/dist/actions/datalake/dev/state.mjs.map +0 -1
- package/dist/actions/datalake/dev/statusDevServer.mjs +0 -101
- package/dist/actions/datalake/dev/statusDevServer.mjs.map +0 -1
- package/dist/actions/datalake/dev/upDevServer.mjs +0 -221
- package/dist/actions/datalake/dev/upDevServer.mjs.map +0 -1
- package/dist/actions/datalake/dev/waitForHealth.mjs +0 -22
- package/dist/actions/datalake/dev/waitForHealth.mjs.map +0 -1
- package/dist/actions/datalake/formatters.mjs +0 -90
- package/dist/actions/datalake/formatters.mjs.map +0 -1
- package/dist/actions/datalake/grantAccess.mjs +0 -116
- package/dist/actions/datalake/grantAccess.mjs.map +0 -1
- package/dist/actions/datalake/index.mjs +0 -361
- package/dist/actions/datalake/index.mjs.map +0 -1
- package/dist/actions/datalake/listDatalakes.mjs +0 -54
- package/dist/actions/datalake/listDatalakes.mjs.map +0 -1
- package/dist/actions/datalake/login.mjs +0 -20
- package/dist/actions/datalake/login.mjs.map +0 -1
- package/dist/actions/datalake/logout.mjs +0 -11
- package/dist/actions/datalake/logout.mjs.map +0 -1
- package/dist/actions/datalake/mintToken.mjs +0 -37
- package/dist/actions/datalake/mintToken.mjs.map +0 -1
- package/dist/actions/datalake/parseSize.mjs +0 -21
- package/dist/actions/datalake/parseSize.mjs.map +0 -1
- package/dist/actions/datalake/payloads/fetchPayload.mjs +0 -76
- package/dist/actions/datalake/payloads/fetchPayload.mjs.map +0 -1
- package/dist/actions/datalake/payloads/index.mjs +0 -271
- package/dist/actions/datalake/payloads/index.mjs.map +0 -1
- package/dist/actions/datalake/payloads/mintAndConnect.mjs +0 -46
- package/dist/actions/datalake/payloads/mintAndConnect.mjs.map +0 -1
- package/dist/actions/datalake/payloads/parsePayloadsFile.mjs +0 -71
- package/dist/actions/datalake/payloads/parsePayloadsFile.mjs.map +0 -1
- package/dist/actions/datalake/payloads/pushPayloads.mjs +0 -181
- package/dist/actions/datalake/payloads/pushPayloads.mjs.map +0 -1
- package/dist/actions/datalake/payloads/tailPayloads.mjs +0 -106
- package/dist/actions/datalake/payloads/tailPayloads.mjs.map +0 -1
- package/dist/actions/datalake/resolveTarget.mjs +0 -15
- package/dist/actions/datalake/resolveTarget.mjs.map +0 -1
- package/dist/actions/datalake/revokeAccess.mjs +0 -108
- package/dist/actions/datalake/revokeAccess.mjs.map +0 -1
- package/dist/actions/datalake/useDatalake.mjs +0 -22
- package/dist/actions/datalake/useDatalake.mjs.map +0 -1
- package/dist/actions/detect/detectAiClients.mjs +0 -405
- package/dist/actions/detect/detectAiClients.mjs.map +0 -1
- package/dist/actions/detect/index.mjs +0 -405
- package/dist/actions/detect/index.mjs.map +0 -1
- package/dist/actions/hash/algorithms/blockhash.mjs +0 -61
- package/dist/actions/hash/algorithms/blockhash.mjs.map +0 -1
- package/dist/actions/hash/algorithms/chromaprint.mjs +0 -205
- package/dist/actions/hash/algorithms/chromaprint.mjs.map +0 -1
- package/dist/actions/hash/algorithms/dhash.mjs +0 -75
- package/dist/actions/hash/algorithms/dhash.mjs.map +0 -1
- package/dist/actions/hash/algorithms/index.mjs +0 -818
- package/dist/actions/hash/algorithms/index.mjs.map +0 -1
- package/dist/actions/hash/algorithms/nilsimsa.mjs +0 -27
- package/dist/actions/hash/algorithms/nilsimsa.mjs.map +0 -1
- package/dist/actions/hash/algorithms/pdq.mjs +0 -83
- package/dist/actions/hash/algorithms/pdq.mjs.map +0 -1
- package/dist/actions/hash/algorithms/phash.mjs +0 -71
- package/dist/actions/hash/algorithms/phash.mjs.map +0 -1
- package/dist/actions/hash/algorithms/sha256.mjs +0 -24
- package/dist/actions/hash/algorithms/sha256.mjs.map +0 -1
- package/dist/actions/hash/algorithms/ssdeep.mjs +0 -203
- package/dist/actions/hash/algorithms/ssdeep.mjs.map +0 -1
- package/dist/actions/hash/algorithms/tlsh.mjs +0 -66
- package/dist/actions/hash/algorithms/tlsh.mjs.map +0 -1
- package/dist/actions/hash/algorithms/types.mjs +0 -1
- package/dist/actions/hash/algorithms/types.mjs.map +0 -1
- package/dist/actions/hash/algorithms/videoFrames.mjs +0 -404
- package/dist/actions/hash/algorithms/videoFrames.mjs.map +0 -1
- package/dist/actions/hash/algorithms/xyo.mjs +0 -30
- package/dist/actions/hash/algorithms/xyo.mjs.map +0 -1
- package/dist/actions/hash/compareHashes.mjs +0 -823
- package/dist/actions/hash/compareHashes.mjs.map +0 -1
- package/dist/actions/hash/hashInput.mjs +0 -868
- package/dist/actions/hash/hashInput.mjs.map +0 -1
- package/dist/actions/hash/index.mjs +0 -881
- package/dist/actions/hash/index.mjs.map +0 -1
- package/dist/actions/hash/lib/hamming.mjs +0 -44
- package/dist/actions/hash/lib/hamming.mjs.map +0 -1
- package/dist/actions/hash/lib/levenshtein.mjs +0 -36
- package/dist/actions/hash/lib/levenshtein.mjs.map +0 -1
- package/dist/actions/hash/lib/runBinary.mjs +0 -54
- package/dist/actions/hash/lib/runBinary.mjs.map +0 -1
- package/dist/actions/hash/lib/which.mjs +0 -36
- package/dist/actions/hash/lib/which.mjs.map +0 -1
- package/dist/actions/hash/lib/withTempfile.mjs +0 -19
- package/dist/actions/hash/lib/withTempfile.mjs.map +0 -1
- package/dist/actions/index.mjs +0 -4615
- package/dist/actions/index.mjs.map +0 -1
- package/dist/actions/printVersion.mjs +0 -12
- package/dist/actions/printVersion.mjs.map +0 -1
- package/dist/actions/sync/index.mjs +0 -51
- package/dist/actions/sync/index.mjs.map +0 -1
- package/dist/actions/sync/syncAiConfig.mjs +0 -51
- package/dist/actions/sync/syncAiConfig.mjs.map +0 -1
- package/dist/actions/wallet/account/deriveAndAdd.mjs +0 -394
- package/dist/actions/wallet/account/deriveAndAdd.mjs.map +0 -1
- package/dist/actions/wallet/account/getActiveWallet.mjs +0 -338
- package/dist/actions/wallet/account/getActiveWallet.mjs.map +0 -1
- package/dist/actions/wallet/account/labelAccount.mjs +0 -389
- package/dist/actions/wallet/account/labelAccount.mjs.map +0 -1
- package/dist/actions/wallet/account/listAccounts.mjs +0 -374
- package/dist/actions/wallet/account/listAccounts.mjs.map +0 -1
- package/dist/actions/wallet/account/removeAccount.mjs +0 -384
- package/dist/actions/wallet/account/removeAccount.mjs.map +0 -1
- package/dist/actions/wallet/account/showAccount.mjs +0 -368
- package/dist/actions/wallet/account/showAccount.mjs.map +0 -1
- package/dist/actions/wallet/addressBook/storage.mjs +0 -110
- package/dist/actions/wallet/addressBook/storage.mjs.map +0 -1
- package/dist/actions/wallet/backup/exportBackup.mjs +0 -93
- package/dist/actions/wallet/backup/exportBackup.mjs.map +0 -1
- package/dist/actions/wallet/backup/importBackup.mjs +0 -142
- package/dist/actions/wallet/backup/importBackup.mjs.map +0 -1
- package/dist/actions/wallet/balance/getBalance.mjs +0 -434
- package/dist/actions/wallet/balance/getBalance.mjs.map +0 -1
- package/dist/actions/wallet/client/walletClient.mjs +0 -64
- package/dist/actions/wallet/client/walletClient.mjs.map +0 -1
- package/dist/actions/wallet/contact/contactActions.mjs +0 -120
- package/dist/actions/wallet/contact/contactActions.mjs.map +0 -1
- package/dist/actions/wallet/contact/storage.mjs +0 -69
- package/dist/actions/wallet/contact/storage.mjs.map +0 -1
- package/dist/actions/wallet/index.mjs +0 -1439
- package/dist/actions/wallet/index.mjs.map +0 -1
- package/dist/actions/wallet/network/networkActions.mjs +0 -137
- package/dist/actions/wallet/network/networkActions.mjs.map +0 -1
- package/dist/actions/wallet/network/storage.mjs +0 -93
- package/dist/actions/wallet/network/storage.mjs.map +0 -1
- package/dist/actions/wallet/password/changePassword.mjs +0 -282
- package/dist/actions/wallet/password/changePassword.mjs.map +0 -1
- package/dist/actions/wallet/password/getActiveKey.mjs +0 -297
- package/dist/actions/wallet/password/getActiveKey.mjs.map +0 -1
- package/dist/actions/wallet/password/initOrUnlock.mjs +0 -337
- package/dist/actions/wallet/password/initOrUnlock.mjs.map +0 -1
- package/dist/actions/wallet/password/passwordStorage.mjs +0 -69
- package/dist/actions/wallet/password/passwordStorage.mjs.map +0 -1
- package/dist/actions/wallet/password/setPassword.mjs +0 -138
- package/dist/actions/wallet/password/setPassword.mjs.map +0 -1
- package/dist/actions/wallet/password/validatePassword.mjs +0 -123
- package/dist/actions/wallet/password/validatePassword.mjs.map +0 -1
- package/dist/actions/wallet/passwordKey.mjs +0 -87
- package/dist/actions/wallet/passwordKey.mjs.map +0 -1
- package/dist/actions/wallet/paths.mjs +0 -26
- package/dist/actions/wallet/paths.mjs.map +0 -1
- package/dist/actions/wallet/prompt.mjs +0 -93
- package/dist/actions/wallet/prompt.mjs.map +0 -1
- package/dist/actions/wallet/seedPhrase/createPhrase.mjs +0 -392
- package/dist/actions/wallet/seedPhrase/createPhrase.mjs.map +0 -1
- package/dist/actions/wallet/seedPhrase/exportPhrase.mjs +0 -334
- package/dist/actions/wallet/seedPhrase/exportPhrase.mjs.map +0 -1
- package/dist/actions/wallet/seedPhrase/idGen.mjs +0 -11
- package/dist/actions/wallet/seedPhrase/idGen.mjs.map +0 -1
- package/dist/actions/wallet/seedPhrase/importPhrase.mjs +0 -393
- package/dist/actions/wallet/seedPhrase/importPhrase.mjs.map +0 -1
- package/dist/actions/wallet/seedPhrase/listPhrases.mjs +0 -62
- package/dist/actions/wallet/seedPhrase/listPhrases.mjs.map +0 -1
- package/dist/actions/wallet/seedPhrase/phraseStorage.mjs +0 -89
- package/dist/actions/wallet/seedPhrase/phraseStorage.mjs.map +0 -1
- package/dist/actions/wallet/seedPhrase/removePhrase.mjs +0 -366
- package/dist/actions/wallet/seedPhrase/removePhrase.mjs.map +0 -1
- package/dist/actions/wallet/seedPhrase/renamePhrase.mjs +0 -78
- package/dist/actions/wallet/seedPhrase/renamePhrase.mjs.map +0 -1
- package/dist/actions/wallet/seedPhrase/types.mjs +0 -1
- package/dist/actions/wallet/seedPhrase/types.mjs.map +0 -1
- package/dist/actions/wallet/seedPhrase/usePhrase.mjs +0 -83
- package/dist/actions/wallet/seedPhrase/usePhrase.mjs.map +0 -1
- package/dist/actions/wallet/session/machineId.mjs +0 -145
- package/dist/actions/wallet/session/machineId.mjs.map +0 -1
- package/dist/actions/wallet/session/sessionCache.mjs +0 -221
- package/dist/actions/wallet/session/sessionCache.mjs.map +0 -1
- package/dist/actions/wallet/session/unlock.mjs +0 -307
- package/dist/actions/wallet/session/unlock.mjs.map +0 -1
- package/dist/actions/wallet/sign/signPayload.mjs +0 -637
- package/dist/actions/wallet/sign/signPayload.mjs.map +0 -1
- package/dist/actions/wallet/storage.mjs +0 -51
- package/dist/actions/wallet/storage.mjs.map +0 -1
- package/dist/actions/wallet/transaction/broadcastTransaction.mjs +0 -453
- package/dist/actions/wallet/transaction/broadcastTransaction.mjs.map +0 -1
- package/dist/actions/wallet/transaction/sendTransaction.mjs +0 -457
- package/dist/actions/wallet/transaction/sendTransaction.mjs.map +0 -1
- package/dist/actions/wallet/transaction/signTransactionFile.mjs +0 -378
- package/dist/actions/wallet/transaction/signTransactionFile.mjs.map +0 -1
- package/dist/actions/xyo/index.mjs +0 -138
- package/dist/actions/xyo/index.mjs.map +0 -1
- package/dist/actions/xyo/transaction/index.mjs +0 -138
- package/dist/actions/xyo/transaction/index.mjs.map +0 -1
- package/dist/actions/xyo/transaction/validateTransactions.mjs +0 -138
- package/dist/actions/xyo/transaction/validateTransactions.mjs.map +0 -1
- package/dist/aries.mjs.map +0 -1
- package/dist/bin/aries.mjs +0 -8472
- package/dist/bin/aries.mjs.map +0 -1
- package/dist/commands/aiCommand.mjs +0 -492
- package/dist/commands/aiCommand.mjs.map +0 -1
- package/dist/commands/auditAiCommand.mjs +0 -119
- package/dist/commands/auditAiCommand.mjs.map +0 -1
- package/dist/commands/auditCommand.mjs +0 -857
- package/dist/commands/auditCommand.mjs.map +0 -1
- package/dist/commands/auditInstallCommand.mjs +0 -324
- package/dist/commands/auditInstallCommand.mjs.map +0 -1
- package/dist/commands/auditListCommand.mjs +0 -107
- package/dist/commands/auditListCommand.mjs.map +0 -1
- package/dist/commands/auditOpenCommand.mjs +0 -51
- package/dist/commands/auditOpenCommand.mjs.map +0 -1
- package/dist/commands/auditSearchCommand.mjs +0 -98
- package/dist/commands/auditSearchCommand.mjs.map +0 -1
- package/dist/commands/auditShowCommand.mjs +0 -123
- package/dist/commands/auditShowCommand.mjs.map +0 -1
- package/dist/commands/auditStatusCommand.mjs +0 -105
- package/dist/commands/auditStatusCommand.mjs.map +0 -1
- package/dist/commands/clampCommand.mjs +0 -2328
- package/dist/commands/clampCommand.mjs.map +0 -1
- package/dist/commands/clampPolicyCommand.mjs +0 -184
- package/dist/commands/clampPolicyCommand.mjs.map +0 -1
- package/dist/commands/clampPolicyInitCommand.mjs +0 -63
- package/dist/commands/clampPolicyInitCommand.mjs.map +0 -1
- package/dist/commands/clampPolicyListCommand.mjs +0 -56
- package/dist/commands/clampPolicyListCommand.mjs.map +0 -1
- package/dist/commands/clampPolicyShowCommand.mjs +0 -83
- package/dist/commands/clampPolicyShowCommand.mjs.map +0 -1
- package/dist/commands/clampRunCommand.mjs +0 -2137
- package/dist/commands/clampRunCommand.mjs.map +0 -1
- package/dist/commands/datalakeAuditCommand.mjs +0 -273
- package/dist/commands/datalakeAuditCommand.mjs.map +0 -1
- package/dist/commands/datalakeCommand.mjs +0 -1637
- package/dist/commands/datalakeCommand.mjs.map +0 -1
- package/dist/commands/datalakeCreateCommand.mjs +0 -189
- package/dist/commands/datalakeCreateCommand.mjs.map +0 -1
- package/dist/commands/datalakeDescribeCommand.mjs +0 -172
- package/dist/commands/datalakeDescribeCommand.mjs.map +0 -1
- package/dist/commands/datalakeDestroyCommand.mjs +0 -53
- package/dist/commands/datalakeDestroyCommand.mjs.map +0 -1
- package/dist/commands/datalakeDevCommand.mjs +0 -470
- package/dist/commands/datalakeDevCommand.mjs.map +0 -1
- package/dist/commands/datalakeDevDownCommand.mjs +0 -111
- package/dist/commands/datalakeDevDownCommand.mjs.map +0 -1
- package/dist/commands/datalakeDevLogsCommand.mjs +0 -65
- package/dist/commands/datalakeDevLogsCommand.mjs.map +0 -1
- package/dist/commands/datalakeDevResetCommand.mjs +0 -125
- package/dist/commands/datalakeDevResetCommand.mjs.map +0 -1
- package/dist/commands/datalakeDevStatusCommand.mjs +0 -110
- package/dist/commands/datalakeDevStatusCommand.mjs.map +0 -1
- package/dist/commands/datalakeDevUpCommand.mjs +0 -268
- package/dist/commands/datalakeDevUpCommand.mjs.map +0 -1
- package/dist/commands/datalakeFetchCommand.mjs +0 -106
- package/dist/commands/datalakeFetchCommand.mjs.map +0 -1
- package/dist/commands/datalakeGrantCommand.mjs +0 -147
- package/dist/commands/datalakeGrantCommand.mjs.map +0 -1
- package/dist/commands/datalakeListCommand.mjs +0 -61
- package/dist/commands/datalakeListCommand.mjs.map +0 -1
- package/dist/commands/datalakeLoginCommand.mjs +0 -39
- package/dist/commands/datalakeLoginCommand.mjs.map +0 -1
- package/dist/commands/datalakeLogoutCommand.mjs +0 -20
- package/dist/commands/datalakeLogoutCommand.mjs.map +0 -1
- package/dist/commands/datalakePushCommand.mjs +0 -214
- package/dist/commands/datalakePushCommand.mjs.map +0 -1
- package/dist/commands/datalakeRevokeCommand.mjs +0 -127
- package/dist/commands/datalakeRevokeCommand.mjs.map +0 -1
- package/dist/commands/datalakeTailCommand.mjs +0 -144
- package/dist/commands/datalakeTailCommand.mjs.map +0 -1
- package/dist/commands/datalakeTokenCommand.mjs +0 -61
- package/dist/commands/datalakeTokenCommand.mjs.map +0 -1
- package/dist/commands/datalakeUseCommand.mjs +0 -35
- package/dist/commands/datalakeUseCommand.mjs.map +0 -1
- package/dist/commands/detectCommand.mjs +0 -419
- package/dist/commands/detectCommand.mjs.map +0 -1
- package/dist/commands/hashCommand.mjs +0 -976
- package/dist/commands/hashCommand.mjs.map +0 -1
- package/dist/commands/hashCompareCommand.mjs +0 -865
- package/dist/commands/hashCompareCommand.mjs.map +0 -1
- package/dist/commands/index.mjs +0 -8461
- package/dist/commands/index.mjs.map +0 -1
- package/dist/commands/syncCommand.mjs +0 -66
- package/dist/commands/syncCommand.mjs.map +0 -1
- package/dist/commands/versionCommand.mjs +0 -24
- package/dist/commands/versionCommand.mjs.map +0 -1
- package/dist/commands/walletAccountCommand.mjs +0 -536
- package/dist/commands/walletAccountCommand.mjs.map +0 -1
- package/dist/commands/walletAccountDeriveCommand.mjs +0 -415
- package/dist/commands/walletAccountDeriveCommand.mjs.map +0 -1
- package/dist/commands/walletAccountLabelCommand.mjs +0 -405
- package/dist/commands/walletAccountLabelCommand.mjs.map +0 -1
- package/dist/commands/walletAccountListCommand.mjs +0 -381
- package/dist/commands/walletAccountListCommand.mjs.map +0 -1
- package/dist/commands/walletAccountRemoveCommand.mjs +0 -396
- package/dist/commands/walletAccountRemoveCommand.mjs.map +0 -1
- package/dist/commands/walletAccountShowCommand.mjs +0 -380
- package/dist/commands/walletAccountShowCommand.mjs.map +0 -1
- package/dist/commands/walletBackupCommand.mjs +0 -222
- package/dist/commands/walletBackupCommand.mjs.map +0 -1
- package/dist/commands/walletBackupExportCommand.mjs +0 -107
- package/dist/commands/walletBackupExportCommand.mjs.map +0 -1
- package/dist/commands/walletBackupImportCommand.mjs +0 -154
- package/dist/commands/walletBackupImportCommand.mjs.map +0 -1
- package/dist/commands/walletBalanceCommand.mjs +0 -448
- package/dist/commands/walletBalanceCommand.mjs.map +0 -1
- package/dist/commands/walletCommand.mjs +0 -1968
- package/dist/commands/walletCommand.mjs.map +0 -1
- package/dist/commands/walletContactAddCommand.mjs +0 -111
- package/dist/commands/walletContactAddCommand.mjs.map +0 -1
- package/dist/commands/walletContactCommand.mjs +0 -184
- package/dist/commands/walletContactCommand.mjs.map +0 -1
- package/dist/commands/walletContactListCommand.mjs +0 -66
- package/dist/commands/walletContactListCommand.mjs.map +0 -1
- package/dist/commands/walletContactRemoveCommand.mjs +0 -97
- package/dist/commands/walletContactRemoveCommand.mjs.map +0 -1
- package/dist/commands/walletContactRenameCommand.mjs +0 -114
- package/dist/commands/walletContactRenameCommand.mjs.map +0 -1
- package/dist/commands/walletCreateCommand.mjs +0 -407
- package/dist/commands/walletCreateCommand.mjs.map +0 -1
- package/dist/commands/walletExportCommand.mjs +0 -345
- package/dist/commands/walletExportCommand.mjs.map +0 -1
- package/dist/commands/walletImportCommand.mjs +0 -413
- package/dist/commands/walletImportCommand.mjs.map +0 -1
- package/dist/commands/walletListCommand.mjs +0 -69
- package/dist/commands/walletListCommand.mjs.map +0 -1
- package/dist/commands/walletLockCommand.mjs +0 -56
- package/dist/commands/walletLockCommand.mjs.map +0 -1
- package/dist/commands/walletNetworkAddCommand.mjs +0 -131
- package/dist/commands/walletNetworkAddCommand.mjs.map +0 -1
- package/dist/commands/walletNetworkCommand.mjs +0 -206
- package/dist/commands/walletNetworkCommand.mjs.map +0 -1
- package/dist/commands/walletNetworkListCommand.mjs +0 -104
- package/dist/commands/walletNetworkListCommand.mjs.map +0 -1
- package/dist/commands/walletNetworkRemoveCommand.mjs +0 -112
- package/dist/commands/walletNetworkRemoveCommand.mjs.map +0 -1
- package/dist/commands/walletNetworkUseCommand.mjs +0 -110
- package/dist/commands/walletNetworkUseCommand.mjs.map +0 -1
- package/dist/commands/walletPasswordChangeCommand.mjs +0 -291
- package/dist/commands/walletPasswordChangeCommand.mjs.map +0 -1
- package/dist/commands/walletPasswordCommand.mjs +0 -301
- package/dist/commands/walletPasswordCommand.mjs.map +0 -1
- package/dist/commands/walletRemoveCommand.mjs +0 -378
- package/dist/commands/walletRemoveCommand.mjs.map +0 -1
- package/dist/commands/walletRenameCommand.mjs +0 -94
- package/dist/commands/walletRenameCommand.mjs.map +0 -1
- package/dist/commands/walletSignCommand.mjs +0 -662
- package/dist/commands/walletSignCommand.mjs.map +0 -1
- package/dist/commands/walletTxBroadcastCommand.mjs +0 -473
- package/dist/commands/walletTxBroadcastCommand.mjs.map +0 -1
- package/dist/commands/walletTxCommand.mjs +0 -612
- package/dist/commands/walletTxCommand.mjs.map +0 -1
- package/dist/commands/walletTxSendCommand.mjs +0 -492
- package/dist/commands/walletTxSendCommand.mjs.map +0 -1
- package/dist/commands/walletTxSignCommand.mjs +0 -403
- package/dist/commands/walletTxSignCommand.mjs.map +0 -1
- package/dist/commands/walletUnlockCommand.mjs +0 -308
- package/dist/commands/walletUnlockCommand.mjs.map +0 -1
- package/dist/commands/walletUseCommand.mjs +0 -95
- package/dist/commands/walletUseCommand.mjs.map +0 -1
- package/dist/commands/xyoCommand.mjs +0 -188
- package/dist/commands/xyoCommand.mjs.map +0 -1
- package/dist/commands/xyoTxCommand.mjs +0 -178
- package/dist/commands/xyoTxCommand.mjs.map +0 -1
- package/dist/commands/xyoTxValidateCommand.mjs +0 -168
- package/dist/commands/xyoTxValidateCommand.mjs.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.mjs +0 -8466
- package/dist/index.mjs.map +0 -1
- package/dist/types/modules.d.mjs +0 -1
- package/dist/types/modules.d.mjs.map +0 -1
|
@@ -1,739 +0,0 @@
|
|
|
1
|
-
// src/actions/audit/installPlugin.ts
|
|
2
|
-
import {
|
|
3
|
-
existsSync,
|
|
4
|
-
mkdirSync,
|
|
5
|
-
readFileSync,
|
|
6
|
-
writeFileSync
|
|
7
|
-
} from "fs";
|
|
8
|
-
import { homedir } from "os";
|
|
9
|
-
import path from "path";
|
|
10
|
-
import chalk from "chalk";
|
|
11
|
-
function findMonorepoRoot(startDir) {
|
|
12
|
-
let dir = startDir;
|
|
13
|
-
while (dir !== path.dirname(dir)) {
|
|
14
|
-
if (existsSync(path.join(dir, "pnpm-workspace.yaml"))) return dir;
|
|
15
|
-
dir = path.dirname(dir);
|
|
16
|
-
}
|
|
17
|
-
return void 0;
|
|
18
|
-
}
|
|
19
|
-
function getRepoRoot() {
|
|
20
|
-
const root = findMonorepoRoot(process.cwd());
|
|
21
|
-
if (!root) throw new Error("Could not find monorepo root (pnpm-workspace.yaml)");
|
|
22
|
-
return root;
|
|
23
|
-
}
|
|
24
|
-
function resolveClaudeHooksDist() {
|
|
25
|
-
return path.join(getRepoRoot(), "packages", "audit-plugin", "dist", "hooks");
|
|
26
|
-
}
|
|
27
|
-
function getClaudeSettingsPath() {
|
|
28
|
-
return path.join(homedir(), ".claude", "settings.json");
|
|
29
|
-
}
|
|
30
|
-
function readClaudeSettings() {
|
|
31
|
-
const settingsPath = getClaudeSettingsPath();
|
|
32
|
-
if (!existsSync(settingsPath)) return {};
|
|
33
|
-
const raw = readFileSync(settingsPath, "utf8");
|
|
34
|
-
return JSON.parse(raw);
|
|
35
|
-
}
|
|
36
|
-
function writeClaudeSettings(settings) {
|
|
37
|
-
const settingsPath = getClaudeSettingsPath();
|
|
38
|
-
mkdirSync(path.dirname(settingsPath), { recursive: true });
|
|
39
|
-
writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + "\n", "utf8");
|
|
40
|
-
}
|
|
41
|
-
function buildClaudeHooks(hooksDir) {
|
|
42
|
-
return {
|
|
43
|
-
SessionStart: [
|
|
44
|
-
{
|
|
45
|
-
matcher: "",
|
|
46
|
-
hooks: [{
|
|
47
|
-
type: "command",
|
|
48
|
-
command: `node ${hooksDir}/session-start.mjs`,
|
|
49
|
-
timeout: 5
|
|
50
|
-
}]
|
|
51
|
-
}
|
|
52
|
-
],
|
|
53
|
-
UserPromptSubmit: [
|
|
54
|
-
{
|
|
55
|
-
matcher: "",
|
|
56
|
-
hooks: [{
|
|
57
|
-
type: "command",
|
|
58
|
-
command: `node ${hooksDir}/user-prompt-submit.mjs`,
|
|
59
|
-
timeout: 5
|
|
60
|
-
}]
|
|
61
|
-
}
|
|
62
|
-
],
|
|
63
|
-
PostToolUse: [
|
|
64
|
-
{
|
|
65
|
-
matcher: "",
|
|
66
|
-
hooks: [{
|
|
67
|
-
type: "command",
|
|
68
|
-
command: `node ${hooksDir}/post-tool-use.mjs`,
|
|
69
|
-
timeout: 5
|
|
70
|
-
}]
|
|
71
|
-
}
|
|
72
|
-
],
|
|
73
|
-
Stop: [
|
|
74
|
-
{
|
|
75
|
-
matcher: "",
|
|
76
|
-
hooks: [{
|
|
77
|
-
type: "command",
|
|
78
|
-
command: `node ${hooksDir}/stop.mjs`,
|
|
79
|
-
timeout: 5
|
|
80
|
-
}]
|
|
81
|
-
}
|
|
82
|
-
]
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
function getCodexConfigPath() {
|
|
86
|
-
return path.join(homedir(), ".codex", "config.toml");
|
|
87
|
-
}
|
|
88
|
-
function getCodexHooksPath() {
|
|
89
|
-
return path.join(getRepoRoot(), ".codex", "hooks.json");
|
|
90
|
-
}
|
|
91
|
-
function readCodexConfig() {
|
|
92
|
-
const configPath = getCodexConfigPath();
|
|
93
|
-
if (!existsSync(configPath)) return "";
|
|
94
|
-
return readFileSync(configPath, "utf8");
|
|
95
|
-
}
|
|
96
|
-
function writeCodexConfig(config) {
|
|
97
|
-
const configPath = getCodexConfigPath();
|
|
98
|
-
mkdirSync(path.dirname(configPath), { recursive: true });
|
|
99
|
-
writeFileSync(configPath, config, "utf8");
|
|
100
|
-
}
|
|
101
|
-
function enableCodexHooksFeature() {
|
|
102
|
-
const config = readCodexConfig();
|
|
103
|
-
const lines = config === "" ? [] : config.split("\n");
|
|
104
|
-
const featuresIndex = lines.findIndex((line) => line.trim() === "[features]");
|
|
105
|
-
if (featuresIndex === -1) {
|
|
106
|
-
const separator = config === "" || config.endsWith("\n\n") || config.endsWith("\n") ? "" : "\n";
|
|
107
|
-
writeCodexConfig(config + separator + "[features]\ncodex_hooks = true\n");
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
const sectionEnd = lines.findIndex(
|
|
111
|
-
(line, index) => index > featuresIndex && /^\s*\[.*\]\s*$/.test(line)
|
|
112
|
-
);
|
|
113
|
-
const endIndex = sectionEnd === -1 ? lines.length : sectionEnd;
|
|
114
|
-
const codexHooksIndex = lines.findIndex(
|
|
115
|
-
(line, index) => index > featuresIndex && index < endIndex && /^\s*codex_hooks\s*=/.test(line)
|
|
116
|
-
);
|
|
117
|
-
if (codexHooksIndex === -1) {
|
|
118
|
-
lines.splice(endIndex, 0, "codex_hooks = true");
|
|
119
|
-
} else {
|
|
120
|
-
lines[codexHooksIndex] = "codex_hooks = true";
|
|
121
|
-
}
|
|
122
|
-
writeCodexConfig(lines.join("\n"));
|
|
123
|
-
}
|
|
124
|
-
function readCodexHooks() {
|
|
125
|
-
const hooksPath = getCodexHooksPath();
|
|
126
|
-
if (!existsSync(hooksPath)) return {};
|
|
127
|
-
return JSON.parse(readFileSync(hooksPath, "utf8"));
|
|
128
|
-
}
|
|
129
|
-
function writeCodexHooks(config) {
|
|
130
|
-
const hooksPath = getCodexHooksPath();
|
|
131
|
-
mkdirSync(path.dirname(hooksPath), { recursive: true });
|
|
132
|
-
writeFileSync(hooksPath, JSON.stringify(config, null, 2) + "\n", "utf8");
|
|
133
|
-
}
|
|
134
|
-
function buildCodexHookCommand(eventName) {
|
|
135
|
-
const recorderPath = path.join(getRepoRoot(), "packages", "audit-plugin", "dist", "codex", "record-event.mjs");
|
|
136
|
-
return `node "${recorderPath}" ${eventName}`;
|
|
137
|
-
}
|
|
138
|
-
function buildCodexHooks() {
|
|
139
|
-
return {
|
|
140
|
-
PostToolUse: [
|
|
141
|
-
{
|
|
142
|
-
hooks: [
|
|
143
|
-
{
|
|
144
|
-
command: buildCodexHookCommand("PostToolUse"),
|
|
145
|
-
statusMessage: "Recording Codex audit entry",
|
|
146
|
-
type: "command"
|
|
147
|
-
}
|
|
148
|
-
],
|
|
149
|
-
matcher: "Bash"
|
|
150
|
-
}
|
|
151
|
-
],
|
|
152
|
-
SessionStart: [
|
|
153
|
-
{
|
|
154
|
-
hooks: [
|
|
155
|
-
{
|
|
156
|
-
command: buildCodexHookCommand("SessionStart"),
|
|
157
|
-
statusMessage: "Recording Codex audit entry",
|
|
158
|
-
type: "command"
|
|
159
|
-
}
|
|
160
|
-
],
|
|
161
|
-
matcher: "startup|resume"
|
|
162
|
-
}
|
|
163
|
-
],
|
|
164
|
-
Stop: [
|
|
165
|
-
{
|
|
166
|
-
hooks: [
|
|
167
|
-
{
|
|
168
|
-
command: buildCodexHookCommand("Stop"),
|
|
169
|
-
statusMessage: "Recording Codex audit entry",
|
|
170
|
-
type: "command"
|
|
171
|
-
}
|
|
172
|
-
]
|
|
173
|
-
}
|
|
174
|
-
],
|
|
175
|
-
UserPromptSubmit: [
|
|
176
|
-
{
|
|
177
|
-
hooks: [
|
|
178
|
-
{
|
|
179
|
-
command: buildCodexHookCommand("UserPromptSubmit"),
|
|
180
|
-
statusMessage: "Recording Codex audit entry",
|
|
181
|
-
type: "command"
|
|
182
|
-
}
|
|
183
|
-
]
|
|
184
|
-
}
|
|
185
|
-
]
|
|
186
|
-
};
|
|
187
|
-
}
|
|
188
|
-
function isManagedCodexHook(hook) {
|
|
189
|
-
return hook.command.includes(path.join("packages", "audit-plugin", "dist", "codex", "record-event.mjs"));
|
|
190
|
-
}
|
|
191
|
-
function mergeCodexHooks(existing) {
|
|
192
|
-
const mergedHooks = existing.hooks ? { ...existing.hooks } : {};
|
|
193
|
-
const managedHooks = buildCodexHooks();
|
|
194
|
-
for (const [eventName, groups] of Object.entries(managedHooks)) {
|
|
195
|
-
const remaining = (mergedHooks[eventName] ?? []).map((group) => ({
|
|
196
|
-
...group,
|
|
197
|
-
hooks: group.hooks.filter((hook) => !isManagedCodexHook(hook))
|
|
198
|
-
})).filter((group) => group.hooks.length > 0);
|
|
199
|
-
mergedHooks[eventName] = [...remaining, ...groups];
|
|
200
|
-
}
|
|
201
|
-
return { hooks: mergedHooks };
|
|
202
|
-
}
|
|
203
|
-
function removeManagedCodexHooks(existing) {
|
|
204
|
-
const nextHooks = {};
|
|
205
|
-
for (const [eventName, groups] of Object.entries(existing.hooks ?? {})) {
|
|
206
|
-
const remaining = groups.map((group) => ({
|
|
207
|
-
...group,
|
|
208
|
-
hooks: group.hooks.filter((hook) => !isManagedCodexHook(hook))
|
|
209
|
-
})).filter((group) => group.hooks.length > 0);
|
|
210
|
-
if (remaining.length > 0) {
|
|
211
|
-
nextHooks[eventName] = remaining;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
return Object.keys(nextHooks).length > 0 ? { hooks: nextHooks } : {};
|
|
215
|
-
}
|
|
216
|
-
function installClaudePlugin() {
|
|
217
|
-
const hooksDir = resolveClaudeHooksDist();
|
|
218
|
-
if (!existsSync(hooksDir)) {
|
|
219
|
-
console.log(chalk.red(`Hook scripts not found: ${hooksDir}`));
|
|
220
|
-
console.log(chalk.gray("Make sure @xylabs/aries-audit-plugin is built (pnpm xy build)."));
|
|
221
|
-
return;
|
|
222
|
-
}
|
|
223
|
-
const settings = readClaudeSettings();
|
|
224
|
-
settings.hooks = buildClaudeHooks(hooksDir);
|
|
225
|
-
writeClaudeSettings(settings);
|
|
226
|
-
console.log(chalk.green("Claude audit hooks installed into ~/.claude/settings.json"));
|
|
227
|
-
console.log(` ${chalk.gray("Hook scripts:")} ${hooksDir}`);
|
|
228
|
-
console.log(chalk.yellow("\nRestart Claude Code for the hooks to take effect."));
|
|
229
|
-
}
|
|
230
|
-
function uninstallClaudePlugin() {
|
|
231
|
-
const settings = readClaudeSettings();
|
|
232
|
-
if (!settings.hooks) {
|
|
233
|
-
console.log(chalk.yellow("No Claude hooks configured in ~/.claude/settings.json"));
|
|
234
|
-
return;
|
|
235
|
-
}
|
|
236
|
-
delete settings.hooks;
|
|
237
|
-
writeClaudeSettings(settings);
|
|
238
|
-
console.log(chalk.green("Claude audit hooks removed from ~/.claude/settings.json"));
|
|
239
|
-
console.log(chalk.yellow("Restart Claude Code for the change to take effect."));
|
|
240
|
-
}
|
|
241
|
-
function installCodexPlugin() {
|
|
242
|
-
const recorderPath = path.join(getRepoRoot(), "packages", "audit-plugin", "dist", "codex", "record-event.mjs");
|
|
243
|
-
if (!existsSync(recorderPath)) {
|
|
244
|
-
console.log(chalk.red(`Codex recorder not found: ${recorderPath}`));
|
|
245
|
-
console.log(chalk.gray("Make sure @xylabs/aries-audit-plugin is built (pnpm xy build)."));
|
|
246
|
-
return;
|
|
247
|
-
}
|
|
248
|
-
enableCodexHooksFeature();
|
|
249
|
-
const hooks = mergeCodexHooks(readCodexHooks());
|
|
250
|
-
writeCodexHooks(hooks);
|
|
251
|
-
console.log(chalk.green("Codex audit hooks installed"));
|
|
252
|
-
console.log(` ${chalk.gray("Hooks file:")} ${getCodexHooksPath()}`);
|
|
253
|
-
console.log(` ${chalk.gray("Config file:")} ${getCodexConfigPath()}`);
|
|
254
|
-
console.log(chalk.yellow("\nRestart Codex CLI in this repo for the hooks to take effect."));
|
|
255
|
-
}
|
|
256
|
-
function uninstallCodexPlugin() {
|
|
257
|
-
const hooksPath = getCodexHooksPath();
|
|
258
|
-
if (!existsSync(hooksPath)) {
|
|
259
|
-
console.log(chalk.yellow("No repo-local Codex hooks file found to update."));
|
|
260
|
-
return;
|
|
261
|
-
}
|
|
262
|
-
const hooks = removeManagedCodexHooks(readCodexHooks());
|
|
263
|
-
writeCodexHooks(hooks);
|
|
264
|
-
console.log(chalk.green("Codex audit hooks removed from repo-local hooks.json"));
|
|
265
|
-
console.log(` ${chalk.gray("Hooks file:")} ${hooksPath}`);
|
|
266
|
-
console.log(chalk.gray("Leaving features.codex_hooks enabled in ~/.codex/config.toml to avoid disabling unrelated hooks."));
|
|
267
|
-
}
|
|
268
|
-
function installPlugin(provider) {
|
|
269
|
-
if (!provider) {
|
|
270
|
-
installClaudePlugin();
|
|
271
|
-
console.log();
|
|
272
|
-
installCodexPlugin();
|
|
273
|
-
return;
|
|
274
|
-
}
|
|
275
|
-
if (provider === "claude") {
|
|
276
|
-
installClaudePlugin();
|
|
277
|
-
return;
|
|
278
|
-
}
|
|
279
|
-
installCodexPlugin();
|
|
280
|
-
}
|
|
281
|
-
function uninstallPlugin(provider) {
|
|
282
|
-
if (!provider) {
|
|
283
|
-
uninstallClaudePlugin();
|
|
284
|
-
console.log();
|
|
285
|
-
uninstallCodexPlugin();
|
|
286
|
-
return;
|
|
287
|
-
}
|
|
288
|
-
if (provider === "claude") {
|
|
289
|
-
uninstallClaudePlugin();
|
|
290
|
-
return;
|
|
291
|
-
}
|
|
292
|
-
uninstallCodexPlugin();
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
// src/actions/audit/listSessions.ts
|
|
296
|
-
import {
|
|
297
|
-
existsSync as existsSync2,
|
|
298
|
-
readdirSync,
|
|
299
|
-
readFileSync as readFileSync2
|
|
300
|
-
} from "fs";
|
|
301
|
-
import path3 from "path";
|
|
302
|
-
import chalk2 from "chalk";
|
|
303
|
-
|
|
304
|
-
// src/actions/audit/auditPaths.ts
|
|
305
|
-
import { homedir as homedir2 } from "os";
|
|
306
|
-
import path2 from "path";
|
|
307
|
-
function getAuditRootDir() {
|
|
308
|
-
return path2.join(homedir2(), ".aries", "audit-logs");
|
|
309
|
-
}
|
|
310
|
-
function getAuditDir(provider) {
|
|
311
|
-
return provider ? path2.join(getAuditRootDir(), provider) : getAuditRootDir();
|
|
312
|
-
}
|
|
313
|
-
function getAuditSearchDirs() {
|
|
314
|
-
return [
|
|
315
|
-
getAuditDir("claude"),
|
|
316
|
-
getAuditDir("codex"),
|
|
317
|
-
getAuditRootDir()
|
|
318
|
-
];
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
// src/actions/audit/listSessions.ts
|
|
322
|
-
function summarizeSession(filePath, date) {
|
|
323
|
-
const content = readFileSync2(filePath, "utf8").trim();
|
|
324
|
-
if (!content) return void 0;
|
|
325
|
-
const lines = content.split("\n");
|
|
326
|
-
const events = {};
|
|
327
|
-
let firstTimestamp = "";
|
|
328
|
-
let lastTimestamp = "";
|
|
329
|
-
let sessionId = "unknown";
|
|
330
|
-
for (const line of lines) {
|
|
331
|
-
try {
|
|
332
|
-
const entry = JSON.parse(line);
|
|
333
|
-
if (!firstTimestamp) firstTimestamp = entry.timestamp ?? "";
|
|
334
|
-
lastTimestamp = entry.timestamp ?? "";
|
|
335
|
-
sessionId = entry.sessionId ?? sessionId;
|
|
336
|
-
const eventName = entry.event ?? "unknown";
|
|
337
|
-
events[eventName] = (events[eventName] ?? 0) + 1;
|
|
338
|
-
} catch {
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
return {
|
|
342
|
-
date,
|
|
343
|
-
entryCount: lines.length,
|
|
344
|
-
events,
|
|
345
|
-
firstTimestamp,
|
|
346
|
-
lastTimestamp,
|
|
347
|
-
sessionId
|
|
348
|
-
};
|
|
349
|
-
}
|
|
350
|
-
function listSessions(date) {
|
|
351
|
-
const auditDirs = getAuditSearchDirs().filter((dir) => existsSync2(dir));
|
|
352
|
-
if (auditDirs.length === 0) {
|
|
353
|
-
console.log(chalk2.yellow("No audit logs found."));
|
|
354
|
-
return;
|
|
355
|
-
}
|
|
356
|
-
const dates = date ? [date] : [...new Set(
|
|
357
|
-
auditDirs.flatMap((auditDir) => readdirSync(auditDir).filter((d) => /^\d{4}-\d{2}-\d{2}$/.test(d)))
|
|
358
|
-
)].toSorted((a, b) => a.localeCompare(b)).toReversed();
|
|
359
|
-
let found = false;
|
|
360
|
-
for (const d of dates) {
|
|
361
|
-
const files = auditDirs.flatMap((auditDir) => {
|
|
362
|
-
const dayDir = path3.join(auditDir, d);
|
|
363
|
-
if (!existsSync2(dayDir)) return [];
|
|
364
|
-
return readdirSync(dayDir).filter((f) => f.endsWith(".jsonl")).map((file) => path3.join(dayDir, file));
|
|
365
|
-
});
|
|
366
|
-
if (files.length === 0) continue;
|
|
367
|
-
found = true;
|
|
368
|
-
console.log(chalk2.cyan(`
|
|
369
|
-
${d}`));
|
|
370
|
-
for (const file of files) {
|
|
371
|
-
const summary = summarizeSession(file, d);
|
|
372
|
-
if (!summary) continue;
|
|
373
|
-
const timeRange = `${summary.firstTimestamp.slice(11, 19)} - ${summary.lastTimestamp.slice(11, 19)}`;
|
|
374
|
-
const eventSummary = Object.entries(summary.events).map(([k, v]) => `${k}:${v}`).join(" ");
|
|
375
|
-
console.log(
|
|
376
|
-
` ${chalk2.white(summary.sessionId.slice(0, 12).padEnd(12))} ${chalk2.gray(timeRange)} ${chalk2.green(String(summary.entryCount).padStart(4))} entries ${chalk2.gray(eventSummary)}`
|
|
377
|
-
);
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
if (!found) {
|
|
381
|
-
console.log(chalk2.yellow("No audit logs found."));
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
// src/actions/audit/openAuditDir.ts
|
|
386
|
-
import { execSync } from "child_process";
|
|
387
|
-
import { existsSync as existsSync3, mkdirSync as mkdirSync2 } from "fs";
|
|
388
|
-
import { platform } from "os";
|
|
389
|
-
import chalk3 from "chalk";
|
|
390
|
-
function openAuditDir() {
|
|
391
|
-
const dir = getAuditDir();
|
|
392
|
-
if (!existsSync3(dir)) {
|
|
393
|
-
mkdirSync2(dir, { recursive: true });
|
|
394
|
-
console.log(chalk3.yellow(`Created audit log directory: ${dir}`));
|
|
395
|
-
}
|
|
396
|
-
const os = platform();
|
|
397
|
-
switch (os) {
|
|
398
|
-
case "darwin": {
|
|
399
|
-
execSync(`open "${dir}"`);
|
|
400
|
-
break;
|
|
401
|
-
}
|
|
402
|
-
case "win32": {
|
|
403
|
-
execSync(`explorer "${dir}"`);
|
|
404
|
-
break;
|
|
405
|
-
}
|
|
406
|
-
default: {
|
|
407
|
-
execSync(`xdg-open "${dir}"`);
|
|
408
|
-
break;
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
console.log(chalk3.green(`Opened: ${dir}`));
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
// src/actions/audit/searchAudit.ts
|
|
415
|
-
import {
|
|
416
|
-
existsSync as existsSync4,
|
|
417
|
-
readdirSync as readdirSync2,
|
|
418
|
-
readFileSync as readFileSync3
|
|
419
|
-
} from "fs";
|
|
420
|
-
import path4 from "path";
|
|
421
|
-
import chalk4 from "chalk";
|
|
422
|
-
function searchAudit(query, date, limit = 50) {
|
|
423
|
-
const auditDirs = getAuditSearchDirs().filter((dir) => existsSync4(dir));
|
|
424
|
-
if (auditDirs.length === 0) {
|
|
425
|
-
console.log(chalk4.yellow("No audit logs found."));
|
|
426
|
-
return;
|
|
427
|
-
}
|
|
428
|
-
const dates = date ? [date] : [...new Set(
|
|
429
|
-
auditDirs.flatMap((auditDir) => readdirSync2(auditDir).filter((d) => /^\d{4}-\d{2}-\d{2}$/.test(d)))
|
|
430
|
-
)].toSorted((a, b) => a.localeCompare(b)).toReversed();
|
|
431
|
-
const lowerQuery = query.toLowerCase();
|
|
432
|
-
let matchCount = 0;
|
|
433
|
-
for (const d of dates) {
|
|
434
|
-
const files = auditDirs.flatMap((auditDir) => {
|
|
435
|
-
const dayDir = path4.join(auditDir, d);
|
|
436
|
-
if (!existsSync4(dayDir)) return [];
|
|
437
|
-
return readdirSync2(dayDir).filter((f) => f.endsWith(".jsonl")).map((file) => path4.join(dayDir, file));
|
|
438
|
-
});
|
|
439
|
-
for (const file of files) {
|
|
440
|
-
const content = readFileSync3(file, "utf8").trim();
|
|
441
|
-
if (!content) continue;
|
|
442
|
-
for (const line of content.split("\n")) {
|
|
443
|
-
if (!line.toLowerCase().includes(lowerQuery)) continue;
|
|
444
|
-
try {
|
|
445
|
-
const entry = JSON.parse(line);
|
|
446
|
-
const time = (entry.timestamp ?? "").slice(0, 19);
|
|
447
|
-
const event = entry.event ?? "unknown";
|
|
448
|
-
const snippet = JSON.stringify(entry.data).slice(0, 150);
|
|
449
|
-
console.log(`${chalk4.gray(time)} ${chalk4.cyan((entry.sessionId ?? "").slice(0, 8))} ${chalk4.yellow(event)} ${snippet}`);
|
|
450
|
-
matchCount++;
|
|
451
|
-
if (matchCount >= limit) {
|
|
452
|
-
console.log(chalk4.gray(`
|
|
453
|
-
... showing first ${limit} matches`));
|
|
454
|
-
return;
|
|
455
|
-
}
|
|
456
|
-
} catch {
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
if (matchCount === 0) {
|
|
462
|
-
console.log(chalk4.yellow(`No matches found for: ${query}`));
|
|
463
|
-
} else {
|
|
464
|
-
console.log(chalk4.gray(`
|
|
465
|
-
${matchCount} match${matchCount === 1 ? "" : "es"} found`));
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
// src/actions/audit/showAiMeta.ts
|
|
470
|
-
import { execSync as execSync2 } from "child_process";
|
|
471
|
-
import {
|
|
472
|
-
existsSync as existsSync5,
|
|
473
|
-
readdirSync as readdirSync3,
|
|
474
|
-
readFileSync as readFileSync4
|
|
475
|
-
} from "fs";
|
|
476
|
-
import { homedir as homedir3 } from "os";
|
|
477
|
-
import path5 from "path";
|
|
478
|
-
import { fileURLToPath } from "url";
|
|
479
|
-
import chalk5 from "chalk";
|
|
480
|
-
function getClientVersion() {
|
|
481
|
-
try {
|
|
482
|
-
const thisFile = fileURLToPath(import.meta.url);
|
|
483
|
-
const pkgDir = path5.resolve(path5.dirname(thisFile), "..", "..");
|
|
484
|
-
const pkg = JSON.parse(readFileSync4(path5.join(pkgDir, "package.json"), "utf8"));
|
|
485
|
-
return pkg.version;
|
|
486
|
-
} catch {
|
|
487
|
-
return void 0;
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
function getClaudeVersion() {
|
|
491
|
-
const execPath = process.env.CLAUDE_CODE_EXECPATH;
|
|
492
|
-
if (execPath) return path5.basename(execPath);
|
|
493
|
-
try {
|
|
494
|
-
const output = execSync2("claude --version", { encoding: "utf8", timeout: 5e3 }).trim();
|
|
495
|
-
const match = /^([\d.]+)/.exec(output);
|
|
496
|
-
return match?.[1];
|
|
497
|
-
} catch {
|
|
498
|
-
return void 0;
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
function getClaudeDir() {
|
|
502
|
-
return path5.join(homedir3(), ".claude");
|
|
503
|
-
}
|
|
504
|
-
function readRestrictions() {
|
|
505
|
-
try {
|
|
506
|
-
const raw = JSON.parse(readFileSync4(path5.join(getClaudeDir(), "policy-limits.json"), "utf8"));
|
|
507
|
-
if (!raw.restrictions) return void 0;
|
|
508
|
-
const result = {};
|
|
509
|
-
for (const [key, value] of Object.entries(raw.restrictions)) {
|
|
510
|
-
result[key] = value.allowed ?? false;
|
|
511
|
-
}
|
|
512
|
-
return Object.keys(result).length > 0 ? result : void 0;
|
|
513
|
-
} catch {
|
|
514
|
-
return void 0;
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
function readIdeName() {
|
|
518
|
-
try {
|
|
519
|
-
const ideDir = path5.join(getClaudeDir(), "ide");
|
|
520
|
-
if (!existsSync5(ideDir)) return void 0;
|
|
521
|
-
const lockFile = readdirSync3(ideDir).find((f) => f.endsWith(".lock"));
|
|
522
|
-
if (!lockFile) return void 0;
|
|
523
|
-
const content = JSON.parse(readFileSync4(path5.join(ideDir, lockFile), "utf8"));
|
|
524
|
-
return content.ideName;
|
|
525
|
-
} catch {
|
|
526
|
-
return void 0;
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
var DYNAMIC_FIELDS = /* @__PURE__ */ new Set(["kind", "model", "permissionMode"]);
|
|
530
|
-
function printSection(label, entries) {
|
|
531
|
-
console.log(chalk5.cyan(label));
|
|
532
|
-
for (const [key, value] of Object.entries(entries)) {
|
|
533
|
-
if (value === void 0) {
|
|
534
|
-
const fallback = DYNAMIC_FIELDS.has(key) ? chalk5.gray("<dynamic>") : chalk5.gray("unknown");
|
|
535
|
-
console.log(` ${chalk5.white(key)}: ${fallback}`);
|
|
536
|
-
} else if (typeof value === "object" && value !== null) {
|
|
537
|
-
console.log(` ${chalk5.white(key)}:`);
|
|
538
|
-
for (const [k, v] of Object.entries(value)) {
|
|
539
|
-
console.log(` ${chalk5.white(k)}: ${chalk5.green(String(v))}`);
|
|
540
|
-
}
|
|
541
|
-
} else {
|
|
542
|
-
console.log(` ${chalk5.white(key)}: ${chalk5.green(typeof value === "string" ? value : JSON.stringify(value))}`);
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
function showAiMeta(json) {
|
|
547
|
-
const ai = {
|
|
548
|
-
entrypoint: process.env.CLAUDE_CODE_ENTRYPOINT,
|
|
549
|
-
ide: readIdeName(),
|
|
550
|
-
kind: void 0,
|
|
551
|
-
model: void 0,
|
|
552
|
-
permissionMode: void 0,
|
|
553
|
-
product: "claude-code",
|
|
554
|
-
provider: "anthropic",
|
|
555
|
-
restrictions: readRestrictions(),
|
|
556
|
-
version: getClaudeVersion()
|
|
557
|
-
};
|
|
558
|
-
const client = {
|
|
559
|
-
name: "@xylabs/aries-audit-plugin",
|
|
560
|
-
version: getClientVersion()
|
|
561
|
-
};
|
|
562
|
-
if (json) {
|
|
563
|
-
console.log(JSON.stringify({ ai, client }, null, 2));
|
|
564
|
-
return;
|
|
565
|
-
}
|
|
566
|
-
printSection("AI", ai);
|
|
567
|
-
console.log();
|
|
568
|
-
printSection("Client", client);
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
// src/actions/audit/showSession.ts
|
|
572
|
-
import {
|
|
573
|
-
existsSync as existsSync6,
|
|
574
|
-
readdirSync as readdirSync4,
|
|
575
|
-
readFileSync as readFileSync5
|
|
576
|
-
} from "fs";
|
|
577
|
-
import path6 from "path";
|
|
578
|
-
import chalk6 from "chalk";
|
|
579
|
-
function findSessionFile(sessionId) {
|
|
580
|
-
const auditDirs = getAuditSearchDirs().filter((dir) => existsSync6(dir));
|
|
581
|
-
if (auditDirs.length === 0) return void 0;
|
|
582
|
-
const dates = [...new Set(
|
|
583
|
-
auditDirs.flatMap((auditDir) => readdirSync4(auditDir).filter((d) => /^\d{4}-\d{2}-\d{2}$/.test(d)))
|
|
584
|
-
)].toSorted((a, b) => a.localeCompare(b)).toReversed();
|
|
585
|
-
for (const date of dates) {
|
|
586
|
-
for (const auditDir of auditDirs) {
|
|
587
|
-
const dayDir = path6.join(auditDir, date);
|
|
588
|
-
if (!existsSync6(dayDir)) continue;
|
|
589
|
-
const files = readdirSync4(dayDir).filter((f) => f.includes(sessionId) && f.endsWith(".jsonl"));
|
|
590
|
-
if (files.length > 0) return path6.join(dayDir, files[0]);
|
|
591
|
-
}
|
|
592
|
-
}
|
|
593
|
-
return void 0;
|
|
594
|
-
}
|
|
595
|
-
function formatSessionStart(time, entry) {
|
|
596
|
-
const version = entry.ai?.version ? ` v${entry.ai.version}` : "";
|
|
597
|
-
const mode = entry.data?.permissionMode ? ` mode=${entry.data.permissionMode}` : "";
|
|
598
|
-
return `${chalk6.gray(time)} ${chalk6.blue("SESSION START")}${version}${mode}`;
|
|
599
|
-
}
|
|
600
|
-
function formatEntry(entry) {
|
|
601
|
-
const time = (entry.timestamp ?? "").slice(11, 23);
|
|
602
|
-
const event = entry.event ?? "unknown";
|
|
603
|
-
const data = entry.data;
|
|
604
|
-
switch (event) {
|
|
605
|
-
case "SessionStart": {
|
|
606
|
-
return formatSessionStart(time, entry);
|
|
607
|
-
}
|
|
608
|
-
case "UserPromptSubmit": {
|
|
609
|
-
return `${chalk6.gray(time)} ${chalk6.green("PROMPT")} ${String(data?.prompt ?? "").slice(0, 200)}`;
|
|
610
|
-
}
|
|
611
|
-
case "PostToolUse": {
|
|
612
|
-
return `${chalk6.gray(time)} ${chalk6.yellow("TOOL")} ${chalk6.white(String(data?.toolName ?? ""))} ${chalk6.gray(String(data?.toolInput ?? "").slice(0, 120))}`;
|
|
613
|
-
}
|
|
614
|
-
case "Stop": {
|
|
615
|
-
return `${chalk6.gray(time)} ${chalk6.magenta("RESPONSE")} ${String(data?.response ?? "").slice(0, 200)}`;
|
|
616
|
-
}
|
|
617
|
-
default: {
|
|
618
|
-
return `${chalk6.gray(time)} ${event} ${JSON.stringify(data)}`;
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
function showSession(sessionId, format) {
|
|
623
|
-
const filePath = findSessionFile(sessionId);
|
|
624
|
-
if (!filePath) {
|
|
625
|
-
console.log(chalk6.red(`No audit log found for session: ${sessionId}`));
|
|
626
|
-
return;
|
|
627
|
-
}
|
|
628
|
-
const content = readFileSync5(filePath, "utf8").trim();
|
|
629
|
-
if (!content) {
|
|
630
|
-
console.log(chalk6.yellow("Session log is empty."));
|
|
631
|
-
return;
|
|
632
|
-
}
|
|
633
|
-
const lines = content.split("\n");
|
|
634
|
-
if (format === "json") {
|
|
635
|
-
for (const line of lines) {
|
|
636
|
-
console.log(line);
|
|
637
|
-
}
|
|
638
|
-
return;
|
|
639
|
-
}
|
|
640
|
-
console.log(chalk6.cyan(`Session: ${sessionId}`));
|
|
641
|
-
console.log(chalk6.cyan(`File: ${filePath}`));
|
|
642
|
-
console.log(chalk6.cyan(`Entries: ${lines.length}`));
|
|
643
|
-
console.log();
|
|
644
|
-
for (const line of lines) {
|
|
645
|
-
try {
|
|
646
|
-
const entry = JSON.parse(line);
|
|
647
|
-
console.log(formatEntry(entry));
|
|
648
|
-
} catch {
|
|
649
|
-
console.log(chalk6.red(` [malformed] ${line.slice(0, 80)}`));
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
// src/actions/audit/statusAudit.ts
|
|
655
|
-
import {
|
|
656
|
-
existsSync as existsSync7,
|
|
657
|
-
readdirSync as readdirSync5,
|
|
658
|
-
readFileSync as readFileSync6,
|
|
659
|
-
statSync
|
|
660
|
-
} from "fs";
|
|
661
|
-
import { homedir as homedir4 } from "os";
|
|
662
|
-
import path7 from "path";
|
|
663
|
-
import chalk7 from "chalk";
|
|
664
|
-
function getDirectorySize(dir) {
|
|
665
|
-
let size = 0;
|
|
666
|
-
if (!existsSync7(dir)) return size;
|
|
667
|
-
for (const entry of readdirSync5(dir)) {
|
|
668
|
-
const fullPath = path7.join(dir, entry);
|
|
669
|
-
const stat = statSync(fullPath);
|
|
670
|
-
size += stat.isDirectory() ? getDirectorySize(fullPath) : stat.size;
|
|
671
|
-
}
|
|
672
|
-
return size;
|
|
673
|
-
}
|
|
674
|
-
function formatBytes(bytes) {
|
|
675
|
-
if (bytes < 1024) return `${bytes} B`;
|
|
676
|
-
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
677
|
-
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
678
|
-
}
|
|
679
|
-
function countSessions(dir) {
|
|
680
|
-
if (!existsSync7(dir)) return 0;
|
|
681
|
-
let count = 0;
|
|
682
|
-
for (const date of readdirSync5(dir)) {
|
|
683
|
-
const dayDir = path7.join(dir, date);
|
|
684
|
-
const stat = statSync(dayDir);
|
|
685
|
-
if (stat.isDirectory()) {
|
|
686
|
-
count += readdirSync5(dayDir).filter((f) => f.endsWith(".jsonl")).length;
|
|
687
|
-
}
|
|
688
|
-
}
|
|
689
|
-
return count;
|
|
690
|
-
}
|
|
691
|
-
function checkHooksInstalled() {
|
|
692
|
-
const settingsPath = path7.join(homedir4(), ".claude", "settings.json");
|
|
693
|
-
if (!existsSync7(settingsPath)) return false;
|
|
694
|
-
try {
|
|
695
|
-
const settings = JSON.parse(readFileSync6(settingsPath, "utf8"));
|
|
696
|
-
return settings.hooks != null;
|
|
697
|
-
} catch {
|
|
698
|
-
return false;
|
|
699
|
-
}
|
|
700
|
-
}
|
|
701
|
-
function statusAudit() {
|
|
702
|
-
const auditRootDir = getAuditRootDir();
|
|
703
|
-
const auditDirs = getAuditSearchDirs().filter((dir) => existsSync7(dir));
|
|
704
|
-
console.log(chalk7.cyan("Audit Plugin Status"));
|
|
705
|
-
console.log();
|
|
706
|
-
if (checkHooksInstalled()) {
|
|
707
|
-
console.log(` ${chalk7.green("Hooks:")} configured in ~/.claude/settings.json`);
|
|
708
|
-
} else {
|
|
709
|
-
console.log(` ${chalk7.red("Hooks:")} not installed (run: aries audit install)`);
|
|
710
|
-
}
|
|
711
|
-
console.log();
|
|
712
|
-
console.log(` ${chalk7.gray("Log root:")} ${auditRootDir}`);
|
|
713
|
-
console.log(` ${chalk7.gray("Claude logs:")} ${getAuditDir("claude")}`);
|
|
714
|
-
console.log(` ${chalk7.gray("Codex logs:")} ${getAuditDir("codex")}`);
|
|
715
|
-
if (auditDirs.length > 0) {
|
|
716
|
-
const sessions = auditDirs.reduce((sum, dir) => sum + countSessions(dir), 0);
|
|
717
|
-
const size = auditDirs.reduce((sum, dir) => sum + getDirectorySize(dir), 0);
|
|
718
|
-
const dates = [...new Set(
|
|
719
|
-
auditDirs.flatMap((dir) => readdirSync5(dir).filter((d) => /^\d{4}-\d{2}-\d{2}$/.test(d)))
|
|
720
|
-
)];
|
|
721
|
-
const sorted = dates.toSorted((a, b) => a.localeCompare(b));
|
|
722
|
-
console.log(` ${chalk7.gray("Sessions:")} ${sessions}`);
|
|
723
|
-
console.log(` ${chalk7.gray("Date range:")} ${sorted[0] ?? "none"} - ${sorted.at(-1) ?? "none"}`);
|
|
724
|
-
console.log(` ${chalk7.gray("Disk usage:")} ${formatBytes(size)}`);
|
|
725
|
-
} else {
|
|
726
|
-
console.log(` ${chalk7.gray("No logs yet")}`);
|
|
727
|
-
}
|
|
728
|
-
}
|
|
729
|
-
export {
|
|
730
|
-
installPlugin,
|
|
731
|
-
listSessions,
|
|
732
|
-
openAuditDir,
|
|
733
|
-
searchAudit,
|
|
734
|
-
showAiMeta,
|
|
735
|
-
showSession,
|
|
736
|
-
statusAudit,
|
|
737
|
-
uninstallPlugin
|
|
738
|
-
};
|
|
739
|
-
//# sourceMappingURL=index.mjs.map
|