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.
- package/.claude/settings.local.json +9 -0
- package/README.md +1 -1
- 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
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Goose Configuration Parser
|
|
3
|
+
*
|
|
4
|
+
* Parses Goose agent configuration from YAML files.
|
|
5
|
+
* Reads goose.yaml, goose.yml, or .gooserc files and constructs configuration object.
|
|
6
|
+
*/
|
|
7
|
+
import type { GooseConfig } from '../config-schemas.js';
|
|
8
|
+
/**
|
|
9
|
+
* Parse Goose agent configuration
|
|
10
|
+
*
|
|
11
|
+
* This function reads goose.yaml, goose.yml, or .gooserc file
|
|
12
|
+
* and returns a fully validated configuration object.
|
|
13
|
+
*
|
|
14
|
+
* @param sourcePath - Path to agent source directory
|
|
15
|
+
* @param verbose - Enable verbose logging
|
|
16
|
+
* @returns Parsed and validated Goose configuration
|
|
17
|
+
*/
|
|
18
|
+
export declare function parseGooseConfig(sourcePath: string, verbose?: boolean): Promise<GooseConfig>;
|
|
19
|
+
/**
|
|
20
|
+
* Find all Goose configurations in a directory tree
|
|
21
|
+
*
|
|
22
|
+
* @param rootPath - Root directory to search
|
|
23
|
+
* @returns Array of paths to Goose configuration files
|
|
24
|
+
*/
|
|
25
|
+
export declare function findGooseConfigs(rootPath: string): string[];
|
|
26
|
+
//# sourceMappingURL=goose.d.ts.map
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Goose Configuration Parser
|
|
3
|
+
*
|
|
4
|
+
* Parses Goose agent configuration from YAML files.
|
|
5
|
+
* Reads goose.yaml, goose.yml, or .gooserc files and constructs configuration object.
|
|
6
|
+
*/
|
|
7
|
+
import * as fs from 'node:fs';
|
|
8
|
+
import * as path from 'node:path';
|
|
9
|
+
import * as yaml from 'yaml';
|
|
10
|
+
import { DEFAULT_GOOSE_CONFIG, } from '../config-schemas.js';
|
|
11
|
+
/**
|
|
12
|
+
* Find Goose configuration file
|
|
13
|
+
*/
|
|
14
|
+
function findGooseConfig(sourcePath) {
|
|
15
|
+
const absolutePath = path.resolve(sourcePath);
|
|
16
|
+
const configFiles = ['goose.yaml', 'goose.yml', '.gooserc'];
|
|
17
|
+
for (const file of configFiles) {
|
|
18
|
+
const filePath = path.join(absolutePath, file);
|
|
19
|
+
if (fs.existsSync(filePath)) {
|
|
20
|
+
return {
|
|
21
|
+
path: filePath,
|
|
22
|
+
type: 'yaml',
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Validate Goose configuration
|
|
30
|
+
*/
|
|
31
|
+
function validateGooseConfig(config) {
|
|
32
|
+
const errors = [];
|
|
33
|
+
const warnings = [];
|
|
34
|
+
// Validate name
|
|
35
|
+
if (!config.name || config.name.trim() === '') {
|
|
36
|
+
errors.push('Agent name is required');
|
|
37
|
+
}
|
|
38
|
+
// Validate model (required for Goose)
|
|
39
|
+
if (!config.model || config.model.trim() === '') {
|
|
40
|
+
errors.push('Model is required for Goose agent');
|
|
41
|
+
}
|
|
42
|
+
// Validate version format
|
|
43
|
+
if (config.version) {
|
|
44
|
+
const versionRegex = /^\d+\.\d+\.\d+$/;
|
|
45
|
+
if (!versionRegex.test(config.version)) {
|
|
46
|
+
errors.push(`Invalid version format: ${config.version}. Expected: X.Y.Z`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
// Validate temperature (must be between 0 and 2)
|
|
50
|
+
if (config.temperature !== undefined) {
|
|
51
|
+
if (config.temperature < 0 || config.temperature > 2) {
|
|
52
|
+
errors.push(`Temperature must be between 0 and 2, got: ${config.temperature}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
// Validate maxTokens (must be positive)
|
|
56
|
+
if (config.maxTokens !== undefined) {
|
|
57
|
+
if (config.maxTokens <= 0) {
|
|
58
|
+
errors.push(`maxTokens must be positive, got: ${config.maxTokens}`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
// Validate working directory exists (if specified)
|
|
62
|
+
if (config.workingDirectory) {
|
|
63
|
+
const workingDirPath = path.resolve(process.cwd(), config.workingDirectory);
|
|
64
|
+
if (!fs.existsSync(workingDirPath)) {
|
|
65
|
+
warnings.push(`Working directory does not exist: ${config.workingDirectory}`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
// Warn if no tools defined
|
|
69
|
+
if (!config.tools || config.tools.length === 0) {
|
|
70
|
+
warnings.push('No tools defined in configuration');
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
valid: errors.length === 0,
|
|
74
|
+
errors,
|
|
75
|
+
warnings,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Parse Goose agent configuration
|
|
80
|
+
*
|
|
81
|
+
* This function reads goose.yaml, goose.yml, or .gooserc file
|
|
82
|
+
* and returns a fully validated configuration object.
|
|
83
|
+
*
|
|
84
|
+
* @param sourcePath - Path to agent source directory
|
|
85
|
+
* @param verbose - Enable verbose logging
|
|
86
|
+
* @returns Parsed and validated Goose configuration
|
|
87
|
+
*/
|
|
88
|
+
export async function parseGooseConfig(sourcePath, verbose = false) {
|
|
89
|
+
if (verbose) {
|
|
90
|
+
console.log(`[Goose] Parsing configuration from: ${sourcePath}`);
|
|
91
|
+
}
|
|
92
|
+
const configLocation = findGooseConfig(sourcePath);
|
|
93
|
+
if (configLocation === null) {
|
|
94
|
+
throw new Error('No Goose configuration found. ' +
|
|
95
|
+
'Expected goose.yaml, goose.yml, or .gooserc file in the agent source path.');
|
|
96
|
+
}
|
|
97
|
+
if (verbose) {
|
|
98
|
+
console.log(`[Goose] Found YAML config: ${configLocation.path}`);
|
|
99
|
+
}
|
|
100
|
+
let config;
|
|
101
|
+
try {
|
|
102
|
+
const content = fs.readFileSync(configLocation.path, 'utf-8');
|
|
103
|
+
const parsed = yaml.parse(content);
|
|
104
|
+
// Merge with defaults
|
|
105
|
+
config = {
|
|
106
|
+
type: 'goose',
|
|
107
|
+
name: parsed.name || DEFAULT_GOOSE_CONFIG.name,
|
|
108
|
+
version: parsed.version || DEFAULT_GOOSE_CONFIG.version,
|
|
109
|
+
description: parsed.description || DEFAULT_GOOSE_CONFIG.description,
|
|
110
|
+
model: parsed.model || DEFAULT_GOOSE_CONFIG.model,
|
|
111
|
+
temperature: parsed.temperature !== undefined ? parsed.temperature : DEFAULT_GOOSE_CONFIG.temperature,
|
|
112
|
+
maxTokens: parsed.maxTokens !== undefined ? parsed.maxTokens : DEFAULT_GOOSE_CONFIG.maxTokens,
|
|
113
|
+
systemPrompt: parsed.systemPrompt || DEFAULT_GOOSE_CONFIG.systemPrompt,
|
|
114
|
+
tools: parsed.tools || DEFAULT_GOOSE_CONFIG.tools,
|
|
115
|
+
workingDirectory: parsed.workingDirectory || DEFAULT_GOOSE_CONFIG.workingDirectory,
|
|
116
|
+
};
|
|
117
|
+
if (verbose) {
|
|
118
|
+
console.log(`[Goose] Parsed name: ${config.name}`);
|
|
119
|
+
console.log(`[Goose] Parsed version: ${config.version}`);
|
|
120
|
+
console.log(`[Goose] Parsed model: ${config.model}`);
|
|
121
|
+
console.log(`[Goose] Parsed temperature: ${config.temperature}`);
|
|
122
|
+
console.log(`[Goose] Parsed maxTokens: ${config.maxTokens}`);
|
|
123
|
+
console.log(`[Goose] Parsed tools: ${config.tools?.length || 0}`);
|
|
124
|
+
console.log(`[Goose] Parsed workingDirectory: ${config.workingDirectory}`);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
129
|
+
throw new Error(`Failed to parse Goose config: ${message}`);
|
|
130
|
+
}
|
|
131
|
+
// Validate configuration
|
|
132
|
+
const validation = validateGooseConfig(config);
|
|
133
|
+
if (!validation.valid) {
|
|
134
|
+
const errorMessage = `Goose configuration validation failed:\n${validation.errors.map(e => ` - ${e}`).join('\n')}`;
|
|
135
|
+
throw new Error(errorMessage);
|
|
136
|
+
}
|
|
137
|
+
// Display warnings if verbose
|
|
138
|
+
if (verbose && validation.warnings.length > 0) {
|
|
139
|
+
console.log(`[Goose] Warnings:`);
|
|
140
|
+
for (const warning of validation.warnings) {
|
|
141
|
+
console.log(`[Goose] - ${warning}`);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return config;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Find all Goose configurations in a directory tree
|
|
148
|
+
*
|
|
149
|
+
* @param rootPath - Root directory to search
|
|
150
|
+
* @returns Array of paths to Goose configuration files
|
|
151
|
+
*/
|
|
152
|
+
export function findGooseConfigs(rootPath) {
|
|
153
|
+
const configs = [];
|
|
154
|
+
function searchDirectory(dirPath) {
|
|
155
|
+
const entries = fs.readdirSync(dirPath, { withFileTypes: true });
|
|
156
|
+
for (const entry of entries) {
|
|
157
|
+
const fullPath = path.join(dirPath, entry.name);
|
|
158
|
+
if (entry.isDirectory()) {
|
|
159
|
+
// Skip node_modules and .git
|
|
160
|
+
if (entry.name !== 'node_modules' && entry.name !== '.git') {
|
|
161
|
+
searchDirectory(fullPath);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
else if (entry.isFile()) {
|
|
165
|
+
// Check for Goose config files
|
|
166
|
+
if (entry.name === 'goose.yaml' || entry.name === 'goose.yml' || entry.name === '.gooserc') {
|
|
167
|
+
configs.push(fullPath);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
searchDirectory(rootPath);
|
|
173
|
+
return configs;
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=goose.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Parser Registry
|
|
3
|
+
*
|
|
4
|
+
* Central exports for all agent configuration parsers.
|
|
5
|
+
* Provides convenient imports for Clawdbot, Goose, Cline, and Generic agents.
|
|
6
|
+
*/
|
|
7
|
+
export { parseClawdbotConfig, findClawdbotConfigs } from './clawdbot.js';
|
|
8
|
+
export { parseGooseConfig, findGooseConfigs } from './goose.js';
|
|
9
|
+
export { parseClineConfig, findClineConfigs } from './cline.js';
|
|
10
|
+
export { parseGenericConfig, findGenericConfigs } from './generic.js';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* Central exports for all agent configuration parsers.
|
|
5
5
|
* Provides convenient imports for Clawdbot, Goose, Cline, and Generic agents.
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
7
|
export { parseClawdbotConfig, findClawdbotConfigs } from './clawdbot.js';
|
|
9
8
|
export { parseGooseConfig, findGooseConfigs } from './goose.js';
|
|
10
9
|
export { parseClineConfig, findClineConfigs } from './cline.js';
|
|
11
10
|
export { parseGenericConfig, findGenericConfigs } from './generic.js';
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent State Serializer
|
|
3
|
+
*
|
|
4
|
+
* This module handles serialization and deserialization of agent state
|
|
5
|
+
* for storage in canisters and local files.
|
|
6
|
+
*/
|
|
7
|
+
import type { AgentConfig } from './types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Agent state schema version
|
|
10
|
+
*/
|
|
11
|
+
export declare const SCHEMA_VERSION = "1.0.0";
|
|
12
|
+
/**
|
|
13
|
+
* Memory item in agent state
|
|
14
|
+
*/
|
|
15
|
+
export interface Memory {
|
|
16
|
+
id: string;
|
|
17
|
+
type: 'fact' | 'user_preference' | 'task_result';
|
|
18
|
+
content: unknown;
|
|
19
|
+
timestamp: number;
|
|
20
|
+
importance: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Task in agent queue
|
|
24
|
+
*/
|
|
25
|
+
export interface Task {
|
|
26
|
+
id: string;
|
|
27
|
+
description: string;
|
|
28
|
+
status: 'pending' | 'running' | 'completed' | 'failed';
|
|
29
|
+
result?: unknown;
|
|
30
|
+
timestamp: number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Agent state stored in canister
|
|
34
|
+
*/
|
|
35
|
+
export interface AgentState {
|
|
36
|
+
config: AgentConfig;
|
|
37
|
+
memories: Memory[];
|
|
38
|
+
tasks: Task[];
|
|
39
|
+
context: Map<string, unknown>;
|
|
40
|
+
version: string;
|
|
41
|
+
lastUpdated: number;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Serialized agent state (for storage/transmission)
|
|
45
|
+
*/
|
|
46
|
+
export interface SerializedAgentState {
|
|
47
|
+
$schema: string;
|
|
48
|
+
version: string;
|
|
49
|
+
agent: {
|
|
50
|
+
name: string;
|
|
51
|
+
type: string;
|
|
52
|
+
version?: string;
|
|
53
|
+
};
|
|
54
|
+
metadata: {
|
|
55
|
+
createdAt: string;
|
|
56
|
+
sourcePath: string;
|
|
57
|
+
entryPoint?: string;
|
|
58
|
+
};
|
|
59
|
+
state: {
|
|
60
|
+
initialized: boolean;
|
|
61
|
+
data: {
|
|
62
|
+
memories?: Memory[];
|
|
63
|
+
tasks?: Task[];
|
|
64
|
+
context?: Record<string, unknown>;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Serialization options
|
|
70
|
+
*/
|
|
71
|
+
export interface SerializationOptions {
|
|
72
|
+
pretty?: boolean;
|
|
73
|
+
includeMemories?: boolean;
|
|
74
|
+
includeTasks?: boolean;
|
|
75
|
+
includeContext?: boolean;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Serialize agent state to JSON
|
|
79
|
+
*/
|
|
80
|
+
export declare function serializeState(state: AgentState, options?: SerializationOptions): string;
|
|
81
|
+
/**
|
|
82
|
+
* Deserialize agent state from JSON
|
|
83
|
+
*/
|
|
84
|
+
export declare function deserializeState(json: string): AgentState;
|
|
85
|
+
/**
|
|
86
|
+
* Write serialized state to file
|
|
87
|
+
*/
|
|
88
|
+
export declare function writeStateFile(state: AgentState, filePath: string, options?: SerializationOptions): Promise<void>;
|
|
89
|
+
/**
|
|
90
|
+
* Read state from file
|
|
91
|
+
*/
|
|
92
|
+
export declare function readStateFile(filePath: string): Promise<AgentState>;
|
|
93
|
+
/**
|
|
94
|
+
* Create empty agent state
|
|
95
|
+
*/
|
|
96
|
+
export declare function createEmptyState(config: AgentConfig): AgentState;
|
|
97
|
+
/**
|
|
98
|
+
* Merge two agent states
|
|
99
|
+
*/
|
|
100
|
+
export declare function mergeStates(base: AgentState, updates: Partial<AgentState>): AgentState;
|
|
101
|
+
/**
|
|
102
|
+
* Validate serialized state
|
|
103
|
+
*/
|
|
104
|
+
export declare function validateState(serialized: SerializedAgentState): {
|
|
105
|
+
valid: boolean;
|
|
106
|
+
errors: string[];
|
|
107
|
+
};
|
|
108
|
+
//# sourceMappingURL=serializer.d.ts.map
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent State Serializer
|
|
3
|
+
*
|
|
4
|
+
* This module handles serialization and deserialization of agent state
|
|
5
|
+
* for storage in canisters and local files.
|
|
6
|
+
*/
|
|
7
|
+
import * as fs from 'node:fs';
|
|
8
|
+
import * as path from 'node:path';
|
|
9
|
+
/**
|
|
10
|
+
* Agent state schema version
|
|
11
|
+
*/
|
|
12
|
+
export const SCHEMA_VERSION = '1.0.0';
|
|
13
|
+
/**
|
|
14
|
+
* Default serialization options
|
|
15
|
+
*/
|
|
16
|
+
const DEFAULT_OPTIONS = {
|
|
17
|
+
pretty: true,
|
|
18
|
+
includeMemories: true,
|
|
19
|
+
includeTasks: true,
|
|
20
|
+
includeContext: true,
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Serialize agent state to JSON
|
|
24
|
+
*/
|
|
25
|
+
export function serializeState(state, options = {}) {
|
|
26
|
+
const opts = { ...DEFAULT_OPTIONS, ...options };
|
|
27
|
+
const serialized = {
|
|
28
|
+
$schema: `https://agentvault.dev/schemas/agent-state-v${SCHEMA_VERSION}.json`,
|
|
29
|
+
version: SCHEMA_VERSION,
|
|
30
|
+
agent: {
|
|
31
|
+
name: state.config.name,
|
|
32
|
+
type: state.config.type,
|
|
33
|
+
version: state.config.version,
|
|
34
|
+
},
|
|
35
|
+
metadata: {
|
|
36
|
+
createdAt: new Date().toISOString(),
|
|
37
|
+
sourcePath: state.config.sourcePath,
|
|
38
|
+
entryPoint: state.config.entryPoint,
|
|
39
|
+
},
|
|
40
|
+
state: {
|
|
41
|
+
initialized: state.memories.length > 0 || state.tasks.length > 0,
|
|
42
|
+
data: {},
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
if (opts.includeMemories) {
|
|
46
|
+
serialized.state.data.memories = state.memories;
|
|
47
|
+
}
|
|
48
|
+
if (opts.includeTasks) {
|
|
49
|
+
serialized.state.data.tasks = state.tasks;
|
|
50
|
+
}
|
|
51
|
+
if (opts.includeContext) {
|
|
52
|
+
serialized.state.data.context = mapToObject(state.context);
|
|
53
|
+
}
|
|
54
|
+
return JSON.stringify(serialized, null, opts.pretty ? 2 : 0);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Deserialize agent state from JSON
|
|
58
|
+
*/
|
|
59
|
+
export function deserializeState(json) {
|
|
60
|
+
const serialized = JSON.parse(json);
|
|
61
|
+
return {
|
|
62
|
+
config: {
|
|
63
|
+
name: serialized.agent.name,
|
|
64
|
+
type: serialized.agent.type,
|
|
65
|
+
sourcePath: serialized.metadata.sourcePath,
|
|
66
|
+
entryPoint: serialized.metadata.entryPoint,
|
|
67
|
+
version: serialized.agent.version,
|
|
68
|
+
},
|
|
69
|
+
memories: serialized.state.data.memories ?? [],
|
|
70
|
+
tasks: serialized.state.data.tasks ?? [],
|
|
71
|
+
context: new Map(Object.entries(serialized.state.data.context ?? {})),
|
|
72
|
+
version: serialized.version,
|
|
73
|
+
lastUpdated: Date.now(),
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Write serialized state to file
|
|
78
|
+
*/
|
|
79
|
+
export async function writeStateFile(state, filePath, options = {}) {
|
|
80
|
+
const serialized = serializeState(state, options);
|
|
81
|
+
// Ensure directory exists
|
|
82
|
+
const dir = path.dirname(filePath);
|
|
83
|
+
if (!fs.existsSync(dir)) {
|
|
84
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
85
|
+
}
|
|
86
|
+
// Write file
|
|
87
|
+
fs.writeFileSync(filePath, serialized, 'utf-8');
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Read state from file
|
|
91
|
+
*/
|
|
92
|
+
export async function readStateFile(filePath) {
|
|
93
|
+
const content = fs.readFileSync(filePath, 'utf-8');
|
|
94
|
+
return deserializeState(content);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Convert Map to plain object
|
|
98
|
+
*/
|
|
99
|
+
function mapToObject(map) {
|
|
100
|
+
const obj = {};
|
|
101
|
+
for (const [key, value] of map.entries()) {
|
|
102
|
+
obj[key] = value;
|
|
103
|
+
}
|
|
104
|
+
return obj;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Create empty agent state
|
|
108
|
+
*/
|
|
109
|
+
export function createEmptyState(config) {
|
|
110
|
+
return {
|
|
111
|
+
config,
|
|
112
|
+
memories: [],
|
|
113
|
+
tasks: [],
|
|
114
|
+
context: new Map(),
|
|
115
|
+
version: SCHEMA_VERSION,
|
|
116
|
+
lastUpdated: Date.now(),
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Merge two agent states
|
|
121
|
+
*/
|
|
122
|
+
export function mergeStates(base, updates) {
|
|
123
|
+
const merged = {
|
|
124
|
+
...base,
|
|
125
|
+
config: updates.config ?? base.config,
|
|
126
|
+
memories: updates.memories ?? base.memories,
|
|
127
|
+
tasks: updates.tasks ?? base.tasks,
|
|
128
|
+
context: updates.context ?? base.context,
|
|
129
|
+
version: updates.version ?? base.version,
|
|
130
|
+
lastUpdated: updates.lastUpdated ?? Date.now(),
|
|
131
|
+
};
|
|
132
|
+
return merged;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Validate serialized state
|
|
136
|
+
*/
|
|
137
|
+
export function validateState(serialized) {
|
|
138
|
+
const errors = [];
|
|
139
|
+
if (!serialized.agent?.name) {
|
|
140
|
+
errors.push('Missing agent name');
|
|
141
|
+
}
|
|
142
|
+
if (!serialized.agent?.type) {
|
|
143
|
+
errors.push('Missing agent type');
|
|
144
|
+
}
|
|
145
|
+
if (!serialized.version) {
|
|
146
|
+
errors.push('Missing version');
|
|
147
|
+
}
|
|
148
|
+
return {
|
|
149
|
+
valid: errors.length === 0,
|
|
150
|
+
errors,
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=serializer.js.map
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for agent packaging
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Supported agent types that can be packaged
|
|
6
|
+
*/
|
|
7
|
+
export type AgentType = 'clawdbot' | 'goose' | 'cline' | 'generic';
|
|
8
|
+
/**
|
|
9
|
+
* Agent configuration as detected from the source directory
|
|
10
|
+
*/
|
|
11
|
+
export interface AgentConfig {
|
|
12
|
+
/** Name of the agent */
|
|
13
|
+
name: string;
|
|
14
|
+
/** Detected agent type */
|
|
15
|
+
type: AgentType;
|
|
16
|
+
/** Source directory path */
|
|
17
|
+
sourcePath: string;
|
|
18
|
+
/** Entry point file (if detected) */
|
|
19
|
+
entryPoint?: string;
|
|
20
|
+
/** Agent version (if detected) */
|
|
21
|
+
version?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Options for the packaging process
|
|
25
|
+
*/
|
|
26
|
+
export interface PackageOptions {
|
|
27
|
+
/** Source directory containing the agent */
|
|
28
|
+
sourcePath: string;
|
|
29
|
+
/** Output directory for compiled artifacts */
|
|
30
|
+
outputPath?: string;
|
|
31
|
+
/** Force overwrite of existing output files */
|
|
32
|
+
force?: boolean;
|
|
33
|
+
/** Skip validation steps */
|
|
34
|
+
skipValidation?: boolean;
|
|
35
|
+
/** Compilation target (wasmedge for local, motoko for ICP) */
|
|
36
|
+
target?: 'wasmedge' | 'motoko' | 'pure-wasm';
|
|
37
|
+
/** Enable debugging features (source maps, verbose output) */
|
|
38
|
+
debug?: boolean;
|
|
39
|
+
/** Optimization level (0-3) */
|
|
40
|
+
optimize?: number;
|
|
41
|
+
/** Run ic-wasm optimize after WASM generation (requires ic-wasm) */
|
|
42
|
+
icWasmOptimize?: boolean;
|
|
43
|
+
/** Run ic-wasm shrink to remove unused functions (requires ic-wasm) */
|
|
44
|
+
icWasmShrink?: boolean;
|
|
45
|
+
/** Validate WASM against Candid .did interface (requires ic-wasm) */
|
|
46
|
+
candidInterface?: string;
|
|
47
|
+
/** Memory limit to set via ic-wasm resource (e.g. '4GiB') */
|
|
48
|
+
memoryLimit?: string;
|
|
49
|
+
/** Compute quota to set via ic-wasm resource */
|
|
50
|
+
computeQuota?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Result of a successful packaging operation
|
|
54
|
+
*/
|
|
55
|
+
export interface PackageResult {
|
|
56
|
+
/** Detected agent configuration */
|
|
57
|
+
config: AgentConfig;
|
|
58
|
+
/** Path to the generated WASM file */
|
|
59
|
+
wasmPath: string;
|
|
60
|
+
/** Path to the generated WAT file (WebAssembly Text format) */
|
|
61
|
+
watPath: string;
|
|
62
|
+
/** Path to the serialized state JSON */
|
|
63
|
+
statePath: string;
|
|
64
|
+
/** Path to the generated JavaScript bundle */
|
|
65
|
+
jsBundlePath?: string;
|
|
66
|
+
/** Path to the generated source map (if enabled) */
|
|
67
|
+
sourceMapPath?: string;
|
|
68
|
+
/** Path to the generated manifest file */
|
|
69
|
+
manifestPath?: string;
|
|
70
|
+
/** Path to the generated Candid interface (if motoko target) */
|
|
71
|
+
didPath?: string;
|
|
72
|
+
/** Size of the WASM file in bytes */
|
|
73
|
+
wasmSize: number;
|
|
74
|
+
/** Compilation target used */
|
|
75
|
+
target: 'wasmedge' | 'motoko' | 'pure-wasm';
|
|
76
|
+
/** Timestamp of the packaging operation */
|
|
77
|
+
timestamp: Date;
|
|
78
|
+
/** Compilation duration in milliseconds */
|
|
79
|
+
duration?: number;
|
|
80
|
+
/** Number of functions exported */
|
|
81
|
+
functionCount?: number;
|
|
82
|
+
/** Original WASM size before ic-wasm optimization (bytes) */
|
|
83
|
+
originalWasmSize?: number;
|
|
84
|
+
/** Size reduction percentage from optimization (0-100) */
|
|
85
|
+
optimizationReductionPercent?: number;
|
|
86
|
+
/** Whether Candid validation passed */
|
|
87
|
+
candidValidationPassed?: boolean;
|
|
88
|
+
/** Optimization warnings */
|
|
89
|
+
optimizationWarnings?: string[];
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Validation error that occurred during packaging
|
|
93
|
+
*/
|
|
94
|
+
export interface ValidationError {
|
|
95
|
+
/** Error code for programmatic handling */
|
|
96
|
+
code: string;
|
|
97
|
+
/** Human-readable error message */
|
|
98
|
+
message: string;
|
|
99
|
+
/** File path related to the error (if applicable) */
|
|
100
|
+
filePath?: string;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Result of agent validation
|
|
104
|
+
*/
|
|
105
|
+
export interface ValidationResult {
|
|
106
|
+
/** Whether validation passed */
|
|
107
|
+
valid: boolean;
|
|
108
|
+
/** List of validation errors (if any) */
|
|
109
|
+
errors: ValidationError[];
|
|
110
|
+
/** List of validation warnings */
|
|
111
|
+
warnings: string[];
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Parsed agent configuration with agent-specific settings
|
|
115
|
+
*/
|
|
116
|
+
export interface ParsedAgentConfig {
|
|
117
|
+
base: {
|
|
118
|
+
name: string;
|
|
119
|
+
version?: string;
|
|
120
|
+
description?: string;
|
|
121
|
+
};
|
|
122
|
+
type: 'clawdbot' | 'goose' | 'cline' | 'generic';
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Config file location
|
|
126
|
+
*/
|
|
127
|
+
export interface ConfigFilePath {
|
|
128
|
+
path: string;
|
|
129
|
+
type: 'json' | 'yaml' | 'directory';
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WasmEdge Compiler
|
|
3
|
+
*
|
|
4
|
+
* Integrates WasmEdge SDK for compiling JavaScript to WebAssembly.
|
|
5
|
+
* Provides WASI-compliant module generation for agent execution.
|
|
6
|
+
*/
|
|
7
|
+
import type { AgentConfig } from '../packaging/types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Compilation target types
|
|
10
|
+
*/
|
|
11
|
+
export type CompilationTarget = 'wasmedge' | 'motoko' | 'pure-wasm';
|
|
12
|
+
/**
|
|
13
|
+
* WasmEdge compilation options
|
|
14
|
+
*/
|
|
15
|
+
export interface WasmEdgeOptions {
|
|
16
|
+
/** Enable debugging support */
|
|
17
|
+
debug?: boolean;
|
|
18
|
+
/** Generate source maps */
|
|
19
|
+
sourcemap?: boolean;
|
|
20
|
+
/** Optimization level (0-3) */
|
|
21
|
+
optimize?: number;
|
|
22
|
+
/** Enable WASI support */
|
|
23
|
+
wasi?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Default WasmEdge options
|
|
27
|
+
*/
|
|
28
|
+
export declare const DEFAULT_WASMEDGE_OPTIONS: WasmEdgeOptions;
|
|
29
|
+
/**
|
|
30
|
+
* Generate WasmEdge-compatible JavaScript wrapper
|
|
31
|
+
*
|
|
32
|
+
* Creates a JavaScript module that implements the standard agent interface
|
|
33
|
+
* and can be compiled with WasmEdge.
|
|
34
|
+
*/
|
|
35
|
+
export declare function generateWasmEdgeWrapper(agentCode: string, config: AgentConfig): string;
|
|
36
|
+
/**
|
|
37
|
+
* Generate WasmEdge build configuration
|
|
38
|
+
*
|
|
39
|
+
* Creates configuration for WasmEdge compiler.
|
|
40
|
+
*/
|
|
41
|
+
export declare function generateWasmEdgeConfig(config: AgentConfig, options?: WasmEdgeOptions): string;
|
|
42
|
+
/**
|
|
43
|
+
* Validate WasmEdge module
|
|
44
|
+
*
|
|
45
|
+
* Checks that a compiled module is valid WasmEdge WASM.
|
|
46
|
+
*/
|
|
47
|
+
export declare function validateWasmEdgeModule(wasmBuffer: Buffer): {
|
|
48
|
+
valid: boolean;
|
|
49
|
+
errors: string[];
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Generate WasmEdge build command
|
|
53
|
+
*
|
|
54
|
+
* Returns the command line to compile JavaScript to WasmEdge WASM.
|
|
55
|
+
* This is a placeholder - actual WasmEdge SDK usage would be integrated.
|
|
56
|
+
*/
|
|
57
|
+
export declare function getWasmEdgeBuildCommand(sourcePath: string, outputPath: string, options?: WasmEdgeOptions): string;
|
|
58
|
+
/**
|
|
59
|
+
* Extract compilation errors from WasmEdge output
|
|
60
|
+
*
|
|
61
|
+
* Parses error messages from WasmEdge compiler output.
|
|
62
|
+
*/
|
|
63
|
+
export declare function parseWasmEdgeErrors(output: string): string[];
|
|
64
|
+
/**
|
|
65
|
+
* Get source map path for compiled WASM
|
|
66
|
+
*
|
|
67
|
+
* Returns the expected source map file path.
|
|
68
|
+
*/
|
|
69
|
+
export declare function getSourceMapPath(wasmPath: string): string;
|
|
70
|
+
/**
|
|
71
|
+
* Generate module manifest for WasmEdge
|
|
72
|
+
*
|
|
73
|
+
* Creates a manifest file with module metadata.
|
|
74
|
+
*/
|
|
75
|
+
export declare function generateWasmEdgeManifest(config: AgentConfig, wasmPath: string, _outputPath: string): string;
|
|
76
|
+
//# sourceMappingURL=wasmedge-compiler.d.ts.map
|