agentvault 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (293) hide show
  1. package/.claude/settings.local.json +9 -0
  2. package/README.md +1 -1
  3. package/dist/cli/commands/approve.js +5 -5
  4. package/dist/cli/commands/archive.js +5 -5
  5. package/dist/cli/commands/backup.js +5 -5
  6. package/dist/cli/commands/cloud-backup.js +12 -12
  7. package/dist/cli/commands/decrypt.js +2 -2
  8. package/dist/cli/commands/deploy.js +1 -1
  9. package/dist/cli/commands/exec.js +2 -2
  10. package/dist/cli/commands/fetch.js +4 -4
  11. package/dist/cli/commands/inference.js +5 -5
  12. package/dist/cli/commands/init.d.ts +1 -1
  13. package/dist/cli/commands/init.js +16 -16
  14. package/dist/cli/commands/list.js +4 -4
  15. package/dist/cli/commands/package.js +2 -2
  16. package/dist/cli/commands/profile.js +1 -1
  17. package/dist/cli/commands/rebuild.js +2 -2
  18. package/dist/cli/commands/show.js +1 -1
  19. package/dist/cli/commands/status.d.ts +1 -1
  20. package/dist/cli/commands/status.js +8 -8
  21. package/dist/cli/commands/trace.js +1 -1
  22. package/dist/cli/commands/wallet-export.js +1 -1
  23. package/dist/cli/commands/wallet-sign.js +1 -1
  24. package/dist/cli/commands/wallet.d.ts +1 -1
  25. package/dist/cli/commands/wallet.js +1 -1
  26. package/dist/cli/index.d.ts +2 -2
  27. package/dist/cli/index.js +3 -3
  28. package/dist/src/archival/archive-manager.d.ts +85 -0
  29. package/dist/src/archival/archive-manager.js +294 -0
  30. package/dist/src/archival/arweave-client.d.ts +88 -0
  31. package/dist/src/archival/arweave-client.js +223 -0
  32. package/dist/src/archival/index.d.ts +8 -0
  33. package/{src/archival/index.ts → dist/src/archival/index.js} +1 -1
  34. package/dist/src/backup/backup.d.ts +67 -0
  35. package/dist/src/backup/backup.js +231 -0
  36. package/dist/src/backup/index.d.ts +7 -0
  37. package/{src/backup/index.ts → dist/src/backup/index.js} +1 -1
  38. package/dist/src/cloud-storage/cloud-sync.d.ts +49 -0
  39. package/dist/src/cloud-storage/cloud-sync.js +372 -0
  40. package/dist/src/cloud-storage/index.d.ts +11 -0
  41. package/{src/cloud-storage/index.ts → dist/src/cloud-storage/index.js} +1 -1
  42. package/dist/src/cloud-storage/provider-detector.d.ts +34 -0
  43. package/dist/src/cloud-storage/provider-detector.js +158 -0
  44. package/{src/cloud-storage/types.ts → dist/src/cloud-storage/types.d.ts} +40 -53
  45. package/dist/src/cloud-storage/types.js +10 -0
  46. package/dist/src/debugging/index.d.ts +6 -0
  47. package/{src/debugging/index.ts → dist/src/debugging/index.js} +1 -1
  48. package/dist/src/debugging/logs.d.ts +32 -0
  49. package/dist/src/debugging/logs.js +158 -0
  50. package/dist/src/debugging/types.d.ts +91 -0
  51. package/dist/src/debugging/types.js +5 -0
  52. package/dist/src/deployment/deployer.d.ts +52 -0
  53. package/dist/src/deployment/deployer.js +211 -0
  54. package/dist/src/deployment/icpClient.d.ts +144 -0
  55. package/dist/src/deployment/icpClient.js +545 -0
  56. package/dist/src/deployment/index.d.ts +11 -0
  57. package/dist/src/deployment/index.js +14 -0
  58. package/dist/src/deployment/promotion.d.ts +32 -0
  59. package/dist/src/deployment/promotion.js +114 -0
  60. package/dist/src/deployment/types.d.ts +101 -0
  61. package/dist/src/deployment/types.js +5 -0
  62. package/dist/src/icp/batch.d.ts +112 -0
  63. package/dist/src/icp/batch.js +273 -0
  64. package/dist/src/icp/cycles.d.ts +29 -0
  65. package/{src/icp/cycles.ts → dist/src/icp/cycles.js} +8 -22
  66. package/dist/src/icp/environment.d.ts +60 -0
  67. package/dist/src/icp/environment.js +183 -0
  68. package/dist/src/icp/icpcli.d.ts +204 -0
  69. package/dist/src/icp/icpcli.js +374 -0
  70. package/dist/src/icp/icwasm.d.ts +94 -0
  71. package/dist/src/icp/icwasm.js +197 -0
  72. package/dist/src/icp/identity.d.ts +50 -0
  73. package/{src/icp/identity.ts → dist/src/icp/identity.js} +15 -28
  74. package/dist/src/icp/index.d.ts +16 -0
  75. package/dist/src/icp/index.js +20 -0
  76. package/dist/src/icp/optimization.d.ts +16 -0
  77. package/dist/src/icp/optimization.js +225 -0
  78. package/dist/src/icp/tokens.d.ts +24 -0
  79. package/{src/icp/tokens.ts → dist/src/icp/tokens.js} +5 -12
  80. package/dist/src/icp/tool-detector.d.ts +31 -0
  81. package/dist/src/icp/tool-detector.js +104 -0
  82. package/dist/src/icp/types.d.ts +493 -0
  83. package/dist/src/icp/types.js +7 -0
  84. package/dist/src/index.d.ts +12 -0
  85. package/dist/src/index.js +18 -0
  86. package/dist/src/inference/bittensor-client.d.ts +108 -0
  87. package/dist/src/inference/bittensor-client.js +224 -0
  88. package/dist/src/inference/index.d.ts +8 -0
  89. package/{src/inference/index.ts → dist/src/inference/index.js} +1 -1
  90. package/dist/src/inference/inference-manager.d.ts +76 -0
  91. package/dist/src/inference/inference-manager.js +228 -0
  92. package/dist/src/metrics/index.d.ts +7 -0
  93. package/{src/metrics/index.ts → dist/src/metrics/index.js} +1 -1
  94. package/dist/src/metrics/metrics.d.ts +39 -0
  95. package/dist/src/metrics/metrics.js +129 -0
  96. package/dist/src/monitoring/alerting.d.ts +51 -0
  97. package/dist/src/monitoring/alerting.js +169 -0
  98. package/dist/src/monitoring/health.d.ts +40 -0
  99. package/dist/src/monitoring/health.js +164 -0
  100. package/dist/src/monitoring/index.d.ts +10 -0
  101. package/dist/src/monitoring/index.js +12 -0
  102. package/dist/src/monitoring/info.d.ts +15 -0
  103. package/dist/src/monitoring/info.js +109 -0
  104. package/dist/src/monitoring/types.d.ts +93 -0
  105. package/dist/src/monitoring/types.js +7 -0
  106. package/dist/src/network/index.d.ts +5 -0
  107. package/{src/network/index.ts → dist/src/network/index.js} +1 -1
  108. package/dist/src/network/network-config.d.ts +31 -0
  109. package/dist/src/network/network-config.js +109 -0
  110. package/dist/src/packaging/compiler.d.ts +61 -0
  111. package/dist/src/packaging/compiler.js +562 -0
  112. package/dist/src/packaging/config-persistence.d.ts +46 -0
  113. package/dist/src/packaging/config-persistence.js +108 -0
  114. package/dist/src/packaging/config-schemas.d.ts +115 -0
  115. package/dist/src/packaging/config-schemas.js +43 -0
  116. package/dist/src/packaging/detector.d.ts +26 -0
  117. package/dist/src/packaging/detector.js +193 -0
  118. package/dist/src/packaging/index.d.ts +16 -0
  119. package/dist/src/packaging/index.js +22 -0
  120. package/dist/src/packaging/packager.d.ts +31 -0
  121. package/dist/src/packaging/packager.js +90 -0
  122. package/dist/src/packaging/parsers/clawdbot.d.ts +19 -0
  123. package/dist/src/packaging/parsers/clawdbot.js +231 -0
  124. package/dist/src/packaging/parsers/cline.d.ts +26 -0
  125. package/dist/src/packaging/parsers/cline.js +185 -0
  126. package/dist/src/packaging/parsers/generic.d.ts +27 -0
  127. package/dist/src/packaging/parsers/generic.js +228 -0
  128. package/dist/src/packaging/parsers/goose.d.ts +26 -0
  129. package/dist/src/packaging/parsers/goose.js +175 -0
  130. package/dist/src/packaging/parsers/index.d.ts +11 -0
  131. package/{src/packaging/parsers/index.ts → dist/src/packaging/parsers/index.js} +1 -1
  132. package/dist/src/packaging/serializer.d.ts +108 -0
  133. package/dist/src/packaging/serializer.js +153 -0
  134. package/dist/src/packaging/types.d.ts +131 -0
  135. package/dist/src/packaging/types.js +5 -0
  136. package/dist/src/packaging/wasmedge-compiler.d.ts +76 -0
  137. package/dist/src/packaging/wasmedge-compiler.js +349 -0
  138. package/dist/src/security/index.d.ts +11 -0
  139. package/{src/security/index.ts → dist/src/security/index.js} +1 -4
  140. package/dist/src/security/multisig.d.ts +102 -0
  141. package/dist/src/security/multisig.js +283 -0
  142. package/dist/src/security/types.d.ts +207 -0
  143. package/dist/src/security/types.js +217 -0
  144. package/dist/src/security/vetkeys.d.ts +179 -0
  145. package/dist/src/security/vetkeys.js +499 -0
  146. package/dist/src/testing/index.d.ts +6 -0
  147. package/{src/testing/index.ts → dist/src/testing/index.js} +1 -1
  148. package/dist/src/testing/local-runner.d.ts +23 -0
  149. package/dist/src/testing/local-runner.js +226 -0
  150. package/dist/src/testing/types.d.ts +98 -0
  151. package/dist/src/testing/types.js +5 -0
  152. package/dist/src/wallet/cbor-serializer.d.ts +82 -0
  153. package/dist/src/wallet/cbor-serializer.js +282 -0
  154. package/dist/src/wallet/chain-dispatcher.d.ts +112 -0
  155. package/dist/src/wallet/chain-dispatcher.js +241 -0
  156. package/dist/src/wallet/cross-chain-aggregator.d.ts +119 -0
  157. package/dist/src/wallet/cross-chain-aggregator.js +235 -0
  158. package/dist/src/wallet/index.d.ts +16 -0
  159. package/dist/src/wallet/index.js +22 -0
  160. package/dist/src/wallet/key-derivation.d.ts +117 -0
  161. package/dist/src/wallet/key-derivation.js +325 -0
  162. package/dist/src/wallet/providers/base-provider.d.ts +111 -0
  163. package/dist/src/wallet/providers/base-provider.js +58 -0
  164. package/dist/src/wallet/providers/cketh-provider.d.ts +104 -0
  165. package/dist/src/wallet/providers/cketh-provider.js +343 -0
  166. package/dist/src/wallet/providers/polkadot-provider.d.ts +115 -0
  167. package/dist/src/wallet/providers/polkadot-provider.js +407 -0
  168. package/dist/src/wallet/providers/solana-provider.d.ts +102 -0
  169. package/dist/src/wallet/providers/solana-provider.js +393 -0
  170. package/dist/src/wallet/transaction-queue.d.ts +133 -0
  171. package/dist/src/wallet/transaction-queue.js +195 -0
  172. package/dist/src/wallet/types.d.ts +167 -0
  173. package/dist/src/wallet/types.js +5 -0
  174. package/dist/src/wallet/vetkeys-adapter.d.ts +134 -0
  175. package/dist/src/wallet/vetkeys-adapter.js +313 -0
  176. package/dist/src/wallet/wallet-manager.d.ts +202 -0
  177. package/dist/src/wallet/wallet-manager.js +451 -0
  178. package/dist/src/wallet/wallet-storage.d.ts +131 -0
  179. package/dist/src/wallet/wallet-storage.js +274 -0
  180. package/macos-wallet-app/AgentVaultWallet/App/AgentVaultWalletApp.swift +54 -0
  181. package/macos-wallet-app/AgentVaultWallet/Models/AppState.swift +102 -0
  182. package/macos-wallet-app/AgentVaultWallet/Models/Chain.swift +121 -0
  183. package/macos-wallet-app/AgentVaultWallet/Models/Wallet.swift +98 -0
  184. package/macos-wallet-app/AgentVaultWallet/Resources/AgentVaultWallet.entitlements +27 -0
  185. package/macos-wallet-app/AgentVaultWallet/Resources/Info.plist +69 -0
  186. package/macos-wallet-app/AgentVaultWallet/Services/BackupService.swift +270 -0
  187. package/macos-wallet-app/AgentVaultWallet/Services/CLIBridge.swift +367 -0
  188. package/macos-wallet-app/AgentVaultWallet/Services/CryptoService.swift +157 -0
  189. package/macos-wallet-app/AgentVaultWallet/Services/FileService.swift +120 -0
  190. package/macos-wallet-app/AgentVaultWallet/Services/KeychainService.swift +219 -0
  191. package/macos-wallet-app/AgentVaultWallet/Utilities/Constants.swift +44 -0
  192. package/macos-wallet-app/AgentVaultWallet/Utilities/Extensions.swift +115 -0
  193. package/macos-wallet-app/AgentVaultWallet/ViewModels/BackupViewModel.swift +237 -0
  194. package/macos-wallet-app/AgentVaultWallet/ViewModels/CreateWalletViewModel.swift +137 -0
  195. package/macos-wallet-app/AgentVaultWallet/ViewModels/ImportWalletViewModel.swift +179 -0
  196. package/macos-wallet-app/AgentVaultWallet/ViewModels/WalletStore.swift +286 -0
  197. package/macos-wallet-app/AgentVaultWallet/Views/Backup/BackupView.swift +235 -0
  198. package/macos-wallet-app/AgentVaultWallet/Views/Backup/RestoreView.swift +316 -0
  199. package/macos-wallet-app/AgentVaultWallet/Views/Create/CreateWalletFlow.swift +438 -0
  200. package/macos-wallet-app/AgentVaultWallet/Views/Import/ImportWalletFlow.swift +399 -0
  201. package/macos-wallet-app/AgentVaultWallet/Views/MainView.swift +134 -0
  202. package/macos-wallet-app/AgentVaultWallet/Views/Settings/SettingsView.swift +276 -0
  203. package/macos-wallet-app/AgentVaultWallet/Views/Sidebar/SidebarView.swift +133 -0
  204. package/macos-wallet-app/AgentVaultWallet/Views/Wallet/DashboardView.swift +233 -0
  205. package/macos-wallet-app/AgentVaultWallet/Views/Wallet/WalletDetailView.swift +281 -0
  206. package/macos-wallet-app/AgentVaultWallet/Views/Wallet/WalletListView.swift +280 -0
  207. package/macos-wallet-app/AgentVaultWallet/Views/Welcome/WelcomeView.swift +176 -0
  208. package/macos-wallet-app/Makefile +47 -0
  209. package/macos-wallet-app/project.yml +40 -0
  210. package/macos-wallet-app/setup.sh +73 -0
  211. package/package.json +10 -2
  212. package/backups/agentvault-backup-test-agent-2026-02-12T17-54-28-967Z.json +0 -28
  213. package/backups/agentvault-backup-test-agent-2026-02-12T17-54-29-032Z.backup +0 -1
  214. package/backups/agentvault-backup-test-agent-2026-02-12T17-57-42-373Z.json +0 -28
  215. package/backups/agentvault-backup-test-agent-2026-02-12T17-57-42-428Z.backup +0 -1
  216. package/backups/agentvault-backup-test-agent-2026-02-12T18-52-25-132Z.json +0 -28
  217. package/backups/agentvault-backup-test-agent-2026-02-12T18-52-25-247Z.backup +0 -1
  218. package/backups/agentvault-backup-test-agent-2026-02-12T18-54-09-216Z.json +0 -28
  219. package/backups/agentvault-backup-test-agent-2026-02-12T18-54-09-283Z.backup +0 -1
  220. package/backups/agentvault-backup-test-agent-2026-02-12T22-18-22-772Z.backup +0 -1
  221. package/backups/agentvault-backup-test-agent-2026-02-12T22-18-22-793Z.json +0 -28
  222. package/backups/test-backup.json +0 -28
  223. package/scripts/dev-dashboard.mjs +0 -84
  224. package/site/README.md +0 -63
  225. package/site/docusaurus.config.ts +0 -148
  226. package/site/package-lock.json +0 -18383
  227. package/site/package.json +0 -47
  228. package/site/sidebars.ts +0 -86
  229. package/site/static/.gitkeep +0 -0
  230. package/site/static/img/logo.svg +0 -28
  231. package/site/static/img/og-image.svg +0 -35
  232. package/src/archival/archive-manager.ts +0 -372
  233. package/src/archival/arweave-client.ts +0 -289
  234. package/src/backup/backup.ts +0 -315
  235. package/src/cloud-storage/cloud-sync.ts +0 -461
  236. package/src/cloud-storage/provider-detector.ts +0 -198
  237. package/src/debugging/logs.ts +0 -193
  238. package/src/debugging/types.ts +0 -100
  239. package/src/deployment/deployer.ts +0 -274
  240. package/src/deployment/icpClient.ts +0 -620
  241. package/src/deployment/index.ts +0 -46
  242. package/src/deployment/promotion.ts +0 -161
  243. package/src/deployment/types.ts +0 -111
  244. package/src/icp/batch.ts +0 -374
  245. package/src/icp/environment.ts +0 -215
  246. package/src/icp/icpcli.ts +0 -438
  247. package/src/icp/icwasm.ts +0 -222
  248. package/src/icp/index.ts +0 -94
  249. package/src/icp/optimization.ts +0 -242
  250. package/src/icp/tool-detector.ts +0 -110
  251. package/src/icp/types.ts +0 -574
  252. package/src/index.ts +0 -25
  253. package/src/inference/bittensor-client.ts +0 -304
  254. package/src/inference/inference-manager.ts +0 -327
  255. package/src/metrics/metrics.ts +0 -186
  256. package/src/monitoring/alerting.ts +0 -190
  257. package/src/monitoring/health.ts +0 -197
  258. package/src/monitoring/index.ts +0 -38
  259. package/src/monitoring/info.ts +0 -114
  260. package/src/monitoring/types.ts +0 -99
  261. package/src/network/network-config.ts +0 -129
  262. package/src/packaging/compiler.ts +0 -647
  263. package/src/packaging/config-persistence.ts +0 -135
  264. package/src/packaging/config-schemas.ts +0 -156
  265. package/src/packaging/detector.ts +0 -220
  266. package/src/packaging/index.ts +0 -90
  267. package/src/packaging/packager.ts +0 -118
  268. package/src/packaging/parsers/clawdbot.ts +0 -278
  269. package/src/packaging/parsers/cline.ts +0 -223
  270. package/src/packaging/parsers/generic.ts +0 -266
  271. package/src/packaging/parsers/goose.ts +0 -214
  272. package/src/packaging/serializer.ts +0 -260
  273. package/src/packaging/types.ts +0 -144
  274. package/src/packaging/wasmedge-compiler.ts +0 -406
  275. package/src/security/multisig.ts +0 -415
  276. package/src/security/types.ts +0 -416
  277. package/src/security/vetkeys.ts +0 -655
  278. package/src/testing/local-runner.ts +0 -264
  279. package/src/testing/types.ts +0 -104
  280. package/src/wallet/cbor-serializer.ts +0 -323
  281. package/src/wallet/chain-dispatcher.ts +0 -313
  282. package/src/wallet/cross-chain-aggregator.ts +0 -346
  283. package/src/wallet/index.ts +0 -76
  284. package/src/wallet/key-derivation.ts +0 -425
  285. package/src/wallet/providers/base-provider.ts +0 -154
  286. package/src/wallet/providers/cketh-provider.ts +0 -434
  287. package/src/wallet/providers/polkadot-provider.ts +0 -503
  288. package/src/wallet/providers/solana-provider.ts +0 -490
  289. package/src/wallet/transaction-queue.ts +0 -284
  290. package/src/wallet/types.ts +0 -178
  291. package/src/wallet/vetkeys-adapter.ts +0 -431
  292. package/src/wallet/wallet-manager.ts +0 -597
  293. package/src/wallet/wallet-storage.ts +0 -380
