@agenticprimitives/agent-naming 1.0.0-alpha.46 → 1.0.0-alpha.47
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 +52 -2
- package/CLAUDE.md +9 -17
- package/dist/abis.d.ts +461 -0
- package/dist/abis.d.ts.map +1 -1
- package/dist/abis.js +88 -0
- package/dist/abis.js.map +1 -1
- package/dist/claim.d.ts +32 -0
- package/dist/claim.d.ts.map +1 -1
- package/dist/claim.js +61 -3
- package/dist/claim.js.map +1 -1
- package/dist/constants.d.ts +24 -4
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +32 -4
- package/dist/constants.js.map +1 -1
- package/dist/custody.d.ts +95 -8
- package/dist/custody.d.ts.map +1 -1
- package/dist/custody.js +107 -13
- package/dist/custody.js.map +1 -1
- package/dist/dns.d.ts +102 -7
- package/dist/dns.d.ts.map +1 -1
- package/dist/dns.js +128 -28
- package/dist/dns.js.map +1 -1
- package/dist/grammar.d.ts +1 -1
- package/dist/grammar.js +2 -2
- package/dist/grammar.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/normalize.d.ts +1 -1
- package/dist/normalize.js +1 -1
- package/dist/price.d.ts.map +1 -1
- package/dist/price.js +7 -0
- package/dist/price.js.map +1 -1
- package/dist/vertical.d.ts +1 -1
- package/dist/vertical.d.ts.map +1 -1
- package/dist/vertical.js +4 -0
- package/dist/vertical.js.map +1 -1
- package/docs/api.md +3 -1
- package/package.json +4 -4
package/dist/dns.d.ts
CHANGED
|
@@ -18,13 +18,35 @@
|
|
|
18
18
|
* already has. Folding the type into the label instead of dropping it keeps two properties the dotted form
|
|
19
19
|
* had: the type is legible in the host, and the projection stays REVERSIBLE — `alice.me` and `alice.org`
|
|
20
20
|
* would both want `alice.<zone>` if the type were simply dropped, forcing an inbound host to guess which
|
|
21
|
-
* root it meant.
|
|
22
|
-
*
|
|
23
|
-
*
|
|
21
|
+
* root it meant.
|
|
22
|
+
*
|
|
23
|
+
* THE PROJECTION IS INJECTIVE, AND THIS IS THE WHOLE RULE (spec 445, audit NAME-8). Two shapes share one zone —
|
|
24
|
+
* typed `<label>-<type>.<zone>` and bare `<label>.<zone>` (persons and untyped roots) — so three things hold, each
|
|
25
|
+
* enforced where the host is MADE and where it is READ, not only at claim time:
|
|
26
|
+
*
|
|
27
|
+
* 1. a bare label that ends in `-<type>` HAS NO HOST. `foo-org` under a person or legacy root would be
|
|
28
|
+
* `foo-org.<zone>`, the host of the typed `foo.org`; the forward functions refuse it (throw / null) and the
|
|
29
|
+
* claim helpers refuse to register it (`labelClaimViolation`). It is refused for LEGACY roots as well as
|
|
30
|
+
* persons — before 2026-11-10 only `validateTypedClaim` knew the rule, and only for persons.
|
|
31
|
+
* 2. a type suffix is one hyphen-free word (`registerVerticalAgentTypes` refuses a hyphen), so a typed label
|
|
32
|
+
* splits exactly one way: the type is the segment after the last hyphen (`typeSuffixOfLabel`).
|
|
33
|
+
* 3. a reserved label (`www`, `api`, `mtls`, `edge`, `well-known`, the type words) has no host and reads back
|
|
34
|
+
* as no name.
|
|
35
|
+
*
|
|
36
|
+
* So for one zone and ONE bare root, no two distinct names share a host and host → name is a function. An estate
|
|
37
|
+
* that serves SEVERAL bare roots (mid-migration: `alice.me` and `alice.agent` are both `alice.<zone>`) is the one
|
|
38
|
+
* place two names share a host by configuration; `confirmDnsHost` reports it unless both resolve to one agent.
|
|
39
|
+
*
|
|
40
|
+
* WHAT THIS FILE CANNOT DO: stop a name being registered. The chain enforces charset and length only, so a label
|
|
41
|
+
* this SDK refuses can exist on chain (registered before the rule, or by a direct contract call). Every inverse
|
|
42
|
+
* here is therefore a HINT about which name a host means — routing confirms it against the chain
|
|
43
|
+
* (`confirmDnsHost`: every reading is resolved, and two readings held by different agents is an explicit
|
|
44
|
+
* `ambiguous` result the router refuses, never a precedence pick).
|
|
24
45
|
*
|
|
25
46
|
* The type in DNS is still a fixed projection of the suffix and is NEVER parsed as authority.
|
|
26
47
|
*/
|
|
27
48
|
import { type ParsedAgentName } from './grammar.js';
|
|
49
|
+
import type { Address } from '@agenticprimitives/types';
|
|
28
50
|
/** A2A JSON-RPC path (must equal `@agenticprimitives/a2a` `A2A_JSONRPC_PATH` — golden-vector tested, no import edge). */
|
|
29
51
|
export declare const A2A_JSONRPC_PATH: "/api/a2a";
|
|
30
52
|
/** A2A agent-card discovery path (origin-scoped — why every agent gets its own host). */
|
|
@@ -37,12 +59,21 @@ export interface DnsHostOptions {
|
|
|
37
59
|
/** The person owns the real `.me` domain matching the handle — the host IS the handle. */
|
|
38
60
|
ownsDomain?: boolean;
|
|
39
61
|
}
|
|
40
|
-
/**
|
|
62
|
+
/**
|
|
63
|
+
* Project a handle onto a DNS host per the §5 table. Root / type-node / legacy names have no host — and neither
|
|
64
|
+
* does a hosted person whose label ends in `-<type>` (rule 1: throws `label_reads_as_type`, never the colliding
|
|
65
|
+
* host). A person on their OWN domain (`ownsDomain`) is not on a shared zone and is not affected.
|
|
66
|
+
*/
|
|
41
67
|
export declare function dnsHostForHandle(name: string | ParsedAgentName, opts: DnsHostOptions): string;
|
|
42
68
|
/**
|
|
43
69
|
* The inverse of `dnsHostForHandle` for a hosted zone: `<label>-<type>.<zone>` → `<label>.<type>`, and a
|
|
44
|
-
* bare `<label>.<zone>` → null (a person/legacy label, whose root the deployment decides from its
|
|
45
|
-
*
|
|
70
|
+
* bare `<label>.<zone>` → null (a person/legacy label, whose root the deployment decides from its root list).
|
|
71
|
+
* Pure and single-valued: exactly one handle or null — the split is unique (rule 2), a reserved or malformed
|
|
72
|
+
* label reads as nothing (rule 3), and no bare name projects onto a typed host (rule 1).
|
|
73
|
+
*
|
|
74
|
+
* A HINT, NOT AN ANSWER. It says which name this SDK would have projected here; it cannot know that the chain
|
|
75
|
+
* also holds a bare-root name with the same label. Confirm with `confirmDnsHost` (or resolve the name and check
|
|
76
|
+
* its records) before routing — resolution is by records, never by parsing a subdomain.
|
|
46
77
|
*/
|
|
47
78
|
export declare function handleForDnsHost(host: string, zone: string): {
|
|
48
79
|
label: string;
|
|
@@ -69,7 +100,12 @@ export declare function typedNameForLabel(rest: string): string | null;
|
|
|
69
100
|
* The DNS label is returned RAW as `label`: a label may read BOTH ways (`alice-home-church` is `alice-home.church`
|
|
70
101
|
* and also the legacy `alice-home-church.<legacyParent>`), so the choice belongs to the caller, which resolves an
|
|
71
102
|
* ORDERED candidate set against the chain — one mechanism, ordered candidates, not a fallback (ADR-0013).
|
|
72
|
-
* Apex, deeper nesting, an unknown type level → null.
|
|
103
|
+
* Apex, deeper nesting, an unknown type level, a reserved label (`www`, `api`, … — rule 3) → null.
|
|
104
|
+
*
|
|
105
|
+
* `name` IS THE TYPED READING WHEN THERE IS ONE, AND THAT IS A HINT (spec 445 / NAME-8). This function is pure; it
|
|
106
|
+
* cannot see that the legacy `<label>.<legacyParent>` is ALSO registered. A router that takes `name` and stops has
|
|
107
|
+
* let a later typed claim take an existing legacy name's host. Route through `confirmDnsHost`, which resolves
|
|
108
|
+
* every reading and refuses when two agents hold one host.
|
|
73
109
|
*/
|
|
74
110
|
export declare function parseTypedAgentHost(hostname: string | undefined, zone: string, legacyParent: string): {
|
|
75
111
|
label: string;
|
|
@@ -80,8 +116,67 @@ export declare function parseTypedAgentHost(hostname: string | undefined, zone:
|
|
|
80
116
|
* `legacyParents` (the ordered person / legacy roots an estate serves — a list, because an estate mid-migration
|
|
81
117
|
* serves several) → `<label>.<zone>`; `<label>.<tld>` for any other agent type → `<label>-<tld>.<zone>`. Deeper or
|
|
82
118
|
* untyped → null (no host to publish at). A projection of the name, never authority.
|
|
119
|
+
*
|
|
120
|
+
* NULL ALSO MEANS "this name has no host on a shared zone" (spec 445 / NAME-8): a malformed or reserved label
|
|
121
|
+
* (`www.me` is not `www.<zone>`), and a bare-root label ending in `-<type>` (`foo-org.agent` is NOT
|
|
122
|
+
* `foo-org.<zone>` — that is `foo.org`'s host). Never the colliding host.
|
|
83
123
|
*/
|
|
84
124
|
export declare function hostForName(name: string, zone: string, legacyParents: readonly string[]): string | null;
|
|
125
|
+
/** One reading of a host: a name it could mean. `projectable` — would `hostForName` put that name at this host? */
|
|
126
|
+
export interface DnsHostReading {
|
|
127
|
+
name: string;
|
|
128
|
+
projectable: boolean;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* EVERY name a single-label host under `zone` could mean, in a fixed order: the typed reading (`<label>-<type>`
|
|
132
|
+
* → `<label>.<type>`), then `<label>.<root>` for each bare root. The bare readings of a label that ends in
|
|
133
|
+
* `-<type>` are included with `projectable: false`: this SDK gives them no host, but the chain may hold one
|
|
134
|
+
* (registered before the rule, or by a direct call), and a router has to know to look. Pure. Apex, nesting,
|
|
135
|
+
* a foreign host, a reserved or malformed label → `[]`.
|
|
136
|
+
*/
|
|
137
|
+
export declare function dnsHostReadings(hostname: string | undefined, zone: string, bareRoots: readonly string[]): DnsHostReading[];
|
|
138
|
+
/** The read `confirmDnsHost` needs — one `readContract` per name (ADR-0012). `AgentNamingClient` satisfies it. */
|
|
139
|
+
export interface DnsHostReads {
|
|
140
|
+
resolveName(name: string): Promise<Address | null>;
|
|
141
|
+
}
|
|
142
|
+
export type DnsHostConfirmation =
|
|
143
|
+
/** No reading of this host is registered (or the host is not an agent host at all). */
|
|
144
|
+
{
|
|
145
|
+
status: 'none';
|
|
146
|
+
}
|
|
147
|
+
/** Exactly one AGENT holds this host. `names` are the readings that resolve to it (several when one agent
|
|
148
|
+
* holds `alice.me` and `alice.agent`); `name` is the first in reading order; `projectable` is false when the
|
|
149
|
+
* host answers only for a grandfathered bare name the SDK no longer projects. */
|
|
150
|
+
| {
|
|
151
|
+
status: 'confirmed';
|
|
152
|
+
address: Address;
|
|
153
|
+
name: string;
|
|
154
|
+
names: string[];
|
|
155
|
+
projectable: boolean;
|
|
156
|
+
}
|
|
157
|
+
/** Two or more DIFFERENT agents hold names that read as this host. The router refuses; it does not pick. */
|
|
158
|
+
| {
|
|
159
|
+
status: 'ambiguous';
|
|
160
|
+
candidates: Array<{
|
|
161
|
+
name: string;
|
|
162
|
+
address: Address;
|
|
163
|
+
projectable: boolean;
|
|
164
|
+
}>;
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* Host → agent, CONFIRMED BY RECORDS (spec 445 / NAME-8). Resolves EVERY reading of the host on chain — one
|
|
168
|
+
* mechanism over the whole candidate set, not a first-hit walk (ADR-0013) — and answers:
|
|
169
|
+
* - none registered → `none`
|
|
170
|
+
* - all registered readings resolve to one agent → `confirmed`
|
|
171
|
+
* - two agents → `ambiguous` — a typed claim made after a legacy name of the same host existed
|
|
172
|
+
* (or the reverse) lands here; the existing holder's host stops answering rather than answering as the
|
|
173
|
+
* claimant. That is a denial an operator can see and settle, where a precedence pick was an impersonation.
|
|
174
|
+
* A read that throws propagates: "could not read" is not "not registered".
|
|
175
|
+
*/
|
|
176
|
+
export declare function confirmDnsHost(hostname: string | undefined, zone: string, ports: {
|
|
177
|
+
bareRoots: readonly string[];
|
|
178
|
+
reads: DnsHostReads;
|
|
179
|
+
}): Promise<DnsHostConfirmation>;
|
|
85
180
|
/**
|
|
86
181
|
* The on-chain name for an explicit handle (an edge path `POST /api/a2a/<handle>`, an injected subdomain header).
|
|
87
182
|
* A bare label is `<label>.<legacyParent>`; a typed handle (`x.t`, `x.t@c.u`, `c.u/x.t`) or a legacy dotted name
|
package/dist/dns.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dns.d.ts","sourceRoot":"","sources":["../src/dns.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"dns.d.ts","sourceRoot":"","sources":["../src/dns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,OAAO,EAAkB,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,KAAK,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Q,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE;IAAE,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,YAAY,CAAA;CAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAS3K;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAWtF"}
|
package/dist/dns.js
CHANGED
|
@@ -18,14 +18,36 @@
|
|
|
18
18
|
* already has. Folding the type into the label instead of dropping it keeps two properties the dotted form
|
|
19
19
|
* had: the type is legible in the host, and the projection stays REVERSIBLE — `alice.me` and `alice.org`
|
|
20
20
|
* would both want `alice.<zone>` if the type were simply dropped, forcing an inbound host to guess which
|
|
21
|
-
* root it meant.
|
|
22
|
-
*
|
|
23
|
-
*
|
|
21
|
+
* root it meant.
|
|
22
|
+
*
|
|
23
|
+
* THE PROJECTION IS INJECTIVE, AND THIS IS THE WHOLE RULE (spec 445, audit NAME-8). Two shapes share one zone —
|
|
24
|
+
* typed `<label>-<type>.<zone>` and bare `<label>.<zone>` (persons and untyped roots) — so three things hold, each
|
|
25
|
+
* enforced where the host is MADE and where it is READ, not only at claim time:
|
|
26
|
+
*
|
|
27
|
+
* 1. a bare label that ends in `-<type>` HAS NO HOST. `foo-org` under a person or legacy root would be
|
|
28
|
+
* `foo-org.<zone>`, the host of the typed `foo.org`; the forward functions refuse it (throw / null) and the
|
|
29
|
+
* claim helpers refuse to register it (`labelClaimViolation`). It is refused for LEGACY roots as well as
|
|
30
|
+
* persons — before 2026-11-10 only `validateTypedClaim` knew the rule, and only for persons.
|
|
31
|
+
* 2. a type suffix is one hyphen-free word (`registerVerticalAgentTypes` refuses a hyphen), so a typed label
|
|
32
|
+
* splits exactly one way: the type is the segment after the last hyphen (`typeSuffixOfLabel`).
|
|
33
|
+
* 3. a reserved label (`www`, `api`, `mtls`, `edge`, `well-known`, the type words) has no host and reads back
|
|
34
|
+
* as no name.
|
|
35
|
+
*
|
|
36
|
+
* So for one zone and ONE bare root, no two distinct names share a host and host → name is a function. An estate
|
|
37
|
+
* that serves SEVERAL bare roots (mid-migration: `alice.me` and `alice.agent` are both `alice.<zone>`) is the one
|
|
38
|
+
* place two names share a host by configuration; `confirmDnsHost` reports it unless both resolve to one agent.
|
|
39
|
+
*
|
|
40
|
+
* WHAT THIS FILE CANNOT DO: stop a name being registered. The chain enforces charset and length only, so a label
|
|
41
|
+
* this SDK refuses can exist on chain (registered before the rule, or by a direct contract call). Every inverse
|
|
42
|
+
* here is therefore a HINT about which name a host means — routing confirms it against the chain
|
|
43
|
+
* (`confirmDnsHost`: every reading is resolved, and two readings held by different agents is an explicit
|
|
44
|
+
* `ambiguous` result the router refuses, never a precedence pick).
|
|
24
45
|
*
|
|
25
46
|
* The type in DNS is still a fixed projection of the suffix and is NEVER parsed as authority.
|
|
26
47
|
*/
|
|
27
48
|
import { parseAgentName } from './grammar.js';
|
|
28
|
-
import {
|
|
49
|
+
import { isAgentTld, isReservedLabel, typeSuffixOfLabel } from './constants.js';
|
|
50
|
+
import { normalizeLabel } from './label.js';
|
|
29
51
|
import { InvalidNameError } from './errors.js';
|
|
30
52
|
/** A2A JSON-RPC path (must equal `@agenticprimitives/a2a` `A2A_JSONRPC_PATH` — golden-vector tested, no import edge). */
|
|
31
53
|
export const A2A_JSONRPC_PATH = '/api/a2a';
|
|
@@ -38,7 +60,31 @@ function assertZone(zone, what) {
|
|
|
38
60
|
throw new InvalidNameError(zone, `${what} must be a DNS zone (got "${zone}")`);
|
|
39
61
|
return z;
|
|
40
62
|
}
|
|
41
|
-
/**
|
|
63
|
+
/** `<label>-<type>` split the one way it can be (rule 2), with a label that could be registered — else null. */
|
|
64
|
+
function splitTypedLabel(rest) {
|
|
65
|
+
const tld = typeSuffixOfLabel(rest);
|
|
66
|
+
if (!tld)
|
|
67
|
+
return null;
|
|
68
|
+
const label = rest.slice(0, -tld.length - 1);
|
|
69
|
+
if (!isPlainLabel(label) || isReservedLabel(label))
|
|
70
|
+
return null;
|
|
71
|
+
return { label, tld };
|
|
72
|
+
}
|
|
73
|
+
function isPlainLabel(label) {
|
|
74
|
+
try {
|
|
75
|
+
return normalizeLabel(label) === label;
|
|
76
|
+
}
|
|
77
|
+
catch (e) {
|
|
78
|
+
if (e instanceof InvalidNameError)
|
|
79
|
+
return false;
|
|
80
|
+
throw e;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Project a handle onto a DNS host per the §5 table. Root / type-node / legacy names have no host — and neither
|
|
85
|
+
* does a hosted person whose label ends in `-<type>` (rule 1: throws `label_reads_as_type`, never the colliding
|
|
86
|
+
* host). A person on their OWN domain (`ownsDomain`) is not on a shared zone and is not affected.
|
|
87
|
+
*/
|
|
42
88
|
export function dnsHostForHandle(name, opts) {
|
|
43
89
|
const p = typeof name === 'string' ? parseAgentName(name) : name;
|
|
44
90
|
const zone = assertZone(opts.zone, 'zone');
|
|
@@ -47,25 +93,36 @@ export function dnsHostForHandle(name, opts) {
|
|
|
47
93
|
}
|
|
48
94
|
const { label, tld } = p.handle;
|
|
49
95
|
const type = p.derivedType;
|
|
96
|
+
const bare = (z) => {
|
|
97
|
+
const reads = typeSuffixOfLabel(label);
|
|
98
|
+
if (reads)
|
|
99
|
+
throw new InvalidNameError(p.normalized, `label_reads_as_type: "${label}.${z}" is the host of "${label.slice(0, -reads.length - 1)}.${reads}" — a label ending in "-${reads}" has no host on a shared zone`);
|
|
100
|
+
return `${label}.${z}`;
|
|
101
|
+
};
|
|
50
102
|
if (p.kind === 'canonical') {
|
|
51
103
|
if (type === 'org')
|
|
52
104
|
return zone;
|
|
53
105
|
if (type === 'person') {
|
|
54
106
|
if (opts.ownsDomain)
|
|
55
107
|
return `${label}.${tld}`;
|
|
56
|
-
return
|
|
108
|
+
return bare(assertZone(opts.homeZone ?? opts.zone, 'homeZone'));
|
|
57
109
|
}
|
|
58
110
|
return `${label}-${tld}.${zone}`;
|
|
59
111
|
}
|
|
60
112
|
// scoped / contextual
|
|
61
113
|
if (type === 'person')
|
|
62
|
-
return
|
|
114
|
+
return bare(zone);
|
|
63
115
|
return `${label}-${tld}.${zone}`;
|
|
64
116
|
}
|
|
65
117
|
/**
|
|
66
118
|
* The inverse of `dnsHostForHandle` for a hosted zone: `<label>-<type>.<zone>` → `<label>.<type>`, and a
|
|
67
|
-
* bare `<label>.<zone>` → null (a person/legacy label, whose root the deployment decides from its
|
|
68
|
-
*
|
|
119
|
+
* bare `<label>.<zone>` → null (a person/legacy label, whose root the deployment decides from its root list).
|
|
120
|
+
* Pure and single-valued: exactly one handle or null — the split is unique (rule 2), a reserved or malformed
|
|
121
|
+
* label reads as nothing (rule 3), and no bare name projects onto a typed host (rule 1).
|
|
122
|
+
*
|
|
123
|
+
* A HINT, NOT AN ANSWER. It says which name this SDK would have projected here; it cannot know that the chain
|
|
124
|
+
* also holds a bare-root name with the same label. Confirm with `confirmDnsHost` (or resolve the name and check
|
|
125
|
+
* its records) before routing — resolution is by records, never by parsing a subdomain.
|
|
69
126
|
*/
|
|
70
127
|
export function handleForDnsHost(host, zone) {
|
|
71
128
|
const h = host.trim().toLowerCase().replace(/\.$/, '');
|
|
@@ -75,15 +132,8 @@ export function handleForDnsHost(host, zone) {
|
|
|
75
132
|
const rest = h.slice(0, h.length - z.length - 1);
|
|
76
133
|
if (!rest || rest.includes('.'))
|
|
77
134
|
return null;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
if (rest.endsWith(suffix) && rest.length > suffix.length) {
|
|
81
|
-
const label = rest.slice(0, -suffix.length);
|
|
82
|
-
const canonical = derivedTypeForTld(tld) === null ? tld : tld;
|
|
83
|
-
return { label, tld: canonical, name: `${label}.${canonical}` };
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
return null;
|
|
135
|
+
const t = splitTypedLabel(rest);
|
|
136
|
+
return t ? { label: t.label, tld: t.tld, name: `${t.label}.${t.tld}` } : null;
|
|
87
137
|
}
|
|
88
138
|
export function agentCardUrlForHost(host) {
|
|
89
139
|
return `https://${assertZone(host, 'host')}${A2A_AGENT_CARD_PATH}`;
|
|
@@ -123,12 +173,8 @@ export function parseSubdomainLabel(hostname, zone, exclude = []) {
|
|
|
123
173
|
/** `<label>-<type>` → the typed name it projects (`alice-home-church` → `alice-home.church`), or null when the
|
|
124
174
|
* label carries no known type suffix. A CANDIDATE — the caller resolves it against the chain. */
|
|
125
175
|
export function typedNameForLabel(rest) {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
if (rest.endsWith(suffix) && rest.length > suffix.length)
|
|
129
|
-
return `${rest.slice(0, -suffix.length)}.${tld}`;
|
|
130
|
-
}
|
|
131
|
-
return null;
|
|
176
|
+
const t = splitTypedLabel(rest);
|
|
177
|
+
return t ? `${t.label}.${t.tld}` : null;
|
|
132
178
|
}
|
|
133
179
|
/**
|
|
134
180
|
* The inbound host → the name it projects, for the two shapes ONE base zone serves:
|
|
@@ -138,7 +184,12 @@ export function typedNameForLabel(rest) {
|
|
|
138
184
|
* The DNS label is returned RAW as `label`: a label may read BOTH ways (`alice-home-church` is `alice-home.church`
|
|
139
185
|
* and also the legacy `alice-home-church.<legacyParent>`), so the choice belongs to the caller, which resolves an
|
|
140
186
|
* ORDERED candidate set against the chain — one mechanism, ordered candidates, not a fallback (ADR-0013).
|
|
141
|
-
* Apex, deeper nesting, an unknown type level → null.
|
|
187
|
+
* Apex, deeper nesting, an unknown type level, a reserved label (`www`, `api`, … — rule 3) → null.
|
|
188
|
+
*
|
|
189
|
+
* `name` IS THE TYPED READING WHEN THERE IS ONE, AND THAT IS A HINT (spec 445 / NAME-8). This function is pure; it
|
|
190
|
+
* cannot see that the legacy `<label>.<legacyParent>` is ALSO registered. A router that takes `name` and stops has
|
|
191
|
+
* let a later typed claim take an existing legacy name's host. Route through `confirmDnsHost`, which resolves
|
|
192
|
+
* every reading and refuses when two agents hold one host.
|
|
142
193
|
*/
|
|
143
194
|
export function parseTypedAgentHost(hostname, zone, legacyParent) {
|
|
144
195
|
if (!hostname)
|
|
@@ -149,9 +200,12 @@ export function parseTypedAgentHost(hostname, zone, legacyParent) {
|
|
|
149
200
|
return null;
|
|
150
201
|
const rest = host.slice(0, host.length - base.length - 1);
|
|
151
202
|
const parts = rest.split('.');
|
|
152
|
-
if (parts.length === 1 && parts[0])
|
|
203
|
+
if (parts.length === 1 && parts[0]) {
|
|
204
|
+
if (!isPlainLabel(parts[0]) || isReservedLabel(parts[0]))
|
|
205
|
+
return null;
|
|
153
206
|
return { label: parts[0], name: typedNameForLabel(parts[0]) ?? `${parts[0]}.${legacyParent}` };
|
|
154
|
-
|
|
207
|
+
}
|
|
208
|
+
if (parts.length === 2 && parts[0] && isAgentTld(parts[1]) && isPlainLabel(parts[0]) && !isReservedLabel(parts[0]))
|
|
155
209
|
return { label: `${parts[0]}.${parts[1]}`, name: `${parts[0]}.${parts[1]}` };
|
|
156
210
|
return null;
|
|
157
211
|
}
|
|
@@ -160,18 +214,64 @@ export function parseTypedAgentHost(hostname, zone, legacyParent) {
|
|
|
160
214
|
* `legacyParents` (the ordered person / legacy roots an estate serves — a list, because an estate mid-migration
|
|
161
215
|
* serves several) → `<label>.<zone>`; `<label>.<tld>` for any other agent type → `<label>-<tld>.<zone>`. Deeper or
|
|
162
216
|
* untyped → null (no host to publish at). A projection of the name, never authority.
|
|
217
|
+
*
|
|
218
|
+
* NULL ALSO MEANS "this name has no host on a shared zone" (spec 445 / NAME-8): a malformed or reserved label
|
|
219
|
+
* (`www.me` is not `www.<zone>`), and a bare-root label ending in `-<type>` (`foo-org.agent` is NOT
|
|
220
|
+
* `foo-org.<zone>` — that is `foo.org`'s host). Never the colliding host.
|
|
163
221
|
*/
|
|
164
222
|
export function hostForName(name, zone, legacyParents) {
|
|
165
223
|
const parts = name.trim().toLowerCase().split('.');
|
|
166
224
|
if (parts.length !== 2 || !parts[0] || !parts[1])
|
|
167
225
|
return null;
|
|
168
226
|
const [label, tld] = parts;
|
|
227
|
+
if (!isPlainLabel(label) || isReservedLabel(label))
|
|
228
|
+
return null;
|
|
169
229
|
if (legacyParents.includes(tld))
|
|
170
|
-
return `${label}.${zone}`;
|
|
230
|
+
return typeSuffixOfLabel(label) ? null : `${label}.${zone}`;
|
|
171
231
|
if (isAgentTld(tld))
|
|
172
232
|
return `${label}-${tld}.${zone}`;
|
|
173
233
|
return null;
|
|
174
234
|
}
|
|
235
|
+
/**
|
|
236
|
+
* EVERY name a single-label host under `zone` could mean, in a fixed order: the typed reading (`<label>-<type>`
|
|
237
|
+
* → `<label>.<type>`), then `<label>.<root>` for each bare root. The bare readings of a label that ends in
|
|
238
|
+
* `-<type>` are included with `projectable: false`: this SDK gives them no host, but the chain may hold one
|
|
239
|
+
* (registered before the rule, or by a direct call), and a router has to know to look. Pure. Apex, nesting,
|
|
240
|
+
* a foreign host, a reserved or malformed label → `[]`.
|
|
241
|
+
*/
|
|
242
|
+
export function dnsHostReadings(hostname, zone, bareRoots) {
|
|
243
|
+
const label = parseSubdomainLabel(hostname, zone);
|
|
244
|
+
if (!label || !isPlainLabel(label) || isReservedLabel(label))
|
|
245
|
+
return [];
|
|
246
|
+
const typed = typedNameForLabel(label);
|
|
247
|
+
const out = typed ? [{ name: typed, projectable: true }] : [];
|
|
248
|
+
for (const root of bareRoots)
|
|
249
|
+
out.push({ name: `${label}.${root}`, projectable: typed === null });
|
|
250
|
+
return out;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Host → agent, CONFIRMED BY RECORDS (spec 445 / NAME-8). Resolves EVERY reading of the host on chain — one
|
|
254
|
+
* mechanism over the whole candidate set, not a first-hit walk (ADR-0013) — and answers:
|
|
255
|
+
* - none registered → `none`
|
|
256
|
+
* - all registered readings resolve to one agent → `confirmed`
|
|
257
|
+
* - two agents → `ambiguous` — a typed claim made after a legacy name of the same host existed
|
|
258
|
+
* (or the reverse) lands here; the existing holder's host stops answering rather than answering as the
|
|
259
|
+
* claimant. That is a denial an operator can see and settle, where a precedence pick was an impersonation.
|
|
260
|
+
* A read that throws propagates: "could not read" is not "not registered".
|
|
261
|
+
*/
|
|
262
|
+
export async function confirmDnsHost(hostname, zone, ports) {
|
|
263
|
+
const readings = dnsHostReadings(hostname, zone, ports.bareRoots);
|
|
264
|
+
if (readings.length === 0)
|
|
265
|
+
return { status: 'none' };
|
|
266
|
+
const resolved = await Promise.all(readings.map(async (r) => ({ ...r, address: await ports.reads.resolveName(r.name) })));
|
|
267
|
+
const held = resolved.filter((r) => !!r.address);
|
|
268
|
+
if (held.length === 0)
|
|
269
|
+
return { status: 'none' };
|
|
270
|
+
const agents = new Set(held.map((r) => r.address.toLowerCase()));
|
|
271
|
+
if (agents.size > 1)
|
|
272
|
+
return { status: 'ambiguous', candidates: held.map(({ name, address, projectable }) => ({ name, address, projectable })) };
|
|
273
|
+
return { status: 'confirmed', address: held[0].address, name: held[0].name, names: held.map((r) => r.name), projectable: held.some((r) => r.projectable) };
|
|
274
|
+
}
|
|
175
275
|
/**
|
|
176
276
|
* The on-chain name for an explicit handle (an edge path `POST /api/a2a/<handle>`, an injected subdomain header).
|
|
177
277
|
* A bare label is `<label>.<legacyParent>`; a typed handle (`x.t`, `x.t@c.u`, `c.u/x.t`) or a legacy dotted name
|
package/dist/dns.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dns.js","sourceRoot":"","sources":["../src/dns.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"dns.js","sourceRoot":"","sources":["../src/dns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,OAAO,EAAE,cAAc,EAAwB,MAAM,cAAc,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAA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,IAAI,EAAE,IAAI,CAAC,CAAC,CAAE,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC;AAC/J,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAc,EAAE,YAAoB;IACrE,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACtC,IAAI,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACpB,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC,IAAI,YAAY,EAAE,CAAC;IAC5F,IAAI,CAAC;QACH,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;QAC5B,OAAO,CAAC,CAAC,IAAI,KAAK,WAAW,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC;IACpG,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,YAAY,gBAAgB;YAAE,OAAO,IAAI,CAAC;QAC/C,MAAM,CAAC,CAAC;IACV,CAAC;AACH,CAAC"}
|
package/dist/grammar.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* dotted := x.t.c.u the on-chain form of x.t@c.u
|
|
10
10
|
* type-node := t.c.u the intermediate node an issuing context owns
|
|
11
11
|
* root := tld | legacy-tld a bare root node (namehash('me'), namehash('agent'))
|
|
12
|
-
* legacy := <anything>.
|
|
12
|
+
* legacy := <anything>.agent untyped, never validated (spec 346 §3.5)
|
|
13
13
|
*
|
|
14
14
|
* The derived type of ANY name is the tld of the part before the first `@`. The context (after `@`)
|
|
15
15
|
* MUST be an org / team / workspace handle. v1: one level of context.
|
package/dist/grammar.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AGENT_TLD_ALIASES,
|
|
1
|
+
import { AGENT_TLD_ALIASES, isReservedLabel, canonicalTld, derivedTypeForTld, subtypeForTld, isLegacyTld, } from './constants.js';
|
|
2
2
|
import { InvalidNameError } from './errors.js';
|
|
3
3
|
import { nodeOfLabels } from './hash.js';
|
|
4
4
|
import { normalizeLabel } from './label.js';
|
|
@@ -25,7 +25,7 @@ function labelsOf(full, part) {
|
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
function assertTypedLabel(full, label, where) {
|
|
28
|
-
if (
|
|
28
|
+
if (isReservedLabel(label)) {
|
|
29
29
|
throw new InvalidNameError(full, `reserved_label: "${label}" cannot be a ${where} label`);
|
|
30
30
|
}
|
|
31
31
|
}
|
package/dist/grammar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grammar.js","sourceRoot":"","sources":["../src/grammar.ts"],"names":[],"mappings":"AAiBA,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,WAAW,GAIZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AA2B5C,MAAM,aAAa,GAAkC,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;AAC5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O,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QACrB,KAAK,MAAM;YACT,OAAO,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QACrB,KAAK,QAAQ;YACX,OAAO,CAAC,CAAC,WAAW,CAAC;IACzB,CAAC;AACH,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,aAAa,CAAC,KAAa;IACzC,OAAO,cAAc,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC;AAC3C,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export { AGENT_TLDS, AGENT_TLD_ALIASES, LEGACY_TLDS, RESERVED_LABELS, ROOT_KIND_AGENT, isAgentTld, isLegacyTld, canonicalTld, derivedTypeForTld, tldForDerivedType, rootClassForDerivedType, rootClassForTld, rootKindForTld, isKnownAgentTld, subtypeForTld, allAgentTlds, type AgentTld, type AnyAgentTld, type LegacyTld, } from './constants.js';
|
|
1
|
+
export { AGENT_TLDS, AGENT_TLD_ALIASES, LEGACY_TLDS, RESERVED_LABELS, CHAIN_SEEDED_RESERVED_LABELS, ROOT_KIND_AGENT, isAgentTld, isLegacyTld, canonicalTld, derivedTypeForTld, tldForDerivedType, rootClassForDerivedType, rootClassForTld, rootKindForTld, isKnownAgentTld, isReservedLabel, typeSuffixOfLabel, subtypeForTld, allAgentTlds, type AgentTld, type AnyAgentTld, type LegacyTld, } from './constants.js';
|
|
2
2
|
export { federatedAgentName, displayAgentName, sameFederatedName, caip2ForChainId, chainIdOfCaip2, type FederatedAgentNameV1, type Caip2Chain, type DisplayAgentNameOptions, } from './federated.js';
|
|
3
3
|
export { registerVerticalAgentTypes, clearVerticalAgentTypes, verticalAgentTypeForTld, verticalAgentTypeForSubtype, verticalAgentTlds, verticalRootKindForTld, type VerticalAgentTypeDefinition, type VerticalAgentType, } from './vertical.js';
|
|
4
4
|
export { normalizeAgentName, normalizeLabel, isValidAgentName } from './normalize.js';
|
|
5
5
|
export { parseAgentName, formatAgentName, onChainNameOf, MIN_ROOT_LABEL_LENGTH, type ParsedAgentName, type ParsedAgentNameKind, type AgentNameForm, } from './grammar.js';
|
|
6
|
-
export { A2A_JSONRPC_PATH, A2A_AGENT_CARD_PATH, dnsHostForHandle, parseSubdomainLabel, typedNameForLabel, parseTypedAgentHost, hostForName, agentNameForHandle, agentCardUrlForHost, a2aEndpointForHost, edgeA2aPathForHandle, type DnsHostOptions, } from './dns.js';
|
|
7
|
-
export { findUniqueLabel, childNodeOf, validateTypedClaim, ROLE_TYPED, type UniqueLabelReads, type TypedClaimViolation, type TypedClaimSubject, } from './claim.js';
|
|
6
|
+
export { A2A_JSONRPC_PATH, A2A_AGENT_CARD_PATH, dnsHostForHandle, handleForDnsHost, dnsHostReadings, confirmDnsHost, parseSubdomainLabel, typedNameForLabel, parseTypedAgentHost, hostForName, agentNameForHandle, agentCardUrlForHost, a2aEndpointForHost, edgeA2aPathForHandle, type DnsHostOptions, type DnsHostReading, type DnsHostReads, type DnsHostConfirmation, } from './dns.js';
|
|
7
|
+
export { findUniqueLabel, childNodeOf, validateTypedClaim, labelClaimViolation, assertClaimableLabel, rootTakesBareHost, knownRootOfNode, ROLE_TYPED, type UniqueLabelReads, type TypedClaimViolation, type TypedClaimSubject, type LabelClaimViolation, } from './claim.js';
|
|
8
8
|
export { CONTEXT_VAULT_RESOURCES, validateContextualIssuance, issuanceBody, isAnchoredOnChain, isIssuanceActiveAt, type ContextualNameIssuanceV1, type ContextualNameIssuanceBody, type ContextualIssuanceBasis, type ContextualIssuanceKind, type ContextualIssuanceStatus, type ContextualNameListing, type IssuanceShapeViolation, } from './issuance.js';
|
|
9
9
|
export { labelhash, namehash, ZERO_NODE } from './namehash.js';
|
|
10
10
|
export { InvalidNameError, NameNotFoundError, UnauthorizedNameOwnerError, } from './errors.js';
|
|
11
11
|
export type { AgentKind, ConnectionKind, AgentNameRecords, RegisterSubnameInput, SetPrimaryNameInput, SetAgentRecordsInput, SetSubregistryInput, AgentNamingClientOpts, DerivedTypeRecord, TypedNameRecord, TypedNameCheck, } from './types.js';
|
|
12
12
|
export { AgentNamingClient, type WriteContext } from './client.js';
|
|
13
|
-
export { buildRegisterSubnameCall, buildRotateNameOwnerCall, buildRotateNameResolverCall, buildSetSubregistryCall, buildSetPrimaryNameCall, buildSetStringAttributeCall, buildSetStringArrayAttributeCall, buildSetAddressAttributeCall, buildSetBytes32AttributeCall, buildRecordCalls, buildSubregistryRegisterCall, buildDeclareAgentTypeCalls, buildTypedClaimCalls, type ContractCall, } from './custody.js';
|
|
13
|
+
export { buildRegisterSubnameCall, buildRotateNameOwnerCall, buildRotateNameResolverCall, buildSetSubregistryCall, buildSetPrimaryNameCall, buildSetStringAttributeCall, buildSetStringArrayAttributeCall, buildSetAddressAttributeCall, buildSetBytes32AttributeCall, buildRecordCalls, buildSubregistryRegisterCall, buildSubregistryCommitCall, subregistryCommitment, generateClaimSecret, SUBREGISTRY_MIN_COMMIT_AGE_SECONDS, SUBREGISTRY_MAX_COMMIT_AGE_SECONDS, buildRenewNameCall, buildDeclareAgentTypeCalls, buildTypedClaimCalls, type ContractCall, } from './custody.js';
|
|
14
14
|
export { agentNameRegistryAbi, agentNameAttributeResolverAbi, agentNameUniversalResolverAbi, ontologyTermRegistryAbi, shapeRegistryAbi, permissionlessSubregistryAbi, pricedSubregistryAbi, agentProfileResolverTypeAbi, } from './abis.js';
|
|
15
15
|
export { PREDICATE_ID, AGENT_KIND_ID, CONNECTION_KIND_ID, CLASS_AGENT_NAME, AGENT_KIND_ENUM, CONNECTION_KIND_ENUM, AGENT_TYPE_ID, AGENT_TYPE_ENUM, encodeAgentType, decodeAgentType, decodeAgentKind, CAIP10_NAMESPACE_ALLOWLIST, encodeRecords, decodeRecords, type PredicateName, type EncodedRecord, type DecodeInput, } from './records.js';
|
|
16
16
|
export { NAME_PRICE_BASE, NAME_PRICE_MULTIPLIERS_X10, NAME_PRICE_CAP, NAME_PRICE_MIN_LABEL, priceOf, toCoinUnits, CLAIM_TICKET_TYPES, claimTicketDomain, buildPricedClaimCalls, type ClaimTicketV1, } from './price.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,eAAe,EACf,UAAU,EACV,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,uBAAuB,EACvB,eAAe,EACf,cAAc,EACd,eAAe,EACf,aAAa,EACb,YAAY,EACZ,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,SAAS,GACf,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,UAAU,EACf,KAAK,uBAAuB,GAC7B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,uBAAuB,EACvB,2BAA2B,EAC3B,iBAAiB,EACjB,sBAAsB,EACtB,KAAK,2BAA2B,EAChC,KAAK,iBAAiB,GACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACtF,OAAO,EACL,cAAc,EACd,eAAe,EACf,aAAa,EACb,qBAAqB,EACrB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,aAAa,GACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":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C7B,uBAAuB,EACvB,gBAAgB,EAChB,4BAA4B,EAC5B,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,WAAW,CAAC;AAInB,OAAO,EACL,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,aAAa,EACb,eAAe,EACf,eAAe,EACf,eAAe,EACf,eAAe,EACf,0BAA0B,EAC1B,aAAa,EACb,aAAa,EACb,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,WAAW,GACjB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,eAAe,EACf,0BAA0B,EAC1B,cAAc,EACd,oBAAoB,EACpB,OAAO,EACP,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,KAAK,aAAa,GACnB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// - CLAUDE.md — doctrine
|
|
6
6
|
// - specs/215-agent-naming.md — the contract
|
|
7
7
|
// Typed TLD registry (ADR-0061 / spec 346 §4).
|
|
8
|
-
export { AGENT_TLDS, AGENT_TLD_ALIASES, LEGACY_TLDS, RESERVED_LABELS, ROOT_KIND_AGENT, isAgentTld, isLegacyTld, canonicalTld, derivedTypeForTld, tldForDerivedType, rootClassForDerivedType, rootClassForTld, rootKindForTld, isKnownAgentTld, subtypeForTld, allAgentTlds, } from './constants.js';
|
|
8
|
+
export { AGENT_TLDS, AGENT_TLD_ALIASES, LEGACY_TLDS, RESERVED_LABELS, CHAIN_SEEDED_RESERVED_LABELS, ROOT_KIND_AGENT, isAgentTld, isLegacyTld, canonicalTld, derivedTypeForTld, tldForDerivedType, rootClassForDerivedType, rootClassForTld, rootKindForTld, isKnownAgentTld, isReservedLabel, typeSuffixOfLabel, subtypeForTld, allAgentTlds, } from './constants.js';
|
|
9
9
|
// The federated reference — the pair { name, chain } that crosses a town, and the never-bare display rule
|
|
10
10
|
// (spec 346 §3.7; ap-federation spec 440 §C). The chain is a record beside the name, never a component of it.
|
|
11
11
|
export { federatedAgentName, displayAgentName, sameFederatedName, caip2ForChainId, chainIdOfCaip2, } from './federated.js';
|
|
@@ -13,15 +13,17 @@ export { federatedAgentName, displayAgentName, sameFederatedName, caip2ForChainI
|
|
|
13
13
|
export { registerVerticalAgentTypes, clearVerticalAgentTypes, verticalAgentTypeForTld, verticalAgentTypeForSubtype, verticalAgentTlds, verticalRootKindForTld, } from './vertical.js';
|
|
14
14
|
export { normalizeAgentName, normalizeLabel, isValidAgentName } from './normalize.js';
|
|
15
15
|
export { parseAgentName, formatAgentName, onChainNameOf, MIN_ROOT_LABEL_LENGTH, } from './grammar.js';
|
|
16
|
-
export { A2A_JSONRPC_PATH, A2A_AGENT_CARD_PATH, dnsHostForHandle, parseSubdomainLabel, typedNameForLabel, parseTypedAgentHost, hostForName, agentNameForHandle, agentCardUrlForHost, a2aEndpointForHost, edgeA2aPathForHandle, } from './dns.js';
|
|
17
|
-
export { findUniqueLabel, childNodeOf, validateTypedClaim, ROLE_TYPED, } from './claim.js';
|
|
16
|
+
export { A2A_JSONRPC_PATH, A2A_AGENT_CARD_PATH, dnsHostForHandle, handleForDnsHost, dnsHostReadings, confirmDnsHost, parseSubdomainLabel, typedNameForLabel, parseTypedAgentHost, hostForName, agentNameForHandle, agentCardUrlForHost, a2aEndpointForHost, edgeA2aPathForHandle, } from './dns.js';
|
|
17
|
+
export { findUniqueLabel, childNodeOf, validateTypedClaim, labelClaimViolation, assertClaimableLabel, rootTakesBareHost, knownRootOfNode, ROLE_TYPED, } from './claim.js';
|
|
18
18
|
export { CONTEXT_VAULT_RESOURCES, validateContextualIssuance, issuanceBody, isAnchoredOnChain, isIssuanceActiveAt, } from './issuance.js';
|
|
19
19
|
export { labelhash, namehash, ZERO_NODE } from './namehash.js';
|
|
20
20
|
export { InvalidNameError, NameNotFoundError, UnauthorizedNameOwnerError, } from './errors.js';
|
|
21
21
|
export { AgentNamingClient } from './client.js';
|
|
22
22
|
// Phase 4 pure call builders (subpath `@agenticprimitives/agent-naming/custody`
|
|
23
23
|
// re-exported from top-level for convenience).
|
|
24
|
-
export { buildRegisterSubnameCall, buildRotateNameOwnerCall, buildRotateNameResolverCall, buildSetSubregistryCall, buildSetPrimaryNameCall, buildSetStringAttributeCall, buildSetStringArrayAttributeCall, buildSetAddressAttributeCall, buildSetBytes32AttributeCall, buildRecordCalls, buildSubregistryRegisterCall,
|
|
24
|
+
export { buildRegisterSubnameCall, buildRotateNameOwnerCall, buildRotateNameResolverCall, buildSetSubregistryCall, buildSetPrimaryNameCall, buildSetStringAttributeCall, buildSetStringArrayAttributeCall, buildSetAddressAttributeCall, buildSetBytes32AttributeCall, buildRecordCalls, buildSubregistryRegisterCall,
|
|
25
|
+
// Spec 445 / generation 4 / B2 (REG-5, REG-6) — commit-reveal claim + parent-authority renew.
|
|
26
|
+
buildSubregistryCommitCall, subregistryCommitment, generateClaimSecret, SUBREGISTRY_MIN_COMMIT_AGE_SECONDS, SUBREGISTRY_MAX_COMMIT_AGE_SECONDS, buildRenewNameCall, buildDeclareAgentTypeCalls, buildTypedClaimCalls, } from './custody.js';
|
|
25
27
|
// Phase 3 contract ABIs (live at deployed addresses recorded in
|
|
26
28
|
// packages/contracts/deployments-<network>.json). ADR-0009 pivot: the
|
|
27
29
|
// resolver inherits the shared `AttributeStorage` + ontology stack.
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,EAAE;AACF,OAAO;AACP,0CAA0C;AAC1C,2BAA2B;AAC3B,+CAA+C;AAE/C,+CAA+C;AAC/C,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,eAAe,EACf,UAAU,EACV,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,uBAAuB,EACvB,eAAe,EACf,cAAc,EACd,eAAe,EACf,aAAa,EACb,YAAY,GAIb,MAAM,gBAAgB,CAAC;AACxB,0GAA0G;AAC1G,8GAA8G;AAC9G,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,cAAc,GAIf,MAAM,gBAAgB,CAAC;AACxB,kGAAkG;AAClG,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,uBAAuB,EACvB,2BAA2B,EAC3B,iBAAiB,EACjB,sBAAsB,GAGvB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACtF,OAAO,EACL,cAAc,EACd,eAAe,EACf,aAAa,EACb,qBAAqB,GAItB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,EAAE;AACF,OAAO;AACP,0CAA0C;AAC1C,2BAA2B;AAC3B,+CAA+C;AAE/C,+CAA+C;AAC/C,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,4BAA4B,EAC5B,eAAe,EACf,UAAU,EACV,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,uBAAuB,EACvB,eAAe,EACf,cAAc,EACd,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,YAAY,GAIb,MAAM,gBAAgB,CAAC;AACxB,0GAA0G;AAC1G,8GAA8G;AAC9G,OAAO,EACL,kBAAkB,E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EAC5B,gBAAgB,EAChB,4BAA4B;AAC5B,8FAA8F;AAC9F,0BAA0B,EAC1B,qBAAqB,EACrB,mBAAmB,EACnB,kCAAkC,EAClC,kCAAkC,EAClC,kBAAkB,EAClB,0BAA0B,EAC1B,oBAAoB,GAErB,MAAM,cAAc,CAAC;AAEtB,gEAAgE;AAChE,sEAAsE;AACtE,oEAAoE;AACpE,OAAO,EACL,oBAAoB,EACpB,6BAA6B,EAC7B,6BAA6B,EAC7B,uBAAuB,EACvB,gBAAgB,EAChB,4BAA4B,EAC5B,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,WAAW,CAAC;AAEnB,uEAAuE;AACvE,6CAA6C;AAC7C,OAAO,EACL,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,aAAa,EACb,eAAe,EACf,eAAe,EACf,eAAe,EACf,eAAe,EACf,0BAA0B,EAC1B,aAAa,EACb,aAAa,GAId,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,eAAe,EACf,0BAA0B,EAC1B,cAAc,EACd,oBAAoB,EACpB,OAAO,EACP,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,GAEtB,MAAM,YAAY,CAAC;AACpB,wGAAwG;AACxG,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/normalize.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export { normalizeLabel } from './label.js';
|
|
|
6
6
|
* - `.ws` rewritten to `.workspace`.
|
|
7
7
|
* - Scoped / contextual names return the `@` form (`vault.svc@richcanvas.org`), whichever accepted
|
|
8
8
|
* rendering was given (`@`, `c.u/x.t`, or dotted `x.t.c.u`).
|
|
9
|
-
* - Root, type-node and legacy (`.
|
|
9
|
+
* - Root, type-node and legacy (`.agent`) names return their dotted form.
|
|
10
10
|
*
|
|
11
11
|
* Throws `InvalidNameError` on any rule violation. `namehash` hashes the on-chain form of the same
|
|
12
12
|
* parse, so two inputs that normalize identically hash identically.
|