@terminal3/t3n-sdk 5.25.0 → 5.26.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 +248 -57
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1122,6 +1122,140 @@ declare class ContractResponseError extends T3nError {
|
|
|
1122
1122
|
*/
|
|
1123
1123
|
declare function parseContractResponse<T = unknown>(raw: string, schema?: ContractResponseSchema<T>): T;
|
|
1124
1124
|
|
|
1125
|
+
/**
|
|
1126
|
+
* Delegated agents and the T3N OAuth connections that act as them. Wire types
|
|
1127
|
+
* and strict decoders for the `tee:organisation` functions the `T3nClient`
|
|
1128
|
+
* wrappers dispatch.
|
|
1129
|
+
*/
|
|
1130
|
+
|
|
1131
|
+
/**
|
|
1132
|
+
* Create a harness agent: one the customer's IdP authenticates. The contract
|
|
1133
|
+
* verifies `harnessIdToken` against `provider` and keys the agent on
|
|
1134
|
+
* `(iss, user_id, clientId)`.
|
|
1135
|
+
*/
|
|
1136
|
+
interface CreateHarnessAgentParams {
|
|
1137
|
+
/**
|
|
1138
|
+
* Label of the node's configured OIDC provider (`Configs[provider:oidc]`)
|
|
1139
|
+
* the token is verified against. Its configured `client_id` is the audience,
|
|
1140
|
+
* so it must be the harness's client.
|
|
1141
|
+
*/
|
|
1142
|
+
provider: string;
|
|
1143
|
+
/** The caller's own ID token, issued by `provider` to the harness's client. */
|
|
1144
|
+
harnessIdToken: string;
|
|
1145
|
+
/** OAuth client the agent will authenticate as: the `azp` its tokens carry. */
|
|
1146
|
+
clientId: string;
|
|
1147
|
+
/** Display name, e.g. "Maria's Claude Agent". */
|
|
1148
|
+
name: string;
|
|
1149
|
+
}
|
|
1150
|
+
/**
|
|
1151
|
+
* Create a T3N agent: one a person picks for an MCP connection through the
|
|
1152
|
+
* T3N authorization server. The caller's session is the proof of identity, so
|
|
1153
|
+
* there is no token, and the session must be a person acting for themselves.
|
|
1154
|
+
*/
|
|
1155
|
+
interface CreateT3nAgentParams {
|
|
1156
|
+
/** Label of the node's T3N provider row, the one whose keys the enclave holds. */
|
|
1157
|
+
provider: string;
|
|
1158
|
+
name: string;
|
|
1159
|
+
harnessIdToken?: never;
|
|
1160
|
+
clientId?: never;
|
|
1161
|
+
}
|
|
1162
|
+
/** Input to `T3nClient.createDelegatedAgent`. The provider row picks the arm. */
|
|
1163
|
+
type CreateDelegatedAgentParams = CreateHarnessAgentParams | CreateT3nAgentParams;
|
|
1164
|
+
/** A delegated per-user agent, as `create-delegated-agent` reports it. */
|
|
1165
|
+
interface DelegatedAgent {
|
|
1166
|
+
agentDid: Did;
|
|
1167
|
+
ownerDid: Did;
|
|
1168
|
+
/** The name as stored, which the contract may have truncated. */
|
|
1169
|
+
name: string;
|
|
1170
|
+
}
|
|
1171
|
+
/**
|
|
1172
|
+
* `t3n` agents are pickable for an MCP connection; `harness` agents belong to
|
|
1173
|
+
* a customer IdP's client and are not.
|
|
1174
|
+
*/
|
|
1175
|
+
type DelegatedAgentKind = "t3n" | "harness";
|
|
1176
|
+
/** One of the caller's delegated agents, from `list-delegated-agents`. */
|
|
1177
|
+
interface ListedDelegatedAgent {
|
|
1178
|
+
agentDid: Did;
|
|
1179
|
+
name: string;
|
|
1180
|
+
createdSecs: number;
|
|
1181
|
+
revokedAtSecs?: number;
|
|
1182
|
+
kind: DelegatedAgentKind;
|
|
1183
|
+
/** The harness's OAuth client, for a `harness` agent only. */
|
|
1184
|
+
harnessClientId?: string;
|
|
1185
|
+
}
|
|
1186
|
+
/** Input to `T3nClient.describeOAuthClient`: the OAuth request's own fields. */
|
|
1187
|
+
interface DescribeOAuthClientParams {
|
|
1188
|
+
clientId: string;
|
|
1189
|
+
redirectUri: string;
|
|
1190
|
+
}
|
|
1191
|
+
/** How the client is identified: a fetched metadata document, a DCR id, or an operator row. */
|
|
1192
|
+
type OAuthClientKind = "cimd" | "dcr" | "registered";
|
|
1193
|
+
/** RFC 8252 class of the redirect URI, which sets the consent wording. */
|
|
1194
|
+
type OAuthRedirectClass = "loopback" | "private_scheme" | "https";
|
|
1195
|
+
/** What the consent page shows about a client, from `oauth-describe-client`. */
|
|
1196
|
+
interface OAuthClientDescription {
|
|
1197
|
+
clientId: string;
|
|
1198
|
+
kind: OAuthClientKind;
|
|
1199
|
+
/**
|
|
1200
|
+
* The `client_id` host for CIMD, the redirect origin or scheme for DCR, the
|
|
1201
|
+
* operator's display name for a registered client.
|
|
1202
|
+
*/
|
|
1203
|
+
identity: string;
|
|
1204
|
+
/** Self-asserted by the client, so shown quoted and never trusted. */
|
|
1205
|
+
clientName?: string;
|
|
1206
|
+
redirectClass: OAuthRedirectClass;
|
|
1207
|
+
redirectDisplay: string;
|
|
1208
|
+
/**
|
|
1209
|
+
* The authorization server's issuer, byte-exact: the RFC 9207 `iss` to put on
|
|
1210
|
+
* every redirect back to the client, Deny and error redirects included.
|
|
1211
|
+
*/
|
|
1212
|
+
iss: string;
|
|
1213
|
+
/** Present only when the operator's `verified_clients` matches. Display only. */
|
|
1214
|
+
verified?: {
|
|
1215
|
+
displayName: string;
|
|
1216
|
+
};
|
|
1217
|
+
}
|
|
1218
|
+
/** Input to `T3nClient.authoriseOAuthConnection`. */
|
|
1219
|
+
interface AuthoriseOAuthConnectionParams {
|
|
1220
|
+
/** One of the caller's own, unrevoked T3N agents. */
|
|
1221
|
+
agentDid: string;
|
|
1222
|
+
clientId: string;
|
|
1223
|
+
redirectUri: string;
|
|
1224
|
+
/** Required unless the operator registered the client with `pkce: "if_sent"`. */
|
|
1225
|
+
codeChallenge?: string;
|
|
1226
|
+
/** Must be `S256` when a challenge is sent. */
|
|
1227
|
+
codeChallengeMethod?: string;
|
|
1228
|
+
/** Omitted means the one MCP resource this authorization server serves. */
|
|
1229
|
+
resource?: string;
|
|
1230
|
+
/** Space-separated; unknown scopes and `offline_access` are dropped, not refused. */
|
|
1231
|
+
scope?: string;
|
|
1232
|
+
}
|
|
1233
|
+
/**
|
|
1234
|
+
* The one-time code to hand back to the client. The caller redirects to
|
|
1235
|
+
* `redirectUri` with `code`, the client's `state` and `iss`.
|
|
1236
|
+
*/
|
|
1237
|
+
interface OAuthAuthorisation {
|
|
1238
|
+
code: string;
|
|
1239
|
+
redirectUri: string;
|
|
1240
|
+
/** The authorization server's issuer, sent as the RFC 9207 `iss` parameter. */
|
|
1241
|
+
iss: string;
|
|
1242
|
+
}
|
|
1243
|
+
/** `expired` is a pending or active connection that time has ended, not yet swept. */
|
|
1244
|
+
type OAuthConnectionState = "pending" | "active" | "expired" | "revoked";
|
|
1245
|
+
/** One of the caller's OAuth connections, from `list-oauth-connections`. */
|
|
1246
|
+
interface OAuthConnection {
|
|
1247
|
+
connectionId: string;
|
|
1248
|
+
agentDid: Did;
|
|
1249
|
+
agentName: string;
|
|
1250
|
+
clientId: string;
|
|
1251
|
+
/** The same identity the consent page showed for the client. */
|
|
1252
|
+
clientDisplayHost: string;
|
|
1253
|
+
createdSecs: number;
|
|
1254
|
+
refreshedSecs?: number;
|
|
1255
|
+
state: OAuthConnectionState;
|
|
1256
|
+
revokedAtSecs?: number;
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1125
1259
|
/**
|
|
1126
1260
|
* Org-data wire types mirroring the org-data contract wire shapes.
|
|
1127
1261
|
*
|
|
@@ -2841,28 +2975,6 @@ interface DescribeFunctionResult {
|
|
|
2841
2975
|
* All cryptographic complexity is handled in WASM components.
|
|
2842
2976
|
*/
|
|
2843
2977
|
|
|
2844
|
-
/** Input to {@link T3nClient.createDelegatedAgent}. */
|
|
2845
|
-
interface CreateDelegatedAgentParams {
|
|
2846
|
-
/**
|
|
2847
|
-
* Label of the node's configured OIDC provider (`Configs[provider:oidc]`)
|
|
2848
|
-
* the token is verified against. Its configured `client_id` is the audience,
|
|
2849
|
-
* so it must be the harness's client.
|
|
2850
|
-
*/
|
|
2851
|
-
provider: string;
|
|
2852
|
-
/** The caller's own ID token, issued by `provider` to the harness's client. */
|
|
2853
|
-
harnessIdToken: string;
|
|
2854
|
-
/** OAuth client the agent will authenticate as: the `azp` its tokens carry. */
|
|
2855
|
-
clientId: string;
|
|
2856
|
-
/** Display name, e.g. "Maria's Claude Agent". */
|
|
2857
|
-
name: string;
|
|
2858
|
-
}
|
|
2859
|
-
/** A delegated per-user agent, as `create-delegated-agent` reports it. */
|
|
2860
|
-
interface DelegatedAgent {
|
|
2861
|
-
agentDid: Did;
|
|
2862
|
-
ownerDid: Did;
|
|
2863
|
-
/** The name as stored, which the contract may have truncated. */
|
|
2864
|
-
name: string;
|
|
2865
|
-
}
|
|
2866
2978
|
declare class T3nClient {
|
|
2867
2979
|
private readonly config;
|
|
2868
2980
|
private readonly transport;
|
|
@@ -3333,24 +3445,44 @@ declare class T3nClient {
|
|
|
3333
3445
|
privateCardDeleted: boolean;
|
|
3334
3446
|
}>;
|
|
3335
3447
|
/**
|
|
3336
|
-
* Create the caller's own delegated agent
|
|
3448
|
+
* Create the caller's own delegated agent.
|
|
3337
3449
|
*
|
|
3338
3450
|
* Dispatches `create-delegated-agent` on `tee:organisation/contracts`. The
|
|
3339
|
-
*
|
|
3340
|
-
* its identity to belong to the session's DID, and keys the agent on
|
|
3341
|
-
* `(iss, user_id, clientId)`. So the session must be the person's own human
|
|
3342
|
-
* DID, signed in through an OIDC provider, not an agent's or a stray key's.
|
|
3451
|
+
* provider row that `params.provider` names picks the arm:
|
|
3343
3452
|
*
|
|
3344
|
-
*
|
|
3345
|
-
*
|
|
3453
|
+
* - **Harness agent** (`harnessIdToken` and `clientId` set): the contract
|
|
3454
|
+
* verifies the token in-enclave against `provider`, requires its identity
|
|
3455
|
+
* to belong to the session's DID, and keys the agent on
|
|
3456
|
+
* `(iss, user_id, clientId)`.
|
|
3457
|
+
* - **T3N agent** (neither set, `provider` names the T3N row): the session is
|
|
3458
|
+
* the proof of identity, and the person can pick the agent for an MCP
|
|
3459
|
+
* connection.
|
|
3460
|
+
*
|
|
3461
|
+
* Either way the session must be the person's own human DID, acting for
|
|
3462
|
+
* themselves. The contract refuses the harness fields on the T3N row, and
|
|
3463
|
+
* their absence on a harness row.
|
|
3346
3464
|
*
|
|
3347
3465
|
* @throws {RpcError} when the contract refuses (token verification, a token
|
|
3348
|
-
* belonging to another DID,
|
|
3466
|
+
* belonging to another DID, a caller that is not a person, the per-owner cap)
|
|
3349
3467
|
* @throws {ContractResponseError} when the response does not name the agent
|
|
3468
|
+
* @throws {Error} before dispatch when only one of `harnessIdToken` and
|
|
3469
|
+
* `clientId` is set
|
|
3350
3470
|
*/
|
|
3351
3471
|
createDelegatedAgent(params: CreateDelegatedAgentParams): Promise<DelegatedAgent>;
|
|
3352
3472
|
/**
|
|
3353
|
-
*
|
|
3473
|
+
* The caller's own delegated agents, T3N and harness, revoked ones included.
|
|
3474
|
+
*
|
|
3475
|
+
* Dispatches `list-delegated-agents` on `tee:organisation/contracts`. Self
|
|
3476
|
+
* only: an agent acting for its owner is refused. A harness agent's IdP user
|
|
3477
|
+
* id is never returned.
|
|
3478
|
+
*
|
|
3479
|
+
* @throws {RpcError} when the contract refuses
|
|
3480
|
+
* @throws {ContractResponseError} when the response does not match its shape
|
|
3481
|
+
*/
|
|
3482
|
+
listDelegatedAgents(): Promise<ListedDelegatedAgent[]>;
|
|
3483
|
+
/**
|
|
3484
|
+
* Stop one of the caller's own delegated agents authenticating, T3N or
|
|
3485
|
+
* harness. A T3N agent's OAuth connections are refused from their next call.
|
|
3354
3486
|
*
|
|
3355
3487
|
* Dispatches `revoke-delegated-agent` on `tee:organisation/contracts`.
|
|
3356
3488
|
* Revocation marks the agent's record; its DID and registry record remain.
|
|
@@ -3362,6 +3494,58 @@ declare class T3nClient {
|
|
|
3362
3494
|
revokeDelegatedAgent(agentDid: string): Promise<{
|
|
3363
3495
|
agentDid: Did;
|
|
3364
3496
|
}>;
|
|
3497
|
+
/**
|
|
3498
|
+
* What the consent page shows about an OAuth client, before any
|
|
3499
|
+
* authorisation. Read only.
|
|
3500
|
+
*
|
|
3501
|
+
* Dispatches `oauth-describe-client` on `tee:organisation/contracts`. The
|
|
3502
|
+
* enclave fetches a CIMD client's metadata document itself and checks
|
|
3503
|
+
* `redirectUri` against the client's registration and the operator's
|
|
3504
|
+
* policy. On a refusal the page shows the error and does not redirect.
|
|
3505
|
+
*
|
|
3506
|
+
* @throws {RpcError} on an invalid client or redirect URI, carrying the
|
|
3507
|
+
* contract's typed code (`invalid_client_id`, `redirect_uri_not_registered`, …)
|
|
3508
|
+
* @throws {ContractResponseError} when the response does not match its shape
|
|
3509
|
+
*/
|
|
3510
|
+
describeOAuthClient(params: DescribeOAuthClientParams): Promise<OAuthClientDescription>;
|
|
3511
|
+
/**
|
|
3512
|
+
* Let an OAuth client act as one of the caller's own T3N agents, and get the
|
|
3513
|
+
* one-time code to send back to it.
|
|
3514
|
+
*
|
|
3515
|
+
* Dispatches `oauth-authorise` on `tee:organisation/contracts`. The session
|
|
3516
|
+
* must be a person acting for themselves. The code is bound to the client,
|
|
3517
|
+
* the redirect URI, the resource and the PKCE challenge; the client redeems
|
|
3518
|
+
* it at the node's token endpoint.
|
|
3519
|
+
*
|
|
3520
|
+
* @throws {RpcError} when the contract refuses (client or redirect checks,
|
|
3521
|
+
* PKCE, resource, an agent the caller does not own or has revoked, the
|
|
3522
|
+
* per-person connection cap)
|
|
3523
|
+
* @throws {ContractResponseError} when the response does not match its shape
|
|
3524
|
+
*/
|
|
3525
|
+
authoriseOAuthConnection(params: AuthoriseOAuthConnectionParams): Promise<OAuthAuthorisation>;
|
|
3526
|
+
/**
|
|
3527
|
+
* The caller's own OAuth connections, including revoked and expired ones
|
|
3528
|
+
* not yet swept. Self only.
|
|
3529
|
+
*
|
|
3530
|
+
* Dispatches `list-oauth-connections` on `tee:organisation/contracts`.
|
|
3531
|
+
*
|
|
3532
|
+
* @throws {RpcError} when the contract refuses
|
|
3533
|
+
* @throws {ContractResponseError} when the response does not match its shape
|
|
3534
|
+
*/
|
|
3535
|
+
listOAuthConnections(): Promise<OAuthConnection[]>;
|
|
3536
|
+
/**
|
|
3537
|
+
* Revoke one of the caller's own OAuth connections. Its refresh token stops
|
|
3538
|
+
* working at once; an access token already issued runs to its expiry. The
|
|
3539
|
+
* agent is untouched. Idempotent.
|
|
3540
|
+
*
|
|
3541
|
+
* Dispatches `revoke-oauth-connection` on `tee:organisation/contracts`.
|
|
3542
|
+
*
|
|
3543
|
+
* @throws {RpcError} when the caller owns no connection with that id
|
|
3544
|
+
* @throws {ContractResponseError} when the response does not name the connection
|
|
3545
|
+
*/
|
|
3546
|
+
revokeOAuthConnection(connectionId: string): Promise<{
|
|
3547
|
+
connectionId: string;
|
|
3548
|
+
}>;
|
|
3365
3549
|
/**
|
|
3366
3550
|
* Provision a fresh org-owned agent.
|
|
3367
3551
|
*
|
|
@@ -3498,8 +3682,6 @@ declare class T3nClient {
|
|
|
3498
3682
|
* `did:t3n:<40 hex>` or bare 40 hex.
|
|
3499
3683
|
*/
|
|
3500
3684
|
private static didToWire;
|
|
3501
|
-
/** Read a DID field (`did:t3n:<40 hex>` or bare hex) from a contract response. */
|
|
3502
|
-
private static didFromResponse;
|
|
3503
3685
|
/**
|
|
3504
3686
|
* Resolve the deployed version of `contractId`, refusing before any dispatch
|
|
3505
3687
|
* when it is older than the caller needs, with a message naming the version the
|
|
@@ -4314,11 +4496,13 @@ declare function createRandomHandler(): GuestToHostHandler;
|
|
|
4314
4496
|
declare function createDefaultHandlers(baseUrl: string, trustAnchor: TrustAnchorOrUnsafe): GuestToHostHandlers;
|
|
4315
4497
|
|
|
4316
4498
|
/**
|
|
4317
|
-
* Stateless
|
|
4499
|
+
* Stateless agent auth: an API key or an OAuth bearer.
|
|
4318
4500
|
*
|
|
4319
4501
|
* `invoke` posts once to `POST /api/invoke` — an HTTPS-only
|
|
4320
|
-
* endpoint (see the HTTPS-guard note below) that authenticates an
|
|
4321
|
-
*
|
|
4502
|
+
* endpoint (see the HTTPS-guard note below) that authenticates an agent by
|
|
4503
|
+
* one {@link StatelessCredential}: an org agent's opaque API key
|
|
4504
|
+
* (`X-T3N-Api-Key: t3n_key_<...>`) or a delegated agent's OAuth access token
|
|
4505
|
+
* (`Authorization: Bearer <token>`), and executes a
|
|
4322
4506
|
* `z:` contract as that agent in the SAME request. Unlike
|
|
4323
4507
|
* {@link T3nClient.execute}, there is **no** ML-KEM handshake, **no**
|
|
4324
4508
|
* `Session-Id`, and **no** session state: the node derives the acting agent
|
|
@@ -4390,26 +4574,38 @@ interface InvokeRequest {
|
|
|
4390
4574
|
pii_did?: string;
|
|
4391
4575
|
input?: unknown;
|
|
4392
4576
|
}
|
|
4577
|
+
/**
|
|
4578
|
+
* The credential `/api/invoke` and `/api/discover` resolve, exactly one of:
|
|
4579
|
+
*
|
|
4580
|
+
* - `apiKey`: an org agent's opaque API key (`t3n_key_<...>`), sent as
|
|
4581
|
+
* `X-T3N-Api-Key`;
|
|
4582
|
+
* - `bearer`: a delegated agent's OAuth access token, sent as
|
|
4583
|
+
* `Authorization: Bearer <token>`.
|
|
4584
|
+
*
|
|
4585
|
+
* The node resolves either on the same routes (its `stateless_credential`
|
|
4586
|
+
* action tries the bearer first). Relayed verbatim, never logged and never
|
|
4587
|
+
* interpolated into any error this module throws.
|
|
4588
|
+
*/
|
|
4589
|
+
type StatelessCredential = {
|
|
4590
|
+
apiKey: string;
|
|
4591
|
+
bearer?: never;
|
|
4592
|
+
} | {
|
|
4593
|
+
bearer: string;
|
|
4594
|
+
apiKey?: never;
|
|
4595
|
+
};
|
|
4393
4596
|
/** Options for {@link invoke}. */
|
|
4394
|
-
|
|
4597
|
+
type InvokeOptions = StatelessCredential & {
|
|
4395
4598
|
/**
|
|
4396
4599
|
* RPC base URL of the T3n node, e.g. `https://node.example.com`. Must be
|
|
4397
4600
|
* `https:` unless the host is a local-dev loopback (`localhost` /
|
|
4398
4601
|
* `127.0.0.1` / `[::1]`) — see the module doc comment's HTTPS-guard note.
|
|
4399
4602
|
*/
|
|
4400
4603
|
baseUrl: string;
|
|
4401
|
-
/**
|
|
4402
|
-
* The agent's opaque API key (`t3n_key_<...>`), relayed verbatim in the
|
|
4403
|
-
* `X-T3N-Api-Key` header. Never logged and never interpolated into any
|
|
4404
|
-
* error this module throws — see the module doc comment and
|
|
4405
|
-
* {@link InvokeError}.
|
|
4406
|
-
*/
|
|
4407
|
-
apiKey: string;
|
|
4408
4604
|
/** The wire request to execute, built to the {@link InvokeRequest} shape. */
|
|
4409
4605
|
request: InvokeRequest;
|
|
4410
4606
|
/** Fetch timeout in ms. Defaults to 30s, matching {@link HttpTransport}. */
|
|
4411
4607
|
timeoutMs?: number;
|
|
4412
|
-
}
|
|
4608
|
+
};
|
|
4413
4609
|
/**
|
|
4414
4610
|
* Thrown when `POST /api/invoke` fails at the transport or HTTP
|
|
4415
4611
|
* layer (network failure, timeout, non-2xx status). Contract-level errors
|
|
@@ -4429,8 +4625,9 @@ declare class InvokeError extends T3nError {
|
|
|
4429
4625
|
constructor(message: string, status?: number | undefined);
|
|
4430
4626
|
}
|
|
4431
4627
|
/**
|
|
4432
|
-
* Execute a `z:` contract as an
|
|
4433
|
-
*
|
|
4628
|
+
* Execute a `z:` contract as an agent, authenticating with an API key or an
|
|
4629
|
+
* OAuth bearer ({@link StatelessCredential}) — one request, no handshake, no
|
|
4630
|
+
* session.
|
|
4434
4631
|
*
|
|
4435
4632
|
* @param opts - baseUrl, apiKey, and the wire request to execute
|
|
4436
4633
|
* @param schema - optional validator applied to the decoded result (e.g. a
|
|
@@ -4448,24 +4645,18 @@ declare function invoke<T = unknown>(opts: InvokeOptions, schema?: ContractRespo
|
|
|
4448
4645
|
* half of {@link InvokeOptions} (no `request`; the operation params are the
|
|
4449
4646
|
* second argument of each read). Same HTTPS + secret-hygiene rules as `invoke`.
|
|
4450
4647
|
*/
|
|
4451
|
-
|
|
4648
|
+
type DiscoverOptions = StatelessCredential & {
|
|
4452
4649
|
/**
|
|
4453
4650
|
* RPC base URL of the T3n node, e.g. `https://node.example.com`. Must be
|
|
4454
4651
|
* `https:` unless the host is a local-dev loopback — see
|
|
4455
4652
|
* {@link InvokeOptions.baseUrl}.
|
|
4456
4653
|
*/
|
|
4457
4654
|
baseUrl: string;
|
|
4458
|
-
/**
|
|
4459
|
-
* The agent's opaque API key (`t3n_key_<...>`), relayed verbatim in the
|
|
4460
|
-
* `X-T3N-Api-Key` header. Never logged and never interpolated into any
|
|
4461
|
-
* error this module throws.
|
|
4462
|
-
*/
|
|
4463
|
-
apiKey: string;
|
|
4464
4655
|
/** Fetch timeout in ms. Defaults to 30s, matching {@link invoke}. */
|
|
4465
4656
|
timeoutMs?: number;
|
|
4466
|
-
}
|
|
4657
|
+
};
|
|
4467
4658
|
/**
|
|
4468
|
-
* `whoami` — resolve the DID the relayed
|
|
4659
|
+
* `whoami` — resolve the DID the relayed credential maps to. The node never
|
|
4469
4660
|
* trusts a caller-supplied DID; this is the relay's sole DID source.
|
|
4470
4661
|
*
|
|
4471
4662
|
* @throws {InvokeError} if `baseUrl` is insecure, on a network failure/timeout,
|
|
@@ -6624,4 +6815,4 @@ declare function validateTail(tail: string): string;
|
|
|
6624
6815
|
declare function canonicalTenantName(tenantDid: string, tail: string): string;
|
|
6625
6816
|
|
|
6626
6817
|
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 };
|
|
6627
|
-
export type { ActivityCallerType, ActivityEntry, ActivityExportFile, ActivityExportStatus, ActivityOutcome, ActivityReport, AdminActionAuth, AdmitForOrgOptions, AgentCardRefInput, AgentCardResponse, AgentCardSetInput, AgentEgressEntry, AgentEgressGetResponse, AgentEgressRefInput, AgentSummary, AssignRolesInput, AuthInput, BalanceRow, BoundGrant, ChargeReason, ClientAuth, ClientHandshake, ComputePayrollRequest, ConfigValidationResult, ContractAgentCountsInput, ContractAgentCountsResponse, ContractDescriptorDocument, ContractDescriptorFacets, ContractExecuteInput, ContractKind, ContractLifecycleStatus, ContractListDetailedOptions, ContractListDetailedPage, ContractPublishInput, ContractRegisterResult, ContractResponseSchema, ContractSetDescriptorInput, ContractUnsetDescriptorInput, ContractUnsetDescriptorResult, CreateDelegatedAgentParams, CreatePolicyInput, DataGetInput, DataGetResponse, DataListInput, DataListResponse, DelegatedAgent, DelegationGrantKind, DelegationGrantRef, DeleteDataInput, DeleteScopeInput, DescribeContractParams, DescribeContractResult, DescribeFunctionParams, DescribeFunctionResult, 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, Logger, MapCreateInput, MapLifecycleStatus, MapResponse, MapUpdateInput, MapVisibility, MemberDelegationDoc, MemberRole, MutationResponse, 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, 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 };
|
|
6818
|
+
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 };
|