@terminal3/t3n-sdk 5.29.0 → 5.31.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
@@ -1,3 +1,6 @@
1
+ import { T3nError, ListContractsParams, ListContractsResult, GrantCheckParams, GrantCheckResult, ContractResponseSchema, Environment } from '@terminal3/t3n-client';
2
+ export { AuthenticationError, BASE_UNITS_PER_TOKEN, ContractDescriptorDocument, ContractKind, ContractResponseError, ContractResponseSchema, DEFAULT_ENVIRONMENT, DelegationGrantKind, DelegationGrantRef, DescribeContractParams, DescribeContractResult, DescribeFunctionParams, DescribeFunctionResult, DiscoverOptions, Environment, FunctionDescriptorEntry, GrantCheckParams, GrantCheckResult, HandshakeError, InvokeError, InvokeOptions, InvokeRequest, ListContractsParams, ListContractsResult, ListContractsScope, ListedContract, NODE_URLS, OtpRateLimitedError, RpcError, SessionExpiredError, SessionStateError, StatelessCredential, StringEncoding, T3nConfigError, T3nError, TOKEN_DECIMALS, WasmError, WhoamiResult, WireBlock, WireEncodingError, _b64uEncode, b64uDecodeStrict, b64uEncodeBytes, compactDidFromBytes, decodeWasmErrorMessage, discoverCheckDelegation, discoverDescribeContract, discoverDescribeFunction, discoverListContracts, discoverWhoami, extractWasmError, formatTokens, invoke, parseContractResponse, requestToWire, toBaseUnits } from '@terminal3/t3n-client';
3
+
1
4
  /**
2
5
  * WASM Component Interface - Mirrors the WIT specification exactly
3
6
  *
@@ -918,216 +921,12 @@ interface T3nClientConfig {
918
921
  * Without this, a network attacker with their own TDX VM can hand the
919
922
  * SDK a forged-but-valid attestation for a key it controls and read
920
923
  * every session. It is a required field precisely so no caller can
921
- * omit it by accident — bypassing verification must be a visible,
924
+ * omit it by accident — skipping verification must be a visible,
922
925
  * grep-able choice.
923
926
  */
924
927
  trustAnchor: TrustAnchorOrUnsafe;
925
928
  }
926
929
 
