@terminal3/t3n-sdk 4.39.1 → 4.42.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.
package/dist/index.d.ts CHANGED
@@ -1026,6 +1026,25 @@ interface BoundGrant {
1026
1026
  /** Agent edge only: optional validity time-box. */
1027
1027
  window?: Validity;
1028
1028
  }
1029
+ /**
1030
+ * Capability grant in the pre-collapse (`UserGrant`) wire shape — the element
1031
+ * of the legacy `org-policy-set-grants` input and `org-grants-get` output. The
1032
+ * grantee is carried as `user_did` (not `grantee`), and there is no
1033
+ * `contract_id` on the element (the enclosing {@link OrgContractGrants} carries
1034
+ * it) nor any agent-edge qualifiers.
1035
+ *
1036
+ * @deprecated Use {@link BoundGrant}. Retained so consumers on the legacy
1037
+ * org-grant vocabulary keep compiling and decoding while the contract still
1038
+ * emits this shape during the delegation-vocabulary deprecation window.
1039
+ */
1040
+ interface UserGrant {
1041
+ /** The user this grant applies to (`did:t3n:<40-hex>`). */
1042
+ user_did: string;
1043
+ /** WIT function names the user may invoke (e.g. `"set-records"`). */
1044
+ functions: string[];
1045
+ /** Data scope paths the user may access (e.g. `"example/records"`). */
1046
+ scopes: string[];
1047
+ }
1029
1048
  /**
1030
1049
  * Policy record for an organisation's data tier.
1031
1050
  *
@@ -1143,6 +1162,29 @@ interface OrgContractDelegation {
1143
1162
  * here would create maintenance churn against benign field additions.
1144
1163
  */
1145
1164
  declare function isOrgContractDelegation(value: unknown): value is OrgContractDelegation;
1165
+ /**
1166
+ * Response type alias for the legacy `org-grants-get`.
1167
+ *
1168
+ * Same envelope as {@link OrgContractDelegation} (`contract_id` + a grant
1169
+ * list), but each grant is the legacy {@link UserGrant} shape (`user_did`
1170
+ * rather than `grantee`), matching what the contract emits during the
1171
+ * deprecation window.
1172
+ *
1173
+ * @deprecated Use {@link OrgContractDelegation}.
1174
+ */
1175
+ interface OrgContractGrants {
1176
+ contract_id: string;
1177
+ grants: UserGrant[];
1178
+ }
1179
+ /**
1180
+ * Shallow runtime guard for {@link OrgContractGrants}. Validates the immediate
1181
+ * envelope (`contract_id: string`, `grants: array`) only — the same structural
1182
+ * check as {@link isOrgContractDelegation}, since the two responses share an
1183
+ * envelope and differ only in the grant element shape.
1184
+ *
1185
+ * @deprecated Use {@link isOrgContractDelegation}.
1186
+ */
1187
+ declare function isOrgContractGrants(value: unknown): value is OrgContractGrants;
1146
1188
  /**
1147
1189
  * One grant inside a role: a capability body (functions + scopes, without the
1148
1190
  * grantee, which is bound at assignment time) plus the target contract.
@@ -1482,6 +1524,153 @@ declare function mergeGrants(existing: BoundGrant[], additions: BoundGrant[]): G
1482
1524
  */
1483
1525
  declare function mergeDiscoverDids(existing: string[], additions: string[]): string[];
1484
1526
 
