@agenticprimitives/contracts 1.0.0-alpha.11 → 1.0.0-alpha.13
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/AUDIT.md +2 -1
- package/deployments-base-sepolia.json +4 -3
- package/dist/abi/AgentRegistryBase.json +588 -0
- package/dist/abi/IRegistryMembershipPolicy.json +70 -0
- package/dist/abi/PaymentEnforcer.json +30 -1
- package/dist/abi/PaymentEscrow.json +25 -0
- package/dist/abi/index.d.ts +2 -0
- package/dist/abi/index.js +2 -0
- package/dist/deployments/base-sepolia.d.ts +1 -0
- package/dist/deployments/base-sepolia.js +4 -3
- package/package.json +1 -1
- package/src/enforcers/PaymentEnforcer.sol +25 -3
- package/src/payments/PaymentEscrow.sol +47 -20
- package/src/registry/AgentRegistryBase.sol +281 -0
- package/src/registry/IRegistryMembershipPolicy.sol +30 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.28;
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @title IRegistryMembershipPolicy
|
|
6
|
+
* @notice Pluggable membership/validation hook for {AgentRegistryBase} (spec 279 §4.2). It answers two
|
|
7
|
+
* yes/no questions and NOTHING else:
|
|
8
|
+
*
|
|
9
|
+
* - `canRegister` — may `subjectAgent` create `entryId` in `registryId` with these claims?
|
|
10
|
+
* - `canAdminister` — may a NON-subject `actor` suspend / revoke / update `entryId`?
|
|
11
|
+
*
|
|
12
|
+
* Implementations live OUTSIDE Ring 0 (issuer-attested, stake/bond, quorum-approved,
|
|
13
|
+
* domain-control-proof, skill-claim-proof, …) — they MUST NOT push vertical business logic into
|
|
14
|
+
* the registry base. Both methods are `view`, so {AgentRegistryBase} reaches them via STATICCALL
|
|
15
|
+
* (no state mutation, no reentrancy). A policy that returns `false` OR reverts is treated as a
|
|
16
|
+
* denial: the base fails closed (ADR-0013) — there is no second, weaker authorization path.
|
|
17
|
+
*/
|
|
18
|
+
interface IRegistryMembershipPolicy {
|
|
19
|
+
/// @return ok whether `subjectAgent` may register `entryId` in `registryId` with `cardHash`/`claimHashes`.
|
|
20
|
+
function canRegister(
|
|
21
|
+
bytes32 registryId,
|
|
22
|
+
bytes32 entryId,
|
|
23
|
+
address subjectAgent,
|
|
24
|
+
bytes32 cardHash,
|
|
25
|
+
bytes32[] calldata claimHashes
|
|
26
|
+
) external view returns (bool ok);
|
|
27
|
+
|
|
28
|
+
/// @return ok whether `actor` (not the entry's subject) may administer (suspend / revoke / update) the entry.
|
|
29
|
+
function canAdminister(bytes32 registryId, bytes32 entryId, address actor) external view returns (bool ok);
|
|
30
|
+
}
|