@terminal3/t3n-sdk 4.3.0 → 4.8.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/cli/index.js +1 -1
- package/dist/index.d.ts +284 -19
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1573,6 +1573,29 @@ interface AgentAuthEntry {
|
|
|
1573
1573
|
agentDid: string;
|
|
1574
1574
|
scripts: AgentAuthScriptGrant[];
|
|
1575
1575
|
}
|
|
1576
|
+
/**
|
|
1577
|
+
* The full agent-auth policy document in the camelCase write shape:
|
|
1578
|
+
* the per-agent grants plus the document-level discovery grants.
|
|
1579
|
+
*
|
|
1580
|
+
* `discoverDids` (contract wire: `discover_dids`) is the
|
|
1581
|
+
* list of DIDs the user lets their registered agents *enumerate the
|
|
1582
|
+
* contracts of* via `listContracts`: an org DID grants org-mode discovery,
|
|
1583
|
+
* the user's own DID grants self-mode discovery. It lives at document
|
|
1584
|
+
* level — not on a script grant — because discovery must surface contracts
|
|
1585
|
+
* the agent cannot yet call. The node's discovery gate additionally
|
|
1586
|
+
* requires the calling agent to be named in `agents` (subject binding), so
|
|
1587
|
+
* an unregistered agent discovers nothing regardless of this list.
|
|
1588
|
+
*/
|
|
1589
|
+
interface AgentAuthPolicy {
|
|
1590
|
+
agents: AgentAuthEntry[];
|
|
1591
|
+
discoverDids: string[];
|
|
1592
|
+
}
|
|
1593
|
+
/**
|
|
1594
|
+
* Parse a full `agent-auth-get` response (the stored snake_case policy
|
|
1595
|
+
* document) into the camelCase write shape, including the document-level
|
|
1596
|
+
* `discover_dids`. A `null` / absent response is the empty policy.
|
|
1597
|
+
*/
|
|
1598
|
+
declare function parseAgentAuthPolicy(response: unknown): AgentAuthPolicy;
|
|
1576
1599
|
/** Extract the `agents` array from an `agent-auth-get` response. */
|
|
1577
1600
|
declare function parseAgentAuthGet(response: unknown): AgentAuthEntry[];
|
|
1578
1601
|
interface AgentAuthMergeResult {
|
|
@@ -1583,27 +1606,42 @@ interface AgentAuthMergeResult {
|
|
|
1583
1606
|
}
|
|
1584
1607
|
/** Input to the full-document write {@link T3nClient.agentAuthUpdate}. The
|
|
1585
1608
|
* document IS the new state: an empty `agents` list revokes all agent
|
|
1586
|
-
* access
|
|
1609
|
+
* access, and an omitted / empty `discoverDids` persists an empty
|
|
1610
|
+
* discovery-grant list (the contract has no per-field merge). Mirrors the
|
|
1611
|
+
* contract `AgentAuthPolicy`. */
|
|
1587
1612
|
interface AgentAuthUpdateInput {
|
|
1588
1613
|
agents: AgentAuthEntry[];
|
|
1614
|
+
/** Document-level discovery grants — see {@link AgentAuthPolicy}. */
|
|
1615
|
+
discoverDids?: string[];
|
|
1589
1616
|
}
|
|
1590
1617
|
/**
|
|
1591
|
-
* Serialise a camelCase
|
|
1618
|
+
* Serialise a camelCase policy document to the contract's canonical
|
|
1592
1619
|
* snake_case `agent-auth-update` wire (`agent_did` / `script_name` /
|
|
1593
1620
|
* `version_req` / `read_scopes` / `valid_from_secs` / `valid_until_secs` /
|
|
1594
|
-
* `allowed_hosts`), so neither write path relies on the
|
|
1595
|
-
* compatibility aliases. Absent optionals are omitted (never
|
|
1596
|
-
* `null`); empty `scopes` / `read_scopes` are omitted (the
|
|
1597
|
-
* defaults both to empty). `functions` and `allowed_hosts` are
|
|
1598
|
-
* emitted — the contract requires explicit functions (`["*"]` =
|
|
1599
|
-
* reads an absent `allowed_hosts` as deny-all egress.
|
|
1600
|
-
|
|
1601
|
-
|
|
1621
|
+
* `allowed_hosts` / `discover_dids`), so neither write path relies on the
|
|
1622
|
+
* contract's compatibility aliases. Absent optionals are omitted (never
|
|
1623
|
+
* sent as `null`); empty `scopes` / `read_scopes` are omitted (the
|
|
1624
|
+
* contract defaults both to empty). `functions` and `allowed_hosts` are
|
|
1625
|
+
* always emitted — the contract requires explicit functions (`["*"]` =
|
|
1626
|
+
* all) and reads an absent `allowed_hosts` as deny-all egress. The
|
|
1627
|
+
* document-level `discover_dids` (strictly snake_case — the contract
|
|
1628
|
+
* defines no camelCase alias for it) is emitted only when non-empty; the
|
|
1629
|
+
* contract defaults an absent list to empty.
|
|
1630
|
+
*/
|
|
1631
|
+
declare function toAgentAuthUpdateWire(agents: AgentAuthEntry[], discoverDids?: string[]): {
|
|
1602
1632
|
agents: Array<{
|
|
1603
1633
|
agent_did: string;
|
|
1604
1634
|
scripts: Array<Record<string, unknown>>;
|
|
1605
1635
|
}>;
|
|
1636
|
+
discover_dids?: string[];
|
|
1606
1637
|
};
|
|
1638
|
+
/**
|
|
1639
|
+
* Order-preserving deduplicating union of discovery-grant DID lists —
|
|
1640
|
+
* the read-merge-write counterpart of {@link mergeAgentAuthEntries} for
|
|
1641
|
+
* the document-level `discoverDids` (the contract rejects duplicate
|
|
1642
|
+
* entries, so the union must dedupe).
|
|
1643
|
+
*/
|
|
1644
|
+
declare function mergeDiscoverDids(existing: string[], additions: string[]): string[];
|
|
1607
1645
|
/**
|
|
1608
1646
|
* Merge new agent entries into the existing policy with script-level union
|
|
1609
1647
|
* semantics: for an agent DID present on both sides, script rows whose
|
|
@@ -1749,6 +1787,95 @@ declare class KycStatusTimeoutError extends T3nError {
|
|
|
1749
1787
|
lastStatus?: KycStatus | undefined);
|
|
1750
1788
|
}
|
|
1751
1789
|
|
|
1790
|
+
/**
|
|
1791
|
+
* Contract-discovery wire shapes.
|
|
1792
|
+
*
|
|
1793
|
+
* Field-for-field mirrors of the node's `contracts.list` and `delegation.check`
|
|
1794
|
+
* JSON-RPC responses (`service::contract_discovery::{ListedContract,
|
|
1795
|
+
* ListContractsResponse}` and `service::grant_check::{GrantRef,
|
|
1796
|
+
* GrantCheckResponse}`). Both methods are session-authenticated plaintext reads
|
|
1797
|
+
* dispatched over `/api/rpc` — the same posture as `token.get-usage` — so the
|
|
1798
|
+
* SDK wrappers return the parsed `result` object directly.
|
|
1799
|
+
*/
|
|
1800
|
+
/** The navigable starting points of the discovery funnel. */
|
|
1801
|
+
type ListContractsScope = "core" | "org" | "self";
|
|
1802
|
+
/** Params for `contracts.list` (every field optional; `{}` lists core). */
|
|
1803
|
+
interface ListContractsParams {
|
|
1804
|
+
/** `"core"` (default) | `"org"` | `"self"`. */
|
|
1805
|
+
scope?: ListContractsScope;
|
|
1806
|
+
/** Target org DID (required for scope `"org"`). */
|
|
1807
|
+
org_did?: string;
|
|
1808
|
+
/** The member the agent acts for (required for scope `"org"` / `"self"`). */
|
|
1809
|
+
pii_did?: string;
|
|
1810
|
+
/** Page offset (defaults to 0 server-side). */
|
|
1811
|
+
offset?: number;
|
|
1812
|
+
/** Page size (defaults + clamped server-side). */
|
|
1813
|
+
limit?: number;
|
|
1814
|
+
}
|
|
1815
|
+
/** Contract kind — `"core"` platform system contract, `"tenant"` z-space. */
|
|
1816
|
+
type ContractKind = "core" | "tenant";
|
|
1817
|
+
/** One contract as presented by `contracts.list`. */
|
|
1818
|
+
interface ListedContract {
|
|
1819
|
+
/** Canonical name: `tee:<name>` for core, `z:<tid>:<tail>` for tenant. */
|
|
1820
|
+
name: string;
|
|
1821
|
+
kind: ContractKind;
|
|
1822
|
+
/** Current registered version; `null` when the contract is not registered. */
|
|
1823
|
+
version: string | null;
|
|
1824
|
+
/** Descriptor summary, or empty when no descriptor is published. */
|
|
1825
|
+
summary: string;
|
|
1826
|
+
/** Descriptor tags, or empty. */
|
|
1827
|
+
tags: string[];
|
|
1828
|
+
/** Owning DID: the org DID (org mode) or the member's own DID (self mode). */
|
|
1829
|
+
owner_org_did?: string;
|
|
1830
|
+
/**
|
|
1831
|
+
* Human-facing short name: the trailing segment of `name` (`payroll` from
|
|
1832
|
+
* `z:<tid>:payroll`, `user` from `tee:user`). Present this to people instead
|
|
1833
|
+
* of the full canonical `name`, which remains the dispatch key.
|
|
1834
|
+
*/
|
|
1835
|
+
short_name: string;
|
|
1836
|
+
}
|
|
1837
|
+
/** Response body for `contracts.list`. */
|
|
1838
|
+
interface ListContractsResult {
|
|
1839
|
+
scope: string;
|
|
1840
|
+
contracts: ListedContract[];
|
|
1841
|
+
next_offset: number | null;
|
|
1842
|
+
}
|
|
1843
|
+
/** Which standing grant a satisfied/missing entry refers to. */
|
|
1844
|
+
type DelegationGrantKind = "agent_auth" | "user_grant";
|
|
1845
|
+
/** Params for `delegation.check` (the generic capability read). */
|
|
1846
|
+
interface GrantCheckParams {
|
|
1847
|
+
/** The target contract whose requirements are checked. */
|
|
1848
|
+
contract: string;
|
|
1849
|
+
/** The member the agent wants to act for (the subject). */
|
|
1850
|
+
pii_did: string;
|
|
1851
|
+
/** Functions the intended action needs. */
|
|
1852
|
+
functions: string[];
|
|
1853
|
+
/** Org-data scopes the intended action needs. */
|
|
1854
|
+
scopes: string[];
|
|
1855
|
+
}
|
|
1856
|
+
/** One grant requirement — satisfied or missing. */
|
|
1857
|
+
interface DelegationGrantRef {
|
|
1858
|
+
grant: DelegationGrantKind;
|
|
1859
|
+
/** The target contract's canonical name. */
|
|
1860
|
+
contract: string;
|
|
1861
|
+
functions: string[];
|
|
1862
|
+
scopes: string[];
|
|
1863
|
+
}
|
|
1864
|
+
/**
|
|
1865
|
+
* Response for `delegation.check`: the `agent_auth ∩ UserGrant` verdict.
|
|
1866
|
+
*
|
|
1867
|
+
* `disclosed` is `true` only when the agent is registered under `pii_did`, so
|
|
1868
|
+
* org-side status was safe to disclose; `false` yields the uniform,
|
|
1869
|
+
* non-disclosive verdict (`authorised:false, satisfied:[], missing:[]`) that is
|
|
1870
|
+
* byte-invariant to the requested capability (R5 anti-enumeration).
|
|
1871
|
+
*/
|
|
1872
|
+
interface GrantCheckResult {
|
|
1873
|
+
authorised: boolean;
|
|
1874
|
+
disclosed: boolean;
|
|
1875
|
+
satisfied: DelegationGrantRef[];
|
|
1876
|
+
missing: DelegationGrantRef[];
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1752
1879
|
/**
|
|
1753
1880
|
* T3n Client - Main SDK class
|
|
1754
1881
|
*
|
|
@@ -1930,6 +2057,35 @@ declare class T3nClient {
|
|
|
1930
2057
|
* server-side handler does not run the encryption layer.
|
|
1931
2058
|
*/
|
|
1932
2059
|
getUsage(opts?: GetUsageOptions): Promise<UsagePage>;
|
|
2060
|
+
/**
|
|
2061
|
+
* List the caller's discoverable contracts (`contracts.list`) — the
|
|
2062
|
+
* node-backed source for the MCP `listContracts` funnel tool.
|
|
2063
|
+
*
|
|
2064
|
+
* `scope` selects the starting point: `"core"` (curated platform contracts,
|
|
2065
|
+
* the default), `"org"` (one org's contracts — pass `org_did` + `pii_did`),
|
|
2066
|
+
* or `"self"` (the member's own contracts — pass `pii_did`). The acting agent
|
|
2067
|
+
* DID is resolved server-side from the session; org / self modes are
|
|
2068
|
+
* discovery-grant gated and return a uniform, non-disclosive empty page on a
|
|
2069
|
+
* gate miss (R5 anti-enumeration).
|
|
2070
|
+
*
|
|
2071
|
+
* Plaintext session read (like {@link getUsage}): the response carries only
|
|
2072
|
+
* public contract-registry metadata, so it is not sealed.
|
|
2073
|
+
*/
|
|
2074
|
+
listContracts(params?: ListContractsParams): Promise<ListContractsResult>;
|
|
2075
|
+
/**
|
|
2076
|
+
* Generic capability check (`delegation.check`) — the
|
|
2077
|
+
* node-backed source for the MCP `checkDelegation` funnel tool.
|
|
2078
|
+
*
|
|
2079
|
+
* Returns the `agent_auth ∩ UserGrant` verdict for `(agent, contract,
|
|
2080
|
+
* pii_did)`: whether the acting agent (resolved from the session) holds the
|
|
2081
|
+
* standing grants that `contract`'s `functions` / `scopes` need for member
|
|
2082
|
+
* `pii_did`. The org half is vacuous for no-org (Individual-owned) targets,
|
|
2083
|
+
* and the verdict is uniform + non-disclosive (`disclosed:false`) when the
|
|
2084
|
+
* agent is not registered under the member (R5 anti-enumeration).
|
|
2085
|
+
*
|
|
2086
|
+
* Plaintext session read (like {@link getUsage}).
|
|
2087
|
+
*/
|
|
2088
|
+
checkDelegation(params: GrantCheckParams): Promise<GrantCheckResult>;
|
|
1933
2089
|
/**
|
|
1934
2090
|
* Fetch a page of audit events. With no `pii_did`, returns
|
|
1935
2091
|
* the caller's own audit trail (every actor). With a `pii_did` set to
|
|
@@ -1994,10 +2150,12 @@ declare class T3nClient {
|
|
|
1994
2150
|
* `tee:user/contracts`, which is **SelfOnly**, so this always returns the
|
|
1995
2151
|
* caller's own `AGENT_AUTH_MAP[self]` document.
|
|
1996
2152
|
*
|
|
1997
|
-
* @returns the
|
|
2153
|
+
* @returns the full policy document (normalised to the camelCase write
|
|
2154
|
+
* shape): the per-agent `agents` entries plus the document-level
|
|
2155
|
+
* `discoverDids` discovery grants
|
|
1998
2156
|
* @throws if the session is not authenticated, or the contract refuses
|
|
1999
2157
|
*/
|
|
2000
|
-
getAgentAuth(): Promise<
|
|
2158
|
+
getAgentAuth(): Promise<AgentAuthPolicy>;
|
|
2001
2159
|
/**
|
|
2002
2160
|
* Authorise an agent for one contract on the caller's own behalf
|
|
2003
2161
|
* (envelope-free authorisation). Read-merge-writes the
|
|
@@ -2014,13 +2172,24 @@ declare class T3nClient {
|
|
|
2014
2172
|
* parameters for. The caller MUST be the delegating user, authenticated as
|
|
2015
2173
|
* themselves — only they may create their own grant.
|
|
2016
2174
|
*
|
|
2175
|
+
* The document-level `discoverDids` discovery grants ride the same
|
|
2176
|
+
* read-merge-write: the existing list is always carried forward (the
|
|
2177
|
+
* contract persists the whole document, so dropping it here would revoke
|
|
2178
|
+
* standing discovery), and any `options.discoverDids` are unioned in
|
|
2179
|
+
* (order-preserving, deduplicated).
|
|
2180
|
+
*
|
|
2017
2181
|
* @param agentDid - the agent DID being authorised
|
|
2018
2182
|
* @param grant - the single script grant to set (contract, functions,
|
|
2019
2183
|
* scopes, validity, egress hosts)
|
|
2184
|
+
* @param options - optional `discoverDids` to union into the document's
|
|
2185
|
+
* discovery grants (org DIDs for org-mode `listContracts`, the caller's
|
|
2186
|
+
* own DID for self mode)
|
|
2020
2187
|
* @returns the script rows preserved from the existing policy (audit aid)
|
|
2021
2188
|
* @throws if the session is not authenticated, or the contract refuses
|
|
2022
2189
|
*/
|
|
2023
|
-
updateAgentAuth(agentDid: string, grant: AgentAuthScriptGrant
|
|
2190
|
+
updateAgentAuth(agentDid: string, grant: AgentAuthScriptGrant, options?: {
|
|
2191
|
+
discoverDids?: string[];
|
|
2192
|
+
}): Promise<{
|
|
2024
2193
|
preservedRows: string[];
|
|
2025
2194
|
}>;
|
|
2026
2195
|
/**
|
|
@@ -2103,6 +2272,33 @@ declare class T3nClient {
|
|
|
2103
2272
|
* a JSON array.
|
|
2104
2273
|
*/
|
|
2105
2274
|
getWalletHistory(walletAddress: string): Promise<unknown[]>;
|
|
2275
|
+
/**
|
|
2276
|
+
* Return the organisations the authenticated user is a member of, as
|
|
2277
|
+
* canonical `did:t3n:<40-hex>` strings.
|
|
2278
|
+
*
|
|
2279
|
+
* Backed by `tee:user/my-organisations`, which reads the caller's
|
|
2280
|
+
* membership set (`UserOrganisations`) keyed on the session DID — the
|
|
2281
|
+
* request carries no body, and a user cannot query anyone else's
|
|
2282
|
+
* memberships. An **empty array means the user belongs to no
|
|
2283
|
+
* organisation**; this is the intended signal for an org-scoped app to
|
|
2284
|
+
* gate entry on (authentication itself is org-agnostic — a user in no
|
|
2285
|
+
* org still authenticates successfully).
|
|
2286
|
+
*
|
|
2287
|
+
* Note this reflects *affiliation*, not per-contract authorisation:
|
|
2288
|
+
* membership does not by itself grant admin rights or a scope grant.
|
|
2289
|
+
* Org-scoped operations remain gated server-side (403) on the org's
|
|
2290
|
+
* admin list / grants regardless of what this returns.
|
|
2291
|
+
*
|
|
2292
|
+
* `my-organisations` is an additive export, so any registered
|
|
2293
|
+
* user-contract version exposes it; {@link executeUserContract}
|
|
2294
|
+
* resolves `"latest"` to the current version so this wrapper doesn't
|
|
2295
|
+
* drift on every `CONTRACT_VERSION` bump.
|
|
2296
|
+
*
|
|
2297
|
+
* @returns the caller's organisation DIDs (`did:t3n:<40-hex>`), possibly empty.
|
|
2298
|
+
* @throws if unauthenticated, if the node rejects the action, or if the
|
|
2299
|
+
* response shape is unexpected.
|
|
2300
|
+
*/
|
|
2301
|
+
myOrgs(): Promise<Did[]>;
|
|
2106
2302
|
/**
|
|
2107
2303
|
* Remove the authenticated user's account AND explicitly abandon
|
|
2108
2304
|
* any wallets. Writes `Abandoned` audit rows to wallet history,
|
|
@@ -2272,15 +2468,18 @@ declare class T3nClient {
|
|
|
2272
2468
|
/**
|
|
2273
2469
|
* Replace this user's agent-authorisation policy (`tee:user/contracts` →
|
|
2274
2470
|
* `agent-auth-update`). The supplied document IS the new state: an empty
|
|
2275
|
-
* `agents` array revokes all agent access
|
|
2471
|
+
* `agents` array revokes all agent access, and an omitted `discoverDids`
|
|
2472
|
+
* persists an empty discovery-grant list. This is the full-document
|
|
2276
2473
|
* write — use {@link T3nClient.updateAgentAuth} for the single-grant
|
|
2277
|
-
* read-merge-write that preserves other contracts' grants
|
|
2474
|
+
* read-merge-write that preserves other contracts' grants and the
|
|
2475
|
+
* standing discovery grants.
|
|
2278
2476
|
*
|
|
2279
2477
|
* Typed wrapper over the raw contract call: callers pass camelCase input;
|
|
2280
2478
|
* the SDK emits the canonical snake_case wire via
|
|
2281
2479
|
* {@link toAgentAuthUpdateWire} (carrying `scopes` / `read_scopes` /
|
|
2282
|
-
* validity alongside `functions` / `allowed_hosts
|
|
2283
|
-
* on the contract's
|
|
2480
|
+
* validity alongside `functions` / `allowed_hosts`, plus the
|
|
2481
|
+
* document-level `discover_dids`), so it does not rely on the contract's
|
|
2482
|
+
* compatibility aliases.
|
|
2284
2483
|
*
|
|
2285
2484
|
* @throws {RpcError} if the contract rejects the policy (validation failure,
|
|
2286
2485
|
* too many agents/grants).
|
|
@@ -3006,6 +3205,46 @@ declare function formatTokens(baseUnits: number | bigint): string;
|
|
|
3006
3205
|
*/
|
|
3007
3206
|
declare function toBaseUnits(tokens: number): number;
|
|
3008
3207
|
|
|
3208
|
+
/** Closed-vocabulary serialisation annotations for a contract function's body. */
|
|
3209
|
+
interface WireBlock {
|
|
3210
|
+
/**
|
|
3211
|
+
* Field paths whose values are emitted as decimal strings. A path ending in
|
|
3212
|
+
* `.*` applies to every value of the named object/array (e.g.
|
|
3213
|
+
* `historical_baselines.*`).
|
|
3214
|
+
*/
|
|
3215
|
+
u64_as_string?: string[];
|
|
3216
|
+
/**
|
|
3217
|
+
* Byte fields carried as typed strings. The value is passed through when it
|
|
3218
|
+
* is already a string; a byte input (`Uint8Array` or a `number[]` of octets)
|
|
3219
|
+
* is encoded per its kind.
|
|
3220
|
+
*/
|
|
3221
|
+
string_encoded?: Record<string, StringEncoding>;
|
|
3222
|
+
}
|
|
3223
|
+
/** The closed set of `string_encoded` field kinds. */
|
|
3224
|
+
type StringEncoding = "did" | "address" | "hash";
|
|
3225
|
+
/**
|
|
3226
|
+
* Raised when a `wire` block asks for a projection the closed vocabulary cannot
|
|
3227
|
+
* express — an unrepresentable value for a declared field. It signals a
|
|
3228
|
+
* descriptor↔contract mismatch on the author's side, so callers surface it as a
|
|
3229
|
+
* terminal `unsupported_wire_encoding` rather than retrying.
|
|
3230
|
+
*/
|
|
3231
|
+
declare class WireEncodingError extends T3nError {
|
|
3232
|
+
readonly field: string;
|
|
3233
|
+
readonly encoding?: StringEncoding | undefined;
|
|
3234
|
+
constructor(message: string, field: string, encoding?: StringEncoding | undefined);
|
|
3235
|
+
}
|
|
3236
|
+
type JsonRecord = Record<string, unknown>;
|
|
3237
|
+
/**
|
|
3238
|
+
* Project `args` into the plain-args body a z-space contract deserialises,
|
|
3239
|
+
* applying the descriptor's `wire` annotations. Returns a new object; `args` is
|
|
3240
|
+
* never mutated. With no `wire` block the body is returned unchanged (the
|
|
3241
|
+
* JSON-plain path).
|
|
3242
|
+
*
|
|
3243
|
+
* @throws {WireEncodingError} when a declared field holds a value the
|
|
3244
|
+
* vocabulary cannot express.
|
|
3245
|
+
*/
|
|
3246
|
+
declare function requestToWire(args: JsonRecord, wire?: WireBlock): JsonRecord;
|
|
3247
|
+
|
|
3009
3248
|
/**
|
|
3010
3249
|
* Cryptographic utilities for T3n SDK
|
|
3011
3250
|
*
|
|
@@ -3343,6 +3582,22 @@ interface ContractPublishInput {
|
|
|
3343
3582
|
*/
|
|
3344
3583
|
source_hash?: string;
|
|
3345
3584
|
}
|
|
3585
|
+
/**
|
|
3586
|
+
* Input for `TenantContractsNamespace.setDescriptor`: publish the agent-facing
|
|
3587
|
+
* descriptor document for an already-registered contract version via
|
|
3588
|
+
* `tee:tenant/contracts.set-descriptor`.
|
|
3589
|
+
*/
|
|
3590
|
+
interface ContractSetDescriptorInput {
|
|
3591
|
+
tail: string;
|
|
3592
|
+
/** Semver the descriptor is bound to; the `name@version` must already be registered. */
|
|
3593
|
+
version: string;
|
|
3594
|
+
/**
|
|
3595
|
+
* The descriptor document — contract-level metadata plus a non-empty
|
|
3596
|
+
* `functions` array of function descriptors — embedded as JSON and stored
|
|
3597
|
+
* verbatim at the version-scoped `:descriptor` sidecar.
|
|
3598
|
+
*/
|
|
3599
|
+
descriptor: unknown;
|
|
3600
|
+
}
|
|
3346
3601
|
interface ContractExecuteInput {
|
|
3347
3602
|
version: string;
|
|
3348
3603
|
functionName: string;
|
|
@@ -3374,6 +3629,7 @@ interface ExecuteBusinessContractOptions<T = unknown> {
|
|
|
3374
3629
|
type TenantMapCreateInput = MapCreateInput;
|
|
3375
3630
|
type TenantMapUpdatePatch = MapUpdateInput;
|
|
3376
3631
|
type TenantContractPublishInput = ContractPublishInput;
|
|
3632
|
+
type TenantContractSetDescriptorInput = ContractSetDescriptorInput;
|
|
3377
3633
|
type TenantContractExecuteInput = ContractExecuteInput;
|
|
3378
3634
|
/**
|
|
3379
3635
|
* Options shared by the `tee:tenant` management calls that accept an optional
|
|
@@ -3433,6 +3689,15 @@ declare class TenantContractsNamespace {
|
|
|
3433
3689
|
constructor(client: TenantClient);
|
|
3434
3690
|
publish(input: ContractPublishInput, opts?: TenantTargetOptions): Promise<ContractRegisterResult>;
|
|
3435
3691
|
register(input: ContractPublishInput, opts?: TenantTargetOptions): Promise<ContractRegisterResult>;
|
|
3692
|
+
/**
|
|
3693
|
+
* Publish the agent-facing descriptor document for a registered
|
|
3694
|
+
* `name@version` via `set-descriptor`. Owner-gated by the
|
|
3695
|
+
* same tenant-resolution rules as `register`, and refused when the
|
|
3696
|
+
* `name@version` is not registered. The node serves the stored document as
|
|
3697
|
+
* the sole descriptor source for the MCP dispatch funnel, so a contract
|
|
3698
|
+
* without one is not dispatchable through it.
|
|
3699
|
+
*/
|
|
3700
|
+
setDescriptor(input: ContractSetDescriptorInput, opts?: TenantTargetOptions): Promise<unknown>;
|
|
3436
3701
|
disable(tail: string, opts?: TenantTargetOptions): Promise<unknown>;
|
|
3437
3702
|
enable(tail: string, opts?: TenantTargetOptions): Promise<unknown>;
|
|
3438
3703
|
unregister(tail: string, opts?: TenantTargetOptions): Promise<unknown>;
|
|
@@ -3540,5 +3805,5 @@ declare function tenantDidHex(tenantDid: string): string;
|
|
|
3540
3805
|
declare function validateTail(tail: string): string;
|
|
3541
3806
|
declare function canonicalTenantName(tenantDid: string, tail: string): string;
|
|
3542
3807
|
|
|
3543
|
-
export { AuthMethod, AuthenticationError, BASE_UNITS_PER_TOKEN, ContractResponseError, DEFAULT_ENVIRONMENT, DEFAULT_INDIVIDUAL_THRESHOLD_CENTS, DEFAULT_KYC_POLL_CADENCE, HandshakeError, HttpTransport, KycStatusTimeoutError, LogLevel, MockTransport, NODE_URLS, OrgDataClient, OtpRateLimitedError, RpcError, SessionExpiredError, SessionOrgDataClient, SessionStateError, SessionStatus, T3nClient, T3nError, TERMINAL_KYC_STATUSES, TOKEN_DECIMALS, TenantClient, TenantContractsNamespace, TenantMapsNamespace, TenantNamespace, TenantSdkValidationError, TenantTokenNamespace, UnsupportedTenantSdkOperationError, UserUpsertError, WasmError, Z_PAYROLL_AUDIT_READ_FUNCTIONS, Z_PAYROLL_RUN_FUNCTIONS, _b64uEncode, assertShape, b64uDecodeStrict, b64uEncodeBytes, bytesToString, canonicalTenantName, clearKeyCache, compactDidFromBytes, createDefaultHandlers, createEmailOtpAuthInput, createEthAuthInput, createLogger, createMlKemPublicKeyHandler, createOidcAuthInput, createOrgDataClientFromSession, createRandomHandler, createWorkloadAuthInput, decodeWasmErrorMessage, eth_get_address, extractWasmError, fetchDkgAttestation, fetchMlKemPublicKey, formatTokens, generateRandomString, generateUUID, getEnvironment, getEnvironmentName, getGlobalLogLevel, getLogger, getNodeUrl, getScriptVersion, isDataGetResponse, isDataListResponse, isMutationResponse, isObject, isOrgContractGrants, isOrgPolicyMeta, isOrgPolicyView, isOrgWriters, isUnsafeTrustServer, loadConfig, loadWasmComponent, maskKeyMaterial, mergeAgentAuthEntries, metamask_get_address, metamask_sign, parseAgentAuthGet, parseContractResponse, redactSecrets, redactSecretsFromJson, setEnvironment, setGlobalLogLevel, setNodeUrl, stringToBytes, tenantDidHex, toAgentAuthUpdateWire, toBaseUnits, validateConfig, validateTail, verifyDkgAttestation, verifyTdxQuote };
|
|
3544
|
-
export type { AdmitForOrgOptions, AgentAuthEntry, AgentAuthMergeResult, AgentAuthScriptGrant, AgentAuthUpdateInput, AuthInput, BalanceRow, ChargeReason, ClientAuth, ClientHandshake, ConfigValidationResult, ContractExecuteInput, ContractPublishInput, ContractRegisterResult, ContractResponseSchema, CreatePolicyInput, DataGetInput, DataGetResponse, DataListInput, DataListResponse, DeleteDataInput, DeleteGrantsInput, DeleteScopeInput, Did, Direction, DkgAttestation, DkgVerifyResult, EmailOtpAuthInput, EmailOtpCredentials, Environment, EthAuthInput, ExecuteBusinessContractOptions, ExecuteOrgDataActionOptions, GetUsageOptions, GrantsGetInput, GuestToHostHandler, GuestToHostHandlers, HandshakeResult, JsonRpcRequest, JsonRpcResponse, KycPollCadence, KycPollOptions, KycStatus, KycStatusKind, Logger, MapCreateInput, MapResponse, MapUpdateInput, MapVisibility, MutationResponse, OidcAuthInput, OidcCredentials, OrgContractGrants, OrgDataActionWire, OrgDataClientOptions, OrgPolicyMeta, OrgPolicyView, OrgWriters, OtpChannel, OtpMergeSuggestion, OtpRequestInput, OtpRequestResult, OtpVerifyInput, OtpVerifyResult, PayrollRunRequest, PeerQuoteResult, PolicyGetInput, QuoteVerifyResult, ReaderSet, SdkConfig, SessionCrypto, SessionId, SetGrantsInput, SetWritersInput, SubmitUserInputArgs, SubmitUserInputResult, T3nClientConfig, TenantAdmitProjection, TenantAdmitStatus, TenantBaseClient, TenantClientConfig, TenantContractExecuteInput, TenantContractPublishInput, TenantExecutionSession, TenantMapCreateInput, TenantMapUpdatePatch, TenantMeResponse, TenantSdkEnvironment, TenantSelfAdmitResult, TenantStatus, TenantTargetOptions, TokenTxKind, Transport, TrustAnchor, TrustAnchorOrUnsafe, UnsafeTrustServer, UpdateMetaInput, UsageEntry, UsagePage, UserGrant, UserInputProfile, UserUpsertErrorKind, WasmComponent, WasmNextResult, WorkloadAuthInput, WriteDataInput, WriterSet, WritersGetInput };
|
|
3808
|
+
export { AuthMethod, AuthenticationError, BASE_UNITS_PER_TOKEN, ContractResponseError, DEFAULT_ENVIRONMENT, DEFAULT_INDIVIDUAL_THRESHOLD_CENTS, DEFAULT_KYC_POLL_CADENCE, HandshakeError, HttpTransport, KycStatusTimeoutError, LogLevel, MockTransport, NODE_URLS, OrgDataClient, OtpRateLimitedError, RpcError, SessionExpiredError, SessionOrgDataClient, SessionStateError, SessionStatus, T3nClient, 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, bytesToString, canonicalTenantName, clearKeyCache, compactDidFromBytes, createDefaultHandlers, createEmailOtpAuthInput, createEthAuthInput, createLogger, createMlKemPublicKeyHandler, createOidcAuthInput, createOrgDataClientFromSession, createRandomHandler, createWorkloadAuthInput, decodeWasmErrorMessage, eth_get_address, extractWasmError, fetchDkgAttestation, fetchMlKemPublicKey, formatTokens, generateRandomString, generateUUID, getEnvironment, getEnvironmentName, getGlobalLogLevel, getLogger, getNodeUrl, getScriptVersion, isDataGetResponse, isDataListResponse, isMutationResponse, isObject, isOrgContractGrants, isOrgPolicyMeta, isOrgPolicyView, isOrgWriters, isUnsafeTrustServer, loadConfig, loadWasmComponent, maskKeyMaterial, mergeAgentAuthEntries, mergeDiscoverDids, metamask_get_address, metamask_sign, parseAgentAuthGet, parseAgentAuthPolicy, parseContractResponse, redactSecrets, redactSecretsFromJson, requestToWire, setEnvironment, setGlobalLogLevel, setNodeUrl, stringToBytes, tenantDidHex, toAgentAuthUpdateWire, toBaseUnits, validateConfig, validateTail, verifyDkgAttestation, verifyTdxQuote };
|
|
3809
|
+
export type { AdmitForOrgOptions, AgentAuthEntry, AgentAuthMergeResult, AgentAuthPolicy, AgentAuthScriptGrant, AgentAuthUpdateInput, AuthInput, BalanceRow, ChargeReason, ClientAuth, ClientHandshake, ConfigValidationResult, ContractExecuteInput, ContractKind, ContractPublishInput, ContractRegisterResult, ContractResponseSchema, ContractSetDescriptorInput, CreatePolicyInput, DataGetInput, DataGetResponse, DataListInput, DataListResponse, DelegationGrantKind, DelegationGrantRef, DeleteDataInput, DeleteGrantsInput, DeleteScopeInput, Did, Direction, DkgAttestation, DkgVerifyResult, EmailOtpAuthInput, EmailOtpCredentials, Environment, EthAuthInput, ExecuteBusinessContractOptions, ExecuteOrgDataActionOptions, GetUsageOptions, GrantCheckParams, GrantCheckResult, GrantsGetInput, GuestToHostHandler, GuestToHostHandlers, HandshakeResult, JsonRpcRequest, JsonRpcResponse, KycPollCadence, KycPollOptions, KycStatus, KycStatusKind, ListContractsParams, ListContractsResult, ListContractsScope, ListedContract, Logger, MapCreateInput, MapResponse, MapUpdateInput, MapVisibility, MutationResponse, OidcAuthInput, OidcCredentials, OrgContractGrants, OrgDataActionWire, OrgDataClientOptions, OrgPolicyMeta, OrgPolicyView, OrgWriters, OtpChannel, OtpMergeSuggestion, OtpRequestInput, OtpRequestResult, OtpVerifyInput, OtpVerifyResult, PayrollRunRequest, PeerQuoteResult, PolicyGetInput, QuoteVerifyResult, ReaderSet, SdkConfig, SessionCrypto, SessionId, SetGrantsInput, SetWritersInput, StringEncoding, SubmitUserInputArgs, SubmitUserInputResult, T3nClientConfig, TenantAdmitProjection, TenantAdmitStatus, TenantBaseClient, TenantClientConfig, TenantContractExecuteInput, TenantContractPublishInput, TenantContractSetDescriptorInput, TenantExecutionSession, TenantMapCreateInput, TenantMapUpdatePatch, TenantMeResponse, TenantSdkEnvironment, TenantSelfAdmitResult, TenantStatus, TenantTargetOptions, TokenTxKind, Transport, TrustAnchor, TrustAnchorOrUnsafe, UnsafeTrustServer, UpdateMetaInput, UsageEntry, UsagePage, UserGrant, UserInputProfile, UserUpsertErrorKind, WasmComponent, WasmNextResult, WireBlock, WorkloadAuthInput, WriteDataInput, WriterSet, WritersGetInput };
|