1527
+ /**
1528
+ * Agent-auth grants — the pre-collapse (camelCase) delegation surface, retained
1529
+ * as a deprecated compatibility layer alongside the flat, snake_case
1530
+ * {@link MemberDelegationDoc} surface in `./member-delegation`.
1531
+ *
1532
+ * `AGENT_AUTH_MAP` is keyed by the *user* DID — one policy document per user,
1533
+ * global across orgs, with at most one entry per agent DID. Reads
1534
+ * (`agent-auth-get`) and writes (`agent-auth-update`) on
1535
+ * `tee:authorisations/contracts` (the policy's owning contract) are
1536
+ * **SelfOnly**: only the user, authenticated as themselves, may read or write
1537
+ * their own grants.
1538
+ *
1539
+ * The write shape carries `scopes` + a validity window: the agent's delegated
1540
+ * org-data scopes, and an optional `[valid_from_secs, valid_until_secs]`
1541
+ * window. The ≤ cap *length* check is enforced contract-side at write time; the
1542
+ * expiry gate is host-side at read time.
1543
+ *
1544
+ * The merge below is a script-level union: writing a grant for one
1545
+ * `(agent_did, script_name)` preserves every other script row on that agent's
1546
+ * entry, and every other agent's entry, unchanged.
1547
+ *
1548
+ * @deprecated Use `./member-delegation` (`MemberDelegationDoc`,
1549
+ * `parseMemberDelegationDoc`, `mergeGrants`) and the `*MemberDelegation*`
1550
+ * client methods. This module maps onto the legacy `agent-auth-*` wire the
1551
+ * contract still accepts during the delegation-vocabulary deprecation window.
1552
+ */
1553
+
1554
+ /**
1555
+ * A single script grant in the camelCase write-request shape.
1556
+ *
1557
+ * @deprecated Use `BoundGrant` from `../org-data/types`.
1558
+ */
1559
+ interface AgentAuthScriptGrant {
1560
+ /** Contract name, or `"*"`. */
1561
+ scriptName: string;
1562
+ /** Optional semver requirement; `null` to match any version. */
1563
+ versionReq?: string | null;
1564
+ /** Functions the agent may invoke on this contract. */
1565
+ functions: string[];
1566
+ /** Org-data scopes delegated to the agent for the contract functions to
1567
+ * read on its behalf. */
1568
+ scopes?: string[];
1569
+ /** Direct-read scopes the agent may enumerate itself, via whichever read
1570
+ * function the contract exposes for direct enumeration. A strict subset of
1571
+ * `scopes` (enforced contract-side). */
1572
+ readScopes?: string[];
1573
+ /** Optional validity-window start (unix seconds). */
1574
+ validFromSecs?: number | null;
1575
+ /** Optional validity-window end (unix seconds). */
1576
+ validUntilSecs?: number | null;
1577
+ /** Egress hosts the agent may reach for this contract. */
1578
+ allowedHosts: string[];
1579
+ }
1580
+ /**
1581
+ * One agent's entry in the write-request shape.
1582
+ *
1583
+ * @deprecated Use the flat `BoundGrant` list on `MemberDelegationDoc`.
1584
+ */
1585
+ interface AgentAuthEntry {
1586
+ agentDid: string;
1587
+ scripts: AgentAuthScriptGrant[];
1588
+ }
1589
+ /**
1590
+ * The full agent-auth policy document in the camelCase write shape:
1591
+ * the per-agent grants plus the document-level discovery grants.
1592
+ *
1593
+ * `discoverDids` (contract wire: `discover_dids`) is the list of DIDs the user
1594
+ * lets their registered agents *enumerate the contracts of* via
1595
+ * `listContracts`: an org DID grants org-mode discovery, the user's own DID
1596
+ * grants self-mode discovery. It lives at document level — not on a script
1597
+ * grant — because discovery must surface contracts the agent cannot yet call.
1598
+ * The node's discovery gate additionally requires the calling agent to be named
1599
+ * in `agents` (subject binding), so an unregistered agent discovers nothing
1600
+ * regardless of this list.
1601
+ *
1602
+ * @deprecated Use {@link MemberDelegationDoc}.
1603
+ */
1604
+ interface AgentAuthPolicy {
1605
+ agents: AgentAuthEntry[];
1606
+ discoverDids: string[];
1607
+ }
1608
+ /**
1609
+ * Parse a full `agent-auth-get` response (the stored snake_case policy
1610
+ * document) into the camelCase write shape, including the document-level
1611
+ * `discover_dids`. A `null` / absent response is the empty policy.
1612
+ *
1613
+ * @deprecated Use `parseMemberDelegationDoc`.
1614
+ */
1615
+ declare function parseAgentAuthPolicy(response: unknown): AgentAuthPolicy;
1616
+ /**
1617
+ * Extract the `agents` array from an `agent-auth-get` response.
1618
+ *
1619
+ * @deprecated Read `MemberDelegationDoc.grants` instead.
1620
+ */
1621
+ declare function parseAgentAuthGet(response: unknown): AgentAuthEntry[];
1622
+ /** @deprecated Use `GrantsMergeResult` from `./member-delegation`. */
1623
+ interface AgentAuthMergeResult {
1624
+ /** Full merged `agents` list, ready for `agent-auth-update`. */
1625
+ agents: AgentAuthEntry[];
1626
+ /** `"<agentDid> → <scriptName>"` rows preserved from the existing policy. */
1627
+ preservedRows: string[];
1628
+ }
1629
+ /**
1630
+ * Input to the full-document write {@link T3nClient.agentAuthUpdate}. The
1631
+ * document IS the new state: an empty `agents` list revokes all agent access,
1632
+ * and an omitted / empty `discoverDids` persists an empty discovery-grant list
1633
+ * (the contract has no per-field merge). Mirrors the contract `AgentAuthPolicy`.
1634
+ *
1635
+ * @deprecated Use {@link MemberDelegationDoc}.
1636
+ */
1637
+ interface AgentAuthUpdateInput {
1638
+ agents: AgentAuthEntry[];
1639
+ /** Document-level discovery grants — see {@link AgentAuthPolicy}. */
1640
+ discoverDids?: string[];
1641
+ }
1642
+ /**
1643
+ * Serialise a camelCase policy document to the contract's canonical snake_case
1644
+ * `agent-auth-update` wire (`agent_did` / `script_name` / `version_req` /
1645
+ * `read_scopes` / `valid_from_secs` / `valid_until_secs` / `allowed_hosts` /
1646
+ * `discover_dids`). Absent optionals are omitted (never sent as `null`); empty
1647
+ * `scopes` / `read_scopes` are omitted (the contract defaults both to empty).
1648
+ * `functions` and `allowed_hosts` are always emitted — the contract requires
1649
+ * explicit functions (`["*"]` = all) and reads an absent `allowed_hosts` as
1650
+ * deny-all egress. The document-level `discover_dids` is emitted only when
1651
+ * non-empty; the contract defaults an absent list to empty.
1652
+ *
1653
+ * @deprecated The new write path passes `MemberDelegationDoc` straight through
1654
+ * with no casing transform.
1655
+ */
1656
+ declare function toAgentAuthUpdateWire(agents: AgentAuthEntry[], discoverDids?: string[]): {
1657
+ agents: Array<{
1658
+ agent_did: string;
1659
+ scripts: Array<Record<string, unknown>>;
1660
+ }>;
1661
+ discover_dids?: string[];
1662
+ };
1663
+ /**
1664
+ * Merge new agent entries into the existing policy with script-level union
1665
+ * semantics: for an agent DID present on both sides, script rows whose
1666
+ * `scriptName` is not being written are preserved; rows with a matching
1667
+ * `scriptName` are replaced by the new grant. Entries for other agent DIDs
1668
+ * pass through unchanged.
1669
+ *
1670
+ * @deprecated Use `mergeGrants` from `./member-delegation`.
1671
+ */
1672
+ declare function mergeAgentAuthEntries(existing: AgentAuthEntry[], newEntries: AgentAuthEntry[]): AgentAuthMergeResult;
1673
+
1485
1674
  /**
1486
1675
  * KYC types for the `tee:user/contracts::kyc-status` short-poll
1487
1676
  * function.
@@ -2133,7 +2322,20 @@ interface ActivityReport {
2133
2322
  */
