agentvault 1.0.1 → 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.
- package/.claude/settings.local.json +9 -0
- package/dist/cli/commands/approve.js +5 -5
- package/dist/cli/commands/archive.js +5 -5
- package/dist/cli/commands/backup.js +5 -5
- package/dist/cli/commands/cloud-backup.js +12 -12
- package/dist/cli/commands/decrypt.js +2 -2
- package/dist/cli/commands/deploy.js +1 -1
- package/dist/cli/commands/exec.js +2 -2
- package/dist/cli/commands/fetch.js +4 -4
- package/dist/cli/commands/inference.js +5 -5
- package/dist/cli/commands/init.d.ts +1 -1
- package/dist/cli/commands/init.js +16 -16
- package/dist/cli/commands/list.js +4 -4
- package/dist/cli/commands/package.js +2 -2
- package/dist/cli/commands/profile.js +1 -1
- package/dist/cli/commands/rebuild.js +2 -2
- package/dist/cli/commands/show.js +1 -1
- package/dist/cli/commands/status.d.ts +1 -1
- package/dist/cli/commands/status.js +8 -8
- package/dist/cli/commands/trace.js +1 -1
- package/dist/cli/commands/wallet-export.js +1 -1
- package/dist/cli/commands/wallet-sign.js +1 -1
- package/dist/cli/commands/wallet.d.ts +1 -1
- package/dist/cli/commands/wallet.js +1 -1
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.js +3 -3
- package/dist/src/archival/archive-manager.d.ts +85 -0
- package/dist/src/archival/archive-manager.js +294 -0
- package/dist/src/archival/arweave-client.d.ts +88 -0
- package/dist/src/archival/arweave-client.js +223 -0
- package/dist/src/archival/index.d.ts +8 -0
- package/{src/archival/index.ts → dist/src/archival/index.js} +1 -1
- package/dist/src/backup/backup.d.ts +67 -0
- package/dist/src/backup/backup.js +231 -0
- package/dist/src/backup/index.d.ts +7 -0
- package/{src/backup/index.ts → dist/src/backup/index.js} +1 -1
- package/dist/src/cloud-storage/cloud-sync.d.ts +49 -0
- package/dist/src/cloud-storage/cloud-sync.js +372 -0
- package/dist/src/cloud-storage/index.d.ts +11 -0
- package/{src/cloud-storage/index.ts → dist/src/cloud-storage/index.js} +1 -1
- package/dist/src/cloud-storage/provider-detector.d.ts +34 -0
- package/dist/src/cloud-storage/provider-detector.js +158 -0
- package/{src/cloud-storage/types.ts → dist/src/cloud-storage/types.d.ts} +40 -53
- package/dist/src/cloud-storage/types.js +10 -0
- package/dist/src/debugging/index.d.ts +6 -0
- package/{src/debugging/index.ts → dist/src/debugging/index.js} +1 -1
- package/dist/src/debugging/logs.d.ts +32 -0
- package/dist/src/debugging/logs.js +158 -0
- package/dist/src/debugging/types.d.ts +91 -0
- package/dist/src/debugging/types.js +5 -0
- package/dist/src/deployment/deployer.d.ts +52 -0
- package/dist/src/deployment/deployer.js +211 -0
- package/dist/src/deployment/icpClient.d.ts +144 -0
- package/dist/src/deployment/icpClient.js +545 -0
- package/dist/src/deployment/index.d.ts +11 -0
- package/dist/src/deployment/index.js +14 -0
- package/dist/src/deployment/promotion.d.ts +32 -0
- package/dist/src/deployment/promotion.js +114 -0
- package/dist/src/deployment/types.d.ts +101 -0
- package/dist/src/deployment/types.js +5 -0
- package/dist/src/icp/batch.d.ts +112 -0
- package/dist/src/icp/batch.js +273 -0
- package/dist/src/icp/cycles.d.ts +29 -0
- package/{src/icp/cycles.ts → dist/src/icp/cycles.js} +8 -22
- package/dist/src/icp/environment.d.ts +60 -0
- package/dist/src/icp/environment.js +183 -0
- package/dist/src/icp/icpcli.d.ts +204 -0
- package/dist/src/icp/icpcli.js +374 -0
- package/dist/src/icp/icwasm.d.ts +94 -0
- package/dist/src/icp/icwasm.js +197 -0
- package/dist/src/icp/identity.d.ts +50 -0
- package/{src/icp/identity.ts → dist/src/icp/identity.js} +15 -28
- package/dist/src/icp/index.d.ts +16 -0
- package/dist/src/icp/index.js +20 -0
- package/dist/src/icp/optimization.d.ts +16 -0
- package/dist/src/icp/optimization.js +225 -0
- package/dist/src/icp/tokens.d.ts +24 -0
- package/{src/icp/tokens.ts → dist/src/icp/tokens.js} +5 -12
- package/dist/src/icp/tool-detector.d.ts +31 -0
- package/dist/src/icp/tool-detector.js +104 -0
- package/dist/src/icp/types.d.ts +493 -0
- package/dist/src/icp/types.js +7 -0
- package/dist/src/index.d.ts +12 -0
- package/dist/src/index.js +18 -0
- package/dist/src/inference/bittensor-client.d.ts +108 -0
- package/dist/src/inference/bittensor-client.js +224 -0
- package/dist/src/inference/index.d.ts +8 -0
- package/{src/inference/index.ts → dist/src/inference/index.js} +1 -1
- package/dist/src/inference/inference-manager.d.ts +76 -0
- package/dist/src/inference/inference-manager.js +228 -0
- package/dist/src/metrics/index.d.ts +7 -0
- package/{src/metrics/index.ts → dist/src/metrics/index.js} +1 -1
- package/dist/src/metrics/metrics.d.ts +39 -0
- package/dist/src/metrics/metrics.js +129 -0
- package/dist/src/monitoring/alerting.d.ts +51 -0
- package/dist/src/monitoring/alerting.js +169 -0
- package/dist/src/monitoring/health.d.ts +40 -0
- package/dist/src/monitoring/health.js +164 -0
- package/dist/src/monitoring/index.d.ts +10 -0
- package/dist/src/monitoring/index.js +12 -0
- package/dist/src/monitoring/info.d.ts +15 -0
- package/dist/src/monitoring/info.js +109 -0
- package/dist/src/monitoring/types.d.ts +93 -0
- package/dist/src/monitoring/types.js +7 -0
- package/dist/src/network/index.d.ts +5 -0
- package/{src/network/index.ts → dist/src/network/index.js} +1 -1
- package/dist/src/network/network-config.d.ts +31 -0
- package/dist/src/network/network-config.js +109 -0
- package/dist/src/packaging/compiler.d.ts +61 -0
- package/dist/src/packaging/compiler.js +562 -0
- package/dist/src/packaging/config-persistence.d.ts +46 -0
- package/dist/src/packaging/config-persistence.js +108 -0
- package/dist/src/packaging/config-schemas.d.ts +115 -0
- package/dist/src/packaging/config-schemas.js +43 -0
- package/dist/src/packaging/detector.d.ts +26 -0
- package/dist/src/packaging/detector.js +193 -0
- package/dist/src/packaging/index.d.ts +16 -0
- package/dist/src/packaging/index.js +22 -0
- package/dist/src/packaging/packager.d.ts +31 -0
- package/dist/src/packaging/packager.js +90 -0
- package/dist/src/packaging/parsers/clawdbot.d.ts +19 -0
- package/dist/src/packaging/parsers/clawdbot.js +231 -0
- package/dist/src/packaging/parsers/cline.d.ts +26 -0
- package/dist/src/packaging/parsers/cline.js +185 -0
- package/dist/src/packaging/parsers/generic.d.ts +27 -0
- package/dist/src/packaging/parsers/generic.js +228 -0
- package/dist/src/packaging/parsers/goose.d.ts +26 -0
- package/dist/src/packaging/parsers/goose.js +175 -0
- package/dist/src/packaging/parsers/index.d.ts +11 -0
- package/{src/packaging/parsers/index.ts → dist/src/packaging/parsers/index.js} +1 -1
- package/dist/src/packaging/serializer.d.ts +108 -0
- package/dist/src/packaging/serializer.js +153 -0
- package/dist/src/packaging/types.d.ts +131 -0
- package/dist/src/packaging/types.js +5 -0
- package/dist/src/packaging/wasmedge-compiler.d.ts +76 -0
- package/dist/src/packaging/wasmedge-compiler.js +349 -0
- package/dist/src/security/index.d.ts +11 -0
- package/{src/security/index.ts → dist/src/security/index.js} +1 -4
- package/dist/src/security/multisig.d.ts +102 -0
- package/dist/src/security/multisig.js +283 -0
- package/dist/src/security/types.d.ts +207 -0
- package/dist/src/security/types.js +217 -0
- package/dist/src/security/vetkeys.d.ts +179 -0
- package/dist/src/security/vetkeys.js +499 -0
- package/dist/src/testing/index.d.ts +6 -0
- package/{src/testing/index.ts → dist/src/testing/index.js} +1 -1
- package/dist/src/testing/local-runner.d.ts +23 -0
- package/dist/src/testing/local-runner.js +226 -0
- package/dist/src/testing/types.d.ts +98 -0
- package/dist/src/testing/types.js +5 -0
- package/dist/src/wallet/cbor-serializer.d.ts +82 -0
- package/dist/src/wallet/cbor-serializer.js +282 -0
- package/dist/src/wallet/chain-dispatcher.d.ts +112 -0
- package/dist/src/wallet/chain-dispatcher.js +241 -0
- package/dist/src/wallet/cross-chain-aggregator.d.ts +119 -0
- package/dist/src/wallet/cross-chain-aggregator.js +235 -0
- package/dist/src/wallet/index.d.ts +16 -0
- package/dist/src/wallet/index.js +22 -0
- package/dist/src/wallet/key-derivation.d.ts +117 -0
- package/dist/src/wallet/key-derivation.js +325 -0
- package/dist/src/wallet/providers/base-provider.d.ts +111 -0
- package/dist/src/wallet/providers/base-provider.js +58 -0
- package/dist/src/wallet/providers/cketh-provider.d.ts +104 -0
- package/dist/src/wallet/providers/cketh-provider.js +343 -0
- package/dist/src/wallet/providers/polkadot-provider.d.ts +115 -0
- package/dist/src/wallet/providers/polkadot-provider.js +407 -0
- package/dist/src/wallet/providers/solana-provider.d.ts +102 -0
- package/dist/src/wallet/providers/solana-provider.js +393 -0
- package/dist/src/wallet/transaction-queue.d.ts +133 -0
- package/dist/src/wallet/transaction-queue.js +195 -0
- package/dist/src/wallet/types.d.ts +167 -0
- package/dist/src/wallet/types.js +5 -0
- package/dist/src/wallet/vetkeys-adapter.d.ts +134 -0
- package/dist/src/wallet/vetkeys-adapter.js +313 -0
- package/dist/src/wallet/wallet-manager.d.ts +202 -0
- package/dist/src/wallet/wallet-manager.js +451 -0
- package/dist/src/wallet/wallet-storage.d.ts +131 -0
- package/dist/src/wallet/wallet-storage.js +274 -0
- package/macos-wallet-app/AgentVaultWallet/App/AgentVaultWalletApp.swift +54 -0
- package/macos-wallet-app/AgentVaultWallet/Models/AppState.swift +102 -0
- package/macos-wallet-app/AgentVaultWallet/Models/Chain.swift +121 -0
- package/macos-wallet-app/AgentVaultWallet/Models/Wallet.swift +98 -0
- package/macos-wallet-app/AgentVaultWallet/Resources/AgentVaultWallet.entitlements +27 -0
- package/macos-wallet-app/AgentVaultWallet/Resources/Info.plist +69 -0
- package/macos-wallet-app/AgentVaultWallet/Services/BackupService.swift +270 -0
- package/macos-wallet-app/AgentVaultWallet/Services/CLIBridge.swift +367 -0
- package/macos-wallet-app/AgentVaultWallet/Services/CryptoService.swift +157 -0
- package/macos-wallet-app/AgentVaultWallet/Services/FileService.swift +120 -0
- package/macos-wallet-app/AgentVaultWallet/Services/KeychainService.swift +219 -0
- package/macos-wallet-app/AgentVaultWallet/Utilities/Constants.swift +44 -0
- package/macos-wallet-app/AgentVaultWallet/Utilities/Extensions.swift +115 -0
- package/macos-wallet-app/AgentVaultWallet/ViewModels/BackupViewModel.swift +237 -0
- package/macos-wallet-app/AgentVaultWallet/ViewModels/CreateWalletViewModel.swift +137 -0
- package/macos-wallet-app/AgentVaultWallet/ViewModels/ImportWalletViewModel.swift +179 -0
- package/macos-wallet-app/AgentVaultWallet/ViewModels/WalletStore.swift +286 -0
- package/macos-wallet-app/AgentVaultWallet/Views/Backup/BackupView.swift +235 -0
- package/macos-wallet-app/AgentVaultWallet/Views/Backup/RestoreView.swift +316 -0
- package/macos-wallet-app/AgentVaultWallet/Views/Create/CreateWalletFlow.swift +438 -0
- package/macos-wallet-app/AgentVaultWallet/Views/Import/ImportWalletFlow.swift +399 -0
- package/macos-wallet-app/AgentVaultWallet/Views/MainView.swift +134 -0
- package/macos-wallet-app/AgentVaultWallet/Views/Settings/SettingsView.swift +276 -0
- package/macos-wallet-app/AgentVaultWallet/Views/Sidebar/SidebarView.swift +133 -0
- package/macos-wallet-app/AgentVaultWallet/Views/Wallet/DashboardView.swift +233 -0
- package/macos-wallet-app/AgentVaultWallet/Views/Wallet/WalletDetailView.swift +281 -0
- package/macos-wallet-app/AgentVaultWallet/Views/Wallet/WalletListView.swift +280 -0
- package/macos-wallet-app/AgentVaultWallet/Views/Welcome/WelcomeView.swift +176 -0
- package/macos-wallet-app/Makefile +47 -0
- package/macos-wallet-app/project.yml +40 -0
- package/macos-wallet-app/setup.sh +73 -0
- package/package.json +10 -2
- package/backups/agentvault-backup-test-agent-2026-02-12T17-54-28-967Z.json +0 -28
- package/backups/agentvault-backup-test-agent-2026-02-12T17-54-29-032Z.backup +0 -1
- package/backups/agentvault-backup-test-agent-2026-02-12T17-57-42-373Z.json +0 -28
- package/backups/agentvault-backup-test-agent-2026-02-12T17-57-42-428Z.backup +0 -1
- package/backups/agentvault-backup-test-agent-2026-02-12T18-52-25-132Z.json +0 -28
- package/backups/agentvault-backup-test-agent-2026-02-12T18-52-25-247Z.backup +0 -1
- package/backups/agentvault-backup-test-agent-2026-02-12T18-54-09-216Z.json +0 -28
- package/backups/agentvault-backup-test-agent-2026-02-12T18-54-09-283Z.backup +0 -1
- package/backups/agentvault-backup-test-agent-2026-02-12T22-18-22-772Z.backup +0 -1
- package/backups/agentvault-backup-test-agent-2026-02-12T22-18-22-793Z.json +0 -28
- package/backups/test-backup.json +0 -28
- package/scripts/dev-dashboard.mjs +0 -84
- package/site/README.md +0 -63
- package/site/docusaurus.config.ts +0 -148
- package/site/package-lock.json +0 -18383
- package/site/package.json +0 -47
- package/site/sidebars.ts +0 -86
- package/site/static/.gitkeep +0 -0
- package/site/static/img/logo.svg +0 -28
- package/site/static/img/og-image.svg +0 -35
- package/src/archival/archive-manager.ts +0 -372
- package/src/archival/arweave-client.ts +0 -289
- package/src/backup/backup.ts +0 -315
- package/src/cloud-storage/cloud-sync.ts +0 -461
- package/src/cloud-storage/provider-detector.ts +0 -198
- package/src/debugging/logs.ts +0 -193
- package/src/debugging/types.ts +0 -100
- package/src/deployment/deployer.ts +0 -274
- package/src/deployment/icpClient.ts +0 -620
- package/src/deployment/index.ts +0 -46
- package/src/deployment/promotion.ts +0 -161
- package/src/deployment/types.ts +0 -111
- package/src/icp/batch.ts +0 -374
- package/src/icp/environment.ts +0 -215
- package/src/icp/icpcli.ts +0 -438
- package/src/icp/icwasm.ts +0 -222
- package/src/icp/index.ts +0 -94
- package/src/icp/optimization.ts +0 -242
- package/src/icp/tool-detector.ts +0 -110
- package/src/icp/types.ts +0 -574
- package/src/index.ts +0 -25
- package/src/inference/bittensor-client.ts +0 -304
- package/src/inference/inference-manager.ts +0 -327
- package/src/metrics/metrics.ts +0 -186
- package/src/monitoring/alerting.ts +0 -190
- package/src/monitoring/health.ts +0 -197
- package/src/monitoring/index.ts +0 -38
- package/src/monitoring/info.ts +0 -114
- package/src/monitoring/types.ts +0 -99
- package/src/network/network-config.ts +0 -129
- package/src/packaging/compiler.ts +0 -647
- package/src/packaging/config-persistence.ts +0 -135
- package/src/packaging/config-schemas.ts +0 -156
- package/src/packaging/detector.ts +0 -220
- package/src/packaging/index.ts +0 -90
- package/src/packaging/packager.ts +0 -118
- package/src/packaging/parsers/clawdbot.ts +0 -278
- package/src/packaging/parsers/cline.ts +0 -223
- package/src/packaging/parsers/generic.ts +0 -266
- package/src/packaging/parsers/goose.ts +0 -214
- package/src/packaging/serializer.ts +0 -260
- package/src/packaging/types.ts +0 -144
- package/src/packaging/wasmedge-compiler.ts +0 -406
- package/src/security/multisig.ts +0 -415
- package/src/security/types.ts +0 -416
- package/src/security/vetkeys.ts +0 -655
- package/src/testing/local-runner.ts +0 -264
- package/src/testing/types.ts +0 -104
- package/src/wallet/cbor-serializer.ts +0 -323
- package/src/wallet/chain-dispatcher.ts +0 -313
- package/src/wallet/cross-chain-aggregator.ts +0 -346
- package/src/wallet/index.ts +0 -76
- package/src/wallet/key-derivation.ts +0 -425
- package/src/wallet/providers/base-provider.ts +0 -154
- package/src/wallet/providers/cketh-provider.ts +0 -434
- package/src/wallet/providers/polkadot-provider.ts +0 -503
- package/src/wallet/providers/solana-provider.ts +0 -490
- package/src/wallet/transaction-queue.ts +0 -284
- package/src/wallet/types.ts +0 -178
- package/src/wallet/vetkeys-adapter.ts +0 -431
- package/src/wallet/wallet-manager.ts +0 -597
- 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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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,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,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
|