927
- /**
928
- * Error classes for T3n SDK
929
- */
930
- /**
931
- * Base error class for T3n SDK errors
932
- */
933
- declare class T3nError extends Error {
934
- readonly code?: string | undefined;
935
- constructor(message: string, code?: string | undefined);
936
- }
937
- /**
938
- * Error thrown when the {@link T3nClientConfig} handed to the
939
- * {@link T3nClient} constructor is invalid — a required field is
940
- * missing or malformed. Thrown eagerly at construction so a
941
- * misconfiguration fails fast with a named, grep-able error instead
942
- * of crashing deep in the handshake.
943
- *
944
- * The `field` names the offending config key so callers can branch or
945
- * log with full fidelity rather than parsing the message.
946
- */
947
- declare class T3nConfigError extends T3nError {
948
- readonly field?: string | undefined;
949
- constructor(message: string, field?: string | undefined);
950
- }
951
- /**
952
- * Error thrown when session is in invalid state for operation
953
- */
954
- declare class SessionStateError extends T3nError {
955
- readonly currentState: string;
956
- constructor(message: string, currentState: string);
957
- }
958
- /**
959
- * Error thrown during authentication process
960
- */
961
- declare class AuthenticationError extends T3nError {
962
- readonly authMethod?: string | undefined;
963
- constructor(message: string, authMethod?: string | undefined);
964
- }
965
- /**
966
- * Error thrown during handshake process
967
- */
968
- declare class HandshakeError extends T3nError {
969
- constructor(message: string);
970
- }
971
- /**
972
- * Error thrown when a session-authenticated SDK client detects that the
973
- * caller-owned session is no longer usable and the caller must
974
- * re-authenticate before the call can succeed.
975
- *
976
- * Unlike {@link OrgDataClient} (which owns its ETH-secret-driven session
977
- * and silently rebuilds it on expiry), {@link SessionOrgDataClient} is
978
- * handed a caller-owned `T3nClient` whose session is bound to an
979
- * interactive flow (typically SIWE). The SDK can't re-authenticate
980
- * non-interactively, so on the same wire patterns that the
981
- * self-owned client recovers from, the session-bound client translates
982
- * the underlying error into this class and rethrows. The original error
983
- * is preserved on the native ES2022 `cause` property.
984
- *
985
- * Callers branch on `instanceof SessionExpiredError` to route the user
986
- * to a re-auth UX (e.g. SIWE modal / login redirect) rather than
987
- * parsing the message of a raw {@link RpcError}.
988
- */
989
- declare class SessionExpiredError extends T3nError {
990
- constructor(cause: unknown);
991
- }
992
- /**
993
- * Error thrown during RPC communication.
994
- *
995
- * `message` is the human-readable error (preferring the server's
996
- * `error.data.detail` when present, with the request id appended in
997
- * `[<id>]` form so a UI that only surfaces `.message` still gives an
998
- * operator something to grep). The structured fields below preserve
999
- * the same info for callers that want to render or log them
1000
- * separately — e.g. a toast that shows `detail` but surfaces
1001
- * `requestId` in a "copy for support" affordance.
1002
- */
1003
- declare class RpcError extends T3nError {
1004
- readonly rpcMethod?: string | undefined;
1005
- readonly httpStatus?: number | undefined;
1006
- /** Server-attached detail (JSON-RPC `error.data.detail`). User-facing kinds
1007
- * carry the specific reason here; internal kinds omit it. */
1008
- readonly detail?: string | undefined;
1009
- /** Per-request correlation id (JSON-RPC `error.data.request_id`). */
1010
- readonly requestId?: string | undefined;
1011
- constructor(message: string, rpcMethod?: string | undefined, httpStatus?: number | undefined,
1012
- /** Server-attached detail (JSON-RPC `error.data.detail`). User-facing kinds
1013
- * carry the specific reason here; internal kinds omit it. */
1014
- detail?: string | undefined,
1015
- /** Per-request correlation id (JSON-RPC `error.data.request_id`). */
1016
- requestId?: string | undefined);
1017
- }
1018
- /**
1019
- * Error thrown when an OTP send is throttled by the node.
1020
- *
1021
- * The email-OTP login flow's `InitEmailOtp` step refuses a send when a
1022
- * still-valid code was issued within the resend cooldown
1023
- * (`reason: "cooldown_active"`) or the rolling per-recipient send cap is
1024
- * exhausted (`reason: "send_cap_exceeded"`). Previously a cooldown-
1025
- * suppressed resend returned a silent success, leaving a user who never
1026
- * received the first code at a dead end; this typed error lets the app
1027
- * render a "you just requested a code — retry in {retryAfterSecs}s"
1028
- * affordance instead.
1029
- *
1030
- * Recognised from the node's stable
1031
- * `OtpRateLimited (reason=…, retry_after_secs=…)` wire token (pinned by a
1032
- * server-side test). Subclass of {@link RpcError} so callers that catch
1033
- * the parent still see `httpStatus`/`requestId`; callers that want the
1034
- * typed surface `instanceof OtpRateLimitedError` to read `reason` and
1035
- * `retryAfterSecs`.
1036
- *
1037
- * Retryable after `retryAfterSecs` (caller-side back-off).
1038
- */
1039
- declare class OtpRateLimitedError extends RpcError {
1040
- /** Stable reason code: `"cooldown_active"` or `"send_cap_exceeded"`. */
1041
- readonly reason: string;
1042
- /** Seconds to wait before retrying the send (parsed from `retry_after_secs=`). */
1043
- readonly retryAfterSecs: number;
1044
- constructor(message: string,
1045
- /** Stable reason code: `"cooldown_active"` or `"send_cap_exceeded"`. */
1046
- reason: string,
1047
- /** Seconds to wait before retrying the send (parsed from `retry_after_secs=`). */
1048
- retryAfterSecs: number, rpcMethod?: string, requestId?: string);
1049
- }
1050
- /**
1051
- * Error thrown when WASM operations fail
1052
- */
1053
- declare class WasmError extends T3nError {
1054
- readonly operation?: string | undefined;
1055
- readonly payload?: unknown | undefined;
1056
- constructor(message: string, operation?: string | undefined, payload?: unknown | undefined);
1057
- }
1058
- /**
1059
- * Decode WASM error message from comma-separated byte array format
1060
- * WASM errors often come as "83,101,114,100,101..." which represents ASCII bytes
1061
- *
1062
- * @param errorMessage - The error message string that may contain comma-separated bytes
1063
- * @returns Decoded error message if it was encoded, otherwise original message
1064
- */
1065
- declare function decodeWasmErrorMessage(errorMessage: string): string;
1066
- /**
1067
- * Extract and decode error from WASM ComponentError
1068
- *
1069
- * @param error - The error object from WASM
1070
- * @returns Decoded error message
1071
- */
1072
- declare function extractWasmError(error: unknown): string;
1073
-
1074
- /**
1075
- * Contract response decoding for {@link T3nClient.execute}.
1076
- *
1077
- * ## On-wire shape
1078
- *
1079
- * Trinity contracts are declared as `result<list<u8>, string>` in WIT and
1080
- * return JSON-encoded bytes. The server-side pipeline is:
1081
- *
1082
- * 1. The contract's returned bytes are deserialized into a JSON `Value`
1083
- * (the contract's decoded return value).
1084
- * 2. The host wraps that value in an internal `ContractResponse` struct
1085
- * for bookkeeping — it carries an extracted `otp_state` alongside the
1086
- * response.
1087
- * 3. The host then unwraps the struct, discarding the `otp_state` field
1088
- * and returning only the inner `Value` across the executor boundary.
1089
- * 4. That plain `Value` is serialised through the session channel.
1090
- *
1091
- * The client therefore receives the contract's **decoded JSON value
1092
- * directly** — no `{response, otp_state}` envelope, despite what the
1093
- * struct name suggests. `parseContractResponse` reflects that reality:
1094
- * it does a typed `JSON.parse` with optional schema validation, nothing
1095
- * more. OTP flows read their `otp_status` / OTP fields directly off the
1096
- * contract's response body; there is no separate envelope field for them
1097
- * on this path.
1098
- */
1099
-
1100
- /**
1101
- * Minimal validator interface. Any library that exposes `.parse(value) -> T`
1102
- * (zod, valibot, superstruct, custom) is compatible.
1103
- */
1104
- interface ContractResponseSchema<T> {
1105
- parse(value: unknown): T;
1106
- }
1107
- /**
1108
- * Thrown when the response string from {@link T3nClient.execute} cannot
1109
- * be parsed as JSON.
1110
- *
1111
- * Schema-validation failures are NOT wrapped — they surface as whatever
1112
- * error the caller's validator throws, preserving the rich diagnostics
1113
- * those libraries already provide.
1114
- */
1115
- declare class ContractResponseError extends T3nError {
1116
- readonly raw?: string | undefined;
1117
- constructor(message: string, raw?: string | undefined);
1118
- }
1119
- /**
1120
- * Parse the JSON-encoded response returned by {@link T3nClient.execute}
1121
- * into a typed value.
1122
- *
1123
- * @param raw - the string returned by {@link T3nClient.execute}
1124
- * @param schema - optional validator applied to the parsed value
1125
- * @returns the decoded response, typed as `T`
1126
- * @throws {ContractResponseError} when `raw` is not valid JSON
1127
- * @throws whatever the schema throws on validation failure (e.g. `ZodError`)
1128
- */
1129
- declare function parseContractResponse<T = unknown>(raw: string, schema?: ContractResponseSchema<T>): T;
1130
-
1131
930
  /**
1132
931
  * Delegated agents and the T3N OAuth connections that act as them. Wire types
1133
932
  * and strict decoders for the functions the `T3nClient` wrappers dispatch:
@@ -2795,205 +2594,6 @@ interface ActivityExportFile {
2795
2594
  csv: string;
2796
2595
  }
2797
2596
 
2798
- /**
2799
- * Contract-discovery wire shapes.
2800
- *
2801
- * Field-for-field mirrors of the node's `contracts.list` and `delegation.check`
2802
- * JSON-RPC responses (`service::contract_discovery::{ListedContract,
2803
- * ListContractsResponse}` and `service::grant_check::{GrantRef,
2804
- * GrantCheckResponse}`). Both methods are session-authenticated plaintext reads
2805
- * dispatched over `/api/rpc` — the same posture as `token.get-usage` — so the
2806
- * SDK wrappers return the parsed `result` object directly.
2807
- */
2808
- /** The navigable starting points of the discovery funnel. */
2809
- type ListContractsScope = "core" | "org" | "self";
2810
- /** Params for `contracts.list` (every field optional; `{}` lists core). */
2811
- interface ListContractsParams {
2812
- /** `"core"` (default) | `"org"` | `"self"`. */
2813
- scope?: ListContractsScope;
2814
- /** Target org DID (required for scope `"org"`). */
2815
- org_did?: string;
2816
- /** The member the agent acts for (required for scope `"org"` / `"self"`). */
2817
- pii_did?: string;
2818
- /** Page offset (defaults to 0 server-side). */
2819
- offset?: number;
2820
- /** Page size (defaults + clamped server-side). */
2821
- limit?: number;
2822
- }
2823
- /** Contract kind — `"core"` platform system contract, `"tenant"` z-space. */
2824
- type ContractKind = "core" | "tenant";
2825
- /** One contract as presented by `contracts.list`. */
2826
- interface ListedContract {
2827
- /** Canonical name: `tee:<name>` for core, `z:<tid>:<tail>` for tenant. */
2828
- name: string;
2829
- kind: ContractKind;
2830
- /** Current registered version; `null` when the contract is not registered. */
2831
- version: string | null;
2832
- /** Descriptor summary, or empty when no descriptor is published. */
2833
- summary: string;
2834
- /** Descriptor tags, or empty. */
2835
- tags: string[];
2836
- /** Owning DID: the org DID (org mode) or the member's own DID (self mode). */
2837
- owner_org_did?: string;
2838
- /**
2839
- * Human-facing short name: the trailing segment of `name` (`payroll` from
2840
- * `z:<tid>:payroll`, `user` from `tee:user`). Present this to people instead
2841
- * of the full canonical `name`, which remains the dispatch key.
2842
- */
2843
- short_name: string;
2844
- }
2845
- /** Response body for `contracts.list`. */
2846
- interface ListContractsResult {
2847
- scope: string;
2848
- contracts: ListedContract[];
2849
- next_offset: number | null;
2850
- }
2851
- /**
2852
- * Which standing grant a satisfied/missing entry refers to — the stable,
2853
- * caller-facing values. Reads are normalised to these two, so switch logic on
2854
- * them stays exhaustive.
2855
- */
2856
- type DelegationGrantKind = "member_delegation" | "org_delegation";
2857
- /** Params for `delegation.check` (the generic capability read). */
2858
- interface GrantCheckParams {
2859
- /** The target contract whose requirements are checked. */
2860
- contract: string;
2861
- /** The member the agent wants to act for (the subject). */
2862
- pii_did: string;
2863
- /** Functions the intended action needs. */
2864
- functions: string[];
2865
- /** Org-data scopes the intended action needs. */
2866
- scopes: string[];
2867
- }
2868
- /** One grant requirement — satisfied or missing. */
2869
- interface DelegationGrantRef {
2870
- grant: DelegationGrantKind;
2871
- /** The target contract's canonical name. */
2872
- contract: string;
2873
- functions: string[];
2874
- scopes: string[];
2875
- }
2876
- /**
2877
- * Response for `delegation.check`: the `member_delegation ∩ org_delegation` verdict.
2878
- *
2879
- * `disclosed` is `true` only when the agent is registered under `pii_did`, so
2880
- * org-side status was safe to disclose; `false` yields the uniform,
2881
- * non-disclosive verdict (`authorised:false, satisfied:[], missing:[]`) that is
2882
- * byte-invariant to the requested capability (R5 anti-enumeration).
2883
- */
2884
- interface GrantCheckResult {
2885
- authorised: boolean;
2886
- disclosed: boolean;
2887
- satisfied: DelegationGrantRef[];
2888
- missing: DelegationGrantRef[];
2889
- }
2890
- /** Response for the `whoami` operation: who the key resolves to, and where. */
2891
- interface WhoamiResult {
2892
- /** The DID the relayed api key resolves to. */
2893
- did: string;
2894
- /**
2895
- * The org DIDs the agent itself belongs to (its own agent-keyed membership),
2896
- * or `[]` when it belongs to none. Each is a valid `org_did` for
2897
- * `contracts.list` scope `"org"`, so this is the seed for browsing the agent's
2898
- * own orgs.
2899
- */
2900
- organisations: string[];
2901
- /**
2902
- * The agent's owning / managing DID — usually the org that created it. `null`
2903
- * for a missing record (agents created without a hosted card or agent URI have
2904
- * no registry record), a record with no owner link, or a malformed record
2905
- * (decode failure is logged at `WARN`, never a silent authority downgrade); a
2906
- * snapshot read failure is surfaced as an error, not reported as `null`. The
2907
- * owner link is mutable and may have changed since creation, so treat this as
2908
- * best-effort, not an authority.
2909
- */
2910
- owner: string | null;
2911
- }
2912
- /** Params for the `describe.contract` operation. */
2913
- interface DescribeContractParams {
2914
- /**
2915
- * Registry name: `tee:<name>/contracts` (core) or `z:<tid>:<tail>` (tenant).
2916
- * The bare core form `contracts.list` presents (`tee:<name>` / `y:<name>`) is
2917
- * also accepted — the node maps it onto the `/contracts` registry key — so a
2918
- * `ListedContract.name` feeds straight in.
2919
- */
2920
- contract: string;
2921
- /** Explicit version; omitted resolves the current registered version. */
2922
- version?: string;
2923
- }
2924
- /** Params for the `describe.function` operation. */
2925
- interface DescribeFunctionParams {
2926
- /**
2927
- * Registry name: `tee:<name>/contracts` (core) or `z:<tid>:<tail>` (tenant).
2928
- * The bare core form `contracts.list` presents (`tee:<name>` / `y:<name>`) is
2929
- * also accepted — the node maps it onto the `/contracts` registry key.
2930
- */
2931
- contract: string;
2932
- /** The single function to project from the contract's descriptor. */
2933
- function: string;
2934
- /** Explicit version; omitted resolves the current registered version. */
2935
- version?: string;
2936
- }
2937
- /**
2938
- * One function's descriptor entry — the `describe.function` result and the
2939
- * element type of a {@link ContractDescriptorDocument}'s `functions` array.
2940
- *
2941
- * Left open-ended: the descriptor document's full schema (argument schema,
2942
- * wire projection, auth requirements) is owned by the contract descriptor
2943
- * registry and served verbatim by the node. The named fields are the ones the
2944
- * node's descriptor path always presents.
2945
- */
2946
- interface FunctionDescriptorEntry {
2947
- /** Contract function name (e.g. `compute-payroll`). */
2948
- name: string;
2949
- summary?: string;
2950
- /** Whether the function mutates state. */
2951
- mutates?: boolean;
2952
- [key: string]: unknown;
2953
- }
2954
- /**
2955
- * The node's descriptor document for a contract — the `descriptor` field of a
2956
- * {@link DescribeContractResult}. Open-ended for the same reason as
2957
- * {@link FunctionDescriptorEntry}: the node returns the registry's descriptor
2958
- * document verbatim.
2959
- */
2960
- interface ContractDescriptorDocument {
2961
- name?: string;
2962
- version?: string;
2963
- summary?: string;
2964
- tags?: string[];
2965
- functions?: FunctionDescriptorEntry[];
2966
- [key: string]: unknown;
2967
- }
2968
- /**
2969
- * Result of the `describe.contract` operation. The node wraps the descriptor
2970
- * document with the resolved dispatch `version`, so an authorised describe hands
2971
- * back the exact `scriptVersion` an {@link invoke} call needs alongside the
2972
- * schema. Returned only on the authorised path; a gate miss or unknown contract
2973
- * yields the uniform non-disclosive error, never this wrapper.
2974
- */
2975
- interface DescribeContractResult {
2976
- /** The canonical registry name, echoed from the request. */
2977
- contract: string;
2978
- /** The resolved dispatch version — pass as `scriptVersion` to `invoke`. */
2979
- version: string;
2980
- /** The contract's full descriptor document. */
2981
- descriptor: ContractDescriptorDocument;
2982
- }
2983
- /**
2984
- * Result of the `describe.function` operation: the resolved dispatch `version`
2985
- * paired with the single projected function entry. Same authorised-path-only
2986
- * guarantee as {@link DescribeContractResult}.
2987
- */
2988
- interface DescribeFunctionResult {
2989
- /** The canonical registry name, echoed from the request. */
2990
- contract: string;
2991
- /** The resolved dispatch version — pass as `scriptVersion` to `invoke`. */
2992
- version: string;
2993
- /** The single projected function's descriptor entry. */
2994
- descriptor: FunctionDescriptorEntry;
2995
- }
2996
-
2997
2597
  /**
2998
2598
  * T3n Client - Main SDK class
2999
2599
  *
@@ -3102,7 +2702,7 @@ declare class T3nClient {
3102
2702
  /**
3103
2703
  * OIDC two-step authentication with session-binding nonce.
3104
2704
  *
3105
- * Bypasses the WASM client state machine and makes two encrypted
2705
+ * Skips the WASM client state machine and makes two encrypted
3106
2706
  * RPC calls directly:
3107
2707
  * 1. `InitOidcAuth { provider }` → server generates nonce → returns
3108
2708
  * `ProvideNonce { nonce }`.
@@ -3113,7 +2713,7 @@ declare class T3nClient {
3113
2713
  private authenticateOidc;
3114
2714
  /**
3115
2715
  * Parse a `Finish { did }` reply shared by the manual (non-WASM) auth flows
3116
- * that bypass the client state machine (interactive OIDC, keyless workload).
2716
+ * that skip the client state machine (interactive OIDC, keyless workload).
3117
2717
  *
3118
2718
  * Validates the `oidc_auth_action` tag before reading `did`: a decodable but
3119
2719
  * non-`Finish` reply is reported as such rather than silently misread as a
@@ -3137,7 +2737,7 @@ declare class T3nClient {
3137
2737
  * the token and mints/resolves the DID `oidc:<iss>:<sub>` →
3138
2738
  * returns `Finish { did }`.
3139
2739
  *
3140
- * Bypasses the WASM client state machine (mirrors `authenticateOidc` /
2740
+ * Skips the WASM client state machine (mirrors `authenticateOidc` /
3141
2741
  * `authenticateEmailOtp`); the `SubmitWorkloadToken` action tag is
3142
2742
  * matched server-side.
3143
2743
  */