@@ -6,99 +6,86 @@
6
6
  * storage providers (Google Drive, iCloud, Dropbox, etc.)
7
7
  * via their local sync directories — no crypto required.
8
8
  */
9
-
10
9
  /**
11
10
  * Supported cloud storage providers detected via local sync directories.
12
11
  */
13
- export type CloudProvider =
14
- | 'google-drive'
15
- | 'icloud-drive'
16
- | 'dropbox'
17
- | 'onedrive'
18
- | 'custom';
19
-
12
+ export type CloudProvider = 'google-drive' | 'icloud-drive' | 'dropbox' | 'onedrive' | 'custom';
20
13
  /**
21
14
  * A detected cloud provider with its local sync path.
22
15
  */
23
16
  export interface DetectedProvider {
24
- provider: CloudProvider;
25
- label: string;
26
- path: string;
27
- available: boolean;
17
+ provider: CloudProvider;
18
+ label: string;
19
+ path: string;
20
+ available: boolean;
28
21
  }
29
-
30
22
  /**
31
23
  * Configuration for cloud backup destination.
32
24
  */
33
25
  export interface CloudBackupConfig {
34
- provider: CloudProvider;
35
- basePath: string;
36
- subdirectory: string;
26
+ provider: CloudProvider;
27
+ basePath: string;
28
+ subdirectory: string;
37
29
  }
