@agenticprimitives/contracts 1.0.0-alpha.5 → 1.0.0-alpha.50
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 +119 -27
- package/README.md +47 -12
- package/deployments-base-sepolia.json +52 -1
- package/deployments-faithchain.json +103 -0
- package/deployments-hopechain.json +78 -0
- package/deployments-paymaster-anvil.json +1 -0
- package/deployments-registries-base-sepolia.json +1 -0
- package/deployments-registries-hopechain.json +1 -0
- package/dist/abi/AccountBootstrap.json +99 -0
- package/dist/abi/AgentAccount.json +461 -67
- package/dist/abi/AgentAccountFactory.json +309 -0
- package/dist/abi/AgentNameAttributeResolver.json +212 -0
- package/dist/abi/AgentNameRegistry.json +544 -0
- package/dist/abi/AgentNameUniversalResolver.json +222 -0
- package/dist/abi/AgentProfileResolver.json +236 -0
- package/dist/abi/AgentRegistryBase.json +1003 -0
- package/dist/abi/AgentRelationship.json +405 -0
- package/dist/abi/AgenticGovernance.json +155 -0
- package/dist/abi/AgreementRegistry.json +203 -5
- package/dist/abi/AllowedMethodsEnforcer.json +193 -0
- package/dist/abi/AllowedTargetsEnforcer.json +193 -0
- package/dist/abi/ApprovedHashRegistry.json +267 -2
- package/dist/abi/AttestationRegistry.json +242 -0
- package/dist/abi/AttributeStorage.json +24 -0
- package/dist/abi/CallDataHashEnforcer.json +193 -0
- package/dist/abi/CustodyPolicy.json +422 -55
- package/dist/abi/DelegationManager.json +292 -0
- package/dist/abi/DigestBindingEnforcer.json +541 -0
- package/dist/abi/Eip7702.json +13 -0
- package/dist/abi/EstateProjectionRegistry.json +599 -0
- package/dist/abi/Generation5Bridge.json +355 -0
- package/dist/abi/GeoFeatureRegistry.json +235 -0
- package/dist/abi/IAgentAccountFactoryView.json +26 -0
- package/dist/abi/IAgentAccountGovernanceTimelockView.json +15 -0
- package/dist/abi/IApprovedHashRegistryWrite.json +35 -0
- package/dist/abi/ICustodyEpochView.json +28 -0
- package/dist/abi/ICustodyPolicyAccountModuleView.json +31 -0
- package/dist/abi/ICustodyPolicyFactoryView.json +13 -0
- package/dist/abi/ICustodyPolicyPasskeyView.json +50 -0
- package/dist/abi/IDelegationManager.json +18 -0
- package/dist/abi/IGeneration4Reads.json +143 -0
- package/dist/abi/IGeneration5Account.json +33 -0
- package/dist/abi/IGeneration5Voucher.json +26 -0
- package/dist/abi/IMoveAccountView.json +57 -0
- package/dist/abi/IMoveCustodyView.json +169 -0
- package/dist/abi/IMoveFactoryView.json +41 -0
- package/dist/abi/IPaymentReceiptRegistry.json +50 -0
- package/dist/abi/IRedemptionContext.json +15 -0
- package/dist/abi/IRegistryMembershipPolicy.json +70 -0
- package/dist/abi/ITimelockVeto.json +93 -0
- package/dist/abi/ITreasurySpendPolicyAccountView.json +44 -0
- package/dist/abi/IUpgradeVoucherView.json +26 -0
- package/dist/abi/MockUSDC.json +621 -0
- package/dist/abi/OntologyTermRegistry.json +268 -0
- package/dist/abi/PayloadClassesEnforcer.json +310 -0
- package/dist/abi/PaymentEnforcer.json +639 -0
- package/dist/abi/PaymentEscrow.json +501 -0
- package/dist/abi/PaymentReceiptRegistry.json +388 -0
- package/dist/abi/PermissionlessSubregistry.json +353 -0
- package/dist/abi/PricedSubregistry.json +1141 -0
- package/dist/abi/QuorumEnforcer.json +209 -0
- package/dist/abi/ReceiptAnchorRegistry.json +346 -0
- package/dist/abi/RelationshipTypeRegistry.json +268 -0
- package/dist/abi/ShapeRegistry.json +268 -0
- package/dist/abi/SignatureVerifier.json +196 -0
- package/dist/abi/SkillDefinitionRegistry.json +235 -0
- package/dist/abi/SmartAgentPaymaster.json +445 -1
- package/dist/abi/StableProxyGoverned.json +190 -0
- package/dist/abi/StableProxyGovernedOneShot.json +172 -0
- package/dist/abi/TimestampEnforcer.json +193 -0
- package/dist/abi/TreasurySpendPolicy.json +667 -0
- package/dist/abi/UpgradeVoucher.json +328 -0
- package/dist/abi/ValueEnforcer.json +193 -0
- package/dist/abi/index.d.ts +35 -0
- package/dist/abi/index.js +35 -0
- package/dist/deployments/base-sepolia.d.ts +11 -0
- package/dist/deployments/base-sepolia.js +51 -28
- package/dist/deployments/faithchain.d.ts +77 -0
- package/dist/deployments/faithchain.js +107 -0
- package/dist/deployments/hopechain.d.ts +68 -0
- package/dist/deployments/hopechain.js +82 -0
- package/dist/deployments/index.d.ts +7 -2
- package/dist/deployments/index.js +15 -0
- package/dist/deployments/paymaster-anvil.d.ts +11 -0
- package/dist/deployments/paymaster-anvil.js +9 -0
- package/dist/deployments/registries-base-sepolia.d.ts +10 -0
- package/dist/deployments/registries-base-sepolia.js +8 -0
- package/dist/deployments/registries-hopechain.d.ts +10 -0
- package/dist/deployments/registries-hopechain.js +8 -0
- package/package.json +37 -7
- package/src/AccountBootstrap.sol +38 -0
- package/src/AgentAccount.sol +1091 -134
- package/src/AgentAccountFactory.sol +198 -21
- package/src/ApprovedHashRegistry.sol +134 -10
- package/src/IAgentAccount.sol +37 -0
- package/src/SmartAgentPaymaster.sol +275 -22
- package/src/UniversalSignatureValidator.sol +7 -0
- package/src/UpgradeVoucher.sol +87 -0
- package/src/agency/DelegationManager.sol +299 -76
- package/src/agency/ICaveatEnforcer.sol +10 -0
- package/src/agency/IDelegationManager.sol +37 -5
- package/src/agreement/AgreementRegistry.sol +105 -35
- package/src/attestation/AttestationRegistry.sol +220 -40
- package/src/custody/CustodyPolicy.sol +588 -70
- package/src/custody/TreasurySpendPolicy.sol +338 -0
- package/src/enforcers/AllowedMethodsEnforcer.sol +13 -2
- package/src/enforcers/AllowedTargetsEnforcer.sol +13 -2
- package/src/enforcers/CallDataHashEnforcer.sol +7 -1
- package/src/enforcers/DigestBindingEnforcer.sol +182 -0
- package/src/enforcers/PayloadClassesEnforcer.sol +36 -0
- package/src/enforcers/PaymentEnforcer.sol +291 -0
- package/src/enforcers/QuorumEnforcer.sol +24 -3
- package/src/enforcers/TimestampEnforcer.sol +7 -1
- package/src/enforcers/ValueEnforcer.sol +13 -2
- package/src/geo/GeoFeatureRegistry.sol +67 -22
- package/src/governance/AgenticGovernance.sol +187 -4
- package/src/governance/GovernanceManaged.sol +2 -0
- package/src/governance/StableProxyGoverned.sol +79 -0
- package/src/governance/StableProxyGovernedOneShot.sol +93 -0
- package/src/identity/AgentProfilePredicates.sol +23 -0
- package/src/identity/AgentProfileResolver.sol +22 -2
- package/src/libraries/Eip7702.sol +36 -0
- package/src/libraries/SignatureSlotRecovery.sol +28 -7
- package/src/libraries/SignatureVerifier.sol +52 -0
- package/src/libraries/WebAuthnLib.sol +16 -0
- package/src/migration/Generation5Bridge.sol +364 -0
- package/src/mocks/MockUSDC.sol +152 -0
- package/src/naming/AgentNameAttributeResolver.sol +29 -4
- package/src/naming/AgentNamePredicates.sol +89 -0
- package/src/naming/AgentNameRegistry.sol +324 -20
- package/src/naming/AgentNameUniversalResolver.sol +35 -2
- package/src/naming/PermissionlessSubregistry.sol +82 -25
- package/src/naming/PricedSubregistry.sol +293 -0
- package/src/ontology/AttributeStorage.sol +93 -80
- package/src/ontology/OntologyTermRegistry.sol +58 -2
- package/src/ontology/ShapeRegistry.sol +58 -2
- package/src/payments/PaymentEscrow.sol +187 -0
- package/src/payments/PaymentReceiptRegistry.sol +100 -0
- package/src/provenance/ReceiptAnchorRegistry.sol +67 -0
- package/src/registry/AgentRegistryBase.sol +372 -0
- package/src/registry/EstateProjectionRegistry.sol +177 -0
- package/src/registry/IRegistryMembershipPolicy.sol +30 -0
- package/src/relationships/AgentRelationship.sol +129 -8
- package/src/relationships/RelationshipTypeRegistry.sol +58 -2
- package/src/skills/SkillDefinitionRegistry.sol +61 -17
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.28;
|
|
3
|
+
|
|
4
|
+
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
|
|
5
|
+
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @title MockUSDC
|
|
9
|
+
* @notice Test USDC for the Base Sepolia x402 demos (spec 272, PAY-CON-3). 6 decimals, open mint +
|
|
10
|
+
* faucet, and full EIP-3009 (`transferWithAuthorization` / `receiveWithAuthorization` /
|
|
11
|
+
* `cancelAuthorization` / `authorizationState`) so the Wave-5 Coinbase-x402 interop adapter
|
|
12
|
+
* is a no-redeploy add (X402-D2 / PAY-WIRE-4).
|
|
13
|
+
*
|
|
14
|
+
* @dev DEV-ONLY: `mint`/`faucet` are open. NEVER a production asset. Wave-1 settlement is
|
|
15
|
+
* delegation-native (the {PaymentEnforcer}-gated `transfer`), so EIP-3009 is present but
|
|
16
|
+
* unused until Wave 5; shipping it now avoids a token redeploy.
|
|
17
|
+
*/
|
|
18
|
+
contract MockUSDC is ERC20 {
|
|
19
|
+
using ECDSA for bytes32;
|
|
20
|
+
|
|
21
|
+
// EIP-3009 type hashes
|
|
22
|
+
bytes32 public constant TRANSFER_WITH_AUTHORIZATION_TYPEHASH = keccak256(
|
|
23
|
+
"TransferWithAuthorization(address from,address to,uint256 value,uint256 validAfter,uint256 validBefore,bytes32 nonce)"
|
|
24
|
+
);
|
|
25
|
+
bytes32 public constant RECEIVE_WITH_AUTHORIZATION_TYPEHASH = keccak256(
|
|
26
|
+
"ReceiveWithAuthorization(address from,address to,uint256 value,uint256 validAfter,uint256 validBefore,bytes32 nonce)"
|
|
27
|
+
);
|
|
28
|
+
bytes32 public constant CANCEL_AUTHORIZATION_TYPEHASH =
|
|
29
|
+
keccak256("CancelAuthorization(address authorizer,bytes32 nonce)");
|
|
30
|
+
|
|
31
|
+
bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;
|
|
32
|
+
uint256 private immutable _CACHED_CHAIN_ID;
|
|
33
|
+
|
|
34
|
+
/// @notice EIP-3009: authorizer => nonce => used-or-canceled.
|
|
35
|
+
mapping(address => mapping(bytes32 => bool)) public authorizationState;
|
|
36
|
+
|
|
37
|
+
event AuthorizationUsed(address indexed authorizer, bytes32 indexed nonce);
|
|
38
|
+
event AuthorizationCanceled(address indexed authorizer, bytes32 indexed nonce);
|
|
39
|
+
|
|
40
|
+
error AuthNotYetValid();
|
|
41
|
+
error AuthExpired();
|
|
42
|
+
error AuthUsedOrCanceled();
|
|
43
|
+
error InvalidSignature();
|
|
44
|
+
error CallerMustBePayee();
|
|
45
|
+
|
|
46
|
+
constructor() ERC20("Mock USD Coin", "USDC") {
|
|
47
|
+
_CACHED_CHAIN_ID = block.chainid;
|
|
48
|
+
_CACHED_DOMAIN_SEPARATOR = _computeDomainSeparator();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function decimals() public pure override returns (uint8) {
|
|
52
|
+
return 6;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// ── dev faucet ──
|
|
56
|
+
function mint(address to, uint256 amount) external {
|
|
57
|
+
_mint(to, amount);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function faucet(uint256 amount) external {
|
|
61
|
+
_mint(msg.sender, amount);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// ── EIP-3009 ──
|
|
65
|
+
|
|
66
|
+
function DOMAIN_SEPARATOR() public view returns (bytes32) {
|
|
67
|
+
return block.chainid == _CACHED_CHAIN_ID ? _CACHED_DOMAIN_SEPARATOR : _computeDomainSeparator();
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function transferWithAuthorization(
|
|
71
|
+
address from,
|
|
72
|
+
address to,
|
|
73
|
+
uint256 value,
|
|
74
|
+
uint256 validAfter,
|
|
75
|
+
uint256 validBefore,
|
|
76
|
+
bytes32 nonce,
|
|
77
|
+
bytes calldata signature
|
|
78
|
+
) external {
|
|
79
|
+
_requireValidAuthorization(from, nonce, validAfter, validBefore);
|
|
80
|
+
_verify(
|
|
81
|
+
from,
|
|
82
|
+
keccak256(
|
|
83
|
+
abi.encode(TRANSFER_WITH_AUTHORIZATION_TYPEHASH, from, to, value, validAfter, validBefore, nonce)
|
|
84
|
+
),
|
|
85
|
+
signature
|
|
86
|
+
);
|
|
87
|
+
_markAuthorizationUsed(from, nonce);
|
|
88
|
+
_transfer(from, to, value);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function receiveWithAuthorization(
|
|
92
|
+
address from,
|
|
93
|
+
address to,
|
|
94
|
+
uint256 value,
|
|
95
|
+
uint256 validAfter,
|
|
96
|
+
uint256 validBefore,
|
|
97
|
+
bytes32 nonce,
|
|
98
|
+
bytes calldata signature
|
|
99
|
+
) external {
|
|
100
|
+
if (to != msg.sender) revert CallerMustBePayee();
|
|
101
|
+
_requireValidAuthorization(from, nonce, validAfter, validBefore);
|
|
102
|
+
_verify(
|
|
103
|
+
from,
|
|
104
|
+
keccak256(
|
|
105
|
+
abi.encode(RECEIVE_WITH_AUTHORIZATION_TYPEHASH, from, to, value, validAfter, validBefore, nonce)
|
|
106
|
+
),
|
|
107
|
+
signature
|
|
108
|
+
);
|
|
109
|
+
_markAuthorizationUsed(from, nonce);
|
|
110
|
+
_transfer(from, to, value);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function cancelAuthorization(address authorizer, bytes32 nonce, bytes calldata signature) external {
|
|
114
|
+
if (authorizationState[authorizer][nonce]) revert AuthUsedOrCanceled();
|
|
115
|
+
_verify(authorizer, keccak256(abi.encode(CANCEL_AUTHORIZATION_TYPEHASH, authorizer, nonce)), signature);
|
|
116
|
+
authorizationState[authorizer][nonce] = true;
|
|
117
|
+
emit AuthorizationCanceled(authorizer, nonce);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// ── internals ──
|
|
121
|
+
|
|
122
|
+
function _requireValidAuthorization(address from, bytes32 nonce, uint256 validAfter, uint256 validBefore)
|
|
123
|
+
private
|
|
124
|
+
view
|
|
125
|
+
{
|
|
126
|
+
if (block.timestamp <= validAfter) revert AuthNotYetValid();
|
|
127
|
+
if (block.timestamp >= validBefore) revert AuthExpired();
|
|
128
|
+
if (authorizationState[from][nonce]) revert AuthUsedOrCanceled();
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function _markAuthorizationUsed(address from, bytes32 nonce) private {
|
|
132
|
+
authorizationState[from][nonce] = true;
|
|
133
|
+
emit AuthorizationUsed(from, nonce);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function _verify(address signer, bytes32 structHash, bytes calldata signature) private view {
|
|
137
|
+
bytes32 digest = keccak256(abi.encodePacked("\x19\x01", DOMAIN_SEPARATOR(), structHash));
|
|
138
|
+
if (digest.recover(signature) != signer) revert InvalidSignature();
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function _computeDomainSeparator() private view returns (bytes32) {
|
|
142
|
+
return keccak256(
|
|
143
|
+
abi.encode(
|
|
144
|
+
keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
|
|
145
|
+
keccak256(bytes("Mock USD Coin")),
|
|
146
|
+
keccak256(bytes("2")),
|
|
147
|
+
block.chainid,
|
|
148
|
+
address(this)
|
|
149
|
+
)
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
pragma solidity ^0.8.28;
|
|
3
3
|
|
|
4
4
|
import "./AgentNameRegistry.sol";
|
|
5
|
+
import {Eip7702} from "../libraries/Eip7702.sol";
|
|
5
6
|
import "../ontology/AttributeStorage.sol";
|
|
7
|
+
import "../governance/StableProxyGoverned.sol";
|
|
6
8
|
|
|
7
9
|
/**
|
|
8
10
|
* @title AgentNameAttributeResolver
|
|
@@ -22,20 +24,24 @@ import "../ontology/AttributeStorage.sol";
|
|
|
22
24
|
* Per-spec simplifications kept from the pure key/value port:
|
|
23
25
|
* - No multi-coin (ENSIP-9) address records. Other-chain identifiers
|
|
24
26
|
* ride on the `atl:nativeId` predicate (a CAIP-10 string).
|
|
25
|
-
* - No aliases
|
|
26
|
-
*
|
|
27
|
+
* - No aliases or operator approvals. Rotation flows through the registry's `setOwner`, which changes
|
|
28
|
+
* who may write AND starts a new record epoch — records never carry over to a new owner (REG-4).
|
|
27
29
|
*
|
|
28
30
|
* SDK contract: `agenticprimitives/agent-naming/records` exposes
|
|
29
31
|
* the same predicate ids and routes encode / decode through the typed
|
|
30
32
|
* setters here. See `AgentNamePredicates.sol` for the canonical set.
|
|
31
33
|
*/
|
|
32
|
-
contract AgentNameAttributeResolver is AttributeStorage {
|
|
34
|
+
contract AgentNameAttributeResolver is AttributeStorage, StableProxyGoverned {
|
|
33
35
|
AgentNameRegistry public immutable REGISTRY;
|
|
34
36
|
|
|
35
37
|
error NotAuthorized();
|
|
36
38
|
error NodeNotFound();
|
|
37
39
|
|
|
38
|
-
|
|
40
|
+
/// @notice A DIRECT deployment, with no upgrade governance (frozen code, as before). Spec 447 — behind a stable
|
|
41
|
+
/// proxy, `initialize(governance_)` instead. `REGISTRY` and `ONTOLOGY` stay immutables: they are the
|
|
42
|
+
/// addresses of other stable proxies, which never change, so a fix is a new implementation built with
|
|
43
|
+
/// the same two addresses.
|
|
44
|
+
constructor(AgentNameRegistry registry, address ontology) AttributeStorage(ontology) initializer {
|
|
39
45
|
REGISTRY = registry;
|
|
40
46
|
}
|
|
41
47
|
|
|
@@ -86,10 +92,29 @@ contract AgentNameAttributeResolver is AttributeStorage {
|
|
|
86
92
|
_unset(node, predicate);
|
|
87
93
|
}
|
|
88
94
|
|
|
95
|
+
// ─── Record epoch (spec 445 / REG-4, REG-6) ─────────────────────
|
|
96
|
+
|
|
97
|
+
/// @dev Records are stored under `keccak256(node, ownerEpoch)`. The registry bumps a node's epoch on every
|
|
98
|
+
/// ownership change (`setOwner` to a different owner, or the re-registration of an expired name), so a
|
|
99
|
+
/// new owner starts with NO records: the previous owner's `atl:addr`, `atl:agentType`, endpoints and
|
|
100
|
+
/// card digest stop resolving in the same transaction, with no delete loop and no log scan (ADR-0012 —
|
|
101
|
+
/// the epoch is one `readContract`). A node that is not live (never registered, or EXPIRED) maps to
|
|
102
|
+
/// key zero, which no write path can reach (`_requireAuth` needs a live node, and a live key is always
|
|
103
|
+
/// a hash), so every getter of this resolver answers empty for it.
|
|
104
|
+
function _storageKey(bytes32 node) internal view override returns (bytes32) {
|
|
105
|
+
(bool live, uint64 epoch) = REGISTRY.recordState(node);
|
|
106
|
+
if (!live) return bytes32(0);
|
|
107
|
+
return keccak256(abi.encode(node, epoch));
|
|
108
|
+
}
|
|
109
|
+
|
|
89
110
|
// ─── Auth ───────────────────────────────────────────────────────
|
|
90
111
|
|
|
91
112
|
function _requireAuth(bytes32 node) internal view {
|
|
92
113
|
if (!REGISTRY.recordExists(node)) revert NodeNotFound();
|
|
114
|
+
Eip7702.refuseDelegatedEOA(msg.sender); // spec 448 §0 (EIP-7702)
|
|
93
115
|
if (msg.sender != REGISTRY.owner(node)) revert NotAuthorized();
|
|
94
116
|
}
|
|
117
|
+
|
|
118
|
+
/// @dev Spec 447 — storage gap: the contract may sit behind a stable proxy; layout gated by `check:storage-layouts`.
|
|
119
|
+
uint256[35] private __gap;
|
|
95
120
|
}
|
|
@@ -51,10 +51,83 @@ library AgentNamePredicates {
|
|
|
51
51
|
/// CustodyPolicy module. `address`.
|
|
52
52
|
bytes32 internal constant ATL_CUSTODY_POLICY = keccak256("atl:custodyPolicy");
|
|
53
53
|
|
|
54
|
+
/// `atl:accounts` — the name's accounts BY CHAIN (ap-federation spec 440 §C / spec 346 §3.8; the ENSIP-9
|
|
55
|
+
/// multi-coin `addr(node, coinType)` ported): a `string[]` of CAIP-10 ids, at most one per CAIP-2 chain,
|
|
56
|
+
/// written by the name owner. `atl:addr` stays the root-chain forward record and `atl:nativeId` the home
|
|
57
|
+
/// account; this lists every account the name resolves to, home and satellites, so a reader on another
|
|
58
|
+
/// chain finds the account that stands there. A reverse claim on that chain is honoured only when the
|
|
59
|
+
/// entry here agrees (ENSIP-19's rule). Evidence a reader checks, never authority.
|
|
60
|
+
bytes32 internal constant ATL_ACCOUNTS = keccak256("atl:accounts");
|
|
61
|
+
|
|
54
62
|
/// `atl:nativeId` — CAIP-10 chain-agnostic account identifier
|
|
55
63
|
/// (per ADR-0008). `string`.
|
|
56
64
|
bytes32 internal constant ATL_NATIVE_ID = keccak256("atl:nativeId");
|
|
57
65
|
|
|
66
|
+
/// `atl:connectionKind` — connection-bootstrap credential KIND (spec 280).
|
|
67
|
+
/// Stored as `bytes32` (hashed enum). Bound to CONNECTION_KIND_ENUM. OPT-IN,
|
|
68
|
+
/// owner-set, PUBLIC. Advertises how a returning person connects by name.
|
|
69
|
+
bytes32 internal constant ATL_CONNECTION_KIND = keccak256("atl:connectionKind");
|
|
70
|
+
|
|
71
|
+
/// `atl:connectionAddress` — connection-bootstrap credential ADDRESS (spec 280).
|
|
72
|
+
/// The custodian EOA (wallet) or social KMS C_sub. `address`. OPT-IN, owner-set,
|
|
73
|
+
/// PUBLIC pre-select hint only (NOT required to connect). Deliberate, documented
|
|
74
|
+
/// name→credential index (ADR-0040 amendment). Never set automatically.
|
|
75
|
+
bytes32 internal constant ATL_CONNECTION_ADDRESS = keccak256("atl:connectionAddress");
|
|
76
|
+
|
|
77
|
+
// ─── Derived type (spec 346 §2.3 / ADR-0061) ────────────────────
|
|
78
|
+
//
|
|
79
|
+
// SA-KEYED records on the AgentProfileResolver subject (NOT name-node records): the
|
|
80
|
+
// suffix of a typed name (.me .org .team .svc .workspace .treasury) is a CLAIM
|
|
81
|
+
// validated against these. `atl:agentKind` stays the 3-valued ROOT; `atl:agentType`
|
|
82
|
+
// is the closed DERIVED layer under it (team ⊂ org; service / workspace /
|
|
83
|
+
// treasury ⊂ service). Roles other than workspace are an open-set string.
|
|
84
|
+
|
|
85
|
+
/// `atl:agentType` — the derived agent type. `bytes32` (hashed enum). Bound to AGENT_TYPE_ENUM.
|
|
86
|
+
bytes32 internal constant ATL_AGENT_TYPE = keccak256("atl:agentType");
|
|
87
|
+
|
|
88
|
+
/// `atl:serviceRole` — open-set service role (`workspace` REQUIRED for that type). `string`.
|
|
89
|
+
bytes32 internal constant ATL_SERVICE_ROLE = keccak256("atl:serviceRole");
|
|
90
|
+
|
|
91
|
+
/// `atl:agentSubtype` — a VERTICAL subtype of the generic derived type (spec 346 §2.4), e.g. an app-registered
|
|
92
|
+
/// kind of organization. The vocabulary is the app's; the chain stores the slug. `string`.
|
|
93
|
+
bytes32 internal constant ATL_AGENT_SUBTYPE = keccak256("atl:agentSubtype");
|
|
94
|
+
|
|
95
|
+
/// `atl:cardDigest` — sha256 (as bytes32) of the RELEASED A2A Agent Card this name currently publishes
|
|
96
|
+
/// (spec 347 §8.3). Content-addresses the card; the card itself is served at the a2aEndpoint host's
|
|
97
|
+
/// `/.well-known/agent-card.json`. Never authority — a verifier compares the fetched bytes to this digest.
|
|
98
|
+
bytes32 internal constant ATL_CARD_DIGEST = keccak256("atl:cardDigest");
|
|
99
|
+
|
|
100
|
+
/// `atl:cardUri` — explicit URI of the released A2A Agent Card when it is not at the default well-known
|
|
101
|
+
/// path of the a2aEndpoint host (spec 347 §8.3). `string`.
|
|
102
|
+
bytes32 internal constant ATL_CARD_URI = keccak256("atl:cardUri");
|
|
103
|
+
|
|
104
|
+
/// Enum set bound to `atl:agentType`. Ten members; mirrors `types.DerivedAgentType`.
|
|
105
|
+
bytes32 internal constant AGENT_TYPE_ENUM = keccak256("atl:AgentTypeEnum");
|
|
106
|
+
|
|
107
|
+
bytes32 internal constant AGENT_TYPE_PERSON = keccak256("person");
|
|
108
|
+
bytes32 internal constant AGENT_TYPE_ORG = keccak256("org");
|
|
109
|
+
bytes32 internal constant AGENT_TYPE_TEAM = keccak256("team");
|
|
110
|
+
bytes32 internal constant AGENT_TYPE_SERVICE = keccak256("service");
|
|
111
|
+
bytes32 internal constant AGENT_TYPE_WORKSPACE = keccak256("workspace");
|
|
112
|
+
bytes32 internal constant AGENT_TYPE_TREASURY = keccak256("treasury");
|
|
113
|
+
bytes32 internal constant AGENT_TYPE_REGISTRY = keccak256("registry"); // the Service Agent that OPERATES a registry
|
|
114
|
+
bytes32 internal constant AGENT_TYPE_CHURCH = keccak256("church"); // organization-class (ADR-0061 amendment 2026-08-30)
|
|
115
|
+
bytes32 internal constant AGENT_TYPE_CIRCLE = keccak256("circle"); // organization-class
|
|
116
|
+
bytes32 internal constant AGENT_TYPE_HOUSEHOLD = keccak256("household"); // organization-class (spec 368, 2026-09-07)
|
|
117
|
+
|
|
118
|
+
// Per-root `rootKind` tags for the ten typed roots (AgentNameRegistry.initializeRoot). Mirrors
|
|
119
|
+
// agent-naming `rootKindForTld`. The untyped legacy root (.agent) carries KIND_AGENT.
|
|
120
|
+
bytes32 internal constant ROOT_KIND_PERSON = keccak256("namespace:Person");
|
|
121
|
+
bytes32 internal constant ROOT_KIND_ORGANIZATION = keccak256("namespace:Organization");
|
|
122
|
+
bytes32 internal constant ROOT_KIND_TEAM = keccak256("namespace:Team");
|
|
123
|
+
bytes32 internal constant ROOT_KIND_SERVICE = keccak256("namespace:Service");
|
|
124
|
+
bytes32 internal constant ROOT_KIND_WORKSPACE = keccak256("namespace:Workspace");
|
|
125
|
+
bytes32 internal constant ROOT_KIND_TREASURY = keccak256("namespace:Treasury");
|
|
126
|
+
bytes32 internal constant ROOT_KIND_REGISTRY = keccak256("namespace:Registry");
|
|
127
|
+
bytes32 internal constant ROOT_KIND_CHURCH = keccak256("namespace:Church");
|
|
128
|
+
bytes32 internal constant ROOT_KIND_CIRCLE = keccak256("namespace:Circle");
|
|
129
|
+
bytes32 internal constant ROOT_KIND_HOUSEHOLD = keccak256("namespace:Household");
|
|
130
|
+
|
|
58
131
|
// ─── Shape + enum-set ids ───────────────────────────────────────
|
|
59
132
|
|
|
60
133
|
/// `atl:AgentName` — the class id for ShapeRegistry validation.
|
|
@@ -71,4 +144,20 @@ library AgentNamePredicates {
|
|
|
71
144
|
bytes32 internal constant AGENT_KIND_PERSON = keccak256("person");
|
|
72
145
|
bytes32 internal constant AGENT_KIND_ORG = keccak256("org");
|
|
73
146
|
bytes32 internal constant AGENT_KIND_SERVICE = keccak256("service");
|
|
147
|
+
|
|
148
|
+
/// Enum set bound to `atl:connectionKind` (spec 280). Contains the
|
|
149
|
+
/// five hashed member ids below.
|
|
150
|
+
bytes32 internal constant CONNECTION_KIND_ENUM = keccak256("atl:ConnectionKindEnum");
|
|
151
|
+
|
|
152
|
+
bytes32 internal constant CONNECTION_KIND_WALLET = keccak256("wallet");
|
|
153
|
+
bytes32 internal constant CONNECTION_KIND_GOOGLE = keccak256("google");
|
|
154
|
+
bytes32 internal constant CONNECTION_KIND_YOUVERSION = keccak256("youversion");
|
|
155
|
+
bytes32 internal constant CONNECTION_KIND_PASSKEY = keccak256("passkey");
|
|
156
|
+
bytes32 internal constant CONNECTION_KIND_MULTI = keccak256("multi");
|
|
157
|
+
// Social/KMS-class kinds (specs 319/320) — per-subject C_sub custodians, code-flow sign-in.
|
|
158
|
+
// The attribute write path validates only the PREDICATE (OntologyTermRegistry.isActive), NOT the
|
|
159
|
+
// enum value, so these are publishable on the live deployment with no redeploy; the ShapeRegistry
|
|
160
|
+
// ConnectionKindEnum seed adds them for forward shape-validation correctness (Deploy.s.sol).
|
|
161
|
+
bytes32 internal constant CONNECTION_KIND_EMAIL = keccak256("email");
|
|
162
|
+
bytes32 internal constant CONNECTION_KIND_PHONE = keccak256("phone");
|
|
74
163
|
}
|