@@ -3145,7 +2745,7 @@ declare class T3nClient {
3145
2745
  /**
3146
2746
  * Email-OTP two-step authentication.
3147
2747
  *
3148
- * Symmetric with {@link authenticateOidc}: bypasses the WASM client
2748
+ * Symmetric with {@link authenticateOidc}: skips the WASM client
3149
2749
  * state machine and makes two encrypted RPC calls directly:
3150
2750
  * 1. `InitEmailOtp { email }` → node sends a one-time code → returns
3151
2751
  * an `OtpSent` ack.
@@ -4165,7 +3765,7 @@ declare class T3nClient {
4165
3765
  *
4166
3766
  * The KYC webhook orphan-attestation flow stays here: when
4167
3767
  * `requireExistingUser` is set, the contract identifies the user
4168
- * by DID (vendorData) instead of email and the gate is bypassed.
3768
+ * by DID (vendorData) instead of email and the email gate does not apply.
4169
3769
  *
4170
3770
  * @throws {UserUpsertError} when the contract returns a typed
4171
3771
  * error (`email_not_verified`, `legacy_field`, `user_not_found`).
@@ -4521,250 +4121,6 @@ declare function createRandomHandler(): GuestToHostHandler;
4521
4121
  */
4522
4122
  declare function createDefaultHandlers(baseUrl: string, trustAnchor: TrustAnchorOrUnsafe): GuestToHostHandlers;
4523
4123
 
4524
- /**
4525
- * Stateless agent auth: an API key or an OAuth bearer.
4526
- *
4527
- * `invoke` posts once to `POST /api/invoke` — an HTTPS-only
4528
- * endpoint (see the HTTPS-guard note below) that authenticates an agent by
4529
- * one {@link StatelessCredential}: an org agent's opaque API key
4530
- * (`X-T3N-Api-Key: t3n_key_<...>`) or a delegated agent's OAuth access token
4531
- * (`Authorization: Bearer <token>`), and executes a
4532
- * `z:` contract as that agent in the SAME request. Unlike
4533
- * {@link T3nClient.execute}, there is **no** ML-KEM handshake, **no**
4534
- * `Session-Id`, and **no** session state: the node derives the acting agent
4535
- * DID from the relayed key per-call (`resolve_stateless_credential`
4536
- * driving the session contract's `api_key` action), then runs the same
4537
- * execute pipeline `action.execute` runs after `check_authentication`
4538
- * (`ActionService::execute_as_did`), and returns the contract's decoded
4539
- * result as a plain `Json(result)` body — NOT a JSON-RPC envelope.
4540
- *
4541
- * Because the response is the bare decoded value (no `{jsonrpc,result,id}`
4542
- * wrapper to unwrap), decoding reuses {@link parseContractResponse} — the
4543
- * exact same JSON.parse + optional-schema path {@link T3nClient.executeAndDecode}
4544
- * uses for the session `execute` RPC — so callers get identical typed /
4545
- * schema-validated decoding on either path.
4546
- *
4547
- * This module intentionally does NOT import {@link T3nClient}, the WASM
4548
- * component loader, or any handshake/session machinery — `invoke` is
4549
- * a single fetch, nothing else.
4550
- *
4551
- * ### Keyed discovery transports
4552
- * Alongside `invoke` (which acts), this module exports the keyed **discovery**
4553
- * reads — {@link discoverWhoami}, {@link discoverListContracts},
4554
- * {@link discoverCheckDelegation}, {@link discoverDescribeContract},
4555
- * {@link discoverDescribeFunction}. They are the api-key counterpart of the
4556
- * session `T3nClient.listContracts` / `checkDelegation` reads: each POSTs a
4557
- * `{ method, params }` envelope to the node's `POST /api/discover` with the
4558
- * same `X-T3N-Api-Key` header, HTTPS guard, timeout, and key-safe error
4559
- * hygiene as `invoke`, and returns the node's raw JSON result. The session
4560
- * `T3nClient` methods are untouched — these live beside `invoke`, off the
4561
- * session client, so the relay reads never open a session. Every transport
4562
- * shares the {@link postKeyed} core, so there is one implementation of the
4563
- * secure-transport + secret-hygiene rules below, not two.
4564
- *
4565
- * ### HTTPS guard
4566
- * The API key is a long-lived bearer credential relayed in a plain header,
4567
- * so `invoke` refuses to send it over an insecure transport: `baseUrl`
4568
- * must be `https:`, unless the host is a local-dev loopback
4569
- * (`localhost` / `127.0.0.1` / `[::1]`), in which case plain `http:` is
4570
- * allowed. The check runs before any network activity — an insecure
4571
- * `baseUrl` never gets as far as a `fetch` call.
4572
- *
4573
- * ### Error hygiene
4574
- * Every error `invoke` throws is a fixed, generic
4575
- * {@link InvokeError} message — the response body text, the
4576
- * underlying network error's message, and the api key are never
4577
- * interpolated into it. This is defense in depth against a server (or a
4578
- * malicious intermediary) that echoes the key or other secrets back in an
4579
- * error body: whatever comes back over the wire on a non-2xx response is
4580
- * discarded, not surfaced. The timeout timer also stays armed until the
4581
- * response body has been fully read (or has itself timed out) — see
4582
- * {@link invoke}'s implementation — so a connection that delivers
4583
- * headers and then stalls on the body still respects `timeoutMs`.
4584
- */
4585
-
4586
- /**
4587
- * Wire body for `POST /api/invoke` — mirrors the server's
4588
- * server-side `ExecuteActionRequest`, the same shape
4589
- * `T3nClient`'s `execute*` wrappers build for the session `action.execute`
4590
- * RPC. Field names are load-bearing: the server deserialises strictly into
4591
- * `contract_id` / `contract_version` / `function_name` (see
4592
- * `T3nClient.executeSystemContract`'s doc comment) — `contract` / `version`
4593
- * / `function` produce a 400.
4594
- */
4595
- interface InvokeRequest {
4596
- contract_id: string;
4597
- contract_version: string;
4598
- function_name: string;
4599
- /** Delegated-call target member; omitted for a self (non-delegated) call. */
4600
- pii_did?: string;
4601
- input?: unknown;
4602
- }
4603
- /**
4604
- * The credential `/api/invoke` and `/api/discover` resolve, exactly one of:
4605
- *
4606
- * - `apiKey`: an org agent's opaque API key (`t3n_key_<...>`), sent as
4607
- * `X-T3N-Api-Key`;
4608
- * - `bearer`: a delegated agent's OAuth access token, sent as
4609
- * `Authorization: Bearer <token>`.
4610
- *
4611
- * The node resolves either on the same routes (its `stateless_credential`
4612
- * action tries the bearer first). Relayed verbatim, never logged and never
4613
- * interpolated into any error this module throws.
4614
- */
4615
- type StatelessCredential = {
4616
- apiKey: string;
4617
- bearer?: never;
4618
- } | {
4619
- bearer: string;
4620
- apiKey?: never;
4621
- };
4622
- /** Options for {@link invoke}. */
4623
- type InvokeOptions = StatelessCredential & {
4624
- /**
4625
- * RPC base URL of the T3n node, e.g. `https://node.example.com`. Must be
4626
- * `https:` unless the host is a local-dev loopback (`localhost` /
4627
- * `127.0.0.1` / `[::1]`) — see the module doc comment's HTTPS-guard note.
4628
- */
4629
- baseUrl: string;
4630
- /** The wire request to execute, built to the {@link InvokeRequest} shape. */
4631
- request: InvokeRequest;
4632
- /** Fetch timeout in ms. Defaults to 30s, matching {@link HttpTransport}. */
4633
- timeoutMs?: number;
4634
- };
4635
- /**
4636
- * Thrown when `POST /api/invoke` fails at the transport or HTTP
4637
- * layer (network failure, timeout, non-2xx status). Contract-level errors
4638
- * the node returns as a 2xx JSON error value are NOT wrapped here — they
4639
- * flow through {@link parseContractResponse}'s normal return, same as the
4640
- * session `execute` path.
4641
- *
4642
- * The message is always one of a small set of fixed, generic strings — it
4643
- * NEVER contains the raw api key, the response body text, or the
4644
- * underlying network error's message: a server (or a
4645
- * misbehaving intermediary) that echoes the key or other secrets back in
4646
- * an error body must not be able to leak them through this error's
4647
- * message.
4648
- */
4649
- declare class InvokeError extends T3nError {
4650
- readonly status?: number | undefined;
4651
- constructor(message: string, status?: number | undefined);
4652
- }
4653
- /**
4654
- * Execute a `z:` contract as an agent, authenticating with an API key or an
4655
- * OAuth bearer ({@link StatelessCredential}) — one request, no handshake, no
4656
- * session.
4657
- *
4658
- * @param opts - baseUrl, apiKey, and the wire request to execute
4659
- * @param schema - optional validator applied to the decoded result (e.g. a
4660
- * zod schema); anything exposing `.parse(value)` is accepted, same as
4661
- * {@link T3nClient.executeAndDecode}
4662
- * @returns the contract's decoded result, typed as `T`
4663
- * @throws {InvokeError} if `baseUrl` is insecure, on a network
4664
- * failure/timeout, or on a non-2xx response
4665
- * @throws {ContractResponseError} if the node returns a 2xx with a body
4666
- * that is not valid JSON
4667
- */
4668
- declare function invoke<T = unknown>(opts: InvokeOptions, schema?: ContractResponseSchema<T>): Promise<T>;
4669
- /**
4670
- * Transport options shared by the keyed discovery reads. Mirrors the transport
4671
- * half of {@link InvokeOptions} (no `request`; the operation params are the
4672
- * second argument of each read). Same HTTPS + secret-hygiene rules as `invoke`.
4673
- */
4674
- type DiscoverOptions = StatelessCredential & {
4675
- /**
4676
- * RPC base URL of the T3n node, e.g. `https://node.example.com`. Must be
4677
- * `https:` unless the host is a local-dev loopback — see
4678
- * {@link InvokeOptions.baseUrl}.
4679
- */
4680
- baseUrl: string;
4681
- /** Fetch timeout in ms. Defaults to 30s, matching {@link invoke}. */
4682
- timeoutMs?: number;
4683
- };
4684
- /**
4685
- * `whoami` — resolve the DID the relayed credential maps to. The node never
4686
- * trusts a caller-supplied DID; this is the relay's sole DID source.
4687
- *
4688
- * @throws {InvokeError} if `baseUrl` is insecure, on a network failure/timeout,
4689
- * or on a non-2xx response
4690
- */
4691
- declare function discoverWhoami(opts: DiscoverOptions): Promise<WhoamiResult>;
4692
- /**
4693
- * `contracts.list` — the keyed counterpart of {@link T3nClient.listContracts}.
4694
- * Absent `params` (`{}`) lists the curated `core` contracts; `org` / `self`
4695
- * scopes are discovery-grant gated server-side (R5 non-disclosive empty page).
4696
- *
4697
- * @throws {InvokeError} — see {@link discoverWhoami}
4698
- */
4699
- declare function discoverListContracts(opts: DiscoverOptions, params?: ListContractsParams): Promise<ListContractsResult>;
4700
- /**
4701
- * `delegation.check` — the keyed counterpart of
4702
- * {@link T3nClient.checkDelegation}. Returns the `member_delegation ∩ org_delegation`
4703
- * verdict for the acting agent (as itself, or for `params.pii_did`).
4704
- *
4705
- * @throws {InvokeError} — see {@link discoverWhoami}
4706
- */
4707
- declare function discoverCheckDelegation(opts: DiscoverOptions, params: GrantCheckParams): Promise<GrantCheckResult>;
4708
- /**
4709
- * `describe.contract` — the authority-gated keyed describe read. Returns
4710
- * `{ contract, version, descriptor }`: the resolved dispatch `version` (the
4711
- * `scriptVersion` an {@link invoke} call needs) alongside the contract's full
4712
- * descriptor document. Unlike the session/stdio public descriptor GET, the relay
4713
- * path is membership-gated on the contract's owning org and returns a uniform
4714
- * non-disclosive error for both "not found" and "not authorised"
4715
- * (anti-enumeration).
4716
- *
4717
- * @throws {InvokeError} — see {@link discoverWhoami}
4718
- */
4719
- declare function discoverDescribeContract(opts: DiscoverOptions, params: DescribeContractParams): Promise<DescribeContractResult>;
4720
- /**
4721
- * `describe.function` — the authority-gated keyed describe read for a single
4722
- * function. Returns `{ contract, version, descriptor }` with `descriptor` the
4723
- * projected function entry. Same gating as {@link discoverDescribeContract}.
4724
- *
4725
- * @throws {InvokeError} — see {@link discoverWhoami}
4726
- */
4727
- declare function discoverDescribeFunction(opts: DiscoverOptions, params: DescribeFunctionParams): Promise<DescribeFunctionResult>;
4728
-
4729
- /**
4730
- * Token fixed-point units (USDT-style 6 decimals).
4731
- *
4732
- * As of `tee:*` metering v2, every token amount on the wire —
4733
- * {@link BalanceRow}'s `available`/`reserved`, {@link UsageEntry.amount},
4734
- * and `total_supply` — is denominated in **base units**, where
4735
- * `1 T3N token = `{@link BASE_UNITS_PER_TOKEN}` base units`. The node
4736
- * meters the *actual* fractional cost of each operation (pro-rata by
4737
- * bytes / byte-seconds / fuel) down to `1e-6` token, so amounts are
4738
- * raw integers in base units, NOT whole tokens.
4739
- *
4740
- * The wire fields are left as raw base units (no silent rescaling — that
4741
- * would lose precision for large balances and surprise callers doing
4742
- * arithmetic). Use {@link formatTokens} to render a human "tokens"
4743
- * string and {@link toBaseUnits} to convert a token figure back.
4744
- *
4745
- * ⚠️ Breaking vs. the pre-decimals SDK: a balance that used to read `5`
4746
- * (whole tokens) now reads `5_000_000` (base units). Multiply existing
4747
- * display code through {@link formatTokens}.
4748
- */
4749
- /** Decimal places in a T3N token (fixed; mirrors the node constant). */
4750
- declare const TOKEN_DECIMALS = 6;
4751
- /** Base units per whole T3N token — `10 ** TOKEN_DECIMALS`. */
4752
- declare const BASE_UNITS_PER_TOKEN = 1000000;
4753
- /**
4754
- * Render a base-unit amount as a human-readable token string, e.g.
4755
- * `25_920_000 → "25.92"`, `1_000_000 → "1"`, `4768 → "0.004768"`.
4756
- *
4757
- * Trailing-zero fraction digits are trimmed; an integer amount renders
4758
- * with no decimal point. Accepts `number` or `bigint`; for balances
4759
- * above `Number.MAX_SAFE_INTEGER` prefer passing a `bigint`.
4760
- */
4761
- declare function formatTokens(baseUnits: number | bigint): string;
4762
- /**
4763
- * Convert a whole-or-fractional token figure to base units (rounded to
4764
- * the nearest base unit). E.g. `25.92 → 25_920_000`, `1 → 1_000_000`.
4765
- */
4766
- declare function toBaseUnits(tokens: number): number;
4767
-
4768
4124
  /**
4769
4125
  * OrgDataClient — typed wrapper over the existing authenticated
4770
4126
  * `/api/rpc` + `action.execute` pipeline.
@@ -5110,7 +4466,7 @@ interface OrgDataClientOptions extends ExecuteOrgDataActionOptions {
5110
4466
  * Extra headers added to every `/api/rpc` request the internal
5111
4467
  * `T3nClient` makes. Mirrors `T3nClientConfig.headers` — needed when
5112
4468
  * the node sits behind an edge policy that gates `/api/rpc` on a
5113
- * header (e.g. the staging Cloud Armor bypass token).
4469
+ * header (e.g. an access token the edge requires).
5114
4470
  */
5115
4471
  headers?: Record<string, string>;
5116
4472
  /**
@@ -5118,7 +4474,7 @@ interface OrgDataClientOptions extends ExecuteOrgDataActionOptions {
5118
4474
  * attestation check (SP-003). Mirrors `T3nClientConfig.trustAnchor`:
5119
4475
  * either a pinned {@link TrustAnchor} or the explicit
5120
4476
  * `{ unsafe_trust_server: true }` opt-out. Required (no silent default)
5121
- * so bypassing verification is always a visible, grep-able choice —
4477
+ * so skipping verification is always a visible, grep-able choice —
5122
4478
  * an authenticated ETH-key caller is still MITM-able on the ML-KEM key.
5123
4479
  * Signed trust-anchor manifests are not published yet, so most callers
5124
4480
  * pass `{ unsafe_trust_server: true }` today.
@@ -5277,8 +4633,8 @@ declare class OrgDataClient {
5277
4633
  * (`admin`|`member`) (org-admin only). A human is a member absent from the
5278
4634
  * agent registry — the exact complement of {@link listAgents}.
5279
4635
  *
5280
- * No profile PII (name/email) is returned; the roster is DID + role only
5281
- * (AI-175). The response carries at most `limit` members plus an optional
4636
+ * No profile PII (name/email) is returned; the roster is DID + role only.
4637
+ * The response carries at most `limit` members plus an optional
5282
4638
  * `next_cursor`; to enumerate every member, pass the returned `next_cursor`
5283
4639
  * back as `cursor` until it is absent.
5284
4640
  */
@@ -5626,14 +4982,13 @@ declare class SessionOrgDataClient {
5626
4982
  declare function createOrgDataClientFromSession(t3n: T3nClient, baseUrl: string): SessionOrgDataClient;
5627
4983
 
5628
4984
  /**
5629
- * Payroll request shapes + shared encoding utilities.
4985
+ * Payroll request shapes.
5630
4986
  *
5631
4987
  * Envelope-free authorisation removed the per-call delegation
5632
4988
  * credential and envelope entirely: authority is now the standing on-chain
5633
4989
  * `member_delegation` ∩ `org_delegation` intersection the host re-reads every call, and
5634
4990
  * every payroll call emits the plain Direct wire variant (`{ request }`).
5635
- * What remains here is the request body shape, its canonical defaults, and
5636
- * the base64url / DID helpers callers still need.
4991
+ * What remains here is the request body shape and its canonical defaults.
5637
4992
  *
5638
4993
  * Wire conventions retained from the contract:
5639
4994
  * - `batch_cap_cents` is emitted as a **JSON string** so JS Number
@@ -5676,62 +5031,6 @@ interface PayrollRunRequest {
5676
5031
  type ComputePayrollRequest = Omit<PayrollRunRequest, "cycle_id">;
5677
5032
  /** Default for `individual_disbursement_threshold_cents` — SGD 15,000. */
5678
5033
  declare const DEFAULT_INDIVIDUAL_THRESHOLD_CENTS = 1500000n;
5679
- declare function b64uEncode(input: Uint8Array): string;
5680
- /**
5681
- * Encode raw bytes to base64url-no-pad (RFC 4648 §5 with padding dropped).
5682
- * The encoding the wire uses for binary fields.
5683
- */
5684
- declare function b64uEncodeBytes(input: Uint8Array): string;
5685
- /**
5686
- * Decode a base64url-no-pad string. Strict — rejects standard-alphabet
5687
- * `+` / `/` and any padding `=`.
5688
- */
5689
- declare function b64uDecodeStrict(input: string): Uint8Array;
5690
- /** @internal — preserved alias for in-tree callers. Prefer
5691
- * {@link b64uEncodeBytes} / {@link b64uDecodeStrict}. */
5692
- declare const _b64uEncode: typeof b64uEncode;
5693
- /** Build a `did:t3n:<40-hex>` from raw 20 bytes. */
5694
- declare function compactDidFromBytes(bytes: Uint8Array): string;
5695
-
5696
- /** Closed-vocabulary serialisation annotations for a contract function's body. */
5697
- interface WireBlock {
5698
- /**
5699
- * Field paths whose values are emitted as decimal strings. A path ending in
5700
- * `.*` applies to every value of the named object/array (e.g.
5701
- * `historical_baselines.*`).
5702
- */
5703
- u64_as_string?: string[];
5704
- /**
5705
- * Byte fields carried as typed strings. The value is passed through when it
5706
- * is already a string; a byte input (`Uint8Array` or a `number[]` of octets)
5707
- * is encoded per its kind.
5708
- */
5709
- string_encoded?: Record<string, StringEncoding>;
5710
- }
5711
- /** The closed set of `string_encoded` field kinds. */
5712
- type StringEncoding = "did" | "address" | "hash";
5713
- /**
5714
- * Raised when a `wire` block asks for a projection the closed vocabulary cannot
5715
- * express — an unrepresentable value for a declared field. It signals a
5716
- * descriptor↔contract mismatch on the author's side, so callers surface it as a
5717
- * terminal `unsupported_wire_encoding` rather than retrying.
5718
- */
5719
- declare class WireEncodingError extends T3nError {
5720
- readonly field: string;
5721
- readonly encoding?: StringEncoding | undefined;
5722
- constructor(message: string, field: string, encoding?: StringEncoding | undefined);
5723
- }
5724
- type JsonRecord = Record<string, unknown>;
5725
- /**
5726
- * Project `args` into the plain-args body a z-space contract deserialises,
5727
- * applying the descriptor's `wire` annotations. Returns a new object; `args` is
5728
- * never mutated. With no `wire` block the body is returned unchanged (the
5729
- * JSON-plain path).
5730
- *
5731
- * @throws {WireEncodingError} when a declared field holds a value the
5732
- * vocabulary cannot express.
5733
- */
5734
- declare function requestToWire(args: JsonRecord, wire?: WireBlock): JsonRecord;
5735
5034
 
5736
5035
  /**
5737
5036
  * SessionUsageReportClient — typed wrapper over the authenticated
@@ -5947,16 +5246,6 @@ declare function isObject(value: unknown): value is Record<string, unknown>;
5947
5246
  */
5948
5247
  declare function assertShape<T>(value: unknown, guard: (v: unknown) => v is T, where: string): T;
5949
5248
 
5950
- type Environment = "sandbox" | "testnet" | "production";
5951
- declare const NODE_URLS: Record<Environment, string>;
5952
- /**
5953
- * Default environment for the public (@terminal3/t3n-sdk) artifact. External
5954
- * consumers default to testnet (not production) — a safer default that the
5955
- * interactive write-confirm and the SDK both honor. The wide/internal build
5956
- * exports its own DEFAULT_ENVIRONMENT; the public rollup alias swaps this in.
5957
- */
5958
- declare const DEFAULT_ENVIRONMENT: Environment;
5959
-
5960
5249
  /**
5961
5250
  * Configuration types for T3n SDK
5962
5251
  */
@@ -6840,5 +6129,5 @@ declare function tenantDidHex(tenantDid: string): string;
6840
6129
  declare function validateTail(tail: string): string;
6841
6130
  declare function canonicalTenantName(tenantDid: string, tail: string): string;
6842
6131
 
6843
- 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, detectQuoteVendor, discoverCheckDelegation, discoverDescribeContract, discoverDescribeFunction, discoverListContracts, discoverWhoami, eth_get_address, extractWasmError, fanOutGrant, fetchDkgAttestation, fetchMlKemPublicKey, fetchSevSnpCollateral, fetchTrustedManifest, formatTokens, generateRandomString, generateUUID, getContractVersion, getEnvironment, getEnvironmentName, getGlobalLogLevel, getLogger, getNodeUrl, invoke, isAgentCardResponse, isAgentEgressGetResponse, isContractAgentCountsResponse, 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, readOnlyScopes, redactSecrets, redactSecretsFromJson, requestToWire, resolveTrustAnchor, setEnvironment, setGlobalLogLevel, setNodeUrl, sevSnpVcekUrl, stringToBytes, tenantDidHex, toBaseUnits, validateConfig, validateTail, verifyDkgAttestation, verifyManifestSignature, verifySevSnpReport, verifyTdxQuote };
6844
- export type { ActivityCallerType, ActivityEntry, ActivityExportFile, ActivityExportStatus, ActivityOutcome, ActivityReport, AdminActionAuth, AdmitForOrgOptions, AgentCardRefInput, AgentCardResponse, AgentCardSetInput, AgentEgressEntry, AgentEgressGetResponse, AgentEgressRefInput, AgentSummary, AssignRolesInput, AuthInput, AuthoriseOAuthConnectionParams, BalanceRow, BoundGrant, ChargeReason, ClientAuth, ClientHandshake, ComputePayrollRequest, ConfigValidationResult, ContractAgentCountsInput, ContractAgentCountsResponse, ContractDescriptorDocument, ContractDescriptorFacets, ContractExecuteInput, ContractKind, ContractLifecycleStatus, ContractListDetailedOptions, ContractListDetailedPage, ContractPublishInput, ContractRegisterResult, ContractResponseSchema, ContractSetDescriptorInput, ContractUnsetDescriptorInput, ContractUnsetDescriptorResult, CreateDelegatedAgentParams, CreateHarnessAgentParams, CreatePolicyInput, CreateT3nAgentParams, DataGetInput, DataGetResponse, DataListInput, DataListResponse, DelegatedAgent, DelegatedAgentKind, DelegationGrantKind, DelegationGrantRef, DeleteDataInput, DeleteScopeInput, DescribeContractParams, DescribeContractResult, DescribeFunctionParams, DescribeFunctionResult, DescribeOAuthClientParams, DetailedContract, Did, DidKind, Direction, DiscoverOptions, DkgAttestation, DkgVerifyResult, DrainContractAgentCountsInput, EmailOtpAuthInput, EmailOtpCredentials, Environment, EthAuthInput, ExecuteBusinessContractOptions, ExecuteOrgDataActionOptions, ExportActivityLogOptions, 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, ListedDelegatedAgent, Logger, MapCreateInput, MapLifecycleStatus, MapResponse, MapUpdateInput, MapVisibility, MemberDelegationDoc, MemberRole, MutationResponse, OAuthAuthorisation, OAuthClientDescription, OAuthClientKind, OAuthConnection, OAuthConnectionState, OAuthRedirectClass, OidcAuthInput, OidcCredentials, OrgAdminStatus, OrgContractDelegation, OrgDataActionWire, OrgDataClientOptions, OrgDelegationAddGrantsInput, OrgDelegationDeleteInput, OrgDelegationGetInput, OrgDelegationRemoveGrantsInput, OrgDelegationSetInput, OrgPolicyMeta, OrgPolicyView, OrgRemoveGrantTarget, OrgRemoveMemberDelegationInput, OrgUsageReport, OrgUsageReportInput, OrgWriters, OtpChannel, OtpMergeSuggestion, OtpRequestInput, OtpRequestResult, OtpVerifyInput, OtpVerifyResult, PayrollRunRequest, PeerQuoteResult, PolicyGetInput, PurgeOrgInput, QuoteVerifyResult, ReaderSet, RemoveTarget, RoleAssignments, RoleAssignmentsResponse, RoleDefinition, RoleGetResponse, RoleGrant, RoleIdInput, ScopeAccessVerb, SdkConfig, SecretKind, SecretListInput, SecretListResponse, SecretNameInput, SecretRecord, SecretSetValueInput, SecretView, SecretWriteInput, SessionCrypto, SessionId, SetAgentEgressInput, SetDefaultQuotasOptions, SetRoleInput, SetWritersInput, SevSnpCollateral, SevSnpVerifyResult, SignedTrustManifest, StatelessCredential, StringEncoding, SubmitUserInputArgs, SubmitUserInputResult, T3nClientConfig, TenantAdmitProjection, TenantAdmitStatus, TenantBaseClient, TenantClientConfig, TenantContractExecuteInput, TenantContractPublishInput, TenantContractSetDescriptorInput, TenantContractUnsetDescriptorInput, TenantExecutionSession, TenantMapCreateInput, TenantMapUpdatePatch, TenantMeResponse, TenantSdkEnvironment, TenantSelfAdmitResult, TenantStatus, TenantTargetOptions, TokenTxKind, Transport, TrustAnchor, TrustAnchorOrUnsafe, TrustAnchorSource, TrustManifestPayload, UnassignRolesInput, UnsafeTrustServer, UpdateMetaInput, UpdateQuotasOptions, UsageEntry, UsagePage, UsageReportSignature, UserInputProfile, UserUpsertErrorKind, Validity, VcekUrlResult, WasmComponent, WasmNextResult, WhoamiResult, WireBlock, WireScope, WorkloadAuthInput, WriteDataInput, WriterSet, WritersGetInput };
6132
+ export { AGENT_CARDS_SCOPE, AuthMethod, DEFAULT_INDIVIDUAL_THRESHOLD_CENTS, DEFAULT_KYC_POLL_CADENCE, HttpTransport, KycStatusTimeoutError, LogLevel, MockTransport, OrgDataClient, SessionOrgDataClient, SessionStatus, SessionUsageReportClient, T3nClient, TERMINAL_KYC_STATUSES, TenantClient, TenantContractsNamespace, TenantMapsNamespace, TenantNamespace, TenantSdkValidationError, TenantTokenNamespace, UnsupportedTenantSdkOperationError, UserUpsertError, Z_PAYROLL_AUDIT_READ_FUNCTIONS, Z_PAYROLL_RUN_FUNCTIONS, assertShape, buildSecretWriteArgs, bytesToString, canonicalTenantName, clearKeyCache, clearManifestVersionFloor, createDefaultHandlers, createEmailOtpAuthInput, createEthAuthInput, createLogger, createMlKemPublicKeyHandler, createOidcAuthInput, createOrgDataClientFromSession, createRandomHandler, createUsageReportClientFromSession, createWorkloadAuthInput, deriveAgentCardEntryId, detectQuoteVendor, eth_get_address, fanOutGrant, fetchDkgAttestation, fetchMlKemPublicKey, fetchSevSnpCollateral, fetchTrustedManifest, generateRandomString, generateUUID, getContractVersion, getEnvironment, getEnvironmentName, getGlobalLogLevel, getLogger, getNodeUrl, isAgentCardResponse, isAgentEgressGetResponse, isContractAgentCountsResponse, 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, parseMemberDelegationDoc, readOnlyScopes, redactSecrets, redactSecretsFromJson, resolveTrustAnchor, setEnvironment, setGlobalLogLevel, setNodeUrl, sevSnpVcekUrl, stringToBytes, tenantDidHex, validateConfig, validateTail, verifyDkgAttestation, verifyManifestSignature, verifySevSnpReport, verifyTdxQuote };
6133
+ export type { ActivityCallerType, ActivityEntry, ActivityExportFile, ActivityExportStatus, ActivityOutcome, ActivityReport, AdminActionAuth, AdmitForOrgOptions, AgentCardRefInput, AgentCardResponse, AgentCardSetInput, AgentEgressEntry, AgentEgressGetResponse, AgentEgressRefInput, AgentSummary, AssignRolesInput, AuthInput, AuthoriseOAuthConnectionParams, BalanceRow, BoundGrant, ChargeReason, ClientAuth, ClientHandshake, ComputePayrollRequest, ConfigValidationResult, ContractAgentCountsInput, ContractAgentCountsResponse, ContractDescriptorFacets, ContractExecuteInput, ContractLifecycleStatus, ContractListDetailedOptions, ContractListDetailedPage, ContractPublishInput, ContractRegisterResult, ContractSetDescriptorInput, ContractUnsetDescriptorInput, ContractUnsetDescriptorResult, CreateDelegatedAgentParams, CreateHarnessAgentParams, CreatePolicyInput, CreateT3nAgentParams, DataGetInput, DataGetResponse, DataListInput, DataListResponse, DelegatedAgent, DelegatedAgentKind, DeleteDataInput, DeleteScopeInput, DescribeOAuthClientParams, DetailedContract, Did, DidKind, Direction, DkgAttestation, DkgVerifyResult, DrainContractAgentCountsInput, EmailOtpAuthInput, EmailOtpCredentials, EthAuthInput, ExecuteBusinessContractOptions, ExecuteOrgDataActionOptions, ExportActivityLogOptions, FetchTrustedManifestOptions, GetActivityLogOptions, GetUsageOptions, GranteeInput, GrantsMergeResult, GuestToHostHandler, GuestToHostHandlers, HandshakeResult, HumanMember, JsonRpcRequest, JsonRpcResponse, KycPollCadence, KycPollOptions, KycStatus, KycStatusKind, ListAgentsInput, ListAgentsResponse, ListHumanMembersInput, ListHumanMembersResponse, ListedDelegatedAgent, Logger, MapCreateInput, MapLifecycleStatus, MapResponse, MapUpdateInput, MapVisibility, MemberDelegationDoc, MemberRole, MutationResponse, OAuthAuthorisation, OAuthClientDescription, OAuthClientKind, OAuthConnection, OAuthConnectionState, OAuthRedirectClass, OidcAuthInput, OidcCredentials, OrgAdminStatus, OrgContractDelegation, OrgDataActionWire, OrgDataClientOptions, OrgDelegationAddGrantsInput, OrgDelegationDeleteInput, OrgDelegationGetInput, OrgDelegationRemoveGrantsInput, OrgDelegationSetInput, OrgPolicyMeta, OrgPolicyView, OrgRemoveGrantTarget, OrgRemoveMemberDelegationInput, OrgUsageReport, OrgUsageReportInput, OrgWriters, OtpChannel, OtpMergeSuggestion, OtpRequestInput, OtpRequestResult, OtpVerifyInput, OtpVerifyResult, PayrollRunRequest, PeerQuoteResult, PolicyGetInput, PurgeOrgInput, QuoteVerifyResult, ReaderSet, RemoveTarget, RoleAssignments, RoleAssignmentsResponse, RoleDefinition, RoleGetResponse, RoleGrant, RoleIdInput, ScopeAccessVerb, SdkConfig, SecretKind, SecretListInput, SecretListResponse, SecretNameInput, SecretRecord, SecretSetValueInput, SecretView, SecretWriteInput, SessionCrypto, SessionId, SetAgentEgressInput, SetDefaultQuotasOptions, SetRoleInput, SetWritersInput, SevSnpCollateral, SevSnpVerifyResult, SignedTrustManifest, SubmitUserInputArgs, SubmitUserInputResult, T3nClientConfig, TenantAdmitProjection, TenantAdmitStatus, TenantBaseClient, TenantClientConfig, TenantContractExecuteInput, TenantContractPublishInput, TenantContractSetDescriptorInput, TenantContractUnsetDescriptorInput, TenantExecutionSession, TenantMapCreateInput, TenantMapUpdatePatch, TenantMeResponse, TenantSdkEnvironment, TenantSelfAdmitResult, TenantStatus, TenantTargetOptions, TokenTxKind, Transport, TrustAnchor, TrustAnchorOrUnsafe, TrustAnchorSource, TrustManifestPayload, UnassignRolesInput, UnsafeTrustServer, UpdateMetaInput, UpdateQuotasOptions, UsageEntry, UsagePage, UsageReportSignature, UserInputProfile, UserUpsertErrorKind, Validity, VcekUrlResult, WasmComponent, WasmNextResult, WireScope, WorkloadAuthInput, WriteDataInput, WriterSet, WritersGetInput };