@agenticprimitives/agent-relationships 1.0.0-alpha.4 → 1.0.0-alpha.40

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/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # @agenticprimitives/agent-relationships
2
2
 
3
- > ⚠️ **Experimental — do NOT use for confidential edges.**
3
+ > Part of **[Agentic Primitives](https://agenticprimitives.dev)** — the open-source trust substrate for agentic applications: identity that can sign, authority checked at act time, evidence the owner carries. [Developer kit](https://github.com/agentictrustlabs/agentic-primitives) · [All packages](https://agenticprimitives.dev/developers)
4
+
5
+ > **EXPERIMENTAL — do NOT use for confidential edges.**
4
6
  >
5
7
  > This package writes the trust-fabric edge graph **publicly on-chain**.
6
8
  > Every edge — its endpoints, type, role set, and status — is visible to
@@ -20,6 +22,9 @@
20
22
  > on each side, `EdgeStatus` lifecycle (proposed/confirmed/active/revoked),
21
23
  > and the actor address that submitted each state transition.
22
24
  >
25
+ > Private links — including every person↔org link — belong in
26
+ > [`related-agents`](../related-agents) (holder-resident vault credentials,
27
+ > [ADR-0025](../../docs/architecture/decisions/0025-related-agent-links-are-private.md)).
23
28
  > A future v2 private-edge variant (commitment-based, with
24
29
  > selective-disclosure proofs) will live alongside this package. Until it
25
30
  > ships, **adopters requiring confidentiality should not use this
@@ -29,43 +34,18 @@
29
34
  > Tracked as the **Privacy Fork** (audit `PKG-agent-relationships-001` /
30
35
  > `EXT-019`). `capability.manifest.json` sets `"stability": "experimental"`.
31
36
 
32
- Trust-fabric edge primitive for Smart Agents. An `Edge` is a
33
- `(subject, object, relationshipType)` triple with a role set on each
34
- side, a status lifecycle (`PROPOSED → CONFIRMED → ACTIVE → REVOKED`),
35
- and optional off-chain metadata anchored by a deterministic
36
- content-hash.
37
+ **A trust graph between addresses, not accounts in someone's database.** As agents take on real work, the question moves from "who is this agent?" to "who stands behind it — which org is it a member of, who governs it, who vouches for it?" Most systems answer with rows in a vendor database that vanish when the vendor does. This package answers with on-chain edges between canonical Smart Agent addresses: an `Edge` is a `(subject, object, relationshipType)` triple with a role set on each side, a status lifecycle (`PROPOSED → CONFIRMED → ACTIVE → REVOKED`), and optional off-chain metadata anchored by a deterministic content hash. Because the endpoints are the canonical identities themselves ([ADR-0010](../../docs/architecture/decisions/0010-smart-agent-canonical-identifier.md)), edges survive credential rotation, name changes, and every other facet swap.
38
+
39
+ Part of [agenticprimitives](../../README.md) — the trust substrate for the agent economy: one canonical Smart Agent identity with custody, delegation, naming, credentials, and audit evidence designed as one system.
37
40
 
38
- Where [`agent-naming`](../agent-naming) resolves *names → addresses*
39
- and [`agent-profile`](../agent-profile) owns the *profile layer*,
40
- this package owns the **relationship layer**: the on-chain graph of
41
- who-knows-whom that other layers compose against (org membership,
42
- governance assertions, validation trust, etc.).
41
+ Where [`agent-naming`](../agent-naming) resolves *names → addresses* and [`agent-profile`](../agent-profile) owns the *profile layer*, this package owns the **relationship layer**: the public graph of org membership, governance assertions, partnerships, and validation trust that other layers compose against.
43
42
 
44
43
  > **Layer:** Discover — the trust **graph** (not canonical identity — that is `agent-account`).
45
44
  > **Canonical key:** Smart Agent addresses. An edge connects anchors; an edge is **not** a delegation.
46
45
 
47
- ## Status
48
-
49
- **Phase 1** — pure SDK + spec + API skeleton. Read methods on the
50
- client throw `R Phase 2`; write methods throw `R Phase 4`. Contracts
51
- (`AgentRelationship.sol` + `RelationshipTypeRegistry.sol`) land in
52
- Phase 3. `AgentAssertion` (signed-claim layer) and
53
- `AgentRelationshipResolver` (policy layer) are **deferred to v2** per
54
- ADR-0007.
55
-
56
- See [`specs/216-agent-relationships.md`](../../specs/216-agent-relationships.md)
57
- for the full design + the phase plan, and:
58
-
59
- - [ADR-0006](../../docs/architecture/decisions/0006-agent-naming-as-resolution-layer.md)
60
- — why naming hierarchy is parent-pointer-based, NOT a
61
- `NAMESPACE_CONTAINS` edge.
62
- - [ADR-0007](../../docs/architecture/decisions/0007-agent-identity-stack-three-packages.md)
63
- — why the identity stack is three packages, not one.
64
-
65
46
  ## Install
66
47
 
67
- This package is workspace-internal in the agenticprimitives monorepo
68
- and not yet published.
48
+ Workspace-internal in the agenticprimitives monorepo; not yet published.
69
49
 
70
50
  ## Usage
71
51
 
@@ -85,8 +65,7 @@ const id = computeEdgeId(
85
65
  // 0x… — keccak256 of packed (subject || object || typeId)
86
66
  ```
87
67
 
88
- Same triple → same edge ID. Direction matters for non-symmetric types
89
- (`HAS_MEMBER(A→B)` ≠ `HAS_MEMBER(B→A)`).
68
+ Same triple → same edge ID; idempotent propose comes for free. Direction matters for non-symmetric types (`HAS_MEMBER(A→B)` ≠ `HAS_MEMBER(B→A)`), and self-edges are refused.
90
69
 
91
70
  ### Relationship type + role taxonomy
92
71
 
@@ -108,9 +87,7 @@ TYPE_SEMANTICS[RELATIONSHIP_TYPE.PARTNERSHIP].symmetric; // true
108
87
  TYPE_SEMANTICS[RELATIONSHIP_TYPE.HAS_GOVERNANCE_OVER].hierarchical; // true
109
88
  ```
110
89
 
111
- `NAMESPACE_CONTAINS` is **intentionally absent** — naming hierarchy
112
- lives in [`agent-naming`](../agent-naming) via parent-pointer per
113
- ADR-0006.
90
+ `NAMESPACE_CONTAINS` is **intentionally absent** — naming hierarchy lives in [`agent-naming`](../agent-naming) via parent-pointer per [ADR-0006](../../docs/architecture/decisions/0006-agent-naming-as-resolution-layer.md), so no parallel authority can drift.
114
91
 
115
92
  ### Relationships client (Phase 2+)
116
93
 
@@ -139,31 +116,37 @@ await rel.proposeEdge({
139
116
  await rel.confirmEdge({ edgeId: '0x…', selfRoles: [] });
140
117
  ```
141
118
 
142
- Each write is authorized via the actor's Smart Agent ERC-1271 →
143
- its CustodyPolicy module. The relationships package itself stays
144
- custody-agnostic (no `@agenticprimitives/account-custody` import).
119
+ Each write is authorized via the actor's Smart Agent ERC-1271 → its CustodyPolicy module. The relationships package itself stays custody-agnostic (no `@agenticprimitives/account-custody` import).
120
+
121
+ ## How it's different
122
+
123
+ The competing category is **social/trust-graph products and registry "endorsement" features** — follower edges, attestation lists, org charts held in an app database:
124
+
125
+ - **Bilateral by construction.** A non-symmetric edge requires confirmation from both sides before it can influence anything (Phase 3+ contract enforcement); a `PROPOSED` edge is a claim, not a fact. Either party can revoke unilaterally, permissionlessly.
126
+ - **Edges connect identities, not handles.** Both endpoints are canonical Smart Agent addresses, so the graph cannot be orphaned by a renamed handle or a rotated key.
127
+ - **An edge is not authority.** `HAS_GOVERNANCE_OVER` asserts a relationship; it grants nothing. Authority is always a delegation or a custody-policy operation — separate primitives, separate packages. Graph products routinely blur this line; the package boundary here makes the blur impossible.
145
128
 
146
129
  ## Subpath exports
147
130
 
148
- - `@agenticprimitives/agent-relationships/taxonomy` —
149
- relationship-type + role constants + semantics map.
131
+ - `@agenticprimitives/agent-relationships/taxonomy` — relationship-type + role constants + semantics map.
150
132
 
151
133
  ## Security invariants
152
134
 
153
- - Edge ID is **deterministic** —
154
- `keccak256(subject || object || relationshipType)`. Off-chain and
155
- on-chain derivations always match.
135
+ - Edge ID is **deterministic** — `keccak256(subject || object || relationshipType)`; off-chain and on-chain derivations always match.
156
136
  - `computeEdgeId` refuses self-edges (subject === object).
157
- - Relationship-type + role IDs are `keccak256(name)` (matches
158
- Solidity `keccak256(bytes(name))`).
159
- - Two-side confirmation for non-symmetric types (Phase 3+ contract
160
- enforcement).
137
+ - Relationship-type + role IDs are `keccak256(name)` (matches Solidity `keccak256(bytes(name))`) — bytes32 hashes, not raw strings, preventing cross-namespace collisions.
138
+ - Two-side confirmation for non-symmetric types (Phase 3+ contract enforcement).
161
139
  - Permissionless revocation from either side (Phase 3+).
162
- - Custody-agnostic — authority always routes through the actor's
163
- Smart Agent ERC-1271.
140
+ - Custody-agnostic — authority always routes through the actor's Smart Agent ERC-1271.
164
141
  - `NAMESPACE_CONTAINS` is intentionally absent (ADR-0006).
165
142
 
166
- See `AUDIT.md` for the package audit + open findings.
143
+ See [`AUDIT.md`](AUDIT.md) for the package audit + open findings.
144
+
145
+ ## Status
146
+
147
+ **Experimental, and Phase 1** — pure SDK + spec + API skeleton. The pure layer (`computeEdgeId`, taxonomy, semantics map) is real and tested; client read methods throw `R Phase 2` and write methods throw `R Phase 4` — stubs by design. Contracts (`AgentRelationship.sol` + `RelationshipTypeRegistry.sol`) land in Phase 3. `AgentAssertion` (signed-claim layer) and `AgentRelationshipResolver` (policy layer) are deferred to v2 per [ADR-0007](../../docs/architecture/decisions/0007-agent-identity-stack-three-packages.md). Full design + phase plan: [`specs/216-agent-relationships.md`](../../specs/216-agent-relationships.md).
148
+
149
+ Beyond the package phases: testnet/pilot-ready posture only; production launch is gated on the public checklist in the root [`README.md`](../../README.md#status--honest-version). Track every security finding live in [`docs/audits/findings.yaml`](../../docs/audits/findings.yaml) — and re-read the confidentiality warning at the top before adopting.
167
150
 
168
151
  ## License
169
152
 
package/dist/calls.d.ts CHANGED
@@ -13,7 +13,7 @@
13
13
  * delegation / mcp-runtime here — these builders stay pure encode-only.
14
14
  */
15
15
  import type { Address, Hex } from '@agenticprimitives/types';
16
- import type { RelationshipType, Role } from './types';
16
+ import type { RelationshipType, Role } from './types.js';
17
17
  /** Minimal call-shape: the standard `{ to, value, data }` triple. */
18
18
  export interface ContractCall {
19
19
  to: Address;
@@ -1 +1 @@
1
- {"version":3,"file":"calls.d.ts","sourceRoot":"","sources":["../src/calls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEtD,qEAAqE;AACrE,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,OAAO,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,GAAG,CAAC;CACX;AAID;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IACzC,aAAa,EAAE,OAAO,CAAC;IACvB,O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AAmB,CAAC,IAAI,EAAE;IACxC,aAAa,EAAE,OAAO,CAAC;IACvB,MAAM,EAAE,GAAG,CAAC;IACZ,IAAI,EAAE,IAAI,CAAC;CACZ,GAAG,YAAY,CAUf;AAED,wEAAwE;AACxE,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IACzC,aAAa,EAAE,OAAO,CAAC;IACvB,MAAM,EAAE,GAAG,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,GAAG,CAAC;CACnB,GAAG,YAAY,CAUf"}
package/dist/calls.js CHANGED
@@ -13,7 +13,7 @@
13
13
  * delegation / mcp-runtime here — these builders stay pure encode-only.
14
14
  */
15
15
  import { encodeFunctionData } from 'viem';
16
- import { agentRelationshipAbi } from './abis';
16
+ import { agentRelationshipAbi } from './abis.js';
17
17
  const ZERO_BYTES32 = '0x0000000000000000000000000000000000000000000000000000000000000000';
18
18
  /**
19
19
  * Build a call to propose a new edge. The caller MUST be the subject
package/dist/calls.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"calls.js","sourceRoot":"","sources":["../src/calls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAE1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AAU9C,MAAM,YAAY,GAAG,oEAA2E,CAAC;AAEjG;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAQpC;IACC,OAAO;QACL,EAAE,EAAE,IAAI,CAAC,aAAa;QACtB,KAAK,EAAE,EAAE;QACT,IAAI,EAAE,kBAAkB,CAAC;YACvB,GAAG,EAAE,oBAAoB;YACzB,YAAY,EAAE,aAAa;YAC3B,IAAI,EAAE;gBACJ,IAAI,CAAC,OAAO;gBACZ,IAAI,CAAC,MAAM;gBACX,IAAI,CAAC,gBAAgB;gBACrB,CAAC,IAAI,CAAC,YAAY,IAAI,EAAE,CAAmB;gBAC3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AAS;YACvB,IAAI,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC;SAC/B,CAAC;KACH,CAAC;AACJ,CAAC;AAED,2DAA2D;AAC3D,MAAM,UAAU,mBAAmB,CAAC,IAInC;IACC,OAAO;QACL,EAAE,EAAE,IAAI,CAAC,aAAa;QACtB,KAAK,EAAE,EAAE;QACT,IAAI,EAAE,kBAAkB,CAAC;YACvB,GAAG,EAAE,oBAAoB;YACzB,YAAY,EAAE,YAAY;YAC1B,IAAI,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC;SAC/B,CAAC;KACH,CAAC;AACJ,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,oBAAoB,CAAC,IAKpC;IACC,OAAO;QACL,EAAE,EAAE,IAAI,CAAC,aAAa;QACtB,KAAK,EAAE,EAAE;QACT,IAAI,EAAE,kBAAkB,CAAC;YACvB,GAAG,EAAE,oBAAoB;YACzB,YAAY,EAAE,aAAa;YAC3B,IAAI,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC;SACzD,CAAC;KACH,CAAC;AACJ,CAAC"}
package/dist/client.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { type Address, type Hex, type WalletClient } from 'viem';
2
- import { computeEdgeId } from './edge-id';
3
- import type { AgentRelationshipsClientOpts, ConfirmEdgeInput, Edge, ProposeEdgeInput, RelationshipType, RevokeEdgeInput, SetRolesInput } from './types';
4
- import { EdgeStatus } from './types';
2
+ import { computeEdgeId } from './edge-id.js';
3
+ import type { AgentRelationshipsClientOpts, ConfirmEdgeInput, Edge, ProposeEdgeInput, RelationshipType, RevokeEdgeInput, SetRolesInput } from './types.js';
4
+ import { EdgeStatus } from './types.js';
5
5
  /**
6
6
  * Optional per-call submission context. When provided, the write
7
7
  * method submits the encoded call via `walletClient.sendTransaction`.
@@ -1 +1 @@
1
- {"version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AC,QAAQ,CAAC,aAAa,CAAU;gBAEnB,IAAI,EAAE,gCAAgC;IAc3D,mEAAmE;IAC7D,OAAO,CAAC,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAwBhD;;;;;;OAMG;IACG,YAAY,CAChB,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE;QAAE,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;QAAC,MAAM,CAAC,EAAE,UAAU,CAAA;KAAE,GACpE,OAAO,CAAC,IAAI,EAAE,CAAC;IAiBlB,qDAAqD;IAC/C,mBAAmB,CACvB,MAAM,EAAE,OAAO,EACf,MAAM,CAAC,EAAE;QAAE,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;QAAC,MAAM,CAAC,EAAE,UAAU,CAAA;KAAE,GACpE,OAAO,CAAC,IAAI,EAAE,CAAC;IAmBlB;;;;;;;;;;;OAWG;IACG,WAAW,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC;IAa3E;;;OAGG;IACG,WAAW,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC;IAK3E;;;OAGG;IACG,UAAU,CAAC,KAAK,EAAE,eAAe,EAAE,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC;IAKzE;;;;;;;;;OASG;IACG,QAAQ,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAmCvE;;;;OAIG;YACW,OAAO;CAiCtB;AAED,qEAAqE;AACrE,OAAO,EAAE,aAAa,EAAE,CAAC"}
package/dist/client.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { createPublicClient, http } from 'viem';
2
- import { agentRelationshipAbi } from './abis';
3
- import { buildAddRoleCall, buildConfirmEdgeCall, buildProposeEdgeCall, buildRemoveRoleCall, buildRevokeEdgeCall, } from './calls';
4
- import { computeEdgeId } from './edge-id';
5
- import { UnknownRelationshipTypeError } from './errors';
2
+ import { agentRelationshipAbi } from './abis.js';
3
+ import { buildAddRoleCall, buildConfirmEdgeCall, buildProposeEdgeCall, buildRemoveRoleCall, buildRevokeEdgeCall, } from './calls.js';
4
+ import { computeEdgeId } from './edge-id.js';
5
+ import { UnknownRelationshipTypeError } from './errors.js';
6
6
  const ZERO = '0x0000000000000000000000000000000000000000';
7
7
  const ZERO_NODE = '0x0000000000000000000000000000000000000000000000000000000000000000';
8
8
  export class AgentRelationshipsClient {
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAgE,MAAM,MAAM,CAAC;AAC9G,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAW1C,OAAO,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAaxD,MAAM,IAAI,GAAG,4CAAqD,CAAC;AACnE,MAAM,SAAS,GAAG,oEAA6E,CAAC;AAkBhG,MAAM,OAAO,wBAAwB;IAId;IAHJ,YAAY,CAAe;IAC3B,aAAa,CAAU;IAExC,YAAqB,IAAsC;QAAtC,SAAI,GAAJ,IAAI,CAAkC;QACzD,IAAI,CAAC,IAAI,CAAC,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAC3E,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;YACrC,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;QAC5D,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,aAAa,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,OAAO;QACjB,gBAAgB,EAAE,CAAC,CAAC,gBAAoC;QACxD,YAAY,EAAE,CAAC,GAAG,KAAK,CAAyB;QAChD,WAAW,EAAE,EAAE;QACf,MAAM,EAAE,CAAC,CAAC,MAAoB;QAC9B,WAAW,EAAE,CAAC,CAAC,WAAW,IAAI,SAAS;QACvC,YAAY,EAAE,CAAC,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY;QACvE,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;KAC/B,CAAC;AACJ,CAAC"}
@@ -18,7 +18,36 @@ export declare function hashRole(name: string): `0x${string}`;
18
18
  * Naming hierarchy lives in agent-naming via a parent-pointer, NOT
19
19
  * via a relationships-edge.
20
20
  */
21
+ /**
22
+ * Derive a relationship-type ID from an ONTOLOGY IRI — the convention for every type added after
23
+ * spec 355. The bytes32 on chain then names a term with an `rdfs:comment` that says what it means and
24
+ * what it does not, instead of a short string whose meaning lives in whoever wrote it.
25
+ *
26
+ * The older constants below hash short names (`HAS_MEMBER`) and keep doing so: their IDs are on chain
27
+ * already and re-hashing them would orphan every existing edge. New terms name their IRI.
28
+ */
29
+ export declare function ontologyRelationshipType(iri: string): `0x${string}`;
30
+ /** The ontology IRIs that back the IRI-derived relationship types, for `check:ontology-bindings`. */
31
+ export declare const RELATIONSHIP_TYPE_IRI: {
32
+ readonly CHARTERED_UNDER: "https://agenticprimitives.dev/ns/core#charteredUnder";
33
+ };
34
+ /** Ontology IRIs backing the IRI-derived ROLES. Same convention and same reason as the types above. */
35
+ export declare const ROLE_IRI: {
36
+ /** `ap:primaryPayee` — the agent its owner wants paid into. A preference, never authority. */
37
+ readonly PRIMARY_PAYEE: "https://agenticprimitives.dev/ns/core#primaryPayee";
38
+ /** `ap:primaryPayer` — the account its owner usually pays FROM. The mirror, and never the same thing:
39
+ * the account you publish to be paid into and the one you spend from are often different. */
40
+ readonly PRIMARY_PAYER: "https://agenticprimitives.dev/ns/core#primaryPayer";
41
+ };
21
42
  export declare const RELATIONSHIP_TYPE: {
43
+ /**
44
+ * `ap:charteredUnder` — subject was created under object and BELONGS TO it: a treasury under the
45
+ * person or organization that holds it, a team under its workspace, a workspace under its
46
+ * organization. NEVER AUTHORITY (ADR-0010): the subject is a distinct custodied agent, and the
47
+ * authority to act for it is granted elsewhere and never by this edge. Recorded so a third party can
48
+ * answer "which treasury does alice hold" — which no public source could answer before (spec 355 §3).
49
+ */
50
+ readonly CHARTERED_UNDER: `0x${string}`;
22
51
  /** Membership: subject is a member of object (org / DAO / collective). */
23
52
  readonly HAS_MEMBER: `0x${string}`;
24
53
  /** Governance: subject has governance authority over object. */
@@ -34,6 +63,18 @@ export declare const RELATIONSHIP_TYPE: {
34
63
  };
35
64
  /** Well-known role labels (bytes32-hashed). */
36
65
  export declare const ROLE: {
66
+ /**
67
+ * `ap:primaryPayee` — on an `ap:charteredUnder` edge, marks the child as the one its owner wants paid
68
+ * into. Set by either end (the contract allows subject or object; in practice the owner). A PREFERENCE:
69
+ * it stops a payer having to guess or be asked, and permits nothing.
70
+ */
71
+ readonly PRIMARY_PAYEE: `0x${string}`;
72
+ /**
73
+ * `ap:primaryPayer` — on the same `ap:charteredUnder` edge, marks the child as the account its owner
74
+ * usually SPENDS from. It permits nothing: a payment from it still needs a mandate signed for that
75
+ * request. What it removes is a question the owner is the only one who can answer, asked every time.
76
+ */
77
+ readonly PRIMARY_PAYER: `0x${string}`;
37
78
  /** Generic member role. */
38
79
  readonly MEMBER: `0x${string}`;
39
80
  /** Board / governance member. */
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,MAAM,EAAE,CAEhE;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,MAAM,EAAE,CAEpD;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB;IAC5B,0EAA0E;;IAE1E,gEAAgE;;IAEhE,yEAAyE;;IAEzE,iDAAiD;;IAEjD,oDAAoD;;IAEpD,4DAA4D;;CAEpD,CAAC;AAEX,+CAA+C;AAC/C,eAAO,MAAM,IAAI;IACf,2BAA2B;;IAE3B,iCAAiC;;IAEjC,4BAA4B;;IAE5B,4BAA4B;;IAE5B,2CAA2C;;IAE3C,wBAAwB;;CAEhB,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,MAAM,EAAE,CAEhE;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,MAAM,EAAE,CAEpD;AAED;;;;;;;;GAQG;AACH;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,MAAM,EAAE,CAEnE;AAED,qGAAqG;AACrG,eAAO,MAAM,qBAAqB;;CAExB,CAAC;AAEX,uGAAuG;AACvG,eAAO,MAAM,QAAQ;IACnB,8FAA8F;;IAE9F;kGAC8F;;CAEtF,CAAC;AAEX,eAAO,MAAM,iBAAiB;IAC5B;;;;;;OAMG;;IAEH,0EAA0E;;IAE1E,gEAAgE;;IAEhE,yEAAyE;;IAEzE,iDAAiD;;IAEjD,oDAAoD;;IAEpD,4DAA4D;;CAEpD,CAAC;AAEX,+CAA+C;AAC/C,eAAO,MAAM,IAAI;IACf;;;;OAIG;;IAEH;;;;OAIG;;IAEH,2BAA2B;;IAE3B,iCAAiC;;IAEjC,4BAA4B;;IAE5B,4BAA4B;;IAE5B,2CAA2C;;IAE3C,wBAAwB;;CAEhB,CAAC"}
package/dist/constants.js CHANGED
@@ -23,7 +23,38 @@ export function hashRole(name) {
23
23
  * Naming hierarchy lives in agent-naming via a parent-pointer, NOT
24
24
  * via a relationships-edge.
25
25
  */
26
+ /**
27
+ * Derive a relationship-type ID from an ONTOLOGY IRI — the convention for every type added after
28
+ * spec 355. The bytes32 on chain then names a term with an `rdfs:comment` that says what it means and
29
+ * what it does not, instead of a short string whose meaning lives in whoever wrote it.
30
+ *
31
+ * The older constants below hash short names (`HAS_MEMBER`) and keep doing so: their IDs are on chain
32
+ * already and re-hashing them would orphan every existing edge. New terms name their IRI.
33
+ */
34
+ export function ontologyRelationshipType(iri) {
35
+ return hashRelationshipType(iri);
36
+ }
37
+ /** The ontology IRIs that back the IRI-derived relationship types, for `check:ontology-bindings`. */
38
+ export const RELATIONSHIP_TYPE_IRI = {
39
+ CHARTERED_UNDER: 'https://agenticprimitives.dev/ns/core#charteredUnder',
40
+ };
41
+ /** Ontology IRIs backing the IRI-derived ROLES. Same convention and same reason as the types above. */
42
+ export const ROLE_IRI = {
43
+ /** `ap:primaryPayee` — the agent its owner wants paid into. A preference, never authority. */
44
+ PRIMARY_PAYEE: 'https://agenticprimitives.dev/ns/core#primaryPayee',
45
+ /** `ap:primaryPayer` — the account its owner usually pays FROM. The mirror, and never the same thing:
46
+ * the account you publish to be paid into and the one you spend from are often different. */
47
+ PRIMARY_PAYER: 'https://agenticprimitives.dev/ns/core#primaryPayer',
48
+ };
26
49
  export const RELATIONSHIP_TYPE = {
50
+ /**
51
+ * `ap:charteredUnder` — subject was created under object and BELONGS TO it: a treasury under the
52
+ * person or organization that holds it, a team under its workspace, a workspace under its
53
+ * organization. NEVER AUTHORITY (ADR-0010): the subject is a distinct custodied agent, and the
54
+ * authority to act for it is granted elsewhere and never by this edge. Recorded so a third party can
55
+ * answer "which treasury does alice hold" — which no public source could answer before (spec 355 §3).
56
+ */
57
+ CHARTERED_UNDER: hashRelationshipType(RELATIONSHIP_TYPE_IRI.CHARTERED_UNDER),
27
58
  /** Membership: subject is a member of object (org / DAO / collective). */
28
59
  HAS_MEMBER: hashRelationshipType('HAS_MEMBER'),
29
60
  /** Governance: subject has governance authority over object. */
@@ -39,6 +70,18 @@ export const RELATIONSHIP_TYPE = {
39
70
  };
40
71
  /** Well-known role labels (bytes32-hashed). */
41
72
  export const ROLE = {
73
+ /**
74
+ * `ap:primaryPayee` — on an `ap:charteredUnder` edge, marks the child as the one its owner wants paid
75
+ * into. Set by either end (the contract allows subject or object; in practice the owner). A PREFERENCE:
76
+ * it stops a payer having to guess or be asked, and permits nothing.
77
+ */
78
+ PRIMARY_PAYEE: hashRole(ROLE_IRI.PRIMARY_PAYEE),
79
+ /**
80
+ * `ap:primaryPayer` — on the same `ap:charteredUnder` edge, marks the child as the account its owner
81
+ * usually SPENDS from. It permits nothing: a payment from it still needs a mandate signed for that
82
+ * request. What it removes is a question the owner is the only one who can answer, asked every time.
83
+ */
84
+ PRIMARY_PAYER: hashRole(ROLE_IRI.PRIMARY_PAYER),
42
85
  /** Generic member role. */
43
86
  MEMBER: hashRole('MEMBER'),
44
87
  /** Board / governance member. */
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAExC;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,OAAO,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AAChC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAY;IACnC,OAAO,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AAChC,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,0EAA0E;IAC1E,UAAU,EAAE,oBAAoB,CAAC,YAAY,CAAC;IAC9C,gEAAgE;IAChE,mBAAmB,EAAE,oBAAoB,CAAC,qBAAqB,CAAC;IAChE,yEAAyE;IACzE,gBAAgB,EA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CAAC"}
@@ -0,0 +1,97 @@
1
+ import { type Address, type Hex } from 'viem';
2
+ export type RelationshipKind = 'has-member' | 'steward-of' | 'chartered-under';
3
+ /** What both parties sign. `termsDigest`, never the terms: a presentation may withhold them. */
4
+ export interface RelationshipCredentialBodyV1 {
5
+ type: 'ap.relationship-credential.v1';
6
+ kind: RelationshipKind;
7
+ /** The party the relation is OF (the member, the steward, the chartered agent). */
8
+ subject: Address;
9
+ /** The party it is TO (the organization, the stewarded agent, the charterer). */
10
+ object: Address;
11
+ chainId: number;
12
+ issuedAt: string;
13
+ /** keccak256 of the RFC 8785 canonical terms; `0x00…` when there are none. */
14
+ termsDigest: Hex;
15
+ /** The chain edge this credential is the private side of, when one exists (the edge carries this credential's digest). */
16
+ edgeRef?: Hex;
17
+ }
18
+ export interface RelationshipCredentialV1 extends RelationshipCredentialBodyV1 {
19
+ /** The holder's copy keeps the terms; a presentation may omit them. */
20
+ terms?: Record<string, unknown>;
21
+ signatures: {
22
+ subject: Hex;
23
+ object: Hex;
24
+ };
25
+ }
26
+ export interface RelationshipRevocationV1 {
27
+ type: 'ap.relationship-revocation.v1';
28
+ /** The credential digest this revokes. */
29
+ credential: Hex;
30
+ revokedAt: string;
31
+ /** Both when both are present to sign; the object's alone when the member is gone — said, not hidden. */
32
+ signatures: {
33
+ subject?: Hex;
34
+ object?: Hex;
35
+ };
36
+ unilateral?: 'subject' | 'object';
37
+ reason?: string;
38
+ }
39
+ export declare const ZERO_DIGEST: Hex;
40
+ export declare const RELATIONSHIP_CREDENTIAL_PREFIX: "relationships.credential:";
41
+ export declare const RELATIONSHIP_REVOCATION_PREFIX: "relationships.revocation:";
42
+ export declare const relationshipCredentialRecordType: (digest: Hex) => string;
43
+ export declare const relationshipRevocationRecordType: (digest: Hex) => string;
44
+ export declare const termsDigestOf: (terms: Record<string, unknown> | undefined) => Hex;
45
+ /** THE ONE digest both parties sign: RFC 8785 over the body (the terms by digest, never inline). */
46
+ export declare function relationshipCredentialDigest(body: RelationshipCredentialBodyV1): Hex;
47
+ export declare function relationshipRevocationDigest(r: Omit<RelationshipRevocationV1, 'signatures'>): Hex;
48
+ /** Issue: build the body, have BOTH sides sign its digest, keep the terms on the holders' copies. */
49
+ export declare function issueRelationshipCredential(input: {
50
+ kind: RelationshipKind;
51
+ subject: Address;
52
+ object: Address;
53
+ chainId: number;
54
+ terms?: Record<string, unknown>;
55
+ edgeRef?: Hex;
56
+ signSubject: (digest: Hex) => Promise<Hex>;
57
+ signObject: (digest: Hex) => Promise<Hex>;
58
+ now?: () => Date;
59
+ }): Promise<{
60
+ credential: RelationshipCredentialV1;
61
+ digest: Hex;
62
+ }>;
63
+ export type SignatureCheck = (signer: Address, digest: Hex, signature: Hex) => Promise<boolean>;
64
+ /**
65
+ * Verify a credential (or a presentation of one): both signatures over the body's digest, each against its own
66
+ * party's Smart Agent; when the terms travel, they must hash to the body's `termsDigest`. Nothing here reads a
67
+ * chain edge — the signatures are the evidence, and the chain is consulted only for THEIR validity.
68
+ */
69
+ export declare function verifyRelationshipCredential(c: RelationshipCredentialV1, verifySig: SignatureCheck): Promise<{
70
+ ok: true;
71
+ digest: Hex;
72
+ } | {
73
+ ok: false;
74
+ reason: string;
75
+ }>;
76
+ /** A presentation: the credential with the terms WITHHELD. Verifies exactly as the full copy does. */
77
+ export declare function presentRelationship(c: RelationshipCredentialV1): RelationshipCredentialV1;
78
+ /** The §4 membership-root leaf: a blinded commitment to the credential's digest — proves membership in the set
79
+ * without naming which credential. `blind` is the holder's secret; the projection keeps the pair. */
80
+ export declare function relationshipCommitment(digest: Hex, blind: Hex): Hex;
81
+ export declare function issueRelationshipRevocation(input: {
82
+ credential: Hex;
83
+ reason?: string;
84
+ now?: () => Date;
85
+ signSubject?: (digest: Hex) => Promise<Hex>;
86
+ signObject?: (digest: Hex) => Promise<Hex>;
87
+ }): Promise<{
88
+ revocation: RelationshipRevocationV1;
89
+ digest: Hex;
90
+ }>;
91
+ export declare function verifyRelationshipRevocation(r: RelationshipRevocationV1, credential: RelationshipCredentialBodyV1, verifySig: SignatureCheck): Promise<{
92
+ ok: true;
93
+ } | {
94
+ ok: false;
95
+ reason: string;
96
+ }>;
97
+ //# sourceMappingURL=credential.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credential.d.ts","sourceRoot":"","sources":["../src/credential.ts"],"names":[],"mappings":"AA2BA,OAAO,EAA4B,KAAK,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAGxE,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG,YAAY,GAAG,iBAAiB,CAAC;AAE/E,gGAAgG;AAChG,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,+BAA+B,CAAC;IACtC,IAAI,EAAE,gBAAgB,CAAC;IACvB,mFAAmF;IACnF,OAAO,EAAE,OAAO,CAAC;IACjB,iFAAiF;IACjF,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,8EAA8E;IAC9E,WAAW,EAAE,GAAG,CAAC;IACjB,0HAA0H;IAC1H,OAAO,CAAC,EAAE,GAAG,CAAC;CACf;AAED,MAAM,WAAW,wBAAyB,SAAQ,4BAA4B;IAC5E,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,UAAU,EAAE;QAAE,OAAO,EAAE,GAAG,CAAC;QAAC,MAAM,EAAE,GAAG,CAAA;KAAE,CAAC;CAC3C;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,+BAA+B,CAAC;IACtC,0CAA0C;IAC1C,UAAU,EAAE,GAAG,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,yGAAyG;IACzG,UAAU,EAAE;QAAE,OAAO,CAAC,EAAE,GAAG,CAAC;QAAC,MAAM,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC5C,UAAU,CAAC,EAAE,SAAS,GAAG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SHIP — spec 410 §8 (THESIS-7).
2
+ //
3
+ // A relationship has three forms (the thesis): a chain record (`AgentRelationship.sol`, right for enforcement), a
4
+ // public commitment (the membership root of spec 410 §4), and a VAULT CREDENTIAL — the one that was missing as a
5
+ // COUNTERSIGNED thing. `relationships.data` (ADR-0025) is the person's private index of her links, issued and held
6
+ // by her alone; nobody else's signature is on it, so it proves what she says, not what the organization agreed.
7
+ //
8
+ // This is the countersigned form: one credential, two signatures, two copies.
9
+ //
10
+ // THE RULE FOR SHARED RECORDS, IN CODE: each principal holds its side; nothing is one party's alone if two signed
11
+ // it. `issueRelationshipCredential` produces the object BOTH sign; the runtime writes one copy into each party's
12
+ // vault under that party's own key as one logical operation (spec 410 §3's `operationId`) — if the second write
13
+ // cannot be reconciled the first is compensated. The chain edge, where a gate must follow it, carries only the
14
+ // credential's digest. Read is from the holder's vantage point only.
15
+ //
16
+ // PRESENTATION UNDER GRANT. The signed body commits to the terms by DIGEST, so a holder presents `kind`, `object`,
17
+ // `issuedAt` and both signatures while WITHHOLDING the terms — the counterparty verifies the organization's
18
+ // signature against its Smart Agent (ERC-1271 / 6492) and never reads `AgentRelationship.sol`. The chain is consulted
19
+ // only for the signature's validity, as for any signature.
20
+ //
21
+ // DEPARTURE. A revocation is a new two-sided record — or the organization's alone when the member is gone, labelled
22
+ // `unilateral` — written to both vaults. The departing member keeps her copy, her receipts and the revocation; she
23
+ // does not keep the organization's records (its vault was never hers). The §4 membership root drops the leaf.
24
+ //
25
+ // Kinds are the T-box relations the chain already hashes: `has-member` (aporg:OrganizationMembership),
26
+ // `steward-of` (ap:Stewardship — the oversight grant is the evidence; this is the two-sided record of it),
27
+ // `chartered-under` (ap:charteredUnder). Bound by IRI in `packages/ontology/src/vault-records.ts`.
28
+ import { keccak256, stringToBytes } from 'viem';
29
+ import { jcsCanonicalize } from '@agenticprimitives/types';
30
+ export const ZERO_DIGEST = `0x${'00'.repeat(32)}`;
31
+ export const RELATIONSHIP_CREDENTIAL_PREFIX = 'relationships.credential:';
32
+ export const RELATIONSHIP_REVOCATION_PREFIX = 'relationships.revocation:';
33
+ export const relationshipCredentialRecordType = (digest) => `${RELATIONSHIP_CREDENTIAL_PREFIX}${digest.toLowerCase()}`;
34
+ export const relationshipRevocationRecordType = (digest) => `${RELATIONSHIP_REVOCATION_PREFIX}${digest.toLowerCase()}`;
35
+ const digestOf = (v) => keccak256(stringToBytes(jcsCanonicalize(v)));
36
+ export const termsDigestOf = (terms) => (terms && Object.keys(terms).length ? digestOf(terms) : ZERO_DIGEST);
37
+ /** THE ONE digest both parties sign: RFC 8785 over the body (the terms by digest, never inline). */
38
+ export function relationshipCredentialDigest(body) {
39
+ const { type, kind, subject, object, chainId, issuedAt, termsDigest, edgeRef } = body;
40
+ return digestOf({ type, kind, subject: subject.toLowerCase(), object: object.toLowerCase(), chainId, issuedAt, termsDigest: termsDigest.toLowerCase(), ...(edgeRef ? { edgeRef: edgeRef.toLowerCase() } : {}) });
41
+ }
42
+ export function relationshipRevocationDigest(r) {
43
+ const { type, credential, revokedAt, unilateral, reason } = r;
44
+ return digestOf({ type, credential: credential.toLowerCase(), revokedAt, ...(unilateral ? { unilateral } : {}), ...(reason ? { reason } : {}) });
45
+ }
46
+ /** Issue: build the body, have BOTH sides sign its digest, keep the terms on the holders' copies. */
47
+ export async function issueRelationshipCredential(input) {
48
+ const body = {
49
+ type: 'ap.relationship-credential.v1', kind: input.kind, subject: input.subject.toLowerCase(), object: input.object.toLowerCase(),
50
+ chainId: input.chainId, issuedAt: (input.now ?? (() => new Date()))().toISOString(), termsDigest: termsDigestOf(input.terms), ...(input.edgeRef ? { edgeRef: input.edgeRef } : {}),
51
+ };
52
+ const digest = relationshipCredentialDigest(body);
53
+ const [subject, object] = await Promise.all([input.signSubject(digest), input.signObject(digest)]);
54
+ return { credential: { ...body, ...(input.terms ? { terms: input.terms } : {}), signatures: { subject, object } }, digest };
55
+ }
56
+ /**
57
+ * Verify a credential (or a presentation of one): both signatures over the body's digest, each against its own
58
+ * party's Smart Agent; when the terms travel, they must hash to the body's `termsDigest`. Nothing here reads a
59
+ * chain edge — the signatures are the evidence, and the chain is consulted only for THEIR validity.
60
+ */
61
+ export async function verifyRelationshipCredential(c, verifySig) {
62
+ if (c.type !== 'ap.relationship-credential.v1')
63
+ return { ok: false, reason: 'not a relationship credential' };
64
+ if (!['has-member', 'steward-of', 'chartered-under'].includes(c.kind))
65
+ return { ok: false, reason: `unknown kind ${String(c.kind)}` };
66
+ if (c.terms !== undefined && termsDigestOf(c.terms).toLowerCase() !== c.termsDigest.toLowerCase())
67
+ return { ok: false, reason: 'the terms do not hash to the signed termsDigest' };
68
+ const digest = relationshipCredentialDigest(c);
69
+ const [s, o] = await Promise.all([verifySig(c.subject, digest, c.signatures.subject).catch(() => false), verifySig(c.object, digest, c.signatures.object).catch(() => false)]);
70
+ if (!s)
71
+ return { ok: false, reason: 'the subject\'s signature did not verify' };
72
+ if (!o)
73
+ return { ok: false, reason: 'the object\'s signature did not verify' };
74
+ return { ok: true, digest };
75
+ }
76
+ /** A presentation: the credential with the terms WITHHELD. Verifies exactly as the full copy does. */
77
+ export function presentRelationship(c) {
78
+ const { terms: _t, ...rest } = c;
79
+ void _t;
80
+ return rest;
81
+ }
82
+ /** The §4 membership-root leaf: a blinded commitment to the credential's digest — proves membership in the set
83
+ * without naming which credential. `blind` is the holder's secret; the projection keeps the pair. */
84
+ export function relationshipCommitment(digest, blind) {
85
+ return keccak256(`0x${digest.slice(2)}${blind.slice(2)}`);
86
+ }
87
+ export async function issueRelationshipRevocation(input) {
88
+ if (!input.signSubject && !input.signObject)
89
+ throw new Error('issueRelationshipRevocation: at least one side signs');
90
+ const unilateral = input.signSubject && input.signObject ? undefined : input.signSubject ? 'subject' : 'object';
91
+ const base = { type: 'ap.relationship-revocation.v1', credential: input.credential.toLowerCase(), revokedAt: (input.now ?? (() => new Date()))().toISOString(), ...(unilateral ? { unilateral } : {}), ...(input.reason ? { reason: input.reason } : {}) };
92
+ const digest = relationshipRevocationDigest(base);
93
+ const signatures = {};
94
+ if (input.signSubject)
95
+ signatures.subject = await input.signSubject(digest);
96
+ if (input.signObject)
97
+ signatures.object = await input.signObject(digest);
98
+ return { revocation: { ...base, signatures }, digest };
99
+ }
100
+ export async function verifyRelationshipRevocation(r, credential, verifySig) {
101
+ if (r.type !== 'ap.relationship-revocation.v1')
102
+ return { ok: false, reason: 'not a relationship revocation' };
103
+ if (r.credential.toLowerCase() !== relationshipCredentialDigest(credential).toLowerCase())
104
+ return { ok: false, reason: 'the revocation names another credential' };
105
+ const digest = relationshipRevocationDigest(r);
106
+ const checks = [];
107
+ if (r.signatures.subject)
108
+ checks.push(verifySig(credential.subject, digest, r.signatures.subject).catch(() => false));
109
+ if (r.signatures.object)
110
+ checks.push(verifySig(credential.object, digest, r.signatures.object).catch(() => false));
111
+ if (!checks.length)
112
+ return { ok: false, reason: 'unsigned' };
113
+ if (r.unilateral && r.signatures.subject && r.signatures.object)
114
+ return { ok: false, reason: 'labelled unilateral but both sides signed' };
115
+ if (!r.unilateral && !(r.signatures.subject && r.signatures.object))
116
+ return { ok: false, reason: 'one side signed and it is not labelled unilateral' };
117
+ const ok = (await Promise.all(checks)).every(Boolean);
118
+ return ok ? { ok: true } : { ok: false, reason: 'a signature did not verify' };
119
+ }
120
+ //# sourceMappingURL=credential.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credential.js","sourceRoot":"","sources":["../src/credential.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,EAAE;AACF,kHAAkH;AAClH,iHAAiH;AACjH,mHAAmH;AACnH,gHAAgH;AAChH,EAAE;AACF,8EAA8E;AAC9E,EAAE;AACF,oHAAoH;AACpH,mHAAmH;AACnH,kHAAkH;AAClH,iHAAiH;AACjH,uEAAuE;AACvE,EAAE;AACF,qHAAqH;AACrH,8GAA8G;AAC9G,wHAAwH;AACxH,6DAA6D;AAC7D,EAAE;AACF,sHAAsH;AACtH,qHAAqH;AACrH,gHAAgH;AAChH,EAAE;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AAC;IACvJ,MAAM,EAAE,GAAG,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACtD,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,4BAA4B,EAAE,CAAC;AACjF,CAAC"}
package/dist/edge-id.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { Address, Hex } from '@agenticprimitives/types';
2
- import type { RelationshipType } from './types';
2
+ import type { RelationshipType } from './types.js';
3
3
  /**
4
4
  * Deterministic edge-ID derivation. Matches the on-chain port that
5
5
  * will land in `packages/contracts/src/relationships/AgentRelationship.sol`
@@ -1 +1 @@
1
- {"version":3,"file":"edge-id.d.ts","sourceRoot":"","sources":["../src/edge-id.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAKhD;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,OAAO,EACf,gBAAgB,EAAE,gBAAgB,GACjC,GAAG,CAcL"}
1
+ {"version":3,"file":"edge-id.d.ts","sourceRoot":"","sources":["../src/edge-id.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAKnD;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,OAAO,EACf,gBAAgB,EAAE,gBAAgB,GACjC,GAAG,CAcL"}
package/dist/edge-id.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { keccak256, concat } from 'viem';
2
- import { InvalidEdgeError } from './errors';
2
+ import { InvalidEdgeError } from './errors.js';
3
3
  const ADDRESS_RE = /^0x[0-9a-fA-F]{40}$/;
4
4
  /**
5
5
  * Deterministic edge-ID derivation. Matches the on-chain port that
@@ -1 +1 @@
1
- {"version":3,"file":"edge-id.js","sourceRoot":"","sources":["../src/edge-id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAGzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,UAAU,GAAG,qBAAqB,CAAC;AAEzC;;;;;;;;;;GAUG;AACH,MAAM,UAAU,aAAa,CAC3B,OAAgB,EAChB,MAAe,EACf,gBAAkC;IAElC,IAAI,CAAC,OAAO;QAAE,MAAM,IAAI,gBAAgB,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC;IACxE,IAAI,CAAC,MAAM;QAAE,MAAM,IAAI,gBAAgB,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC;IACrE,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,MAAM,IAAI,gBAAgB,CAAC,2BAA2B,EAAE,kBAAkB,CAAC,CAAC;IAC9E,CAAC;IACD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC;QAAE,MAAM,IAAI,gBAAgB,CAAC,qBAAqB,OAAO,EAAE,EAAE,SAAS,CAAC,CAAC;IACrG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC;QAAE,MAAM,IAAI,gBAAgB,CAAC,oBAAoB,MAAM,EAAE,EAAE,QAAQ,CAAC,CAAC;IACjG,IAAI,OAAO,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC,WAAW,EAAE,EAAE,CAAC;QACnD,MAAM,IAAI,gBAAgB,CAAC,yDAAyD,CAAC,CAAC;IACxF,CAAC;IACD,MAAM,CAAC,GAAG,OAAO,CAAC,WAAW,E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EAAmB,CAAC;IACjD,MAAM,CAAC,GAAG,MAAM,CAAC,WAAW,EAAmB,CAAC;IAChD,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;AACrD,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,9 +1,10 @@
1
- export { RELATIONSHIP_TYPE, ROLE, hashRelationshipType, hashRole, } from './constants';
2
- export { computeEdgeId } from './edge-id';
3
- export { TYPE_SEMANTICS, type RelationshipTypeSemantics, } from './taxonomy';
4
- export { InvalidEdgeError, UnauthorizedActorError, UnknownRelationshipTypeError, } from './errors';
5
- export { EdgeStatus, type RelationshipType, type Role, type Edge, type ProposeEdgeInput, type ConfirmEdgeInput, type RevokeEdgeInput, type SetRolesInput, type AgentRelationshipsClientOpts, } from './types';
6
- export { AgentRelationshipsClient, type WriteContext } from './client';
7
- export { agentRelationshipAbi, relationshipTypeRegistryAbi, } from './abis';
8
- export { buildProposeEdgeCall, buildConfirmEdgeCall, buildActivateEdgeCall, buildRevokeEdgeCall, buildAddRoleCall, buildRemoveRoleCall, buildSetMetadataCall, type ContractCall, } from './calls';
1
+ export { RELATIONSHIP_TYPE, ROLE, ROLE_IRI, RELATIONSHIP_TYPE_IRI, hashRelationshipType, hashRole, } from './constants.js';
2
+ export { computeEdgeId } from './edge-id.js';
3
+ export { TYPE_SEMANTICS, type RelationshipTypeSemantics, } from './taxonomy.js';
4
+ export { InvalidEdgeError, UnauthorizedActorError, UnknownRelationshipTypeError, } from './errors.js';
5
+ export { EdgeStatus, type RelationshipType, type Role, type Edge, type ProposeEdgeInput, type ConfirmEdgeInput, type RevokeEdgeInput, type SetRolesInput, type AgentRelationshipsClientOpts, } from './types.js';
6
+ export { AgentRelationshipsClient, type WriteContext } from './client.js';
7
+ export { agentRelationshipAbi, relationshipTypeRegistryAbi, } from './abis.js';
8
+ export { buildProposeEdgeCall, buildConfirmEdgeCall, buildActivateEdgeCall, buildRevokeEdgeCall, buildAddRoleCall, buildRemoveRoleCall, buildSetMetadataCall, type ContractCall, } from './calls.js';
9
+ export { issueRelationshipCredential, verifyRelationshipCredential, presentRelationship, relationshipCredentialDigest, termsDigestOf, issueRelationshipRevocation, verifyRelationshipRevocation, relationshipRevocationDigest, relationshipCommitment, RELATIONSHIP_CREDENTIAL_PREFIX, RELATIONSHIP_REVOCATION_PREFIX, relationshipCredentialRecordType, relationshipRevocationRecordType, ZERO_DIGEST, type RelationshipKind, type RelationshipCredentialBodyV1, type RelationshipCredentialV1, type RelationshipRevocationV1, type SignatureCheck, } from './credential.js';
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,iBAAiB,EACjB,IAAI,EACJ,oBAAoB,EACpB,QAAQ,GACT,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EACL,cAAc,EACd,KAAK,yBAAyB,GAC/B,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,UAAU,EACV,KAAK,gBAAgB,EACrB,KAAK,IAAI,EACT,KAAK,IAAI,EACT,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,4BAA4B,GAClC,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,wBAAwB,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAIvE,OAAO,EACL,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,QAAQ,CAAC;AAIhB,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,KAAK,Y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,CAAC"}
package/dist/index.js CHANGED
@@ -5,16 +5,21 @@
5
5
  // - CLAUDE.md — doctrine
6
6
  // - specs/216-agent-relationships.md — the contract
7
7
  // - docs/architecture/decisions/0007-agent-identity-stack-three-packages.md
8
- export { RELATIONSHIP_TYPE, ROLE, hashRelationshipType, hashRole, } from './constants';
9
- export { computeEdgeId } from './edge-id';
10
- export { TYPE_SEMANTICS, } from './taxonomy';
11
- export { InvalidEdgeError, UnauthorizedActorError, UnknownRelationshipTypeError, } from './errors';
12
- export { EdgeStatus, } from './types';
13
- export { AgentRelationshipsClient } from './client';
8
+ export { RELATIONSHIP_TYPE, ROLE,
9
+ // The IRIs the roles are DERIVED from — a caller that reads roles by their modelled name (the decision
10
+ // plane, spec 363) needs the term, not only its hash.
11
+ ROLE_IRI, RELATIONSHIP_TYPE_IRI, hashRelationshipType, hashRole, } from './constants.js';
12
+ export { computeEdgeId } from './edge-id.js';
13
+ export { TYPE_SEMANTICS, } from './taxonomy.js';
14
+ export { InvalidEdgeError, UnauthorizedActorError, UnknownRelationshipTypeError, } from './errors.js';
15
+ export { EdgeStatus, } from './types.js';
16
+ export { AgentRelationshipsClient } from './client.js';
14
17
  // Phase 3 contract ABIs (live at deployed addresses recorded in
15
18
  // packages/contracts/deployments-<network>.json).
16
- export { agentRelationshipAbi, relationshipTypeRegistryAbi, } from './abis';
19
+ export { agentRelationshipAbi, relationshipTypeRegistryAbi, } from './abis.js';
17
20
  // Phase 4 pure call builders. Compose into AgentAccount.execute /
18
21
  // CustodyPolicy ceremonies / ERC-4337 UserOps as needed.
19
- export { buildProposeEdgeCall, buildConfirmEdgeCall, buildActivateEdgeCall, buildRevokeEdgeCall, buildAddRoleCall, buildRemoveRoleCall, buildSetMetadataCall, } from './calls';
22
+ export { buildProposeEdgeCall, buildConfirmEdgeCall, buildActivateEdgeCall, buildRevokeEdgeCall, buildAddRoleCall, buildRemoveRoleCall, buildSetMetadataCall, } from './calls.js';
23
+ // Spec 410 §8 — the VAULT form of a relationship: one credential, two signatures, two copies.
24
+ export { issueRelationshipCredential, verifyRelationshipCredential, presentRelationship, relationshipCredentialDigest, termsDigestOf, issueRelationshipRevocation, verifyRelationshipRevocation, relationshipRevocationDigest, relationshipCommitment, RELATIONSHIP_CREDENTIAL_PREFIX, RELATIONSHIP_REVOCATION_PREFIX, relationshipCredentialRecordType, relationshipRevocationRecordType, ZERO_DIGEST, } from './credential.js';
20
25
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,EAAE;AACF,OAAO;AACP,0CAA0C;AAC1C,2BAA2B;AAC3B,sDAAsD;AACtD,8EAA8E;AAE9E,OAAO,EACL,iBAAiB,EACjB,IAAI,EACJ,oBAAoB,EACpB,QAAQ,GACT,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EACL,cAAc,GAEf,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,UAAU,GASX,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,wBAAwB,EAAqB,MAAM,UAAU,CAAC;AAEvE,gEAAgE;AAChE,kDAAkD;AAClD,OAAO,EACL,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,QAAQ,CAAC;AAEhB,kEAAkE;AAClE,yDAAyD;AACzD,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,GAErB,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,EAAE;AACF,OAAO;AACP,0CAA0C;AAC1C,2BAA2B;AAC3B,sDAAsD;AACtD,8EAA8E;AAE9E,OAAO,EACL,iBAAiB,EACjB,IAAI;AACJ,uGAAuG;AACvG,sDAAsD;AACtD,QAAQ,EACR,qBAAqB,EACrB,oBAAoB,EACpB,QAAQ,GACT,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EACL,cAAc,GAEf,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,UAAU,GASX,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,wBAAwB,EAAqB,MAAM,aAAa,CAAC;AAE1E,gEAAgE;AAChE,kDAAkD;AAClD,OAAO,EACL,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,WAAW,CAAC;AAEnB,kEAAkE;AAClE,yDAAyD;AACzD,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,GAErB,MAAM,YAAY,CAAC;AACpB,8FAA8F;AAC9F,OAAO,EACL,2BAA2B,EAAE,4BAA4B,EAAE,mBAAmB,EAAE,4BAA4B,EAAE,aAAa,EAC3H,2BAA2B,EAAE,4BAA4B,EAAE,4BAA4B,EAAE,sBAAsB,EAC/G,8BAA8B,EAAE,8BAA8B,EAAE,gCAAgC,EAAE,gCAAgC,EAAE,WAAW,GAEhJ,MAAM,iBAAiB,CAAC"}
@@ -16,7 +16,7 @@
16
16
  * on-chain contract (Phase 3) enforces the two-side-confirmation
17
17
  * rule independently for non-symmetric types.
18
18
  */
19
- import { RELATIONSHIP_TYPE, ROLE, hashRelationshipType, hashRole } from './constants';
19
+ import { RELATIONSHIP_TYPE, ROLE, hashRelationshipType, hashRole } from './constants.js';
20
20
  import type { Hex } from '@agenticprimitives/types';
21
21
  export { RELATIONSHIP_TYPE, ROLE, hashRelationshipType, hashRole };
22
22
  export interface RelationshipTypeSemantics {
@@ -1 +1 @@
1
- {"version":3,"file":"taxonomy.d.ts","sourceRoot":"","sources":["../src/taxonomy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACtF,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,oBAAoB,EAAE,QAAQ,EAAE,CAAC;AAEnE,MAAM,WAAW,yBAAyB;IACxC,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,YAAY,EAAE,OAAO,CAAC;IACtB,mEAAmE;IACnE,UAAU,EAAE,OAAO,CAAC;IACpB,uDAAuD;IACvD,SAAS,EAAE,OAAO,CAAC;IACnB,qCAAqC;IACrC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,yBAAyB,CAAC,CA2C1E,CAAC"}
1
+ {"version":3,"file":"taxonomy.d.ts","sourceRoot":"","sources":["../src/taxonomy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACzF,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,oBAAoB,EAAE,QAAQ,EAAE,CAAC;AAEnE,MAAM,WAAW,yBAAyB;IACxC,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,YAAY,EAAE,OAAO,CAAC;IACtB,mEAAmE;IACnE,UAAU,EAAE,OAAO,CAAC;IACpB,uDAAuD;IACvD,SAAS,EAAE,OAAO,CAAC;IACnB,qCAAqC;IACrC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,yBAAyB,CAAC,CAqD1E,CAAC"}
package/dist/taxonomy.js CHANGED
@@ -16,9 +16,19 @@
16
16
  * on-chain contract (Phase 3) enforces the two-side-confirmation
17
17
  * rule independently for non-symmetric types.
18
18
  */
19
- import { RELATIONSHIP_TYPE, ROLE, hashRelationshipType, hashRole } from './constants';
19
+ import { RELATIONSHIP_TYPE, ROLE, hashRelationshipType, hashRole } from './constants.js';
20
20
  export { RELATIONSHIP_TYPE, ROLE, hashRelationshipType, hashRole };
21
21
  export const TYPE_SEMANTICS = Object.freeze({
22
+ [RELATIONSHIP_TYPE.CHARTERED_UNDER]: {
23
+ name: 'CHARTERED_UNDER',
24
+ // Hierarchical in the sense of BELONGING, not of control: a treasury sits under the agent that holds
25
+ // it. Not transitive — a team under a workspace under an organization does not make the team the
26
+ // organization's, and reading it that way would invent a chain nobody asserted.
27
+ hierarchical: true,
28
+ transitive: false,
29
+ symmetric: false,
30
+ description: 'ap:charteredUnder — subject was created under object and belongs to it (a treasury under its holder, a team under its workspace). Never authority: the power to act for the subject is granted elsewhere, never by this edge.',
31
+ },
22
32
  [RELATIONSHIP_TYPE.HAS_MEMBER]: {
23
33
  name: 'HAS_MEMBER',
24
34
  hierarchical: false,
@@ -1 +1 @@
1
- {"version":3,"file":"taxonomy.js","sourceRoot":"","sources":["../src/taxonomy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGtF,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,oBAAoB,EAAE,QAAQ,EAAE,CAAC;AAenE,MAAM,CAAC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AY,EAAE,KAAK;QACnB,UAAU,EAAE,KAAK;QACjB,SAAS,EAAE,KAAK;QAChB,WAAW,EAAE,gFAAgF;KAC9F;IACD,CAAC,iBAAiB,CAAC,UAAU,CAAC,EAAE;QAC9B,IAAI,EAAE,YAAY;QAClB,YAAY,EAAE,KAAK;QACnB,UAAU,EAAE,KAAK;QACjB,SAAS,EAAE,KAAK;QAChB,WAAW,EAAE,uCAAuC;KACrD;CACF,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,17 +1,21 @@
1
1
  {
2
2
  "name": "@agenticprimitives/agent-relationships",
3
- "version": "1.0.0-alpha.4",
3
+ "version": "1.0.0-alpha.40",
4
4
  "description": "Agent relationships SDK: trust-fabric edge store (subject, object, relationshipType) with role taxonomy. Phase 1 ships edge-ID derivation + relationship-type constants + client skeleton; AgentRelationship.sol + RelationshipTypeRegistry.sol ports land in Phase 3. AgentAssertion + AgentRelationshipResolver deferred to v2.",
5
+ "homepage": "https://agenticprimitives.dev",
6
+ "bugs": {
7
+ "url": "https://github.com/agentictrustlabs/agenticprimitives/issues"
8
+ },
9
+ "author": {
10
+ "name": "Agentic Trust Labs",
11
+ "url": "https://agenticprimitives.dev"
12
+ },
5
13
  "license": "MIT",
6
14
  "repository": {
7
15
  "type": "git",
8
16
  "url": "git+https://github.com/agentictrustlabs/agenticprimitives.git",
9
17
  "directory": "packages/agent-relationships"
10
18
  },
11
- "homepage": "https://github.com/agentictrustlabs/agenticprimitives/tree/master/packages/agent-relationships",
12
- "bugs": {
13
- "url": "https://github.com/agentictrustlabs/agenticprimitives/issues"
14
- },
15
19
  "type": "module",
16
20
  "main": "./dist/index.js",
17
21
  "types": "./dist/index.d.ts",
@@ -35,14 +39,14 @@
35
39
  "access": "public"
36
40
  },
37
41
  "peerDependencies": {
38
- "viem": "^2.50.0",
39
- "@agenticprimitives/agent-account": "1.0.0-alpha.4",
40
- "@agenticprimitives/connect-auth": "1.0.0-alpha.4",
41
- "@agenticprimitives/types": "1.0.0-alpha.4"
42
+ "viem": "^2.52.2",
43
+ "@agenticprimitives/agent-account": "^1.0.0-alpha.40",
44
+ "@agenticprimitives/connect-auth": "^1.0.0-alpha.40",
45
+ "@agenticprimitives/types": "^1.0.0-alpha.40"
42
46
  },
43
47
  "devDependencies": {
44
48
  "@types/node": "^22.7.0",
45
- "vitest": "^2.1.0"
49
+ "vitest": "^4.1.11"
46
50
  },
47
51
  "keywords": [
48
52
  "agent",
@@ -50,7 +54,12 @@
50
54
  "trust-fabric",
51
55
  "edges",
52
56
  "roles",
53
- "agentic"
57
+ "agentic",
58
+ "agentic-primitives",
59
+ "agenticprimitives",
60
+ "ai-agents",
61
+ "agent-authority",
62
+ "agentic-trust"
54
63
  ],
55
64
  "scripts": {
56
65
  "build": "tsc -p tsconfig.build.json",