@agenticprimitives/agent-resolution 0.0.0-alpha.1

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.
Files changed (92) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +319 -0
  3. package/dist/admission.d.ts +14 -0
  4. package/dist/admission.d.ts.map +1 -0
  5. package/dist/admission.js +137 -0
  6. package/dist/admission.js.map +1 -0
  7. package/dist/authority-ref.d.ts +38 -0
  8. package/dist/authority-ref.d.ts.map +1 -0
  9. package/dist/authority-ref.js +69 -0
  10. package/dist/authority-ref.js.map +1 -0
  11. package/dist/canonicalization.d.ts +16 -0
  12. package/dist/canonicalization.d.ts.map +1 -0
  13. package/dist/canonicalization.js +39 -0
  14. package/dist/canonicalization.js.map +1 -0
  15. package/dist/codec.d.ts +15 -0
  16. package/dist/codec.d.ts.map +1 -0
  17. package/dist/codec.js +34 -0
  18. package/dist/codec.js.map +1 -0
  19. package/dist/compose.d.ts +79 -0
  20. package/dist/compose.d.ts.map +1 -0
  21. package/dist/compose.js +235 -0
  22. package/dist/compose.js.map +1 -0
  23. package/dist/endpoint-control.d.ts +87 -0
  24. package/dist/endpoint-control.d.ts.map +1 -0
  25. package/dist/endpoint-control.js +174 -0
  26. package/dist/endpoint-control.js.map +1 -0
  27. package/dist/errors.d.ts +33 -0
  28. package/dist/errors.d.ts.map +1 -0
  29. package/dist/errors.js +71 -0
  30. package/dist/errors.js.map +1 -0
  31. package/dist/freshness.d.ts +43 -0
  32. package/dist/freshness.d.ts.map +1 -0
  33. package/dist/freshness.js +100 -0
  34. package/dist/freshness.js.map +1 -0
  35. package/dist/grant-index.d.ts +21 -0
  36. package/dist/grant-index.d.ts.map +1 -0
  37. package/dist/grant-index.js +0 -0
  38. package/dist/grant-index.js.map +1 -0
  39. package/dist/grants.d.ts +100 -0
  40. package/dist/grants.d.ts.map +1 -0
  41. package/dist/grants.js +99 -0
  42. package/dist/grants.js.map +1 -0
  43. package/dist/index.d.ts +44 -0
  44. package/dist/index.d.ts.map +1 -0
  45. package/dist/index.js +63 -0
  46. package/dist/index.js.map +1 -0
  47. package/dist/invitation.d.ts +43 -0
  48. package/dist/invitation.d.ts.map +1 -0
  49. package/dist/invitation.js +76 -0
  50. package/dist/invitation.js.map +1 -0
  51. package/dist/peer-attestation.d.ts +61 -0
  52. package/dist/peer-attestation.d.ts.map +1 -0
  53. package/dist/peer-attestation.js +128 -0
  54. package/dist/peer-attestation.js.map +1 -0
  55. package/dist/peer-gate.d.ts +73 -0
  56. package/dist/peer-gate.d.ts.map +1 -0
  57. package/dist/peer-gate.js +108 -0
  58. package/dist/peer-gate.js.map +1 -0
  59. package/dist/policy.d.ts +53 -0
  60. package/dist/policy.d.ts.map +1 -0
  61. package/dist/policy.js +73 -0
  62. package/dist/policy.js.map +1 -0
  63. package/dist/ports.d.ts +59 -0
  64. package/dist/ports.d.ts.map +1 -0
  65. package/dist/ports.js +10 -0
  66. package/dist/ports.js.map +1 -0
  67. package/dist/projection.d.ts +74 -0
  68. package/dist/projection.d.ts.map +1 -0
  69. package/dist/projection.js +134 -0
  70. package/dist/projection.js.map +1 -0
  71. package/dist/proof.d.ts +76 -0
  72. package/dist/proof.d.ts.map +1 -0
  73. package/dist/proof.js +207 -0
  74. package/dist/proof.js.map +1 -0
  75. package/dist/publication.d.ts +123 -0
  76. package/dist/publication.d.ts.map +1 -0
  77. package/dist/publication.js +32 -0
  78. package/dist/publication.js.map +1 -0
  79. package/dist/records.d.ts +168 -0
  80. package/dist/records.d.ts.map +1 -0
  81. package/dist/records.js +83 -0
  82. package/dist/records.js.map +1 -0
  83. package/dist/references.d.ts +61 -0
  84. package/dist/references.d.ts.map +1 -0
  85. package/dist/references.js +7 -0
  86. package/dist/references.js.map +1 -0
  87. package/dist/results.d.ts +89 -0
  88. package/dist/results.d.ts.map +1 -0
  89. package/dist/results.js +37 -0
  90. package/dist/results.js.map +1 -0
  91. package/package.json +57 -0
  92. package/spec.md +78 -0
