@agenticprimitives/identity-directory-adapters 1.0.0-alpha.15 → 1.0.0-alpha.17
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/dist/caip10.d.ts +1 -1
- package/dist/caip10.d.ts.map +1 -1
- package/dist/caip10.js +9 -2
- package/dist/caip10.js.map +1 -1
- package/package.json +4 -4
package/dist/caip10.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ import type { Address, CanonicalAgentId } from '@agenticprimitives/types';
|
|
|
2
2
|
export declare const EIP155_NAMESPACE: "eip155";
|
|
3
3
|
/** Build an eip155 `CanonicalAgentId` from a chainId + EVM address (lowercased). */
|
|
4
4
|
export declare function toCanonicalAgentId(chainId: number, address: Address): CanonicalAgentId;
|
|
5
|
-
/** Extract the EVM address from an eip155 `CanonicalAgentId`. Throws on a non-eip155 id. */
|
|
5
|
+
/** Extract the EVM address from an eip155 `CanonicalAgentId`. Throws on a non-eip155 id or a malformed address. */
|
|
6
6
|
export declare function addressOf(id: CanonicalAgentId): Address;
|
|
7
7
|
//# sourceMappingURL=caip10.d.ts.map
|
package/dist/caip10.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"caip10.d.ts","sourceRoot":"","sources":["../src/caip10.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE1E,eAAO,MAAM,gBAAgB,EAAG,QAAiB,CAAC;AAElD,oFAAoF;AACpF,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,gBAAgB,CAEtF;AAED,
|
|
1
|
+
{"version":3,"file":"caip10.d.ts","sourceRoot":"","sources":["../src/caip10.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE1E,eAAO,MAAM,gBAAgB,EAAG,QAAiB,CAAC;AAElD,oFAAoF;AACpF,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,gBAAgB,CAEtF;AAED,mHAAmH;AACnH,wBAAgB,SAAS,CAAC,EAAE,EAAE,gBAAgB,GAAG,OAAO,CAavD"}
|
package/dist/caip10.js
CHANGED
|
@@ -10,12 +10,19 @@ export const EIP155_NAMESPACE = 'eip155';
|
|
|
10
10
|
export function toCanonicalAgentId(chainId, address) {
|
|
11
11
|
return `${EIP155_NAMESPACE}:${chainId}:${address.toLowerCase()}`;
|
|
12
12
|
}
|
|
13
|
-
/** Extract the EVM address from an eip155 `CanonicalAgentId`. Throws on a non-eip155 id. */
|
|
13
|
+
/** Extract the EVM address from an eip155 `CanonicalAgentId`. Throws on a non-eip155 id or a malformed address. */
|
|
14
14
|
export function addressOf(id) {
|
|
15
15
|
const parts = id.split(':');
|
|
16
16
|
if (parts.length !== 3 || parts[0] !== EIP155_NAMESPACE) {
|
|
17
17
|
throw new Error(`identity-directory-adapters: expected an eip155 CanonicalAgentId, got "${id}"`);
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
// NEW-IDA-2: the third token was returned as an Address with NO validation — a malformed id
|
|
20
|
+
// (`eip155:1:not-an-address`) flowed downstream as a bogus principal into on-chain reads. Require a
|
|
21
|
+
// well-formed 20-byte hex address (fail-closed).
|
|
22
|
+
const addr = parts[2] ?? '';
|
|
23
|
+
if (!/^0x[0-9a-fA-F]{40}$/.test(addr)) {
|
|
24
|
+
throw new Error(`identity-directory-adapters: eip155 CanonicalAgentId has a malformed address: "${id}"`);
|
|
25
|
+
}
|
|
26
|
+
return addr;
|
|
20
27
|
}
|
|
21
28
|
//# sourceMappingURL=caip10.js.map
|
package/dist/caip10.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"caip10.js","sourceRoot":"","sources":["../src/caip10.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD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,OAAO,IAAe,CAAC;AACzB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agenticprimitives/identity-directory-adapters",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.17",
|
|
4
4
|
"description": "Port implementations for @agenticprimitives/identity-directory: NamingPort (wraps agent-naming), OnChainReadPort (viem readContract), IndexerPort (in-memory; SPARQL/GraphDB later). The one composition layer allowed to import agent-naming (spec 100 §4 / ADR-0015).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"viem": "^2.52.2",
|
|
35
|
-
"@agenticprimitives/agent-naming": "1.0.0-alpha.
|
|
36
|
-
"@agenticprimitives/identity-directory": "1.0.0-alpha.
|
|
37
|
-
"@agenticprimitives/types": "1.0.0-alpha.
|
|
35
|
+
"@agenticprimitives/agent-naming": "1.0.0-alpha.17",
|
|
36
|
+
"@agenticprimitives/identity-directory": "1.0.0-alpha.17",
|
|
37
|
+
"@agenticprimitives/types": "1.0.0-alpha.17"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"vitest": "^4.1.8"
|