@agenticprimitives/agent-profile 1.0.0-alpha.12 → 1.0.0-alpha.14
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/README.md +5 -5
- package/dist/caip10.d.ts +3 -2
- package/dist/caip10.d.ts.map +1 -1
- package/dist/caip10.js +3 -2
- package/dist/caip10.js.map +1 -1
- package/dist/card.d.ts +64 -0
- package/dist/card.d.ts.map +1 -0
- package/dist/card.js +133 -0
- package/dist/card.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +33 -4
- package/dist/types.d.ts.map +1 -1
- package/package.json +9 -5
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @agenticprimitives/agent-profile
|
|
2
2
|
|
|
3
|
-
**A profile describes the identity; it never becomes the identity.** Agent discovery is consolidating right now —
|
|
3
|
+
**A profile describes the identity; it never becomes the identity.** Agent discovery is consolidating right now — on-chain registries, DNS/PKI agent naming, Hedera-style profiles, A2A cards, and MCP registries. Each standard wants to be the place an agent "lives." This package takes the other position: every agent already lives at one canonical ERC-4337 Smart Agent address, and a profile is an AP-native, typed, content-hashed manifest *about* that address ([ADR-0010](../../docs/architecture/decisions/0010-smart-agent-canonical-identifier.md)). Registry entries in any standard are external projections/facets that back-link to the same anchor — so one identity serves all of them, and no registry can quietly fork who the agent is.
|
|
4
4
|
|
|
5
5
|
Part of [agenticprimitives](../../README.md) — the trust substrate for the agent economy: one canonical Smart Agent identity with custody, delegation, naming, credentials, and audit evidence designed as one system.
|
|
6
6
|
|
|
@@ -13,7 +13,7 @@ Where [`agent-naming`](../agent-naming) maps names → addresses, this package m
|
|
|
13
13
|
|
|
14
14
|
- You author or validate an `AgentCard` (person, org, service, treasury, MCP server, multisig).
|
|
15
15
|
- You need a deterministic `profileContentHash` for the on-chain `metadata-hash` anchor — so a tampered profile is detectable by anyone holding the hash.
|
|
16
|
-
- You need CAIP-10 `nativeId` encode/decode (strict encode, permissive decode)
|
|
16
|
+
- You need CAIP-10 `nativeId` encode/decode (strict encode, permissive decode) as a portable back-link to the canonical SA ([ADR-0008](../../docs/architecture/decisions/0008-caip10-nativeid-record-predicate.md)).
|
|
17
17
|
- You need endpoint-verification methods (DNS TXT, signed URL, HTTP challenge, verifiable presentation) — Phase 2+.
|
|
18
18
|
- You build encoded calls to register or update on-chain profile anchors.
|
|
19
19
|
|
|
@@ -61,16 +61,16 @@ const nativeId = buildCaip10Address({
|
|
|
61
61
|
|
|
62
62
|
## How it's different
|
|
63
63
|
|
|
64
|
-
The reference points are
|
|
64
|
+
The reference points are registry and agent-card ecosystems, but this package defines the AP-native primitive:
|
|
65
65
|
|
|
66
|
-
- **Anchor, not authority.** In registry-first designs, the registry entry *is* the agent, and each registry mints its own notion of identity. Here the `AgentCard` is
|
|
66
|
+
- **Anchor, not authority.** In registry-first designs, the registry entry *is* the agent, and each registry mints its own notion of identity. Here the `AgentCard` is AP-native typed JSON discriminated on `type`, and every external registry facet must back-link to the canonical Smart Agent via CAIP-10 `nativeId` ([spec 220 §4](../../specs/220-agent-identity-bootstrap.md)). One agent, many registries, zero identity forks.
|
|
67
67
|
- **Tamper evidence built in.** `profileContentHash` is deterministic canonical JSON — sorted keys, fixed numeric format — matching the on-chain `metadata-hash` predicate. Two semantically equal profiles hash identically; a mutated profile cannot pass against its anchor.
|
|
68
68
|
- **Endpoint claims are not endpoint proof.** A profile may *claim* an MCP or A2A URL; `VerificationMethod` is the explicit, caller-selected proof that the Smart Agent controls it. We never silently pick a verification method — you always know what "verified" meant.
|
|
69
69
|
- **CAIP-10 done strictly.** Encoders reject unknown namespaces (Phase 1: eip155, hedera, solana); decoders accept any grammar-valid CAIP-10 string for forward compatibility.
|
|
70
70
|
|
|
71
71
|
## Main concepts
|
|
72
72
|
|
|
73
|
-
- **AgentCard**:
|
|
73
|
+
- **AgentCard**: AP-native typed JSON discriminated by `type`, with type-specific sub-objects (`AiAgentProfile`, `McpServerProfile`, `MultisigProfile`, `ServiceProfile`).
|
|
74
74
|
- **Profile facet**: `metadata-uri` + `metadata-hash` pointing at the canonical SA.
|
|
75
75
|
- **CAIP-10 `nativeId`**: the cross-registry back-link; must match the SA on EVM chains.
|
|
76
76
|
- **Verification**: proves an MCP/A2A URL is controlled by the SA (distinct from naming).
|
package/dist/caip10.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* CAIP-10 chain-agnostic account identifier helpers
|
|
3
|
-
*
|
|
2
|
+
* CAIP-10 chain-agnostic account identifier helpers. AP uses CAIP-10
|
|
3
|
+
* as a portable back-link to the canonical Smart Agent (ADR-0008);
|
|
4
|
+
* external registry-specific identifiers are derived outside Ring 0.
|
|
4
5
|
*
|
|
5
6
|
* Subpath: `@agenticprimitives/agent-profile/caip10`.
|
|
6
7
|
*
|
package/dist/caip10.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"caip10.d.ts","sourceRoot":"","sources":["../src/caip10.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"caip10.d.ts","sourceRoot":"","sources":["../src/caip10.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAE5D,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAM3E,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC;AAC3C,OAAO,EAAE,0BAA0B,EAAE,CAAC;AAItC;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa,CAcpE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAMtD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEpD"}
|
package/dist/caip10.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* CAIP-10 chain-agnostic account identifier helpers
|
|
3
|
-
*
|
|
2
|
+
* CAIP-10 chain-agnostic account identifier helpers. AP uses CAIP-10
|
|
3
|
+
* as a portable back-link to the canonical Smart Agent (ADR-0008);
|
|
4
|
+
* external registry-specific identifiers are derived outside Ring 0.
|
|
4
5
|
*
|
|
5
6
|
* Subpath: `@agenticprimitives/agent-profile/caip10`.
|
|
6
7
|
*
|
package/dist/caip10.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"caip10.js","sourceRoot":"","sources":["../src/caip10.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"caip10.js","sourceRoot":"","sources":["../src/caip10.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAQjD,OAAO,EAAE,0BAA0B,EAAE,CAAC;AAEtC,MAAM,cAAc,GAAG,kEAAkE,CAAC;AAE1F;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAkB;IACnD,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAChD,IAAI,CAAC,0BAA0B,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;QAC/C,MAAM,IAAI,kBAAkB,CAC1B,GAAG,SAAS,IAAI,SAAS,IAAI,OAAO,EAAE,EACtC,cAAc,SAAS,uBAAuB,CAAC,GAAG,0BAA0B,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAC3F,CAAC;IACJ,CAAC;IACD,MAAM,iBAAiB,GAAG,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;IACnF,MAAM,GAAG,GAAG,GAAG,SAAS,IAAI,SAAS,IAAI,iBAAiB,EAAE,CAAC;IAC7D,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,kBAAkB,CAAC,GAAG,EAAE,gCAAgC,CAAC,CAAC;IACtE,CAAC;IACD,OAAO,GAAoB,CAAC;AAC9B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,MAAM,CAAC,GAAG,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrC,IAAI,CAAC,CAAC,EAAE,CAAC;QACP,MAAM,IAAI,kBAAkB,CAAC,KAAK,EAAE,gCAAgC,CAAC,CAAC;IACxE,CAAC;IACD,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CAAE,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CAAE,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAE,EAAE,CAAC;AAChE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,KAAa;IACzC,OAAO,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACpC,CAAC"}
|
package/dist/card.d.ts
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Signed agent card bundle (spec 279 §3.2) — the discovery-substrate primitive that lets a verifier prove
|
|
3
|
+
* `cardHash → subjectAgent` WITHOUT trusting the registry or server that served the card.
|
|
4
|
+
*
|
|
5
|
+
* Subpath: `@agenticprimitives/agent-profile/card`.
|
|
6
|
+
*
|
|
7
|
+
* Shape: `cardHash` = sha256 of the canonical-JSON card; the subject Smart Agent signs (ERC-1271) a digest
|
|
8
|
+
* binding `{cardHash, subjectAgent, issuedAt, expiresAt, chainId, verifyingContract}`. Verification
|
|
9
|
+
* recomputes the card hash (catches a card tamper) AND re-checks the subject SA's ERC-1271 signature over
|
|
10
|
+
* that digest (authoritative — catches a tamper that also rewrote the hash). Both the signer and the
|
|
11
|
+
* on-chain ERC-1271 read are INJECTED so the module stays a pure, network-free helper (ADR-0006/0021);
|
|
12
|
+
* fail-closed throughout (ADR-0013).
|
|
13
|
+
*
|
|
14
|
+
* This is the off-chain card whose hash a registry entry references (`@agenticprimitives/registry-kit`).
|
|
15
|
+
* It is descriptive evidence only and carries NO authority to act.
|
|
16
|
+
*/
|
|
17
|
+
import { type Address, type Hex } from 'viem';
|
|
18
|
+
import type { AgentCard, Sha256, SignedAgentCardBundleV1 } from './types.js';
|
|
19
|
+
/** sha256 over the canonical-JSON encoding of a card → `sha256:<hex>`. Deterministic across runtimes
|
|
20
|
+
* (UTF-8 byte-level). Reuses {@link canonicalProfileJson} so the bytes hashed here match the package's
|
|
21
|
+
* one canonical card encoding. */
|
|
22
|
+
export declare function hashAgentCard(card: AgentCard): Sha256;
|
|
23
|
+
/** Injected ERC-1271 read — `verifyingContract.isValidSignature(hash, signature)` resolved to a bool.
|
|
24
|
+
* Satisfied structurally by a viem `PublicClient` (`verifyHash`). */
|
|
25
|
+
export interface Erc1271Verifier {
|
|
26
|
+
verifyHash(args: {
|
|
27
|
+
address: Address;
|
|
28
|
+
hash: Hex;
|
|
29
|
+
signature: Hex;
|
|
30
|
+
}): Promise<boolean>;
|
|
31
|
+
}
|
|
32
|
+
/** Injected Smart-Agent signer: signs the 32-byte digest, returning the ERC-1271-validatable signature. */
|
|
33
|
+
export type SmartAgentCardSigner = (digest: Hex) => Promise<Hex>;
|
|
34
|
+
export interface BuildSignedAgentCardInput {
|
|
35
|
+
card: AgentCard;
|
|
36
|
+
/** The canonical Smart Agent the card describes. Also the signer + verifying contract in V1. */
|
|
37
|
+
subjectAgent: Address;
|
|
38
|
+
chainId: number;
|
|
39
|
+
issuedAt: string;
|
|
40
|
+
expiresAt?: string;
|
|
41
|
+
/** ERC-1271 verifying contract; defaults to `subjectAgent` (the SA validates its own card). */
|
|
42
|
+
verifyingContract?: Address;
|
|
43
|
+
}
|
|
44
|
+
/** Build a signed card bundle: hash the card, have the subject SA sign the digest (ERC-1271), return the
|
|
45
|
+
* signed {@link SignedAgentCardBundleV1}. */
|
|
46
|
+
export declare function buildSignedAgentCardBundle(input: BuildSignedAgentCardInput, sign: SmartAgentCardSigner): Promise<SignedAgentCardBundleV1>;
|
|
47
|
+
export type VerifySignedAgentCardResult = {
|
|
48
|
+
ok: true;
|
|
49
|
+
subjectAgent: Address;
|
|
50
|
+
cardHash: Sha256;
|
|
51
|
+
card: AgentCard;
|
|
52
|
+
} | {
|
|
53
|
+
ok: false;
|
|
54
|
+
reason: 'bad_shape' | 'card_hash_mismatch' | 'subject_mismatch' | 'expired' | 'signature_invalid';
|
|
55
|
+
};
|
|
56
|
+
/** Verify a signed card bundle WITHOUT trusting whoever served it: recompute `cardHash` from the card
|
|
57
|
+
* (catches a card tamper that left the hash stale), confirm the proof is self-asserted by the subject SA
|
|
58
|
+
* (signer == verifyingContract == subjectAgent — V1), enforce expiry, then re-check the subject SA's
|
|
59
|
+
* ERC-1271 signature over the digest (authoritative). Fail-closed: any anomaly → `ok:false`. */
|
|
60
|
+
export declare function verifySignedAgentCardBundle(bundle: SignedAgentCardBundleV1, opts: {
|
|
61
|
+
verifier: Erc1271Verifier;
|
|
62
|
+
now?: number;
|
|
63
|
+
}): Promise<VerifySignedAgentCardResult>;
|
|
64
|
+
//# sourceMappingURL=card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../src/card.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAA+B,KAAK,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAE3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAE7E;;mCAEmC;AACnC,wB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,2BAA2B,CAAC,CAkDtC"}
|
package/dist/card.js
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Signed agent card bundle (spec 279 §3.2) — the discovery-substrate primitive that lets a verifier prove
|
|
3
|
+
* `cardHash → subjectAgent` WITHOUT trusting the registry or server that served the card.
|
|
4
|
+
*
|
|
5
|
+
* Subpath: `@agenticprimitives/agent-profile/card`.
|
|
6
|
+
*
|
|
7
|
+
* Shape: `cardHash` = sha256 of the canonical-JSON card; the subject Smart Agent signs (ERC-1271) a digest
|
|
8
|
+
* binding `{cardHash, subjectAgent, issuedAt, expiresAt, chainId, verifyingContract}`. Verification
|
|
9
|
+
* recomputes the card hash (catches a card tamper) AND re-checks the subject SA's ERC-1271 signature over
|
|
10
|
+
* that digest (authoritative — catches a tamper that also rewrote the hash). Both the signer and the
|
|
11
|
+
* on-chain ERC-1271 read are INJECTED so the module stays a pure, network-free helper (ADR-0006/0021);
|
|
12
|
+
* fail-closed throughout (ADR-0013).
|
|
13
|
+
*
|
|
14
|
+
* This is the off-chain card whose hash a registry entry references (`@agenticprimitives/registry-kit`).
|
|
15
|
+
* It is descriptive evidence only and carries NO authority to act.
|
|
16
|
+
*/
|
|
17
|
+
import { sha256 as viemSha256, toHex } from 'viem';
|
|
18
|
+
import { canonicalProfileJson } from './profile.js';
|
|
19
|
+
/** sha256 over the canonical-JSON encoding of a card → `sha256:<hex>`. Deterministic across runtimes
|
|
20
|
+
* (UTF-8 byte-level). Reuses {@link canonicalProfileJson} so the bytes hashed here match the package's
|
|
21
|
+
* one canonical card encoding. */
|
|
22
|
+
export function hashAgentCard(card) {
|
|
23
|
+
return `sha256:${viemSha256(toHex(canonicalProfileJson(card))).slice(2)}`;
|
|
24
|
+
}
|
|
25
|
+
/** Deterministic JSON (sorted keys, `undefined` dropped) for the signed-card proof body. */
|
|
26
|
+
function canonicalize(v) {
|
|
27
|
+
if (v === null || typeof v !== 'object')
|
|
28
|
+
return JSON.stringify(v) ?? 'null';
|
|
29
|
+
if (Array.isArray(v))
|
|
30
|
+
return `[${v.map(canonicalize).join(',')}]`;
|
|
31
|
+
const o = v;
|
|
32
|
+
return `{${Object.keys(o)
|
|
33
|
+
.sort()
|
|
34
|
+
.filter((k) => o[k] !== undefined)
|
|
35
|
+
.map((k) => `${JSON.stringify(k)}:${canonicalize(o[k])}`)
|
|
36
|
+
.join(',')}}`;
|
|
37
|
+
}
|
|
38
|
+
/** The 32-byte digest (0x-hex) the subject SA signs / the ERC-1271 read validates over. Binds the card
|
|
39
|
+
* hash to the subject + chain + verifying contract, so a card cannot be replayed for another SA/chain. */
|
|
40
|
+
function cardDigest(b) {
|
|
41
|
+
return viemSha256(toHex(canonicalize({
|
|
42
|
+
cardHash: b.cardHash,
|
|
43
|
+
subjectAgent: b.subjectAgent.toLowerCase(),
|
|
44
|
+
issuedAt: b.issuedAt,
|
|
45
|
+
expiresAt: b.expiresAt,
|
|
46
|
+
chainId: b.chainId,
|
|
47
|
+
verifyingContract: b.verifyingContract.toLowerCase(),
|
|
48
|
+
})));
|
|
49
|
+
}
|
|
50
|
+
/** Build a signed card bundle: hash the card, have the subject SA sign the digest (ERC-1271), return the
|
|
51
|
+
* signed {@link SignedAgentCardBundleV1}. */
|
|
52
|
+
export async function buildSignedAgentCardBundle(input, sign) {
|
|
53
|
+
const verifyingContract = input.verifyingContract ?? input.subjectAgent;
|
|
54
|
+
const cardHash = hashAgentCard(input.card);
|
|
55
|
+
const signature = await sign(cardDigest({
|
|
56
|
+
cardHash,
|
|
57
|
+
subjectAgent: input.subjectAgent,
|
|
58
|
+
issuedAt: input.issuedAt,
|
|
59
|
+
expiresAt: input.expiresAt,
|
|
60
|
+
chainId: input.chainId,
|
|
61
|
+
verifyingContract,
|
|
62
|
+
}));
|
|
63
|
+
return {
|
|
64
|
+
type: 'SignedAgentCardBundleV1',
|
|
65
|
+
card: input.card,
|
|
66
|
+
cardHash,
|
|
67
|
+
subjectAgent: input.subjectAgent,
|
|
68
|
+
issuedAt: input.issuedAt,
|
|
69
|
+
expiresAt: input.expiresAt,
|
|
70
|
+
proof: {
|
|
71
|
+
type: 'ERC1271SmartAgentSignature',
|
|
72
|
+
chainId: input.chainId,
|
|
73
|
+
verifyingContract,
|
|
74
|
+
signer: input.subjectAgent,
|
|
75
|
+
signature,
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
/** Verify a signed card bundle WITHOUT trusting whoever served it: recompute `cardHash` from the card
|
|
80
|
+
* (catches a card tamper that left the hash stale), confirm the proof is self-asserted by the subject SA
|
|
81
|
+
* (signer == verifyingContract == subjectAgent — V1), enforce expiry, then re-check the subject SA's
|
|
82
|
+
* ERC-1271 signature over the digest (authoritative). Fail-closed: any anomaly → `ok:false`. */
|
|
83
|
+
export async function verifySignedAgentCardBundle(bundle, opts) {
|
|
84
|
+
if (!bundle ||
|
|
85
|
+
bundle.type !== 'SignedAgentCardBundleV1' ||
|
|
86
|
+
!bundle.card ||
|
|
87
|
+
!bundle.proof?.signature ||
|
|
88
|
+
bundle.proof.type !== 'ERC1271SmartAgentSignature') {
|
|
89
|
+
return { ok: false, reason: 'bad_shape' };
|
|
90
|
+
}
|
|
91
|
+
let recomputed;
|
|
92
|
+
try {
|
|
93
|
+
recomputed = hashAgentCard(bundle.card);
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
return { ok: false, reason: 'bad_shape' }; // invalid card shape
|
|
97
|
+
}
|
|
98
|
+
if (recomputed !== bundle.cardHash)
|
|
99
|
+
return { ok: false, reason: 'card_hash_mismatch' };
|
|
100
|
+
// V1: the subject SA self-asserts its own card. A delegated signer is a future version.
|
|
101
|
+
const subject = bundle.subjectAgent.toLowerCase();
|
|
102
|
+
if (bundle.proof.signer.toLowerCase() !== subject || bundle.proof.verifyingContract.toLowerCase() !== subject) {
|
|
103
|
+
return { ok: false, reason: 'subject_mismatch' };
|
|
104
|
+
}
|
|
105
|
+
if (bundle.expiresAt) {
|
|
106
|
+
const exp = Date.parse(bundle.expiresAt);
|
|
107
|
+
const now = opts.now ?? Date.now();
|
|
108
|
+
if (!Number.isNaN(exp) && now > exp)
|
|
109
|
+
return { ok: false, reason: 'expired' };
|
|
110
|
+
}
|
|
111
|
+
let valid;
|
|
112
|
+
try {
|
|
113
|
+
valid = await opts.verifier.verifyHash({
|
|
114
|
+
address: bundle.proof.verifyingContract,
|
|
115
|
+
hash: cardDigest({
|
|
116
|
+
cardHash: bundle.cardHash,
|
|
117
|
+
subjectAgent: bundle.subjectAgent,
|
|
118
|
+
issuedAt: bundle.issuedAt,
|
|
119
|
+
expiresAt: bundle.expiresAt,
|
|
120
|
+
chainId: bundle.proof.chainId,
|
|
121
|
+
verifyingContract: bundle.proof.verifyingContract,
|
|
122
|
+
}),
|
|
123
|
+
signature: bundle.proof.signature,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
catch {
|
|
127
|
+
return { ok: false, reason: 'signature_invalid' };
|
|
128
|
+
}
|
|
129
|
+
if (!valid)
|
|
130
|
+
return { ok: false, reason: 'signature_invalid' };
|
|
131
|
+
return { ok: true, subjectAgent: bundle.subjectAgent, cardHash: bundle.cardHash, card: bundle.card };
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=card.js.map
|
package/dist/card.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.js","sourceRoot":"","sources":["../src/card.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,KAAK,EAA0B,MAAM,MAAM,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAGpD;;mCAEmC;AACnC,MAAM,UAAU,aAAa,CAAC,IAAe;IAC3C,OAAO,UAAU,UAAU,CAAC,KAAK,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAY,CAAC;AACtF,CAA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BAC3B,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO;gBAC7B,iBAAiB,EAAE,MAAM,CAAC,KAAK,CAAC,iBAAiB;aAClD,CAAC;YACF,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,SAAS;SAClC,CAAC,CAAC;IACL,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,mBAAmB,EAAE,CAAC;IACpD,CAAC;IACD,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,mBAAmB,EAAE,CAAC;IAC9D,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;AACvG,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export { CAIP10_NAMESPACE_ALLOWLIST, AGENT_CARD_SCHEMA_VERSION, AUTH_ORIGIN, } from './constants.js';
|
|
2
2
|
export { buildCaip10Address, parseCaip10, isValidCaip10, type Caip10Parts, } from './caip10.js';
|
|
3
3
|
export { canonicalProfileJson, profileContentHash, } from './profile.js';
|
|
4
|
+
export { hashAgentCard, buildSignedAgentCardBundle, verifySignedAgentCardBundle, type Erc1271Verifier, type SmartAgentCardSigner, type BuildSignedAgentCardInput, type VerifySignedAgentCardResult, } from './card.js';
|
|
4
5
|
export { InvalidProfileError, ProfileHashMismatchError, EndpointVerificationError, InvalidCaip10Error, } from './errors.js';
|
|
5
|
-
export type { ProfileType, Caip10Address, VerificationMethod, AiAgentProfile, McpServerProfile, MultisigProfile, ServiceProfile, AgentCard, AgentIdentityClientOpts, PublishProfileInput, } from './types.js';
|
|
6
|
+
export type { ProfileType, Caip10Address, VerificationMethod, AiAgentProfile, McpServerProfile, MultisigProfile, ServiceProfile, AgentCard, Sha256, SignedAgentCardBundleV1, AgentIdentityClientOpts, PublishProfileInput, } from './types.js';
|
|
6
7
|
export { AgentIdentityClient, type WriteContext } from './client.js';
|
|
7
8
|
export { agentProfileResolverAbi } from './abis.js';
|
|
8
9
|
export { buildRegisterProfileCall, buildSetProfileMetadataCall, buildSetProfileStringCall, buildSetProfileAddressCall, buildSetProfileBytes32Call, buildSetProfileActiveCall, type ContractCall, } from './calls.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,EACzB,WAAW,GACZ,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,KAAK,WAAW,GACjB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,EACzB,WAAW,GACZ,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,KAAK,WAAW,GACjB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,aAAa,EACb,0BAA0B,EAC1B,2BAA2B,EAC3B,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,GACjC,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,SAAS,EACT,MAAM,EACN,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAMrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAIpD,OAAO,EACL,wBAAwB,EACxB,2BAA2B,EAC3B,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,EAC1B,yBAAyB,EACzB,KAAK,YAAY,GAClB,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
export { CAIP10_NAMESPACE_ALLOWLIST, AGENT_CARD_SCHEMA_VERSION, AUTH_ORIGIN, } from './constants.js';
|
|
10
10
|
export { buildCaip10Address, parseCaip10, isValidCaip10, } from './caip10.js';
|
|
11
11
|
export { canonicalProfileJson, profileContentHash, } from './profile.js';
|
|
12
|
+
// Signed agent card bundle (spec 279 §3.2) — prove `cardHash → subjectAgent` without trusting the server.
|
|
13
|
+
export { hashAgentCard, buildSignedAgentCardBundle, verifySignedAgentCardBundle, } from './card.js';
|
|
12
14
|
export { InvalidProfileError, ProfileHashMismatchError, EndpointVerificationError, InvalidCaip10Error, } from './errors.js';
|
|
13
15
|
export { AgentIdentityClient } from './client.js';
|
|
14
16
|
// Phase 3 contract ABIs (live at deployed addresses recorded in
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,EAAE;AACF,OAAO;AACP,0CAA0C;AAC1C,2BAA2B;AAC3B,gDAAgD;AAChD,8EAA8E;AAC9E,2EAA2E;AAE3E,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,EACzB,WAAW,GACZ,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,aAAa,GAEd,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,EAAE;AACF,OAAO;AACP,0CAA0C;AAC1C,2BAA2B;AAC3B,gDAAgD;AAChD,8EAA8E;AAC9E,2EAA2E;AAE3E,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,EACzB,WAAW,GACZ,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,aAAa,GAEd,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AAEtB,0GAA0G;AAC1G,OAAO,EACL,aAAa,EACb,0BAA0B,EAC1B,2BAA2B,GAK5B,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAiBrB,OAAO,EAAE,mBAAmB,EAAqB,MAAM,aAAa,CAAC;AAErE,gEAAgE;AAChE,mEAAmE;AACnE,+DAA+D;AAC/D,0CAA0C;AAC1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAEpD,kEAAkE;AAClE,yDAAyD;AACzD,OAAO,EACL,wBAAwB,EACxB,2BAA2B,EAC3B,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,EAC1B,yBAAyB,GAE1B,MAAM,YAAY,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Address, Hex, Caip10Address } from '@agenticprimitives/types';
|
|
2
2
|
export type { Caip10Address };
|
|
3
3
|
/**
|
|
4
|
-
* Discriminator for AgentCard sub-shapes.
|
|
5
|
-
*
|
|
4
|
+
* Discriminator for AP-native AgentCard sub-shapes. Borrows the useful
|
|
5
|
+
* typed-profile idea from external registry/card ecosystems while keeping
|
|
6
|
+
* Ring 0 vocabulary AP-owned:
|
|
6
7
|
* - `treasury` (custody-policy-governed asset account)
|
|
7
8
|
* - `multisig` (collective Smart Agent with named members)
|
|
8
9
|
*
|
|
@@ -12,8 +13,8 @@ export type { Caip10Address };
|
|
|
12
13
|
*/
|
|
13
14
|
export type ProfileType = 'person' | 'org' | 'service' | 'treasury' | 'mcpServer' | 'multisig';
|
|
14
15
|
/**
|
|
15
|
-
* Endpoint-control verification methods
|
|
16
|
-
*
|
|
16
|
+
* Endpoint-control verification methods. Inspired by external agent-card
|
|
17
|
+
* verification patterns, but not tied to any DNS/PKI registry integration.
|
|
17
18
|
*
|
|
18
19
|
* - `dns-txt` — owner publishes a TXT record at a known label;
|
|
19
20
|
* resolver fetches and matches against the on-chain digest.
|
|
@@ -64,6 +65,34 @@ export interface ServiceProfile extends BaseProfile {
|
|
|
64
65
|
endpoint?: string;
|
|
65
66
|
}
|
|
66
67
|
export type AgentCard = AiAgentProfile | McpServerProfile | MultisigProfile | ServiceProfile;
|
|
68
|
+
/** sha256 content hash, e.g. `sha256:ab12…`. The discovery substrate hashes cards with sha256
|
|
69
|
+
* (distinct from the keccac `profileContentHash` used as the on-chain `metadata-hash` predicate). */
|
|
70
|
+
export type Sha256 = `sha256:${string}`;
|
|
71
|
+
/**
|
|
72
|
+
* A self-asserted, SA-signed agent card (spec 279 §3.2). The distinct guarantee: a verifier can prove
|
|
73
|
+
* `cardHash → subjectAgent` WITHOUT trusting the registry or server that served the card — the subject
|
|
74
|
+
* Smart Agent signs (via ERC-1271) a digest binding the card hash to its own address + chain. This is the
|
|
75
|
+
* card that a registry entry's `cardHash` references; it is descriptive evidence and carries NO authority to act.
|
|
76
|
+
*/
|
|
77
|
+
export interface SignedAgentCardBundleV1 {
|
|
78
|
+
type: 'SignedAgentCardBundleV1';
|
|
79
|
+
card: AgentCard;
|
|
80
|
+
/** sha256 over the canonical-JSON card (`hashAgentCard`). */
|
|
81
|
+
cardHash: Sha256;
|
|
82
|
+
/** The canonical Smart Agent this card is a facet of (= signer = verifyingContract in V1). */
|
|
83
|
+
subjectAgent: Address;
|
|
84
|
+
issuedAt: string;
|
|
85
|
+
expiresAt?: string;
|
|
86
|
+
proof: {
|
|
87
|
+
type: 'ERC1271SmartAgentSignature';
|
|
88
|
+
chainId: number;
|
|
89
|
+
/** The ERC-1271 contract whose `isValidSignature` validates the signature (the subject SA in V1). */
|
|
90
|
+
verifyingContract: Address;
|
|
91
|
+
/** The signing identity (the subject SA in V1). */
|
|
92
|
+
signer: Address;
|
|
93
|
+
signature: Hex;
|
|
94
|
+
};
|
|
95
|
+
}
|
|
67
96
|
export interface AgentIdentityClientOpts {
|
|
68
97
|
rpcUrl: string;
|
|
69
98
|
chainId: number;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAK5E,YAAY,EAAE,aAAa,EAAE,CAAC;AAE9B
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAK5E,YAAY,EAAE,aAAa,EAAE,CAAC;AAE9B;;;;;;;;;;GAUG;AACH,MAAM,MAAM,WAAW,GACnB,QAAQ,GACR,KAAK,GACL,SAAS,GACT,UAAU,GACV,WAAW,GACX,UAAU,CAAC;AAEf;;;;;;;;;;;GAWG;AACH,MAA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W,uBAAuB;IACtC,IAAI,EAAE,yBAAyB,CAAC;IAChC,IAAI,EAAE,SAAS,CAAC;IAChB,6DAA6D;IAC7D,QAAQ,EAAE,MAAM,CAAC;IACjB,8FAA8F;IAC9F,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE;QACL,IAAI,EAAE,4BAA4B,CAAC;QACnC,OAAO,EAAE,MAAM,CAAC;QAChB,qGAAqG;QACrG,iBAAiB,EAAE,OAAO,CAAC;QAC3B,mDAAmD;QACnD,MAAM,EAAE,OAAO,CAAC;QAChB,SAAS,EAAE,GAAG,CAAC;KAChB,CAAC;CACH;AAED,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,kDAAkD;IAClD,KAAK,EAAE,OAAO,CAAC;IACf,4EAA4E;IAC5E,OAAO,EAAE,SAAS,CAAC;IACnB;;;;;OAKG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,2EAA2E;IAC3E,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB;;;;OAIG;IACH,YAAY,CAAC,EAAE;QACb,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,SAAS,CAAC,EAAE,GAAG,CAAC;QAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;KAC3B,CAAC;CACH"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agenticprimitives/agent-profile",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
4
|
-
"description": "Agent identity SDK:
|
|
3
|
+
"version": "1.0.0-alpha.14",
|
|
4
|
+
"description": "Agent identity SDK: AP-native typed profile/card schema (AgentCard), CAIP-10 nativeId helpers, endpoint verification methods (DNS TXT / signed URL / HTTP challenge / VP), canonical-JSON content-hash. External registry projections stay outside Ring 0.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -27,6 +27,10 @@
|
|
|
27
27
|
"./profile": {
|
|
28
28
|
"types": "./dist/profile.d.ts",
|
|
29
29
|
"import": "./dist/profile.js"
|
|
30
|
+
},
|
|
31
|
+
"./card": {
|
|
32
|
+
"types": "./dist/card.d.ts",
|
|
33
|
+
"import": "./dist/card.js"
|
|
30
34
|
}
|
|
31
35
|
},
|
|
32
36
|
"files": [
|
|
@@ -40,9 +44,9 @@
|
|
|
40
44
|
},
|
|
41
45
|
"peerDependencies": {
|
|
42
46
|
"viem": "^2.52.2",
|
|
43
|
-
"@agenticprimitives/agent-account": "1.0.0-alpha.
|
|
44
|
-
"@agenticprimitives/connect-auth": "1.0.0-alpha.
|
|
45
|
-
"@agenticprimitives/types": "1.0.0-alpha.
|
|
47
|
+
"@agenticprimitives/agent-account": "1.0.0-alpha.14",
|
|
48
|
+
"@agenticprimitives/connect-auth": "1.0.0-alpha.14",
|
|
49
|
+
"@agenticprimitives/types": "1.0.0-alpha.14"
|
|
46
50
|
},
|
|
47
51
|
"devDependencies": {
|
|
48
52
|
"@types/node": "^22.7.0",
|