38
-
39
30
  /**
40
31
  * What to include in a cloud backup archive.
41
32
  */
42
33
  export interface CloudArchiveOptions {
43
- agentName?: string;
44
- includeConfigs: boolean;
45
- includeWallets: boolean;
46
- includeBackups: boolean;
47
- includeNetworks: boolean;
34
+ agentName?: string;
35
+ includeConfigs: boolean;
36
+ includeWallets: boolean;
37
+ includeBackups: boolean;
38
+ includeNetworks: boolean;
48
39
  }
49
-
50
40
  /**
51
41
  * Metadata written alongside the archive for identification and integrity.
52
42
  */
53
43
  export interface CloudArchiveManifest {
54
- version: string;
55
- createdAt: string;
56
- platform: string;
57
- hostname: string;
58
- agentVaultVersion: string;
59
- agentName?: string;
60
- components: string[];
61
- files: CloudArchiveFileEntry[];
62
- checksum: string;
44
+ version: string;
45
+ createdAt: string;
46
+ platform: string;
47
+ hostname: string;
48
+ agentVaultVersion: string;
49
+ agentName?: string;
50
+ components: string[];
51
+ files: CloudArchiveFileEntry[];
52
+ checksum: string;
63
53
  }
64
-
65
54
  /**
66
55
  * Entry for a single file within the archive manifest.
67
56
  */
