@terminal3/t3n-sdk 4.12.0 → 4.14.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 +57 -8
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1880,11 +1880,29 @@ declare class T3nClient {
|
|
|
1880
1880
|
* entries. `kinds` filters by `TokenTxKind`; an empty array is
|
|
1881
1881
|
* treated as "no filter".
|
|
1882
1882
|
*
|
|
1883
|
-
*
|
|
1884
|
-
*
|
|
1885
|
-
*
|
|
1883
|
+
* Like {@link getAuditEvents} / {@link execute}, this runs the
|
|
1884
|
+
* session-payload encryption: balance and ledger history are
|
|
1885
|
+
* self-only data, so the request params and response are sealed to
|
|
1886
|
+
* the session key rather than sent plaintext over TLS. (Transitional:
|
|
1887
|
+
* the node still accepts the legacy plaintext shape during the
|
|
1888
|
+
* staggered rollout, so a leaked `Session-Id` alone is not fully
|
|
1889
|
+
* de-fanged on this endpoint until the sealed shape becomes
|
|
1890
|
+
* mandatory.)
|
|
1886
1891
|
*/
|
|
1887
1892
|
getUsage(opts?: GetUsageOptions): Promise<UsagePage>;
|
|
1893
|
+
/**
|
|
1894
|
+
* Fetch the caller's own credit row (`token.get-balance`).
|
|
1895
|
+
*
|
|
1896
|
+
* Like {@link getUsage} / {@link getAuditEvents}, this runs the
|
|
1897
|
+
* session-payload encryption: the balance is self-only data, so the
|
|
1898
|
+
* request (an empty sealed blob showing possession of the session
|
|
1899
|
+
* key) and the response are sealed to the session key rather than
|
|
1900
|
+
* sent plaintext over TLS. (Transitional: the node still accepts the
|
|
1901
|
+
* legacy plaintext shape during the staggered rollout.) Prefer this
|
|
1902
|
+
* over reading `getUsage().balance` when only the credit row is
|
|
1903
|
+
* needed.
|
|
1904
|
+
*/
|
|
1905
|
+
getBalance(): Promise<BalanceRow>;
|
|
1888
1906
|
/**
|
|
1889
1907
|
* List the caller's discoverable contracts (`contracts.list`) — the
|
|
1890
1908
|
* node-backed source for the MCP `listContracts` funnel tool.
|
|
@@ -1896,8 +1914,9 @@ declare class T3nClient {
|
|
|
1896
1914
|
* discovery-grant gated and return a uniform, non-disclosive empty page on a
|
|
1897
1915
|
* gate miss (R5 anti-enumeration).
|
|
1898
1916
|
*
|
|
1899
|
-
* Plaintext session read
|
|
1900
|
-
*
|
|
1917
|
+
* Plaintext session read: the response carries only public
|
|
1918
|
+
* contract-registry metadata (no PII), so it is not sealed — unlike
|
|
1919
|
+
* the self-only reads {@link getUsage} / {@link getBalance}, which are.
|
|
1901
1920
|
*/
|
|
1902
1921
|
listContracts(params?: ListContractsParams): Promise<ListContractsResult>;
|
|
1903
1922
|
/**
|
|
@@ -1911,7 +1930,9 @@ declare class T3nClient {
|
|
|
1911
1930
|
* and the verdict is uniform + non-disclosive (`disclosed:false`) when the
|
|
1912
1931
|
* agent is not registered under the member (R5 anti-enumeration).
|
|
1913
1932
|
*
|
|
1914
|
-
* Plaintext session read
|
|
1933
|
+
* Plaintext session read: the verdict is uniform and non-disclosive,
|
|
1934
|
+
* so it is not sealed (unlike the self-only reads {@link getUsage} /
|
|
1935
|
+
* {@link getBalance}).
|
|
1915
1936
|
*/
|
|
1916
1937
|
checkDelegation(params: GrantCheckParams): Promise<GrantCheckResult>;
|
|
1917
1938
|
/**
|
|
@@ -1972,6 +1993,32 @@ declare class T3nClient {
|
|
|
1972
1993
|
* empty / too long)
|
|
1973
1994
|
*/
|
|
1974
1995
|
createOrganisation(name: string): Promise<Did>;
|
|
1996
|
+
/**
|
|
1997
|
+
* Provision a fresh org-owned agent.
|
|
1998
|
+
*
|
|
1999
|
+
* Dispatches `create-agent` on `tee:organisation/contracts` over the
|
|
2000
|
+
* standard authenticated `action.execute` path. The node injects the
|
|
2001
|
+
* caller's DID into the contract call context, and the contract refuses
|
|
2002
|
+
* unless the caller is listed as an admin of `organisationDid`. A brand
|
|
2003
|
+
* new secp256k1 wallet is minted in-TEE for the agent; its eth-derived
|
|
2004
|
+
* DID and its raw private key are both returned. The private key is the
|
|
2005
|
+
* "authentication token" the MCP sidecar uses to authenticate as this
|
|
2006
|
+
* agent (the existing `PRIVATE_KEY` eth auth mode) — it is generated and
|
|
2007
|
+
* returned exactly once here and is never persisted or recoverable
|
|
2008
|
+
* afterwards, so the caller must capture it immediately.
|
|
2009
|
+
*
|
|
2010
|
+
* @param organisationDid - the owning organisation's DID
|
|
2011
|
+
* (`did:t3n:<40-hex>`); the caller must be one of its admins
|
|
2012
|
+
* @param name - human-readable agent name (1..=128 bytes)
|
|
2013
|
+
* @returns the new agent's DID and its one-time private key
|
|
2014
|
+
* @throws if the session is not authenticated, or if the contract
|
|
2015
|
+
* refuses (e.g. the caller is not an admin of `organisationDid`, or the
|
|
2016
|
+
* name is empty / too long)
|
|
2017
|
+
*/
|
|
2018
|
+
createAgent(organisationDid: string, name: string): Promise<{
|
|
2019
|
+
agentDid: Did;
|
|
2020
|
+
privateKey: string;
|
|
2021
|
+
}>;
|
|
1975
2022
|
/**
|
|
1976
2023
|
* Read the authenticated user's own agent-auth policy — the standing
|
|
1977
2024
|
* grants delegated to agents. Dispatches `agent-auth-get` on
|
|
@@ -2458,8 +2505,10 @@ declare class T3nClient {
|
|
|
2458
2505
|
/**
|
|
2459
2506
|
* Send a session-authenticated JSON-RPC request with plaintext
|
|
2460
2507
|
* params/result (no SessionEncryption layer). Used for tenant-facing
|
|
2461
|
-
* read endpoints
|
|
2462
|
-
*
|
|
2508
|
+
* read endpoints whose payloads carry only public / non-disclosive
|
|
2509
|
+
* metadata (`contracts.list`, `delegation.check`) where the
|
|
2510
|
+
* server-side handler reads the JSON envelope directly. (The token
|
|
2511
|
+
* self-reads moved to the sealed path — see {@link getUsage}.)
|
|
2463
2512
|
*
|
|
2464
2513
|
* Auto-attaches the `Session-Id` header; surfaces JSON-RPC errors
|
|
2465
2514
|
* the same way as {@link sendRpcRequest} (typed
|