2134
2323
  next_seq: number | null;
2135
2324
  }
2136
- /** Params for one activity-report page. All optional; `{}` is valid. */
2325
+ /**
2326
+ * Params for one activity-report page. All optional; `{}` is valid.
2327
+ *
2328
+ * The row filters (`caller_type`, `outcome`, `did`, `contract`, `function`)
2329
+ * are AND-ed and applied node-side before the page is filled, so `limit` keeps
2330
+ * counting *matching* rows and the cursor keeps its meaning — page a filtered
2331
+ * report exactly as an unfiltered one, resending the same filters with every
2332
+ * `before_seq`. They narrow what comes back, not what the node scans, so short
2333
+ * and empty pages with a live `next_seq` are the normal case under a selective
2334
+ * filter.
2335
+ *
2336
+ * A field the node does not recognise is rejected (400) rather than ignored,
2337
+ * so a filter never silently widens a query back to the whole organisation.
2338
+ */
2137
2339
  interface GetActivityLogOptions {
2138
2340
  /** Window start, Unix ms, inclusive. Defaults to 0 (no lower bound). */
2139
2341
  from_ms?: number;
@@ -2152,6 +2354,31 @@ interface GetActivityLogOptions {
2152
2354
  * the node's own scan cap can trip first. See {@link ActivityReport.next_seq}.
2153
2355
  */
2154
2356
  limit?: number;
2357
+ /** Keep only calls made by an agent, or only those made by a human. */
2358
+ caller_type?: ActivityCallerType;
2359
+ /** Keep only calls that ended in this outcome. */
2360
+ outcome?: ActivityOutcome;
2361
+ /**
2362
+ * Keep only calls this DID took part in — as the {@link ActivityEntry.actor}
2363
+ * that ran them, or as the {@link ActivityEntry.on_behalf_of} owner they ran
2364
+ * for. Both sides match: "what did this agent do" and "what was done in my
2365
+ * name" are the same question from the two ends of one delegation.
2366
+ *
2367
+ * One whole `did:t3n:<40-hex>`. A partial DID is rejected rather than widened
2368
+ * into a prefix search, so a search box should send this only once it holds a
2369
+ * complete DID.
2370
+ */
2371
+ did?: string;
2372
+ /**
2373
+ * Keep only calls whose {@link ActivityEntry.contract} contains this
2374
+ * substring, compared case-insensitively. Must not be empty.
2375
+ */
2376
+ contract?: string;
2377
+ /**
2378
+ * Keep only calls whose {@link ActivityEntry.function} contains this
2379
+ * substring, compared case-insensitively. Must not be empty.
2380
+ */
2381
+ function?: string;
2155
2382
  }
2156
2383
 
2157
2384
  /**
@@ -2207,7 +2434,11 @@ interface ListContractsResult {
2207
2434
  contracts: ListedContract[];
2208
2435
  next_offset: number | null;
2209
2436
  }
2210
- /** Which standing grant a satisfied/missing entry refers to. */
2437
+ /**
2438
+ * Which standing grant a satisfied/missing entry refers to — the stable,
2439
+ * caller-facing values. Reads are normalised to these two, so switch logic on
2440
+ * them stays exhaustive.
2441
+ */
2211
2442
  type DelegationGrantKind = "member_delegation" | "org_delegation";
2212
2443
  /** Params for `delegation.check` (the generic capability read). */
2213
2444
  interface GrantCheckParams {
@@ -2623,6 +2854,22 @@ declare class T3nClient {
2623
2854
  * cursor = page.next_seq ?? undefined;
2624
2855
  * } while (cursor !== undefined);
2625
2856
  * ```
2857
+ *
2858
+ * The optional row filters — `caller_type`, `outcome`, `did`, `contract`,
2859
+ * `function` — are AND-ed node-side and applied before the page is filled, so
2860
+ * they compose freely with each other and with the cursor. Resend the same
2861
+ * filters with every page; changing them mid-walk changes what the cursor
2862
+ * means. Because a filter narrows what comes back rather than what the node
2863
+ * scans, short and empty pages are the normal case — page until `next_seq` is
2864
+ * `null`.
2865
+ *
2866
+ * ```ts
2867
+ * // Everything one agent did, or had done in its name, that was refused.
2868
+ * const denied = await client.getActivityLog({
2869
+ * did: "did:t3n:8a2fbc8a2fbc8a2fbc8a2fbc8a2fbc8a2fbc8a2f",
2870
+ * outcome: "denied",
2871
+ * });
2872
+ * ```
2626
2873
  */
2627
2874
  getActivityLog(opts?: GetActivityLogOptions): Promise<ActivityReport>;
2628
2875
  /**
@@ -3196,6 +3443,68 @@ declare class T3nClient {
3196
3443
  * too many delegatees/grants).
3197
3444
  */
3198
3445
  memberDelegationUpdate(input: MemberDelegationDoc): Promise<void>;
3446
+ /**
3447
+ * Revoke the caller's own agent delegations scoped to one org (detach-cascade
3448
+ * `agent_auth` half). Dispatches `agent-auth-revoke-org` on
3449
+ * `tee:user/contracts` (**SelfOnly**): every grant targeting a `z:<orgTid>:*`
3450
+ * contract is removed from the caller's own delegation document.
3451
+ *
3452
+ * @param orgTid - the org's z-space tenant id (`did:t3n:<hex>` or bare
3453
+ * 40-hex) — i.e. the `<tid>` in the org's `z:<tid>:…` contract names
3454
+ * @deprecated Use {@link T3nClient.revokeMemberDelegationForOrg}.
3455
+ */
3456
+ revokeAgentAuthForOrg(orgTid: string): Promise<void>;
3457
+ /**
3458
+ * Read the authenticated user's own agent-auth policy — the standing grants
3459
+ * delegated to agents — in the legacy camelCase shape. Dispatches
3460
+ * `agent-auth-get` on `tee:authorisations/contracts` (**SelfOnly**), so this
3461
+ * always returns the caller's own policy document.
3462
+ *
3463
+ * @returns the full policy document normalised to the camelCase write shape:
3464
+ * the per-agent `agents` entries plus the document-level `discoverDids`
3465
+ * discovery grants
3466
+ * @throws if the session is not authenticated, or the contract refuses
3467
+ * @deprecated Use {@link T3nClient.getMemberDelegation}.
3468
+ */
3469
+ getAgentAuth(): Promise<AgentAuthPolicy>;
3470
+ /**
3471
+ * Authorise an agent for one contract on the caller's own behalf, in the
3472
+ * legacy camelCase shape. Read-merge-writes the caller's policy document via
3473
+ * `agent-auth-update` (**SelfOnly**) with script-level union semantics, so
3474
+ * other contracts' grants for this or any agent survive untouched.
3475
+ *
3476
+ * @param agentDid - the agent DID being authorised
3477
+ * @param grant - the single script grant to set (contract, functions,
3478
+ * scopes, validity, egress hosts)
3479
+ * @param options - optional `discoverDids` to union into the document's
3480
+ * discovery grants
3481
+ * @returns the script rows preserved from the existing policy (audit aid)
3482
+ * @throws if the session is not authenticated, or the contract refuses
3483
+ * @deprecated Use {@link T3nClient.updateMemberDelegation} (note it drops the
3484
+ * leading `agentDid` argument — the `grantee` lives on the grant).
3485
+ */
3486
+ updateAgentAuth(agentDid: string, grant: AgentAuthScriptGrant, options?: {
3487
+ discoverDids?: string[];
3488
+ }): Promise<{
3489
+ preservedRows: string[];
3490
+ }>;
3491
+ /**
3492
+ * Replace this user's agent-authorisation policy in the legacy camelCase
3493
+ * shape (`tee:authorisations/contracts` → `agent-auth-update`). The supplied
3494
+ * document IS the new state: an empty `agents` array revokes all agent
3495
+ * access, and an omitted `discoverDids` persists an empty discovery-grant
3496
+ * list. Use {@link T3nClient.updateAgentAuth} for the single-grant
3497
+ * read-merge-write.
3498
+ *
3499
+ * The SDK emits the canonical snake_case wire via {@link toAgentAuthUpdateWire}
3500
+ * (carrying `scopes` / `read_scopes` / validity alongside `functions` /
3501
+ * `allowed_hosts`, plus the document-level `discover_dids`).
3502
+ *
3503
+ * @throws {RpcError} if the contract rejects the policy (validation failure,
3504
+ * too many agents/grants).
3505
+ * @deprecated Use {@link T3nClient.memberDelegationUpdate}.
3506
+ */
3507
+ agentAuthUpdate(input: AgentAuthUpdateInput): Promise<void>;
3199
3508
  /**
3200
3509
  * Convenience helper: run the explicit OTP roundtrip and submit
3201
3510
  * the slim user-upsert in one call.
@@ -3789,6 +4098,26 @@ interface OrgDelegationDeleteInput {
3789
4098
  orgDid: string;
3790
4099
  contractId: string;
3791
4100
  }
4101
+ /**
4102
+ * Legacy input for {@link OrgDataClient.setGrants}. Carries the full
4103
+ * {@link UserGrant} list verbatim (grantee as `user_did`).
4104
+ *
4105
+ * @deprecated Use {@link OrgDelegationSetInput}.
4106
+ */
4107
+ interface SetGrantsInput {
4108
+ orgDid: string;
4109
+ contractId: string;
4110
+ grants: UserGrant[];
4111
+ }
4112
+ /**
4113
+ * Legacy input for {@link OrgDataClient.deleteGrants}.
4114
+ *
4115
+ * @deprecated Use {@link OrgDelegationDeleteInput}.
4116
+ */
4117
+ interface DeleteGrantsInput {
4118
+ orgDid: string;
4119
+ contractId: string;
4120
+ }
3792
4121
  /**
3793
4122
  * Grant or replace the outbound host allow-list an org-owned agent may use
3794
4123
  * while executing one of the org's contracts (org-admin only).
@@ -3933,6 +4262,16 @@ interface OrgRemoveMemberDelegationInput {
3933
4262
  /** DID (`did:t3n:<40-hex>` or bare hex) to drop from every grant list. */
3934
4263
  memberDid: string;
3935
4264
  }
4265
+ /**
4266
+ * Legacy input for {@link OrgDataClient.removeMemberGrants}.
4267
+ *
4268
+ * @deprecated Use {@link OrgRemoveMemberDelegationInput}.
4269
+ */
4270
+ interface RemoveMemberGrantsInput {
4271
+ orgDid: string;
4272
+ /** DID (`did:t3n:<40-hex>` or bare hex) to drop from every grant list. */
4273
+ memberDid: string;
4274
+ }
3936
4275
  interface PolicyGetInput {
3937
4276
  orgDid: string;
3938
4277
  }
@@ -3944,6 +4283,15 @@ interface OrgDelegationGetInput {
3944
4283
  orgDid: string;
3945
4284
  contractId: string;
3946
4285
  }
4286
+ /**
4287
+ * Legacy input for {@link OrgDataClient.grantsGet}.
4288
+ *
4289
+ * @deprecated Use {@link OrgDelegationGetInput}.
4290
+ */
4291
+ interface GrantsGetInput {
4292
+ orgDid: string;
4293
+ contractId: string;
4294
+ }
3947
4295
  interface DataListInput {
3948
4296
  orgDid: string;
3949
4297
  scope: string;
@@ -4086,6 +4434,22 @@ declare class OrgDataClient {
4086
4434
  * Delete the grant entry for a contract entirely.
4087
4435
  */
4088
4436
  deleteDelegation(input: OrgDelegationDeleteInput): Promise<MutationResponse>;
4437
+ /**
4438
+ * Full replacement of the user-grant list for a contract, in the legacy
4439
+ * `UserGrant` wire shape (grantee as `user_did`). Passing an empty list
4440
+ * removes the entry. Dispatches the legacy `org-policy-set-grants` function
4441
+ * the contract still accepts during the deprecation window.
4442
+ *
4443
+ * @deprecated Use {@link OrgDataClient.setDelegation}.
4444
+ */
4445
+ setGrants(input: SetGrantsInput): Promise<MutationResponse>;
4446
+ /**
4447
+ * Delete the grant entry for a contract entirely, via the legacy
4448
+ * `org-policy-delete-grants` function.
4449
+ *
4450
+ * @deprecated Use {@link OrgDataClient.deleteDelegation}.
4451
+ */
4452
+ deleteGrants(input: DeleteGrantsInput): Promise<MutationResponse>;
4089
4453
  /**
4090
4454
  * Grant or replace the outbound host allow-list an org-owned agent may use
4091
4455
  * while executing one of the org's contracts (org-admin only).
@@ -4182,6 +4546,13 @@ declare class OrgDataClient {
4182
4546
  * `deleted_entries` reports how many contract grant lists were rewritten.
4183
4547
  */
4184
4548
  removeMemberDelegation(input: OrgRemoveMemberDelegationInput): Promise<MutationResponse>;
4549
+ /**
4550
+ * Detach-cascade grant sweep via the legacy `org-remove-member-grants`
4551
+ * function.
4552
+ *
4553
+ * @deprecated Use {@link OrgDataClient.removeMemberDelegation}.
4554
+ */
4555
+ removeMemberGrants(input: RemoveMemberGrantsInput): Promise<MutationResponse>;
4185
4556
  /** Read the policy metadata for an org (admin-only). */
4186
4557
  policyGet(input: PolicyGetInput): Promise<OrgPolicyMeta>;
4187
4558
  /**
@@ -4209,6 +4580,13 @@ declare class OrgDataClient {
4209
4580
  writersGet(input: WritersGetInput): Promise<OrgWriters>;
4210
4581
  /** Read the grant list for a contract (admin-only). */
4211
4582
  getDelegation(input: OrgDelegationGetInput): Promise<OrgContractDelegation>;
4583
+ /**
4584
+ * Read the grant list for a contract (admin-only) in the legacy `UserGrant`
4585
+ * wire shape, via the legacy `org-grants-get` function.
4586
+ *
4587
+ * @deprecated Use {@link OrgDataClient.getDelegation}.
4588
+ */
4589
+ grantsGet(input: GrantsGetInput): Promise<OrgContractGrants>;
4212
4590
  /**
4213
4591
  * List entry IDs for a scope (admin-only), paginated.
4214
4592
  *
@@ -4307,6 +4685,18 @@ declare class SessionOrgDataClient {
4307
4685
  setDelegation(input: OrgDelegationSetInput): Promise<MutationResponse>;
4308
4686
  /** Mirrors {@link OrgDataClient.deleteDelegation}. */
4309
4687
  deleteDelegation(input: OrgDelegationDeleteInput): Promise<MutationResponse>;
4688
+ /**
4689
+ * Mirrors {@link OrgDataClient.setGrants}.
4690
+ *
4691
+ * @deprecated Use {@link SessionOrgDataClient.setDelegation}.
4692
+ */
4693
+ setGrants(input: SetGrantsInput): Promise<MutationResponse>;
4694
+ /**
4695
+ * Mirrors {@link OrgDataClient.deleteGrants}.
4696
+ *
4697
+ * @deprecated Use {@link SessionOrgDataClient.deleteDelegation}.
4698
+ */
4699
+ deleteGrants(input: DeleteGrantsInput): Promise<MutationResponse>;
4310
4700
  /**
4311
4701
  * Grant or replace the outbound host allow-list an org-owned agent may use
4312
4702
  * while executing one of the org's contracts (org-admin only).
@@ -4357,6 +4747,12 @@ declare class SessionOrgDataClient {
4357
4747
  purgeOrg(input: PurgeOrgInput): Promise<MutationResponse>;
4358
4748
  /** Mirrors {@link OrgDataClient.removeMemberDelegation}. */
4359
4749
  removeMemberDelegation(input: OrgRemoveMemberDelegationInput): Promise<MutationResponse>;
4750
+ /**
4751
+ * Mirrors {@link OrgDataClient.removeMemberGrants}.
4752
+ *
4753
+ * @deprecated Use {@link SessionOrgDataClient.removeMemberDelegation}.
4754
+ */
4755
+ removeMemberGrants(input: RemoveMemberGrantsInput): Promise<MutationResponse>;
4360
4756
  /** Mirrors {@link OrgDataClient.policyGet}. */
4361
4757
  policyGet(input: PolicyGetInput): Promise<OrgPolicyMeta>;
4362
4758
  /** Mirrors {@link OrgDataClient.policyView}. */
@@ -4367,6 +4763,12 @@ declare class SessionOrgDataClient {
4367
4763
  writersGet(input: WritersGetInput): Promise<OrgWriters>;
4368
4764
  /** Mirrors {@link OrgDataClient.getDelegation}. */
4369
4765
  getDelegation(input: OrgDelegationGetInput): Promise<OrgContractDelegation>;
4766
+ /**
4767
+ * Mirrors {@link OrgDataClient.grantsGet}.
4768
+ *
4769
+ * @deprecated Use {@link SessionOrgDataClient.getDelegation}.
4770
+ */
4771
+ grantsGet(input: GrantsGetInput): Promise<OrgContractGrants>;
4370
4772
  /** Mirrors {@link OrgDataClient.dataList}. */
4371
4773
  dataList(input: DataListInput): Promise<DataListResponse>;
4372
4774
  /** Mirrors {@link OrgDataClient.dataGet}. */
@@ -5411,5 +5813,5 @@ declare function tenantDidHex(tenantDid: string): string;
5411
5813
  declare function validateTail(tail: string): string;
5412
5814
  declare function canonicalTenantName(tenantDid: string, tail: string): string;
5413
5815
 
5414
- export { AGENT_CARDS_SCOPE, AuthMethod, AuthenticationError, BASE_UNITS_PER_TOKEN, ContractResponseError, DEFAULT_ENVIRONMENT, DEFAULT_INDIVIDUAL_THRESHOLD_CENTS, DEFAULT_KYC_POLL_CADENCE, HandshakeError, HttpTransport, InvokeError, KycStatusTimeoutError, LogLevel, MockTransport, NODE_URLS, OrgDataClient, OtpRateLimitedError, RpcError, SessionExpiredError, SessionOrgDataClient, SessionStateError, SessionStatus, SessionUsageReportClient, T3nClient, T3nConfigError, T3nError, TERMINAL_KYC_STATUSES, TOKEN_DECIMALS, TenantClient, TenantContractsNamespace, TenantMapsNamespace, TenantNamespace, TenantSdkValidationError, TenantTokenNamespace, UnsupportedTenantSdkOperationError, UserUpsertError, WasmError, WireEncodingError, Z_PAYROLL_AUDIT_READ_FUNCTIONS, Z_PAYROLL_RUN_FUNCTIONS, _b64uEncode, assertShape, b64uDecodeStrict, b64uEncodeBytes, buildSecretWriteArgs, bytesToString, canonicalTenantName, clearKeyCache, clearManifestVersionFloor, compactDidFromBytes, createDefaultHandlers, createEmailOtpAuthInput, createEthAuthInput, createLogger, createMlKemPublicKeyHandler, createOidcAuthInput, createOrgDataClientFromSession, createRandomHandler, createUsageReportClientFromSession, createWorkloadAuthInput, decodeWasmErrorMessage, deriveAgentCardEntryId, discoverCheckDelegation, discoverDescribeContract, discoverDescribeFunction, discoverListContracts, discoverWhoami, eth_get_address, extractWasmError, fetchDkgAttestation, fetchMlKemPublicKey, fetchTrustedManifest, formatTokens, generateRandomString, generateUUID, getContractVersion, getEnvironment, getEnvironmentName, getGlobalLogLevel, getLogger, getNodeUrl, invoke, isAgentCardResponse, isAgentEgressGetResponse, isDataGetResponse, isDataListResponse, isListAgentsResponse, isListHumanMembersResponse, isMutationResponse, isObject, isOrgAdminStatus, isOrgContractDelegation, isOrgPolicyMeta, isOrgPolicyView, isOrgUsageReport, isOrgWriters, isRoleAssignmentsResponse, isRoleGetResponse, isSecretListResponse, isSecretRecord, isSecretView, isUnsafeTrustServer, loadConfig, loadWasmComponent, manifestToTrustAnchor, maskKeyMaterial, mergeDiscoverDids, mergeGrants, metamask_get_address, metamask_sign, parseContractResponse, parseMemberDelegationDoc, redactSecrets, redactSecretsFromJson, requestToWire, setEnvironment, setGlobalLogLevel, setNodeUrl, stringToBytes, tenantDidHex, toBaseUnits, validateConfig, validateTail, verifyDkgAttestation, verifyManifestSignature, verifyTdxQuote };
5415
- export type { ActivityCallerType, ActivityEntry, ActivityOutcome, ActivityReport, AdmitForOrgOptions, AgentCardRefInput, AgentCardResponse, AgentCardSetInput, AgentEgressEntry, AgentEgressGetResponse, AgentEgressRefInput, AgentSummary, AssignRolesInput, AuthInput, BalanceRow, BoundGrant, ChargeReason, ClientAuth, ClientHandshake, ConfigValidationResult, ContractDescriptorDocument, ContractDescriptorFacets, ContractExecuteInput, ContractKind, ContractLifecycleStatus, ContractListDetailedOptions, ContractListDetailedPage, ContractPublishInput, ContractRegisterResult, ContractResponseSchema, ContractSetDescriptorInput, CreatePolicyInput, DataGetInput, DataGetResponse, DataListInput, DataListResponse, DelegationGrantKind, DelegationGrantRef, DeleteDataInput, DeleteScopeInput, DescribeContractParams, DescribeContractResult, DescribeFunctionParams, DescribeFunctionResult, DetailedContract, Did, Direction, DiscoverOptions, DkgAttestation, DkgVerifyResult, EmailOtpAuthInput, EmailOtpCredentials, Environment, EthAuthInput, ExecuteBusinessContractOptions, ExecuteOrgDataActionOptions, FetchTrustedManifestOptions, FunctionDescriptorEntry, GetActivityLogOptions, GetUsageOptions, GrantCheckParams, GrantCheckResult, GranteeInput, GrantsMergeResult, GuestToHostHandler, GuestToHostHandlers, HandshakeResult, HumanMember, InvokeOptions, InvokeRequest, JsonRpcRequest, JsonRpcResponse, KycPollCadence, KycPollOptions, KycStatus, KycStatusKind, ListAgentsInput, ListAgentsResponse, ListContractsParams, ListContractsResult, ListContractsScope, ListHumanMembersInput, ListHumanMembersResponse, ListedContract, Logger, MapCreateInput, MapLifecycleStatus, MapResponse, MapUpdateInput, MapVisibility, MemberDelegationDoc, MemberRole, MutationResponse, OidcAuthInput, OidcCredentials, OrgAdminStatus, OrgContractDelegation, OrgDataActionWire, OrgDataClientOptions, OrgDelegationDeleteInput, OrgDelegationGetInput, OrgDelegationSetInput, OrgPolicyMeta, OrgPolicyView, OrgRemoveMemberDelegationInput, OrgUsageReport, OrgUsageReportInput, OrgWriters, OtpChannel, OtpMergeSuggestion, OtpRequestInput, OtpRequestResult, OtpVerifyInput, OtpVerifyResult, PayrollRunRequest, PeerQuoteResult, PolicyGetInput, PurgeOrgInput, QuoteVerifyResult, ReaderSet, RoleAssignments, RoleAssignmentsResponse, RoleDefinition, RoleGetResponse, RoleGrant, RoleIdInput, SdkConfig, SecretKind, SecretListInput, SecretListResponse, SecretNameInput, SecretRecord, SecretSetValueInput, SecretView, SecretWriteInput, SessionCrypto, SessionId, SetAgentEgressInput, SetRoleInput, SetWritersInput, SignedTrustManifest, StringEncoding, SubmitUserInputArgs, SubmitUserInputResult, T3nClientConfig, TenantAdmitProjection, TenantAdmitStatus, TenantBaseClient, TenantClientConfig, TenantContractExecuteInput, TenantContractPublishInput, TenantContractSetDescriptorInput, TenantExecutionSession, TenantMapCreateInput, TenantMapUpdatePatch, TenantMeResponse, TenantSdkEnvironment, TenantSelfAdmitResult, TenantStatus, TenantTargetOptions, TokenTxKind, Transport, TrustAnchor, TrustAnchorOrUnsafe, TrustAnchorSource, TrustManifestPayload, UnassignRolesInput, UnsafeTrustServer, UpdateMetaInput, UsageEntry, UsagePage, UsageReportSignature, UserInputProfile, UserUpsertErrorKind, Validity, WasmComponent, WasmNextResult, WhoamiResult, WireBlock, WorkloadAuthInput, WriteDataInput, WriterSet, WritersGetInput };
5816
+ export { AGENT_CARDS_SCOPE, AuthMethod, AuthenticationError, BASE_UNITS_PER_TOKEN, ContractResponseError, DEFAULT_ENVIRONMENT, DEFAULT_INDIVIDUAL_THRESHOLD_CENTS, DEFAULT_KYC_POLL_CADENCE, HandshakeError, HttpTransport, InvokeError, KycStatusTimeoutError, LogLevel, MockTransport, NODE_URLS, OrgDataClient, OtpRateLimitedError, RpcError, SessionExpiredError, SessionOrgDataClient, SessionStateError, SessionStatus, SessionUsageReportClient, T3nClient, T3nConfigError, T3nError, TERMINAL_KYC_STATUSES, TOKEN_DECIMALS, TenantClient, TenantContractsNamespace, TenantMapsNamespace, TenantNamespace, TenantSdkValidationError, TenantTokenNamespace, UnsupportedTenantSdkOperationError, UserUpsertError, WasmError, WireEncodingError, Z_PAYROLL_AUDIT_READ_FUNCTIONS, Z_PAYROLL_RUN_FUNCTIONS, _b64uEncode, assertShape, b64uDecodeStrict, b64uEncodeBytes, buildSecretWriteArgs, bytesToString, canonicalTenantName, clearKeyCache, clearManifestVersionFloor, compactDidFromBytes, createDefaultHandlers, createEmailOtpAuthInput, createEthAuthInput, createLogger, createMlKemPublicKeyHandler, createOidcAuthInput, createOrgDataClientFromSession, createRandomHandler, createUsageReportClientFromSession, createWorkloadAuthInput, decodeWasmErrorMessage, deriveAgentCardEntryId, discoverCheckDelegation, discoverDescribeContract, discoverDescribeFunction, discoverListContracts, discoverWhoami, eth_get_address, extractWasmError, fetchDkgAttestation, fetchMlKemPublicKey, fetchTrustedManifest, formatTokens, generateRandomString, generateUUID, getContractVersion, getEnvironment, getEnvironmentName, getGlobalLogLevel, getLogger, getNodeUrl, invoke, isAgentCardResponse, isAgentEgressGetResponse, isDataGetResponse, isDataListResponse, isListAgentsResponse, isListHumanMembersResponse, isMutationResponse, isObject, isOrgAdminStatus, isOrgContractDelegation, isOrgContractGrants, isOrgPolicyMeta, isOrgPolicyView, isOrgUsageReport, isOrgWriters, isRoleAssignmentsResponse, isRoleGetResponse, isSecretListResponse, isSecretRecord, isSecretView, isUnsafeTrustServer, loadConfig, loadWasmComponent, manifestToTrustAnchor, maskKeyMaterial, mergeAgentAuthEntries, mergeDiscoverDids, mergeGrants, metamask_get_address, metamask_sign, parseAgentAuthGet, parseAgentAuthPolicy, parseContractResponse, parseMemberDelegationDoc, redactSecrets, redactSecretsFromJson, requestToWire, setEnvironment, setGlobalLogLevel, setNodeUrl, stringToBytes, tenantDidHex, toAgentAuthUpdateWire, toBaseUnits, validateConfig, validateTail, verifyDkgAttestation, verifyManifestSignature, verifyTdxQuote };
5817
+ export type { ActivityCallerType, ActivityEntry, ActivityOutcome, ActivityReport, AdmitForOrgOptions, AgentAuthEntry, AgentAuthMergeResult, AgentAuthPolicy, AgentAuthScriptGrant, AgentAuthUpdateInput, AgentCardRefInput, AgentCardResponse, AgentCardSetInput, AgentEgressEntry, AgentEgressGetResponse, AgentEgressRefInput, AgentSummary, AssignRolesInput, AuthInput, BalanceRow, BoundGrant, ChargeReason, ClientAuth, ClientHandshake, ConfigValidationResult, ContractDescriptorDocument, ContractDescriptorFacets, ContractExecuteInput, ContractKind, ContractLifecycleStatus, ContractListDetailedOptions, ContractListDetailedPage, ContractPublishInput, ContractRegisterResult, ContractResponseSchema, ContractSetDescriptorInput, CreatePolicyInput, DataGetInput, DataGetResponse, DataListInput, DataListResponse, DelegationGrantKind, DelegationGrantRef, DeleteDataInput, DeleteGrantsInput, DeleteScopeInput, DescribeContractParams, DescribeContractResult, DescribeFunctionParams, DescribeFunctionResult, DetailedContract, Did, Direction, DiscoverOptions, DkgAttestation, DkgVerifyResult, EmailOtpAuthInput, EmailOtpCredentials, Environment, EthAuthInput, ExecuteBusinessContractOptions, ExecuteOrgDataActionOptions, FetchTrustedManifestOptions, FunctionDescriptorEntry, GetActivityLogOptions, GetUsageOptions, GrantCheckParams, GrantCheckResult, GranteeInput, GrantsGetInput, GrantsMergeResult, GuestToHostHandler, GuestToHostHandlers, HandshakeResult, HumanMember, InvokeOptions, InvokeRequest, JsonRpcRequest, JsonRpcResponse, KycPollCadence, KycPollOptions, KycStatus, KycStatusKind, ListAgentsInput, ListAgentsResponse, ListContractsParams, ListContractsResult, ListContractsScope, ListHumanMembersInput, ListHumanMembersResponse, ListedContract, Logger, MapCreateInput, MapLifecycleStatus, MapResponse, MapUpdateInput, MapVisibility, MemberDelegationDoc, MemberRole, MutationResponse, OidcAuthInput, OidcCredentials, OrgAdminStatus, OrgContractDelegation, OrgContractGrants, OrgDataActionWire, OrgDataClientOptions, OrgDelegationDeleteInput, OrgDelegationGetInput, OrgDelegationSetInput, OrgPolicyMeta, OrgPolicyView, OrgRemoveMemberDelegationInput, OrgUsageReport, OrgUsageReportInput, OrgWriters, OtpChannel, OtpMergeSuggestion, OtpRequestInput, OtpRequestResult, OtpVerifyInput, OtpVerifyResult, PayrollRunRequest, PeerQuoteResult, PolicyGetInput, PurgeOrgInput, QuoteVerifyResult, ReaderSet, RemoveMemberGrantsInput, RoleAssignments, RoleAssignmentsResponse, RoleDefinition, RoleGetResponse, RoleGrant, RoleIdInput, SdkConfig, SecretKind, SecretListInput, SecretListResponse, SecretNameInput, SecretRecord, SecretSetValueInput, SecretView, SecretWriteInput, SessionCrypto, SessionId, SetAgentEgressInput, SetGrantsInput, SetRoleInput, SetWritersInput, SignedTrustManifest, StringEncoding, SubmitUserInputArgs, SubmitUserInputResult, T3nClientConfig, TenantAdmitProjection, TenantAdmitStatus, TenantBaseClient, TenantClientConfig, TenantContractExecuteInput, TenantContractPublishInput, TenantContractSetDescriptorInput, TenantExecutionSession, TenantMapCreateInput, TenantMapUpdatePatch, TenantMeResponse, TenantSdkEnvironment, TenantSelfAdmitResult, TenantStatus, TenantTargetOptions, TokenTxKind, Transport, TrustAnchor, TrustAnchorOrUnsafe, TrustAnchorSource, TrustManifestPayload, UnassignRolesInput, UnsafeTrustServer, UpdateMetaInput, UsageEntry, UsagePage, UsageReportSignature, UserGrant, UserInputProfile, UserUpsertErrorKind, Validity, WasmComponent, WasmNextResult, WhoamiResult, WireBlock, WorkloadAuthInput, WriteDataInput, WriterSet, WritersGetInput };