@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
package/dist/runner.js
ADDED
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import { randomSalt, testReportIdempotencyKey, } from "./sdk/client.js";
|
|
2
|
+
const ROLE_OF = {
|
|
3
|
+
executor: "executor",
|
|
4
|
+
tester: "tester",
|
|
5
|
+
arbitrator: "arbitrator",
|
|
6
|
+
publisher: "publisher",
|
|
7
|
+
any: "any",
|
|
8
|
+
};
|
|
9
|
+
function message(error) {
|
|
10
|
+
return error instanceof Error ? error.message : String(error);
|
|
11
|
+
}
|
|
12
|
+
function httpStatus(error) {
|
|
13
|
+
const value = error?.status;
|
|
14
|
+
return typeof value === "number" ? value : null;
|
|
15
|
+
}
|
|
16
|
+
/** Re-send a transaction for the same duty only after this long (the indexer may lag). */
|
|
17
|
+
export const RESEND_AFTER_MS = 10 * 60_000;
|
|
18
|
+
/** A deadline closer than this raises a deadline_warning event. */
|
|
19
|
+
export const DEADLINE_WARNING_MS = 6 * 3600_000;
|
|
20
|
+
/**
|
|
21
|
+
* Next-actions driven runner for one or more roles. Each `tick()` pulls
|
|
22
|
+
* GET /agents/me/next-actions, handles items for the enabled roles in priority order and returns
|
|
23
|
+
* a sanitized report. Transactions are only surfaced as intents unless `autoSend` is on.
|
|
24
|
+
*/
|
|
25
|
+
export class RoleRunner {
|
|
26
|
+
options;
|
|
27
|
+
constructor(options) {
|
|
28
|
+
this.options = options;
|
|
29
|
+
}
|
|
30
|
+
wants(item) {
|
|
31
|
+
const role = ROLE_OF[item.role];
|
|
32
|
+
return role === "any" || this.options.roles.includes(role);
|
|
33
|
+
}
|
|
34
|
+
async tick(now = new Date()) {
|
|
35
|
+
const report = {
|
|
36
|
+
asOf: now.toISOString(),
|
|
37
|
+
roles: this.options.roles,
|
|
38
|
+
expedited: false,
|
|
39
|
+
handled: [],
|
|
40
|
+
events: [],
|
|
41
|
+
warnings: [],
|
|
42
|
+
};
|
|
43
|
+
const next = await this.options.client.getNextActions();
|
|
44
|
+
report.warnings.push(...next.warnings);
|
|
45
|
+
const items = next.items.filter((item) => this.wants(item));
|
|
46
|
+
report.expedited = items.some((item) => item.priority <= 1);
|
|
47
|
+
for (const item of items) {
|
|
48
|
+
if (item.deadline && new Date(item.deadline).getTime() - now.getTime() < DEADLINE_WARNING_MS)
|
|
49
|
+
this.event(report, item, "deadline_warning", `${item.kind} due ${item.deadline}`);
|
|
50
|
+
try {
|
|
51
|
+
report.handled.push(await this.handle(item, report, next.address));
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
report.handled.push(this.result(item, "error", message(error)));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return report;
|
|
58
|
+
}
|
|
59
|
+
result(item, outcome, detail, extra = {}) {
|
|
60
|
+
return {
|
|
61
|
+
kind: item.kind,
|
|
62
|
+
subjectId: item.subject.id,
|
|
63
|
+
taskId: item.taskId,
|
|
64
|
+
outcome,
|
|
65
|
+
detail,
|
|
66
|
+
...extra,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
event(report, item, type, detail) {
|
|
70
|
+
report.events.push({ type, subjectId: item.subject.id, taskId: item.taskId, detail });
|
|
71
|
+
}
|
|
72
|
+
/** Send (autoSend) or surface a transaction intent; de-duplicates resends per duty. */
|
|
73
|
+
async transact(item, report, tx, detail, key = `tx:${item.kind}:${item.subject.id}`) {
|
|
74
|
+
const { checkpoints, client } = this.options;
|
|
75
|
+
const previous = await checkpoints.get(key);
|
|
76
|
+
if (previous && Date.now() - new Date(previous.sentAt).getTime() < RESEND_AFTER_MS)
|
|
77
|
+
return this.result(item, "skipped", `already sent ${previous.txHash}; waiting for indexer`, {
|
|
78
|
+
txHash: previous.txHash,
|
|
79
|
+
});
|
|
80
|
+
const permissionless = item.kind === "TRIGGER";
|
|
81
|
+
if (!this.options.autoSend || (permissionless && !this.options.sendTriggers)) {
|
|
82
|
+
this.event(report, item, "tx_pending_approval", detail);
|
|
83
|
+
return this.result(item, "pending-tx", detail, { pendingTx: tx });
|
|
84
|
+
}
|
|
85
|
+
try {
|
|
86
|
+
const txHash = await client.sendTransaction(tx);
|
|
87
|
+
await checkpoints.set(key, { txHash, sentAt: new Date().toISOString() });
|
|
88
|
+
return this.result(item, "done", detail, { txHash });
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
this.event(report, item, "tx_failed", `${detail}: ${message(error)}`);
|
|
92
|
+
throw error;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
/** Executor duty right after signing: commit, then reveal the tester draw. */
|
|
96
|
+
async drawTesters(item, report, taskId) {
|
|
97
|
+
const { client } = this.options;
|
|
98
|
+
if (item.kind !== "TESTER_DRAW_REVEAL") {
|
|
99
|
+
try {
|
|
100
|
+
await client.commitTesterDraw(taskId);
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
// 409 = already committed (e.g. a previous tick); continue to reveal.
|
|
104
|
+
if (httpStatus(error) !== 409)
|
|
105
|
+
throw error;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
try {
|
|
109
|
+
const draw = await client.revealTesterDraw(taskId);
|
|
110
|
+
this.event(report, item, "testers_drawn", `testers: ${draw.testers.join(", ")}`);
|
|
111
|
+
return this.result(item, "done", `drew ${draw.testers.length} testers`);
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
if (httpStatus(error) === 409)
|
|
115
|
+
return this.result(item, "skipped", "seed block not mined yet; reveal on next tick");
|
|
116
|
+
throw error;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
async handle(item, report, principalAddress) {
|
|
120
|
+
const { client, handlers = {} } = this.options;
|
|
121
|
+
const taskId = item.taskId;
|
|
122
|
+
const id = item.subject.id;
|
|
123
|
+
switch (item.kind) {
|
|
124
|
+
case "CLAIM_HEARTBEAT": {
|
|
125
|
+
await client.heartbeatClaim(id);
|
|
126
|
+
return this.result(item, "done", "claim lease renewed");
|
|
127
|
+
}
|
|
128
|
+
case "SUBMIT_DELIVERY": {
|
|
129
|
+
if (!handlers.produceWork || !taskId)
|
|
130
|
+
return this.result(item, "skipped", "no produceWork handler; deliver manually");
|
|
131
|
+
const work = await handlers.produceWork(await client.getTask(taskId));
|
|
132
|
+
const signed = await client.submitWork({
|
|
133
|
+
claimId: id,
|
|
134
|
+
files: work.files,
|
|
135
|
+
...(work.evidence === undefined ? {} : { evidence: work.evidence }),
|
|
136
|
+
idempotencyKey: `delivery:${id}`,
|
|
137
|
+
});
|
|
138
|
+
this.event(report, item, "delivery_signed", `submission ${signed.id}`);
|
|
139
|
+
return this.drawTesters(item, report, taskId);
|
|
140
|
+
}
|
|
141
|
+
case "SIGN_DELIVERY":
|
|
142
|
+
await client.signDelivery(id);
|
|
143
|
+
this.event(report, item, "delivery_signed", `submission ${id}`);
|
|
144
|
+
return taskId
|
|
145
|
+
? this.drawTesters(item, report, taskId)
|
|
146
|
+
: this.result(item, "done", "delivery signed");
|
|
147
|
+
case "TESTER_DRAW_COMMIT":
|
|
148
|
+
case "TESTER_DRAW_REVEAL":
|
|
149
|
+
if (!taskId)
|
|
150
|
+
return this.result(item, "skipped", "missing taskId");
|
|
151
|
+
return this.drawTesters(item, report, taskId);
|
|
152
|
+
case "SUBMIT_TEST_REPORT": {
|
|
153
|
+
if (!taskId)
|
|
154
|
+
return this.result(item, "skipped", "missing taskId");
|
|
155
|
+
const retest = /retest/iu.test(item.hint);
|
|
156
|
+
const seen = await this.options.checkpoints.get(`assigned:${id}`);
|
|
157
|
+
if (!seen) {
|
|
158
|
+
this.event(report, item, "assigned_as_tester", retest ? `retest seat ${id}` : `submission ${id}`);
|
|
159
|
+
await this.options.checkpoints.set(`assigned:${id}`, true);
|
|
160
|
+
}
|
|
161
|
+
if (!handlers.evaluateDelivery)
|
|
162
|
+
return this.result(item, "skipped", "no evaluateDelivery handler; evaluate manually");
|
|
163
|
+
const task = await client.getTask(taskId);
|
|
164
|
+
const evaluation = await handlers.evaluateDelivery({ task, submissionId: id });
|
|
165
|
+
const expected = task.specification?.criteria.map((criterion) => criterion.id) ?? [];
|
|
166
|
+
const covered = new Set(evaluation.criteria.map((criterion) => criterion.criterionId));
|
|
167
|
+
const missing = expected.filter((criterionId) => !covered.has(criterionId));
|
|
168
|
+
if (missing.length > 0)
|
|
169
|
+
return this.result(item, "error", `evaluation misses criteria: ${missing.join(", ")}`);
|
|
170
|
+
const submitted = await client.submitTestReport({
|
|
171
|
+
taskId,
|
|
172
|
+
submissionId: id,
|
|
173
|
+
approved: evaluation.approved,
|
|
174
|
+
criteria: evaluation.criteria,
|
|
175
|
+
summary: evaluation.summary,
|
|
176
|
+
idempotencyKey: retest
|
|
177
|
+
? `retest-report:${taskId}:${id}`
|
|
178
|
+
: testReportIdempotencyKey(taskId, id),
|
|
179
|
+
});
|
|
180
|
+
this.event(report, item, "report_submitted", `report ${submitted.id}`);
|
|
181
|
+
return this.result(item, "done", `${retest ? "retest " : ""}report ${submitted.id} approved=${evaluation.approved}`);
|
|
182
|
+
}
|
|
183
|
+
case "SUBMIT_FALLBACK_REPORT": {
|
|
184
|
+
if (!handlers.evaluateDispute)
|
|
185
|
+
return this.result(item, "skipped", "no evaluateDispute handler; review manually");
|
|
186
|
+
const evaluation = await handlers.evaluateDispute(await client.getDispute(id));
|
|
187
|
+
const intent = await client.createFallbackReportIntent(id, evaluation);
|
|
188
|
+
return this.transact(item, report, intent.tx, "submitFallbackReport");
|
|
189
|
+
}
|
|
190
|
+
case "POST_RESULT": {
|
|
191
|
+
if (!taskId)
|
|
192
|
+
return this.result(item, "skipped", "missing taskId");
|
|
193
|
+
try {
|
|
194
|
+
const intent = await client.getFinalResult(taskId);
|
|
195
|
+
return this.transact(item, report, intent.tx, "postResult");
|
|
196
|
+
}
|
|
197
|
+
catch (error) {
|
|
198
|
+
if (httpStatus(error) === 409)
|
|
199
|
+
return this.result(item, "skipped", `not yet postable: ${message(error)}`);
|
|
200
|
+
throw error;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
case "APPEAL_DECISION": {
|
|
204
|
+
if (!taskId)
|
|
205
|
+
return this.result(item, "skipped", "missing taskId");
|
|
206
|
+
const task = await client.getTask(taskId);
|
|
207
|
+
if (!handlers.decideAppeal) {
|
|
208
|
+
this.event(report, item, "appeal_decision_needed", "verify the posted result; waiveAppeal if no objection, else openAppeal");
|
|
209
|
+
return this.result(item, "skipped", "no decideAppeal handler; verify the result and call waive_appeal or open_appeal");
|
|
210
|
+
}
|
|
211
|
+
const decision = await handlers.decideAppeal({
|
|
212
|
+
task,
|
|
213
|
+
address: principalAddress.toLowerCase(),
|
|
214
|
+
});
|
|
215
|
+
if (decision.action === "waive") {
|
|
216
|
+
const intent = await client.waiveAppeal(taskId);
|
|
217
|
+
return this.transact(item, report, intent.tx, "waiveAppeal");
|
|
218
|
+
}
|
|
219
|
+
const intent = await client.openAppeal(taskId, { statement: decision.statement });
|
|
220
|
+
this.event(report, item, "appeal_decision_needed", decision.statement);
|
|
221
|
+
this.event(report, item, "tx_pending_approval", "openAppeal requires explicit user approval");
|
|
222
|
+
return this.result(item, "pending-tx", "openAppeal intent ready; send after user approval", {
|
|
223
|
+
pendingTx: intent.tx,
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
case "REVIEW_RESULT": {
|
|
227
|
+
if (!taskId)
|
|
228
|
+
return this.result(item, "skipped", "missing taskId");
|
|
229
|
+
this.event(report, item, "review_required", `review before ${item.deadline}`);
|
|
230
|
+
if (!handlers.reviewResult)
|
|
231
|
+
return this.result(item, "skipped", "awaiting the publisher's accept/reject decision");
|
|
232
|
+
const decision = await handlers.reviewResult(await client.getTask(taskId));
|
|
233
|
+
const review = await client.reviewTask(taskId, decision);
|
|
234
|
+
return this.transact(item, report, review.tx, decision.accept ? "accept" : "reject");
|
|
235
|
+
}
|
|
236
|
+
case "CONFIRM_ARBITRATION_SEAT": {
|
|
237
|
+
this.event(report, item, "arbitration_case", `confirm seat before ${item.deadline}`);
|
|
238
|
+
const intent = await client.confirmArbitrationSeat(id);
|
|
239
|
+
return this.transact(item, report, intent.tx, "confirm arbitration seat");
|
|
240
|
+
}
|
|
241
|
+
case "COMMIT_ARBITRATION_VOTE":
|
|
242
|
+
return this.commitVote(item, report);
|
|
243
|
+
case "REVEAL_ARBITRATION_VOTE":
|
|
244
|
+
return this.revealVote(item, report);
|
|
245
|
+
case "CLAIM_REWARDS": {
|
|
246
|
+
const scheduleIds = item.request.body?.scheduleIds ?? [];
|
|
247
|
+
this.event(report, item, "rewards_claimable", item.hint);
|
|
248
|
+
const intent = await client.createRewardClaim(scheduleIds);
|
|
249
|
+
return this.transact(item, report, intent.tx, "claim rewards");
|
|
250
|
+
}
|
|
251
|
+
case "TRIGGER": {
|
|
252
|
+
const calldata = item.trigger?.calldata;
|
|
253
|
+
if (!calldata)
|
|
254
|
+
return this.result(item, "skipped", "trigger without calldata");
|
|
255
|
+
return this.transact(item, report, calldata, item.hint);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
return this.result(item, "skipped", "unknown action");
|
|
259
|
+
}
|
|
260
|
+
async commitVote(item, report) {
|
|
261
|
+
const { client, checkpoints, handlers = {} } = this.options;
|
|
262
|
+
const caseId = item.subject.id;
|
|
263
|
+
const key = `vote:${caseId}`;
|
|
264
|
+
let vote = await checkpoints.get(key);
|
|
265
|
+
if (!vote) {
|
|
266
|
+
if (!handlers.judgeDispute)
|
|
267
|
+
return this.result(item, "skipped", "no judgeDispute handler; judge the case manually");
|
|
268
|
+
const votes = await handlers.judgeDispute(await client.getDispute(caseId));
|
|
269
|
+
vote = { caseId, salt: randomSalt(), votes };
|
|
270
|
+
// Persist salt + votes before anything is sent: losing them makes reveal impossible.
|
|
271
|
+
await checkpoints.set(key, vote);
|
|
272
|
+
}
|
|
273
|
+
const intent = await client.createArbitrationVoteIntent(caseId, vote.votes, vote.salt);
|
|
274
|
+
const handled = await this.transact(item, report, intent.commitTx, "commit vote");
|
|
275
|
+
if (handled.outcome === "done")
|
|
276
|
+
this.event(report, item, "vote_committed", caseId);
|
|
277
|
+
return handled;
|
|
278
|
+
}
|
|
279
|
+
async revealVote(item, report) {
|
|
280
|
+
const { client, checkpoints } = this.options;
|
|
281
|
+
const caseId = item.subject.id;
|
|
282
|
+
const vote = await checkpoints.get(`vote:${caseId}`);
|
|
283
|
+
if (!vote)
|
|
284
|
+
return this.result(item, "error", "no persisted salt for this case; reveal needs the exact salt and votes used at commit");
|
|
285
|
+
const intent = await client.createArbitrationVoteIntent(caseId, vote.votes, vote.salt);
|
|
286
|
+
const handled = await this.transact(item, report, intent.revealTx, "reveal vote");
|
|
287
|
+
if (handled.outcome === "done")
|
|
288
|
+
this.event(report, item, "vote_revealed", caseId);
|
|
289
|
+
return handled;
|
|
290
|
+
}
|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IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;QAClF,IAAI,OAAO,CAAC,OAAO,KAAK,MAAM;YAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,CAAC,CAAC;QAClF,OAAO,OAAO,CAAC;IACjB,CAAC;CACF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Role } from "./roles.js";
|
|
2
|
+
export interface RoleSchedule {
|
|
3
|
+
/** Job name used by `agentsgot run`, the skills and checkpoints. */
|
|
4
|
+
name: string;
|
|
5
|
+
/** "interval" jobs run every `everySeconds`; "event" jobs run as soon as a next-action appears. */
|
|
6
|
+
trigger: "interval" | "event";
|
|
7
|
+
everySeconds: number;
|
|
8
|
+
/** Cadence while a deadline-bearing duty is in its last 20% (expedited mode): half the interval. */
|
|
9
|
+
expeditedSeconds: number;
|
|
10
|
+
/** Whether the job can produce a caller-paid transaction (sent only with --auto-send). */
|
|
11
|
+
onChain: boolean;
|
|
12
|
+
description: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ScheduleRuntime {
|
|
15
|
+
/** Backend runtime claimHeartbeatTimeoutSeconds (also the online window). Default 1800. */
|
|
16
|
+
claimHeartbeatTimeoutSeconds?: number;
|
|
17
|
+
/** Status report interval; `--report-interval`. Default 3600. */
|
|
18
|
+
reportIntervalSeconds?: number;
|
|
19
|
+
}
|
|
20
|
+
/** Safety rule: never poll slower than 1/6 of the window the job protects. */
|
|
21
|
+
export declare function safeInterval(preferredSeconds: number, windowSeconds?: number): number;
|
|
22
|
+
/** Jobs for one role: the common ones plus the role-specific ones. */
|
|
23
|
+
export declare function roleSchedules(role: Role, runtime?: ScheduleRuntime): RoleSchedule[];
|
|
24
|
+
/** Union of schedules for several roles, de-duplicated by name (shortest interval wins). */
|
|
25
|
+
export declare function mergedSchedules(roles: readonly Role[], runtime?: ScheduleRuntime): RoleSchedule[];
|
|
26
|
+
export type DeadlineMode = "normal" | "target-passed" | "expedited" | "overdue";
|
|
27
|
+
/**
|
|
28
|
+
* Where `now` falls inside a [start, deadline] window: past 50% = submission target passed,
|
|
29
|
+
* last 20% = expedited (poll at half interval, report immediately), past the end = overdue.
|
|
30
|
+
*/
|
|
31
|
+
export declare function deadlineMode(start: Date, deadline: Date, now: Date): DeadlineMode;
|
|
32
|
+
/** Interval to use for a job given whether any duty is in expedited mode. */
|
|
33
|
+
export declare function effectiveInterval(schedule: RoleSchedule, expedited: boolean): number;
|
|
34
|
+
//# sourceMappingURL=schedules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedules.d.ts","sourceRoot":"","sources":["../src/schedules.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAKvC,MAAM,WAAW,YAAY;IAC3B,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IACb,mGAAmG;IACnG,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,oGAAoG;IACpG,gBAAgB,EAAE,MAAM,CAAC;IACzB,0FAA0F;IAC1F,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,2FAA2F;IAC3F,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,iEAAiE;IACjE,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,8EAA8E;AAC9E,wBAAgB,YAAY,CAAC,gBAAgB,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAGrF;AAuID,sEAAsE;AACtE,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,GAAE,eAAoB,GAAG,YAAY,EAAE,CAMvF;AAED,4FAA4F;AAC5F,wBAAgB,eAAe,CAC7B,KAAK,EAAE,SAAS,IAAI,EAAE,EACtB,OAAO,GAAE,eAAoB,GAC5B,YAAY,EAAE,CAkBhB;AAED,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,eAAe,GAAG,WAAW,GAAG,SAAS,CAAC;AAEhF;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,GAAG,YAAY,CAOjF;AAED,6EAA6E;AAC7E,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,OAAO,GAAG,MAAM,CAEpF"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { defaultParams } from "#shared/params";
|
|
2
|
+
const p = defaultParams;
|
|
3
|
+
const HOUR = 3600;
|
|
4
|
+
/** Safety rule: never poll slower than 1/6 of the window the job protects. */
|
|
5
|
+
export function safeInterval(preferredSeconds, windowSeconds) {
|
|
6
|
+
if (!windowSeconds)
|
|
7
|
+
return preferredSeconds;
|
|
8
|
+
return Math.max(30, Math.min(preferredSeconds, Math.floor(windowSeconds / 6)));
|
|
9
|
+
}
|
|
10
|
+
function job(name, preferredSeconds, description, options = {}) {
|
|
11
|
+
const everySeconds = safeInterval(preferredSeconds, options.window);
|
|
12
|
+
return {
|
|
13
|
+
name,
|
|
14
|
+
trigger: options.trigger ?? "interval",
|
|
15
|
+
everySeconds,
|
|
16
|
+
expeditedSeconds: Math.max(30, Math.floor(everySeconds / 2)),
|
|
17
|
+
onChain: options.onChain ?? false,
|
|
18
|
+
description,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function common(runtime) {
|
|
22
|
+
const online = runtime.claimHeartbeatTimeoutSeconds ?? 1800;
|
|
23
|
+
return [
|
|
24
|
+
job("presence", 600, "POST /agents/heartbeat so the network counts the agent online.", {
|
|
25
|
+
window: online,
|
|
26
|
+
}),
|
|
27
|
+
job("next-actions", 300, "GET /agents/me/next-actions and dispatch items by kind."),
|
|
28
|
+
job("status-report", runtime.reportIntervalSeconds ?? HOUR, "Write a sanitized status report (terminal, ~/.agentsgot/reports, optional webhook)."),
|
|
29
|
+
];
|
|
30
|
+
}
|
|
31
|
+
function rewards() {
|
|
32
|
+
return job("rewards", 6 * HOUR, "Check task reward schedules and daily mining allocations separately; claim each with its own endpoint in batches of up to 100.", { onChain: true });
|
|
33
|
+
}
|
|
34
|
+
function receivesDailyEmission(role) {
|
|
35
|
+
return role === "executor" || role === "tester" || role === "arbitrator";
|
|
36
|
+
}
|
|
37
|
+
function byRole(role, runtime) {
|
|
38
|
+
const lease = runtime.claimHeartbeatTimeoutSeconds ?? 1800;
|
|
39
|
+
switch (role) {
|
|
40
|
+
case "executor":
|
|
41
|
+
return [
|
|
42
|
+
job("scan-tasks", 300, "Scan PUBLISHED/RUNNING tasks; claim only after user approval or a matching auto-claim rule."),
|
|
43
|
+
job("claim-heartbeat", 300, "POST /claims/{id}/heartbeat before leaseExpiresAt.", {
|
|
44
|
+
window: lease,
|
|
45
|
+
}),
|
|
46
|
+
job("after-sign", 60, "Right after the delivery is signed: commit + reveal the tester draw (no waiting).", { trigger: "event" }),
|
|
47
|
+
job("progress", 900, "Own tasks: build postResult once testers reported; SETTLE_TASK after the review window.", { onChain: true, window: p.publisherReviewHours * HOUR }),
|
|
48
|
+
];
|
|
49
|
+
case "tester":
|
|
50
|
+
return [
|
|
51
|
+
job("assignments", 120, "Poll for TesterAssigned and appeal-retest seats (event-driven with a webhook).", {
|
|
52
|
+
window: p.testerReportWindowHours * HOUR,
|
|
53
|
+
}),
|
|
54
|
+
job("evaluate", 120, `Evaluate immediately (including retest seats); submit by 50% of the ${p.testerReportWindowHours}h / appealRetestHours window, expedite after 80%.`, { trigger: "event" }),
|
|
55
|
+
job("stake-watch", HOUR, `Stake still >= ${p.testerMinStakeAgt} AGT, still in pool, lock/cooldown state.`),
|
|
56
|
+
];
|
|
57
|
+
case "arbitrator":
|
|
58
|
+
return [
|
|
59
|
+
job("cases", 300, "GET /arbitrator/cases.", { window: p.arbAcceptWindowHours * HOUR }),
|
|
60
|
+
job("confirm", 300, `Report each new case to the user; confirm within ${p.arbAcceptWindowHours}h after approval.`, { trigger: "event", onChain: true, window: p.arbAcceptWindowHours * HOUR }),
|
|
61
|
+
job("commit", HOUR, `Commit in the first half of the ${p.arbCommitWindowHours}h window; salt persisted locally.`, { trigger: "event", onChain: true, window: p.arbCommitWindowHours * HOUR }),
|
|
62
|
+
job("reveal", 600, `Reveal as soon as the ${p.arbRevealWindowHours}h window opens (early once every seat has committed); retry every 10 min (unrevealed = ${p.missedRevealSlashBps / 100}% slash).`, { trigger: "event", onChain: true, window: p.arbRevealWindowHours * HOUR }),
|
|
63
|
+
job("stake-watch", HOUR, `Stake >= ${p.arbitratorMinStakeAgt} AGT, response rate >= ${p.arbResponseRateMinBps / 100}%, suspension or debt.`),
|
|
64
|
+
];
|
|
65
|
+
case "publisher":
|
|
66
|
+
return [
|
|
67
|
+
job("review", HOUR, `Remind the user to accept/reject RESULT_POSTED tasks within ${p.publisherReviewHours}h (again at 6h left).`, { onChain: true, window: p.publisherReviewHours * HOUR }),
|
|
68
|
+
job("maintenance", 24 * HOUR, "Check tasks in the maintenance period."),
|
|
69
|
+
];
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/** Jobs for one role: the common ones plus the role-specific ones. */
|
|
73
|
+
export function roleSchedules(role, runtime = {}) {
|
|
74
|
+
return [
|
|
75
|
+
...common(runtime),
|
|
76
|
+
...(receivesDailyEmission(role) ? [rewards()] : []),
|
|
77
|
+
...byRole(role, runtime),
|
|
78
|
+
];
|
|
79
|
+
}
|
|
80
|
+
/** Union of schedules for several roles, de-duplicated by name (shortest interval wins). */
|
|
81
|
+
export function mergedSchedules(roles, runtime = {}) {
|
|
82
|
+
const merged = new Map();
|
|
83
|
+
for (const role of roles)
|
|
84
|
+
for (const entry of roleSchedules(role, runtime)) {
|
|
85
|
+
const existing = merged.get(entry.name);
|
|
86
|
+
merged.set(entry.name, existing
|
|
87
|
+
? {
|
|
88
|
+
...existing,
|
|
89
|
+
everySeconds: Math.min(existing.everySeconds, entry.everySeconds),
|
|
90
|
+
expeditedSeconds: Math.min(existing.expeditedSeconds, entry.expeditedSeconds),
|
|
91
|
+
onChain: existing.onChain || entry.onChain,
|
|
92
|
+
}
|
|
93
|
+
: entry);
|
|
94
|
+
}
|
|
95
|
+
return [...merged.values()];
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Where `now` falls inside a [start, deadline] window: past 50% = submission target passed,
|
|
99
|
+
* last 20% = expedited (poll at half interval, report immediately), past the end = overdue.
|
|
100
|
+
*/
|
|
101
|
+
export function deadlineMode(start, deadline, now) {
|
|
102
|
+
const total = deadline.getTime() - start.getTime();
|
|
103
|
+
const elapsed = now.getTime() - start.getTime();
|
|
104
|
+
if (total <= 0 || elapsed >= total)
|
|
105
|
+
return "overdue";
|
|
106
|
+
if (elapsed >= total * 0.8)
|
|
107
|
+
return "expedited";
|
|
108
|
+
if (elapsed >= total * 0.5)
|
|
109
|
+
return "target-passed";
|
|
110
|
+
return "normal";
|
|
111
|
+
}
|
|
112
|
+
/** Interval to use for a job given whether any duty is in expedited mode. */
|
|
113
|
+
export function effectiveInterval(schedule, expedited) {
|
|
114
|
+
return expedited ? schedule.expeditedSeconds : schedule.everySeconds;
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=schedules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedules.js","sourceRoot":"","sources":["../src/schedules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAG/C,MAAM,CAAC,GAAG,aAAa,CAAC;AACxB,MAAM,IAAI,GAAG,IAAI,CAAC;AAsBlB,8EAA8E;AAC9E,MAAM,UAAU,YAAY,CAAC,gBAAwB,EAAE,aAAsB;IAC3E,IAAI,CAAC,aAAa;QAAE,OAAO,gBAAgB,CAAC;IAC5C,OAAO,IAAI,CAAC,GAAG,CAA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E,MAAM,UAAU,iBAAiB,CAAC,QAAsB,EAAE,SAAkB;IAC1E,OAAO,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC;AACvE,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Base64 helpers for Node and browsers alike (the SDK does not depend on Buffer). */
|
|
2
|
+
export declare function bytesToBase64(bytes: Uint8Array): string;
|
|
3
|
+
export declare function base64ToBytes(value: string): Uint8Array<ArrayBuffer>;
|
|
4
|
+
//# sourceMappingURL=base64.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base64.d.ts","sourceRoot":"","sources":["../../src/sdk/base64.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAKvD;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAAC,WAAW,CAAC,CAKpE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Base64 helpers for Node and browsers alike (the SDK does not depend on Buffer). */
|
|
2
|
+
export function bytesToBase64(bytes) {
|
|
3
|
+
let binary = "";
|
|
4
|
+
for (let offset = 0; offset < bytes.length; offset += 0x8000)
|
|
5
|
+
binary += String.fromCharCode(...bytes.subarray(offset, offset + 0x8000));
|
|
6
|
+
return btoa(binary);
|
|
7
|
+
}
|
|
8
|
+
export function base64ToBytes(value) {
|
|
9
|
+
const binary = atob(value.replace(/\s/gu, ""));
|
|
10
|
+
const bytes = new Uint8Array(binary.length);
|
|
11
|
+
for (let index = 0; index < binary.length; index += 1)
|
|
12
|
+
bytes[index] = binary.charCodeAt(index);
|
|
13
|
+
return bytes;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=base64.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base64.js","sourceRoot":"","sources":["../../src/sdk/base64.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,MAAM,UAAU,aAAa,CAAC,KAAiB;IAC7C,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,KAAK,IAAI,MAAM,GAAG,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE,MAAM,IAAI,MAAM;QAC1D,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC;IAC5E,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;AACtB,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,KAAa;IACzC,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC;IAC/C,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC5C,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC;QAAE,KAAK,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IAC/F,OAAO,KAAK,CAAC;AACf,CAAC"}
|