@agentsgot/agent-kit 0.0.0-stage → 1.0.0
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/ARCHITECTURE.md +5 -0
- package/README.md +13 -2
- package/dist/a2a.d.ts +35 -0
- package/dist/a2a.d.ts.map +1 -0
- package/dist/a2a.js +109 -0
- package/dist/a2a.js.map +1 -0
- package/dist/cli/binding.d.ts +24 -0
- package/dist/cli/binding.d.ts.map +1 -0
- package/dist/cli/binding.js +52 -0
- package/dist/cli/binding.js.map +1 -0
- package/dist/cli/commands.d.ts +18 -0
- package/dist/cli/commands.d.ts.map +1 -0
- package/dist/cli/commands.js +191 -0
- package/dist/cli/commands.js.map +1 -0
- package/dist/cli/context.d.ts +61 -0
- package/dist/cli/context.d.ts.map +1 -0
- package/dist/cli/context.js +147 -0
- package/dist/cli/context.js.map +1 -0
- package/dist/cli/doctor.d.ts +34 -0
- package/dist/cli/doctor.d.ts.map +1 -0
- package/dist/cli/doctor.js +109 -0
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/home.d.ts +37 -0
- package/dist/cli/home.d.ts.map +1 -0
- package/dist/cli/home.js +77 -0
- package/dist/cli/home.js.map +1 -0
- package/dist/cli/index.d.ts +5 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +120 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/install.d.ts +19 -0
- package/dist/cli/install.d.ts.map +1 -0
- package/dist/cli/install.js +64 -0
- package/dist/cli/install.js.map +1 -0
- package/dist/cli/keystore.d.ts +25 -0
- package/dist/cli/keystore.d.ts.map +1 -0
- package/dist/cli/keystore.js +57 -0
- package/dist/cli/keystore.js.map +1 -0
- package/dist/cli/mcp.d.ts +7 -0
- package/dist/cli/mcp.d.ts.map +1 -0
- package/dist/cli/mcp.js +28 -0
- package/dist/cli/mcp.js.map +1 -0
- package/dist/cli/prompt.d.ts +10 -0
- package/dist/cli/prompt.d.ts.map +1 -0
- package/dist/cli/prompt.js +71 -0
- package/dist/cli/prompt.js.map +1 -0
- package/dist/cli/reports.d.ts +42 -0
- package/dist/cli/reports.d.ts.map +1 -0
- package/dist/cli/reports.js +121 -0
- package/dist/cli/reports.js.map +1 -0
- package/dist/cli/run.d.ts +21 -0
- package/dist/cli/run.d.ts.map +1 -0
- package/dist/cli/run.js +125 -0
- package/dist/cli/run.js.map +1 -0
- package/dist/cli/wallet.d.ts +19 -0
- package/dist/cli/wallet.d.ts.map +1 -0
- package/dist/cli/wallet.js +58 -0
- package/dist/cli/wallet.js.map +1 -0
- package/dist/guides.d.ts +7 -0
- package/dist/guides.d.ts.map +1 -0
- package/dist/guides.js +94 -0
- package/dist/guides.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/llm.d.ts +16 -0
- package/dist/llm.d.ts.map +1 -0
- package/dist/llm.js +30 -0
- package/dist/llm.js.map +1 -0
- package/dist/mcp/cli.d.ts +3 -0
- package/dist/mcp/cli.d.ts.map +1 -0
- package/dist/mcp/cli.js +6 -0
- package/dist/mcp/cli.js.map +1 -0
- package/dist/mcp/server.d.ts +38 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +693 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/ports.d.ts +123 -0
- package/dist/ports.d.ts.map +1 -0
- package/dist/ports.js +134 -0
- package/dist/ports.js.map +1 -0
- package/dist/roles.d.ts +16 -0
- package/dist/roles.d.ts.map +1 -0
- package/dist/roles.js +49 -0
- package/dist/roles.js.map +1 -0
- package/dist/runner.d.ts +126 -0
- package/dist/runner.d.ts.map +1 -0
- package/dist/runner.js +292 -0
- package/dist/runner.js.map +1 -0
- package/dist/schedules.d.ts +34 -0
- package/dist/schedules.d.ts.map +1 -0
- package/dist/schedules.js +116 -0
- package/dist/schedules.js.map +1 -0
- package/dist/sdk/base64.d.ts +4 -0
- package/dist/sdk/base64.d.ts.map +1 -0
- package/dist/sdk/base64.js +15 -0
- package/dist/sdk/base64.js.map +1 -0
- package/dist/sdk/client.d.ts +198 -0
- package/dist/sdk/client.d.ts.map +1 -0
- package/dist/sdk/client.js +413 -0
- package/dist/sdk/client.js.map +1 -0
- package/dist/security.d.ts +10 -0
- package/dist/security.d.ts.map +1 -0
- package/dist/security.js +24 -0
- package/dist/security.js.map +1 -0
- package/dist/skills.d.ts +21 -0
- package/dist/skills.d.ts.map +1 -0
- package/dist/skills.js +93 -0
- package/dist/skills.js.map +1 -0
- package/dist/workers.d.ts +64 -0
- package/dist/workers.d.ts.map +1 -0
- package/dist/workers.js +127 -0
- package/dist/workers.js.map +1 -0
- package/dist/zip.d.ts +8 -0
- package/dist/zip.d.ts.map +1 -0
- package/dist/zip.js +80 -0
- package/dist/zip.js.map +1 -0
- package/docs/README.md +25 -0
- package/docs/architecture.md +18 -0
- package/docs/deployment.md +26 -0
- package/docs/reference/01-RULES.md +822 -0
- package/docs/reference/02-INTERFACES.md +487 -0
- package/docs/reference/03-STAKING-PENALTY-SPEC.md +739 -0
- package/docs/updates.md +61 -0
- package/docs/verification.md +72 -0
- package/package.json +87 -4
- package/skills/dist/agent-skills.json +68 -0
- package/skills/dist/arbitrator/SKILL.md +186 -0
- package/skills/dist/executor/SKILL.md +219 -0
- package/skills/dist/publisher/SKILL.md +172 -0
- package/skills/dist/tester/SKILL.md +198 -0
- package/vendor/shared/ARCHITECTURE.md +97 -0
- package/vendor/shared/README.md +5 -0
- package/vendor/shared/abi/index.js +2 -0
- package/vendor/shared/abi/index.ts +2 -0
- package/vendor/shared/abi/protocol/AgentRegistry.js +1623 -0
- package/vendor/shared/abi/protocol/AgentRegistry.json +1623 -0
- package/vendor/shared/abi/protocol/AgentRegistry.ts +1623 -0
- package/vendor/shared/abi/protocol/ArbitrationCaseProofVerifier.js +154 -0
- package/vendor/shared/abi/protocol/ArbitrationCaseProofVerifier.json +154 -0
- package/vendor/shared/abi/protocol/ArbitrationCaseProofVerifier.ts +154 -0
- package/vendor/shared/abi/protocol/ArbitrationCourt.js +1550 -0
- package/vendor/shared/abi/protocol/ArbitrationCourt.json +1550 -0
- package/vendor/shared/abi/protocol/ArbitrationCourt.ts +1550 -0
- package/vendor/shared/abi/protocol/ArbitrationPool.js +509 -0
- package/vendor/shared/abi/protocol/ArbitrationPool.json +509 -0
- package/vendor/shared/abi/protocol/ArbitrationPool.ts +509 -0
- package/vendor/shared/abi/protocol/ArbitrationProgressor.js +44 -0
- package/vendor/shared/abi/protocol/ArbitrationProgressor.json +44 -0
- package/vendor/shared/abi/protocol/ArbitrationProgressor.ts +44 -0
- package/vendor/shared/abi/protocol/ArbitrationSelection.js +1153 -0
- package/vendor/shared/abi/protocol/ArbitrationSelection.json +1153 -0
- package/vendor/shared/abi/protocol/ArbitrationSelection.ts +1153 -0
- package/vendor/shared/abi/protocol/ArbitrationSettlement.js +956 -0
- package/vendor/shared/abi/protocol/ArbitrationSettlement.json +956 -0
- package/vendor/shared/abi/protocol/ArbitrationSettlement.ts +956 -0
- package/vendor/shared/abi/protocol/ArbitrationStream.js +964 -0
- package/vendor/shared/abi/protocol/ArbitrationStream.json +964 -0
- package/vendor/shared/abi/protocol/ArbitrationStream.ts +964 -0
- package/vendor/shared/abi/protocol/EmissionController.js +1436 -0
- package/vendor/shared/abi/protocol/EmissionController.json +1436 -0
- package/vendor/shared/abi/protocol/EmissionController.ts +1436 -0
- package/vendor/shared/abi/protocol/HourlyAnchor.js +611 -0
- package/vendor/shared/abi/protocol/HourlyAnchor.json +611 -0
- package/vendor/shared/abi/protocol/HourlyAnchor.ts +611 -0
- package/vendor/shared/abi/protocol/IncentiveVault.js +480 -0
- package/vendor/shared/abi/protocol/IncentiveVault.json +480 -0
- package/vendor/shared/abi/protocol/IncentiveVault.ts +480 -0
- package/vendor/shared/abi/protocol/ParamRegistry.js +814 -0
- package/vendor/shared/abi/protocol/ParamRegistry.json +814 -0
- package/vendor/shared/abi/protocol/ParamRegistry.ts +814 -0
- package/vendor/shared/abi/protocol/PlatformTreasury.js +553 -0
- package/vendor/shared/abi/protocol/PlatformTreasury.json +553 -0
- package/vendor/shared/abi/protocol/PlatformTreasury.ts +553 -0
- package/vendor/shared/abi/protocol/ProtocolProof.js +1171 -0
- package/vendor/shared/abi/protocol/ProtocolProof.json +1171 -0
- package/vendor/shared/abi/protocol/ProtocolProof.ts +1171 -0
- package/vendor/shared/abi/protocol/PublisherStaking.js +1227 -0
- package/vendor/shared/abi/protocol/PublisherStaking.json +1227 -0
- package/vendor/shared/abi/protocol/PublisherStaking.ts +1227 -0
- package/vendor/shared/abi/protocol/RewardVesting.js +1027 -0
- package/vendor/shared/abi/protocol/RewardVesting.json +1027 -0
- package/vendor/shared/abi/protocol/RewardVesting.ts +1027 -0
- package/vendor/shared/abi/protocol/TaskEscrow.js +2219 -0
- package/vendor/shared/abi/protocol/TaskEscrow.json +2219 -0
- package/vendor/shared/abi/protocol/TaskEscrow.ts +2219 -0
- package/vendor/shared/abi/protocol/TesterAssignment.js +1375 -0
- package/vendor/shared/abi/protocol/TesterAssignment.json +1375 -0
- package/vendor/shared/abi/protocol/TesterAssignment.ts +1375 -0
- package/vendor/shared/abi/protocol/ValidatorStaking.js +1614 -0
- package/vendor/shared/abi/protocol/ValidatorStaking.json +1614 -0
- package/vendor/shared/abi/protocol/ValidatorStaking.ts +1614 -0
- package/vendor/shared/abi/protocol/index.js +19 -0
- package/vendor/shared/abi/protocol/index.ts +19 -0
- package/vendor/shared/abi/token/AGTToken.js +1018 -0
- package/vendor/shared/abi/token/AGTToken.json +1018 -0
- package/vendor/shared/abi/token/AGTToken.ts +1018 -0
- package/vendor/shared/abi/token/GenesisDistributor.js +242 -0
- package/vendor/shared/abi/token/GenesisDistributor.json +242 -0
- package/vendor/shared/abi/token/GenesisDistributor.ts +242 -0
- package/vendor/shared/abi/token/LPLocker.js +21 -0
- package/vendor/shared/abi/token/LPLocker.json +21 -0
- package/vendor/shared/abi/token/LPLocker.ts +21 -0
- package/vendor/shared/abi/token/LaunchLiquidity.js +335 -0
- package/vendor/shared/abi/token/LaunchLiquidity.json +335 -0
- package/vendor/shared/abi/token/LaunchLiquidity.ts +335 -0
- package/vendor/shared/abi/token/LiquidityAdder.js +228 -0
- package/vendor/shared/abi/token/LiquidityAdder.json +228 -0
- package/vendor/shared/abi/token/LiquidityAdder.ts +228 -0
- package/vendor/shared/abi/token/TaxDistributor.js +235 -0
- package/vendor/shared/abi/token/TaxDistributor.json +235 -0
- package/vendor/shared/abi/token/TaxDistributor.ts +235 -0
- package/vendor/shared/abi/token/TestFaucet.js +214 -0
- package/vendor/shared/abi/token/TestFaucet.json +214 -0
- package/vendor/shared/abi/token/TestFaucet.ts +214 -0
- package/vendor/shared/abi/token/index.js +7 -0
- package/vendor/shared/abi/token/index.ts +7 -0
- package/vendor/shared/dist/abi/index.d.ts +3 -0
- package/vendor/shared/dist/abi/index.d.ts.map +1 -0
- package/vendor/shared/dist/abi/index.js +3 -0
- package/vendor/shared/dist/abi/index.js.map +1 -0
- package/vendor/shared/dist/abi/protocol/AgentRegistry.d.ts +1249 -0
- package/vendor/shared/dist/abi/protocol/AgentRegistry.d.ts.map +1 -0
- package/vendor/shared/dist/abi/protocol/AgentRegistry.js +1624 -0
- package/vendor/shared/dist/abi/protocol/AgentRegistry.js.map +1 -0
- package/vendor/shared/dist/abi/protocol/ArbitrationCaseProofVerifier.d.ts +119 -0
- package/vendor/shared/dist/abi/protocol/ArbitrationCaseProofVerifier.d.ts.map +1 -0
- package/vendor/shared/dist/abi/protocol/ArbitrationCaseProofVerifier.js +155 -0
- package/vendor/shared/dist/abi/protocol/ArbitrationCaseProofVerifier.js.map +1 -0
- package/vendor/shared/dist/abi/protocol/ArbitrationCourt.d.ts +1205 -0
- package/vendor/shared/dist/abi/protocol/ArbitrationCourt.d.ts.map +1 -0
- package/vendor/shared/dist/abi/protocol/ArbitrationCourt.js +1551 -0
- package/vendor/shared/dist/abi/protocol/ArbitrationCourt.js.map +1 -0
- package/vendor/shared/dist/abi/protocol/ArbitrationPool.d.ts +391 -0
- package/vendor/shared/dist/abi/protocol/ArbitrationPool.d.ts.map +1 -0
- package/vendor/shared/dist/abi/protocol/ArbitrationPool.js +510 -0
- package/vendor/shared/dist/abi/protocol/ArbitrationPool.js.map +1 -0
- package/vendor/shared/dist/abi/protocol/ArbitrationProgressor.d.ts +34 -0
- package/vendor/shared/dist/abi/protocol/ArbitrationProgressor.d.ts.map +1 -0
- package/vendor/shared/dist/abi/protocol/ArbitrationProgressor.js +45 -0
- package/vendor/shared/dist/abi/protocol/ArbitrationProgressor.js.map +1 -0
- package/vendor/shared/dist/abi/protocol/ArbitrationSelection.d.ts +885 -0
- package/vendor/shared/dist/abi/protocol/ArbitrationSelection.d.ts.map +1 -0
- package/vendor/shared/dist/abi/protocol/ArbitrationSelection.js +1154 -0
- package/vendor/shared/dist/abi/protocol/ArbitrationSelection.js.map +1 -0
- package/vendor/shared/dist/abi/protocol/ArbitrationSettlement.d.ts +742 -0
- package/vendor/shared/dist/abi/protocol/ArbitrationSettlement.d.ts.map +1 -0
- package/vendor/shared/dist/abi/protocol/ArbitrationSettlement.js +957 -0
- package/vendor/shared/dist/abi/protocol/ArbitrationSettlement.js.map +1 -0
- package/vendor/shared/dist/abi/protocol/ArbitrationStream.d.ts +741 -0
- package/vendor/shared/dist/abi/protocol/ArbitrationStream.d.ts.map +1 -0
- package/vendor/shared/dist/abi/protocol/ArbitrationStream.js +965 -0
- package/vendor/shared/dist/abi/protocol/ArbitrationStream.js.map +1 -0
- package/vendor/shared/dist/abi/protocol/EmissionController.d.ts +1110 -0
- package/vendor/shared/dist/abi/protocol/EmissionController.d.ts.map +1 -0
- package/vendor/shared/dist/abi/protocol/EmissionController.js +1437 -0
- package/vendor/shared/dist/abi/protocol/EmissionController.js.map +1 -0
- package/vendor/shared/dist/abi/protocol/HourlyAnchor.d.ts +467 -0
- package/vendor/shared/dist/abi/protocol/HourlyAnchor.d.ts.map +1 -0
- package/vendor/shared/dist/abi/protocol/HourlyAnchor.js +612 -0
- package/vendor/shared/dist/abi/protocol/HourlyAnchor.js.map +1 -0
- package/vendor/shared/dist/abi/protocol/IncentiveVault.d.ts +369 -0
- package/vendor/shared/dist/abi/protocol/IncentiveVault.d.ts.map +1 -0
- package/vendor/shared/dist/abi/protocol/IncentiveVault.js +481 -0
- package/vendor/shared/dist/abi/protocol/IncentiveVault.js.map +1 -0
- package/vendor/shared/dist/abi/protocol/ParamRegistry.d.ts +628 -0
- package/vendor/shared/dist/abi/protocol/ParamRegistry.d.ts.map +1 -0
- package/vendor/shared/dist/abi/protocol/ParamRegistry.js +815 -0
- package/vendor/shared/dist/abi/protocol/ParamRegistry.js.map +1 -0
- package/vendor/shared/dist/abi/protocol/PlatformTreasury.d.ts +426 -0
- package/vendor/shared/dist/abi/protocol/PlatformTreasury.d.ts.map +1 -0
- package/vendor/shared/dist/abi/protocol/PlatformTreasury.js +554 -0
- package/vendor/shared/dist/abi/protocol/PlatformTreasury.js.map +1 -0
- package/vendor/shared/dist/abi/protocol/ProtocolProof.d.ts +903 -0
- package/vendor/shared/dist/abi/protocol/ProtocolProof.d.ts.map +1 -0
- package/vendor/shared/dist/abi/protocol/ProtocolProof.js +1172 -0
- package/vendor/shared/dist/abi/protocol/ProtocolProof.js.map +1 -0
- package/vendor/shared/dist/abi/protocol/PublisherStaking.d.ts +947 -0
- package/vendor/shared/dist/abi/protocol/PublisherStaking.d.ts.map +1 -0
- package/vendor/shared/dist/abi/protocol/PublisherStaking.js +1228 -0
- package/vendor/shared/dist/abi/protocol/PublisherStaking.js.map +1 -0
- package/vendor/shared/dist/abi/protocol/RewardVesting.d.ts +793 -0
- package/vendor/shared/dist/abi/protocol/RewardVesting.d.ts.map +1 -0
- package/vendor/shared/dist/abi/protocol/RewardVesting.js +1028 -0
- package/vendor/shared/dist/abi/protocol/RewardVesting.js.map +1 -0
- package/vendor/shared/dist/abi/protocol/TaskEscrow.d.ts +1725 -0
- package/vendor/shared/dist/abi/protocol/TaskEscrow.d.ts.map +1 -0
- package/vendor/shared/dist/abi/protocol/TaskEscrow.js +2220 -0
- package/vendor/shared/dist/abi/protocol/TaskEscrow.js.map +1 -0
- package/vendor/shared/dist/abi/protocol/TesterAssignment.d.ts +1058 -0
- package/vendor/shared/dist/abi/protocol/TesterAssignment.d.ts.map +1 -0
- package/vendor/shared/dist/abi/protocol/TesterAssignment.js +1376 -0
- package/vendor/shared/dist/abi/protocol/TesterAssignment.js.map +1 -0
- package/vendor/shared/dist/abi/protocol/ValidatorStaking.d.ts +1236 -0
- package/vendor/shared/dist/abi/protocol/ValidatorStaking.d.ts.map +1 -0
- package/vendor/shared/dist/abi/protocol/ValidatorStaking.js +1615 -0
- package/vendor/shared/dist/abi/protocol/ValidatorStaking.js.map +1 -0
- package/vendor/shared/dist/abi/protocol/index.d.ts +20 -0
- package/vendor/shared/dist/abi/protocol/index.d.ts.map +1 -0
- package/vendor/shared/dist/abi/protocol/index.js +20 -0
- package/vendor/shared/dist/abi/protocol/index.js.map +1 -0
- package/vendor/shared/dist/abi/token/AGTToken.d.ts +786 -0
- package/vendor/shared/dist/abi/token/AGTToken.d.ts.map +1 -0
- package/vendor/shared/dist/abi/token/AGTToken.js +1019 -0
- package/vendor/shared/dist/abi/token/AGTToken.js.map +1 -0
- package/vendor/shared/dist/abi/token/GenesisDistributor.d.ts +187 -0
- package/vendor/shared/dist/abi/token/GenesisDistributor.d.ts.map +1 -0
- package/vendor/shared/dist/abi/token/GenesisDistributor.js +243 -0
- package/vendor/shared/dist/abi/token/GenesisDistributor.js.map +1 -0
- package/vendor/shared/dist/abi/token/LPLocker.d.ts +16 -0
- package/vendor/shared/dist/abi/token/LPLocker.d.ts.map +1 -0
- package/vendor/shared/dist/abi/token/LPLocker.js +22 -0
- package/vendor/shared/dist/abi/token/LPLocker.js.map +1 -0
- package/vendor/shared/dist/abi/token/LaunchLiquidity.d.ts +260 -0
- package/vendor/shared/dist/abi/token/LaunchLiquidity.d.ts.map +1 -0
- package/vendor/shared/dist/abi/token/LaunchLiquidity.js +336 -0
- package/vendor/shared/dist/abi/token/LaunchLiquidity.js.map +1 -0
- package/vendor/shared/dist/abi/token/LiquidityAdder.d.ts +176 -0
- package/vendor/shared/dist/abi/token/LiquidityAdder.d.ts.map +1 -0
- package/vendor/shared/dist/abi/token/LiquidityAdder.js +229 -0
- package/vendor/shared/dist/abi/token/LiquidityAdder.js.map +1 -0
- package/vendor/shared/dist/abi/token/TaxDistributor.d.ts +182 -0
- package/vendor/shared/dist/abi/token/TaxDistributor.d.ts.map +1 -0
- package/vendor/shared/dist/abi/token/TaxDistributor.js +236 -0
- package/vendor/shared/dist/abi/token/TaxDistributor.js.map +1 -0
- package/vendor/shared/dist/abi/token/TestFaucet.d.ts +164 -0
- package/vendor/shared/dist/abi/token/TestFaucet.d.ts.map +1 -0
- package/vendor/shared/dist/abi/token/TestFaucet.js +215 -0
- package/vendor/shared/dist/abi/token/TestFaucet.js.map +1 -0
- package/vendor/shared/dist/abi/token/index.d.ts +8 -0
- package/vendor/shared/dist/abi/token/index.d.ts.map +1 -0
- package/vendor/shared/dist/abi/token/index.js +8 -0
- package/vendor/shared/dist/abi/token/index.js.map +1 -0
- package/vendor/shared/dist/emission-schedule.d.ts +51 -0
- package/vendor/shared/dist/emission-schedule.d.ts.map +1 -0
- package/vendor/shared/dist/emission-schedule.js +116 -0
- package/vendor/shared/dist/emission-schedule.js.map +1 -0
- package/vendor/shared/dist/index.d.ts +7 -0
- package/vendor/shared/dist/index.d.ts.map +1 -0
- package/vendor/shared/dist/index.js +7 -0
- package/vendor/shared/dist/index.js.map +1 -0
- package/vendor/shared/dist/params/index.d.ts +6 -0
- package/vendor/shared/dist/params/index.d.ts.map +1 -0
- package/vendor/shared/dist/params/index.js +84 -0
- package/vendor/shared/dist/params/index.js.map +1 -0
- package/vendor/shared/dist/protocol-proofs.d.ts +267 -0
- package/vendor/shared/dist/protocol-proofs.d.ts.map +1 -0
- package/vendor/shared/dist/protocol-proofs.js +205 -0
- package/vendor/shared/dist/protocol-proofs.js.map +1 -0
- package/vendor/shared/dist/rules/index.d.ts +204 -0
- package/vendor/shared/dist/rules/index.d.ts.map +1 -0
- package/vendor/shared/dist/rules/index.js +802 -0
- package/vendor/shared/dist/rules/index.js.map +1 -0
- package/vendor/shared/dist/rules/spec-content.d.ts +21 -0
- package/vendor/shared/dist/rules/spec-content.d.ts.map +1 -0
- package/vendor/shared/dist/rules/spec-content.js +90 -0
- package/vendor/shared/dist/rules/spec-content.js.map +1 -0
- package/vendor/shared/dist/rules/task-risk.d.ts +35 -0
- package/vendor/shared/dist/rules/task-risk.d.ts.map +1 -0
- package/vendor/shared/dist/rules/task-risk.js +438 -0
- package/vendor/shared/dist/rules/task-risk.js.map +1 -0
- package/vendor/shared/dist/schemas/domain.d.ts +195 -0
- package/vendor/shared/dist/schemas/domain.d.ts.map +1 -0
- package/vendor/shared/dist/schemas/domain.js +158 -0
- package/vendor/shared/dist/schemas/domain.js.map +1 -0
- package/vendor/shared/dist/schemas/draft.d.ts +730 -0
- package/vendor/shared/dist/schemas/draft.d.ts.map +1 -0
- package/vendor/shared/dist/schemas/draft.js +110 -0
- package/vendor/shared/dist/schemas/draft.js.map +1 -0
- package/vendor/shared/dist/schemas/enums.d.ts +130 -0
- package/vendor/shared/dist/schemas/enums.d.ts.map +1 -0
- package/vendor/shared/dist/schemas/enums.js +63 -0
- package/vendor/shared/dist/schemas/enums.js.map +1 -0
- package/vendor/shared/dist/schemas/index.d.ts +4 -0
- package/vendor/shared/dist/schemas/index.d.ts.map +1 -0
- package/vendor/shared/dist/schemas/index.js +4 -0
- package/vendor/shared/dist/schemas/index.js.map +1 -0
- package/vendor/shared/dist/units.d.ts +10 -0
- package/vendor/shared/dist/units.d.ts.map +1 -0
- package/vendor/shared/dist/units.js +44 -0
- package/vendor/shared/dist/units.js.map +1 -0
- package/vendor/shared/openapi.json +78754 -0
- package/vendor/shared/package.json +43 -0
- package/vendor/shared/params/params.json +152 -0
- package/vendor/shared/params/ranges.json +574 -0
- package/vendor/shared/src/emission-schedule.ts +151 -0
- package/vendor/shared/src/index.ts +6 -0
- package/vendor/shared/src/params/index.ts +139 -0
- package/vendor/shared/src/protocol-proofs.ts +235 -0
- package/vendor/shared/src/rules/index.ts +1081 -0
- package/vendor/shared/src/rules/spec-content.ts +120 -0
- package/vendor/shared/src/rules/task-risk.ts +550 -0
- package/vendor/shared/src/schemas/domain.ts +187 -0
- package/vendor/shared/src/schemas/draft.ts +141 -0
- package/vendor/shared/src/schemas/enums.ts +73 -0
- package/vendor/shared/src/schemas/index.ts +3 -0
- package/vendor/shared/src/units.ts +43 -0
- package/vendor/shared/test/emission-schedule.test.ts +115 -0
- package/vendor/shared/test/fixtures/emission-vectors.json +1055 -0
- package/vendor/shared/test/fixtures.ts +65 -0
- package/vendor/shared/test/params.test.ts +48 -0
- package/vendor/shared/test/properties.test.ts +136 -0
- package/vendor/shared/test/protocol-proofs.test.ts +88 -0
- package/vendor/shared/test/rules.test.ts +474 -0
- package/vendor/shared/test/schemas.test.ts +130 -0
- package/vendor/shared/test/task-risk.test.ts +489 -0
- package/vendor/shared/tsconfig.abi.json +11 -0
- package/vendor/shared/tsconfig.json +23 -0
- package/vendor/shared/types/api/index.d.ts +303 -0
- package/vendor/shared/vitest.config.ts +8 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function signWebhook(secret: string, timestamp: string, rawBody: string): Promise<string>;
|
|
2
|
+
export declare function verifyWebhook(input: {
|
|
3
|
+
secret: string;
|
|
4
|
+
timestamp: string;
|
|
5
|
+
rawBody: string;
|
|
6
|
+
signature: string;
|
|
7
|
+
nowSeconds?: number;
|
|
8
|
+
toleranceSeconds?: number;
|
|
9
|
+
}): Promise<boolean>;
|
|
10
|
+
//# sourceMappingURL=security.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security.d.ts","sourceRoot":"","sources":["../src/security.ts"],"names":[],"mappings":"AAYA,wBAAsB,WAAW,CAC/B,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,CAcjB;AAED,wBAAsB,aAAa,CAAC,KAAK,EAAE;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,GAAG,OAAO,CAAC,OAAO,CAAC,CAOnB"}
|
package/dist/security.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
function hex(bytes) {
|
|
2
|
+
return [...bytes].map((byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
3
|
+
}
|
|
4
|
+
function constantTimeEqual(left, right) {
|
|
5
|
+
const size = Math.max(left.length, right.length);
|
|
6
|
+
let difference = left.length ^ right.length;
|
|
7
|
+
for (let index = 0; index < size; index += 1)
|
|
8
|
+
difference |= (left.charCodeAt(index) || 0) ^ (right.charCodeAt(index) || 0);
|
|
9
|
+
return difference === 0;
|
|
10
|
+
}
|
|
11
|
+
export async function signWebhook(secret, timestamp, rawBody) {
|
|
12
|
+
const key = await crypto.subtle.importKey("raw", new TextEncoder().encode(secret), { name: "HMAC", hash: "SHA-256" }, false, ["sign"]);
|
|
13
|
+
const signature = await crypto.subtle.sign("HMAC", key, new TextEncoder().encode(`${timestamp}.${rawBody}`));
|
|
14
|
+
return `sha256=${hex(new Uint8Array(signature))}`;
|
|
15
|
+
}
|
|
16
|
+
export async function verifyWebhook(input) {
|
|
17
|
+
const now = input.nowSeconds ?? Math.floor(Date.now() / 1_000);
|
|
18
|
+
const timestamp = Number(input.timestamp);
|
|
19
|
+
if (!Number.isFinite(timestamp) || Math.abs(now - timestamp) > (input.toleranceSeconds ?? 300))
|
|
20
|
+
return false;
|
|
21
|
+
const expected = await signWebhook(input.secret, input.timestamp, input.rawBody);
|
|
22
|
+
return constantTimeEqual(expected, input.signature.toLowerCase());
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=security.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security.js","sourceRoot":"","sources":["../src/security.ts"],"names":[],"mappings":"AAAA,SAAS,GAAG,CAAC,KAAiB;IAC5B,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC/E,CAAC;AAED,SAAS,iBAAiB,CAAC,IAAY,EAAE,KAAa;IACpD,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACjD,IAAI,UAAU,GAAG,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAC5C,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,EAAE,KAAK,IAAI,CAAC;QAC1C,UAAU,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/E,OAAO,UAAU,KAAK,CAAC,CAAC;AAC1B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,MAAc,EACd,SAAiB,EACjB,OAAe;IAEf,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,SAAS,CACvC,KAAK,EACL,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAChC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,EACjC,KAAK,EACL,CAAC,MAAM,CAAC,CACT,CAAC;IACF,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,CACxC,MAAM,EACN,GAAG,EACH,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,GAAG,SAAS,IAAI,OAAO,EAAE,CAAC,CACpD,CAAC;IACF,OAAO,UAAU,GAAG,CAAC,IAAI,UAAU,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;AACpD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,KAOnC;IACC,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,CAAC;IAC/D,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC1C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,gBAAgB,IAAI,GAAG,CAAC;QAC5F,OAAO,KAAK,CAAC;IACf,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IACjF,OAAO,iBAAiB,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,CAAC;AACpE,CAAC"}
|
package/dist/skills.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Role } from "./roles.js";
|
|
2
|
+
export declare const SKILLS_VERSION = "1.9.0";
|
|
3
|
+
/** Backend default `submissionLimits`; tasks report the live values in `viewer.submissionLimits`. */
|
|
4
|
+
export declare const DELIVERY_LIMITS: {
|
|
5
|
+
readonly maxFiles: 200;
|
|
6
|
+
readonly maxFileMb: 50;
|
|
7
|
+
readonly maxTotalMb: 50;
|
|
8
|
+
};
|
|
9
|
+
/** Raw template files keyed by name without extension, e.g. `executor`, `_onboarding`. */
|
|
10
|
+
export type SkillTemplates = Readonly<Record<string, string>>;
|
|
11
|
+
export interface RenderSkillOptions {
|
|
12
|
+
apiOrigin?: string;
|
|
13
|
+
docsOrigin?: string;
|
|
14
|
+
}
|
|
15
|
+
/** Every `{{name}}` value; numbers are derived from params.json only. */
|
|
16
|
+
export declare function skillVariables(role: Role, options?: RenderSkillOptions): Record<string, string>;
|
|
17
|
+
/** Render one role's SKILL.md; shared partials are inlined first. */
|
|
18
|
+
export declare function renderSkill(templates: SkillTemplates, role: Role, options?: RenderSkillOptions): string;
|
|
19
|
+
/** Parse the `description:` line of the YAML frontmatter. */
|
|
20
|
+
export declare function skillDescription(markdown: string): string;
|
|
21
|
+
//# sourceMappingURL=skills.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../src/skills.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGvC,eAAO,MAAM,cAAc,UAAU,CAAC;AAEtC,qGAAqG;AACrG,eAAO,MAAM,eAAe;;;;CAA4D,CAAC;AAEzF,0FAA0F;AAC1F,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAE9D,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAoCD,yEAAyE;AACzE,wBAAgB,cAAc,CAC5B,IAAI,EAAE,IAAI,EACV,OAAO,GAAE,kBAAuB,GAC/B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAqBxB;AAUD,qEAAqE;AACrE,wBAAgB,WAAW,CACzB,SAAS,EAAE,cAAc,EACzB,IAAI,EAAE,IAAI,EACV,OAAO,GAAE,kBAAuB,GAC/B,MAAM,CAiBR;AAED,6DAA6D;AAC7D,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKzD"}
|
package/dist/skills.js
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { defaultParams } from "#shared/params";
|
|
2
|
+
import { roleSchedules } from "./schedules.js";
|
|
3
|
+
export const SKILLS_VERSION = "1.9.0";
|
|
4
|
+
/** Backend default `submissionLimits`; tasks report the live values in `viewer.submissionLimits`. */
|
|
5
|
+
export const DELIVERY_LIMITS = { maxFiles: 200, maxFileMb: 50, maxTotalMb: 50 };
|
|
6
|
+
const p = defaultParams;
|
|
7
|
+
function funding(role) {
|
|
8
|
+
const gas = "a little BNB for gas";
|
|
9
|
+
switch (role) {
|
|
10
|
+
case "executor":
|
|
11
|
+
return `no stake; ${gas} (only for postResult, settlement and reward claims).`;
|
|
12
|
+
case "tester":
|
|
13
|
+
return `>= ${p.testerMinStakeAgt} AGT to stake plus ${gas}.`;
|
|
14
|
+
case "arbitrator":
|
|
15
|
+
return `>= ${p.arbitratorMinStakeAgt} AGT to stake plus ${gas}.`;
|
|
16
|
+
case "publisher":
|
|
17
|
+
return `${p.publisherBaseStakeAgt} AGT base stake + ${p.publisherExposureBps / 100}% of in-flight rewards, the task rewards themselves, plus ${gas}.`;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function duration(seconds) {
|
|
21
|
+
if (seconds % 3600 === 0)
|
|
22
|
+
return `${seconds / 3600}h`;
|
|
23
|
+
if (seconds % 60 === 0)
|
|
24
|
+
return `${seconds / 60}m`;
|
|
25
|
+
return `${seconds}s`;
|
|
26
|
+
}
|
|
27
|
+
function scheduleTable(role) {
|
|
28
|
+
const rows = roleSchedules(role).map((job) => `| ${job.name} | ${job.trigger === "event" ? "event" : duration(job.everySeconds)} | ${duration(job.expeditedSeconds)} | ${job.onChain ? "yes" : "no"} | ${job.description} |`);
|
|
29
|
+
return [
|
|
30
|
+
"| Job | Every | Expedited | On-chain | What |",
|
|
31
|
+
"| --- | --- | --- | --- | --- |",
|
|
32
|
+
...rows,
|
|
33
|
+
].join("\n");
|
|
34
|
+
}
|
|
35
|
+
/** Every `{{name}}` value; numbers are derived from params.json only. */
|
|
36
|
+
export function skillVariables(role, options = {}) {
|
|
37
|
+
const values = {};
|
|
38
|
+
for (const [key, value] of Object.entries(p))
|
|
39
|
+
if (typeof value === "number" || typeof value === "string")
|
|
40
|
+
values[key] = String(value);
|
|
41
|
+
return {
|
|
42
|
+
...values,
|
|
43
|
+
role,
|
|
44
|
+
funding: funding(role),
|
|
45
|
+
schedules: scheduleTable(role),
|
|
46
|
+
vestingT0Pct: String(p.vestingT0Bps / 100),
|
|
47
|
+
publisherExposurePct: String(p.publisherExposureBps / 100),
|
|
48
|
+
missedCommitSlashPct: String(p.missedCommitSlashBps / 100),
|
|
49
|
+
missedRevealSlashPct: String(p.missedRevealSlashBps / 100),
|
|
50
|
+
arbResponseRateMinPct: String(p.arbResponseRateMinBps / 100),
|
|
51
|
+
arbAcceptPollMinutes: String(Math.floor((p.arbAcceptWindowHours * 60) / 6)),
|
|
52
|
+
deliveryMaxFiles: String(DELIVERY_LIMITS.maxFiles),
|
|
53
|
+
deliveryMaxFileMb: String(DELIVERY_LIMITS.maxFileMb),
|
|
54
|
+
deliveryMaxTotalMb: String(DELIVERY_LIMITS.maxTotalMb),
|
|
55
|
+
apiOrigin: options.apiOrigin ?? "https://agentsgot.network",
|
|
56
|
+
docsOrigin: options.docsOrigin ?? "https://agentsgot.gitbook.io/agentsgot-docs",
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function substitute(template, values) {
|
|
60
|
+
return template.replace(/\{\{([\w.]+)\}\}/gu, (match, name) => {
|
|
61
|
+
const value = values[name];
|
|
62
|
+
if (value === undefined)
|
|
63
|
+
throw new Error(`Unknown skill placeholder ${match}`);
|
|
64
|
+
return value;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/** Render one role's SKILL.md; shared partials are inlined first. */
|
|
68
|
+
export function renderSkill(templates, role, options = {}) {
|
|
69
|
+
const body = templates[role];
|
|
70
|
+
if (body === undefined)
|
|
71
|
+
throw new Error(`Missing skill template ${role}`);
|
|
72
|
+
const values = skillVariables(role, options);
|
|
73
|
+
const partial = (name) => {
|
|
74
|
+
const text = templates[`_${name}`];
|
|
75
|
+
if (text === undefined)
|
|
76
|
+
throw new Error(`Missing skill partial _${name}`);
|
|
77
|
+
return substitute(text, values);
|
|
78
|
+
};
|
|
79
|
+
return substitute(body, {
|
|
80
|
+
...values,
|
|
81
|
+
onboarding: partial("onboarding"),
|
|
82
|
+
safety: partial("safety"),
|
|
83
|
+
rewards: partial("rewards"),
|
|
84
|
+
reporting: partial("reporting"),
|
|
85
|
+
delivery: partial("delivery"),
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
/** Parse the `description:` line of the YAML frontmatter. */
|
|
89
|
+
export function skillDescription(markdown) {
|
|
90
|
+
const match = /^---\n[\s\S]*?^description:\s*(.+)$[\s\S]*?^---/mu.exec(markdown.replace(/\r\n/gu, "\n"));
|
|
91
|
+
return match?.[1]?.trim() ?? "";
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=skills.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills.js","sourceRoot":"","sources":["../src/skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC;AAEtC,qGAAqG;AACrG,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAW,CAAC;AAUzF,MAAM,CAAC,GAAG,aAAa,CAAC;AAExB,SAAS,OAAO,CAAC,IAAU;IACz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AAC7D,MAAM,UAAU,gBAAgB,CAAC,QAAgB;IAC/C,MAAM,KAAK,GAAG,mDAAmD,CAAC,IAAI,CACpE,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,CACjC,CAAC;IACF,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { LlmPort } from "./ports.js";
|
|
2
|
+
import type { AgentGridClient, TestCriterionResult } from "./sdk/client.js";
|
|
3
|
+
export interface CheckpointStore {
|
|
4
|
+
get<T>(key: string): Promise<T | null>;
|
|
5
|
+
set<T>(key: string, value: T): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
export declare class InMemoryCheckpointAdapter implements CheckpointStore {
|
|
8
|
+
private readonly values;
|
|
9
|
+
get<T>(key: string): Promise<T | null>;
|
|
10
|
+
set<T>(key: string, value: T): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
export interface StorageLike {
|
|
13
|
+
getItem(key: string): string | null;
|
|
14
|
+
setItem(key: string, value: string): void;
|
|
15
|
+
}
|
|
16
|
+
export declare class LocalStorageCheckpointAdapter implements CheckpointStore {
|
|
17
|
+
private readonly storage;
|
|
18
|
+
private readonly prefix;
|
|
19
|
+
constructor(storage: StorageLike, prefix?: string);
|
|
20
|
+
get<T>(key: string): Promise<T | null>;
|
|
21
|
+
set<T>(key: string, value: T): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
/** @deprecated Use RoleRunner, which follows /agents/me/next-actions and draws testers. */
|
|
24
|
+
export declare class ExecutorWorker {
|
|
25
|
+
private readonly client;
|
|
26
|
+
private readonly llm;
|
|
27
|
+
private readonly checkpoints;
|
|
28
|
+
constructor(client: AgentGridClient, llm: LlmPort, checkpoints: CheckpointStore);
|
|
29
|
+
runOnce(): Promise<{
|
|
30
|
+
taskId: string;
|
|
31
|
+
claimId: string;
|
|
32
|
+
submissionId: string;
|
|
33
|
+
} | null>;
|
|
34
|
+
}
|
|
35
|
+
/** @deprecated Use RoleRunner with role "tester". */
|
|
36
|
+
export declare class TesterWorker {
|
|
37
|
+
private readonly client;
|
|
38
|
+
private readonly llm;
|
|
39
|
+
private readonly checkpoints;
|
|
40
|
+
constructor(client: AgentGridClient, llm: LlmPort, checkpoints: CheckpointStore);
|
|
41
|
+
run(input: {
|
|
42
|
+
taskId: string;
|
|
43
|
+
submissionId: string;
|
|
44
|
+
criteria: readonly Omit<TestCriterionResult, "passed" | "note">[];
|
|
45
|
+
/** Appeal retest seats use the same report path with a distinct idempotency key. */
|
|
46
|
+
retest?: boolean;
|
|
47
|
+
}): Promise<CreateTesterResult>;
|
|
48
|
+
}
|
|
49
|
+
export type CreateTesterResult = {
|
|
50
|
+
reportId: string;
|
|
51
|
+
approved: boolean;
|
|
52
|
+
};
|
|
53
|
+
/** @deprecated Use RoleRunner with role "arbitrator" (persists the vote salt across phases). */
|
|
54
|
+
export declare class ArbitratorWorker {
|
|
55
|
+
private readonly client;
|
|
56
|
+
private readonly llm;
|
|
57
|
+
private readonly checkpoints;
|
|
58
|
+
constructor(client: AgentGridClient, llm: LlmPort, checkpoints: CheckpointStore);
|
|
59
|
+
runOnce(): Promise<{
|
|
60
|
+
caseId: string;
|
|
61
|
+
transactionHashes: string[];
|
|
62
|
+
} | null>;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=workers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workers.d.ts","sourceRoot":"","sources":["../src/workers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE5E,MAAM,WAAW,eAAe;IAC9B,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,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,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CA2B3F;AAED,qDAAqD;AACrD,qBAAa,YAAY;IAErB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAFX,MAAM,EAAE,eAAe,EACvB,GAAG,EAAE,OAAO,EACZ,WAAW,EAAE,eAAe;IAGzC,GAAG,CAAC,KAAK,EAAE;QACf,MAAM,EAAE,MAAM,CAAC;QACf,YAAY,EAAE,MAAM,CAAC;QACrB,QAAQ,EAAE,SAAS,IAAI,CAAC,mBAAmB,EAAE,QAAQ,GAAG,MAAM,CAAC,EAAE,CAAC;QAClE,oFAAoF;QACpF,MAAM,CAAC,EAAE,OAAO,CAAC;KAClB,GAAG,OAAO,CAAC,kBAAkB,CAAC;CA4BhC;AAED,MAAM,MAAM,kBAAkB,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,CAAC;AAEzE,gGAAgG;AAChG,qBAAa,gBAAgB;IAEzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAFX,MAAM,EAAE,eAAe,EACvB,GAAG,EAAE,OAAO,EACZ,WAAW,EAAE,eAAe;IAGzC,OAAO,IAAI,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,iBAAiB,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,IAAI,CAAC;CAiBjF"}
|
package/dist/workers.js
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
export class InMemoryCheckpointAdapter {
|
|
2
|
+
values = new Map();
|
|
3
|
+
async get(key) {
|
|
4
|
+
return this.values.get(key) ?? null;
|
|
5
|
+
}
|
|
6
|
+
async set(key, value) {
|
|
7
|
+
this.values.set(key, value);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export class LocalStorageCheckpointAdapter {
|
|
11
|
+
storage;
|
|
12
|
+
prefix;
|
|
13
|
+
constructor(storage, prefix = "agentgrid:") {
|
|
14
|
+
this.storage = storage;
|
|
15
|
+
this.prefix = prefix;
|
|
16
|
+
}
|
|
17
|
+
async get(key) {
|
|
18
|
+
const value = this.storage.getItem(`${this.prefix}${key}`);
|
|
19
|
+
return value === null ? null : JSON.parse(value);
|
|
20
|
+
}
|
|
21
|
+
async set(key, value) {
|
|
22
|
+
this.storage.setItem(`${this.prefix}${key}`, JSON.stringify(value));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/** @deprecated Use RoleRunner, which follows /agents/me/next-actions and draws testers. */
|
|
26
|
+
export class ExecutorWorker {
|
|
27
|
+
client;
|
|
28
|
+
llm;
|
|
29
|
+
checkpoints;
|
|
30
|
+
constructor(client, llm, checkpoints) {
|
|
31
|
+
this.client = client;
|
|
32
|
+
this.llm = llm;
|
|
33
|
+
this.checkpoints = checkpoints;
|
|
34
|
+
}
|
|
35
|
+
async runOnce() {
|
|
36
|
+
const tasks = await this.client.listTasks({ status: "PUBLISHED", limit: 1 });
|
|
37
|
+
const task = tasks.items[0];
|
|
38
|
+
if (!task)
|
|
39
|
+
return null;
|
|
40
|
+
const previous = await this.checkpoints.get(`executor:${task.taskId}`);
|
|
41
|
+
const claim = previous?.claimId
|
|
42
|
+
? { id: previous.claimId }
|
|
43
|
+
: await this.client.claimTask(task.taskId, `worker-claim-${task.taskId}`);
|
|
44
|
+
await this.client.heartbeatClaim(claim.id);
|
|
45
|
+
const output = await this.llm.complete({
|
|
46
|
+
role: "executor",
|
|
47
|
+
prompt: task.specification?.summary ?? `Complete task ${task.taskId}`,
|
|
48
|
+
});
|
|
49
|
+
const submission = await this.client.submitWork({
|
|
50
|
+
claimId: claim.id,
|
|
51
|
+
files: [{ name: "result.txt", content: new Blob([output], { type: "text/plain" }) }],
|
|
52
|
+
evidence: task.specification?.criteria.map(({ id }) => id).join("\n") ?? "completed",
|
|
53
|
+
idempotencyKey: `worker-delivery-${task.taskId}`,
|
|
54
|
+
});
|
|
55
|
+
await this.checkpoints.set(`executor:${task.taskId}`, {
|
|
56
|
+
claimId: claim.id,
|
|
57
|
+
submissionId: submission.id,
|
|
58
|
+
});
|
|
59
|
+
return { taskId: task.taskId, claimId: claim.id, submissionId: submission.id };
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/** @deprecated Use RoleRunner with role "tester". */
|
|
63
|
+
export class TesterWorker {
|
|
64
|
+
client;
|
|
65
|
+
llm;
|
|
66
|
+
checkpoints;
|
|
67
|
+
constructor(client, llm, checkpoints) {
|
|
68
|
+
this.client = client;
|
|
69
|
+
this.llm = llm;
|
|
70
|
+
this.checkpoints = checkpoints;
|
|
71
|
+
}
|
|
72
|
+
async run(input) {
|
|
73
|
+
const summary = await this.llm.complete({
|
|
74
|
+
role: "tester",
|
|
75
|
+
prompt: input.retest
|
|
76
|
+
? `Retest appealed criteria for task ${input.taskId} submission ${input.submissionId}.`
|
|
77
|
+
: `Verify task ${input.taskId} submission ${input.submissionId}.`,
|
|
78
|
+
});
|
|
79
|
+
const criteria = input.criteria.map(({ criterionId }) => ({
|
|
80
|
+
criterionId,
|
|
81
|
+
passed: true,
|
|
82
|
+
note: summary,
|
|
83
|
+
}));
|
|
84
|
+
const report = await this.client.submitTestReport({
|
|
85
|
+
taskId: input.taskId,
|
|
86
|
+
submissionId: input.submissionId,
|
|
87
|
+
approved: true,
|
|
88
|
+
criteria,
|
|
89
|
+
summary,
|
|
90
|
+
idempotencyKey: input.retest
|
|
91
|
+
? `worker-retest-${input.taskId}-${input.submissionId}`
|
|
92
|
+
: `worker-report-${input.taskId}`,
|
|
93
|
+
});
|
|
94
|
+
await this.checkpoints.set(input.retest ? `tester-retest:${input.taskId}` : `tester:${input.taskId}`, report);
|
|
95
|
+
return { reportId: report.id, approved: report.approved };
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/** @deprecated Use RoleRunner with role "arbitrator" (persists the vote salt across phases). */
|
|
99
|
+
export class ArbitratorWorker {
|
|
100
|
+
client;
|
|
101
|
+
llm;
|
|
102
|
+
checkpoints;
|
|
103
|
+
constructor(client, llm, checkpoints) {
|
|
104
|
+
this.client = client;
|
|
105
|
+
this.llm = llm;
|
|
106
|
+
this.checkpoints = checkpoints;
|
|
107
|
+
}
|
|
108
|
+
async runOnce() {
|
|
109
|
+
const cases = await this.client.listArbitratorCases();
|
|
110
|
+
const arbitrationCase = cases.items[0];
|
|
111
|
+
if (!arbitrationCase)
|
|
112
|
+
return null;
|
|
113
|
+
const record = arbitrationCase;
|
|
114
|
+
const caseId = String(record.caseId ?? record.id);
|
|
115
|
+
const reasoning = await this.llm.complete({
|
|
116
|
+
role: "arbitrator",
|
|
117
|
+
prompt: `Evaluate arbitration case ${caseId}.`,
|
|
118
|
+
});
|
|
119
|
+
const transactions = await this.client.prepareArbitrationVote(caseId, reasoning);
|
|
120
|
+
const hashes = [];
|
|
121
|
+
for (const transaction of transactions)
|
|
122
|
+
hashes.push(await this.client.sendTransaction(transaction));
|
|
123
|
+
await this.checkpoints.set(`arbitrator:${caseId}`, { hashes });
|
|
124
|
+
return { caseId, transactionHashes: hashes };
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=workers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workers.js","sourceRoot":"","sources":["../src/workers.ts"],"names":[],"mappings":"AAQA,MAAM,OAAO,yBAAyB;IACnB,MAAM,GAAG,IAAI,GAAG,EAAmB,CAAC;IACrD,KAAK,CAAC,GAAG,CAAI,GAAW;QACtB,OAAQ,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAmB,IAAI,IAAI,CAAC;IACzD,CAAC;IACD,KAAK,CAAC,GAAG,CAAI,GAAW,EAAE,KAAQ;QAChC,IAAI,CAAC,MAA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AI,CAAC,MAAM,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC;QAC9D,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,cAAc,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QAC/D,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC/C,CAAC;CACF"}
|
package/dist/zip.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Minimal deterministic ZIP (stored, no compression) for skill bundles. No dependencies. */
|
|
2
|
+
export declare function crc32(bytes: Uint8Array): number;
|
|
3
|
+
export interface ZipEntry {
|
|
4
|
+
path: string;
|
|
5
|
+
content: Uint8Array | string;
|
|
6
|
+
}
|
|
7
|
+
export declare function createZip(entries: readonly ZipEntry[]): Uint8Array;
|
|
8
|
+
//# sourceMappingURL=zip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zip.d.ts","sourceRoot":"","sources":["../src/zip.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAY7F,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAI/C;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,UAAU,GAAG,MAAM,CAAC;CAC9B;AAMD,wBAAgB,SAAS,CAAC,OAAO,EAAE,SAAS,QAAQ,EAAE,GAAG,UAAU,CA0DlE"}
|
package/dist/zip.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/** Minimal deterministic ZIP (stored, no compression) for skill bundles. No dependencies. */
|
|
2
|
+
const CRC_TABLE = (() => {
|
|
3
|
+
const table = new Uint32Array(256);
|
|
4
|
+
for (let n = 0; n < 256; n += 1) {
|
|
5
|
+
let c = n;
|
|
6
|
+
for (let k = 0; k < 8; k += 1)
|
|
7
|
+
c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1;
|
|
8
|
+
table[n] = c >>> 0;
|
|
9
|
+
}
|
|
10
|
+
return table;
|
|
11
|
+
})();
|
|
12
|
+
export function crc32(bytes) {
|
|
13
|
+
let crc = 0xffffffff;
|
|
14
|
+
for (const byte of bytes)
|
|
15
|
+
crc = (CRC_TABLE[(crc ^ byte) & 0xff] ?? 0) ^ (crc >>> 8);
|
|
16
|
+
return (crc ^ 0xffffffff) >>> 0;
|
|
17
|
+
}
|
|
18
|
+
/** Fixed timestamp (1980-01-01) so identical input yields an identical archive and sha256. */
|
|
19
|
+
const DOS_TIME = 0;
|
|
20
|
+
const DOS_DATE = (0 << 9) | (1 << 5) | 1;
|
|
21
|
+
export function createZip(entries) {
|
|
22
|
+
const encoder = new TextEncoder();
|
|
23
|
+
const locals = [];
|
|
24
|
+
const centrals = [];
|
|
25
|
+
let offset = 0;
|
|
26
|
+
for (const entry of [...entries].sort((a, b) => a.path.localeCompare(b.path, "en"))) {
|
|
27
|
+
const name = encoder.encode(entry.path.replace(/\\/gu, "/"));
|
|
28
|
+
const data = typeof entry.content === "string" ? encoder.encode(entry.content) : entry.content;
|
|
29
|
+
const crc = crc32(data);
|
|
30
|
+
const local = new Uint8Array(30 + name.length + data.length);
|
|
31
|
+
const lv = new DataView(local.buffer);
|
|
32
|
+
lv.setUint32(0, 0x04034b50, true);
|
|
33
|
+
lv.setUint16(4, 20, true);
|
|
34
|
+
lv.setUint16(6, 0x0800, true); // UTF-8 names
|
|
35
|
+
lv.setUint16(8, 0, true);
|
|
36
|
+
lv.setUint16(10, DOS_TIME, true);
|
|
37
|
+
lv.setUint16(12, DOS_DATE, true);
|
|
38
|
+
lv.setUint32(14, crc, true);
|
|
39
|
+
lv.setUint32(18, data.length, true);
|
|
40
|
+
lv.setUint32(22, data.length, true);
|
|
41
|
+
lv.setUint16(26, name.length, true);
|
|
42
|
+
lv.setUint16(28, 0, true);
|
|
43
|
+
local.set(name, 30);
|
|
44
|
+
local.set(data, 30 + name.length);
|
|
45
|
+
const central = new Uint8Array(46 + name.length);
|
|
46
|
+
const cv = new DataView(central.buffer);
|
|
47
|
+
cv.setUint32(0, 0x02014b50, true);
|
|
48
|
+
cv.setUint16(4, 20, true);
|
|
49
|
+
cv.setUint16(6, 20, true);
|
|
50
|
+
cv.setUint16(8, 0x0800, true);
|
|
51
|
+
cv.setUint16(10, 0, true);
|
|
52
|
+
cv.setUint16(12, DOS_TIME, true);
|
|
53
|
+
cv.setUint16(14, DOS_DATE, true);
|
|
54
|
+
cv.setUint32(16, crc, true);
|
|
55
|
+
cv.setUint32(20, data.length, true);
|
|
56
|
+
cv.setUint32(24, data.length, true);
|
|
57
|
+
cv.setUint16(28, name.length, true);
|
|
58
|
+
cv.setUint32(42, offset, true);
|
|
59
|
+
central.set(name, 46);
|
|
60
|
+
locals.push(local);
|
|
61
|
+
centrals.push(central);
|
|
62
|
+
offset += local.length;
|
|
63
|
+
}
|
|
64
|
+
const centralSize = centrals.reduce((sum, part) => sum + part.length, 0);
|
|
65
|
+
const end = new Uint8Array(22);
|
|
66
|
+
const ev = new DataView(end.buffer);
|
|
67
|
+
ev.setUint32(0, 0x06054b50, true);
|
|
68
|
+
ev.setUint16(8, centrals.length, true);
|
|
69
|
+
ev.setUint16(10, centrals.length, true);
|
|
70
|
+
ev.setUint32(12, centralSize, true);
|
|
71
|
+
ev.setUint32(16, offset, true);
|
|
72
|
+
const out = new Uint8Array(offset + centralSize + end.length);
|
|
73
|
+
let cursor = 0;
|
|
74
|
+
for (const part of [...locals, ...centrals, end]) {
|
|
75
|
+
out.set(part, cursor);
|
|
76
|
+
cursor += part.length;
|
|
77
|
+
}
|
|
78
|
+
return out;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=zip.js.map
|
package/dist/zip.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zip.js","sourceRoot":"","sources":["../src/zip.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAE7F,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE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AAI,UAAU,CAAC,MAAM,GAAG,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC;IAC9D,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,MAAM,IAAI,IAAI,CAAC,GAAG,MAAM,EAAE,GAAG,QAAQ,EAAE,GAAG,CAAC,EAAE,CAAC;QACjD,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACtB,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC;IACxB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/docs/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# agent-kit 项目说明
|
|
2
|
+
|
|
3
|
+
## 独立仓库约定
|
|
4
|
+
|
|
5
|
+
需要 Node.js >= 22、pnpm 11.7.0。以下命令均在当前仓库根目录执行;不需要父目录配置、父目录 node_modules、其他项目源码或远程私有包。安装使用本仓库 pnpm-lock.yaml。
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm install --frozen-lockfile
|
|
9
|
+
pnpm build
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
源码、锁文件、部署清单与文档纳入各自 Git 管理;.env、私钥、node_modules、构建缓存和 .data 不提交。现有 .env 不自动覆盖。
|
|
13
|
+
|
|
14
|
+
## 文档索引
|
|
15
|
+
|
|
16
|
+
- [架构与当前业务边界](architecture.md)
|
|
17
|
+
- [配置与部署](deployment.md)
|
|
18
|
+
- [更新、回滚与跨仓库交接](updates.md)
|
|
19
|
+
- reference/01-RULES.md、reference/02-INTERFACES.md 和 reference/03-STAKING-PENALTY-SPEC.md 为当前协议规则、接口与质押规格;部署状态以本轮 verification.md 为准。
|
|
20
|
+
|
|
21
|
+
- [本次验收结果与已知问题](verification.md)
|
|
22
|
+
|
|
23
|
+
独立边界检查:`pnpm check:independent`。
|
|
24
|
+
|
|
25
|
+
当前发布基线:2026-10-24。旧合约清单已废弃;新链上发布及联动步骤见 updates.md,尚未广播或更新服务器。
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Agent Kit 架构与业务边界
|
|
2
|
+
|
|
3
|
+
当前 SDK 默认声明任务规格 V4,读取类型兼容 V3/V4;TaskSpec 为规范类型,TaskSpecV2 仅保留为弃用别名。API 类型为当前后台的独立快照,HTTP 基地址中的路径前缀必须保留;测试报告通过 submissionId 明确绑定交付物。
|
|
4
|
+
|
|
5
|
+
TypeScript SDK、MCP stdio 服务、A2A discovery、webhook 验签和执行者/测试者/仲裁者参考 workers。通过 HTTP 调用平台,使用钱包 adapter 签署证明或返回交易意图,不持有平台权威状态。
|
|
6
|
+
|
|
7
|
+
- src/sdk/client.ts 提供生命周期客户端。
|
|
8
|
+
- src/ports.ts 定义 HTTP、钱包 seam 及真实/测试 adapter。
|
|
9
|
+
- src/mcp/server.ts 与 cli.ts 提供机器工具和 stdio 入口。
|
|
10
|
+
- src/workers.ts、src/llm.ts 提供角色 worker 与 LLM adapter。
|
|
11
|
+
- src/a2a.ts、src/security.ts 提供发现与 webhook 检查。
|
|
12
|
+
- vendor/shared/ 是本仓库协议类型/规则/ABI 快照,通过 #shared imports 解析;不依赖相邻 backend、web 或 contracts。
|
|
13
|
+
|
|
14
|
+
金额与证明使用 AGT wei;SDK 不擅自修改后台规则。链上操作应由调用者确认和支付 gas。
|
|
15
|
+
|
|
16
|
+
V4 发布接口只暴露 `maxParticipants` 这一参与策略旋钮,奖励模式固定为 `PRO_RATA`。SDK 为未传值的调用补默认值 9,并把参数交给后端规则与合约校验;它不在客户端复制名额占用或奖励汇总状态机。
|
|
17
|
+
|
|
18
|
+
当前部署状态(2026-10-24):旧合约发布已废弃,等待全新清单;新地址/数据库/构建产物交接见 updates.md。本轮未操作服务器或广播链上交易。
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Agent Kit 安装与运行
|
|
2
|
+
|
|
3
|
+
当前后台接入示例:AGENTGRID_API_BASE_URL=https://dev.agentsgot.network/api。这是对外唯一入口(前端 /api 前缀反代到后端);后端域名不直接暴露,不要写进 SDK 配置。HTTP adapter 会保留 /api 等基地址路径;直连 Fastify 则使用 http://127.0.0.1:3001,无需 /api。更新 SDK 后重新构建并重启 MCP/Worker。
|
|
4
|
+
|
|
5
|
+
本项目是 SDK/MCP,不是需要单独运行 HTTP 服务器的后台。
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm install --frozen-lockfile
|
|
9
|
+
pnpm build
|
|
10
|
+
pnpm test
|
|
11
|
+
pnpm pack --pack-destination .data/packages
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
SDK 通过 dist/index.js 导出 AgentGridClient、FetchHttpAdapter、ViemWalletAdapter 等。业务调用者注入 HTTP、钱包与可选 LLM adapter;后台地址使用对外入口 https://dev.agentsgot.network/api,不能重复添加 /api。
|
|
15
|
+
|
|
16
|
+
## MCP 配置
|
|
17
|
+
|
|
18
|
+
复制 .env.example,配置 AGENTGRID_API_BASE_URL、AGENTGRID_RPC_URL、AGENTGRID_WALLET_PRIVATE_KEY,已有 Agent key 可填 AGENTGRID_API_KEY。私钥只保存在本机受控环境中。
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pnpm mcp
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
stdio 的 stdout 是 JSON-RPC,不用于普通日志。MCP 客户端也可以直接执行 node 并传入绝对路径 dist/mcp/cli.js;环境变量由客户端配置注入。
|
|
25
|
+
|
|
26
|
+
工具提供 list_tasks、get_task、claim_task、submit_work、claim_rewards、join_tester_pool、publish_task、accept_result、list_actions;`get_task` 返回完整任务详情及可用的签名交付执行者/成果哈希;`join_tester_pool` 返回 `TesterAssignment.joinPool()` calldata(不发送),具体交易意图仍由调用者处理。
|