@agenticprimitives/registry-resolution 1.0.0-alpha.22
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 +19 -0
- package/CLAUDE.md +37 -0
- package/LICENSE +21 -0
- package/README.md +60 -0
- package/dist/caller.d.ts +23 -0
- package/dist/caller.d.ts.map +1 -0
- package/dist/caller.js +4 -0
- package/dist/caller.js.map +1 -0
- package/dist/flows.d.ts +61 -0
- package/dist/flows.d.ts.map +1 -0
- package/dist/flows.js +71 -0
- package/dist/flows.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/policy-defaults.d.ts +10 -0
- package/dist/policy-defaults.d.ts.map +1 -0
- package/dist/policy-defaults.js +43 -0
- package/dist/policy-defaults.js.map +1 -0
- package/dist/ports.d.ts +94 -0
- package/dist/ports.d.ts.map +1 -0
- package/dist/ports.js +2 -0
- package/dist/ports.js.map +1 -0
- package/dist/reference.d.ts +25 -0
- package/dist/reference.d.ts.map +1 -0
- package/dist/reference.js +2 -0
- package/dist/reference.js.map +1 -0
- package/dist/resolve.d.ts +8 -0
- package/dist/resolve.d.ts.map +1 -0
- package/dist/resolve.js +197 -0
- package/dist/resolve.js.map +1 -0
- package/dist/result.d.ts +67 -0
- package/dist/result.d.ts.map +1 -0
- package/dist/result.js +2 -0
- package/dist/result.js.map +1 -0
- package/package.json +67 -0
- package/spec.md +3 -0
package/AUDIT.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# AUDIT — @agenticprimitives/registry-resolution
|
|
2
|
+
|
|
3
|
+
**Status:** W3 of spec 346 (2026-08-29). Pure composition; no transport, storage, clock or randomness.
|
|
4
|
+
|
|
5
|
+
## Threat model (what a compromise of a consumer of this package could try)
|
|
6
|
+
| Threat | Control | Test |
|
|
7
|
+
| --- | --- | --- |
|
|
8
|
+
| Treat a resolution as permission to invoke | `authority` carries references only; no grant/caveat object is ever returned | `no-authority` |
|
|
9
|
+
| Enumerate private issuances through a public lookup | `IssuanceReads` receives the caller; a `none`-listed issuance returns `null` to a public caller | `private-issuance-hidden` |
|
|
10
|
+
| Keep a contextual name alive after the delegation is revoked | basis liveness is re-verified on every resolution (`DelegationLivenessPort` + membership + role gate) | `basis-not-current` |
|
|
11
|
+
| Escalate a refused public lookup into a grant lookup (or degrade a failed grant into a public one) | exactly one reference kind per `ResolutionCaller`; refusals are final | `one-mechanism` |
|
|
12
|
+
| Let a suffix override the on-chain record | step 1 is `checkTypedName`; any inconsistency refuses before anything else is read | `type-mismatch` |
|
|
13
|
+
| Bind an agent to a host derived from its name | bindings come only from the verified publication's surfaces | `bindings-from-publication` |
|
|
14
|
+
| Leak a grant id / presentation into evidence | results are built from typed fields; the grant never enters `evidence` / `authority` | `no-grant-in-result` |
|
|
15
|
+
| Turn evidence into a single score | no `trustScore` field; `forbiddenTerms` gate | `no-trust-score` |
|
|
16
|
+
|
|
17
|
+
## Known limits
|
|
18
|
+
- Workspace participation and per-agent discovery policies are optional ports; absent → workspace context is withheld and the per-type default policy applies.
|
|
19
|
+
- `resolveContextualReference` re-reads the issuance once more than `resolveTypedName` (two calls); acceptable for a read-mostly path.
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# @agenticprimitives/registry-resolution — Claude guide
|
|
2
|
+
|
|
3
|
+
The **composed typed resolver** ([spec 346](../../specs/346-typed-agent-naming-and-registry.md) §6.3, §8, §9;
|
|
4
|
+
[ADR-0061](../../docs/architecture/decisions/0061-derived-agent-types-and-typed-name-suffixes.md)). It composes the
|
|
5
|
+
four planes it does not own — naming (`agent-naming`), the authority graph (`organization`), discovery
|
|
6
|
+
(`registry-kit`), protocol resolution (`agent-resolution`) — into one answer with **six separate signals**:
|
|
7
|
+
subject / context / relationship / bindings / authority / evidence. Never a trust score.
|
|
8
|
+
|
|
9
|
+
## Doctrine (each has a test)
|
|
10
|
+
- **Resolution is never authority** (ADR-0056). `authority.delegationsSeen` are REFERENCES; nothing here
|
|
11
|
+
authorizes. `DelegationLivenessPort` is the only authority question asked, and it is only asked.
|
|
12
|
+
- **One mechanism per caller** (ADR-0013). `ResolutionCaller` names the posture (`public` |
|
|
13
|
+
`authenticated` | `grant` | `invitation`); `callerAdmittedBy(policy, posture)` decides; a refusal is
|
|
14
|
+
final — no retry as a stronger caller, no fall-through to a weaker one.
|
|
15
|
+
- **The suffix is a claim; the record is the authority.** Step 1 is `TypedNamingReads.checkTypedName`,
|
|
16
|
+
which fails closed on `type_mismatch` / `role_required` / `kind_mismatch` (agent-naming, spec 346 §2.3).
|
|
17
|
+
- **`x@ctx` resolves only while its basis is LIVE**: issuance active, membership active, RoleAssignment
|
|
18
|
+
passes `authorizeRoleGatedExecution`, delegation `live`. Revoke the delegation → `basis_not_current`;
|
|
19
|
+
the canonical handle still resolves. A `none`-listed issuance is disclosed only to admitted callers
|
|
20
|
+
(`IssuanceReads` receives the caller).
|
|
21
|
+
- **Bindings come FROM the publication** (host, `/.well-known/agent-card.json`, `/api/a2a`) — never derived
|
|
22
|
+
from the name string here.
|
|
23
|
+
- **`.workspace`** exposes `coordinatesWorkspace` only to participants / grant-holders / invitees.
|
|
24
|
+
|
|
25
|
+
## Layout
|
|
26
|
+
`src/resolve.ts` (the pipeline) · `src/ports.ts` (every injected read; structural where a package edge is
|
|
27
|
+
refused) · `src/policy-defaults.ts` (§8.1 defaults + admission) · `src/flows.ts` (§9 connect / join /
|
|
28
|
+
scoped issuance / revoke — pure planners) · `src/reference.ts`, `src/result.ts` (shapes).
|
|
29
|
+
|
|
30
|
+
## Boundaries
|
|
31
|
+
Allowed: `types`, `agent-naming`, `agent-resolution`, `registry-kit`, `organization`, `situations`.
|
|
32
|
+
Forbidden: `delegation` (liveness is a port), `vault`, `a2a` transport, `identity-directory` (evidence is a
|
|
33
|
+
structural port), `agent-profile`, `agent-relationships`, any Ring-1 provider, `viem`. Nothing in Ring 0
|
|
34
|
+
imports this package; apps and the sibling registry repo do.
|
|
35
|
+
|
|
36
|
+
## Validate
|
|
37
|
+
`pnpm check:registry-resolution` · `pnpm check:resolution-privacy` · `pnpm check:public-exports`.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Agentic Trust Labs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# @agenticprimitives/registry-resolution
|
|
2
|
+
|
|
3
|
+
The composed **typed-name resolver** of spec 346: given a typed handle (`rpedersen.me`, `vault.svc@richcanvas.org`,
|
|
4
|
+
`field.workspace@richcanvas.org`, `discovery.registry`) and a caller posture, it returns the subject, its
|
|
5
|
+
derived type, the issuing context and the live relationship (for `x@ctx` names), the permitted deployment
|
|
6
|
+
bindings, the delegations it *saw*, and the registry/directory evidence — as **six separate signals**.
|
|
7
|
+
It never returns a trust score and never authorizes anything.
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
parseAgentName ─▶ checkTypedName (suffix ↔ on-chain atl:agentType ↔ root; fail closed)
|
|
11
|
+
│ x@ctx: issuance (posture-gated) ─▶ basis live? (membership · role gate · delegation) ─▶ ContextualAgentReferenceV1
|
|
12
|
+
▼
|
|
13
|
+
discovery policy (per-agent or the per-type default) ─▶ is THIS caller admitted? (one mechanism)
|
|
14
|
+
▼
|
|
15
|
+
publication via the caller's reference kind (ans-name | private-grant | direct-invitation) ─▶ bindings
|
|
16
|
+
▼
|
|
17
|
+
registry entries + directory evidence ─▶ TypedResolutionResultV1
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import { resolveTypedName } from '@agenticprimitives/registry-resolution';
|
|
24
|
+
|
|
25
|
+
const out = await resolveTypedName('rpedersen.me@richcanvas.org', { posture: 'grant', requester, grantId, presentation }, ports);
|
|
26
|
+
if (out.ok) {
|
|
27
|
+
out.result.subject; // { agentId, derivedType: 'person', root: 'person', name, legacy: false, typeConsistent: true }
|
|
28
|
+
out.result.context; // { agentId: richcanvas.org's SA, derivedType: 'org', name: 'richcanvas.org' }
|
|
29
|
+
out.result.relationship; // { membershipId, roleAssignmentId?, delegationHash, current: true, basis: 'membership' }
|
|
30
|
+
out.result.bindings; // { host, agentCardUrl, a2aEndpoint, surfaces, publication } — from the signed publication
|
|
31
|
+
out.result.authority; // { note: 'resolution-is-not-authority', delegationsSeen: [...] }
|
|
32
|
+
out.result.evidence; // { registryEntries, assurance, directory }
|
|
33
|
+
} else {
|
|
34
|
+
out.reason; // 'unregistered' | 'type_mismatch' | 'issuance_not_found' | 'basis_not_current' | 'not_permitted' | …
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
`ports` (`TypedResolverPorts`) are all injected: the typed-naming read (`AgentNamingClient.checkTypedName`),
|
|
39
|
+
the context's issuance surface, delegation liveness, membership/role reads, the agent-resolution composed
|
|
40
|
+
resolver, registry evidence, and optionally directory evidence, workspace reads and per-agent policies.
|
|
41
|
+
|
|
42
|
+
## Flows (spec 346 §9)
|
|
43
|
+
|
|
44
|
+
| Function | What it plans |
|
|
45
|
+
| --- | --- |
|
|
46
|
+
| `acceptConnectInvitation(invitation, acceptor, now)` | shape + expiry + recipient checks; returns the grant + initial publication the invitee stores. The registry records nothing. |
|
|
47
|
+
| `planContextualNameIssuance(input, registryId)` | after a join is accepted: the unsigned `ContextualNameIssuanceV1` body (`kind: 'reference'`, membership + delegation basis) + the `CONTEXTUAL_NAME_ISSUED` log event. |
|
|
48
|
+
| `planScopedNameIssuance(input, registryId)` | a context issuing `vault.svc@…` / `architecture.team@…` in its own namespace (`operated-by` / `chartered` basis). |
|
|
49
|
+
| `revokeContextualName(issuance, registryId, now)` | deactivates the contextual name; the canonical handle is untouched. |
|
|
50
|
+
|
|
51
|
+
Referral admission (§9.3) lives in `registry-kit` (`admitRegistryEntry` with a sponsor).
|
|
52
|
+
|
|
53
|
+
## Posture defaults (spec 346 §8.1)
|
|
54
|
+
|
|
55
|
+
`defaultDiscoveryPolicyForType(t)` — person: public name, unlisted, grant-resolved; org / service / registry:
|
|
56
|
+
public; team / workspace: consented listing, authenticated resolution; treasury: unlisted,
|
|
57
|
+
grant-resolved. `callerAdmittedBy(policy, posture)` is the single admission rule.
|
|
58
|
+
|
|
59
|
+
## What this package refuses to do
|
|
60
|
+
Hold state, open a transport, decide authorization, rank, or fall back. See `CLAUDE.md`.
|
package/dist/caller.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { CanonicalAgentId } from '@agenticprimitives/types';
|
|
2
|
+
import type { AgentConnectionInvitationV1, ResolutionGrantPresentationV1 } from '@agenticprimitives/agent-resolution';
|
|
3
|
+
/**
|
|
4
|
+
* Who is asking, and by which ONE mechanism (spec 346 §8.2; ADR-0013). A public caller that gets `null`
|
|
5
|
+
* does NOT retry as a grant-holder; a failed grant does NOT fall through to a public lookup.
|
|
6
|
+
*/
|
|
7
|
+
export type ResolutionCaller = {
|
|
8
|
+
posture: 'public';
|
|
9
|
+
} | {
|
|
10
|
+
posture: 'authenticated';
|
|
11
|
+
requester: CanonicalAgentId;
|
|
12
|
+
} | {
|
|
13
|
+
posture: 'grant';
|
|
14
|
+
requester: CanonicalAgentId;
|
|
15
|
+
grantId: string;
|
|
16
|
+
presentation: ResolutionGrantPresentationV1;
|
|
17
|
+
} | {
|
|
18
|
+
posture: 'invitation';
|
|
19
|
+
requester?: CanonicalAgentId;
|
|
20
|
+
invitation: AgentConnectionInvitationV1;
|
|
21
|
+
};
|
|
22
|
+
export declare function callerRequester(c: ResolutionCaller): CanonicalAgentId | undefined;
|
|
23
|
+
//# sourceMappingURL=caller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"caller.d.ts","sourceRoot":"","sources":["../src/caller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,2BAA2B,EAAE,6BAA6B,EAAE,MAAM,qCAAqC,CAAC;AAEtH;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GACxB;IAAE,OAAO,EAAE,QAAQ,CAAA;CAAE,GACrB;IAAE,OAAO,EAAE,eAAe,CAAC;IAAC,SAAS,EAAE,gBAAgB,CAAA;CAAE,GACzD;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,gBAAgB,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,6BAA6B,CAAA;CAAE,GAC/G;IAAE,OAAO,EAAE,YAAY,CAAC;IAAC,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAAC,UAAU,EAAE,2BAA2B,CAAA;CAAE,CAAC;AAErG,wBAAgB,eAAe,CAAC,CAAC,EAAE,gBAAgB,GAAG,gBAAgB,GAAG,SAAS,CAEjF"}
|
package/dist/caller.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"caller.js","sourceRoot":"","sources":["../src/caller.ts"],"names":[],"mappings":"AAaA,MAAM,UAAU,eAAe,CAAC,CAAmB;IACjD,OAAO,CAAC,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC1D,CAAC"}
|
package/dist/flows.d.ts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { CanonicalAgentId, Hex } from '@agenticprimitives/types';
|
|
2
|
+
import { type ContextualNameIssuanceBody, type ContextualNameListing, type ContextualIssuanceBasis } from '@agenticprimitives/agent-naming';
|
|
3
|
+
import { type AgentConnectionInvitationV1, type PrivateResolutionGrantV1, type AgentServicePublicationV1 } from '@agenticprimitives/agent-resolution';
|
|
4
|
+
import type { RegistryLifecycleEventDraft } from '@agenticprimitives/registry-kit';
|
|
5
|
+
export type ConnectAcceptance = {
|
|
6
|
+
ok: true;
|
|
7
|
+
grant: PrivateResolutionGrantV1;
|
|
8
|
+
initialPublication?: AgentServicePublicationV1;
|
|
9
|
+
rendezvous: string;
|
|
10
|
+
targetAgent: CanonicalAgentId;
|
|
11
|
+
} | {
|
|
12
|
+
ok: false;
|
|
13
|
+
reasons: readonly string[];
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Accept a connection invitation: shape + expiry + recipient binding. Returns what the invitee stores —
|
|
17
|
+
* the grant (resolution plane) and the initial publication. The registry records NOTHING here: a
|
|
18
|
+
* connection is a relationship event, not a naming or registry event (spec 346 §9.1).
|
|
19
|
+
*/
|
|
20
|
+
export declare function acceptConnectInvitation(invitation: AgentConnectionInvitationV1, acceptor: CanonicalAgentId, now: string): ConnectAcceptance;
|
|
21
|
+
export interface JoinAcceptanceInput {
|
|
22
|
+
/** `x.t@c.u` to issue. */
|
|
23
|
+
name: string;
|
|
24
|
+
context: CanonicalAgentId;
|
|
25
|
+
subject: CanonicalAgentId;
|
|
26
|
+
membershipId: string;
|
|
27
|
+
roleAssignmentId?: string;
|
|
28
|
+
/** The mandate / authority delegation minted on acceptance — what keeps the name CURRENT. */
|
|
29
|
+
delegationHash: Hex;
|
|
30
|
+
listing: ContextualNameListing;
|
|
31
|
+
now: string;
|
|
32
|
+
expiresAt?: string;
|
|
33
|
+
}
|
|
34
|
+
export type JoinAcceptance = {
|
|
35
|
+
ok: true;
|
|
36
|
+
issuance: ContextualNameIssuanceBody;
|
|
37
|
+
event: RegistryLifecycleEventDraft;
|
|
38
|
+
} | {
|
|
39
|
+
ok: false;
|
|
40
|
+
reasons: readonly string[];
|
|
41
|
+
};
|
|
42
|
+
/** Plan the contextual-name issuance a context signs after a join is accepted (unsigned body + the log event). */
|
|
43
|
+
export declare function planContextualNameIssuance(input: JoinAcceptanceInput, registryId: `urn:ap:registry:${string}`): JoinAcceptance;
|
|
44
|
+
/** Revoking the basis deactivates the contextual name and leaves the canonical handle untouched (spec 346 §9.2). */
|
|
45
|
+
export declare function revokeContextualName(issuance: ContextualNameIssuanceBody, registryId: `urn:ap:registry:${string}`, now: string): {
|
|
46
|
+
issuance: ContextualNameIssuanceBody;
|
|
47
|
+
event: RegistryLifecycleEventDraft;
|
|
48
|
+
};
|
|
49
|
+
/** A scoped service/team/coordinator/treasury name the context issues in its own namespace (spec 346 §3.2). */
|
|
50
|
+
export declare function planScopedNameIssuance(input: {
|
|
51
|
+
name: string;
|
|
52
|
+
context: CanonicalAgentId;
|
|
53
|
+
subject: CanonicalAgentId;
|
|
54
|
+
basis: Exclude<ContextualIssuanceBasis, {
|
|
55
|
+
kind: 'membership';
|
|
56
|
+
}>;
|
|
57
|
+
listing: ContextualNameListing;
|
|
58
|
+
now: string;
|
|
59
|
+
expiresAt?: string;
|
|
60
|
+
}, registryId: `urn:ap:registry:${string}`): JoinAcceptance;
|
|
61
|
+
//# sourceMappingURL=flows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flows.d.ts","sourceRoot":"","sources":["../src/flows.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAoB,GAAG,EAAE,MAAM,0BAA0B,CAAC;AACxF,OAAO,EAAiE,KAAK,0BAA0B,EAAE,KAAK,qBAAqB,EAAE,KAAK,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC3M,OAAO,EAA2B,KAAK,2BAA2B,EAAE,KAAK,wBAAwB,EAAE,KAAK,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAC/K,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAInF,MAAM,MAAM,iBAAiB,GACzB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,wBAAwB,CAAC;IAAC,kBAAkB,CAAC,EAAE,yBAAyB,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,gBAAgB,CAAA;CAAE,GAChJ;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AAE9C;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,2BAA2B,EAAE,QAAQ,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAO3I;AAID,MAAM,WAAW,mBAAmB;IAClC,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,gBAAgB,CAAC;IAC1B,OAAO,EAAE,gBAAgB,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,6FAA6F;IAC7F,cAAc,EAAE,GAAG,CAAC;IACpB,OAAO,EAAE,qBAAqB,CAAC;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,cAAc,GACtB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,0BAA0B,CAAC;IAAC,KAAK,EAAE,2BAA2B,CAAA;CAAE,GACtF;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AAE9C,kHAAkH;AAClH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,mBAAmB,MAAM,EAAE,GAAG,cAAc,CAiB9H;AAOD,oHAAoH;AACpH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,0BAA0B,EAAE,UAAU,EAAE,mBAAmB,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG;IAAE,QAAQ,EAAE,0BAA0B,CAAC;IAAC,KAAK,EAAE,2BAA2B,CAAA;CAAE,CAE7M;AAED,+GAA+G;AAC/G,wBAAgB,sBAAsB,CAAC,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,gBAAgB,CAAC;IAAC,OAAO,EAAE,gBAAgB,CAAC;IAAC,KAAK,EAAE,OAAO,CAAC,uBAAuB,EAAE;QAAE,IAAI,EAAE,YAAY,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,EAAE,qBAAqB,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,UAAU,EAAE,mBAAmB,MAAM,EAAE,GAAG,cAAc,CAgB/S"}
|
package/dist/flows.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { validateContextualIssuance, parseAgentName, derivedTypeForTld } from '@agenticprimitives/agent-naming';
|
|
2
|
+
import { validateInvitationShape } from '@agenticprimitives/agent-resolution';
|
|
3
|
+
/**
|
|
4
|
+
* Accept a connection invitation: shape + expiry + recipient binding. Returns what the invitee stores —
|
|
5
|
+
* the grant (resolution plane) and the initial publication. The registry records NOTHING here: a
|
|
6
|
+
* connection is a relationship event, not a naming or registry event (spec 346 §9.1).
|
|
7
|
+
*/
|
|
8
|
+
export function acceptConnectInvitation(invitation, acceptor, now) {
|
|
9
|
+
const reasons = validateInvitationShape(invitation).map((v) => `${v.field}: ${v.message}`);
|
|
10
|
+
if (invitation.expiresAt <= now)
|
|
11
|
+
reasons.push('expiresAt: invitation expired');
|
|
12
|
+
if (invitation.recipient && invitation.recipient.toLowerCase() !== acceptor.toLowerCase())
|
|
13
|
+
reasons.push('recipient: invitation is bound to another agent');
|
|
14
|
+
if (invitation.resolution.grant.targetAgent.toLowerCase() !== invitation.targetAgent.toLowerCase())
|
|
15
|
+
reasons.push('grant: targetAgent disagrees with the invitation');
|
|
16
|
+
if (reasons.length)
|
|
17
|
+
return { ok: false, reasons };
|
|
18
|
+
return { ok: true, grant: invitation.resolution.grant, ...(invitation.initialPublication ? { initialPublication: invitation.initialPublication } : {}), rendezvous: invitation.resolution.rendezvous, targetAgent: invitation.targetAgent };
|
|
19
|
+
}
|
|
20
|
+
/** Plan the contextual-name issuance a context signs after a join is accepted (unsigned body + the log event). */
|
|
21
|
+
export function planContextualNameIssuance(input, registryId) {
|
|
22
|
+
let subjectType;
|
|
23
|
+
try {
|
|
24
|
+
const p = parseAgentName(input.name);
|
|
25
|
+
if (p.kind !== 'scoped')
|
|
26
|
+
return { ok: false, reasons: ['name: must be x.t@c.u'] };
|
|
27
|
+
subjectType = derivedTypeForTld(p.handle.tld);
|
|
28
|
+
}
|
|
29
|
+
catch (e) {
|
|
30
|
+
return { ok: false, reasons: [`name: ${e.message}`] };
|
|
31
|
+
}
|
|
32
|
+
const basis = { kind: 'membership', membershipId: input.membershipId, ...(input.roleAssignmentId ? { roleAssignmentId: input.roleAssignmentId } : {}), delegationHash: input.delegationHash };
|
|
33
|
+
const issuance = {
|
|
34
|
+
type: 'ContextualNameIssuanceV1', name: input.name, context: input.context, subject: input.subject, subjectType, kind: 'reference', basis,
|
|
35
|
+
listing: input.listing, issuedAt: input.now, ...(input.expiresAt ? { expiresAt: input.expiresAt } : {}), status: 'active',
|
|
36
|
+
};
|
|
37
|
+
const violations = validateContextualIssuance(issuance);
|
|
38
|
+
if (violations.length)
|
|
39
|
+
return { ok: false, reasons: violations.map((v) => `${v.field}: ${v.message}`) };
|
|
40
|
+
return { ok: true, issuance, event: eventDraft('CONTEXTUAL_NAME_ISSUED', registryId, input.subject, input.name, input.now) };
|
|
41
|
+
}
|
|
42
|
+
/** Deterministic event id — no randomness on this surface (spec 338 §10 / check:resolution-privacy). */
|
|
43
|
+
function eventDraft(kind, registryId, subjectAgent, name, occurredAt) {
|
|
44
|
+
return { type: 'RegistryLifecycleEventV1', eventId: `urn:ap:naming-event:${kind.toLowerCase()}:${name}:${occurredAt}`, kind, registryId, subjectAgent, refs: {}, occurredAt };
|
|
45
|
+
}
|
|
46
|
+
/** Revoking the basis deactivates the contextual name and leaves the canonical handle untouched (spec 346 §9.2). */
|
|
47
|
+
export function revokeContextualName(issuance, registryId, now) {
|
|
48
|
+
return { issuance: { ...issuance, status: 'revoked' }, event: eventDraft('CONTEXTUAL_NAME_REVOKED', registryId, issuance.subject, issuance.name, now) };
|
|
49
|
+
}
|
|
50
|
+
/** A scoped service/team/coordinator/treasury name the context issues in its own namespace (spec 346 §3.2). */
|
|
51
|
+
export function planScopedNameIssuance(input, registryId) {
|
|
52
|
+
let subjectType;
|
|
53
|
+
try {
|
|
54
|
+
const p = parseAgentName(input.name);
|
|
55
|
+
if (p.kind !== 'scoped')
|
|
56
|
+
return { ok: false, reasons: ['name: must be x.t@c.u'] };
|
|
57
|
+
subjectType = derivedTypeForTld(p.handle.tld);
|
|
58
|
+
}
|
|
59
|
+
catch (e) {
|
|
60
|
+
return { ok: false, reasons: [`name: ${e.message}`] };
|
|
61
|
+
}
|
|
62
|
+
const issuance = {
|
|
63
|
+
type: 'ContextualNameIssuanceV1', name: input.name, context: input.context, subject: input.subject, subjectType, kind: 'scoped', basis: input.basis,
|
|
64
|
+
listing: input.listing, issuedAt: input.now, ...(input.expiresAt ? { expiresAt: input.expiresAt } : {}), status: 'active',
|
|
65
|
+
};
|
|
66
|
+
const violations = validateContextualIssuance(issuance);
|
|
67
|
+
if (violations.length)
|
|
68
|
+
return { ok: false, reasons: violations.map((v) => `${v.field}: ${v.message}`) };
|
|
69
|
+
return { ok: true, issuance, event: eventDraft('CONTEXTUAL_NAME_ISSUED', registryId, input.subject, input.name, input.now) };
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=flows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flows.js","sourceRoot":"","sources":["../src/flows.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,0BAA0B,EAAE,cAAc,EAAE,iBAAiB,EAA6F,MAAM,iCAAiC,CAAC;AAC3M,OAAO,EAAE,uBAAuB,EAAmG,MAAM,qCAAqC,CAAC;AAS/K;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,UAAuC,EAAE,QAA0B,EAAE,GAAW;IACtH,MAAM,OAAO,GAAG,uBAAuB,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IAC3F,IAAI,UAAU,CAAC,SAAS,IAAI,GAAG;QAAE,OAAO,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;IAC/E,IAAI,UAAU,CAAC,SAAS,IAAI,UAAU,CAAC,SAAS,CAAC,WAAW,EAAE,KAAK,QAAQ,CAAC,WAAW,EAAE;QAAE,OAAO,CAAC,IAAI,CAAC,iDAAiD,CAAC,CAAC;IAC3J,IAAI,UAAU,CAAC,UAAU,CAAC,KAAK,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AO,EAAE,QAAQ,EAAE,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ;KAC1H,CAAC;IACF,MAAM,UAAU,GAAG,0BAA0B,CAAC,QAAQ,CAAC,CAAC;IACxD,IAAI,UAAU,CAAC,MAAM;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;IACxG,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,wBAAwB,EAAE,UAAU,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;AAC/H,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const PACKAGE_STATUS: "w3-contextual-resolution";
|
|
2
|
+
export declare const SPEC_REF: "specs/346-typed-agent-naming-and-registry.md";
|
|
3
|
+
export { resolveTypedName, resolveContextualReference } from './resolve.js';
|
|
4
|
+
export { defaultDiscoveryPolicyForType, callerAdmittedBy } from './policy-defaults.js';
|
|
5
|
+
export { callerRequester, type ResolutionCaller } from './caller.js';
|
|
6
|
+
export type { ContextualAgentReferenceV1 } from './reference.js';
|
|
7
|
+
export type { TypedResolutionResultV1, TypedResolutionOutcome, TypedResolutionRefusal } from './result.js';
|
|
8
|
+
export type { TypedResolverPorts, TypedNamingReads, IssuanceReads, DelegationLivenessPort, RelationshipReads, PublicationReads, RegistryEvidenceReads, RegistryEvidenceRow, DirectoryEvidenceReads, DirectoryEvidenceLike, WorkspaceReads, DiscoveryPolicyReads, } from './ports.js';
|
|
9
|
+
export { acceptConnectInvitation, planContextualNameIssuance, planScopedNameIssuance, revokeContextualName, type ConnectAcceptance, type JoinAcceptanceInput, type JoinAcceptance, } from './flows.js';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,cAAc,EAAG,0BAAmC,CAAC;AAClE,eAAO,MAAM,QAAQ,EAAG,8CAAuD,CAAC;AAEhF,OAAO,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAC5E,OAAO,EAAE,6BAA6B,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACvF,OAAO,EAAE,eAAe,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACrE,YAAY,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AACjE,YAAY,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC3G,YAAY,EACV,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,cAAc,EACd,oBAAoB,GACrB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,sBAAsB,EACtB,oBAAoB,EACpB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,cAAc,GACpB,MAAM,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// @agenticprimitives/registry-resolution — the composed typed resolver (spec 346 §6.3, §8, §9).
|
|
2
|
+
//
|
|
3
|
+
// Pure composition over injected ports: naming (agent-naming), the authority graph (organization),
|
|
4
|
+
// discovery (registry-kit), protocol resolution (agent-resolution). No transport, no storage, no
|
|
5
|
+
// authorization decision — resolution is never authority (ADR-0056).
|
|
6
|
+
export const PACKAGE_STATUS = 'w3-contextual-resolution';
|
|
7
|
+
export const SPEC_REF = 'specs/346-typed-agent-naming-and-registry.md';
|
|
8
|
+
export { resolveTypedName, resolveContextualReference } from './resolve.js';
|
|
9
|
+
export { defaultDiscoveryPolicyForType, callerAdmittedBy } from './policy-defaults.js';
|
|
10
|
+
export { callerRequester } from './caller.js';
|
|
11
|
+
export { acceptConnectInvitation, planContextualNameIssuance, planScopedNameIssuance, revokeContextualName, } from './flows.js';
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,EAAE;AACF,mGAAmG;AACnG,iGAAiG;AACjG,qEAAqE;AACrE,MAAM,CAAC,MAAM,cAAc,GAAG,0BAAmC,CAAC;AAClE,MAAM,CAAC,MAAM,QAAQ,GAAG,8CAAuD,CAAC;AAEhF,OAAO,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAC5E,OAAO,EAAE,6BAA6B,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACvF,OAAO,EAAE,eAAe,EAAyB,MAAM,aAAa,CAAC;AAiBrE,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,sBAAsB,EACtB,oBAAoB,GAIrB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DerivedAgentType } from '@agenticprimitives/types';
|
|
2
|
+
import type { AgentDiscoveryPolicyV1 } from '@agenticprimitives/agent-resolution';
|
|
3
|
+
export declare function defaultDiscoveryPolicyForType(t: DerivedAgentType): AgentDiscoveryPolicyV1;
|
|
4
|
+
/**
|
|
5
|
+
* May THIS caller obtain a publication under THIS policy? One mechanism per posture (ADR-0013):
|
|
6
|
+
* `public` resolution admits everyone; `authenticated` admits any identified caller; `invitation` /
|
|
7
|
+
* `pairwise` admit grant-holders and invitees only; `direct` admits invitees only; `none` admits nobody.
|
|
8
|
+
*/
|
|
9
|
+
export declare function callerAdmittedBy(policy: AgentDiscoveryPolicyV1, posture: 'public' | 'authenticated' | 'grant' | 'invitation'): boolean;
|
|
10
|
+
//# sourceMappingURL=policy-defaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy-defaults.d.ts","sourceRoot":"","sources":["../src/policy-defaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAsBlF,wBAAgB,6BAA6B,CAAC,CAAC,EAAE,gBAAgB,GAAG,sBAAsB,CAEzF;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,sBAAsB,EAAE,OAAO,EAAE,QAAQ,GAAG,eAAe,GAAG,OAAO,GAAG,YAAY,GAAG,OAAO,CActI"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default visibility posture per derived type (spec 346 §8.1). Overridable per agent; every default
|
|
3
|
+
* passes `validateDiscoveryPolicy` (tested). The person default — a PUBLIC name that is UNLISTED and
|
|
4
|
+
* resolvable only by grant — is the converse of "nameless ≠ unresolvable": named ≠ resolvable.
|
|
5
|
+
*/
|
|
6
|
+
const DEFAULTS = {
|
|
7
|
+
person: { naming: 'public', listing: 'none', resolution: 'invitation', inbound: 'delegation-required' },
|
|
8
|
+
org: { naming: 'public', listing: 'public', resolution: 'public', inbound: 'delegation-required' },
|
|
9
|
+
team: { naming: 'public', listing: 'consented-projection', resolution: 'authenticated', inbound: 'delegation-required' },
|
|
10
|
+
service: { naming: 'public', listing: 'public', resolution: 'public', inbound: 'delegation-required' },
|
|
11
|
+
workspace: { naming: 'public', listing: 'consented-projection', resolution: 'authenticated', inbound: 'delegation-required' },
|
|
12
|
+
treasury: { naming: 'public', listing: 'none', resolution: 'invitation', inbound: 'delegation-required' },
|
|
13
|
+
registry: { naming: 'public', listing: 'public', resolution: 'public', inbound: 'delegation-required' },
|
|
14
|
+
church: { naming: 'public', listing: 'public', resolution: 'public', inbound: 'delegation-required' },
|
|
15
|
+
circle: { naming: 'public', listing: 'consented-projection', resolution: 'authenticated', inbound: 'delegation-required' },
|
|
16
|
+
// Spec 368 — a household is the family's own agent: named publicly (a typed name is a public fact), listed
|
|
17
|
+
// nowhere, reached by invitation, like a person. A family is not a directory entry.
|
|
18
|
+
household: { naming: 'public', listing: 'none', resolution: 'invitation', inbound: 'delegation-required' },
|
|
19
|
+
};
|
|
20
|
+
export function defaultDiscoveryPolicyForType(t) {
|
|
21
|
+
return { specVersion: 'ap.agent-discovery-policy/1', ...DEFAULTS[t] };
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* May THIS caller obtain a publication under THIS policy? One mechanism per posture (ADR-0013):
|
|
25
|
+
* `public` resolution admits everyone; `authenticated` admits any identified caller; `invitation` /
|
|
26
|
+
* `pairwise` admit grant-holders and invitees only; `direct` admits invitees only; `none` admits nobody.
|
|
27
|
+
*/
|
|
28
|
+
export function callerAdmittedBy(policy, posture) {
|
|
29
|
+
switch (policy.resolution) {
|
|
30
|
+
case 'public':
|
|
31
|
+
return true;
|
|
32
|
+
case 'authenticated':
|
|
33
|
+
return posture !== 'public';
|
|
34
|
+
case 'invitation':
|
|
35
|
+
case 'pairwise':
|
|
36
|
+
return posture === 'grant' || posture === 'invitation';
|
|
37
|
+
case 'direct':
|
|
38
|
+
return posture === 'invitation';
|
|
39
|
+
case 'none':
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=policy-defaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version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qB,EAAE;IAC1H,2GAA2G;IAC3G,oFAAoF;IACpF,SAAS,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,EAAE,qBAAqB,EAAE;CAC3G,CAAC;AAEF,MAAM,UAAU,6BAA6B,CAAC,CAAmB;IAC/D,OAAO,EAAE,WAAW,EAAE,6BAA6B,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;AACxE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAA8B,EAAE,OAA4D;IAC3H,QAAQ,MAAM,CAAC,UAAU,EAAE,CAAC;QAC1B,KAAK,QAAQ;YACX,OAAO,IAAI,CAAC;QACd,KAAK,eAAe;YAClB,OAAO,OAAO,KAAK,QAAQ,CAAC;QAC9B,KAAK,YAAY,CAAC;QAClB,KAAK,UAAU;YACb,OAAO,OAAO,KAAK,OAAO,IAAI,OAAO,KAAK,YAAY,CAAC;QACzD,KAAK,QAAQ;YACX,OAAO,OAAO,KAAK,YAAY,CAAC;QAClC,KAAK,MAAM;YACT,OAAO,KAAK,CAAC;IACjB,CAAC;AACH,CAAC"}
|
package/dist/ports.d.ts
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { CanonicalAgentId, Hex, DerivedAgentType, AgentType } from '@agenticprimitives/types';
|
|
2
|
+
import type { ContextualNameIssuanceV1 } from '@agenticprimitives/agent-naming';
|
|
3
|
+
import type { AgentResolutionReference, ComposedResolutionResult, ResolutionContextV1, AgentDiscoveryPolicyV1 } from '@agenticprimitives/agent-resolution';
|
|
4
|
+
import type { RegistryId, RegistryEntryId, RegistryEntryStatusV1 } from '@agenticprimitives/registry-kit';
|
|
5
|
+
import type { RoleAssignmentBody } from '@agenticprimitives/organization';
|
|
6
|
+
import type { SituationV2 } from '@agenticprimitives/situations';
|
|
7
|
+
import type { ResolutionCaller } from './caller.js';
|
|
8
|
+
/** The typed-naming read (structurally `AgentNamingClient.checkTypedName`, spec 346 §4). */
|
|
9
|
+
export interface TypedNamingReads {
|
|
10
|
+
checkTypedName(name: string): Promise<{
|
|
11
|
+
ok: true;
|
|
12
|
+
record: {
|
|
13
|
+
name: string;
|
|
14
|
+
onChainName: string;
|
|
15
|
+
node: Hex;
|
|
16
|
+
address: `0x${string}`;
|
|
17
|
+
derivedType: DerivedAgentType | null;
|
|
18
|
+
root: AgentType | null;
|
|
19
|
+
serviceRole: string | null;
|
|
20
|
+
legacy: boolean;
|
|
21
|
+
typeConsistent: boolean;
|
|
22
|
+
context?: {
|
|
23
|
+
name: string;
|
|
24
|
+
derivedType: DerivedAgentType;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
} | {
|
|
28
|
+
ok: false;
|
|
29
|
+
reason: string;
|
|
30
|
+
detail?: string;
|
|
31
|
+
}>;
|
|
32
|
+
}
|
|
33
|
+
/** The context's issuance surface (its vault projection or rendezvous). It receives the caller so a
|
|
34
|
+
* `none`-listed issuance is disclosed only to grant-holders / members; `null` is the answer otherwise. */
|
|
35
|
+
export interface IssuanceReads {
|
|
36
|
+
findByName(name: string, caller: ResolutionCaller): Promise<ContextualNameIssuanceV1 | null>;
|
|
37
|
+
}
|
|
38
|
+
/** Delegation liveness — the ONLY authority question this package asks, and it only asks (ADR-0056). */
|
|
39
|
+
export type DelegationLivenessPort = (delegationHash: Hex) => Promise<'live' | 'revoked' | 'expired' | 'unknown'>;
|
|
40
|
+
export interface RelationshipReads {
|
|
41
|
+
membershipActive(membershipId: string, at: string): Promise<boolean>;
|
|
42
|
+
roleAssignment(roleAssignmentId: string): Promise<SituationV2<RoleAssignmentBody> | null>;
|
|
43
|
+
}
|
|
44
|
+
/** The protocol-resolution plane (wrap `createComposedResolver` from agent-resolution). */
|
|
45
|
+
export interface PublicationReads {
|
|
46
|
+
resolve(reference: AgentResolutionReference, context: ResolutionContextV1): Promise<ComposedResolutionResult>;
|
|
47
|
+
}
|
|
48
|
+
export interface RegistryEvidenceRow {
|
|
49
|
+
registryId: RegistryId;
|
|
50
|
+
entryId: RegistryEntryId;
|
|
51
|
+
status: RegistryEntryStatusV1['current'];
|
|
52
|
+
receiptId: string;
|
|
53
|
+
}
|
|
54
|
+
export interface RegistryEvidenceReads {
|
|
55
|
+
entriesFor(agentId: CanonicalAgentId): Promise<RegistryEvidenceRow[]>;
|
|
56
|
+
}
|
|
57
|
+
/** Structural mirror of identity-directory `Evidence` — no package edge. */
|
|
58
|
+
export interface DirectoryEvidenceLike {
|
|
59
|
+
source: 'naming' | 'onchain' | 'indexer';
|
|
60
|
+
observedAt: string;
|
|
61
|
+
assurance: 'unverified' | 'asserted' | 'onchain-read' | 'onchain-confirmed';
|
|
62
|
+
ref: string;
|
|
63
|
+
blockNumber?: bigint;
|
|
64
|
+
}
|
|
65
|
+
export interface DirectoryEvidenceReads {
|
|
66
|
+
evidenceFor(name: string, agentId: CanonicalAgentId): Promise<DirectoryEvidenceLike[]>;
|
|
67
|
+
}
|
|
68
|
+
/** `coordinatesWorkspace` for a `.workspace` subject (spec 346 §8.4). */
|
|
69
|
+
export interface WorkspaceReads {
|
|
70
|
+
forCoordinator(agentId: CanonicalAgentId): Promise<{
|
|
71
|
+
workspaceRef: string;
|
|
72
|
+
governedBy: CanonicalAgentId;
|
|
73
|
+
profile?: string;
|
|
74
|
+
} | null>;
|
|
75
|
+
/** Is the caller a current participant of that workspace (spec 344 §2.1)? */
|
|
76
|
+
isParticipant(workspaceRef: string, requester: CanonicalAgentId): Promise<boolean>;
|
|
77
|
+
}
|
|
78
|
+
export interface DiscoveryPolicyReads {
|
|
79
|
+
policyFor(agentId: CanonicalAgentId): Promise<AgentDiscoveryPolicyV1 | null>;
|
|
80
|
+
}
|
|
81
|
+
export interface TypedResolverPorts {
|
|
82
|
+
naming: TypedNamingReads;
|
|
83
|
+
issuances: IssuanceReads;
|
|
84
|
+
delegationLive: DelegationLivenessPort;
|
|
85
|
+
relationships: RelationshipReads;
|
|
86
|
+
publications: PublicationReads;
|
|
87
|
+
registry: RegistryEvidenceReads;
|
|
88
|
+
directory?: DirectoryEvidenceReads;
|
|
89
|
+
workspaces?: WorkspaceReads;
|
|
90
|
+
policies?: DiscoveryPolicyReads;
|
|
91
|
+
chainId: number;
|
|
92
|
+
now: () => string;
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=ports.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ports.d.ts","sourceRoot":"","sources":["../src/ports.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACnG,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,KAAK,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC3J,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAC1G,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,4FAA4F;AAC5F,MAAM,WAAW,gBAAgB;IAC/B,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CACjC;QAAE,EAAE,EAAE,IAAI,CAAC;QAAC,MAAM,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,WAAW,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,GAAG,CAAC;YAAC,OAAO,EAAE,KAAK,MAAM,EAAE,CAAC;YAAC,WAAW,EAAE,gBAAgB,GAAG,IAAI,CAAC;YAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAAC;YAAC,WAAW,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,EAAE,cAAc,CAAC;IAC5B,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,MAAM,CAAC;CACnB"}
|
package/dist/ports.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ports.js","sourceRoot":"","sources":["../src/ports.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ActorContextV1, CanonicalAgentId, DerivedAgentType, Hex } from '@agenticprimitives/types';
|
|
2
|
+
import type { ContextualNameIssuanceV1 } from '@agenticprimitives/agent-naming';
|
|
3
|
+
/**
|
|
4
|
+
* A resolved `x.t@c.u` reference (spec 346 §3.4): the canonical subject + the context + the live
|
|
5
|
+
* relationship. A REFERENCE, never a second identity — it carries no address of its own (ADR-0010/0020).
|
|
6
|
+
*/
|
|
7
|
+
export interface ContextualAgentReferenceV1 {
|
|
8
|
+
type: 'ContextualAgentReferenceV1';
|
|
9
|
+
name: string;
|
|
10
|
+
subject: CanonicalAgentId;
|
|
11
|
+
subjectType: DerivedAgentType;
|
|
12
|
+
context: CanonicalAgentId;
|
|
13
|
+
contextType: DerivedAgentType;
|
|
14
|
+
actorContext: ActorContextV1;
|
|
15
|
+
relationship: {
|
|
16
|
+
membershipId: string;
|
|
17
|
+
roleAssignmentId?: string;
|
|
18
|
+
/** The live delegation — the only authority the reference points AT. */
|
|
19
|
+
delegationHash: Hex;
|
|
20
|
+
};
|
|
21
|
+
issuance: ContextualNameIssuanceV1;
|
|
22
|
+
/** When the basis was last verified live. */
|
|
23
|
+
currentAt: string;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=reference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reference.d.ts","sourceRoot":"","sources":["../src/reference.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AACxG,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAEhF;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,4BAA4B,CAAC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,gBAAgB,CAAC;IAC1B,WAAW,EAAE,gBAAgB,CAAC;IAC9B,OAAO,EAAE,gBAAgB,CAAC;IAC1B,WAAW,EAAE,gBAAgB,CAAC;IAC9B,YAAY,EAAE,cAAc,CAAC;IAC7B,YAAY,EAAE;QACZ,YAAY,EAAE,MAAM,CAAC;QACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,wEAAwE;QACxE,cAAc,EAAE,GAAG,CAAC;KACrB,CAAC;IACF,QAAQ,EAAE,wBAAwB,CAAC;IACnC,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reference.js","sourceRoot":"","sources":["../src/reference.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ResolutionCaller } from './caller.js';
|
|
2
|
+
import type { TypedResolverPorts } from './ports.js';
|
|
3
|
+
import type { ContextualAgentReferenceV1 } from './reference.js';
|
|
4
|
+
import type { TypedResolutionOutcome } from './result.js';
|
|
5
|
+
export declare function resolveTypedName(name: string, caller: ResolutionCaller, ports: TypedResolverPorts): Promise<TypedResolutionOutcome>;
|
|
6
|
+
/** The reference object alone (for callers that only need the relationship, e.g. an audit row). */
|
|
7
|
+
export declare function resolveContextualReference(name: string, caller: ResolutionCaller, ports: TypedResolverPorts): Promise<ContextualAgentReferenceV1 | null>;
|
|
8
|
+
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAeA,OAAO,EAAmB,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAErE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,KAAK,EAAE,sBAAsB,EAAmD,MAAM,aAAa,CAAC;AA8D3G,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CA0GzI;AAED,mGAAmG;AACnG,wBAAsB,0BAA0B,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,0BAA0B,GAAG,IAAI,CAAC,CAkB9J"}
|
package/dist/resolve.js
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { parseAgentName, isIssuanceActiveAt } from '@agenticprimitives/agent-naming';
|
|
2
|
+
import { authorizeRoleGatedExecution } from '@agenticprimitives/organization';
|
|
3
|
+
import { A2A_JSONRPC_PATH, A2A_AGENT_CARD_PATH } from '@agenticprimitives/agent-naming';
|
|
4
|
+
import { callerRequester } from './caller.js';
|
|
5
|
+
import { callerAdmittedBy, defaultDiscoveryPolicyForType } from './policy-defaults.js';
|
|
6
|
+
const refuse = (reason, detail) => ({ ok: false, reason, ...(detail ? { detail } : {}) });
|
|
7
|
+
function agentIdOf(chainId, address) {
|
|
8
|
+
return `eip155:${chainId}:${address.toLowerCase()}`;
|
|
9
|
+
}
|
|
10
|
+
function referenceFor(caller, onChainName) {
|
|
11
|
+
switch (caller.posture) {
|
|
12
|
+
case 'public':
|
|
13
|
+
case 'authenticated':
|
|
14
|
+
return { kind: 'ans-name', name: onChainName };
|
|
15
|
+
case 'grant':
|
|
16
|
+
return { kind: 'private-grant', grantId: caller.grantId, presentation: caller.presentation };
|
|
17
|
+
case 'invitation':
|
|
18
|
+
return { kind: 'direct-invitation', invitation: caller.invitation };
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
/** Deployment bindings (spec 346 §5) come FROM the publication — the host is never derived from the name here. */
|
|
22
|
+
function bindingsFrom(surfaces) {
|
|
23
|
+
const a2a = surfaces.find((s) => s.protocol === 'a2a');
|
|
24
|
+
if (!a2a)
|
|
25
|
+
return {};
|
|
26
|
+
// spec 347 §8.1: the a2a surface's `capabilitiesRef` is the released card's content digest when it is
|
|
27
|
+
// `sha256:`-shaped; any other ref is somebody else's pointer and is NOT surfaced as a card digest.
|
|
28
|
+
const cardDigest = a2a.capabilitiesRef && /^sha256:[0-9a-f]{64}$/.test(a2a.capabilitiesRef) ? a2a.capabilitiesRef : undefined;
|
|
29
|
+
try {
|
|
30
|
+
const u = new URL(a2a.uri);
|
|
31
|
+
return { host: u.host, a2aEndpoint: `${u.origin}${A2A_JSONRPC_PATH}`, agentCardUrl: `${u.origin}${A2A_AGENT_CARD_PATH}`, ...(cardDigest ? { cardDigest } : {}) };
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return {};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Verify a `reference` issuance's basis is LIVE: the membership is active, the RoleAssignment (when
|
|
39
|
+
* named) passes the role gate WITH its materializing delegation live, and the delegation itself is
|
|
40
|
+
* unrevoked. The resolver verifies the delegation, never just the record (spec 346 §9.2).
|
|
41
|
+
*/
|
|
42
|
+
async function verifyReferenceBasis(iss, ports, now) {
|
|
43
|
+
if (iss.basis.kind !== 'membership')
|
|
44
|
+
return { ok: false, detail: `reference basis must be a membership (got ${iss.basis.kind})` };
|
|
45
|
+
const live = await ports.delegationLive(iss.basis.delegationHash);
|
|
46
|
+
if (live !== 'live')
|
|
47
|
+
return { ok: false, detail: `delegation ${live}` };
|
|
48
|
+
const memberActive = await ports.relationships.membershipActive(iss.basis.membershipId, now);
|
|
49
|
+
if (!memberActive)
|
|
50
|
+
return { ok: false, detail: 'membership not active' };
|
|
51
|
+
if (iss.basis.roleAssignmentId) {
|
|
52
|
+
const ra = await ports.relationships.roleAssignment(iss.basis.roleAssignmentId);
|
|
53
|
+
if (!authorizeRoleGatedExecution({ roleAssignment: ra, hasMaterializingAuthority: true, at: now })) {
|
|
54
|
+
return { ok: false, detail: 'role assignment not active' };
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return { ok: true, delegationHash: iss.basis.delegationHash };
|
|
58
|
+
}
|
|
59
|
+
async function verifyScopedBasis(iss, ports) {
|
|
60
|
+
const hash = iss.basis.kind === 'operated-by' ? iss.basis.delegationHash : iss.basis.kind === 'chartered' ? iss.basis.mandateDelegationHash : null;
|
|
61
|
+
if (!hash)
|
|
62
|
+
return { ok: false, detail: `scoped basis must be operated-by or chartered (got ${iss.basis.kind})` };
|
|
63
|
+
const live = await ports.delegationLive(hash);
|
|
64
|
+
return live === 'live' ? { ok: true, delegationHash: hash } : { ok: false, detail: `delegation ${live}` };
|
|
65
|
+
}
|
|
66
|
+
export async function resolveTypedName(name, caller, ports) {
|
|
67
|
+
const now = ports.now();
|
|
68
|
+
let parsed;
|
|
69
|
+
try {
|
|
70
|
+
parsed = parseAgentName(name);
|
|
71
|
+
}
|
|
72
|
+
catch (e) {
|
|
73
|
+
const msg = e.message;
|
|
74
|
+
return refuse(msg.includes('context_depth') ? 'context_depth' : 'malformed', msg);
|
|
75
|
+
}
|
|
76
|
+
// 1. Subject: the naming plane enforces suffix ↔ record ↔ root (spec 346 §2.3) and fails closed.
|
|
77
|
+
const checked = await ports.naming.checkTypedName(parsed.normalized);
|
|
78
|
+
if (!checked.ok)
|
|
79
|
+
return refuse(checked.reason, checked.detail);
|
|
80
|
+
const rec = checked.record;
|
|
81
|
+
const subjectId = agentIdOf(ports.chainId, rec.address);
|
|
82
|
+
const delegationsSeen = [];
|
|
83
|
+
// 2. Context (scoped / contextual names): the issuance is the record; its basis must be live NOW.
|
|
84
|
+
let contextSignal;
|
|
85
|
+
let relationship;
|
|
86
|
+
let reference;
|
|
87
|
+
if (parsed.kind === 'scoped') {
|
|
88
|
+
const ctxName = `${parsed.context.label}.${parsed.context.tld}`;
|
|
89
|
+
const ctxChecked = await ports.naming.checkTypedName(ctxName);
|
|
90
|
+
if (!ctxChecked.ok)
|
|
91
|
+
return refuse('unregistered', `context ${ctxName}: ${ctxChecked.reason}`);
|
|
92
|
+
const contextId = agentIdOf(ports.chainId, ctxChecked.record.address);
|
|
93
|
+
contextSignal = { agentId: contextId, derivedType: parsed.context.derivedType, name: ctxName };
|
|
94
|
+
const iss = await ports.issuances.findByName(parsed.normalized, caller);
|
|
95
|
+
if (!iss)
|
|
96
|
+
return refuse('issuance_not_found');
|
|
97
|
+
if (iss.context.toLowerCase() !== contextId.toLowerCase() || iss.subject.toLowerCase() !== subjectId.toLowerCase()) {
|
|
98
|
+
return refuse('issuance_not_found', 'issuance does not bind this context/subject');
|
|
99
|
+
}
|
|
100
|
+
if (!isIssuanceActiveAt(iss, now))
|
|
101
|
+
return refuse('issuance_inactive');
|
|
102
|
+
const basis = iss.kind === 'reference' ? await verifyReferenceBasis(iss, ports, now) : await verifyScopedBasis(iss, ports);
|
|
103
|
+
if (!basis.ok)
|
|
104
|
+
return refuse('basis_not_current', basis.detail);
|
|
105
|
+
delegationsSeen.push(basis.delegationHash);
|
|
106
|
+
if (iss.kind === 'reference' && iss.basis.kind === 'membership') {
|
|
107
|
+
const actorContext = {
|
|
108
|
+
accountabilityRoot: { scheme: 'caip10', id: contextId },
|
|
109
|
+
rootPrincipal: { scheme: 'caip10', id: contextId },
|
|
110
|
+
originatingAgent: { scheme: 'caip10', id: subjectId },
|
|
111
|
+
actingAgent: { scheme: 'caip10', id: subjectId },
|
|
112
|
+
authorityChain: { profile: 'ap.contextual-name/1', digest: basis.delegationHash },
|
|
113
|
+
};
|
|
114
|
+
reference = {
|
|
115
|
+
type: 'ContextualAgentReferenceV1', name: parsed.normalized, subject: subjectId, subjectType: rec.derivedType ?? parsed.derivedType,
|
|
116
|
+
context: contextId, contextType: parsed.context.derivedType, actorContext,
|
|
117
|
+
relationship: { membershipId: iss.basis.membershipId, ...(iss.basis.roleAssignmentId ? { roleAssignmentId: iss.basis.roleAssignmentId } : {}), delegationHash: iss.basis.delegationHash },
|
|
118
|
+
issuance: iss, currentAt: now,
|
|
119
|
+
};
|
|
120
|
+
relationship = { ...reference.relationship, current: true, basis: 'membership' };
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
relationship = { membershipId: '', delegationHash: basis.delegationHash, current: true, basis: iss.basis.kind };
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
// 3. Posture: is THIS caller admitted by the subject's policy? One mechanism; no fallback (ADR-0013).
|
|
127
|
+
const policy = (await ports.policies?.policyFor(subjectId)) ?? (rec.derivedType ? defaultDiscoveryPolicyForType(rec.derivedType) : null);
|
|
128
|
+
const admitted = policy ? callerAdmittedBy(policy, caller.posture) : caller.posture !== 'public';
|
|
129
|
+
const requester = callerRequester(caller);
|
|
130
|
+
// 4. Publication (bindings) — only when admitted; an unadmitted caller still learns the subject exists
|
|
131
|
+
// ONLY because the name is public (naming posture); private issuances were already gated in step 2.
|
|
132
|
+
let bindings;
|
|
133
|
+
let assurance = 'unresolved';
|
|
134
|
+
if (admitted) {
|
|
135
|
+
const res = await ports.publications.resolve(referenceFor(caller, rec.onChainName), { requester, now });
|
|
136
|
+
if (!res.ok)
|
|
137
|
+
return refuse('publication_failed', res.failures.map((f) => String(f.reason ?? f)).join(', '));
|
|
138
|
+
if (res.resolution.canonicalAgentId.toLowerCase() !== subjectId.toLowerCase()) {
|
|
139
|
+
return refuse('publication_failed', 'publication is for a different agent than the name resolves to');
|
|
140
|
+
}
|
|
141
|
+
bindings = { ...bindingsFrom(res.resolution.publication.surfaces), surfaces: res.resolution.publication.surfaces, publication: res.resolution };
|
|
142
|
+
assurance = res.resolution.assurance;
|
|
143
|
+
}
|
|
144
|
+
else if (caller.posture !== 'public' && policy && policy.resolution === 'none') {
|
|
145
|
+
return refuse('not_permitted');
|
|
146
|
+
}
|
|
147
|
+
// 5. Workspace context (spec 346 §8.4): members / grant-holders / invitees only.
|
|
148
|
+
let workspace;
|
|
149
|
+
if (rec.derivedType === 'workspace' && ports.workspaces && caller.posture !== 'public') {
|
|
150
|
+
const ws = await ports.workspaces.forCoordinator(subjectId);
|
|
151
|
+
if (ws) {
|
|
152
|
+
const allowed = caller.posture === 'grant' || caller.posture === 'invitation' || (requester ? await ports.workspaces.isParticipant(ws.workspaceRef, requester) : false);
|
|
153
|
+
if (allowed)
|
|
154
|
+
workspace = ws;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
// 6. Evidence — separate signals; never a score.
|
|
158
|
+
const registryEntries = await ports.registry.entriesFor(subjectId);
|
|
159
|
+
const directory = ports.directory ? await ports.directory.evidenceFor(parsed.normalized, subjectId) : [];
|
|
160
|
+
return {
|
|
161
|
+
ok: true,
|
|
162
|
+
result: {
|
|
163
|
+
type: 'TypedResolutionResultV1',
|
|
164
|
+
subject: { agentId: subjectId, derivedType: rec.derivedType, root: rec.root, name: rec.name, legacy: rec.legacy, typeConsistent: rec.typeConsistent },
|
|
165
|
+
...(contextSignal ? { context: contextSignal } : {}),
|
|
166
|
+
...(relationship ? { relationship } : {}),
|
|
167
|
+
...(bindings ? { bindings } : {}),
|
|
168
|
+
...(workspace ? { workspace } : {}),
|
|
169
|
+
authority: { note: 'resolution-is-not-authority', delegationsSeen },
|
|
170
|
+
evidence: { registryEntries, assurance, directory },
|
|
171
|
+
resolvedAt: now,
|
|
172
|
+
},
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
/** The reference object alone (for callers that only need the relationship, e.g. an audit row). */
|
|
176
|
+
export async function resolveContextualReference(name, caller, ports) {
|
|
177
|
+
const out = await resolveTypedName(name, caller, ports);
|
|
178
|
+
if (!out.ok || !out.result.relationship || out.result.relationship.basis !== 'membership' || !out.result.context)
|
|
179
|
+
return null;
|
|
180
|
+
const iss = await ports.issuances.findByName(name, caller);
|
|
181
|
+
if (!iss)
|
|
182
|
+
return null;
|
|
183
|
+
return {
|
|
184
|
+
type: 'ContextualAgentReferenceV1', name: out.result.subject.name, subject: out.result.subject.agentId, subjectType: out.result.subject.derivedType ?? iss.subjectType,
|
|
185
|
+
context: out.result.context.agentId, contextType: out.result.context.derivedType,
|
|
186
|
+
actorContext: {
|
|
187
|
+
accountabilityRoot: { scheme: 'caip10', id: out.result.context.agentId },
|
|
188
|
+
rootPrincipal: { scheme: 'caip10', id: out.result.context.agentId },
|
|
189
|
+
originatingAgent: { scheme: 'caip10', id: out.result.subject.agentId },
|
|
190
|
+
actingAgent: { scheme: 'caip10', id: out.result.subject.agentId },
|
|
191
|
+
authorityChain: { profile: 'ap.contextual-name/1', digest: out.result.relationship.delegationHash },
|
|
192
|
+
},
|
|
193
|
+
relationship: { membershipId: out.result.relationship.membershipId, ...(out.result.relationship.roleAssignmentId ? { roleAssignmentId: out.result.relationship.roleAssignmentId } : {}), delegationHash: out.result.relationship.delegationHash },
|
|
194
|
+
issuance: iss, currentAt: out.result.resolvedAt,
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
//# sourceMappingURL=resolve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAiC,MAAM,iCAAiC,CAAC;AACpH,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAE9E,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACxF,OAAO,EAAE,eAAe,EAAyB,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAKvF,MAAM,MAAM,GAAG,CAAC,MAA8B,EAAE,MAAe,EAA0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AC,MAAM,CAAC,YAAY,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,cAAc,EAAE;QACjP,QAAQ,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,UAAU;KAChD,CAAC;AACJ,CAAC"}
|
package/dist/result.d.ts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { AgentType, CanonicalAgentId, DerivedAgentType, Hex } from '@agenticprimitives/types';
|
|
2
|
+
import type { ServiceSurfacePublicationV1, VerifiedAgentResolutionV1, ResolutionAssurance } from '@agenticprimitives/agent-resolution';
|
|
3
|
+
import type { ContextualAgentReferenceV1 } from './reference.js';
|
|
4
|
+
import type { DirectoryEvidenceLike, RegistryEvidenceRow } from './ports.js';
|
|
5
|
+
/**
|
|
6
|
+
* The six signals (spec 346 §8.3) — subject / context / relationship / bindings / authority / evidence —
|
|
7
|
+
* returned SEPARATELY. There is deliberately no trust score and no rank field: relevance ≠ trust, and a
|
|
8
|
+
* ranking belongs to the intent layer, built from `evidence`.
|
|
9
|
+
*/
|
|
10
|
+
export interface TypedResolutionResultV1 {
|
|
11
|
+
type: 'TypedResolutionResultV1';
|
|
12
|
+
subject: {
|
|
13
|
+
agentId: CanonicalAgentId;
|
|
14
|
+
derivedType: DerivedAgentType | null;
|
|
15
|
+
root: AgentType | null;
|
|
16
|
+
name: string;
|
|
17
|
+
legacy: boolean;
|
|
18
|
+
typeConsistent: boolean;
|
|
19
|
+
};
|
|
20
|
+
context?: {
|
|
21
|
+
agentId: CanonicalAgentId;
|
|
22
|
+
derivedType: DerivedAgentType;
|
|
23
|
+
name: string;
|
|
24
|
+
};
|
|
25
|
+
relationship?: ContextualAgentReferenceV1['relationship'] & {
|
|
26
|
+
current: true;
|
|
27
|
+
basis: 'membership' | 'operated-by' | 'chartered';
|
|
28
|
+
};
|
|
29
|
+
bindings?: {
|
|
30
|
+
host?: string;
|
|
31
|
+
agentCardUrl?: string;
|
|
32
|
+
a2aEndpoint?: string;
|
|
33
|
+
/** sha256 of the RELEASED A2A Agent Card the a2a surface publishes (`capabilitiesRef`, spec 347 §8.1). */
|
|
34
|
+
cardDigest?: string;
|
|
35
|
+
surfaces: readonly ServiceSurfacePublicationV1[];
|
|
36
|
+
publication: VerifiedAgentResolutionV1;
|
|
37
|
+
};
|
|
38
|
+
/** `.workspace` subjects only, and only for callers the workspace's posture admits (spec 346 §8.4). */
|
|
39
|
+
workspace?: {
|
|
40
|
+
workspaceRef: string;
|
|
41
|
+
governedBy: CanonicalAgentId;
|
|
42
|
+
profile?: string;
|
|
43
|
+
};
|
|
44
|
+
/** References only — nothing here authorizes (ADR-0056 §1). */
|
|
45
|
+
authority: {
|
|
46
|
+
note: 'resolution-is-not-authority';
|
|
47
|
+
delegationsSeen: readonly Hex[];
|
|
48
|
+
};
|
|
49
|
+
evidence: {
|
|
50
|
+
registryEntries: readonly RegistryEvidenceRow[];
|
|
51
|
+
assurance: ResolutionAssurance | 'unresolved';
|
|
52
|
+
directory: readonly DirectoryEvidenceLike[];
|
|
53
|
+
};
|
|
54
|
+
resolvedAt: string;
|
|
55
|
+
}
|
|
56
|
+
export type TypedResolutionRefusal = 'unregistered' | 'type_mismatch' | 'type_undeclared' | 'kind_mismatch' | 'role_required' | 'not_typed' | 'context_depth' | 'issuance_not_found' | 'issuance_inactive' | 'basis_not_current' | 'not_permitted' | 'publication_failed' | 'malformed';
|
|
57
|
+
export type TypedResolutionOutcome = {
|
|
58
|
+
ok: true;
|
|
59
|
+
result: TypedResolutionResultV1;
|
|
60
|
+
}
|
|
61
|
+
/** Uniform: the reason is for the caller's own diagnostics; the wire projection SHOULD flatten it (spec 338 §10). */
|
|
62
|
+
| {
|
|
63
|
+
ok: false;
|
|
64
|
+
reason: TypedResolutionRefusal;
|
|
65
|
+
detail?: string;
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=result.d.ts.map
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,CAAC;QACjD,WAAW,EAAE,yBAAyB,CAAC;KACxC,CAAC;IACF,uGAAuG;IACvG,SAAS,CAAC,EAAE;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,gBAAgB,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACrF,+DAA+D;IAC/D,SAAS,EAAE;QAAE,IAAI,EAAE,6BAA6B,CAAC;QAAC,eAAe,EAAE,SAAS,GAAG,EAAE,CAAA;KAAE,CAAC;IACpF,QAAQ,EAAE;QAAE,eAAe,EAAE,SAAS,mBAAmB,EAAE,CAAC;QAAC,SAAS,EAAE,mBAAmB,GAAG,YAAY,CAAC;QAAC,SAAS,EAAE,SAAS,qBAAqB,EAAE,CAAA;KAAE,CAAC;IAC1J,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,sBAAsB,GAC9B,cAAc,GACd,eAAe,GACf,iBAAiB,GACjB,eAAe,GACf,eAAe,GACf,WAAW,GACX,eAAe,GACf,oBAAoB,GACpB,mBAAmB,GACnB,mBAAmB,GACnB,eAAe,GACf,oBAAoB,GACpB,WAAW,CAAC;AAEhB,MAAM,MAAM,sBAAsB,GAC9B;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,uBAAuB,CAAA;CAAE;AAC/C,qHAAqH;GACnH;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,sBAAsB,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC"}
|
package/dist/result.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result.js","sourceRoot":"","sources":["../src/result.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@agenticprimitives/registry-resolution",
|
|
3
|
+
"version": "1.0.0-alpha.22",
|
|
4
|
+
"description": "The composed typed resolver (spec 346 §6.3/§8/§9): typed name → subject → derived type → (context → relationship) → permitted publication → bindings, returned as SEPARATE signals (subject / context / relationship / bindings / authority / evidence — never a trust score). Posture-aware, one mechanism per caller, every read injected. Owns the connect / join / referral flow shapes. Never authority.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/agentictrustlabs/agenticprimitives.git",
|
|
9
|
+
"directory": "packages/registry-resolution"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/agentictrustlabs/agenticprimitives/tree/master/packages/registry-resolution",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/agentictrustlabs/agenticprimitives/issues"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"main": "./dist/index.js",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"import": "./dist/index.js"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"LICENSE",
|
|
26
|
+
"dist",
|
|
27
|
+
"spec.md",
|
|
28
|
+
"README.md",
|
|
29
|
+
"AUDIT.md",
|
|
30
|
+
"CLAUDE.md"
|
|
31
|
+
],
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"@agenticprimitives/agent-naming": "1.0.0-alpha.22",
|
|
37
|
+
"@agenticprimitives/organization": "0.0.0-alpha.6",
|
|
38
|
+
"@agenticprimitives/situations": "0.0.0-alpha.6",
|
|
39
|
+
"@agenticprimitives/types": "1.0.0-alpha.22",
|
|
40
|
+
"@agenticprimitives/registry-kit": "0.0.0-alpha.10",
|
|
41
|
+
"@agenticprimitives/agent-resolution": "0.0.0-alpha.3"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"vitest": "^4.1.8",
|
|
45
|
+
"@agenticprimitives/agent-naming": "1.0.0-alpha.22",
|
|
46
|
+
"@agenticprimitives/registry-kit": "0.0.0-alpha.10",
|
|
47
|
+
"@agenticprimitives/organization": "0.0.0-alpha.6",
|
|
48
|
+
"@agenticprimitives/agent-resolution": "0.0.0-alpha.3",
|
|
49
|
+
"@agenticprimitives/situations": "0.0.0-alpha.6",
|
|
50
|
+
"@agenticprimitives/types": "1.0.0-alpha.22"
|
|
51
|
+
},
|
|
52
|
+
"keywords": [
|
|
53
|
+
"agent",
|
|
54
|
+
"naming",
|
|
55
|
+
"registry",
|
|
56
|
+
"resolution",
|
|
57
|
+
"smart-agent",
|
|
58
|
+
"agentic"
|
|
59
|
+
],
|
|
60
|
+
"scripts": {
|
|
61
|
+
"build": "tsc -p tsconfig.build.json",
|
|
62
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
63
|
+
"test": "vitest run",
|
|
64
|
+
"test:unit": "vitest run test/unit --passWithNoTests",
|
|
65
|
+
"clean": "rm -rf dist"
|
|
66
|
+
}
|
|
67
|
+
}
|
package/spec.md
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
# Spec pointer
|
|
2
|
+
|
|
3
|
+
Architect-of-record: [`specs/346-typed-agent-naming-and-registry.md`](../../specs/346-typed-agent-naming-and-registry.md) — §6.3 (this package), §8 (contextual resolution), §9 (invitation flows). ADR of record: [ADR-0061](../../docs/architecture/decisions/0061-derived-agent-types-and-typed-name-suffixes.md); governing doctrine [ADR-0056](../../docs/architecture/decisions/0056-resolution-is-not-authority-private-agent-resolution.md).
|