68
57
  export interface CloudArchiveFileEntry {
69
- relativePath: string;
70
- sizeBytes: number;
71
- checksum: string;
58
+ relativePath: string;
59
+ sizeBytes: number;
60
+ checksum: string;
72
61
  }
73
-
74
62
  /**
75
63
  * Result of an archive operation.
76
64
  */
77
65
  export interface CloudArchiveResult {
78
- success: boolean;
79
- archivePath?: string;
80
- manifestPath?: string;
81
- fileCount?: number;
82
- totalBytes?: number;
83
- error?: string;
66
+ success: boolean;
67
+ archivePath?: string;
68
+ manifestPath?: string;
69
+ fileCount?: number;
70
+ totalBytes?: number;
71
+ error?: string;
84
72
  }
85
-
86
73
  /**
87
74
  * Result of a restore operation.
88
75
  */
89
76
  export interface CloudRestoreResult {
90
- success: boolean;
91
- restoredFiles?: number;
92
- components?: string[];
93
- warnings: string[];
94
- error?: string;
77
+ success: boolean;
78
+ restoredFiles?: number;
79
+ components?: string[];
80
+ warnings: string[];
81
+ error?: string;
95
82
  }
96
-
97
83
  /**
98
84
  * A discovered archive available for restore.
99
85
  */
