agent-protocols 0.7.0 → 0.9.0

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 (48) hide show
  1. package/README.md +38 -9
  2. package/dist/delegation.d.ts +98 -29
  3. package/dist/delegation.d.ts.map +1 -1
  4. package/dist/delegation.js +377 -51
  5. package/dist/delegation.js.map +1 -1
  6. package/dist/discourse.d.ts +196 -74
  7. package/dist/discourse.d.ts.map +1 -1
  8. package/dist/discourse.js +568 -116
  9. package/dist/discourse.js.map +1 -1
  10. package/dist/errors.d.ts.map +1 -1
  11. package/dist/errors.js.map +1 -1
  12. package/dist/http-client.d.ts +47 -17
  13. package/dist/http-client.d.ts.map +1 -1
  14. package/dist/http-client.js +118 -39
  15. package/dist/http-client.js.map +1 -1
  16. package/dist/identity.d.ts +101 -4
  17. package/dist/identity.d.ts.map +1 -1
  18. package/dist/identity.js +334 -8
  19. package/dist/identity.js.map +1 -1
  20. package/dist/local-connector/catalog.d.ts +1 -16
  21. package/dist/local-connector/catalog.d.ts.map +1 -1
  22. package/dist/local-connector/catalog.js +53 -63
  23. package/dist/local-connector/catalog.js.map +1 -1
  24. package/dist/local-connector/engine.d.ts +57 -33
  25. package/dist/local-connector/engine.d.ts.map +1 -1
  26. package/dist/local-connector/engine.js +652 -607
  27. package/dist/local-connector/engine.js.map +1 -1
  28. package/dist/local-connector/inputs.d.ts +29 -76
  29. package/dist/local-connector/inputs.d.ts.map +1 -1
  30. package/dist/local-connector/inputs.js +19 -1
  31. package/dist/local-connector/inputs.js.map +1 -1
  32. package/dist/local-connector/projection.d.ts +24 -9
  33. package/dist/local-connector/projection.d.ts.map +1 -1
  34. package/dist/local-connector/projection.js +79 -40
  35. package/dist/local-connector/projection.js.map +1 -1
  36. package/dist/local-connector/state.d.ts +10 -3
  37. package/dist/local-connector/state.d.ts.map +1 -1
  38. package/dist/local-connector/state.js +3 -0
  39. package/dist/local-connector/state.js.map +1 -1
  40. package/dist/local-connector/views.d.ts +36 -12
  41. package/dist/local-connector/views.d.ts.map +1 -1
  42. package/dist/local-connector/views.js +49 -31
  43. package/dist/local-connector/views.js.map +1 -1
  44. package/dist/profile.d.ts +23 -9
  45. package/dist/profile.d.ts.map +1 -1
  46. package/dist/profile.js +120 -3
  47. package/dist/profile.js.map +1 -1
  48. package/package.json +5 -5
package/README.md CHANGED
@@ -4,12 +4,12 @@ TypeScript SDK for the draft Agent Identity, Agent Profile, Agent Delegation, an
4
4
 
5
5
  ## Modules
6
6
 
7
- - `identity`: `did:agent:` encoding, JCS canonicalization, event hashes, Ed25519 signing and verification, live-write nonce checks, request JWT helpers.
8
- - `profile`: `profile.update` payloads, Profile documents, delegation discovery hints, validation, materialization.
9
- - `delegation`: Agent Delegation principal documents and alias resolution, grant/revoke payloads, credential documents, status/query shapes, validation, and materialization.
10
- - `discourse`: ADP kernel payloads, the room type system (type definitions, pack imports, type registry, JSON Schema payload validation), join request types, roles, room states, protocol discovery, archive manifests, room-path checks, kind-based permission and state helpers.
11
- - `http-client`: fetch-based Profile, Delegation, and Discourse clients.
12
- - `local-connector`: Local Agent Protocols MCP connector tool names, resource URIs, structured view types, and timeline/sync helpers.
7
+ - `identity`: `did:agent:` encoding, strict JSON parsing (`parseStrictJson`, `parseEnvelopeJson`), JCS canonicalization, event hashes, Ed25519 signing and strict verification (`verifyEd25519Strict`), closed event objects (`validateEventFields`), clock-derived nonces with bounded `Max-Seen-Nonce` resynchronization, live-write and exact-resubmission checks (`verifySubmission`), request JWT helpers, and the shared HTTP shapes (`ErrorResponse`, `ListResponse`, `AcceptedRecord`, `DiscoveryDocument`).
8
+ - `profile`: `profile.update` payloads, Profile documents, delegation discovery hints, validation, succession checks, materialization.
9
+ - `delegation`: principal documents and resolution, Controller records with `supersedes` lineage, grant/revoke payloads, credentials, query shapes, authority, acceptance, historical, and use checks, `verifyDelegationCredential` over the latest grant record, and `auditDelegationHistory` for auditors.
10
+ - `discourse`: the ADP kernel — twelve built-in event types, freshness classes, room policy (`invites`, `open_roles`), signed join requests and reviews, the type system with the portable type schema profile, redacted records, server records, and archive verification.
11
+ - `http-client`: fetch-based Profile, Delegation, and Discourse clients. Lists use `{ result, next_cursor }`; non-2xx responses throw `HttpResponseError` with the protocol `code`, `data`, and `Max-Seen-Nonce`.
12
+ - `local-connector`: the Local Agent Protocols MCP connector: 23 standard tools, resource URIs, structured views, and the connector engine.
13
13
 