@@ -0,0 +1,76 @@
1
+ import type { Address, CanonicalAgentId } from '@agenticprimitives/types';
2
+ import { type Sha256 } from './canonicalization.js';
3
+ import { type ResolutionFailure } from './errors.js';
4
+ import { type ChannelContinuityState, type ResolutionFreshnessV1 } from './freshness.js';
5
+ import { type AgentServicePublicationV1, type ServiceSurfacePublicationV1 } from './publication.js';
6
+ import { type EndpointControlAssurance, type VerifyEndpointControlOptions } from './endpoint-control.js';
7
+ /** Injected ERC-1271 read — satisfied structurally by a viem `PublicClient`. */
8
+ export interface Erc1271Verifier {
9
+ verifyHash(args: {
10
+ address: Address;
11
+ hash: `0x${string}`;
12
+ signature: `0x${string}`;
13
+ }): Promise<boolean>;
14
+ }
15
+ /**
16
+ * Injected publication-authority check: "was `publishedBy` authorized to publish for `agentId` at
17
+ * `at`, under `authorityRef`?"
18
+ *
19
+ * Injected rather than implemented because the authority record is authoritative in the target's
20
+ * vault (spec 338 §9) and this package does no I/O. A verifier that always returns true is a
21
+ * deliberate test double, never a production default.
22
+ */
23
+ export type PublicationAuthorityCheck = (args: {
24
+ agentId: CanonicalAgentId;
25
+ publishedBy: CanonicalAgentId;
26
+ authorityRef: string;
27
+ at: string;
28
+ }) => Promise<boolean>;
29
+ export interface VerifyPublicationOptions {
30
+ /** The agent the caller EXPECTED to resolve. Mismatch is capability substitution. */
31
+ expectedAgentId: CanonicalAgentId;
32
+ /** ISO-8601, injected. */
33
+ now: string;
34
+ verifier: Erc1271Verifier;
35
+ /** Omit only when the caller verifies authority itself; then `publisherAuthorized` stays `false`. */
36
+ authorityCheck?: PublicationAuthorityCheck;
37
+ known?: ChannelContinuityState;
38
+ requireContinuity?: boolean;
39
+ /**
40
+ * Require every surface to carry a currently-valid endpoint-control proof.
41
+ *
42
+ * WITHOUT `endpointControl` below this checks only PRESENCE and EXPIRY — "a proof was recorded",
43
+ * not "we verified it". Supply `endpointControl` to actually verify (AR-L4), and read
44
+ * `endpointAssurance` to learn whether the result was cryptographic or merely observed.
45
+ */
46
+ requireEndpointProof?: boolean;
47
+ /** Evidence resolver + trusted observers. Omit ⇒ presence/expiry only (see above). */
48
+ endpointControl?: Pick<VerifyEndpointControlOptions, 'resolveEvidence' | 'trustedObservers' | 'maxObservationAgeMs'>;
49
+ /**
50
+ * Reject a surface whose endpoint control is weaker than this. `'cryptographic'` refuses
51
+ * observation-based proofs outright. Only meaningful with `endpointControl` supplied.
52
+ */
53
+ minEndpointAssurance?: EndpointControlAssurance;
54
+ /** Reject any surface whose exposure exceeds this projection's ceiling (fail-closed). */
55
+ maxExposure?: 'public' | 'authenticated' | 'private' | 'service-only';
56
+ }
57
+ export interface VerifyPublicationResult {
58
+ ok: boolean;
59
+ publication: AgentServicePublicationV1;
60
+ /** Digest recomputed from the canonical body — compare to `publication.digest`. */
61
+ computedDigest: Sha256;
62
+ signatureValid: boolean;
63
+ publisherAuthorized: boolean;
64
+ freshness: ResolutionFreshnessV1;
65
+ /** Surfaces that passed every check. Empty when `ok` is false. */
66
+ acceptedSurfaces: readonly ServiceSurfacePublicationV1[];
67
+ /** Per-surface endpoint-control assurance. Absent entry ⇒ not verified (presence-only or no proof). */
68
+ endpointAssurance: Readonly<Record<string, EndpointControlAssurance>>;
69
+ failures: readonly ResolutionFailure[];
70
+ }
71
+ /**
72
+ * Verify a publication end to end. Never throws on a verification failure — returns every failure so
73
+ * a caller can log precisely and surface a uniform wire code (see `errors.ts`).
74
+ */
75
+ export declare function verifyPublication(publication: AgentServicePublicationV1, opts: VerifyPublicationOptions): Promise<VerifyPublicationResult>;
76
+ //# sourceMappingURL=proof.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proof.d.ts","sourceRoot":"","sources":["../src/proof.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAA2B,KAAK,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAW,KAAK,iBAAiB,EAAE,MAAM,aAAa,CA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;IAChD,yFAAyF;IACzF,WAAW,CAAC,EAAE,QAAQ,GAAG,eAAe,GAAG,SAAS,GAAG,cAAc,CAAC;CACvE;AAED,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,OAAO,CAAC;IACZ,WAAW,EAAE,yBAAyB,CAAC;IACvC,mFAAmF;IACnF,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,SAAS,EAAE,qBAAqB,CAAC;IACjC,kEAAkE;IAClE,gBAAgB,EAAE,SAAS,2BAA2B,EAAE,CAAC;IACzD,uGAAuG;IACvG,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC,CAAC;IACtE,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAC;CACxC;AAiBD;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,yBAAyB,EACtC,IAAI,EAAE,wBAAwB,GAC7B,OAAO,CAAC,uBAAuB,CAAC,CA8MlC"}
package/dist/proof.js ADDED
@@ -0,0 +1,207 @@
1
+ // Publication verification — the security core of this package (spec 338 §3.1).
2
+ //
3
+ // Fail-closed (ADR-0013). Verification recomputes the digest from the canonical body (catches any
4
+ // field tamper) AND re-checks the signature over that digest by the declared publisher AND checks
5
+ // freshness/continuity AND checks that the publisher was authorized to publish for this agent.
6
+ //
7
+ // Every one of those is load-bearing:
8
+ // - digest alone → tampering caught, staleness not
9
+ // - signature alone → an old signed publication replays forever
10
+ // - freshness alone → the resolver could have substituted the whole object
11
+ // - publisher authority → a compromised publication key publishes for anyone
12
+ //
13
+ // The signature verifier is INJECTED so this stays a pure, network-free leaf. A viem `PublicClient`
14
+ // satisfies `Erc1271Verifier` structurally (`verifyHash`), matching `registry-kit`.
15
+ import { digestOf, signingDigest } from './canonicalization.js';
16
+ import { failure } from './errors.js';
17
+ import { checkFreshness, } from './freshness.js';
18
+ import { publicationBody, } from './publication.js';
19
+ import { verifyEndpointControl, } from './endpoint-control.js';
20
+ const ENDPOINT_ASSURANCE_RANK = {
21
+ none: 0,
22
+ observed: 1,
23
+ cryptographic: 2,
24
+ };
25
+ const EXPOSURE_RANK = { public: 0, authenticated: 1, private: 2, 'service-only': 3 };
26
+ /** CAIP-10 `namespace:reference:address` → the address a signature verifier takes. */
27
+ function addressOf(id) {
28
+ const parts = String(id).split(':');
29
+ const addr = parts[parts.length - 1];
30
+ return addr && /^0x[0-9a-fA-F]{40}$/.test(addr) ? addr.toLowerCase() : undefined;
31
+ }
32
+ /**
33
+ * Verify a publication end to end. Never throws on a verification failure — returns every failure so
34
+ * a caller can log precisely and surface a uniform wire code (see `errors.ts`).
35
+ */
36
+ export async function verifyPublication(publication, opts) {
37
+ const failures = [];
38
+ // 1. Digest — recompute from the canonical body so any field tamper is caught even if the
39
+ // signature happens to verify against the claimed digest.
40
+ const computedDigest = await digestOf(publicationBody(publication));
41
+ if (computedDigest !== publication.digest) {
42
+ failures.push(failure('publication_digest_mismatch', 'recomputed digest does not match the published digest', {
43
+ computed: computedDigest,
44
+ published: publication.digest,
45
+ }));
46
+ }
47
+ // 2. Target — the publication must describe the agent the caller asked for.
48
+ if (publication.agentId !== opts.expectedAgentId) {
49
+ failures.push(failure('publication_agent_mismatch', 'publication describes a different agent than expected', {
50
+ expected: opts.expectedAgentId,
51
+ got: publication.agentId,
52
+ }));
53
+ }
54
+ // 3. Status — only `active` may be used to reach an agent.
55
+ if (publication.status !== 'active') {
56
+ failures.push(failure('publication_status_not_active', `publication status is "${publication.status}"`, {
57
+ status: publication.status,
58
+ }));
59
+ }
60
+ // 4. Freshness + continuity + rollback + equivocation.
61
+ const freshness = checkFreshness({
62
+ channelId: publication.channelId,
63
+ sequence: publication.sequence,
64
+ previousDigest: publication.previousDigest,
65
+ digest: publication.digest,
66
+ issuedAt: publication.issuedAt,
67
+ notBefore: publication.notBefore,
68
+ expiresAt: publication.expiresAt,
69
+ now: opts.now,
70
+ known: opts.known,
71
+ requireContinuity: opts.requireContinuity,
72
+ });
73
+ failures.push(...freshness.failures);
74
+ // 5. Signature — over the RECOMPUTED digest, by the declared publisher.
75
+ let signatureValid = false;
76
+ const proof = publication.proofs.find((p) => p.signer === publication.publishedBy);
77
+ const publisherAddress = addressOf(publication.publishedBy);
78
+ if (!proof) {
79
+ failures.push(failure('publication_signature_invalid', 'no proof by the declared publisher', {
80
+ publishedBy: publication.publishedBy,
81
+ }));
82
+ }
83
+ else if (!publisherAddress) {
84
+ failures.push(failure('publication_signature_invalid', 'publisher id does not carry a verifiable address', {
85
+ publishedBy: publication.publishedBy,
86
+ }));
87
+ }
88
+ else {
89
+ try {
90
+ signatureValid = await opts.verifier.verifyHash({
91
+ address: publisherAddress,
92
+ hash: signingDigest(computedDigest),
93
+ signature: proof.signature,
94
+ });
95
+ }
96
+ catch {
97
+ // A verifier that errors is a verifier that did not verify (ADR-0013: no fallback to a
98
+ // weaker check).
99
+ signatureValid = false;
100
+ }
101
+ if (!signatureValid) {
102
+ failures.push(failure('publication_signature_invalid', 'publisher signature did not verify over the publication digest'));
103
+ }
104
+ }
105
+ // 6. Publication authority — a valid signature by an unauthorized publisher is still a forgery.
106
+ let publisherAuthorized = false;
107
+ if (opts.authorityCheck) {
108
+ try {
109
+ publisherAuthorized = await opts.authorityCheck({
110
+ agentId: publication.agentId,
111
+ publishedBy: publication.publishedBy,
112
+ authorityRef: publication.publicationAuthorityRef,
113
+ at: opts.now,
114
+ });
115
+ }
116
+ catch {
117
+ publisherAuthorized = false;
118
+ }
119
+ if (!publisherAuthorized) {
120
+ failures.push(failure('publication_publisher_unauthorized', 'publisher was not authorized to publish for this agent', {
121
+ publishedBy: publication.publishedBy,
122
+ authorityRef: publication.publicationAuthorityRef,
123
+ }));
124
+ }
125
+ }
126
+ // 7. Per-surface checks — exposure ceiling, endpoint control, transport-key window.
127
+ const nowMs = Date.parse(opts.now);
128
+ const acceptedSurfaces = [];
129
+ const endpointAssurance = {};
130
+ const ceiling = opts.maxExposure ? EXPOSURE_RANK[opts.maxExposure] : undefined;
131
+ for (const s of publication.surfaces) {
132
+ const surfaceFailures = [];
133
+ if (ceiling !== undefined && EXPOSURE_RANK[s.exposure] > ceiling) {
134
+ surfaceFailures.push(failure('publication_surface_exposure_violation', `surface exposure "${s.exposure}" exceeds the projection ceiling "${opts.maxExposure}"`, {
135
+ surfaceId: s.surfaceId,
136
+ }));
137
+ }
138
+ if (opts.requireEndpointProof) {
139
+ if (!s.endpointControlProof) {
140
+ surfaceFailures.push(failure('publication_endpoint_proof_missing', 'endpoint-control proof required but absent', { surfaceId: s.surfaceId }));
141
+ }
142
+ else if (opts.endpointControl) {
143
+ // AR-L4: actually verify, rather than trusting that a proof was recorded.
144
+ const ec = await verifyEndpointControl(s.endpointControlProof, {
145
+ uri: s.uri,
146
+ surfaceId: s.surfaceId,
147
+ agentId: publication.agentId,
148
+ now: opts.now,
149
+ verifier: opts.verifier,
150
+ resolveEvidence: opts.endpointControl.resolveEvidence,
151
+ trustedObservers: opts.endpointControl.trustedObservers,
152
+ maxObservationAgeMs: opts.endpointControl.maxObservationAgeMs,
153
+ });
154
+ endpointAssurance[s.surfaceId] = ec.assurance;
155
+ if (!ec.ok) {
156
+ surfaceFailures.push(...ec.failures.map((f) => ({ ...f, detail: { ...f.detail, surfaceId: s.surfaceId } })));
157
+ }
158
+ else if (opts.minEndpointAssurance &&
159
+ ENDPOINT_ASSURANCE_RANK[ec.assurance] < ENDPOINT_ASSURANCE_RANK[opts.minEndpointAssurance]) {
160
+ surfaceFailures.push(failure('publication_endpoint_proof_missing', `endpoint control assurance "${ec.assurance}" is weaker than the required "${opts.minEndpointAssurance}"`, { surfaceId: s.surfaceId }));
161
+ }
162
+ }
163
+ else if (s.endpointControlProof.expiresAt) {
164
+ // Presence/expiry only — the caller did not supply an evidence resolver.
165
+ const exp = Date.parse(s.endpointControlProof.expiresAt);
166
+ if (!Number.isNaN(exp) && !Number.isNaN(nowMs) && nowMs >= exp) {
167
+ surfaceFailures.push(failure('publication_endpoint_proof_expired', 'endpoint-control proof has expired', { surfaceId: s.surfaceId }));
168
+ }
169
+ }
170
+ }
171
+ const key = s.transportKeyBinding;
172
+ if (key && !Number.isNaN(nowMs)) {
173
+ const kNotBefore = Date.parse(key.notBefore);
174
+ const kExpires = Date.parse(key.expiresAt);
175
+ if (Number.isNaN(kNotBefore) || Number.isNaN(kExpires)) {
176
+ surfaceFailures.push(failure('publication_transport_key_invalid', 'transport key validity window is not parseable', { surfaceId: s.surfaceId }));
177
+ }
178
+ else if (nowMs < kNotBefore || nowMs >= kExpires) {
179
+ surfaceFailures.push(failure('publication_transport_key_invalid', 'transport key is outside its validity window', {
180
+ surfaceId: s.surfaceId,
181
+ notBefore: key.notBefore,
182
+ expiresAt: key.expiresAt,
183
+ }));
184
+ }
185
+ if (key.purposes.length === 0) {
186
+ surfaceFailures.push(failure('publication_transport_key_invalid', 'transport key declares no purpose', { surfaceId: s.surfaceId }));
187
+ }
188
+ }
189
+ if (surfaceFailures.length === 0)
190
+ acceptedSurfaces.push(s);
191
+ else
192
+ failures.push(...surfaceFailures);
193
+ }
194
+ const ok = failures.length === 0 && signatureValid;
195
+ return {
196
+ ok,
197
+ publication,
198
+ computedDigest,
199
+ signatureValid,
200
+ publisherAuthorized,
201
+ freshness,
202
+ acceptedSurfaces: ok ? acceptedSurfaces : [],
203
+ endpointAssurance,
204
+ failures,
205
+ };
206
+ }
207
+ //# sourceMappingURL=proof.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proof.js","sourceRoot":"","sources":["../src/proof.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,EAAE;AACF,kGAAkG;AAClG,kGAAkG;AAClG,+FAA+F;AAC/F,EAAE;AACF,sCAAsC;AACtC,gEAAgE;AAChE,0EAA0E;AAC1E,qFAAqF;AACrF,mFAAmF;AACnF,EAAE;AACF,oGAAoG;AACpG,oFAAoF;AAGpF,OAAO,EAAE,QAAQ,EAAE,aAAa,E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AE,GAAG,CAAC,SAAS;oBACxB,SAAS,EAAE,GAAG,CAAC,SAAS;iBACzB,CAAC,CACH,CAAC;YACJ,CAAC;YACD,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC9B,eAAe,CAAC,IAAI,CAClB,OAAO,CAAC,mCAAmC,EAAE,mCAAmC,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC,CAC9G,CAAC;YACJ,CAAC;QACH,CAAC;QAED,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC;YAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;;YACtD,QAAQ,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,CAAC;IACzC,CAAC;IAED,MAAM,EAAE,GAAG,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,cAAc,CAAC;IAEnD,OAAO;QACL,EAAE;QACF,WAAW;QACX,cAAc;QACd,cAAc;QACd,mBAAmB;QACnB,SAAS;QACT,gBAAgB,EAAE,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE;QAC5C,iBAAiB;QACjB,QAAQ;KACT,CAAC;AACJ,CAAC"}
@@ -0,0 +1,123 @@
1
+ import type { CanonicalAgentId } from '@agenticprimitives/types';
2
+ import type { Sha256 } from './canonicalization.js';
3
+ /** Lifecycle state of a publication. Only `active` may be used to reach an agent. */
4
+ export type PublicationStatus = 'active'
5
+ /** A higher sequence exists. Kept for continuity verification. */
6
+ | 'superseded'
7
+ /** Temporarily unusable; may return to `active`. */
8
+ | 'suspended'
9
+ /** Permanently withdrawn. */
10
+ | 'revoked'
11
+ /** The publisher key or endpoint is believed compromised — clients MUST stop using it. */
12
+ | 'compromised';
13
+ export type ServiceSurfaceProtocol = 'a2a' | 'mcp' | 'https' | 'grpc' | 'quic' | 'other';
14
+ /**
15
+ * Who may see this surface. Fail-closed: a surface is included in a projection only when its
16
+ * exposure and audience admit that projection (see `projection.ts`).
17
+ */
18
+ export type SurfaceExposure = 'public'
19
+ /** Any authenticated caller. */
20
+ | 'authenticated'
21
+ /** Only the parties named in `audience` / matching `audienceClassifications`. */
22
+ | 'private'
23
+ /** Only other services in the same trust domain; never in any partner-facing projection. */
24
+ | 'service-only';
25
+ /** Binds a transport key to a surface, with a purpose and a validity window (spec 338 §13 SHACL). */
26
+ export interface TransportKeyBindingV1 {
27
+ keyId: string;
28
+ algorithm: string;
29
+ thumbprint: string;
30
+ purposes: readonly string[];
31
+ notBefore: string;
32
+ expiresAt: string;
33
+ /** Reference to the evidence proving the agent controls this key. */
34
+ proofRef: string;
35
+ }
36
+ /**
37
+ * Evidence that the publisher actually controls the endpoint it published — the difference between
38
+ * "claims this URI" and "controls this URI". Closes the `verifyEndpoint` gap recorded in
39
+ * dntls-comparison.md §0.3 item 3.
40
+ */
41
+ export interface EndpointControlProofV1 {
42
+ method: 'signed-challenge' | 'http-challenge' | 'dns' | 'verifiable-presentation' | 'transport-handshake';
43
+ evidenceRef: string;
44
+ verifiedAt: string;
45
+ expiresAt?: string;
46
+ }
47
+ export interface ServiceSurfacePublicationV1 {
48
+ /** Stable id — corresponds to a `surface-catalog` SurfaceDescriptor id. */
49
+ surfaceId: string;
50
+ protocol: ServiceSurfaceProtocol;
51
+ protocolVersion: string;
52
+ uri: string;
53
+ exposure: SurfaceExposure;
54
+ /** Explicit audience for `exposure:'private'`. Empty/absent + private ⇒ visible to nobody. */
55
+ audience?: readonly CanonicalAgentId[];
56
+ audienceClassifications?: readonly string[];
57
+ roles?: readonly string[];
58
+ /** Reference to the capability/skill declaration this surface serves. Never inlined here. */
59
+ capabilitiesRef?: string;
60
+ /** Security requirements a caller must satisfy at the transport/application layer. Never a grant. */
61
+ securityRequirements: readonly string[];
62
+ priority?: number;
63
+ region?: string;
64
+ tenantRoutingHint?: string;
65
+ transportKeyBinding?: TransportKeyBindingV1;
66
+ endpointControlProof?: EndpointControlProofV1;
67
+ }
68
+ /** A signature over the publication digest. Carrying it is never itself authorization. */
69
+ export interface PublicationProofV1 {
70
+ signer: CanonicalAgentId;
71
+ scheme: 'erc1271' | 'ecdsa' | 'session-key';
72
+ signature: `0x${string}`;
73
+ }
74
+ export interface AgentServicePublicationV1 {
75
+ specVersion: 'ap.agent-service-publication/1';
76
+ publicationId: string;
77
+ /**
78
+ * Groups a continuity chain. Sequence is monotonic WITHIN a channel, not globally.
79
+ *
80
+ * NORMATIVE: a channel identifies an (agent, audience projection) pair — there is ONE channel per
81
+ * projection profile, and for `pairwise` postures one per counterparty. This is what makes
82
+ * "project BEFORE signing" workable: the publisher signs each audience's publication separately
83
+ * and a resolver SELECTS one, never edits one (see `selectPresignedPublication`). Dropping a
84
+ * surface after signing invalidates the digest, which is exactly the check that stops a
85
+ * compromised resolver — so it must never be the happy path.
86
+ *
87
+ * Per-counterparty channels also mean two counterparties cannot correlate sequence numbers, which
88
+ * would otherwise leak that they are talking to the same infrastructure.
89
+ */
90
+ channelId: string;
91
+ /** The canonical Smart Agent this publication describes. Never a name (ADR-0010). */
92
+ agentId: CanonicalAgentId;
93
+ /** Monotonic within `channelId`. The anti-rollback axis. */
94
+ sequence: bigint;
95
+ /** Digest of the immediately prior publication in this channel. Absent only at sequence 0. */
96
+ previousDigest?: Sha256;
97
+ status: PublicationStatus;
98
+ surfaces: readonly ServiceSurfacePublicationV1[];
99
+ /** A minimized projection of profile fields, by reference. The profile itself stays in `agent-profile`. */
100
+ profileProjection?: {
101
+ displayName?: string;
102
+ description?: string;
103
+ agentKind?: string;
104
+ profileRef?: string;
105
+ profileDigest?: Sha256;
106
+ };
107
+ issuedAt: string;
108
+ notBefore?: string;
109
+ /** REQUIRED. An unexpiring publication cannot be shown to be current. */
110
+ expiresAt: string;
111
+ /** The agent that signed. May be a delegated publication authority, not necessarily `agentId`. */
112
+ publishedBy: CanonicalAgentId;
113
+ /** Reference to the authority record permitting `publishedBy` to publish for `agentId`. */
114
+ publicationAuthorityRef: string;
115
+ digest: Sha256;
116
+ proofs: readonly PublicationProofV1[];
117
+ }
118
+ /** The publication body a proof commits to: everything except the digest and the proofs themselves. */
119
+ export type PublicationBody = Omit<AgentServicePublicationV1, 'digest' | 'proofs'>;
120
+ /** Extract the canonical body. `sequence` is serialized as a decimal string so the digest is stable
121
+ * across JSON round-trips (bigint has no JSON form). */
122
+ export declare function publicationBody(p: PublicationBody): Record<string, unknown>;
123
+ //# sourceMappingURL=publication.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publication.d.ts","sourceRoot":"","sources":["../src/publication.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,qFAAqF;AACrF,MAAM,MAAM,iBAAiB,GACzB,QAAQ;AACV,kEAAkE;GAChE,YAAY;AACd,oDAAoD;GAClD,WAAW;AACb,6BAA6B;GAC3B,SAAS;AACX,0FAA0F;GACxF,aAAa,CAAC;AAElB,MAAM,MAAM,sBAAsB,GAAG,KAAK,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEzF;;;GAGG;AACH,MAAM,MAAM,eAAe,GACvB,QAAQ;AACV,gCAAgC;GAC9B,eAAe;AACjB,iFAAiF;GAC/E,SAAS;AACX,4FAA4F;GAC1F,cAAc,CAAC;AAEnB,qGAAqG;AACrG,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,qEAAqE;IACrE,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,kBAAk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IAC5D,QAAQ,EAAE,MAAM,CAAC;IACjB,8FAA8F;IAC9F,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,MAAM,EAAE,iBAAiB,CAAC;IAE1B,QAAQ,EAAE,SAAS,2BAA2B,EAAE,CAAC;IAEjD,2GAA2G;IAC3G,iBAAiB,CAAC,EAAE;QAClB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;IAEF,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,SAAS,EAAE,MAAM,CAAC;IAElB,kGAAkG;IAClG,WAAW,EAAE,gBAAgB,CAAC;IAC9B,2FAA2F;IAC3F,uBAAuB,EAAE,MAAM,CAAC;IAEhC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,SAAS,kBAAkB,EAAE,CAAC;CACvC;AAED,uGAAuG;AACvG,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,yBAAyB,EAAE,QAAQ,GAAG,QAAQ,CAAC,CAAC;AAEnF;yDACyD;AACzD,wBAAgB,eAAe,CAAC,CAAC,EAAE,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAiB3E"}
@@ -0,0 +1,32 @@
1
+ // AgentServicePublication — the ONE signed, sequenced, expiring operational object (spec 338 §3).
2
+ //
3
+ // Deliberately NOT a mutable database and NOT where descriptive profile content lives:
4
+ //
5
+ // AgentProfile durable description → `agent-profile` (spec 217)
6
+ // SurfaceDescriptor design-time declaration → `surface-catalog` (spec 288)
7
+ // AgentServicePublication current operational projection → here
8
+ //
9
+ // The load-bearing rule (spec 338 §3.1):
10
+ // A content hash proves the publication was NOT MODIFIED. It does not prove it is CURRENT.
11
+ // Hence sequence + previousDigest + status + expiry, all verified fail-closed.
12
+ /** Extract the canonical body. `sequence` is serialized as a decimal string so the digest is stable
13
+ * across JSON round-trips (bigint has no JSON form). */
14
+ export function publicationBody(p) {
15
+ return {
16
+ specVersion: p.specVersion,
17
+ publicationId: p.publicationId,
18
+ channelId: p.channelId,
19
+ agentId: p.agentId,
20
+ sequence: p.sequence.toString(10),
21
+ previousDigest: p.previousDigest,
22
+ status: p.status,
23
+ surfaces: p.surfaces,
24
+ profileProjection: p.profileProjection,
25
+ issuedAt: p.issuedAt,
26
+ notBefore: p.notBefore,
27
+ expiresAt: p.expiresAt,
28
+ publishedBy: p.publishedBy,
29
+ publicationAuthorityRef: p.publicationAuthorityRef,
30
+ };
31
+ }
32
+ //# sourceMappingURL=publication.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publication.js","sourceRoot":"","sources":["../src/publication.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,EAAE;AACF,uFAAuF;AACvF,EAAE;AACF,kGAAkG;AAClG,oGAAoG;AACpG,4EAA4E;AAC5E,EAAE;AACF,yCAAyC;AACzC,6FAA6F;AAC7F,+EAA+E;AA8I/E;yDACyD;AACzD,MAAM,UAAU,eAAe,CAAC,CAAkB;IAChD,OAAO;QACL,WAAW,EAAE,CAAC,CAAC,WAAW;QAC1B,aAAa,EAAE,CAAC,CAAC,aAAa;QAC9B,SAAS,EAAE,CAAC,CAAC,SAAS;QACtB,OAAO,EAAE,CAAC,CAAC,OAAO;QAClB,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QACjC,cAAc,EAAE,CAAC,CAAC,cAAc;QAChC,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,iBAAiB,EAAE,CAAC,CAAC,iBAAiB;QACtC,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,SAAS,EAAE,CAAC,CAAC,SAAS;QACtB,SAAS,EAAE,CAAC,CAAC,SAAS;QACtB,WAAW,EAAE,CAAC,CAAC,WAAW;QAC1B,uBAAuB,EAAE,CAAC,CAAC,uBAAuB;KACnD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,168 @@
1
+ import type { CanonicalAgentId } from '@agenticprimitives/types';
2
+ import type { Sha256 } from './canonicalization.js';
3
+ import type { AgentServicePublicationV1 } from './publication.js';
4
+ import type { PrivateResolutionGrantV1 } from './grants.js';
5
+ import type { AgentConnectionInvitationV1 } from './invitation.js';
6
+ import type { AgentDiscoveryPolicyV1 } from './policy.js';
7
+ /** Mirrors `@agenticprimitives/vault`'s `VaultClassification`. Not imported — see the header note. */
8
+ export type ResolutionRecordClassification = 'public' | 'internal' | 'secret.high' | 'delegation.private' | 'receipt.private';
9
+ /** Resource keys in the TARGET / OWNER vault — the authoritative side. */
10
+ export declare const OWNER_VAULT_RESOURCES: {
11
+ readonly discoveryPolicy: "agent-resolution:discovery-policy";
12
+ readonly publications: "agent-resolution:publications";
13
+ readonly publicationAuthorities: "agent-resolution:publication-authorities";
14
+ readonly publicationContinuity: "agent-resolution:publication-continuity";
15
+ readonly grants: "agent-resolution:grants";
16
+ readonly grantStatus: "agent-resolution:grant-status";
17
+ readonly pairwiseAliases: "agent-resolution:pairwise-aliases";
18
+ readonly endpointControlEvidence: "agent-resolution:endpoint-control-evidence";
19
+ readonly invitations: "agent-resolution:invitations";
20
+ readonly invitationDeliveryReceipts: "agent-resolution:invitation-delivery-receipts";
21
+ readonly resolutionReceipts: "agent-resolution:resolution-receipts";
22
+ };
23
+ /** Resource keys in the RESOLUTION SERVICE vault — the operational side. */
24
+ export declare const RESOLVER_VAULT_RESOURCES: {
25
+ readonly grantIndex: "agent-resolution:resolver:grant-index";
26
+ readonly challengeNonces: "agent-resolution:resolver:challenge-nonces";
27
+ readonly useCounters: "agent-resolution:resolver:use-counters";
28
+ readonly rateBudgets: "agent-resolution:resolver:rate-budgets";
29
+ readonly projectionCache: "agent-resolution:resolver:projection-cache";
30
+ readonly abuseObservations: "agent-resolution:resolver:abuse-observations";
31
+ };
32
+ export type OwnerVaultResource = (typeof OWNER_VAULT_RESOURCES)[keyof typeof OWNER_VAULT_RESOURCES];
33
+ export type ResolverVaultResource = (typeof RESOLVER_VAULT_RESOURCES)[keyof typeof RESOLVER_VAULT_RESOURCES];
34
+ export interface DiscoveryPolicyRecordV1 {
35
+ recordVersion: 'ap.resolution-record.discovery-policy/1';
36
+ classification: 'internal';
37
+ agentId: CanonicalAgentId;
38
+ policy: AgentDiscoveryPolicyV1;
39
+ updatedAt: string;
40
+ }
41
+ export interface PublicationRecordV1 {
42
+ recordVersion: 'ap.resolution-record.publication/1';
43
+ /** `internal`: it names endpoints. A publication with private surfaces is never `public`. */
44
+ classification: 'internal' | 'secret.high';
45
+ publication: AgentServicePublicationV1;
46
+ /** Retained after supersession so continuity and equivocation claims stay provable. */
47
+ retiredAt?: string;
48
+ }
49
+ /**
50
+ * The owner's view of a publication channel. Distinct from a client's `ChannelContinuityState`:
51
+ * this one is the SOURCE (what we published), that one is a RECIPIENT's memory (what we accepted).
52
+ */
53
+ export interface PublicationContinuityRecordV1 {
54
+ recordVersion: 'ap.resolution-record.publication-continuity/1';
55
+ classification: 'internal';
56
+ channelId: string;
57
+ agentId: CanonicalAgentId;
58
+ latestSequence: bigint;
59
+ latestDigest: Sha256;
60
+ /** Digests observed at a sequence we also published — evidence of publisher-key compromise. */
61
+ observedConflicts?: readonly {
62
+ sequence: bigint;
63
+ digest: Sha256;
64
+ observedAt: string;
65
+ }[];
66
+ }
67
+ export interface GrantRecordV1 {
68
+ recordVersion: 'ap.resolution-record.grant/1';
69
+ /** A grant is a bearer-shaped capability until presented — never below `secret.high`. */
70
+ classification: 'secret.high';
71
+ grant: PrivateResolutionGrantV1;
72
+ issuedTo?: CanonicalAgentId;
73
+ /** Free-text note for the owner's own console. Never projected to the recipient or a resolver. */
74
+ ownerNote?: string;
75
+ }
76
+ export type GrantStatus = 'active' | 'revoked' | 'expired' | 'superseded';
77
+ export interface GrantStatusRecordV1 {
78
+ recordVersion: 'ap.resolution-record.grant-status/1';
79
+ classification: 'internal';
80
+ grantId: string;
81
+ status: GrantStatus;
82
+ updatedAt: string;
83
+ /** Local-only. Never returned to a presenter — the wire answer is always `resolution_denied`. */
84
+ reason?: string;
85
+ }
86
+ export interface PairwiseAliasRecordV1 {
87
+ recordVersion: 'ap.resolution-record.pairwise-alias/1';
88
+ /** Names a counterparty relationship — the correlation risk this whole design exists to bound. */
89
+ classification: 'secret.high';
90
+ aliasId: string;
91
+ agentId: CanonicalAgentId;
92
+ counterparty: CanonicalAgentId;
93
+ /** The label THIS counterparty sees. Never shared across counterparties, never public. */
94
+ privateLabel?: string;
95
+ grantId: string;
96
+ createdAt: string;
97
+ revokedAt?: string;
98
+ }
99
+ export interface EndpointControlEvidenceRecordV1 {
100
+ recordVersion: 'ap.resolution-record.endpoint-control-evidence/1';
101
+ classification: 'internal';
102
+ evidenceRef: string;
103
+ surfaceId: string;
104
+ agentId: CanonicalAgentId;
105
+ method: string;
106
+ verifiedAt: string;
107
+ expiresAt?: string;
108
+ evidence: unknown;
109
+ }
110
+ export interface InvitationRecordV1 {
111
+ recordVersion: 'ap.resolution-record.invitation/1';
112
+ classification: 'secret.high';
113
+ invitation: AgentConnectionInvitationV1;
114
+ deliveredAt?: string;
115
+ acceptedAt?: string;
116
+ revokedAt?: string;
117
+ }
118
+ /**
119
+ * The resolver's lookup row. Note what is ABSENT: the raw grant id, the target agent in the clear,
120
+ * and the grant body. A stolen index yields keyed digests and ciphertext (spec 338 §10, "resolver
121
+ * database stolen").
122
+ */
123
+ export interface GrantIndexRecordV1 {
124
+ recordVersion: 'ap.resolution-record.grant-index/1';
125
+ classification: 'secret.high';
126
+ /** `HMAC(indexSecret, 'ap.resolution.index/1' ‖ grantId)` — see `grant-index.ts`. */
127
+ grantDigest: string;
128
+ /** Encrypted `{ targetAgent, projection, issuer }`. Opaque to this package. */
129
+ encryptedTargetBinding: string;
130
+ notBefore: string;
131
+ expiresAt: string;
132
+ }
133
+ export interface ChallengeNonceRecordV1 {
134
+ recordVersion: 'ap.resolution-record.challenge-nonce/1';
135
+ classification: 'internal';
136
+ nonce: string;
137
+ audience: string;
138
+ issuedAt: string;
139
+ expiresAt: string;
140
+ spentAt?: string;
141
+ }
142
+ export interface UseCounterRecordV1 {
143
+ recordVersion: 'ap.resolution-record.use-counter/1';
144
+ classification: 'internal';
145
+ grantDigest: string;
146
+ used: number;
147
+ maximum?: number;
148
+ /** MUST be durable across worker instances — an in-isolate counter is bypassable (spec 338 §16). */
149
+ updatedAt: string;
150
+ }
151
+ /**
152
+ * Field names that MUST NOT appear in any public projection, discovery knowledge base row, search
153
+ * index, or global telemetry event (spec 338 §9, ADR-0040, ADR-0056 §9).
154
+ *
155
+ * Exported so a Ring-1 resolver, indexer, or logger can assert against it rather than re-deriving
156
+ * the list — the leak this guards is easy to reintroduce by accident when adding a debug log.
157
+ */
158
+ export declare const NEVER_PUBLIC_FIELDS: readonly ["grantId", "grantDigest", "privateLabel", "encryptedTargetBinding", "subjectProof", "challengeNonce", "counterparty", "audience", "transportKeyBinding", "ownerNote"];
159
+ export type NeverPublicField = (typeof NEVER_PUBLIC_FIELDS)[number];
160
+ /**
161
+ * Shallow scan for never-public fields in an object bound for a public sink.
162
+ *
163
+ * Deliberately conservative and shallow-recursive: it is a guardrail for logging and projection call
164
+ * sites, not a security boundary. The boundary is that private records never reach a public sink in
165
+ * the first place.
166
+ */
167
+ export declare function findNeverPublicFields(value: unknown, maxDepth?: number): readonly NeverPublicField[];
168
+ //# sourceMappingURL=records.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"records.d.ts","sourceRoot":"","sources":["../src/records.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,yBAAyB,EAAE,M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