100
86
  export interface DiscoveredArchive {
101
- manifestPath: string;
102
- archivePath: string;
103
- manifest: CloudArchiveManifest;
87
+ manifestPath: string;
88
+ archivePath: string;
89
+ manifest: CloudArchiveManifest;
104
90
  }
91
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Cloud Storage Types
3
+ *
4
+ * Types for the cloud storage backup feature that lets users
5
+ * archive and restore AgentVault data using consumer cloud
6
+ * storage providers (Google Drive, iCloud, Dropbox, etc.)
7
+ * via their local sync directories — no crypto required.
8
+ */
9
+ export {};
10
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Debugging module
3
+ */
4
+ export * from './types.js';
5
+ export * from './logs.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Debugging module
3
3
  */
4
-
5
4
  export * from './types.js';
6
5
  export * from './logs.js';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Log aggregation for canister debugging
3
+ *
4
+ * Collects, stores, and queries logs from canisters
5
+ */
6
+ import type { LogEntry, LogLevel } from './types.js';
7
+ /**
8
+ * Collect logs from canister output
9
+ */
10
+ export declare function collectLogs(canisterId: string, output: string): Promise<LogEntry[]>;
11
+ /**
12
+ * Store log entries to disk
13
+ */
14
+ export declare function storeLogs(canisterId: string, logs: LogEntry[]): Promise<void>;
15
+ /**
16
+ * Retrieve logs for a canister with optional filtering
17
+ */
18
+ export declare function getLogs(canisterId: string, options?: {
19
+ since?: Date;
20
+ level?: LogLevel;
21
+ pattern?: string;
22
+ limit?: number;
23
+ }): Promise<LogEntry[]>;
24
+ /**
25
+ * Export logs to a file
26
+ */
27
+ export declare function exportLogs(canisterId: string, outputPath: string, format?: 'json' | 'csv'): Promise<void>;
28
+ /**
29
+ * Clear logs for a canister
30
+ */
31
+ export declare function clearLogs(canisterId: string): Promise<void>;
32
+ //# sourceMappingURL=logs.d.ts.map
@@ -0,0 +1,158 @@
1
+ /**
2
+ * Log aggregation for canister debugging
3
+ *
4
+ * Collects, stores, and queries logs from canisters
5
+ */
6
+ import fs from 'node:fs';
7
+ import path from 'node:path';
8
+ import os from 'node:os';
9
+ const AGENTVAULT_DIR = path.join(os.homedir(), '.agentvault');
10
+ const LOGS_DIR = path.join(AGENTVAULT_DIR, 'logs');
11
+ /**
12
+ * Ensure logs directory exists
13
+ */
14
+ function ensureLogsDir() {
15
+ if (!fs.existsSync(AGENTVAULT_DIR)) {
16
+ fs.mkdirSync(AGENTVAULT_DIR, { recursive: true });
17
+ }
18
+ if (!fs.existsSync(LOGS_DIR)) {
19
+ fs.mkdirSync(LOGS_DIR, { recursive: true });
20
+ }
21
+ }
22
+ /**
23
+ * Get logs directory for a specific canister
24
+ */
25
+ function getCanisterLogsDir(canisterId) {
26
+ ensureLogsDir();
27
+ const canisterDir = path.join(LOGS_DIR, canisterId);
28
+ if (!fs.existsSync(canisterDir)) {
29
+ fs.mkdirSync(canisterDir, { recursive: true });
30
+ }
31
+ return canisterDir;
32
+ }
33
+ /**
34
+ * Get log file path for a canister and date
35
+ */
36
+ function getLogFilePath(canisterId, date) {
37
+ const logsDir = getCanisterLogsDir(canisterId);
38
+ const logDate = date || new Date();
39
+ const dateStr = logDate.toISOString().split('T')[0];
40
+ return path.join(logsDir, `${dateStr}.jsonl`);
41
+ }
42
+ /**
43
+ * Parse log line from canister output
44
+ */
45
+ function parseLogLine(line, canisterId) {
46
+ try {
47
+ const parsed = JSON.parse(line);
48
+ return {
49
+ timestamp: new Date(parsed.timestamp),
50
+ level: parsed.level || 'info',
51
+ message: parsed.message || '',
52
+ canisterId,
53
+ method: parsed.method,
54
+ context: parsed.context,
55
+ };
56
+ }
57
+ catch {
58
+ return null;
59
+ }
60
+ }
61
+ /**
62
+ * Collect logs from canister output
63
+ */
64
+ export async function collectLogs(canisterId, output) {
65
+ const logs = [];
66
+ const lines = output.split('\n');
67
+ for (const line of lines) {
68
+ if (line.trim()) {
69
+ const logEntry = parseLogLine(line, canisterId);
70
+ if (logEntry) {
71
+ logs.push(logEntry);
72
+ }
73
+ }
74
+ }
75
+ return logs;
76
+ }
77
+ /**
78
+ * Store log entries to disk
79
+ */
80
+ export async function storeLogs(canisterId, logs) {
81
+ const logFilePath = getLogFilePath(canisterId);
82
+ const lines = logs.map((log) => JSON.stringify(log)).join('\n');
83
+ fs.appendFileSync(logFilePath, lines + '\n', 'utf8');
84
+ }
85
+ /**
86
+ * Retrieve logs for a canister with optional filtering
87
+ */
88
+ export async function getLogs(canisterId, options = {}) {
89
+ const logsDir = getCanisterLogsDir(canisterId);
90
+ const files = fs.readdirSync(logsDir)
91
+ .filter((f) => f.endsWith('.jsonl'))
92
+ .sort()
93
+ .reverse();
94
+ const allLogs = [];
95
+ for (const file of files) {
96
+ const filePath = path.join(logsDir, file);
97
+ const content = fs.readFileSync(filePath, 'utf8');
98
+ const lines = content.split('\n');
99
+ for (const line of lines) {
100
+ if (line.trim()) {
101
+ const log = parseLogLine(line, canisterId);
102
+ if (log) {
103
+ allLogs.push(log);
104
+ }
105
+ }
106
+ }
107
+ if (options.since) {
108
+ const fileDate = new Date(file.replace('.jsonl', ''));
109
+ if (fileDate < options.since) {
110
+ break;
111
+ }
112
+ }
113
+ }
114
+ const filteredLogs = allLogs.filter((log) => {
115
+ if (options.since && log.timestamp < options.since) {
116
+ return false;
117
+ }
118
+ if (options.level && log.level !== options.level) {
119
+ return false;
120
+ }
121
+ if (options.pattern && !log.message.includes(options.pattern)) {
122
+ return false;
123
+ }
124
+ return true;
125
+ });
126
+ if (options.limit) {
127
+ return filteredLogs.slice(-options.limit);
128
+ }
129
+ return filteredLogs.sort((a, b) => a.timestamp.getTime() - b.timestamp.getTime());
130
+ }
131
+ /**
132
+ * Export logs to a file
133
+ */
134
+ export async function exportLogs(canisterId, outputPath, format = 'json') {
135
+ const logs = await getLogs(canisterId);
136
+ if (format === 'json') {
137
+ fs.writeFileSync(outputPath, JSON.stringify(logs, null, 2), 'utf8');
138
+ }
139
+ else if (format === 'csv') {
140
+ const headers = 'timestamp,level,message,canisterId,method,context\n';
141
+ const rows = logs.map((log) => {
142
+ const context = log.context ? JSON.stringify(log.context).replace(/"/g, '""') : '';
143
+ return `"${log.timestamp.toISOString()}","${log.level}","${log.message.replace(/"/g, '""')}","${log.canisterId}","${log.method || ''}","${context}"`;
144
+ }).join('\n');
145
+ fs.writeFileSync(outputPath, headers + rows, 'utf8');
146
+ }
147
+ }
148
+ /**
149
+ * Clear logs for a canister
150
+ */
151
+ export async function clearLogs(canisterId) {
152
+ const logsDir = getCanisterLogsDir(canisterId);
153
+ const files = fs.readdirSync(logsDir);
154
+ for (const file of files) {
155
+ fs.unlinkSync(path.join(logsDir, file));
156
+ }
157
+ }
158
+ //# sourceMappingURL=logs.js.map
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Types for debugging and instrumentation functionality
3
+ */
4
+ /** Log level */
5
+ export type LogLevel = 'info' | 'warning' | 'error' | 'debug';
6
+ /** Log entry from canister or system */
7
+ export interface LogEntry {
8
+ /** Log timestamp */
9
+ timestamp: Date;
10
+ /** Log level */
11
+ level: LogLevel;
12
+ /** Log message */
13
+ message: string;
14
+ /** Source canister ID */
15
+ canisterId: string;
16
+ /** Method that generated the log (if applicable) */
17
+ method?: string;
18
+ /** Additional context */
19
+ context?: Record<string, unknown>;
20
+ }
21
+ /** Trace filter options */
22
+ export interface TraceFilter {
23
+ /** Filter by method name */
24
+ method?: string;
25
+ /** Minimum duration in milliseconds */
26
+ minDuration?: number;
27
+ /** Maximum depth of the call tree */
28
+ maxDepth?: number;
29
+ /** Filter by caller principal */
30
+ caller?: string;
31
+ }
32
+ /** Method statistics for profiling */
33
+ export interface MethodStats {
34
+ /** Number of calls */
35
+ count: number;
36
+ /** Total duration in milliseconds */
37
+ totalDuration: number;
38
+ /** Average duration in milliseconds */
39
+ avgDuration: number;
40
+ /** Maximum duration in milliseconds */
41
+ maxDuration: number;
42
+ }
43
+ /** Result of profiling a canister */
44
+ export interface ProfileResult {
45
+ /** Number of samples collected */
46
+ samples: number;
47
+ /** Duration of profiling in seconds */
48
+ duration: number;
49
+ /** Statistics per method */
50
+ methodStats: Map<string, MethodStats>;
51
+ /** Memory snapshots taken during profiling */
52
+ memorySnapshots: number[];
53
+ }
54
+ /** Instrument result */
55
+ export interface InstrumentResult {
56
+ /** Whether instrumentation succeeded */
57
+ success: boolean;
58
+ /** Path to instrumented WASM */
59
+ outputPath: string;
60
+ /** Any warnings from instrumentation */
61
+ warnings: string[];
62
+ }
63
+ /** Trace export format */
64
+ export type TraceExportFormat = 'json' | 'flamegraph' | 'text';
65
+ /** Dashboard metric types */
66
+ export interface DashboardMetrics {
67
+ /** Current cycles balance */
68
+ cycles: bigint;
69
+ /** Memory usage in bytes */
70
+ memory: bigint;
71
+ /** Requests per second */
72
+ requestRate: number;
73
+ /** Error rate */
74
+ errorRate: number;
75
+ }
76
+ /** Alert severity levels */
77
+ export type AlertSeverity = 'info' | 'warning' | 'error' | 'critical';
78
+ /** Alert entry */
79
+ export interface AlertEntry {
80
+ /** Alert timestamp */
81
+ timestamp: Date;
82
+ /** Alert severity */
83
+ severity: AlertSeverity;
84
+ /** Alert message */
85
+ message: string;
86
+ /** Related canister ID */
87
+ canisterId: string;
88
+ /** Alert type/category */
89
+ type: string;
90
+ }
91
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Types for debugging and instrumentation functionality
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Agent Deployer
3
+ *
4
+ * Main orchestrator for the ICP canister deployment pipeline.
5
+ * Coordinates validation, client setup, and deployment operations.
6
+ */
7
+ import type { DeployOptions, DeployResult, DeploymentError, NetworkType, DeploymentStatus } from './types.js';
8
+ /**
9
+ * Validate deployment options
10
+ */
11
+ export declare function validateDeployOptions(options: DeployOptions): {
12
+ valid: boolean;
13
+ errors: DeploymentError[];
14
+ warnings: string[];
15
+ };
16
+ /**
17
+ * Get deployment preview/summary
18
+ *
19
+ * Useful for dry-run functionality
20
+ */
21
+ export declare function getDeploySummary(options: DeployOptions): {
22
+ agentName: string;
23
+ wasmPath: string;
24
+ wasmHash: string;
25
+ wasmSize: number;
26
+ network: NetworkType;
27
+ isUpgrade: boolean;
28
+ canisterId?: string;
29
+ validation: ReturnType<typeof validateDeployOptions>;
30
+ };
31
+ /**
32
+ * Deploy an agent to ICP
33
+ *
34
+ * This is the main entry point for the deployment pipeline.
35
+ * Uses auto-detection to choose between icp-cli and the @dfinity/agent SDK.
36
+ *
37
+ * Priority: icp-cli > @dfinity/agent SDK (with dfx fallback)
38
+ *
39
+ * @param options - Deployment options
40
+ * @returns Deployment result with canister info
41
+ */
42
+ export declare function deployAgent(options: DeployOptions): Promise<DeployResult>;
43
+ /**
44
+ * Check if a canister exists and get its status
45
+ */
46
+ export declare function getCanisterStatus(canisterId: string, network: NetworkType): Promise<{
47
+ exists: boolean;
48
+ status?: DeploymentStatus;
49
+ memorySize?: bigint;
50
+ cycles?: bigint;
51
+ }>;
52
+ //# sourceMappingURL=deployer.d.ts.map