14
14
  ## Example
15
15
 
@@ -18,7 +18,8 @@ import { AgentSigner, ClientNonceManager, materializeProfile, profileUpdateEvent
18
18
 
19
19
  const signer = AgentSigner.generate();
20
20
  const nonces = new ClientNonceManager();
21
- const event = profileUpdateEvent(signer.agentId(), Date.now(), nonces.nextNonce(), {
21
+ const createdAt = Date.now();
22
+ const event = profileUpdateEvent(signer.agentId(), createdAt, nonces.nextNonce(createdAt), {
22
23
  id: signer.agentId(),
23
24
  name: "ResearchAgent-v3",
24
25
  });
@@ -26,6 +27,34 @@ const envelope = signer.signEvent(event);
26
27
  const profile = materializeProfile(envelope);
27
28
  ```
28
29
 
29
- Agent Profile has no `username` field: the Agent ID is the identity key, and the latest profile is the accepted `profile.update` with the greatest `nonce`.
30
+ `nextNonce(createdAt)` derives `max(last + 1, created_at)`, so nonces stay monotonic across restarts and devices. Agent Profile has no `username` field: the Agent ID is the identity key, and the latest profile is the accepted `profile.update` with the greatest `nonce`.
30
31
 
31
- ADP room writes declare a signed `base_seq` / `base_hash`: discussion and contract writes must match the current room head, while `signal`-kind writes — including the built-in membership events — only anchor to an accepted record and never contend for the head. Use `discourseEvent` or `typeDefineEvent` with `baseSeq` and `baseHash`, or let a local connector derive them from `SyncState`. Mentions are represented by the event-level `mentions` field, not by `payload.extra`.
32
+ ADP room writes carry a signed `base_seq` / `base_hash`. Message and control writes — `message.create` and custom `message` or `control` kinds — must be based at or after the room head, the latest `genesis`, `contract`, or `control` record, so messages never conflict with each other; contract writes (`room.update`, `room.close`, `room.cancel`, `type.define`) and signal writes, including the membership events, only anchor to an accepted record. Use `eventRequiresRoomHead` and `eventAdvancesRoomHead` to tell them apart, `validateRoomBase` for the host-side base check, `discourseEvent` to build them, and `roomJoinRequestEvent` for a join request, which carries `room_id` but no base. Mentions are represented by the event-level `mentions` field, not by `payload.extra`.
33
+
34
+ The conformance vectors in `docs/protocols/*/1.0.vectors.json` are part of the test suite.
35
+
36
+ ## Delegation
37
+
38
+ Controllers are records shared by `controllers` and `retired_controllers`: `id` is the Agent ID, `source` is an HTTPS origin or `local`, and `valid_from` starts the binding. Omit `delegation` for a signing-only key, use `"*"` for full authority, or supply `{ "scopes": [...], "audiences": [...] }` for restricted authority. `supersedes` lets a successor key manage its predecessors' credentials. Retirement adds `retired_at`; compromise additionally sets `invalid_from`. A principal that grants delegations publishes `delegation_query_url`.
39
+
40
+ Grants name the canonical `principal_id`. Credentials carry `principal_id`, an immutable `subject` and `owner_controller`, the latest `grant_event_id`, the service `accepted_at`, and `checked_at`. Materialization requires an explicit acceptance time and trusted previous state; it never derives acceptance time from `created_at`.
41
+
42
+ The validation layers have different responsibilities:
43
+
44
+ - Envelope validation checks cryptography, the closed event object, and payload shape, not principal authority.
45
+ - Event-authority validation checks the controller policy before signing. Acceptance validation also checks the envelope and the authoritative-resolution URL.
46
+ - Historical validation checks an accepted record `{ envelope, accepted_at }` against the original controller interval and ceiling. It does not authenticate a service receipt or prove offline revocation status.
47
+ - Use validation checks audience, status, and validity. Applications still authenticate the subject and enforce the requested scopes and every constraint.
48
+
49
+ ```ts
50
+ // principal was freshly resolved over HTTPS; previous is trusted service state.
51
+ validateDelegationAcceptance(envelope, principal, resolvedUrl, acceptedAt, previous);
52
+ const credential = materializeDelegationCredential(envelope, { acceptedAt, previous });
53
+
54
+ // A relying party checks the credential's latest grant record.
55
+ const verdict = verifyDelegationCredential(credential, records, principal, principal.id, "https://dmsg.net", Date.now());
56
+ ```
57
+
58
+ Services remain responsible for fresh HTTPS resolution, live Identity timestamp and nonce checks, exact-resubmission lookups, atomic state and history storage, and current revocation or compromise reevaluation. These are SDK building blocks, not a hosted delegation service.
59
+
60
+ The local connector derives the delegation service from the principal's `delegation_query_url` and its discovery document, and checks policy and credential ownership before signing a grant or revocation.
@@ -1,7 +1,11 @@
1
- import { AgentId, Envelope, Event } from "./identity.js";
1
+ import { AcceptedRecord, AgentId, Envelope, Event, ListResponse } from "./identity.js";
2
2
  export declare const DELEGATION_PROTOCOL = "agent-delegation/1.0";
3
3
  export declare const DELEGATION_GRANT = "delegation.grant";
4
4
  export declare const DELEGATION_REVOKE = "delegation.revoke";
5
+ /** Delegation IDs are unreserved URL characters: no percent-encoding, no look-alikes. */
6
+ export declare const DELEGATION_ID_PATTERN: RegExp;
7
+ /** Delegation-specific error codes (Agent Delegation Section 9.7). */
8
+ export declare const DELEGATION_ERROR_CODES: readonly string[];
5
9
  export type DelegationEventType = typeof DELEGATION_GRANT | typeof DELEGATION_REVOKE;
6
10
  export type DelegationStatus = "active" | "suspended" | "expired" | "revoked";
7
11
  export interface PrincipalLink {
@@ -9,29 +13,48 @@ export interface PrincipalLink {
9
13
  url: string;
10
14
  rel: string;
11
15
  }
16
+ /** Display descriptor of a principal, used by Agent Profile delegation hints. */
12
17
  export interface PrincipalDescriptor {
13
18
  id: string;
14
19
  type?: string;
15
20
  name?: string;
16
21
  }
22
+ /** The same record is used in current and retired controller lists. */
23
+ export interface Controller {
24
+ id: AgentId;
25
+ source: string;
26
+ valid_from: number;
27
+ name?: string;
28
+ delegation?: "*" | {
29
+ scopes: string[];
30
+ audiences: string[];
31
+ };
32
+ /** Earlier controllers of this principal whose credentials this key may manage. */
33
+ supersedes?: AgentId[];
34
+ retired_at?: number;
35
+ invalid_from?: number;
36
+ }
17
37
  export interface PrincipalDocument extends PrincipalDescriptor {
18
38
  description?: string;
19
39
  avatar_url?: string;
20
40
  /** Other HTTPS URLs that lead to this principal. Aliases are not identities. */
21
41
  aliases?: string[];
22
42
  links?: PrincipalLink[];
23
- controllers: AgentId[];
24
- /** Delegation query endpoint for this principal; answers existence checks. */
43
+ protocol: typeof DELEGATION_PROTOCOL;
44
+ controllers: Controller[];
45
+ retired_controllers?: Controller[];
46
+ /** Delegation query endpoint; required when any controller carries `delegation`. */
25
47
  delegation_query_url?: string;
26
- updated_at?: number;
48
+ updated_at: number;
27
49
  extra?: Record<string, unknown>;
28
50
  }
29
51
  export interface DelegationGrantPayload {
30
52
  id: string;
31
- principal: PrincipalDescriptor;
53
+ principal_id: string;
32
54
  subject: AgentId;
33
55
  relationship?: string;
34
56
  scopes: string[];
57
+ audiences: string[];
35
58
  constraints?: Record<string, unknown>;
36
59
  not_before?: number;
37
60
  expires_at?: number;
@@ -45,25 +68,23 @@ export type DelegationPayload = DelegationGrantPayload | DelegationRevokePayload
45
68
  export interface DelegationCredential {
46
69
  id: string;
47
70
  protocol: typeof DELEGATION_PROTOCOL;
48
- principal: PrincipalDescriptor;
49
- controller: AgentId;
71
+ principal_id: string;
50
72
  subject: AgentId;
51
73
  relationship?: string;
52
74
  scopes: string[];
75
+ audiences: string[];
53
76
  constraints?: Record<string, unknown>;
54
77
  not_before?: number;
55
78
  expires_at?: number;
56
79
  status: DelegationStatus;
57
- updated_at: number;
80
+ controller: AgentId;
81
+ owner_controller: AgentId;
82
+ grant_event_id: string;
58
83
  event_id: string;
59
- }
60
- export interface DelegationStatusDocument {
61
- id: string;
62
- status: DelegationStatus;
84
+ accepted_at: number;
63
85
  checked_at: number;
64
- expires_at?: number;
65
- event_id: string;
66
86
  }
87
+ export type DelegationRecord = AcceptedRecord<DelegationPayload>;
67
88
  export interface DelegationServiceEndpoints {
68
89
  delegations: string;
69
90
  query?: string;
@@ -80,25 +101,28 @@ export interface DelegationQueryRequest {
80
101
  id?: string;
81
102
  status?: DelegationStatus;
82
103
  limit?: number;
104
+ cursor?: string;
83
105
  }
84
- export interface DelegationSummary {
85
- id: string;
86
- subject: AgentId;
87
- principal: PrincipalDescriptor;
88
- scopes?: string[];
89
- status: DelegationStatus;
90
- }
91
- export interface DelegationQueryResponse {
92
- result: DelegationSummary[];
93
- }
94
- export interface DelegationEventsResponse {
95
- result: Envelope<DelegationPayload>[];
106
+ /** Agent Identity list of full credentials. */
107
+ export type DelegationQueryResponse = ListResponse<DelegationCredential>;
108
+ /** Agent Identity list of accepted records in service acceptance order. */
109
+ export type DelegationEventsResponse = ListResponse<DelegationRecord>;
110
+ /** Result of {@link verifyDelegationCredential}. */
111
+ export interface DelegationVerdict {
112
+ credential: DelegationCredential;
113
+ /** Latest-grant signature, controller, ceiling, and consistency checks passed. */
114
+ verified: boolean;
115
+ /** Verified, and usable for the audience now: active, in its window, audience listed. */
116
+ usable: boolean;
117
+ /** Every failed check. */
118
+ reasons: string[];
96
119
  }
97
120
  export declare function delegationGrantEvent(actor: AgentId, createdAt: number, nonce: number, payload: DelegationGrantPayload): Event<DelegationGrantPayload>;
98
121
  export declare function delegationRevokeEvent(actor: AgentId, createdAt: number, nonce: number, payload: DelegationRevokePayload): Event<DelegationRevokePayload>;
122
+ export declare function validateController(controller: Controller, retired?: boolean): void;
99
123
  export declare function validatePrincipalDocument(document: PrincipalDocument): void;
100
124
  /**
101
- * Checks the authoritative-read rule of Agent Delegation Section 5.3: a
125
+ * Checks the authoritative-read rule of Agent Delegation Section 3: a
102
126
  * principal document binds controller keys only when it is read at its own
103
127
  * `id`. A document served anywhere else is a copy; its `controllers` MUST be
104
128
  * discarded and `document.id` resolved instead.
@@ -110,6 +134,12 @@ export declare function validatePrincipalResolution(document: PrincipalDocument,
110
134
  * name for the principal unless it is listed here.
111
135
  */
112
136
  export declare function isPrincipalAlias(document: PrincipalDocument, url: string): boolean;
137
+ /**
138
+ * The lineage of a controller (Section 5.1): its own ID plus, transitively,
139
+ * every record it supersedes. A restricted controller owns a credential whose
140
+ * `owner_controller` is in its lineage.
141
+ */
142
+ export declare function controllerLineage(document: PrincipalDocument, controllerId: AgentId): Set<AgentId>;
113
143
  export declare function validateDelegationGrantPayload(payload: DelegationGrantPayload, createdAt?: number): void;
114
144
  /**
115
145
  * A public delegation query is an existence check and MUST include both
@@ -122,9 +152,48 @@ export declare function validateDelegationQueryRequest(request: DelegationQueryR
122
152
  allowEnumeration?: boolean;
123
153
  }): void;
124
154
  export declare function validateDelegationRevokePayload(payload: DelegationRevokePayload): void;
155
+ export declare function validateDelegationId(value: unknown): asserts value is string;
125
156
  export declare function validateDelegationEnvelope(envelope: Envelope<DelegationPayload>): void;
126
- export declare function materializeDelegationCredential(envelope: Envelope<DelegationGrantPayload>, options?: {
157
+ /** Materializes an already accepted event. The caller supplies trusted previous state
158
+ * and the service's actual acceptance time; this function does not authorize it. */
159
+ export declare function materializeDelegationCredential(envelope: Envelope<DelegationPayload>, options: {
160
+ acceptedAt: number;
161
+ previous?: DelegationCredential;
127
162
  status?: DelegationStatus;
128
- updatedAt?: number;
163
+ checkedAt?: number;
129
164
  }): DelegationCredential;
165
+ /** Pre-signing authority check. Input previous state and document must be trusted.
166
+ * This does not verify signatures, fetch HTTPS, check cache age, or enforce nonce/time windows. */
167
+ export declare function validateDelegationEventAuthority(event: Event<DelegationPayload>, document: PrincipalDocument, acceptedAt: number, previous?: DelegationCredential): void;
168
+ /** Online acceptance checks over a document read at resolvedUrl. Services must also
169
+ * enforce fresh resolution, Identity live replay rules, and atomic persistence. */
170
+ export declare function validateDelegationAcceptance(envelope: Envelope<DelegationPayload>, document: PrincipalDocument, resolvedUrl: string, acceptedAt: number, previous?: DelegationCredential): void;
171
+ /** Uses caller-trusted acceptance evidence, never an event's self-reported time as proof.
172
+ * Current status, evidence authenticity and application constraints are separate checks. */
173
+ export declare function validateHistoricalDelegation(record: DelegationRecord, document: PrincipalDocument, resolvedUrl: string, previous?: DelegationCredential): void;
174
+ /** Per-result enumeration check; the caller authenticates actor and resolves the document. */
175
+ export declare function validateControllerEnumeration(document: PrincipalDocument, actor: AgentId, now: number, owner: AgentId): void;
176
+ /** Checks audience/status/time only, after cryptographic and historical verification.
177
+ * The application still authenticates the subject and enforces scopes and constraints. */
178
+ export declare function validateDelegationUse(credential: DelegationCredential, audience: string, now: number): void;
179
+ /**
180
+ * Verifies a credential under Agent Delegation Section 8 with the online
181
+ * service-trusting evidence policy: checks the accepted record of its latest
182
+ * grant — signature, Controller binding, ceiling, and authority interval —
183
+ * confirms that the grant matches the credential, and then checks use for
184
+ * `audience` at `now`. Ownership and `supersedes` lineage govern management,
185
+ * which the service enforced at acceptance; auditors replay them with
186
+ * {@link auditDelegationHistory}. Relying parties still enforce scopes and
187
+ * constraints and authenticate the subject.
188
+ */
189
+ export declare function verifyDelegationCredential(credential: DelegationCredential, records: readonly DelegationRecord[], document: PrincipalDocument, resolvedUrl: string, audience: string, now: number): DelegationVerdict;
190
+ /**
191
+ * Auditor check (Section 8): replays every accepted record of a credential
192
+ * against the authoritative principal document — signatures, controller
193
+ * intervals, ceilings, and ownership lineage — and confirms that the replay
194
+ * matches the credential. Relying parties use {@link verifyDelegationCredential}.
195
+ */
196
+ export declare function auditDelegationHistory(credential: DelegationCredential, records: readonly DelegationRecord[], document: PrincipalDocument, resolvedUrl: string): void;
197
+ /** A relying-party audience (Section 5): an origin for a relying application, or an Agent ID for a relying agent. */
198
+ export declare function validateAudience(value: unknown): void;
130
199
  //# sourceMappingURL=delegation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"delegation.d.ts","sourceRoot":"","sources":["../src/delegation.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EACP,QAAQ,EACR,KAAK,EAIN,MAAM,eAAe,CAAC;AAEvB,eAAO,MAAM,mBAAmB,yBAAyB,CAAC;AAC1D,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AACnD,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AAErD,MAAM,MAAM,mBAAmB,GAC3B,OAAO,gBAAgB,GACvB,OAAO,iBAAiB,CAAC;AAE7B,MAAM,MAAM,gBAAgB,GACxB,QAAQ,GACR,WAAW,GACX,SAAS,GACT,SAAS,CAAC;AAEd,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,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